From 27261a950d91c352eac25a3036656c3e4f81fb12 Mon Sep 17 00:00:00 2001 From: Paulo Cesar Pereira de Andrade Date: Thu, 11 Dec 2008 14:43:04 -0200 Subject: [PATCH] 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. --- hw/xfree86/loader/Makefile.am | 2 +- hw/xfree86/loader/sdksyms.sh | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/hw/xfree86/loader/Makefile.am b/hw/xfree86/loader/Makefile.am index ccf16fc79..19c7dabe3 100644 --- a/hw/xfree86/loader/Makefile.am +++ b/hw/xfree86/loader/Makefile.am @@ -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) diff --git a/hw/xfree86/loader/sdksyms.sh b/hw/xfree86/loader/sdksyms.sh index b522096a7..41a68fbaf 100755 --- a/hw/xfree86/loader/sdksyms.sh +++ b/hw/xfree86/loader/sdksyms.sh @@ -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:]]/ {