1 dnl Copyright (C) 2014-2016 Free Software Foundation, Inc.
3 dnl This file is part of GDB.
5 dnl This program is free software; you can redistribute it and/or modify
6 dnl it under the terms of the GNU General Public License as published by
7 dnl the Free Software Foundation; either version 3 of the License, or
8 dnl (at your option) any later version.
10 dnl This program is distributed in the hope that it will be useful,
11 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
12 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 dnl GNU General Public License for more details.
15 dnl You should have received a copy of the GNU General Public License
16 dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
18 dnl GDB_AC_BUILD_WITH_CXX()
19 dnl Provide an --enable-build-with-cxx/--disable-build-with-cxx set of options
20 dnl allowing a user to build with a C++ compiler.
22 AC_DEFUN([GDB_AC_BUILD_WITH_CXX],
24 AC_ARG_ENABLE(build-with-cxx,
25 AS_HELP_STRING([--disable-build-with-cxx], [build with C compiler instead of C++ compiler]),
30 AC_MSG_ERROR([bad value $enableval for --enable-build-with-cxx]) ;;
32 [enable_build_with_cxx=yes])
34 if test "$enable_build_with_cxx" = "yes"; then
36 COMPILER_CFLAGS='$(CXXFLAGS)'
39 COMPILER_CFLAGS='$(CFLAGS)'
42 AC_SUBST(COMPILER_CFLAGS)