>>>>> "D" == David Craine <dave@infoether.com> writes:
D> RIght...I've got that part. But what I'm trying to do is compile and
D> statically link the extension into the ruby executable itself. I've
D> created an entry in the <ruby>/ext/Setup file for bdb so that it will
D> try and build it when Ruby builds. When I try to make ruby it will
D> actually try and compile the bdb extension, but without passing in the
D> --with-db-dir parameter. I need to know how to pass this parameter
D> through to the extconf.rb file for the bdb extension when running the
D> make file for ruby.
There is a bug in extconf.rb for bdb, not really a surprise for me :-)
Try it with
uln% cd ext
uln%
uln% tar zxf ~/ruby/perso/db/bdb-0.5.4.tar.gz
uln%
uln% rm -r bdb-0.5.4/extconf.rb bdb-0.5.4/bdbxml*
uln%
uln% cd ..
uln%
uln% tail -1 ext/Setup
bdb-0.5.4/src
uln%
uln% ./configure --prefix=$HOME/local/r182 --with-db-dir=$HOME/local/db4.3.21 > /dev/null
uln%
uln% make
[...]
compiling bdb-0.5.4/src
make[1]: Entering directory `/opt/ts/ruby/tmp/ruby-1.8.2/ext/bdb-0.5.4/src'
gcc -g -O2 -I. -I../../.. -I../../../. -I../../.././ext/bdb-0.5.4/src -I/opt/ts/local/db4.3.21/include -c bdb.c
gcc -g -O2 -I. -I../../.. -I../../../. -I../../.././ext/bdb-0.5.4/src -I/opt/ts/local/db4.3.21/include -c env.c
gcc -g -O2 -I. -I../../.. -I../../../. -I../../.././ext/bdb-0.5.4/src -I/opt/ts/local/db4.3.21/include -c log.c
gcc -g -O2 -I. -I../../.. -I../../../. -I../../.././ext/bdb-0.5.4/src -I/opt/ts/local/db4.3.21/include -c transaction.c
gcc -g -O2 -I. -I../../.. -I../../../. -I../../.././ext/bdb-0.5.4/src -I/opt/ts/local/db4.3.21/include -c cursor.c
gcc -g -O2 -I. -I../../.. -I../../../. -I../../.././ext/bdb-0.5.4/src -I/opt/ts/local/db4.3.21/include -c common.c
gcc -g -O2 -I. -I../../.. -I../../../. -I../../.././ext/bdb-0.5.4/src -I/opt/ts/local/db4.3.21/include -c lock.c
gcc -g -O2 -I. -I../../.. -I../../../. -I../../.././ext/bdb-0.5.4/src -I/opt/ts/local/db4.3.21/include -c delegator.c
gcc -g -O2 -I. -I../../.. -I../../../. -I../../.././ext/bdb-0.5.4/src -I/opt/ts/local/db4.3.21/include -c sequence.c
gcc -g -O2 -I. -I../../.. -I../../../. -I../../.././ext/bdb-0.5.4/src -I/opt/ts/local/db4.3.21/include -c recnum.c
ar cru bdb.a bdb.o env.o log.o transaction.o cursor.o common.o lock.o delegator.o sequence.o recnum.o
make[1]: Leaving directory `/opt/ts/ruby/tmp/ruby-1.8.2/ext/bdb-0.5.4/src'
[...]
make[1]: Entering directory `/opt/ts/ruby/tmp/ruby-1.8.2'
gcc -g -O2 -I. -I. -o ext/extinit.o -c ext/extinit.c
gcc -g -O2 -rdynamic -Wl,-export-dynamic -L. -L'/opt/ts/local/db4.3.21/lib' -Wl,-R'/opt/ts/local/db4.3.21/lib' main.o ext/extinit.o ext/bdb-0.5.4/src/bdb.a -lruby-static -ldl -lcrypt -lm -ldb-4.3 -o ruby
make[1]: Leaving directory `/opt/ts/ruby/tmp/ruby-1.8.2'
uln%
uln% ./ruby -e 'p BDB::VERSION'
"Sleepycat Software: Berkeley DB 4.3.21: (November 8, 2004)"
uln%
Guy Decoux