From: Paul Eggert Date: Thu, 16 Jun 2005 07:24:42 +0000 (+0000) Subject: * doc/autoconf.texi (Limitations of Usual Tools): Mention expr bug X-Git-Tag: AUTOCONF-2.59c~331 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7a2fe7a9637ea2dbda6a2c9423256e9651f8ae7d;p=thirdparty%2Fautoconf.git * 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. --- diff --git a/ChangeLog b/ChangeLog index 0395dab3d..0b304760d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-06-16 Paul Eggert + + * 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 * doc/autoconf.texi: "filesystem" -> "file system". diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 8b23418b9..e36229f56 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -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 diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index 5c23b3d2e..06f0bd56f 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -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