[Python-Dev] Distutils confuses Berkeley DB and dbm?

Skip Montanaro skip@pobox.com
Thu, 30 May 2002 20:12:46 -0500

Would someone on Linux please try the following:

    import dbm
    f = dbm.open("foo", "c")
    f["1"] = "1"

then ask the file command what kind of file it is.  On my system it tells me
the file is a Berkeley DB 1.85 hash file.  I figure that distutils is
getting ahold of the libdb dbm-compatibility include files and libraries and
using them.  On my system, the only ndbm.h is in /usr/include/db1.  Here's
how the dbm module builds on my system:

    building 'dbm' extension
    gcc -DNDEBUG -O3 -fPIC
    -I. -I/home/skip/src/python/head/dist/src/./Include -I/usr/local/include \
    -IInclude/ -c /home/skip/src/python/head/dist/src/Modules/dbmmodule.c -o \
    gcc -shared build/temp.linux-i686-2.3/dbmmodule.o -L/usr/local/lib -ldb1 \
    -o build/lib.linux-i686-2.3/dbm.so 

I know there is a bug report open about something related to building
Berkeley DB-based modules, but I'm offline at the moment so I can't check
it.  Barry, were you going to look at this?  How about a little
collaboration?  I think I'm mostly responsible for what distutils does as
far as building bsddb.