summaryrefslogtreecommitdiff
path: root/buildtools
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-10-21 18:36:41 +1100
committerAndrew Tridgell <tridge@samba.org>2010-10-21 08:45:49 +0000
commit6c3e670f31beb5766b906e26ddc0c5d75b401137 (patch)
tree9259cee880d6a27df44607cff73f8003c29cea4a /buildtools
parent6fd9fee502067dd2e864ebfce50302af062ee2d6 (diff)
downloadsamba-6c3e670f31beb5766b906e26ddc0c5d75b401137.tar.gz
samba-6c3e670f31beb5766b906e26ddc0c5d75b401137.tar.bz2
samba-6c3e670f31beb5766b906e26ddc0c5d75b401137.zip
waf: check the linker accepts a set of ldflags before using them
Autobuild-User: Andrew Tridgell <tridge@samba.org> Autobuild-Date: Thu Oct 21 08:45:49 UTC 2010 on sn-devel-104
Diffstat (limited to 'buildtools')
-rw-r--r--buildtools/wafsamba/samba_autoconf.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index 8cab128595..ea2ef09806 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -436,6 +436,15 @@ def CHECK_CFLAGS(conf, cflags):
ccflags=cflags,
msg="Checking compiler accepts %s" % cflags)
+@conf
+def CHECK_LDFLAGS(conf, ldflags):
+ '''check if the given ldflags are accepted by the linker
+ '''
+ return conf.check(fragment='int main(void) { return 0; }\n',
+ execute=0,
+ ldflags=ldflags,
+ msg="Checking linker accepts %s" % ldflags)
+
@conf
def CONFIG_SET(conf, option):
@@ -619,7 +628,7 @@ def ADD_LDFLAGS(conf, flags, testflags=False):
if testflags:
ok_flags=[]
for f in flags.split():
- if CHECK_CFLAGS(conf, f):
+ if CHECK_LDFLAGS(conf, f):
ok_flags.append(f)
flags = ok_flags
if not 'EXTRA_LDFLAGS' in conf.env: