Changeset 2efdd08 in rtems for aclocal/prog-cxx.m4


Ignore:
Timestamp:
May 20, 1998, 5:06:57 PM (22 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
27dccae
Parents:
17a8d603
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • aclocal/prog-cxx.m4

    r17a8d603 r2efdd08  
    44dnl Check for target g++
    55dnl
    6 dnl Adaptation of autoconf-2.12's AC_PROG_CXX to rtems
    7 dnl
    8 dnl 98/02/10 Ralf Corsepius (corsepiu@faw.uni-ulm.de)
    9 dnl
    10  
     6dnl 98/05/20 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
     7dnl                             Completely reworked
     8
    119AC_DEFUN(RTEMS_PROG_CXX,
    1210[
    1311AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
    1412AC_BEFORE([$0], [AC_PROG_CXX])dnl
    15 AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++, gcc)
     13AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl
    1614
    17 RTEMS_PROG_CXX_WORKS
     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
    1829AC_PROG_CXX_GNU
    1930
     
    3849  test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
    3950fi
    40 CXX_FOR_TARGET=$CXX
     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
    4159
    4260dnl restore initial values
    43 unset CXX
    4461unset ac_cv_prog_gxx
     62unset ac_cv_prog_cc_g
     63unset ac_cv_prog_cxx_works
     64unset ac_cv_prog_cxx_cross
    4565])
    46 
    47 
    48 dnl Almost identical to AC_PROG_CXX_WORKS
    49 dnl Additional handling of malloc
    50 dnl NOTE: using newlib with a native compiler is cross-compiling, indeed.
    51 AC_DEFUN(RTEMS_PROG_CXX_WORKS,
    52 [AC_MSG_CHECKING([whether the target C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works])
    53 AC_LANG_SAVE
    54 AC_LANG_CPLUSPLUS
    55 
    56 dnl this fails if rtems uses newlib, because rtems has its own malloc which
    57 dnl is not available at bootstrap
    58 AC_TRY_COMPILER(
    59   [main(){return(0);}],
    60   rtems_cv_prog_cxx_works, rtems_cv_prog_cxx_cross)
    61 AC_LANG_RESTORE
    62 AC_MSG_RESULT($rtems_cv_prog_cxx_works)
    63 if test $rtems_cv_prog_cxx_works = no; then
    64   AC_MSG_ERROR([installation or configuration problem: target C++ compiler cannot create executables.])
    65 fi
    66 AC_MSG_CHECKING([whether the target C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler])
    67 AC_MSG_RESULT($rtems_cv_prog_cxx_cross)
    68 ])
Note: See TracChangeset for help on using the changeset viewer.