def set_options(opt):
opt.BUILTIN_DEFAULT('NONE')
- opt.BUNDLED_EXTENSION_DEFAULT('')
+ opt.PRIVATE_EXTENSION_DEFAULT('')
opt.RECURSE('buildtools/wafsamba')
@wafsamba.runonce
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')
+ #Some OS (ie. freebsd) return EINVAL if the convertion could not be done, it's not what we expect
+ #Let's detect those cases
+ if conf.CONFIG_SET('HAVE_STRTOLL'):
+ conf.CHECK_CODE('''
+ long long nb = strtoll("Text", NULL, 0);
+ if (errno == EINVAL) {
+ return 0;
+ } else {
+ return 1;
+ }
+ ''',
+ msg="Checking correct behavior of strtoll",
+ headers = 'errno.h',
+ execute = True,
+ define_ret = True,
+ define = 'HAVE_BSD_STRTOLL',
+ )
conf.CHECK_FUNCS('if_nametoindex strerror_r')
conf.CHECK_FUNCS('getdirentries getdents syslog')
conf.CHECK_FUNCS('gai_strerror get_current_dir_name')
addmain=False,
msg='Checking for working strptime'):
conf.DEFINE('REPLACE_STRPTIME', 1)
+ else:
+ conf.CHECK_CODE('''
+ const char *s = "20070414101546Z";
+ char *ret;
+ struct tm t;
+ memset(&t, 0, sizeof(t));
+ ret = strptime(s, "%Y%m%d%H%M%S", &t);
+ if (ret == NULL || t.tm_wday != 6) {
+ return 0;
+ } else {
+ return 1;
+ }
+ ''',
+ msg="Checking correct behavior of strptime",
+ headers = 'time.h',
+ execute = True,
+ define_ret = True,
+ define = 'REPLACE_STRPTIME',
+ )
if conf.CONFIG_SET('HAVE_KRB5_H'):
# Check for KRB5_DEPRECATED handling
# libraries are loaded, but this doesn't appear to work
# at the moment:
# hide_symbols=bld.BUILTIN_LIBRARY('replace'),
+ private_library=True,
deps='crypt dl nsl socket rt')
TEST_SOURCES = '''test/testsuite.c test/main.c test/strptime.c