+2005-06-16 Paul Eggert <eggert@cs.ucla.edu>
+
+ * doc/autoconf.texi (Limitations of Usual Tools): Mention expr bug
+ on Mac OS X 10.4 reported by Peter O'Gorman in:
+ http://lists.gnu.org/archive/html/autoconf-patches/2005-06/msg00041.html
+ * lib/autoconf/general.m4 (_AC_CANONICAL_SPLIT):
+ Use shell builtins rather than 'expr', to work around expr bug.
+
2005-06-10 Paul Eggert <eggert@cs.ucla.edu>
* doc/autoconf.texi: "filesystem" -> "file system".
bytes. In this case, you might want to fall back on @samp{echo|sed} if
@command{expr} fails.
+On Mac OS X 10.4, @command{expr} mishandles the pattern @samp{[^-]} in
+some cases. For example, the command @samp{expr
+Xpowerpc-apple-darwin8.1.0 : 'X[^-]*-[^-]*-\(.*\)'} outputs
+@samp{apple-darwin8.1.0} rather than the correct @samp{darwin8.1.0}.
+This particular case can be worked around by substituting @samp{[^--]}
+for @samp{[^-]}.
+
Don't leave, there is some more!
The @acronym{QNX} 4.25 @command{expr}, in addition of preferring @samp{0} to
m4_define([_AC_CANONICAL_SPLIT],
[AC_SUBST([$1], [$ac_cv_$1])dnl
dnl FIXME: AC_SUBST([$1_alias], [$ac_cv_$1_alias])dnl
-AC_SUBST([$1_cpu], [`expr "X$ac_cv_$1" : ['X\([^-]*\)']`])dnl
-AC_SUBST([$1_vendor], [`expr "X$ac_cv_$1" : ['X[^-]*-\([^-]*\)']`])dnl
-AC_SUBST([$1_os], [`expr "X$ac_cv_$1" : ['X[^-]*-[^-]*-\(.*\)']`])dnl
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_$1
+shift
+IFS=$ac_save_IFS
+$1_cpu=$[1]
+$1_vendor=$[2]
+$1_os=$[3]
+
+case $[#] in
+0|1|2) ;;
+*)
+ shift; shift; shift
+ for ac_arg
+ do $1_os=$1_os-$ac_arg
+ done;;
+esac
+
+AC_SUBST([$1_cpu])dnl
+AC_SUBST([$1_vendor])dnl
+AC_SUBST([$1_os])dnl
])# _AC_CANONICAL_SPLIT