Gentoo devs have made gdbm, more and more, an optional package; I have had -gdbm in my global USE flags since sysinstall. Seeing that my current packages all made gdbm completely optional, I removed gdbm 1.8.3-r1. In apache-2.0.54-r13.ebuild, the USE=gdbm flag and gdbm DEPEND has been removed. But the apache build process inserts -lgdbm flags which error out the make when gdbm is not installed (please note my system uses MAKEOPTS=j2): /usr/share/apr-0/build/libtool --silent --mode=compile i586-pc-linux-gnu-gcc -pthread -O2 -mtune=k6-2 -pipe -DLINUX=2 -D_REENTRANT -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -DAP_HAVE_DESIGNATED_INITIALIZER -I/usr/include/apr-0 -I. -I/var/tmp/portage/apache-2.0.54-r13/work/httpd-2.0.54/os/unix -I/var/tmp/portage/apache-2.0.54-r13/work/httpd-2.0.54/server/mpm/worker -I/var/tmp/portage/apache-2.0.54-r13/work/httpd-2.0.54/modules/http -I/var/tmp/portage/apache-2.0.54-r13/work/httpd-2.0.54/modules/filters -I/var/tmp/portage/apache-2.0.54-r13/work/httpd-2.0.54/modules/proxy -I/var/tmp/portage/apache-2.0.54-r13/work/httpd-2.0.54/include -I/var/tmp/portage/apache-2.0.54-r13/work/httpd-2.0.54/modules/generators -I/usr/include/openssl -I/var/tmp/portage/apache-2.0.54-r13/work/httpd-2.0.54/modules/dav/main -prefer-non-pic -static -c htdbm.c && touch htdbm.lo /usr/share/apr-0/build/libtool --silent --mode=link i586-pc-linux-gnu-gcc -pthread -O2 -mtune=k6-2 -pipe -DLINUX=2 -D_REENTRANT -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -DAP_HAVE_DESIGNATED_INITIALIZER -I/usr/include/apr-0 -I. -I/var/tmp/portage/apache-2.0.54-r13/work/httpd-2.0.54/os/unix -I/var/tmp/portage/apache-2.0.54-r13/work/httpd-2.0.54/server/mpm/worker -I/var/tmp/portage/apache-2.0.54-r13/work/httpd-2.0.54/modules/http -I/var/tmp/portage/apache-2.0.54-r13/work/httpd-2.0.54/modules/filters -I/var/tmp/portage/apache-2.0.54-r13/work/httpd-2.0.54/modules/proxy -I/var/tmp/portage/apache-2.0.54-r13/work/httpd-2.0.54/include -I/var/tmp/portage/apache-2.0.54-r13/work/httpd-2.0.54/modules/generators -I/usr/include/openssl -I/var/tmp/portage/apache-2.0.54-r13/work/httpd-2.0.54/modules/dav/main -export-dynamic -L/usr/lib -o htpasswd htpasswd.lo -lz -lssl -lcrypto -ldl /var/tmp/portage/apache-2.0.54-r13/work/httpd-2.0.54/srclib/pcre/libpcre.la /usr/lib/libaprutil-0.la -lgdbm -ldb-4.2 -lexpat /usr/lib/libapr-0.la -lrt -lm -lcrypt -lnsl -lpthread -ldl /usr/share/apr-0/build/libtool --silent --mode=link i586-pc-linux-gnu-gcc -pthread -O2 -mtune=k6-2 -pipe -DLINUX=2 -D_REENTRANT -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -DAP_HAVE_DESIGNATED_INITIALIZER -I/usr/include/apr-0 -I. -I/var/tmp/portage/apache-2.0.54-r13/work/httpd-2.0.54/os/unix -I/var/tmp/portage/apache-2.0.54-r13/work/httpd-2.0.54/server/mpm/worker -I/var/tmp/portage/apache-2.0.54-r13/work/httpd-2.0.54/modules/http -I/var/tmp/portage/apache-2.0.54-r13/work/httpd-2.0.54/modules/filters -I/var/tmp/portage/apache-2.0.54-r13/work/httpd-2.0.54/modules/proxy -I/var/tmp/portage/apache-2.0.54-r13/work/httpd-2.0.54/include -I/var/tmp/portage/apache-2.0.54-r13/work/httpd-2.0.54/modules/generators -I/usr/include/openssl -I/var/tmp/portage/apache-2.0.54-r13/work/httpd-2.0.54/modules/dav/main -export-dynamic -L/usr/lib -o htdigest htdigest.lo -lz -lssl -lcrypto -ldl /var/tmp/portage/apache-2.0.54-r13/work/httpd-2.0.54/srclib/pcre/libpcre.la /usr/lib/libaprutil-0.la -lgdbm -ldb-4.2 -lexpat /usr/lib/libapr-0.la -lrt -lm -lcrypt -lnsl -lpthread -ldl /usr/lib/gcc/i586-pc-linux-gnu/3.4.4/../../../../i586-pc-linux-gnu/bin/ld: cannot find -lgdbm collect2: ld returned 1 exit status make[2]: *** [htpasswd] Error 1 make[2]: *** Waiting for unfinished jobs.... /usr/lib/gcc/i586-pc-linux-gnu/3.4.4/../../../../i586-pc-linux-gnu/bin/ld: cannot find -lgdbm collect2: ld returned 1 exit status make[2]: *** [htdigest] Error 1 make[2]: Leaving directory `/var/tmp/portage/apache-2.0.54-r13/work/httpd-2.0.54/support' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/tmp/portage/apache-2.0.54-r13/work/httpd-2.0.54/support' make: *** [all-recursive] Error 1 Reproducible: Always Steps to Reproduce: 1. emerge -1 net-www/apache # 2.0.54-r13 Actual Results: ebuild exited with errors. Expected Results: Ebuild should have compiled. emerge info Portage 2.0.51.22-r2 (default-linux/x86/2005.0, gcc-3.4.4, glibc-2.3.5-r1, 2.6.12-gentoo-r4 i586) ================================================================= System uname: 2.6.12-gentoo-r4 i586 AMD-K6(tm) 3D processor Gentoo Base System version 1.12.0_pre5 dev-lang/python: 2.3.5, 2.4.1-r1 sys-apps/sandbox: 1.2.12 sys-devel/autoconf: 2.13, 2.59-r7 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6 sys-devel/binutils: 2.16.1 sys-devel/libtool: 1.5.18-r1 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CBUILD="i586-pc-linux-gnu" CFLAGS="-O2 -mtune=k6-2 -pipe" CHOST="i586-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -mtune=k6-2 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distlocks sandbox sfperms strict" GENTOO_MIRRORS="ftp://mirrors.tds.net/gentoo ftp://cs.ubishops.ca/pub/gentoo ftp://sunsite.ualberta.ca/pub/unix/Linux/gentoo/ ftp://ftp.gtlib.cc.gatech.edu/pub/gentoo ftp://csociety-ftp.ecn.purdue.edu/pub/gentoo/ ftp://mirror.iawnet.sandia.gov/pub/gentoo/ ftp://ftp.ussg.iu.edu/pub/linux/gentoo ftp://ftp.ucsb.edu/pub/mirrors/linux/gentoo/ ftp://gentoo.chem.wisc.edu/gentoo/ ftp://gentoo.mirrors.pair.com/ ftp://gentoo.ccccom.com http://mirror.clarkson.edu/pub/distributions/gentoo/ ftp://ftp.ndlug.nd.edu/pub/gentoo/" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="x86 3dnow X aac acl alsa apache2 apm avi berkdb bitmap-fonts bzip2 caps cdr crypt curl divx4linux dvd emboss encode exiscan-acl flac foomaticdb gif gphoto2 gpm gstreamer gtk gtk2 imagemagick imlib ipv6 jpeg lcms libg++ libwww live mailwrapper mmx mng motif mp3 ncurses nls nptl objc ogg oggvorbis opengl openssl pam pdflib perl png python quicktime readline rtc spell ssl tcpd threads tiff truetype truetype-fonts type1-fonts unicode vorbis win32codecs xinetd xml2 xmms xprint xv zlib userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
You should run revdep-rebuild if you have problems after unmerging a library. Re-emerge dev-libs/apr-util.
I did run 'revdep-rebuild -pv'. dev-libs/apr-util was not on the list (perl, apache and subversion were) as the system had the -gdbm USE flag set long before I removed gdbm. Apparently, some gdbm setup info was captured by apr-util regardless of the flag setting, which revdep-rebuild was not built to detect.