On 2/6/24 20:37, Nick Bowler wrote:
On 2024-02-06 22:33, Sam James wrote:
Noticed when building Emacs:
```
* checking type of array argument to getgroups... ./configure: 42782: test: =: 
unexpected operator
```

Oh look, I see this line in emacs-29.2/configure.ac:

   AC_DEFUN([AC_TYPE_UID_T])

This is the actual cause of the problem, because AC_TYPE_UID_T is the
part of Autoconf that would have assigned this variable.  Since Emacs
has deleted its definition, it has therefore broken other Autoconf
macros (like AC_TYPE_GETGROUPS) which depend on it.

Thanks for reporting this. I installed the attached patch into Emacs master.

The now-fixed bug in Emacs's generated 'configure' script should be harmless on all platforms I know about, as AC_TYPE_GETGROUPS should go ahead and do the right thing anyway.

PS. There is a case for quoting all uses of ac_cv_* variables, as their values may be corrupted in the cache. This is my usual style elsewhere and perhaps Autoconf should adopt it. Of course if we'd done that we would likely never have spotted this harmless error in Emacs configure.ac....
From e34ebc0ccc6c27e7e1217baad9ca74dd7bea4c37 Mon Sep 17 00:00:00 2001
From: Paul Eggert <egg...@cs.ucla.edu>
Date: Wed, 7 Feb 2024 13:17:57 -0800
Subject: [PATCH] Port better to Autoconf 2.72

* configure.ac: Set ac_cv_type_gid_t=yes to pacify Autoconf 2.72
AC_TYPE_GETGROUPS.  Problem reported by Nick Bowler in:
https://lists.gnu.org/r/autoconf-patches/2024-02/msg00001.html
---
 configure.ac | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure.ac b/configure.ac
index b74eba879ab..847fdbd54d2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2337,6 +2337,7 @@ AC_DEFUN
 AC_DEFUN([AC_TYPE_SIZE_T])
 # Likewise for obsolescent test for uid_t, gid_t; Emacs assumes them.
 AC_DEFUN([AC_TYPE_UID_T])
+ac_cv_type_gid_t=yes # AC_TYPE_GETGROUPS needs this in Autoconf 2.72.
 
 # Check for all math.h functions that Emacs uses; on some platforms,
 # -lm is needed for some of these functions.
-- 
2.43.0

Reply via email to