SCons: Make BATCH options global sticky so libelf is built appropriately.

--HG--
extra : convert_revision : 4bca5c31b8421305d41aac072696964b39d7ff16
This commit is contained in:
Ali Saidi 2008-04-07 23:40:24 -04:00
parent d9d79cebb9
commit bee4d454e8
2 changed files with 11 additions and 19 deletions

View file

@ -303,6 +303,8 @@ global_sticky_opts = Options(global_sticky_opts_file, args=ARGUMENTS)
global_sticky_opts.AddOptions( global_sticky_opts.AddOptions(
('CC', 'C compiler', os.environ.get('CC', env['CC'])), ('CC', 'C compiler', os.environ.get('CC', env['CC'])),
('CXX', 'C++ compiler', os.environ.get('CXX', env['CXX'])), ('CXX', 'C++ compiler', os.environ.get('CXX', env['CXX'])),
('BATCH', 'Use batch pool for build and tests', False),
('BATCH_CMD', 'Batch pool submission command name', 'qdo'),
('EXTRAS', 'Add Extra directories to the compilation', '', ('EXTRAS', 'Add Extra directories to the compilation', '',
PathListAllExist, PathListMakeAbsolute) PathListAllExist, PathListMakeAbsolute)
) )
@ -369,6 +371,12 @@ else:
print ' Please fix SConstruct and src/SConscript and try again.' print ' Please fix SConstruct and src/SConscript and try again.'
Exit(1) Exit(1)
# Do this after we save setting back, or else we'll tack on an
# extra 'qdo' every time we run scons.
if env['BATCH']:
env['CC'] = env['BATCH_CMD'] + ' ' + env['CC']
env['CXX'] = env['BATCH_CMD'] + ' ' + env['CXX']
if sys.platform == 'cygwin': if sys.platform == 'cygwin':
# cygwin has some header file issues... # cygwin has some header file issues...
env.Append(CCFLAGS=Split("-Wno-uninitialized")) env.Append(CCFLAGS=Split("-Wno-uninitialized"))
@ -437,7 +445,6 @@ try:
env.Append(CFLAGS='-arch x86_64') env.Append(CFLAGS='-arch x86_64')
env.Append(LINKFLAGS='-arch x86_64') env.Append(LINKFLAGS='-arch x86_64')
env.Append(ASFLAGS='-arch x86_64') env.Append(ASFLAGS='-arch x86_64')
env['OSX64bit'] = True
except: except:
pass pass
@ -592,8 +599,6 @@ sticky_opts.AddOptions(
BoolOption('USE_MYSQL', 'Use MySQL for stats output', have_mysql), BoolOption('USE_MYSQL', 'Use MySQL for stats output', have_mysql),
BoolOption('USE_FENV', 'Use <fenv.h> IEEE mode control', have_fenv), BoolOption('USE_FENV', 'Use <fenv.h> IEEE mode control', have_fenv),
BoolOption('USE_CHECKER', 'Use checker for detailed CPU models', False), BoolOption('USE_CHECKER', 'Use checker for detailed CPU models', False),
BoolOption('BATCH', 'Use batch pool for build and tests', False),
('BATCH_CMD', 'Batch pool submission command name', 'qdo'),
('PYTHONHOME', ('PYTHONHOME',
'Override the default PYTHONHOME for this system (use with caution)', 'Override the default PYTHONHOME for this system (use with caution)',
'%s:%s' % (sys.prefix, sys.exec_prefix)), '%s:%s' % (sys.prefix, sys.exec_prefix)),
@ -819,12 +824,6 @@ for build_path in build_paths:
# Save sticky option settings back to current options file # Save sticky option settings back to current options file
sticky_opts.Save(current_opts_file, env) sticky_opts.Save(current_opts_file, env)
# Do this after we save setting back, or else we'll tack on an
# extra 'qdo' every time we run scons.
if env['BATCH']:
env['CC'] = env['BATCH_CMD'] + ' ' + env['CC']
env['CXX'] = env['BATCH_CMD'] + ' ' + env['CXX']
if env['USE_SSE2']: if env['USE_SSE2']:
env.Append(CCFLAGS='-msse2') env.Append(CCFLAGS='-msse2')

View file

@ -87,16 +87,9 @@ ElfFile('libelf_convert.c')
ElfFile('libelf_fsize.c') ElfFile('libelf_fsize.c')
ElfFile('libelf_msize.c') ElfFile('libelf_msize.c')
m4env = Environment(ENV=os.environ) m4env = env.Copy()
del m4env['CCFLAGS']
if env.get('CC'): del m4env['CPPPATH']
m4env['CC'] = env['CC']
if env.get('CXX'):
m4env['CXX'] = env['CXX']
if env.get('OSX64bit'):
m4env.Append(CFLAGS='-arch x86_64')
m4env.Append(LINKFLAGS='-arch x86_64')
# If we have gm4 use it # If we have gm4 use it
if m4env.Detect('gm4'): if m4env.Detect('gm4'):