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

_______________________________________________
Autoconf mailing list
Autoconf@gnu.org
https://lists.gnu.org/mailman/listinfo/autoconf

Reply via email to