autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Configure for non-gcc compiler


From: Eric Blake
Subject: Re: Configure for non-gcc compiler
Date: Thu, 18 Apr 2013 13:23:09 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130402 Thunderbird/17.0.5

On 04/18/2013 12:06 PM, A.P. Horst wrote:
> Hi,
> 
> been trying my way in autotools land for a short while now, and I must
> say, it works like a charm.
> But there is one thing I've been breaking my head on for a while now.
> Many of my projects use GCC, some use a totally different compiler and
> worse, some are mixed. How do I go about that with autoconf? Is there an
> easy way to 'add' a compiler to check for? Or a hard way?

What do you mean by adding a compiler?  Your user can already do:

./configure CC=/path/to/weird/cc

to get whatever compiler they want, without you as the configure.ac
author even having to know about their weird compiler name.  As long as
you correctly wrote your configure.ac to do feature tests (such as "does
$CC -Wall work?") rather than hard-coded tests ("is $CC named GCC?" or
"is the compiler newer than version 1.5?"), then your configure script
should already just work.

Using AC_PROG_CC without arguments already provides your configure
script with a rather long list of compiler names to try, but it you are
absolutely certain that you want to make an even longer list of default
compiler names to try by default, you can call AC_PROG_CC([gcc cc ...])
to populate the list with your set of default names.  See
https://www.gnu.org/software/autoconf/manual/autoconf.html#C-Compiler
for details.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]