My standard build which autodetects most features, and in particular
Berkeley db and PostgreSQL, is failing to link as follows:
------------------------------------------------------------------------
database.o(.text+0x1d7): In function `Fopen_database':
/playpen/Projects/XEmacs/21.4/src/database.c:697: undefined reference to `db_cre
ate_4001'
collect2: ld returned 1 exit status
make[1]: *** [xemacs] Error 1
make[1]: Leaving directory `/playpen/Projects/XEmacs/Builds/21.4/src'
make: *** [src] Error 2
------------------------------------------------------------------------
What is happening is that on my platform, libpq (the PostgreSQL stub
library) is dynamically linked to libdb3. I believe this is Debian-
specific damage.
This means that the link test for
char dbcreate ();
main () { db_create(); }
in configure _succeeds_ so that -ldb is _not_ added to the
linker_flags. Then database.c #include's <db.h>, which decorates
function names with version information, and the link fails, as you
see.
This doesn't affect 21.5 because PostgreSQL's libraries are _not_
linked with in other config tests, they are tracked separately.
Probable minimally invasive workaround: move the Berkeley db detection
code earlier than the PostgreSQL detection code. It is possible that
this will cause subtle runtime breakage for users with libpq linked to
libdb3 and libdb 4.0 installed as the default libdb.so. (If there's
breakage for libdb 4.1 users, it will be obvious at the link stage
because of the version decoration scheme.)
More correct fix involves breaking out the libraries as is done in
21.5. Fully correct fix is probably not possible, because Debian is
deliberately using techniques that confuse configure.
Vin, what do you think? I'll work up a patch later.
--
Institute of Policy and Planning Sciences
http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Ask not how you can "do" free software business;
ask what your business can "do for" free software.