Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | Upstream-Status: Pending |
| 2 | |
| 3 | --- quota-tools.orig/configure.in |
| 4 | +++ quota-tools/configure.in |
| 5 | @@ -151,33 +151,46 @@ AC_SUBST(QUOTA_NETLINK_PROG) |
| 6 | AC_SUBST(NETLINKLIBS) |
| 7 | |
| 8 | AC_SEARCH_LIBS(gethostbyname, nsl) |
| 9 | -AC_MSG_CHECKING(for host_access in -lwrap) |
| 10 | -AC_CACHE_VAL(ac_cv_lib_wrap_main, |
| 11 | - saved_LIBS="$LIBS" |
| 12 | - LIBS="$LIBS -lwrap" |
| 13 | - [AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 14 | - #include <stdio.h> |
| 15 | - #include <sys/types.h> |
| 16 | - #include <sys/socket.h> |
| 17 | - #include <netinet/in.h> |
| 18 | - #include <tcpd.h> |
| 19 | - struct request_info request; |
| 20 | - int deny_severity, allow_severity;]],[[hosts_access(&request);]])], |
| 21 | - dnl We always restore LIBS as we add -lwrap in the next check |
| 22 | - [ac_cv_lib_wrap_main=yes; LIBS="$saved_LIBS"; AC_MSG_RESULT(yes)], |
| 23 | - [ac_cv_lib_wrap_main=no; LIBS="$saved_LIBS"; AC_MSG_RESULT(no)]) |
| 24 | - ]) |
| 25 | |
| 26 | -if test ${ac_cv_lib_wrap_main} = yes; then |
| 27 | - AC_CHECK_HEADER(tcpd.h,, [ |
| 28 | - echo 'ERROR: could not find tcpd.h - missing TCP wrappers package' |
| 29 | - exit 1 |
| 30 | - ]) |
| 31 | - LIBS="$LIBS -lwrap" |
| 32 | - AC_DEFINE([HOSTS_ACCESS], 1, [Use hosts.allow and hosts.deny for access checking of rpc.rquotad]) |
| 33 | - COMPILE_OPTS="$COMPILE_OPTS HOSTS_ACCESS" |
| 34 | +AC_ARG_WITH(tcpwrappers, |
| 35 | + [ --with-tcpwrappers=[yes/no/try] Use hosts.allow and hosts.deny for access checking of rpc.rquota [default=yes, if available.]], |
| 36 | + , |
| 37 | + with_tcpwrappers="try") |
| 38 | + |
| 39 | +if test "x$with_tcpwrappers" != xno; then |
| 40 | + AC_MSG_CHECKING(for host_access in -lwrap) |
| 41 | + AC_CACHE_VAL(ac_cv_lib_wrap_main, |
| 42 | + saved_LIBS="$LIBS" |
| 43 | + LIBS="$LIBS -lwrap" |
| 44 | + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 45 | + #include <stdio.h> |
| 46 | + #include <sys/types.h> |
| 47 | + #include <sys/socket.h> |
| 48 | + #include <netinet/in.h> |
| 49 | + #include <tcpd.h> |
| 50 | + struct request_info request; |
| 51 | + int deny_severity, allow_severity;]],[[hosts_access(&request);]])], |
| 52 | + dnl We always restore LIBS as we add -lwrap in the next try |
| 53 | + [ac_cv_lib_wrap_main=yes; LIBS="$saved_LIBS"; AC_MSG_RESULT(yes)], |
| 54 | + [ac_cv_lib_wrap_main=no; LIBS="$saved_LIBS"; AC_MSG_RESULT(no)]) |
| 55 | + ]) |
| 56 | + |
| 57 | + if test "x$ac_cv_lib_wrap_main" = xyes; then |
| 58 | + AC_CHECK_HEADER(tcpd.h,, [ |
| 59 | + if test "x$with_tcpwrappers" != xtry; then |
| 60 | + AC_MSG_ERROR([could not find tcpd.h - missing TCP wrappers package]) |
| 61 | + fi |
| 62 | + ]) |
| 63 | + |
| 64 | + LIBS="$LIBS -lwrap" |
| 65 | + AC_DEFINE([HOSTS_ACCESS], 1, [Use hosts.allow and hosts.deny for access checking of rpc.rquotad]) |
| 66 | + COMPILE_OPTS="$COMPILE_OPTS HOSTS_ACCESS" |
| 67 | + elif test "x$with_tcpwrappers" != xtry; then |
| 68 | + AC_MSG_ERROR([could not find libwrap - missing TCP wrappers package]) |
| 69 | + fi |
| 70 | fi |
| 71 | |
| 72 | + |
| 73 | dnl Checks for typedefs, structures, and compiler characteristics. |
| 74 | AC_C_CONST |
| 75 | AC_C_INLINE |