Made scons not pass -DPREFERENCES_DIR= by default.

Pass it only if prefsdir or version_suffix is set. That is consistent
with other buildsystems and enables XDG compliant locations for user
configuration, user data and cache if prefsdir/version_suffix are not
set.
This commit is contained in:
Sergey Popov 2010-10-15 01:24:24 +00:00
parent fb10a9c4a4
commit 306cccfef5
2 changed files with 4 additions and 2 deletions

View file

@ -75,7 +75,7 @@ opts.AddVariables(
BoolVariable('notifications', 'Enable support for desktop notifications', True),
BoolVariable('nls','enable compile/install of gettext message catalogs',True),
PathVariable('prefix', 'autotools-style installation prefix', "/usr/local", PathVariable.PathAccept),
PathVariable('prefsdir', 'user preferences directory', ".wesnoth$version_suffix", PathVariable.PathAccept),
PathVariable('prefsdir', 'user preferences directory', "", PathVariable.PathAccept),
PathVariable('destdir', 'prefix to add to all installation paths.', "/", PathVariable.PathAccept),
BoolVariable('prereqs','abort if prerequisites cannot be detected',True),
('program_suffix', 'suffix to append to names of installed programs',"$version_suffix"),

View file

@ -58,7 +58,9 @@ if env["PLATFORM"] != "win32":
filesystem_env.Append(CPPDEFINES = "LOCALEDIR='\"$localedirname\"'")
if not os.path.isabs(env['localedirname']):
filesystem_env.Append(CPPDEFINES = "HAS_RELATIVE_LOCALEDIR")
if env['prefsdir']:
if env['version_suffix'] and not env['prefsdir']:
filesystem_env['prefsdir'] = ".wesnoth$version_suffix"
if filesystem_env['prefsdir']:
filesystem_env.Append(CPPDEFINES = "PREFERENCES_DIR='\"$prefsdir\"'")
libwesnoth_core_sources.extend([