From: Scott MacVicar Date: Fri, 16 Oct 2009 16:09:49 +0000 (+0000) Subject: Fix bug #49332 - Unable to compile with Snow Leopard due to some DNS funsies X-Git-Tag: php-5.2.12RC1~61 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eb9ca1bf82f61a63b06a7b661dee564fc6325704;p=php Fix bug #49332 - Unable to compile with Snow Leopard due to some DNS funsies --- diff --git a/NEWS b/NEWS index eb0fe5b0b9..5b09906db6 100644 --- a/NEWS +++ b/NEWS @@ -38,6 +38,7 @@ PHP NEWS of a multibyte character). (Moriyoshi) - Fixed bug #49528 (UTF-16 strings prefixed by BOMs wrongly converted). (Moriyoshi) +- Fixed bug #49332 (Build error with Snow Leopard). (Scott) - Fixed bug #48805 (IPv6 socket transport is not working). (Ilia) - Fixed bug #48764 (PDO_pgsql::query() always uses implicit prepared statements if v3 proto available). (Matteo, Mark Kirkwood) diff --git a/configure.in b/configure.in index 45a1099a5f..6d9873aa7e 100644 --- a/configure.in +++ b/configure.in @@ -211,7 +211,14 @@ case $host_alias in CPPFLAGS="$CPPFLAGS -no-cpp-precomp" fi fi - AC_DEFINE(BIND_8_COMPAT, 1, [Enabling BIND8 compatibility for Panther]) + + macosx_major=`sw_vers -productVersion | cut -d . -f 1` + macosx_minor=`sw_vers -productVersion | cut -d . -f 2` + + if test "$macosx_major" -ge "10" && test "$macosx_minor" -lt "6" ; then + AC_DEFINE(BIND_8_COMPAT, 1, [Enabling BIND8 compatibility for Panther]) + fi + php_multiple_shlib_versions_ok=yes ;; *beos*) @@ -388,6 +395,7 @@ sys/time.h \ netinet/in.h \ alloca.h \ arpa/inet.h \ +arpa/nameser_compat.h \ arpa/nameser.h \ assert.h \ crypt.h \ diff --git a/ext/standard/config.m4 b/ext/standard/config.m4 index 56848f9ed8..d99b35f91f 100644 --- a/ext/standard/config.m4 +++ b/ext/standard/config.m4 @@ -315,6 +315,18 @@ PHP_CHECK_FUNC(res_nmkquery, resolv, bind, socket) PHP_CHECK_FUNC(res_nsend, resolv, bind, socket) PHP_CHECK_FUNC(dn_expand, resolv, bind, socket) +dnl OSX has the dns functions in libc but remaps them in resolv.h for bind so linking fails +case $host_alias in + *darwin*) + macosx_major=`sw_vers -productVersion | cut -d . -f 1` + macosx_minor=`sw_vers -productVersion | cut -d . -f 2` + + if test "$macosx_major" -ge "10" && test "$macosx_minor" -ge "6" ; then + LIBS="$LIBS -lresolv" + fi + ;; +esac + dnl dnl Check if atof() accepts NAN dnl diff --git a/ext/standard/dns.c b/ext/standard/dns.c index 02a7a07962..bc6e888ec0 100644 --- a/ext/standard/dns.c +++ b/ext/standard/dns.c @@ -55,6 +55,9 @@ #undef STATUS #undef T_UNSPEC #endif +#if HAVE_ARPA_NAMESER_COMPAT_H +#include +#endif #if HAVE_ARPA_NAMESER_H #include #endif