Dear Post
Building Berkeley DB from source, and building Postfix according to
*Postfix Berkeley DB Howto* [1] with
make makefiles CCARGS="-DHAS_DB
-I/scratch/local2/berkeley-db/include"
AUXLIBS="-L/scratch/local2/berkeley-db/lib -ldb"
running `make upgrade`, I am getting the error below.
```
SHLIB_ENV_VAR= SHLIB_ENV_VAL= \
shlib_directory=${shlib_directory:-` bin/postconf -dhx
shlib_directory`} /bin/sh \
postfix-install -non-interactive
bin/postconf: error while loading shared libraries: libdb-5.3.so: cannot
open shared object file: No such file or directory
bin/postconf: error while loading shared libraries: libdb-5.3.so: cannot
open shared object file: No such file or directory
bin/postconf: error while loading shared libraries: libdb-5.3.so: cannot
open shared object file: No such file or directory
bin/postconf: error while loading shared libraries: libdb-5.3.so: cannot
open shared object file: No such file or directory
bin/postconf: error while loading shared libraries: libdb-5.3.so: cannot
open shared object file: No such file or directory
bin/postconf: error while loading shared libraries: libdb-5.3.so: cannot
open shared object file: No such file or directory
bin/postconf: error while loading shared libraries: libdb-5.3.so: cannot
open shared object file: No such file or directory
bin/postconf: error while loading shared libraries: libdb-5.3.so: cannot
open shared object file: No such file or directory
bin/postconf: error while loading shared libraries: libdb-5.3.so: cannot
open shared object file: No such file or directory
bin/postconf: error while loading shared libraries: libdb-5.3.so: cannot
open shared object file: No such file or directory
bin/postconf: error while loading shared libraries: libdb-5.3.so: cannot
open shared object file: No such file or directory
bin/postconf: error while loading shared libraries: libdb-5.3.so: cannot
open shared object file: No such file or directory
bin/postconf: error while loading shared libraries: libdb-5.3.so: cannot
open shared object file: No such file or directory
bin/postconf: error while loading shared libraries: libdb-5.3.so: cannot
open shared object file: No such file or directory
bin/postconf: error while loading shared libraries: libdb-5.3.so: cannot
open shared object file: No such file or directory
bin/postconf: error while loading shared libraries: libdb-5.3.so: cannot
open shared object file: No such file or directory
bin/postconf: error while loading shared libraries: libdb-5.3.so: cannot
open shared object file: No such file or directory
```
Specifying the runtime library path and running
LD_LIBRARY_PATH=/scratch/local2/berkeley-db/lib make upgrade
gets rid of these errors.
So, should I add the directory to the runtime library search path at
build time?
make makefiles CCARGS="-DHAS_DB
-I/scratch/local2/berkeley-db/include"
AUXLIBS="-L/scratch/local2/berkeley-db/lib -ldb
-Wl,-rpath,/scratch/local2/berkeley-db/lib"
The instructions for Solaris seem to do that
AUXLIBS="-R/usr/local/BerkeleyDB/lib -L/usr/local/BerkeleyDB/lib -ldb"
but it fails:
gcc -I. -I../../include -DHAS_DB
-I/scratch/local2/berkeley-db/include -DHAS_DEV_URANDOM -DHAS_PCRE
-DSNAPSHOT -UUSE_DYNAMIC_LIBS -DDEF_SHLIB_DIR=\"no\" -UUSE_DYNAMIC_MAPS
-Wmissing-prototypes -Wformat -Wno-comment -fno-common -g -O -I.
-I../../include -DLINUX5 -o master master.o master_conf.o master_ent.o
master_sig.o master_avail.o master_spawn.o master_service.o
master_status.o master_listen.o master_vars.o master_wakeup.o
master_watch.o master_flow.o master_monitor.o ../../lib/libglobal.a
../../lib/libutil.a -R/scratch/local2/berkeley-db/
-L/scratch/local2/berkeley-db/lib -ldb -lpcre -lnsl -lresolv -ldl
-licui18n -licuuc -licudata
gcc: error: unrecognized command line option ‘-R’
ld(1) says `-R` is treated as `-rpath`, so I guess `-Wl` is needed, so
it’s passed to the linker.
Kind regards,
Paul
[1]: http://www.postfix.org/DB_README.html#no_db