Installing SpamAssassin on Solaris 2.5.1

Solaris 2.5 does not include the snprintf and vsnprintf functions, causing problems when building SpamAssassin's spamc:

make -f spamc/Makefile spamc/spamc
gcc  -g -O2 spamc/spamc.c spamc/libspamc.c spamc/utils.c \
        -o spamc/spamc   -ldl -lnsl -lsocket
Undefined                       first referenced
 symbol                             in file
snprintf                            /var/tmp//cczWSH2W.o
vsnprintf                           /var/tmp//cczWSH2W.o
ld: fatal: Symbol referencing errors. No output written to spamc/spamc
collect2: ld returned 1 exit status
*** Error code 1
make: Fatal error: Command failed for target `spamc/spamc'
Current working directory /.cpan/build/Mail-SpamAssassin-3.0.0
*** Error code 1
make: Fatal error: Command failed for target `spamc/spamc'

As a workaround, you may build and install snprintf.c, and modify spamc's Makefile to include the snprintf library.

1. Download snprintf.c

2. Build and install snprintf.o.

gzip -cd snprintf_source.tar.gz | tar xvf -
cd snprintf_source_directory
su root -c "cp snprintf.o /usr/lib"

3. Modify spamc's Makefile to reference the snprintf.o library.

cd SpamAssassin_source_directory
sed 's/LIBS = -ldl -lnsl -lsocket/LIBS = -ldl -lnsl -lsocket -lsnprintf/' spamc/Makefile \
   > spamc/
mv spamc/ spamc/Makefile

4. Build and install SpamAssassin.

perl Makefile.PL
make install

Back to
Last modified: 10/6/2004