Back to home page

Wine source

 
 

    


File indexing completed on 2023-03-03 23:36:58

3536316a3 Alex*0001 #!/bin/sh
                0002 #
                0003 # Wrapper script to run Wine and Winelib apps from inside the source tree
                0004 #
                0005 # Copyright (C) 2002 Alexandre Julliard
                0006 #
                0007 # This library is free software; you can redistribute it and/or
                0008 # modify it under the terms of the GNU Lesser General Public
                0009 # License as published by the Free Software Foundation; either
                0010 # version 2.1 of the License, or (at your option) any later version.
                0011 #
                0012 # This library is distributed in the hope that it will be useful,
                0013 # but WITHOUT ANY WARRANTY; without even the implied warranty of
                0014 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
                0015 # Lesser General Public License for more details.
                0016 #
                0017 # You should have received a copy of the GNU Lesser General Public
                0018 # License along with this library; if not, write to the Free Software
360a3f914 Jona*0019 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
3536316a3 Alex*0020 #
                0021 
                0022 # first determine the directory that contains the app itself
                0023 
                0024 appdir=""
4422d22cf Alex*0025 name=$0
                0026 
3536316a3 Alex*0027 case "$0" in
                0028   */*)
                0029     # $0 contains a path, use it
                0030     appdir=`dirname "$0"`
4422d22cf Alex*0031     name=`basename "$0"`
3536316a3 Alex*0032     ;;
                0033   *)
                0034     # no directory in $0, search in PATH
                0035     saved_ifs=$IFS
                0036     IFS=:
                0037     for d in $PATH
                0038     do
                0039       IFS=$saved_ifs
4422d22cf Alex*0040       if [ -x "$d/$name" ]
3536316a3 Alex*0041       then
                0042         appdir="$d"
                0043         break
                0044       fi
                0045     done
                0046     ;;
                0047 esac
                0048 
4422d22cf Alex*0049 # now find the top-level directory of the build tree
3536316a3 Alex*0050 
                0051 if [ -x "$appdir/server/wineserver" ]
                0052 then topdir="$appdir"
                0053 elif [ -x "$appdir/../server/wineserver" ]
                0054 then topdir="$appdir/.."
                0055 elif [ -x "$appdir/../../server/wineserver" ]
                0056 then topdir="$appdir/../.."
                0057 elif [ -x "$appdir/../../../server/wineserver" ]
                0058 then topdir="$appdir/../../.."
                0059 else
4422d22cf Alex*0060   echo "$name: could not locate the Wine build tree"
3536316a3 Alex*0061   exit 1
                0062 fi
                0063 
                0064 # setup the environment
                0065 
                0066 topdir=`cd "$topdir" && pwd`
                0067 
a808f38c1 Alex*0068 if [ "`uname -s`" = "Darwin" ]
3536316a3 Alex*0069 then
a808f38c1 Alex*0070   if [ -n "$DYLD_LIBRARY_PATH" ]
                0071   then
5c831122c Alex*0072     DYLD_LIBRARY_PATH="$topdir/dlls/ntdll:$topdir/dlls/win32u:$DYLD_LIBRARY_PATH"
a808f38c1 Alex*0073   else
5c831122c Alex*0074     DYLD_LIBRARY_PATH="$topdir/dlls/ntdll:$topdir/dlls/win32u"
a808f38c1 Alex*0075   fi
                0076   export DYLD_LIBRARY_PATH
3536316a3 Alex*0077 fi
a808f38c1 Alex*0078 
4422d22cf Alex*0079 if [ -x "$topdir/loader/$name" ]
                0080 then WINELOADER="$topdir/loader/$name"
                0081 elif [ -x "$topdir/loader/wine" ]
50c6ac832 Alex*0082 then WINELOADER="$topdir/loader/wine"
12aa347e1 Fran*0083 elif [ -x "$topdir/loader/wine64" ]
                0084 then WINELOADER="$topdir/loader/wine64"
50c6ac832 Alex*0085 else
4422d22cf Alex*0086   echo "$name: could not find the Wine loader in $topdir"
50c6ac832 Alex*0087   exit 1
                0088 fi
bf463abfe Alex*0089 export WINELOADER
3536316a3 Alex*0090 
6a2ca011b Eric*0091 # any local settings ?
                0092 if [ -f "$topdir/.winewrapper" ]
                0093 then
                0094     . $topdir/.winewrapper
                0095 fi
                0096 
3536316a3 Alex*0097 # and run the application
                0098 
50c6ac832 Alex*0099 exec "$WINELOADER" "$@"