diff --git a/Makefile.src.in b/Makefile.src.in index 1d654d283f..fcdd9ecc8c 100644 --- a/Makefile.src.in +++ b/Makefile.src.in @@ -38,11 +38,13 @@ MAKEDEPEND = !!MAKEDEPEND!! CFLAGS_MAKEDEP = !!CFLAGS_MAKEDEP!! SORT = !!SORT!! AWK = !!AWK!! +CONFIGURE_INVOCATION = !!CONFIGURE_INVOCATION!! CONFIG_CACHE_COMPILER = $(SRC_OBJS_DIR)/!!CONFIG_CACHE_COMPILER!! CONFIG_CACHE_LINKER = $(SRC_OBJS_DIR)/!!CONFIG_CACHE_LINKER!! CONFIG_CACHE_ENDIAN = $(SRC_OBJS_DIR)/!!CONFIG_CACHE_ENDIAN!! CONFIG_CACHE_SOURCE = $(SRC_OBJS_DIR)/!!CONFIG_CACHE_SOURCE!! CONFIG_CACHE_VERSION = $(SRC_OBJS_DIR)/!!CONFIG_CACHE_VERSION!! +CONFIG_CACHE_INVOCATION = $(SRC_OBJS_DIR)/!!CONFIG_CACHE_INVOCATION!! OBJS_C := !!OBJS_C!! OBJS_CPP := !!OBJS_CPP!! @@ -114,6 +116,8 @@ RES := $(shell if [ "`cat $(CONFIG_CACHE_ENDIAN) 2>/dev/null`" != "$(ENDIAN_FORC RES := $(shell if [ "`cat $(CONFIG_CACHE_SOURCE) 2>/dev/null`" != "$(SRCS)" ]; then echo "$(SRCS)" > $(CONFIG_CACHE_SOURCE); fi ) # If there is a change in the revision, make sure we recompile rev.cpp RES := $(shell if [ "`cat $(CONFIG_CACHE_VERSION) 2>/dev/null`" != "$(REV) $(MODIFIED)" ]; then echo "$(REV) $(MODIFIED)" > $(CONFIG_CACHE_VERSION); fi ) +# If there is a change in the configure invocation, make sure we recompile rev.cpp +RES := $(shell if [ "`cat $(CONFIG_CACHE_INVOCATION) 2>/dev/null`" != "$(CONFIGURE_INVOCATION)" ]; then echo "$(CONFIGURE_INVOCATION)" > $(CONFIG_CACHE_INVOCATION); fi ) ifndef MAKEDEPEND # The slow, but always correct, dep-check @@ -292,8 +296,8 @@ $(ENDIAN_CHECK): $(SRC_DIR)/endian_check.cpp # Revision files -$(SRC_DIR)/rev.cpp: $(CONFIG_CACHE_VERSION) $(SRC_DIR)/rev.cpp.in - $(Q)cat $(SRC_DIR)/rev.cpp.in | sed "s@\!\!REVISION\!\!@$(REV_NR)@g;s@!!VERSION!!@$(REV)@g;s@!!MODIFIED!!@$(MODIFIED)@g;s@!!DATE!!@`date +%d.%m.%y`@g" > $(SRC_DIR)/rev.cpp +$(SRC_DIR)/rev.cpp: $(CONFIG_CACHE_VERSION) $(CONFIG_CACHE_INVOCATION) $(SRC_DIR)/rev.cpp.in + $(Q)cat $(SRC_DIR)/rev.cpp.in | sed "s@\!\!REVISION\!\!@$(REV_NR)@g;s@!!VERSION!!@$(REV)@g;s@!!MODIFIED!!@$(MODIFIED)@g;s@!!DATE!!@`date +%d.%m.%y`@g;s@\!\!CONFIGURE_INVOCATION\!\!@$(CONFIGURE_INVOCATION)@g;" > $(SRC_DIR)/rev.cpp $(SRC_DIR)/os/windows/ottdres.rc: $(CONFIG_CACHE_VERSION) $(SRC_DIR)/os/windows/ottdres.rc.in $(Q)cat $(SRC_DIR)/os/windows/ottdres.rc.in | sed "s@\!\!REVISION\!\!@$(REV_NR)@g;s@!!VERSION!!@$(REV)@g;s@!!DATE!!@`date +%d.%m.%y`@g" > $(SRC_DIR)/os/windows/ottdres.rc diff --git a/config.lib b/config.lib index 4974ef3470..2fee81b3e6 100644 --- a/config.lib +++ b/config.lib @@ -513,6 +513,12 @@ detect_params() { # Clean the logfile echo "" > $config_log log 2 "Invocation: $0 $*" + if [ "$ignore_extra_parameters" = "0" -o ! -f config.invocation ]; then + echo "$0 $*" > config.invocation + CONFIGURE_INVOCATION="$0 $*" + else + CONFIGURE_INVOCATION="`cat config.invocation`" + fi } save_params() { @@ -3440,6 +3446,7 @@ make_sed() { s@!!CONFIG_CACHE_VERSION!!@config.cache.version@g; s@!!CONFIG_CACHE_SOURCE_LIST!!@config.cache.source.list@g; s@!!CONFIG_CACHE_PWD!!@config.cache.pwd@g; + s@!!CONFIG_CACHE_INVOCATION!!@config.cache.invocation@g; s@!!LANG_SUPPRESS!!@$lang_suppress@g; s@!!OBJS_C!!@$OBJS_C@g; s@!!OBJS_CPP!!@$OBJS_CPP@g; @@ -3452,6 +3459,7 @@ make_sed() { s@!!DISTCC!!@$distcc@g; s@!!NFORENUM!!@$nforenum@g; s@!!GRFCODEC!!@$grfcodec@g; + s@!!CONFIGURE_INVOCATION!!@$CONFIGURE_INVOCATION@g; " if [ "$icon_theme_dir" != "" ]; then diff --git a/projects/determineversion.vbs b/projects/determineversion.vbs index e738569e3a..82ccde5f2d 100755 --- a/projects/determineversion.vbs +++ b/projects/determineversion.vbs @@ -27,6 +27,7 @@ Sub UpdateFile(modified, revision, version, cur_date, filename) FindReplaceInFile filename, "!!REVISION!!", revision FindReplaceInFile filename, "!!VERSION!!", version FindReplaceInFile filename, "!!DATE!!", cur_date + FindReplaceInFile filename, "!!CONFIGURE_INVOCATION!!", "" End Sub Sub UpdateFiles(version) diff --git a/src/crashlog.cpp b/src/crashlog.cpp index 05ae410b67..7749bef3d4 100644 --- a/src/crashlog.cpp +++ b/src/crashlog.cpp @@ -103,7 +103,8 @@ char *CrashLog::LogOpenTTDVersion(char *buffer, const char *last) const " Bits: %d\n" " Endian: %s\n" " Dedicated: %s\n" - " Build date: %s\n\n", + " Build date: %s\n" + " Configure: %s\n\n", _openttd_revision, _openttd_revision_modified, _openttd_newgrf_version, @@ -122,7 +123,8 @@ char *CrashLog::LogOpenTTDVersion(char *buffer, const char *last) const #else "no", #endif - _openttd_build_date + _openttd_build_date, + _openttd_build_configure ); } diff --git a/src/rev.cpp.in b/src/rev.cpp.in index 7e27859ce0..fb5b6d8c73 100644 --- a/src/rev.cpp.in +++ b/src/rev.cpp.in @@ -49,6 +49,12 @@ const char _openttd_revision[] = "!!VERSION!!"; */ const char _openttd_build_date[] = __DATE__ " " __TIME__; + +/** + * The configure invocation used to build OpenTTD + */ +const char _openttd_build_configure[] = "!!CONFIGURE_INVOCATION!!"; + /** * Let us know if current build was modified. This detection * works even in the case when revision string is overridden by diff --git a/src/rev.h b/src/rev.h index d31dbb51cc..68e19a3632 100644 --- a/src/rev.h +++ b/src/rev.h @@ -14,6 +14,7 @@ extern const char _openttd_revision[]; extern const char _openttd_build_date[]; +extern const char _openttd_build_configure[]; extern const byte _openttd_revision_modified; extern const uint32 _openttd_newgrf_version;