Re: [PATCH] doc: detail inconsistencies in sed word boundary handling

2016-10-31 Thread Jim Meyering
On Sun, Oct 30, 2016 at 12:01 PM, Pádraig Brady wrote: > * doc/autoconf.texi (Limitations of usual tools): Display a > table showing where the various syntaxes for word boundaries > are supported. ... > +Portable scripts should be aware of the inconsistencies and > +options for handling word bound

[PATCH v2 3/3] autoconf: refine quadrigraph test in _AC_DEFINE_UNQUOTED

2016-10-31 Thread Paolo Bonzini
It is a very common case that a quadrigraph appears in the argument of _AC_DEFINE_UNQUOTED, because "#define" is expanded through a quadrigraph. Therefore, restrict the quadrigraph tests to "$" (for "$(" and "${") and "(" (for "$("). At the same time, "#" should not be used inside AC_ECHO because

[PATCH v2 1/3] autoconf: prefer an unrolled loop for trivial AC_CHECK_FUNCS

2016-10-31 Thread Paolo Bonzini
An unrolled loop avoids the cost of spawning sed in AS_TR_SH and AS_TR_CPP. Prefer it if there is nothing in the second and third argument of AC_CHECK_FUNCS and the first argument is a literal. Modify AC_CHECK_FUNCS_ONCE to avoid the variable indirection too. * lib/autoconf/functions.m4 (AC_CHECK

Re: [PATCH 1/3] autoconf: prefer an unrolled loop for trivial AC_CHECK_FUNCS

2016-10-31 Thread Paolo Bonzini
On 31/10/2016 18:01, Eric Blake wrote: > On 10/31/2016 10:33 AM, Paolo Bonzini wrote: >> >> >> On 31/10/2016 16:28, Eric Blake wrote: >>> On 10/31/2016 06:39 AM, Paolo Bonzini wrote: An unrolled loop avoids the cost of spawning sed in AS_TR_SH and AS_TR_CPP. Prefer it if there is nothi

[PATCH v2 2/3] autoconf: prefer an unrolled loop for trivial AC_CHECK_HEADERS

2016-10-31 Thread Paolo Bonzini
An unrolled loop avoids the cost of spawning sed in AS_TR_SH and AS_TR_CPP. Prefer it if there is nothing in the second and third argument of AC_CHECK_HEADERS and the first argument is a literal. Modify AC_CHECK_HEADERS_ONCE to avoid the variable indirection too. * lib/autoconf/headers.m4 (AC_CHE

[PATCH v2 0/3] limit number of cat and sed forks

2016-10-31 Thread Paolo Bonzini
These three patches speed up libvirt's configure script by roughly 3%, by avoiding repeated calls to sed (for AS_TR_SH and AS_TR_CPP, patches 1-2) and cat (for _AC_DEFINE_UNQUOTED, patch 3). The AS_TR_SH and AS_TR_CPP computations are moved to autoconf time. cat is replaced by printf. Thanks, P

Re: [PATCH 1/3] autoconf: prefer an unrolled loop for trivial AC_CHECK_FUNCS

2016-10-31 Thread Eric Blake
On 10/31/2016 10:33 AM, Paolo Bonzini wrote: > > > On 31/10/2016 16:28, Eric Blake wrote: >> On 10/31/2016 06:39 AM, Paolo Bonzini wrote: >>> An unrolled loop avoids the cost of spawning sed in AS_TR_SH and >>> AS_TR_CPP. Prefer it if there is nothing in the second and third >>> argument of AC_C

Re: [PATCH 3/3] autoconf: refine quadrigraph test in _AC_DEFINE_UNQUOTED

2016-10-31 Thread Eric Blake
On 10/31/2016 06:39 AM, Paolo Bonzini wrote: > It is a very common case that a quadrigraph appears in the argument of > _AC_DEFINE_UNQUOTED, because "#define" is expanded through a quadrigraph. > Therefore, restrict the quadrigraph tests to "$" (for "$(" and "${") > and "(" (for "$("). > > At the

Re: [PATCH 2/3] autoconf: prefer an unrolled loop for trivial AC_CHECK_HEADERS

2016-10-31 Thread Eric Blake
On 10/31/2016 06:39 AM, Paolo Bonzini wrote: > An unrolled loop avoids the cost of spawning sed in AS_TR_SH and > AS_TR_CPP. Prefer it if there is nothing in the second and third > argument of AC_CHECK_HEADERS and the first argument is a literal. > Modify AC_CHECK_HEADERS_ONCE to avoid the variabl

Re: [PATCH 2/3] autoconf: prefer an unrolled loop for trivial AC_CHECK_HEADERS

2016-10-31 Thread Paolo Bonzini
On 31/10/2016 16:32, Eric Blake wrote: > On 10/31/2016 06:39 AM, Paolo Bonzini wrote: >> An unrolled loop avoids the cost of spawning sed in AS_TR_SH and >> AS_TR_CPP. Prefer it if there is nothing in the second and third >> argument of AC_CHECK_HEADERS and the first argument is a literal. >> Mo

Re: [PATCH 1/3] autoconf: prefer an unrolled loop for trivial AC_CHECK_FUNCS

2016-10-31 Thread Paolo Bonzini
On 31/10/2016 16:28, Eric Blake wrote: > On 10/31/2016 06:39 AM, Paolo Bonzini wrote: >> An unrolled loop avoids the cost of spawning sed in AS_TR_SH and >> AS_TR_CPP. Prefer it if there is nothing in the second and third >> argument of AC_CHECK_FUNCS and the first argument is a literal. >> Modi

Re: [PATCH 1/3] autoconf: prefer an unrolled loop for trivial AC_CHECK_FUNCS

2016-10-31 Thread Eric Blake
On 10/31/2016 06:39 AM, Paolo Bonzini wrote: > An unrolled loop avoids the cost of spawning sed in AS_TR_SH and > AS_TR_CPP. Prefer it if there is nothing in the second and third > argument of AC_CHECK_FUNCS and the first argument is a literal. > Modify AC_CHECK_FUNCS_ONCE to avoid the variable in

Re: [PATCH] oldnames: autoupdate AM_PROG_MKDIR_P

2016-10-31 Thread Eric Blake
On 10/31/2016 07:07 AM, Paolo Bonzini wrote: > The Automake maintainer badly wants to remove AM_PROG_MKDIR_P. > Provide an update path ourselves. > > 2016-10-31 Paolo Bonzini > > * lib/autoconf/oldnames.m4 (AM_PROG_MKDIR_P): New. > > Signed-off-by: Paolo Bonzini > --- > lib/autoconf/o

Re: [PATCH 1/3] autoconf: prefer an unrolled loop for trivial AC_CHECK_FUNCS

2016-10-31 Thread Eric Blake
On 10/31/2016 06:39 AM, Paolo Bonzini wrote: > An unrolled loop avoids the cost of spawning sed in AS_TR_SH and > AS_TR_CPP. Prefer it if there is nothing in the second and third > argument of AC_CHECK_FUNCS and the first argument is a literal. > Modify AC_CHECK_FUNCS_ONCE to avoid the variable in

[PATCH] oldnames: autoupdate AM_PROG_MKDIR_P

2016-10-31 Thread Paolo Bonzini
The Automake maintainer badly wants to remove AM_PROG_MKDIR_P. Provide an update path ourselves. 2016-10-31 Paolo Bonzini * lib/autoconf/oldnames.m4 (AM_PROG_MKDIR_P): New. Signed-off-by: Paolo Bonzini --- lib/autoconf/oldnames.m4 | 1 + 1 file changed, 1 insertion(+) diff --git a/

[PATCH 3/3] autoconf: refine quadrigraph test in _AC_DEFINE_UNQUOTED

2016-10-31 Thread Paolo Bonzini
It is a very common case that a quadrigraph appears in the argument of _AC_DEFINE_UNQUOTED, because "#define" is expanded through a quadrigraph. Therefore, restrict the quadrigraph tests to "$" (for "$(" and "${") and "(" (for "$("). At the same time, "#" should not be used inside AC_ECHO because

[PATCH 1/3] autoconf: prefer an unrolled loop for trivial AC_CHECK_FUNCS

2016-10-31 Thread Paolo Bonzini
An unrolled loop avoids the cost of spawning sed in AS_TR_SH and AS_TR_CPP. Prefer it if there is nothing in the second and third argument of AC_CHECK_FUNCS and the first argument is a literal. Modify AC_CHECK_FUNCS_ONCE to avoid the variable indirection too. * lib/autoconf/functions.m4 (AC_CHECK

[PATCH 0/3] limit number of cat and sed forks

2016-10-31 Thread Paolo Bonzini
These three patches speed up libvirt's configure script by roughly 3%, by avoiding repeated calls to sed (for AS_TR_SH and AS_TR_CPP, patches 1-2) and cat (for _AC_DEFINE_UNQUOTED, patch 3). The AS_TR_SH and AS_TR_CPP computations are moved to autoconf time. cat is replaced by printf. Thanks, P

[PATCH 2/3] autoconf: prefer an unrolled loop for trivial AC_CHECK_HEADERS

2016-10-31 Thread Paolo Bonzini
An unrolled loop avoids the cost of spawning sed in AS_TR_SH and AS_TR_CPP. Prefer it if there is nothing in the second and third argument of AC_CHECK_HEADERS and the first argument is a literal. Modify AC_CHECK_HEADERS_ONCE to avoid the variable indirection too. * lib/autoconf/headers.m4 (AC_CHE