source: rtems/testsuites/aclocal/prog-cxx.m4 @ 11ff3a9

5
Last change on this file since 11ff3a9 was 14e5a08, checked in by Joel Sherrill <joel@…>, on 10/12/17 at 02:32:32

Fix warnings for using C/ObjC specific GCC flags with C++

Closes #3181.

  • Property mode set to 100644
File size: 1.2 KB
Line 
1dnl
2dnl Check for target g++
3dnl
4
5AC_DEFUN([RTEMS_PROG_CXX_FOR_TARGET],
6[
7AC_BEFORE([$0], [RTEMS_CANONICALIZE_TOOLS])dnl
8AC_REQUIRE([RTEMS_ENABLE_CXX])
9RTEMS_CHECK_CPUOPTS([RTEMS_SMP])
10
11# If CXXFLAGS is not set, default to CFLAGS
12if test x"$rtems_cv_HAS_SMP" = x"yes" ; then
13  CXXFLAGS=${CXXFLAGS-${CFLAGS} -std=gnu++11}
14else
15  CXXFLAGS=${CXXFLAGS-${CFLAGS}}
16fi
17
18CXXFLAGS=`echo ${CXXFLAGS} | sed \
19  -e s/-Wmissing-prototypes// \
20  -e s/-Wimplicit-function-declaration// \
21  -e s/-Wstrict-prototypes// \
22  -e s/-Wnested-externs//`
23
24RTEMS_CHECK_TOOL(CXX,g++)
25if test "$RTEMS_HAS_CPLUSPLUS" = "yes";
26then
27  dnl Only accept g++
28  dnl NOTE: This might be too restrictive
29  if test -z "$CXX";
30  then
31    RTEMS_HAS_CPLUSPLUS=no
32    HAS_CPLUSPLUS=no
33    ## Work-around to a bug in automake
34    AM_CONDITIONAL([am__fastdepCXX],[false])
35  else
36    AC_PROG_CXX
37    AC_PROG_CXXCPP
38    if test "$ac_cv_prog_cc_cross" != "$ac_cv_prog_cxx_cross"; then
39      AC_MSG_ERROR([***]
40       [Inconsistency in compiler configuration:]
41       [Target C compiler and target C++ compiler]
42       [must both either be cross compilers or native compilers])
43    fi
44  fi
45else
46  ## Work-around to a bug in automake
47  AM_CONDITIONAL([am__fastdepCXX],[false])
48fi
49])
Note: See TracBrowser for help on using the repository browser.