]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
Speed up bootstrap by improving lt_join.
authorEric Blake <ebb9@byu.net>
Tue, 16 Oct 2007 22:45:49 +0000 (22:45 +0000)
committerEric Blake <ebb9@byu.net>
Tue, 16 Oct 2007 22:45:49 +0000 (22:45 +0000)
* libltdl/m4/ltsugar.m4 (lt_join, _lt_join): Rewrite to mirror
Autoconf 2.62's faster implementation.

ChangeLog
libltdl/m4/ltsugar.m4

index 1fa09ead8e7db9a3f31de54e07fde1578663bd76..97a2c2d6c8d9d6957f3e4cb28120f06b5959f74c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-10-16  Eric Blake  <ebb9@byu.net>
+
+       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  <ebb9@byu.net>
 
        Whitespace cleanup.
index 239051a62da07d7dd5d7cf16564af633cbfeb2cd..0d258e070a24d695ceba7e2f3a6071b6915e1d01 100644 (file)
@@ -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)