Page 1 of 1

[Nagios-devel] nrpe-2.0 portability patch

Posted: Fri Oct 03, 2003 12:10 pm
by Guest
--=-loCoeGuuRRoDIeGpD1a7
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

I tried to build nrpe-2.0 on solaris and hpux and hit a problem with a
missing getopt_long symbol. A little configure.in hacking and I fixed
the problem by using getopt_long in libiberty. Attached is my patch for
configure.in and src/Makefile.in.
--
Jeffrey Layton

--=-loCoeGuuRRoDIeGpD1a7
Content-Disposition: attachment; filename=nrpe.patch
Content-Type: text/x-patch; name=nrpe.patch; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Index: configure.in
===================================================================
--- configure.in (revision 139)
+++ configure.in (working copy)
@@ -42,6 +42,12 @@
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(long)

+dnl Check for getopt_long
+
+AC_CHECK_FUNCS([getopt_long],,
+ AC_CHECK_LIB([iberty],[getopt_long],OTHERLIBS="$OTHERLIBS -liberty"))
+AC_SUBST(OTHERLIBS)
+
dnl Define u_int32_t if we don't have it already (Solaris, etc.)
AC_CHECK_TYPE(uint32_t,unsigned int)
AC_CHECK_TYPE(u_int32_t,unsigned int)
Index: src/Makefile.in
===================================================================
--- src/Makefile.in (revision 139)
+++ src/Makefile.in (working copy)
@@ -12,6 +12,7 @@
CFLAGS=@CFLAGS@ @DEFS@
LDFLAGS=@LDFLAGS@ @LIBS@
SOCKETLIBS=@SOCKETLIBS@
+OTHERLIBS=@OTHERLIBS@

CP=@CP@

@@ -19,10 +20,10 @@
all: nrpe check_nrpe

nrpe: nrpe.c nrpe.h utils.c utils.h $(SRC_COMMON)/common.h $(SRC_COMMON)/config.h
- $(CC) $(CFLAGS) -o $@ nrpe.c utils.c $(LDFLAGS) $(SOCKETLIBS)
+ $(CC) $(CFLAGS) -o $@ nrpe.c utils.c $(LDFLAGS) $(SOCKETLIBS) $(OTHERLIBS)

check_nrpe: check_nrpe.c utils.c utils.h $(SRC_COMMON)/common.h $(SRC_COMMON)/config.h
- $(CC) $(CFLAGS) -o $@ check_nrpe.c utils.c $(LDFLAGS) $(SOCKETLIBS)
+ $(CC) $(CFLAGS) -o $@ check_nrpe.c utils.c $(LDFLAGS) $(SOCKETLIBS) $(OTHERLIBS)

clean:
rm -f core nrpe check_nrpe

--=-loCoeGuuRRoDIeGpD1a7--






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