build: check for volatile
authorAndrew Tridgell <tridge@samba.org>
Sun, 7 Mar 2010 04:52:45 +0000 (15:52 +1100)
committerAndrew Tridgell <tridge@samba.org>
Tue, 6 Apr 2010 10:26:43 +0000 (20:26 +1000)
buildtools/wafsamba/samba_autoconf.py
lib/replace/wscript

index fef44ea95ba793edf22fafc0b2e3630dcd34ad75..7eac7d955f5383ffe97f2be623cbd4ab53837ceb 100644 (file)
@@ -48,11 +48,16 @@ def CHECK_TYPE_IN(conf, t, hdr):
     return False
 
 @conf
-def CHECK_TYPE(conf, t, alternate):
-    if not conf.check(type_name=t, header_name=conf.env.hlist):
+def CHECK_TYPE(conf, t, alternate=None, headers=None, define=None):
+    if headers is None:
+        headers = conf.env.hlist
+    if define is not None:
+        ret = conf.check(type_name=t, header_name=headers, define_name=define)
+    else:
+        ret = conf.check(type_name=t, header_name=headers)
+    if not ret and alternate is not None:
         conf.DEFINE(t, alternate)
-        return True
-    return False
+    return ret
 
 @conf
 def CHECK_VARIABLE(conf, v, define=None, always=False, headers=None):
index b5a01d6a81b22d187e2c32322dc044c62b0d86fc..ef8972924b53862edb378c00307c1b6a67411b7e 100644 (file)
@@ -100,6 +100,7 @@ def configure(conf):
     conf.CHECK_TYPE('loff_t', 'off_t')
     conf.CHECK_TYPE('bool', 'off_t')
     conf.CHECK_TYPE('offset_t', 'loff_t')
+    conf.CHECK_TYPE('volatile int', define='HAVE_VOLATILE')
 
     conf.CHECK_TYPE_IN('struct ifaddrs', 'ifaddrs.h')
     conf.CHECK_TYPE_IN('struct addrinfo', 'netdb.h')