Commit 170c34b8 authored by Mathieu Parent's avatar Mathieu Parent

New upstream version 2.1.10

parent 83a0bdc5
_pytalloc_check_type: int (PyObject *, const char *)
_pytalloc_get_mem_ctx: TALLOC_CTX *(PyObject *)
_pytalloc_get_ptr: void *(PyObject *)
_pytalloc_get_type: void *(PyObject *, const char *)
pytalloc_BaseObject_PyType_Ready: int (PyTypeObject *)
pytalloc_BaseObject_check: int (PyObject *)
pytalloc_BaseObject_size: size_t (void)
pytalloc_CObject_FromTallocPtr: PyObject *(void *)
pytalloc_Check: int (PyObject *)
pytalloc_GenericObject_reference_ex: PyObject *(TALLOC_CTX *, void *)
pytalloc_GenericObject_steal_ex: PyObject *(TALLOC_CTX *, void *)
pytalloc_GetBaseObjectType: PyTypeObject *(void)
pytalloc_GetObjectType: PyTypeObject *(void)
pytalloc_reference_ex: PyObject *(PyTypeObject *, TALLOC_CTX *, void *)
pytalloc_steal: PyObject *(PyTypeObject *, void *)
pytalloc_steal_ex: PyObject *(PyTypeObject *, TALLOC_CTX *, void *)
_pytalloc_check_type: int (PyObject *, const char *)
_pytalloc_get_mem_ctx: TALLOC_CTX *(PyObject *)
_pytalloc_get_ptr: void *(PyObject *)
_pytalloc_get_type: void *(PyObject *, const char *)
pytalloc_BaseObject_PyType_Ready: int (PyTypeObject *)
pytalloc_BaseObject_check: int (PyObject *)
pytalloc_BaseObject_size: size_t (void)
pytalloc_Check: int (PyObject *)
pytalloc_GenericObject_reference_ex: PyObject *(TALLOC_CTX *, void *)
pytalloc_GenericObject_steal_ex: PyObject *(TALLOC_CTX *, void *)
pytalloc_GetBaseObjectType: PyTypeObject *(void)
pytalloc_GetObjectType: PyTypeObject *(void)
pytalloc_reference_ex: PyObject *(PyTypeObject *, TALLOC_CTX *, void *)
pytalloc_steal: PyObject *(PyTypeObject *, void *)
pytalloc_steal_ex: PyObject *(PyTypeObject *, TALLOC_CTX *, void *)
_talloc: void *(const void *, size_t)
_talloc_array: void *(const void *, size_t, unsigned int, const char *)
_talloc_free: int (void *, const char *)
_talloc_get_type_abort: void *(const void *, const char *, const char *)
_talloc_memdup: void *(const void *, const void *, size_t, const char *)
_talloc_move: void *(const void *, const void *)
_talloc_pooled_object: void *(const void *, size_t, const char *, unsigned int, size_t)
_talloc_realloc: void *(const void *, void *, size_t, const char *)
_talloc_realloc_array: void *(const void *, void *, size_t, unsigned int, const char *)
_talloc_reference_loc: void *(const void *, const void *, const char *)
_talloc_set_destructor: void (const void *, int (*)(void *))
_talloc_steal_loc: void *(const void *, const void *, const char *)
_talloc_zero: void *(const void *, size_t, const char *)
_talloc_zero_array: void *(const void *, size_t, unsigned int, const char *)
talloc_asprintf: char *(const void *, const char *, ...)
talloc_asprintf_append: char *(char *, const char *, ...)
talloc_asprintf_append_buffer: char *(char *, const char *, ...)
talloc_autofree_context: void *(void)
talloc_check_name: void *(const void *, const char *)
talloc_disable_null_tracking: void (void)
talloc_enable_leak_report: void (void)
talloc_enable_leak_report_full: void (void)
talloc_enable_null_tracking: void (void)
talloc_enable_null_tracking_no_autofree: void (void)
talloc_find_parent_byname: void *(const void *, const char *)
talloc_free_children: void (void *)
talloc_get_name: const char *(const void *)
talloc_get_size: size_t (const void *)
talloc_increase_ref_count: int (const void *)
talloc_init: void *(const char *, ...)
talloc_is_parent: int (const void *, const void *)
talloc_named: void *(const void *, size_t, const char *, ...)
talloc_named_const: void *(const void *, size_t, const char *)
talloc_parent: void *(const void *)
talloc_parent_name: const char *(const void *)
talloc_pool: void *(const void *, size_t)
talloc_realloc_fn: void *(const void *, void *, size_t)
talloc_reference_count: size_t (const void *)
talloc_reparent: void *(const void *, const void *, const void *)
talloc_report: void (const void *, FILE *)
talloc_report_depth_cb: void (const void *, int, int, void (*)(const void *, int, int, int, void *), void *)
talloc_report_depth_file: void (const void *, int, int, FILE *)
talloc_report_full: void (const void *, FILE *)
talloc_set_abort_fn: void (void (*)(const char *))
talloc_set_log_fn: void (void (*)(const char *))
talloc_set_log_stderr: void (void)
talloc_set_memlimit: int (const void *, size_t)
talloc_set_name: const char *(const void *, const char *, ...)
talloc_set_name_const: void (const void *, const char *)
talloc_show_parents: void (const void *, FILE *)
talloc_strdup: char *(const void *, const char *)
talloc_strdup_append: char *(char *, const char *)
talloc_strdup_append_buffer: char *(char *, const char *)
talloc_strndup: char *(const void *, const char *, size_t)
talloc_strndup_append: char *(char *, const char *, size_t)
talloc_strndup_append_buffer: char *(char *, const char *, size_t)
talloc_test_get_magic: int (void)
talloc_total_blocks: size_t (const void *)
talloc_total_size: size_t (const void *)
talloc_unlink: int (const void *, void *)
talloc_vasprintf: char *(const void *, const char *, va_list)
talloc_vasprintf_append: char *(char *, const char *, va_list)
talloc_vasprintf_append_buffer: char *(char *, const char *, va_list)
talloc_version_major: int (void)
talloc_version_minor: int (void)
......@@ -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
......@@ -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:
......
......@@ -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)
......
......@@ -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
......@@ -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):
......
......@@ -820,6 +820,24 @@ int rep_strerror_r(int errnum, char *buf, size_t buflen)
strncpy(buf, s, buflen);
return 0;
}
#elif (!defined(STRERROR_R_XSI_NOT_GNU))
#undef strerror_r
int rep_strerror_r(int errnum, char *buf, size_t buflen)
{
char *s = strerror_r(errnum, buf, buflen);
if (s == NULL) {
/* Shouldn't happen, should always get a string */
return EINVAL;
}
if (s != buf) {
strlcpy(buf, s, buflen);
if (strlen(s) > buflen - 1) {
return ERANGE;
}
}
return 0;
}
#endif
#ifndef HAVE_CLOCK_GETTIME
......
......@@ -628,7 +628,7 @@ ssize_t rep_pwrite(int __fd, const void *__buf, size_t __nbytes, off_t __offset)
char *rep_get_current_dir_name(void);
#endif
#ifndef HAVE_STRERROR_R
#if (!defined(HAVE_STRERROR_R) || !defined(STRERROR_R_XSI_NOT_GNU))
#define strerror_r rep_strerror_r
int rep_strerror_r(int errnum, char *buf, size_t buflen);
#endif
......
......@@ -79,13 +79,21 @@ int rep_utimes(const char *filename, const struct timeval tv[2]);
typedef int clockid_t;
int rep_clock_gettime(clockid_t clk_id, struct timespec *tp);
#endif
/* make sure we have a best effort CUSTOM_CLOCK_MONOTONIC we can rely on */
/* make sure we have a best effort CUSTOM_CLOCK_MONOTONIC we can rely on.
*
* on AIX the values of CLOCK_* are cast expressions, not integer constants,
* this prevents them from being compared against in a preprocessor directive.
* The following ...IS_* macros can be used to check which clock is in use.
*/
#if defined(CLOCK_MONOTONIC)
#define CUSTOM_CLOCK_MONOTONIC CLOCK_MONOTONIC
#define CUSTOM_CLOCK_MONOTONIC_IS_MONOTONIC
#elif defined(CLOCK_HIGHRES)
#define CUSTOM_CLOCK_MONOTONIC CLOCK_HIGHRES
#define CUSTOM_CLOCK_MONOTONIC_IS_HIGHRES
#else
#define CUSTOM_CLOCK_MONOTONIC CLOCK_REALTIME
#define CUSTOM_CLOCK_MONOTONIC_IS_REALTIME
#endif
#endif
......@@ -63,7 +63,7 @@ static int os2_delete(DIR *d)
off_t offsets[READDIR_SIZE];
int i, j;
struct dirent *de;
char names[READDIR_SIZE][30];
char names[READDIR_SIZE][256];
/* scan, remembering offsets */
for (i=0, de=readdir(d);
......
......@@ -81,6 +81,9 @@ def configure(conf):
conf.CHECK_HEADERS('sys/atomic.h')
conf.CHECK_HEADERS('libgen.h')
if conf.CHECK_CFLAGS('-Wno-format-truncation'):
conf.define('HAVE_WNO_FORMAT_TRUNCATION', '1')
# Check for process set name support
conf.CHECK_CODE('''
#include <sys/prctl.h>
......@@ -466,6 +469,7 @@ removeea setea
conf.DEFINE('HAVE_ROBUST_MUTEXES', 1)
conf.CHECK_FUNCS_IN('crypt', 'crypt', checklibc=True)
conf.CHECK_FUNCS_IN('crypt_r', 'crypt', checklibc=True)
conf.CHECK_VARIABLE('rl_event_hook', define='HAVE_DECL_RL_EVENT_HOOK', always=True,
headers='readline.h readline/readline.h readline/history.h')
......@@ -626,6 +630,13 @@ removeea setea
conf.RECURSE('system')
conf.SAMBA_CONFIG_H()
if conf.CHECK_FUNCS('strerror_r'):
# Check if strerror_r is XSI-Compatable, the default GNU implementation
# is not
conf.CHECK_CODE('int strerror_r(int errnum, char *buf, size_t buflen);',
'STRERROR_R_XSI_NOT_GNU',
headers='string.h', addmain=False, link=False,
msg="Checking for XSI (rather than GNU) prototype for strerror_r")
REPLACEMENT_FUNCTIONS = {
......@@ -703,11 +714,14 @@ def build(bld):
private_library=True,
deps='crypt dl nsl socket rt attr' + extra_libs)
replace_test_cflags="-Wno-format-zero-length"
if bld.CONFIG_SET('HAVE_WNO_FORMAT_TRUNCATION'):
replace_test_cflags += " -Wno-format-truncation"
bld.SAMBA_SUBSYSTEM('replace-test',
source='''test/testsuite.c test/strptime.c
test/os2_delete.c test/getifaddrs.c''',
deps='replace',
cflags="-Wno-format-length")
cflags=replace_test_cflags)
if bld.env.standalone_replace:
bld.SAMBA_BINARY('replace_testsuite',
......
......@@ -3,9 +3,9 @@ exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: pytalloc-util
Name: pytalloc-util@PYTHON_SO_ABI_FLAG@
Description: Utility functions for using talloc objects with Python
Version: @TALLOC_VERSION@
Libs: @LIB_RPATH@ -L${libdir} -lpytalloc-util@PYTHON_SO_ABI_FLAG@
Libs: @LIB_RPATH@ -L${libdir} -lpytalloc-util@PYTHON_LIBNAME_SO_ABI_FLAG@
Cflags: -I${includedir}
URL: http://talloc.samba.org/
......@@ -407,10 +407,11 @@ const char *talloc_set_name(const void *ptr, const char *fmt, ...) PRINTF_ATTRIB
*
* @param[in] new_ctx The new parent context.
*
* @param[in] pptr Pointer to the talloc chunk to move.
* @param[in] pptr Pointer to a pointer to the talloc chunk to move.
*
* @return The pointer to the talloc chunk that moved.
* It does not have any failure modes.
*
* @return The pointer of the talloc chunk it has been moved to,
* NULL on error.
*/
void *talloc_move(const void *new_ctx, void **pptr);
#else
......
......@@ -21,9 +21,9 @@ say('you make the errors, we detect them')
def check_task_classes(self):
for x in Task.TaskBase.classes:
if isinstance(x, Task.Task):
if not getattr(cls, 'ext_in', None) or getattr(cls, 'before', None):
if not getattr(x, 'ext_in', None) or getattr(x, 'before', None):
say('class %s has no precedence constraints (ext_in/before)')
if not getattr(cls, 'ext_out', None) or getattr(cls, 'after', None):
if not getattr(x, 'ext_out', None) or getattr(x, 'after', None):
say('class %s has no precedence constraints (ext_out/after)')
comp = Build.BuildContext.compile
......
#!/usr/bin/env python
APPNAME = 'talloc'
VERSION = '2.1.9'
VERSION = '2.1.10'
blddir = 'bin'
......@@ -32,9 +32,6 @@ def set_options(opt):
opt.add_option('--enable-talloc-compat1',
help=("Build talloc 1.x.x compat library [False]"),
action="store_true", dest='TALLOC_COMPAT1', default=False)
opt.add_option('--disable-python',
help=("disable the pytalloc module"),
action="store_true", dest='disable_python', default=False)
def configure(conf):
......@@ -46,22 +43,24 @@ def configure(conf):
conf.define('TALLOC_BUILD_VERSION_MINOR', int(VERSION.split('.')[1]))
conf.define('TALLOC_BUILD_VERSION_RELEASE', int(VERSION.split('.')[2]))
conf.env.disable_python = getattr(Options.options, 'disable_python', False)
if not conf.env.standalone_talloc:
if conf.CHECK_BUNDLED_SYSTEM_PKG('talloc', minversion=VERSION,
implied_deps='replace'):
conf.define('USING_SYSTEM_TALLOC', 1)
if conf.CHECK_BUNDLED_SYSTEM_PKG('pytalloc-util', minversion=VERSION,
implied_deps='talloc replace'):
conf.define('USING_SYSTEM_PYTALLOC_UTIL', 1)
conf.env.TALLOC_COMPAT1 = False
if conf.env.standalone_talloc:
conf.env.TALLOC_COMPAT1 = Options.options.TALLOC_COMPAT1
conf.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig'
conf.env.TALLOC_VERSION = VERSION
conf.CHECK_XSLTPROC_MANPAGES()
conf.CHECK_HEADERS('sys/auxv.h')
conf.CHECK_FUNCS('getauxval')
conf.SAMBA_CONFIG_H()
conf.SAMBA_CHECK_UNDEFINED_SYMBOL_FLAGS()
# We need to set everything non-python up before here, because
# SAMBA_CHECK_PYTHON makes a copy of conf and we need it set up correctly
if not conf.env.disable_python:
# also disable if we don't have the python libs installed
conf.SAMBA_CHECK_PYTHON(mandatory=False, version=(2,4,2))
......@@ -70,20 +69,32 @@ def configure(conf):
Logs.warn('Disabling pytalloc-util as python devel libs not found')
conf.env.disable_python = True
conf.CHECK_HEADERS('sys/auxv.h')
conf.CHECK_FUNCS('getauxval')
if not conf.env.standalone_talloc:
if conf.CHECK_BUNDLED_SYSTEM_PKG('talloc', minversion=VERSION,
implied_deps='replace'):
conf.define('USING_SYSTEM_TALLOC', 1)
conf.SAMBA_CONFIG_H()
using_system_pytalloc_util = True
if not conf.CHECK_BUNDLED_SYSTEM_PKG('pytalloc-util', minversion=VERSION,
implied_deps='talloc replace'):
using_system_pytalloc_util = False
conf.SAMBA_CHECK_UNDEFINED_SYMBOL_FLAGS()
# We need to get a pytalloc-util for all the python versions
# we are building for
if conf.env['EXTRA_PYTHON']:
name = 'pytalloc-util' + conf.all_envs['extrapython']['PYTHON_SO_ABI_FLAG']
if not conf.CHECK_BUNDLED_SYSTEM_PKG(name, minversion=VERSION,
implied_deps='talloc replace'):
using_system_pytalloc_util = False
if using_system_pytalloc_util:
conf.define('USING_SYSTEM_PYTALLOC_UTIL', 1)
def build(bld):
bld.RECURSE('lib/replace')
if bld.env.standalone_talloc:
bld.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig'
bld.env.TALLOC_VERSION = VERSION
private_library = False
# should we also install the symlink to libtalloc1.so here?
......@@ -126,7 +137,7 @@ def build(bld):
private_library=private_library,
manpages='man/talloc.3')
if not bld.CONFIG_SET('USING_SYSTEM_PYTALLOC_UTIL') and not bld.env.disable_python:
if not bld.CONFIG_SET('USING_SYSTEM_PYTALLOC_UTIL'):
for env in bld.gen_python_environments(['PKGCONFIGDIR']):
name = bld.pyembed_libname('pytalloc-util')
......@@ -140,16 +151,19 @@ def build(bld):
abi_match='pytalloc_* _pytalloc_*',
private_library=private_library,
public_headers=('' if private_library else 'pytalloc.h'),
pc_files='pytalloc-util.pc'
pc_files='pytalloc-util.pc',
enabled=bld.PYTHON_BUILD_IS_ENABLED()
)
bld.SAMBA_PYTHON('pytalloc',
'pytalloc.c',
deps='talloc ' + name,
enabled=bld.PYTHON_BUILD_IS_ENABLED(),
realname='talloc.so')
bld.SAMBA_PYTHON('test_pytalloc',
'test_pytalloc.c',
deps='pytalloc',
enabled=bld.PYTHON_BUILD_IS_ENABLED(),
realname='_test_pytalloc.so',
install=False)
......@@ -157,12 +171,18 @@ def build(bld):
def test(ctx):
'''run talloc testsuite'''
import Utils, samba_utils
samba_utils.ADD_LD_LIBRARY_PATH('bin/shared')
samba_utils.ADD_LD_LIBRARY_PATH('bin/shared/private')
cmd = os.path.join(Utils.g_module.blddir, 'talloc_testsuite')
ret = samba_utils.RUN_COMMAND(cmd)
print("testsuite returned %d" % ret)
magic_helper_cmd = os.path.join(Utils.g_module.blddir, 'talloc_test_magic_differs_helper')
magic_cmd = os.path.join(srcdir, 'lib', 'talloc',
'test_magic_differs.sh')
if not os.path.exists(magic_cmd):
magic_cmd = os.path.join(srcdir, 'test_magic_differs.sh')
magic_ret = samba_utils.RUN_COMMAND(magic_cmd + " " + magic_helper_cmd)
print("magic differs test returned %d" % magic_ret)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment