X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/f6b561d9f9cbc6fc95bbb86518372a5cb52f45a6..6d58c632025cb6928a90e4176577982bfb9c3981:/tests/atlocal.in?ds=sidebyside diff --git a/tests/atlocal.in b/tests/atlocal.in index e350d137..16e6fda8 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in @@ -79,6 +79,15 @@ LIBS="$abs_top_builddir/lib/libbison.a @LIBS@ @INTLLIBS@" # Empty if no xsltproc was found : ${XSLTPROC='@XSLTPROC@'} +# 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. +: ${C_COMPILER_POSIXLY_CORRECT='@C_COMPILER_POSIXLY_CORRECT@'} +if env | grep '^POSIXLY_CORRECT=' >/dev/null; then + POSIXLY_CORRECT_IS_EXPORTED=true +else + POSIXLY_CORRECT_IS_EXPORTED=false +fi # Handle --compile-c-with-cxx here, once CXX and CXXFLAGS are known. if "$at_arg_compile_c_with_cxx"; then