Hello,

On Wed, Aug 17, 2005 at 02:22:00PM -0700, Noah Misch wrote:
> Please omit the common code elimination.  The `m4_if's of the new code
> mostly cancel the benefits of unification.

you are right.  Updated version below.

Stepan
2005-08-18  Stepan Kasal  <[EMAIL PROTECTED]>

        * lib/autoconf/general.m4 (_AC_CANONICAL_SPLIT): Verify that the value
        is really canonical.  Simplify the actual split, relying on that.
        Moreover, we rely on the fact that $* concatenates the parameters by
        the first character from IFS.

Index: lib/autoconf/general.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/general.m4,v
retrieving revision 1.880
diff -u -r1.880 general.m4
--- lib/autoconf/general.m4     16 Aug 2005 09:11:06 -0000      1.880
+++ lib/autoconf/general.m4     18 Aug 2005 09:04:59 -0000
@@ -1655,23 +1655,18 @@
 # --------------------------
 # Generate the variables THING, THING_{alias cpu vendor os}.
 m4_define([_AC_CANONICAL_SPLIT],
-[AC_SUBST([$1],       [$ac_cv_$1])dnl
+[case $ac_cv_$1 in
+  [[!-]]*-*-*) ;;
+  *) AC_MSG_ERROR([non-canonical value of ac_cv_$1: $ac_cv_$1]);;
+esac
+AC_SUBST([$1], [$ac_cv_$1])dnl
 ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_$1
-shift
-IFS=$ac_save_IFS
-
+set $ac_cv_$1
 AC_SUBST([$1_cpu], [$[1]])dnl
 AC_SUBST([$1_vendor], [$[2]])dnl
-AC_SUBST([$1_os], [$[3]])dnl
-case $[#] in
-0|1|2) ;;
-*)
-  shift; shift; shift
-  for ac_arg
-  do $1_os=[$]$1_os-$ac_arg
-  done;;
-esac
+shift; shift
+AC_SUBST([$1_os], [$[*]])dnl
+IFS=$ac_save_IFS
 ])# _AC_CANONICAL_SPLIT
 
 

Reply via email to