summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOthmar Gsenger <otti@anytun.org>2012-01-05 21:39:07 +0000
committerOthmar Gsenger <otti@anytun.org>2012-01-05 21:39:07 +0000
commit60229d939672f554621fdf97ab2ed534fa9f7de7 (patch)
treecf94ff89af9547deb455b2a0e8871780ce6b4a40
parentfixed mingw build target (diff)
added helper scripts for mingw environment
-rw-r--r--contrib/boost_project-config.patch15
-rwxr-xr-xcontrib/build-boost-mingw-cross.sh21
-rwxr-xr-xcontrib/build-openssl-mingw-cross.sh19
-rw-r--r--contrib/openssl-1.0.0f-configure.patch46
4 files changed, 101 insertions, 0 deletions
diff --git a/contrib/boost_project-config.patch b/contrib/boost_project-config.patch
new file mode 100644
index 0000000..5dd39c3
--- /dev/null
+++ b/contrib/boost_project-config.patch
@@ -0,0 +1,15 @@
+--- boost_1_48_0/project-config.jam 2012-01-05 22:25:47.000000000 +0100
++++ project-config.jam 2012-01-05 22:14:39.000000000 +0100
+@@ -7,10 +7,8 @@
+ # Compiler configuration. This definition will be used unless
+ # you already have defined some toolsets in your user-config.jam
+ # file.
+-if ! gcc in [ feature.values <toolset> ]
+-{
+- using gcc ;
+-}
++using gcc : w32 : i686-w64-mingw32-g++ ;
++using gcc : w64 : x86_64-w64-mingw32-g++ ;
+
+ project : default-build <toolset>gcc ;
+
diff --git a/contrib/build-boost-mingw-cross.sh b/contrib/build-boost-mingw-cross.sh
new file mode 100755
index 0000000..bdad77d
--- /dev/null
+++ b/contrib/build-boost-mingw-cross.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+set -e
+BOOST=1.48.0
+
+BOOST_DASH=`echo $BOOST | perl -ne 's/\./_/g; print'`
+echo $BOOST_DASH
+wget http://downloads.sourceforge.net/project/boost/boost/$BOOST/boost_${BOOST_DASH}.tar.bz2 -O - | tar xj
+
+cd boost_${BOOST_DASH}
+./bootstrap.sh
+
+patch -p1 < ../boost_project-config.patch
+
+for target in w32 w64; do
+ ./b2 --layout=system variant=release threading=multi link=shared runtime-link=shared toolset=gcc-$target target-os=windows threadapi=win32 stage
+ mkdir -p ../boost-$target/include
+ mv stage/lib ../boost-$target/
+ cp -r boost ../boost-$target/include
+ ./b2 --layout=system variant=release threading=multi link=shared runtime-link=shared toolset=gcc-$target target-os=windows threadapi=win32 stage --clean
+done
+rm -rf boost_${BOOST_DASH}
diff --git a/contrib/build-openssl-mingw-cross.sh b/contrib/build-openssl-mingw-cross.sh
new file mode 100755
index 0000000..39f73eb
--- /dev/null
+++ b/contrib/build-openssl-mingw-cross.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+set -e
+OPENSSL=openssl-1.0.0f
+BASE=`pwd`
+
+wget http://openssl.org/source/$OPENSSL.tar.gz -O - | tar xz
+
+cd $OPENSSL
+patch -p1 < ../openssl-1.0.0f-configure.patch
+./config --cross-compile-prefix=x86_64-w64-mingw32- shared mingw64 --prefix=$BASE/openssl-w64/
+make
+make install
+make clean
+./config --cross-compile-prefix=i686-w64-mingw32- shared mingw --prefix=$BASE/openssl-w32/
+make
+make install
+make clean
+cd ..
+rm -rf $OPENSSL
diff --git a/contrib/openssl-1.0.0f-configure.patch b/contrib/openssl-1.0.0f-configure.patch
new file mode 100644
index 0000000..125f436
--- /dev/null
+++ b/contrib/openssl-1.0.0f-configure.patch
@@ -0,0 +1,46 @@
+diff -u openssl-1.0.0f.orig/config openssl-1.0.0f//config
+--- openssl-1.0.0f.orig/config 2011-07-15 21:59:18.000000000 +0200
++++ openssl-1.0.0f//config 2012-01-05 01:32:27.619235053 +0100
+@@ -825,9 +825,9 @@
+ # options="$options -DATALLA"
+ #fi
+
+-($CC -Wa,--help -c -o /dev/null -x assembler /dev/null 2>&1 | \
+- grep \\--noexecstack) 2>&1 > /dev/null && \
+- options="$options -Wa,--noexecstack"
++#($CC -Wa,--help -c -o /dev/null -x assembler /dev/null 2>&1 | \
++# grep \\--noexecstack) 2>&1 > /dev/null && \
++# options="$options -Wa,--noexecstack"
+
+ # gcc < 2.8 does not support -march=ultrasparc
+ if [ "$OUT" = solaris-sparcv9-gcc -a $GCCVER -lt 28 ]
+diff -u openssl-1.0.0f.orig/Configure openssl-1.0.0f//Configure
+--- openssl-1.0.0f.orig/Configure 2011-12-19 18:04:38.000000000 +0100
++++ openssl-1.0.0f//Configure 2012-01-05 01:21:18.723239740 +0100
+@@ -505,7 +505,7 @@
+ "BC-32","bcc32::::WIN32::BN_LLONG DES_PTR RC4_INDEX EXPORT_VAR_AS_FN:${no_asm}:win32",
+
+ # MinGW
+-"mingw", "gcc:-mno-cygwin -DL_ENDIAN -DWIN32_LEAN_AND_MEAN -fomit-frame-pointer -O3 -march=i486 -Wall::-D_MT:MINGW32:-lws2_32 -lgdi32 -lcrypt32:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts} EXPORT_VAR_AS_FN:${x86_asm}:coff:win32:cygwin-shared:-D_WINDLL -DOPENSSL_USE_APPLINK:-mno-cygwin:.dll.a",
++"mingw", "gcc:-mno-cygwin -DL_ENDIAN -DWIN32_LEAN_AND_MEAN -fomit-frame-pointer -O3 -march=i486 -Wall::-D_MT:MINGW32:-lws2_32 -lgdi32 -lcrypt32:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts} EXPORT_VAR_AS_FN:${x86_asm}:coff:win32:cygwin-shared:-D_WINDLL -DOPENSSL_USE_APPLINK:-mno-cygwin -Wl,--export-all -shared:.dll.a",
+ # As for OPENSSL_USE_APPLINK. Applink makes it possible to use .dll
+ # compiled with one compiler with application compiled with another
+ # compiler. It's possible to engage Applink support in mingw64 build,
+@@ -513,7 +513,7 @@
+ # handling, one can't seriously consider its binaries for using with
+ # non-mingw64 run-time environment. And as mingw64 is always consistent
+ # with itself, Applink is never engaged and can as well be omitted.
+-"mingw64", "gcc:-mno-cygwin -DL_ENDIAN -O3 -Wall -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE::-D_MT:MINGW64:-lws2_32 -lgdi32 -lcrypt32:SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:${x86_64_asm}:mingw64:win32:cygwin-shared:-D_WINDLL:-mno-cygwin:.dll.a",
++"mingw64", "gcc:-mno-cygwin -DL_ENDIAN -O3 -Wall -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE::-D_MT:MINGW64:-lws2_32 -lgdi32 -lcrypt32:SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:${x86_64_asm}:mingw64:win32:cygwin-shared:-D_WINDLL:-mno-cygwin -Wl,--export-all -shared:.dll.a",
+
+ # UWIN
+ "UWIN", "cc:-DTERMIOS -DL_ENDIAN -O -Wall:::UWIN::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:win32",
+@@ -869,7 +869,7 @@
+ }
+ else
+ {
+- die "target already defined - $target (offending arg: $_)\n" if ($target ne "");
++ #die "target already defined - $target (offending arg: $_)\n" if ($target ne "");
+ $target=$_;
+ }
+