From 0070558150bf2d0bedd77f8f651ebb41acd6552f Mon Sep 17 00:00:00 2001 From: Hans Ulrich Niedermann Date: Tue, 6 Nov 2007 19:57:27 +0100 Subject: Simplify m4 macros --- m4/ndim-check-sh-command-substitution.m4 | 8 +++----- m4/ndim-check-sh-functions.m4 | 6 ++---- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/m4/ndim-check-sh-command-substitution.m4 b/m4/ndim-check-sh-command-substitution.m4 index 30ea082..48c5e26 100644 --- a/m4/ndim-check-sh-command-substitution.m4 +++ b/m4/ndim-check-sh-command-substitution.m4 @@ -2,13 +2,11 @@ dnl NDIM_CHECK_SH_COMMAND_SUBSTITUTION([ACTION-IF-SUPPORTED], dnl [ACTION-IF-NOT-SUPPORTED)dnl dnl +m4_pattern_forbid([NDIM_CHECK_SH_COMMAND_SUBSTITUTION])dnl AC_DEFUN([NDIM_CHECK_SH_COMMAND_SUBSTITUTION],[dnl ndim_sh_command_substitution=no -if test "x$(pwd)" = "x`pwd`" \ -&& test "y$(echo "foobar")" = "y`echo foobar`" -then - ndim_sh_command_substitution=yes -fi +test "x$(pwd)" = "x`pwd`" && test "y$(echo "foobar")" = "y`echo foobar`" \ + && ndim_sh_command_substitution=yes m4_ifval([$1], [ if test "x$ndim_sh_command_substitution" = "xyes"; then $1 diff --git a/m4/ndim-check-sh-functions.m4 b/m4/ndim-check-sh-functions.m4 index 137a218..a0f5108 100644 --- a/m4/ndim-check-sh-functions.m4 +++ b/m4/ndim-check-sh-functions.m4 @@ -2,15 +2,13 @@ dnl NDIM_CHECK_SH_FUNCTIONS([ACTION-IF-SUPPORTED], dnl [ACTION-IF-NOT-SUPPORTED)dnl dnl +m4_pattern_forbid([NDIM_CHECK_SH_FUNCTIONS])dnl AC_DEFUN([NDIM_CHECK_SH_FUNCTIONS],[dnl NDIM_CHECK_SH_COMMAND_SUBSTITUTION([], [dnl AC_MSG_ERROR([Sorry, POSIX sh with \$() required.])dnl ])dnl ndim_sh_functions=no -if test "x$(moo() { echo "meh"; }; moo)" = "xmeh" -then - ndim_sh_functions=yes -fi +test "x$(moo() { echo "meh"; }; moo)" = "xmeh" && ndim_sh_functions=yes m4_ifval([$1], [ if test "x$ndim_sh_functions" = "xyes"; then $1 -- cgit