]> granicus.if.org Git - php/commitdiff
fix build with Sun compiler, which doesn't support -O0
authorAntony Dovgal <tony2001@php.net>
Mon, 4 Dec 2006 18:28:34 +0000 (18:28 +0000)
committerAntony Dovgal <tony2001@php.net>
Mon, 4 Dec 2006 18:28:34 +0000 (18:28 +0000)
acinclude.m4
configure.in

index d941ab7656d24af1432688b6f82b15d7fd3ac1ad..efc7ccca0f59cd19d7b9f7646031feff2eab432d 100644 (file)
@@ -2574,3 +2574,19 @@ ifelse([$1],[],:,[$1])
 ifelse([$2],[],[AC_MSG_ERROR([Cannot find php_pdo_driver.h.])],[$2])
   fi
 ])
+
+dnl
+dnl PHP_DETECT_ICC
+dnl
+AC_DEFUN([PHP_DETECT_ICC],
+[
+  ICC="no"
+  AC_MSG_CHECKING([for icc])
+  AC_EGREP_CPP([^__INTEL_COMPILER], [__INTEL_COMPILER],
+    ICC="no"
+    AC_MSG_RESULT([no]),
+    ICC="yes"
+    AC_MSG_RESULT([yes])
+  )
+])
+
index 837732560aaa1e00eab31a2b45dfd2167cef228c..f6032c780beca0033d03f84f62fce074f708df05 100644 (file)
@@ -120,6 +120,7 @@ dnl Checks for programs.
 dnl -------------------------------------------------------------------------
 
 AC_PROG_CC
+PHP_DETECT_ICC
 AC_PROG_CC_C_O
 dnl Change to AC_PROG_CC_STDC when we start requiring a post-2.13 autoconf
 dnl AC_PROG_CC_STDC
@@ -684,8 +685,11 @@ if test "$PHP_DEBUG" = "yes"; then
   CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'`
   CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-O[0-9]*//g'`
   changequote([,])
-  CFLAGS="$CFLAGS -O0"
-  CXXFLAGS="$CXXFLAGS -O0"
+  dnl add -O0 only if GCC or ICC is used
+  if test "$GCC" = "yes" || test "$ICC" = "yes"; then
+    CFLAGS="$CFLAGS -O0"
+    CXXFLAGS="$CXXFLAGS -O0"
+  fi
 else
   PHP_DEBUG=0
   ZEND_DEBUG=no