From d71d7fa45bc372109fb86494f7d881cc1bb10d71 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Mon, 24 Mar 2008 02:36:13 +0000 Subject: [PATCH] Support more configuration flags in scons. --- SConstruct | 20 +++++--------------- src/SConstruct | 4 ++-- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/SConstruct b/SConstruct index 86c51558c9d..f10121cb492 100644 --- a/SConstruct +++ b/SConstruct @@ -24,7 +24,7 @@ opts.Add(PathOption('prefsdir', 'user preferences directory', ".wesnoth", PathOp opts.Add(BoolOption('debug', 'Set to build for debugging', False)) opts.Add(BoolOption('profile', 'Set to build for debugging', False)) opts.Add(BoolOption('strict', 'Set to strict compilation', False)) -opts.Add(BoolOption('tests', 'Set to enable static building of Wesnoth', False)) +opts.Add(BoolOption('static', 'Set to enable static building of Wesnoth', False)) opts.Add(BoolOption('lite', 'Set to build lite version of wesnoth (no music or large images)', False)) opts.Add(BoolOption('smallgui', 'Set for GUI reductions for resolutions down to 800x480 (eeePC, Nokia 8x0), resize images before installing', False)) opts.Add(BoolOption('tinygui', 'Set for GUI reductions for resolutions down to 320x240 (PDAs), resize images before installing', False)) @@ -83,12 +83,14 @@ if not "/" in envdict["datadir"]: cc_version = env["CCVERSION"] -debug = ARGUMENTS.get('debug', 'no') -if debug == "yes": +if env["debug"] == "yes": env["CXXFLAGS"] = Split("-O0 -DDEBUG -ggdb3 -W -Wall -ansi") else: env["CXXFLAGS"] = Split("-O2 -ansi") +if env['static']: + env["LDFLAGS"].append("-all-static") + if env['profile']: env["CXXFLAGS"].append("-pg") @@ -223,18 +225,6 @@ wesconfig_builder = Builder(action = wesconfig_build) env.Append(BUILDERS = {'Wesconfig' : wesconfig_builder}) env.Wesconfig("src/wesconfig.h", "SConstruct") -# Build tests to crib from: -# http://silvertree.googlecode.com/svn/trunk/{SConstruct,scons/} -# -# Tips on MacOS scons usage -# http://www.scons.org/wiki/MacOSX -# -# Scons missing features: -# 1. [] overloading should be used more -- in particular, environment and -# options dictionaries should be directly accessible through it. -# 2. Where's the command-existence test? -# 3. New builder: Make target from string in SConstruct itself. - # Local variables: # mode: python # end: diff --git a/src/SConstruct b/src/SConstruct index 736afcaa08e..c640e21308d 100644 --- a/src/SConstruct +++ b/src/SConstruct @@ -10,8 +10,8 @@ env.Default("all") # Libraries and source groups # boost_libs = Split("boost_iostreams-mt boost_regex") -SDL_libs = Split("SDL_net SDL_ttf SDL_mixer SDL pthread SDL_image") -commonlibs = SDL_libs + boost_libs + ["-lpython"+sys.version[:3]] +SDL_libs = Split("SDL_net SDL_ttf SDL_mixer SDL_image SDL") +commonlibs = SDL_libs + boost_libs + ["pthread", "-lpython"+sys.version[:3]] #color_range.cpp should be removed, but game_config depends on it. #game_config has very few things that are needed elsewhere, it should be