Modify sdksyms.sh to receive $top_srcdir as first argument.

  If the basename of header file processed by cpp matches $top_srcdir,
check for extern symbols in the output, and add to the xorg_symbols
vector.
  Possibly a better solution then using this script would be to somehow
tell the linker to not drop any symbols from the binary being generated.
parent 1f4fb022
......@@ -24,4 +24,4 @@ libloader_la_SOURCES = \
CLEANFILES = sdksyms.c
sdksyms.c: sdksyms.sh
$(srcdir)/sdksyms.sh $(AM_CFLAGS) $(CFLAGS) $(INCLUDES)
$(srcdir)/sdksyms.sh $(top_srcdir) $(AM_CFLAGS) $(CFLAGS) $(INCLUDES)
......@@ -319,18 +319,24 @@ cat > sdksyms.c << EOF
EOF
cpp -DXorgLoader $@ sdksyms.c | awk '
topdir=$1
shift
cpp -DXorgLoader $@ sdksyms.c | awk -v topdir=$topdir '
BEGIN {
sdk = 0;
print("/*");
print(" * These symbols are referenced to ensure they");
print(" * will be available in the X Server binary.");
print(" */");
printf("/* topdir=%s */\n", topdir);
print("_X_HIDDEN void *xorg_symbols[] = {");
}
/^# [0-9]+/ {
# only process text after a include in a relative path
sdk = $3 !~ /^"\//;
# Process text after a include in a relative path or when the
# processed file has a basename matching $top_srcdir.
# Note that indexing starts at 1; 0 means no match, and there
# is a starting ".
sdk = $3 !~ /^"\// || index($3, topdir) == 2;
}
/^extern[[:space:]]/ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment