Am 08.01.2016 um 16:03 schrieb Gavin Smith:
On 8 January 2016 at 14:33, Gavin Smith <gavinsmith0...@gmail.com> wrote:
Failing that, it would be better for conditional SHORTNAME to work,
instead of adding a new option.
For example:
--- automake-orig 2016-01-08 14:54:04.000000000 +0000
+++ /home/g/local/bin/automake 2016-01-08 15:06:06.000000000 +0000
@@ -1749,11 +1749,18 @@
my $var = var ($derived . '_SHORTNAME');
if ($var)
{
- # FIXME: should use the same Condition as
- # the _SOURCES variable. But this is really
- # silly overkill -- nobody should have
- # conditional shortnames.
- $dname = $var->variable_value;
+ # Use the same Condition as the _SOURCES variable.
+ my $sources_var = var ($derived . '_SOURCES');
+ if ($sources_var) {
+ my @conds = $sources_var->conditions->conds;
+ if (@conds) {
+ my $cond = $conds[0];
+ my $def = $var->def($cond);
+ if ($def) {
+ $dname = $def->value;
+ }
+ }
+ }
}
$object = $dname . '-' . $object;
What does Makefile.in look like with that? I found that _SHORTNAME is
evaluated at automake-time which is probably the reason it's not
supported in a conditional. I didn't think it would be feasible to make
_SHORTNAME work (not for me anyway, I'm completely new to automake's
source code).
I'd still prefer the option because it has the bonus of avoiding
repetitions like the following all over the place:
bin_PROGRAMS += foo
foo_SHORTNAME = foo
Thank you anyway!