[Nagios-devel] common/snprintf is not always built when needed w/fix

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

[Nagios-devel] common/snprintf is not always built when needed w/fix

Post by Guest »

I was building nagios 1.0b5 on a Solaris 2.5.1 machine, and the
build failed in a few places (in base and cgi) because it couldn't
find snprintf().

cgi/Makefile.in had a reference to SNPRINTF_O but not a definition,
base/Makefile.in did not seem to mention it at all.

A suggested patch follows, following the style already used in
contrib/Makefile.in.

Incidentally, there are a number of places in the Makefile.in's
where a binary depends on a number of .c files (e.g. common/objects.c)
which results in those .c's being compiled while linking the binary,
rather than pre-building a separate .o. This means that builds
(and re-builds) take longer, since a number of things get compiled
multiple times. I don't know if it would be worthwhile to go through
and add the necessary rules to make the .o's and adjust the
dependencies.

Cheers! Thanks!

John
jsellens@generalconcepts.com



Index: base/Makefile.in
===================================================================
RCS file: /cvsroot/nagios/nagios/base/Makefile.in,v
retrieving revision 1.3
diff -c -r1.3 Makefile.in
*** base/Makefile.in 29 Jun 2002 19:15:49 -0000 1.3
--- base/Makefile.in 22 Aug 2002 19:12:37 -0000
***************
*** 51,56 ****
--- 51,59 ----
# Extra base code
BASEEXTRALIBS=@BASEEXTRALIBS@

+ # Generated automatically from configure script
+ SNPRINTF_O=@SNPRINTF_O@
+
# Object data
ODATALIBS=$(SRC_COMMON)/objects.c $(SRC_XDATA)/$(XODC)
ODATAHDRS=$(SRC_COMMON)/objects.h $(SRC_XDATA)/$(XODH)
***************
*** 82,88 ****
DDATADEPS=$(DDATALIBS)


! OBJS=checks.o config.o commands.o flapping.o logging.o notifications.o sehandlers.o utils.o $(RDATALIBS) $(CDATALIBS) $(ODATALIBS) $(SDATALIBS) $(PDATALIBS) $(DDATALIBS) $(BASEEXTRALIBS)

nagios: nagios.c $(OBJS) nagios.h $(SRC_COMMON)/locations.h
$(CC) $(CFLAGS) $(LDFLAGS) nagios.c $(OBJS) $(PERLLIBS) $(MATHLIBS) -o $@
--- 85,91 ----
DDATADEPS=$(DDATALIBS)


! OBJS=checks.o config.o commands.o flapping.o logging.o notifications.o sehandlers.o utils.o $(RDATALIBS) $(CDATALIBS) $(ODATALIBS) $(SDATALIBS) $(PDATALIBS) $(DDATALIBS) $(BASEEXTRALIBS) $(SNPRINTF_O)

nagios: nagios.c $(OBJS) nagios.h $(SRC_COMMON)/locations.h
$(CC) $(CFLAGS) $(LDFLAGS) nagios.c $(OBJS) $(PERLLIBS) $(MATHLIBS) -o $@
Index: cgi/Makefile.in
===================================================================
RCS file: /cvsroot/nagios/nagios/cgi/Makefile.in,v
retrieving revision 1.2
diff -c -r1.2 Makefile.in
*** cgi/Makefile.in 29 Jun 2002 19:15:50 -0000 1.2
--- cgi/Makefile.in 22 Aug 2002 19:12:37 -0000
***************
*** 43,48 ****
--- 43,51 ----
XDDC=@XDDC@
XDDH=@XDDH@

+ # Generated automatically from configure script
+ SNPRINTF_O=@SNPRINTF_O@
+
# Object functions
ODATALIBS=$(SRC_COMMON)/objects.c $(SRC_XDATA)/$(XODC)
ODATAHDRS=$(SRC_COMMON)/objects.h $(SRC_XDATA)/$(XODH)





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: jsellens@generalconcepts.com
Locked