waflib: force_32bit: try to fix passing additional flags to generate 32bit code on MacOSX

This commit is contained in:
Alibek Omarov 2018-12-16 17:01:12 +03:00
parent 2072f5c276
commit a580e98f28

View File

@ -37,22 +37,20 @@ def configure(conf):
conf.env.DEST_SIZEOF_VOID_P = 8
else:
if check_32bit(conf, 'Checking if \'{0}\' can target 32-bit'.format(conf.env.COMPILER_CC)):
conf.env.DEST_SIZEOF_VOID_P = 4 # predict state
conf.env.DEST_SIZEOF_VOID_P = 4
else:
flag = '-m32'
flags = ['-m32']
# Think different.
if(conf.env.DEST_OS == 'darwin'):
flag = '-arch i386'
flags = ['-arch', 'i386']
env_stash = conf.env
conf.env.append_value('LINKFLAGS', [flag])
conf.env.append_value('CFLAGS', [flag])
conf.env.append_value('CXXFLAGS', [flag])
if check_32bit(conf, '...trying with additional flags'.format(conf.env.COMPILER_CC)):
conf.env.append_value('LINKFLAGS', flags)
conf.env.append_value('CFLAGS', flags)
conf.env.append_value('CXXFLAGS', flags)
if check_32bit(conf, '...trying with additional flags'):
conf.env.DEST_SIZEOF_VOID_P = 4
else:
conf.env.DEST_SIZEOF_VOID_P = 8
conf.env = env_stash
if getattr(conf.env, 'BIT32_MANDATORY') and conf.env.DEST_SIZEOF_VOID_P == 8:
conf.fatal('Compiler can\'t create 32-bit code!')
4