summarylogtreecommitdiffstats
path: root/mingw-wine.sh
blob: 292e2f49aa3136f33fb8779488fddf7db77753d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh

set -e

mingw_prefix=/usr/@TRIPLE@

# wine requires the dlls to lie next to the exe
if test -f "$1"
then
  path=`dirname $1`
  if ! test -f "${path}/libstdc++-6.dll"
  then
    cp ${mingw_prefix}/bin/*.dll ${path}
  fi
fi

# run it in a custom WINEPREFIX to not mess with default ~/.wine
# also default prefix might be a 32 bits prefix, which will fail to run x86_64 exes
if ! test -d "${WINEPREFIX}"
then
  WINEPREFIX=~/.wine-@TRIPLE@ wine "$@"
else
  wine "$@"
fi