1 | dnl |
---|
2 | dnl Check for target g++ |
---|
3 | dnl |
---|
4 | |
---|
5 | AC_DEFUN([RTEMS_PROG_CXX_FOR_TARGET], |
---|
6 | [ |
---|
7 | AC_BEFORE([$0], [RTEMS_CANONICALIZE_TOOLS])dnl |
---|
8 | AC_REQUIRE([RTEMS_ENABLE_CXX]) |
---|
9 | RTEMS_CHECK_CPUOPTS([RTEMS_SMP]) |
---|
10 | |
---|
11 | # If CXXFLAGS is not set, default to CFLAGS |
---|
12 | if test x"$rtems_cv_HAS_SMP" = x"yes" ; then |
---|
13 | CXXFLAGS=${CXXFLAGS-${CFLAGS} -std=gnu++11} |
---|
14 | else |
---|
15 | CXXFLAGS=${CXXFLAGS-${CFLAGS}} |
---|
16 | fi |
---|
17 | |
---|
18 | CXXFLAGS=`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 | |
---|
24 | RTEMS_CHECK_TOOL(CXX,g++) |
---|
25 | if test "$RTEMS_HAS_CPLUSPLUS" = "yes"; |
---|
26 | then |
---|
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 |
---|
45 | else |
---|
46 | ## Work-around to a bug in automake |
---|
47 | AM_CONDITIONAL([am__fastdepCXX],[false]) |
---|
48 | fi |
---|
49 | ]) |
---|