configure: clump check for ${var%...} and ${var#...} expansion together
authorStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 28 Jun 2012 21:29:51 +0000 (23:29 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 28 Jun 2012 21:34:53 +0000 (23:34 +0200)
And together with those for the ${var%%...} and ${var##...} expansions.
After all, it is basically impossible to find a shell that support one
of them but not the others.

Suggestion by Eric Blake.

* configure.ac: Here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
configure.ac

index b79f1e7..c945b13 100644 (file)
@@ -297,23 +297,12 @@ AC_DEFUN([_AM_CHECK_CANDIDATE_SHELL],
       [], [am_score=1; break])
 
     _AM_CHECK_SHELL_FEATURE([$1],
-      [supports \${var@%:@glob}],
-      [v=a/b/c; test ${v@%:@*/} = b/c],
-      [], [am_score=1; break])
-
-    _AM_CHECK_SHELL_FEATURE([$1],
-      [supports \${var@%:@@%:@glob}],
-      [v=a/b/c; test ${v@%:@@%:@*/} = c],
-      [], [am_score=1; break])
-
-    _AM_CHECK_SHELL_FEATURE([$1],
-      [supports \${var%glob}],
-      [v=a.b.c; test ${v%.*} = a.b],
-      [], [am_score=1; break])
-
-    _AM_CHECK_SHELL_FEATURE([$1],
-      [supports \${var%%glob}],
-      [v=a.b.c; test ${v%%.*} = a],
+      [supports \${var@%:@glob} and \${var%glob}],
+      [v=a/b/c \
+        && test ${v@%:@*/} = b/c \
+        && test ${v@%:@@%:@*/} = c \
+        && test ${v%/*} = a/b \
+        && test ${v%%/*} = a],
       [], [am_score=1; break])
 
     _AM_CHECK_SHELL_FEATURE([$1],