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.
This commit is contained in:
Paulo Cesar Pereira de Andrade 2008-12-11 14:43:04 -02:00
parent 1f4fb0225b
commit 27261a950d
2 changed files with 10 additions and 4 deletions

View File

@ -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)

View File

@ -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:]]/ {