diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-02-23 13:47:34 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-02-23 13:47:34 +0200 |
commit | 3278c862abfc4a6cb9c27cd9dcfce2b8f2b73910 (patch) | |
tree | 70fbfe7dbb27250cdad3ead628ce6b7c4ab7287e /test/windows/odb/mingw/build | |
parent | afc81e5cb09219770a8a5b8cd2855b45ece0a42a (diff) |
Add Windows test scripts
Diffstat (limited to 'test/windows/odb/mingw/build')
-rwxr-xr-x | test/windows/odb/mingw/build | 132 |
1 files changed, 132 insertions, 0 deletions
diff --git a/test/windows/odb/mingw/build b/test/windows/odb/mingw/build new file mode 100755 index 0000000..979cc16 --- /dev/null +++ b/test/windows/odb/mingw/build @@ -0,0 +1,132 @@ +#! /usr/bin/env bash + +# Build ODB for mingw +# +# -rebuild +# -test +# +trap 'exit 1' ERR + +function error () +{ + echo "$*" 1>&2 +} + +function clean () +{ + if [ -f $1/Makefile ]; then + make -C $1 distclean + fi +} + +MYSQL=/c/projects/mysql-mingw32/bin/mysql.exe +CPPFLAGS=-I/c/projects/mysql-mingw32/include +LDFLAGS="-L/c/projects/mysql-mingw32/lib -Wl,--enable-auto-import" + +test=n +rebuild=n + +while [ $# -gt 0 ]; do + case $1 in + -rebuild) + rebuild=y + shift + ;; + -test) + test=y + shift + ;; + *) + error "unknown option: $1" + exit 1 + ;; + esac +done + +# Clean everything up if we are rebuilding. +# +if [ $rebuild = y ]; then + clean libodb + clean libodb-mysql + clean libodb-tracer + clean odb-tests + clean odb-examples +fi + +# Build libodb +# +cd libodb + +if [ $rebuild = y ]; then + ./configure CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" +fi + +make +cd .. + +# Build libodb-mysql +# +cd libodb-mysql + +if [ $rebuild = y ]; then + ./configure --with-libodb=../libodb CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" +fi + +make +cd .. + +# Build libodb-tracer +# +cd libodb-tracer + +if [ $rebuild = y ]; then + ./configure --with-libodb=../libodb CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" +fi + +make +cd .. + +# Build odb-tests +# +cd odb-tests + +if [ $rebuild = y ]; then + ./configure \ +--with-database=mysql \ +--with-libodb=../libodb \ +--with-libodb-mysql=../libodb-mysql \ +--with-libodb-tracer=../libodb-tracer \ +--with-mysql-host=192.168.0.5 \ +--with-mysql-client=$MYSQL \ +CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" DIFFFLAGS=-ubB +fi + +make + +if [ $test = y ]; then + make check +fi + +cd .. + +# Build odb-examples +# +cd odb-examples + +if [ $rebuild = y ]; then + ./configure \ +--with-database=mysql \ +--with-libodb=../libodb \ +--with-libodb-mysql=../libodb-mysql \ +--with-mysql-host=192.168.0.5 \ +--with-mysql-client=$MYSQL \ +CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" +fi + +make + +if [ $test = y ]; then + make check +fi + +cd .. |