feature: added 64-bit windows building/packaging support using the MSYS2/MinGW toolchain.

This commit is contained in:
Yichun Zhang (agentzh)
2018-04-21 19:00:45 -07:00
parent f0e621b0c4
commit 51c4a3848d
3 changed files with 74 additions and 31 deletions

View File

@ -2,11 +2,12 @@
PCRE=pcre-8.42
ZLIB=zlib-1.2.11
OPENSSL=openssl-1.0.2n
OPENSSL=openssl-1.1.0h
JOBS=9
# wget https://www.openssl.org/source/openssl-1.0.2k.tar.gz
# wget https://www.openssl.org/source/openssl-1.1.0h.tar.gz
# wget http://zlib.net/zlib-1.2.11.tar.gz
# wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.40.tar.gz
# wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.42.tar.gz
rm -rf objs || exit 1
mkdir -p objs/lib || exit 1
@ -18,7 +19,8 @@ tar -xf ../../../$PCRE.tar.gz || exit 1
cd ../..
cd objs/lib/$OPENSSL || exit 1
patch -p1 < ../../../patches/openssl-1.0.2h-sess_set_get_cb_yield.patch || exit 1
patch -p1 < ../../../patches/openssl-1.1.0d-sess_set_get_cb_yield.patch \
|| exit 1
cd ../../..
#--with-openssl-opt="no-asm" \
@ -57,7 +59,7 @@ cd ../../..
--with-pcre=objs/lib/$PCRE \
--with-zlib=objs/lib/$ZLIB \
--with-openssl=objs/lib/$OPENSSL \
-j5 || exit 1
#gmake -j5
make || exit 1
make install
-j$JOBS || exit 1
make -j$JOBS || exit 1
exec make install

View File

@ -1,7 +1,23 @@
#!/bin/bash
mingw32=/c/msys64/mingw32
info=`uname -a`
if [[ "$info" == MINGW64* ]]; then
arch="win64";
else
if [[ "$info" == MINGW32* ]]; then
arch="win32";
else
echo "Unknown architecture: $info" > /dev/stderr
exit 1
fi
fi
echo $arch
name=`pwd|perl -e '$d=<>;$d=~s{.*?/}{}g;$d=~s/$//g;print $d'`
name="$name-win32"
name="$name-$arch"
echo $name
if [ -d $name ]; then
rm -rf $name
@ -9,12 +25,15 @@ fi
mkdir $name || exit 1
cp -r resty restydoc restydoc-index nginx.exe luajit.exe lua51.dll lua include lualib html conf logs pod $name/ || exit 1
cp COPYRIGHT $name/ || exit 1
cp /c/MinGW/bin/libgcc_s_dw2-1.dll $name/ || exit 1
if [[ "$arch" == "win32" ]]; then
cp $mingw32/bin/libgcc_s_dw2-1.dll $name/ || exit 1
cp $mingw32/bin/libwinpthread-1.dll $name/ || exit 1
fi
cd $name || exit 1
PATH=/c/Strawberry/perl/bin:$PATH cmd /c 'pl2bat.bat resty' || exit 1
PATH=/c/Strawberry/perl/bin:$PATH cmd /c 'pl2bat.bat restydoc' || exit 1
PATH=/c/Strawberry/perl/bin:$PATH cmd /c 'pl2bat.bat restydoc-index' || exit 1
cp ../README-win32.txt README.txt
cp ../README-windows.txt README.txt
unix2dos conf/* html/*.html resty || exit 1
cd .. || exit 1
zip -r $name.zip $name || exit 1