3 #---------------------------------------------------------------------------
4 # runfg -- front end for setting up the FG_ROOT env variable and launching
7 # Written by Curtis Olson, started September 1997.
9 # Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
11 # This program is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13 # the Free Software Foundation; either version 2 of the License, or
14 # (at your option) any later version.
16 # This program is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write to the Free Software
23 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 # (Log is kept at end of this file)
27 #---------------------------------------------------------------------------
35 # name of Flight Gear executable
36 @programs = ( "fg" . $version_major, "fg" . $version_major . ".exe" );
38 # see if we can find the executable
39 while ( $path eq "" && ($program = shift(@programs)) ) {
42 if ( -x "./Main/$program" ) {
43 $path = "./Main/$program";
44 } elsif ( -x "./$program" ) {
49 die "Cannot locate program.\n" if ( $path eq "" );
52 # set the FG_ROOT environment variable if it hasn't already been set.
53 if ( $ENV{FG_ROOT} eq "" ) {
54 # look for a file called fgtop as a place marker
57 } elsif ( -e "../fgtop" ) {
63 print "Running $path @ARGV\n";
67 #---------------------------------------------------------------------------
69 # Revision 1.4 1998/03/09 22:52:38 curt
70 # Mod's to better support win32 if perl exists.
72 # Revision 1.3 1998/02/16 16:17:34 curt
75 # Revision 1.2 1998/01/27 00:47:43 curt
76 # Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
77 # system and commandline/config file processing code.
79 # Revision 1.1 1997/10/28 18:47:27 curt