#! /bin/sh

if test "$1" = "d"; then
  cxx="g++ -nodefaultlibs"
  libs="-Wl,-Bstatic,-lstdc++,-Bdynamic -Wl,-lgcc -Wl,-lgcc_eh -Wl,-lm -Wl,-lc"
else
  cxx="g++"
  libs=
fi

../odb/configure \
--with-libcutl=../libcutl \
--disable-rpath \
--with-gxx-name=../lib/odb/$2/bin/g++ \
--with-options-file=../etc/odb/default.options \
--prefix=$3 \
--libexecdir=$3/lib \
CXX="$cxx" CXXFLAGS=-O2 LIBS="$libs"