]> granicus.if.org Git - php/commitdiff
Fix bug #49332 - Unable to compile with Snow Leopard due to some DNS funsies
authorScott MacVicar <scottmac@php.net>
Fri, 16 Oct 2009 16:09:49 +0000 (16:09 +0000)
committerScott MacVicar <scottmac@php.net>
Fri, 16 Oct 2009 16:09:49 +0000 (16:09 +0000)
NEWS
configure.in
ext/standard/config.m4
ext/standard/dns.c

diff --git a/NEWS b/NEWS
index eb0fe5b0b9b7cca250403d030dd0edfcd177b13c..5b09906db6220da889300e5a9d18c643b0f00d28 100644 (file)
--- 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)
index 45a1099a5f9e8413154acd1e66b452bc57e95b17..6d9873aa7e8918f66aca2b5e3c4e837cdc1272cf 100644 (file)
@@ -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 \
index 56848f9ed8b88ba476a4de11fd451c3e50daa3da..d99b35f91f3592728b898f1e856f0391d79bb10a 100644 (file)
@@ -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
index 02a7a0796237d9f735c8909c656c11b394716066..bc6e888ec034bd718c8960f6794299c97ff604d5 100644 (file)
@@ -55,6 +55,9 @@
 #undef STATUS
 #undef T_UNSPEC
 #endif
+#if HAVE_ARPA_NAMESER_COMPAT_H
+#include <arpa/nameser_compat.h>
+#endif
 #if HAVE_ARPA_NAMESER_H
 #include <arpa/nameser.h>
 #endif