scottmac                                 Fri, 16 Oct 2009 16:09:49 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=289700

Log:
Fix bug #49332 - Unable to compile with Snow Leopard due to some DNS funsies

Bug: http://bugs.php.net/49332 (Assigned) Make fails with "Undefined symbols: 
_res_9_dn_expand, _res_9_search and _res_9"
      
Changed paths:
    U   php/php-src/branches/PHP_5_2/NEWS
    U   php/php-src/branches/PHP_5_2/configure.in
    U   php/php-src/branches/PHP_5_2/ext/standard/config.m4
    U   php/php-src/branches/PHP_5_2/ext/standard/dns.c

Modified: php/php-src/branches/PHP_5_2/NEWS
===================================================================
--- php/php-src/branches/PHP_5_2/NEWS   2009-10-16 16:05:44 UTC (rev 289699)
+++ php/php-src/branches/PHP_5_2/NEWS   2009-10-16 16:09:49 UTC (rev 289700)
@@ -38,6 +38,7 @@
   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)

Modified: php/php-src/branches/PHP_5_2/configure.in
===================================================================
--- php/php-src/branches/PHP_5_2/configure.in   2009-10-16 16:05:44 UTC (rev 
289699)
+++ php/php-src/branches/PHP_5_2/configure.in   2009-10-16 16:09:49 UTC (rev 
289700)
@@ -211,7 +211,14 @@
         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 @@
 netinet/in.h \
 alloca.h \
 arpa/inet.h \
+arpa/nameser_compat.h \
 arpa/nameser.h \
 assert.h \
 crypt.h \

Modified: php/php-src/branches/PHP_5_2/ext/standard/config.m4
===================================================================
--- php/php-src/branches/PHP_5_2/ext/standard/config.m4 2009-10-16 16:05:44 UTC 
(rev 289699)
+++ php/php-src/branches/PHP_5_2/ext/standard/config.m4 2009-10-16 16:09:49 UTC 
(rev 289700)
@@ -315,6 +315,18 @@
 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

Modified: php/php-src/branches/PHP_5_2/ext/standard/dns.c
===================================================================
--- php/php-src/branches/PHP_5_2/ext/standard/dns.c     2009-10-16 16:05:44 UTC 
(rev 289699)
+++ php/php-src/branches/PHP_5_2/ext/standard/dns.c     2009-10-16 16:09:49 UTC 
(rev 289700)
@@ -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

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to