diff options
| -rw-r--r-- | configure.ac | 2 | ||||
| -rw-r--r-- | m4/ndim-check-sh-command-substitution.m4 | 13 | ||||
| -rw-r--r-- | m4/ndim-check-sh-functions.m4 | 16 | ||||
| -rw-r--r-- | m4/ndim-check-sh-param-expansion.m4 | 31 | ||||
| -rw-r--r-- | m4/ndim-detect-man2txt.m4 | 13 | ||||
| -rw-r--r-- | m4/ndim-require-posix-sh.m4 | 2 |
6 files changed, 29 insertions, 48 deletions
diff --git a/configure.ac b/configure.ac index d51c332..0da491f 100644 --- a/configure.ac +++ b/configure.ac @@ -15,6 +15,8 @@ AM_INIT_AUTOMAKE([-Wall -Werror foreign 1.10 dist-bzip2 ######################################################################## AC_PROG_SED +AC_PROG_GREP +AC_PROG_INSTALL ######################################################################## diff --git a/m4/ndim-check-sh-command-substitution.m4 b/m4/ndim-check-sh-command-substitution.m4 index de2e80c..e382294 100644 --- a/m4/ndim-check-sh-command-substitution.m4 +++ b/m4/ndim-check-sh-command-substitution.m4 @@ -1,3 +1,4 @@ +# serial 1.2.3 dnl NDIM_CHECK_SH_COMMAND_SUBSTITUTION([ACTION-IF-SUPPORTED], dnl [ACTION-IF-NOT-SUPPORTED)dnl dnl @@ -9,16 +10,8 @@ ndim_sh_command_substitution=no test "x$(pwd)" = "x`pwd`" && test "y$(echo "foobar")" = "y`echo foobar`" \ && ndim_sh_command_substitution=yes AC_MSG_RESULT([$ndim_sh_command_substitution])]) -m4_ifval([$1], [ -if test "x$ndim_sh_command_substitution" = "xyes"; then -$1 -fi -])dnl -m4_ifval([$2], [ -if test "x$ndim_sh_command_substitution" = "xno"; then -$2 -fi -]) +m4_ifval([$1], [AS_IF([test "x$ndim_sh_command_substitution" = "xyes"], [$1])])dnl +m4_ifval([$2], [AS_IF([test "x$ndim_sh_command_substitution" = "xno" ], [$2])])dnl ])dnl dnl dnl Local Variables: diff --git a/m4/ndim-check-sh-functions.m4 b/m4/ndim-check-sh-functions.m4 index 0b03dd7..77e1559 100644 --- a/m4/ndim-check-sh-functions.m4 +++ b/m4/ndim-check-sh-functions.m4 @@ -1,4 +1,4 @@ -# version 1.11 +# version 1.12 dnl NDIM_CHECK_SH_FUNCTIONS([ACTION-IF-SUPPORTED], dnl [ACTION-IF-NOT-SUPPORTED)dnl dnl @@ -11,17 +11,9 @@ AS_IF([test "x$ndim_sh_functions" = "x"], [dnl AC_MSG_CHECKING([whether sh supports POSIX sh functions]) ndim_sh_functions=no test "x$(moo() { echo "meh"; }; moo)" = "xmeh" && ndim_sh_functions=yes -AC_MSG_RESULT([$ndim_sh_functions])]) -m4_ifval([$1], [ -if test "x$ndim_sh_functions" = "xyes"; then -$1 -fi -])dnl -m4_ifval([$2], [ -if test "x$ndim_sh_functions" = "xno"; then -$2 -fi -]) +AC_MSG_RESULT([$ndim_sh_functions])])dnl +m4_ifval([$1], [AS_IF([test "x$ndim_sh_functions" = "xyes"], [$1])])dnl +m4_ifval([$2], [AS_IF([test "x$ndim_sh_functions" = "xno" ], [$2])])dnl ])dnl dnl dnl Local Variables: diff --git a/m4/ndim-check-sh-param-expansion.m4 b/m4/ndim-check-sh-param-expansion.m4 index b253131..91941e8 100644 --- a/m4/ndim-check-sh-param-expansion.m4 +++ b/m4/ndim-check-sh-param-expansion.m4 @@ -1,29 +1,22 @@ -# version 1.11 -dnl NDIM_CHECK_SH_COMMAND_SUBSTITUTION([ACTION-IF-SUPPORTED], -dnl [ACTION-IF-NOT-SUPPORTED)dnl +# version 1.12 +dnl NDIM_CHECK_SH_COMMAND_EXPANSION([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 +m4_pattern_forbid([NDIM_CHECK_SH_PARAM_EXPANSION])dnl +AC_DEFUN([NDIM_CHECK_SH_PARAM_EXPANSION],[dnl +AS_IF([test "x$ndim_sh_param_expansion" = "x"], [dnl +AC_MSG_CHECKING([\${foo%%bar} type sh param expansion]) +ndim_sh_param_expansion=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 -]) + && ndim_sh_param_expansion=yes +AC_MSG_RESULT([$ndim_sh_param_expansion])]) +m4_ifval([$1], [AS_IF([test "x$ndim_sh_param_expansion" = "xyes"], [$1])])dnl +m4_ifval([$2], [AS_IF([test "x$ndim_sh_param_expansion" = "xno" ], [$2])])dnl ])dnl dnl dnl Local Variables: diff --git a/m4/ndim-detect-man2txt.m4 b/m4/ndim-detect-man2txt.m4 index 023b5ba..0cb4b6e 100644 --- a/m4/ndim-detect-man2txt.m4 +++ b/m4/ndim-detect-man2txt.m4 @@ -1,4 +1,4 @@ -# serial 1.6.3 +# serial 1.6.4 dnl dnl NDIM_DETECT_MAN2TXT dnl @@ -21,22 +21,23 @@ AC_DEFUN([NDIM_DETECT_MAN2TXT], [dnl NDIM_CHECK_SH_FUNCTIONS([], [dnl AC_MSG_ERROR([Sorry, POSIX sh with functions required.])dnl ])dnl -AC_ARG_VAR([MAN]) +AC_ARG_VAR([MAN], [man(1) program to use]) AC_PATH_PROG([MAN], [man], [false]) -AC_ARG_VAR([COL]) +AC_ARG_VAR([COL], [col(1) program to use]) AC_PATH_PROG([COL], [col], [false]) AM_CONDITIONAL([HAVE_NDIM_MAN2TXT], [test "x$MAN" != "xfalse" && test "x$COL" != "xfalse" && test "x$(echo "ABXY" | $COL -b)" = "xBY"]) AC_MSG_CHECKING([man and col -b work correctly]) -if test "x$HAVE_NDIM_MAN2TXT_FALSE" = "x#"; then +AS_IF([test "x$HAVE_NDIM_MAN2TXT_FALSE" = "x#"], +[ AC_MSG_RESULT([yes]) NDIM_MAN2TXT='m2t(){ $(MAN) "$$(dirname "[$$]1")/$$(basename "[$$]1")"|$(COL) -b; }; m2t' -else +], [ AC_MSG_RESULT([no $(echo "ABXY" | $COL -b)]) NDIM_MAN2TXT='false' -fi +]) AC_SUBST([NDIM_MAN2TXT]) ])dnl dnl diff --git a/m4/ndim-require-posix-sh.m4 b/m4/ndim-require-posix-sh.m4 index e5e4814..c81cb5d 100644 --- a/m4/ndim-require-posix-sh.m4 +++ b/m4/ndim-require-posix-sh.m4 @@ -5,7 +5,7 @@ AC_DEFUN([NDIM_REQUIRE_POSIX_SH],[dnl NDIM_CHECK_SH_COMMAND_SUBSTITUTION([], [dnl AC_MSG_ERROR([Sorry, POSIX sh with \$() required.])dnl ])dnl -NDIM_CHECK_SH_PARAM_SUBSTITUTION([], [dnl +NDIM_CHECK_SH_PARAM_EXPANSION([], [dnl AC_MSG_ERROR([Sorry, POSIX sh with \${foo%%bar} & Co. required.])dnl ])dnl ])dnl |
