]> git.mxchange.org Git - flightgear.git/blob - Simulator/runfg
Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
[flightgear.git] / Simulator / runfg
1 #!/usr/bin/perl
2
3 #---------------------------------------------------------------------------
4 # runfg -- front end for setting up the FG_ROOT env variable and launching 
5 #          the fg executable.
6 #
7 # Written by Curtis Olson, started September 1997.
8 #
9 # Copyright (C) 1997  Curtis L. Olson  - curt@infoplane.com
10 #
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.
15 #
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.
20 #
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.
24 #
25 # $Id$
26 # (Log is kept at end of this file)
27 #---------------------------------------------------------------------------
28
29
30 # Flight Gear Version
31 $version_major = "0";
32
33 # name of Flight Gear executable
34 $program = "fg" . $version_major;
35
36 # see if we can find the executable
37 if ( -x "./Main/$program" ) {
38     $path = "./Main/$program";
39 } elsif ( -x "./$program" ) {
40     $path = "./$program";
41 } else {
42     die "Cannot locate $program\n";
43 }
44
45 # set the FG_ROOT environment variable if it hasn't already been set.
46 if ( $ENV{FG_ROOT} eq "" ) {
47     # look for a file called fgtop as a place marker
48     if ( -e "fgtop" ) {
49         $ENV{FG_ROOT} = ".";
50     } elsif ( -e "../fgtop" ) {
51         $ENV{FG_ROOT} = "..";
52     }
53 }
54
55 # run Flight Gear
56 print "Running $path\n";
57 exec($path);
58
59
60 #---------------------------------------------------------------------------
61 # $Log$
62 # Revision 1.2  1998/01/27 00:47:43  curt
63 # Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
64 # system and commandline/config file processing code.
65 #
66 # Revision 1.1  1997/10/28 18:47:27  curt
67 # Initial revision.
68 #