common/autoconf/basics.m4
changeset 28906 741a25ba3b20
parent 28902 0c09b47449c8
parent 28602 51c0dcf51b67
child 28908 fc8fe39b34cf
--- a/common/autoconf/basics.m4	Tue Jan 27 09:32:37 2015 -0800
+++ b/common/autoconf/basics.m4	Wed Jan 28 08:14:14 2015 -0800
@@ -983,3 +983,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)
+])