From e0c01e98923e3012cd3aee459e15e84e11b05a7b Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Tue, 16 Oct 2007 22:45:49 +0000 Subject: [PATCH] Speed up bootstrap by improving lt_join. * libltdl/m4/ltsugar.m4 (lt_join, _lt_join): Rewrite to mirror Autoconf 2.62's faster implementation. --- ChangeLog | 6 ++++++ libltdl/m4/ltsugar.m4 | 20 ++++++++------------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1fa09ead8..97a2c2d6c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-10-16 Eric Blake + + Speed up bootstrap by improving lt_join. + * libltdl/m4/ltsugar.m4 (lt_join, _lt_join): Rewrite to mirror + Autoconf 2.62's faster implementation. + 2007-10-12 Eric Blake Whitespace cleanup. diff --git a/libltdl/m4/ltsugar.m4 b/libltdl/m4/ltsugar.m4 index 239051a62..0d258e070 100644 --- a/libltdl/m4/ltsugar.m4 +++ b/libltdl/m4/ltsugar.m4 @@ -7,7 +7,7 @@ # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# serial 4 ltsugar.m4 +# serial 5 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) @@ -17,19 +17,15 @@ AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. +# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier +# versions in m4sugar had bugs. m4_define([lt_join], -[m4_case([$#], - [0], [m4_fatal([$0: too few arguments: $#])], - [1], [], - [2], [[$2]], - [m4_ifval([$2], - [[$2][]m4_foreach(_lt_Arg, lt_car([m4_shiftn(2, $@)]), - [_$0([$1], _lt_Arg)])], - [$0([$1], m4_shiftn(2, $@))])])[]dnl -]) +[m4_if([$#], [1], [], + [$#], [2], [[$2]], + [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], -[m4_ifval([$2],[$1][$2])[]dnl -]) +[m4_if([$#$2], [2], [], + [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) -- 2.47.3