WAF: Fix detection of linker features
authorLukas Slebodnik <lslebodn@redhat.com>
Tue, 6 Dec 2016 17:07:36 +0000 (18:07 +0100)
committerRalph Boehme <slow@samba.org>
Mon, 2 Jan 2017 13:12:27 +0000 (14:12 +0100)
Following check of linker feature failed with strict CFLAGS
"-Werrorr=implicit-function-declaration -Werror=implicit-int"

  Checking for rpath library support       : not found
  Checking for -Wl,--version-script support  : not found

../main.c: In function ‘main’:
../main.c:1:26: error: implicit declaration of function ‘lib_func’
    [-Werror=implicit-function-declaration]
 int main(void) {return !(lib_func() == 42);}
                          ^~~~~~~~

Signed-off-by: Lukas Slebodnik <lslebodn@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
buildtools/wafsamba/samba_conftests.py

index 045f858e9cdaae7ee5754a2c7fbef6642a7fee59..c9f8fdc0131838b44dc92196fa95c6b2f7aea506 100644 (file)
@@ -286,7 +286,9 @@ def CHECK_LIBRARY_SUPPORT(conf, rpath=False, version_script=False, msg=None):
     os.makedirs(subdir)
 
     Utils.writef(os.path.join(subdir, 'lib1.c'), 'int lib_func(void) { return 42; }\n')
-    Utils.writef(os.path.join(dir, 'main.c'), 'int main(void) {return !(lib_func() == 42);}\n')
+    Utils.writef(os.path.join(dir, 'main.c'),
+                 'int lib_func(void);\n'
+                 'int main(void) {return !(lib_func() == 42);}\n')
 
     bld = Build.BuildContext()
     bld.log = conf.log