automake
[Top][All Lists]
Advanced

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

Re: Specifying AM_CPPFLAGS from within configure.ac


From: Ralf Wildenhues
Subject: Re: Specifying AM_CPPFLAGS from within configure.ac
Date: Mon, 6 Jun 2005 17:31:51 +0200
User-agent: Mutt/1.4.1i

Hi Jirka,

* Jirka Hanika wrote on Sat, Jun 04, 2005 at 10:12:18PM CEST:
> 
> I've decided to send one more piece of reaction directly to you, because it
> doesn't belong to the automake list anymore and it might confuse the
> AC_COMPILER_OPTION thread on the autoconf list unless verbosely
> introduced.

Actually, I believe this is very much on-topic on the list, and also of
potential interest to others.  I hope you don't mind I copy to the list
(I also don't like much to discuss public matters in private).

> In fact the reason why I initially meddled with that option selection
> macro was that on Mac OS X, a project of mine required some aboriginal
> -framework whatever linker option (well, maybe a compiler option, I don't
> have direct access to check) to build at all.  So I decided I want to
> feed the option to every compiler which will at least ignore it.

Not a very good idea, I believe.  I know we put a lot of extra stuff for
Darwin into Libtool (but I am very ignorant of it myself, so I am very
much the wrong person to ask).

Somebody _will_ already have encountered the "-framework addition
problem" and might be able to give advice specific to this.  I believe
this should be solved differently from the kind of macro I proposed.

> I can't reasonably expect people to put it in CXXFLAGS or LDFLAGS, as
> the specified framework is project-specific.  On the other hand,
> including such options among CXXFLAGS by the builder is often clearly
> standard practice.  With options which may not be duplicated on the
> command line, this may lead to absurd, though hopefully not harmful effects.
> 
> Therefore, unless I'm misusing autoconf, the borderline between CFLAGS and
> AC_COMPILER_OPTION is a fuzzy one.

Well, sometimes you have to have the user specify CFLAGS (my
experience), at least if you want to avoid to ever outsmart her.

> With reference to your planned AC_COMPILER_OPTION I'd like to vote
> for an optional macro parameter specifying the test source.  Most people
> won't need it, for others it will be essential.

Yes, that might be a good idea.

[...]
> > 
> > Also, the options may depend on each other (and on options given in
> > CXXFLAGS/CPPFLAGS), so you should document your macro to not use the
> > ones given in $1 in sequence.
>
> (I should perhaps also add that I'm not sure that I fully understand the
> last abovequoted paragraph of yours, nor the argument why you purport to
> run 2*n compilations for n candidate options.  My naive implementation
> would be to run 1 compilation with neither and 1 with every single
> candidate.  Users may group strings of interdependent options using
> shell quoting if that is the desired behavior.  I may be missing something.)

If the user is allowed to specify the source, it will need 2*n
compilations for n different sources.
If the user only specifies one source, we can do with n+1.  We still
need to specify whether to accumulate options or select just one.

As to interdependence of options:  just think of
  -Wall -Wno-unused
with gcc (and an unfortunate source file).  There are much more complex
examples (and the example given is bad as such options should not be put
in there, most likely).

Regards,
Ralf




reply via email to

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