diff options
author | Chong Yidong <cyd@stupidchicken.com> | 2007-10-17 15:53:01 +0000 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2007-10-17 15:53:01 +0000 |
commit | 555ffc3fcfa4565d2bdb1ebb0a8a8b2ef80140d2 (patch) | |
tree | 64b244fad91b6b1f0d44d648705594783ca109c6 /configure.in | |
parent | c136b8280e4d22e30a72a417701e46bc19f4528b (diff) | |
download | emacs-555ffc3fcfa4565d2bdb1ebb0a8a8b2ef80140d2.tar.gz |
(HAVE_RES_INIT): Define if res_init() exists.
(HAVE_LIBRESOLV): Also define if we are using res_init().
Diffstat (limited to 'configure.in')
-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) AC_CHECK_FUNCS(gethostname getdomainname dup2 \ rename closedir mkdir rmdir sysinfo getrusage get_current_dir_name \ -random lrand48 bcopy bcmp logb frexp fmod rint cbrt ftime res_init setsid \ +random lrand48 bcopy bcmp logb frexp fmod rint cbrt ftime setsid \ strerror fpathconf select mktime euidaccess getpagesize tzset setlocale \ utimes setrlimit setpgid getcwd getwd shutdown getaddrinfo \ __fpending mblen mbrlen mbsinit strsignal setitimer ualarm index rindex \ @@ -2775,17 +2775,38 @@ AC_CHECK_FUNCS(getpt) # than to expect to find it in ncurses. AC_CHECK_LIB(ncurses, tparm) +# Do we have res_init, for detecting changes in /etc/resolv.conf? + +resolv=no +AC_CHECK_FUNC(res_init, have_res_init=yes, have_res_init=no) +if test "$have_res_init" = no; then + OLIBS="$LIBS" + LIBS="$LIBS -lresolv" + AC_MSG_CHECKING(for res_init with -lresolv) + AC_TRY_LINK([#include <netinet/in.h> +#include <arpa/nameser.h> +#include <resolv.h> ], + [res_init();], + have_res_init=yes, have_res_init=no) + AC_MSG_RESULT($have_res_init) + if test "$have_res_init" = yes ; then + resolv=yes + fi + LIBS="$OLIBS" +fi + +if test "$have_res_init" = yes; then + AC_DEFINE(HAVE_RES_INIT, 1, [Define to 1 if res_init is available.]) +fi + # Do we need the Hesiod library to provide the support routines? if test "$with_hesiod" = yes ; then # Don't set $LIBS here -- see comments above. - resolv=no AC_CHECK_FUNC(res_send, , [AC_CHECK_FUNC(__res_send, , [AC_CHECK_LIB(resolv, res_send, resolv=yes, [AC_CHECK_LIB(resolv, __res_send, resolv=yes)])])]) if test "$resolv" = yes ; then RESOLVLIB=-lresolv - AC_DEFINE(HAVE_LIBRESOLV, 1, - [Define to 1 if you have the resolv library (-lresolv).]) else RESOLVLIB= fi @@ -2795,6 +2816,12 @@ if test "$with_hesiod" = yes ; then :, $RESOLVLIB)]) fi +# Do we need libresolv (due to res_init or Hesiod)? +if test "$resolv" = yes ; then + AC_DEFINE(HAVE_LIBRESOLV, 1, + [Define to 1 if you have the resolv library (-lresolv).]) +fi + # These tell us which Kerberos-related libraries to use. if test "${with_kerberos+set}" = set; then AC_CHECK_LIB(com_err, com_err) |