bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: ac_compile


From: Ian Lance Taylor
Subject: Re: ac_compile
Date: 25 Jan 2001 09:03:23 -0800
User-agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.7

"Haefelinger, Wolfgang" <address@hidden> writes:

> I'm working with the beloved 'Autoconf version 2.13'.
> However there is, among others, a detail which I do
> not  understand:  In acgeneral.m4, line 1232  the variable
> $ac_compile to compile a C source file contains hard-wired
> the flag '-c' to avoid  the final linking pass. How do you
> know that "all C compilers" support this flag? 
> 
> My  naive  assumption  was that the flag -c gets added to
> the variable $CFLAGS. 
> 
> I was even more surprised to see that the variable $ac_link
> contains $CPPFLAGS as well as $CFLAGS. I do  not understand
> why we  need the flags to the preprocessor here? Again your
> assumption  is  that  the  'C' compiler can be used to link
> objects  into  an executable. Although this is true for all 
> the compiler I'm aware of, it is not true in general.

autoconf is intended to solve portabililty problems which arise in
practice.  It is not intended to solve all theoretically possible
portability problems.  If you start to imagine all possibilities, the
problem of portability becomes insurmountable in practice.

All C compilers take pretty much the same set of command line
options--after all, they all look back to the original Unix C
compiler--so autoconf pretty much doesn't worry about it.  If this
ever becomes an issue--if we ever need to port autoconf to a system
with a C compiler which does not follow these conventions--we can
worry about it then.  Worrying about the possibility beforehand is
probably wasted effort.

Ian



reply via email to

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