summaryrefslogtreecommitdiff
path: root/lib/replace
diff options
context:
space:
mode:
authorBjörn Baumbach <bb@sernet.de>2017-06-22 16:07:27 +0200
committerRalph Boehme <slow@samba.org>2017-06-23 21:01:17 +0200
commit3a175830e579ab10231439657b23733338cd5634 (patch)
tree57c388cff514510847b635a716ccaa6a667ca21d /lib/replace
parent1f0be3e1199170b599652905021a57e966ef12a9 (diff)
downloadsamba-3a175830e579ab10231439657b23733338cd5634.tar.gz
waf:lib/replace: Fix building with older GCC versions
Using gcc 4.3.2: cc1: error: unrecognized command line option "-Wno-format-truncation" Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
Diffstat (limited to 'lib/replace')
-rw-r--r--lib/replace/wscript8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/replace/wscript b/lib/replace/wscript
index 33f49eb5aa8..7c50e1daf85 100644
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -81,6 +81,9 @@ def configure(conf):
conf.CHECK_HEADERS('sys/atomic.h')
conf.CHECK_HEADERS('libgen.h')
+ if conf.CHECK_CFLAGS('-Wno-format-truncation'):
+ conf.define('HAVE_WNO_FORMAT_TRUNCATION', '1')
+
# Check for process set name support
conf.CHECK_CODE('''
#include <sys/prctl.h>
@@ -711,11 +714,14 @@ def build(bld):
private_library=True,
deps='crypt dl nsl socket rt attr' + extra_libs)
+ replace_test_cflags="-Wno-format-zero-length"
+ if bld.CONFIG_SET('HAVE_WNO_FORMAT_TRUNCATION'):
+ replace_test_cflags += " -Wno-format-truncation"
bld.SAMBA_SUBSYSTEM('replace-test',
source='''test/testsuite.c test/strptime.c
test/os2_delete.c test/getifaddrs.c''',
deps='replace',
- cflags="-Wno-format-zero-length -Wno-format-truncation")
+ cflags=replace_test_cflags)
if bld.env.standalone_replace:
bld.SAMBA_BINARY('replace_testsuite',