summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2008-12-11 14:43:04 -0200
committerPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2008-12-11 14:43:04 -0200
commit27261a950d91c352eac25a3036656c3e4f81fb12 (patch)
tree39e7a8026eefa8a562ff675691c3d3397910b723
parent1f4fb0225b278d1cf4145aebeb0bdd23dc8f62d5 (diff)
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.
-rw-r--r--hw/xfree86/loader/Makefile.am2
-rwxr-xr-xhw/xfree86/loader/sdksyms.sh12
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:]]/ {