# There are a few install-related variables that you should not define.
foreach my $var ('PRE_INSTALL', 'POST_INSTALL', 'NORMAL_INSTALL')
{
- if (&variable_defined ($var) && !$var_is_am{$var})
+ if (variable_defined ($var) && !$var_is_am{$var})
{
macro_error ($var, "`$var' should not be defined");
}
}
push (@sources, '$(SOURCES)')
- if &variable_defined ('SOURCES');
+ if variable_defined ('SOURCES');
# Must do this after reading .am file. See read_main_am_file to
# understand weird tricks we play there with variables.
&handle_all ($output);
# FIXME: Gross!
- if (&variable_defined('lib_LTLIBRARIES') &&
- &variable_defined('bin_PROGRAMS'))
+ if (variable_defined ('lib_LTLIBRARIES') &&
+ variable_defined ('bin_PROGRAMS'))
{
$output_rules .= "install-binPROGRAMS: install-libLTLIBRARIES\n\n";
}
&handle_clean;
&handle_factored_dependencies;
- &check_typos;
+ check_typos ();
if (! -d ($output_directory . '/' . $am_relative_dir))
{
# Handle AUTOMAKE_OPTIONS variable. Return 1 on error, 0 otherwise.
sub handle_options
{
- if (&variable_defined ('AUTOMAKE_OPTIONS'))
+ if (variable_defined ('AUTOMAKE_OPTIONS'))
{
foreach (&variable_value_as_list_recursive ('AUTOMAKE_OPTIONS', ''))
{
'dist_EXTRA_', 'nodist_EXTRA_')
{
my @files;
- if (&variable_defined ($prefix . $one_file . '_SOURCES'))
+ if (variable_defined ($prefix . $one_file . '_SOURCES'))
{
@files = &variable_value_as_list_recursive (
($prefix . $one_file . '_SOURCES'),
foreach my $file (@files)
{
- if (defined $libsources{$file})
- {
- macro_error ($prefix . $one_file . '_SOURCES',
- "automatically discovered file `$file' should not be explicitly mentioned");
- }
+ macro_error ($prefix . $one_file . '_SOURCES',
+ "automatically discovered file `$file' should not be explicitly mentioned")
+ if defined $libsources{$file};
}
}
}
$object = $base . $this_obj_ext;
if (defined $lang->flags
- && &variable_defined ($derived . '_' . $lang->flags))
+ && variable_defined ($derived . '_' . $lang->flags))
{
# We have a per-executable flag in effect for this
# object. In this case we rewrite the object's
# override.
my $dname = $derived;
- if (&variable_defined ($derived . '_SHORTNAME'))
+ if (variable_defined ($derived . '_SHORTNAME'))
{
# FIXME: should use the same conditional as
# the _SOURCES variable. But this is really
my ($linker) = '';
- if (&variable_defined ($one_file . "_OBJECTS"))
+ if (variable_defined ($one_file . "_OBJECTS"))
{
macro_error ($one_file . '_OBJECTS',
$one_file . '_OBJECTS', 'should not be defined');
$used_pfx{$xpfx} = 1
unless $prefix =~ /EXTRA_/;
- push (@sources, '$(' . $prefix . $one_file . "_SOURCES)");
- push (@dist_sources, '$(' . $prefix . $one_file . "_SOURCES)")
+ push @sources, "\$($var)";
+ push @dist_sources, "\$($var)"
unless $prefix =~ /^nodist_/;
@substfroms = ();
my ($xname, $var) = @_;
prog_error ("handle_lib_objects: $var undefined")
- if ! &variable_defined ($var);
+ if ! variable_defined ($var);
my $ret = 0;
foreach my $cond (variable_conditions_recursive ($var))
push (@dep_list, $lsearch);
$seen_libobjs = 1;
if (! keys %libsources
- && ! &variable_defined ($lt . 'LIBOBJS'))
+ && ! variable_defined ($lt . 'LIBOBJS'))
{
macro_error ($var,
"\@$lt" . "LIBOBJS\@ seen but never set in `$configure_ac'");
($rewrite = $iter) =~ s/(\W)/\\$1/g;
$rewrite = "^" . $rewrite . "\$";
# Only require the file if it is not a built source.
- if (! &variable_defined ('BUILT_SOURCES')
+ if (! variable_defined ('BUILT_SOURCES')
|| ! grep (/$rewrite/,
&variable_value_as_list_recursive (
'BUILT_SOURCES', 'all')))
}
}
- if ($xname ne '' && ! &variable_defined ($xname . '_DEPENDENCIES', $cond))
+ if ($xname ne '' && ! variable_defined ($xname . '_DEPENDENCIES', $cond))
{
define_pretty_variable ($xname . '_DEPENDENCIES', $cond, @dep_list);
}
macro_error ("$name$xt",
"invalid variable `$name$xt'; "
. "should be `$xname$xt'")
- if &variable_defined ("$name$xt");
+ if variable_defined ("$name$xt");
}
}
{
$default_includes = ' -I. -I$(srcdir)';
- if (&variable_defined ('CONFIG_HEADER'))
+ if (variable_defined ('CONFIG_HEADER'))
{
foreach my $hdr (split (' ', &variable_value ('CONFIG_HEADER')))
{
my $linker = &handle_source_transform ($xname, $one_file, $obj);
my $xt = '';
- if (&variable_defined ($xname . "_LDADD"))
+ if (variable_defined ($xname . "_LDADD"))
{
if (&handle_lib_objects ($xname, $xname . '_LDADD'))
{
# This does a bit too much work. But we need it to
# generate _DEPENDENCIES when appropriate.
- if (&variable_defined ('LDADD'))
+ if (variable_defined ('LDADD'))
{
if (&handle_lib_objects ($xname, 'LDADD'))
{
$seen_libobjs = 1;
}
}
- elsif (! &variable_defined ($xname . '_DEPENDENCIES'))
+ elsif (! variable_defined ($xname . '_DEPENDENCIES'))
{
&define_variable ($xname . '_DEPENDENCIES', '');
}
$xt = '_SOURCES'
}
- if (&variable_defined ($xname . '_LIBADD'))
+ if (variable_defined ($xname . '_LIBADD'))
{
macro_error ($xname . '_LIBADD',
"use `" . $xname . "_LDADD', not `"
. $xname . "_LIBADD'");
}
- if (! &variable_defined ($xname . '_LDFLAGS'))
+ if (! variable_defined ($xname . '_LDFLAGS'))
{
# Define the prog_LDFLAGS variable.
&define_variable ($xname . '_LDFLAGS', '');
# Determine program to use for link.
my $xlink;
- if (&variable_defined ($xname . '_LINK'))
+ if (variable_defined ($xname . '_LINK'))
{
$xlink = $xname . '_LINK';
}
'EXEEXT' => $extension));
}
- if (&variable_defined ('LDADD') && &handle_lib_objects ('', 'LDADD'))
+ if (variable_defined ('LDADD') && &handle_lib_objects ('', 'LDADD'))
{
$seen_libobjs = 1;
}
{
my $xname = &canonicalize ($one_file);
- if (&variable_defined ($xname . '_LDADD'))
+ if (variable_defined ($xname . '_LDADD'))
{
&check_libobjs_sources ($xname, $xname . '_LDADD');
}
- elsif (&variable_defined ('LDADD'))
+ elsif (variable_defined ('LDADD'))
{
&check_libobjs_sources ($xname, 'LDADD');
}
'_OBJECTS', '_DEPENDENCIES',
'_AR');
- if (! &variable_defined ($xlib . '_AR'))
+ if (! variable_defined ($xlib . '_AR'))
{
&define_variable ($xlib . '_AR', '$(AR) cru');
}
- if (&variable_defined ($xlib . '_LIBADD'))
+ if (variable_defined ($xlib . '_LIBADD'))
{
if (&handle_lib_objects ($xlib, $xlib . '_LIBADD'))
{
&define_variable ($xlib . "_LIBADD", '');
}
- if (&variable_defined ($xlib . '_LDADD'))
+ if (variable_defined ($xlib . '_LDADD'))
{
macro_error ($xlib . '_LDADD',
"use `" . $xlib . "_LIBADD', not `"
foreach my $onelib (@liblist)
{
my $xlib = &canonicalize ($onelib);
- if (&variable_defined ($xlib . '_LIBADD'))
+ if (variable_defined ($xlib . '_LIBADD'))
{
&check_libobjs_sources ($xlib, $xlib . '_LIBADD');
}
}
# Get the installation directory of each library.
- for (&variable_value_as_list_recursive ($key . '_LTLIBRARIES', 'all'))
+ for (variable_value_as_list_recursive ($key . '_LTLIBRARIES', 'all'))
{
if ($instdirs{$_})
{
- &am_error ("`$_' is already going to be installed in `$instdirs{$_}'");
+ am_error ("`$_' is already going to be installed in `$instdirs{$_}'");
}
else
{
'_SOURCES', '_OBJECTS',
'_DEPENDENCIES');
- if (! &variable_defined ($xlib . '_LDFLAGS'))
+ if (! variable_defined ($xlib . '_LDFLAGS'))
{
# Define the lib_LDFLAGS variable.
&define_variable ($xlib . '_LDFLAGS', '');
# Check that the library fits the standard naming convention.
my $libname_rx = "^lib.*\.la";
- if ((&variable_defined ($xlib . '_LDFLAGS')
+ if ((variable_defined ($xlib . '_LDFLAGS')
&& grep (/-module/, &variable_value_as_list_recursive (
$xlib . '_LDFLAGS', 'all')))
- || (&variable_defined ('LDFLAGS')
+ || (variable_defined ('LDFLAGS')
&& grep (/-module/, &variable_value_as_list_recursive (
'LDFLAGS', 'all'))))
{
&am_error ("`$onelib' is not a standard libtool library name");
}
- if (&variable_defined ($xlib . '_LIBADD'))
+ if (variable_defined ($xlib . '_LIBADD'))
{
if (&handle_lib_objects ($xlib, $xlib . '_LIBADD'))
{
&define_variable ($xlib . "_LIBADD", '');
}
- if (&variable_defined ($xlib . '_LDADD'))
+ if (variable_defined ($xlib . '_LDADD'))
{
macro_error ($xlib . '_LDADD',
"use `" . $xlib . "_LIBADD', not `"
# Determine program to use for link.
my $xlink;
- if (&variable_defined ($xlib . '_LINK'))
+ if (variable_defined ($xlib . '_LINK'))
{
$xlink = $xlib . '_LINK';
}
foreach my $onelib (@liblist)
{
my $xlib = &canonicalize ($onelib);
- if (&variable_defined ($xlib . '_LIBADD'))
+ if (variable_defined ($xlib . '_LIBADD'))
{
&check_libobjs_sources ($xlib, $xlib . '_LIBADD');
}
# See if any _SOURCES variable were misspelled. Also, make sure that
# EXTRA_ variables don't contain configure substitutions.
-sub check_typos
+sub check_typos ()
{
foreach my $varname (keys %var_value)
{
foreach my $primary ('_SOURCES', '_LIBADD', '_LDADD', '_LDFLAGS',
'_DEPENDENCIES')
{
- if ($varname =~ /$primary$/ && ! $content_seen{$varname})
- {
- macro_error ($varname,
- "invalid unused variable name: `$varname'");
- }
+ macro_error ($varname,
+ "invalid unused variable name: `$varname'")
+ if $varname =~ /$primary$/ && ! $content_seen{$varname};
}
}
}
+
# Handle scripts.
sub handle_scripts
{
# ($DO-SOMETHING, $TEXICLEANS)
# handle_texinfo_helper ()
-# -----------------
+# ------------------------
# Handle all Texinfo source; helper for handle_texinfo
sub handle_texinfo_helper
{
macro_error ('TEXINFOS',
"`TEXINFOS' is an anachronism; use `info_TEXINFOS'")
- if &variable_defined ('TEXINFOS');
- return (0, '') if (! &variable_defined ('info_TEXINFOS')
- && ! &variable_defined ('html_TEXINFOS'));
+ if variable_defined ('TEXINFOS');
+ return (0, '') if (! variable_defined ('info_TEXINFOS')
+ && ! variable_defined ('html_TEXINFOS'));
- if (&variable_defined ('html_TEXINFOS'))
+ if (variable_defined ('html_TEXINFOS'))
{
macro_error ('html_TEXINFOS',
"HTML generation not yet supported");
push (@texi_deps, '$(srcdir)/' . $vtexi) if $vtexi;
my $canonical = &canonicalize ($infobase);
- if (&variable_defined ($canonical . "_TEXINFOS"))
+ if (variable_defined ($canonical . "_TEXINFOS"))
{
push (@texi_deps, '$(' . $canonical . '_TEXINFOS)');
&push_dist_common ('$(' . $canonical . '_TEXINFOS)');
&define_variable ('TEXINFO_TEX', "$texinfodir/texinfo.tex");
$need_texi_file = 2; # so that we require_conf_file later
}
- elsif (&variable_defined ('TEXINFO_TEX'))
+ elsif (variable_defined ('TEXINFO_TEX'))
{
# The user defined TEXINFO_TEX so assume he knows what he is
# doing.
sub handle_man_pages
{
macro_error ('MANS', "`MANS' is an anachronism; use `man_MANS'")
- if &variable_defined ('MANS');
+ if variable_defined ('MANS');
# Find all the sections in use. We do this by first looking for
# "standard" sections, and then looking for any additional
# Add more sections as needed.
foreach my $section ('0'..'9', 'n', 'l')
{
- if (&variable_defined ($pfx . 'man' . $section . '_MANS'))
+ if (variable_defined ($pfx . 'man' . $section . '_MANS'))
{
$sections{$section} = 1;
$vlist{'$(' . $pfx . 'man' . $section . '_MANS)'} = 1;
}
}
- if (&variable_defined ($pfx . 'man_MANS'))
+ if (variable_defined ($pfx . 'man_MANS'))
{
$vlist{'$(' . $pfx . 'man_MANS)'} = 1;
foreach (&variable_value_as_list_recursive ($pfx . 'man_MANS', 'all'))
sub handle_tags
{
my @tag_deps = ();
- if (&variable_defined ('SUBDIRS'))
+ if (variable_defined ('SUBDIRS'))
{
$output_rules .= ("tags-recursive:\n"
. "\tlist=\'\$(SUBDIRS)\'; for subdir in \$\$list; do \\\n"
}
if (&saw_sources_p (1)
- || &variable_defined ('ETAGS_ARGS')
+ || variable_defined ('ETAGS_ARGS')
|| @tag_deps)
{
my @config;
'DIRS' => "@tag_deps"));
&examine_variable ('TAGS_DEPENDENCIES');
}
- elsif (&variable_defined ('TAGS_DEPENDENCIES'))
+ elsif (variable_defined ('TAGS_DEPENDENCIES'))
{
macro_error ('TAGS_DEPENDENCIES',
"doesn't make sense to define `TAGS_DEPENDENCIES' without sources or `ETAGS_ARGS'");
# subdir. If so, add it to the list. I didn't want to do this
# originally, but there were so many requests that I finally
# relented.
- if (&variable_defined ('EXTRA_DIST'))
+ if (variable_defined ('EXTRA_DIST'))
{
# FIXME: This should be fixed to work with conditionals. That
# will require only making the entries in %dist_dirs under the
# If we have SUBDIRS, create all dist subdirectories and do
# recursive build.
- if (&variable_defined ('SUBDIRS'))
+ if (variable_defined ('SUBDIRS'))
{
# If SUBDIRS is conditionally defined, then set DIST_SUBDIRS
# to all possible directories, and use it. If DIST_SUBDIRS is
# one project uses so many conditional subdirectories that
# calling variable_conditionally_defined on SUBDIRS will cause
# automake to grow to 150Mb. Sigh.
- if (&variable_defined ('DIST_SUBDIRS')
+ if (variable_defined ('DIST_SUBDIRS')
|| variable_conditionally_defined ('SUBDIRS'))
{
$dist_subdir_name = 'DIST_SUBDIRS';
- if (! &variable_defined ('DIST_SUBDIRS'))
+ if (! variable_defined ('DIST_SUBDIRS'))
{
define_pretty_variable
('DIST_SUBDIRS', '',
$transform{'DIST-TARGETS'} = join(' ', @dist_targets);
# Defining $(DISTDIR).
- $transform{'DISTDIR'} = !&variable_defined('distdir');
+ $transform{'DISTDIR'} = !variable_defined('distdir');
$transform{'TOP_DISTDIR'} = backname ($relative_dir);
$output_rules .= &file_contents ('distdir', %transform);
sub handle_subdirs
{
return
- unless &variable_defined ('SUBDIRS');
+ unless variable_defined ('SUBDIRS');
# Make sure each directory mentioned in SUBDIRS actually exists.
foreach my $dir (&variable_value_as_list_recursive ('SUBDIRS', 'all'))
push @ac_deps, 'acinclude.m4';
}
- if (&variable_defined ('ACLOCAL_M4_SOURCES'))
+ if (variable_defined ('ACLOCAL_M4_SOURCES'))
{
push (@ac_deps, '$(ACLOCAL_M4_SOURCES)');
}
- elsif (&variable_defined ('ACLOCAL_AMFLAGS'))
+ elsif (variable_defined ('ACLOCAL_AMFLAGS'))
{
# Scan all -I directories for m4 files. These are our
# dependencies.
{
return if ! $seen_gettext || $relative_dir ne '.';
- if (! &variable_defined ('SUBDIRS'))
+ if (! variable_defined ('SUBDIRS'))
{
conf_error ("AM_GNU_GETTEXT used but SUBDIRS not defined");
return;
# before .SUFFIXES. So we make sure that .SUFFIXES appears before
# anything else, by sticking it right after the default: target.
$output_header .= ".SUFFIXES:\n";
- if (@suffixes || &variable_defined ('SUFFIXES'))
+ if (@suffixes || variable_defined ('SUFFIXES'))
{
# Make sure suffixes has unique elements. Sort them to ensure
# the output remains consistent. However, $(SUFFIXES) is
# suffixes, and this lets the user have some control. Push
# actual suffixes, and not $(SUFFIXES). Some versions of make
# do not like variable substitutions on the .SUFFIXES line.
- my @user_suffixes = (&variable_defined ('SUFFIXES')
+ my @user_suffixes = (variable_defined ('SUFFIXES')
? &variable_value_as_list_recursive ('SUFFIXES', '')
: ());
my @local_headers = ();
push @local_headers, '$(BUILT_SOURCES)'
- if &variable_defined ('BUILT_SOURCES');
+ if variable_defined ('BUILT_SOURCES');
foreach my $spec (@config_headers)
{
my ($out, @ins) = split_config_file_spec ($spec);
$output_all .= ("all: @local_headers"
. "\n\t"
. '$(MAKE) $(AM_MAKEFLAGS) '
- . (&variable_defined ('SUBDIRS')
+ . (variable_defined ('SUBDIRS')
? 'all-recursive' : 'all-am')
. "\n\n");
}
else
{
- $output_all .= "all: " . (&variable_defined ('SUBDIRS')
+ $output_all .= "all: " . (variable_defined ('SUBDIRS')
? 'all-recursive' : 'all-am') . "\n\n";
}
}
&depend ('.PHONY', 'check', 'check-am');
$output_rules .= ("check: "
- . (&variable_defined ('SUBDIRS')
+ . (variable_defined ('SUBDIRS')
? 'check-recursive' : 'check-am')
. "\n");
}
# Don't include `MAINTAINER'; it is handled specially below.
foreach my $name ('MOSTLY', '', 'DIST')
{
- $transform{"${name}CLEAN"} = &variable_defined ("${name}CLEANFILES");
+ $transform{"${name}CLEAN"} = variable_defined ("${name}CLEANFILES");
}
# Built sources are automatically removed by maintainer-clean.
push (@maintainer_clean_files, '$(BUILT_SOURCES)')
- if &variable_defined ('BUILT_SOURCES');
+ if variable_defined ('BUILT_SOURCES');
push (@maintainer_clean_files, '$(MAINTAINERCLEANFILES)')
- if &variable_defined ('MAINTAINERCLEANFILES');
+ if variable_defined ('MAINTAINERCLEANFILES');
$output_rules .= &file_contents ('clean',
(%transform,
{
macro_error ($c,
"`$c' defined but `dejagnu' not in `AUTOMAKE_OPTIONS'")
- if &variable_defined ($c);
+ if variable_defined ($c);
}
}
- if (&variable_defined ('TESTS'))
+ if (variable_defined ('TESTS'))
{
push (@check_tests, 'check-TESTS');
$output_rules .= &file_contents ('check');
push (@all, '$(ELCFILES)');
&am_error ("`lisp_LISP' defined but `AM_PATH_LISPDIR' not in `$configure_ac'")
- if ! $am_lispdir_location && &variable_defined ('lisp_LISP');
+ if ! $am_lispdir_location && variable_defined ('lisp_LISP');
require_conf_file ($am_lispdir_location, $FOREIGN, 'elisp-comp');
&define_variable ('elisp_comp', $config_aux_dir . '/elisp-comp');
# Found some python.
&am_error ("`python_PYTHON' defined but `AM_PATH_PYTHON' not in `$configure_ac'")
- if ! $pythondir_location && &variable_defined ('python_PYTHON');
+ if ! $pythondir_location && variable_defined ('python_PYTHON');
require_conf_file ($pythondir_location, $FOREIGN, 'py-compile');
&define_variable ('py_compile', $config_aux_dir . '/py-compile');
my $dir;
foreach my $curs (@valid)
{
- if (! &variable_defined ($curs . '_JAVA') || $curs eq 'EXTRA')
+ if (! variable_defined ($curs . '_JAVA') || $curs eq 'EXTRA')
{
next;
}
my ($self, $aggregate, $output, $input) = @_;
my $flag = $aggregate . "_YFLAGS";
- if ((&variable_defined ($flag)
+ if ((variable_defined ($flag)
&& &variable_value ($flag) =~ /$DASH_D_PATTERN/o)
- || (&variable_defined ('YFLAGS')
+ || (variable_defined ('YFLAGS')
&& &variable_value ('YFLAGS') =~ /$DASH_D_PATTERN/o))
{
(my $output_base = $output) =~ s/\..*$//;
return if defined $language_scratch{'yacc-done'};
$language_scratch{'yacc-done'} = 1;
- if (&variable_defined ('YACCFLAGS'))
+ if (variable_defined ('YACCFLAGS'))
{
macro_error ('YACCFLAGS',
"`YACCFLAGS' obsolete; use `YFLAGS' instead");
# $BOOLEAN
-# &variable_defined ($VAR, [$COND])
+# variable_defined ($VAR, [$COND])
# ---------------------------------
# See if a variable exists. $VAR is the variable name, and $COND is
# the condition which we should check. If no condition is given, we
# currently return true if the variable is defined under any
# condition.
-sub variable_defined ($$)
+sub variable_defined ($;$)
{
my ($var, $cond) = @_;
sub examine_variable
{
my ($var) = @_;
- &variable_defined ($var);
+ variable_defined ($var);
}
# Return the set of conditions for which a variable is defined.
# macro_define and variable_pretty_output.
$cond ||= 'TRUE';
- if (! &variable_defined ($var, $cond))
+ if (! variable_defined ($var, $cond))
{
macro_define ($var, 1, '', $cond, "@value", undef);
variable_pretty_output ($var, $cond || 'TRUE');
'INSTALL-MAN' => !$options{'no-installman'},
'CK-NEWS' => $options{'check-news'} || 0,
- 'SUBDIRS' => &variable_defined ('SUBDIRS'),
+ 'SUBDIRS' => variable_defined ('SUBDIRS'),
'TOPDIR' => backname ($relative_dir),
'TOPDIR_P' => $relative_dir eq '.',
'CONFIGURE-AC' => $configure_ac,
"invalid variable `$varname': `dist' is forbidden")
if ! exists $configure_vars{$varname};
}
- elsif (! defined $valid{$X} && ! &variable_defined ("${X}dir"))
+ elsif (! defined $valid{$X} && ! variable_defined ("${X}dir"))
{
# Note that a configure variable is always legitimate.
# It is natural to name such variables after the
# interpreter. This is but one of several Java hacks. Similarly,
# `PYTHON' is customarily used to mean the Python interpreter.
macro_error ($primary, "`$primary' is an anachronism")
- if &variable_defined ($primary)
+ if variable_defined ($primary)
&& ($primary ne 'JAVA' && $primary ne 'PYTHON');
my $nodir_name = $X;
my $one_name = $X . '_' . $primary;
next
- unless (&variable_defined ($one_name));
+ unless (variable_defined ($one_name));
my $strip_subdir = 1;
# If subdir prefix should be preserved, do so.
$output_vars .= "\n";
}
- if ($require_extra && ! &variable_defined ('EXTRA_' . $primary))
+ if ($require_extra && ! variable_defined ('EXTRA_' . $primary))
{
macro_error ($require_extra,
"`$require_extra' contains configure substitution, but `EXTRA_$primary' not defined");