dsp             Thu Nov  6 20:38:02 2008 UTC

  Modified files:              
    /php-src    acinclude.m4 configure.in 
  Log:
  Detect Sun C compiler and set default flags if it is used
  
  
http://cvs.php.net/viewvc.cgi/php-src/acinclude.m4?r1=1.390&r2=1.391&diff_format=u
Index: php-src/acinclude.m4
diff -u php-src/acinclude.m4:1.390 php-src/acinclude.m4:1.391
--- php-src/acinclude.m4:1.390  Mon Sep  8 10:24:05 2008
+++ php-src/acinclude.m4        Thu Nov  6 20:38:02 2008
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: acinclude.m4,v 1.390 2008/09/08 10:24:05 tony2001 Exp $
+dnl $Id: acinclude.m4,v 1.391 2008/11/06 20:38:02 dsp Exp $
 dnl
 dnl This file contains local autoconf functions.
 dnl
@@ -2766,6 +2766,22 @@
   )
 ])
 
+dnl PHP_DETECT_SUNCC
+dnl Detect if the systems default compiler is suncc.
+dnl We also set some usefull CFLAGS if the user didn't set any
+AC_DEFUN([PHP_DETECT_SUNCC],[
+  SUNCC="no"
+  AC_MSG_CHECKING([for suncc])
+  AC_EGREP_CPP([^__SUNPRO_C], [__SUNPRO_C],
+    SUNCC="no"
+    AC_MSG_RESULT([no]),
+    SUNCC="yes"
+    test -n "$auto_cflags" && CFLAGS="-fsimple=2 -xnorunpath -xO4 
-xalias_level=basic -xipo=1 -xlibmopt -xprefetch_level=1 -xprefetch=auto 
-xstrconst -xtarget=native -zlazyload"
+    GCC=""
+    AC_MSG_RESULT([yes])
+  )
+])
+
 dnl
 dnl PHP_CRYPT_R_STYLE
 dnl detect the style of crypt_r() is any is available
http://cvs.php.net/viewvc.cgi/php-src/configure.in?r1=1.664&r2=1.665&diff_format=u
Index: php-src/configure.in
diff -u php-src/configure.in:1.664 php-src/configure.in:1.665
--- php-src/configure.in:1.664  Wed Jul 30 23:31:41 2008
+++ php-src/configure.in        Thu Nov  6 20:38:02 2008
@@ -1,4 +1,4 @@
-## $Id: configure.in,v 1.664 2008/07/30 23:31:41 jani Exp $ -*- autoconf -*-
+## $Id: configure.in,v 1.665 2008/11/06 20:38:02 dsp Exp $ -*- autoconf -*-
 dnl ## Process this file with autoconf to produce a configure script.
 
 divert(1)
@@ -142,6 +142,7 @@
 
 AC_PROG_CC
 PHP_DETECT_ICC
+PHP_DETECT_SUNCC
 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
@@ -214,6 +215,10 @@
       CFLAGS="$CFLAGS -ieee"
     fi
     ;;
+  sparc*)
+    if test "$SUNCC" = "yes"; then
+      CFLAGS="$CFLAGS -xmemalign=8s"
+    fi
 esac
 
 dnl activate some gcc specific optimizations for gcc >= 4
@@ -788,6 +793,15 @@
     CFLAGS="$CFLAGS -O0"
     CXXFLAGS="$CXXFLAGS -O0"
   fi
+  if test "$SUNCC" = "yes"; then
+    if -n "$auto_cflags"; then
+      CFLAGS="-g"
+      CXXFLAGS="-g"
+    else
+      CFLAGS="$CFLAGS -g"
+      CXXFLAGS="$CFLAGS -g"
+    fi
+  fi
 else
   PHP_DEBUG=0
   ZEND_DEBUG=no



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

Reply via email to