scons: remove boostfilesystem build option, replace with "libintl"

This option cleans up some of the compatability path code from the
1.12 release. After this commit:

- boost::filesystem becomes a hard dependency, for scons
- boost::locale is a soft dependency, a build flag "libintl"
allows to swap boost::locale out for libintl.
- the libintl flag cannot be used when compiling for windows
This commit is contained in:
Chris Beck 2014-12-27 13:57:51 -05:00
parent 2a7b1f912c
commit c62d53239c
2 changed files with 13 additions and 9 deletions

View File

@ -73,7 +73,7 @@ opts.AddVariables(
BoolVariable('lowmem', 'Set to reduce memory usage by removing extra functionality', False),
BoolVariable('notifications', 'Enable support for desktop notifications', True),
BoolVariable('nls','enable compile/install of gettext message catalogs',True),
BoolVariable('boostfilesystem', 'Use boost filesystem', True),
BoolVariable('libintl', 'Use lib intl for translations, instead of boost locale', False),
BoolVariable('png', 'Clear to disable writing png files for screenshots, images', True),
PathVariable('prefix', 'autotools-style installation prefix', "/usr/local", PathVariable.PathAccept),
PathVariable('prefsdir', 'user preferences directory', "", PathVariable.PathAccept),
@ -299,8 +299,8 @@ configure_args = dict(
env.MergeFlags(env["extra_flags_config"])
# Some tests need to load parts of boost
if env["boostfilesystem"]:
env.PrependENVPath('LD_LIBRARY_PATH', env["boostlibdir"])
env.PrependENVPath('LD_LIBRARY_PATH', env["boostlibdir"])
if env["prereqs"]:
conf = env.Configure(**configure_args)
@ -373,16 +373,15 @@ if env["prereqs"]:
have_server_prereqs = (\
conf.CheckCPlusPlus(gcc_version = "3.3") & \
have_sdl_net() & \
((env["boostfilesystem"]) or (conf.CheckGettextLibintl())) & \
conf.CheckBoost("iostreams", require_version = "1.34.1") & \
conf.CheckBoostIostreamsGZip() & \
conf.CheckBoostIostreamsBZip2() & \
conf.CheckBoost("random",require_version = "1.40.0") & \
conf.CheckBoost("smart_ptr", header_only = True) & \
conf.CheckBoost("system") & \
((not env["boostfilesystem"]) or
(conf.CheckBoost("filesystem", require_version = "1.44.0") & \
conf.CheckBoost("locale"))) \
conf.CheckBoost("filesystem", require_version = "1.44.0") & \
((not env["libintl"]) or conf.CheckGettextLibintl()) & \
(env["libintl"] or conf.CheckBoost("locale")) \
and Info("GOOD: Base prerequisites are met")) \
or Warning("WARN: Base prerequisites are not met")
@ -404,6 +403,10 @@ if env["prereqs"]:
if have_client_prereqs:
if env["PLATFORM"] != "win32":
have_X = conf.CheckLib('X11')
else:
if env["libintl"]:
Warning("ERROR: You cannot use the libintl option when building for windows")
have_client_prereqs = False
env["notifications"] = env["notifications"] and conf.CheckPKG("dbus-1")
if env["notifications"]:
@ -521,6 +524,7 @@ for env in [test_env, client_env, env]:
if env["PLATFORM"] == 'win32':
env.Append(LIBS = ["wsock32", "iconv", "z"], CCFLAGS = ["-mthreads"], LINKFLAGS = ["-mthreads"], CPPDEFINES = ["_WIN32_WINNT=0x0500"])
if env["PLATFORM"] == 'darwin': # Mac OS X
env.Append(FRAMEWORKS = "Carbon") # Carbon GUI

View File

@ -66,8 +66,8 @@ if env['default_prefs_file']:
libwesnoth_core_sources.extend([
game_config_env.Object("game_config.cpp"),
filesystem_env.Object("filesystem_common.cpp"),
filesystem_env.Object("filesystem_boost.cpp") if env["boostfilesystem"] else filesystem_env.Object("filesystem.cpp"),
filesystem_env.Object("gettext_boost.cpp") if env["boostfilesystem"] else filesystem_env.Object("gettext.cpp")
filesystem_env.Object("filesystem_boost.cpp"),
filesystem_env.Object("gettext.cpp") if env["libintl"] else filesystem_env.Object("gettext_boost.cpp")
])
libwesnoth_core = [env.Library("wesnoth_core", libwesnoth_core_sources)]