xserver: Branch 'master'

Paulo Cesar Pereira de Andrade pcpa at kemper.freedesktop.org
Tue Dec 23 12:45:25 PST 2008


 hw/xfree86/loader/Makefile.am |    6 ++++--
 hw/xfree86/loader/sdksyms.sh  |   13 +++++++++++++
 2 files changed, 17 insertions(+), 2 deletions(-)

New commits:
commit 86dc660588a615baefb1799d78a501c95a931d77
Author: Paulo Cesar Pereira de Andrade <pcpa at mandriva.com.br>
Date:   Tue Dec 23 18:07:54 2008 -0200

    Improve sdksyms.c automatic generation (Fix #19245).
    
      Since it is already parsing cpp output, create a dependency file
    in the same process. This will cause sdksyms.c to be regenerated
    whenever a sdk header is modified.
      This also uses the gmake 'sinclude' directive (don't fail if
    included file doesn't exist). This should not cause any problems
    given that gmake only constructs are used in several other Makefiles.

diff --git a/hw/xfree86/loader/Makefile.am b/hw/xfree86/loader/Makefile.am
index 8732a49..b16f12b 100644
--- a/hw/xfree86/loader/Makefile.am
+++ b/hw/xfree86/loader/Makefile.am
@@ -21,7 +21,9 @@ libloader_la_SOURCES = \
 	os.c \
 	sdksyms.c
 
-CLEANFILES = sdksyms.c
+CLEANFILES = sdksyms.c sdksyms.dep
 
-sdksyms.c: sdksyms.sh
+sdksyms.dep sdksyms.c: sdksyms.sh
 	CPP='$(CPP)' AWK='$(AWK)' $(srcdir)/sdksyms.sh $(top_srcdir) $(AM_CFLAGS) $(CFLAGS) $(INCLUDES)
+
+sinclude sdksyms.dep
diff --git a/hw/xfree86/loader/sdksyms.sh b/hw/xfree86/loader/sdksyms.sh
index 0576010..be0b0ee 100755
--- a/hw/xfree86/loader/sdksyms.sh
+++ b/hw/xfree86/loader/sdksyms.sh
@@ -333,6 +333,8 @@ BEGIN {
     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
@@ -340,6 +342,15 @@ BEGIN {
     #   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);
+	if (! headers[$3]) {
+	    printf(" \\\n  %s", $3) >> "sdksyms.dep";
+	    headers[$3] = 1;
+	}
+    }
 }
 
 /^extern[ 	]/  {
@@ -394,6 +405,8 @@ BEGIN {
 
 END {
     print("};");
+
+    print("") >> "sdksyms.dep";
 }' > _sdksyms.c
 
 STATUS=$?


More information about the xorg-commit mailing list