]> git.mxchange.org Git - flightgear.git/commitdiff
Use updated version.h if available.
authorJames Turner <zakalawe@mac.com>
Sat, 13 Nov 2010 18:58:55 +0000 (18:58 +0000)
committerJames Turner <zakalawe@mac.com>
Sat, 13 Nov 2010 18:58:55 +0000 (18:58 +0000)
Add single fallback header if version.h is missing.

src/Include/no_version.h [new file with mode: 0644]
src/Include/version.h.in
src/Instrumentation/mk_viii.cxx
src/Main/options.cxx

diff --git a/src/Include/no_version.h b/src/Include/no_version.h
new file mode 100644 (file)
index 0000000..4e33838
--- /dev/null
@@ -0,0 +1,16 @@
+#ifndef FG_NO_VERSION_H
+#define FG_NO_VERSION_H
+
+// version.h is generated by the build system for official builds of
+// FlightGear. To avoid complicating the life of regular developers,
+// especially on Windows, we set HAVE_VERSION_H if version.h is generated.
+// If that define is not set, we include this file instead, which provides
+// placeholder values instead.
+
+#define FLIGHTGEAR_VERSION "development " __DATE__
+
+#define HUDSON_BUILD_NUMBER 0
+#define HUDSON_BUILD_ID "none"
+#define REVISION "unknown"
+
+#endif
\ No newline at end of file
index f8524a3c629e83659d2825a2f6a72b4dbbdfc621..4d1f692ef02f38e521d61d1badffeaba0500bc2d 100644 (file)
@@ -28,7 +28,7 @@
 
 #define FLIGHTGEAR_VERSION "@VERSION@"
 
-#define HUDSON_BUILD_NUMBER "@HUDSON_BUILD_NUMBER@"
+#define HUDSON_BUILD_NUMBER @HUDSON_BUILD_NUMBER@
 #define HUDSON_BUILD_ID "@HUDSON_BUILD_ID@"
 #define REVISION "@REVISION@"
 
index d69cc96adec8e23833bff94f841250cf2bb8caf4..223ab61362dab56f589669ab8bae78d43d0c2c46 100755 (executable)
@@ -76,9 +76,13 @@ using std::string;
 
 #include <Airports/runways.hxx>
 #include <Airports/simple.hxx>
-#ifndef _MSC_VER
+
+#ifdef HAVE_VERSION_H
 #  include <Include/version.h>
+#else
+#  include <Include/no_version.h>
 #endif
+
 #include <Main/fg_props.hxx>
 #include <Main/globals.hxx>
 #include "instrument_mgr.hxx"
index 4eebeead598df9c9b05aa32ce28cf86a3476279c..cf8317a79a1bafbb102579d6f81194cdd04fca79 100644 (file)
@@ -64,8 +64,10 @@ using std::cout;
 using std::cerr;
 using std::endl;
 
-#ifndef VERSION
-#define VERSION "CVS "__DATE__
+#ifdef HAVE_VERSION_H
+#  include <Include/version.h>
+#else
+#  include <Include/no_version.h>
 #endif
 
 #define NEW_DEFAULT_MODEL_HZ 120
@@ -233,6 +235,12 @@ fgSetDefaults ()
     fgSetString("/sim/multiplay/txhost", "0");
     fgSetInt("/sim/multiplay/rxport", 0);
     fgSetInt("/sim/multiplay/txport", 0);
+    
+    fgSetString("/sim/version/flightgear", FLIGHTGEAR_VERSION);
+    //fgSetString("/sim/version/simgear", FLIGHTGEAR_VERSION);
+    fgSetString("/sim/version/revision", REVISION);
+    fgSetInt("/sim/version/build-number", HUDSON_BUILD_NUMBER);
+    fgSetString("/sim/version/build-id", HUDSON_BUILD_ID);
 }
 
 static bool
@@ -1208,7 +1216,9 @@ fgOptParking( const char *arg )
 static int
 fgOptVersion( const char *arg )
 {
-    cerr << "FlightGear version: " << VERSION << endl;
+    cerr << "FlightGear version: " << FLIGHTGEAR_VERSION << endl;
+    cerr << "Revision: " << REVISION << endl;
+    cerr << "Build-Id: " << HUDSON_BUILD_ID << endl;
     cerr << "FG_ROOT=" << globals->get_fg_root() << endl;
     cerr << "FG_HOME=" << fgGetString("/sim/fg-home") << endl;
     cerr << "FG_SCENERY=";