Hello,
On Thu, Aug 18, 2005 at 01:22:10PM -0700, Paul Eggert wrote:
> > +[case $ac_cv_$1 in
> > + [[!-]]*-*-*) ;;
> > + *) AC_MSG_ERROR([non-canonical value of ac_cv_$1: $ac_cv_$1]);;
> > +esac
>
> Sorry, I don't understand what that pattern is trying to do. Does it
> really catch all non-canonical values?
The pattern catches values which start with "-" or which contain less
than two "-".
This ensures that the code below:
IFS=-; set $ac_cv_$1; shift; shift
won't fail.
> Or even common problems? If not, then I wouldn't bother.
The main goal is not to catch non-canonical values. The goal is to
catch evil values which would break the code below.
> Also, the [!-] doesn't look portable to me.
I thought that it was a portable way to match any character other than "-".
If I were wrong, we can use:
ac_good=:
case $ac_cv_$1 in
-*) ac_good=false;;
*-?*-?*) ;;
*) ac_good=false;;
esac
ac_good || AC_MSG_ERROR([non-canonical value of ac_cv_$1: $ac_cv_$1])
Have a nice day,
Stepan Kasal