changeset 14180:0d67836109b5

ansi-c++-opt: skip C++ dependency style if C++ is unused * m4/ansi-c++.m4 (gl_PROG_ANSI_CXX): Avoid full-blown dependency tests when we know C++ compilation is not desired. Reported by Scott McCreary. Signed-off-by: Eric Blake <eblake@redhat.com>
author Eric Blake <eblake@redhat.com>
date Tue, 18 Jan 2011 21:49:45 -0700
parents c8f2d55830b2
children bceb1351a723
files ChangeLog m4/ansi-c++.m4
diffstat 2 files changed, 17 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-01-18  Eric Blake  <eblake@redhat.com>
+
+	ansi-c++-opt: skip C++ dependency style if C++ is unused
+	* m4/ansi-c++.m4 (gl_PROG_ANSI_CXX): Avoid full-blown dependency
+	tests when we know C++ compilation is not desired.
+	Reported by Scott McCreary.
+
 2011-01-18  Bruno Haible  <bruno@clisp.org>
 
 	*printf-posix: Avoid test failures. Make tests work on MacOS X, Cygwin.
--- a/m4/ansi-c++.m4
+++ b/m4/ansi-c++.m4
@@ -1,4 +1,4 @@
-# ansi-c++.m4 serial 6
+# ansi-c++.m4 serial 7
 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,
@@ -116,9 +116,13 @@
 
   AM_CONDITIONAL([$2], [test "$$1" != ":"])
 
-  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'
-  dnl /usr/local/share/automake-1.11/am/depend2.am:   to `configure.ac' and run `aclocal' and `autoconf' again.
-  _AM_DEPENDENCIES([CXX])
+  if test "$$1" != ":"; 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'
+    dnl /usr/local/share/automake-1.11/am/depend2.am:   to `configure.ac' and run `aclocal' and `autoconf' again.
+    _AM_DEPENDENCIES([CXX])
+  else
+    AM_CONDITIONAL([am__fastdepCXX], [false])
+  fi
 ])