diff options
-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, |