From 557df7eed8faf7febc2314e1aba863353e397942 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Sun, 1 Mar 2015 05:34:43 -0600 Subject: refine building windows binaries, enable shared --- dist-win.sh | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/dist-win.sh b/dist-win.sh index e45101a..e5f15b8 100755 --- a/dist-win.sh +++ b/dist-win.sh @@ -1,6 +1,6 @@ #!/bin/bash set -e -set -x +#set -x export PATH=/cygdrive/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio\ 12.0/VC/bin:$PATH VERSION=`cat VERSION` @@ -10,25 +10,27 @@ rm -fr $DIST mkdir -p $DIST for ARCH in X86 X64; do - echo Building for $ARCH - if [ $ARCH=X86 ]; then + if [ $ARCH = X86 ]; then HOST=i686-w64-mingw32 + ARCHDIR=x86 else HOST=x86_64-w64-mingw32 + ARCHDIR=x64 fi - CC=$HOST-gcc ./configure --host=$HOST \ - --enable-libtls --disable-shared + echo Building for $HOST + + CC=$HOST-gcc ./configure --host=$HOST --enable-libtls make clean PATH=$PATH:/usr/$HOST/sys-root/mingw/bin \ make -j 4 check - make -j 4 install DESTDIR=`pwd`/stage-$ARCH + make -j 4 install DESTDIR=`pwd`/stage-$ARCHDIR - mkdir -p $DIST/$ARCH - #cp -a stage-$ARCH/usr/local/lib/* $DIST/$ARCH + mkdir -p $DIST/$ARCHDIR + #cp -a stage-$ARCHDIR/usr/local/lib/* $DIST/$ARCHDIR if [ ! -e $DIST/include ]; then - cp -a stage-$ARCH/usr/local/include $DIST + cp -a stage-$ARCHDIR/usr/local/include $DIST sed -i -e 'N;/\n.*__non/s/"\? *\n/ /;P;D' \ $DIST/include/openssl/*.h $DIST/include/*.h sed -i -e 'N;/\n.*__attr/s/"\? *\n/ /;P;D' \ @@ -38,16 +40,16 @@ for ARCH in X86 X64; do $DIST/include/openssl/*.h $DIST/include/*.h fi - cp stage-$ARCH/usr/local/bin/* $DIST/$ARCH - #cp /usr/$HOST/sys-root/mingw/bin/libssp* $DIST/$ARCH + cp stage-$ARCHDIR/usr/local/bin/* $DIST/$ARCHDIR + #cp /usr/$HOST/sys-root/mingw/bin/libssp* $DIST/$ARCHDIR for i in libcrypto libssl libtls; do - DLL=$(basename `ls -1 $DIST/$ARCH/$i*.dll`|cut -d. -f1) + DLL=$(basename `ls -1 $DIST/$ARCHDIR/$i*.dll`|cut -d. -f1) echo EXPORTS > $DLL.def - dumpbin /exports $DIST/$ARCH/$DLL.dll | \ + dumpbin /exports $DIST/$ARCHDIR/$DLL.dll | \ awk '{print $4}' | awk 'NF' |tail -n +9 >> $DLL.def - lib /MACHINE:$ARCH /def:$DLL.def /out:$DIST/$ARCH/$DLL.lib - cv2pdb $DIST/$ARCH/$DLL.dll + lib /MACHINE:$ARCH /def:$DLL.def /out:$DIST/$ARCHDIR/$DLL.lib + cv2pdb $DIST/$ARCHDIR/$DLL.dll done done -- cgit v1.2.3-55-g6feb