X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=m4%2Fshell.m4;h=f9ca24edca84ce777d5ef0c90516d5baf2ddd579;hb=ecea6a7078983379e5b4d8961337cc55298aa8b1;hp=a1cf55b9f7c00c20149497433ae883f4a52d15d7;hpb=dc84183747ce1703eb99685b5dbde1f65a143c06;p=debian%2Fgzip diff --git a/m4/shell.m4 b/m4/shell.m4 index a1cf55b..f9ca24e 100644 --- a/m4/shell.m4 +++ b/m4/shell.m4 @@ -1,6 +1,6 @@ # Check for a working shell. -# Copyright (C) 2000-2001, 2007, 2009-2012 Free Software Foundation, Inc. +# Copyright (C) 2000-2001, 2007, 2009-2018 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) @@ -34,40 +34,53 @@ AC_DEFUN([AC_PROG_SHELL], # Test that $(...) works. test "$(expr 3 + 4)" -eq 7 || exit ' + # Solaris 11 /bin/sh (AT&T Research) 93u 2011-02-08 has a file + # descriptor bug that breaks zgrep and is hard to test for + # directly. At some point $(...) is reading a pipe from the + # subshell, but the pipe is also open in the parent shell, so + # the read deadlocks. Prefer some other shell if available. + ac_maybe_solaris_sh_bug='test "${.sh.version}"' + 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 + "$SHELL" -c "$ac_maybe_solaris_sh_bug" 2>/dev/null || + ac_cv_path_shell=$SHELL 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 # PATH. Also, loop through PATH first and then through # shells, since less-"nice" shells in /bin and /usr/bin are # more likely to be installed than "nicer" shells elsewhere. + ac_break_if_good_shell=: as_save_IFS=$IFS; IFS=: for as_dir in /bin /usr/bin $PATH 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 - ac_cv_path_shell=$as_dir/$ac_base - break + if "$as_dir/$ac_base" -c "$ac_maybe_solaris_sh_bug" 2>/dev/null + then + test "$ac_cv_path_shell" = no + else + ac_break_if_good_shell=break + : + fi && ac_cv_path_shell=$as_dir/$ac_base + $ac_break_if_good_shell fi done - case $ac_cv_path_shell in - (/*) break - esac + $ac_break_if_good_shell esac done rm -f conftest.c @@ -78,4 +91,7 @@ AC_DEFUN([AC_PROG_SHELL], SHELL=/bin/sh AC_MSG_WARN([using $SHELL, even though it does not conform to POSIX]) fi + if "$SHELL" -c "$ac_maybe_solaris_sh_bug" 2>/dev/null; then + AC_MSG_WARN([using $SHELL, even though it may have file descriptor bugs]) + fi AC_SUBST(SHELL)])