[milters] Archive

Lists Index Date Thread Search

Article: 948
From: Barry Quiel
Date: 2006-05-30 02:10:17 -0400
Subject: Re: Building milter-sender BerkeleyDB

Removal...........: milters-request@milter.info?subject=remove
More information..: http://www.milter.info/#Support
--------------------------------------------------------

Here is the configure line for libmilter:

./configure --with-db=/usr/local/BerkeleyDB.4.2
LibSnert/1.60.816
Copyright 1996, 2006 by Anthony Howe. All rights reserved.

   Platform..........: SunOS gcc
   pthread & mutex...: yes yes
   Semaphore.........: POSIX_API
   Shared Memory.....: POSIX_API
   Time..............: POSIX_API
   Berkeley DB.......: 4.2
   libmilter.........: yes
   CFLAGS............: -D_REENTRANT -I 
/usr/local/BerkeleyDB.4.2/include/. -g -I${top_srcdir}/../../include
   LDFLAGS...........: -L /usr/local/BerkeleyDB.4.2/lib/. 
-L${top_srcdir}/../../lib
   LIBS..............: -lmilter -lpam -lresolv -lsocket -lnsl -lrt 
-lpthread -ldb-4.2 -ldl

libmilter builds fine.

Here is the configure line for milter-sender:
  export LDFLAGS="-R /usr/local/BerkeleyDB.4.2/lib/."
  ./configure --enable-run-user=smmsp --enable-run-group=smmsp 
--with-db=/usr/local/BerkeleyDB.4.2
milter-sender/1.10.904
Copyright 2002, 2006 by Anthony Howe. All rights reserved.

   Platform..............: SunOS gcc
   LibSnert..............: yes
   --prefix..............: /usr/local
   --datadir.............: ${prefix}/share
   --localstatedir.......: /var
   --exec_prefix.........: ${prefix}
   --sbindir.............: ${exec_prefix}/sbin
   --libexecdir..........: ${exec_prefix}/libexec
   --enable-run-user.....: smmsp
   --enable-run-group....: smmsp
   --enable-pid..........: /var/run/milter/milter-sender.pid
   --enable-socket.......: /var/run/milter/milter-sender.socket
   --enable-cache-file...: /var/cache/milter-sender.db
   --enable-cache-type...: default
   --with-sendmail.......: /etc/mail
   CFLAGS................:  -D_REENTRANT -I 
/usr/local/BerkeleyDB.4.2/include/. -g -I${top_srcdir}/../../include
   LDFLAGS...............: -R /usr/local/BerkeleyDB.4.2/lib/. -L 
/usr/local/BerkeleyDB.4.2/lib/. -L${top_srcdir}/../../lib
   LIBS..................:  -lsnert -lmilter -lpam -lresolv -lsocket 
-lnsl -lrt -lpthread -ldb-4.2 -ldl

The -R option tells the compiled app to "remember" the path to a 
library.  Instead of reading an LD_LIBRARY_PATH at run-time to link the 
library, the program already knows where it is.  You can specify the -R 
option in LDFLAGS.

One stupid question.  Does it matter if there is a space between -L or 
-R and the path?  I've noticed this is inconsistent in the above output.

Anthony Howe wrote:
> Removal...........: milters-request@milter.info?subject=remove
> More information..: http://www.milter.info/#Support
> --------------------------------------------------------
> 
> Barry Quiel wrote:
>> Trying to build milter-sender 1.10 on Solaris 10 and I can't get it to 
>> link to libdb. When I do a ldd it says file not found for libdb-4.2.so.
>>
>> I used the with-db option and I set a LDFLAGS with a -R option.  I 
>> didn't have any problems when I built .62.837.  And I didn't have to 
>> use a -R option when I built .62.837.
> 
> What does the -R option do?
> 
>> I am building the new version of milter-sender on the same machine 
>> with the same compiler, same environment settings, etc.
>>
>> I really don't want to set an LD_LIBRARY_PATH.  Any suggestions?  Am I 
>> just missing something stupid?
> 
> What did the libsnert ./configure summary report? Typically you say:
> 
>     cd com/snert/src/lib
> 
>     ./configure
> or
>     ./configure --with-db=/path/to/install
> 
>     make clean build
>     cd ../milter-sender
>     ./configure
>     make clean build
>     sudo make install
> 
> If BDB is in /usr/local or /usr, libsnert ./configure should find it. An 
> alternative method is to specify:
> 
>     cd com/snert/src/lib
>     CFLAGS=-I/path/to/includes LDFLAGS=-L/path/to/lib ./configure
> 
>     ...
> 
> 

Lists Index Date Thread Search