diff options
| -rw-r--r-- | configure.in | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/configure.in b/configure.in index 0f101a0edc3..c6fca826461 100644 --- a/configure.in +++ b/configure.in | |||
| @@ -2731,7 +2731,7 @@ AC_CHECK_HEADERS(maillock.h) | |||
| 2731 | 2731 | ||
| 2732 | AC_CHECK_FUNCS(gethostname getdomainname dup2 \ | 2732 | AC_CHECK_FUNCS(gethostname getdomainname dup2 \ |
| 2733 | rename closedir mkdir rmdir sysinfo getrusage get_current_dir_name \ | 2733 | rename closedir mkdir rmdir sysinfo getrusage get_current_dir_name \ |
| 2734 | random lrand48 bcopy bcmp logb frexp fmod rint cbrt ftime res_init setsid \ | 2734 | random lrand48 bcopy bcmp logb frexp fmod rint cbrt ftime setsid \ |
| 2735 | strerror fpathconf select mktime euidaccess getpagesize tzset setlocale \ | 2735 | strerror fpathconf select mktime euidaccess getpagesize tzset setlocale \ |
| 2736 | utimes setrlimit setpgid getcwd getwd shutdown getaddrinfo \ | 2736 | utimes setrlimit setpgid getcwd getwd shutdown getaddrinfo \ |
| 2737 | __fpending mblen mbrlen mbsinit strsignal setitimer ualarm index rindex \ | 2737 | __fpending mblen mbrlen mbsinit strsignal setitimer ualarm index rindex \ |
| @@ -2775,17 +2775,38 @@ AC_CHECK_FUNCS(getpt) | |||
| 2775 | # than to expect to find it in ncurses. | 2775 | # than to expect to find it in ncurses. |
| 2776 | AC_CHECK_LIB(ncurses, tparm) | 2776 | AC_CHECK_LIB(ncurses, tparm) |
| 2777 | 2777 | ||
| 2778 | # Do we have res_init, for detecting changes in /etc/resolv.conf? | ||
| 2779 | |||
| 2780 | resolv=no | ||
| 2781 | AC_CHECK_FUNC(res_init, have_res_init=yes, have_res_init=no) | ||
| 2782 | if test "$have_res_init" = no; then | ||
| 2783 | OLIBS="$LIBS" | ||
| 2784 | LIBS="$LIBS -lresolv" | ||
| 2785 | AC_MSG_CHECKING(for res_init with -lresolv) | ||
| 2786 | AC_TRY_LINK([#include <netinet/in.h> | ||
| 2787 | #include <arpa/nameser.h> | ||
| 2788 | #include <resolv.h> ], | ||
| 2789 | [res_init();], | ||
| 2790 | have_res_init=yes, have_res_init=no) | ||
| 2791 | AC_MSG_RESULT($have_res_init) | ||
| 2792 | if test "$have_res_init" = yes ; then | ||
| 2793 | resolv=yes | ||
| 2794 | fi | ||
| 2795 | LIBS="$OLIBS" | ||
| 2796 | fi | ||
| 2797 | |||
| 2798 | if test "$have_res_init" = yes; then | ||
| 2799 | AC_DEFINE(HAVE_RES_INIT, 1, [Define to 1 if res_init is available.]) | ||
| 2800 | fi | ||
| 2801 | |||
| 2778 | # Do we need the Hesiod library to provide the support routines? | 2802 | # Do we need the Hesiod library to provide the support routines? |
| 2779 | if test "$with_hesiod" = yes ; then | 2803 | if test "$with_hesiod" = yes ; then |
| 2780 | # Don't set $LIBS here -- see comments above. | 2804 | # Don't set $LIBS here -- see comments above. |
| 2781 | resolv=no | ||
| 2782 | AC_CHECK_FUNC(res_send, , [AC_CHECK_FUNC(__res_send, , | 2805 | AC_CHECK_FUNC(res_send, , [AC_CHECK_FUNC(__res_send, , |
| 2783 | [AC_CHECK_LIB(resolv, res_send, resolv=yes, | 2806 | [AC_CHECK_LIB(resolv, res_send, resolv=yes, |
| 2784 | [AC_CHECK_LIB(resolv, __res_send, resolv=yes)])])]) | 2807 | [AC_CHECK_LIB(resolv, __res_send, resolv=yes)])])]) |
| 2785 | if test "$resolv" = yes ; then | 2808 | if test "$resolv" = yes ; then |
| 2786 | RESOLVLIB=-lresolv | 2809 | RESOLVLIB=-lresolv |
| 2787 | AC_DEFINE(HAVE_LIBRESOLV, 1, | ||
| 2788 | [Define to 1 if you have the resolv library (-lresolv).]) | ||
| 2789 | else | 2810 | else |
| 2790 | RESOLVLIB= | 2811 | RESOLVLIB= |
| 2791 | fi | 2812 | fi |
| @@ -2795,6 +2816,12 @@ if test "$with_hesiod" = yes ; then | |||
| 2795 | :, $RESOLVLIB)]) | 2816 | :, $RESOLVLIB)]) |
| 2796 | fi | 2817 | fi |
| 2797 | 2818 | ||
| 2819 | # Do we need libresolv (due to res_init or Hesiod)? | ||
| 2820 | if test "$resolv" = yes ; then | ||
| 2821 | AC_DEFINE(HAVE_LIBRESOLV, 1, | ||
| 2822 | [Define to 1 if you have the resolv library (-lresolv).]) | ||
| 2823 | fi | ||
| 2824 | |||
| 2798 | # These tell us which Kerberos-related libraries to use. | 2825 | # These tell us which Kerberos-related libraries to use. |
| 2799 | if test "${with_kerberos+set}" = set; then | 2826 | if test "${with_kerberos+set}" = set; then |
| 2800 | AC_CHECK_LIB(com_err, com_err) | 2827 | AC_CHECK_LIB(com_err, com_err) |