Re: Is dbm module missing?

Guido.van.Rossum@cwi.nl
Mon, 15 Aug 1994 22:57:02 +0200

Thomas:
> > Is the "dbm" module not properly linked into the current version
> > of Python? I've tried using "dbm.open(...)" and the interpreter
> > complains about the name "dbm". I looked at the Makefile in
> > the Modules/ directory, and the dbm code sure doesn't look like
> > it gets put in the library....

me:
> Look in the Modules/Setup file -- I bet the line for dbm is commented
> out.

Thomas:
> Yes, that is right. Though I had to change a couple of things
> to get it to link properly. I am running UnixWare 1.1, and I
> had to change the Modules/Makefile. Here is the change:
>
> old:
> LIBS = -ldl -lsocket -lnsl -ldl -lsocket -lnsl
> new:
> LIBS = -ldl -lsocket -lnsl -ldl -lsocket -lnsl -L /usr/ucblib -lucb
>
> old:
> dbmmodule.o: $(srcdri)/dbmmodule.c; $(CC) $(CFLAGS) - $(srcdir)/dbmmodule.c
> new:
> dbmmodule.o: $(srcdri)/dbmmodule.c; $(CC) $(CFLAGS) -c -I /usr/ucbinclude $(srcdir)/dbmmodule.c
>
> This is because ndbm is in the ucb compatibility stuff, but I compile
> the rest of python as SVR4.
>
> I realize that the Makefile isn't the right place to make this change.

You can add -I, -L and -l options to the line in the Setup file and
the makesetup script will distribute them correctly over the Makefile.

This is the "official" way to do it -- it just isn't possible to let
the configure script work out how to compile and link for each
optional module on each UNIX variant... :-(

--Guido van Rossum, CWI, Amsterdam <Guido.van.Rossum@cwi.nl>
<URL:http://www.cwi.nl/cwi/people/Guido.van.Rossum.html>