mirror of
https://github.com/samba-team/samba.git
synced 2025-08-03 04:22:09 +03:00
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
This commit is contained in:
@ -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,
|
||||
|
Reference in New Issue
Block a user