From 2efdd08b402f42579548349e62c73c9fe999bc98 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 20 May 1998 17:06:57 +0000 Subject: 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 -[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. --- configure.in | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'configure.in') diff --git a/configure.in b/configure.in index 993479e61d..f8674f6e3f 100644 --- a/configure.in +++ b/configure.in @@ -165,18 +165,9 @@ else AC_MSG_ERROR(no) fi -dnl NOTE: host_os is automatically set by autoconf - -if [[ "${program_prefix}" = "NONE" ]] ; then - if [[ "${target}" = "${host}" ]] ; then - program_prefix= - else - program_prefix=${target}- - fi -fi +RTEMS_TOOL_PREFIX dnl check target cc -CC="$program_prefix"gcc RTEMS_PROG_CC dnl check if the compiler supports --specs RTEMS_GCC_SPECS @@ -190,25 +181,23 @@ if test "$RTEMS_USE_GCC272" != "yes" ; then RTEMS_USE_GCC272=yes fi fi +test "$rtems_cv_gcc_pipe" = "yes" && CC_FOR_TARGET="$CC_FOR_TARGET --pipe" dnl check for g++ if test "$RTEMS_HAS_CPLUSPLUS" = "yes"; then - CXX="$program_prefix"g++ RTEMS_PROG_CXX if test "$rtems_cv_prog_cc_cross" != "$rtems_cv_prog_cxx_cross"; then AC_MSG_ERROR([***] [Inconsistency in compiler configuration:] [Target C compiler and Target C++ compiler] [must both ether be cross compilers or native compilers] - [Hint: LD_LIBRARY_PATH ?] ) + [Hint: If building a posix bsp: LD_LIBRARY_PATH?] ) fi - AC_PATH_PROG(CXX_FOR_TARGET,"$program_prefix"g++,no) else CXX_FOR_TARGET="no" fi RTEMS_CANONICALIZE_TOOLS -test "$rtems_cv_gcc_pipe" = "yes" && CC_FOR_TARGET="$CC_FOR_TARGET --pipe" dnl check host cc AC_PROG_CC -- cgit v1.2.3