This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Bootstrapping


Hello!

I've just attempted to compile libstdc++-2.90.6 on a very minimal
installation of RedHat Linux 6.0

Apart from the mentioned problem in "make install" there was another
problem. The "configure" script tests if the c++ compiler works.

Unfortunately, the c++ compiler cannot link executables until a c++
library is installed. This is a chicken and egg problem.

My solution was to specify "CC=gcc ./configure"
There is no real need in having another c++ library preinstalled.

You may find interesting the attached parts of configure.in and aclocal.m4
which I wrote for IceWM in order to circumvent a similar problem.

Pavel Roskin
dnl Checking for C in hope that it understands C++ too
ice_PROG_CXX_LIGHT

dnl Setting language to C++
AC_LANG_CPLUSPLUS
AC_PROG_CXX

dnl If both CC and CXX are GNU compilers, it is better to use CC
dnl for linking. Also check how to turn off RTTI and exception handling
if test x"$ac_cv_prog_gxx" != x; then
  AC_PROG_CC
  if test x"$ac_cv_prog_gcc" != x; then
    CXX_LINK=$CC
  fi
  ice_CXX_FLAG_ACCEPT(no_rtti, -fno-rtti)
  ice_CXX_FLAG_ACCEPT(no_exceptions, -fno-exceptions)
  if test x"$no_exceptions_ok" = xno; then
    ice_CXX_FLAG_ACCEPT(no_exceptions, -fno-handle-exceptions)
  fi
fi

if test x"$CXX_LINK" = x; then
  CXX_LINK=$CXX
fi

AC_SUBST(CXX_LINK)
dnl ice_PROG_CXX_LIGHT
dnl Checking for C in hope that it understands C++ too
dnl Useful for C++ programs which don't use C++ library at all
AC_DEFUN(ice_PROG_CXX_LIGHT, [
AC_REQUIRE([AC_PROG_CC])
AC_MSG_CHECKING([whether the C compiler ($CC) understands C++])
cat > conftest.C <<EOF
#ifdef __cplusplus
  int main() {return 0;}
#else
  bogus_command;
#endif
EOF
if AC_TRY_COMMAND(rm conftest; $CC -o conftest conftest.C; test -f ./conftest) >/dev/null 2>&1; then
  ice_prog_gxx=yes
  CXX=$CC
else
  ice_prog_gxx=no
fi
AC_MSG_RESULT($ice_prog_gxx)
])

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]