From e02b49a80643e8e22566c72bf39b76e89acdf312 Mon Sep 17 00:00:00 2001 From: Darren Tucker <dtucker@zip.com.au> Date: Fri, 11 Sep 2009 14:56:08 +1000 Subject: [PATCH] - (dtucker) [configure.ac] Change the -lresolv check so it works on Mac OS X 10.6 (which doesn't have BIND8_COMPAT and thus uses res_9_query). Patch from jbasney at ncsa uiuc edu. --- ChangeLog | 5 +++++ configure.ac | 27 ++++++++++++++++++++++----- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index dcb471b53..83664dc3d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +20090911 + - (dtucker) [configure.ac] Change the -lresolv check so it works on Mac OS X + 10.6 (which doesn't have BIND8_COMPAT and thus uses res_9_query). Patch + from jbasney at ncsa uiuc edu. + 20090908 - (djm) [serverloop.c] Fix test for server-assigned remote forwarding port (-R 0:...); bz#1578, spotted and fix by gavin AT emf.net; ok dtucker@ diff --git a/configure.ac b/configure.ac index a0b781ee4..ea9f1bb56 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.426 2009/09/01 08:26:00 dtucker Exp $ +# $Id: configure.ac,v 1.427 2009/09/11 04:56:08 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -15,7 +15,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org) -AC_REVISION($Revision: 1.426 $) +AC_REVISION($Revision: 1.427 $) AC_CONFIG_SRCDIR([ssh.c]) AC_CONFIG_HEADER(config.h) @@ -3324,12 +3324,30 @@ AC_SEARCH_LIBS(getrrsetbyname, resolv, AC_SEARCH_LIBS(res_query, resolv) AC_SEARCH_LIBS(dn_expand, resolv) AC_MSG_CHECKING(if res_query will link) - AC_TRY_LINK_FUNC(res_query, AC_MSG_RESULT(yes), + AC_LINK_IFELSE([ +#include "confdefs.h" +#include <sys/types.h> +#include <netinet/in.h> +#include <arpa/nameser.h> +#include <netdb.h> +#include <resolv.h> +int main() +{ + res_query (0, 0, 0, 0, 0); + return 0; +} + ], + AC_MSG_RESULT(yes), [AC_MSG_RESULT(no) saved_LIBS="$LIBS" LIBS="$LIBS -lresolv" AC_MSG_CHECKING(for res_query in -lresolv) AC_LINK_IFELSE([ +#include "confdefs.h" +#include <sys/types.h> +#include <netinet/in.h> +#include <arpa/nameser.h> +#include <netdb.h> #include <resolv.h> int main() { @@ -3337,8 +3355,7 @@ int main() return 0; } ], - [LIBS="$LIBS -lresolv" - AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(yes)], [LIBS="$saved_LIBS" AC_MSG_RESULT(no)]) ])