wscript: use --as-needed only if tested successfully
authorBjörn Jacke <bj@sernet.de>
Tue, 2 Mar 2021 21:47:35 +0000 (22:47 +0100)
committerKarolin Seeger <kseeger@samba.org>
Fri, 5 Mar 2021 12:19:14 +0000 (12:19 +0000)
Some OSes like Solaris based OmiOS don't support this.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14288

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 996560191ac6bd603901dcd6c0de5d239e019ef4)

wscript

diff --git a/wscript b/wscript
index a195ac33c985b1678c74735db27f188a35912e7c..2020c6793f0927c6c416c936c9a34d34f970e3f8 100644 (file)
--- a/wscript
+++ b/wscript
@@ -321,7 +321,8 @@ def configure(conf):
     # allows us to find problems on our development hosts faster.
     # It also results in faster load time.
 
-    conf.add_as_needed()
+    conf.ADD_LDFLAGS('-Wl,--as-needed', testflags=True)
+
 
     if not conf.CHECK_NEED_LC("-lc not needed"):
         conf.ADD_LDFLAGS('-lc', testflags=False)