From: <pat...@us...> - 2011-04-23 22:08:43
|
Revision: 678 http://xml-cppdom.svn.sourceforge.net/xml-cppdom/?rev=678&view=rev Author: patrickh Date: 2011-04-23 22:08:36 +0000 (Sat, 23 Apr 2011) Log Message: ----------- Updated the build to work with, and require, SCons 2.0. Modified Paths: -------------- trunk/ChangeLog trunk/SConstruct trunk/cppdom/SConscript trunk/test/SConscript Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-04-04 23:46:05 UTC (rev 677) +++ trunk/ChangeLog 2011-04-23 22:08:36 UTC (rev 678) @@ -1,5 +1,7 @@ DATE AUTHOR CHANGE ---------- ----------- ------------------------------------------------------- +2011-04-23 patrickh SCons 2.0 is now the minimum required version. + Submitted by Doug McCorkle. 2010-04-14 patrickh Preserve newlines in CDATA. Submitted by: Carsten Neumann VERSION: 1.1.2 Modified: trunk/SConstruct =================================================================== --- trunk/SConstruct 2011-04-04 23:46:05 UTC (rev 677) +++ trunk/SConstruct 2011-04-23 22:08:36 UTC (rev 678) @@ -27,7 +27,7 @@ #------------------------------------------------------------------------------ # Main build setup #------------------------------------------------------------------------------ -EnsureSConsVersion(0,96) +EnsureSConsVersion(2,0) #SourceSignatures('MD5') #SourceSignatures('timestamp') SConsignFile('.sconsign.'+GetPlatform()) @@ -43,19 +43,20 @@ buildDir = "build." + platform option_filename = "config.cache." + platform +temp_env = dict(ENV = os.environ) if GetPlatform() == "win32": - if ARGUMENTS.has_key("MSVS_VERSION"): - common_env = Environment(MSVS_VERSION = ARGUMENTS["MSVS_VERSION"]) - else: - common_env = Environment() - common_env["MSVS"] = {"VERSION" : common_env["MSVS_VERSION"]} - print "Using MSVS version", common_env["MSVS"]["VERSION"] -else: - common_env = Environment(ENV = os.environ) -SConsAddons.Builders.registerSubstBuilder(common_env) -common_env["CONFIGUREDIR"] = '.sconf_temp_'+platform -common_env["CONFIGURELOG"] = 'sconf.log_'+platform + if ARGUMENTS.has_key("MSVC_VERSION"): + temp_env["MSVC_VERSION"] = ARGUMENTS["MSVC_VERSION"] + if ARGUMENTS.has_key("MSVS_ARCH"): + temp_env["MSVS_ARCH"] = ARGUMENTS["MSVS_ARCH"] + temp_env["TARGET_ARCH"] = ARGUMENTS["MSVS_ARCH"] + + temp_env["MSVS"] = {"VERSION" : temp_env["MSVC_VERSION"]} + +temp_env["CONFIGUREDIR"] = '.sconf_temp_'+platform +temp_env["CONFIGURELOG"] = 'sconf.log_'+platform + # Create variant helper and builder variant_helper = sca_variants.VariantsHelper() base_bldr = EnvironmentBuilder() @@ -71,8 +72,12 @@ opts.AddOption(sca_opts.SeparatorOption("\nPackage Options")) opts.AddOption( cppunit_options ) opts.AddOption( boost_options ) + base_bldr.addOptions(opts) variant_helper.addOptions(opts) +common_env = base_bldr.buildEnvironment(None,None,**temp_env) +SConsAddons.Builders.registerSubstBuilder(common_env) + opts.AddOption(sca_opts.SeparatorOption("\nOther settings")) opts.Add('prefix', 'Installation prefix', unspecified_prefix) opts.Add('build_test', 'Build the test programs', 'yes') @@ -108,7 +113,7 @@ base_bldr.readOptions(common_env) base_bldr.enableWarnings() - # Apply any common package options + # Apply any common package options # Update environment for boost options if boost_options.isAvailable(): boost_options.apply(common_env) @@ -162,8 +167,8 @@ sub_dirs.append('test') # ---- FOR EACH VARIANT ----- # - for combo in variant_helper.iterate(locals(), base_bldr, common_env): - #baseEnv = env_bldr.applyToEnvironment(common_env.Copy(), variant=combo,options=opts) + for combo in variant_helper.iterate(locals(), base_bldr, common_env): + #build_env = base_bldr.applyToEnvironment(common_env.Copy(), variant=combo,options=opts) print " Processing combo: ", ", ".join(['%s:%s'%(i[0],i[1]) for i in combo.iteritems()]) inst_paths = copy.copy(base_inst_paths) @@ -195,7 +200,7 @@ # Process subdirectories full_build_dir = pj(buildDir,combo_dir) for d in sub_dirs: - SConscript(pj(d,'SConscript'), build_dir=pj(full_build_dir, d), duplicate=0) + SConscript(pj(d,'SConscript'), variant_dir=pj(full_build_dir, d), duplicate=0) # Build up the provides vars for the .fpc files inst_paths['flagpoll'] = pj(inst_paths['lib'],'flagpoll') Modified: trunk/cppdom/SConscript =================================================================== --- trunk/cppdom/SConscript 2011-04-04 23:46:05 UTC (rev 677) +++ trunk/cppdom/SConscript 2011-04-23 22:08:36 UTC (rev 678) @@ -27,7 +27,7 @@ if boost_options.isAvailable(): sources.append("SpiritParser.cpp") -cppdom_lib_env = build_env.Copy() +cppdom_lib_env = build_env.Clone() cppdom_lib_env.Append(CPPPATH = [inst_paths['include'],]) if "debug" in combo["type"] or "debugrt" in combo["type"]: @@ -40,10 +40,10 @@ # NOTE: The [:3] bit used before passing the MSVS_VERSION value to float() # is to handle the case of Visual C++ Express Edition which appends "Exp" # to the version number. - if cppdom_lib_env.has_key('MSVS_VERSION') and float(cppdom_lib_env['MSVS_VERSION'][:3]) >= 8.0: + if cppdom_lib_env.has_key('MSVC_VERSION') and float(cppdom_lib_env['MSVC_VERSION'][:3]) >= 8.0: shlinkcom = [shlinkcom, 'mt.exe -manifest ${TARGET}.manifest -outputresource:$TARGET;2'] - cppdom_shared_lib_env = cppdom_lib_env.Copy() + cppdom_shared_lib_env = cppdom_lib_env.Clone() cppdom_shared_lib_env.AppendUnique(CPPDEFINES = ["CPPDOM_EXPORTS"]) if GetPlatform() == 'darwin': # TODO: The install name should probably include the installation @@ -60,7 +60,7 @@ cppdom_shared_lib_env.Install(inst_paths['lib'], cppdom_lib) if "static" in combo["libtype"]: - cppdom_static_lib_env = cppdom_lib_env.Copy() + cppdom_static_lib_env = cppdom_lib_env.Clone() cppdom_static_lib = cppdom_static_lib_env.StaticLibrary(cppdom_static_libname, sources) cppdom_static_lib_env.Install(inst_paths['lib'], cppdom_static_lib) Modified: trunk/test/SConscript =================================================================== --- trunk/test/SConscript 2011-04-04 23:46:05 UTC (rev 677) +++ trunk/test/SConscript 2011-04-23 22:08:36 UTC (rev 678) @@ -4,7 +4,7 @@ import os pj = os.path.join -test_env = build_env.Copy() +test_env = build_env.Clone() test_env.Append(CPPPATH = [inst_paths['include'], '#test'], LIBPATH = [inst_paths['lib'],], LIBS = [cppdom_app_libname]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |