regen
[bison.git] / tests / atlocal.in
blobeabff45008a2133fddcd358771fa9f00c0688c42
1 # @configure_input@                                     -*- shell-script -*-
2 # Configurable variable values for Bison test suite.
4 # Copyright (C) 2000-2015, 2018-2021 Free Software Foundation, Inc.
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program.  If not, see <https://www.gnu.org/licenses/>.
19 # We need 'testsuite.h' (srcdir/test).
20 CPPFLAGS="-I$abs_top_srcdir/tests @CPPFLAGS@"
22 # Don't just check if $POSIXLY_CORRECT is set, as Bash, when launched
23 # as /bin/sh, sets the shell variable POSIXLY_CORRECT to y, but not
24 # the environment variable.
25 if env | grep '^POSIXLY_CORRECT=' >/dev/null; then
26   POSIXLY_CORRECT_IS_EXPORTED=true
27 else
28   POSIXLY_CORRECT_IS_EXPORTED=false
31 ## ------------------- ##
32 ## C/C++ Compilation.  ##
33 ## ------------------- ##
35 : ${CC='@CC@'}
36 : ${CXX='@CXX@'}
38 # Is the compiler GCC?
39 : ${GCC='@GCC@'}
41 # Sometimes a test group needs to ignore gcc warnings, so it locally
42 # sets CFLAGS to this.
43 : ${NO_WERROR_CFLAGS='@CFLAGS@  @WARN_CFLAGS@  @WARN_CFLAGS_TEST@'}
44 : ${NO_WERROR_CXXFLAGS='@CXXFLAGS@ @WARN_CXXFLAGS@ @WARN_CXXFLAGS_TEST@'}
45 : ${WNO_DEPRECATED_CXXFLAGS='@WNO_DEPRECATED_CXXFLAGS@'}
47 # But most of the time, we want -Werror.
48 : ${CFLAGS="$NO_WERROR_CFLAGS  @WERROR_CFLAGS@"}
49 : ${CXXFLAGS="$NO_WERROR_CXXFLAGS @WERROR_CXXFLAGS@"}
51 # If 'exit 77'; skip all C++ tests; otherwise ':'.
52 : ${BISON_CXX_WORKS='@BISON_CXX_WORKS@'}
54 # Compiler flags to disable exception support.
55 : ${NO_EXCEPTIONS_CXXFLAGS='@NO_EXCEPTIONS_CXXFLAGS@'}
57 # Requiring a specific C++ standard.
58 : ${CXX98_CXXFLAGS='@CXX98_CXXFLAGS@'}
59 : ${CXX03_CXXFLAGS='@CXX03_CXXFLAGS@'}
60 : ${CXX11_CXXFLAGS='@CXX11_CXXFLAGS@'}
61 : ${CXX14_CXXFLAGS='@CXX14_CXXFLAGS@'}
62 : ${CXX17_CXXFLAGS='@CXX17_CXXFLAGS@'}
63 : ${CXX20_CXXFLAGS='@CXX20_CXXFLAGS@'}
64 : ${CXX2B_CXXFLAGS='@CXX2B_CXXFLAGS@'}
66 # Whether the compiler supports POSIXLY_CORRECT defined.
67 : ${C_COMPILER_POSIXLY_CORRECT='@C_COMPILER_POSIXLY_CORRECT@'}
68 : ${CXX_COMPILER_POSIXLY_CORRECT='@CXX_COMPILER_POSIXLY_CORRECT@'}
70 if $POSIXLY_CORRECT_IS_EXPORTED; then
71   $C_COMPILER_POSIXLY_CORRECT || BISON_C_WORKS=false
72   $CXX_COMPILER_POSIXLY_CORRECT || BISON_CXX_WORKS=false
75 # Handle --compile-c-with-cxx here, once CXX and CXXFLAGS are known.
76 if "$at_arg_compile_c_with_cxx"; then
77   CC_IS_CXX=1
78   CC=$CXX
79   NO_WERROR_CFLAGS=$NO_WERROR_CXXFLAGS
80   CFLAGS="$CXXFLAGS $WNO_DEPRECATED_CXXFLAGS"
81   BISON_C_WORKS=$BISON_CXX_WORKS
82 else
83   CC_IS_CXX=0
87 ## ------- ##
88 ## Other.  ##
89 ## ------- ##
91 # Empty if no D compiler was found.
92 : ${DC='@DC@'}
93 : ${DCFLAGS='@DCFLAGS@'}
94 if test x"$DC" = x; then
95   BISON_DC_WORKS=false
96 else
97   BISON_DC_WORKS=true
100 # Empty if no javac was found
101 : ${CONF_JAVAC='@CONF_JAVAC@'}
103 # Empty if no Java VM was found
104 : ${CONF_JAVA='@CONF_JAVA@'}
106 # We need egrep and perl.
107 : ${EGREP='@EGREP@'}
108 : ${PERL='@PERL@'}
110 # Use simple quotes (lib/quote.c).
111 # We have an LC_ALL=C pushed onto us via maint.mk.
112 LC_CTYPE=C
113 export LC_CTYPE
115 # Are special link options needed?
116 : ${LDFLAGS='@LDFLAGS@'}
118 # Are special libraries needed?
119 : ${LIBS="$abs_top_builddir/lib/libbison.a @LIBS@ @INTLLIBS@"}
121 # Empty if no xsltproc was found
122 : ${XSLTPROC='@XSLTPROC@'}
125 # Some tests expect a precise diff format.  See AT_DIFF_U_CHECK.
126 # See https://lists.gnu.org/r/bug-bison/2020-05/msg00049.html.
127 cat >conftest.1 <<EOF
136 cat >conftest.2 <<EOF
145 cat >conftest.expected <<EOF
146 @@ -1,6 +1,6 @@
157 diff -u conftest.1 conftest.2 2>/dev/null | sed -n '/^@@/,$p' | sed 's/^ $//' >conftest.diff
158 if diff conftest.expected conftest.diff >/dev/null; then
159     DIFF_U_WORKS=true
160 else
161     DIFF_U_WORKS=false
163 rm conftest.*