From f7b2bea429417fe99ef46f815f82c1323c8f0e1e Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Thu, 24 Nov 2011 10:32:03 +0200 Subject: Add Oracle to dist --- dist.sh | 40 +++++++++++++++++++++++++++++++++-- test/windows/README | 2 ++ test/windows/odb/all | 2 +- test/windows/odb/mingw/build | 9 +++++--- test/windows/odb/oracle-driver.bat | 43 ++++++++++++++++++++++++++++++++++++++ test/windows/odb/oracle.options | 9 ++++++++ test/windows/odb/setenv.bat | 7 +++++-- test/windows/odb/unpack | 7 +++++-- 8 files changed, 109 insertions(+), 10 deletions(-) create mode 100644 test/windows/odb/oracle-driver.bat create mode 100644 test/windows/odb/oracle.options diff --git a/dist.sh b/dist.sh index f6a0fa7..5bd548d 100755 --- a/dist.sh +++ b/dist.sh @@ -48,6 +48,11 @@ cxxp=g++-4.5 CXXFLAGS="-W -Wall -Wno-unknown-pragmas" +mysql_options= +sqlite_options= +pgsql_options= +oracle_options="--with-oracle-host=localhost --with-oracle-service=xe" + while [ $# -gt 0 ]; do case $1 in -rebuild) @@ -91,13 +96,14 @@ while [ $# -gt 0 ]; do done if [ "$db" = "" ]; then - db="pgsql sqlite mysql" + db="oracle pgsql sqlite mysql" fi # Clean everything up if we are rebuilding. # if [ $rebuild = y ]; then rm -rf $out_root/libodb/* + rm -rf $out_root/libodb-oracle/* rm -rf $out_root/libodb-pgsql/* rm -rf $out_root/libodb-sqlite/* rm -rf $out_root/libodb-mysql/* @@ -114,7 +120,8 @@ if [ $rebuild = y ]; then rm -rf $out_root/pack fi -mkdir -p $out_root/libodb +mkdir -p $out_root/libodb\ +mkdir -p $out_root/libodb-oracle mkdir -p $out_root/libodb-pgsql mkdir -p $out_root/libodb-sqlite mkdir -p $out_root/libodb-mysql @@ -182,6 +189,29 @@ cp $out_root/libodb/libodb-$ver.*.zip $out_root/pack/ cp $out_root/libodb/libodb-$ver.*.tar.gz $out_root/pack/ cp $out_root/libodb/libodb-$ver.*.tar.bz2 $out_root/pack/ +# Build libodb-oracle +# +make -C `find_out_dir $src_root/libodb-oracle` \ +-f $src_root/libodb-oracle/makefile dist dist_prefix=$out_root/libodb-oracle + +cd $out_root/libodb-oracle + +if [ $rebuild = y ]; then + ./bootstrap + ./configure --with-libodb=../libodb \ + --with-oci="/usr/lib/oracle/instantclient/10.2.0.3" \ + CXX=$cxx CXXFLAGS="$CXXFLAGS" +fi + +make -j 8 +make dist + +cd $wd + +cp $out_root/libodb-oracle/libodb-oracle-$ver.*.zip $out_root/pack/ +cp $out_root/libodb-oracle/libodb-oracle-$ver.*.tar.gz $out_root/pack/ +cp $out_root/libodb-oracle/libodb-oracle-$ver.*.tar.bz2 $out_root/pack/ + # Build libodb-pgsql # make -C `find_out_dir $src_root/libodb-pgsql` \ @@ -306,6 +336,8 @@ for d in $db; do mkdir -p $out_root/odb-tests-$d cd $out_root/odb-tests-$d + optvar=${d}_options + if [ $rebuild = y ]; then ../odb-tests/configure \ --with-database=$d \ @@ -313,6 +345,7 @@ for d in $db; do --with-libodb-$d=../libodb-$d \ --with-libodb-boost=../libodb-boost \ --with-libodb-qt=../libodb-qt \ +${!optvar} \ CXX=$cxx \ CXXFLAGS="$CXXFLAGS" \ ODB=$odb @@ -354,6 +387,8 @@ for d in $db; do mkdir -p $out_root/odb-examples-$d cd $out_root/odb-examples-$d + optvar=${d}_options + if [ $rebuild = y ]; then ../odb-examples/configure \ --with-database=$d \ @@ -361,6 +396,7 @@ for d in $db; do --with-libodb-$d=../libodb-$d \ --with-libodb-boost=../libodb-boost \ --with-libodb-qt=../libodb-qt \ +${!optvar} \ CXX=$cxx \ CXXFLAGS="$CXXFLAGS" \ ODB=$odb diff --git a/test/windows/README b/test/windows/README index b2ee0d3..8211bac 100644 --- a/test/windows/README +++ b/test/windows/README @@ -21,10 +21,12 @@ Steps: sqlite pgsql pgsql64 + oracle boost qtcore odb/libodb odb/libodb-mysql + odb/libodb-oracle odb/libodb-pgsql odb/libodb-sqlite odb/libodb-boost diff --git a/test/windows/odb/all b/test/windows/odb/all index e727929..8d50a29 100755 --- a/test/windows/odb/all +++ b/test/windows/odb/all @@ -27,7 +27,7 @@ if [ "$2" = "" ]; then exit 1 else if [ "$2" = "all" ]; then - databases="pgsql sqlite mysql" + databases="oracle pgsql sqlite mysql" else databases=$2 fi diff --git a/test/windows/odb/mingw/build b/test/windows/odb/mingw/build index 35748c9..79aee24 100755 --- a/test/windows/odb/mingw/build +++ b/test/windows/odb/mingw/build @@ -24,16 +24,18 @@ ROOT=/c/projects MYSQL=$ROOT/mysql-mingw32 SQLITE=$ROOT/sqlite-mingw32 PGSQL=$ROOT/pgsql-mingw32 +ORACLE=$ROOT/oracle-mingw32 BOOST=$ROOT/boost-mingw32 QTCORE=$ROOT/qtcore-mingw32 -CPPFLAGS="-I$BOOST -I$QTCORE/include -I$QTCORE/include/QtCore -I$PGSQL/include -I$SQLITE -I$MYSQL/include" -LDFLAGS="-L$BOOST/stage/lib -L$QTCORE/lib -L$PGSQL/lib -L$SQLITE -L$MYSQL/lib -Wl,--enable-auto-import" +CPPFLAGS="-I$BOOST -I$QTCORE/include -I$QTCORE/include/QtCore -I$ORACLE/include -I$PGSQL/include -I$SQLITE -I$MYSQL/include" +LDFLAGS="-L$BOOST/stage/lib -L$QTCORE/lib -L$ORACLE/lib -L$PGSQL/lib -L$SQLITE -L$MYSQL/lib -Wl,--enable-auto-import" PATH="$QTCORE/bin:$PATH" mysql_options="--with-mysql-host=192.168.0.5 --with-mysql-client=$MYSQL/bin/mysql.exe" sqlite_options="--with-sqlite-db=c:\\projects\\odb\\odb_test.db" pgsql_options="--with-pgsql-host=192.168.0.5 --with-pgsql-client=$PGSQL/bin/psql.exe" +oracle-options="--with-oracle-host=192.168.0.5 --with-oracle-service=xe --with-oracle-client=$ORACLE/bin/sqlplus.exe" test=n rebuild=n @@ -62,13 +64,14 @@ while [ $# -gt 0 ]; do done if [ "$db" = "" ]; then - db="pgsql sqlite mysql" + db="oracle pgsql sqlite mysql" fi # Clean everything up if we are rebuilding. # if [ $rebuild = y ]; then clean libodb + clean libodb-oracle clean libodb-pgsql clean libodb-sqlite clean libodb-mysql diff --git a/test/windows/odb/oracle-driver.bat b/test/windows/odb/oracle-driver.bat new file mode 100644 index 0000000..83662bf --- /dev/null +++ b/test/windows/odb/oracle-driver.bat @@ -0,0 +1,43 @@ +@echo off +rem file : oracle-driver.bat +rem author : Boris Kolpackov +rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +rem license : GNU GPL v2; see accompanying LICENSE file + +rem +rem oracle-driver.bat sql-file +rem +rem Run the oracle client on the SQL file specified. Adjust the +rem option below to match your Oracle setup. +rem + +setlocal + +set "options=%ORACLE_OPTIONS%" +set "options=%options% odb_test/odb_test" + +set "oracle=%ORACLE_CLIENT%" + +if "_%oracle%_" == "__" set "oracle=sqlplus" + +if "_%1_" == "__" ( + echo no sql file specified + goto usage +) + +%oracle% %options% < %1 + +if errorlevel 1 goto error +goto end + +:usage +echo. +echo usage: oracle-driver.bat sql-file +echo. + +:error +endlocal +exit /b 1 + +:end +endlocal diff --git a/test/windows/odb/oracle.options b/test/windows/odb/oracle.options new file mode 100644 index 0000000..288ef20 --- /dev/null +++ b/test/windows/odb/oracle.options @@ -0,0 +1,9 @@ +# Sample Oracle options file used to run the tests. Adjust to +# match your Oracle setup. +# + +--user odb_test +--password odb_test +# --service +# --host 192.168.0.X +# --port diff --git a/test/windows/odb/setenv.bat b/test/windows/odb/setenv.bat index dafba20..d23f85c 100755 --- a/test/windows/odb/setenv.bat +++ b/test/windows/odb/setenv.bat @@ -6,13 +6,16 @@ set MYSQL64=c:\projects\mysql64 set SQLITE=c:\projects\sqlite set PGSQL=c:\projects\pgsql set PGSQL64=c:\projects\pgsql64 +set ORACLE=c:\projects\oracle +set ORACLE64=c:\projects\oracle64 set QTCORE=c:\projects\qtcore set QTCORE64=c:\projects\qtcore64 +set "ORACLE_OPTIONS=-L -S" set "DIFF=c:\cygwin\bin\diff.exe -ubB" rem set "DEVENV=c:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\devenv.com" set "DEVENV=c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.com" -set PATH=%ODB%\libodb\bin;%ODB%\libodb-sqlite\bin;%ODB%\libodb-mysql\bin;%ODB%\libodb-pgsql\bin;%ODB%\libodb-boost\bin;%ODB%\libodb-qt\bin;%MYSQL%\bin;%SQLITE%\bin;%PGSQL%\bin;%QTCORE%\bin;%PATH% -set PATH=%ODB%\libodb\bin64;%ODB%\libodb-sqlite\bin64;%ODB%\libodb-mysql\bin64;%ODB%\libodb-pgsql\bin64;%ODB%\libodb-boost\bin64;%ODB%\libodb-qt\bin64;%MYSQL64%\bin;%SQLITE%\bin64;%PGSQL64%\bin;%QTCORE64%\bin;%PATH% +set PATH=%ODB%\libodb\bin;%ODB%\libodb-sqlite\bin;%ODB%\libodb-mysql\bin;%ODB%\libodb-pgsql\bin;%ODB%\libodb-oracle\bin;%ODB%\libodb-boost\bin;%ODB%\libodb-qt\bin;%MYSQL%\bin;%SQLITE%\bin;%PGSQL%\bin;%ORACLE%\bin;%QTCORE%\bin;%PATH% +set PATH=%ODB%\libodb\bin64;%ODB%\libodb-sqlite\bin64;%ODB%\libodb-mysql\bin64;%ODB%\libodb-pgsql\bin64;%ODB%\libodb-oracle\bin64;%ODB%\libodb-boost\bin64;%ODB%\libodb-qt\bin64;%MYSQL64%\bin;%SQLITE%\bin64;%PGSQL64%\bin;%ORACLE64%\bin;%QTCORE64%\bin;%PATH% if "_%1_" == "__" goto end diff --git a/test/windows/odb/unpack b/test/windows/odb/unpack index c45bd6c..8f40853 100755 --- a/test/windows/odb/unpack +++ b/test/windows/odb/unpack @@ -12,7 +12,7 @@ function error () echo "$*" 1>&2 } -databases="pgsql sqlite mysql" +databases="oracle pgsql sqlite mysql" mingw=n while [ $# -gt 0 ]; do @@ -34,7 +34,7 @@ else base=/cygdrive/t/pack fi -rm -rf libodb libodb-pgsql libodb-sqlite libodb-mysql libodb-boost \ +rm -rf libodb libodb-oracle libodb-pgsql libodb-sqlite libodb-mysql libodb-boost \ libodb-qt odb odb-tests odb-examples odb-tests-* odb-examples-* v=`echo $base/libodb-?.*.zip | sed -e "s%$base/libodb-\(.*\).zip%\1%"` @@ -44,6 +44,9 @@ echo unpacking $v from $base unzip -q $base/libodb-$v.zip mv libodb-$v libodb +unzip -q $base/libodb-oracle-$v.zip +mv libodb-oracle-$v libodb-oracle + unzip -q $base/libodb-pgsql-$v.zip mv libodb-pgsql-$v libodb-pgsql -- cgit v1.1