To check:
floor:/home/users/nikm# ls -l /usr/lib/libdb* /usr/local/lib/libdb* -rw-r--r-- 1 root root 85154 Jul 12 1997 /usr/lib/libdb.a lrwxrwxrwx 1 root root 15 Jul 16 09:28 /usr/lib/libdb.so -> libdb.so.1.85.4 lrwxrwxrwx 1 root root 15 Jul 16 07:40 /usr/lib/libdb.so.1 -> libdb.so.1.85.4 -rwxr-xr-x 1 root root 58552 Jul 12 1997 /usr/lib/libdb.so.1.85.4 lrwxrwxrwx 1 root root 9 Jul 16 09:27 /usr/lib/libdbm.a -> libgdbm.a lrwxrwxrwx 1 root root 16 Jul 16 09:27 /usr/lib/libdbm.so -> libgdbm.so.1.7.3as you can see, this machine has a shared libdb installed. If you have a static libdb installed, it's probably in /usr/local/lib as libdb.a - that's where I install it on SunOS and other non-linux unix's.
# tar xfz db-2.4.14.tar.gz # rm db-2.4.14.tar.gz # cd db-2.4.14/ # cd build.unix/ # ../dist/configure [...] # make [...] # make installThis should install libdb.a in /usr/local/lib and the header files in /usr/local/include.
# tar xfz sendmail.8.9.1a.tar.gz # rm sendmail.8.9.1a.tar.gz # cd sendmail-8.9.1a # cd src # ./makesendmailmakesendmail may not always work successfully at first, and you may need to tune your Makefile. makesendmail creates a subdirectory called obj.<ostype>.<version>.<arch> ie: on this machine it's called 'obj.Linux.2.0.35.i686'. This machine failed to compile sendmail with the following errors:
# ./makesendmail CC=gcc Configuration: os=Linux, rel=2.0.35, rbase=2, rroot=2.0, arch=i686, sfx= Using M4=/usr/bin/m4 Creating obj.Linux.2.0.35.i686 using ../BuildTools/OS/Linux Making dependencies in obj.Linux.2.0.35.i686 cc -M -I. -DNEWDB *.c >> Makefile map.c:29: db.h: No such file or directory udb.c:28: db.h: No such file or directory make: *** [depend] Error 1 Making in obj.Linux.2.0.35.i686 gcc -O -I. -DNEWDB -c alias.c -o alias.o gcc -O -I. -DNEWDB -c arpadate.c -o arpadate.o gcc -O -I. -DNEWDB -c clock.c -o clock.o gcc -O -I. -DNEWDB -c collect.c -o collect.o gcc -O -I. -DNEWDB -c conf.c -o conf.o gcc -O -I. -DNEWDB -c convtime.c -o convtime.o gcc -O -I. -DNEWDB -c daemon.c -o daemon.o gcc -O -I. -DNEWDB -c deliver.c -o deliver.o gcc -O -I. -DNEWDB -c domain.c -o domain.o gcc -O -I. -DNEWDB -c envelope.c -o envelope.o gcc -O -I. -DNEWDB -c err.c -o err.o gcc -O -I. -DNEWDB -c headers.c -o headers.o gcc -O -I. -DNEWDB -c macro.c -o macro.o gcc -O -I. -DNEWDB -c main.c -o main.o gcc -O -I. -DNEWDB -c map.c -o map.o map.c:29: db.h: No such file or directory make: *** [map.o] Error 1so I need to correct the Makefile INCDIRS path to update it to reflect the appropriate location of the db header files.
# cd obj.Linux.2.0.35.i686/ # vi Makefilenow I change a few things while I'm in here: I change the C compiler from
# C compiler CC= ccto:
# C compiler CC= gccI make sure that MAPDEF is only '-DNEWDB' as any current installation shouldn't really be using anything else.
# define the database mechanisms available for map & alias lookups: # -DNDBM -- use new DBM # -DNEWDB -- use new Berkeley DB # -DNIS -- include NIS support # The really old (V7) DBM library is no longer supported. # See README for a description of how these flags interact. # MAPDEF= -DNEWDBand I updated INCDIRS. In my debian installation of linux, the db header files that come with the shared libdb are in /usr/include/db - look in the following directories for db.h: /usr/include, /usr/include/db, /usr/local/include and /usr/local/include/db
I change:
# include directories INCDIRS=to:
# include directories INCDIRS= -I/usr/include/dbif you're libdb is in /usr/local/lib you need to tell make. Change:
# library directories LIBDIRS=to:
# library directories LIBDIRS= -L/usr/local/liband then check your LIBS line. Different operating systems need different libraries listed here. Generally, if it shows '-lnis' remove that bit, solaris will generally need a bunch of libraries.. normally I have to add -ldb on many systems except linux. My LIBS line is:
# libraries required on your system # delete -l44bsd if you are not running BIND 4.9.x LIBS= -ldbbut other OS's have different requirements. A solaris installation may need a LIBS line like:
# libraries required on your system # delete -l44bsd if you are not running BIND 4.9.x LIBS= -lsocket -lnsl -ldbor maybe:
# libraries required on your system # delete -l44bsd if you are not running BIND 4.9.x LIBS= -lsocket -lnsl -ldb -lkstatit generally depends on the version and installation.
OK, now you've corrected your makefile, run 'make CC=gcc' in the obj* directory:
# pwd /home/source/sendmail-8.9.1a/src/obj.Linux.2.0.35.i686 # make clean [...] # make [...]This should build the sendmail binary. Under SunOS srvrsmtp.c sometimes can fail to compile complaining about strtoul. If this happens to you, edit the makefile and add '-DBROKEN_ANSI_LIBRARY' to ENVDEF ie:
# environment definitions (e.g., -D_AIX3) ENVDEF= -DBROKEN_ANSI_LIBRARYthen do a 'make clean' and a 'make' again.
Sometimes the compile of sendmail will complete, but will then fail trying to build the man pages becaus 'groff' is not installed. This is OK since we are only really looking for the sendmail binary.
When successfully installed, you should have a /usr/lib/sendmail or /usr/sbin/sendmail binary on your system. Generally it's a good idea to delete all your old copies of sendmail once you're satisfied with the new install, especially under SunOS where there are alot of setuid sendmail binaries lying around in /usr/lib (ie: sendmail.mx) - I generally do a: "rm /usr/lib/sendmail*" prior to doing a make install on SunOS.
Check the date of the binary, and if it is freshly installed, move on to configuring sendmail.
:wq