diff --git a/configure.ac b/configure.ac index 651fa139..86783d52 100644 --- a/configure.ac +++ b/configure.ac @@ -114,6 +114,7 @@ fi BISON_TEST_FOR_WORKING_C_COMPILER BISON_TEST_FOR_WORKING_CXX_COMPILER +BISON_C_COMPILER_POSIXLY_CORRECT AC_ARG_ENABLE([yacc], [AC_HELP_STRING([--disable-yacc], diff --git a/m4/c-working.m4 b/m4/c-working.m4 index d563d32b..0db60f76 100644 --- a/m4/c-working.m4 +++ b/m4/c-working.m4 @@ -25,3 +25,47 @@ AC_DEFUN([BISON_TEST_FOR_WORKING_C_COMPILER], [ [], [AC_MSG_FAILURE([cannot compile a simple C program])]) ]) + +# BISON_CHECK_WITH_POSIXLY_CORRECT(CODE) +# -------------------------------------- +# Run the Autoconf CODE with POSIXLY_CORRECT set to 1, and restored to +# its initial value afterwards. +AC_DEFUN([BISON_CHECK_WITH_POSIXLY_CORRECT], +[gl_awk_probe='BEGIN { if ("POSIXLY_CORRECT" in ENVIRON) print "x" }' +case ${POSIXLY_CORRECT+x}`$AWK "$gl_awk_probe"