gwynne                                   Mon, 30 Nov 2009 21:38:44 +0000

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

Log:
The old Darwin hack is BROKEN and INCORRECT. It works only for Darwin 9, not 
10, and uses an ugly CFLAGS hack that messes with the entire build. This 
version sets one cached value to the correct result for Darwin 9 and 10. It's 
cleaner, has no side effects, has nothing to do with Autoconf versions, and 
works for everyone.

Changed paths:
    U   php/php-src/branches/PHP_5_2/configure.in
    U   php/php-src/branches/PHP_5_3/configure.in
    U   php/php-src/trunk/configure.in

Modified: php/php-src/branches/PHP_5_2/configure.in
===================================================================
--- php/php-src/branches/PHP_5_2/configure.in   2009-11-30 21:02:46 UTC (rev 
291522)
+++ php/php-src/branches/PHP_5_2/configure.in   2009-11-30 21:38:44 UTC (rev 
291523)
@@ -122,21 +122,6 @@
 $php_shtool mkdir -p libs
 rm -f libs/*

-dnl Darwin 9 hack
-dnl Because the default debugging format used by Apple's GCC on Mac OS 10.5
-dnl causes errors in all current and past versions of Autoconf, we do a little
-dnl messing with the CFLAGS here to trick it.
-php_did_darwin9_cheat=0
-case $host_alias in
-*darwin9*)
-  hasg=`echo $CFLAGS | grep -E '(^-g)|([[:space:]]-g)'`
-  if test x"$hasg" = "x"; then
-    php_did_darwin9_cheat=1
-    CFLAGS="$CFLAGS -gstabs"
-  fi
-  ;;
-esac
-
 dnl Checks for programs.
 dnl -------------------------------------------------------------------------

@@ -1331,6 +1316,14 @@

 LDFLAGS="$LDFLAGS $PHP_AIX_LDFLAGS"

+dnl Autoconf 2.13's libtool checks go slightly nuts on Mac OS X 10.5 and 10.6.
+dnl This hack works around it. Ugly.
+case $host_alias in
+*darwin9*|*darwin10*)
+       ac_cv_exeext=
+       ;;
+esac
+
 dnl Only allow AC_PROG_CXX and AC_PROG_CXXCPP if they are explicitly called 
(by PHP_REQUIRE_CXX).
 dnl Otherwise AC_PROG_LIBTOOL fails if there is no working C++ compiler.
 AC_PROVIDE_IFELSE([PHP_REQUIRE_CXX], [], [
@@ -1354,15 +1347,6 @@

 CC=$old_CC

-dnl Finish the Darwin hack
-if test "$php_did_darwin9_cheat" -eq 1; then
-  if test "$PHP_DEBUG" = "1"; then
-    CFLAGS=`echo "$CFLAGS" | $SED -e 's/-gstabs/-g/g'`
-  else
-    CFLAGS=`echo "-O2 $CFLAGS" | $SED -e 's/-gstabs//g'`
-  fi
-fi
-
 PHP_CONFIGURE_PART(Generating files)

 CXXFLAGS_CLEAN=$CXXFLAGS

Modified: php/php-src/branches/PHP_5_3/configure.in
===================================================================
--- php/php-src/branches/PHP_5_3/configure.in   2009-11-30 21:02:46 UTC (rev 
291522)
+++ php/php-src/branches/PHP_5_3/configure.in   2009-11-30 21:38:44 UTC (rev 
291523)
@@ -122,21 +122,6 @@
 $php_shtool mkdir -p libs
 rm -f libs/*

-dnl Darwin 9 hack
-dnl Because the default debugging format used by Apple's GCC on Mac OS 10.5
-dnl causes errors in all current and past versions of Autoconf, we do a little
-dnl messing with the CFLAGS here to trick it.
-php_did_darwin9_cheat=0
-case $host_alias in
-*darwin9*)
-  hasg=`echo $CFLAGS | grep -E '(^-g)|([[:space:]]-g)'`
-  if test x"$hasg" = "x"; then
-    php_did_darwin9_cheat=1
-    CFLAGS="$CFLAGS -gstabs"
-  fi
-  ;;
-esac
-
 dnl Checks for programs.
 dnl -------------------------------------------------------------------------

@@ -1339,6 +1324,14 @@

 LDFLAGS="$LDFLAGS $PHP_AIX_LDFLAGS"

+dnl Autoconf 2.13's libtool checks go slightly nuts on Mac OS X 10.5 and 10.6.
+dnl This hack works around it. Ugly.
+case $host_alias in
+*darwin9*|*darwin10*)
+       ac_cv_exeext=
+       ;;
+esac
+
 dnl Only allow AC_PROG_CXX and AC_PROG_CXXCPP if they are explicitly called 
(by PHP_REQUIRE_CXX).
 dnl Otherwise AC_PROG_LIBTOOL fails if there is no working C++ compiler.
 AC_PROVIDE_IFELSE([PHP_REQUIRE_CXX], [], [
@@ -1362,15 +1355,6 @@

 CC=$old_CC

-dnl Finish the Darwin hack
-if test "$php_did_darwin9_cheat" -eq 1; then
-  if test "$PHP_DEBUG" = "1"; then
-    CFLAGS=`echo "$CFLAGS" | $SED -e 's/-gstabs/-g/g'`
-  else
-    CFLAGS=`echo "-O2 $CFLAGS" | $SED -e 's/-gstabs//g'`
-  fi
-fi
-
 PHP_CONFIGURE_PART(Generating files)

 CXXFLAGS_CLEAN=$CXXFLAGS

Modified: php/php-src/trunk/configure.in
===================================================================
--- php/php-src/trunk/configure.in      2009-11-30 21:02:46 UTC (rev 291522)
+++ php/php-src/trunk/configure.in      2009-11-30 21:38:44 UTC (rev 291523)
@@ -124,21 +124,6 @@
 $php_shtool mkdir -p libs
 rm -f libs/*

-dnl Darwin 9 hack
-dnl Because the default debugging format used by Apple's GCC on Mac OS 10.5
-dnl causes errors in all current and past versions of Autoconf, we do a little
-dnl messing with the CFLAGS here to trick it.
-php_did_darwin9_cheat=0
-case $host_alias in
-*darwin9*)
-  hasg=`echo $CFLAGS | grep -E '(^-g)|([[:space:]]-g)'`
-  if test x"$hasg" = "x"; then
-    php_did_darwin9_cheat=1
-    CFLAGS="$CFLAGS -gstabs"
-  fi
-  ;;
-esac
-
 dnl Checks for programs.
 dnl -------------------------------------------------------------------------

@@ -1277,6 +1262,14 @@

 LDFLAGS="$LDFLAGS $PHP_AIX_LDFLAGS"

+dnl Autoconf 2.13's libtool checks go slightly nuts on Mac OS X 10.5 and 10.6.
+dnl This hack works around it. Ugly.
+case $host_alias in
+*darwin9*|*darwin10*)
+       ac_cv_exeext=
+       ;;
+esac
+
 dnl Only allow AC_PROG_CXX and AC_PROG_CXXCPP if they are explicitly called 
(by PHP_REQUIRE_CXX).
 dnl Otherwise AC_PROG_LIBTOOL fails if there is no working C++ compiler.
 AC_PROVIDE_IFELSE([PHP_REQUIRE_CXX], [], [
@@ -1300,15 +1293,6 @@

 CC=$old_CC

-dnl Finish the Darwin hack
-if test "$php_did_darwin9_cheat" -eq 1; then
-  if test "$PHP_DEBUG" = "1"; then
-    CFLAGS=`echo "$CFLAGS" | $SED -e 's/-gstabs/-g/g'`
-  else
-    CFLAGS=`echo "-O2 $CFLAGS" | $SED -e 's/-gstabs//g'`
-  fi
-fi
-
 PHP_CONFIGURE_PART(Generating files)

 CXXFLAGS_CLEAN=$CXXFLAGS

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

Reply via email to