[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: changing the default compilers for autoconf
From: |
Ralf Wildenhues |
Subject: |
Re: changing the default compilers for autoconf |
Date: |
Fri, 7 Sep 2007 15:46:04 +0200 |
User-agent: |
Mutt/1.5.16 (2007-07-25) |
Hello Sanjay,
* Sanjay Gianchandani wrote on Fri, Sep 07, 2007 at 02:55:16PM CEST:
> I have been working on Solaris, and have been trying to increase the
> efficiency of autoconf built softwares on the system.
> The main issue here is that autoconf by default, and as a rule, uses the GNU
> based compilers to make the software, while
> on Solaris, Sun Studio compilers prove to be much more efficient.
For yourself, just get in the habit of using
.../configure -C CC=cc CXX=CC F77=f77 FC=f95
or write a config.site file that sets these as defaults once and for
all, for your system; see
<http://www.gnu.org/software/autoconf/manual/html_node/Site-Defaults.html>
for more information.
If you want to change the defaults for your specific package, but every
user of it, then you can put something like
: ${CC=cc}
: ${CXX=CC}
# ...
in your configure.ac, right before AC_PROG_CC; but be warned that users
may not like your decision all that much and at least require that you
do this only on Solaris. For that, invoke AC_CANONICAL_HOST and then
match $host against *-*-solaris*:
AC_CANONICAL_HOST
case $host in
*-*-solaris*) : ${CC=cc} ... ;;
esac
AC_PROG_CC
As to changing Autoconf's defaults globally, i.e., for everyone and
every package without package-specific modifications: preference of GCC,
the GNU Compiler Collection, is a policy decision. From an effort point
of view, you'd have more luck in improving GCC so that it ends up being
the better compiler, than getting GNU to promote a proprietary compiler
over its own free one. ;-)
Cheers,
Ralf