The bootstrap script generates the same files ‘autoreconf -vi’ would,
in a normal package, but it uses autoconf *from the git sources* to do
it. This means people building from git do not need autoconf to be
installed already. More importantly, it eliminates the extra steps
when building from git, of re-generating autoconf’s own configure
script with the just-built autoconf, then rebuilding the entire tree.
(This process still requires Automake to be installed already, and
Automake’s bootstrap script requires Autoconf to be installed already,
so there is still a dependency loop between Autoconf and Automake when
building from git—you need at least one of them installed from a
tarball to get started.)
The bootstrap script works by creating a partial installation tree in
a temporary directory, containing bin/autoconf, bin/autom4te, and just
enough of the usual contents of $(pkgdatadir) for autoconf and
autom4te to work. It then runs a hardcoded list of commands,
corresponding to what ‘autoreconf -i -Wall,error’ would run, but
setting environment variables AUTOCONF and AUTOM4TE to ensure the
bootstrap versions of these tools are used. (We have to create both,
because automake runs autoconf, not autom4te, to trace configure.ac.)
The ‘Autom4te’, ‘autoconf’, and ‘m4sugar’ subdirectories of the
partial installation tree are symlinked back to the source tree; this
is why version.m4 needed to be moved out of the m4sugar subdirectory,
so the bootstrap script can create it without scribbling on the source
tree. autom4te is run in --melt mode, so we don’t need to create
freeze files in any subdirectories either. All of the substitution
variables that are needed for autoconf and autom4te to both run, and
create the same output that they would have if fully configured, are
honored (unfortunately this does involve digging around in
configure.ac with sed expressions).
This simplifies the Makefile a bit and also paves the way for a
bootstrap script (replacing the process of re-running autoreconf with
the just-built autoconf) which will be able to cope with generated
files that get installed in @pkgdatadir@ but not in @pkgdatadir@/m4sugar.
* lib/version.in: New file, contents extracted from lib/local.mk.
* lib/local.mk: Do not generate version.m4 here.
* configure.ac: Generate lib/version.m4 from lib/version.in via
config.status.
* lib/freeze.mk, lib/local.mk, lib/m4sugar/m4sugar.m4:
version.m4 now lives in @pkgdatadir@ rather than @pkgdatadir@/m4sugar.
Autoconf’s diagnostics now follow current GNU coding standards,
which say that diagnostics in the C locale should quote 'like this'
with plain apostrophes instead of the older GNU style `like this'
with grave accent and apostrophe.
NetBSD’s /bin/sh sets a special variable “NETBSD_SHELL” to identify
itself. This means we can whitelist it as not having a buggy -n
implementation.
* configure.ac: Assume -n mode works in shells that have a preset
variable named NETBSD_SHELL.
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.
The test suite was insisting on using /bin/sh -n for syntax checking,
which meant that if /bin/sh wasn’t one of the short list of shells
whose -n is known to work, we would skip all of the syntax-check
tests, even if some other shell was available that would work.
Instead do like _AS_DETECT_BETTER_SHELL, and loop over possible
shells, starting with $SHELL and going on to a hardwired list of
known-good possibilities. The result is written to the substitution
variable @SHELL_N@ and the testsuite uses that.
(Should we invoke AC_PATH_PROG on the result of the search if it’s not
already absolute?)
* configure.ac: Search for a shell whose -n mode is known to
work, instead of just checking /bin/sh. Set @SHELL_N@ to
what we find.
* tests/atlocal.in: Propagate @SHELL_N@ to testsuite.
* tests/local.at (AT_CHECK_SHELL_SYNTAX): Use $SHELL_N instead
of hardcoding /bin/sh. Update test for usable shell -n.
(AT_CHECK_AUTOCONF): Update test for usable shell -n.
* tests/tools.at: Update test for usable shell -n.
Based on an idea by Bernhard Reutner-Fischer.
We frequently used the idiom of 'test "${var+set}" = set' to
test if $var was set to a non-empty string, but this can portably
be trimmed to a more compact 'test ${var+y}' for a smaller
configure file. Testing that a variable is not set can be done
with '${var+false} :' (although the value of $? is not reliably
1 when the variable is set).
The code for AS_VAR_TEST_SET already used the form '${var+:} false',
but it is slightly longer, and does not guarantee $? of 1.
Tested on coreutils, where the resulting configure file is about
1k smaller.
* doc/autoconf.texi (Shell Substitutions): Prefer shorter sequence
for testing if a variable is set.
(Limitations of Builtins) <test (strings)>: Document it.
* configure.ac: Use it.
* lib/autoconf/c.m4 (_AC_PROG_CC_G, _AC_PROG_CXX_G)
(_AC_PROG_OBJC_G, _AC_PROG_OBJCXX_G): Likewise.
* lib/autoconf/fortran.m4 (_AC_PROG_FC_G): Likewise.
* lib/autoconf/general.m4 (_AC_ENABLE_IF_ACTION, AC_CACHE_SAVE):
Likewise.
* lib/autoconf/lang.m4 (_AC_COMPILER_EXEEXT_DEFAULT): Likewise.
* lib/autoconf/programs.m4 (AC_PROG_INSTALL, AC_PROG_MKDIR_P)
(_AC_PROG_LEX_YYTEXT_DECL): Likewise.
* lib/autoconf/status.m4 (_AC_OUTPUT_MAIN_LOOP): Likewise.
* lib/autotest/general.m4 (AT_INIT): Likewise.
* tests/base.at (AC_CACHE_CHECK): Likewise.
* tests/m4sh.at (LINENO): Likewise.
* lib/m4sugar/m4sh.m4 (_AS_BOURNE_COMPATIBLE)
(_AS_DETECT_BETTER_SHELL, _AS_SHELL_SANITIZE)
(_AS_PATH_SEPARATOR_PREPARE): Likewise.
(AS_VAR_TEST_SET): Use shorter sequence.
Signed-off-by: Eric Blake <eblake@redhat.com>
Done via 'make update-copyright', since all files are effectively
modified and distributed this year via public version control.
* all files: Update copyright year.
* Makefile.am (SUBDIRS): Remove (its last component 'man' has just
been removed).
(SUFFIXES): New, defined to empty, to be updated later by included
files.
($(srcdir)/man/local.mk): Include this.
* configure.ac (AC_CONFIG_FILES): Drop 'man/Makefile'.
* lib/freeze.mk (SUFFIXES): Extend with '+=' rather than defining
with '='.
* man/Makefile.am: Rename ...
* man/local.mk: ... like this, and adjust throughout.
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
* Makefile.am (SUBDIRS): Drop 'tests'. Adjust comments.
(DISTCLEANFILES, MAINTAINERCLEANFILES): Define to empty, to be
updated later.
(MAINTAINERCLEANFILES): Adjust later definition to use '+='
rather than '='.
($(srcdir)/tests/local.mk): Include this.
* configure.ac (AC_CONFIG_FILES): Drop 'tests/Makefile'.
* lib/freeze.mk ($(AUTOM4TE_CFG)): Drop now-redundant remake rule.
($(build_libdir)/m4sugar/version.m4): Likewise.
* tests/Makefile.am: Rename ...
* tests/local.mk: ... like this, and adjust (quite heavily).
* tests/mktests.sh: Adjust to generate output files and temporary
files in the tests subdirectory rather than in the current
directory.
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
* Makefile.am (SUBDIRS): Drop 'lib'.
(edit): New, shared among the recipes in 'lib/local.mk' and
'bin/local.mk'.
(CLEANFILES): New, will be updated later in included files.
($(srcdir)/lib/local.mk): Include it.
($(srcdir)/lib/freeze.mk): Likewise.
* lib/Makefile.am: Rename ...
* lib/local.mk: .. like this, with several adjustments. In
particular ...
(edit): Drop this definition, subsumed by the one in the
top-level Makefile.am.
* bin/local.mk (edit): Drop definition, that is already present
in the top-level Makefile.am now.
($(srcdir)/lib/freeze.mk): Drop inclusion; that is already done
in the top-level Makefile.am now.
* doc/local.mk (CLEANFILES): Adjust: append to it, do not define
it.
* lib/freeze.mk ($(AUTOM4TE_CFG)): Adjust recipe.
* configure.ac (AC_CONFIG_FILES): Drop 'lib/Makefile'.
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Rather than reading it dynamically from the ChangeLog -- that,
remember, is only a dummy in a Git checkout! To avoid risking
the definition to get out-of-sync, let's enhance the maintainer
target 'update-copyright' to update it automatically (the same
way it's done in the Automake build system).
* configure.ac (RELEASE_YEAR): New AC_SUBST'd variable.
* cfg.mk (update-release-year): New maintainer-specific target
to automatically update the value of that variable.
(update-copyright): Depend on the new target.
* bin/local.mk (RELEASE_YEAR): Drop definition.
(edit): Simplify quoting of $(RELEASE_YEAR).
* lib/Makefile.am (RELEASE_YEAR): Drop definition.
(m4sugar/version.m4): Simplify quoting of $(RELEASE_YEAR).
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
* lib/m4sugar/Makefile.am: Delete, its contents merged ...
* lib/Makefile.am: ... in here, with proper adjustments.
(SUBDIRS): Drop 'lib/m4sugar'.
Other related adjustments and re-organizations.
* configure.ac (AC_CONFIG_FILES): Drop 'lib/m4sugar/Makefile'.
* lib/freeze.mk ($(build_libdir)/m4sugar/version.m4): Adjust
recipe.
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
* lib/autotest/Makefile.am: Delete, its contents merged ...
* lib/Makefile.am: ... in here, with proper adjustments.
(SUBDIRS): Drop 'autotest'.
Other minor related modifications.
* configure.ac (AC_CONFIG_FILES): Drop 'lib/autotest/Makefile'.
* lib/freeze.mk (MY_AUTOM4TE): Small required adjustments.
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
* Makefile.am (MOSTLYCLEANFILES): New, to be extended later by
included files.
($(srcdir)/doc/local.mk): New include.
(SUBDIRS): Drop 'bin'. Adjust comments.
* bin/Makefile.am: Rename ...
* bin/local.mk: ... like this, and adjust.
* configure.ac (AC_CONFIG_FILES): Drop 'bin/Makefile'.
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
* .gitignore: Adjust.
* Makefile.am ($(srcdir)/doc/local.mk): New include.
(SUBDIRS): Drop 'doc'.
(AM_MAKEINFOFLAGS): Rename ...
(custom_MAKEINFOFLAGS): ... like this, to avoid conflicting with
the AM_MAKEINFOFLAGS defined in the included 'doc/local.mk'
($(srcdir)/INSTALL): Adjust recipe.
* doc/Makefile.am: Rename ...
* doc/local.mk: ... like this, and adjust.
* configure.ac (AC_CONFIG_FILES): Drop 'doc/Makefile'.
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Done via 'make update-copyright', since all files are effectively
modified and distributed this year via public version control.
* all files: Update copyright year.
* configure.ac: The Automake NEWS entry for version 1.11 states that
For AC_CONFIG_LINKS, if source and destination are equal, do
not remove the file in a non-VPATH build. Such setups work
with Autoconf 2.62 or newer.
Since our build system requires autoconf >= 2.62 and automake >= 1.11
already, we can get rid of the workaround for that long-fixed bug.
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
* configure.ac: Require 2.62, and remove obsolescent comments.
We are not imposing an new restriction in doing so, since we already
require Automake 1.11 or later, and that requires Autoconf 2.62.
Simplify code for symlinking of GNUmakefile in VPATH builds, in
accordance with the existing "TODO" comments.
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
At 2.68b, I asked whether anyone would miss .gz and .bz2 formats.
Consensus was overwhelming that .gz still holds a place in people's
hearts, in spite of .xz compressing to smaller files, but no one
was able to make a convincing argument for .bz2.
* configure.ac (AM_INIT_AUTOMAKE): Drop bzip2; xz wins hands down.
Signed-off-by: Eric Blake <eblake@redhat.com>
This reduces the implicit requirement from 5.6.2 back to 5.6,
while raising the explicit requirement to match the actual code.
* configure.ac (PERL): Fail up front if perl is too old.
* NEWS: Document this.
* README: Likewise.
* README-hacking: Likewise.
* lib/Autom4te/ChannelDefs.pm: Bump requirement.
* lib/Autom4te/General.pm: Relax requirement.
Following the practice set by various other GNU projects, we start
to automatically generate the ChangeLog file from the git commit
messages. This will avoid duplication (as the ChangeLog entries
were always inserted both in the git commit message and in the
version-controlled ChangeLog file), and potential problems with
spurious merge conflicts (which, although greatly mitigated by
Bruno Haible's `git-merge-changelog' helper program, have never
been completely solved).
* ChangeLog: Moved ...
* ChangeLog.3: ... to this.
* build-aux/gitlog-to-changelog: New script, synced from gnulib.
* cfg.mk (gnulib-update): Also sync gitlog-to-changelog.
* Makefile.am (gen-ChangeLog): New .PHONY rule, generate the
ChangeLog for distribution.
(dist-hook): Depend on it.
($(srcdir)/ChangeLog): New dummy rule, to pacify automake "gnu"
strictness. Creates a dummy ChangeLog, that will be overridden
by the proper one at distribution time.
(gen_start_date): New variable, the date starting from which the
git log entries are to be copied in the generated ChangeLog.
(EXTRA_DIST): Add ChangeLog.3 and gitlog-to-changelog.
* configure.ac (AC_CONFIG_SRCDIR): Use 'lib/autoconf/autoconf.m4'
instead of 'ChangeLog' as the sentinel file.
* .gitignore: Add ChangeLog.
* configure.ac (PERL_FLOCK): New substitution variable with test
whether Fcntl::flock is implemented by the system.
* bin/Makefile.am (edit): Substitute @PERL_FLOCK@.
* bin/autom4te.in: Call XFile::lock only if flock is
implemented.
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
This test makes atlocal code use configure tests instead. This
is best practice and could make diagnosing autoconf bugs easier.
2009-07-12 Paolo Bonzini <bonzini@gnu.org>
* configure.ac: Test for unsupported characters in files and
directories here...
* tests/atlocal.in: ... and not here.
This test makes atlocal code use configure tests instead. This
is best practice and could make diagnosing autoconf bugs easier.
2009-07-12 Paolo Bonzini <bonzini@gnu.org>
* configure.ac: Test for unsupported characters in files and
directories here...
* tests/atlocal.in: ... and not here.
* configure.ac: Reflect fact that change to git-version-gen
produces -, but not always a letter, on non-release builds.
* BUGS: Mention known issues.
* lib/m4sugar/m4sh.m4 (_AS_DETECT_BETTER_SHELL): Ask for help in
debugging platforms with deficient shells.
Signed-off-by: Eric Blake <ebb9@byu.net>