Use wine on Linux to test executable when building windows zip file

This commit is contained in:
William S Fulton 2019-04-09 06:50:25 +01:00
commit d6746379a1

View file

@ -9,6 +9,8 @@
# path to zip program # path to zip program
zip= zip=
wine=
# options for configure # options for configure
extraconfigureoptions= extraconfigureoptions=
compileflags="-O2 -Wall -Wextra" compileflags="-O2 -Wall -Wextra"
@ -41,6 +43,11 @@ else
echo "Building native Windows executable on Linux" echo "Building native Windows executable on Linux"
if test x$zip = x; then if test x$zip = x; then
zip=zip zip=zip
wine=$(which wine)
fi
if test x$wine = x; then
echo "Could not detect wine - please install wine-stable package."
exit 1;
fi fi
echo "Checking that mingw 32-bit gcc is installed/available" echo "Checking that mingw 32-bit gcc is installed/available"
if test -n "`which i686-w64-mingw32-gcc`" ; then if test -n "`which i686-w64-mingw32-gcc`" ; then
@ -109,9 +116,9 @@ if test -f "$tarball"; then
echo "Compiling (quietly)..." echo "Compiling (quietly)..."
make > build.log make > build.log
echo "Simple check to see if swig.exe runs..." echo "Simple check to see if swig.exe runs..."
env LD_LIBRARY_PATH= PATH= ./swig.exe -version || exit 1 env LD_LIBRARY_PATH= PATH= $wine ./swig.exe -version || exit 1
echo "Simple check to see if ccache-swig.exe runs..." echo "Simple check to see if ccache-swig.exe runs..."
env LD_LIBRARY_PATH= PATH= ./CCache/ccache-swig.exe -V || exit 1 env LD_LIBRARY_PATH= PATH= $wine ./CCache/ccache-swig.exe -V || exit 1
echo "Creating $swigwinbasename.zip..." echo "Creating $swigwinbasename.zip..."
cd .. cd ..
cp $swigbasename/swig.exe $swigwinbasename cp $swigbasename/swig.exe $swigwinbasename