Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:41911 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 64484 invoked from network); 13 Nov 2008 22:53:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Nov 2008 22:53:01 -0000 X-Host-Fingerprint: 93.133.84.186 krlh-5d8554ba.pool.einsundeins.de Received: from [93.133.84.186] ([93.133.84.186:23067] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B2/D6-07308-CCFAC194 for ; Thu, 13 Nov 2008 17:53:00 -0500 Message-ID: To: internals@lists.php.net Date: Thu, 13 Nov 2008 23:52:57 +0100 User-Agent: Thunderbird 2.0.0.17 (X11/20081023) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 93.133.84.186 Subject: [PATCH] Using cc as the default compiler From: dsp@php.net (David Soria Parra) Hi Internals, as I recently worked with different compilers, and I noticed that we always check for gcc by default. This means even your /usr/bin/cc is _not_ gcc, PHP's buildsystem will use gcc if it's found. This is the default behavior of the AC_PROG_CC macro. In my opinion, I think if people install another C compiler and make them their default compiler by putting the necessary path to cc first, they would like to use cc instead of gcc. Maybe I'm wrong in that point, but I consider 'cc' as the default C compiler on a system. We also have the checks for both ICC and SunCC in our buildsystem and they are handled well. Therefore I would suggest that we are checking for the cc binary by default and than fallback to gcc. I'm aware that people usually should use gcc as their default compiler, but if you specifically installed another compiler you might have good reasons to use it (because of the used architecture, or because you like to use software you bought). The implementation is straight forward as the AC_PROG_CC macro supports this (http://www.gnu.org/software/libtool/manual/autoconf/C-Compiler.html): Index: b/configure.in =================================================================== --- a/configure.in 2008-11-07 00:28:53.047697316 +0100 +++ b/configure.in 2008-11-11 00:19:08.794287603 +0100 @@ -140,7 +140,7 @@ dnl Checks for programs. dnl ------------------------------------------------------------------------- -AC_PROG_CC +AC_PROG_CC([cc]) PHP_DETECT_ICC PHP_DETECT_SUNCC AC_PROG_CC_C_O If there are no objections on this, I would like to commit this fix to 5.3 and 6.0. Regards David