[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Configuring dejagnu without a C++ compiler
From: |
Nick Clifton |
Subject: |
Configuring dejagnu without a C++ compiler |
Date: |
30 Aug 2002 12:51:34 +0100 |
Hi Rob,
The current dejagnu configure script uses the AC_PROG_CXX macro to
check for a working C++ compiler. If such a compiler is not found,
then the configure will fail and dejagnu cannot be built. C++
however is not needed in order to build or run dejagnu, and it is
only used in one test in the testsuite.
I would like to propose a patch which provides an alternative
definition of the AC_PROG_CXX macro which does not fail if a
working compiler cannot be found. It would mean that the testsuite
(if run) would report a failed test, but this seems to be a
reasonable compromise.
Is this patch acceptable ?
Cheers
Nick
2002-08-30 Nick Clifton <address@hidden>
* acinclude.m4: Provide alternative definition of AC_PROG_CXX
which does not call AC_PROG_CXX_WORKS. This allows dejagnu to
be configured and built without a working C++ compiler.
Index: acinclude.m4
===================================================================
RCS file: /cvsroot/dejagnu/dejagnu/acinclude.m4,v
retrieving revision 1.3
diff -c -3 -p -w -r1.3 acinclude.m4
*** acinclude.m4 30 May 2001 15:35:50 -0000 1.3
--- acinclude.m4 30 Aug 2002 11:46:26 -0000
*************** fi
*** 108,110 ****
--- 108,155 ----
AC_SUBST(DOCBOOK)
])
+
+ # AC_PROG_CXX
+
+ # FIXME: We temporarily define our own version of AC_PROG_CXX.
+ # This is copied from autoconf 2.13, but does not call AC_PROG_CXX_WORKS.
+ # We do not need a C++ compiler in order to build dejagnu, so
+ # if we cannot find a working compiler it is not the end of
+ # the world. This is fixed in later versions of autoconf where
+ # there is different macro which will skip the link test entirely.
+
+ AC_DEFUN(AC_PROG_CXX,
+ [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
+ AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++ cl, gcc)
+
+ AC_PROG_CXX_GNU
+
+ if test $ac_cv_prog_gxx = yes; then
+ GXX=yes
+ else
+ GXX=
+ fi
+
+ dnl Check whether -g works, even if CXXFLAGS is set, in case the package
+ dnl plays around with CXXFLAGS (such as to build both debugging and
+ dnl normal versions of a library), tasteless as that idea is.
+ ac_test_CXXFLAGS="${CXXFLAGS+set}"
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS=
+ AC_PROG_CXX_G
+ if test "$ac_test_CXXFLAGS" = set; then
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ elif test $ac_cv_prog_cxx_g = yes; then
+ if test "$GXX" = yes; then
+ CXXFLAGS="-g -O2"
+ else
+ CXXFLAGS="-g"
+ fi
+ else
+ if test "$GXX" = yes; then
+ CXXFLAGS="-O2"
+ else
+ CXXFLAGS=
+ fi
+ fi
+ ])