On my machine, building heimdal-0.7 ends with this error message: /bin/sh ../../libtool --mode=link i686-pc-linux-gnu-gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs -O3 -march=pentium4 -fomit-frame-pointer -pipe -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -o convert_db convert_db.o libhdb.la ../krb5/libkrb5.la ../asn1/libasn1.la -L/usr/athena/lib -lcrypto ../../lib/vers/libvers.la ../../lib/roken/libroken.la -lcrypt -lresolv -pthread i686-pc-linux-gnu-gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs -O3 -march=pentium4 -fomit-frame-pointer -pipe -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -o .libs/convert_db convert_db.o -pthread ./.libs/libhdb.so /var/tmp/portage/heimdal-0.7/work/heimdal-0.7/lib/krb5/.libs/libkrb5.so -L/usr/athena/lib ../krb5/.libs/libkrb5.so /var/tmp/portage/heimdal-0.7/work/heimdal-0.7/lib/asn1/.libs/libasn1.so /var/tmp/portage/heimdal-0.7/work/heimdal-0.7/lib/roken/.libs/libroken.so -ldl ../asn1/.libs/libasn1.so /usr/athena/lib/libcom_err.a -lcrypto ../../lib/vers/.libs/libvers.a ../../lib/roken/.libs/libroken.so -ldb -lcrypt -lresolv ./.libs/libhdb.so: undefined reference to `db_create' collect2: ld returned 1 exit status make[1]: *** [convert_db] Error 1 make[1]: Leaving directory `/var/tmp/portage/heimdal-0.7/work/heimdal-0.7/lib/hdb' make: *** [all] Error 2 it seems db3.o (inside libhdb.so) requires the symbol db_create. db3.c seems to do an inaccurate check if it can include db4/db.h (there are other names for the db includes of 4.x), and then chooses to include db3/db.h. Whereas on machines that don't have db3, it would fall back to db.h, which is again a link to db4.2/db.h. If the latter is included, the #define db_create db_create_4002 or so would have been used, hence the unresolved symbol doesn't show up. I think :) sderoeck@olympia ~ $ equery l sys-libs/db [ Searching for package 'db' in 'sys-libs' among: ] * installed packages [I--] [ ] sys-libs/db-4.2.52_p2 (4.2) [I--] [ ] sys-libs/db-1.85-r2 (1) [I--] [ ] sys-libs/db-4.1.25_p1-r4 (4.1) [I--] [ ] sys-libs/db-3.2.9-r10 (3)
It seems to me that heimdal links with -ldb, unconditionally (this is, not depending on what versions of include files it found). Therefore, I would expect it to include /usr/include/db.h, as I assume db.h and libdb.so point to (possibly by softlinks) to files of the same db-version. In the same reasoning, if you would allow some kind of detection of the best suited db-version available, it would not be done at compile-time (as in gcc -c), but at configure time, because then a suitable libdb-x.so + dbx/db.h combination could be detected. As gentoo seems to take care that a link points to the latest version installed, I would go for the option in the first paragraph.
If I remember right, heimdal does not support db-4.2, only 4.1 (or even up to 4.0, am not sure now). Please check the email lists, it was mentioned there. I'm sure.
Martin, could you point us to the e-mail you're referring to? It seems to me the heimdal-discuss archive is not very search friendly, and they may not like it if I wget -r their whole html-frontend for the list.
http://www.google.com/search?hl=en&q=heimdal-discuss+mokrejs+db-4%2C0&btnG=Google+Search
Fixed in heimdal-0.7-r1. Many thanks to robbat2 for helping me on this one. Fix now consists of only using /usr/include/db.h and /usr/lib/libdb.so, so we're guaranteed to use the same version of includes/libraries, and detecting more specific version properties using these files.