summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-03-23 09:29:51 +1100
committerAndrew Tridgell <tridge@samba.org>2010-04-06 20:27:00 +1000
commit00649a9c6266f959dbc7d857180e43f2b1363844 (patch)
tree52fb65dfd462e2a4baf5865a1a6c662c7f9dffc0
parentf95ca1afc984ecf295b9181b2f699a72afcb4772 (diff)
downloadsamba-00649a9c6266f959dbc7d857180e43f2b1363844.tar.gz
samba-00649a9c6266f959dbc7d857180e43f2b1363844.tar.bz2
samba-00649a9c6266f959dbc7d857180e43f2b1363844.zip
build: updated configure checks or new syntax
-rw-r--r--lib/popt/wscript3
-rw-r--r--lib/replace/system/wscript_configure16
-rw-r--r--lib/replace/wscript62
-rw-r--r--lib/tevent/wscript4
-rw-r--r--lib/util/charset/wscript_configure12
-rw-r--r--lib/util/wscript_configure11
-rw-r--r--source4/heimdal_build/wscript_configure22
-rw-r--r--source4/lib/ldb/wscript2
-rw-r--r--source4/lib/tls/wscript9
9 files changed, 68 insertions, 73 deletions
diff --git a/lib/popt/wscript b/lib/popt/wscript
index ccdb290703..af432c4d4e 100644
--- a/lib/popt/wscript
+++ b/lib/popt/wscript
@@ -8,8 +8,7 @@ def set_options(opt):
def configure(conf):
conf.CHECK_HEADERS('float.h')
if not Options.options.INCLUDED_POPT:
- if (conf.CHECK_HEADERS('popt.h') and
- conf.CHECK_FUNCS_IN('poptGetContext', 'popt')):
+ if conf.CHECK_FUNCS_IN('poptGetContext', 'popt', headers='popt.h'):
conf.DEFINE('HAVE_SYSTEM_POPT', 1)
def build(bld):
diff --git a/lib/replace/system/wscript_configure b/lib/replace/system/wscript_configure
index 4569704bf9..410af09815 100644
--- a/lib/replace/system/wscript_configure
+++ b/lib/replace/system/wscript_configure
@@ -4,21 +4,21 @@ conf.CHECK_FUNCS('getpwnam_r getpwuid_r getpwent_r')
# solaris varients of getXXent_r
conf.CHECK_C_PROTOTYPE('getpwent_r',
'struct passwd *getpwent_r(struct passwd *src, char *buf, int buflen)',
- define='SOLARIS_GETPWENT_R')
+ define='SOLARIS_GETPWENT_R', headers='pwd.h')
conf.CHECK_C_PROTOTYPE('getgrent_r',
'struct group *getgrent_r(struct group *src, char *buf, int buflen)',
- define='SOLARIS_GETGRENT_R')
+ define='SOLARIS_GETGRENT_R', headers='grp.h')
# the irix varients
conf.CHECK_C_PROTOTYPE('getpwent_r',
'struct passwd *getpwent_r(struct passwd *src, char *buf, size_t buflen)',
- define='SOLARIS_GETPWENT_R')
+ define='SOLARIS_GETPWENT_R', headers='pwd.h')
conf.CHECK_C_PROTOTYPE('getgrent_r',
'struct group *getgrent_r(struct group *src, char *buf, size_t buflen)',
- define='SOLARIS_GETGRENT_R')
+ define='SOLARIS_GETGRENT_R', headers='grp.h')
conf.CHECK_FUNCS('getgrouplist')
-conf.CHECK_HEADERS('ctype.h locale.h langinfo.h', add_headers=False)
-conf.CHECK_HEADERS('fnmatch.h locale.h langinfo.h', add_headers=False)
-conf.CHECK_HEADERS('sys/ipc.h sys/mman.h sys/shm.h', add_headers=False)
-conf.CHECK_HEADERS('termios.h termio.h sys/termio.h', add_headers=False)
+conf.CHECK_HEADERS('ctype.h locale.h langinfo.h')
+conf.CHECK_HEADERS('fnmatch.h locale.h langinfo.h')
+conf.CHECK_HEADERS('sys/ipc.h sys/mman.h sys/shm.h')
+conf.CHECK_HEADERS('termios.h termio.h sys/termio.h')
diff --git a/lib/replace/wscript b/lib/replace/wscript
index 6d7ba542f8..0879bac10b 100644
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -101,19 +101,20 @@ def configure(conf):
conf.DEFINE('_XOPEN_SOURCE_EXTENDED', 1, add_to_cflags=True)
conf.DEFINE('LIBREPLACE_NETWORK_CHECKS', 1)
- conf.CHECK_HEADERS('unistd.h sys/types.h stdlib.h stdio.h stddef.h')
- conf.CHECK_HEADERS('ctype.h locale.h acl/libacl.h compat.h')
+ conf.CHECK_HEADERS('stdio.h sys/types.h sys/stat.h stdlib.h stddef.h memory.h string.h', add_headers=True)
+ conf.CHECK_HEADERS('strings.h inttypes.h stdint.h unistd.h minix/config.h', add_headers=True)
+ conf.CHECK_HEADERS('ctype.h standards.h stdbool.h stdint.h stdarg.h vararg.h', add_headers=True)
+ conf.CHECK_HEADERS('crypt.h locale.h acl/libacl.h compat.h')
conf.CHECK_HEADERS('acl/libacl.h attr/xattr.h compat.h ctype.h dustat.h')
conf.CHECK_HEADERS('fcntl.h fnmatch.h glob.h history.h krb5.h langinfo.h')
- conf.CHECK_HEADERS('libaio.h locale.h ndir.h net/if.h pwd.h readline.h')
- conf.CHECK_HEADERS('readline/history.h readline/readline.h shadow.h sys/acl.h')
+ conf.CHECK_HEADERS('libaio.h locale.h ndir.h net/if.h pwd.h')
+ conf.CHECK_HEADERS('shadow.h sys/acl.h')
conf.CHECK_HEADERS('sys/attributes.h sys/capability.h sys/dir.h sys/epoll.h')
conf.CHECK_HEADERS('sys/fcntl.h sys/filio.h sys/filsys.h sys/fs/s5param.h sys/fs/vx/quota.h')
conf.CHECK_HEADERS('sys/id.h sys/ioctl.h sys/ipc.h sys/mman.h sys/mode.h sys/ndir.h sys/priv.h')
conf.CHECK_HEADERS('sys/resource.h sys/security.h sys/shm.h sys/statfs.h sys/statvfs.h sys/termio.h')
conf.CHECK_HEADERS('sys/vfs.h sys/xattr.h termio.h termios.h')
conf.CHECK_HEADERS('sys/wait.h sys/stat.h malloc.h grp.h')
- conf.CHECK_HEADERS('crypt.h dlfcn.h dl.h standards.h stdbool.h stdint.h')
conf.CHECK_HEADERS('sys/select.h setjmp.h utime.h sys/syslog.h syslog.h')
conf.CHECK_HEADERS('sys/time.h time.h stdarg.h vararg.h sys/mount.h mntent.h')
conf.CHECK_HEADERS('stropts.h unix.h string.h strings.h sys/param.h limits.h')
@@ -170,7 +171,8 @@ def configure(conf):
conf.CHECK_TYPE_IN('struct ifaddrs', 'ifaddrs.h')
conf.CHECK_TYPE_IN('struct addrinfo', 'netdb.h')
conf.CHECK_TYPE_IN('struct sockaddr', 'sys/socket.h')
- conf.CHECK_CODE('struct sockaddr_in6 x', define='HAVE_STRUCT_SOCKADDR_IN6')
+ conf.CHECK_CODE('struct sockaddr_in6 x', define='HAVE_STRUCT_SOCKADDR_IN6',
+ headers='sys/socket.h netdb.h netinet/in.h')
conf.CHECK_TYPE_IN('struct sockaddr_storage', 'sys/socket.h')
conf.CHECK_TYPE_IN('sa_family_t', 'sys/socket.h')
@@ -178,7 +180,8 @@ def configure(conf):
conf.CHECK_FUNCS_IN('''inet_ntoa inet_aton inet_ntop inet_pton connect gethostbyname
getaddrinfo getnameinfo freeaddrinfo gai_strerror''',
- 'socket nsl', checklibc=True)
+ 'socket nsl', checklibc=True,
+ headers='sys/socket.h netinet/in.h arpa/inet.h')
conf.CHECK_CODE('''
struct sockaddr_storage sa_store;
@@ -192,7 +195,8 @@ def configure(conf):
}
freeaddrinfo(ai);
''',
- define='HAVE_IPV6')
+ define='HAVE_IPV6',
+ headers='sys/socket.h netdb.h netinet/in.h')
# check if signal() takes a void function
if conf.CHECK_CODE('return *(signal (0, 0)) (0) == 1', define='RETSIGTYPE_INT', msg='Checking return type of signal handlers'):
@@ -200,16 +204,19 @@ def configure(conf):
else:
conf.DEFINE('RETSIGTYPE', 'void')
+ # these may be builtins, so we need the link=False strategy
+ conf.CHECK_FUNCS('strdup memmem printf memset memcpy memmove strcpy strncpy bzero', link=False)
+
conf.CHECK_FUNCS('shl_load shl_unload shl_findsym')
conf.CHECK_FUNCS('pipe strftime srandom random srand rand usleep setbuffer')
conf.CHECK_FUNCS('lstat getpgrp utime utimes seteuid setresuid setegid')
- conf.CHECK_FUNCS('setresgid chroot bzero strerror vsyslog setlinebuf mktime')
+ conf.CHECK_FUNCS('setresgid chroot strerror vsyslog setlinebuf mktime')
conf.CHECK_FUNCS('ftruncate chsize rename waitpid wait4 strlcpy strlcat')
- conf.CHECK_FUNCS('initgroups memmove strdup pread pwrite strndup strcasestr')
+ conf.CHECK_FUNCS('initgroups pread pwrite strndup strcasestr')
conf.CHECK_FUNCS('strtok_r mkdtemp dup2 dprintf vdprintf isatty chown lchown')
conf.CHECK_FUNCS('link readlink symlink realpath fdatasync snprintf vsnprintf')
conf.CHECK_FUNCS('asprintf vasprintf setenv unsetenv strnlen strtoull __strtoull')
- conf.CHECK_FUNCS('strtouq strtoll __strtoll strtoq memmem printf memset memcpy')
+ conf.CHECK_FUNCS('strtouq strtoll __strtoll strtoq')
conf.CHECK_FUNCS('if_nametoindex socketpair')
conf.CHECK_FUNCS('dirfd getdirentries getdents syslog')
conf.CHECK_FUNCS('gai_strerror get_current_dir_name')
@@ -217,21 +224,25 @@ def configure(conf):
conf.CHECK_FUNCS('getgrent_r getgrgid_r getgrnam_r getgrouplist getpagesize')
conf.CHECK_FUNCS('getpwent_r getpwnam_r getpwuid_r epoll_create')
- conf.CHECK_FUNCS_IN('dlopen dlsym dlerror dlclose', 'dl', checklibc=True)
+ conf.CHECK_FUNCS_IN('dlopen dlsym dlerror dlclose', 'dl', checklibc=True, headers='dlfcn.h dl.h')
conf.CHECK_FUNCS_IN('poptGetContext', 'popt')
- conf.CHECK_FUNCS_IN('res_search', 'resolv', checklibc=True)
+ conf.CHECK_FUNCS_IN('res_search', 'resolv', checklibc=True,
+ headers='netinet/in.h arpa/nameser.h resolv.h')
conf.CHECK_FUNCS_IN('gettext', 'intl', checklibc=True)
- conf.CHECK_FUNCS_IN('pthread_create', 'pthread', checklibc=True, header='pthread.h')
+ conf.CHECK_FUNCS_IN('pthread_create', 'pthread', checklibc=True, headers='pthread.h')
conf.CHECK_FUNCS_IN('crypt', 'crypt', checklibc=True)
- conf.CHECK_VARIABLE('rl_event_hook', define='HAVE_DECL_RL_EVENT_HOOK', always=True)
+ conf.CHECK_VARIABLE('rl_event_hook', define='HAVE_DECL_RL_EVENT_HOOK', always=True,
+ headers='readline.h readline/readline.h readline/history.h')
conf.CHECK_VARIABLE('__FUNCTION__', define='HAVE_FUNCTION_MACRO')
conf.CHECK_DECLS('snprintf vsnprintf asprintf vasprintf')
- conf.CHECK_DECLS('dirfd environ errno getgrent_r getpwent_r', reverse=True)
+ conf.CHECK_DECLS('dirfd', reverse=True, headers='dirent.h')
+ conf.CHECK_DECLS('errno', headers='errno.h', reverse=True)
+ conf.CHECK_DECLS('environ getgrent_r getpwent_r', reverse=True, headers='pwd.h grp.h')
conf.CHECK_DECLS('pread pwrite setenv setresgid setresuid', reverse=True)
conf.CHECK_SIZEOF('char int "long long" long off_t short size_t ssize_t')
@@ -257,7 +268,7 @@ def configure(conf):
addmain=False,
msg="Checking for C99 vsnprintf")
- if Options.options.pedantic:
+ if Options.options.pedantic and conf.CHECK_CFLAGS('-W'):
conf.ADD_CFLAGS('-W')
conf.SAMBA_CONFIG_H()
@@ -296,16 +307,18 @@ def configure(conf):
''',
define='HAVE_IMMEDIATE_STRUCTURES')
- conf.CHECK_CODE('mkdir("foo",0777)', define='HAVE_MKDIR_MODE')
+ conf.CHECK_CODE('mkdir("foo",0777)', define='HAVE_MKDIR_MODE', headers='sys/stat.h')
- conf.CHECK_STRUCTURE_MEMBER('struct stat', 'st_mtim.tv_nsec', define='HAVE_STAT_TV_NSEC')
+ conf.CHECK_STRUCTURE_MEMBER('struct stat', 'st_mtim.tv_nsec', define='HAVE_STAT_TV_NSEC',
+ headers='sys/stat.h')
# we need the st_rdev test under two names
- conf.CHECK_STRUCTURE_MEMBER('struct stat', 'st_rdev', define='HAVE_STRUCT_STAT_ST_RDEV')
- conf.CHECK_STRUCTURE_MEMBER('struct stat', 'st_rdev', define='HAVE_ST_RDEV')
- conf.CHECK_STRUCTURE_MEMBER('struct sockaddr_storage', 'ss_family')
+ conf.CHECK_STRUCTURE_MEMBER('struct stat', 'st_rdev', define='HAVE_STRUCT_STAT_ST_RDEV',
+ headers='sys/stat.h')
+ conf.CHECK_STRUCTURE_MEMBER('struct stat', 'st_rdev', define='HAVE_ST_RDEV', headers='sys/stat.h')
+ conf.CHECK_STRUCTURE_MEMBER('struct sockaddr_storage', 'ss_family', headers='sys/socket.h netinet/in.h')
conf.CHECK_CODE('struct sockaddr_un sunaddr; sunaddr.sun_family = AF_UNIX;',
- define='HAVE_UNIXSOCKET')
+ define='HAVE_UNIXSOCKET', headers='sys/socket.h sys/un.h')
conf.CHECK_CODE('''
@@ -322,7 +335,8 @@ def configure(conf):
execute=True,
mandatory=True) # lets see if we get a mandatory failure for this one
- if conf.CHECK_CFLAGS('-fvisibility=hidden', 'VISIBILITY_CFLAGS'):
+ if conf.CHECK_CFLAGS('-fvisibility=hidden'):
+ conf.env.VISIBILITY_CFLAGS = '-fvisibility=hidden'
conf.CHECK_CODE('''void vis_foo1(void) {}
__attribute__((visibility("default"))) void vis_foo2(void) {}''',
cflags=conf.env.VISIBILITY_CFLAGS,
diff --git a/lib/tevent/wscript b/lib/tevent/wscript
index 0a6f01163e..6d7414addb 100644
--- a/lib/tevent/wscript
+++ b/lib/tevent/wscript
@@ -18,8 +18,8 @@ def configure(conf):
conf.sub_config(LIBREPLACE_DIR)
conf.sub_config(LIBTALLOC_DIR)
- conf.CHECK_HEADERS('sys/epoll.h')
- conf.CHECK_FUNCS('epoll_create')
+ if conf.CHECK_FUNCS('epoll_create', headers='sys/epoll.h'):
+ conf.DEFINE('HAVE_EPOLL', 1)
conf.SAMBA_CONFIG_H()
diff --git a/lib/util/charset/wscript_configure b/lib/util/charset/wscript_configure
index 4dbb46d0fb..0322bea446 100644
--- a/lib/util/charset/wscript_configure
+++ b/lib/util/charset/wscript_configure
@@ -1,10 +1,2 @@
-conf.CHECK_HEADERS('iconv.h')
-
-conf.CHECK_FUNCS_IN('iconv_open', 'iconv', checklibc=True)
-
-conf.CHECK_CODE('''
- iconv_t cd = iconv_open("ASCII","UCS-2LE");
- if (cd == 0 || cd == (iconv_t)-1) return -1;
- ''',
- define='HAVE_NATIVE_ICONV')
-
+if conf.CHECK_FUNCS_IN('iconv_open', 'iconv', checklibc=True, headers='iconv.h'):
+ conf.DEFINE('HAVE_NATIVE_ICONV', 1)
diff --git a/lib/util/wscript_configure b/lib/util/wscript_configure
index 44c73dac7a..eb38aa8bde 100644
--- a/lib/util/wscript_configure
+++ b/lib/util/wscript_configure
@@ -1,15 +1,12 @@
-conf.CHECK_HEADERS('execinfo.h')
-
# backtrace could be in libexecinfo or in libc
-conf.CHECK_FUNCS_IN('backtrace', 'execinfo', checklibc=True)
+conf.CHECK_FUNCS_IN('backtrace', 'execinfo', checklibc=True, headers='execinfo.h')
conf.CHECK_FUNCS('sigprocmask sigblock sigaction')
-conf.CHECK_HEADERS('sys/attributes.h attr/xattr.h sys/xattr.h')
-conf.CHECK_FUNCS_IN('flistxattr', 'attr', checklibc=True)
+conf.CHECK_FUNCS_IN('flistxattr', 'attr', checklibc=True, headers='sys/attributes.h attr/xattr.h sys/xattr.h')
-conf.CHECK_STRUCTURE_MEMBER('struct statvfs', 'f_frsize', define='HAVE_FRSIZE')
+conf.CHECK_STRUCTURE_MEMBER('struct statvfs', 'f_frsize', define='HAVE_FRSIZE', headers='sys/statvfs.h')
conf.CHECK_CODE('getxattr(NULL, NULL, NULL, 0, 0, 0)',
define='XATTR_ADDITIONAL_OPTIONS')
@@ -17,8 +14,6 @@ conf.CHECK_CODE('getxattr(NULL, NULL, NULL, 0, 0, 0)',
if conf.CONFIG_SET('HAVE_FLISTXATTR'):
conf.DEFINE('HAVE_XATTR_SUPPORT', 1)
-conf.CHECK_HEADERS('sys/statvfs.h')
-
conf.CHECK_CODE('struct statvfs64 fsd; exit(statvfs64 (".", &fsd))',
define='STAT_STATVFS64',
headers='unistd.h sys/types.h sys/statvfs.h',
diff --git a/source4/heimdal_build/wscript_configure b/source4/heimdal_build/wscript_configure
index 83d171cbee..0f28f23e55 100644
--- a/source4/heimdal_build/wscript_configure
+++ b/source4/heimdal_build/wscript_configure
@@ -9,7 +9,7 @@ conf.CHECK_HEADERS('''crypt.h errno.h inttypes.h netdb.h signal.h sys/bswap.h
sys/utsname.h time.h timezone.h ttyname.h netinet/in.h
netinet/in6.h netinet6/in6.h libintl.h''')
-conf.CHECK_HEADERS('curses.h term.h termcap.h', add_headers=False)
+conf.CHECK_HEADERS('curses.h term.h termcap.h')
conf.CHECK_FUNCS('''atexit cgetent getprogname setprogname gethostname
putenv rcmd readv sendmsg setitimer strlwr strncasecmp
@@ -23,27 +23,25 @@ conf.CHECK_FUNCS_IN('''getnameinfo sendmsg socket getipnodebyname gethostent get
'socket nsl',
checklibc=True)
-conf.CHECK_FUNCS('iruserok', checklink=True)
+conf.CHECK_FUNCS('iruserok')
conf.CHECK_FUNCS('bswap16')
conf.CHECK_FUNCS('bswap32')
-conf.CHECK_TYPE('struct winsize', define='HAVE_STRUCT_WINSIZE')
+conf.CHECK_TYPE('struct winsize', define='HAVE_STRUCT_WINSIZE', headers='sys/termios.h sys/ioctl.h')
conf.DEFINE('HAVE_KRB_STRUCT_WINSIZE', 1)
conf.DEFINE('VOID_RETSIGTYPE', 1)
-conf.CHECK_VARIABLE('h_errno')
+conf.CHECK_VARIABLE('h_errno', headers='netdb.h')
# strangely enough, we need it with another define too
-conf.CHECK_DECLS('h_errno')
+conf.CHECK_DECLS('h_errno', headers='netdb.h')
-conf.CHECK_DECLS('_res')
-
-conf.CHECK_HEADERS('arpa/nameser.h dns.h')
-conf.CHECK_FUNCS_IN('res_search res_nsearch res_ndestroy dns_search dn_expand', 'resolv', checklibc=True)
-conf.CHECK_VARIABLE('_res')
-conf.CHECK_HEADERS('pty.h util.h libutil.h')
-conf.CHECK_FUNCS_IN('openpty', 'util', checklibc=True)
+conf.CHECK_FUNCS_IN('res_search res_nsearch res_ndestroy dns_search dn_expand', 'resolv',
+ checklibc=True, headers='netinet/in.h arpa/nameser.h resolv.h dns.h')
+conf.CHECK_VARIABLE('_res', headers='netinet/in.h arpa/nameser.h resolv.h')
+conf.CHECK_DECLS('_res', headers='netinet/in.h arpa/nameser.h resolv.h')
+conf.CHECK_FUNCS_IN('openpty', 'util', checklibc=True, headers='pty.h util.h libutil.h')
conf.DEFINE('HAVE_KRB5',1)
conf.DEFINE('HAVE_GSSAPI',1)
diff --git a/source4/lib/ldb/wscript b/source4/lib/ldb/wscript
index 053d11200f..92cefab8af 100644
--- a/source4/lib/ldb/wscript
+++ b/source4/lib/ldb/wscript
@@ -19,7 +19,7 @@ def configure(conf):
conf.sub_config(LIBTEVENT_DIR)
# where does the default LIBDIR end up? in conf.env somewhere?
#
- conf.CONFIG_PATH('LDB_MODULESDIR', conf.SUBST_ENV_VAR('LIBDIR') + '/ldb')
+ conf.CONFIG_PATH('LDB_MODULESDIR', conf.SUBST_ENV_VAR('MODULESDIR') + '/ldb')
conf.SAMBA_CONFIG_H()
def build(bld):
diff --git a/source4/lib/tls/wscript b/source4/lib/tls/wscript
index 45fa55aaef..a993848cf9 100644
--- a/source4/lib/tls/wscript
+++ b/source4/lib/tls/wscript
@@ -15,15 +15,12 @@ def configure(conf):
if 'HAVE_GNUTLS' in conf.env and not Options.options.disable_gnutls:
conf.DEFINE('ENABLE_GNUTLS', 1)
- conf.CHECK_FUNCS_IN('gnutls_global_init', 'gnutls', header='gnutls/gnutls.h')
-
- conf.CHECK_HEADERS('gnutls/gnutls.h')
+ conf.CHECK_FUNCS_IN('gnutls_global_init', 'gnutls', headers='gnutls/gnutls.h')
# check for gnutls_datum types
- conf.CHECK_TYPES('gnutls_datum gnutls_datum_t')
+ conf.CHECK_TYPES('gnutls_datum gnutls_datum_t', headers='gnutls/gnutls.h')
- conf.CHECK_HEADERS('gcrypt.h')
- conf.CHECK_FUNCS_IN('gcry_control', 'gcrypt')
+ conf.CHECK_FUNCS_IN('gcry_control', 'gcrypt', headers='gcrypt.h')
conf.CHECK_FUNCS_IN('gpg_err_code_from_errno', 'gpg-error')