summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Warn if AC_INIT or AC_OUTPUT are missing from configure.ac (#107986)zack/bug-107986Zack Weinberg2020-08-1415-34/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Trim whitespace from arguments of AC_INIT (#107986)Zack Weinberg2020-08-064-31/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* AT_CHECK_MACRO: Preserve config.log and config.status from run 1.Zack Weinberg2020-08-051-0/+2
| | | | | | | | | | | 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.
* Only probe C++ language features, not library, for speed (#110285)Zack Weinberg2020-08-042-195/+167
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Filter out _AST_FEATURES when comparing environment state. (#110283)Zack Weinberg2020-08-041-7/+16
| | | | | | | | | | | | 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.
* Partially revert e54e3f90: restore use of $(MAKE) in error message.Zack Weinberg2020-08-041-1/+1
| | | | | | | 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.
* Expect OpenIndiana test failurePaul Eggert2020-08-021-0/+7
| | | | | | 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.
* Work around ksh93 bug that broke config.statusPaul Eggert2020-08-021-2/+2
| | | | | | | | | * 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.
* Fix regression: autotools and whitespace in file namesPaul Eggert2020-08-011-5/+1
| | | | | | * 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.
* make fetchPaul Eggert2020-08-012-3/+4
|
* Fix regression that broke Automake ‘make check’Paul Eggert2020-08-012-9/+30
| | | | | | | | | | | | | | | | | 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.
* * doc/autoconf.texi: Tweak wording.Paul Eggert2020-07-311-20/+20
|
* doc: Update some more macro descriptions.Bruno Haible2020-07-311-1/+6
| | | | | * doc/autoconf.texi (Particular Functions): Add a remark about AC_FUNC_MMAP. Clarify AC_FUNC_STRCOLL.
* doc: Refer to Gnulib where it makes sense.Bruno Haible2020-07-311-2/+29
| | | | | | | * 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.
* doc: Refer to Gnulib instead of asking clients to provide replacement code.Bruno Haible2020-07-311-0/+16
| | | | | | * 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.
* Remove obsolete Cray supportPaul Eggert2020-07-302-29/+5
| | | | | | | | | 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
* Simplify Makefiles embedded in autotest.atZack Weinberg2020-07-271-22/+4
| | | | | | | | | | | | | | | | | | | 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.)
* Port AC_F77_LIBRARY_LDFLAGS to oneAPI HPC ToolkitPaul Eggert2020-07-221-0/+1
| | | | | | | 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’.
* Don’t assume plain ‘make’ in C unit testsPaul Eggert2020-07-202-3/+4
| | | | | | | | 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.
* Prefer ‘$(MAKE)’ to ‘make’ in MakefilesPaul Eggert2020-07-202-2/+2
| | | | | | * GNUmakefile (abort-due-to-no-makefile): * Makefile.am (check-coverage-report): Prefer ‘$(MAKE)’ to ‘make’ in diagnostics.
* Port build procedure to AIX 7.1Paul Eggert2020-07-171-4/+4
| | | | | | | | | | | * 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.
* Test AC_FC_LINE_LENGTH only to 250 columnsPaul Eggert2020-07-174-7/+15
| | | | | | | | * 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.
* Fix ${VAR-NONWORD} bugsPaul Eggert2020-07-163-10/+14
| | | | | | | * 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.
* Document that VAL must be a word in ${VAR-VALUE}Paul Eggert2020-07-161-19/+30
| | | | | | * doc/autoconf.texi (Shell Substitutions): Document that in ${VAR-VALUE}, VALUE must be a shell word, and omit examples implying otherwise.
* tests/autotest.at: don’t use suffix rules to generate executablesZack Weinberg2020-07-161-6/+6
| | | | | | | | | | | | | | | 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.
* tests/local.at: improve sed portabilityZack Weinberg2020-07-161-1/+2
| | | | | | | | | | 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.
* Revise documentation for AC_PROG_LEX.Zack Weinberg2020-07-163-38/+46
| | | | | | | | | | - 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.
* AC_PROG_LEX no longer sets LEXLIB for yywrapPaul Eggert2020-07-163-4/+18
| | | | | | | 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.
* Fix AC_PROG_LEX regressionPaul Eggert2020-07-161-4/+9
| | | | | | | | 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.
* Document AC_EGREP* betterPaul Eggert2020-07-151-0/+30
| | | | | From a suggestion by Bruno Haible in: https://lists.gnu.org/archive/html/bug-autoconf/2017-02/msg00001.html
* doc: More clarifications regarding --host and --build.Bruno Haible2020-07-151-8/+23
| | | | | | * 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.
* Revert mistaken patch for BisonPaul Eggert2020-07-153-7/+3
| | | | | | | 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.
* Use more-modern cross-compilation examplesPaul Eggert2020-07-151-12/+13
| | | | | | * doc/autoconf.texi (Generic Programs) (Specifying Target Triplets, Transformation Examples) (Hosts and Cross-Compilation): Use more-modern examples.
* Revert mistaken patch for WinePaul Eggert2020-07-151-11/+1
| | | | | | | | * 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
* NEWS: don’t describe Automake 1.13 as “upcoming.”Nick Alcock2020-07-141-2/+2
| | | | | Automake 1.13 was released eight years ago. The current version is 1.16.2.
* * doc/autoconf.texi: Fix mishandling of `.v2.69bPaul Eggert2020-07-132-4/+6
|
* make fetchPaul Eggert2020-07-132-6/+35
|
* Formally obsolete AC_CONFIG_HEADER (#105403)Zack Weinberg2020-07-125-13/+15
| | | | | | | | | | | | | | | This macro was replaced by AC_CONFIG_HEADERS many years ago (before the beginning of the VCS history) and isn’t even documented, but we never got around to making autoupdate notice it. Problem reported *in 2006* by jensseidel@users.sf.net. There was one use of AC_CONFIG_HEADER in our source tree, which is converted. Also, to avoid confusing people reading old NEWS or TODO entries, all mentions of AC_CONFIG_HEADER therein are also replaced with AC_CONFIG_HEADERS. * lib/autoconf/status.m4 (AC_CONFIG_HEADER): Make an AU_ALIAS for AC_CONFIG_HEADERS.
* Add AC_PROG_EGREP to AU_DEFUN for AC_HEADER_STDC (#110215)Zack Weinberg2020-07-122-5/+15
| | | | | | | | | | AC_HEADER_STDC used to use AC_EGREP_CPP, and therefore had the side effect of AC_REQUIRE([AC_PROG_EGREP]). In 2.70 AC_HEADER_STDC is an AU_DEFUN and, before this change, the replacement didn’t invoke AC_PROG_EGREP, which broke configure scripts that assumed $EGREP would be set. Problem reported by Ross Burton. * lib/autoconf/headers.m4 (AU::AC_HEADER_STDC): Also invoke AC_PROG_EGREP.
* Fix logic error in _AC_PROG_LEX_YYTEXT_DECL (#109320)Tom2020-07-121-8/+13
| | | | | | | | | | | | | The search for the appropriate value for @LEXLIB@ did not distinguish correctly between success (‘break’ out of a shell for loop, having set $ac_cv_lib_lex) and failure (normal termination of the loop, value in $ac_cv_lib_lex is garbage). Bug report and original patch by Tom <tom@ojodeagua.com> with refinements by Zack Weinberg. * lib/autoconf/programs.m4 (_AC_PROG_LEX_YYTEXT_DECL): Error out if we cannot find the library that (f)lex scanners need to be linked against, instead of continuing with @LEXLIB@ set to the empty string.
* make fetchZack Weinberg2020-07-112-4/+7
| | | | URLs in gnu-oids.texi are now consistent with standards.texi.
* Update hyperlinks in the manual and README-hacking.Zack Weinberg2020-07-102-12/+14
| | | | | | | | Lots of http:// -> https:// conversions; refer to XZ Utils instead of the obsolete LZMA Utils; remove dead link to dbaspot.com; replace mention of -fmudflap with -fsanitize= and add a proper cross-reference to the GCC manual for that.
* Update links in COPYING, COPYINGv3, and COPYING.EXCEPTION.Zack Weinberg2020-07-103-14/+13
| | | | | | | | | | | | | | | | | | - COPYINGv3 now exactly matches https://www.gnu.org/licenses/gpl-3.0.txt as of 2020-07-10. The only change was to turn a bunch of http:// URLs into https:// URLs. - COPYING now exactly matches https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt as of 2020-07-10 except that the FSF’s old postal address has been deleted and <https://fsf.org/> inserted (consistent with COPYINGv3). Besides the above, the only change was to whitespace. - A typo in a URL in COPYING.EXCEPTION was corrected.
* Document AS_IF(..., ..., [[]]) glitchPaul Eggert2020-07-101-0/+7
| | | | | | * doc/autoconf.texi (Common Shell Constructs): Note the if-false arg problem reported by Jannick in: https://lists.gnu.org/r/autoconf/2020-03/msg00045.html
* Fix ac_compiler_gnu bugPaul Eggert2020-07-101-1/+3
| | | | | | | | Problem and fix reported by Jannick in: https://lists.gnu.org/r/autoconf/2020-03/msg00045.html except that I omitted the comment, which I thought unnecessary. * lib/autoconf/lang.m4 (_AC_LANG_COMPILER_GNU): Set ac_compiler_gnu regardless of whether result was from cache.
* NEWS: add notes about known breakage due to pickier macros.Zack Weinberg2020-07-101-0/+21
| | | | | | These are all cases where the offending configure script or third-party macro was always incorrect, but autoconf 2.69 let you get away with it.
* NEWS: mention that AS_INIT no longer embeds full paths to source files.Zack Weinberg2020-07-091-12/+21
| | | | | | (Change made in c6daae41276a49b52a9d5e2f70c95651364ed619.) Also reorder some of the NEWS entries more logically.
* AS_INIT: basename __file__Luke Mewburn2020-07-052-1/+22
| | | | | | Fix AS_INIT to encode the basename of __file__ instead of the full path to the source directory. Allows for reproducible builds.
* Fix AC_CHECK_LIB quoting bugPaul Eggert2020-07-022-1/+5
| | | | | | | Problem reported by Bert Wesarg in: https://lists.gnu.org/archive/html/autoconf/2016-04/msg00020.html * lib/autoconf/libs.m4 (AC_CHECK_LIB): Fix quoting bug. * tests/semantics.at (AC_CHECK_LIB): Add a test for the bug.
* * tests/local.at: Fix space-tab problems.Paul Eggert2020-06-291-1/+1
|