summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2010-04-13 12:56:19 +0200
committerStefan Metzmacher <metze@samba.org>2010-04-13 12:59:07 +0200
commit974025944e6bd59a79638f185a6268903f396fa6 (patch)
treea29f5d0eb16036e1aaa2695bed8497a3bf231f4c
parent367ba43b63eacb2bffaf8c53c77a343481482939 (diff)
downloadsamba-974025944e6bd59a79638f185a6268903f396fa6.tar.gz
samba-974025944e6bd59a79638f185a6268903f396fa6.tar.bz2
samba-974025944e6bd59a79638f185a6268903f396fa6.zip
buildtools/wafsamba: make sure CHECK_FUNC() and CHECK_VARIABLE() work with -O3 in the CFLAGS
'CFLAGS="-O3" waf configure' was not detecting dlopen() needs -ldl. metze
-rw-r--r--buildtools/wafsamba/samba_autoconf.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index 9d0229e147..dca6595964 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -188,9 +188,11 @@ def CHECK_VARIABLE(conf, v, define=None, always=False,
msg="Checking for variable %s" % v
return CHECK_CODE(conf,
+ # we need to make sure the compiler doesn't
+ # optimize it out...
'''
#ifndef %s
- void *_x; _x=(void *)&%s;
+ void *_x; _x=(void *)&%s; return (int)_x;
#endif
return 0
''' % (v, v),
@@ -264,7 +266,9 @@ def CHECK_FUNC(conf, f, link=True, lib=None, headers=None):
if not ret:
ret = CHECK_CODE(conf,
# it might be a macro
- 'void *__x = (void *)%s' % f,
+ # we need to make sure the compiler doesn't
+ # optimize it out...
+ 'void *__x = (void *)%s; return (int)__x' % f,
execute=False,
link=True,
addmain=True,