From d648270ebba6880b1ac8fca29ed0d150fa8f22ca Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Mon, 24 Mar 2008 13:43:45 +0000 Subject: [PATCH] Re-introduce wesconfig.h include to some files... ...where it will be handy for the scons build. --- SConstruct | 8 ++++++-- src/ai.cpp | 1 + src/ai_python.cpp | 2 ++ src/game.cpp | 1 + src/multiplayer_connect.cpp | 1 + src/wesconfig.h | 9 +++------ 6 files changed, 14 insertions(+), 8 deletions(-) diff --git a/SConstruct b/SConstruct index 7bcf66a5f66..f1cc44b9a92 100644 --- a/SConstruct +++ b/SConstruct @@ -71,8 +71,8 @@ Available build targets include: wesnoth wesnoth_editor wesnothd campaignd exploder cutter all = all installables - test = unit test binary - tags = build tags for Emacs. + test = unit test binary (not an imstallable) + TAGS = build tags for Emacs. """ + opts.GenerateHelpText(env)) conf = Configure(env) @@ -87,6 +87,10 @@ if not "/" in envdict["datadir"]: # Check some preconditions # +if float(sys.version[:3]) < 2.5: + print "Python version is too old, 2.4 or greater is required," + Exit(1) + targets = map(str, BUILD_TARGETS) if ("wesnoth" in targets or "wesnoth_editor" in targets): diff --git a/src/ai.cpp b/src/ai.cpp index 180b0df8570..1605f291742 100644 --- a/src/ai.cpp +++ b/src/ai.cpp @@ -17,6 +17,7 @@ //! @file ai.cpp //! Artificial intelligence - The computer commands the enemy. +#include "wesconfig.h" #include "ai.hpp" #include "ai2.hpp" #include "ai_dfool.hpp" diff --git a/src/ai_python.cpp b/src/ai_python.cpp index 7cbb8a6d652..e2b3ac66c3a 100644 --- a/src/ai_python.cpp +++ b/src/ai_python.cpp @@ -38,6 +38,8 @@ supposed to be catched by user scripts. */ +#include "wesconfig.h" + #ifdef HAVE_PYTHON #include "global.hpp" diff --git a/src/game.cpp b/src/game.cpp index 8992a00108b..97bfaea863c 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -49,6 +49,7 @@ #include "titlescreen.hpp" #include "util.hpp" #include "upload_log.hpp" +#include "wesconfig.h" #include "wml_exception.hpp" #include "wml_separators.hpp" #include "serialization/binary_or_text.hpp" diff --git a/src/multiplayer_connect.cpp b/src/multiplayer_connect.cpp index 82d9908ce6a..7b8581a57f6 100644 --- a/src/multiplayer_connect.cpp +++ b/src/multiplayer_connect.cpp @@ -29,6 +29,7 @@ #include "statistics.hpp" #include "show_dialog.hpp" #include "serialization/string_utils.hpp" +#include "wesconfig.h" #include diff --git a/src/wesconfig.h b/src/wesconfig.h index 4cc4d16ed35..86f544cc49d 100644 --- a/src/wesconfig.h +++ b/src/wesconfig.h @@ -8,23 +8,20 @@ //! DO NOT MODIFY THIS FILE !!! //! modify SConstruct otherwise the settings will be overwritten. +// We are building with scons, so Python cannot be absent. +#define HAVE_PYTHON - -#ifdef HAVE_CONFIG_H -# include "config.h" -#else # define VERSION "1.5.0-svn" # define PACKAGE "wesnoth" # ifndef LOCALEDIR # define LOCALEDIR "translations" # endif -#endif /** * Some older savegames of Wesnoth cannot be loaded anymore, * this variable defines the minimum required version. * It is only to be updated upon changes that break *all* saves/replays - * (break as in crash wesnoth, not compatibility issues like stat changes) + * (break as in crash Wesnoth, not compatibility issues like stat changes) */ #define MIN_SAVEGAME_VERSION "1.3.10"