summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViktor Dukhovni <ietf-dane@dukhovni.org>2021-11-30 17:46:10 -0500
committerZubin Duggal <zubin.duggal@gmail.com>2022-05-09 13:16:42 +0530
commitde5e16513cf4a9e8a78233d66c57f108f0e4a241 (patch)
tree0e4b23613c2ad203e65ebde9febe8e75c54fe827
parent8105bbb0322febeab9ebfbea1954e187256dc55d (diff)
downloadhaskell-de5e16513cf4a9e8a78233d66c57f108f0e4a241.tar.gz
Use POSIX shell syntax to redirect stdout/err
FreeBSD (and likely NetBSD) /bin/sh does not support '>& word' to redirect stdout + stderr. (Also the preferred syntax in bash would be '&> word' to avoid surprises when `word` is "-" or a number). Resolves: #20760 (cherry picked from commit d3c7f9be47ac99637ac0ede0759f77da320afaad)
-rw-r--r--m4/fp_cc_supports_target.m42
-rw-r--r--m4/xcode_version.m42
2 files changed, 2 insertions, 2 deletions
diff --git a/m4/fp_cc_supports_target.m4 b/m4/fp_cc_supports_target.m4
index 080c9f5d40..37eb8805e4 100644
--- a/m4/fp_cc_supports_target.m4
+++ b/m4/fp_cc_supports_target.m4
@@ -12,7 +12,7 @@ AC_DEFUN([FP_CC_SUPPORTS_TARGET],
AC_REQUIRE([FPTOOLS_SET_PLATFORM_VARS])
AC_MSG_CHECKING([whether $1 CC supports --target])
echo 'int main() { return 0; }' > conftest.c
- if $CC --target=$LlvmTarget -Werror conftest.c >& /dev/null ; then
+ if $CC --target=$LlvmTarget -Werror conftest.c > /dev/null 2>&1 ; then
CONF_CC_SUPPORTS_TARGET=YES
AC_MSG_RESULT([yes])
else
diff --git a/m4/xcode_version.m4 b/m4/xcode_version.m4
index e59604d6b8..af2916eb1d 100644
--- a/m4/xcode_version.m4
+++ b/m4/xcode_version.m4
@@ -5,7 +5,7 @@ AC_DEFUN([XCODE_VERSION],[
if test "$TargetVendor_CPP" = "apple"
then
AC_MSG_CHECKING(Xcode version)
- XcodeVersion=`(xcode-select -p >& /dev/null && xcodebuild -version) | grep Xcode | sed "s/Xcode //"`
+ XcodeVersion=`(xcode-select -p > /dev/null 2>&1 && xcodebuild -version) | grep Xcode | sed "s/Xcode //"`
# Old Xcode versions don't actually give the Xcode version
if test "$XcodeVersion" = ""
then