Backslash ${prefix} for kde3 too...
[gnash.git] / gui / gnash.in
blobca0f16d87040211c2cdeb080e0816ce7339ca72c
1 #!/bin/sh
4 # gnash: Wrapper script for running the different GUI versions of gnash
5 #
6 # Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
7 #
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 3 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 # TODO:
25 # Handle --version on your own (or GUI config reported would be the one of the default executable)
28 #!/bin/sh
30 GUIS="gtk kde kde4 sdl fltk aqua riscos fb alp hildon haiku"
31 THIS_DIR="`dirname $0`"
33 if test "$1" = "-G"; then
34 shift
35 if test "x$1" = "x"; then
36 echo "-G needs an argument (-G list for a list of possible values)" >&2
37 exit 1
39 gui=`echo "$1" | tr '[A-Z]' '[a-z]'`
40 shift
41 if test "$gui" = "?" -o "$gui" = "list"; then
42 for g in ${GUIS}; do
43 exe=${THIS_DIR}/${g}-gnash
44 if test -e ${exe}; then
45 list="$list $g"
47 done
48 echo "Available guis: $list"
49 exit 0
51 if ! test -e ${THIS_DIR}/${gui}-gnash; then
52 echo "Can't find ${gui}-gnash." >&2
53 exit 1
57 for gui in ${gui} ${GUIS}; do
58 exe=${THIS_DIR}/${gui}-gnash
59 if test -e ${exe}; then
60 exec ${exe} "$@"
62 done
64 echo "Could not find any <gui>-gnash executable under directory ${THIS_DIR}, with <gui> in $GUI_DIR." >&2
65 exit 1