diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2012-01-31 11:25:17 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2012-01-31 15:21:04 +0100 |
commit | c83ce7bcc6dbee5b3b8c9cceb7de698763d2d10e (patch) | |
tree | 9c531fad47a5edb6cb9d0ce68e61730710d9f484 /lib/replace | |
parent | 5c50e08983ff276dc472d00baba7a835dbda6cc5 (diff) | |
download | samba-c83ce7bcc6dbee5b3b8c9cceb7de698763d2d10e.tar.gz samba-c83ce7bcc6dbee5b3b8c9cceb7de698763d2d10e.tar.bz2 samba-c83ce7bcc6dbee5b3b8c9cceb7de698763d2d10e.zip |
replace: Only include C files from which there are actually functions used.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Tue Jan 31 15:21:04 CET 2012 on sn-devel-104
Diffstat (limited to 'lib/replace')
-rw-r--r-- | lib/replace/wscript | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/lib/replace/wscript b/lib/replace/wscript index e85d33cf61..4b4f0a8a6a 100644 --- a/lib/replace/wscript +++ b/lib/replace/wscript @@ -401,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, |