problems (with solution) building latest snapshot on Solaris

Charles Jones jonescr at cisco.com
Fri Nov 4 15:19:17 CET 2005


Just for fun I grabbed the latest snapshot and tried to compile it on my 
Solaris10 server at home. I ran into a couple of problems which I was 
able to fix.  Long gory details below, quick summary at the bottom.

I configured with all default options, except no to LDAP.  Here's the 
results:

[hobbit at ultra5 snapshot]$ make
CC="gcc" CFLAGS="-g -O2 -Wall -Wno-unused -D_REENTRANT -DSunOS -I. 
-I`pwd`/include -I/usr/local/include" OSDEF="-DSunOS" RPATHOPT="" 
PCREINCDIR="-I/usr/local/include" SSLFLAGS="-DBBGEN_SSL" 
SSLINCDIR="-I/usr/local/ssl/include " SSLLIBS="-L/usr/lib -lssl 
-lcrypto" NETLIBS="-lresolv -lsocket -lnsl" BBTOPDIR="/home/hobbit" 
BBLOGDIR="/var/log/hobbit" BBHOSTNAME="ultra5" BBHOSTIP="192.168.0.103" 
BBHOSTOS="sunos" make -C lib all
make[1]: Entering directory `/home/hobbit/snapshot/lib'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/hobbit/snapshot/lib'
CC="gcc" CFLAGS="-g -O2 -Wall -Wno-unused -D_REENTRANT -DSunOS -I. 
-I`pwd`/include -I/usr/local/include" RPATHOPT="" SSLFLAGS="-DBBGEN_SSL" 
SSLINCDIR="-I/usr/local/ssl/include " SSLLIBS="-L/usr/lib -lssl 
-lcrypto" NETLIBS="-lresolv -lsocket -lnsl" BBHOME="/home/hobbit/server" 
make -C common all
make[1]: Entering directory `/home/hobbit/snapshot/common'
gcc -g -O2 -Wall -Wno-unused -D_REENTRANT -DSunOS -I. 
-I/home/hobbit/snapshot/include -I/usr/local/include -o bbhostgrep 
bbhostgrep.o ../lib/libbbgen.a
Undefined                       first referenced
 symbol                             in file
recv                                ../lib/libbbgen.a(sendmsg.o)
getservbyname                       ../lib/libbbgen.a(sendmsg.o)
gethostbyname                       ../lib/libbbgen.a(sendmsg.o)
socket                              ../lib/libbbgen.a(sendmsg.o)
getsockopt                          ../lib/libbbgen.a(sendmsg.o)
connect                             ../lib/libbbgen.a(sendmsg.o)
inet_aton                           ../lib/libbbgen.a(sendmsg.o)
inet_ntoa                           ../lib/libbbgen.a(sendmsg.o)
shutdown                            ../lib/libbbgen.a(sendmsg.o)
ld: fatal: Symbol referencing errors. No output written to bbhostgrep
collect2: ld returned 1 exit status
make[1]: *** [bbhostgrep] Error 1
make[1]: Leaving directory `/home/hobbit/snapshot/common'
make: *** [common-build] Error 2

These errors are typical of missing networking libraries 
(resolv,socket,nsl), so I checked the Makefile and added $(NETLIBS) to 
snapshot/common/Makefile

bbhostgrep: $(HOSTGREPOBJS) ../lib/libbbgen.a
        $(CC) $(CFLAGS) -o $@ $(HOSTGREPOBJS) ../lib/libbbgen.a *$(NETLIBS)*

I then did a "make clean" and ran make again. This time I get this error:

make[1]: Leaving directory `/home/hobbit/snapshot/common'
CC="gcc" CFLAGS="-g -O2 -Wall -Wno-unused -D_REENTRANT -DSunOS -I. 
-I`pwd`/include -I/usr/local/include" BBHOME="/home/hobbit/client" 
BBHOSTIP="192.168.0.103" LOCALCLIENT="" make -C client all
make[1]: Entering directory `/home/hobbit/snapshot/client'
cat hobbitclient.cfg.DIST | sed -e's!@BBHOSTIP@!192.168.0.103!g' 
 >hobbitclient.cfg
make[1]: *** [hobbitclient.cfg] Error 2
make[1]: Leaving directory `/home/hobbit/snapshot/client'
make: *** [client] Error 2

I checked to see if /home/hobbit/snapshot/client/hobbitclient.cfg was 
created, and it was, but zero bytes.
So, I checked the hobbitclient.cfg.DIST to make sure it had data in it 
and it did, I then I decided to check the sed command being used:
 "sed -e's!@BBHOSTIP@!192.168.0.103!g'". 

The syntax of that looks correct but when I tried it on the command 
line, it didn't work! So then I grepped for sed in all of the Makefiles, 
and found many usages of sed, but all the others had one difference, *a 
space after the -e option*. I changed the sed commands in 
snapshot/client/Makefile to have a space after the "-e" option, did a 
make clean; make; and now it compiled smoothly.

--- Summary ---
So, to summarize, for Solaris compatibility in the latest snapshot, 
please add the netlibs to the snapshot/common/Makefile, and correct the 
spacing of the sed command options in snapshot/client/Makefile.

-Charles
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20051104/b759ff3f/attachment.html>


More information about the Xymon mailing list