source: rtems/aclocal/prog-cxx.m4 @ 9b8baa1

4.104.114.84.95
Last change on this file since 9b8baa1 was 2efdd08, checked in by Joel Sherrill <joel.sherrill@…>, on 05/20/98 at 17:06:57

Patch from Ralf Corseipus to fix latent configure problems suddenly triggered:

The breakdown:

  • CC_FOR_TARGET and CXX_FOR_TARGET were not correctly re-read from autoconf's configuration cache (config.cache)
  • If <target>-[gcc|g++] was not found while running configure, the config macros tried to use other (wrong) compilers (e.g. cc).

Changes:

  • New RTEMS_PROG_CC macro (aclocal/prog-cc.m4).
  • New RTEMS_PROG_CXX macro (aclocal/prog-cxx.m4)
  • Moved a shell script fragment from configure.in to a new m4-autoconf macro (New file: aclocal/tool-prefix.m4)
  • Minor changes to configure.in

I tested it with linux/posix (native gcc/primary libc) and
sh-rtems/gensh1 on a linux host and didn't notice any bugs
related to the problems mentioned above. There seem to be
more bugs with the posix bsp, but I consider them minor as
the build run completed successfully. It is just too late
for me to attempt to fix them now.

  • Property mode set to 100644
File size: 1.5 KB
Line 
1dnl
2dnl $Id$
3dnl
4dnl Check for target g++
5dnl
6dnl 98/05/20 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
7dnl                             Completely reworked
8
9AC_DEFUN(RTEMS_PROG_CXX,
10[
11AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
12AC_BEFORE([$0], [AC_PROG_CXX])dnl
13AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl
14
15dnl Only accept g++ and c++
16dnl NOTE: This might be too restrictive for native compilation
17AC_PATH_PROGS(CXX_FOR_TARGET, "$program_prefix"g++ "$program_prefix"c++)
18test -z "$CXX_FOR_TARGET" \
19  && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
20
21dnl backup
22rtems_save_CXX=$CXX
23rtems_save_CXXFLAGS=$CXXFLAGS
24
25dnl temporarily set CXX
26CXX=$CXX_FOR_TARGET
27
28AC_PROG_CXX_WORKS
29AC_PROG_CXX_GNU
30
31if test $ac_cv_prog_gxx = yes; then
32  GXX=yes
33dnl Check whether -g works, even if CXXFLAGS is set, in case the package
34dnl plays around with CXXFLAGS (such as to build both debugging and
35dnl normal versions of a library), tasteless as that idea is.
36  ac_test_CXXFLAGS="${CXXFLAGS+set}"
37  ac_save_CXXFLAGS="$CXXFLAGS"
38  CXXFLAGS=
39  AC_PROG_CXX_G
40  if test "$ac_test_CXXFLAGS" = set; then
41    CXXFLAGS="$ac_save_CXXFLAGS"
42  elif test $ac_cv_prog_cxx_g = yes; then
43    CXXFLAGS="-g -O2"
44  else
45    CXXFLAGS="-O2"
46  fi
47else
48  GXX=
49  test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
50fi
51
52rtems_cv_prog_gxx=$ac_cv_prog_gxx
53rtems_cv_prog_cxx_g=$ac_cv_prog_cxx_g
54rtems_cv_prog_cxx_works=$ac_cv_prog_cxx_works
55rtems_cv_prog_cxx_cross=$ac_cv_prog_cxx_cross
56
57CXX=$rtems_save_CXX
58CXXFLAGS=$rtems_save_CXXFLAGS
59
60dnl restore initial values
61unset ac_cv_prog_gxx
62unset ac_cv_prog_cc_g
63unset ac_cv_prog_cxx_works
64unset ac_cv_prog_cxx_cross
65])
Note: See TracBrowser for help on using the repository browser.