summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorGwynne Raskind <gwynne@php.net>2008-03-09 14:27:25 +0000
committerGwynne Raskind <gwynne@php.net>2008-03-09 14:27:25 +0000
commit62ba50b762d914045b15994dc2800606ec56d871 (patch)
tree592853af5656d496040d022041ae617c69b17df3 /configure.in
parenta344adf72e48d725575c22b9955e028d7fdf6a52 (diff)
downloadphp-git-62ba50b762d914045b15994dc2800606ec56d871.tar.gz
MFH: Fix Darwin 9/Mac OS X 10.5 build problems, or at least patch them
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in28
1 files changed, 27 insertions, 1 deletions
diff --git a/configure.in b/configure.in
index 5bfc663c3d..241154f19a 100644
--- a/configure.in
+++ b/configure.in
@@ -122,6 +122,21 @@ dnl or the contents of libs.
$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*)
+ echo $CFLAGS | grep -E '(^-g)|([[:space:]]-g)' 2>/dev/null >/dev/null
+ if test "$?" -ne 0; then
+ php_did_darwin9_cheat=1
+ CFLAGS="$CFLAGS -gstabs"
+ fi
+ ;;
+esac
+
dnl Checks for programs.
dnl -------------------------------------------------------------------------
@@ -167,7 +182,14 @@ esac
dnl activate some gcc specific optimizations for gcc >= 4
if test "$GCC" = "yes"; then
- GCC_MAJOR_VERSION=`$CC --version | $SED -n '1s/[[^0-9]]*\([[0-9]]\+\)\.[[0-9]]\+\..*/\1/;1p'`
+ case $host_alias in
+ *darwin*)
+ GCC_MAJOR_VERSION=`$CC -dumpversion | $SED -nE '1s/([[0-9]]+)\.[[0-9]]+\..*/\1/;1p'`
+ ;;
+ *)
+ GCC_MAJOR_VERSION=`$CC --version | $SED -n '1s/[[^0-9]]*\([[0-9]]\+\)\.[[0-9]]\+\..*/\1/;1p'`
+ ;;
+ esac
if test $GCC_MAJOR_VERSION -ge 4; then
CFLAGS="$CFLAGS -fvisibility=hidden"
fi
@@ -716,6 +738,10 @@ 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