aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrent Cook <bcook@openbsd.org>2015-03-01 05:34:43 -0600
committerBrent Cook <bcook@openbsd.org>2015-03-01 05:34:43 -0600
commit557df7eed8faf7febc2314e1aba863353e397942 (patch)
tree9ef8c3f7c5c5ad7d34b5ff298b76c866ac4df978
parentf94d3d671ca01ef22d0f61f368f901fa96a9c5db (diff)
downloadportable-557df7eed8faf7febc2314e1aba863353e397942.tar.gz
portable-557df7eed8faf7febc2314e1aba863353e397942.tar.bz2
portable-557df7eed8faf7febc2314e1aba863353e397942.zip
refine building windows binaries, enable shared
-rwxr-xr-xdist-win.sh32
1 files 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 @@
1#!/bin/bash 1#!/bin/bash
2set -e 2set -e
3set -x 3#set -x
4 4
5export PATH=/cygdrive/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio\ 12.0/VC/bin:$PATH 5export PATH=/cygdrive/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio\ 12.0/VC/bin:$PATH
6VERSION=`cat VERSION` 6VERSION=`cat VERSION`
@@ -10,25 +10,27 @@ rm -fr $DIST
10mkdir -p $DIST 10mkdir -p $DIST
11 11
12for ARCH in X86 X64; do 12for ARCH in X86 X64; do
13 echo Building for $ARCH
14 13
15 if [ $ARCH=X86 ]; then 14 if [ $ARCH = X86 ]; then
16 HOST=i686-w64-mingw32 15 HOST=i686-w64-mingw32
16 ARCHDIR=x86
17 else 17 else
18 HOST=x86_64-w64-mingw32 18 HOST=x86_64-w64-mingw32
19 ARCHDIR=x64
19 fi 20 fi
20 21
21 CC=$HOST-gcc ./configure --host=$HOST \ 22 echo Building for $HOST
22 --enable-libtls --disable-shared 23
24 CC=$HOST-gcc ./configure --host=$HOST --enable-libtls
23 make clean 25 make clean
24 PATH=$PATH:/usr/$HOST/sys-root/mingw/bin \ 26 PATH=$PATH:/usr/$HOST/sys-root/mingw/bin \
25 make -j 4 check 27 make -j 4 check
26 make -j 4 install DESTDIR=`pwd`/stage-$ARCH 28 make -j 4 install DESTDIR=`pwd`/stage-$ARCHDIR
27 29
28 mkdir -p $DIST/$ARCH 30 mkdir -p $DIST/$ARCHDIR
29 #cp -a stage-$ARCH/usr/local/lib/* $DIST/$ARCH 31 #cp -a stage-$ARCHDIR/usr/local/lib/* $DIST/$ARCHDIR
30 if [ ! -e $DIST/include ]; then 32 if [ ! -e $DIST/include ]; then
31 cp -a stage-$ARCH/usr/local/include $DIST 33 cp -a stage-$ARCHDIR/usr/local/include $DIST
32 sed -i -e 'N;/\n.*__non/s/"\? *\n/ /;P;D' \ 34 sed -i -e 'N;/\n.*__non/s/"\? *\n/ /;P;D' \
33 $DIST/include/openssl/*.h $DIST/include/*.h 35 $DIST/include/openssl/*.h $DIST/include/*.h
34 sed -i -e 'N;/\n.*__attr/s/"\? *\n/ /;P;D' \ 36 sed -i -e 'N;/\n.*__attr/s/"\? *\n/ /;P;D' \
@@ -38,16 +40,16 @@ for ARCH in X86 X64; do
38 $DIST/include/openssl/*.h $DIST/include/*.h 40 $DIST/include/openssl/*.h $DIST/include/*.h
39 fi 41 fi
40 42
41 cp stage-$ARCH/usr/local/bin/* $DIST/$ARCH 43 cp stage-$ARCHDIR/usr/local/bin/* $DIST/$ARCHDIR
42 #cp /usr/$HOST/sys-root/mingw/bin/libssp* $DIST/$ARCH 44 #cp /usr/$HOST/sys-root/mingw/bin/libssp* $DIST/$ARCHDIR
43 45
44 for i in libcrypto libssl libtls; do 46 for i in libcrypto libssl libtls; do
45 DLL=$(basename `ls -1 $DIST/$ARCH/$i*.dll`|cut -d. -f1) 47 DLL=$(basename `ls -1 $DIST/$ARCHDIR/$i*.dll`|cut -d. -f1)
46 echo EXPORTS > $DLL.def 48 echo EXPORTS > $DLL.def
47 dumpbin /exports $DIST/$ARCH/$DLL.dll | \ 49 dumpbin /exports $DIST/$ARCHDIR/$DLL.dll | \
48 awk '{print $4}' | awk 'NF' |tail -n +9 >> $DLL.def 50 awk '{print $4}' | awk 'NF' |tail -n +9 >> $DLL.def
49 lib /MACHINE:$ARCH /def:$DLL.def /out:$DIST/$ARCH/$DLL.lib 51 lib /MACHINE:$ARCH /def:$DLL.def /out:$DIST/$ARCHDIR/$DLL.lib
50 cv2pdb $DIST/$ARCH/$DLL.dll 52 cv2pdb $DIST/$ARCHDIR/$DLL.dll
51 done 53 done
52done 54done
53 55