public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: YiFei Zhu <zhuyifei@google.com>
To: gentoo-dev@lists.gentoo.org
Cc: YiFei Zhu <zhuyifei1999@gmail.com>
Subject: [gentoo-dev] [PATCH] autotools.eclass: Run eautoheader with --force
Date: Fri, 13 Sep 2024 07:32:58 +0000	[thread overview]
Message-ID: <20240913073258.588680-1-zhuyifei@google.com> (raw)

From: YiFei Zhu <zhuyifei1999@gmail.com>

To quote Eli [1] (I can't explain it better than this):

  autotools.eclass runs autoheader without options (and in
  particular without --force). This will only remake config.h.in
  if there are actual changes to the content, which in turn means
  that it will be out of date compared to aclocal.m4 (which we very
  much expect to have changes).

  So `make` sees that the header is out of date, and runs autoheader
  yet again, this time updating the timestamp for `make` purposes.

This causes QA warning that "maintainer mode" is detected.

autoheader and autoconf added --force option at the same time [2],
so no reason only autoconf has that option in the eclass and not
autoheader.

Like, autoconf, a check on WANT_AUTOCONF != 2.1 is added because the
feature was added in autoconf 2.52.

[1] https://bugs.gentoo.org/939468#c6
[2] https://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=dbf7fc61

Closes: https://bugs.gentoo.org/939468
Closes: https://bugs.gentoo.org/939535
Signed-off-by: YiFei Zhu <zhuyifei1999@gmail.com>
---
 eclass/autotools.eclass | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/eclass/autotools.eclass b/eclass/autotools.eclass
index 0571b18ba525..641612f37193 100644
--- a/eclass/autotools.eclass
+++ b/eclass/autotools.eclass
@@ -312,7 +312,13 @@ eautoreconf() {
 	else
 		eautoconf --force
 	fi
-	[[ ${AT_NOEAUTOHEADER} != "yes" ]] && eautoheader
+	if [[ ${AT_NOEAUTOHEADER} != "yes" ]] ; then
+		if [[ ${WANT_AUTOCONF} == "2.1" ]] ; then
+			eautoheader
+		else
+			eautoheader --force
+		fi
+	fi
 	[[ ${AT_NOEAUTOMAKE} != "yes" ]] && FROM_EAUTORECONF="yes" eautomake ${AM_OPTS}
 
 	if [[ ${AT_NOELIBTOOLIZE} != "yes" ]] ; then
-- 
2.46.0.662.g92d0881bb0-goog



                 reply	other threads:[~2024-09-13  7:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240913073258.588680-1-zhuyifei@google.com \
    --to=zhuyifei@google.com \
    --cc=gentoo-dev@lists.gentoo.org \
    --cc=zhuyifei1999@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox