diff --git a/source/build/include/common.h b/source/build/include/common.h index 83e296715..b47c95d6a 100644 --- a/source/build/include/common.h +++ b/source/build/include/common.h @@ -58,9 +58,10 @@ extern const char *s_buildTimestamp; #ifdef __cplusplus } #endif -extern const char *s_buildInfo; //// FUNCTIONS +extern void PrintBuildInfo(void); + extern void clearDefNamePtr(void); void G_AddGroup(const char *buffer); diff --git a/source/build/src/common.cpp b/source/build/src/common.cpp index bbf45ec5c..e2e2838e4 100644 --- a/source/build/src/common.cpp +++ b/source/build/src/common.cpp @@ -8,22 +8,54 @@ #include "common.h" -const char* s_buildInfo = -#ifdef BITNESS64 - "(64-bit)" +void PrintBuildInfo(void) +{ + buildprint( + "Built ", s_buildTimestamp, ", " + +#if defined __INTEL_COMPILER + "ICC ", __INTEL_COMPILER / 100, ".", __INTEL_COMPILER % 100, " " __INTEL_COMPILER_BUILD_DATE " (" __VERSION__ ")" +#elif defined __clang__ + "clang " +# ifdef DEBUGGINGAIDS + __clang_version__ +# else + , __clang_major__, ".", __clang_minor__, ".", __clang_patchlevel__, +# endif +#elif defined _MSC_VER + "MSVC ", +# if defined _MSC_FULL_VER + _MSC_FULL_VER / 10000000, ".", _MSC_FULL_VER % 10000000 / 100000, ".", _MSC_FULL_VER % 100000, ".", _MSC_BUILD, +# else + _MSC_VER / 100, ".", _MSC_VER % 100, +# endif +#elif defined __GNUC__ + "GCC " +# ifdef DEBUGGINGAIDS + __VERSION__ +# else + , __GNUC__, ".", __GNUC_MINOR__, +# if defined __GNUC_PATCHLEVEL__ + ".", __GNUC_PATCHLEVEL__, +# endif +# endif #else - "(32-bit)" + "Unknown" #endif -#if defined (_MSC_VER) || defined(__cplusplus) -#ifdef _MSC_VER - " MSVC" + ", " +#ifdef BITNESS64 + "64" +#else + "32" #endif -#ifdef __cplusplus - " C++" + "-bit " +#if B_BIG_ENDIAN == 1 + "big-endian" #endif - " build" -#endif -; + "\n"); + + // TODO: architecture, OS, maybe build and feature settings +} // def/clipmap handling diff --git a/source/build/src/wiibits.cpp b/source/build/src/wiibits.cpp index e03767ba7..31fd47dc5 100644 --- a/source/build/src/wiibits.cpp +++ b/source/build/src/wiibits.cpp @@ -76,7 +76,7 @@ void wii_open(void) CON_GetMetrics(&ConsoleExtent.x, &ConsoleExtent.y); print_centered(ConsoleExtent.x, AppProperName, s_buildRev); - print_centered(ConsoleExtent.x, "Compiled", s_buildTimestamp); + print_centered(ConsoleExtent.x, "Built", s_buildTimestamp); VIDEO_WaitVSync(); if (vmode->viTVMode&VI_NON_INTERLACE) diff --git a/source/duke3d/src/astub.cpp b/source/duke3d/src/astub.cpp index 256f4d8b4..8df3851a1 100644 --- a/source/duke3d/src/astub.cpp +++ b/source/duke3d/src/astub.cpp @@ -62,7 +62,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. extern const char *s_buildRev; extern const char *s_buildTimestamp; -extern const char *s_buildInfo; #include @@ -8443,9 +8442,8 @@ int32_t ExtPreInit(int32_t argc,char const * const * argv) OSD_SetLogFile("mapster32.log"); OSD_SetVersion("Mapster32",0,2); - initprintf("Mapster32 %s %s\n", s_buildRev, s_buildInfo); - initprintf("Compiled %s\n", s_buildTimestamp); - // initprintf("Copyright (c) 2008 EDuke32 team\n"); + initprintf("Mapster32 %s\n", s_buildRev); + PrintBuildInfo(); G_CheckCommandLine(argc,argv); diff --git a/source/duke3d/src/game.cpp b/source/duke3d/src/game.cpp index ed0eb3763..1d61e2585 100644 --- a/source/duke3d/src/game.cpp +++ b/source/duke3d/src/game.cpp @@ -6108,8 +6108,8 @@ int app_main(int argc, char const * const * argv) wm_setapptitle(APPNAME); - initprintf(HEAD2 " %s %s\n", s_buildRev, s_buildInfo); - initprintf("Compiled %s\n", s_buildTimestamp); + initprintf(HEAD2 " %s\n", s_buildRev); + PrintBuildInfo(); if (!g_useCwd) G_AddSearchPaths(); diff --git a/source/kenbuild/src/bstub.cpp b/source/kenbuild/src/bstub.cpp index fcd55a26c..48d2ff385 100644 --- a/source/kenbuild/src/bstub.cpp +++ b/source/kenbuild/src/bstub.cpp @@ -93,8 +93,8 @@ int32_t ExtPreInit(int32_t argc,char const * const * argv) OSD_SetLogFile("testeditor.log"); OSD_SetVersion(AppProperName,0,2); - initprintf("%s %s %s\n", AppProperName, s_buildRev, s_buildInfo); - initprintf("Compiled %s\n", s_buildTimestamp); + initprintf("%s %s\n", AppProperName, s_buildRev); + PrintBuildInfo(); return 0; } diff --git a/source/kenbuild/src/game.cpp b/source/kenbuild/src/game.cpp index b53d332d4..bec23d298 100644 --- a/source/kenbuild/src/game.cpp +++ b/source/kenbuild/src/game.cpp @@ -467,8 +467,8 @@ int32_t app_main(int32_t argc, char const * const * argv) OSD_SetParameters(0,2, 0,0, 4,0); OSD_SetLogFile("testgame.log"); - initprintf("%s %s %s\n", AppProperName, s_buildRev, s_buildInfo); - initprintf("Compiled %s\n", s_buildTimestamp); + initprintf("%s %s\n", AppProperName, s_buildRev); + PrintBuildInfo(); #ifdef USE_OPENGL OSD_RegisterFunction("restartvid","restartvid: reinitialise the video mode",osdcmd_restartvid);