| 1 |
#!/bin/bash |
| 2 |
|
| 3 |
set -e |
| 4 |
|
| 5 |
# just in case... |
| 6 |
unset CC |
| 7 |
unset CXX |
| 8 |
|
| 9 |
#PREFIX=i686-w64-mingw32 |
| 10 |
PREFIX=x86_64-w64-mingw32 |
| 11 |
|
| 12 |
#export PATH="/usr/$PREFIX/bin:$PATH" |
| 13 |
export INSTALLDIR="$PWD/$PREFIX" |
| 14 |
export PKG_CONFIG_PATH=$INSTALLDIR/lib/pkgconfig:/usr/$PREFIX/lib/pkgconfig |
| 15 |
export CPPFLAGS="-I$INSTALLDIR/include" |
| 16 |
export LDFLAGS="-L$INSTALLDIR/lib" |
| 17 |
|
| 18 |
# let mingw compiler be less verbose |
| 19 |
export CFLAGS="-O2 -Wall -Wno-format" |
| 20 |
|
| 21 |
# build libunistring |
| 22 |
if [ ! -d libunistring ]; then |
| 23 |
git clone https://git.savannah.gnu.org/git/libunistring.git |
| 24 |
cd libunistring |
| 25 |
else |
| 26 |
cd libunistring |
| 27 |
git pull |
| 28 |
fi |
| 29 |
./autogen.sh |
| 30 |
./configure --build=x86_64-pc-linux-gnu --host=$PREFIX --enable-shared --prefix=$INSTALLDIR |
| 31 |
make clean |
| 32 |
make -j$(nproc) |
| 33 |
make install |
| 34 |
cd .. |
| 35 |
|
| 36 |
# build libidn2 |
| 37 |
if [ ! -d libidn2 ]; then |
| 38 |
git clone https://gitlab.com/libidn/libidn2.git |
| 39 |
cd libidn2 |
| 40 |
else |
| 41 |
cd libidn2 |
| 42 |
git pull |
| 43 |
fi |
| 44 |
./bootstrap |
| 45 |
./configure --build=x86_64-pc-linux-gnu --host=$PREFIX --enable-shared --disable-doc --disable-gcc-warnings --prefix=$INSTALLDIR |
| 46 |
make clean |
| 47 |
make -j$(nproc) |
| 48 |
make install |
| 49 |
cd .. |
| 50 |
|
| 51 |
# build libpsl |
| 52 |
export WINEPATH="$INSTALLDIR/bin;$INSTALLDIR/lib;/usr/$PREFIX/bin;/usr/$PREFIX/lib;$PWD/libpsl/.libs;$GCCLIB" |
| 53 |
./autogen.sh |
| 54 |
./configure --build=x86_64-pc-linux-gnu --host=$PREFIX --enable-shared --disable-gtk-doc --enable-runtime=libidn2 --prefix=$INSTALLDIR |
| 55 |
make clean |
| 56 |
make -j$(nproc) |
| 57 |
make check -j$(nproc) LOG_COMPILER=wine |