build: added configure test for inline
authorAndrew Tridgell <tridge@samba.org>
Wed, 5 May 2010 13:16:26 +0000 (15:16 +0200)
committerAndrew Tridgell <tridge@samba.org>
Wed, 5 May 2010 14:14:13 +0000 (16:14 +0200)
buildtools/wafsamba/samba_conftests.py
buildtools/wafsamba/wscript

index e709929ba967bd754332e1115fd320fbaa8c276f..a5c1b389aedbe4b9b2a595b1f72074d4567daa2c 100644 (file)
@@ -279,3 +279,27 @@ def CHECK_UNAME(conf):
                                msg="Checking uname %s type" % v):
             ret = False
     return ret
+
+@conf
+def CHECK_INLINE(conf):
+    '''check for the right value for inline'''
+    conf.COMPOUND_START('Checking for inline')
+    for i in ['inline', '__inline__', '__inline']:
+        ret = conf.CHECK_CODE('''
+        typedef int foo_t;
+        static %s foo_t static_foo () {return 0; }
+        %s foo_t foo () {return 0; }''' % (i, i),
+                              define='INLINE_MACRO',
+                              addmain=False,
+                              link=False)
+        if ret:
+            if i != 'inline':
+                conf.DEFINE('inline', i, quote=False)
+            break
+    if not ret:
+        conf.COMPOUND_END(ret)
+    else:
+        conf.COMPOUND_END(i)
+    return ret
+
+
index 0413bb4b0e2a1c1d232ac5d2157c62b4c5d743ba..c8872eb79551d2f5dd2d2ab7141d439ff754c749 100644 (file)
@@ -220,6 +220,8 @@ def configure(conf):
     # we should use the PIC options in waf instead
     conf.ADD_CFLAGS('-fPIC', testflags=True)
 
+    conf.CHECK_INLINE()
+
     # check for pkgconfig
     conf.check_cfg(atleast_pkgconfig_version='0.0.0')