[Python-Dev] Re: making dbmmodule still broken

Skip Montanaro skip@pobox.com
Tue, 18 Jun 2002 18:44:40 -0500

    Guido> On my 2yo Mandrake 8.1 (?) system, when I do "make" in the latest
    Guido> CVS tree, I always get an error from building dbmmodule.c:

    Guido> [guido@odiug linux]$ make
    Guido> case $MAKEFLAGS in \
    Guido> *-s*)  CC='gcc' LDSHARED='gcc -shared' OPT='-DNDEBUG -g -O3 -Wall -Wstrict-prototypes' ./python -E ../setup.py -q build;; \
    Guido> *)  CC='gcc' LDSHARED='gcc -shared' OPT='-DNDEBUG -g -O3 -Wall -Wstrict-prototypes' ./python -E ../setup.py build;; \
    Guido> esac
    Guido> running build
    Guido> running build_ext
    Guido> building 'dbm' extension
    Guido> gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I. -I/home/guido/python/dist/src/./Include -I/usr/local/include -I/home/guido/python/dist/src/Include -I/home/guido/python/dist/src/linux -c /home/guido/python/dist/src/Modules/dbmmodule.c -o build/temp.linux-i686-2.3/dbmmodule.o
    Guido> /home/guido/python/dist/src/Modules/dbmmodule.c:25: #error "No ndbm.h available!"
    Guido> running build_scripts
    Guido> [guido@odiug linux]$

    Guido> There's an ndbm.h is in /usr/include/db1/ndbm.h

    Guido> Skip, didn't you change something in this area recently?  I think
    Guido> it's still busted. :-(

Hmmm...  Works on my Mandrake 8.1 system.  I have the db2-devel-2.4.14-5mdk
package installed, which provides /usr/lib/libndbm.{a,so}.

Note that you probably don't want to use /usr/include/db1/ndbm.h because you
will wind up using is the broken Berkeley DB 1.85 hash file implementation.
One of the two major goals of the change I checked in recently was to
deprecate BerkeleyDB 1.85.  Do you not have an ndbm or gdbm implementation
on your system?

If you don't have an acceptable set of libraries/include files it shouldn't
try building the module at all.  It looks like the else: branch

                exts.append( Extension('dbm', ['dbmmodule.c']) )

should probably be removed.

I'll take another look at the problem again Wednesday.  I am offline at the
moment and can't "cvs up" (the modem here at the North Beach Inn shares a
phone line with the credit card machine and it's the dinner hour... :-)