summaryrefslogtreecommitdiff
path: root/dist.sh
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-03-30 13:11:24 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-03-30 13:11:24 +0200
commit457b2c78ff3b6da7856c6d336de6e1b2dc3a4d60 (patch)
treea155eab5d4e1e4d716512194b75a14decdf44172 /dist.sh
parent315792498783a7605434a6a2c79958dfe2aea9b4 (diff)
Support for the SQLite database
Also temporarily disable boost in tests and examples
Diffstat (limited to 'dist.sh')
-rwxr-xr-xdist.sh125
1 files changed, 95 insertions, 30 deletions
diff --git a/dist.sh b/dist.sh
index e7d2a4c..58a37fb 100755
--- a/dist.sh
+++ b/dist.sh
@@ -5,6 +5,7 @@
# -rebuild
# -complete package/build libcutl and the ODB compiler; implies -rebuild
# -test
+# -db <database>
# -odb
#
trap 'exit 1' ERR
@@ -22,6 +23,7 @@ ver=`cat $src_root/odb/version`
test=n
rebuild=n
complete=n
+db=
odb=$src_root/odb/odb/odb
CXXFLAGS="-W -Wall -Wno-unknown-pragmas"
@@ -41,6 +43,11 @@ while [ $# -gt 0 ]; do
test=y
shift
;;
+ -db)
+ shift
+ db="$db $1"
+ shift
+ ;;
-odb)
shift
odb=$1
@@ -53,6 +60,10 @@ while [ $# -gt 0 ]; do
esac
done
+if [ "$db" = "" ]; then
+ db="mysql sqlite"
+fi
+
# Clean everything up if we are rebuilding.
#
if [ $rebuild = y ]; then
@@ -60,8 +71,8 @@ if [ $rebuild = y ]; then
rm -rf $out_root/libodb-mysql/*
rm -rf $out_root/libodb-tracer/*
rm -rf $out_root/libodb-boost/*
- rm -rf $out_root/odb-tests/*
- rm -rf $out_root/odb-examples/*
+ rm -rf $out_root/odb-tests/* $out_root/odb-tests-*
+ rm -rf $out_root/odb-examples/* $out_root/odb-examples-*
if [ $complete = y ]; then
rm -rf $out_root/libcutl/*
@@ -135,6 +146,25 @@ 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-sqlite
+#
+make -C $src_root/libodb-sqlite dist dist_prefix=$out_root/libodb-sqlite
+
+cd $out_root/libodb-sqlite
+
+if [ $rebuild = y ]; then
+ ./bootstrap
+ ./configure --with-libodb=../libodb CXXFLAGS="$CXXFLAGS"
+fi
+
+make -j 8
+make dist
+
+cd $wd
+
+cp $out_root/libodb-sqlite/libodb-sqlite-$ver.zip $out_root/pack/
+cp $out_root/libodb-sqlite/libodb-sqlite-$ver.tar.gz $out_root/pack/
+cp $out_root/libodb-sqlite/libodb-sqlite-$ver.tar.bz2 $out_root/pack/
# Build libodb-mysql
#
@@ -198,59 +228,94 @@ cp $out_root/libodb-boost/libodb-boost-$ver.tar.bz2 $out_root/pack/
# Build odb-tests
#
-make -C $src_root/tests dist dist_prefix=$out_root/odb-tests
+make -C $src_root/tests-mysql -f $src_root/tests/makefile dist \
+dist_prefix=$out_root/odb-tests
cd $out_root/odb-tests
if [ $rebuild = y ]; then
./bootstrap
- ./configure \
---with-database=mysql \
+fi
+
+cd $wd
+
+dist_tests=
+
+for d in $db; do
+ mkdir -p $out_root/odb-tests-$d
+ cd $out_root/odb-tests-$d
+
+# @@ --with-libodb-boost=../libodb-boost \
+
+ if [ $rebuild = y ]; then
+ ../odb-tests/configure \
+--with-database=$d \
--with-libodb=../libodb \
--with-libodb-tracer=../libodb-tracer \
---with-libodb-mysql=../libodb-mysql \
---with-libodb-boost=../libodb-boost \
+--with-libodb-$d=../libodb-$d \
CXXFLAGS="$CXXFLAGS" \
ODB=$odb
-fi
+ fi
-if [ $test = y ]; then
- make -j 8 check
-fi
+ if [ $test = y ]; then
+ make -j 8 check
+ fi
-make dist
+ if [ "$dist_tests" = "" ]; then
+ dist_tests=$d
+ make dist
+ fi
-cd $wd
+ cd $wd
+done
+
+cp $out_root/odb-tests-$dist_tests/odb-tests-$ver.zip $out_root/pack/
+cp $out_root/odb-tests-$dist_tests/odb-tests-$ver.tar.gz $out_root/pack/
+cp $out_root/odb-tests-$dist_tests/odb-tests-$ver.tar.bz2 $out_root/pack/
-cp $out_root/odb-tests/odb-tests-$ver.zip $out_root/pack/
-cp $out_root/odb-tests/odb-tests-$ver.tar.gz $out_root/pack/
-cp $out_root/odb-tests/odb-tests-$ver.tar.bz2 $out_root/pack/
# Build odb-examples
#
-make -C $src_root/examples dist dist_prefix=$out_root/odb-examples
+make -C $src_root/examples-mysql -f $src_root/examples/makefile dist \
+dist_prefix=$out_root/odb-examples
cd $out_root/odb-examples
if [ $rebuild = y ]; then
./bootstrap
- ./configure \
---with-database=mysql \
+fi
+
+cd $wd
+
+dist_examples=
+
+for d in $db; do
+ mkdir -p $out_root/odb-examples-$d
+ cd $out_root/odb-examples-$d
+
+# @@ --with-libodb-boost=../libodb-boost \
+
+ if [ $rebuild = y ]; then
+ ../odb-examples/configure \
+--with-database=$d \
--with-libodb=../libodb \
---with-libodb-mysql=../libodb-mysql \
---with-libodb-boost=../libodb-boost \
+--with-libodb-$d=../libodb-$d \
CXXFLAGS="$CXXFLAGS" \
ODB=$odb
-fi
+ fi
-if [ $test = y ]; then
- make -j 8 check
-fi
+ if [ $test = y ]; then
+ make -j 8 check
+ fi
-make dist
+ if [ "$dist_examples" = "" ]; then
+ dist_examples=$d
+ make dist
+ fi
-cd $wd
+ cd $wd
+done
-cp $out_root/odb-examples/odb-examples-$ver.zip $out_root/pack/
-cp $out_root/odb-examples/odb-examples-$ver.tar.gz $out_root/pack/
-cp $out_root/odb-examples/odb-examples-$ver.tar.bz2 $out_root/pack/
+cp $out_root/odb-examples-$dist_examples/odb-examples-$ver.zip $out_root/pack/
+cp $out_root/odb-examples-$dist_examples/odb-examples-$ver.tar.gz $out_root/pack/
+cp $out_root/odb-examples-$dist_examples/odb-examples-$ver.tar.bz2 $out_root/pack/