]> git.mxchange.org Git - flightgear.git/blobdiff - Simulator/runfg
Adopted Gnu automake/autoconf system.
[flightgear.git] / Simulator / runfg
index 1d42f66a8d7898133265b7caaa0ed4e9c27179f2..22a93414b74993a3654323a253c240034c836356 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
 
 #---------------------------------------------------------------------------
 # runfg -- front end for setting up the FG_ROOT env variable and launching 
 # Flight Gear Version
 $version_major = "0";
 
+$path = "";
+
 # name of Flight Gear executable
-$program = "fg" . $version_major;
+@programs = ( "fg" . $version_major, "fg" . $version_major . ".exe" );
 
 # see if we can find the executable
-if ( -x "./Main/$program" ) {
-    $path = "./Main/$program";
-} elsif ( -x "./$program" ) {
-    $path = "./$program";
-} else {
-    die "Cannot locate $program\n";
+while ( $path eq "" && ($program = shift(@programs)) ) {
+    print "$program\n";
+
+    if ( -x "./Main/$program" ) {
+       $path = "./Main/$program";
+    } elsif ( -x "./$program" ) {
+       $path = "./$program";
+    }
 }
 
+die "Cannot locate program.\n" if ( $path eq "" );
+
+
 # set the FG_ROOT environment variable if it hasn't already been set.
 if ( $ENV{FG_ROOT} eq "" ) {
     # look for a file called fgtop as a place marker
@@ -53,12 +60,22 @@ if ( $ENV{FG_ROOT} eq "" ) {
 }
 
 # run Flight Gear
-print "Running $path\n";
-exec($path);
+print "Running $path @ARGV\n";
+exec("$path @ARGV");
 
 
 #---------------------------------------------------------------------------
 # $Log$
+# Revision 1.4  1998/03/09 22:52:38  curt
+# Mod's to better support win32 if perl exists.
+#
+# Revision 1.3  1998/02/16 16:17:34  curt
+# Minor tweaks.
+#
+# Revision 1.2  1998/01/27 00:47:43  curt
+# Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+# system and commandline/config file processing code.
+#
 # Revision 1.1  1997/10/28 18:47:27  curt
 # Initial revision.
 #