summaryrefslogtreecommitdiff
path: root/bin/automake.in
diff options
context:
space:
mode:
Diffstat (limited to 'bin/automake.in')
-rwxr-xr-x[-rw-r--r--]bin/automake.in438
1 files changed, 4 insertions, 434 deletions
diff --git a/bin/automake.in b/bin/automake.in
index b4ae8f43f..ce2bc8919 100644..100755
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -50,6 +50,7 @@ BEGIN
import Thread::Queue;
}
}
+use Automake::Global;
use Automake::General;
use Automake::XFile;
use Automake::Channels;
@@ -130,97 +131,9 @@ sub usage ();
sub version ();
sub yacc_lex_finish_helper ();
-## ----------- ##
-## Constants. ##
-## ----------- ##
-
-# Some regular expressions. One reason to put them here is that it
-# makes indentation work better in Emacs.
-
-# Writing singled-quoted-$-terminated regexes is a pain because
-# perl-mode thinks of $' as the ${'} variable (instead of a $ followed
-# by a closing quote. Letting perl-mode think the quote is not closed
-# leads to all sort of misindentations. On the other hand, defining
-# regexes as double-quoted strings is far less readable. So usually
-# we will write:
-#
-# $REGEX = '^regex_value' . "\$";
-
-my $IGNORE_PATTERN = '^\s*##([^#\n].*)?\n';
-my $WHITE_PATTERN = '^\s*' . "\$";
-my $COMMENT_PATTERN = '^#';
-my $TARGET_PATTERN='[$a-zA-Z0-9_.@%][-.a-zA-Z0-9_(){}/$+@%]*';
-# A rule has three parts: a list of targets, a list of dependencies,
-# and optionally actions.
-my $RULE_PATTERN =
- "^($TARGET_PATTERN(?:(?:\\\\\n|\\s)+$TARGET_PATTERN)*) *:([^=].*|)\$";
-
-# Only recognize leading spaces, not leading tabs. If we recognize
-# leading tabs here then we need to make the reader smarter, because
-# otherwise it will think rules like 'foo=bar; \' are errors.
-my $ASSIGNMENT_PATTERN = '^ *([^ \t=:+]*)\s*([:+]?)=\s*(.*)' . "\$";
-# This pattern recognizes a Gnits version id and sets $1 if the
-# release is an alpha release. We also allow a suffix which can be
-# used to extend the version number with a "fork" identifier.
-my $GNITS_VERSION_PATTERN = '\d+\.\d+([a-z]|\.\d+)?(-[A-Za-z0-9]+)?';
-
-my $IF_PATTERN = '^if\s+(!?)\s*([A-Za-z][A-Za-z0-9_]*)\s*(?:#.*)?' . "\$";
-my $ELSE_PATTERN =
- '^else(?:\s+(!?)\s*([A-Za-z][A-Za-z0-9_]*))?\s*(?:#.*)?' . "\$";
-my $ENDIF_PATTERN =
- '^endif(?:\s+(!?)\s*([A-Za-z][A-Za-z0-9_]*))?\s*(?:#.*)?' . "\$";
-my $PATH_PATTERN = '(\w|[+/.-])+';
-# This will pass through anything not of the prescribed form.
-my $INCLUDE_PATTERN = ('^include\s+'
- . '((\$\(top_srcdir\)/' . $PATH_PATTERN . ')'
- . '|(\$\(srcdir\)/' . $PATH_PATTERN . ')'
- . '|([^/\$]' . $PATH_PATTERN . '))\s*(#.*)?' . "\$");
-
-# Directories installed during 'install-exec' phase.
-my $EXEC_DIR_PATTERN =
- '^(?:bin|sbin|libexec|sysconf|localstate|lib|pkglib|.*exec.*)' . "\$";
-
-# Values for AC_CANONICAL_*
-use constant AC_CANONICAL_BUILD => 1;
-use constant AC_CANONICAL_HOST => 2;
-use constant AC_CANONICAL_TARGET => 3;
-
-# Values indicating when something should be cleaned.
-use constant MOSTLY_CLEAN => 0;
-use constant CLEAN => 1;
-use constant DIST_CLEAN => 2;
-use constant MAINTAINER_CLEAN => 3;
-
-# Libtool files.
-my @libtool_files = qw(ltmain.sh config.guess config.sub);
-# ltconfig appears here for compatibility with old versions of libtool.
-my @libtool_sometimes = qw(ltconfig ltcf-c.sh ltcf-cxx.sh ltcf-gcj.sh);
-
-# Commonly found files we look for and automatically include in
-# DISTFILES.
-my @common_files =
- (qw(ABOUT-GNU ABOUT-NLS AUTHORS BACKLOG COPYING COPYING.DOC COPYING.LIB
- COPYING.LESSER ChangeLog INSTALL NEWS README THANKS TODO
- ar-lib compile config.guess config.rpath
- config.sub depcomp install-sh libversion.in mdate-sh
- missing mkinstalldirs py-compile texinfo.tex ylwrap),
- @libtool_files, @libtool_sometimes);
-
-# Commonly used files we auto-include, but only sometimes. This list
-# is used for the --help output only.
-my @common_sometimes =
- qw(aclocal.m4 acconfig.h config.h.top config.h.bot configure
- configure.ac configure.in stamp-vti);
-
-# Standard directories from the GNU Coding Standards, and additional
-# pkg* directories from Automake. Stored in a hash for fast member check.
-my %standard_prefix =
- map { $_ => 1 } (qw(bin data dataroot doc dvi exec html include info
- lib libexec lisp locale localstate man man1 man2
- man3 man4 man5 man6 man7 man8 man9 oldinclude pdf
- pkgdata pkginclude pkglib pkglibexec ps sbin
- sharedstate sysconf));
-
+# This variable was kept here because it uses the \$RELEASE_YEAR variable
+# which is passed directly to this script by the Makefile. We need to find a
+# better solution.
# Copyright on generated Makefile.ins.
my $gen_copyright = "\
# Copyright (C) 1994-$RELEASE_YEAR Free Software Foundation, Inc.
@@ -235,349 +148,6 @@ my $gen_copyright = "\
# PARTICULAR PURPOSE.
";
-# These constants are returned by the lang_*_rewrite functions.
-# LANG_SUBDIR means that the resulting object file should be in a
-# subdir if the source file is. In this case the file name cannot
-# have '..' components.
-use constant LANG_IGNORE => 0;
-use constant LANG_PROCESS => 1;
-use constant LANG_SUBDIR => 2;
-
-# These are used when keeping track of whether an object can be built
-# by two different paths.
-use constant COMPILE_LIBTOOL => 1;
-use constant COMPILE_ORDINARY => 2;
-
-# We can't always associate a location to a variable or a rule,
-# when it's defined by Automake. We use INTERNAL in this case.
-use constant INTERNAL => new Automake::Location;
-
-# Serialization keys for message queues.
-use constant QUEUE_MESSAGE => "msg";
-use constant QUEUE_CONF_FILE => "conf file";
-use constant QUEUE_LOCATION => "location";
-use constant QUEUE_STRING => "string";
-
-## ---------------------------------- ##
-## Variables related to the options. ##
-## ---------------------------------- ##
-
-# TRUE if we should always generate Makefile.in.
-my $force_generation = 1;
-
-# From the Perl manual.
-my $symlink_exists = (eval 'symlink ("", "");', $@ eq '');
-
-# TRUE if missing standard files should be installed.
-my $add_missing = 0;
-
-# TRUE if we should copy missing files; otherwise symlink if possible.
-my $copy_missing = 0;
-
-# TRUE if we should always update files that we know about.
-my $force_missing = 0;
-
-
-## ---------------------------------------- ##
-## Variables filled during files scanning. ##
-## ---------------------------------------- ##
-
-# Name of the configure.ac file.
-my $configure_ac;
-
-# Files found by scanning configure.ac for LIBOBJS.
-my %libsources = ();
-
-# Names used in AC_CONFIG_HEADERS call.
-my @config_headers = ();
-
-# Names used in AC_CONFIG_LINKS call.
-my @config_links = ();
-
-# List of Makefile.am's to process, and their corresponding outputs.
-my @input_files = ();
-my %output_files = ();
-
-# Complete list of Makefile.am's that exist.
-my @configure_input_files = ();
-
-# List of files in AC_CONFIG_FILES/AC_OUTPUT without Makefile.am's,
-# and their outputs.
-my @other_input_files = ();
-# Where each AC_CONFIG_FILES/AC_OUTPUT/AC_CONFIG_LINK/AC_CONFIG_HEADERS
-# appears. The keys are the files created by these macros.
-my %ac_config_files_location = ();
-# The condition under which AC_CONFIG_FOOS appears.
-my %ac_config_files_condition = ();
-
-# Directory to search for configure-required files. This
-# will be computed by locate_aux_dir() and can be set using
-# AC_CONFIG_AUX_DIR in configure.ac.
-# $CONFIG_AUX_DIR is the 'raw' directory, valid only in the source-tree.
-my $config_aux_dir = '';
-my $config_aux_dir_set_in_configure_ac = 0;
-# $AM_CONFIG_AUX_DIR is prefixed with $(top_srcdir), so it can be used
-# in Makefiles.
-my $am_config_aux_dir = '';
-
-# Directory to search for AC_LIBSOURCE files, as set by AC_CONFIG_LIBOBJ_DIR
-# in configure.ac.
-my $config_libobj_dir = '';
-
-# Whether AM_GNU_GETTEXT has been seen in configure.ac.
-my $seen_gettext = 0;
-# Whether AM_GNU_GETTEXT([external]) is used.
-my $seen_gettext_external = 0;
-# Where AM_GNU_GETTEXT appears.
-my $ac_gettext_location;
-# Whether AM_GNU_GETTEXT_INTL_SUBDIR has been seen.
-my $seen_gettext_intl = 0;
-
-# The arguments of the AM_EXTRA_RECURSIVE_TARGETS call (if any).
-my @extra_recursive_targets = ();
-
-# Lists of tags supported by Libtool.
-my %libtool_tags = ();
-# 1 if Libtool uses LT_SUPPORTED_TAG. If it does, then it also
-# uses AC_REQUIRE_AUX_FILE.
-my $libtool_new_api = 0;
-
-# Most important AC_CANONICAL_* macro seen so far.
-my $seen_canonical = 0;
-
-# Where AM_MAINTAINER_MODE appears.
-my $seen_maint_mode;
-
-# Actual version we've seen.
-my $package_version = '';
-
-# Where version is defined.
-my $package_version_location;
-
-# TRUE if we've seen AM_PROG_AR
-my $seen_ar = 0;
-
-# Location of AC_REQUIRE_AUX_FILE calls, indexed by their argument.
-my %required_aux_file = ();
-
-# Where AM_INIT_AUTOMAKE is called.
-my $seen_init_automake = 0;
-
-# TRUE if we've seen AM_AUTOMAKE_VERSION.
-my $seen_automake_version = 0;
-
-# Hash table of discovered configure substitutions. Keys are names,
-# values are 'FILE:LINE' strings which are used by error message
-# generation.
-my %configure_vars = ();
-
-# Ignored configure substitutions (i.e., variables not to be output in
-# Makefile.in)
-my %ignored_configure_vars = ();
-
-# Files included by $configure_ac.
-my @configure_deps = ();
-
-# Greatest timestamp of configure's dependencies.
-my $configure_deps_greatest_timestamp = 0;
-
-# Hash table of AM_CONDITIONAL variables seen in configure.
-my %configure_cond = ();
-
-# This maps extensions onto language names.
-my %extension_map = ();
-
-# List of the DIST_COMMON files we discovered while reading
-# configure.ac.
-my @configure_dist_common = ();
-
-# This maps languages names onto objects.
-my %languages = ();
-# Maps each linker variable onto a language object.
-my %link_languages = ();
-
-# maps extensions to needed source flags.
-my %sourceflags = ();
-
-# List of targets we must always output.
-# FIXME: Complete, and remove falsely required targets.
-my %required_targets =
- (
- 'all' => 1,
- 'dvi' => 1,
- 'pdf' => 1,
- 'ps' => 1,
- 'info' => 1,
- 'install-info' => 1,
- 'install' => 1,
- 'install-data' => 1,
- 'install-exec' => 1,
- 'uninstall' => 1,
-
- # FIXME: Not required, temporary hacks.
- # Well, actually they are sort of required: the -recursive
- # targets will run them anyway...
- 'html-am' => 1,
- 'dvi-am' => 1,
- 'pdf-am' => 1,
- 'ps-am' => 1,
- 'info-am' => 1,
- 'install-data-am' => 1,
- 'install-exec-am' => 1,
- 'install-html-am' => 1,
- 'install-dvi-am' => 1,
- 'install-pdf-am' => 1,
- 'install-ps-am' => 1,
- 'install-info-am' => 1,
- 'installcheck-am' => 1,
- 'uninstall-am' => 1,
- 'tags-am' => 1,
- 'ctags-am' => 1,
- 'cscopelist-am' => 1,
- 'install-man' => 1,
- );
-
-# Queue to push require_conf_file requirements to.
-my $required_conf_file_queue;
-
-# The name of the Makefile currently being processed.
-my $am_file = 'BUG';
-
-################################################################
-
-## ------------------------------------------ ##
-## Variables reset by &initialize_per_input. ##
-## ------------------------------------------ ##
-
-# Relative dir of the output makefile.
-my $relative_dir;
-
-# Greatest timestamp of the output's dependencies (excluding
-# configure's dependencies).
-my $output_deps_greatest_timestamp;
-
-# These variables are used when generating each Makefile.in.
-# They hold the Makefile.in until it is ready to be printed.
-my $output_vars;
-my $output_all;
-my $output_header;
-my $output_rules;
-my $output_trailer;
-
-# This is the conditional stack, updated on if/else/endif, and
-# used to build Condition objects.
-my @cond_stack;
-
-# This holds the set of included files.
-my @include_stack;
-
-# List of dependencies for the obvious targets.
-my @all;
-my @check;
-my @check_tests;
-
-# Keys in this hash table are files to delete. The associated
-# value tells when this should happen (MOSTLY_CLEAN, DIST_CLEAN, etc.)
-my %clean_files;
-
-# Keys in this hash table are object files or other files in
-# subdirectories which need to be removed. This only holds files
-# which are created by compilations. The value in the hash indicates
-# when the file should be removed.
-my %compile_clean_files;
-
-# Keys in this hash table are directories where we expect to build a
-# libtool object. We use this information to decide what directories
-# to delete.
-my %libtool_clean_directories;
-
-# Value of $(SOURCES), used by tags.am.
-my @sources;
-# Sources which go in the distribution.
-my @dist_sources;
-
-# This hash maps object file names onto their corresponding source
-# file names. This is used to ensure that each object is created
-# by a single source file.
-my %object_map;
-
-# This hash maps object file names onto an integer value representing
-# whether this object has been built via ordinary compilation or
-# libtool compilation (the COMPILE_* constants).
-my %object_compilation_map;
-
-
-# This keeps track of the directories for which we've already
-# created dirstamp code. Keys are directories, values are stamp files.
-# Several keys can share the same stamp files if they are equivalent
-# (as are './/foo' and 'foo').
-my %directory_map;
-
-# All .P files.
-my %dep_files;
-
-# This is a list of all targets to run during "make dist".
-my @dist_targets;
-
-# List of all programs, libraries and ltlibraries as returned
-# by am_install_var
-my @proglist;
-my @liblist;
-my @ltliblist;
-# Blacklist of targets (as canonical base name) for which object file names
-# may not be automatically shortened
-my @dup_shortnames;
-
-# Keep track of all programs declared in this Makefile, without
-# $(EXEEXT). @substitutions@ are not listed.
-my %known_programs;
-my %known_libraries;
-
-# This keeps track of which extensions we've seen (that we care
-# about).
-my %extension_seen;
-
-# This is random scratch space for the language finish functions.
-# Don't randomly overwrite it; examine other uses of keys first.
-my %language_scratch;
-
-# We keep track of which objects need special (per-executable)
-# handling on a per-language basis.
-my %lang_specific_files;
-
-# List of distributed files to be put in DIST_COMMON.
-my @dist_common;
-
-# This is set when 'handle_dist' has finished. Once this happens,
-# we should no longer push on dist_common.
-my $handle_dist_run;
-
-# Used to store a set of linkers needed to generate the sources currently
-# under consideration.
-my %linkers_used;
-
-# True if we need 'LINK' defined. This is a hack.
-my $need_link;
-
-# Does the generated Makefile have to build some compiled object
-# (for binary programs, or plain or libtool libraries)?
-my $must_handle_compiled_objects;
-
-# Record each file processed by make_paragraphs.
-my %transformed_files;
-
-################################################################
-
-## ---------------------------------------------- ##
-## Variables not reset by &initialize_per_input. ##
-## ---------------------------------------------- ##
-
-# Cache each file processed by make_paragraphs.
-# (This is different from %transformed_files because
-# %transformed_files is reset for each file while %am_file_cache
-# it global to the run.)
-my %am_file_cache;
-
################################################################
# var_SUFFIXES_trigger ($TYPE, $VALUE)