From 6c3e670f31beb5766b906e26ddc0c5d75b401137 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 21 Oct 2010 18:36:41 +1100 Subject: waf: check the linker accepts a set of ldflags before using them Autobuild-User: Andrew Tridgell Autobuild-Date: Thu Oct 21 08:45:49 UTC 2010 on sn-devel-104 --- buildtools/wafsamba/samba_autoconf.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'buildtools/wafsamba/samba_autoconf.py') 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: -- cgit