automake-patches
[Top][All Lists]
Advanced

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

Re: AM_DEFAULT_SOURCE_EXT


From: Ralf Wildenhues
Subject: Re: AM_DEFAULT_SOURCE_EXT
Date: Tue, 21 Oct 2008 05:00:34 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

* Akim Demaille wrote on Mon, Oct 20, 2008 at 12:56:23AM CEST:
> Le 18 oct. 08 à 03:02, Ralf Wildenhues a écrit :
>> * Akim Demaille wrote on Thu, Oct 16, 2008 at 04:11:22PM CEST:
>>>
>>> I wish I could define
>>>
>>>  AM_DEFAULT_SOURCE_EXT = .cc
>>>
>>> or whatever, so that I wouldn't have to define all the foo_SOURCES.
>>
>> I agree "extension" is better than "suffix".  (Even if Automake itself
>> is inconsistent here and uses both.)
>
> Hum, actually I meant to use extensions without the dot :(

Erm, but you certainly didn't write it that way before!  ;-)

> Trying to  find a distinctive meaning to extension and suffix…  Of
> course you  should add a period before an extension to get a suffix
> only when the  extension is non-empty :)

This is a bike-shedding issue, right?  Or is there a real reason?

FWIW, I find it easier to search for if the dot is part of the thing;
also, most uses inside automake include the dot (accept_extension et
al).

>> I am wondering whether DEFAULT_SOURCE_EXT would be preferable to
>> AM_DEFAULT_SOURCE_EXT?
>
> I made it AM_ to avoid infringing on the user name space, but I'm fine  
> with just any name.

Yeah, not infringing is probably good.  Trying to find a general rule
would be even better.  Hmm,

  Variables using an `AM_' prefix are either automake-rule-specific
  sister variables of the respective user API variables without that
  prefix (typically, those end in `FLAGS'); or they change some mode
  of operation of `automake' runtime.

The second part is not consistent.

* AM_INSTALLCHECK_STD_OPTIONS_EXEMPT is purely 'make installcheck' run
  time issue,
* AM_COLOR_TESTS is purely a 'make check' run time issue,
* OTOH, AUTOMAKE_OPTIONS is important at 'automake' run time, but
  doesn't have the prefix.  ACLOCAL_AMFLAGS is also not so consistent.

I wonder now whether we should rename AM_COLOR_TESTS to COLOR_TESTS.
OTOH, as graphics program I might want to use the latter for something
entirely different...

>> +    (my $default_source = $unxformed) =~ s,(\.[^./\\]*)?$, 
>> $default_source_ext,;
>
> So Automake cannot leave with using "$(AM_DEFAULT_SOURCE_EXT)" as a  
> symbolic value?

No.

> It really needs to perform the substitution statically?  

Yes.

> Otherwise all the rest comes for free (conditionals, possibility to 
> change the extension on the command line (not that I think of a 
> particular use here, but...)).

Believe me, it won't come for free.  The *SOURCES parser is quite
involved just to deal with conditionals; it outright forbids symbolics.

>> +AM_DEFAULT_SOURCE_EXT = .cpp

> Just my 0.02 French Francs (yeah, I know, today the currency is €, but  
> in the context of criticism/critique, the French currency definitely  
> seems more appropriate): .cpp reminds me too me about CPP, I prefer 
> .cc/.cxx :)

And you're quite entitled to never use .cpp in your sources.  However,
it is the only extension for C++ source code that is accepted without
further command line option by every C++ compiler we know of.  (MS cl
needs a switch to come right before the name otherwise.)  So that is
not an issue of personal preference.

Cheers,
Ralf




reply via email to

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