Re: [Nagios-devel] linking issues

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

Re: [Nagios-devel] linking issues

Post by Guest »

This is a multi-part message in MIME format.
--------------040906070309070505050301
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Andreas Ericsson wrote:
> What's the reason for linking in libmath and libnsl?
>
> Insofar as I know no functions in either nagios or any of the cgi's use
> any advanced math and should work well without it.
>

Except for statuswrl.c, which I don't build (meh the stupid). It seems
curious in the base dir though.

> libnsl is another library out of place. Perhaps it's needed by Sun and
> friends. On Linux (Fedora 3, Openwall current, Debian sarge) Nagios
> builds nicely without them, although I know Sun (and some others) have
> huge problems understanding any C-code at all without it. Perhaps -lnsl
> should be linked explicitly on those and dropped for other platforms?
>

This remains a mystery.

To remove the -lm stuff in base, you can apply the attached patch.

--
Andreas Ericsson [email protected]
OP5 AB www.op5.se
Lead Developer

--------------040906070309070505050301
Content-Type: text/plain;
name="nagios-base-nomath.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="nagios-base-nomath.diff"

diff -urN ../nagios.orig/base/Makefile.in ./base/Makefile.in
--- ../nagios.orig/base/Makefile.in 2005-05-22 20:26:47.000000000 +0200
+++ ./base/Makefile.in 2005-05-22 20:27:33.000000000 +0200
@@ -42,7 +42,6 @@
CGIURL=@cgiurl@
HTMURL=@htmurl@

-MATHLIBS=-lm
PERLLIBS=@PERLLIBS@
PERLXSI_O=@PERLXSI_O@
SOCKETLIBS=@SOCKETLIBS@
@@ -151,10 +150,10 @@
$(CC) $(CFLAGS) -c -o $@ $(XRDC)

nagios: $(OBJS) $(OBJDEPS) $(SRC_INCLUDE)/nagios.h $(SRC_INCLUDE)/locations.h
- $(CC) -o $@ $(OBJS) $(BROKER_LDFLAGS) $(LDFLAGS) $(PERLLIBS) $(MATHLIBS) $(SOCKETLIBS) $(THREADLIBS) $(BROKERLIBS) $(LIBS)
+ $(CC) -o $@ $(OBJS) $(BROKER_LDFLAGS) $(LDFLAGS) $(PERLLIBS) $(SOCKETLIBS) $(THREADLIBS) $(BROKERLIBS) $(LIBS)

nagiostats: nagiostats.c $(SRC_INCLUDE)/locations.h
- $(CC) $(CFLAGS) -o $@ nagiostats.c $(LDFLAGS) $(MATHLIBS) $(LIBS)
+ $(CC) $(CFLAGS) -o $@ nagiostats.c $(LDFLAGS) $(LIBS)

$(OBJS): $(SRC_INCLUDE)/locations.h

diff -urN ../nagios.orig/nagios-base-nomath.diff ./nagios-base-nomath.diff
--- ../nagios.orig/nagios-base-nomath.diff 1970-01-01 01:00:00.000000000 +0100
+++ ./nagios-base-nomath.diff 2005-05-22 21:05:11.000000000 +0200
@@ -0,0 +1,24 @@
+diff -urN ../nagios.orig/base/Makefile.in ./base/Makefile.in
+--- ../nagios.orig/base/Makefile.in 2005-05-22 20:26:47.000000000 +0200
++++ ./base/Makefile.in 2005-05-22 20:27:33.000000000 +0200
+@@ -42,7 +42,6 @@
+ CGIURL=@cgiurl@
+ HTMURL=@htmurl@
+
+-MATHLIBS=-lm
+ PERLLIBS=@PERLLIBS@
+ PERLXSI_O=@PERLXSI_O@
+ SOCKETLIBS=@SOCKETLIBS@
+@@ -151,10 +150,10 @@
+ $(CC) $(CFLAGS) -c -o $@ $(XRDC)
+
+ nagios: $(OBJS) $(OBJDEPS) $(SRC_INCLUDE)/nagios.h $(SRC_INCLUDE)/locations.h
+- $(CC) -o $@ $(OBJS) $(BROKER_LDFLAGS) $(LDFLAGS) $(PERLLIBS) $(MATHLIBS) $(SOCKETLIBS) $(THREADLIBS) $(BROKERLIBS) $(LIBS)
++ $(CC) -o $@ $(OBJS) $(BROKER_LDFLAGS) $(LDFLAGS) $(PERLLIBS) $(SOCKETLIBS) $(THREADLIBS) $(BROKERLIBS) $(LIBS)
+
+ nagiostats: nagiostats.c $(SRC_INCLUDE)/locations.h
+- $(CC) $(CFLAGS) -o $@ nagiostats.c $(LDFLAGS) $(MATHLIBS) $(LIBS)
++ $(CC) $(CFLAGS) -o $@ nagiostats.c $(LDFLAGS) $(LIBS)
+
+ $(OBJS): $(SRC_INCLUDE)/locations.h
+

--------------040906070309070505050301--





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked