summaryrefslogtreecommitdiffstats
path: root/m4/ndim-check-sh-param-expansion.m4
blob: b253131fb5a105c1912d0f816b3a34bc6b8477cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# version 1.11
dnl NDIM_CHECK_SH_COMMAND_SUBSTITUTION([ACTION-IF-SUPPORTED],
dnl                                    [ACTION-IF-NOT-SUPPORTED)dnl
dnl
m4_pattern_forbid([NDIM_CHECK_SH_PARAM_SUBSTITUTION])dnl
AC_DEFUN([NDIM_CHECK_SH_PARAM_SUBSTITUTION],[dnl
AS_IF([test "x$ndim_sh_param_substitution" = "x"], [dnl
AC_MSG_CHECKING([\${foo%%bar} type sh param substitution])
ndim_sh_param_substitution=no
ndim_testvalue="12.34.56-1.23.4-615asdg"
test "x${ndim_testvalue%%-*}" = "x12.34.56" \
     && test "x${ndim_testvalue%-*}" = "x12.34.56-1.23.4" \
     && test "x${ndim_testvalue##*-}" = "x615asdg" \
     && test "x${ndim_testvalue#*-}" = "x1.23.4-615asdg" \
     && ndim_sh_param_substitution=yes
AC_MSG_RESULT([$ndim_sh_param_substitution])])
m4_ifval([$1], [
if test "x$ndim_sh_param_substitution" = "xyes"; then
$1
fi
])dnl
m4_ifval([$2], [
if test "x$ndim_sh_param_substitution" = "xno"; then
$2
fi
])
])dnl
dnl
dnl Local Variables:
dnl mode: autoconf
dnl End: