waf: Correctly check for prctl in just one place.
authorAndreas Schneider <asn@samba.org>
Mon, 25 Feb 2013 09:02:35 +0000 (10:02 +0100)
committerDavid Disseldorp <ddiss@suse.de>
Tue, 5 Mar 2013 22:29:43 +0000 (23:29 +0100)
Reviewed-by: David Disseldorp <ddiss@samba.org>
lib/replace/wscript
source3/wscript

index 47735be9e6f85f45813f3a12340562e07c43d5fa..36a9f6a3669682f2c4d9d4a7824a31af01629fac 100644 (file)
@@ -94,7 +94,7 @@ struct foo bar = { .y = 'X', .x = 1 };
     conf.CHECK_HEADERS('security/pam_appl.h zlib.h asm/unistd.h')
     conf.CHECK_HEADERS('aio.h sys/unistd.h rpc/rpc.h rpc/nettype.h alloca.h float.h')
 
-    conf.CHECK_HEADERS('rpcsvc/nis.h rpcsvc/ypclnt.h sys/prctl.h sys/sysctl.h')
+    conf.CHECK_HEADERS('rpcsvc/nis.h rpcsvc/ypclnt.h sys/sysctl.h')
     conf.CHECK_HEADERS('sys/fileio.h sys/filesys.h sys/dustat.h sys/sysmacros.h')
     conf.CHECK_HEADERS('xfs/libxfs.h netgroup.h')
 
@@ -106,6 +106,18 @@ struct foo bar = { .y = 'X', .x = 1 };
     conf.CHECK_HEADERS('utmp.h utmpx.h lastlog.h malloc.h')
     conf.CHECK_HEADERS('syscall.h sys/syscall.h inttypes.h')
 
+    # Check for process set name support
+    conf.CHECK_CODE('''
+                    #include <sys/prctl.h>
+                    int main(void) {
+                        prctl(0);
+                        return 0;
+                    }
+                    ''',
+                    'HAVE_PRCTL',
+                    headers='sys/prctl.h',
+                    msg='Checking for prctl syscall')
+
     conf.CHECK_CODE('''
                     #include <unistd.h>
                     #ifdef HAVE_FCNTL_H
@@ -225,6 +237,7 @@ struct foo bar = { .y = 'X', .x = 1 };
     conf.CHECK_FUNCS('link readlink symlink realpath snprintf vsnprintf')
     conf.CHECK_FUNCS('asprintf vasprintf setenv unsetenv strnlen strtoull __strtoull')
     conf.CHECK_FUNCS('strtouq strtoll __strtoll strtoq memalign posix_memalign')
+    conf.CHECK_FUNCS('prctl')
 
     # libbsd on some platforms provides strlcpy and strlcat
     if not conf.CHECK_FUNCS('strlcpy strlcat'):
index 7a99dc1c552695c2777e3a63fb390f7e5bccf5ba..1bc68115e52f58550764955c5ac40bd3db26f8da 100644 (file)
@@ -317,7 +317,7 @@ _lstat __lstat lutimes
 __lxstat memalign mknod mlock mlockall munlock munlockall
 _open __open _opendir __opendir
 pathconf poll posix_fallocate
-posix_memalign prctl pread _pread __pread
+posix_memalign pread _pread __pread
 pwrite _pwrite __pwrite
 rdchk _read __read _readdir __readdir
 _seekdir __seekdir
@@ -330,14 +330,6 @@ __sys_llseek syslog _telldir __telldir textdomain timegm
 utimensat vsyslog _write __write __xstat
 ''')
 
-    conf.CHECK_CODE('''
-#ifdef HAVE_SYS_PRCTL_H
-#include <sys/prctl.h>
-#endif
-int i; i = prtcl(0); 
-''', 
-                    'HAVE_PRCTL', link=False)
-
     conf.CHECK_SAMBA3_CHARSET() # see build/charset.py
 
     # FIXME: these should be tests for features, but the old build system just