bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ansi-c++-opt: interoperability with libtool


From: Bruno Haible
Subject: ansi-c++-opt: interoperability with libtool
Date: Mon, 6 Jun 2011 00:36:39 +0200
User-agent: KMail/1.9.9

GNU gettext uses the gl_PROG_ANSI_CXX and also uses
  LT_LANG([C++])
On a machine with a broken C++ compiler and no working C++ preprocessor, then
despite of configure option --disable-c++, configure bails out like this:

  checking whether we are using the GNU C++ compiler... no
  checking whether : accepts -g... no
  checking dependency style of :... none
  checking how to run the C++ preprocessor... /lib/cpp
  configure: error: in 
`/home/haible/multibuild-1039/hpux11.31/gettext-0.18.1/gettext-tools':
  configure: error: C++ preprocessor "/lib/cpp" fails sanity check
  See `config.log' for more details
  configure: error: ./configure failed for gettext-tools

The reason is that LT_LANG([C++]) contains an invocation of AC_PROG_CXXCPP,
like this:

if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
    (test "X$CXX" != "Xg++"))) ; then
  AC_PROG_CXXCPP
else
  _lt_caught_CXX_error=yes
fi

This means, if CXX=":", libtool's macro assumes that a C++ compiler exists
and works. But if CXX="" or CXX="no" it skips the test for the preprocessor.

This changes fixes the situation, allowing configure to progress when
--disable-c++ is given:


2011-06-05  Bruno Haible  <address@hidden>

        ansi-c++-opt: Interoperability with libtool.
        * m4/ansi-c++.m4 (gl_PROG_ANSI_CXX): When a C++ compiler is not found,
        set the variable to "no", not to ":".
        * NEWS: Mention the change.

--- NEWS.orig   Mon Jun  6 00:27:57 2011
+++ NEWS        Mon Jun  6 00:27:46 2011
@@ -12,6 +12,9 @@
 
 Date        Modules         Changes
 
+2011-06-05  ansi-c++-opt    When a C++ compiler is not found, the variable CXX
+                            is now set to "no", not to ":".
+
 2011-05-11  group-member    The include file is changed from "group-member.h"
                             to <unistd.h>.
 
--- m4/ansi-c++.m4.orig Mon Jun  6 00:27:57 2011
+++ m4/ansi-c++.m4      Sun Jun  5 15:23:12 2011
@@ -1,4 +1,4 @@
-# ansi-c++.m4 serial 7
+# ansi-c++.m4 serial 8
 dnl Copyright (C) 2002-2003, 2005, 2010-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -41,7 +41,7 @@
 
 # gl_PROG_ANSI_CXX([ANSICXX_VARIABLE], [ANSICXX_CONDITIONAL])
 # Sets ANSICXX_VARIABLE to the name of a sufficiently ANSI C++ compliant
-# compiler, or to ":" if none is found.
+# compiler, or to "no" if none is found.
 # Defines the Automake condition ANSICXX_CONDITIONAL to true if such a compiler
 # was found, or to false if not.
 
@@ -51,7 +51,7 @@
   m4_if([$1], [CXX], [],
     [gl_save_CXX="$CXX"])
   if test "$CXX_CHOICE" = no; then
-    CXX=":"
+    CXX=no
   fi
   if test -z "$CXX"; then
     if test -n "$CCC"; then
@@ -62,7 +62,7 @@
                      [:])
     fi
   fi
-  if test "$CXX" != ":"; then
+  if test "$CXX" != no; then
     dnl Use a modified version of AC_PROG_CXX_WORKS that does not exit
     dnl upon failure.
     AC_MSG_CHECKING([whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works])
@@ -114,9 +114,9 @@
      CXX="$gl_save_CXX"])
   AC_SUBST([$1])
 
-  AM_CONDITIONAL([$2], [test "$$1" != ":"])
+  AM_CONDITIONAL([$2], [test "$$1" != no])
 
-  if test "$$1" != ":"; then
+  if test "$$1" != no; then
     dnl This macro invocation resolves an automake error:
     dnl /usr/local/share/automake-1.11/am/depend2.am: am__fastdepCXX does not 
appear in AM_CONDITIONAL
     dnl /usr/local/share/automake-1.11/am/depend2.am:   The usual way to 
define `am__fastdepCXX' is to add `AC_PROG_CXX'
-- 
In memoriam Eduard Lederer <http://de.wikipedia.org/wiki/Eduard_Lederer>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]