havelib: Fix for Solaris 11 OpenIndiana and Solaris 11 OmniOS.
[gnulib.git] / m4 / no-c++.m4
blob905aa69d4615e562832b089769975bdfd9cf1d0a
1 # no-c++.m4 serial 2
2 dnl Copyright (C) 2006, 2009-2020 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
7 # Support for C source files that cannot be compiled by a C++ compiler.
8 # Set NO_CXX to the C++ compiler flags needed to request C mode instead of
9 # C++ mode.
10 # So far only g++ is supported. This includes clang++, as it is g++ compatible.
12 AC_DEFUN([gt_NO_CXX],
14   NO_CXX=
15   AC_EGREP_CPP([Is_g_plus_plus], [
16 #if defined __GNUC__ && defined __cplusplus
17   Is_g_plus_plus
18 #endif
19     ],
20     [NO_CXX="-x c"])
21   AC_SUBST([NO_CXX])