#!/bin/sh - # # This is how I normally configure DBSQL when I'm doing daily work. # # Note that I'm usually using the latest copy of Mac OS/X for # devlelopment work, so some of this may be specific to that. # [ -d build_unix ] && { echo 'You cannot build in the top-level directory.' exit 1 } [ -d aclocal ] && { echo 'You cannot build in the dist directory.' exit 1 } args="" #args="--disable-shared $args" #args="--disable-static $args" args="--enable-vacuum $args" #args="--enable-datetime $args" args="--enable-authentication $args" args="--enable-incore-databases $args" args="--enable-incore-temp-databases $args" args="--enable-debug $args" args="--enable-diagnostic $args" args="--enable-test $args" args="--enable-tcl $args" #args="--enable-sqlite-compat $args" args="--enable-soundex-sqlfn $args" #args="--with-tcl=/usr/lib/tcl-8.5.19/lib $args" #args="--with-berkeleydb=/usr/local/db-4.8.30 $args" #args="--with-db-uniquename=FOO $args" # Mac OS/X enable: #args="LD_TWOLEVEL_NAMESPACE=1 LIBTSO_LIBS=-ltcl8.4 $args" # On NixOS enable: CFLAGS="${NIX_CFLAGS_COMPILE} -O0 -g -DDEBUG" LDLAGS="${NIX_LDFLAGS} /home/gburd/src/libdb/build_unix/.libs" #args="--with-berkeleydb=$(pkg-config --variable=prefix db) $args" #args="--with-berkeleydb=/nix/store/mlhib3c2ra8bj36vhxmwqhyxph8a8sgf-db-4.8.30 $args" args="--with-berkeleydb=/home/gburd/opt $args" args="--with-tcl=$(pkg-config --variable=libdir tcl) $args" echo "env $cppflags $ldflags $libs ../dist/configure $args" env $cppflags $ldflags $libs sh ../dist/configure -C $args # (echo "break __db_loadme" && # echo "break __db_err" && # echo "define dd" && # echo 'print __db_dump(dbp, "a", "/tmp/o")' && # echo "end" && # echo "define dc" && # echo 'print __db_dump(dbc->dbp, "a", "/tmp/o")' && # echo "end") > .gdbinit # (echo "set environment LD_LIBRARY_PATH=.:.libs" && # echo "dir ../src" && # echo "dir ../src/dbsql" && # echo "dir ../src/dbsql/rl/src" && # echo "dir /usr/local/db/src/dist" && # echo "path /usr/local/db/lib" && # echo "path .") > .gdbinit rm -f tags ln -s ../dist/tags tags mkdir -p .libs && true exit 0 nix-build -E 'with import {}; enableDebugging db4' gdb -ix .gdbinit --tui build_unix/.libs/dbsql r --init ../test/smoke.sql smoke