Make MAINTAINER_MODE regeneration logic consistent with bootstrap.sh#2522
Merged
albinahlback merged 1 commit intoflintlib:mainfrom Dec 22, 2025
Merged
Make MAINTAINER_MODE regeneration logic consistent with bootstrap.sh#2522albinahlback merged 1 commit intoflintlib:mainfrom
albinahlback merged 1 commit intoflintlib:mainfrom
Conversation
The documented way to generate `./configure` is running `./bootstrap` (which in turn runs `autoreconf -i`). However, when Makefile detects that `./configure` is stale relative to `configure.ac`, it regenerates it using this snippet: https://github.com/flintlib/flint/blob/2498f7f588ebcbfbf0617307f23a117968525495/Makefile.in#L989-L998 This uses plain `autoconf`, which is incorrect. `autoconf` relies on presence of `aclocal.m4`, which is created by `aclocal` as part of `autoreconf -i` chain. If this file is not present, `autoconf` fails with cryptic error messages (see below). Granted, this scenario is uncommon. Typically if you have a Makefile, you've already run bootstrap.sh and ./configure, so aclocal.m4 exists. However, it can happen in exotic situations, such as modifying configure.ac when building from a release tarball. To reproduce: ``` curl -L https://github.com/flintlib/flint/releases/download/v3.4.0/flint-3.4.0.tar.gz | tar -xzf - cd flint-3.4.0/ touch configure.ac ./configure make ``` `make` fails with a confusing error message: ``` Running autoconf configure.ac:163: error: possibly undefined macro: AC_MSG_ERROR If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. configure.ac:933: error: possibly undefined macro: AC_SUBST configure.ac:987: error: possibly undefined macro: AC_DEFINE make: *** [Makefile:993: /home/username/flint-3.4.0/configure] Error 1 ``` ----- This change fixes this inconsistency: now bootstrap.sh will be used for regenerating too.
Collaborator
|
@albinahlback does this look good? |
Collaborator
|
Yes! |
Collaborator
|
Thanks @Vlad-Shcherbina! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The documented way to generate
./configureis running./bootstrap(which in turn runs
autoreconf -i).However, when Makefile detects that
./configureis stale relativeto
configure.ac, it regenerates it using this snippet:flint/Makefile.in
Lines 989 to 998 in 2498f7f
This uses plain
autoconf, which is incorrect.autoconfrelies on presence ofaclocal.m4, which is createdby
aclocalas part ofautoreconf -ichain.If this file is not present,
autoconffails with cryptic errormessages (see below).
Granted, this scenario is uncommon. Typically if you have a Makefile,
you've already run bootstrap.sh and ./configure, so aclocal.m4
exists. However, it can happen in exotic situations, such as
modifying configure.ac when building from a release tarball.
To reproduce:
makefails with a confusing error message:This change fixes this inconsistency: now bootstrap.sh will be used for
regenerating too.