webperimental: killstack decides stack protects.
[freeciv.git] / bootstrap / fcgui.in
blob391f5e9cece1c74fb22de47264442105ec1ff443
1 #!/bin/sh
2 #/***********************************************************************
3 # Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
4 # script by Rene Schalburg
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2, or (at your option)
8 # any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 #***********************************************************************/
17 BUILDDIR=`dirname $0`
18 PROGNAME=freeciv
19 EXENAME=${PROGNAME}@EXEEXT@
21 if test "x$1" = "x--gui" ; then
22 if test "x$2" != "x" ; then
23 EXENAME=${PROGNAME}-$2
24 shift
26 shift
29 if test -x "$BUILDDIR/client/$EXENAME" ; then
30 EXE=$BUILDDIR/client/$EXENAME
31 elif test -x "$BUILDDIR/$EXENAME" ; then
32 EXE=$BUILDDIR/$EXENAME
33 else
34 echo "Unable to find client executable: $EXENAME"
35 echo "Searching for freeciv clients ..."
37 EXE=`ls -1 "$BUILDDIR/${PROGNAME}-"* "$BUILDDIR/client/${PROGNAME}-"* 2> /dev/null |\
38 while read program ; do
39 if test -x "$program" ; then
40 echo $program
41 break
43 done`
45 if test -x "$EXE" ; then
46 echo "... using $EXE"
47 else
48 echo "No client found"
49 exit 1
53 if test "x$FREECIV_DATA_PATH" = "x" ; then
54 FREECIV_DATA_PATH=".@HOST_PATH_SEPARATOR@data@HOST_PATH_SEPARATOR@@FREECIV_STORAGE_DIR@@HOST_DIR_SEPARATOR@@DATASUBDIR@"
56 FREECIV_DATA_PATH="${FREECIV_DATA_PATH}@HOST_PATH_SEPARATOR@@abs_top_builddir@@HOST_DIR_SEPARATOR@data@HOST_PATH_SEPARATOR@@abs_top_srcdir@@HOST_DIR_SEPARATOR@data"
57 export FREECIV_DATA_PATH
59 if test "x$FREECIV_SAVE_PATH" = "x" ; then
60 FREECIV_SAVE_PATH=".@HOST_PATH_SEPARATOR@@FREECIV_STORAGE_DIR@@HOST_DIR_SEPARATOR@saves"
62 FREECIV_SAVE_PATH="${FREECIV_SAVE_PATH}@HOST_PATH_SEPARATOR@@abs_top_builddir@@HOST_PATH_SEPARATOR@@abs_top_srcdir@"
63 export FREECIV_SAVE_PATH
65 if test "x$FREECIV_SCENARIO_PATH" = "x" ; then
66 FREECIV_SCENARIO_PATH=".@HOST_PATH_SEPARATOR@data@HOST_DIR_SEPARATOR@scenarios@HOST_PATH_SEPARATOR@@FREECIV_STORAGE_DIR@@HOST_DIR_SEPARATOR@@DATASUBDIR@@HOST_DIR_SEPARATOR@scenarios@HOST_PATH_SEPARATOR@@FREECIV_STORAGE_DIR@@HOST_DIR_SEPARATOR@scenarios"
68 FREECIV_SCENARIO_PATH="${FREECIV_SCENARIO_PATH}@HOST_PATH_SEPARATOR@@abs_top_builddir@@HOST_DIR_SEPARATOR@data@HOST_DIR_SEPARATOR@scenarios@HOST_PATH_SEPARATOR@@abs_top_srcdir@@HOST_DIR_SEPARATOR@data@HOST_DIR_SEPARATOR@scenarios"
69 export FREECIV_SCENARIO_PATH
71 echo "Running $EXE"
72 exec "$EXE" ${1+"$@"}