1 # @configure_input@ -*- shell-script -*-
2 # Configurable variable values for Bison test suite.
4 # Copyright (C) 2000-2013 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 <http://www.gnu.org/licenses/>.
20 CPPFLAGS="-I$abs_top_builddir/lib @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
28 POSIXLY_CORRECT_IS_EXPORTED=false
31 ## ------------------- ##
32 ## C/C++ Compilation. ##
33 ## ------------------- ##
38 # Is the compiler 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@'
46 # But most of the time, we want -Werror.
47 CFLAGS="$NO_WERROR_CFLAGS @WERROR_CFLAGS@"
48 CXXFLAGS="$NO_WERROR_CXXFLAGS @WERROR_CXXFLAGS@"
50 # If 'exit 77'; skip all C++ tests; otherwise ':'.
51 BISON_CXX_WORKS='@BISON_CXX_WORKS@'
53 # Be sure that the C++ compiler is not broken because of gnulib. This
54 # cannot be checked in configure (gnulib is not parameterized yet),
55 # and checking this in every C++ test in AC_COMPILE_CXX is too costly.
57 # http://lists.gnu.org/archive/html/bug-bison/2013-06/msg00001.html
59 # FIXME: Check (say 2014) whether this is still needed.
60 if $BISON_CXX_WORKS; then
61 # See AT_DATA_SOURCE_PROLOGUE.
62 cat >conftest.cc <<EOF
64 /* We don't need perfect functions for these tests. */
72 std::cout << "Works" << std::endl;
76 $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS $LIBS -o conftest conftest.cc
79 *) BISON_CXX_WORKS="as_fn_error 77 cannot-compile-simple-program";;
84 # Whether the compiler supports POSIXLY_CORRECT defined.
85 : ${C_COMPILER_POSIXLY_CORRECT='@C_COMPILER_POSIXLY_CORRECT@'}
86 : ${CXX_COMPILER_POSIXLY_CORRECT='@CXX_COMPILER_POSIXLY_CORRECT@'}
88 if $POSIXLY_CORRECT_IS_EXPORTED; then
89 $C_COMPILER_POSIXLY_CORRECT ||
90 BISON_C_WORKS="as_fn_error 77 POSIXLY_CORRECT"
91 $CXX_COMPILER_POSIXLY_CORRECT ||
92 BISON_CXX_WORKS="as_fn_error 77 POSIXLY_CORRECT"
95 # Handle --compile-c-with-cxx here, once CXX and CXXFLAGS are known.
96 if "$at_arg_compile_c_with_cxx"; then
99 NO_WERROR_CFLAGS=$NO_WERROR_CXXFLAGS
101 BISON_C_WORKS=$BISON_CXX_WORKS
111 # Empty if no javac was found
112 CONF_JAVAC='@CONF_JAVAC@'
114 # Empty if no Java VM was found
115 CONF_JAVA='@CONF_JAVA@'
117 # We need egrep and perl.
121 # Use simple quotes (lib/quote.c).
125 # Are special link options needed?
128 # Are special libraries needed?
129 LIBS="$abs_top_builddir/lib/libbison.a @LIBS@ @INTLLIBS@"
131 # Empty if no xsltproc was found
132 : ${XSLTPROC='@XSLTPROC@'}
134 # Don't just check if $POSIXLY_CORRECT is set, as Bash, when launched
135 # as /bin/sh, sets the shell variable POSIXLY_CORRECT to y, but not
136 # the environment variable.
137 : ${C_COMPILER_POSIXLY_CORRECT='@C_COMPILER_POSIXLY_CORRECT@'}
138 if env | grep '^POSIXLY_CORRECT=' >/dev/null; then
139 POSIXLY_CORRECT_IS_EXPORTED=true
141 POSIXLY_CORRECT_IS_EXPORTED=false