build: added local_include option to CHECK_CODE()
authorAndrew Tridgell <tridge@samba.org>
Sun, 7 Mar 2010 13:06:39 +0000 (00:06 +1100)
committerAndrew Tridgell <tridge@samba.org>
Tue, 6 Apr 2010 10:26:46 +0000 (20:26 +1000)
buildtools/wafsamba/samba_autoconf.py

index 36bc2484ec50e6e088664fa0c765a2b0fe7d4cde..297d8d19219980a311ec955947954a28733bfed6 100644 (file)
@@ -173,7 +173,8 @@ def CHECK_SIZEOF(conf, vars, headers=None, define=None):
 @conf
 def CHECK_CODE(conf, code, define,
                always=False, execute=False, addmain=True, mandatory=False,
-               headers=None, msg=None, cflags=''):
+               headers=None, msg=None, cflags='', includes='# . ../default',
+               local_include=True):
     '''check if some code compiles and/or runs'''
     hdrs=''
     if headers is not None:
@@ -198,14 +199,15 @@ def CHECK_CODE(conf, code, define,
     if msg is None:
         msg="Checking for %s" % define
 
-    cflags = cflags + ' -I%s' % conf.curdir
+    if local_include:
+        cflags = cflags + ' -I%s' % conf.curdir
 
     if conf.check(fragment=fragment,
                   execute=execute,
                   define_name = define,
                   mandatory = mandatory,
                   ccflags=to_list(cflags),
-                  includes='# . ../default',
+                  includes=includes,
                   msg=msg):
         conf.DEFINE(define, 1)
         return True