mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
public: wscript: parallelize libc extension checks for faster reconfigure
This commit is contained in:
@@ -106,25 +106,33 @@ def configure(conf):
|
||||
conf.export_define('ALLOCA_H', '<stdlib.h>')
|
||||
|
||||
conf.export_define('STDINT_H', '<stdint.h>' if conf.simple_check(HEADER_TEST % 'stdint.h', 'stdint.h') else '<pstdint.h>')
|
||||
conf.export_define('HAVE_TGMATH_H', conf.simple_check(TGMATH_H_TEST, 'tgmath.h', use='M werror export'))
|
||||
|
||||
# save some time on Windows, msvc is too slow
|
||||
# these calls must be available with both msvc and mingw
|
||||
if conf.env.DEST_OS == 'win32':
|
||||
conf.export_define('HAVE_TGMATH_H', conf.simple_check(TGMATH_H_TEST, 'tgmath.h', use='M werror export'))
|
||||
conf.export_define('HAVE_STRNICMP')
|
||||
conf.export_define('HAVE_STRICMP')
|
||||
else:
|
||||
# TODO: multicheck for speed
|
||||
def check_libc_extension(frag, msg, define):
|
||||
conf.export_define(define, conf.simple_check(frag, msg, use='werror export'))
|
||||
exports_list = []
|
||||
|
||||
check_libc_extension(STRNCASECMP_TEST, 'strncasecmp', 'HAVE_STRNCASECMP')
|
||||
check_libc_extension(STRCASECMP_TEST, 'strcasecmp', 'HAVE_STRCASECMP')
|
||||
check_libc_extension(STRCASESTR_TEST, 'strcasestr', 'HAVE_STRCASESTR')
|
||||
check_libc_extension(STRCHRNUL_TEST, 'strchrnul', 'HAVE_STRCHRNUL')
|
||||
check_libc_extension(STRLCPY_TEST, 'strlcpy', 'HAVE_STRLCPY')
|
||||
check_libc_extension(STRLCAT_TEST, 'strlcat', 'HAVE_STRLCAT')
|
||||
check_libc_extension(STRNLEN_TEST, 'strnlen', 'HAVE_STRNLEN')
|
||||
def check_libc_extension(frag, msg, define):
|
||||
exports_list.append(define)
|
||||
return {'fragment': frag, 'msg': 'Checking for ' + msg, 'define_name': define, 'mandatory': False, 'use': 'M werror export'}
|
||||
|
||||
conf.multicheck(
|
||||
check_libc_extension(TGMATH_H_TEST, 'tgmath.h', 'HAVE_TGMATH_H'),
|
||||
check_libc_extension(STRNCASECMP_TEST, 'strncasecmp', 'HAVE_STRNCASECMP'),
|
||||
check_libc_extension(STRCASECMP_TEST, 'strcasecmp', 'HAVE_STRCASECMP'),
|
||||
check_libc_extension(STRCASESTR_TEST, 'strcasestr', 'HAVE_STRCASESTR'),
|
||||
check_libc_extension(STRCHRNUL_TEST, 'strchrnul', 'HAVE_STRCHRNUL'),
|
||||
check_libc_extension(STRLCPY_TEST, 'strlcpy', 'HAVE_STRLCPY'),
|
||||
check_libc_extension(STRLCAT_TEST, 'strlcat', 'HAVE_STRLCAT'),
|
||||
check_libc_extension(STRNLEN_TEST, 'strnlen', 'HAVE_STRNLEN'),
|
||||
)
|
||||
|
||||
for export in exports_list:
|
||||
conf.export_define(export)
|
||||
|
||||
# kill temporary uselib
|
||||
del conf.env.DEFINES_export
|
||||
|
||||
Reference in New Issue
Block a user