summaryrefslogtreecommitdiff
path: root/buildtools/wafsamba/samba_autoconf.py
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-10-18 15:17:56 +1100
committerAndrew Tridgell <tridge@samba.org>2010-10-19 11:22:35 +1100
commit968381a4e2e7c8350b89104c17568259d35787a5 (patch)
treea80423e97e83f16377d4decd3f6dedc968aab332 /buildtools/wafsamba/samba_autoconf.py
parent1b8355897d1db0a127b6357ff5a3b2eb1c1e3b71 (diff)
downloadsamba-968381a4e2e7c8350b89104c17568259d35787a5.tar.gz
samba-968381a4e2e7c8350b89104c17568259d35787a5.tar.bz2
samba-968381a4e2e7c8350b89104c17568259d35787a5.zip
waf: put -Wl,-no-undefined only in the linker flags, not when compiling C
Diffstat (limited to 'buildtools/wafsamba/samba_autoconf.py')
-rw-r--r--buildtools/wafsamba/samba_autoconf.py27
1 files changed, 26 insertions, 1 deletions
diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index 98352044b5..dffc5f0bdb 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -562,8 +562,10 @@ def SAMBA_CONFIG_H(conf, path=None):
if Options.options.developer:
# we add these here to ensure that -Wstrict-prototypes is not set during configure
- conf.ADD_CFLAGS('-Wall -g -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Werror-implicit-function-declaration -Wformat=2 -Wno-format-y2k -Wl,-no-undefined',
+ conf.ADD_CFLAGS('-Wall -g -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Werror-implicit-function-declaration -Wformat=2 -Wno-format-y2k',
testflags=True)
+ conf.ADD_LDFLAGS('-Wl,-no-undefined', testflags=True)
+
if Options.options.picky_developer:
conf.ADD_CFLAGS('-Werror', testflags=True)
@@ -605,6 +607,21 @@ def ADD_CFLAGS(conf, flags, testflags=False):
conf.env['EXTRA_CFLAGS'] = []
conf.env['EXTRA_CFLAGS'].extend(TO_LIST(flags))
+@conf
+def ADD_LDFLAGS(conf, flags, testflags=False):
+ '''add some LDFLAGS to the command line
+ optionally set testflags to ensure all the flags work
+ '''
+ if testflags:
+ ok_flags=[]
+ for f in flags.split():
+ if CHECK_CFLAGS(conf, f):
+ ok_flags.append(f)
+ flags = ok_flags
+ if not 'EXTRA_LDFLAGS' in conf.env:
+ conf.env['EXTRA_LDFLAGS'] = []
+ conf.env['EXTRA_LDFLAGS'].extend(TO_LIST(flags))
+
@conf
@@ -629,6 +646,14 @@ def CURRENT_CFLAGS(bld, target, cflags, hide_symbols=False):
return ret
+def CURRENT_LDFLAGS(bld, target, cflags, hide_symbols=False):
+ '''work out the current loader flags. local flags are added first'''
+ flags = CURRENT_CFLAGS(bld, target, cflags, hide_symbols=hide_symbols)
+ if 'EXTRA_LDFLAGS' in bld.env:
+ flags.extend(bld.env['EXTRA_LDFLAGS'])
+ return flags
+
+
@conf
def CHECK_CC_ENV(conf):
"""trim whitespaces from 'CC'.