X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/1462fcee1ed295b24f47758b370068aa6304bb41..e35cd6def7a19423a5f0fc566d844f6019df111a:/m4/c-working.m4?ds=sidebyside diff --git a/m4/c-working.m4 b/m4/c-working.m4 index f185812a..0db60f76 100644 --- a/m4/c-working.m4 +++ b/m4/c-working.m4 @@ -1,6 +1,6 @@ # Sanity test a C compiler. -# Copyright (C) 2006, 2009-2010 Free Software Foundation, Inc. +# Copyright (C) 2006, 2009-2012 Free Software Foundation, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -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"