[Nut-upsdev] patch for m4/nut_check_libwrap.m4

Tim Rice tim at multitalents.net
Tue Dec 15 01:09:19 UTC 2009


I ran into some issues building nut-2.4.1 on my Solaris 10 machine.
Here is a patch for m4/nut_check_libwrap.m4 to fix libwrap support.

-----------------------
#	m4/nut_check_libwrap.m4
#	test needs to use TRY_LINK
#	Undefined                      first referenced
#	 symbol                            in file
#	deny_severity                       /usr/sfw/lib/libwrap.so
#	allow_severity                      /usr/sfw/lib/libwrap.so
#   	Run yp_get_default_domain first or it will choke with the above
#	error too because of -lwrap
#
#
--- nut-2.4.1/m4/nut_check_libwrap.m4.old	2009-02-17 01:20:40.000000000 -0800
+++ nut-2.4.1/m4/nut_check_libwrap.m4	2009-12-14 16:49:06.789684000 -0800
@@ -16,8 +16,23 @@
    LIBS=""
 
    AC_CHECK_HEADER(tcpd.h, [], nut_have_libwrap=no)
-   AC_CHECK_LIB(wrap, request_init, [], nut_have_libwrap=no)
    AC_SEARCH_LIBS(yp_get_default_domain, nsl, [], nut_have_libwrap=no)
+   LIBS="-lwrap ${LIBS}"
+   AC_TRY_LINK(
+	[
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <tcpd.h>
+int deny_severity = 0, allow_severity = 0;
+	], [request_init(0);],
+	[
+		AC_DEFINE(HAVE_LIBWRAP, 1, [Define if you want TCP Wrappers support])
+	],
+	[
+		nut_have_libwrap=no
+	]
+   )
 
    if test "${nut_have_libwrap}" = "yes"; then
 	LIBWRAP_CFLAGS=""
-----------------------
 

-- 
Tim Rice				Multitalents	(707) 887-1469
tim at multitalents.net





More information about the Nut-upsdev mailing list