found.
}
+// Return the current base package version
+string fgBasePackageVersion() {
+ SGPath base_path( globals->get_fg_root() );
+ base_path.append("version");
+
+ sg_gzifstream in( base_path.str() );
+ if ( !in.is_open() ) {
+ SGPath old_path( globals->get_fg_root() );
+ old_path.append( "Thanks" );
+ sg_gzifstream old( old_path.str() );
+ if ( !old.is_open() ) {
+ return "[none found]";
+ } else {
+ return "[old version, please upgrade]";
+ }
+ }
+
+ string version;
+ in >> version;
+
+ return version;
+}
+
+
// Read in configuration (file and command line)
bool fgInitConfig ( int argc, char **argv ) {
#endif
+#ifdef HAVE_CONFIG
+# include <config.h>
+#endif
+
+#include <simgear/compiler.h>
+
+#include STL_STRING
+
#include <Airports/simple.hxx>
+SG_USING_STD(string);
+
// Read in configuration (file and command line) and just set fg_root
bool fgInitFGRoot ( int argc, char **argv );
+// Return the current base package version
+string fgBasePackageVersion();
+
+
// Read in configuration (file and command line)
bool fgInitConfig ( int argc, char **argv );
// fg_root was specified (ignore all other options for now)
fgInitFGRoot(argc, argv);
+ // Check for the correct base package version
+ string base_version = fgBasePackageVersion();
+ if ( !(base_version == "0.7.9") ) {
+ SG_LOG( SG_GENERAL, SG_ALERT, "Base package check failed ... "
+ << base_version);
+ exit(-1);
+ }
+
// Initialize the Aircraft directory to "" (UIUC)
aircraft_dir = "";