Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:41683 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65013 invoked from network); 5 Nov 2008 13:37:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Nov 2008 13:37:36 -0000 Authentication-Results: pb1.pair.com header.from=dsoria@gmx.net; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dsoria@gmx.net; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmx.net designates 213.165.64.20 as permitted sender) X-PHP-List-Original-Sender: dsoria@gmx.net X-Host-Fingerprint: 213.165.64.20 mail.gmx.net Linux 2.6 Received: from [213.165.64.20] ([213.165.64.20:53213] helo=mail.gmx.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D8/64-50953-E91A1194 for ; Wed, 05 Nov 2008 08:37:35 -0500 Received: (qmail invoked by alias); 05 Nov 2008 13:37:31 -0000 Received: from vpn-cl-165-173.rz.uni-karlsruhe.de (EHLO rzdu-fg-147-220.rz.uni-karlsruhe.de) [141.3.165.173] by mail.gmx.net (mp035) with SMTP; 05 Nov 2008 14:37:31 +0100 X-Authenticated: #235172 X-Provags-ID: V01U2FsdGVkX1/YkxVKdj7Yq/ks2KARh0i0RZHutEQ8Gqmz8oVyV+ RDl0qBeX5BWRSm Message-ID: <4911A199.5060501@gmx.net> Date: Wed, 05 Nov 2008 14:37:29 +0100 User-Agent: Thunderbird 2.0.0.17 (Macintosh/20080914) MIME-Version: 1.0 To: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.47 Subject: [PATCH] SunCC default options From: dsoria@gmx.net (David Soria Parra) I recently noticed if you want to compile PHP using the suncc compiler, there are no useful default flags set by configure. Therefore if there are no objections I want to commit the following patch that introduces usefull cflags (actually those used by php distributed by sun) for the suncc compiler if the user didn't provide his own cflags. In addition it makes sure that --enable-debug works for suncc. I tested the patch with sunstudio 11 and sunstudio 12 c compilers. The patch is for 5.3 so I won't commit this to 5.2. David Set default flags for suncc compiler Index: php53/acinclude.m4 =================================================================== --- php53.orig/acinclude.m4 2008-09-08 12:24:25.000000000 +0200 +++ php53/acinclude.m4 2008-11-05 01:22:40.403777976 +0100 @@ -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 Index: php53/configure.in =================================================================== --- php53.orig/configure.in 2008-09-01 22:51:57.000000000 +0200 +++ php53/configure.in 2008-11-05 01:22:40.404329417 +0100 @@ -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