Mailing List Archive

[PATCH] Use AC_SUBST_FILE to replace @DEPEND@ with contents of .depend
AC_SUBST_FILE[0] is similar to AC_SUBST, but instead of replacing
a variable with its value, it replaces a variable with the contents
of the file named by the value. This is exactly what we want in
order to insert the contents of .depend at the end of the Makefile.

Using AC_SUBST for this purpose poses some problems if $as_echo
involves running an external command (i.e. printf is not built-in),
in which case the size of .depend may exceed the operating system's
argument size limit. In particular, since autoconf 2.70, $as_echo
no longer uses `print -r` on ksh shells[1], causing the following
message when creating config.log on Linux with oksh:

./configure: printf: Argument list too long

AC_SUBST_FILE requires the substitution string to be on its own
line, so drop the unneeded leading comment (the first line of .depend
has a '#' of its own).

[0] https://www.gnu.org/software/autoconf/manual/html_node/Setting-Output-Variables.html
[1] http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=2b59b6f8a79b8bf77e178ff4e5aa0ede433d39cf;hp=bea5177adc0c924fe7483509a5e38a6d49319fcb
---
Note that I only get this error if I manually generate configure
from a git clone since the distributed tarballs used autoconf-2.69.
It also seems that the error only affects the contents of config.log,
not the Makefile (which is processed with an awk script).

Makefile.in | 2 +-
configure.ac | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index b749206d..4710c2fe 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -772,4 +772,4 @@ package: $(CONFIGFILES) $(MANPAGES) $(TARGETS)
sh buildpkg.sh; \
fi

-# @DEPEND@
+@DEPEND@
diff --git a/configure.ac b/configure.ac
index 1c2757ca..af2379df 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5442,7 +5442,8 @@ AC_SUBST([TEST_SSH_IPV6], [$TEST_SSH_IPV6])
AC_SUBST([TEST_SSH_UTF8], [$TEST_SSH_UTF8])
AC_SUBST([TEST_MALLOC_OPTIONS], [$TEST_MALLOC_OPTIONS])
AC_SUBST([UNSUPPORTED_ALGORITHMS], [$unsupported_algorithms])
-AC_SUBST([DEPEND], [$(cat $srcdir/.depend)])
+AC_SUBST_FILE([DEPEND])
+DEPEND=$srcdir/.depend

CFLAGS="${CFLAGS} ${CFLAGS_AFTER}"
LDFLAGS="${LDFLAGS} ${LDFLAGS_AFTER}"
--
2.30.1

_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
Re: [PATCH] Use AC_SUBST_FILE to replace @DEPEND@ with contents of .depend [ In reply to ]
On Sun, 18 Apr 2021, Michael Forney wrote:

> argument size limit. In particular, since autoconf 2.70, $as_echo
> no longer uses `print -r` on ksh shells[1], causing the following
> message when creating config.log on Linux with oksh:
>
> ./configure: printf: Argument list too long

What? Whose stupid idea was *that*?

> [1] http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=2b59b6f8a79b8bf77e178ff4e5aa0ede433d39cf;hp=bea5177adc0c924fe7483509a5e38a6d49319fcb

Dear GNU autoconf developer,

please keep using print -r -- if $KSH_VERSION is not unset/empty.
This is *much* faster and more reliable. (Also, print -nr -- to
omit the trailing newline.)

Thanks,
//mirabilos (developer of mksh)
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
Re: [PATCH] Use AC_SUBST_FILE to replace @DEPEND@ with contents of .depend [ In reply to ]
On 2021-04-18, Michael Forney <mforney@mforney.org> wrote:
> AC_SUBST_FILE[0] is similar to AC_SUBST, but instead of replacing
> a variable with its value, it replaces a variable with the contents
> of the file named by the value. This is exactly what we want in
> order to insert the contents of .depend at the end of the Makefile.
>
> Using AC_SUBST for this purpose poses some problems if $as_echo
> involves running an external command (i.e. printf is not built-in),
> in which case the size of .depend may exceed the operating system's
> argument size limit. In particular, since autoconf 2.70, $as_echo
> no longer uses `print -r` on ksh shells[1], causing the following
> message when creating config.log on Linux with oksh:
>
> ./configure: printf: Argument list too long
>
> AC_SUBST_FILE requires the substitution string to be on its own
> line, so drop the unneeded leading comment (the first line of .depend
> has a '#' of its own).
>
> [0]
> https://www.gnu.org/software/autoconf/manual/html_node/Setting-Output-Variables.html
> [1]
> http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=2b59b6f8a79b8bf77e178ff4e5aa0ede433d39cf;hp=bea5177adc0c924fe7483509a5e38a6d49319fcb

Ping on this patch.
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
Re: [PATCH] Use AC_SUBST_FILE to replace @DEPEND@ with contents of .depend [ In reply to ]
On 2021-06-24, Michael Forney <mforney@mforney.org> wrote:
> On 2021-04-18, Michael Forney <mforney@mforney.org> wrote:
>> AC_SUBST_FILE[0] is similar to AC_SUBST, but instead of replacing
>> a variable with its value, it replaces a variable with the contents
>> of the file named by the value. This is exactly what we want in
>> order to insert the contents of .depend at the end of the Makefile.
>>
>> Using AC_SUBST for this purpose poses some problems if $as_echo
>> involves running an external command (i.e. printf is not built-in),
>> in which case the size of .depend may exceed the operating system's
>> argument size limit. In particular, since autoconf 2.70, $as_echo
>> no longer uses `print -r` on ksh shells[1], causing the following
>> message when creating config.log on Linux with oksh:
>>
>> ./configure: printf: Argument list too long
>>
>> AC_SUBST_FILE requires the substitution string to be on its own
>> line, so drop the unneeded leading comment (the first line of .depend
>> has a '#' of its own).
>>
>> [0]
>> https://www.gnu.org/software/autoconf/manual/html_node/Setting-Output-Variables.html
>> [1]
>> http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=2b59b6f8a79b8bf77e178ff4e5aa0ede433d39cf;hp=bea5177adc0c924fe7483509a5e38a6d49319fcb
>
> Ping on this patch.

Any concerns with this patch? I thought it would be fairly
uncontroversial since it uses the autoconf macro designed exactly for
this purpose.
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
Re: [PATCH] Use AC_SUBST_FILE to replace @DEPEND@ with contents of .depend [ In reply to ]
On Sun, 18 Apr 2021, Michael Forney wrote:

> AC_SUBST_FILE[0] is similar to AC_SUBST, but instead of replacing
> a variable with its value, it replaces a variable with the contents
> of the file named by the value. This is exactly what we want in
> order to insert the contents of .depend at the end of the Makefile.
>
> Using AC_SUBST for this purpose poses some problems if $as_echo
> involves running an external command (i.e. printf is not built-in),
> in which case the size of .depend may exceed the operating system's
> argument size limit. In particular, since autoconf 2.70, $as_echo
> no longer uses `print -r` on ksh shells[1], causing the following
> message when creating config.log on Linux with oksh:
>
> ./configure: printf: Argument list too long
>
> AC_SUBST_FILE requires the substitution string to be on its own
> line, so drop the unneeded leading comment (the first line of .depend
> has a '#' of its own).

I actually have a few workflows that run make against the Makefile.in
(e.g. generating cat format manpages as part of release) and these
break with @DEPEND@ on it's own, uncommented line. I'll need to adjust
these before merging this.

It's unfortunate that AC_SUBST_FILE has the whole-line restriction
whereas AC_SUBST does not :(

-d
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
Re: [PATCH] Use AC_SUBST_FILE to replace @DEPEND@ with contents of .depend [ In reply to ]
On Wed, 11 Aug 2021, Damien Miller wrote:

> I actually have a few workflows that run make against the Makefile.in
> (e.g. generating cat format manpages as part of release) and these
> break with @DEPEND@ on it's own, uncommented line. I'll need to adjust
> these before merging this.

Can’t you put #@DEPEND@ on a line of its own?

Put a leading newline into the @DEPEND@ contents.

bye,
//mirabilos
--
15:41?<Lo-lan-do:#fusionforge> Somebody write a testsuite for helloworld :-)
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
Re: [PATCH] Use AC_SUBST_FILE to replace @DEPEND@ with contents of .depend [ In reply to ]
On Wed, 11 Aug 2021, Thorsten Glaser wrote:

> On Wed, 11 Aug 2021, Damien Miller wrote:
>
> > I actually have a few workflows that run make against the Makefile.in
> > (e.g. generating cat format manpages as part of release) and these
> > break with @DEPEND@ on it's own, uncommented line. I'll need to adjust
> > these before merging this.
>
> Can’t you put #@DEPEND@ on a line of its own?
>
> Put a leading newline into the @DEPEND@ contents.

#@DEPEND@ is on a line of its own

AC_SUBST_FILE requires @DEPEND@ to appear without the '#'

-d
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
Re: [PATCH] Use AC_SUBST_FILE to replace @DEPEND@ with contents of .depend [ In reply to ]
On Thu, 12 Aug 2021, Damien Miller wrote:

> #@DEPEND@ is on a line of its own
>
> AC_SUBST_FILE requires @DEPEND@ to appear without the '#'

Ah, ouch.

Hmmm. I tried this, working in gmake, first…

-----BEGIN cutting here may damage your screen surface-----
love:
@echo not war

DEPEND1=\
@DEPEND@
DEPEND2=$(DEPEND1:@DEPEND@=)
$(DEPEND2)
-----END cutting here may damage your screen surface-----

… but nmake.exe and mirmake don’t like it. However, they do like this…

-----BEGIN cutting here may damage your screen surface-----
love:
@echo not war

DEPEND1=@BACKSLASH@\
@DEPEND@
-----END cutting here may damage your screen surface-----

… which also works with pmake (bmake (NetBSD-derived) for GNU) and gmake.


$ sed -e 's!@BACKSLASH@!\\!' -e 's!^@DEPEND@!foo: love!' <z.mk >w.mk
$ vsdevcmd
[…]

C:\misc\mk>nmake /nologo -f z.mk
not war

C:\misc\mk>nmake /nologo -f w.mk
not war

C:\misc\mk>nmake /nologo -f z.mk foo
NMAKE : fatal error U1073: don't know how to make 'foo'
Stop.

C:\misc\mk>nmake /nologo -f w.mk foo
not war


This is assuming we may have @BACKSLASH@ not on a line of its own.

bye,
//mirabilos
--
Infrastrukturexperte • tarent solutions GmbH
Am Dickobskreuz 10, D-53121 Bonn • http://www.tarent.de/
Telephon +49 228 54881-393 • Fax: +49 228 54881-235
HRB AG Bonn 5168 • USt-ID (VAT): DE122264941
Geschäftsführer: Dr. Stefan Barth, Kai Ebenrett, Boris Esser, Alexander Steeg

*************************************************

Mit dem tarent-Newsletter nichts mehr verpassen: www.tarent.de/newsletter

*************************************************
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev