1dnl ######################################################################
2dnl check if libwrap (if exists), requires the caller to define the variables
3dnl deny_severity and allow_severity.
4AC_DEFUN([AMU_CHECK_LIBWRAP_SEVERITY],
5[
6AC_CACHE_CHECK([if libwrap wants caller to define allow_severity and deny_severity], ac_cv_need_libwrap_severity_vars, [
7# save, then reset $LIBS back to original value
8SAVEDLIBS="$LIBS"
9LIBS="$LIBS -lwrap"
10# run program one without defining our own severity variables
11AC_TRY_RUN(
12[
13int main()
14{
15   exit(0);
16}
17],[ac_tmp_val1="yes"],[ac_tmp_val1="no"])
18# run program two with defining our own severity variables
19AC_TRY_RUN(
20[
21int deny_severity, allow_severity, rfc931_timeout;
22int main()
23{
24   exit(0);
25}
26],[ac_tmp_val2="yes"],[ac_tmp_val2="no"])
27# restore original value of $LIBS
28LIBS="$SAVEDLIBS"
29# now decide what to do
30if test "$ac_tmp_val1" = "no" && test "$ac_tmp_val2" = "yes"
31then
32	ac_cv_need_libwrap_severity_vars="yes"
33else
34	ac_cv_need_libwrap_severity_vars="no"
35fi
36])
37if test "$ac_cv_need_libwrap_severity_vars" = "yes"
38then
39	AC_DEFINE(NEED_LIBWRAP_SEVERITY_VARIABLES)
40fi
41])
42