]> git.saurik.com Git - bison.git/blobdiff - tests/local.at
Merge branch 'branch-2.6' into maint
[bison.git] / tests / local.at
index 65ff8870461f80af0b6d4308a8e669347af459dd..f172b2445055dc87b7d1deefff793024c3b5f865 100644 (file)
@@ -462,10 +462,14 @@ m4_define([AT_BISON_CHECK_WARNINGS],
       [m4_null_if([$2], [AT_BISON_CHECK_WARNINGS_($@)])])])
 
 m4_define([AT_BISON_CHECK_WARNINGS_],
-[[# Defining POSIXLY_CORRECT causes bison to complain if options
-# are added after the grammar file name, so skip these checks
-# in that case.
-if test -z "${POSIXLY_CORRECT+set}"; then
+[[# Defining POSIXLY_CORRECT causes bison to complain if options are
+# added after the grammar file name, so skip these checks in that
+# case.
+#
+# Don't just check if $POSIXLY_CORRECT is set, as Bash, when launched
+# as /bin/sh, sets the shell variable POSIXLY_CORRECT to y, but not
+# the environment variable.
+if env | grep '^POSIXLY_CORRECT=' >/dev/null; then :; else
   ]AT_SAVE_SPECIAL_FILES[
 
   # To avoid expanding it repeatedly, store specified stdout.