SUMMARY: compiling sendmail under solaris 2.6 with BerkDB

From: Dan Simoes (
Date: Fri Apr 16 1999 - 01:12:23 CDT

I got many replies, most pointing me to -ldb.
I ended up adding the library and include path, as well as -ldb
directly to the makefile. The below approach seems
like the most appropriate though.

Thanks for all the replies!

| Dan |

Forwarded message:
>From wally.winzer@ChampUSA.COM Tue Apr 13 22:04:50 1999
X-UIDL: 1d9edafb7c2c0784558c154284966f5d
Message-Id: <3713F7BE.9303CF79@ChampUSA.COM>
Date: Tue, 13 Apr 1999 19:04:46 -0700
From: "Auteria Wally Winzer Jr." <wally.winzer@ChampUSA.COM>
Organization: Champion Nutrition
X-Mailer: Mozilla 4.51 [en] (Win95; U)
X-Accept-Language: en
Mime-Version: 1.0
To: Dan Simoes <>
Subject: Re: sendmail compile help needed
References: <>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

This is what you need to do to compile sendmail-8.9.3 w/BerkeleyDB 2.7.3-BETA.:

1. untar a clean src tarball of sendmail.8.9.3.tar.gz.
2. Create a site.config.m4 file under BuildTools/Site directory. Do this by
    cd into BuildTools/OS. There will be a SunOS.5.6 sample site.config file.
3. Copy that sample site.config file to BuildTools/Site directory and rename
    it to site.config.m4. Modify the file to suit your taste.

Here's a sample of my site.config.m4 file:

# @(#)SunOS.5.6 8.10 (Alameda) 4/01/1999
define(`confCC', `gcc')
define(`confOPTIMIZE', `-g -O3')
define(`confBEFORE', `sysexits.h')
define(`confENVDEF', `-DSOLARIS=20600 ')
define(`confINCDIRS', `-I/usr/local/BerkeleyDB/include')
define(`confLIBS', `-lsocket -lnsl -lkstat -lresolv -lelf -lwrap -L/usr/local/BerkeleyDB/lib -ldb')
define(`confMBINDIR', `/usr/lib')
define(`confEBINDIR', `/usr/lib')
define(`confSBINGRP', `sys')
define(`confSTDIR', `/etc/mail')
define(`confHFDIR', `/etc/mail')
define(`confINSTALL', `${BUILDBIN}/')
define(`confDEPEND_TYPE', `CC-M')
        if [ -r /usr/include/sysexits.h ]; \
        then \
                ln -s /usr/include/sysexits.h; \

Notice the lines "define(`confINCDIRS', `-I/usr/local/BerkeleyDB/include')"
and "define(`confLIBS', `-lsocket -lnsl -lkstat -lresolv -lelf -lwrap -L/usr/local/BerkeleyDB/lib -ldb')".
Make sure the line is exactly as shown, or if you wish to you my site.config.m4
file, then do so. Make sure you have tcp_wrappers installed (libwrap.a), GNU m4
(gm4), and BerkeleyDB-2.7.3-BETA (-ldb). If you don't have tcp_wrappers
installed just remove the -DTCPWRAPPERS. Also, if you're not running
Also make sure you have groff in place (GNU roff)

NOTE: If you use the above site.config.m4 file, IT'LL WORK! TRUST ME!

cd into sendmail-8.9.3/src
./Build -c (this will remove a pre-existing obj.* directory and create a new dir
with the latest macros defined.
./Build -n install (check to see where things are placed only, no actual installation)
If you're satisfied with everything:
./Build install

Create your file, and you're all set!

Dan Simoes wrote:

> I give up. I've searched all over and this is a common
> problem, but no solution...
> Solaris 2.6, latest gcc, latest sendmail, latest BerkeleyDB.
> Compile fails with:
> gcc -o sendmail -L/usr/local/BerkeleyDB/lib alias.o arpadate.o clock.o collect.o conf.o control.o convtime.o daemon.o deliver.o domain.o envelope.o err.o headers.o macro.o main.o map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o safefile.o savemail.o snprintf.o srvrsmtp.o stab.o stats.o sysexits.o trace.o udb.o usersmtp.o util.o version.o -lresolv -lsocket -lnsl -lkstat
> Undefined first referenced
> symbol in file
> db_open map.o
> ld: fatal: Symbol referencing errors. No output written to sendmail
> make: *** [sendmail] Error 1
> Many people have had this problem as documented in comp.mail.sendmail
> but I don't see any fix.
> I tried several variants on the Build script and finally resorted
> to dealing directly with the makefile:
> INCDIRS= -I/usr/local/BerkeleyDB/include
> LIBDIRS= -L/usr/local/BerkeleyDB/lib
> If you've run across a solution for this and can share,
> I'd really appreciate it. Thanks!
> | Dan |

Dan Simoes                      
MCIWorldcom Advanced Networks
100 Manhattanville Road, Suite 5        (914) 701-5378 (voice)
Purchase, NY 10577                      (914) 701-5310 (fax)

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:13:18 CDT