"\$(LIBTOOL) $ltverbose $libtool_tag\$($ptltflags) \$(LIBTOOLFLAGS) "
. "--mode=compile $obj_compile";
- # We _need_ `-o' for per object rules.
+ # We _need_ '-o' for per object rules.
my $output_flag = $lang->output_flag || '-o';
- my $depbase = dirname ($obj);
- $depbase = ''
- if $depbase eq '.';
- $depbase .= '/'
- unless $depbase eq '';
- $depbase .= '$(DEPDIR)/' . basename ($obj);
-
$output_rules .=
file_contents ($rule_file,
new Automake::Location,
. "\tdone\n");
push (@tag_deps, 'tags-recursive');
&depend ('.PHONY', 'tags-recursive');
- &depend ('.MAKE', 'tags-recursive');
$output_rules .= ("ctags-recursive:\n"
- . "\tlist=\'\$(SUBDIRS)\'; for subdir in \$\$list; do \\\n"
+ . "\tlist='\$(SUBDIRS)'; for subdir in \$\$list; do \\\n"
# Never fail here if a subdir fails; it
# isn't important.
. "\t test \"\$\$subdir\" = . || (\$(am__cd) \$\$subdir"
. "\tdone\n");
push (@ctag_deps, 'ctags-recursive');
&depend ('.PHONY', 'ctags-recursive');
- &depend ('.MAKE', 'ctags-recursive');
$output_rules .= ("cscopelist-recursive:\n"
- . "\tlist=\'\$(SUBDIRS)\'; for subdir in \$\$list; do \\\n"
+ . "\tlist='\$(SUBDIRS)'; for subdir in \$\$list; do \\\n"
# Never fail here if a subdir fails; it
# isn't important.
. "\t test \"\$\$subdir\" = . || (\$(am__cd) \$\$subdir"
error $where, "required directory $reldir/$dir does not exist"
unless -d "$reldir/$dir";
- # `aux' is probably the most important of the following forbidden name,
- # If an 'obj/' directory exists, BSD make will enter it before
- # reading 'Makefile'. Hence the 'Makefile' in the current directory
- # will not be read.
- #
- # % cat Makefile
- # all:
- # echo Hello
- # % cat obj/Makefile
- # all:
- # echo World
- # % make # GNU make
- # echo Hello
- # Hello
- # % pmake # BSD make
- # echo World
- # World
- msg ('portability', $where,
- "naming a subdirectory 'obj' causes troubles with BSD make")
- if $dir eq 'obj';
-
+ # 'aux' is probably the most important of the following forbidden name,
# since it's tempting to use it as an AC_CONFIG_AUX_DIR.
msg ('portability', $where,
- "name `$dir' is reserved on W32 and DOS platforms")
+ "name '$dir' is reserved on W32 and DOS platforms")
if grep (/^\Q$dir\E$/i, qw/aux lpt1 lpt2 lpt3 com1 com2 com3 com4 con prn/);
}
}
depend '.PHONY', 'check', 'check-am';
- # Handle recursion. We have to honor BUILT_SOURCES like for `all:'.
+ # Handle recursion. We have to honor BUILT_SOURCES like for 'all:'.
$output_rules .= ("check: "
. (var ('BUILT_SOURCES')
- ? "\$(BUILT_SOURCES)\n\t\$(MAKE) \$(AM_MAKEFLAGS) "
+ ? "\$(BUILT_SOURCES)\n\t\$(MAKE) "
: '')
. (var ('SUBDIRS') ? 'check-recursive' : 'check-am')
. "\n");
my ($self, $name) = @_;
my $derived = canonicalize ($name);
- my $varname = $derived . '_SOURCES';
- my $var = var ($varname);
+ my $var = var "${derived}_SOURCES";
+ return unless $var;
- if ($var)
+ my @vala_sources = grep { /\.vala$/ } ($var->value_as_list_recursive);
+
+ foreach my $vala_file (@vala_sources)
{
- foreach my $file ($var->value_as_list_recursive)
- {
- $output_rules .= "\$(srcdir)/$file: \$(srcdir)/${derived}_vala.stamp\n"
- . "\t\@if test -f \$@; then :; else rm -f \$(srcdir)/${derived}_vala.stamp; fi\n"
- . "\t\@if test -f \$@; then :; else \\\n"
- . "\t \$(MAKE) \$(srcdir)/${derived}_vala.stamp; \\\n"
- . "\tfi\n"
- if $file =~ s/(.*)\.vala$/$1.c/;
- }
+ (my $c_file = $vala_file) =~ s/(.*)\.vala$/$1.c/;
+ $output_rules .= "\$(srcdir)/$c_file: \$(srcdir)/${derived}_vala.stamp\n"
+ . "\t\@if test -f \$@; then :; else rm -f \$(srcdir)/${derived}_vala.stamp; fi\n"
+ . "\t\@if test -f \$@; then :; else \\\n"
- . "\t \$(MAKE) \$(AM_MAKEFLAGS) \$(srcdir)/${derived}_vala.stamp; \\\n"
++ . "\t \$(MAKE) \$(srcdir)/${derived}_vala.stamp; \\\n"
+ . "\tfi\n"
}
# Add rebuild rules for generated header and vapi files
AC_SUBST([am_AUTOUPDATE], ["${AUTOUPDATE-autoupdate}"])
dnl We call AC_PROG_CC in an unusual way, and only for use in our
- dnl testsuite, so also use `no-dependencies' and `no-define' among
+ dnl testsuite, so also use 'no-dependencies' and 'no-define' among
dnl the automake options to avoid bloating and potential problems.
-AM_INIT_AUTOMAKE([1.10a dist-xz filename-length-max=99 color-tests
+AM_INIT_AUTOMAKE([dist-xz filename-length-max=99 color-tests
parallel-tests silent-rules no-define no-dependencies])
# The API version is the base version. We must guarantee
# detected below.
}
-
- # A GNU make-style pattern rule has a single "%" in the target name.
- msg ('portability', $where,
- "'%'-style pattern rules are a GNU make extension")
- if $target =~ /^[^%]*%[^%]*$/;
--
# Diagnose target redefinitions.
if ($tdef)
{
{
if ($oldowner == RULE_USER)
{
- # Ignore `%'-style pattern rules. We'd need the
+ # Ignore '%'-style pattern rules. We'd need the
- # dependencies to detect duplicates, and they are
- # already diagnosed as unportable by -Wportability.
+ # dependencies to detect duplicates.
if ($target !~ /^[^%]*%[^%]*$/)
{
## FIXME: Presently we can't diagnose duplicate user rules
## - once per *extension* (not per language) for generic compilation rules
## - once for each file which requires specific flags.
- ## Note it is on purpose we wrote `if %AMDEP%', since:
+ ## Note it is on purpose we wrote "if %AMDEP%", since:
##
## - if deps are turned off, %AMDEP% is mapped onto FALSE, and therefore
- ## the `if FALSE' chunk is removed (automake-time conditionals).
+ ## the "if FALSE" chunk is removed (automake-time conditionals).
##
## - if deps are on, %AMDEP% is mapped onto AMDEP, and therefore
- ## the `if AMDEP' chunk is prefix with @AMDEP_TRUE@ just like for any
+ ## the "if AMDEP" chunk is prefix with @AMDEP_TRUE@ just like for any
## other configure-time conditional.
##
-## We do likewise for %FASTDEP%; this expands to an ordinary
-## configure-time conditional. %FASTDEP% is used to speed up the
-## common case of building a package with gcc 3.x. In this case we
-## can skip the use of depcomp and easily inline the dependency
-## tracking.
+## We do likewise for %FASTDEP%; this expands to an ordinary configure-time
+## conditional. %FASTDEP% is used to speed up the common case of building
+## a package with gcc >= 3.x. In this case we can skip the use of depcomp
+## and easily inline the dependency tracking.
-## Verbosity of FASTDEP rules
-## --------------------------
-## (1) Some people want to see what happens during make. They think
-## @-commands are evil because hiding things hinders debugging.
-## (2) Other people want to see only the important commands--those that
-## may produce diagnostics, such as compiler invocations. They
-## do not care about build details such as dependency generation
-## (the if/then/else machinery in FASTDEP rules). Their point is
-## that it is hard to spot diagnostics in a verbose output.
-## (3) Other people want "make -s" to work as expected: silently.
-## This way they can spot any diagnostic really easily.
-##
-## The second point suggests we hide rules with @ and that we 'echo'
-## only the relevant parts. However this goes against the two others.
-## There are regular complaints about this on the mailing list, but
-## it's hard to please everybody. On April 2003, William Fulton (from
-## clan (3)) and Karl Berry (from clan (2)) agreed that folding the
-## compile rules so that they are output on a single line (instead of 5)
-## would be a good compromise. Actually we use two lines rather than one,
-## because this way %SOURCE% is always located at the end of the first
-## line and is therefore easier to spot. (We need an extra line when
-## depbase is used.)
+if %?FIRST%
+?SUBDIROBJ?am__depdir = $(dir $@)/$(DEPDIR)
+?!SUBDIROBJ?am__depdir = $(DEPDIR)
+## FIXME: more precise in the removal of the suffix?
+am__depbase = $(am__depdir)/$(basename $(notdir $@))
+## Avoid useless forks when possible.
+am__ensure_depdir = test -d $(am__depdir) || $(MKDIR_P) $(am__depdir)
+endif %?FIRST%
if %?NONLIBTOOL%
?GENERIC?%EXT%.o:
%VERBOSE%source='%SOURCE%' object='%LTOBJ%' libtool=yes @AMDEPBACKSLASH@
DEPDIR=$(DEPDIR) $(%FPFX%DEPMODE) $(depcomp) @AMDEPBACKSLASH@
endif %AMDEP%
- ## We can always use `-o' with Libtool.
+ ## We can always use '-o' with Libtool.
-?GENERIC? %VERBOSE-NODEP%%LTCOMPILE% %-c% -o %LTOBJ% %SOURCEFLAG%%SOURCE%
-## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
-?!GENERIC? %VERBOSE-NODEP%%LTCOMPILE% %-c% -o %LTOBJ% %SOURCEFLAG%`test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
+ %VERBOSE-NODEP%%LTCOMPILE% %-c% -o %LTOBJ% %SOURCEFLAG%$<
endif !%FASTDEP%
endif %?LIBTOOL%
## create this directory under $dc_install_base, because it would
## create very long directory names.
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
-?DISTCHECK-HOOK? && $(MAKE) $(AM_MAKEFLAGS) distcheck-hook \
+?DISTCHECK-HOOK? && $(MAKE) distcheck-hook \
## Parallel BSD make may not start a new shell for each command in a recipe,
- ## so be sure to `cd' back to the original directory after this.
+ ## so be sure to 'cd' back to the original directory after this.
&& am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
## changes the tree; however, invoke the recursive make for debuggability.
@if $(am__make_dryrun); then dry=:; else dry=; fi; \
if test "$(EMACS)" != no && test ! -f $@; then \
- ## If `make -j' is used and more than one file has been erased, several
+ ## If "make -j" is used and more than one file has been erased, several
## processes can execute this block. We have to make sure that only
- ## the first one will run `$(MAKE) elc-stamp', and the other ones will
-## the first one will run "$(MAKE) $(AM_MAKEFLAGS) elc-stamp", and the
-## other ones will wait.
++## the first one will run "$(MAKE) elc-stamp", and the other ones will
+## wait.
##
## There is a race here if only one child of make receive a signal.
## In that case the build may fail. We remove elc-stamp when we receive
$(RECURSIVE_CLEAN_TARGETS:-recursive=)
.PHONY: $(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS)
-.MAKE: $(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS)
# This directory's subdirectories are mostly independent; you can cd
- # into them and run `make' without going through this Makefile.
- # To change the values of `make' variables: instead of editing Makefiles,
- # (1) if the variable is set in `config.status', edit `config.status'
- # (which will cause the Makefiles to be regenerated when you run `make');
- # (2) otherwise, pass the desired values on the `make' command line.
+ # into them and run 'make' without going through this Makefile.
+ # To change the values of 'make' variables: instead of editing Makefiles,
+ # (1) if the variable is set in 'config.status', edit 'config.status'
+ # (which will cause the Makefiles to be regenerated when you run 'make');
+ # (2) otherwise, pass the desired values on the 'make' command line.
$(RECURSIVE_TARGETS):
## Using $failcom allows "-k" to keep its natural meaning when running a
?GENERIC_INFO?%SOURCE_SUFFIX%%DEST_SUFFIX%:
?!GENERIC_INFO?%DEST_INFO_PREFIX%%DEST_SUFFIX%: %SOURCE_INFO% %DEPS%
- ## It is wrong to have `info' files dependent on %DIRSTAMP%, because
- ## `info' files are distributed and %DIRSTAMP% isn't: a distributed file
+ ## It is wrong to have 'info' files dependent on %DIRSTAMP%, because
+ ## 'info' files are distributed and %DIRSTAMP% isn't: a distributed file
## should never be dependent upon a non-distributed built file.
## Therefore we ensure that %DIRSTAMP% exists in the rule.
-?!INSRC??DIRSTAMP? @test -f %DIRSTAMP% || $(MAKE) $(AM_MAKEFLAGS) %DIRSTAMP%
+?!INSRC??DIRSTAMP? @test -f %DIRSTAMP% || $(MAKE) %DIRSTAMP%
## Back up the info files before running makeinfo. This is the cheapest
## way to ensure that
## 1) If the texinfo file shrinks (or if you start using --no-split),
: > sub/conftest.c
for i in 1 2 3 4 5 6; do
echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
+ # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+ # Solaris 10 /bin/sh.
+ echo '/* dummy */' > sub/conftst$i.h
done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+ echo "include sub/conftest.Po" > confmf
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # We check with '-c' and '-o' for the sake of the "dashmstdout"
# mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this. Also, some Intel
- # versions had trouble with output in subdirs
+ # handle '-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs.
am__obj=sub/conftest.${OBJEXT-o}
am__minus_obj="-o $am__obj"
case $depmode in
# STRIPPROG with the value of the STRIP variable (set by the user).
AC_DEFUN([AM_PROG_INSTALL_STRIP],
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
- # Installed binaries are usually stripped using `strip' when the user
- # run `make install-strip'. However `strip' might not be the right
+ # Installed binaries are usually stripped using 'strip' when the user
+ # run "make install-strip". However 'strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
+# tool to use in cross-compilation environments, therefore Automake-NG
- # will honor the `STRIP' environment variable to overrule this program.
- dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+ # will honor the 'STRIP' environment variable to overrule this program.
+ dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
if test "$cross_compiling" != no; then
AC_CHECK_TOOL([STRIP], [strip], :)
fi
sc_cd_in_backquotes \
sc_cd_relative_dir \
sc_perl_at_uscore_in_scalar_context \
- sc_perl_local_no_parens \
sc_perl_local \
sc_AMDEP_TRUE_in_automake_in \
-sc_tests_make_without_am_makeflags \
+sc_tests_no_gmake_requirement \
+sc_tests_no_gmake_checking \
+sc_tests_make_can_chain_suffix_rules \
+sc_tests_make_dont_do_useless_vpath_rebuilds \
+sc_no_dotmake_target \
+sc_no_am_makeflags \
+sc_tests_no_make_e \
+sc_docs_no_make_e \
+sc_make_simple_include \
+sc_tests_make_simple_include \
sc_tests_obsolete_variables \
sc_tests_plain_make \
sc_tests_plain_autoconf \
fi; \
done
- ## Never use `sleep 1' to create files with different timestamps.
- ## Use `$sleep' instead. Some filesystems (e.g., Windows') have only
-## Overriding a Makefile macro on the command line is not portable when
-## recursive targets are used. Better use an envvar. SHELL is an
-## exception, POSIX says it can't come from the environment. V, DESTDIR,
-## DISTCHECK_CONFIGURE_FLAGS and DISABLE_HARD_ERRORS are exceptions, too,
-## as package authors are urged not to initialize them anywhere.
-## Finally, 'exp' is used by some ad-hoc checks, where we ensure it's
-## ok to override it from the command line.
-sc_tests_overriding_macros_on_cmdline:
- @if grep -E '\$$MAKE .*(SHELL=.*=|=.*SHELL=)' $(xtests); then \
- echo 'Rewrite "$$MAKE foo=bar SHELL=$$SHELL" as "foo=bar $$MAKE -e SHELL=$$SHELL"' 1>&2; \
- echo ' in the above lines, it is more portable.' 1>&2; \
- exit 1; \
- fi
-# The first s/// tries to account for usages like "$MAKE || st=$?".
-# 'DISTCHECK_CONFIGURE_FLAGS' and 'exp' are allowed to contain whitespace in
-# their definitions, hence the more complex last three substitutions below.
-# Also, the 'make-dryrun.test' is whitelisted, since there we need to
-# override variables from the command line in order to cover the expected
-# code paths.
- @tests=`for t in $(xtests); do \
- case $$t in */make-dryrun.test);; *) echo $$t;; esac; \
- done`; \
- if sed -e 's/ || .*//' -e 's/ && .*//' \
- -e 's/ DESTDIR=[^ ]*/ /' -e 's/ SHELL=[^ ]*/ /' \
- -e 's/ V=[^ ]*/ /' -e 's/ DISABLE_HARD_ERRORS=[^ ]*/ /' \
- -e "s/ DISTCHECK_CONFIGURE_FLAGS='[^']*'/ /" \
- -e 's/ DISTCHECK_CONFIGURE_FLAGS="[^"]*"/ /' \
- -e 's/ DISTCHECK_CONFIGURE_FLAGS=[^ ]/ /' \
- -e "s/ exp='[^']*'/ /" \
- -e 's/ exp="[^"]*"/ /' \
- -e 's/ exp=[^ ]/ /' \
- $$tests | grep '\$$MAKE .*='; then \
- echo 'Rewrite "$$MAKE foo=bar" as "foo=bar $$MAKE -e" in the above lines,' 1>&2; \
- echo 'it is more portable.' 1>&2; \
- exit 1; \
- fi
- @if grep 'SHELL=.*\$$MAKE' $(xtests); then \
- echo '$$MAKE ignores the SHELL envvar, use "$$MAKE SHELL=$$SHELL" in' 1>&2; \
- echo 'the above lines.' 1>&2; \
- exit 1; \
- fi
-
+ ## Never use 'sleep 1' to create files with different timestamps.
+ ## Use '$sleep' instead. Some filesystems (e.g., Windows) have only
## a 2sec resolution.
sc_tests_plain_sleep:
@if grep -E '\bsleep +[12345]\b' $(xtests); then \
About the tests
---------------
- There are two kinds of tests in the Automake testsuite (both implemented
- as shell scripts). The scripts with the '.test' suffix are "simple"
- tests, their outcome completely determined by their exit status. Those
- with the '.tap' suffix use the TAP protocol. If you want to run a test
- by hand, you can do so directly if it is a simple test:
+ There are two kinds of tests in the Automake-NG testsuite (both
- implemented as shell scripts). The scripts with the `.test' suffix
++ implemented as shell scripts). The scripts with the '.test' suffix
+ are "simple" tests, their outcome completely determined by their exit
- status. Those with the `.tap' suffix use the TAP protocol. If you
++ status. Those with the '.tap' suffix use the TAP protocol. If you
+ want to run a test by hand, you can do so directly if it is a simple
+ test:
./nogzip.test
Include ./defs in every test script (see existing tests for examples
of how to do this).
- Use the `skip_' function to skip tests, with a meaningful message if
- possible. Where convenient, use the `warn_' function to print generic
- warnings, the `fail_' function for test failures, and the `fatal_'
+ Use the 'skip_' function to skip tests, with a meaningful message if
+ possible. Where convenient, use the 'warn_' function to print generic
+ warnings, the 'fail_' function for test failures, and the 'fatal_'
function for hard errors. In case a hard error is due to a failed
- set-up of a test scenario, you can use the `framework_fail_' function
+ set-up of a test scenario, you can use the 'framework_fail_' function
instead.
- For tests that use the `parallel-tests' Automake-NG option, set the
- shell variable `am_parallel_tests' to "yes" before including ./defs.
- For tests that are *not* meant to work with the `parallel-tests'
- For tests that use the 'parallel-tests' Automake option, set the shell
- variable 'am_parallel_tests' to "yes" before including ./defs. For
- tests that are *not* meant to work with the 'parallel-tests' Automake
- option (these should be very very few), set the shell variable
- 'am_parallel_tests' to "no" before including ./defs.
++ For tests that use the 'parallel-tests' Automake-NG option, set the
++ shell variable 'am_parallel_tests' to "yes" before including ./defs.
++ For tests that are *not* meant to work with the 'parallel-tests'
+ Automake-NG option (these should be very very few), set the shell
- variable `am_parallel_tests' to "no" before including ./defs.
++ variable 'am_parallel_tests' to "no" before including ./defs.
- Some tests in the Automake testsuite are auto-generated; those tests
+ Some tests in the Automake-NG testsuite are auto-generated; those tests
might have custom extensions, but their basename (that is, with such
extension stripped) is expected to end with "-w" string, optionally
followed by decimal digits. For example, the name of a valid
Use $sleep when you have to make sure that some file is newer
than another.
- Use `cat' or `grep' to display (part of) files that may be interesting
- for debugging, so that when a user send a verbose output we don't have
- to ask him for more details. Display stderr output on the stderr file
- descriptor. If some redirected command is likely to fail, display its
- output even in the failure case, before exiting.
+ Use cat or grep or similar commands to display (part of) files that
+ may be interesting for debugging, so that when a user send a verbose
+ output we don't have to ask him for more details. Display stderr
+ output on the stderr file descriptor. If some redirected command is
+ likely to fail, display its output even in the failure case, before
+ exiting.
- Use `Exit' rather than `exit' to abort a test.
+ Use 'Exit' rather than 'exit' to abort for leave early from a test
+ case.
- Use `$PATH_SEPARATOR', not hard-coded `:', as the separator of
+ Use '$PATH_SEPARATOR', not hard-coded ':', as the separator of
PATH's entries.
- It's more important to make sure that a feature works, than make
- sure that Automake's output looks correct. It might look correct
+ It's more important to make sure that a feature works, than make sure
+ that the output of Automake-NG looks correct. It might look correct
- and still fail to work. In other words, prefer running `make' over
- grepping `Makefile.in' (or do both).
+ and still fail to work. In other words, prefer running 'make' over
+ grepping Makefile.in (or do both).
- If you run $AUTOMAKE or $AUTOCONF several times in the same test
- and change `configure.ac' by the meantime, do
- rm -rf autom4te.cache
- before the following runs. On fast machines the new `configure.ac'
- could otherwise have the same timestamp as the old `autom4te.cache'.
- Alternatively, use `--force' for subsequent runs of the tools.
+ If you run $ACLOCAL, $AUTOMAKE or $AUTOCONF several times in the
+ same test and change configure.ac by the meantime, do
+ rm -rf autom4te*.cache
+ before the following runs. On fast machines the new configure.ac
+ could otherwise have the same timestamp as the old autom4te.cache.
Use filenames with two consecutive spaces when testing that some
code preserves filenames with spaces. This will catch errors like
`echo $filename | ...`.
Make sure your test script can be used to faithfully check an
- installed version of automake (as with "make installcheck"). For
- example, if you need to copy or grep an automake-provided script,
+ installed version of Automake-ng (as with "make installcheck"). For
+ example, if you need to copy or grep an Automake-ng provided script,
- do not assume that they can be found in the `$top_srcdir/lib'
- directory, but use `$am_scriptdir' instead. The complete list of
- such `$am_..dir' variables can be found in tests/defs-static.in.
+ do not assume that they can be found in the '$top_srcdir/lib'
+ directory, but use '$am_scriptdir' instead. The complete list of
- such "$am_...dir" variables can be found in tests/defs-static.in.
++ such "$am_..dir" variables can be found in tests/defs-static.in.
+
+ When writing input for lex, include the following in the definitions
+ section:
+ %{
+ #define YY_NO_UNISTD_H 1
+ %}
+ to accomodate non-ANSI systems, since GNU flex generates code that
+ includes unistd.h otherwise. Also add:
+ %option never-interactive
+ to the definitions section if the generated code is to be compiled
+ by a C++ compiler, for similar reasons (i.e., the isatty(3) function
+ from that same unistd.h header would be required otherwise).
Before commit: make sure the test is executable, add the tests to
TESTS in Makefile.am, add it to XFAIL_TESTS in addition if needed,
Do not
------
- Do not test an Automake-NG error with `$AUTOMAKE && Exit 1', or in
- Do not test an Automake error with "$AUTOMAKE && Exit 1", or in three
- years we'll discover that this test failed for some other bogus reason.
- This happened many times. Better use something like
++ Do not test an Automake-NG error with "$AUTOMAKE && Exit 1", or in
+ three years we'll discover that this test failed for some other bogus
+ reason. This happened many times. Better use something like
+
AUTOMAKE_fails
grep 'expected diagnostic' stderr
- (Note this doesn't prevent the test from failing for another reason,
- but at least it makes sure the original error is still here).
-
- Do not override Makefile variables using make arguments, as in e.g.:
- $MAKE prefix=/opt install
- This is not portable for recursive targets (targets that call a
- sub-make may not pass "prefix=/opt" along). Use the following
- instead:
- prefix=/opt $MAKE -e install
+
+ (Note this doesn't prevent the test from failing for another
+ reason, but at least it makes sure the original error is still
+ here.)
foo2 += $(foo3)
foo3 = -Wno-error
bar = -Wportability
- # This will give a warning with `-Wportability'.
+ # This will give a warning with '-Wportability'.
-zardoz :=
+.aaa.bbb .ccc.ddd:
- # This would give a warning with `-Woverride'.
+ # This would give a warning with '-Woverride'.
install:
END
# to make sure we do not pollute the tests/ directory.
echo "$me: running etags --version -o /dev/null"
etags --version -o /dev/null \
- || skip_all_ "required program \`etags' not available"
- ;;
- gcc)
- # When gcc is required, export `CC=gcc' so that ./configure
- # always use it. This is important only when the user
- # has defined CC in his environment, otherwise ./configure will
- # prefer gcc to other compilers.
- CC=${am__tool_prefix}gcc
- CFLAGS=$GNU_CFLAGS
- export CC CFLAGS CPPFLAGS
- echo "$me: running $CC --version"
- $CC --version || skip_all_ "GNU C compiler not available"
- echo "$me: running $CC -v"
- $CC -v || skip_all_ "botched installation for GNU C compiler"
+ || skip_all_ "required program 'etags' not available"
;;
- GNUmake)
- for make_ in "$MAKE" gmake gnumake :; do
- MAKE=$make_ am__using_gmake=''
- test "$MAKE" = : && break
- echo "$me: determine whether $MAKE is GNU make"
- # Don't use "&&" here, or a bug of 'set -e' present in some
- # versions of the BSD shell will be triggered. We add the
- # dummy "else" branch for extra safety.
- if using_gmake; then break; else :; fi
- done
- test "$MAKE" = : && skip_all_ "this test requires GNU make"
- export MAKE
- unset make_
- ;;
gcj)
- GCJ=${am__tool_prefix}gcj
- export GCJ
- echo "$me: running $GCJ --version"
- $GCJ --version || skip_all_ "GNU Java compiler not available"
- echo "$me: running $GCJ -v"
- $GCJ -v || skip_all_ "botched installation for GNU Java compiler"
+ GCJ=$GNU_GCJ GCJFLAGS=$GNU_GCJFLAGS; export GCJ GCJFLAGS
+ test "$GCJ" = false && skip_all_ "GNU Java compiler unavailable"
+ : For shells with busted 'set -e'.
+ ;;
+ gcc)
+ CC=$GNU_CC CFLAGS=$GNU_CFLAGS; export CC CFLAGS CPPFLAGS
+ test "$CC" = false && skip_all_ "GNU C compiler unavailable"
+ : For shells with busted 'set -e'.
;;
g++)
- CXX=${am__tool_prefix}g++
- CXXFLAGS=$GNU_CXXFLAGS
- export CXX CXXFLAGS CPPFLAGS
- echo "$me: running $CXX --version"
- $CXX --version || skip_all_ "GNU C++ compiler not available"
- echo "$me: running $CXX -v"
- $CXX -v || skip_all_ "botched installation for GNU C++ compiler"
+ CXX=$GNU_CXX CXXFLAGS=$GNU_CXXFLAGS; export CXX CXXFLAGS CPPFLAGS
+ test "$CXX" = false && skip_all_ "GNU C++ compiler unavailable"
+ : For shells with busted 'set -e'.
;;
gfortran)
- FC=${am__tool_prefix}gfortran
- FCFLAGS=$GNU_FCFLAGS
- export FC FCFLAGS
- echo "$me: running $FC --version"
- $FC --version || skip_all_ "GNU Fortran compiler not available"
- echo "$me: running $FC -v"
- $FC -v || skip_all_ "botched installation for GNU Fortran compiler"
+ FC=$GNU_FC FCFLAGS=$GNU_FCFLAGS; export FC FCFLAGS
+ test "$FC" = false && skip_all_ "GNU Fortran compiler unavailable"
case " $required " in
*\ g77\ *) ;;
*) F77=$FC FFLAGS=$FCFLAGS; export F77 FFLAGS;;
# Check that we don't complain for files that aren't outdated.
$EGREP " (foo|bar).m4" output && Exit 1
- # Now we again use `--install' explicitly, and "make distcheck"
+ # Now we again use '--install' explicitly, and "make distcheck"
# should pass.
$ACLOCAL -I m4 --install
-using_gmake || $MAKE Makefile
$MAKE distcheck
# Similar to what have been done above, but this time we:
ACLOCAL_PATH="$cwd/pth"; export ACLOCAL_PATH
- # The explicit use of `--install' here won't help when the installed file
- # `.m4' will become out-of-date w.r.t. the one in the system acdir.
+ # The explicit use of '--install' here won't help when the installed file
+ # '.m4' will become out-of-date w.r.t. the one in the system acdir.
$ACLOCAL -I m4 --install
-using_gmake || $MAKE Makefile
$MAKE distcheck
# Only increase serial number, without changing the other contents; this
# Check that we don't complain for files that aren't outdated.
$EGREP " (foo|bar|baz).m4" output && Exit 1
- # Now we again use `--install' explicitly, and "make distcheck"
+ # Now we again use '--install' explicitly, and "make distcheck"
# should pass.
$ACLOCAL -I m4 --install
-using_gmake || $MAKE Makefile
$MAKE distcheck
:
rm -rf $me-1.0
# Remove the dot from VERSION for the next grep.
-VERSION=10 MKDIR_P='echo MKDIR_P' $MAKE -e distdir >stdout || :
+$MAKE distdir VERSION=10 MKDIR_P='echo MKDIR_P' >stdout || :
cat stdout
- # Make sure no `./' appear in the directory names. srcdir is `..', so
+ # Make sure no './' appear in the directory names. srcdir is '..', so
# this also checks that no directory is created in the source tree.
grep 'MKDIR_P.*\.' stdout && Exit 1
# Java people need this.
# PR/317, reported by Eric Siegerman and Philip Fong.
--# Require GNU make for this test. SunOS Make does not support
- # `$$' in a target or a dependency (it outputs the empty string instead).
-# '$$' in a target or a dependency (it outputs the empty string instead).
-required=GNUmake
. ./defs || Exit 1
echo AC_OUTPUT >> configure.ac
silentcxx-gcc.test \
silentf77.test \
silentf90.test \
+ silent-amopts.test \
silent-many-gcc.test \
silent-many-generic.test \
-silent-nowarn.test \
silent-configsite.test \
-silent-nested-vars.test \
silent-lex.test \
silent-yacc.test \
silent-yacc-headers.test \
spell3.test \
spelling.test \
spy.test \
+spy-vpath-rewrite.test \
+ spy-rm.tap \
stdinc.test \
stamph2.test \
stdlib.test \
vala5.test \
vala-vpath.test \
vala-mix.test \
+ vala-mix2.test \
vars.test \
-vars3.test \
+vars-assign.test \
vartar.test \
vartypos.test \
vartypo2.test \
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
- # Ensure that `make -n dist' and `make -n distcheck' do not change files
- # on disk, due to GNU make executing rules containing `$(MAKE)'.
- # Also, ensure that `make -n dist' and `make -n distcheck' show what
-# Ensure that 'make -n dist' and 'make -n distcheck' do not change files
++# Ensure that "make -n dist" and "make -n distcheck" do not change files
+ # on disk, due to GNU make executing rules containing '$(MAKE)'.
-# Also, ensure that 'make -n dist' and 'make -n distcheck' show what
-# would happen, at least when using GNU make.
++# Also, ensure that "make -n dist" and "make -n distcheck" show what
+# would happen.
. ./defs || Exit 1
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
- # Test `make -n' for various targets, to ensure that:
+ # Test 'make -n' for various targets, to ensure that:
+ #
# 1. no files or directories are created or removed, and
-#
-# 2. if using GNU make or a make implementation supporting the .MAKE
-# special target, the output from make is sufficiently complete.
+# 2. the output from make is sufficiently complete.
#
# This test exercises the GCS-mandated targets (except for dist)
# as well as tags, TAGS.
errmsg = ::OOPS:: Recursion too deep
-if IS_GNU_MAKE
+is_too_deep := $(shell test $(MAKELEVEL) -lt 10 && echo no)
- is_too_deep := $(shell test $(MAKELEVEL) -lt 10 && echo no)
-
-## Indenteation here required to avoid confusing Automake.
+## Extra indentation here required to avoid confusing Automake.
+## FIXME: now that we assume make is GNU make, this shouldn't happen!
ifeq ($(is_too_deep),no)
+ # All is ok.
else
- $(error $(errmsg), $(MAKELEVEL) levels)
+ $(error $(errmsg), $(MAKELEVEL) levels)
endif
-
-else !IS_GNU_MAKE
-
-# We use mkdir to detect the level of recursion, since it is easy
-# to use and assured to be portably atomical. Also use an higher
-# number than with GNU make above, since the level used here can
-# be incremented by tow or more per recursion.
-recursion-not-too-deep:
- @ok=no; \
- for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 \
- 18 19 20 21 22 23 24 25 26 27 28 29; \
- do \
- echo " mkdir rec-$$i.d"; \
- if mkdir rec-$$i.d; then \
- ok=yes; break; \
- else :; fi; \
- done; \
- test $$ok = yes || { echo '$(errmsg)' >&2; exit 1; }
-.PHONY: recursion-not-too-deep
-clean-local:
- rmdir rec-[0-9].d
-
-targets = all check recheck $(TESTS) $(TEST_LOGS) $(TEST_SUITE_LOG)
-$(targets): recursion-not-too-deep
-
-# For BSD make.
-.BEGIN: recursion-not-too-deep
-
-endif !IS_GNU_MAKE
END
-if using_gmake; then
- cond=:
-else
- cond=false
-fi
-
-cat >> configure.ac << END
-AM_CONDITIONAL([IS_GNU_MAKE], [$cond])
-AC_OUTPUT
-END
+echo AC_OUTPUT >> configure.ac
# Another helpful idiom to avoid hanging on capable systems. The subshell
- # is needed since `ulimit' might be a special shell builtin.
+ # is needed since 'ulimit' might be a special shell builtin.
if (ulimit -t 8); then ulimit -t 8; fi
$ACLOCAL
# Check that the default testsuite log doesn't get unduly modified.
# Also check that the testsuite log file doesn't need to be named
- # accordingly to the `*.log' pattern.
+ # accordingly to the '*.log' pattern.
chmod a-w test-suite.log
-TEST_SUITE_LOG=TheLogFile $MAKE -e check
+$MAKE check TEST_SUITE_LOG=TheLogFile
ls -l
diff orig test-suite.log
test_log_expected TheLogFile
. ./defs || Exit 1
case $MAKE in
- *\ -j*) skip_ "\$MAKE contains \`-j'";;
+ *\ -j*) skip_ "\$MAKE contains '-j'";;
esac
-if using_gmake; then
- j=-j
-else
- unindent > Makefile <<END
- all: one two
- one:
- $sleep && test -f two
- two:
- echo ok > \$@
-END
- for j in "-j" "-j " NONE; do
- if test x"$j" = xNONE; then
- skip_ "can't run make in parallel mode"
- fi
- $MAKE ${j}2 all >output 2>&1 || continue
- $EGREP -i "(warning|error):|-j[\"\'\` ]" output && continue
- break
- done
- rm -f one output Makefile
-fi
-
cat >> configure.ac << 'END'
AC_OUTPUT
END
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Another test for -Wportability warning about %-style rules, plus
+# Support for pattern rules:
# make sure we don't warn about duplicate definition for
- # `${ARCH}/%.$(OBJEXT):'.
+ # '${ARCH}/%.$(OBJEXT):'.
# Report from Ralf Corsepius.
. ./defs || Exit 1
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Check that remake rules works from subdirectories, even using
- # `GNUmakefile' as makefiles name. This obviously requires GNU
+ # 'GNUmakefile' as makefiles name. This obviously requires GNU
# make.
- # See also the other similar tests `remake-subdir*.test', and the
- # related test `aclocal5.test'
+ # See also the other similar tests 'remake-subdir*.test', and the
+ # related test 'aclocal5.test'
-required=GNUmake
. ./defs || Exit 1
magic1='::MagicString::One::'
$FGREP $magic3 zardoz
$FGREP $magic1 zardoz && Exit 1
$FGREP $magic2 zardoz && Exit 1
- # After the remake above, the files `zardoz.am' and `zardoz.in'
+ # After the remake above, the files 'zardoz.am' and 'zardoz.in'
# should be no more needed.
echo 'endif' > zardoz.am # Put in a syntax error.
-is_gmake || $MAKE zardoz
$MAKE test
rm -f zardoz.in zardoz.am # Get rid of them.
-is_gmake || $MAKE zardoz
$MAKE test
echo 'FOO = $(BAR)' >> quux.am
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Test that automake works around a bug of Solaris Make. The bug is the
-# following. If we have a Makefile containg a file inclusion like this:
+# If we have a Makefile containing a file inclusion like this:
+#
# include .//foo.mk
-# Solaris make fails with a message like:
+#
+# Solaris 10 make fails with a message like:
+#
- # make: ... can't find `/foo.mk': No such file or directory
- # make: fatal error ... read of include file `/foo.mk' failed
+ # make: ... can't find '/foo.mk': No such file or directory
+ # make: fatal error ... read of include file '/foo.mk' failed
-# (even if the file 'foo.mk' exists). The error disappear by collapsing
-# the repeated slash '/' characters into a single one.
+#
- # (even if the file `foo.mk' exists). The error disappear by
- # collapsing the repeated slash `/' characters into a single one.
++# (even if the file 'foo.mk' exists). The error disappear by
++# collapsing the repeated slash '/' characters into a single one.
+#
+# GNU make shouldn't suffer from this bug; but we check for it
+# anyway -- better safe than sorry.
#
- # See also sister "grepping" test `subobj11b.test', and related test
- # `subobj11c.test'.
+ # See also sister "grepping" test 'subobj11b.test', and related test
+ # 'subobj11c.test'.
required=cc
. ./defs || Exit 1
# Automatic dependency tracking with subdir-objects option active:
# check for a pathological case of slash-collapsing in the name of
# included makefile fragments (containing dependency info).
- # See also related test `subobj11a.test'.
-# See also related tests 'subobj11a.test' and 'subobj11b.test'.
++# See also related test 'subobj11a.test'.
. ./defs || Exit 1
}
END
-directive=''; make_can_chain_suffix_rules || directive=TODO
-
-for target in all distcheck; do
- command_ok_ "make $target" \
- -D "$directive" -r "suffix rules not chained" \
- $MAKE $target
-done
+command_ok_ "make all" $MAKE all
+command_ok_ "make distcheck" $MAKE distcheck
- # FIXME: should we check that intermediate file `foo.cc' has
+ # FIXME: should we check that intermediate file 'foo.cc' has
# been removed? Or is this requiring too much from the make
# implementation?
count_test_results total=2 pass=1 fail=0 xpass=0 xfail=0 skip=0 error=1
- # See that the option `--no-merge' can override the effect of `--merge'.
+ # See that the option '--no-merge' can override the effect of '--merge'.
-TEST_LOG_DRIVER_FLAGS=--no-merge $MAKE -e check >stdout \
+$MAKE check TEST_LOG_DRIVER_FLAGS=--no-merge >stdout \
|| { cat stdout; Exit 1; }
cat stdout
: No need to re-run a.test anymore, but c.test should be rerun,
: as it contained an XPASS. And this time, make it fail with
: an hard error.
- # Use `echo' here, since Solaris 10 /bin/sh would try to optimize
- # a `:' away after the first iteration, even if it is redirected.
+ # Use 'echo' here, since Solaris 10 /bin/sh would try to optimize
+ # a ':' away after the first iteration, even if it is redirected.
echo dummy > c.err
- env TEST_LOGS='a.log c.log' $MAKE -e recheck >stdout \
- && { cat stdout; Exit 1; }
+ $MAKE TEST_LOGS='a.log c.log' recheck >stdout && { cat stdout; Exit 1; }
cat stdout
count_test_results total=1 pass=0 fail=0 xpass=0 xfail=0 skip=0 error=1
test ! -r a.run
: c.test contained and hard error the last time, so it should be re-run.
: This time, make it pass
- # Use `echo', not `:'; see comments above for why.
+ # Use 'echo', not ':'; see comments above for why.
echo dummy > c.ok
- env TESTS='c.test a.test' $MAKE -e recheck >stdout \
- || { cat stdout; Exit 1; }
+ $MAKE TESTS='c.test a.test' recheck >stdout || { cat stdout; Exit 1; }
cat stdout
count_test_results total=1 pass=1 fail=0 xpass=0 xfail=0 skip=0 error=0
test ! -r a.run
test -f foo.trs
test -f bar.trs
test ! -f sub/zardoz.trs
- # "make clean" shouldn't remove `.trs' files for tests not in $(TESTS).
+ # "make clean" shouldn't remove '.trs' files for tests not in $(TESTS).
-TESTS=bar.sh $MAKE -e clean
+$MAKE TESTS=bar.sh clean
test -f foo.trs
test ! -f bar.trs
test -f foo.trs
test -f bar.trs
test ! -f sub/zardoz.trs
- # "make clean" shouldn't remove `.trs' files for tests whose log
+ # "make clean" shouldn't remove '.trs' files for tests whose log
# is not in $(TEST_LOGS).
-TEST_LOGS=foo.log $MAKE -e clean
+$MAKE TEST_LOGS=foo.log clean
test ! -f foo.trs
test -f bar.trs
test ! -f sub/zardoz.trs
test -f $distdir/baz/zardoz-parse.h
# Sanity check the distribution.
-yl_distcheck
+$MAKE distcheck
- # While we are at it, make sure that `parse.c' and `parse.h' are erased
+ # While we are at it, make sure that 'parse.c' and 'parse.h' are erased
# by maintainer-clean, and not by distclean.
$MAKE distclean
test -f foo/parse.c
# Try to enable dependency tracking even with slow dependency
# extractors, to improve coverage.
../configure --enable-dependency-tracking YACC=false
-$MAKE
++
+$MAKE all YACC=false
ls -l sub/*.[ch] && Exit 1
-env DISTCHECK_CONFIGURE_FLAGS='YACC=false' $MAKE distcheck
+$MAKE distcheck YACC=false DISTCHECK_CONFIGURE_FLAGS='YACC=false'
: