Building Python with gdbm support

E

Ed

I am trying to use a Perl script which requires a Database module other
than "dbm" to be the default Mod. So, what the script is checking is

import anydbm
if (anydbm._defaultmod.__name__ == 'dumbdbm'
or anydbm._defaultmod.__name__ == 'dbm'):

First of, I'm doing this on a Sparc/Solaris 8 box.

So, I'm trying to get gdbm to be the default mod. I've downloaded and
built gdbm-1.8.3. It has not been build to /usr (I don't have root
access). I've built this fine.

When I build Python 2.4.1, it at first doesn't pick up on the gdbm
module ("dbm" is still the default module, and Modules directory in the
Python source doesn'thave a .o file for the gdbmmodule file).

I've nosed around, and found the a line commented out Modules/Setup
file, regarding building the gdbm module. I uncommented it (being sure
that the approrpiate directories for the .h and lib files are
provided), and it looked like it built the module. But when I attempt
to start python, I get an error:

ld.so.1: python: fatal: libgdbm.so.3: open failed: No such file or
directory
Killed


Look, the bottom line is I don't know what the correct steps are to get
the gdbm module built in as part of the Python installation (as well as
setting it as the default database module). I've tried to piece
together bits and pieces of various newsgroup messages, as I haven't
found a decent spot for any doco.

Can anyone point me in the right direction, in regards to how to get my
Python installation set up the way I want?

Is it correct to edit the Modules/Setup file? I would have thought
that the configure approach would support these types of isses, rather
than manually editing a file? Should I be using the setup.py script?
I have no idea what that does, or where I would call it, but the name
of it sounds like it should be included?

Thanks for any help,
Ed
 
E

Ed

I've actually sorted myself out. I updated Modules/Setup.dist, so that
it has the following line...

gdbm gdbmmodule.c -I/ct/ctapp/gnu/bin/gdbm-1.8.3/include
-L/ct/ctapp/gnu/bin/gdbm-1.8.3/lib -lgdbm

Rebuilt everything in Python. I also had to ensure that my environment
using the newly-built Python contained the gdbm/lib directory in it's
LD_LIBRARY_PATH (the same value as what's passed to -L in the above
line).

I'm assuming this is alright. I guess if I change anything, I have to
remember to update Setup.dist. If I'm missing a step, or if there's an
easier way, I'm all ears... :)

Thanks,
Ed
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top