Re: [PATCH] Add quotes in AS_IF test for gid_t

Paul Eggert <[email protected]> Wed, 7 Feb 2024 13:22:47 -0800
Newsgroups gmane.comp.sysutils.autoconf.patches,gmane.emacs.devel
Organization UCLA Computer Science Department
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--------------E5NEkfo07FfZXRqx6DlmdUz4
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

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....
--------------E5NEkfo07FfZXRqx6DlmdUz4
Content-Type: text/x-patch; charset=UTF-8;
 name="0001-Port-better-to-Autoconf-2.72.patch"
Content-Disposition: attachment;
 filename="0001-Port-better-to-Autoconf-2.72.patch"
Content-Transfer-Encoding: base64

RnJvbSBlMzRlYmMwY2NjNmMyN2U3ZTEyMTdiYWFkOWNhNzRkZDdiZWE0YzM3IE1vbiBTZXAg
MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBQYXVsIEVnZ2VydCA8ZWdnZXJ0QGNzLnVjbGEuZWR1
PgpEYXRlOiBXZWQsIDcgRmViIDIwMjQgMTM6MTc6NTcgLTA4M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