try restructuring rules to ensure reconf always run
[debian/gzip] / m4 / shell.m4
index 7eb470761eb244bc6f06f3c56e0a5b152a41cecb..2b10bb07f6fdeb58bc2bfa6543214a366cb6be8d 100644 (file)
@@ -1,4 +1,20 @@
-#serial 4
+# Check for a working shell.
+
+# Copyright (C) 2000-2001, 2007, 2009-2010 Free Software Foundation, Inc.
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
 
 # AC_PROG_SHELL
 # -------------
@@ -15,19 +31,21 @@ AC_DEFUN([AC_PROG_SHELL],
        >conftest.c || exit
        >|conftest.c || exit
        !>conftest.c || exit
+       # Test that $(...) works.
+       test "$(expr 3 + 4)" -eq 7 || exit
       '
       ac_cv_path_shell=no
 
       case $SHELL in
-      /*)
+      (/*)
        rm -f conftest.c
        if ("$SHELL" -c "$ac_command") 2>/dev/null; then
          ac_cv_path_shell=$SHELL
-       fi;;
+       fi
       esac
 
       case $ac_cv_path_shell in
-      no)
+      (no)
        # Prefer shells that are more likely to be installed in the
        # same place on all hosts of this platform.  Therefore, prefer
        # shells in /bin and /usr/bin to shells in the installer's
@@ -39,7 +57,7 @@ AC_DEFUN([AC_PROG_SHELL],
        do
          IFS=$as_save_IFS
          case $as_dir in
-         /*)
+         (/*)
            for ac_base in sh bash ksh sh5; do
              rm -f conftest.c
              if ("$as_dir/$ac_base" -c "$ac_command") 2>/dev/null; then
@@ -48,11 +66,11 @@ AC_DEFUN([AC_PROG_SHELL],
              fi
            done
            case $ac_cv_path_shell in
-           /*) break;;
-           esac;;
+           (/*) break
+           esac
          esac
        done
-       rm -f conftest.c;;
+       rm -f conftest.c
       esac])
    AC_MSG_RESULT($ac_cv_path_shell)
    SHELL=$ac_cv_path_shell