[ng] tests: merge, tweak and modernize few test scripts
* t/specflg.sh, t/specflg2.sh, t/specflg3.sh: Merged into ...
* t/per-target-flags.sh: ... this test.
* t/fo.sh: Remove, its weak grepping checks well superseded by
the semantic checks in 't/fort4.sh'.
* t/cxxo.sh: Remove, its weak grepping checks well superseded
by the semantic checks in 't/cxx-demo.sh'.
* t/cxxcpp.sh: Enhance a little.
* t/empty.sh: Renamed ...
* t/empty-data-primary.sh: ... to this. Add trailing ':' command.
* t/empty2.sh, t/empty3.sh, t/empty4.sh: Merged ...
* t/empty-sources-primary.tap: ... into this new test.
* t/no-outdir-option.sh: Remove. A test to check than an obsolete
and now deleted option ("--output-dir") stays deleted is way too
much even for the most test-infected person ;-)
* master:
tests: look for '.lo' rather than '.o' object when using Libtool with C++
cosmetics: few typofixes in older ChangeLogs, suggested by "codespell.py"
tests: add basic semantic tests on C++ support
tests: minor tweak to 't/objc-megademo.sh'
* maint:
tests: look for '.lo' rather than '.o' object when using Libtool with C++
cosmetics: few typofixes in older ChangeLogs, suggested by "codespell.py"
tests: add basic semantic tests on C++ support
tests: minor tweak to 't/objc-megademo.sh'
* t/objc-megademo.sh (am_create_testdir): Define to "empty" before
including ./defs, because this test doesn't rely on the files usually
pre-set by the setup in there.
* t/subobj10.sh: The use of find(1) without an explicitly given
file or directory argument (as in "find -name '*.o'" instead of
"find . '-name.o'") is mostly a GNU extension, and not portable
to POSIX find. Fix it.
* master:
cleanup: simplify subroutine '&saw_extension'
cleanup: remove subroutine '&saw_sources_p'
cleanup: remove unused '&count_files_for_language' subroutine
automake: simplify '&saw_sources_p'
tags: look at $(am__tagged_files) to decide whether to activate
tags: new var $(am__tagged_files) to list all files to run taggers on
tags (cscope): also process $(TAGS_FILES)
tags (ID, cscope): also process config header (if any)
+ Extra non-trivial edits:
* automake.in (handle_tags): Adjust the call to 'define_variable' for
the variable '$(am__tagged_files)' to the different signature we have
in Automake-NG, i.e., "define_variable($VAR, $WHERE, @VALUE)" rather
than "define_variable($VAR, $VALUE, $WHERE)".
* Makefile.am ($(versioned_mans)): Pass 'aclocal-$(APIVERSION)' and
'automake-$(APIVERSION)' to the 'help2man' invocation, rather than
'aclocal' and 'automake', since otherwise the system-wide automake
and aclocal programs would be used instead of the proper wrappers in
't/wrap'.
Merge branch 'ng/depcomp-unify-o-obj-rules' into ng/master
* ng/depcomp-unify-o-obj-rules:
[ng] depcomp: remove unused variable '$source' from the depcomp script
[ng] depcomp: unify rules for '.o' and '.obj' objects
[ng] depcomp: prefer make automatic variables over automake transforms
+ Extra non-trivial edits:
* t/libtool3.sh: Also look for the '.$(OBJEXT)' extension when grepping
the generated Makefile to ensure no explicit rules for the C compilation
has been emitted (only pattern rules should have been).
* t/subdir3.sh: Remove, since the changes done to it in the branch
'ng/depcomp-unify-o-obj-rules' have been obsoleted by the general
semantic changes done in the 'ng/subdir-objects' branch (where this
test had indeed been removed).
* t/subobj4.sh: Likewise.
* automake.in (saw_extension): Now that we use the '%extension_seen'
hash only as a set (it's keys being its elements), we can simplify
the implementation of this function accordingly.
* automake.in (saw_sources_p): Remove, its implementation is now so
trivial that it's easier to inline it into ...
(handle_languages): ... it's only caller.
This is just a minor cleanup. No semantic change is intended.
* automake.in (saw_sources_p): Since its now-only caller calls it with
the '0' argument, remove the code paths that assumed the argument could
be '1', and assume no arguments.
(handle_languages): Drop the arguments '0' in the '&saw_sources_p'
invocation.
tags: look at $(am__tagged_files) to decide whether to activate
This is just a preparatory refactoring in view of future changes.
* automake.in (handle_tags): To decide whether to include the tags rules,
rely on whether the automake-defined variable $(SOURCES) is non-empty,
rather than on the fact that '&saw_sources(1)' returns true.
tags: new var $(am__tagged_files) to list all files to run taggers on
This change reduce code duplication a little, and will be needed by
future simplifications.
* automake.in (handle_tags): Define a new 'am__tagged_files' private
make variable that lists all files to run taggers (mkid, cscope, ctags,
etc) on. Drop the now-useless transform '%CONFIG%' when including
'tags.am'.
* lib/am/tags.am: Use it in several recipes and dependencies list to
reduce code duplication.
[ng] depcomp: remove unused variable '$source' from the depcomp script
* lib/am/depend2.am (%.c -> %.$(OBJEXT) compilation recipes): Do not
pass the path of the source file in the 'source' environment variable
to the invocation of the 'depcomp' script.
* lib/depcomp: Don't document the 'source' environment variable, and
do not abort if it is not set; that variable wasn't actually used
anyway.
[ng] depcomp: unify rules for '.o' and '.obj' objects
This change just reduces code duplication and size of the generated
Makefiles a little. No actual semantic change is intended.
* automake.in (handle_languages): Drop the '%OBJOBJ%' transform.
* lib/am/depend2.am (am__o_src): New, return the path of the source
file corresponding to the target compiled object unchanged when the
object has the '.o' suffix, and returns a proper invocation of
'$(CYGPATH_W)' on that same source file when the object has the
'.obj' suffix.
Using the new $(am__o_src) function, unify rules for the creation of
'.o' and '.obj' objects into a rule for the creation of '.$(OBJEXT)'
objects.
* t/ext.sh: Adjust grepping checks.
* t/ext2.sh: Likewise.
* t/libtool3.sh: Likewise.
* t/objc-basic.sh: Likewise.
* t/objcxx-basic.sh: Likewise.
* t/silent-many-gcc.sh: Likewise.
* t/silent-many-generic.sh: Likewise.
* t/specflg6.sh: Likewise.
* t/subdir3.sh: Likewise.
* t/subobj4.sh: Likewise.
* t/suffix.sh: Likewise.
* t/suffix2.sh: Likewise.
* t/empty2.sh: Enhance a little.
* t/empty3.sh: Likewise.
* t/specflg.sh: Likewise, and adjust comments.
* t/specflg2.sh: Likewise.
* t/pr87.sh: Remove an obsolete check (obsolete since our switch
from suffix rules to pattern rules for C compilation recipes).
[ng] cleanup: after enabling of subdir-objects unconditionally
Few minor cleanups made possible by earlier changes, plus other minor
cleanups triggered in cascade. No semantic change is intended.
* automake.in (LANG_IGNORE, LANG_SUBDIR): Remove.
(register_language ('name' => 'vala', ...)): Add '.vapi' to the entry
'extensions', and simplify the entry 'output_extensions' to point to a
dummy subroutine (since it wasn't really used anyway).
(handle_single_transform): Don't expect the 'lang_*_rewrite' subroutines
to return a 'LANG_*' constant anymore, but only a transformed extension,
if required. To decide whether further processing of the source file
should be stopped, rely on a new set of 'lang_*_ignore' subroutines,
defaulting to a subroutine that returns false. Accordingly, don't special
case the handling of '.vapi' files anymore, instead relying on ...
(lang_vala_ignore, lang_header_ignore): ... these new subroutines to avoid
extra processing of C/C++ headers and Vala '.vapi' headers.
(lang_c_rewrite): Adjust to explicitly return an undefined value.
(lang_java_rewrite): Remove.
Remove an outdated comment.
* lib/am/tags.am (cscopelist): Also scan the files (if any) listed in
the '$(TAGS_FILES) variable, for consistency by what is done by the
'ID', 'TAGS' and 'CTAGS' rules.
tags (ID, cscope): also process config header (if any)
* lib/am/tags.am (cscopelist, ID): Also scan the file given by the
'%CONFIG%' transform, for consistency by what is done by the 'TAGS'
and 'CTAGS' rules.
[ng] tests: remove explicit usages of the 'subdir-objects' option
It is enabled unconditionally since the previous change.
* Several tests: Adjust, extend, rework and simplify, as needed.
* t/ax/depcomp-shuffle.sh, t/ax/depcomp.sh: Likewise.
* t/subobj2.sh: Rename ...
* t/subobj-cxx-grep.sh: ... to this, and adjust.
* t/subobj.sh: Rename ...
* t/subobj-c.sh: ... to this, and adjust.
* t/subobj-cxx.sh: New test.
The fact that Automake-generated Makefiles places compiled
object files in the current directory by default, also when the
corresponding source file is in a subdirectory, is basically an
historical accident, due to the fact that the 'subdir-objects'
option had only been introduced in April 1999, starting with
commit 'user-dep-gen-branchpoint-56-g88b5959', and never made
the default, likely to avoid backwards-compatibility issues.
Since we believe the behaviour enabled by the 'subdir-objects'
is the only natural and most useful one, we make it the only
only one available, simplifying the Automake implementation and
APIs a little in the process.
* NG-NEWS: Update.
* doc/automake-ng.texi (Program and Library Variables): The output
object files are not anymore placed in the current directory by
default, but rather in the same directory of the source file.
(LIBOBJS): Now the $(LIBOBJS) and $(ALLOCA) variables can also be
be used outside of the directory where their sources lie.
(List of Automake options): Don't document the 'subdir-objects'
option anymore.
Other related minor adjustments.
* automake.in (LANG_PROCESS): Remove, it's not needed anymore.
(handle_languages): Don't test whether option 'subdir-objects'
is set (just assume it is), and do not use the '%SUBDIROBJ%'
transform when processing '.am' fragments.
(lang_sub_obj): Delete, it would just return 'LANG_SUBDIR'
unconditionally now.
(lang_c_rewrite): Adjust. Don't test whether the option
'subdir-objects' is set (just assume it is).
(lang_yacc_rewrite): Likewise.
(lang_lex_rewrite): Likewise.
(handle_single_transform): Likewise. Remove an obsolete
comment. Add a proper "FIXME" comments about a fragment
of code that might have become dead code now.
(handle_LIBOBJS_or_ALLOCA): Simplify assuming that the option
'subdir-objects' is always set. Accordingly, there's no need
to warn anymore if '$(LIBOBJS)' or '$(ALLOCA)' are used outside
the '$config_libobj_dir' directory (as specified by autoconf
macro 'AC_CONFIG_LIBOBJ_DIR').
* lib/am/depend2.am: Assume the '?SUBDIROBJ?' Automake time
conditional is always true, and remove its use accordingly.
lib/am/depend2.am
* t/ax/depcomp.sh: Adjust to the fact that 'subdir-objects' is
always in effect.
* t/ccnoco2.sh: Likewise.
* t/cscope.tap: Likewise.
* t/depcomp8a.sh: Likewise.
* t/depcomp8b.sh: Likewise.
* t/libtool3.sh: Likewise.
* t/pr401.sh: Likewise.
* t/pr401b.sh: Likewise.
* t/pr401c.sh: Likewise.
* t/lex-line.sh: Likewise.
* t/yacc-line.sh: Likewise.
* t/yacc5.sh: Likewise.
* t/parallel-tests-suffix-prog.sh: Likewise.
* t/fort4.sh: Likewise, and extend a bit.
* t/fort5.sh: Likewise.
* t/gcj.sh: Likewise.
* t/subpkg.sh: Likewise.
* t/subpkg-yacc.sh: Likewise.
* t/xsource.sh: Likewise.
* t/libobj20a.sh: Remove as obsolete.
* t/libobj20b.sh: Adjust heading comments.
* t/libobj20c.sh: Likewise.
* t/subdir3.sh: Remove as obsolete.
* t/subobj4.sh: Likewise.
[ng] parallel-tests: use 'am__error' instead of hand-rolled equivalent
The API offered by 'am__error' (as introduced in recent commit
'v1.12.1-302-g67d6102') is cleaner, and allows us to diagnose more
issues (even if unrelated), rather than stopping at the first one.
* lib/am/parallel-tests.am: Use '$(am__error)' instead of an hand-rolled
poor man's equivalent to diagnose invalid $(TEST_EXTENSIONS). In
particular ...
(am__maybe_invalid_test_extensions): Remove this as now useless.
* NG-NEWS (Warnings and diagnostic): Diagnostic about typos in
'_SOURCES' etc. variable is issued at make, not automake, runtime,
and when undesired can be silenced (totally or partly) with the
help of the 'AM_VARTYPOS_WHITELIST' variable.
[ng] vartypos: allow user to whitelist false positives
It can happen that the user legitimately employs what the new Automake-NG
make runtime warnings would take for an erroneous usage; for example, GNU
coreutils 8.17 uses something like this is its build system (see file
'src/Makefile.am'):
# Shared files.
copy_LDADD =
cp_LDADD += $(copy_LDADD)
ginstall_LDADD += $(copy_LDADD)
mv_LDADD += $(copy_LDADD)
...
copy_LDADD += $(LIB_SELINUX) # for selinux use
copy_LDADD += $(LIB_CLOCK_GETTIME) # for gettime, settime, ...
copy_LDADD += $(LIB_XATTR) # for various xattr functions
...
Since it does so without having a program called 'copy' anywhere, the
Makefile generated by Automake complains like this:
Makefile:2544: variable 'copy_LDADD' is defined but no program
Makefile:2544: or library has 'copy' as canonical name
Makefile:2546: *** Some Automake-NG error occurred. Stop.
Instead of forcing the coreutils developers to heavily edit their Makefile,
it is better to allow them to whitelist their suspicious usages as correct.
And such a whitelisting capability is a good idea even regardless this
motivation, since it helps enforcing the Autotools- philosophy "the user is
always right" (as long as he is explicit enough).
* lib/am/check-typos (.am/vartypos/whitelisted-vars ): Also add the contents
of the user-reserved variable '$(AM_VARTYPOS_WHITELIST)' (note that it is
still undocumented).
* t/vartypos-whitelist.sh: New test.
Merge branches 'ng/check-typos-at-make-runtime' and 'ng/yacc-lex-fixlets' into ng/master
* ng/check-typos-at-make-runtime:
[ng] cleanup: unused variable in the automake script removed
[ng] warns: also report typos for 'LOG_DEPENDENCIES' variables
[ng] warns: typos in '_DEPENDENCIES' variables are now reported
[ng] warns: typos in _SOURCES etc. reported at make runtime
[ng] refactor: new make variables am__all_libs and am__all_ltlibs
[ng] automake: new global variable '%known_ltlibraries'
[ng] coverage: conditional defn of lib_LIBRARIES and lib_LTLIBRARIES
* ng/yacc-lex-fixlets:
[ng] yacc: prefer use of automatic variables over automake-time transforms
[ng] yacc/c++: prefer make-time processing over recipe-time one
[ng] lex: fix a (mostly harmless) typo in code
[ng] refactor: merge lang_{yacc,lex}_finish functions
[ng] cleanup: don't error on 'YACCFLAGS' usage
They are identical after the last commit, so no need to keep them
separated anymore
* automake.in (yacc_lex_finish_helper, lang_yacc_finish,
lang_lex_finish): Merge into ..
(lang_yacc_lex_finish): ... this.
Adjust calls to 'register_language' for Yacc and Lex accordingly.
* automake.in (lang_yacc_finish): Stop calling 'reject_var' on
'YACCFLAGS'; that has been obsolete for such a long time (since
1998 at least!) that is not worth worrying about anymore in
Automake-NG.
[ng] cleanup: unused variable in the automake script removed
* automake.in ($output_header): Remove.
(initialize_per_input): Don't reset it.
(generate_makefile): Don't use its content when creating the output
Makefile: it was always empty anyway.
[ng] warns: also report typos for 'LOG_DEPENDENCIES' variables
* lib/am/parallel-tests.am (am__using_parallel_tests): New, set to
"yes" to inform the rest of the makefile that the parallel testsuite
harness is in use.
* lib/am/check-typos.am (.am/vartypos/whitelisted-vars): Whitelist
only 'LOG_DEPENDENCIES' variables that actually correspond to a
declared test extension.
* t/vartypos-deps.sh: New test.
[ng] warns: typos in '_DEPENDENCIES' variables are now reported
Detection of those typos had been disabled in commit in commit
'v1.12-295-g9a5f837' of 2012-05-22, "[ng] warns: don't report possible
issues with '_DEPENDENCIES' variables", to avoid spurious errors.
* lib/am/check-typos.am (.am/vartypos/suffixes): Add '_DEPENDENCIES'.
(.am/vartypos/whitelisted-vars): Extend accordingly to avoid spurious
errors.
* t/vartypos.sh: Extend to also test bad usages of '_DEPENDENCIES'
variables.
[ng] warns: typos in _SOURCES etc. reported at make runtime
For example, on an input:
bin_PROGRAMS = frob
forb_SOURCES = main.c
a proper warning should be given, since either 'forb' or 'frob' is likely a
typo. Mainline Automake gives the warning at automake runtime, while with
this change, the warnings will be moved at make runtime. This will allow
us to warn about variables like '_DEPENDENCIES', whose definitions can
be unavailable (or unanalyzable) at automake runtime (check about those
variables had to be disabled in commit 'v1.12-295-g9a5f837' of 2012-05-22,
"[ng] warns: don't report possible issues with '_DEPENDENCIES' variables",
to avoid spurious errors).
* automake.in (generate_makefile): Emit code to perform make runtime
checks, in particular those moved out from ...
(check_typos): ... this now-deleted function ...
* lib/am/check-typos.am: ... into this new Makefile fragment.
* Makefile.am (dist_am_DATA): Add the new file.
* lib/am/header-vars.am (am__error): New internal function, declares an
error without immediately terminating the make process. Allows us to
diagnose more issues at once, rather than stopping at the first one.
* t/spell.sh: Adjust and extend.
* t/spell2.sh: Likewise.
* t/warnopts.sh: Adjust.
* t/vartypo2.sh: Remove, its content adjusted and merged ...
* t/vartypos.sh: ... into this test, adjusted and extended as well.
[ng] refactor: new make variables am__all_libs and am__all_ltlibs
This change is only a preparatory refactoring in view of future changes.
* t/all-progs.sh: Renamed ...
* t/all-prog-libs.sh: ... like this, and extended.
* automake.in (generate_makefile): Define the make vars 'am__all_libs'
and 'am__all_ltlibs' respectively from the sorted keys of the hashes
'%known_libraries' and '%known_ltlibraries'. For consistency, and for
offering a better stability of the output Makefiles, sort the keys of
the '%known_programs' hash before using them to define the make variable
'am__all_progs'.
[ng] automake: new global variable '%known_ltlibraries'
This is just a preparatory refactoring in view of future changes.
* automake.in (%known_ltlibraries): New global variable.
(initialize_per_input): Reset it.
(handle_ltlibraries): Register processed libtool libraries in
'%known_ltlibraries' rather than in '%known_libraries'.
(lang_vala_finish): Also take into account the contents of
'%known_ltlibraries'; since we are at it, refactor a little
to remove some inconsistency and code duplication.
[ng] internals: copy 'header-vars.am' more verbatim in the output makefile
* automake.in (define_standard_variables): The 'header-vars.am' file should
contain no rule definition, nor any variable definition that must be known
at automake runtime; so we can read and process that file's content using
the 'preprocess_file' function rather than the 'file_contents_internal' one.
This will allow us to make a more liberal use of GNU make builtins in there,
like the 'define' builtin.
* t/comment4.sh: Adjust.
* t/vpath.sh: Likewise.
* t/txinfo17.sh (texinfo.texi): Use "foobar", not "example", as the
argument of the @setfilename call, to ensure we don't get false
positives in the later grepping checks.
In GNU make, '$^' used in a recipe contains every dependency for the
target, even those not declared when the recipe is read; for example,
on:
all: foo1; @echo $^
all: foo2
"make all" would output "foo1 foo2". This is not Automake's fault,
as some comments incorrectly stated. See also:
<http://lists.gnu.org/archive/html/help-make/2012-05/msg00029.html>
* lib/am/texinfos.am: Fix those incorrect comments, and document the
GNU make behaviour described above.
* t/suffix-custom-link.sh: Rewrite a little to avoid triggering warnings
from the 'sc_tests_here_document_format' maintainer check.
* syntax-checks.mk (sc_diff_aclocal_in_aclocal,
sc_diff_automake_in_automake): Rename ...
(sc_diff_aclocal_in_aclocal,
sc_diff_automake_in_automake): ... respectively to these, rewrite to use
static pattern rules and 'diff -u' instead of bare 'diff', and fix the
count of expected differences to account for the removed substitution of
'@SHELL@' in automake.in.
(syntax_check_rules): Adjust.
* master: (21 commits)
news: document deprecation of configure.in
news: put planned backward compatibilities early
sync: update files from upstream with "make fetch"
maint: deprecate 'configure.in' as autoconf input
maint: post-release minor version bump
release: stable release 1.12.1
copyright: update copyright years in a couple of files
tests: avoid spurious failures with Solaris 9 cscope program
maintcheck: fix a spurious failure
perf: beginning of a performance testsuite
aclocal: declare function prototypes, do not use '&' in function calls
news: support for configure.in will be dropped in future automake versions
missing: support AC_CONFIG_HEADERS in addition to obsolete AC_CONFIG_HEADER
missing: don't bother checking for AM_CONFIG_HEADER: it is gone now
docs: remove mention of AM_CONFIG_HEADER: it is obsolete and removed now
tests: fix botched heading comments in 'lex-clean-cxx.sh'
[ng] maintcheck: some tweaks and fixlets
help: fix a typo in the list of warning categories
maint: version bump after beta release
release: beta release 1.12.0b (will become 1.12.1)
...
+ Extra non-trivial edits:
* Makefile.am (TESTS): Add the tests in the 't/perf' directory.
* maint:
news: document deprecation of configure.in
news: put planned backward compatibilities early
sync: update files from upstream with "make fetch"
maint: deprecate 'configure.in' as autoconf input
maint: post-release minor version bump
release: stable release 1.12.1
copyright: update copyright years in a couple of files
tests: avoid spurious failures with Solaris 9 cscope program
maintcheck: fix a spurious failure
perf: beginning of a performance testsuite
aclocal: declare function prototypes, do not use '&' in function calls
news: support for configure.in will be dropped in future automake versions
tests: fix botched heading comments in 'lex-clean-cxx.sh'
[ng] maintcheck: some tweaks and fixlets
help: fix a typo in the list of warning categories
maint: version bump after beta release
release: beta release 1.12.0b (will become 1.12.1)
release: remove overly picky check
[ng] vars: recognize escaped '#' correctly in a variable definition
Regression revealed by a failure in test 't/backslash-tricks.sh', and
caused by the recent merge of the 'ng/var-simplify' branch.
It is worth noting that this change has a collateral effect: comments
placed after the variable definition *must* now be separated with one
or more spaces from said definition:
# This won't work, and will produce a subtly broken Makefile
foo = val# comment
foo += val2
# Please do this instead
foo = val # comment
foo += val2
We believe that supporting the use of escaped '#' characters in variable
definitions is more important than supporting the fringe case above.
* lib/Automake/VarDef.pm (raw_value): Fix processing of stored value
to account for escaped '#' characters.
(value): Add a FIXME comment about a statement that is not strictly
true anymore now that we assume GNU make.
* t/backslash-tricks.sh: Extend a bit.
* t/comment8.sh: Relax a bit, by placing spaces between the variable's
definitions and the comments on the same line. Extend in another
respect, to watch against a regression introduced by the first draft of
this commit.
* NEWS (Warnings and deprecations): We now warn if 'configure.in' is
used instead of 'configure.ac' as autoconf input.
(Future backward-incompatibilities): Adjust.
It has been years since that has been deprecated in the documentation,
in favour of 'configure.ac':
Previous versions of Autoconf promoted the name configure.in, which
is somewhat ambiguous (the tool needed to process this file is not
described by its extension), and introduces a slight confusion with
config.h.in and so on (for which '.in' means "to be processed by
configure"). Using configure.ac is now preferred.
It's now time to start giving runtime warning about the use of
'configure.in', so that support for it can be removed in future
versions of autoconf/automake.
See also, in the Autoconf repository, commit 'v2.69-4-g560f16b' of
2012-05-23, "general: deprecate 'configure.in' as autoconf input".
* lib/Automake/Configure_ac.pm: Issue a warning in the 'obsolete'
category if 'configure.in' is detected. Since this module is synced
from Automake, this change is to be backported there (and will be
soon).
* t/help.sh: Adjust.
* t/configure.sh: Adjust and enhance.
tests: avoid spurious failures with Solaris 9 cscope program
* t/cscope.tap: Also check that the cscope program in use supports the
'-q' option; if this is not the case, some cscope usages in the generated
Makefiles would fail, so we must skip the checks involving those usages.
* ng/var-simplify:
[ng] cosmetics: avoid redundant use of '&' in subroutine calls
[ng] rename: define_pretty_variable -> define_cond_variable()
[ng] cleanup: prefer 'define_variable' over 'define_pretty_variable'
[ng] refactor: change signature of 'define_variable()'
[ng] vars: get rid of VAR_ASIS / VAR_PRETTY distinction
[ng] vars: keep track of conditionals in appended values and comments
[ng] vars: simplify logic for appending conditionally
[ng] VarDef: store comments and values as a perl array
[ng] refactor: support comments only for VarDef, not for ItemDef too
[ng] tests: Automake should let us append to undefined variables (someday)
[ng] tests: spy behaviour of '+=' with GNU make
[ng] vars: get rid of VAR_SILENT type
[ng] vars: get rid of VAR_SORTED type
[ng] cleanup: remove unused private variables in Automake::Variable
[ng] vars: get rid of VAR_ASIS / VAR_PRETTY distinction
It doesn't offer us any real advantage (apart from some eye-candy
in the generated makefile), and complicates the code and the
internal APIs.
* automake.in (define_verbose_var, define_configure_variable,
file_contents_internal): Adjust the 'Automake::Variable::define'
call to drop the VAR_ASIS parameter.
(define_pretty_variable): Likewise. Also, adjust the function
description not to state that the value of a variable defined by
it is "pretty printed in the output file".
(handle_subdirs): Don't try to prettify the RECURSIVE_TARGETS
variable anymore.
(read_am_file): Adjust the 'Automake::Variable::define' calls
to drop the VAR_ASIS parameter. Also, don't "prettify" the
definition of variables whose value is more than 1000 characters
long. That is now done directly ...
* lib/Automake/Variable.pm (output): ... in here.
(define): Drop the '$pretty' parameter, and adjust implementation
details accordingly. Now output variable definitions are only
prettified when needed, i.e., when their value is more than 1000
characters long. And the only reason this prettification is done
is to ensure the generated Makefile.in won't have lines so long
that could confuse tools (like sed and awk) processing it into a
Makefile at config.status runtime.
(Pod Documentation): Adjust.
(_has_line_too_long): New internal function.
(transform_variable_recursively): Drop '$pretty' parameter in a
call to 'define'.
* lib/Automake/VarDef.pm (VAR_ASIS, VAR_PRETTY): Delete.
(@EXPORT): Don't advertise them.
(new): Don't take nor store the '$pretty' parameter anymore.
(pretty): Remove this accessor method.
(Pod Documentation): Adjust.
* t/check2.sh: Adjust.
* t/distcom-subdir.sh: Likewise.
* t/distcom2.sh: Likewise.
* t/longline.sh: Likewise.
* t/pluseq3.sh: Likewise.
* t/subdir4.sh: Likewise.
* t/subst-no-trailing-empty-line.sh: Remove as obsolete.
[ng] vars: simplify logic for appending conditionally
This will make the generated Makefiles more bloated, but that should
be OK, since eventually further refactorings will change the format used
to output conditional variables extending, and the resulting Makefiles
will once again be smaller and cleaner.
* lib/Automake/Variable.pm (define): When appending to an existing
variable *defined in another condition*, don't bother to avoid the
creation of intermediate internal variables when that's not really
needed; just create them unconditionally.
(_new): Don't reset $self->{'last-append'} anymore, it has been
removed (it was only used in the 'define' function).
[ng] texinfo: take advantage of GNU make features in several recipes
* lib/am/texibuild.am: In a recipe, use $(@D) instead of extracting
the directory component from '$@' with echo+sed.
* lib/am/texinfos.am (am__create_installdir): New private helper
variable.
Rewrite several rules to take advantage of it and of GNU make automatic
variables (like $^) and builtins (like $(and), $(addprefix), $(notdir)).
Add a workaround for a misfeature of the Automake parser/preprocessor
that might sometimes prevent us from using the '$^' automatic variable
correctly in our recipe.
* lib/am/texinfos.am (uninstall-info-am): Remove support for '*.iNN'
files used on DJGPP.
(maintainer-clean-aminfo): Likewise.
* bootstrap.sh: Adjust comments: we don't use "ln -s" not because
it's not properly supported by DJGPP, but because it might not be
properly supported by MinGW/MSYS.
[ng] general: assume dot-starting file names are supported
Now that we've dropped support for DJGPP, Windows 95/98/ME and MS-DOS,
that should always the case.
* lib/am/texibuild.am: Just assume we can have directories whose name
starts with a dot, i.e., that '${am__leading_dot}' expands to '.'.
* m4/depend.m4 (AM_SET_DEPDIR): Likewise. Now $(DEPDIR) will be set
unconditionally to '.deps'.
* m4/init.m4 (AM_INIT_AUTOMAKE): Don't AC_REQUIRE the m4 macro
'AM_SET_LEADING_DOT' anymore.
* m4/lead-dot.m4: Delete.
* Makefile.am (dist_automake_ac_DATA): Remove it.
* NG-NEWS: Update.
* t/subobj11a.sh: Just assume $(DEPDIR) expands to '.deps'.
[ng] cleanup: drop support for DJGPP, Windows 95/98/ME, MS-DOS
See also:
<http://lists.gnu.org/archive/html/automake-ng/2012-05/msg00104.html>
* automake.in (BEGIN): Don't override $ENV{SHELL} for DJGPP.
* bootstrap: Don't special case the default value for BOOTSTRAP_SHELL
on DJGPP. While we are at, allow that variable to be overridden from
the environment.
* configure.ac (MODIFICATION_DELAY): Define to '2' unconditionally, as
we don't have to cater to quirks of Windows 95/98/ME anymore.
* lib/am/texibuild.am: Remove support for '*.iNN' files used on DJGPP.
* lib/am/texinfos.am: Likewise.
* NG-NEWS: Update.
Now that, after today's commit 'v1.12-331-g645bb21', Automake-NG does
not follow the chain of user-defined pattern rules anymore, there's no
need to treat such rules preferentially, nor to reject old-fashioned
suffix rules. This will help interoperability with tools like Gnulib,
which generated Makefile.am fragments that still uses old-fashioned
suffix rules (since they are targeted to mainline Automake).
* automake.in (handle_footer): Do not reject the '.SUFFIXES:' rule
nor the 'SUFFIXES' variable. Add a "FIXME" comment about why we
still support the 'SUFFIXES' variable.
* lib/Automake/Rule.pm: Do not error out if an old-fashioned suffix
rule is seen.
* lib/am/footer.am (.SUFFIXES): Depend on '$(SUFFIXES)', if that's
non-empty.
* t/suffix-rules-reject.sh: Remove.
* t/suffix-rules-old-fashioned.sh: New.
* NG-NEWS: Adjust.
* doc/automake-ng.texi (Suffixes): Do not state that Automake-NG
rejects attempts to define old-fashioned suffix rules.
[ng] compile: rename make variable DEFAULT_INCLUDES -> AM_DEFAULT_INCLUDES
The automake-generated variable 'DEFAULT_INCLUDES' has never been
documented, and it violates user namespace. So rename it to
'AM_DEFAULT_INCLUDES', to make it clear that it is owned by Automake.
We prefer that name to something that would sound more "private",
like 'am__default_includes', because there are possibly legitimate
usages of that variable on the user's part.
* automake.in, lib/am/compile.am: Do the rename.
* NG-NEWS, doc/automake-ng.texi: Update.
* t/confh4.sh, t/no-extra-makefile-code.sh: Adjust.
* syntax-checks.mk (old_vars_checks): Add new check
'sc_no_DEFAULT_INCLUDES'.
(modern_DEFAULT_INCLUDES): Define to 'DEFAULT_INCLUDES'.
[ng] compile: add extra -I opts from config headers at make runtime
Unless the 'no-stdinc' option is in use, automake automatically adds
to the compiler's include path (through the use of '-I' options placed
in the $(DEFAULT_INCLUDES) variable) the $(srcdir), the current
directory, and all the directories where header files specified with
AC_CONFIG_HEADERS macro are placed. It also tries to remove unseemly
duplicated '-I' entries, for example simplifying "-I. -I$(srcdir)" to
"-I." when in a non-VPATH build (in which case '$(srcdir)' is simply
'.').
Before this change, that preprocessing was done both at automake runtime
and configure runtime; with GNU make features, we can simplify it a bit
and move almost all of it at make runtime instead.
* automake.in (handle_compile): Remove automake-time preprocessing, and
support for further configure-time preprocessing, of the intended contents
of $(DEFAULT_INCLUDES); instead, move all of them ...
* lib/am/compile.am (DEFAULT_INCLUDES) [%?STDINC%]: ... here.
* m4/init.m4: Remove AC_SUBST of @am__isrc@.
* t/no-extra-makefile-code.sh: Trivially adjust.
* t/nostdinc.sh: Adjust by preferring more "semantic" checks to grepping
checks.
* t/confh4.sh: Adjust and extend.
* t/stdinc-no-repeated.sh: New test.
* Makefile.am (do_subst): Remove a now-unneeded hack.
[ng] compile: rename make variable CONFIG_HEADER -> AM_CONFIG_HEADERS
The automake-generated variable 'CONFIG_HEADER' has never been
documented, and it violates user namespace. So rename it to
'AM_CONFIG_HEADERS', to make it clear that it is owned by Automake.
We prefer that name to something that would sound more "private",
like 'am__config_headers', because there are possibly legitimate
usages of that variable on the user's part.
* automake.in: Do the rename. Also, don't bother explicitly
rejecting the setting of 'CONFIG_HEADER' as an anachronism:
that warning has been active so long that any still maintained
Makefile.am file should have stopped doing that long ago.
* NG-NEWS: Update.
* lib/am/remake-hdr.am: Update a comment.
* syntax-checks.mk (modern.CONFIG_HEADER): New, define to
'AM_CONFIG_HEADERS'.
[ng] maintcheck: refactor checks on obsolete variable names
This is just a preparatory refactoring, to make future additions
easier.
* syntax-checks.mk (sc_renamed_variables_rules): New autocomputed
variable.
($(sc_renamed_variables_rules)): New static pattern rule, subsuming
most of the existing checks against the use of old names for some
automake provided make variables.
(syntax_check_rules): Add the contents of the new variable, and do
not explicitly list the checks subsumed by it.
[ng] suffix: drop Automake-time chaining of suffix rules
This change simplifies the Automake::Rule module a little, moves yet
more logic from Automake runtime to GNU make runtime (in the spirit of
Automake-NG), and gets us rid of some never-documented nor completely
specified Automake magics. OTOH, it also breaks some idioms that, while
only relevant for uncommon cases, have been working since the first
Automake releases. Still, it is easy to slightly modify those idioms to
have the use cases they were catering to correctly handled with the new
semantics (examples of this are given below); the only downside being the
need of a little more verbosity and explicitness on the user's part.
So, with the present change, automake starts using a much simpler and
dumber algorithm to determine how to build an object associated to a
source whose extension in not one of those it handles internally.
The new algorithm goes like this. For any file listed in a '_SOURCES'
variable whose suffix is not recognized internally by automake (in
contrast to known suffixes like '.c' or '.f90'), automake will obtain
the expected target object file by stripping the suffix from the source
file, and appending either '.$(OBJEXT)' or '.lo' to it (which one depends
on whether the object is built as part of a program, a static library, or
a libtool library). It will then be assumed (but not checked!) that the
user has defined a rule (either explicit or defined from a pattern rule)
which can turn that source file into this corresponding object file. For
example, on an input like:
automake will expect that the three objects 'mu.$(OBJEXT)', 'fu.$(OBJEXT)'
and 'zu.$(OBJEXT)' are to be used in the linking of the 'foo' program, and
that the user has provided proper recipes for all those objects to be
built at make time, as well as a link command for linking 'foo'. Here is
an example of how those declarations could look like:
%.$(OBJEXT): %.ext1
my-compiler -c -o $@ $<
# We need to compile mu with debugging enabled.
mu.$(OBJEXT): mu.ext1
my-compiler -DDEBUG=1 -c -o $@ $<
foo_LINK = $(CC) -o $@
In this particular case, the idiom above is basically the same one that
would be required in mainline automake (apart for the fact that, there,
old-fashioned suffix rules should be used instead of pattern rules). To
see what is truly changed with the new algorithm, we have to look at a
more indirect usage.
Mainline Automake follows the chain of user-defined pattern rules to
determine how to build the object file deriving from a source file with
a custom user extension; for example, upon reading:
automake knew that it has to bring in the C++ support (compilation rules,
requirement for AC_PROG_CXX in configure.ac, etc), and use the C++ linker
to link the 'foo' executable.
But after the present change, automake *won't follow those implicit
chains of pattern rules* anymore; so that the idiom above will have to
be re-worked like follows to preserve its intent and behaviour:
%.cc: %.zoo:
$(preprocess) $< > $@
bin_PROGRAMS = foo
# The use of '.cc' is required to let Automake know to bring in
# stuff for the handling of C++ compilation, and to use the C++
# linker to build 'foo'.
nodist_foo_SOURCES = bar.cc
EXTRA_DIST = foo.zoo
Finally, we must note another, slightly annoying first consequence of
this change of semantics: one can't use anymore "header files" with
extensions unrecognized to Automake anymore; for example, an usage like
this:
# Won't work anymore: will cause errors at make runtime.
%.h: %.my-hdr
$(preprocess-header) $< >$@
foo_SOURCES = foo.c bar.my-hdr
BUILT_SOURCES = bar.h
will cause the generated Makefile to die on "make all", with an error
like:
make[1]: *** No rule to make target 'bar.o', needed by 'zardoz'. Stop.
while an usage like this:
# Won't work anymore: will cause errors at automake runtime.
%.h: %.my-hdr
$(preprocess-header) $< >$@
foo_SOURCES = foo.c foo.my-hdr
BUILT_SOURCES = foo.h
will cause automake itself to die, reporting an error like:
object 'foo.$(OBJEXT)' created by 'foo.my-hdr' and 'foo.c'
We don't believe the above breakage is a real issue though, because
the use case can still be served by placing the "non standard" headers
in EXTRA_DIST rather than in a _SOURCES variable:
# This will work.
%.h: %.my-hdr
$(preprocess-header) $< >$@
foo_SOURCES = foo.c
EXTRA_DIST = foo.my-hdr
BUILT_SOURCES = foo.h
A more detailed list of changes follow ...
* automake.in (register_language): Don't call 'register_suffix_rule'
on the source and object extensions of the registered languages.
(handle_single_transform): Implement the new simple algorithm described
in details above (plus an hack to continue supporting Vala-related
'.vapi' files in _SOURCES variables). Remove the only call ever to ...
(derive_suffix): ... this function, which has thus been removed.
* lib/Automake/Rule.pm
($_suffix_rules_default, $suffix_rules, register_suffix_rule): Remove.
(@EXPORT, reset): Adjust.
(define): Don't call 'register_suffix_rule' on the suffixes of target
and dependency when a pattern rule is seen.
* t/specflg10.sh: Move ...
* t/am-default-source-ext.sh: ... to this more proper name, and
adjusted.
* t/suffix12.sh: Renamed ...
* t/suffix-custom-subobj.sh: ... to this, and remove a botched heading
comment.
* t/suffix3.sh: Adjust.
* t/suffix5.sh: Likewise.
* t/suffix8.sh: Likewise.
* t/suffix10.sh: Likewise.
* t/suffix13.sh: Likewise.
* t/suffix-chain.sh: Likewise.
* t/suffix-hdr.sh: Likewise.
* t/suffix-custom.sh: New test.
* t/suffix-custom-link.sh: Likewise.
* t/suffix-custom-default-ext.sh: Likewise.
* t/yacc-lex-cxx-alone.sh: Likewise.
* NG-NEWS: Update.
Some tests in the Automake testsuite already aims only at verifying
the performance, rather than the correctness, of some operations.
Still, they are somewhat shoehorned and forced into the PASS/FAIL
framework (say, with the 'ulimit' shell builtin used to verify some
operation doesn't take up too much time or memory), but that is
conceptually a stretch, and has already caused problems in practice
(see automake bug#11512 for an example).
So we start moving the "performance tests" out of the testsuite proper,
and make them run only "on demand" (when the user exports the variable
'AM_TESTSUITE_PERF' to "yes"). Ideally, we should provide those tests
with a custom runner/driver that measures and displays the relevant
performance information, but doing that correctly and with the right
APIs is definitely more difficult, so we leave it for a later step
(an hope we'll take such a step eventually).
* t/cond29.sh: Move ...
* t/perf/cond.sh: ... here, and adjust.
* t/testsuite-recheck-speed.sh: Move ...
* t/perf/testsuite-recheck.sh: ... here.
* t/testsuite-summary-speed.sh: Move ...
* t/perf/testsuite-summary.sh: ... here.
* t/list-of-tests.mk (perf_TESTS): New variable, listing the tests in
the 't/perf' directory.
(handwritten_TESTS): Adjust.
* defs: Skip any tests in the 't/perf/' subdirectory unless the
'AM_TESTSUITE_PERF' variable is set to "yes" or "y".
* .gitignore: Update.
aclocal: declare function prototypes, do not use '&' in function calls
This change will also fix automake bug#11543 (from a report by Matt
Burgess).
* aclocal.in: Declare prototypes for almost all functions early, before
any actual function definition (but omit the prototype for the dynamically
generated '&search' function). Add prototypes to any function definition.
Remove '&' from function invocations (i.e., simply use "func(ARGS..)"
instead of "&func(ARGS...)").
* THANKS, NEWS: Update.
news: support for configure.in will be dropped in future automake versions
The use of configure.in as Autoconf input has been deprecated for a
very long time in the Autoconf documentation, and the next version of
Autoconf (2.70) will start warning about it ar runtime as well (see
commit 'v2.69-4-g560f16b' or 2012-05-23, "general: deprecate
'configure.in' as autoconf input", in the Autoconf's git repository).
missing: support AC_CONFIG_HEADERS in addition to obsolete AC_CONFIG_HEADER
* missing (autoheader*): Do not look only for AC_CONFIG_HEADER when
grepping configure.ac, but also for AC_CONFIG_HEADERS: the latter has
been preferred to the former by several years now in Autoconf.
missing: don't bother checking for AM_CONFIG_HEADER: it is gone now
* missing (autoheader*): Do not look for AM_CONFIG_HEADER when
grepping configure.ac: it is not supported anymore (has been in
fact deleted in commit v1.12-15-gd2ca168 of 2012-04-27, "m4: delete
several obsolete macros").
Merge branch 'ng/drop-configure-in' into ng/master
* ng/drop-configure-in:
maintcheck: obsolete check 'sc_tests_no_configure_in' removed
cleanup: get rid of 'Automake::Configure_ac' module
cleanup: just assume configure input is configure.ac
cleanup: don't support configure.in anymore
There's no need to verify our tests doesn't use the obsoleted
name 'configure.in' for the Autoconf file anymore: we don't support
it anyway in Automake-NG, so any test trying to use it would fail.