foreach my $X (sort keys %valid)
{
my $one_name = $X . '_' . $primary;
- if (&variable_defined ($one_name))
- {
- my $strip_subdir = 1;
- # If subdir prefix should be preserved, do so.
- if ($X =~ /^nobase_/)
- {
- $strip_subdir = 0;
- $X =~ s/^nobase_//;
- }
+ next
+ unless (&variable_defined ($one_name));
- my $nodir_name = $X;
- # If files should be distributed, do so.
- my $dist_p = 0;
- if ($can_dist)
- {
- $dist_p = (($default_dist && $one_name !~ /^nodist_/)
- || (! $default_dist && $one_name =~ /^dist_/));
- $nodir_name =~ s/^(dist|nodist)_//;
- }
+ my $strip_subdir = 1;
+ # If subdir prefix should be preserved, do so.
+ if ($X =~ /^nobase_/)
+ {
+ $strip_subdir = 0;
+ $X =~ s/^nobase_//;
+ }
- # Append actual contents of where_PRIMARY variable to
- # result.
- foreach my $rcurs (&variable_value_as_list ($one_name, 'all'))
- {
- # Skip configure substitutions. Possibly bogus.
- if ($rcurs =~ /^\@.*\@$/)
- {
- if ($X eq 'EXTRA')
- {
- if (! $warned_about_extra)
- {
- $warned_about_extra = 1;
- &am_line_error ($one_name,
- "`$one_name' contains configure substitution, but shouldn't");
- }
- }
- # Check here to make sure variables defined in
- # configure.ac do not imply that EXTRA_PRIMARY
- # must be defined.
- elsif (! defined $configure_vars{$one_name})
- {
- $require_extra = $one_name
- if $do_require;
- }
+ my $nodir_name = $X;
+ # If files should be distributed, do so.
+ my $dist_p = 0;
+ if ($can_dist)
+ {
+ $dist_p = (($default_dist && $one_name !~ /^nodist_/)
+ || (! $default_dist && $one_name =~ /^dist_/));
+ $nodir_name =~ s/^(dist|nodist)_//;
+ }
- next;
- }
+ # Append actual contents of where_PRIMARY variable to
+ # result.
+ foreach my $rcurs (&variable_value_as_list ($one_name, 'all'))
+ {
+ # Skip configure substitutions. Possibly bogus.
+ if ($rcurs =~ /^\@.*\@$/)
+ {
+ if ($X eq 'EXTRA')
+ {
+ if (! $warned_about_extra)
+ {
+ $warned_about_extra = 1;
+ &am_line_error ($one_name,
+ "`$one_name' contains configure substitution, but shouldn't");
+ }
+ }
+ # Check here to make sure variables defined in
+ # configure.ac do not imply that EXTRA_PRIMARY
+ # must be defined.
+ elsif (! defined $configure_vars{$one_name})
+ {
+ $require_extra = $one_name
+ if $do_require;
+ }
- push (@result, $rcurs);
- }
+ next;
+ }
- # A blatant hack: we rewrite each _PROGRAMS primary to
- # include EXEEXT when in Cygwin32 mode.
- if ($primary eq 'PROGRAMS')
- {
- my @conds = &variable_conditions ($one_name);
+ push (@result, $rcurs);
+ }
- my @condvals;
- foreach my $cond (@conds)
+ # A blatant hack: we rewrite each _PROGRAMS primary to
+ # include EXEEXT when in Cygwin32 mode.
+ if ($primary eq 'PROGRAMS')
+ {
+ my @conds = &variable_conditions ($one_name);
+
+ my @condvals;
+ foreach my $cond (@conds)
+ {
+ my @one_binlist = ();
+ my @condval = &variable_value_as_list ($one_name,
+ $cond);
+ foreach my $rcurs (@condval)
{
- my @one_binlist = ();
- my @condval = &variable_value_as_list ($one_name,
- $cond);
- foreach my $rcurs (@condval)
+ if ($rcurs =~ /\./ || $rcurs =~ /^\@.*\@$/)
{
- if ($rcurs =~ /\./ || $rcurs =~ /^\@.*\@$/)
- {
- push (@one_binlist, $rcurs);
- }
- else
- {
- push (@one_binlist, $rcurs . '$(EXEEXT)');
- }
+ push (@one_binlist, $rcurs);
+ }
+ else
+ {
+ push (@one_binlist, $rcurs . '$(EXEEXT)');
}
-
- push (@condvals, $cond);
- push (@condvals, join (' ', @one_binlist));
}
- variable_delete ($one_name);
- while (@condvals)
- {
- my $cond = shift (@condvals);
- my @val = split (' ', shift (@condvals));
- &define_pretty_variable ($one_name, $cond, @val);
- }
- }
+ push (@condvals, $cond);
+ push (@condvals, join (' ', @one_binlist));
+ }
- # "EXTRA" shouldn't be used when generating clean targets,
- # all, or install targets.
- if ($X eq 'EXTRA')
- {
- # We used to warn if EXTRA_FOO was defined uselessly,
- # but this was annoying.
- next;
- }
+ variable_delete ($one_name);
+ while (@condvals)
+ {
+ my $cond = shift (@condvals);
+ my @val = split (' ', shift (@condvals));
+ &define_pretty_variable ($one_name, $cond, @val);
+ }
+ }
- if ($X eq 'check')
- {
- push (@check, '$(' . $one_name . ')');
- }
- else
- {
- push (@used, '$(' . $one_name . ')');
- }
+ # "EXTRA" shouldn't be used when generating clean targets,
+ # all, or install targets.
+ if ($X eq 'EXTRA')
+ {
+ # We used to warn if EXTRA_FOO was defined uselessly,
+ # but this was annoying.
+ next;
+ }
- # Is this to be installed?
- my $install_p = $X ne 'noinst' && $X ne 'check';
+ if ($X eq 'check')
+ {
+ push (@check, '$(' . $one_name . ')');
+ }
+ else
+ {
+ push (@used, '$(' . $one_name . ')');
+ }
- # If so, with install-exec? (or install-data?).
- my $exec_p = (defined $exec_dir_p {$X}
- ? $exec_dir_p {$X}
- : ($X =~ /exec/));
+ # Is this to be installed?
+ my $install_p = $X ne 'noinst' && $X ne 'check';
- # Singular form of $PRIMARY.
- (my $one_primary = $primary) =~ s/S$//;
- $output_rules .= &file_contents ($file,
- ('FIRST' => $first,
+ # If so, with install-exec? (or install-data?).
+ my $exec_p = (defined $exec_dir_p {$X}
+ ? $exec_dir_p {$X}
+ : ($X =~ /exec/));
- 'PRIMARY' => $primary,
- 'ONE_PRIMARY' => $one_primary,
- 'DIR' => $X,
- 'NDIR' => $nodir_name,
- 'BASE' => $strip_subdir,
+ # Singular form of $PRIMARY.
+ (my $one_primary = $primary) =~ s/S$//;
+ $output_rules .= &file_contents ($file,
+ ('FIRST' => $first,
- 'EXEC' => $exec_p,
- 'INSTALL' => $install_p,
- 'DIST' => $dist_p));
+ 'PRIMARY' => $primary,
+ 'ONE_PRIMARY' => $one_primary,
+ 'DIR' => $X,
+ 'NDIR' => $nodir_name,
+ 'BASE' => $strip_subdir,
- $first = '';
- }
+ 'EXEC' => $exec_p,
+ 'INSTALL' => $install_p,
+ 'DIST' => $dist_p));
+
+ $first = '';
}
# The JAVA variable is used as the name of the Java interpreter.