From: Gwynne Raskind Date: Mon, 10 Mar 2008 15:17:47 +0000 (+0000) Subject: Improve the Darwin 9 hack considerably and switch to using dl*() instead of NS*(... X-Git-Tag: RELEASE_2_0_0a1~184 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0c2ef3cece5c9cf7d30d859628eb489296b7aa89;p=php Improve the Darwin 9 hack considerably and switch to using dl*() instead of NS*() on Darwin 8+. --- diff --git a/configure.in b/configure.in index cb27bb9491..57c37be79d 100644 --- a/configure.in +++ b/configure.in @@ -129,8 +129,8 @@ dnl messing with the CFLAGS here to trick it. php_did_darwin9_cheat=0 case $host_alias in *darwin9*) - echo $CFLAGS | grep -E '(^-g)|([[:space:]]-g)' 2>/dev/null >/dev/null - if test "$?" -ne 0; then + hasg=`echo $CFLAGS | grep -E '(^-g)|([[:space:]]-g)'` + if test x"$hasg" = "x"; then php_did_darwin9_cheat=1 CFLAGS="$CFLAGS -gstabs" fi @@ -391,7 +391,6 @@ langinfo.h \ limits.h \ locale.h \ monetary.h \ -mach-o/dyld.h \ netdb.h \ pwd.h \ resolv.h \ @@ -443,6 +442,18 @@ assert.h #endif ]) +dnl Don't use mach-o/dyld.h on Darwin 8+, dl* is recommended by Apple from there on +dnl See http://developer.apple.com/documentation/DeveloperTools/Conceptual/MachOTopics/Articles/loading_code.html +case $host_alias in +*darwin[[89]]*) + ;; +*) + AC_CHECK_HEADERS([ \ +mach-o/dyld.h +],[],[][]) + ;; +esac + PHP_FOPENCOOKIE PHP_BROKEN_GETCWD PHP_BROKEN_GLIBC_FOPEN_APPEND @@ -737,10 +748,6 @@ if test "$PHP_DEBUG" = "yes"; then CXXFLAGS="$CXXFLAGS -O0" fi else - dnl Finish the Darwin hack - if test "$php_did_darwin9_cheat" -eq 1; then - CFLAGS=`echo "$CFLAGS" | $SED -e 's/-gstabs//g'` - fi PHP_DEBUG=0 ZEND_DEBUG=no fi @@ -1222,6 +1229,15 @@ SHARED_LIBTOOL='$(LIBTOOL)' CC=$old_CC +dnl Finish the Darwin hack +if test "$php_did_darwin9_cheat" -eq 1; then + if test "$PHP_DEBUG" = "yes"; then + CFLAGS=`echo "$CFLAGS" | $SED -e 's/-gstabs/-g/g'` + else + CFLAGS=`echo "$CFLAGS" | $SED -e 's/-gstabs//g'` + fi +fi + PHP_CONFIGURE_PART(Generating files) CXXFLAGS_CLEAN=$CXXFLAGS