NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: toolchain/57431: tool m4 can't regen tools/compat/configure



On 23-05-24 07:00, Luke Mewburn wrote:
  | >Number:         57431
  | >Category:       toolchain
  | >Synopsis:       tool m4 can't regen tools/compat/configure
  |
  | It's not possible to run "$TOOLDIR/bin/make -C tools/compat regen"
  | with $TOOLDIR/bin/nbm4 as the m4 implementation for tools/autoconf;
  | nbm4 complains about a regular expression used within autoconf.
  | GNU M4 works fine.
  | 
  | This makes it tricky to regen tools/compat after modifying
  | tools/compat/configure.ac for other issues.

I analysed this further - see discussion on source-changed-d:
- https://mail-index.netbsd.org/source-changes-d/2023/05/24/msg013956.html
- https://mail-index.netbsd.org/source-changes-d/2023/05/24/msg013957.html


In short, we don't need Christos' rev 1.2 change to
  external/gpl3/autoconf/dist/lib/autoconf/general.m4
and should revert that.

What we need to do is change unescaped GNU m4 regexp and patsubst
'{' and '}' to '\{' and '\}', because GNU m4 regexp is imp

GNU m4 regexp is implemented using gnulib Emacs-mode regexp
which are documented in
  https://www.gnu.org/software/gnulib/manual/html_node/emacs-regular-expression-syntax.html

Specifically, { and } have no special meaning for GNU m4;
these are not interval characters, and \{ and \} are not
the equivalent (unlike POSIX BREs).


I have experimented with converting our m4's -g mode (GNU emulation)
to escape { and } in regexes (in the twiddle()) function and
this seems to work. Further testing is required.


Home | Main Index | Thread Index | Old Index