]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
basic_nis_auth: Improved portability
authorFrancesco Chemolli <kinkie@squid-cache.org>
Thu, 24 Oct 2013 15:11:16 +0000 (09:11 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 24 Oct 2013 15:11:16 +0000 (09:11 -0600)
helpers/basic_auth/NIS/nis_support.cc
helpers/basic_auth/NIS/required.m4

index 075eb5b6678b27dbeaeaff6c3f34cf1f48825fb7..01657199aef78c2cb82f9ccccbc55ac40d1e4cb0 100644 (file)
@@ -2,12 +2,25 @@
  * Written By Rabellino Sergio (rabellino@di.unito.it) For Solaris 2.x
  */
 #include "squid.h"
+
+#if HAVE_STDLIB_H
 #include <stdlib.h>
+#endif
+#if HAVE_STDIO_H
 #include <stdio.h>
+#endif
+#if HAVE_STRING_H
 #include <string.h>
+#endif
+#if HAVE_SYSLOG_H
 #include <syslog.h>
+#endif
+#if HAVE_SYS_TYPES_H
 #include <sys/types.h>
+#endif
+#if HAVE_RPC_RPC_H
 #include <rpc/rpc.h>
+#endif
 
 #if _SQUID_FREEBSD_  && !defined(BOOL_DEFINED)
 // BUG: FreeBSD rpcsvc/yp_* headers try to redefine bool unless we match their non-standard hack.
 #endif
 
 #include <rpcsvc/ypclnt.h>
+
+#if HAVE_RPCSVC_YP_PROT_H
 #include <rpcsvc/yp_prot.h>
+#endif
 
 #include "nis_support.h"
 
index 4b66a61a877affcade4e4fccea86852a507f8627..9d046673e63f65856736fabbbc3d28653383d449 100755 (executable)
@@ -1 +1,5 @@
-AC_CHECK_HEADERS([rpcsvc/yp_prot.h],[BUILD_HELPER="NIS"])
+AC_CHECK_HEADERS([sys/types.h rpc/rpc.h rpcsvc/yp_prot.h],[BUILD_HELPER="NIS"],,AC_INCLUDES_DEFAULT([
+#if HAVE_RPC_RPC_H
+#include <rpc/rpc.h>
+#endif
+]))