common/autoconf/basics.m4
changeset 28602 51c0dcf51b67
parent 27595 cff167b3bfa2
child 28809 6481e27e00ee
child 28906 741a25ba3b20
--- a/common/autoconf/basics.m4	Thu Jan 08 17:11:48 2015 -0800
+++ b/common/autoconf/basics.m4	Wed Jan 14 16:03:59 2015 +0100
@@ -987,3 +987,26 @@
     IS_RECONFIGURE=no
   fi
 ])
+
+# Check for support for specific options in bash
+AC_DEFUN_ONCE([BASIC_CHECK_BASH_OPTIONS],
+[
+  # Test if bash supports pipefail.
+  AC_MSG_CHECKING([if bash supports pipefail])
+  if ${BASH} -c 'set -o pipefail'; then
+    BASH_ARGS="$BASH_ARGS -o pipefail"
+    AC_MSG_RESULT([yes])
+  else
+    AC_MSG_RESULT([no])
+  fi
+
+  AC_MSG_CHECKING([if bash supports errexit (-e)])
+  if ${BASH} -e -c 'true'; then
+    BASH_ARGS="$BASH_ARGS -e"
+    AC_MSG_RESULT([yes])
+  else
+    AC_MSG_RESULT([no])
+  fi
+
+  AC_SUBST(BASH_ARGS)
+])