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

  Checking uname sysname type              : not found
  Checking uname machine type              : not found
  Checking uname release type              : not found
  Checking uname version type              : not found

../test.c: In function ‘main’:
../test.c:8:32: error: implicit declaration of function ‘printf’
    [-Werror=implicit-function-declaration]
                                printf("%s", n.sysname);
                                ^~~~~~
../test.c:8:32: warning: incompatible implicit declaration
    of built-in function ‘printf’
../test.c:8:32: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’

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 c9f8fdc0131838b44dc92196fa95c6b2f7aea506..72e432164984c7faa9bc93745d401b5c38849d37 100644 (file)
@@ -438,6 +438,7 @@ def CHECK_UNAME(conf):
     ret = True
     for v in "sysname machine release version".split():
         if not conf.CHECK_CODE('''
+                               int printf(const char *format, ...);
                                struct utsname n;
                                if (uname(&n) == -1) return -1;
                                printf("%%s", n.%s);