From: Bo Peng Date: Mon, 27 Aug 2007 03:28:08 +0000 (+0000) Subject: Scons cleanup 4: stop forcing the use of c++ compiler because of the .C ==> .cpp... X-Git-Tag: 1.6.10~8690 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=d44f8f84ad1bd12466f76caec82d6d921eb38228;p=lyx.git Scons cleanup 4: stop forcing the use of c++ compiler because of the .C ==> .cpp conversion git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19820 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/development/scons/SConstruct b/development/scons/SConstruct index 36d930c27c..8147cee419 100644 --- a/development/scons/SConstruct +++ b/development/scons/SConstruct @@ -458,13 +458,6 @@ if use_vc: else: CCFLAGS_default.extend(['/wd4819', '/wd4996', '/nologo', '/MD']) C_CCFLAGS.extend(['/wd4819', '/wd4996', '/nologo', '/MD']) -else: - if env.has_key('CXX') and env['CXX']: - env['CC'] = env.subst('$CXX') - env['LINK'] = env.subst('$CXX') - else: - env['CC'] = 'g++' - env['LINK'] = 'g++' # for debug/release mode if env.has_key('optimization') and env['optimization'] is not None: @@ -1465,6 +1458,7 @@ env.SConsignFile(os.path.join(Dir(env['BUILDDIR']).abspath, '.sconsign')) # this usage needs further investigation. #env.CacheDir('%s/Cache/%s' % (env['BUILDDIR'], frontend)) env.BuildDir('$BUILDDIR/boost', '$TOP_SRCDIR/boost/libs', duplicate = 0) +env.BuildDir('$BUILDDIR/intl', '$TOP_SRCDIR/intl', duplicate = 0) env.BuildDir('$BUILDDIR/src', '$TOP_SRCDIR/src', duplicate = 0) frontend_env.BuildDir('$BUILDDIR/src', '$TOP_SRCDIR/src', duplicate = 0) @@ -1477,18 +1471,15 @@ def libExists(libname): if (included_boost and not libExists('included_boost_regex')) or 'boost' in BUILD_TARGETS: # - # boost libraries - boostenv = env.Copy() + # boost/libs # - # boost use its own config.h - boostenv['CPPPATH'] = ['$BUILDDIR/boost'] + extra_inc_paths - boostenv['CCFLAGS'] = ['$INCPREFIX$TOP_SRCDIR/boost'] - boostenv.AppendUnique(CCFLAGS = ['-DBOOST_USER_CONFIG=""']) - for lib in boost_libs: - boostlib = boostenv.StaticLibrary( + boostlib = env.StaticLibrary( target = '$LOCALLIBPATH/included_boost_%s' % lib, - source = ['$BUILDDIR/boost/%s/src/%s' % (lib, x) for x in eval('boost_libs_%s_src_files' % lib)] + source = ['$BUILDDIR/boost/%s/src/%s' % (lib, x) for x in eval('boost_libs_%s_src_files' % lib)], + # do not use global CPPPATH because src/config.h will mess up with boost/config.h + CPPPATH = ['$BUILDDIR/boost'] + extra_inc_paths, + CCFLAGS = ['$CCFLAGS', '$INCPREFIX$TOP_SRCDIR/boost', '-DBOOST_USER_CONFIG=""'] ) Alias('boost', boostlib) @@ -1497,17 +1488,7 @@ if (included_gettext and not libExists('included_intl')) or 'intl' in BUILD_TARG # # intl # - intlenv = env.Copy() - - # we need the original C compiler for these files - intlenv['CC'] = C_COMPILER - intlenv['CCFLAGS'] = C_CCFLAGS - if use_vc: - intlenv.Append(CCFLAGS=['/Dinline#', '/D__attribute__(x)#', '/Duintmax_t=UINT_MAX']) - # intl does not use global config.h - intlenv['CPPPATH'] = ['$BUILDDIR/intl'] + extra_inc_paths - - intlenv.Append(CCFLAGS = [ + INTL_CCFLAGS = [ r'-DLOCALEDIR=\"' + env['LOCALEDIR'].replace('\\', '\\\\') + r'\"', r'-DLOCALE_ALIAS_PATH=\"' + env['LOCALEDIR'].replace('\\', '\\\\') + r'\"', r'-DLIBDIR=\"' + env['TOP_SRCDIR'].replace('\\', '\\\\') + r'/lib\"', @@ -1521,11 +1502,15 @@ if (included_gettext and not libExists('included_intl')) or 'intl' in BUILD_TARG '-DDEPENDS_ON_LIBICONV=1', '-DHAVE_CONFIG_H' ] - ) + if use_vc: + INTL_CCFLAGS.extend(['/Dinline#', '/D__attribute__(x)#', '/Duintmax_t=UINT_MAX']) - intl = intlenv.StaticLibrary( + intl = env.StaticLibrary( target = '$LOCALLIBPATH/included_intl', LIBS = ['c'], + CCFLAGS = INTL_CCFLAGS, + # do not use global CPPPATH because src/config.h will mess up with intl/config.h + CPPPATH = ['$BUILDDIR/intl'] + extra_inc_paths, source = ['$BUILDDIR/intl/%s' % x for x in intl_files] ) Alias('intl', intl)