Re: fix: autoreconf fails due to .m4 files added but not installed

2024-01-12 Thread Mike Frysinger
On 28 May 2022 12:14, Jim Meyering wrote:
> A few days ago I was preparing to release grep and wanted to make sure
> it'd work with the latest automake and autoconf, so I built and installed
> each from master. That exposed these errors when bootstrapping grep. I
> think it was a prerequisite to have run grep's "make maintainer-clean":
> 
>   configure.ac:41: warning: _AM_PROG_RM_F is m4_require'd but not\
> m4_defun'd
>   configure.ac:41: warning: _AM_PROG_XARGS_N is m4_require'd but not\
> m4_defun'd
>   configure:5058: error: possibly undefined macro: _AM_PROG_RM_F
>   configure:5059: error: possibly undefined macro: _AM_PROG_XARGS_N
> 
> I've just pushed the attached fix.
> Introduced in v1.16.5-46-g38da1d906 and v1.16.5-45-g3099097d7
> so this doesn't need a NEWS update.
> 
> Mike, can you add an automake test that would have caught this?

does `make distcheck` not catch this ?  would be nice if we could catch
with a git checkout directly, but seems difficult to pull off.

would it be reasonable to assume that every m4/*.m4 file is supposed
to be installed ?  that wouldn't be too hard to run tests against,
but it would make things a little more tricky for devs working out
of the git tree with uncommitted local changes.

the problem with running $ACLOCAL is that it's configured to search
the local ../m4/ tree for all macros that exist ...

is there some m4 invocation we could run that would scan all the
installed m4 files ?  we can pass down the known list of m4 files to
be installed, but how to actually scan/validate them i'm not sure.
-mike


signature.asc
Description: PGP signature


fix: autoreconf fails due to .m4 files added but not installed

2022-05-28 Thread Jim Meyering
A few days ago I was preparing to release grep and wanted to make sure
it'd work with the latest automake and autoconf, so I built and installed
each from master. That exposed these errors when bootstrapping grep. I
think it was a prerequisite to have run grep's "make maintainer-clean":

  configure.ac:41: warning: _AM_PROG_RM_F is m4_require'd but not\
m4_defun'd
  configure.ac:41: warning: _AM_PROG_XARGS_N is m4_require'd but not\
m4_defun'd
  configure:5058: error: possibly undefined macro: _AM_PROG_RM_F
  configure:5059: error: possibly undefined macro: _AM_PROG_XARGS_N

I've just pushed the attached fix.
Introduced in v1.16.5-46-g38da1d906 and v1.16.5-45-g3099097d7
so this doesn't need a NEWS update.

Mike, can you add an automake test that would have caught this?

>From 208f103f2607eaed95aa0d227c5627b4363ffb7b Mon Sep 17 00:00:00 2001
From: Jim Meyering 
Date: Mon, 23 May 2022 23:20:37 -0700
Subject: [PATCH] fix: autoreconf fails due to .m4 files added but not
 installed

* m4/local.mk (dist_automake_ac_DATA): Add both rmf.m4 and xargsn.m4.
Building grep from "make maintainer-clean" state, failed like this:
  configure.ac:41: warning: _AM_PROG_RM_F is m4_require'd but not\
m4_defun'd
  configure.ac:41: warning: _AM_PROG_XARGS_N is m4_require'd but not\
m4_defun'd
  configure:5058: error: possibly undefined macro: _AM_PROG_RM_F
  configure:5059: error: possibly undefined macro: _AM_PROG_XARGS_N
---
 m4/local.mk | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/m4/local.mk b/m4/local.mk
index 3bc333b7b..7ed018996 100644
--- a/m4/local.mk
+++ b/m4/local.mk
@@ -46,6 +46,7 @@ dist_automake_ac_DATA = \
   %D%/options.m4 \
   %D%/python.m4 \
   %D%/prog-cc-c-o.m4 \
+  %D%/rmf.m4 \
   %D%/runlog.m4 \
   %D%/sanity.m4 \
   %D%/silent.m4 \
@@ -53,7 +54,8 @@ dist_automake_ac_DATA = \
   %D%/substnot.m4 \
   %D%/tar.m4 \
   %D%/upc.m4 \
-  %D%/vala.m4
+  %D%/vala.m4 \
+  %D%/xargsn.m4

 dist_system_ac_DATA = %D%/acdir/README

-- 
2.35.1.677.gabf474a5dd