summaryrefslogtreecommitdiff
path: root/binary
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-02-15 09:11:53 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-02-15 09:11:53 +0200
commitbb5c65c64ff5ad3d136b351da2d629a9cd8a2ba5 (patch)
tree2036331bd329f4915df9374e4a71a7ef30973486 /binary
parent663a6689ba14a422cbc714d113b28dad731c44bf (diff)
Add MinGW-W64 ODB binary build scripts
Diffstat (limited to 'binary')
-rw-r--r--binary/mingw-w64/NOTES166
-rwxr-xr-xbinary/mingw-w64/binutils-configure11
-rwxr-xr-xbinary/mingw-w64/binutils-cross-configure10
-rwxr-xr-xbinary/mingw-w64/build-dist306
-rwxr-xr-xbinary/mingw-w64/gcc-configure33
-rwxr-xr-xbinary/mingw-w64/gcc-cross-configure27
-rwxr-xr-xbinary/mingw-w64/gcc-prereq-configure11
-rwxr-xr-xbinary/mingw-w64/libcutl-configure9
-rwxr-xr-xbinary/mingw-w64/libodb-boost-configure14
-rwxr-xr-xbinary/mingw-w64/libodb-configure9
-rwxr-xr-xbinary/mingw-w64/libodb-qt-configure14
-rw-r--r--binary/mingw-w64/manifest.txt15
-rwxr-xr-xbinary/mingw-w64/odb-configure14
-rwxr-xr-xbinary/mingw-w64/pthread-cross-configure9
-rwxr-xr-xbinary/mingw-w64/rt-configure10
-rwxr-xr-xbinary/mingw-w64/rt-cross-configure9
-rwxr-xr-xbinary/mingw-w64/rt-headers-cross-configure8
17 files changed, 675 insertions, 0 deletions
diff --git a/binary/mingw-w64/NOTES b/binary/mingw-w64/NOTES
new file mode 100644
index 0000000..ae3d0fb
--- /dev/null
+++ b/binary/mingw-w64/NOTES
@@ -0,0 +1,166 @@
+An overview of steps required to switch to a new GCC version. This is
+a complete toolchain bring up.
+
+1. Get the MinGW-W64 GCC build of this version and get configuration
+ flags (gcc -v). The idea is to build both the cross-compiler
+ and the native compiler (with linked-in ODB plugin) as close
+ to the MinGW-W64 configuration as possible.
+
+2. Build cross-binutils:
+
+ 1. Move old cross/mingw to cross/mingw-X.Y.Z.
+ 2. Unpack binutils, rename to binutils, create or clean binutils-cross-build.
+ 3. Build and install:
+
+ cd binutils-cross-build
+ ../binutils-cross-configure
+ make -j 16
+ make install
+
+3 Install runtime headers:
+
+ 1. Unpack mingw-w64 and rename to mingw-w64, create or clean
+ mingw-w64-headers-build.
+ 2. Configure & install:
+
+ cd mingw-w64-headers-build
+ ../rt-headers-cross-configure
+ make install
+
+4. Build cross-GCC, phase 1:
+
+ 1. Unpack GCC, rename to gcc-cross, create or clean gcc-cross-build.
+ 2. Adapt older gcc-X.Y.Z-mingw-cross.patch (--dry-run) and apply.
+ 3. Adapt gcc-cross-configure based on MinGW-W64 config and old config.
+ 4. Build & install GCC only:
+
+ cd gcc-cross-build
+ ../gcc-cross-configure
+ make -j 16 all-gcc
+ make install-gcc
+
+5. Build runtime:
+
+ 1. Create or clean mingw-w64-build.
+ 2. Build & install:
+
+ export PATH=`pwd`/cross/mingw/bin:$PATH
+ cd mingw-w64-build
+ ../rt-cross-configure
+ make -j 16
+ make install
+
+6. Build pthreads:
+
+ 1. Get winpthreads, create or clean winpthreads-build
+
+ svn checkout http://mingw-w64.svn.sourceforge.net/svnroot/mingw-w64/experimental/winpthreads
+
+ 2. Build and install:
+
+ export PATH=`pwd`/cross/mingw/bin:$PATH
+ cd winpthreads-build
+ ../pthreads-cross-configure
+ make -j 16
+ make install
+
+7. Build cross-GCC, phase 2:
+
+ 1. Build & install:
+
+ cd gcc-cross-build
+ make -j 16
+ make install
+
+ 2. Disable .dll & .la files in i686-w64-mingw32/lib.
+
+ 3. Check that the compiler works. Compile and run sizeof_funds.cxx and
+ throw.cxx.
+
+8. Package runtime:
+
+ 1. Save mingw-rt as mingw-rt-X.Y.Z
+
+ 2. Package:
+
+ cd mingw-w64-headers-build
+ make DESTDIR=/home/boris/work/odb/build/mingw-w64/mingw-rt install
+
+ cd mingw-w64-build
+ make DESTDIR=/home/boris/work/odb/build/mingw-w64/mingw-rt install
+
+ cd winpthreads-build
+ make DESTDIR=/home/boris/work/odb/build/mingw-w64/mingw-rt install
+
+ Move to the top level directory.
+
+9. Build binutils:
+
+ 1. Create or clean binutils-build, /mingw.
+ 2. Build and install:
+
+ export PATH=`pwd`/cross/mingw/bin:$PATH
+ cd binutils-build
+ ../configure-binutils
+ make -j 16
+ make install
+
+ 3. Copy /mingw/* to mingw-binutils.
+
+10. Build GCC prerequisites (gmp, mpfr, mpc):
+
+ 1. Unpack {gmp, mpfr, mpc}
+ 2. Build and install:
+
+ cd {gmp, mpfr, mpc}
+ ../gcc-prereq-configure
+ make -j 16
+ make install
+
+11. Build the native compiler:
+
+ 1. Unpack GCC, rename to gcc, create or clean gcc-build.
+ 2. Adapt older gcc-X.Y.Z-mingw.patch (--dry-run) and apply.
+ 3. Adapt older gcc-X.Y.Z-static-plugin.patch (--dry-run) and apply.
+ This step will probably require careful review of changes in the
+ plugin code (plugin.h and plugin.c).
+ 4. Regenerate configure script in gcc/gcc/. Use the same autoconf
+ version as in the original (see ~/build/autocond-X.Y). For example:
+
+ sudo make -C ~/build/autoconf-2.64 install
+ autoconf --version
+ cd gcc
+ autoconf
+ sudo make -C ~/build/autoconf-2.64 uninstall
+
+ 4. Adapt gcc-configure.
+ 5. Configure and make GCC manually:
+
+ export PATH=`pwd`/cross/mingw/bin:$PATH
+ cd gcc-build
+ ../gcc-configure
+ make -j 16
+
+ This step will fail due to lack of libplugin-stub.a. That's
+ ok. Copy .h and .def files from gcc-build/gcc/ to gcc-headers/
+ (backup old ones).
+
+4. Run the build-dist script with -rebuild
+
+ 1. If GCC build fails, then it can be re-configured or re-made
+ directly from the gcc-build directory provided you don't
+ clean it up (if you do so, you can manually copy libplugin-stub.a
+ to gcc-build/gcc/).
+
+ 2. Check the package for any stray directories/files. Compare size to
+ the old version.
+
+ 3. On Windows, check that:
+
+ - Compiler, including exceptions, work. Compile and run sizeof_funds.cxx
+ and throw.cxx.
+
+ - Make sure ODB runs, including throwing exceptions (run on object
+ with private data members).
+
+5. Copy updates/patches to odb/etc/.
diff --git a/binary/mingw-w64/binutils-configure b/binary/mingw-w64/binutils-configure
new file mode 100755
index 0000000..e5194c0
--- /dev/null
+++ b/binary/mingw-w64/binutils-configure
@@ -0,0 +1,11 @@
+#! /bin/sh
+
+../binutils/configure \
+--host i686-w64-mingw32 \
+--target i686-w64-mingw32 \
+--prefix=/mingw \
+--with-sysroot=/mingw \
+--disable-nls \
+--disable-shared \
+--disable-debug \
+CFLAGS=-O2
diff --git a/binary/mingw-w64/binutils-cross-configure b/binary/mingw-w64/binutils-cross-configure
new file mode 100755
index 0000000..142f110
--- /dev/null
+++ b/binary/mingw-w64/binutils-cross-configure
@@ -0,0 +1,10 @@
+#! /bin/sh
+
+../binutils/configure \
+--target i686-w64-mingw32 \
+--prefix=/home/boris/work/odb/build/mingw-w64/cross/mingw \
+--with-sysroot=/home/boris/work/odb/build/mingw-w64/cross/mingw \
+--disable-nls \
+--disable-shared \
+--disable-debug \
+CFLAGS=-O2
diff --git a/binary/mingw-w64/build-dist b/binary/mingw-w64/build-dist
new file mode 100755
index 0000000..b7b2047
--- /dev/null
+++ b/binary/mingw-w64/build-dist
@@ -0,0 +1,306 @@
+#! /usr/bin/env bash
+
+# Create ODB compiler Windows distribution.
+#
+# -rebuild
+# -pack get the source distributions from /tmp/pack/
+#
+trap 'exit 1' ERR
+
+function error ()
+{
+ echo "$*" 1>&2
+}
+
+# Find output directory for a project. It is either $1-default or if
+# that doesn't exist, it is $1.
+#
+function find_out_dir ()
+{
+ # Get the actual directory in case -default is a symlink.
+ #
+ tmp=`realpath $1-default 2>/dev/null`
+
+ if [ -n "$tmp" -a -d "$tmp" ]; then
+ echo "$tmp"
+ else
+ echo "$1"
+ fi
+}
+
+rebuild=n
+pack=n
+
+while [ $# -gt 0 ]; do
+ case $1 in
+ -rebuild)
+ rebuild=y
+ shift
+ ;;
+ -pack)
+ pack=y
+ rebuild=y
+ shift
+ ;;
+ *)
+ error "unknown option: $1"
+ exit 1
+ ;;
+ esac
+done
+
+
+if [ $pack = n ]; then
+ src_root=$HOME/work
+
+ over=`cat $HOME/work/odb/odb/version`
+else
+ src_root=/tmp
+
+ cver=`echo $src_root/libcutl-?.*.tar.gz | sed -e "s%$src_root/libcutl-\(.*\).tar.gz%\1%"`
+ over=`echo $src_root/pack/odb-?.*.tar.gz | sed -e "s%$src_root/pack/odb-\(.*\).tar.gz%\1%"`
+ mver=`echo $over | sed -e 's%\([0-9]*\.[0-9]*\).*%\1%'`
+fi
+
+out_root=`pwd`
+install_root="/tmp/odb-$over-i686-windows"
+
+export PATH=$out_root/cross/mingw/bin:$PATH
+
+# Clean everything up if we are rebuilding.
+#
+if [ $rebuild = y ]; then
+ rm -rf /mingw/*
+ rm -rf libplugin-stub
+ rm -rf gcc-build/*
+ rm -rf libcutl
+ rm -rf libodb
+ rm -rf libodb-boost
+ rm -rf libodb-qt
+ rm -rf odb
+ rm -rf odb-build/*
+ rm -rf $install_root
+
+ cp -r mingw-rt/* /mingw/
+ cp -r mingw-binutils/* /mingw/
+fi
+
+if [ $pack = n ]; then
+ rm -f /tmp/odb-$over-i686-windows.zip
+else
+ rm -f /tmp/pack/odb-$over-i686-windows.zip
+fi
+
+# Build libplugin-stub
+#
+if [ $rebuild = y ]; then
+ mkdir -p libplugin-stub
+ cd libplugin-stub
+ i686-w64-mingw32-gcc -O2 -c ../plugin-stub.c
+ i686-w64-mingw32-ar cr libplugin-stub.a plugin-stub.o
+ i686-w64-mingw32-ranlib libplugin-stub.a
+ cd ..
+
+ mkdir -p gcc-build/gcc
+ cp libplugin-stub/libplugin-stub.a gcc-build/gcc/
+fi
+
+# Build libodb
+#
+if [ $pack = n ]; then
+ make -C `find_out_dir $src_root/odb/libodb` -f $src_root/odb/libodb/makefile \
+ dist dist_prefix=$out_root/libodb
+
+ if [ $rebuild = y ]; then
+ cd libodb
+ ./bootstrap
+ cd ..
+ fi
+else
+ libodb=`echo $src_root/pack/libodb-$mver.*.tar.gz | sed -e "s%$src_root/pack/\(.*\)\.tar\.gz%\1%"`
+ tar xfz $src_root/pack/$libodb.tar.gz
+ mv $libodb libodb
+fi
+
+cd libodb
+
+if [ $rebuild = y ]; then
+ ../libodb-configure
+fi
+
+make
+cd odb
+make install-data
+cd ../..
+
+# Build libodb-boost
+#
+if [ $pack = n ]; then
+ make -C `find_out_dir $src_root/odb/libodb-boost` -f $src_root/odb/libodb-boost/makefile \
+ dist dist_prefix=$out_root/libodb-boost
+
+ if [ $rebuild = y ]; then
+ cd libodb-boost
+ ./bootstrap
+ cd ..
+ fi
+else
+ libodb_boost=`echo $src_root/pack/libodb-boost-$mver.*.tar.gz | sed -e "s%$src_root/pack/\(.*\)\.tar\.gz%\1%"`
+ tar xfz $src_root/pack/$libodb_boost.tar.gz
+ mv $libodb_boost libodb-boost
+fi
+
+cd libodb-boost
+
+if [ $rebuild = y ]; then
+ ../libodb-boost-configure
+fi
+
+make
+make install-data
+cd ..
+
+# Build libodb-qt
+#
+if [ $pack = n ]; then
+ make -C `find_out_dir $src_root/odb/libodb-qt` -f $src_root/odb/libodb-qt/makefile \
+ dist dist_prefix=$out_root/libodb-qt
+
+ if [ $rebuild = y ]; then
+ cd libodb-qt
+ ./bootstrap
+ cd ..
+ fi
+else
+ libodb_qt=`echo $src_root/pack/libodb-qt-$mver.*.tar.gz | sed -e "s%$src_root/pack/\(.*\)\.tar\.gz%\1%"`
+ tar xfz $src_root/pack/$libodb_qt.tar.gz
+ mv $libodb_qt libodb-qt
+fi
+
+cd libodb-qt
+
+if [ $rebuild = y ]; then
+ ../libodb-qt-configure
+fi
+
+make
+make install-data
+cd ..
+
+# Build libcutl
+#
+if [ $pack = n ]; then
+ make -C $src_root/cutl/libcutl dist dist_prefix=$out_root/libcutl
+
+ if [ $rebuild = y ]; then
+ cd libcutl
+ ./bootstrap
+ cd ..
+ fi
+else
+ tar xfz $src_root/libcutl-$cver.tar.gz
+ mv libcutl-$cver libcutl
+fi
+
+cd libcutl
+
+if [ $rebuild = y ]; then
+ ../libcutl-configure
+fi
+
+make -j 10
+cd ..
+
+# Build odb
+#
+if [ $pack = n ]; then
+ make -C $src_root/odb/odb dist dist_prefix=$out_root/odb
+
+ if [ $rebuild = y ]; then
+ cd odb
+ ./bootstrap
+ cd ..
+ fi
+else
+ tar xfz $src_root/pack/odb-$over.tar.gz
+ mv odb-$over odb
+fi
+
+mkdir -p odb-build
+cd odb-build
+
+if [ $rebuild = y ]; then
+ ../odb-configure $over
+fi
+
+make -j 10
+make install-strip
+rm -r $install_root/libexec # odb/odb.a
+cd ..
+
+# Build gcc
+#
+mkdir -p gcc-build
+cd gcc-build
+
+if [ $rebuild = y ]; then
+ ../gcc-configure
+else
+ rm -f gcc/cc1plus.exe gcc/cc1plus-dummy.exe
+fi
+
+make STATIC_PLUGIN_LIBS="-Wl,--whole-archive $out_root/odb-build/odb/.libs/odb.a -Wl,--no-whole-archive $out_root/libcutl/cutl/.libs/libcutl.a -lstdc++ -static-libgcc" -j 10
+make install
+make -C i686-w64-mingw32/libstdc++-v3 install-strip
+cd ..
+
+# Copy /mingw over to installation
+#
+cp -r /mingw $install_root/
+
+# Move some DLLs to mingw/bin/.
+mv $install_root/mingw/lib/libgcc_s_sjlj-1.dll $install_root/mingw/bin/
+mv $install_root/mingw/i686-w64-mingw32/bin/libwinpthread-1.dll $install_root/mingw/bin/
+
+# Move doc and man out of share/
+#
+rm -rf $install_root/doc $install_root/man
+mv $install_root/share/man $install_root/
+mv $install_root/share/doc/odb $install_root/doc
+rm -r $install_root/share
+
+# Clean some things up.
+#
+rm -f $install_root/mingw/lib/libbfd.*
+rm -f $install_root/mingw/include/bfd*.h
+rm -f $install_root/mingw/lib/libopcodes.*
+rm -f $install_root/mingw/lib/libiberty.a
+rm -f `find $install_root -name '*.la'`
+
+# Copy msys over to installation.
+#
+cp -r msys/* $install_root/mingw/
+
+# Copy the default options file.
+#
+mkdir -p $install_root/etc/odb
+cp -L default.options $install_root/etc/odb/
+todos $install_root/etc/odb/default.options
+
+# Copy manifest.
+#
+cp -L manifest.txt $install_root/mingw/
+todos $install_root/mingw/manifest.txt
+
+# Copy README.
+#
+cp -L README $install_root/README
+todos $install_root/README
+
+# Zip it up.
+#
+cd /tmp
+mkdir -p pack
+rm -f pack/odb-$over-i686-windows.zip
+zip -r pack/odb-$over-i686-windows.zip odb-$over-i686-windows
+cd $out_root
diff --git a/binary/mingw-w64/gcc-configure b/binary/mingw-w64/gcc-configure
new file mode 100755
index 0000000..ca00dd5
--- /dev/null
+++ b/binary/mingw-w64/gcc-configure
@@ -0,0 +1,33 @@
+#! /bin/sh
+
+# Try to configure a build similar to MinGW-W64's.
+#
+# NOTE: update gcc-headers/ if changing the configuration.
+#
+../gcc/configure \
+--host i686-w64-mingw32 \
+--target i686-w64-mingw32 \
+--prefix=/mingw \
+--with-sysroot=/mingw \
+--enable-languages=c,c++ \
+--enable-shared \
+--enable-threads=posix \
+--disable-libssp \
+--disable-libgomp \
+--disable-graphite \
+--disable-multilib \
+--enable-libstdcxx-time \
+--enable-fully-dynamic-string \
+--disable-dw2-exceptions \
+--enable-sjlj-exceptions \
+--disable-libstdcxx-pch \
+--disable-libstdcxx-debug \
+--disable-rpath \
+--disable-win32-registry \
+--disable-nls \
+--disable-werror \
+--with-pkgversion="ODB special" \
+--with-bugurl="http://www.codesynthesis.com/products/odb/" \
+--enable-static-plugin \
+--with-stage1-libs=libplugin-stub.a \
+CFLAGS=-O2 CXXFLAGS=-O2 LDFLAGS=-s
diff --git a/binary/mingw-w64/gcc-cross-configure b/binary/mingw-w64/gcc-cross-configure
new file mode 100755
index 0000000..39d1d54
--- /dev/null
+++ b/binary/mingw-w64/gcc-cross-configure
@@ -0,0 +1,27 @@
+#! /bin/sh
+
+# Try to configure a build similar to MinGW-W64's.
+#
+../gcc-cross/configure \
+--target i686-w64-mingw32 \
+--prefix=/home/boris/work/odb/build/mingw-w64/cross/mingw \
+--with-sysroot=/home/boris/work/odb/build/mingw-w64/cross/mingw \
+--enable-languages=c,c++ \
+--enable-shared \
+--enable-threads=posix \
+--disable-debug \
+--disable-libssp \
+--disable-libgomp \
+--disable-graphite \
+--disable-multilib \
+--enable-libstdcxx-time \
+--enable-fully-dynamic-string \
+--disable-dw2-exceptions \
+--enable-sjlj-exceptions \
+--disable-libstdcxx-pch \
+--disable-libstdcxx-debug \
+--disable-rpath \
+--disable-win32-registry \
+--disable-nls \
+--disable-werror \
+CFLAGS=-O2 CXXFLAGS=-O2
diff --git a/binary/mingw-w64/gcc-prereq-configure b/binary/mingw-w64/gcc-prereq-configure
new file mode 100755
index 0000000..f71322c
--- /dev/null
+++ b/binary/mingw-w64/gcc-prereq-configure
@@ -0,0 +1,11 @@
+#! /bin/sh
+
+# Configure gmp/mpfr/mpc (in the current dir).
+#
+./configure \
+--disable-shared \
+--enable-static \
+--host i686-w64-mingw32 \
+--target i686-w64-mingw32 \
+--prefix=/home/boris/work/odb/build/mingw-w64/cross/mingw/i686-w64-mingw32 \
+CFLAGS=-O2 CXXFLAGS=-O2
diff --git a/binary/mingw-w64/libcutl-configure b/binary/mingw-w64/libcutl-configure
new file mode 100755
index 0000000..23a3bd6
--- /dev/null
+++ b/binary/mingw-w64/libcutl-configure
@@ -0,0 +1,9 @@
+#! /bin/sh
+
+./configure \
+--disable-shared \
+--enable-static \
+--host i686-w64-mingw32 \
+--target i686-w64-mingw32 \
+--prefix=/mingw \
+CXXFLAGS="-O2 -W -Wall"
diff --git a/binary/mingw-w64/libodb-boost-configure b/binary/mingw-w64/libodb-boost-configure
new file mode 100755
index 0000000..9516f1a
--- /dev/null
+++ b/binary/mingw-w64/libodb-boost-configure
@@ -0,0 +1,14 @@
+#! /bin/sh
+
+wd=`pwd`
+
+./configure \
+--disable-shared \
+--enable-static \
+--host i686-w64-mingw32 \
+--target i686-w64-mingw32 \
+--prefix=/mingw \
+--with-libodb=../libodb \
+CXXFLAGS="-O2 -W -Wall" \
+CPPFLAGS="-I$wd/../cross/boost" \
+LDFLAGS="-L$wd/../cross/boost/stage/lib"
diff --git a/binary/mingw-w64/libodb-configure b/binary/mingw-w64/libodb-configure
new file mode 100755
index 0000000..23a3bd6
--- /dev/null
+++ b/binary/mingw-w64/libodb-configure
@@ -0,0 +1,9 @@
+#! /bin/sh
+
+./configure \
+--disable-shared \
+--enable-static \
+--host i686-w64-mingw32 \
+--target i686-w64-mingw32 \
+--prefix=/mingw \
+CXXFLAGS="-O2 -W -Wall"
diff --git a/binary/mingw-w64/libodb-qt-configure b/binary/mingw-w64/libodb-qt-configure
new file mode 100755
index 0000000..f3a2734
--- /dev/null
+++ b/binary/mingw-w64/libodb-qt-configure
@@ -0,0 +1,14 @@
+#! /bin/sh
+
+wd=`pwd`
+
+./configure \
+--disable-shared \
+--enable-static \
+--host i686-w64-mingw32 \
+--target i686-w64-mingw32 \
+--prefix=/mingw \
+--with-libodb=../libodb \
+CXXFLAGS="-O2 -W -Wall" \
+CPPFLAGS="-I$wd/../cross/qtcore/include -I$wd/../cross/qtcore/include/QtCore" \
+LDFLAGS="-L$wd/../cross/qtcore/lib"
diff --git a/binary/mingw-w64/manifest.txt b/binary/mingw-w64/manifest.txt
new file mode 100644
index 0000000..e35a3ea
--- /dev/null
+++ b/binary/mingw-w64/manifest.txt
@@ -0,0 +1,15 @@
+This directory contains components from the MinGW-W64 and MSYS systems
+as well as the GCC compiler.
+
+The MinGW-W64 and GCC distributions are comprised of several different
+packages. Each of the various packages is governed by its own
+individual copyright and licensing terms. Some of those packages are
+licensed by the GNU Public License (GPL) or the GNU Lesser General
+Public License(LGPL), some are licensed in the Public Domain and some
+have their own open-source licenses.
+
+For full source code and licensing details see:
+
+MinGW-W64: http://mingw-w64.sourceforge.net
+MSYS: http://www.mingw.org
+GCC: http://gcc.gnu.org
diff --git a/binary/mingw-w64/odb-configure b/binary/mingw-w64/odb-configure
new file mode 100755
index 0000000..fd565a0
--- /dev/null
+++ b/binary/mingw-w64/odb-configure
@@ -0,0 +1,14 @@
+#! /bin/sh
+
+../odb/configure \
+--disable-shared \
+--enable-static \
+--host i686-w64-mingw32 \
+--target i686-w64-mingw32 \
+--prefix=/tmp/odb-$1-i686-windows \
+--with-libcutl=../libcutl \
+--with-gxx-name='..\\mingw\\bin\\g++.exe' \
+--with-options-file='..\\etc\\odb\\default.options' \
+CXXFLAGS="-O2 -W -Wall" \
+LDFLAGS=-static-libgcc \
+CPPFLAGS="-I`pwd`/../gcc-headers/gcc -I`pwd`/../gcc/gcc -I`pwd`/../gcc/libcpp/include -I`pwd`/../gcc/include"
diff --git a/binary/mingw-w64/pthread-cross-configure b/binary/mingw-w64/pthread-cross-configure
new file mode 100755
index 0000000..d858097
--- /dev/null
+++ b/binary/mingw-w64/pthread-cross-configure
@@ -0,0 +1,9 @@
+#! /bin/sh
+
+#
+#
+../winpthreads/configure \
+--host i686-w64-mingw32 \
+--prefix=/home/boris/work/odb/build/mingw-w64/cross/mingw/i686-w64-mingw32 \
+--with-sysroot=/home/boris/work/odb/build/mingw-w64/cross/mingw \
+CFLAGS=-O2 CXXFLAGS=-O2
diff --git a/binary/mingw-w64/rt-configure b/binary/mingw-w64/rt-configure
new file mode 100755
index 0000000..3cf9b61
--- /dev/null
+++ b/binary/mingw-w64/rt-configure
@@ -0,0 +1,10 @@
+#! /bin/sh
+
+#
+#
+../mingw-w64/configure \
+--host i686-w64-mingw32 \
+--target i686-w64-mingw32 \
+--prefix=/mingw \
+--with-sysroot=/mingw \
+CFLAGS=-O2 CXXFLAGS=-O2
diff --git a/binary/mingw-w64/rt-cross-configure b/binary/mingw-w64/rt-cross-configure
new file mode 100755
index 0000000..93c1226
--- /dev/null
+++ b/binary/mingw-w64/rt-cross-configure
@@ -0,0 +1,9 @@
+#! /bin/sh
+
+#
+#
+../mingw-w64/configure \
+--host i686-w64-mingw32 \
+--prefix=/home/boris/work/odb/build/mingw-w64/cross/mingw \
+--with-sysroot=/home/boris/work/odb/build/mingw-w64/cross/mingw \
+CFLAGS=-O2 CXXFLAGS=-O2
diff --git a/binary/mingw-w64/rt-headers-cross-configure b/binary/mingw-w64/rt-headers-cross-configure
new file mode 100755
index 0000000..58b800f
--- /dev/null
+++ b/binary/mingw-w64/rt-headers-cross-configure
@@ -0,0 +1,8 @@
+#! /bin/sh
+
+#
+#
+../mingw-w64/mingw-w64-headers/configure \
+--host i686-w64-mingw32 \
+--prefix=/home/boris/work/odb/build/mingw-w64/cross/mingw \
+CFLAGS=-O2 CXXFLAGS=-O2