Tom Tromey [Tue, 8 May 2001 19:12:54 +0000 (19:12 +0000)]
* automake.in (subst): New sub.
(handle_languages): Use it.
(output_lex_build_rule): Likewise; also use _am_quote.
(check_libobjs_sources): Likewise.
(make_paragraphs): Use subst.
Akim Demaille [Tue, 8 May 2001 13:53:29 +0000 (13:53 +0000)]
* automake.in (&file_contents_internal): Apply the @cond_stack to
the rules and assignments.
Don't rely on `$.' as it's biased by &make_paragraphs.
Don't remove backslashes in variable values.
Akim Demaille [Tue, 8 May 2001 13:12:58 +0000 (13:12 +0000)]
* automake.in ($IGNORE_PATTERN): Improve for multi-line matches.
($RULE_PATTERN): Use that from `&make_paragraphs'.
($MACRO_PATTERN): Just catch the name of a macro.
($BOGUS_MACRO_PATTERN): Remove.
($ASSIGNMENT_PATTERN): New.
(&file_contents_internal, &make_paragraphs): Adjust.
(¯o_define): Catch bad macro names.
(&cond_stack_endif): Better error message.
(&file_contents_internal): Don't remove backslashes in variable
values.
(¯o_define): Do it for `+=' user variables.
(&define_standard_variables): Use `undef' instead of a dummy
variable.
(&make_paragraph): Be sure not to chop the trail of hash only
lines: adjust the `##' regexp.
(&rule_define): Fix a bug: don't read $1 but $target.
* tests/condincl.test: Strengthen.
Akim Demaille [Tue, 8 May 2001 13:02:54 +0000 (13:02 +0000)]
* automake.in (Language): Add attributes `Name' and `config_vars'.
(&finish): Work properly if there is no _finish.
(Automake): Register language Names and AC_SUBST dependencies.
Register Fortran 77 variables upon which ratfor and ppf77 depend.
(&handle_languages): Once per language, invoke
`define_linker_variables', and check its config_vars.
(&lang_cxx_finish, &lang_f77_finish, &lang_objc_finish)
(&lang_java_finish): Remove.
(&lang_ppf77_finish, &lang_ratfor_finish): Adjust.
Akim Demaille [Tue, 8 May 2001 11:38:47 +0000 (11:38 +0000)]
* automake.in (&handle_lib_objects_cond): Don't take $LEX_SEEN as
argument, as you don't use it.
Hence...
(&handle_lib_objects): Don't take $LEX_SEEN as argument, as you
don't use it.
Hence...
(&handle_programs): Don't mess with %lex_sources, as you don't use
it.
Akim Demaille [Tue, 8 May 2001 11:18:04 +0000 (11:18 +0000)]
* automake.in (&define_program_variable): Remove.
(&scan_one_autoconf_file): Skip MAKEINFO when found in an
AM_MISSING_PROG.
(&handle_texinfo): Don't define MAKEINFO and TEXI2DVI.
* texinfos.am: Do it.
Akim Demaille [Tue, 8 May 2001 10:58:48 +0000 (10:58 +0000)]
Support `if !COND', `else COND', `end COND'.
* automake.texi (Conditionals): Document it.
* automake.in ($WHITE_PATTERN, $MACRO_PATTERN, $BOGUS_MACRO_PATTERN)
($GNITS_VERSION_PATTERN, $INCLUDE_PATTERN): Use `d' and `s'.
($IF_PATTERN, $ELSE_PATTERN, $ENDIF_PATTERN): Likewise, and accept
a leading `!' before the condition.
(&handle_options): Use `d'.
(&cond_stack_if, &cond_stack_else, &&cond_stack_endif): New.
(&read_am_file, &file_contents_internal): Use them.
(&transform): No longer substitute `%!COND%', forcing the use of
`! %?COND%'.
* ansi2knr.am, lex.am, tags.am, texinfos.am, yacc.am: Adjust.
Akim Demaille [Tue, 8 May 2001 10:42:20 +0000 (10:42 +0000)]
Uniform handling of per-object compilation rules.
Note: Automake is repaired.
* automake.in (&handle_languages): Output per object rules for all
the objects, not only for those which language supports dependency
tracking.
Fix Automake: when outputting per-object rules, use `-o' if the
language has no `output_flag', as it's really needed.
(&handle_single_transform_list): Instead of special casing files
which need per object rules but which language don't support
dependency tracking, keep them in the queue for processing by
`&handle_languages'.
Akim Demaille [Tue, 8 May 2001 10:39:49 +0000 (10:39 +0000)]
* automake.in (&handle_languages): `ext-compile.am' and
`depend2.am' are now equivalent for generic rules: output only the
latter.
* ext-compile.am: Remove.
Akim Demaille [Tue, 8 May 2001 10:38:11 +0000 (10:38 +0000)]
Note: This patch breaks Automake. Repaired within two patches.
* automake.in (Language): Replace the attribute `output_arg' with
`compile_flag' and `output_flag'.
(Automake): Adjust language registrations.
(&handle_languages): Transform `-c' and `-o' for both suffix and
per object rules, instead of `OUTARG' and `LTOUTARG' only for
generic rules.
(&handle_single_transform_list): Adjust to `compile_flag' and
`output_flag'.
* depend2.am, ext-compile.am: Use `%-c%' and `%-o%'.
Akim Demaille [Tue, 8 May 2001 09:46:11 +0000 (09:46 +0000)]
* automake.in (&handle_languages): Don't transform %COMPILER%.
Use `$lang->compiler' instead of `$pfx' to transform generic
%COMPILE% and %LTCOMPILE%.
* ext-compile.am: Use %COMPILE%, %LTCOMPILE% and %SOURCE% instead
of %COMPILER% and $<.
Akim Demaille [Mon, 7 May 2001 21:41:18 +0000 (21:41 +0000)]
* automake.in (&handle_languages): Use the same `%transform' for
both `depend2.am' and `ext-compile.am'.
Move the definition of `$flag' where it is used, and rename as
`$flags'.
Akim Demaille [Mon, 7 May 2001 17:51:54 +0000 (17:51 +0000)]
* automake.in (&handle_languages): Compute `$ltoutarg' and
`$outarg' independently from dependency code.
There is no use looping on a language's possible extensions since
we loop over used extensions.
Therefore, there is no use for a local `%transform'.
Tom Tromey [Sun, 6 May 2001 23:01:34 +0000 (23:01 +0000)]
Fix for PR automake/132:
* automake.in (c, c++, objc, asm, ppf77): Add DEFAULT_INCLUDES to
compilation.
(java): Remove INCLUDES and DEFS from compilation.
(lang_c_finish): Add DEFAULT_INCLUDES to compilation.
* compile.am (DEFS): Don't include %DEFAULT_INCLUDES%.
(DEFAULT_INCLUDES): New macro.
Tom Tromey [Sun, 6 May 2001 05:25:58 +0000 (05:25 +0000)]
* automake.in (conditional_true_when): Use a hash, not index().
Also, a TRUE component always results in a true return.
Fixes test cond10.test. For PR automake/164.
* tests/Makefile.am (XFAIL_TESTS): Removed cond10.test.
Tom Tromey [Sat, 5 May 2001 20:47:29 +0000 (20:47 +0000)]
Fix bug reported by Robert Boehne:
* automake.in (output_lex_build_rule): Don't let AMDEP_TRUE be
substituted.
(handle_dependencies): Likewise.
* Makefile.am (maintainer-check): Look for AMDEP_TRUE
substitution. Correct diff now has 30 lines. Look for space
after losing `undef'.
* automake.in (&read_am_file, &file_contents_internal): Don't
define macros when `FALSE', to avoid errors on doubly defined
variables but under condition `FALSE'. In order to allow...
(&am_install_var): When reading the associated file for the first
time, enable `%?FIRST%'.
(&handle_libraries): Let libs.am define $(AR) and $(RANLIB).
* libs.am: Do it when `%?FIRST%'.
* automake.in (®ister_language, &finish_languages): Use `pure'
as a Boolean.
(®ister_language): Use %done properly with objects, not names.
(&finish_languages): Replace `$non_c' with `$needs_c'.
Unify LISP, PYTHON and JAVA primaries.
* automake.in (&handle_emacs_lisp): Be like &handle_python, i.e.,
return if there are no files, hook elist-comp on the Autoconf
macro, rely on lisp.am to define variables.
(&handle_python, &handle_java): Likewise.
(&scan_one_autoconf_file): Pseudo AC_SUBST of `pythondir' and
`PYTHON' must be handled here, not in `&handle_python'.
* java.am: Define needed variables and rules.
* automake.in (&finish_languages, &handle_single_transform_list)
(&add_depend2, &handle_dependencies): No longer use the language
name in `$lang'. Rename `$lang_obj' as `$lang'.
* automake.in (®ister_language): Rename `output-arg' and
`derived-autodep' as `output_arg' and `derived_autodep' to match
the Language attribute.
Set the defaults in %option instead of $lang.
* Automake/: New directory.
* Automake/Struct.pm: New file, based on Perl 5.6's Class::Struct.
* automake.in (Language): Use Automake::Struct.
* tests/defs: Adjust to find Struct.
* automake.in (Language): Add attribute `name'.
(®ister_language): The name of the language is now given in the
hash.
No longer use `$lang' as the name of the language.
Rename `$lang_obj' as `$lang'.
* automake.in (Language): Add attribute `extensions'.
(Automake): Pass a hash to `®ister_language' instead of a
list of pseudo assignments.
(®ister_language): Adjust.
(&finish_languages): Initialize `$ltoutarg'.
* automake.in (Language): Add attribute `output_arg'.
(%language_map): Remove.
(®ister_language): Build only the object, and store in
%languages only.
(&finish_languages, &handle_single_transform_list): Adjust.
* automake.in (Language): Add attributes `flags', `compile' and
`compiler'.
(&finish_languages, &handle_single_transform_list, &handle_dist)
(&add_depend2, ®ister_language): Use them and the `linker' and
`pure' attributes.
* automake.in (&handle_single_transform_list, &finish_languages)
(&handle_dist, &handle_dependencies): Use the language object for
autodep and derived-autodep too.
* automake.in (Language): New package, temporarily in this file.
Use Class::Struct.
(Automake): New package.
(%languages): New.
(&handle_single_transform_list): Use the language object's `ansi'
attribute instead of `$language_map{"$lang-ansi-p"}'.
(®ister_language): Build and register the language too.