Nagios/CVS HEAD compilation issues on Solaris (nanosleep patch)

Joe Rhett jrhett at isite.net
Sat Nov 22 23:20:08 CET 2003


gcc -g -O2 -I/opt/imagelib/include -DHAVE_CONFIG_H -DNSCORE -o nagios nagios.c broker.o nebmods.o checks.o config.o commands.o events.o flapping.o logging.o notifications.o sehandlers.o utils.o retention-base.o xretention-base.o comments-base.o xcomments-base.o objects-base.o xobjects-base.o statusdata-base.o xstatusdata-base.o perfdata-base.o xperfdata-base.o downtime-base.o xdowntime-base.o    -L/opt/imagelib/lib  -lm -lnsl -lsocket -lpthread -ldl 
Undefined                       first referenced
 symbol                             in file
nanosleep                           events.o
ld: fatal: Symbol referencing errors. No output written to nagios
collect2: ld returned 1 exit status

To get nanosleep on Solaris, so you have to link with -lrt.
(it's also in -lposix4, but will be removed in future versions)
This should be tested for by autoconf.

I was prepared to provide an autoconf patch, but configure.ac was not
included in the CVS sources.  However, something like this is probably all 
that is needed. 

AC_SEARCH_LIBS(nanosleep, [rt], [posix4], [], [
	echo "nanosleep() required for timing operations."
	exit 1
])


-- 
Joe Rhett                                                      Chief Geek
JRhett at Isite.Net                                      Isite Services, Inc.


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/




More information about the Developers mailing list