Re: [PHP-CVS] cvs: php-src(PHP_5_3) / NEWS acinclude.m4 configure.in

2008-11-06 Thread Hannes Magnusson
On Thu, Nov 6, 2008 at 22:14, David Soria Parra <[EMAIL PROTECTED]> wrote:
> Hannes Magnusson wrote:
>>
>> On Thu, Nov 6, 2008 at 21:42, David Soria Parra <[EMAIL PROTECTED]> wrote:
>>>
>>> dsp Thu Nov  6 20:42:12 2008 UTC
>>>
>>>  Modified files:  (Branch: PHP_5_3)
>>>   /php-srcacinclude.m4 configure.in NEWS
>>>  Log:
>>>  MFH: Detect Sun C compiler and set default flags if it is used
>>
>> [...]
>>>
>>> +- Added default flags for suncc compiler. (David Soria Parra)
>>
>> Thats great.. what are those default flags and "why should I care"?
>
> Hi Hannes,
>
> so the complete list is at
> http://docs.sun.com/app/docs/doc/819-5265/bjapp?a=view but let me get

Sorry for not being literal enough: How should the end-user know what
this news entry means, and should he pay special attentions to it?
Should he search our docs for "which flags does PHP set by default for
suncc?"

Being slightly more verbose in the NEWS isn't a bad thing - and if
this is something "important" then you should document it too.

-Hannes

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



Re: [PHP-CVS] cvs: php-src(PHP_5_3) / NEWS acinclude.m4 configure.in

2008-11-06 Thread David Soria Parra

Hannes Magnusson wrote:

On Thu, Nov 6, 2008 at 21:42, David Soria Parra <[EMAIL PROTECTED]> wrote:

dsp Thu Nov  6 20:42:12 2008 UTC

 Modified files:  (Branch: PHP_5_3)
   /php-srcacinclude.m4 configure.in NEWS
 Log:
 MFH: Detect Sun C compiler and set default flags if it is used

[...]

+- Added default flags for suncc compiler. (David Soria Parra)


Thats great.. what are those default flags and "why should I care"?

Hi Hannes,

so the complete list is at 
http://docs.sun.com/app/docs/doc/819-5265/bjapp?a=view but let me get 
through the most important parts of the list:


xtarget=native
Causes to generate processor specific code.

xalias_level=basic
does optimization based on basic assumptions about the c types e.g. 
float* will not point to int*.


fsimple=2
will simplify floating point arithmetic

xipo=1
will do an analysis of all object files and try to optimize across all 
object files.


xlibmopt
optimize math routines, according to the documentation this might result 
in slight differences to the std math lib. But I asked some sun 
engineers and it was considered safe.


So actually I picked options that usually are set by the -fast option, 
but removed the onces that might cause problems. That's why the list is 
that long and that's even why I don't use -xO5 but -xO4 to not run in 
errors (this was recommand by some webstack guy).


The only sad thing is that you still need to set the compiler using the 
CC env variable as by default we are looking for gcc and ignoring other 
compilers even though they are the default cc compiler on those 
machines. I acutally think that this is not desirable.


David

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



Re: [PHP-CVS] cvs: php-src(PHP_5_3) / NEWS acinclude.m4 configure.in

2008-11-06 Thread Hannes Magnusson
On Thu, Nov 6, 2008 at 21:42, David Soria Parra <[EMAIL PROTECTED]> wrote:
> dsp Thu Nov  6 20:42:12 2008 UTC
>
>  Modified files:  (Branch: PHP_5_3)
>/php-srcacinclude.m4 configure.in NEWS
>  Log:
>  MFH: Detect Sun C compiler and set default flags if it is used
[...]
> +- Added default flags for suncc compiler. (David Soria Parra)

Thats great.. what are those default flags and "why should I care"?

-Hannes

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



[PHP-CVS] cvs: php-src(PHP_5_3) / NEWS acinclude.m4 configure.in

2008-11-06 Thread David Soria Parra
dsp Thu Nov  6 20:42:12 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-srcacinclude.m4 configure.in NEWS 
  Log:
  MFH: Detect Sun C compiler and set default flags if it is used
  
  
http://cvs.php.net/viewvc.cgi/php-src/acinclude.m4?r1=1.332.2.14.2.26.2.10&r2=1.332.2.14.2.26.2.11&diff_format=u
Index: php-src/acinclude.m4
diff -u php-src/acinclude.m4:1.332.2.14.2.26.2.10 
php-src/acinclude.m4:1.332.2.14.2.26.2.11
--- php-src/acinclude.m4:1.332.2.14.2.26.2.10   Mon Sep  8 10:24:25 2008
+++ php-src/acinclude.m4Thu Nov  6 20:42:11 2008
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: acinclude.m4,v 1.332.2.14.2.26.2.10 2008/09/08 10:24:25 tony2001 Exp $
+dnl $Id: acinclude.m4,v 1.332.2.14.2.26.2.11 2008/11/06 20:42:11 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.579.2.52.2.77.2.31&r2=1.579.2.52.2.77.2.32&diff_format=u
Index: php-src/configure.in
diff -u php-src/configure.in:1.579.2.52.2.77.2.31 
php-src/configure.in:1.579.2.52.2.77.2.32
--- php-src/configure.in:1.579.2.52.2.77.2.31   Mon Sep  1 20:51:57 2008
+++ php-src/configure.inThu Nov  6 20:42:11 2008
@@ -1,4 +1,4 @@
-## $Id: configure.in,v 1.579.2.52.2.77.2.31 2008/09/01 20:51:57 johannes Exp $ 
-*- autoconf -*-
+## $Id: configure.in,v 1.579.2.52.2.77.2.32 2008/11/06 20:42:11 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
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.366&r2=1.2027.2.547.2.965.2.367&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.366 
php-src/NEWS:1.2027.2.547.2.965.2.367
--- php-src/NEWS:1.2027.2.547.2.965.2.366   Thu Nov  6 01:38:56 2008
+++ php-src/NEWSThu Nov  6 20:42:11 2008
@@ -17,6 +17,7 @@
 - Added concatenation option to bz2.decompress stream filter.
   (Keisial at gmail dot com, Greg)
 - Added support for using compressed connections with PDO_mysql. (Johannes)
+- Added default flags for suncc compiler. (David Soria Parra)
 
 - Deprecated define_syslog_variables(). (Kalle)
 



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