summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--buildtools/wafsamba/samba_autoconf.py77
-rw-r--r--lib/replace/wscript33
-rw-r--r--nsswitch/wscript_configure5
-rw-r--r--source4/heimdal_build/wscript_configure6
-rw-r--r--source4/lib/tls/wscript7
5 files changed, 99 insertions, 29 deletions
diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index b5da80f3a6a..5a733b6f593 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -69,14 +69,26 @@ def CHECK_HEADER(conf, h, add_headers=False):
@conf
-def CHECK_HEADERS(conf, headers, add_headers=False):
- '''check for a list of headers'''
+def CHECK_HEADERS(conf, headers, add_headers=False, together=False):
+ '''check for a list of headers
+
+ when together==True, then the headers accumulate within this test.
+ This is useful for interdependent headers
+ '''
ret = True
+ if not add_headers and together:
+ saved_hlist = conf.env.hlist[:]
+ set_add_headers = True
+ else:
+ set_add_headers = add_headers
for hdr in TO_LIST(headers):
- if not CHECK_HEADER(conf, hdr, add_headers):
+ if not CHECK_HEADER(conf, hdr, set_add_headers):
ret = False
+ if not add_headers and together:
+ conf.env.hlist = saved_hlist
return ret
+
def header_list(conf, headers=None):
'''form a list of headers which exist, as a string'''
hlist=[]
@@ -166,7 +178,7 @@ def CHECK_DECLS(conf, vars, reverse=False, headers=None):
return ret
-def CHECK_FUNC(conf, f, link=None, lib='c', headers=None):
+def CHECK_FUNC(conf, f, link=None, lib=None, headers=None):
'''check for a function'''
define='HAVE_%s' % f.upper()
@@ -205,7 +217,7 @@ def CHECK_FUNC(conf, f, link=None, lib='c', headers=None):
@conf
-def CHECK_FUNCS(conf, list, link=None, lib='c', headers=None):
+def CHECK_FUNCS(conf, list, link=None, lib=None, headers=None):
'''check for a list of functions'''
ret = True
for f in TO_LIST(list):
@@ -241,7 +253,7 @@ def CHECK_CODE(conf, code, define,
always=False, execute=False, addmain=True,
add_headers=True, mandatory=False,
headers=None, msg=None, cflags='', includes='# .',
- local_include=True, lib='c', link=True,
+ local_include=True, lib=None, link=True,
define_ret=False, quote=False):
'''check if some code compiles and/or runs'''
@@ -261,9 +273,9 @@ def CHECK_CODE(conf, code, define,
execute = 0
if addmain:
- fragment='#include "__confdefs.h"\n%s\n int main(void) { %s; return 0; }' % (hdrs, code)
+ fragment='#include "__confdefs.h"\n%s\n int main(void) { %s; return 0; }\n' % (hdrs, code)
else:
- fragment='#include "__confdefs.h"\n%s\n%s' % (hdrs, code)
+ fragment='#include "__confdefs.h"\n%s\n%s\n' % (hdrs, code)
conf.write_config_header('__confdefs.h', top=True)
@@ -281,17 +293,27 @@ def CHECK_CODE(conf, code, define,
else:
type='cprogram'
- if conf.check(fragment=fragment,
- execute=execute,
- define_name = define,
- mandatory = mandatory,
- ccflags=TO_LIST(cflags),
- includes=includes,
- lib=lib, # how do I make this conditional, so I can avoid the -lc?
- type=type,
- msg=msg,
- quote=quote,
- define_ret=define_ret):
+ if lib is not None:
+ uselib = TO_LIST(lib)
+ else:
+ uselib = []
+
+ ret = conf.check(fragment=fragment,
+ execute=execute,
+ define_name = define,
+ mandatory = mandatory,
+ ccflags=TO_LIST(cflags),
+ includes=includes,
+ uselib=uselib,
+ type=type,
+ msg=msg,
+ quote=quote,
+ define_ret=define_ret)
+ if not ret and CONFIG_SET(conf, define):
+ # sometimes conf.check() returns false, but it
+ # sets the define. Maybe a waf bug?
+ ret = True
+ if ret:
if not define_ret:
conf.DEFINE(define, 1)
return True
@@ -431,6 +453,23 @@ def CHECK_C_PROTOTYPE(conf, function, prototype, define, headers=None):
msg='Checking C prototype for %s' % function)
+@conf
+def CHECK_LARGEFILE(conf):
+ '''see what we need for largefile support'''
+ if conf.CHECK_CODE('return !(sizeof(off_t) >= 8)',
+ 'HAVE_LARGEFILE',
+ execute=True,
+ msg='Checking for large file support'):
+ return True
+ if conf.CHECK_CODE('return !(sizeof(off_t) >= 8)',
+ 'HAVE_LARGEFILE',
+ execute=True,
+ cflags='-D_FILE_OFFSET_BITS=64',
+ msg='Checking for -D_FILE_OFFSET_BITS=64'):
+ conf.DEFINE('_FILE_OFFSET_BITS', 64)
+ return True
+ return False
+
#################################################
diff --git a/lib/replace/wscript b/lib/replace/wscript
index b4ef65d28c7..39e75c06c7a 100644
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -81,7 +81,6 @@ def configure(conf):
execute=True,
msg='Checking simple C program')
-
# check for rpath
if not conf.env.DISABLE_SHARED and conf.CHECK_RPATH_SUPPORT():
conf.env.RPATH_ON_BUILD = not Options.options.disable_rpath_build
@@ -101,9 +100,15 @@ def configure(conf):
conf.DEFINE('_XOPEN_SOURCE_EXTENDED', 1, add_to_cflags=True)
conf.DEFINE('LIBREPLACE_NETWORK_CHECKS', 1)
- conf.CHECK_HEADERS('stdio.h sys/types.h sys/stat.h stdlib.h stddef.h memory.h string.h', add_headers=True)
+ # get the base headers we'll use for the rest of the tests
+ 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)
+
+ # see if we need special largefile flags
+ conf.CHECK_LARGEFILE()
+
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')
@@ -180,9 +185,9 @@ def configure(conf):
conf.CHECK_TYPE_IN('sig_atomic_t', 'signal.h', define='HAVE_SIG_ATOMIC_T_TYPE')
conf.CHECK_FUNCS_IN('''inet_ntoa inet_aton inet_ntop inet_pton connect gethostbyname
- getaddrinfo getnameinfo freeaddrinfo gai_strerror''',
+ getaddrinfo getnameinfo freeaddrinfo gai_strerror socketpair''',
'socket nsl', checklibc=True,
- headers='sys/socket.h netinet/in.h arpa/inet.h')
+ headers='sys/socket.h netinet/in.h arpa/inet.h netdb.h')
conf.CHECK_CODE('''
struct sockaddr_storage sa_store;
@@ -197,6 +202,7 @@ def configure(conf):
freeaddrinfo(ai);
''',
define='HAVE_IPV6',
+ lib='nsl socket',
headers='sys/socket.h netdb.h netinet/in.h')
# check if signal() takes a void function
@@ -218,7 +224,7 @@ def configure(conf):
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')
- conf.CHECK_FUNCS('if_nametoindex socketpair')
+ conf.CHECK_FUNCS('if_nametoindex')
conf.CHECK_FUNCS('dirfd getdirentries getdents syslog')
conf.CHECK_FUNCS('gai_strerror get_current_dir_name')
conf.CHECK_FUNCS('timegm getifaddrs freeifaddrs mmap setgroups setsid')
@@ -229,7 +235,7 @@ def configure(conf):
conf.CHECK_FUNCS_IN('poptGetContext', 'popt')
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('gettext', 'intl', checklibc=True, headers='libintl.h')
conf.CHECK_FUNCS_IN('pthread_create', 'pthread', checklibc=True, headers='pthread.h')
conf.CHECK_FUNCS_IN('crypt', 'crypt', checklibc=True)
@@ -252,6 +258,15 @@ def configure(conf):
if conf.CONFIG_SET('HAVE_EPOLL_CREATE') and conf.CONFIG_SET('HAVE_SYS_EPOLL_H'):
conf.DEFINE('HAVE_EPOLL', 1)
+ if not conf.CHECK_CODE('''#define LIBREPLACE_CONFIGURE_TEST_STRPTIME
+ #include "$libreplacedir/test/strptime.c"''',
+ define='HAVE_STRPTIME',
+ msg='Checking for working strptime'):
+ conf.DEFINE('REPLACE_STRPTIME', 1)
+
+
+
+
conf.CHECK_CODE('va_list ap1,ap2; va_copy(ap1,ap2)',
define="HAVE_VA_COPY",
msg="Checking for va_copy")
@@ -290,6 +305,7 @@ def configure(conf):
#include "test/getifaddrs.c"
''' % method,
method,
+ lib='nsl socket',
addmain=False,
execute=True):
break
@@ -367,6 +383,10 @@ def build(bld):
REPLACE_SOURCE = 'replace.c snprintf.c'
+
+ if bld.CONFIG_SET('REPLACE_STRPTIME'):
+ REPLACE_SOURCE += ' strptime.c'
+
bld.SAMBA_LIBRARY('replace',
source=REPLACE_SOURCE,
group='base_libraries',
@@ -375,6 +395,7 @@ def build(bld):
TEST_SOURCES = '''test/testsuite.c test/main.c test/strptime.c
test/os2_delete.c test/getifaddrs.c'''
+
bld.SAMBA_BINARY('replace_testsuite',
TEST_SOURCES,
deps='replace',
diff --git a/nsswitch/wscript_configure b/nsswitch/wscript_configure
index cb559581e72..3305bbf44e9 100644
--- a/nsswitch/wscript_configure
+++ b/nsswitch/wscript_configure
@@ -1,5 +1,4 @@
conf.CHECK_HEADERS('nss.h nss_common.h ns_api.h')
-conf.CHECK_HEADERS('security/pam_appl.h')
-conf.CHECK_FUNCS_IN('pam_start', 'pam', checklibc=True)
-conf.CHECK_HEADERS('security/pam_modules.h pam/pam_modules.h')
+conf.CHECK_HEADERS('security/pam_appl.h security/pam_modules.h pam/pam_modules.h', together=True)
+conf.CHECK_FUNCS_IN('pam_start', 'pam', checklibc=True, headers='security/pam_appl.h')
diff --git a/source4/heimdal_build/wscript_configure b/source4/heimdal_build/wscript_configure
index 0f28f23e55b..d3a2cb72539 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')
+conf.CHECK_HEADERS('curses.h term.h termcap.h', together=True)
conf.CHECK_FUNCS('''atexit cgetent getprogname setprogname gethostname
putenv rcmd readv sendmsg setitimer strlwr strncasecmp
@@ -29,6 +29,10 @@ conf.CHECK_FUNCS('bswap16')
conf.CHECK_FUNCS('bswap32')
conf.CHECK_TYPE('struct winsize', define='HAVE_STRUCT_WINSIZE', headers='sys/termios.h sys/ioctl.h')
+conf.CHECK_STRUCTURE_MEMBER('struct winsize', 'ws_xpixel',
+ define='HAVE_WS_XPIXEL', headers='sys/termios.h sys/ioctl.h')
+conf.CHECK_STRUCTURE_MEMBER('struct winsize', 'ws_ypixel',
+ define='HAVE_WS_YPIXEL', headers='sys/termios.h sys/ioctl.h')
conf.DEFINE('HAVE_KRB_STRUCT_WINSIZE', 1)
conf.DEFINE('VOID_RETSIGTYPE', 1)
diff --git a/source4/lib/tls/wscript b/source4/lib/tls/wscript
index a993848cf99..66cc762b988 100644
--- a/source4/lib/tls/wscript
+++ b/source4/lib/tls/wscript
@@ -17,6 +17,13 @@ def configure(conf):
conf.CHECK_FUNCS_IN('gnutls_global_init', 'gnutls', headers='gnutls/gnutls.h')
+ conf.CHECK_VARIABLE('gnutls_x509_crt_set_version',
+ headers='gnutls/gnutls.h gnutls/x509.h',
+ define='HAVE_GNUTLS_X509_CRT_SET_VERSION')
+ conf.CHECK_VARIABLE('gnutls_x509_crt_set_subject_key_id',
+ headers='gnutls/gnutls.h gnutls/x509.h',
+ define='HAVE_GNUTLS_X509_CRT_SET_SUBJECT_KEY_ID')
+
# check for gnutls_datum types
conf.CHECK_TYPES('gnutls_datum gnutls_datum_t', headers='gnutls/gnutls.h')