]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* doc/autoconf.texi (Limitations of Usual Tools): Mention expr bug
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 16 Jun 2005 07:24:42 +0000 (07:24 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 16 Jun 2005 07:24:42 +0000 (07:24 +0000)
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.

ChangeLog
doc/autoconf.texi
lib/autoconf/general.m4

index 0395dab3d36bddd16edd917681a503d2a856c5a5..0b304760d932c92907fdbde9dc3bbc15ce1170fe 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+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".
index 8b23418b9d0e7b28ef624e3eec3b45746565770a..e36229f560c3258d16e2fde2626c0f7d5eba63e9 100644 (file)
@@ -11830,6 +11830,13 @@ Solaris 8 @command{/usr/ucb/expr}) have a silly length limit that causes
 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
index 5c23b3d2e4a2d0f57fe50e12a996cde8b357871f..06f0bd56f3a59bcca0ab1b8a8d05d4b53032a2b2 100644 (file)
@@ -1671,9 +1671,26 @@ m4_define([AC_REQUIRE_AUX_FILE],
 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