SConstruct (7727:e40fbbe1ed4f) SConstruct (7739:f97a5f4d0879)
1# -*- mode:python -*-
2
3# Copyright (c) 2009 The Hewlett-Packard Development Company
4# Copyright (c) 2004-2005 The Regents of The University of Michigan
5# All rights reserved.
6#
7# Redistribution and use in source and binary forms, with or without
8# modification, are permitted provided that the following conditions are

--- 344 unchanged lines hidden (view full) ---

353main['SUNCC'] = CXX_V and CXX_V.find('Sun C++') >= 0
354main['ICC'] = CXX_V and CXX_V.find('Intel') >= 0
355if main['GCC'] + main['SUNCC'] + main['ICC'] > 1:
356 print 'Error: How can we have two at the same time?'
357 Exit(1)
358
359# Set up default C++ compiler flags
360if main['GCC']:
1# -*- mode:python -*-
2
3# Copyright (c) 2009 The Hewlett-Packard Development Company
4# Copyright (c) 2004-2005 The Regents of The University of Michigan
5# All rights reserved.
6#
7# Redistribution and use in source and binary forms, with or without
8# modification, are permitted provided that the following conditions are

--- 344 unchanged lines hidden (view full) ---

353main['SUNCC'] = CXX_V and CXX_V.find('Sun C++') >= 0
354main['ICC'] = CXX_V and CXX_V.find('Intel') >= 0
355if main['GCC'] + main['SUNCC'] + main['ICC'] > 1:
356 print 'Error: How can we have two at the same time?'
357 Exit(1)
358
359# Set up default C++ compiler flags
360if main['GCC']:
361 main.Append(CCFLAGS='-pipe')
362 main.Append(CCFLAGS='-fno-strict-aliasing')
361 main.Append(CCFLAGS=['-pipe'])
362 main.Append(CCFLAGS=['-fno-strict-aliasing'])
363 main.Append(CCFLAGS=['-Wall', '-Wno-sign-compare', '-Wundef'])
363 main.Append(CCFLAGS=['-Wall', '-Wno-sign-compare', '-Wundef'])
364 main.Append(CXXFLAGS='-Wno-deprecated')
364 main.Append(CXXFLAGS=['-Wno-deprecated'])
365 # Read the GCC version to check for versions with bugs
366 # Note CCVERSION doesn't work here because it is run with the CC
367 # before we override it from the command line
368 gcc_version = readCommand([main['CXX'], '-dumpversion'], exception=False)
369 if not compareVersions(gcc_version, '4.4.1') or \
370 not compareVersions(gcc_version, '4.4.2'):
371 print 'Info: Tree vectorizer in GCC 4.4.1 & 4.4.2 is buggy, disabling.'
365 # Read the GCC version to check for versions with bugs
366 # Note CCVERSION doesn't work here because it is run with the CC
367 # before we override it from the command line
368 gcc_version = readCommand([main['CXX'], '-dumpversion'], exception=False)
369 if not compareVersions(gcc_version, '4.4.1') or \
370 not compareVersions(gcc_version, '4.4.2'):
371 print 'Info: Tree vectorizer in GCC 4.4.1 & 4.4.2 is buggy, disabling.'
372 main.Append(CCFLAGS='-fno-tree-vectorize')
372 main.Append(CCFLAGS=['-fno-tree-vectorize'])
373elif main['ICC']:
374 pass #Fix me... add warning flags once we clean up icc warnings
375elif main['SUNCC']:
373elif main['ICC']:
374 pass #Fix me... add warning flags once we clean up icc warnings
375elif main['SUNCC']:
376 main.Append(CCFLAGS='-Qoption ccfe')
377 main.Append(CCFLAGS='-features=gcc')
378 main.Append(CCFLAGS='-features=extensions')
379 main.Append(CCFLAGS='-library=stlport4')
380 main.Append(CCFLAGS='-xar')
381 #main.Append(CCFLAGS='-instances=semiexplicit')
376 main.Append(CCFLAGS=['-Qoption ccfe'])
377 main.Append(CCFLAGS=['-features=gcc'])
378 main.Append(CCFLAGS=['-features=extensions'])
379 main.Append(CCFLAGS=['-library=stlport4'])
380 main.Append(CCFLAGS=['-xar'])
381 #main.Append(CCFLAGS=['-instances=semiexplicit'])
382else:
383 print 'Error: Don\'t know what compiler options to use for your compiler.'
384 print ' Please fix SConstruct and src/SConscript and try again.'
385 Exit(1)
386
387# Set up common yacc/bison flags (needed for Ruby)
388main['YACCFLAGS'] = '-d'
389main['YACCHXXFILESUFFIX'] = '.hh'

--- 4 unchanged lines hidden (view full) ---

394 main['CC'] = main['BATCH_CMD'] + ' ' + main['CC']
395 main['CXX'] = main['BATCH_CMD'] + ' ' + main['CXX']
396 main['AS'] = main['BATCH_CMD'] + ' ' + main['AS']
397 main['AR'] = main['BATCH_CMD'] + ' ' + main['AR']
398 main['RANLIB'] = main['BATCH_CMD'] + ' ' + main['RANLIB']
399
400if sys.platform == 'cygwin':
401 # cygwin has some header file issues...
382else:
383 print 'Error: Don\'t know what compiler options to use for your compiler.'
384 print ' Please fix SConstruct and src/SConscript and try again.'
385 Exit(1)
386
387# Set up common yacc/bison flags (needed for Ruby)
388main['YACCFLAGS'] = '-d'
389main['YACCHXXFILESUFFIX'] = '.hh'

--- 4 unchanged lines hidden (view full) ---

394 main['CC'] = main['BATCH_CMD'] + ' ' + main['CC']
395 main['CXX'] = main['BATCH_CMD'] + ' ' + main['CXX']
396 main['AS'] = main['BATCH_CMD'] + ' ' + main['AS']
397 main['AR'] = main['BATCH_CMD'] + ' ' + main['AR']
398 main['RANLIB'] = main['BATCH_CMD'] + ' ' + main['RANLIB']
399
400if sys.platform == 'cygwin':
401 # cygwin has some header file issues...
402 main.Append(CCFLAGS="-Wno-uninitialized")
402 main.Append(CCFLAGS=["-Wno-uninitialized"])
403
404# Check for SWIG
405if not main.has_key('SWIG'):
406 print 'Error: SWIG utility not found.'
407 print ' Please install (see http://www.swig.org) and retry.'
408 Exit(1)
409
410# Check for appropriate SWIG version

--- 73 unchanged lines hidden (view full) ---

484conf.CheckLeading()
485
486# Check if we should compile a 64 bit binary on Mac OS X/Darwin
487try:
488 import platform
489 uname = platform.uname()
490 if uname[0] == 'Darwin' and compareVersions(uname[2], '9.0.0') >= 0:
491 if int(readCommand('sysctl -n hw.cpu64bit_capable')[0]):
403
404# Check for SWIG
405if not main.has_key('SWIG'):
406 print 'Error: SWIG utility not found.'
407 print ' Please install (see http://www.swig.org) and retry.'
408 Exit(1)
409
410# Check for appropriate SWIG version

--- 73 unchanged lines hidden (view full) ---

484conf.CheckLeading()
485
486# Check if we should compile a 64 bit binary on Mac OS X/Darwin
487try:
488 import platform
489 uname = platform.uname()
490 if uname[0] == 'Darwin' and compareVersions(uname[2], '9.0.0') >= 0:
491 if int(readCommand('sysctl -n hw.cpu64bit_capable')[0]):
492 main.Append(CCFLAGS='-arch x86_64')
493 main.Append(CFLAGS='-arch x86_64')
494 main.Append(LINKFLAGS='-arch x86_64')
495 main.Append(ASFLAGS='-arch x86_64')
492 main.Append(CCFLAGS=['-arch x86_64'])
493 main.Append(CFLAGS=['-arch x86_64'])
494 main.Append(LINKFLAGS=['-arch x86_64'])
495 main.Append(ASFLAGS=['-arch x86_64'])
496except:
497 pass
498
499# Recent versions of scons substitute a "Null" object for Configure()
500# when configuration isn't necessary, e.g., if the "--help" option is
501# present. Unfortuantely this Null object always returns false,
502# breaking all our configuration checks. We replace it with our own
503# more optimistic null object that returns True instead.

--- 378 unchanged lines hidden (view full) ---

882 print "Compiling in", variant_dir, "with MySQL support."
883 env.ParseConfig(mysql_config_libs)
884 env.ParseConfig(mysql_config_include)
885
886 # Save sticky variable settings back to current variables file
887 sticky_vars.Save(current_vars_file, env)
888
889 if env['USE_SSE2']:
496except:
497 pass
498
499# Recent versions of scons substitute a "Null" object for Configure()
500# when configuration isn't necessary, e.g., if the "--help" option is
501# present. Unfortuantely this Null object always returns false,
502# breaking all our configuration checks. We replace it with our own
503# more optimistic null object that returns True instead.

--- 378 unchanged lines hidden (view full) ---

882 print "Compiling in", variant_dir, "with MySQL support."
883 env.ParseConfig(mysql_config_libs)
884 env.ParseConfig(mysql_config_include)
885
886 # Save sticky variable settings back to current variables file
887 sticky_vars.Save(current_vars_file, env)
888
889 if env['USE_SSE2']:
890 env.Append(CCFLAGS='-msse2')
890 env.Append(CCFLAGS=['-msse2'])
891
892 # The src/SConscript file sets up the build rules in 'env' according
893 # to the configured variables. It returns a list of environments,
894 # one for each variant build (debug, opt, etc.)
895 envList = SConscript('src/SConscript', variant_dir = variant_path,
896 exports = 'env')
897
898 # Set up the regression tests for each build.
899 for e in envList:
900 SConscript('tests/SConscript',
901 variant_dir = joinpath(variant_path, 'tests', e.Label),
902 exports = { 'env' : e }, duplicate = False)
903
904Help(help_text)
891
892 # The src/SConscript file sets up the build rules in 'env' according
893 # to the configured variables. It returns a list of environments,
894 # one for each variant build (debug, opt, etc.)
895 envList = SConscript('src/SConscript', variant_dir = variant_path,
896 exports = 'env')
897
898 # Set up the regression tests for each build.
899 for e in envList:
900 SConscript('tests/SConscript',
901 variant_dir = joinpath(variant_path, 'tests', e.Label),
902 exports = { 'env' : e }, duplicate = False)
903
904Help(help_text)