The python ebuild fails to fully disable building against gdbm when the USE-flag is turned off. This is evidenced by it hitting a bug that crops up when building with the gdbm USE-flag, even after that flag is turned off. The dbm_extension is built even when -gdbm is used. This was found in an embedded uclibc environment, but the python issue seems totally unrelated. I will attempt to reproduce on a more typical box if that would be useful, please let me know. emerge --info: Portage 2.1_pre3-r1 (uclibc/x86/2.4, gcc-3.4.5, uclibc-0.9.28-r0, 2.6.12-morph7 i686) ================================================================= System uname: 2.6.12-morph7 i686 Intel(R) Pentium(R) 4 CPU 3.00GHz Gentoo Base System version 1.12.0_pre15 dev-lang/python: 2.4.2 sys-apps/sandbox: 1.2.17 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-r1 sys-devel/binutils: 2.16.1-r1 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.4.26-r1 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CBUILD="i686-gentoo-linux-uclibc" CFLAGS="-march=pentium4 -Os -pipe" CHOST="i686-gentoo-linux-uclibc" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/splash /etc/terminfo /etc/env.d" CXXFLAGS="-march=pentium4 -Os -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distlocks nodoc noinfo noman sandbox sfperms" GENTOO_MIRRORS=" http://distfiles.gentoo.org" MAKEOPTS="-j3" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage" USE="x86 acpi berkdb bitmap-fonts bzip2 cdr dvd expat jpeg minimal mmx ncurses pam perl png python readline sse sse2 ssl threads truetype truetype-fonts type1-fonts uclibc unicode zlib elibc_uclibc kernel_linux userland_GNU" Unset: ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS
I had some trouble understanding what exactly the problem is, but it seems that you were unhappy that python is built with a dbm module even use the gdbm USE flag is disabled. AFAIK python is always built with some sort of minimal dbm support, even if gdbm and berkeleydb support are not compiled in. For example, on Unix you will always have a dumbdbm module. If Python is truly compiled with gdbm support there should be a 'gdbm' module, so I suggest you check that. I'm not sure if that answers your problem... also, I am not a Gentoo (or Python) developer, so by no means is my understanding of this authoritative.
actually, if this is true, it's a valid bug. we have a USE="build" flag which basically strips out all the linkage to external libraries (such as libdb, libgdbm, etc). we need some more information to go on, for instance, the whole compile log and other relevant information. as far as i know, the minimal build has been working otherwise we would be getting complaints from the stagers.
I don't know if it is related to this or not but building python-2.4.3-r4 with USE="berkdb ncurses readline ssl tk ucs2 -bootstrap -build -doc -gdbm -ipv6 -nocxx" in a box with gdbm installed yields a /usr/lib64/python2.4/lib-dynload/dbm_failed.so file linked with libgdbm.so.3 as you can see from: # ldd /usr/lib64/python2.4/lib-dynload/dbm_failed.so libgdbm.so.3 => /usr/lib/libgdbm.so.3 (0x00002b3b567fa000) libpthread.so.0 => /lib/libpthread.so.0 (0x00002b3b568ff000) libc.so.6 => /lib/libc.so.6 (0x00002b3b56a15000) /lib64/ld-linux-x86-64.so.2 (0x0000555555554000) It just doesn't feel right. # emerge --info Portage 2.1.1-r1 (default-linux/amd64/2006.1/desktop, gcc-4.1.1, glibc-2.4-r3, 2.6.18-gentoo x86_64) ================================================================= System uname: 2.6.18-gentoo x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 4600+ Gentoo Base System version 1.12.5 Last Sync: Wed, 18 Oct 2006 08:00:01 +0000 distcc 2.18.3 x86_64-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled] ccache version 2.3 [enabled] app-admin/eselect-compiler: [Not Present] dev-java/java-config: 1.3.7, 2.0.30 dev-lang/python: 2.4.3-r4 dev-python/pycrypto: 2.0.1-r5 dev-util/ccache: 2.3 dev-util/confcache: [Not Present] sys-apps/sandbox: 1.2.17 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-r2 sys-devel/binutils: 2.16.1-r3 sys-devel/gcc-config: 1.3.13-r4 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="amd64" AUTOCLEAN="yes" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=k8 -O3 -pipe -fomit-frame-pointer" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config" CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo" CXXFLAGS="-march=k8 -O3 -pipe -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs autoconfig ccache collision-protect distcc distlocks fixpackages metadata-transfer sandbox sfperms strict test userfetch userpriv usersandbox" GENTOO_MIRRORS="http://pandemonium.tiscali.de/pub/gentoo/ http://gentoo.mirror.solnet.ch http://gentoo.inode.at/ http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ http://ftp.snt.utwente.nl/pub/os/linux/gentoo http://ftp.du.se/pub/os/gentoo" LC_ALL="it_IT.UTF-8" LINGUAS="it" MAKEOPTS="-j11" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage /usr/portage/local/layman/vmware" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="amd64 X Xaw3d a52 aalib acpi alsa arts audiofile bash-completion berkdb bitmap-fonts bluetooth bzip2 cairo caps cdparanoia cdr cli cracklib crypt cups curl dbus dga dio dlloader dri dvd dvdr dvdread elibc_glibc emboss encode exif expat fam fbcon ffmpeg fftw firefox flac foomaticdb fortran ftp gd ggi gif glut gmp gnutls gphoto2 gpm gstreamer gtk2 hal idn imagemagick imlib input_devices_evdev input_devices_joystick input_devices_keyboard input_devices_mouse isdnlog java javascript jbig jikes joystick jpeg jpeg2k kde kdeenablefinal kernel_linux lcms libcaca libg++ linguas_it lm_sensors lua mad maildir matroska mikmod mng motif mozilla mp3 mpeg mpi ncurses nls nptl nptlonly nsplugin offensive ogg openal opengl oss pam pcre pdf perl png posix ppds pppd python qt3 quicktime readline reflection samba sasl scanner sdl session sockets sox speex spell spl ssl svg symlink sysvipc tcl tcltk tcpd theora threads tiff tk truetype truetype-fonts type1-fonts udev unicode usb userland_GNU v4l vcd video_cards_fglrx videos vorbis wmf xine xml xml2 xorg xosd xpm xv xvid zlib" Unset: CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Works fine in 2.4.4-r1.