[PATCH v2 2/3] xfree86: Move sdksyms generation to ddx toplevel

Dan Nicholson dbn.lists at gmail.com
Tue Jun 14 23:02:14 PDT 2011


The symbols in sdksyms.c cover the entire source tree. In order to make
them resolve when libxorg.la goes away, move the objects from libloader
to Xorg. Unfortunately, this means sdksyms needs to get built again for
the test code.

Signed-off-by: Dan Nicholson <dbn.lists at gmail.com>
---
 hw/xfree86/.gitignore         |    2 +
 hw/xfree86/Makefile.am        |   14 ++-
 hw/xfree86/loader/.gitignore  |    3 -
 hw/xfree86/loader/Makefile.am |   14 +--
 hw/xfree86/loader/sdksyms.sh  |  425 -----------------------------------------
 hw/xfree86/sdksyms.sh         |  425 +++++++++++++++++++++++++++++++++++++++++
 test/Makefile.am              |    7 +-
 7 files changed, 445 insertions(+), 445 deletions(-)
 delete mode 100644 hw/xfree86/loader/.gitignore
 delete mode 100755 hw/xfree86/loader/sdksyms.sh
 create mode 100755 hw/xfree86/sdksyms.sh

diff --git a/hw/xfree86/.gitignore b/hw/xfree86/.gitignore
index f9b3f4a..997a94e 100644
--- a/hw/xfree86/.gitignore
+++ b/hw/xfree86/.gitignore
@@ -1,2 +1,4 @@
 Xorg
 xorg.conf.example
+sdksyms.c
+sdksyms.dep
diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am
index 697571e..6580e8d 100644
--- a/hw/xfree86/Makefile.am
+++ b/hw/xfree86/Makefile.am
@@ -38,10 +38,11 @@ DIST_SUBDIRS = common ddc i2c x86emu int10 fbdevhw os-support \
 	       utils doc man
 
 bin_PROGRAMS = Xorg
-Xorg_SOURCES =
+nodist_Xorg_SOURCES = sdksyms.c
 
 AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@
-INCLUDES = @XORG_INCS@ 
+INCLUDES = $(XORG_INCS) -I$(srcdir)/parser -I$(top_srcdir)/miext/cw \
+	-I$(srcdir)/ddc -I$(srcdir)/i2c -I$(srcdir)/modes -I$(srcdir)/ramdac
 
 noinst_LTLIBRARIES = libxorg.la
 libxorg_la_SOURCES =
@@ -111,3 +112,12 @@ xorg.conf.example: xorgconf.cpp
 
 relink:
 	$(AM_V_at)rm -f Xorg && $(MAKE) Xorg
+
+CLEANFILES = sdksyms.c sdksyms.dep
+EXTRA_DIST += sdksyms.sh
+
+sdksyms.dep sdksyms.c: sdksyms.sh
+	CPP='$(CPP)' AWK='$(AWK)' $(srcdir)/sdksyms.sh $(top_srcdir) $(CFLAGS) $(AM_CFLAGS) $(INCLUDES)
+
+SDKSYMS_DEP = sdksyms.dep
+include $(SDKSYMS_DEP)
diff --git a/hw/xfree86/loader/.gitignore b/hw/xfree86/loader/.gitignore
deleted file mode 100644
index 6b38d9e..0000000
--- a/hw/xfree86/loader/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-#		Add & Override for this directory and it's subdirectories
-sdksyms.c
-sdksyms.dep
diff --git a/hw/xfree86/loader/Makefile.am b/hw/xfree86/loader/Makefile.am
index 0e5b304..ebe0c81 100644
--- a/hw/xfree86/loader/Makefile.am
+++ b/hw/xfree86/loader/Makefile.am
@@ -9,11 +9,7 @@ AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS)
 
 EXTRA_DIST = \
 	loader.h \
-	loaderProcs.h \
-	sdksyms.sh
-
-nodist_libloader_la_SOURCES = \
-	sdksyms.c
+	loaderProcs.h
 
 libloader_la_SOURCES = \
 	loader.c \
@@ -23,11 +19,3 @@ libloader_la_SOURCES = \
 	os.c
 
 libloader_la_LIBADD = $(DLOPEN_LIBS)
-
-CLEANFILES = sdksyms.c sdksyms.dep
-
-sdksyms.dep sdksyms.c: sdksyms.sh $(top_builddir)/include/do-not-use-config.h
-	CPP='$(CPP)' AWK='$(AWK)' $(srcdir)/sdksyms.sh $(top_srcdir) $(AM_CFLAGS) $(CFLAGS) $(INCLUDES)
-
-SDKSYMS_DEP = sdksyms.dep
-include $(SDKSYMS_DEP)
diff --git a/hw/xfree86/loader/sdksyms.sh b/hw/xfree86/loader/sdksyms.sh
deleted file mode 100755
index 18bb735..0000000
--- a/hw/xfree86/loader/sdksyms.sh
+++ /dev/null
@@ -1,425 +0,0 @@
-#!/bin/sh
-
-cat > sdksyms.c << EOF
-/* This file is automatically generated by sdksyms.sh. */
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-
-/* These must be included first */
-#include "misc.h"
-#include "miscstruct.h"
-
-
-/* render/Makefile.am */
-#include "picture.h"
-#include "mipict.h"
-#include "glyphstr.h"
-#include "picturestr.h"
-
-
-/* fb/Makefile.am -- module */
-/*
-#include "fb.h"
-#include "fbrop.h"
-#include "fboverlay.h"
-#include "wfbrename.h"
-#include "fbpict.h"
- */
-
-
-/* miext/shadow/Makefile.am -- module */
-/*
-#include "shadow.h"
- */
-
-
-/* miext/damage/Makefile.am */
-#include "damage.h"
-#include "damagestr.h"
-
-/* miext/sync/Makefile.am */
-#include "misync.h"
-#include "misyncstr.h"
-
-/* Xext/Makefile.am -- half is module, half is builtin */
-/*
-#include "xvdix.h"
-#include "xvmcext.h"
- */
-#include "geext.h"
-#include "geint.h"
-#include "shmint.h"
-#include "syncsdk.h"
-#if XINERAMA
-# include "panoramiXsrv.h"
-# include "panoramiX.h"
-#endif
-
-
-/* hw/xfree86/int10/Makefile.am -- module */
-/*
-#include "xf86int10.h"
- */
-
-
-/* hw/xfree86/i2c/Makefile.am -- "mostly" modules */
-#include "xf86i2c.h"
-/*
-#include "bt829.h"
-#include "fi1236.h"
-#include "msp3430.h"
-#include "tda8425.h"
-#include "tda9850.h"
-#include "tda9885.h"
-#include "uda1380.h"
-#include "i2c_def.h"
- */
-
-
-/* hw/xfree86/modes/Makefile.am */
-#include "xf86Crtc.h"
-#include "xf86Modes.h"
-#include "xf86RandR12.h"
-/* #include "xf86Rename.h" */
-
-
-/* hw/xfree86/ddc/Makefile.am */
-#include "edid.h"
-#include "xf86DDC.h"
-
-
-/* hw/xfree86/dri2/Makefile.am -- module */
-/*
-#if DRI2
-# include "dri2.h"
-#endif
- */
-
-
-/* hw/xfree86/vgahw/Makefile.am -- module */
-/*
-#include "vgaHW.h"
- */
-
-
-/* hw/xfree86/fbdevhw/Makefile.am -- module */
-/*
-#include "fbdevhw.h"
- */
-
-
-/* hw/xfree86/common/Makefile.am */
-#include "compiler.h"
-#include "fourcc.h"
-#include "xf86.h"
-#include "xf86Module.h"
-#include "xf86Opt.h"
-#include "xf86PciInfo.h"
-#include "xf86Priv.h"
-#include "xf86Privstr.h"
-#include "xf86cmap.h"
-#include "xf86fbman.h"
-#include "xf86str.h"
-#include "xf86Xinput.h"
-#include "xf86VGAarbiter.h"
-#include "xisb.h"
-#if XV
-# include "xf86xv.h"
-# include "xf86xvmc.h"
-# include "xf86xvpriv.h"
-#endif
-/* XF86VidMode code is in libextmod module */
-/*
-#if XF86VIDMODE
-# include "vidmodeproc.h"
-#endif
- */
-#include "xorgVersion.h"
-#if defined(__sparc__) || defined(__sparc)
-# include "xf86sbusBus.h"
-#endif
-
-
-/* hw/xfree86/ramdac/Makefile.am */
-#include "BT.h"
-#include "IBM.h"
-#include "TI.h"
-#include "xf86Cursor.h"
-#include "xf86RamDac.h"
-
-
-/* hw/xfree86/shadowfb/Makefile.am -- module */
-/*
-#include "shadowfb.h"
- */
-
-
-/* hw/xfree86/os-support/solaris/Makefile.am */
-#if defined(sun386)
-# include "agpgart.h"
-#endif
-
-
-/* hw/xfree86/os-support/Makefile.am */
-#include "xf86_OSproc.h"
-#include "xf86_OSlib.h"
-
-
-/* hw/xfree86/os-support/bus/Makefile.am */
-#include "xf86Pci.h"
-#if defined(__sparc__) || defined(__sparc)
-# include "xf86Sbus.h"
-#endif
-
-
-/* hw/xfree86/xaa/Makefile.am -- module */
-/*
-#include "xaa.h"
-#include "xaalocal.h"
-#include "xaarop.h"
- */
-
-
-/* hw/xfree86/dixmods/extmod/Makefile.am -- module */
-/*
-#include "dgaproc.h"
- */
-
-
-/* hw/xfree86/parser/Makefile.am */
-#include "xf86Parser.h"
-#include "xf86Optrec.h"
-
-
-/* hw/xfree86/vbe/Makefile.am -- module */
-/*
-#include "vbe.h"
-#include "vbeModes.h"
- */
-
-
-/* hw/xfree86/dri/Makefile.am -- module */
-/*
-#if XF86DRI
-# include "dri.h"
-# include "sarea.h"
-# include "dristruct.h"
-#endif
- */
-
-
-/* mi/Makefile.am */
-#include "micmap.h"
-#include "miline.h"
-#include "mipointer.h"
-#include "mi.h"
-#include "mibstore.h"
-#include "migc.h"
-#include "mipointrst.h"
-#include "mizerarc.h"
-#include "micoord.h"
-#include "mifillarc.h"
-#include "mispans.h"
-#include "miwideline.h"
-#include "mistruct.h"
-#include "mifpoly.h"
-#include "mioverlay.h"
-
-
-/* randr/Makefile.am */
-#include "randrstr.h"
-#include "rrtransform.h"
-
-
-/* dbe/Makefile.am -- module */
-/*
-#include "dbestruct.h"
- */
-
-
-/* exa/Makefile.am -- module */
-/*
-#include "exa.h"
- */
-
-
-/* xfixes/Makefile.am */
-#include "xfixes.h"
-
-
-/* include/Makefile.am */
-#include "XIstubs.h"
-#include "Xprintf.h"
-#include "closestr.h"
-#include "closure.h"
-#include "colormap.h"
-#include "colormapst.h"
-#include "hotplug.h"
-#include "client.h"
-#include "cursor.h"
-#include "cursorstr.h"
-#include "dix.h"
-#include "dixaccess.h"
-#include "dixevents.h"
-#include "dixfont.h"
-#include "dixfontstr.h"
-#include "dixgrabs.h"
-#include "dixstruct.h"
-#include "exevents.h"
-#include "extension.h"
-#include "extinit.h"
-#include "extnsionst.h"
-#include "gc.h"
-#include "gcstruct.h"
-#include "globals.h"
-#include "input.h"
-#include "inputstr.h"
-/* already included */
-/*
-#include "misc.h"
-#include "miscstruct.h"
- */
-#include "opaque.h"
-#include "os.h"
-#include "pixmap.h"
-#include "pixmapstr.h"
-#include "privates.h"
-#include "property.h"
-#include "propertyst.h"
-#include "ptrveloc.h"
-#include "region.h"
-#include "regionstr.h"
-#include "registry.h"
-#include "resource.h"
-#include "rgb.h"
-#include "screenint.h"
-#include "scrnintstr.h"
-#include "selection.h"
-#include "servermd.h"
-#include "site.h"
-#include "swaprep.h"
-#include "swapreq.h"
-#include "validate.h"
-#include "window.h"
-#include "windowstr.h"
-#include "xace.h"
-#include "xkbfile.h"
-#include "xkbsrv.h"
-#include "xkbstr.h"
-#include "xkbrules.h"
-#include "xserver-properties.h"
-
-EOF
-
-topdir=$1
-shift
-LC_ALL=C
-export LC_ALL
-${CPP:-cpp} "$@" -DXorgLoader sdksyms.c | ${AWK:-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[] = {");
-
-    printf("sdksyms.c:") > "sdksyms.dep";
-}
-/^# [0-9]+ "/ {
-    #   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;
-
-    if (sdk && $3 ~ /\.h"$/) {
-	# remove quotes
-	gsub(/"/, "", $3);
-	line = $2;
-	header = $3;
-	if (! headers[$3]) {
-	    printf(" \\\n  %s", $3) >> "sdksyms.dep";
-	    headers[$3] = 1;
-	}
-    }
-    next;
-}
-
-/^extern[ 	]/  {
-    if (sdk) {
-	n = 3;
-
-	# skip attribute, if any
-	while ($n ~ /^(__attribute__|__global)/ ||
-	    # skip modifiers, if any
-	    $n ~ /^\*?(unsigned|const|volatile|struct)$/ ||
-	    # skip pointer
-	    $n ~ /^[a-zA-Z0-9_]*\*$/)
-	    n++;
-
-	# type specifier may not be set, as in
-	#   extern _X_EXPORT unsigned name(...)
-	if ($n !~ /[^a-zA-Z0-9_]/)
-	    n++;
-
-	# go back if we are at the parameter list already
-	if ($n ~ /^[(]([^*].*)?$/)
-	    n--;
-
-	# match
-	#    extern _X_EXPORT type (* name[])(...)
-	if ($n ~ /^[^a-zA-Z0-9_]+$/)
-	    n++;
-
-	# match
-	#	extern _X_EXPORT const name *const ...
-	if ($n ~ /^([^a-zA-Z0-9_]+)?const$/)
-	    n++;
-
-	# actual name may be in the next line, as in
-	#   extern _X_EXPORT type
-	# possibly ending with a *
-	#   name(...)
-	if ($n == "" || $n ~ /^\*+$/) {
-	    getline;
-	    n = 1;
-	}
-
-	# dont modify $0 or $n
-	symbol = $n;
-
-	# remove starting non word chars
-	sub(/^[^a-zA-Z0-9_]+/, "",symbol);
-
-	# remove from first non word to end of line
-	sub(/[^a-zA-Z0-9_].*/, "", symbol);
-
-	#print;
-	printf("    (void *) &%-50s /* %s:%s */\n", symbol ",", header, line);
-    }
-}
-
-{
-    line++;
-}
-
-END {
-    print("};");
-
-    print("") >> "sdksyms.dep";
-}' > _sdksyms.c
-
-STATUS=$?
-
-cat _sdksyms.c >> sdksyms.c
-rm _sdksyms.c
-
-[ $? != 0 ] && exit $?
-
-exit $STATUS
diff --git a/hw/xfree86/sdksyms.sh b/hw/xfree86/sdksyms.sh
new file mode 100755
index 0000000..18bb735
--- /dev/null
+++ b/hw/xfree86/sdksyms.sh
@@ -0,0 +1,425 @@
+#!/bin/sh
+
+cat > sdksyms.c << EOF
+/* This file is automatically generated by sdksyms.sh. */
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+
+/* These must be included first */
+#include "misc.h"
+#include "miscstruct.h"
+
+
+/* render/Makefile.am */
+#include "picture.h"
+#include "mipict.h"
+#include "glyphstr.h"
+#include "picturestr.h"
+
+
+/* fb/Makefile.am -- module */
+/*
+#include "fb.h"
+#include "fbrop.h"
+#include "fboverlay.h"
+#include "wfbrename.h"
+#include "fbpict.h"
+ */
+
+
+/* miext/shadow/Makefile.am -- module */
+/*
+#include "shadow.h"
+ */
+
+
+/* miext/damage/Makefile.am */
+#include "damage.h"
+#include "damagestr.h"
+
+/* miext/sync/Makefile.am */
+#include "misync.h"
+#include "misyncstr.h"
+
+/* Xext/Makefile.am -- half is module, half is builtin */
+/*
+#include "xvdix.h"
+#include "xvmcext.h"
+ */
+#include "geext.h"
+#include "geint.h"
+#include "shmint.h"
+#include "syncsdk.h"
+#if XINERAMA
+# include "panoramiXsrv.h"
+# include "panoramiX.h"
+#endif
+
+
+/* hw/xfree86/int10/Makefile.am -- module */
+/*
+#include "xf86int10.h"
+ */
+
+
+/* hw/xfree86/i2c/Makefile.am -- "mostly" modules */
+#include "xf86i2c.h"
+/*
+#include "bt829.h"
+#include "fi1236.h"
+#include "msp3430.h"
+#include "tda8425.h"
+#include "tda9850.h"
+#include "tda9885.h"
+#include "uda1380.h"
+#include "i2c_def.h"
+ */
+
+
+/* hw/xfree86/modes/Makefile.am */
+#include "xf86Crtc.h"
+#include "xf86Modes.h"
+#include "xf86RandR12.h"
+/* #include "xf86Rename.h" */
+
+
+/* hw/xfree86/ddc/Makefile.am */
+#include "edid.h"
+#include "xf86DDC.h"
+
+
+/* hw/xfree86/dri2/Makefile.am -- module */
+/*
+#if DRI2
+# include "dri2.h"
+#endif
+ */
+
+
+/* hw/xfree86/vgahw/Makefile.am -- module */
+/*
+#include "vgaHW.h"
+ */
+
+
+/* hw/xfree86/fbdevhw/Makefile.am -- module */
+/*
+#include "fbdevhw.h"
+ */
+
+
+/* hw/xfree86/common/Makefile.am */
+#include "compiler.h"
+#include "fourcc.h"
+#include "xf86.h"
+#include "xf86Module.h"
+#include "xf86Opt.h"
+#include "xf86PciInfo.h"
+#include "xf86Priv.h"
+#include "xf86Privstr.h"
+#include "xf86cmap.h"
+#include "xf86fbman.h"
+#include "xf86str.h"
+#include "xf86Xinput.h"
+#include "xf86VGAarbiter.h"
+#include "xisb.h"
+#if XV
+# include "xf86xv.h"
+# include "xf86xvmc.h"
+# include "xf86xvpriv.h"
+#endif
+/* XF86VidMode code is in libextmod module */
+/*
+#if XF86VIDMODE
+# include "vidmodeproc.h"
+#endif
+ */
+#include "xorgVersion.h"
+#if defined(__sparc__) || defined(__sparc)
+# include "xf86sbusBus.h"
+#endif
+
+
+/* hw/xfree86/ramdac/Makefile.am */
+#include "BT.h"
+#include "IBM.h"
+#include "TI.h"
+#include "xf86Cursor.h"
+#include "xf86RamDac.h"
+
+
+/* hw/xfree86/shadowfb/Makefile.am -- module */
+/*
+#include "shadowfb.h"
+ */
+
+
+/* hw/xfree86/os-support/solaris/Makefile.am */
+#if defined(sun386)
+# include "agpgart.h"
+#endif
+
+
+/* hw/xfree86/os-support/Makefile.am */
+#include "xf86_OSproc.h"
+#include "xf86_OSlib.h"
+
+
+/* hw/xfree86/os-support/bus/Makefile.am */
+#include "xf86Pci.h"
+#if defined(__sparc__) || defined(__sparc)
+# include "xf86Sbus.h"
+#endif
+
+
+/* hw/xfree86/xaa/Makefile.am -- module */
+/*
+#include "xaa.h"
+#include "xaalocal.h"
+#include "xaarop.h"
+ */
+
+
+/* hw/xfree86/dixmods/extmod/Makefile.am -- module */
+/*
+#include "dgaproc.h"
+ */
+
+
+/* hw/xfree86/parser/Makefile.am */
+#include "xf86Parser.h"
+#include "xf86Optrec.h"
+
+
+/* hw/xfree86/vbe/Makefile.am -- module */
+/*
+#include "vbe.h"
+#include "vbeModes.h"
+ */
+
+
+/* hw/xfree86/dri/Makefile.am -- module */
+/*
+#if XF86DRI
+# include "dri.h"
+# include "sarea.h"
+# include "dristruct.h"
+#endif
+ */
+
+
+/* mi/Makefile.am */
+#include "micmap.h"
+#include "miline.h"
+#include "mipointer.h"
+#include "mi.h"
+#include "mibstore.h"
+#include "migc.h"
+#include "mipointrst.h"
+#include "mizerarc.h"
+#include "micoord.h"
+#include "mifillarc.h"
+#include "mispans.h"
+#include "miwideline.h"
+#include "mistruct.h"
+#include "mifpoly.h"
+#include "mioverlay.h"
+
+
+/* randr/Makefile.am */
+#include "randrstr.h"
+#include "rrtransform.h"
+
+
+/* dbe/Makefile.am -- module */
+/*
+#include "dbestruct.h"
+ */
+
+
+/* exa/Makefile.am -- module */
+/*
+#include "exa.h"
+ */
+
+
+/* xfixes/Makefile.am */
+#include "xfixes.h"
+
+
+/* include/Makefile.am */
+#include "XIstubs.h"
+#include "Xprintf.h"
+#include "closestr.h"
+#include "closure.h"
+#include "colormap.h"
+#include "colormapst.h"
+#include "hotplug.h"
+#include "client.h"
+#include "cursor.h"
+#include "cursorstr.h"
+#include "dix.h"
+#include "dixaccess.h"
+#include "dixevents.h"
+#include "dixfont.h"
+#include "dixfontstr.h"
+#include "dixgrabs.h"
+#include "dixstruct.h"
+#include "exevents.h"
+#include "extension.h"
+#include "extinit.h"
+#include "extnsionst.h"
+#include "gc.h"
+#include "gcstruct.h"
+#include "globals.h"
+#include "input.h"
+#include "inputstr.h"
+/* already included */
+/*
+#include "misc.h"
+#include "miscstruct.h"
+ */
+#include "opaque.h"
+#include "os.h"
+#include "pixmap.h"
+#include "pixmapstr.h"
+#include "privates.h"
+#include "property.h"
+#include "propertyst.h"
+#include "ptrveloc.h"
+#include "region.h"
+#include "regionstr.h"
+#include "registry.h"
+#include "resource.h"
+#include "rgb.h"
+#include "screenint.h"
+#include "scrnintstr.h"
+#include "selection.h"
+#include "servermd.h"
+#include "site.h"
+#include "swaprep.h"
+#include "swapreq.h"
+#include "validate.h"
+#include "window.h"
+#include "windowstr.h"
+#include "xace.h"
+#include "xkbfile.h"
+#include "xkbsrv.h"
+#include "xkbstr.h"
+#include "xkbrules.h"
+#include "xserver-properties.h"
+
+EOF
+
+topdir=$1
+shift
+LC_ALL=C
+export LC_ALL
+${CPP:-cpp} "$@" -DXorgLoader sdksyms.c | ${AWK:-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[] = {");
+
+    printf("sdksyms.c:") > "sdksyms.dep";
+}
+/^# [0-9]+ "/ {
+    #   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;
+
+    if (sdk && $3 ~ /\.h"$/) {
+	# remove quotes
+	gsub(/"/, "", $3);
+	line = $2;
+	header = $3;
+	if (! headers[$3]) {
+	    printf(" \\\n  %s", $3) >> "sdksyms.dep";
+	    headers[$3] = 1;
+	}
+    }
+    next;
+}
+
+/^extern[ 	]/  {
+    if (sdk) {
+	n = 3;
+
+	# skip attribute, if any
+	while ($n ~ /^(__attribute__|__global)/ ||
+	    # skip modifiers, if any
+	    $n ~ /^\*?(unsigned|const|volatile|struct)$/ ||
+	    # skip pointer
+	    $n ~ /^[a-zA-Z0-9_]*\*$/)
+	    n++;
+
+	# type specifier may not be set, as in
+	#   extern _X_EXPORT unsigned name(...)
+	if ($n !~ /[^a-zA-Z0-9_]/)
+	    n++;
+
+	# go back if we are at the parameter list already
+	if ($n ~ /^[(]([^*].*)?$/)
+	    n--;
+
+	# match
+	#    extern _X_EXPORT type (* name[])(...)
+	if ($n ~ /^[^a-zA-Z0-9_]+$/)
+	    n++;
+
+	# match
+	#	extern _X_EXPORT const name *const ...
+	if ($n ~ /^([^a-zA-Z0-9_]+)?const$/)
+	    n++;
+
+	# actual name may be in the next line, as in
+	#   extern _X_EXPORT type
+	# possibly ending with a *
+	#   name(...)
+	if ($n == "" || $n ~ /^\*+$/) {
+	    getline;
+	    n = 1;
+	}
+
+	# dont modify $0 or $n
+	symbol = $n;
+
+	# remove starting non word chars
+	sub(/^[^a-zA-Z0-9_]+/, "",symbol);
+
+	# remove from first non word to end of line
+	sub(/[^a-zA-Z0-9_].*/, "", symbol);
+
+	#print;
+	printf("    (void *) &%-50s /* %s:%s */\n", symbol ",", header, line);
+    }
+}
+
+{
+    line++;
+}
+
+END {
+    print("};");
+
+    print("") >> "sdksyms.dep";
+}' > _sdksyms.c
+
+STATUS=$?
+
+cat _sdksyms.c >> sdksyms.c
+rm _sdksyms.c
+
+[ $? != 0 ] && exit $?
+
+exit $STATUS
diff --git a/test/Makefile.am b/test/Makefile.am
index 29e483a..04c255b 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -7,7 +7,10 @@ check_LTLIBRARIES = libxservertest.la
 TESTS=$(noinst_PROGRAMS)
 
 AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@
-INCLUDES = @XORG_INCS@
+INCLUDES = $(XORG_INCS) -I$(top_srcdir)/hw/xfree86/parser \
+	-I$(top_srcdir)/miext/cw -I$(top_srcdir)/hw/xfree86/ddc \
+	-I$(top_srcdir)/hw/xfree86/i2c -I$(top_srcdir)/hw/xfree86/modes \
+	-I$(top_srcdir)/hw/xfree86/ramdac
 TEST_LDADD=libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS)
 
 if SPECIAL_DTRACE_OBJECTS
@@ -21,7 +24,7 @@ list_LDADD=$(TEST_LDADD)
 misc_LDADD=$(TEST_LDADD)
 fixes_LDADD=$(TEST_LDADD)
 
-libxservertest_la_SOURCES =
+nodist_libxservertest_la_SOURCES = $(top_builddir)/hw/xfree86/sdksyms.c
 libxservertest_la_LIBADD = \
             $(XSERVER_LIBS) \
             $(top_builddir)/hw/xfree86/loader/libloader.la \
-- 
1.7.3.4



More information about the xorg-devel mailing list