Search path for Berkeley DB linkage

Julien ÉLIE julien at
Sat Oct 1 14:09:47 UTC 2011

Hi all,

I am a bit puzzled by how DB_LDFLAGS and DB_LIBS are used
in our source code.  They seem to be properly set in STORAGE_LIBS;
and used at link time for our libraries.

The issue I am facing is that when I want to run innd, I obtain:

./innd: error while loading shared libraries: cannot open shared object file: No such file or directory

Yet, I have in

DB_CPPFLAGS     = -I/home/iulius/autobuild/bin/db-5.2.36/include
DB_LDFLAGS      = -L/home/iulius/autobuild/bin/db-5.2.36/lib
DB_LIBS         = -ldb -lz

DBM_CPPFLAGS    = -I/home/iulius/autobuild/bin/db-5.2.36/include
DBM_LIBS        = -L/home/iulius/autobuild/bin/db-5.2.36/lib -ldb

** Note that if I set to /home/iulius/autobuild/bin/db-5.2.36/lib
in my environment variables, innd properly starts.
That is why I assume something is missing in one of a link done
at build time.

A search for DB_CPPFLAGS/DBM_CPPFLAGS returns:

In authprogs, ckpasswd:

ckpasswd: ckpasswd.o $(LIBAUTH) $(LIBINN)
        $(LINK) ckpasswd.o $(CK_LIBS) $(AUTH_LIBS)

Seems OK.

frontends/Makefile:	$(CC) $(CFLAGS) $(DB_CPPFLAGS) -c $<
frontends/Makefile:	$(CC) $(CFLAGS) $(DB_CPPFLAGS) -c $<
frontends/Makefile:	$(CC) $(CFLAGS) $(DB_CPPFLAGS) -c $<
frontends/Makefile:	$(CC) $(CFLAGS) $(DB_CPPFLAGS) -c $<

for ovdb_init.o, ovdb_monitor.o, ovdb_server.o and ovdb_stat.o

which are properly linked:

ovdb_init:      ovdb_init.o    $(BOTH)   ; $(LINK) ovdb_init.o    $(STORELIBS)
ovdb_monitor:   ovdb_monitor.o $(BOTH)   ; $(LINK) ovdb_monitor.o $(STORELIBS)
ovdb_server:    ovdb_server.o  $(BOTH)   ; $(LINK) ovdb_server.o  $(STORELIBS)
ovdb_stat:      ovdb_stat.o    $(BOTH)   ; $(LINK) ovdb_stat.o    $(STORELIBS)

In storage/Makefile:

.c.o .c.lo:
        $(LIBCC) $(CFLAGS) $(CCOUTPUT)

And everything is linked with $(STORAGE_LIBS) in libstorage:

ovtest: ov.c libstorage.$(EXTLIB) $(LIBINN)
        $(CC) $(CFLAGS) -D_TEST_ -o ovtest ov.c \
            libstorage.$(EXTLIB) $(LIBINN) $(STORAGE_LIBS) $(LIBS) $(OBJECTS) $(LIBINN)
        $(LIBLD) $(LDFLAGS) -o $@ $(LOBJECTS) \
            $(LIBINN) $(STORAGE_LIBS) $(LIBS) \
            -rpath $(PATHLIB) -version-info 2:0:0

libstorage.a: $(OBJECTS)
        ar r $@ $(OBJECTS)
        $(RANLIB) libstorage.a

Apart from these three points, I do not see what could generate the issue.
Is there something I am missing in the use of our build system for linkage?

I can of course set LD_LIBRARY_PATH in my environment variables but I doubt
it is the best thing to do (especially when I used the proper --enable-berkeleydb
flag at configure time).

Julien ÉLIE

« – Où vous croyez-vous ici ?
  – Où je me trouve, je sais. » (Astérix)

More information about the inn-workers mailing list