The branch, master has been updated via c83ce7b replace: Only include C files from which there are actually functions used. via 5c50e08 replace: use libbsd for strlcat/strlcpy when available. from bfa951d s4-s3-upgrade: Check if there are duplicate sids for users and groups
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit c83ce7bcc6dbee5b3b8c9cceb7de698763d2d10e Author: Jelmer Vernooij <jel...@samba.org> Date: Tue Jan 31 11:25:17 2012 +0100 replace: Only include C files from which there are actually functions used. Autobuild-User: Jelmer Vernooij <jel...@samba.org> Autobuild-Date: Tue Jan 31 15:21:04 CET 2012 on sn-devel-104 commit 5c50e08983ff276dc472d00baba7a835dbda6cc5 Author: Jelmer Vernooij <jel...@samba.org> Date: Tue Jan 31 11:10:18 2012 +0100 replace: use libbsd for strlcat/strlcpy when available. ----------------------------------------------------------------------- Summary of changes: lib/replace/wscript | 59 ++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 42 insertions(+), 17 deletions(-) Changeset truncated at 500 lines: diff --git a/lib/replace/wscript b/lib/replace/wscript index e4fc72b..4b4f0a8 100644 --- a/lib/replace/wscript +++ b/lib/replace/wscript @@ -163,12 +163,18 @@ def configure(conf): conf.CHECK_FUNCS('pipe strftime srandom random srand rand usleep setbuffer') conf.CHECK_FUNCS('lstat getpgrp utime utimes seteuid setreuid setresuid setegid') conf.CHECK_FUNCS('setregid setresgid chroot strerror vsyslog setlinebuf mktime') - conf.CHECK_FUNCS('ftruncate chsize rename waitpid wait4 strlcpy strlcat') + conf.CHECK_FUNCS('ftruncate chsize rename waitpid wait4') 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 snprintf vsnprintf') conf.CHECK_FUNCS('asprintf vasprintf setenv unsetenv strnlen strtoull __strtoull') conf.CHECK_FUNCS('strtouq strtoll __strtoll strtoq') + + # libbsd on some platforms provides strlcpy and strlcat + if not conf.CHECK_FUNCS('strlcpy strlcat'): + conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h', + checklibc=True) + #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'): @@ -206,19 +212,19 @@ def configure(conf): if conf.CHECK_FUNCS_IN('clock_gettime', 'rt', checklibc=True): for c in ['CLOCK_MONOTONIC', 'CLOCK_PROCESS_CPUTIME_ID', 'CLOCK_REALTIME']: conf.CHECK_CODE(''' - #if TIME_WITH_SYS_TIME - # include <sys/time.h> - # include <time.h> - #else - # if HAVE_SYS_TIME_H - # include <sys/time.h> - # else - # include <time.h> - # endif - #endif - clockid_t clk = %s''' % c, - 'HAVE_%s' % c, - msg='Checking whether the clock_gettime clock ID %s is available' % c) + #if TIME_WITH_SYS_TIME + # include <sys/time.h> + # include <time.h> + #else + # if HAVE_SYS_TIME_H + # include <sys/time.h> + # else + # include <time.h> + # endif + #endif + clockid_t clk = %s''' % c, + 'HAVE_%s' % c, + msg='Checking whether the clock_gettime clock ID %s is available' % c) conf.CHECK_TYPE('struct timespec', headers='sys/time.h time.h') @@ -395,13 +401,32 @@ def configure(conf): conf.SAMBA_CONFIG_H() +REPLACEMENT_FUNCTIONS = { + 'replace.c': ['ftruncate', 'strlcpy', 'strlcat', 'mktime', 'initgroups', + 'memmove', 'strdup', 'setlinebuf', 'vsyslog', 'strnlen', + 'strndup', 'waitpid', 'seteuid', 'setegid', 'chroot', + 'mkstemp', 'mkdtemp', 'pread', 'pwrite', 'strcasestr', + 'strtok_r', 'strtoll', 'strtoull', 'setenv', 'unsetenv', + 'utime', 'utimes', 'dup2', 'chown', 'link', 'readlink', + 'symlink', 'lchown', 'realpath', 'memmem', 'vdprintf', + 'dprintf', 'get_current_dir_name', + 'strerror_r', 'clock_gettime'], + 'timegm.c': ['timegm'], + 'snprintf.c': ['snprintf'], + } + + def build(bld): bld.RECURSE('buildtools/wafsamba') - REPLACE_HOSTCC_SOURCE = 'replace.c snprintf.c' + REPLACE_HOSTCC_SOURCE = '' if bld.CONFIG_SET('REPLACE_STRPTIME'): REPLACE_HOSTCC_SOURCE += ' strptime.c' - if not bld.CONFIG_SET('HAVE_TIMEGM'): REPLACE_HOSTCC_SOURCE += ' timegm.c' + for filename, functions in REPLACEMENT_FUNCTIONS.iteritems(): + for function in functions: + if not bld.CONFIG_SET('HAVE_%s' % function.upper()): + REPLACE_HOSTCC_SOURCE += ' %s' % filename + break bld.SAMBA_SUBSYSTEM('LIBREPLACE_HOSTCC', REPLACE_HOSTCC_SOURCE, @@ -436,7 +461,7 @@ def build(bld): # at the moment: # hide_symbols=bld.BUILTIN_LIBRARY('replace'), private_library=True, - deps='crypt dl nsl socket rt') + deps='crypt dl nsl socket rt bsd') bld.SAMBA_SUBSYSTEM('replace-test', source='''test/testsuite.c test/strptime.c -- Samba Shared Repository