autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Use expr where possible


From: Peter O'Gorman
Subject: Re: [PATCH] Use expr where possible
Date: Wed, 15 Jun 2005 13:08:26 +0900
User-agent: Mozilla Thunderbird 1.0 (Macintosh/20041206)

Stepan Kasal wrote:
Hi,
  I commited the patch, incorporating Paul's suggestions and
fixing a mistake I made (I confused <<_ACEOF with <<\_ACEOF).
The final version is attached.

Stepan
 dnl FIXME: AC_SUBST([$1_alias],  [$ac_cv_$1_alias])dnl
-AC_SUBST([$1_cpu],
-        [`echo $ac_cv_$1 | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\1/'`])dnl
-AC_SUBST([$1_vendor],
-        [`echo $ac_cv_$1 | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\2/'`])dnl
-AC_SUBST([$1_os],
-        [`echo $ac_cv_$1 | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\3/'`])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_CANONICAL_SPLIT

Unfortunately, this breaks on Mac OS X 10.4:
% expr "Xpowerpc-apple-darwin8.1.0" : 'X[^-]*-[^-]*-\(.*\)'
apple-darwin8.1.0

expr is broken on 10.4, it is sad, but true. Please either revert this portion of the patch or use -- instead of -.
% expr "Xpowerpc-apple-darwin8.1.0" : 'X[^--]*-[^--]*-\(.*\)'
darwin8.1.0

Peter
--
Peter O'Gorman - http://www.pogma.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]