diff options
-rw-r--r-- | buildtools/wafsamba/samba_conftests.py | 24 | ||||
-rw-r--r-- | buildtools/wafsamba/wscript | 2 |
2 files changed, 26 insertions, 0 deletions
diff --git a/buildtools/wafsamba/samba_conftests.py b/buildtools/wafsamba/samba_conftests.py index e709929ba96..a5c1b389aed 100644 --- a/buildtools/wafsamba/samba_conftests.py +++ b/buildtools/wafsamba/samba_conftests.py @@ -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 + + diff --git a/buildtools/wafsamba/wscript b/buildtools/wafsamba/wscript index 0413bb4b0e2..c8872eb7955 100644 --- a/buildtools/wafsamba/wscript +++ b/buildtools/wafsamba/wscript @@ -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') |