buildtools/wafsamba: inline defines during configure into the tests
authorStefan Metzmacher <metze@samba.org>
Sat, 24 Apr 2010 16:10:37 +0000 (18:10 +0200)
committerStefan Metzmacher <metze@samba.org>
Sat, 24 Apr 2010 18:03:50 +0000 (20:03 +0200)
There 2 reasons for this change:
- This is how autoconf tests work and it makes config.log much more useful
- The waf c preprocessor ignored changes in bin/default/__confdefs.h when using
  waf configure -C, because is outside of the configure tests project path
  and handled like a system header.

Many thanks to ita for pointing out the fix.

metze

buildtools/wafsamba/samba_autoconf.py

index c35db9b45fba966427d0ef26020d5da5498fd887..743f420d5d4ea13fae9c9afab38f5c955aed5795 100644 (file)
@@ -345,19 +345,16 @@ def CHECK_CODE(conf, code, define,
     else:
         execute = 0
 
+    defs = conf.get_config_header()
+
     if addmain:
-        fragment='#include "__confdefs.h"\n%s\n int main(void) { %s; return 0; }\n' % (hdrs, code)
+        fragment='%s\n%s\n int main(void) { %s; return 0; }\n' % (defs, hdrs, code)
     else:
-        fragment='#include "__confdefs.h"\n%s\n%s\n' % (hdrs, code)
-
-    conf.write_config_header('__confdefs.h', top=True)
+        fragment='%s\n%s\n%s\n' % (defs, hdrs, code)
 
     if msg is None:
         msg="Checking for %s" % define
 
-    # include the directory containing __confdefs.h
-    cflags += ' -I../../default'
-
     if local_include:
         cflags += ' -I%s' % conf.curdir