build: add a function to test if -lc is needed
[samba.git] / source4 / wscript
index 3213e7c4e4ea420f6ec46c3bcf624350ccace381..93391dacd1ea0199487cc4b74e1585c095a6ac2d 100644 (file)
@@ -113,6 +113,8 @@ def configure(conf):
     # 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)
+    if not conf.CHECK_NEED_LC("-lc not needed"):
+        conf.ADD_LDFLAGS('-lc', testflags=False)
 
     # we don't want PYTHONDIR in config.h, as otherwise changing
     # --prefix causes a complete rebuild