]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/configure
Remove -lnsl from tpc wrappers link unless needed
[bacula/bacula] / bacula / configure
index ea8b2cac3644e3bca7badd119b627ec5c276c1a2..ee3fafe7e5b7ea7d0a3d6a5b88c5c7dbc0dab5ad 100755 (executable)
@@ -4186,7 +4186,7 @@ then
 elif test -f /etc/engarde-version
 then
         DISTNAME=engarde
-elif test "$ac_cv_cygwin" = yes
+elif test "$CYGWIN" = yes
 then
         DISTNAME=cygwin
         cat >>confdefs.h <<\_ACEOF
@@ -6326,7 +6326,7 @@ if test "${with_tcp_wrappers+set}" = set; then
 
     if test "x$withval" != "xno" ; then
        saved_LIBS="$LIBS"
-       LIBS="$LIBS -lwrap -lnsl"
+       LIBS="$saved_LIBS -lwrap"
        echo "$as_me:$LINENO: checking for libwrap" >&5
 echo $ECHO_N "checking for libwrap... $ECHO_C" >&6
        cat >conftest.$ac_ext <<_ACEOF
@@ -6369,6 +6369,52 @@ _ACEOF
 
            TCPW_MSG="yes"
 
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+           LIBS="$saved_LIBS -lwrap -lnsl"
+           cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+ #include <tcpd.h>
+                int deny_severity = 0;
+                int allow_severity = 0;
+                struct request_info *req;
+int
+main ()
+{
+ hosts_access(req);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+                echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+                cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBWRAP 1
+_ACEOF
+
+                TCPW_MSG="yes"
+
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
@@ -6377,6 +6423,9 @@ sed 's/^/| /' conftest.$ac_ext >&5
 echo "$as_me: error: *** libwrap missing" >&2;}
    { (exit 1); exit 1; }; }
 
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
     fi