s4-build: use -Wl,--as-needed if supported
authorAndrew Tridgell <tridge@samba.org>
Tue, 2 Nov 2010 23:50:16 +0000 (10:50 +1100)
committerAndrew Tridgell <tridge@samba.org>
Wed, 3 Nov 2010 00:35:56 +0000 (00:35 +0000)
this makes our runtime load times smaller, and also means we find bugs
that this may cause on gentoo. gentoo uses this by default

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Wed Nov  3 00:35:56 UTC 2010 on sn-devel-104

source4/wscript

index cbc0bf49ac2d5e66caab3fe631344db4ba246502..ac4971ca6a4edf463812b1a907b7165ed512d7b1 100644 (file)
@@ -118,6 +118,12 @@ def configure(conf):
     # resolution of symbols
     conf.ADD_LDFLAGS('-Wl,-no-undefined', testflags=True)
 
+    # gentoo always adds this. We want our normal build to be as
+    # strict as the strictest OS we support, so adding this here
+    # allows us to find problems on our development hosts faster.
+    # It also results in faster load time.
+    conf.ADD_LDFLAGS('-Wl,--as-needed', testflags=True)
+
     # we don't want PYTHONDIR in config.h, as otherwise changing
     # --prefix causes a complete rebuild
     del(conf.env.defines['PYTHONDIR'])