How to change default autoconf settings --help output

I want to change the contents of the autoconf default output configure --help, in particular the text placed in HELP_BEGINon _AC_INIT_HELP.

I understand that this will be a hack that is not completely "kosher" according to the teachings of autoconf, but I am ready to live with any consequences in portability, etc. However, I would prefer not to directly edit the autoconf implementation, a post-processing step is required on the generated script configuration.

It seems that the power of m4 should allow me to do this, but I have tried many different things, none of which work. Most of them lead to m4 crashes, for example:

$ cat configure.ac 
AC_PREREQ(2.69)
m4_define([_AC_INIT_HELP],patsubst(m4_defn([_AC_INIT_HELP]),[Fine],[Foo]))
AC_INIT(foo,1.0)
AC_OUTPUT()
$ autoreconf
/usr/local/pkg/autotools-201608/bin/m4: memory exhausted
autom4te: /usr/local/pkg/autotools-201608/bin/m4 failed with exit status: 1
aclocal: error: echo failed with exit status: 1
autoreconf: aclocal failed with exit status: 1

How can I do this job?

+4
1
, .

m4_copy:

AC_PREREQ(2.69)
m4_copy([_AC_INIT_HELP],[_MY_INIT_HELP])
m4_define([_AC_INIT_HELP],[patsubst(m4_defn([_MY_INIT_HELP]),[Fine],[Foo])])
AC_INIT(foo,1.0)
AC_OUTPUT()
+3

Source: https://habr.com/ru/post/1673529/


All Articles