Commit Graph

6661 Commits

Author SHA1 Message Date
Zack Weinberg
9b5c0f1774
Generate manpages directly from source code.
We generate manpages for autoconf’s installed programs (autoconf,
autoheader, etc.) using help2man, which runs each program in order to
learn its --help output.  Each manpage therefore has a dependency on
the existence of the corresponding program, but this dependency is
intentionally left out of the Makefile so that one can build from a
tarball release (which will include prebuilt manpages) without having
help2man installed.

But when building from a git checkout with high levels of
parallelism (-j20 or so), the missing dependency can lead to build
failures, because help2man will try to run the program before it
exists.  In an earlier patch I tried to work around this with a
recursive make invocation in the ‘.x.1’ rule, to ensure the existence
of the program.  That only traded one concurrency bug for another, now
we could have two jobs trying to build the same program simultaneously
and they would clobber each other’s work and the build would still
fail.

Instead, this patch introduces a utility script ‘help-extract.pl’ that
reads --help and --version information directly from the source code
for each program.  This utility, wrapped appropriately for each
program, is what help2man now runs.  Usage is a little weird because
help2man doesn’t let you specify any arguments to the “executable”
that it runs, but it works, and lets us write all of the true
dependencies of each manpage into the Makefile without naming any file
that would be created during a build from a tarball.  help-extract.pl
is a Perl script, so it introduces no new build-time requirements.

A downside is that we have to make sure each of the script sources in
bin/, and also part of lib/Autom4te/ChannelDefs.pm, are parseable by
help-extract.  The most important constraints are that the text output
by --help must be defined in a global variable named ‘help’, and its
definition has to be formatted just the way these definitions are
currently formatted.  Similarly for --version.  Furthermore, only some
non-literal substitutions are possible in these texts; each has to be
explicitly supported in help-extract.pl.  The current list of supported
substitutions is $0, @PACKAGE_NAME@, @VERSION@, @RELEASE_YEAR@, and
Autom4te::ChannelDefs::usage.

The generated manpages themselves are character-for-character
identical before and after this patch.

 * build-aux/help-extract.pl: New build script that extracts --help
  and --version output from manpages.

 * man/autoconf.w, man/autoheader.w, man/autom4te.w, man/autoreconf.w
 * man/autoscan.w, man/autoupdate.w, man/ifnames.w: New shell scripts
   which wrap build-aux/help-extract.pl.

 * man/local.mk: Generate each manpage by running help2man on the
   corresponding .w script, not on the built utility itself.
   Revise all dependencies to match.

 * bin/autoconf.as: Rename ‘usage’ variable to ‘help’ and
   ‘help’ variable to ‘usage_err’.
 * bin/autoheader.in: Call Autom4te::ChannelDefs::usage with no
   function-call parentheses, matching all the other scripts.
 * bin/autom4te.in: Initialize $version with a regular double-quoted
   string, not a heredoc, matching all the other scripts.
 * bin/autoscan.in: Remove global variable $configure_scan.
2020-08-21 16:23:32 -04:00
Zack Weinberg
acf6fb022b
Fix ‘make distcheck’ failure due to generated manpages in build dir.
If we are doing a VPATH build and we generate the manpages,
they will be written to the build directory, and should be
deleted by ‘make distclean’; ‘make distcheck’ fails if this
is not done.  However, if we are doing a build in the source
directory, the manpages might have been shipped to us and we
should *not* delete them in ‘make distclean’.

Correction to 5d3c99e562.

* man/local.mk (distclean-local-man): New rule.  Delete $(dist_man_MANS)
  in VPATH builds only.
  (MOSTLYCLEANFILES, .x.1): Don’t use globs to decide what to delete.
2020-08-21 13:53:18 -04:00
Zack Weinberg
1a5ed45669
tests: New helper macro AT_CHECK_MAKE.
This macro factors out some repeated code surrounding tests that run
make, such as honoring $MAKE, *not* honoring $MAKEFLAGS, and
normalizing the exit status.  Partially addresses bug #110267
(problems with Sun’s make barfing on GNU make options from
$MAKEFLAGS).

Also addresses some unrelated problems I noticed while changing all
the tests that run make to use this macro:

The shtool test is now properly skipped if shtool is not available on
the host system.

Some of the Fortran tests would create an executable and then run it,
others would create an executable and then the AT_CHECK operation that
would run it was commented out.  There’s no evidence in the changelog
or the git history for why this was done.  I uncommented all of the
commented-out cases; this can be undone easily if it causes
problems.  (It can’t be an issue with cross-compilation because some
of the tests do run the executable.)

* tests/local.at (AT_CHECK_MAKE): New macro wrapping an AT_CHECK
  invocation of make.  All tests that run make updated to use this macro.
* tests/fortran.at: Uncomment all AT_CHECKs that run the just-compiled
  program.
* tests/foreign.at (shtool): Skip the test if shtool is not available
  from the host system.  Simplify shell logic.
2020-08-20 14:07:59 -04:00
Zack Weinberg
6c2d3e8edc
Properly skip erlang tests when erl/erlc are not available.
Fallout from the previous change, which I should’ve tested on a
machine without Erlang tools installed, before pushing.

It bugs me a little that we have to put these special exit codes into
autoconf itself instead of the testsuite, but it is what it is.

 * lib/autoconf/erlang.m4 (AC_ERLANG_NEED_ERLC, AC_ERLANG_NEED_ERL):
 Exit with code 77 on failure so testsuite understands to skip Erlang
 tests in this case.
 (AC_ERLANG_CHECK_LIB): Use AC_ERLANG_NEED_ERLC and AC_ERLANG_NEED_ERL
 instead of the _PATH_ versions.
2020-08-20 13:18:42 -04:00
Zack Weinberg
5fd2e37e46
tests/suite.at: m4_include acerlang.at.
This corrects a long-standing oversight; the “blind” tests for the
Erlang macros have never actually gotten run.
2020-08-20 08:51:46 -04:00
Zack Weinberg
fa0754f704
_AC_COMPILER_EXEEXT_CROSS: exit 77 if test program does not run
This causes our testsuite to report a skipped test, rather than a
failure, if the detected compiler for _AC_LANG produces broken
executables.  It matches the behavior of _AC_COMPILER_EXEEXT_DEFAULT,
which has exited with that code for a long time if it hits the
“_AC_LANG compiler cannot *create* executables” failure case.

Partially addresses bug #110267.  The Solaris 10 machine I have access
to, has a broken gccgo installation that generates executables that
crash on startup.   Without this patch, test “358: Go” fails.  With
this patch, it is skipped.
2020-08-18 16:47:42 -04:00
Zack Weinberg
5d3c99e562
Generate manpages in build directory.
It is not necessary to generate the manpages in the source directory
during a split build; ‘make dist’ can still find them in the build
directory and put them in the tarball.

Also add some defensive logic to the .x.1 rule to ensure that
bin/command and tests/command exist before generating man/command.1.
Without this, if you do a sufficiently parallel build, help2man may
generate the manpage from an older installed copy of ‘command’.
(Ideally, we wouldn’t have to run ‘command’ at all and this would not
be an issue, but ‘help2man’ doesn’t appear to support that.)

After this patch, the only files written to the source directory
during the ‘make’ phase of a split build (starting from a clean Git
checkout) are

doc/version.texi
doc/stamp-vti
doc/autoconf.info
doc/standards.info

These are not under our control, they’re being created by automake’s
built-in rules for Texinfo documentation.

* man/local.mk: Replace all instances of $(mansrcdir) with literal ‘man’.
  (.x.1): Ensure that bin/command, tests/command, and the man
  directory exist before creating man/command.1.
2020-08-18 16:32:33 -04:00
Zack Weinberg
924ba17398
Delete a dummy ChangeLog in ‘make distclean’.
‘make distcheck’ from git may create a dummy ChangeLog file in the
build directory.  Delete this on ‘make distclean’, but don’t delete
a real ChangeLog (generated by the gen-ChangeLog rule).

* Makefile.am (distclean-local): Delete ChangeLog if it is the dummy
  created to pacify automake.
2020-08-18 15:09:49 -04:00
Zack Weinberg
17a7ec16a7
Don’t distribute tests/ac*.at.
tests/ac*.at are generated files containing basic test cases for all
the public AC_* macros that can be invoked without arguments.  They’re
generated using a simple awk script, and we already require awk at
build time because of automake, so there is no reason to ship them in
the tarball.  If we don’t ship them in the tarball, we can simplify
the logic in tests/local.mk, and avoid writing these files to the
source directory in a split build.

This should fix a problem with split builds using Solaris’ dmake
(see bug #110289).

tests/mktests.sh probably doesn’t work right if any of its argument
paths have spaces in their names, but that’s a separate issue.

* tests/local.mk (tests/mktests.stamp): Don’t change directory or
  rewrite the contents of $(AUTOCONF_FILES).
  (TESTSUITE_GENERATED_AT): Remove $(srcdir) prefix.
  Add tests/acerlang.at (accidentally omitted).
  (CLEANFILES): Add $(TESTSUITE_GENERATED_AT), mktests.stamp and mktests.tmp.
  (MAINTAINERCLEANFILES): Don’t set.
  (EXTRA_DIST): Include only the hand-written .at files, $(TESTSUITE_HAND_AT).

* configure.ac: Run AC_PROG_AWK, if for some reason AM_INIT_AUTOMAKE
  hasn’t done it for us.
* tests/mktests.sh: Use $AWK if set in environment.  Shell script linting.
2020-08-18 14:54:24 -04:00
Zack Weinberg
2f97729b39
autoreconf: mention intltoolize and gtkdocize in --help output. 2020-08-18 08:58:40 -04:00
Eli Schwartz
b3b3af821a
autoreconf: integrate intltoolize into the standard configuration tools
In addition to the gtkdocize tool, gtk-related software may utilize the
IT_PROG_INTLTOOL macro in order to require the intltoolize tool. So too
here should the tool be run by autoreconf itself, in order to guarantee
its initialization via the unified frontend for all autotools projects.
2020-08-18 08:49:18 -04:00
Eli Schwartz
dd880a0a6d
autoreconf: integrate gtkdocize into the standard reconfiguration tools
When the GTK_DOC_CHECK macro is in use, this flags a given configure.ac
as belonging the the common class of gtk-related software that requires
the gtkdocize tool to be run before autoreconf, in order to install the
gtk-doc macro and Makefile fragment. Make this easier to accomplish via
teaching autoreconf how to detect and run this tool automatically; this
gets us one step closer to a world in which `autoreconf -fi` on its own
is enough to bootstrap any autotools project into a configurable state.
2020-08-18 08:44:13 -04:00
Zack Weinberg
aba75f6d4a
Warn if AC_INIT or AC_OUTPUT are missing from configure.ac (#107986)
It is almost always incorrect for a configure script to omit either
AC_INIT or AC_OUTPUT.  Issue warnings in the ‘syntax’ category for
this.

The implementation is, unfortunately, a bit of a kludge.  To check for
the _absence_ of a macro invocation, we can use m4_provide_if inside a
m4_wrap hook.  However, if we activate the m4_wrap hook directly from
general.m4, we get spurious warnings at freeze time.  We also get
warnings whenever a script that’s missing AC_INIT and/or AC_OUTPUT
is *traced*, which means we get double warnings from autoconf, and
autoheader and aclocal complain about it too, which seems unnecessary.

A clean way to deal with this would be to make the hook look for a
special macro that’s defined only when autoconf (the program) is
invoked without any --trace arguments.  Unfortunately, autom4te
doesn’t pass --define down to M4, and changing that would involve
coordinating with Automake (the project), so instead I’ve gone for the
kludge: a new file lib/autoconf/trailer.m4 that calls m4_wrap.  This
file is *not* included in autoconf.m4f, but it’s installed, and it’s
added to the m4 invocation by autoconf (the program) only when not
tracing.  (It still uses m4_wrap, because we pass it to m4 *before*
configure.ac, because otherwise we get nonsense locations for any
*other* diagnostics coming out of this autoconf invocation.  I don’t
know why.)

The additional checks in autoreconf are intended to make sure that if
autoreconf skips a directory entirely, you get told why.

Lots of tests in the testsuite didn’t bother with AC_OUTPUT, and
somewhat fewer didn’t bother with AC_INIT; where possible I just added
them.

Suggested by David A. Wheeler, who submitted a patch, but I didn’t
wind up using any of his code.  (His implementation used an extra
tracing pass, only checked for a missing AC_INIT, and invented a new
command-line option to turn off this specific warning.  I thought this
was tidier overall, despite the kludge.)

* lib/autoconf/general.m4 (_AC_FINALIZE): New macro: code to be run
  when generating configure, after the entire configure.ac is
  processed. Currently only checks that AC_INIT and AC_OUTPUT were
  called at some point, issuing syntax-category warnings if not.
  (AC_INIT, AC_OUTPUT): m4_provide self.
* lib/autoconf/trailer.m4: New file that just calls m4_wrap([_AC_FINALIZE]).
* lib/local.mk: Install new file.

* bin/autoconf.as: Add trailer.m4 to the final invocation of autom4te,
  but only when not tracing.
* bin/autoreconf.in (autoreconf_current_directory): Distinguish in
  diagnostics between “directory skipped because it doesn’t have a
  configure.ac or configure.in” (e.g. Cygnus configure) and “directory
  has a configure.ac but it doesn’t appear to be autoconf input.”

* tests/*.at: Fix all tests affected by the new warnings.
2020-08-18 08:24:05 -04:00
Zack Weinberg
6a0c023944
Trim whitespace from arguments of AC_INIT (#107986)
Specifically, all five arguments, if present, are passed through
m4_normalize before doing anything else with them.  For instance,
AC_INIT([  GNU  Hello  ], [1.0]) is now equivalent to
AC_INIT([GNU Hello], [1.0]).

As a consequence, newlines in the arguments to AC_INIT are now
converted to spaces and no longer trigger warnings.

Also, diagnose inappropriate contents of the fourth and fifth
arguments as well as the first three.  The fifth argument should be
“usable as-is in single- and double-quoted strings and quoted and
unquoted here-docs,” like the first three.  (This is the check
performed by _AC_INIT_LITERAL.)  The fourth argument (TARNAME) is used
to construct filenames, so apply an even more stringent test, namely
AS_LITERAL_WORD_IF.

Suggested by David A. Wheeler, who submitted a patch, but I didn’t
wind up using any of his code.

* lib/autoconf/general.m4 (_AC_INIT_LITERAL): Not necessary to check
  for newlines anymore.
  (_AC_INIT_PACKAGE): Pass all five arguments through m4_normalize
  before doing anything else with them.  New warning: apply
  _AC_INIT_LITERAL to fifth argument (URL).  New warning: complain
  if fourth argument (TARNAME) is not a literal word according to
  AS_LITERAL_WORD_IF.  Simplify a conditional by using m4_default.

* tests/base.at (AC_INIT with unusual version strings): Adjust to
  match above changes, add more subtests.
2020-08-18 08:24:00 -04:00
Paul Eggert
508225174b Avoid one-argument ‘main’
* tests/autotest.at (C unit tests, C unit tests (EXEEXT)):
Avoid ‘int main (int argc)’ as the C standard says this
is not portable.
2020-08-06 17:52:49 -07:00
Paul Eggert
0ea8d9d468 Pacify -Werror in two places
Although this cannot easily be done in general, there are a couple
of places where it’s easy.
* lib/autoconf/c.m4 (AC_LANG_INT_SAVE (C)):
Change ‘()’ to ‘(void)’ to pacify picky compilers.
Problem reported by Vincent Lefevre in:
https://lists.gnu.org/r/autoconf-patches/2020-08/msg00000.html
(AC_C_INLINE): Likewise.
2020-08-06 17:52:49 -07:00
Paul Eggert
185f58e9c1 * lib/autoconf/c.m4: Bring XL C comments up to date. 2020-08-06 13:27:43 -07:00
Paul Eggert
4880949b8d * TODO: Add -Werror support. 2020-08-06 12:28:40 -07:00
Zack Weinberg
6f4dd4677a
AT_CHECK_MACRO: Preserve config.log and config.status from run 1.
AT_CHECK_MACRO runs a test configure script twice and looks for
differences in the results.  If something goes wrong, it’ll be helpful
for debugging to preserve the config.log and config.status files from
both runs.

* tests/local.at (AT_CHECK_MACRO): Also copy config.log and
  config.status to config-log.$at_run and config-status.$at_run
  respectively.
2020-08-05 10:45:22 -04:00
Zack Weinberg
c16be7152d
Only probe C++ language features, not library, for speed (#110285)
The test programs used by _AC_PROG_CXX_CXX98 and _AC_PROG_CXX_CXX11
can take several seconds to compile, even on current-generation CPUs.
Each of them may be test-compiled up to six times as the configure
script searches for appropriate command-line switches.  This is
reported to cancel out all of the other performance gains made since
2.69.

Replace these programs with simpler ones that do not exercise the C++
standard *library* and can be compiled in less than a second each.
On my computer, which is quite new, the minimal configure script

    AC_INIT
    AC_PROG_CXX

executes in 4.5 seconds (wall-clock) before this change and 0.5
seconds after.

* lib/autoconf/c.m4 (_AC_CXX_CXX98_TEST_HEADER, _AC_CXX_CXX98_TEST_BODY):
  Rewrite to test only C++ 1998 language features, not library features.
  (_AC_CXX_CXX11_TEST_HEADER, _AC_CXX_CXX11_TEST_BODY):
  Similarly for C++ 2011.
* doc/autoconf.texi (AC_PROG_CXX): Document this change.
2020-08-04 13:08:31 -04:00
Zack Weinberg
2cb0ab81b9
Filter out _AST_FEATURES when comparing environment state. (#110283)
ksh93 uses an environment variable called _AST_FEATURES to communicate
with subshell instances of itself.  Its value may change at any time
so AT_CHECK_ENV and AT_CONFIG_CMP should ignore it.

This was responsible for many spurious testsuite failures on
OpenIndiana.  Problem reported by Bob Friesenhahn.

* tests/local.at (_AT_CHECK_ENV, AT_CONFIG_CMP): Add _AST_FEATURES to
  list of variables set by shells to unstable values.
2020-08-04 13:05:49 -04:00
Zack Weinberg
50d06060f1
Partially revert e54e3f90: restore use of $(MAKE) in error message.
In commit 14d58bfd, the error message printed by the
‘abort-due-to-no-makefile’ rule in GNUmakefile was changed to refer to
the value of ‘$(MAKE)’ instead of a literal ‘make’.  A subsequent
‘make fetch’ (e54e3f90) clobbered this.  Put it back.
2020-08-04 08:46:59 -04:00
Paul Eggert
0f8fd8ec86 Expect OpenIndiana test failure
On OpenIndiana, Perl file locking does not work atop NFS.
* tests/tools.at (autom4te cache locking):
Expect this test to file if Perl file locking does not work.
2020-08-02 16:31:55 -07:00
Paul Eggert
3ba414b2c4 Work around ksh93 bug that broke config.status
* lib/autoconf/status.m4 (_AC_OUTPUT_HEADER):
Use ‘>&1’, which is a no-op, to work around a bug in ksh93
Version JM 93t+ 2010-03-05 as used in OpenIndiana.
The bug causes ‘printf "foo"’ to mistakenly succeed in
some cases even though the underlying ‘write’ syscall fails.
The ‘>&1’ causes the printf to fail, as it should.
2020-08-02 16:31:55 -07:00
Paul Eggert
4178160225 Fix regression: autotools and whitespace in file names
* bin/autoheader.in (templates_for_header): Fix previous change by
not warning about file names with shell metacharacters, as this is
OK for command-line file names.
2020-08-01 17:53:53 -07:00
Paul Eggert
e54e3f907b make fetch 2020-08-01 17:53:53 -07:00
Paul Eggert
e30ed26209 Fix regression that broke Automake ‘make check’
Problem reported by Ken Moffat (sr#110287); the problem was
introduced in 2016-12-21T16:15:46Z!daniel.kitta@gmail.com.
* bin/autoheader.in (templates_for_header):
When generating warnings about symbols lacking templates,
downgrade template read failure from a fatal error to a warning.
Also, don’t even try to read from a template file whose name has
shell metavariables (which Autoconf 2.50 withdrew support for);
just warn about that, too.  These changes cause the Automake
tests to merely generate warnings that are ignored, instead
of failing.
* doc/autoconf.texi (Configuration Files, Configuration Headers)
(Configuration Commands, Configuration Links):
Also document here that the file names should not contain
shell metacharacters, to make this constraint more obvious.
2020-08-01 11:47:42 -07:00
Paul Eggert
e9bfc7c758 * doc/autoconf.texi: Tweak wording. 2020-07-31 14:22:28 -07:00
Bruno Haible
ca67a088dc doc: Update some more macro descriptions.
* doc/autoconf.texi (Particular Functions): Add a remark about AC_FUNC_MMAP.
Clarify AC_FUNC_STRCOLL.
2020-07-31 14:22:28 -07:00
Bruno Haible
091805f6ac doc: Refer to Gnulib where it makes sense.
* doc/autoconf.texi (Particular Functions): Point to Gnulib wherever Gnulib has
more workarounds than mentioned for the particular macro, namely for
AC_FUNC_CHOWN, AC_FUNC_FSEEKO, AC_FUNC_GETGROUPS, AC_FUNC_GETMNTENT,
AC_FUNC_MBRTOWC, AC_FUNC_STRERROR_R, AC_FUNC_STRTOLD.
2020-07-31 14:22:28 -07:00
Bruno Haible
61f97e6070 doc: Refer to Gnulib instead of asking clients to provide replacement code.
* doc/autoconf.texi (Particular Functions): Point to Gnulib for all macros that
may call AC_LIBOBJ, namely AC_FUNC_ALLOCA, AC_FUNC_MALLOC, AC_FUNC_OBSTACK,
AC_FUNC_REALLOC, AC_FUNC_STRNLEN.
2020-07-31 14:22:28 -07:00
Paul Eggert
15edf7fd80 Remove obsolete Cray support
Gnulib removed this recently, and we should be consistent.
* doc/autoconf.texi (Autoheader Macros):
Use a more up-to-date example.
* lib/autoconf/functions.m4 (CRAY_STACKSEG_END): Remove.
This is backported from the following Gnulib patch:
https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=41a2d446c7984f8f39e3eeca40c6d30630969c10
2020-07-30 18:51:59 -07:00
Zack Weinberg
df7e1cdbdf
Simplify Makefiles embedded in autotest.at
This is a follow-up for the various patches to address problems with
tests 221 and 222 with various non-GNU make implementations.  We’re
not trying to exercise Make at all in these tests; it’s just a
convenient way to invoke the compiler found by AC_PROG_CC on a test
program.  The tests will be more reliable if we minimize the number of
Make features we are using.  So: no implicit rules at all, and no
intermediates.  Generate ‘testprog’ directly from ‘testprog.c’.

Also copy from fortran.at a more thorough set of substitution
variables for the compilation command, mainly for consistency,
and don’t use Makefile variables, again for consistency with
fortran.at.

(This is also, theoretically, faster since we’re only invoking the
compiler driver once, but it’s probably not enough of a difference to
measure.)
2020-07-27 13:27:47 -04:00
Paul Eggert
ae26b9b44c Port AC_F77_LIBRARY_LDFLAGS to oneAPI HPC Toolkit
Problem reported by Bill Dieter in:
https://lists.gnu.org/r/bug-autoconf/2020-07/msg00089.html
* lib/autoconf/fortran.m4 (_AC_FC_LIBRARY_LDFLAGS):
Defend against ‘clang -mllvm -loopopt=0’.
2020-07-22 14:09:16 -07:00
Paul Eggert
96f0001bcd Don’t assume plain ‘make’ in C unit tests
Problem reported by Bruno Haible in:
https://savannah.gnu.org/support/?110273#comment6
* lib/autoconf/general.m4 (_AC_ARG_VAR_VALIDATE):
* tests/autotest.at (C unit tests, C unit tests (EXEEXT)):
Prefer ‘${MAKE-make}’ to ‘make’ in shell code.
2020-07-20 15:13:34 -07:00
Paul Eggert
14d58bfd58 Prefer ‘$(MAKE)’ to ‘make’ in Makefiles
* GNUmakefile (abort-due-to-no-makefile):
* Makefile.am (check-coverage-report):
Prefer ‘$(MAKE)’ to ‘make’ in diagnostics.
2020-07-20 15:13:34 -07:00
Paul Eggert
d7bd610b4c Port build procedure to AIX 7.1
* lib/freeze.mk (MY_AUTOM4TE, build_libdir, m4f_dependencies):
Prefer ‘$(top_build_prefix)’ to ‘$(top_builddir)/’.
The difference matters on AIX 7.1, where ‘make’ doesn’t know that
bin/autom4te and ./bin/autom4te are the same file,
and gets confused about dependencies without this change.
‘$(top_build_prefix)bin/autom4te’ expands to ‘bin/automake’
whereas ‘$(top_builddir)/bin/autom4te’ expands to
‘./bin/automake’, and the former works where the latter doesn’t.
2020-07-17 18:43:38 -07:00
Paul Eggert
0c39ab024f Test AC_FC_LINE_LENGTH only to 250 columns
* NEWS, doc/autoconf.texi, lib/autoconf/fortran.m4:
Document 250, not 254.
* tests/fortran.at (AC_FC_LINE_LENGTH): Test lines with 250
columns not 253, since Oracle Studio 12.6 Fortran 95 8.8
2017/05/30 goes up only to 250.
2020-07-17 15:07:31 -07:00
Paul Eggert
c03ca42de3 Fix ${VAR-NONWORD} bugs
* lib/autoconf/functions.m4 (AC_FUNC_SELECT_ARGTYPES):
* lib/autoconf/programs.m4 (AC_FUNC_SELECT_ARGTYPES):
* lib/autotest/general.m4 (AT_INIT):
Rewrite to avoid ${VAR-VALUE} where VALUE is not a shell word.
2020-07-16 23:08:10 -07:00
Paul Eggert
2ff883c27e Document that VAL must be a word in ${VAR-VALUE}
* doc/autoconf.texi (Shell Substitutions):
Document that in ${VAR-VALUE}, VALUE must be a shell word,
and omit examples implying otherwise.
2020-07-16 17:30:54 -07:00
Zack Weinberg
7c08375081
tests/autotest.at: don’t use suffix rules to generate executables
In two tests, when @EXEEXT@ is empty, we were generating Makefiles
containing suffix rules with only one explicit suffix, e.g.

    .o:
        $(CC) -o $@ $^

Solaris 10’s ‘dmake’ does not understand this as a rule to create
‘foo’ from ‘foo.o’.  That’s not the point of the tests, so use
ordinary per-rule commands to link the executables in these tests
instead.

Partially addresses #110267.
2020-07-16 17:31:07 -04:00
Zack Weinberg
71b5037ac6
tests/local.at: improve sed portability
Solaris 10 /bin/sed does not support * after \( … \), only after
subexpressions that match a _single character_.

Partially addresses #110267. Problem reported by Dagobert Michelsen.

* tests/local.at (AT_CHECK_M4): Do not use star after parenthesized
  subexpression in sed s/// commands.
2020-07-16 16:43:48 -04:00
Zack Weinberg
f7693b83f2
Revise documentation for AC_PROG_LEX.
- Better explanation of the additional tests performed by this macro,
   once the tool has been located.

 - Update advice re using Flex to generate a bundled lex.yy.c.

 - Remove text describing a bug in Automake that has long since been
   corrected.
2020-07-16 14:48:09 -04:00
Paul Eggert
29ede6b96f AC_PROG_LEX no longer sets LEXLIB for yywrap
Suggested by Zack Weinberg in:
https://lists.gnu.org/r/autoconf-patches/2020-07/msg00016.html
* lib/autoconf/programs.m4 (_AC_PROG_LEX_YYTEXT_DECL):
Define yywrap too.
2020-07-16 10:48:09 -07:00
Paul Eggert
eb4a1d7faf Fix AC_PROG_LEX regression
Problem reported by Ross Burton in:
https://savannah.gnu.org/support/?110269
* lib/autoconf/programs.m4 (_AC_PROG_LEX_YYTEXT_DECL):
If tests indicate that LEX or LEXLIB does not work, set LEX to ":"
and LEXLIB empty, instead of failing out of 'configure' entirely.
2020-07-16 09:49:14 -07:00
Paul Eggert
6677262915 Document AC_EGREP* better
From a suggestion by Bruno Haible in:
https://lists.gnu.org/archive/html/bug-autoconf/2017-02/msg00001.html
2020-07-15 16:27:58 -07:00
Bruno Haible
fc1fe98541 doc: More clarifications regarding --host and --build.
* doc/autoconf.texi (Specifying Target Triplets): Describe the effects
of --host in more detail. Don't recommend to specify --build when
specifying --host. Add another example regarding MinGW.
2020-07-15 13:45:43 -07:00
Paul Eggert
d45c2e2f5b Revert mistaken patch for Bison
Problem reported by Bruno Haible in:
https://savannah.gnu.org/support/?110266
* lib/autoconf/programs.m4 (AC_PROG_YACC):
Go back to using bison -y instead of bison -o y.tab.c.
2020-07-15 13:30:56 -07:00
Paul Eggert
e70c99a92f Use more-modern cross-compilation examples
* doc/autoconf.texi (Generic Programs)
(Specifying Target Triplets, Transformation Examples)
(Hosts and Cross-Compilation): Use more-modern examples.
2020-07-15 11:51:07 -07:00
Paul Eggert
6997ed9cee Revert mistaken patch for Wine
* lib/autoconf/lang.m4 (_AC_COMPILER_EXEEXT_CROSS):
Revert patch trying to cater to GNU/Linux builds
for Wine.  They should use --build as well as --host.
Problem reported by Bruno Haible in:
https://savannah.gnu.org/support/?110268
2020-07-15 11:51:07 -07:00