Commit 8d3b3a49 authored by Mathieu Parent's avatar Mathieu Parent

New upstream version 0.9.33

parent 82e11f0d
_tevent_add_fd: struct tevent_fd *(struct tevent_context *, TALLOC_CTX *, int, uint16_t, tevent_fd_handler_t, void *, const char *, const char *)
_tevent_add_signal: struct tevent_signal *(struct tevent_context *, TALLOC_CTX *, int, int, tevent_signal_handler_t, void *, const char *, const char *)
_tevent_add_timer: struct tevent_timer *(struct tevent_context *, TALLOC_CTX *, struct timeval, tevent_timer_handler_t, void *, const char *, const char *)
_tevent_create_immediate: struct tevent_immediate *(TALLOC_CTX *, const char *)
_tevent_loop_once: int (struct tevent_context *, const char *)
_tevent_loop_until: int (struct tevent_context *, bool (*)(void *), void *, const char *)
_tevent_loop_wait: int (struct tevent_context *, const char *)
_tevent_queue_create: struct tevent_queue *(TALLOC_CTX *, const char *, const char *)
_tevent_req_callback_data: void *(struct tevent_req *)
_tevent_req_cancel: bool (struct tevent_req *, const char *)
_tevent_req_create: struct tevent_req *(TALLOC_CTX *, void *, size_t, const char *, const char *)
_tevent_req_data: void *(struct tevent_req *)
_tevent_req_done: void (struct tevent_req *, const char *)
_tevent_req_error: bool (struct tevent_req *, uint64_t, const char *)
_tevent_req_nomem: bool (const void *, struct tevent_req *, const char *)
_tevent_req_notify_callback: void (struct tevent_req *, const char *)
_tevent_req_oom: void (struct tevent_req *, const char *)
_tevent_schedule_immediate: void (struct tevent_immediate *, struct tevent_context *, tevent_immediate_handler_t, void *, const char *, const char *)
_tevent_threaded_schedule_immediate: void (struct tevent_threaded_context *, struct tevent_immediate *, tevent_immediate_handler_t, void *, const char *, const char *)
tevent_backend_list: const char **(TALLOC_CTX *)
tevent_cleanup_pending_signal_handlers: void (struct tevent_signal *)
tevent_common_add_fd: struct tevent_fd *(struct tevent_context *, TALLOC_CTX *, int, uint16_t, tevent_fd_handler_t, void *, const char *, const char *)
tevent_common_add_signal: struct tevent_signal *(struct tevent_context *, TALLOC_CTX *, int, int, tevent_signal_handler_t, void *, const char *, const char *)
tevent_common_add_timer: struct tevent_timer *(struct tevent_context *, TALLOC_CTX *, struct timeval, tevent_timer_handler_t, void *, const char *, const char *)
tevent_common_add_timer_v2: struct tevent_timer *(struct tevent_context *, TALLOC_CTX *, struct timeval, tevent_timer_handler_t, void *, const char *, const char *)
tevent_common_check_signal: int (struct tevent_context *)
tevent_common_context_destructor: int (struct tevent_context *)
tevent_common_fd_destructor: int (struct tevent_fd *)
tevent_common_fd_get_flags: uint16_t (struct tevent_fd *)
tevent_common_fd_set_close_fn: void (struct tevent_fd *, tevent_fd_close_fn_t)
tevent_common_fd_set_flags: void (struct tevent_fd *, uint16_t)
tevent_common_have_events: bool (struct tevent_context *)
tevent_common_loop_immediate: bool (struct tevent_context *)
tevent_common_loop_timer_delay: struct timeval (struct tevent_context *)
tevent_common_loop_wait: int (struct tevent_context *, const char *)
tevent_common_schedule_immediate: void (struct tevent_immediate *, struct tevent_context *, tevent_immediate_handler_t, void *, const char *, const char *)
tevent_common_threaded_activate_immediate: void (struct tevent_context *)
tevent_common_wakeup: int (struct tevent_context *)
tevent_common_wakeup_fd: int (int)
tevent_common_wakeup_init: int (struct tevent_context *)
tevent_context_init: struct tevent_context *(TALLOC_CTX *)
tevent_context_init_byname: struct tevent_context *(TALLOC_CTX *, const char *)
tevent_context_init_ops: struct tevent_context *(TALLOC_CTX *, const struct tevent_ops *, void *)
tevent_debug: void (struct tevent_context *, enum tevent_debug_level, const char *, ...)
tevent_fd_get_flags: uint16_t (struct tevent_fd *)
tevent_fd_set_auto_close: void (struct tevent_fd *)
tevent_fd_set_close_fn: void (struct tevent_fd *, tevent_fd_close_fn_t)
tevent_fd_set_flags: void (struct tevent_fd *, uint16_t)
tevent_get_trace_callback: void (struct tevent_context *, tevent_trace_callback_t *, void *)
tevent_loop_allow_nesting: void (struct tevent_context *)
tevent_loop_set_nesting_hook: void (struct tevent_context *, tevent_nesting_hook, void *)
tevent_num_signals: size_t (void)
tevent_queue_add: bool (struct tevent_queue *, struct tevent_context *, struct tevent_req *, tevent_queue_trigger_fn_t, void *)
tevent_queue_add_entry: struct tevent_queue_entry *(struct tevent_queue *, struct tevent_context *, struct tevent_req *, tevent_queue_trigger_fn_t, void *)
tevent_queue_add_optimize_empty: struct tevent_queue_entry *(struct tevent_queue *, struct tevent_context *, struct tevent_req *, tevent_queue_trigger_fn_t, void *)
tevent_queue_length: size_t (struct tevent_queue *)
tevent_queue_running: bool (struct tevent_queue *)
tevent_queue_start: void (struct tevent_queue *)
tevent_queue_stop: void (struct tevent_queue *)
tevent_queue_wait_recv: bool (struct tevent_req *)
tevent_queue_wait_send: struct tevent_req *(TALLOC_CTX *, struct tevent_context *, struct tevent_queue *)
tevent_re_initialise: int (struct tevent_context *)
tevent_register_backend: bool (const char *, const struct tevent_ops *)
tevent_req_default_print: char *(struct tevent_req *, TALLOC_CTX *)
tevent_req_defer_callback: void (struct tevent_req *, struct tevent_context *)
tevent_req_is_error: bool (struct tevent_req *, enum tevent_req_state *, uint64_t *)
tevent_req_is_in_progress: bool (struct tevent_req *)
tevent_req_poll: bool (struct tevent_req *, struct tevent_context *)
tevent_req_post: struct tevent_req *(struct tevent_req *, struct tevent_context *)
tevent_req_print: char *(TALLOC_CTX *, struct tevent_req *)
tevent_req_received: void (struct tevent_req *)
tevent_req_reset_endtime: void (struct tevent_req *)
tevent_req_set_callback: void (struct tevent_req *, tevent_req_fn, void *)
tevent_req_set_cancel_fn: void (struct tevent_req *, tevent_req_cancel_fn)
tevent_req_set_cleanup_fn: void (struct tevent_req *, tevent_req_cleanup_fn)
tevent_req_set_endtime: bool (struct tevent_req *, struct tevent_context *, struct timeval)
tevent_req_set_print_fn: void (struct tevent_req *, tevent_req_print_fn)
tevent_sa_info_queue_count: size_t (void)
tevent_set_abort_fn: void (void (*)(const char *))
tevent_set_debug: int (struct tevent_context *, void (*)(void *, enum tevent_debug_level, const char *, va_list), void *)
tevent_set_debug_stderr: int (struct tevent_context *)
tevent_set_default_backend: void (const char *)
tevent_set_trace_callback: void (struct tevent_context *, tevent_trace_callback_t, void *)
tevent_signal_support: bool (struct tevent_context *)
tevent_thread_proxy_create: struct tevent_thread_proxy *(struct tevent_context *)
tevent_thread_proxy_schedule: void (struct tevent_thread_proxy *, struct tevent_immediate **, tevent_immediate_handler_t, void *)
tevent_threaded_context_create: struct tevent_threaded_context *(TALLOC_CTX *, struct tevent_context *)
tevent_timeval_add: struct timeval (const struct timeval *, uint32_t, uint32_t)
tevent_timeval_compare: int (const struct timeval *, const struct timeval *)
tevent_timeval_current: struct timeval (void)
tevent_timeval_current_ofs: struct timeval (uint32_t, uint32_t)
tevent_timeval_is_zero: bool (const struct timeval *)
tevent_timeval_set: struct timeval (uint32_t, uint32_t)
tevent_timeval_until: struct timeval (const struct timeval *, const struct timeval *)
tevent_timeval_zero: struct timeval (void)
tevent_trace_point_callback: void (struct tevent_context *, enum tevent_trace_point)
tevent_update_timer: void (struct tevent_timer *, struct timeval)
tevent_wakeup_recv: bool (struct tevent_req *)
tevent_wakeup_send: struct tevent_req *(TALLOC_CTX *, struct tevent_context *, struct timeval)
_tevent_add_fd: struct tevent_fd *(struct tevent_context *, TALLOC_CTX *, int, uint16_t, tevent_fd_handler_t, void *, const char *, const char *)
_tevent_add_signal: struct tevent_signal *(struct tevent_context *, TALLOC_CTX *, int, int, tevent_signal_handler_t, void *, const char *, const char *)
_tevent_add_timer: struct tevent_timer *(struct tevent_context *, TALLOC_CTX *, struct timeval, tevent_timer_handler_t, void *, const char *, const char *)
_tevent_create_immediate: struct tevent_immediate *(TALLOC_CTX *, const char *)
_tevent_loop_once: int (struct tevent_context *, const char *)
_tevent_loop_until: int (struct tevent_context *, bool (*)(void *), void *, const char *)
_tevent_loop_wait: int (struct tevent_context *, const char *)
_tevent_queue_create: struct tevent_queue *(TALLOC_CTX *, const char *, const char *)
_tevent_req_callback_data: void *(struct tevent_req *)
_tevent_req_cancel: bool (struct tevent_req *, const char *)
_tevent_req_create: struct tevent_req *(TALLOC_CTX *, void *, size_t, const char *, const char *)
_tevent_req_data: void *(struct tevent_req *)
_tevent_req_done: void (struct tevent_req *, const char *)
_tevent_req_error: bool (struct tevent_req *, uint64_t, const char *)
_tevent_req_nomem: bool (const void *, struct tevent_req *, const char *)
_tevent_req_notify_callback: void (struct tevent_req *, const char *)
_tevent_req_oom: void (struct tevent_req *, const char *)
_tevent_schedule_immediate: void (struct tevent_immediate *, struct tevent_context *, tevent_immediate_handler_t, void *, const char *, const char *)
_tevent_threaded_schedule_immediate: void (struct tevent_threaded_context *, struct tevent_immediate *, tevent_immediate_handler_t, void *, const char *, const char *)
tevent_backend_list: const char **(TALLOC_CTX *)
tevent_cleanup_pending_signal_handlers: void (struct tevent_signal *)
tevent_common_add_fd: struct tevent_fd *(struct tevent_context *, TALLOC_CTX *, int, uint16_t, tevent_fd_handler_t, void *, const char *, const char *)
tevent_common_add_signal: struct tevent_signal *(struct tevent_context *, TALLOC_CTX *, int, int, tevent_signal_handler_t, void *, const char *, const char *)
tevent_common_add_timer: struct tevent_timer *(struct tevent_context *, TALLOC_CTX *, struct timeval, tevent_timer_handler_t, void *, const char *, const char *)
tevent_common_add_timer_v2: struct tevent_timer *(struct tevent_context *, TALLOC_CTX *, struct timeval, tevent_timer_handler_t, void *, const char *, const char *)
tevent_common_check_signal: int (struct tevent_context *)
tevent_common_context_destructor: int (struct tevent_context *)
tevent_common_fd_destructor: int (struct tevent_fd *)
tevent_common_fd_get_flags: uint16_t (struct tevent_fd *)
tevent_common_fd_set_close_fn: void (struct tevent_fd *, tevent_fd_close_fn_t)
tevent_common_fd_set_flags: void (struct tevent_fd *, uint16_t)
tevent_common_have_events: bool (struct tevent_context *)
tevent_common_loop_immediate: bool (struct tevent_context *)
tevent_common_loop_timer_delay: struct timeval (struct tevent_context *)
tevent_common_loop_wait: int (struct tevent_context *, const char *)
tevent_common_schedule_immediate: void (struct tevent_immediate *, struct tevent_context *, tevent_immediate_handler_t, void *, const char *, const char *)
tevent_common_threaded_activate_immediate: void (struct tevent_context *)
tevent_common_wakeup: int (struct tevent_context *)
tevent_common_wakeup_fd: int (int)
tevent_common_wakeup_init: int (struct tevent_context *)
tevent_context_init: struct tevent_context *(TALLOC_CTX *)
tevent_context_init_byname: struct tevent_context *(TALLOC_CTX *, const char *)
tevent_context_init_ops: struct tevent_context *(TALLOC_CTX *, const struct tevent_ops *, void *)
tevent_debug: void (struct tevent_context *, enum tevent_debug_level, const char *, ...)
tevent_fd_get_flags: uint16_t (struct tevent_fd *)
tevent_fd_set_auto_close: void (struct tevent_fd *)
tevent_fd_set_close_fn: void (struct tevent_fd *, tevent_fd_close_fn_t)
tevent_fd_set_flags: void (struct tevent_fd *, uint16_t)
tevent_get_trace_callback: void (struct tevent_context *, tevent_trace_callback_t *, void *)
tevent_loop_allow_nesting: void (struct tevent_context *)
tevent_loop_set_nesting_hook: void (struct tevent_context *, tevent_nesting_hook, void *)
tevent_num_signals: size_t (void)
tevent_queue_add: bool (struct tevent_queue *, struct tevent_context *, struct tevent_req *, tevent_queue_trigger_fn_t, void *)
tevent_queue_add_entry: struct tevent_queue_entry *(struct tevent_queue *, struct tevent_context *, struct tevent_req *, tevent_queue_trigger_fn_t, void *)
tevent_queue_add_optimize_empty: struct tevent_queue_entry *(struct tevent_queue *, struct tevent_context *, struct tevent_req *, tevent_queue_trigger_fn_t, void *)
tevent_queue_length: size_t (struct tevent_queue *)
tevent_queue_running: bool (struct tevent_queue *)
tevent_queue_start: void (struct tevent_queue *)
tevent_queue_stop: void (struct tevent_queue *)
tevent_queue_wait_recv: bool (struct tevent_req *)
tevent_queue_wait_send: struct tevent_req *(TALLOC_CTX *, struct tevent_context *, struct tevent_queue *)
tevent_re_initialise: int (struct tevent_context *)
tevent_register_backend: bool (const char *, const struct tevent_ops *)
tevent_req_default_print: char *(struct tevent_req *, TALLOC_CTX *)
tevent_req_defer_callback: void (struct tevent_req *, struct tevent_context *)
tevent_req_is_error: bool (struct tevent_req *, enum tevent_req_state *, uint64_t *)
tevent_req_is_in_progress: bool (struct tevent_req *)
tevent_req_poll: bool (struct tevent_req *, struct tevent_context *)
tevent_req_post: struct tevent_req *(struct tevent_req *, struct tevent_context *)
tevent_req_print: char *(TALLOC_CTX *, struct tevent_req *)
tevent_req_received: void (struct tevent_req *)
tevent_req_reset_endtime: void (struct tevent_req *)
tevent_req_set_callback: void (struct tevent_req *, tevent_req_fn, void *)
tevent_req_set_cancel_fn: void (struct tevent_req *, tevent_req_cancel_fn)
tevent_req_set_cleanup_fn: void (struct tevent_req *, tevent_req_cleanup_fn)
tevent_req_set_endtime: bool (struct tevent_req *, struct tevent_context *, struct timeval)
tevent_req_set_print_fn: void (struct tevent_req *, tevent_req_print_fn)
tevent_sa_info_queue_count: size_t (void)
tevent_set_abort_fn: void (void (*)(const char *))
tevent_set_debug: int (struct tevent_context *, void (*)(void *, enum tevent_debug_level, const char *, va_list), void *)
tevent_set_debug_stderr: int (struct tevent_context *)
tevent_set_default_backend: void (const char *)
tevent_set_trace_callback: void (struct tevent_context *, tevent_trace_callback_t, void *)
tevent_signal_support: bool (struct tevent_context *)
tevent_thread_proxy_create: struct tevent_thread_proxy *(struct tevent_context *)
tevent_thread_proxy_schedule: void (struct tevent_thread_proxy *, struct tevent_immediate **, tevent_immediate_handler_t, void *)
tevent_threaded_context_create: struct tevent_threaded_context *(TALLOC_CTX *, struct tevent_context *)
tevent_timeval_add: struct timeval (const struct timeval *, uint32_t, uint32_t)
tevent_timeval_compare: int (const struct timeval *, const struct timeval *)
tevent_timeval_current: struct timeval (void)
tevent_timeval_current_ofs: struct timeval (uint32_t, uint32_t)
tevent_timeval_is_zero: bool (const struct timeval *)
tevent_timeval_set: struct timeval (uint32_t, uint32_t)
tevent_timeval_until: struct timeval (const struct timeval *, const struct timeval *)
tevent_timeval_zero: struct timeval (void)
tevent_trace_point_callback: void (struct tevent_context *, enum tevent_trace_point)
tevent_update_timer: void (struct tevent_timer *, struct timeval)
tevent_wakeup_recv: bool (struct tevent_req *)
tevent_wakeup_send: struct tevent_req *(TALLOC_CTX *, struct tevent_context *, struct timeval)
......@@ -38,16 +38,20 @@ def subst_at_vars(task):
return 0
def PKG_CONFIG_FILES(bld, pc_files, vnum=None):
def PKG_CONFIG_FILES(bld, pc_files, vnum=None, extra_name=None):
'''install some pkg_config pc files'''
dest = '${PKGCONFIGDIR}'
dest = bld.EXPAND_VARIABLES(dest)
for f in TO_LIST(pc_files):
base=os.path.basename(f)
if extra_name:
target = f.split('.pc')[0] + extra_name + ".pc"
else:
target = f
base=os.path.basename(target)
t = bld.SAMBA_GENERATOR('PKGCONFIG_%s' % base,
rule=subst_at_vars,
source=f+'.in',
target=f)
target=target)
bld.add_manual_dependency(bld.path.find_or_declare(f), bld.env['PREFIX'])
t.vars = []
if t.env.RPATH_ON_INSTALL:
......@@ -58,7 +62,7 @@ def PKG_CONFIG_FILES(bld, pc_files, vnum=None):
t.env.PACKAGE_VERSION = vnum
for v in [ 'PREFIX', 'EXEC_PREFIX', 'LIB_RPATH' ]:
t.vars.append(t.env[v])
bld.INSTALL_FILES(dest, f, flat=True, destname=base)
bld.INSTALL_FILES(dest, target, flat=True, destname=base)
Build.BuildContext.PKG_CONFIG_FILES = PKG_CONFIG_FILES
......@@ -2,37 +2,10 @@
# and for SAMBA_ macros for building libraries, binaries etc
import Options, Build, os
from optparse import SUPPRESS_HELP
from samba_utils import os_path_relpath, TO_LIST
from samba_utils import os_path_relpath, TO_LIST, samba_add_onoff_option
from samba_autoconf import library_flags
def SAMBA3_ADD_OPTION(opt, option, help=(), dest=None, default=True,
with_name="with", without_name="without"):
if default is None:
default_str = "auto"
elif default is True:
default_str = "yes"
elif default is False:
default_str = "no"
else:
default_str = str(default)
if help == ():
help = ("Build with %s support (default=%s)" % (option, default_str))
if dest is None:
dest = "with_%s" % option.replace('-', '_')
with_val = "--%s-%s" % (with_name, option)
without_val = "--%s-%s" % (without_name, option)
#FIXME: This is broken and will always default to "default" no matter if
# --with or --without is chosen.
opt.add_option(with_val, help=help, action="store_true", dest=dest,
default=default)
opt.add_option(without_val, help=SUPPRESS_HELP, action="store_false",
dest=dest)
Options.Handler.SAMBA3_ADD_OPTION = SAMBA3_ADD_OPTION
Options.Handler.SAMBA3_ADD_OPTION = samba_add_onoff_option
def SAMBA3_IS_STATIC_MODULE(bld, module):
'''Check whether module is in static list'''
......
......@@ -110,6 +110,7 @@ def LIB_MUST_BE_PRIVATE(conf, libname):
@conf
def CHECK_BUNDLED_SYSTEM_PKG(conf, libname, minversion='0.0.0',
maxversion=None, version_blacklist=[],
onlyif=None, implied_deps=None, pkg=None):
'''check if a library is available as a system library.
......@@ -117,12 +118,15 @@ def CHECK_BUNDLED_SYSTEM_PKG(conf, libname, minversion='0.0.0',
'''
return conf.CHECK_BUNDLED_SYSTEM(libname,
minversion=minversion,
maxversion=maxversion,
version_blacklist=version_blacklist,
onlyif=onlyif,
implied_deps=implied_deps,
pkg=pkg)
@conf
def CHECK_BUNDLED_SYSTEM(conf, libname, minversion='0.0.0',
maxversion=None, version_blacklist=[],
checkfunctions=None, headers=None, checkcode=None,
onlyif=None, implied_deps=None,
require_headers=True, pkg=None, set_target=True):
......@@ -181,16 +185,29 @@ def CHECK_BUNDLED_SYSTEM(conf, libname, minversion='0.0.0',
minversion = minimum_library_version(conf, libname, minversion)
msg = 'Checking for system %s' % libname
msg_ver = []
if minversion != '0.0.0':
msg += ' >= %s' % minversion
msg_ver.append('>=%s' % minversion)
if maxversion is not None:
msg_ver.append('<=%s' % maxversion)
for v in version_blacklist:
msg_ver.append('!=%s' % v)
if msg_ver != []:
msg += " (%s)" % (" ".join(msg_ver))
uselib_store=libname.upper()
if pkg is None:
pkg = libname
version_checks = '%s >= %s' % (pkg, minversion)
if maxversion is not None:
version_checks += ' %s <= %s' % (pkg, maxversion)
for v in version_blacklist:
version_checks += ' %s != %s' % (pkg, v)
# try pkgconfig first
if (conf.CHECK_CFG(package=pkg,
args='"%s >= %s" --cflags --libs' % (pkg, minversion),
args='"%s" --cflags --libs' % (version_checks),
msg=msg, uselib_store=uselib_store) and
check_functions_headers_code()):
if set_target:
......
......@@ -24,7 +24,7 @@ def check(self, *k, **kw):
if not 'env' in kw:
kw['env'] = self.env.copy()
# match the configuration test with speficic options, for example:
# match the configuration test with specific options, for example:
# --with-libiconv -> Options.options.iconv_open -> "Checking for library iconv"
additional_dirs = []
if 'msg' in kw:
......@@ -286,7 +286,9 @@ def CHECK_LIBRARY_SUPPORT(conf, rpath=False, version_script=False, msg=None):
os.makedirs(subdir)
Utils.writef(os.path.join(subdir, 'lib1.c'), 'int lib_func(void) { return 42; }\n')
Utils.writef(os.path.join(dir, 'main.c'), 'int main(void) {return !(lib_func() == 42);}\n')
Utils.writef(os.path.join(dir, 'main.c'),
'int lib_func(void);\n'
'int main(void) {return !(lib_func() == 42);}\n')
bld = Build.BuildContext()
bld.log = conf.log
......@@ -436,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);
......
......@@ -229,6 +229,7 @@ def add_init_functions(self):
if modules == []:
sname = sname.replace('-','_')
sname = sname.replace('.','_')
sname = sname.replace('/','_')
cflags.append('-DSTATIC_%s_MODULES=%s' % (sname, sentinel))
if sentinel == 'NULL':
......
......@@ -14,7 +14,7 @@ def write_version_header(task):
return 0
def SAMBA_MKVERSION(bld, target):
def SAMBA_MKVERSION(bld, target, source='VERSION'):
'''generate the version.h header for Samba'''
# We only force waf to re-generate this file if we are installing,
......@@ -22,7 +22,7 @@ def SAMBA_MKVERSION(bld, target):
# git revision) included in the version.
t = bld.SAMBA_GENERATOR('VERSION',
rule=write_version_header,
source= 'VERSION',
source=source,
target=target,
always=bld.is_install)
Build.BuildContext.SAMBA_MKVERSION = SAMBA_MKVERSION
......@@ -51,7 +51,6 @@ def write_build_options_header(fp):
fp.write("*/\n")
fp.write("\n")
fp.write("#include \"includes.h\"\n")
fp.write("#include \"build_env.h\"\n")
fp.write("#include \"dynconfig/dynconfig.h\"\n")
fp.write("#include \"lib/cluster_support.h\"\n")
......@@ -92,19 +91,6 @@ def write_build_options_header(fp):
fp.write(" return;\n")
fp.write(" }\n")
fp.write("\n")
fp.write("#ifdef _BUILD_ENV_H\n")
fp.write(" /* Output information about the build environment */\n")
fp.write(" output(screen,\"Build environment:\\n\");\n")
fp.write(" output(screen,\" Built by: %s@%s\\n\",BUILD_ENV_USER,BUILD_ENV_HOST);\n")
fp.write(" output(screen,\" Built on: %s\\n\",BUILD_ENV_DATE);\n")
fp.write("\n")
fp.write(" output(screen,\" Built using: %s\\n\",BUILD_ENV_COMPILER);\n")
fp.write(" output(screen,\" Build host: %s\\n\",BUILD_ENV_UNAME);\n")
fp.write(" output(screen,\" SRCDIR: %s\\n\",BUILD_ENV_SRCDIR);\n")
fp.write(" output(screen,\" BUILDDIR: %s\\n\",BUILD_ENV_BUILDDIR);\n")
fp.write("\n")
fp.write("\n")
fp.write("#endif\n")
fp.write("\n")
fp.write(" /* Output various paths to files and directories */\n")
fp.write(" output(screen,\"\\nPaths:\\n\");\n")
......@@ -178,6 +164,9 @@ def write_build_options(task):
keys_header_other.append(key)
else:
keys_option_have.append(key)
elif key.startswith("static_init_"):
l = key.split("(")
keys_misc.append(l[0])
else:
keys_misc.append(key)
......
......@@ -49,7 +49,8 @@ def SAMBA_CHECK_PERL(conf, mandatory=True, version=(5,0,0)):
conf.env.PERL_LIB_INSTALL_DIR = perl_lib_install_dir
perl_inc = read_perl_config_var('print "@INC"')
perl_inc.remove('.')
if '.' in perl_inc:
perl_inc.remove('.')
conf.start_msg("PERL_INC: ")
conf.end_msg("%s" % (perl_inc), 'GREEN')
conf.env.PERL_INC = perl_inc
......@@ -40,6 +40,18 @@ def SAMBA_CHECK_PYTHON(conf, mandatory=True, version=(2,4,2)):
@conf
def SAMBA_CHECK_PYTHON_HEADERS(conf, mandatory=True):
if conf.env.disable_python:
if mandatory:
raise Utils.WafError("Cannot check for python headers when "
"--disable-python specified")
conf.msg("python headers", "Check disabled due to --disable-python")
# we don't want PYTHONDIR in config.h, as otherwise changing
# --prefix causes a complete rebuild
del(conf.env.defines['PYTHONDIR'])
del(conf.env.defines['PYTHONARCHDIR'])
return
if conf.env["python_headers_checked"] == []:
if conf.env['EXTRA_PYTHON']:
conf.setenv('extrapython')
......@@ -75,6 +87,20 @@ def _check_python_headers(conf, mandatory):
conf.env['PYTHON_SO_ABI_FLAG'] = abi_pattern % ''
else:
conf.env['PYTHON_SO_ABI_FLAG'] = ''
conf.env['PYTHON_LIBNAME_SO_ABI_FLAG'] = (
conf.env['PYTHON_SO_ABI_FLAG'].replace('_', '-'))
for lib in conf.env['LINKFLAGS_PYEMBED']:
if lib.startswith('-L'):
conf.env.append_unique('LIBPATH_PYEMBED', lib[2:]) # strip '-L'
conf.env['LINKFLAGS_PYEMBED'].remove(lib)
return
def PYTHON_BUILD_IS_ENABLED(self):
return self.CONFIG_SET('HAVE_PYTHON_H')
Build.BuildContext.PYTHON_BUILD_IS_ENABLED = PYTHON_BUILD_IS_ENABLED
def SAMBA_PYTHON(bld, name,
......@@ -91,6 +117,11 @@ def SAMBA_PYTHON(bld, name,
enabled=True):
'''build a python extension for Samba'''
# force-disable when we can't build python modules, so
# every single call doesn't need to pass this in.
if not bld.PYTHON_BUILD_IS_ENABLED():
enabled = False
if bld.env['IS_EXTRA_PYTHON']:
name = 'extra-' + name
......@@ -138,7 +169,10 @@ Build.BuildContext.SAMBA_PYTHON = SAMBA_PYTHON
def pyembed_libname(bld, name, extrapython=False):
return name + bld.env['PYTHON_SO_ABI_FLAG']
if bld.env['PYTHON_SO_ABI_FLAG']:
return name + bld.env['PYTHON_SO_ABI_FLAG']
else:
return name
Build.BuildContext.pyembed_libname = pyembed_libname
......
......@@ -33,3 +33,9 @@ def CHECK_POPT(conf):
return conf.CHECK_BUNDLED_SYSTEM('popt', checkfunctions='poptGetContext', headers='popt.h')
Build.BuildContext.CHECK_POPT = CHECK_POPT
@conf
def CHECK_CMOCKA(conf):
return conf.CHECK_BUNDLED_SYSTEM_PKG('cmocka', minversion='1.1.1')
Build.BuildContext.CHECK_CMOCKA = CHECK_CMOCKA
......@@ -2,6 +2,7 @@
# and for SAMBA_ macros for building libraries, binaries etc
import os, sys, re, fnmatch, shlex
from optparse import SUPPRESS_HELP
import Build, Options, Utils, Task, Logs, Configure
from TaskGen import feature, before, after
from Configure import conf, ConfigurationContext
......@@ -669,3 +670,27 @@ def samba_before_apply_obj_vars(self):
if is_standard_libpath(v, i):
v['LIBPATH'].remove(i)
def samba_add_onoff_option(opt, option, help=(), dest=None, default=True,
with_name="with", without_name="without"):
if default is None:
default_str = "auto"
elif default is True:
default_str = "yes"
elif default is False:
default_str = "no"
else:
default_str = str(default)
if help == ():
help = ("Build with %s support (default=%s)" % (option, default_str))
if dest is None:
dest = "with_%s" % option.replace('-', '_')
with_val = "--%s-%s" % (with_name, option)
without_val = "--%s-%s" % (without_name, option)
opt.add_option(with_val, help=help, action="store_true", dest=dest,
default=default)
opt.add_option(without_val, help=SUPPRESS_HELP, action="store_false",
dest=dest)
Options.Handler.samba_add_onoff_option = samba_add_onoff_option
......@@ -144,7 +144,7 @@ def SAMBA_LIBRARY(bld, libname, source,
'''define a Samba library'''
if pyembed and bld.env['IS_EXTRA_PYTHON']:
public_headers = pc_files = None
public_headers = None
if private_library and public_headers:
raise Utils.WafError("private library '%s' must not have public header files" %
......@@ -225,7 +225,7 @@ def SAMBA_LIBRARY(bld, libname, source,
if vnum is None and soname is None:
raise Utils.WafError("public library '%s' must have a vnum" %
libname)
if pc_files is None and not bld.env['IS_EXTRA_PYTHON']:
if pc_files is None:
raise Utils.WafError("public library '%s' must have pkg-config file" %
libname)
if public_headers is None and not bld.env['IS_EXTRA_PYTHON']:
......@@ -328,7 +328,10 @@ def SAMBA_LIBRARY(bld, libname, source,
t.link_name = link_name
if pc_files is not None and not private_library:
bld.PKG_CONFIG_FILES(pc_files, vnum=vnum)
if pyembed and bld.env['IS_EXTRA_PYTHON']:
bld.PKG_CONFIG_FILES(pc_files, vnum=vnum, extra_name=bld.env['PYTHON_SO_ABI_FLAG'])
else:
bld.PKG_CONFIG_FILES(pc_files, vnum=vnum)
if (manpages is not None and 'XSLTPROC_MANPAGES' in bld.env and
bld.env['XSLTPROC_MANPAGES']):
......@@ -462,7 +465,8 @@ def SAMBA_MODULE(bld, modname, source,
pyembed=False,
manpages=None,
allow_undefined_symbols=False,
allow_warnings=False
allow_warnings=False,
install=True
):
'''define a Samba module.'''
......@@ -532,7 +536,8 @@ def SAMBA_MODULE(bld, modname, source,
pyembed=pyembed,
manpages=manpages,
allow_undefined_symbols=allow_undefined_symbols,
allow_warnings=allow_warnings
allow_warnings=allow_warnings,
install=install
)
......
......@@ -196,6 +196,10 @@ def set_options(opt):
help='tag release in git at the same time',
type='string', action='store', dest='TAG_RELEASE')
opt.add_option('--disable-python',
help='do not generate python modules',
action='store_true', dest='disable_python', default=False)
opt.add_option('--extra-python', type=str,
help=("build selected libraries for the specified "
"additional version of Python "
......@@ -208,6 +212,8 @@ def configure(conf):
conf.env.hlist = []
conf.env.srcdir = conf.srcdir
conf.define('SRCDIR', conf.env['srcdir'])
if Options.options.timestamp_dependencies:
conf.ENABLE_TIMESTAMP_DEPENDENCIES()
......@@ -279,8 +285,14 @@ def configure(conf):
conf.env.AUTOCONF_HOST = Options.options.AUTOCONF_HOST
conf.env.AUTOCONF_PROGRAM_PREFIX = Options.options.AUTOCONF_PROGRAM_PREFIX
conf.env.disable_python = Options.options.disable_python
conf.env.EXTRA_PYTHON = Options.options.EXTRA_PYTHON
if (conf.env.disable_python and conf.env.EXTRA_PYTHON):
Logs.error('ERROR: cannot specify both --disable-python and --extra-python.')
sys.exit(1)
if (conf.env.AUTOCONF_HOST and
conf.env.AUTOCONF_BUILD and
conf.env.AUTOCONF_BUILD != conf.env.AUTOCONF_HOST):
......@@ -490,12 +502,12 @@ struct foo bar = { .y = 'X', .x = 1 };
if not conf.CHECK_LARGEFILE():
raise Utils.WafError('Samba requires large file support support, but not available on this platform: sizeof(off_t) < 8')
if 'HAVE_STDDEF_H' in conf.env and 'HAVE_STDLIB_H' in conf.env:
if conf.env.HAVE_STDDEF_H and conf.env.HAVE_STDLIB_H:
conf.DEFINE('STDC_HEADERS', 1)
conf.CHECK_HEADERS('sys/time.h time.h', together=True)
if 'HAVE_SYS_TIME_H' in conf.env and 'HAVE_TIME_H' in conf.env:
if conf.env.HAVE_SYS_TIME_H and conf.env.HAVE_TIME_H:
conf.DEFINE('TIME_WITH_SYS_TIME', 1)
# cope with different extensions for libraries
......
/*
/*
Unix SMB/CIFS implementation.
Samba utility functions
Copyright (C) Andrew Tridgell 1998
......@@ -94,17 +94,17 @@ int rep_getifaddrs(struct ifaddrs **ifap)
if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) == -1) {
return -1;
}
ifc.ifc_len = sizeof(buff);
ifc.ifc_buf = buff;
if (ioctl(fd, SIOCGIFCONF, &ifc) != 0) {
close(fd);
return -1;
}
}
ifr = ifc.ifc_req;
n = ifc.ifc_len / sizeof(struct ifreq);
/* Loop through interfaces, looking for given IP address */
......@@ -171,7 +171,7 @@ int rep_getifaddrs(struct ifaddrs **ifap)
close(fd);
return 0;
}
}
#define _FOUND_IFACE_ANY
#endif /* HAVE_IFACE_IFCONF */
......@@ -200,14 +200,14 @@ int rep_getifaddrs(struct ifaddrs **ifap)
if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) == -1) {
return -1;
}
strioctl.ic_cmd = SIOCGIFCONF;
strioctl.ic_dp = buff;
strioctl.ic_len = sizeof(buff);
if (ioctl(fd, I_STR, &strioctl) < 0) {
close(fd);
return -1;
}
}
/* we can ignore the possible sizeof(int) here as the resulting
number of interface structures won't change */
......@@ -217,16 +217,16 @@ int rep_getifaddrs(struct ifaddrs **ifap)
at the start of the buffer if the offered size is a
multiple of the structure size plus an int */
if (n*sizeof(struct ifreq) + sizeof(int) == strioctl.ic_len) {
ifr = (struct ifreq *)(buff + sizeof(int));
ifr = (struct ifreq *)(buff + sizeof(int));
} else {
ifr = (struct ifreq *)buff;
ifr = (struct ifreq *)buff;
}
/* Loop through interfaces */
for (i = 0; i<n; i++) {
ifreq = ifr[i];
curif = calloc(1, sizeof(struct ifaddrs));
if (lastif == NULL) {
*ifap = curif;
......
......@@ -820,6 +820,24 @@ int rep_strerror_r(int errnum, char *buf, size_t buflen)