From unknown Sun Jun 22 11:45:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#7864: odd configure bug with dependency checking and conditional C++ support Resent-From: Eric Blake Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-automake@gnu.org Resent-Date: Wed, 19 Jan 2011 04:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 7864 X-GNU-PR-Package: automake X-GNU-PR-Keywords: To: 7864@debbugs.gnu.org, bug-gnulib@gnu.org X-Debbugs-Original-To: bug-automake@gnu.org, bug-gnulib Received: via spool by submit@debbugs.gnu.org id=B.129541227318275 (code B ref -1); Wed, 19 Jan 2011 04:45:02 +0000 Received: (at submit) by debbugs.gnu.org; 19 Jan 2011 04:44:33 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PfPuK-0004ki-3f for submit@debbugs.gnu.org; Tue, 18 Jan 2011 23:44:32 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PfPuF-0004kU-V4 for submit@debbugs.gnu.org; Tue, 18 Jan 2011 23:44:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PfQ1m-0002gx-IS for submit@debbugs.gnu.org; Tue, 18 Jan 2011 23:52:15 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:39585) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PfQ1m-0002gm-DF for submit@debbugs.gnu.org; Tue, 18 Jan 2011 23:52:14 -0500 Received: from [140.186.70.92] (port=42391 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PfQ1l-0001c9-2Z for bug-automake@gnu.org; Tue, 18 Jan 2011 23:52:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PfQ1j-0002gC-H5 for bug-automake@gnu.org; Tue, 18 Jan 2011 23:52:12 -0500 Received: from mx1.redhat.com ([209.132.183.28]:15084) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PfQ1j-0002g1-A9; Tue, 18 Jan 2011 23:52:11 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p0J4q9MG024913 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 18 Jan 2011 23:52:10 -0500 Received: from [10.3.113.109] (ovpn-113-109.phx2.redhat.com [10.3.113.109]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p0J4q8As020379; Tue, 18 Jan 2011 23:52:09 -0500 Message-ID: <4D366DF8.30902@redhat.com> Date: Tue, 18 Jan 2011 21:52:08 -0700 From: Eric Blake Organization: Red Hat User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7 MIME-Version: 1.0 X-Enigmail-Version: 1.1.2 OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig3163D97FA02DFCC0EF61AAC5" X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Spam-Score: -7.9 (-------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -7.9 (-------) This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig3163D97FA02DFCC0EF61AAC5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable http://lists.gnu.org/archive/html/bug-m4/2010-12/msg00001.html reported that on Haiku, builds of m4 fail with a strange error: checking dependency style of :... mkdir: cannot create directory `conftest.dir': File or Directory already exists cp: accessing `conftest.dir': Bad data =2E/configure: line 28036: cd: conftest.dir: Not a directory =2E/configure: line 28047: ./depcomp: No such file or directory none I traced it to the following: M4 is using gnulib's ansi-c++-opt module to enable support for optional C++ compilation support, and has this line in configure.ac to disable C++ by default: AC_DEFUN([gl_CXX_CHOICE_DEFAULT_NO]) Then, when gnulib finally gets around to invoking gl_PROG_ANSI_CXX, $CXX is : (the default for not using C++), and the macro does this (rather than directly calling AC_PROG_CXX which unconditionally requires a working C++ compiler: 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]) Yes, Bruno is exploiting undocumented automake internals. Normally, _AM_DEPENDENCIES is called so early in the build process that conftest.dir does not exist, but in m4's case, there is a leftover conftest.dir from a prior test because the C++ compiler isn't checked until about halfway through configure. Also, _AM_DEPENDENCIES normally assumes that $CXX is a valid compiler (since AC_PROG_CXX aborts configure if the required compiler is not available), but obviously, with Bruno's attempt to conditionalize things, CXX of : will flat out fail the dependency check. The end result is that halfway through configure, automake's attempt to check for C++ dependency mode even though C++ compilation was not requested ends up changing the working directory, so that the remainder of the configure script falls flat because all sorts of assumptions about running directly in $builddir have been violated. First - should autoconf's m4/depend.m4 be changed to use mkdir -p instead of mkdir, when creating conftest.dir? Should it be taught that if CXX is :, that the dependency check should be skipped? Also, should it be made more robust to cd failure, so that it does not leave the rest of the configure running in an unknown temporary sub-directory? Second - when gnulib is avoiding the C++ compiler, why is it still trying to determine the dependency mode? I'm applying this patch to gnulib to avoid the issue in the first place when CXX=3D: (but it still doesn't solve the automake issue of dependency checking not being robust to a pre-existing conftest.dir when C++ compilation is requested via =2E/configure --enable-cxx). =46rom 8a5019c9db43ed95ad763683761a0023bf536efb Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Tue, 18 Jan 2011 21:49:45 -0700 Subject: [PATCH] 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 --- ChangeLog | 7 +++++++ m4/ansi-c++.m4 | 16 ++++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 00f9ebe..263f1a0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-01-18 Eric Blake + + 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 *printf-posix: Avoid test failures. Make tests work on MacOS X, Cygwin.= diff --git a/m4/ansi-c++.m4 b/m4/ansi-c++.m4 index b25cf56..d6352ee 100644 --- 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, I= nc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -116,9 +116,13 @@ EOF AM_CONDITIONAL([$2], [test "$$1" !=3D ":"]) - 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" !=3D ":"; 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 ]) --=20 1.7.3.4 --=20 Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org --------------enig3163D97FA02DFCC0EF61AAC5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJNNm34AAoJEKeha0olJ0NqKOYH/02cPF2k5JbCVFlmu96jb0WA SSOCywNalP6+pTb+HcTcnWgcr3U3lncFHXsBeb0T3w8ZnpW54AJOqRUyM2QZGELZ 0Z559k9IaTP6h6/kmeNMF1zJutuBvwIsLZo8pLgjJQPeyFzwT4J9mjRpQyECH4qo ierVMWKv6kGA9qUhPHiyrAxaTlh+/SpSSDOVDqBrqMs2YWbgCEG65kzikLeEUtHH Xt6pyLym2pQaGXyi3RvPdxaM2B7OY9qP1tauVq0UbznhvXPYseyf+jxFz2H3ahl9 OeeCpB2617Y0pdRJamaYxE3GyBIkPKQ6uv5XwYr2aj7oqI2WeHuo/voj5YEBqL8= =mFxn -----END PGP SIGNATURE----- --------------enig3163D97FA02DFCC0EF61AAC5-- From unknown Sun Jun 22 11:45:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#7864: odd configure bug with dependency checking and conditional C++ support Resent-From: Ralf Wildenhues Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-automake@gnu.org Resent-Date: Wed, 19 Jan 2011 18:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7864 X-GNU-PR-Package: automake X-GNU-PR-Keywords: To: Eric Blake , automake-patches@gnu.org Cc: 7864@debbugs.gnu.org Received: via spool by 7864-submit@debbugs.gnu.org id=B7864.129546036628719 (code B ref 7864); Wed, 19 Jan 2011 18:07:01 +0000 Received: (at 7864) by debbugs.gnu.org; 19 Jan 2011 18:06:06 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PfcQ1-0007T8-SA for submit@debbugs.gnu.org; Wed, 19 Jan 2011 13:06:06 -0500 Received: from mailout-de.gmx.net ([213.165.64.22]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1PfcPg-0007SO-Bf for 7864@debbugs.gnu.org; Wed, 19 Jan 2011 13:06:05 -0500 Received: (qmail invoked by alias); 19 Jan 2011 18:13:32 -0000 Received: from xdsl-89-0-138-36.netcologne.de (EHLO localhost.localdomain) [89.0.138.36] by mail.gmx.net (mp006) with SMTP; 19 Jan 2011 19:13:32 +0100 X-Authenticated: #13673931 X-Provags-ID: V01U2FsdGVkX19S4hZwG4VSKssoOG0WYq5uJW6UVHiUzXlFzPZuxI oyKj/NFTOkt8ws Received: from ralf by localhost.localdomain with local (Exim 4.69) (envelope-from ) id 1PfcXD-0001vd-RK; Wed, 19 Jan 2011 19:13:31 +0100 Date: Wed, 19 Jan 2011 19:13:31 +0100 From: Ralf Wildenhues Message-ID: <20110119181331.GB7245@gmx.de> Mail-Followup-To: Eric Blake , automake-patches@gnu.org, 7864@debbugs.gnu.org References: <4D366DF8.30902@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D366DF8.30902@redhat.com> Organization: Institute for Numerical Simulation, University of Bonn User-Agent: Mutt/1.5.20 (2010-08-04) X-Y-GMX-Trusted: 0 X-Spam-Score: -2.8 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.8 (--) [ adding automake-patches, dropping bug-gnulib ] Hi Eric, thanks for the report! * Eric Blake wrote on Wed, Jan 19, 2011 at 05:52:08AM CET: > checking dependency style of :... mkdir: cannot create directory > `conftest.dir': File or Directory already exists > cp: accessing `conftest.dir': Bad data > ./configure: line 28036: cd: conftest.dir: Not a directory > ./configure: line 28047: ./depcomp: No such file or directory > none > First - should autoconf's m4/depend.m4 be changed to use mkdir -p > instead of mkdir, when creating conftest.dir? No, that won't help if it is a file, not a directory. > Should it be taught that > if CXX is :, that the dependency check should be skipped? Maybe, but that is irrelevant for the actual bug AFAICS. > Also, should > it be made more robust to cd failure, so that it does not leave the rest > of the configure running in an unknown temporary sub-directory? This is all that should be needed in Automake. I'll be pushing this to maint in a little bit. Cheers, Ralf Allow _AM_DEPENDENCIES to be used later in configure. * m4/depend.m4 (_AM_DEPENDENCIES): Remove a previously existing conftest.dir before recreating it. Fixes bug#7864. Report by Eric Blake, from report by Scott McCreary against M4. diff --git a/m4/depend.m4 b/m4/depend.m4 index 714bc9c..a5726c6 100644 --- a/m4/depend.m4 +++ b/m4/depend.m4 @@ -1,12 +1,12 @@ ## -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, -# 2010 Free Software Foundation, Inc. +# 2010, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 12 +# serial 13 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, @@ -46,6 +46,7 @@ AC_CACHE_CHECK([dependency style of $depcc], # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. + rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. From unknown Sun Jun 22 11:45:12 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Eric Blake Subject: bug#7864: closed (Re: bug#7864: odd configure bug with dependency checking and conditional C++ support) Message-ID: References: <20110119191004.GH7245@gmx.de> <4D366DF8.30902@redhat.com> X-Gnu-PR-Message: they-closed 7864 X-Gnu-PR-Package: automake Reply-To: 7864@debbugs.gnu.org Date: Wed, 19 Jan 2011 19:03:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1295463782-1068-1" This is a multi-part message in MIME format... ------------=_1295463782-1068-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #7864: odd configure bug with dependency checking and conditional C++ suppo= rt which was filed against the automake package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 7864@debbugs.gnu.org. --=20 7864: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D7864 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1295463782-1068-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 7864-done) by debbugs.gnu.org; 19 Jan 2011 19:02:25 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PfdIX-0000GS-29 for submit@debbugs.gnu.org; Wed, 19 Jan 2011 14:02:25 -0500 Received: from mailout-de.gmx.net ([213.165.64.22]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1PfdIU-0000GG-J1 for 7864-done@debbugs.gnu.org; Wed, 19 Jan 2011 14:02:23 -0500 Received: (qmail invoked by alias); 19 Jan 2011 19:10:10 -0000 Received: from xdsl-89-0-138-36.netcologne.de (EHLO localhost.localdomain) [89.0.138.36] by mail.gmx.net (mp010) with SMTP; 19 Jan 2011 20:10:10 +0100 X-Authenticated: #13673931 X-Provags-ID: V01U2FsdGVkX19JG2BTmU9Jr4SlPBpry8L505nbep/quNFdz7iG9L +E4DHDu2iak0kV Received: from ralf by localhost.localdomain with local (Exim 4.69) (envelope-from ) id 1PfdPx-0002br-1I; Wed, 19 Jan 2011 20:10:05 +0100 Date: Wed, 19 Jan 2011 20:10:05 +0100 From: Ralf Wildenhues To: Eric Blake , 7864-done@debbugs.gnu.org Subject: Re: bug#7864: odd configure bug with dependency checking and conditional C++ support Message-ID: <20110119191004.GH7245@gmx.de> References: <4D366DF8.30902@redhat.com> <20110119181331.GB7245@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110119181331.GB7245@gmx.de> Organization: Institute for Numerical Simulation, University of Bonn User-Agent: Mutt/1.5.20 (2010-08-04) X-Y-GMX-Trusted: 0 X-Spam-Score: -2.8 (--) X-Debbugs-Envelope-To: 7864-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.8 (--) Fixed by v1.11-293-gd652a1c. ------------=_1295463782-1068-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 19 Jan 2011 04:44:33 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PfPuK-0004ki-3f for submit@debbugs.gnu.org; Tue, 18 Jan 2011 23:44:32 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PfPuF-0004kU-V4 for submit@debbugs.gnu.org; Tue, 18 Jan 2011 23:44:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PfQ1m-0002gx-IS for submit@debbugs.gnu.org; Tue, 18 Jan 2011 23:52:15 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:39585) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PfQ1m-0002gm-DF for submit@debbugs.gnu.org; Tue, 18 Jan 2011 23:52:14 -0500 Received: from [140.186.70.92] (port=42391 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PfQ1l-0001c9-2Z for bug-automake@gnu.org; Tue, 18 Jan 2011 23:52:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PfQ1j-0002gC-H5 for bug-automake@gnu.org; Tue, 18 Jan 2011 23:52:12 -0500 Received: from mx1.redhat.com ([209.132.183.28]:15084) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PfQ1j-0002g1-A9; Tue, 18 Jan 2011 23:52:11 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p0J4q9MG024913 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 18 Jan 2011 23:52:10 -0500 Received: from [10.3.113.109] (ovpn-113-109.phx2.redhat.com [10.3.113.109]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p0J4q8As020379; Tue, 18 Jan 2011 23:52:09 -0500 Message-ID: <4D366DF8.30902@redhat.com> Date: Tue, 18 Jan 2011 21:52:08 -0700 From: Eric Blake Organization: Red Hat User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7 MIME-Version: 1.0 To: bug-automake@gnu.org, bug-gnulib Subject: odd configure bug with dependency checking and conditional C++ support X-Enigmail-Version: 1.1.2 OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig3163D97FA02DFCC0EF61AAC5" X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Spam-Score: -7.9 (-------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -7.9 (-------) This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig3163D97FA02DFCC0EF61AAC5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable http://lists.gnu.org/archive/html/bug-m4/2010-12/msg00001.html reported that on Haiku, builds of m4 fail with a strange error: checking dependency style of :... mkdir: cannot create directory `conftest.dir': File or Directory already exists cp: accessing `conftest.dir': Bad data =2E/configure: line 28036: cd: conftest.dir: Not a directory =2E/configure: line 28047: ./depcomp: No such file or directory none I traced it to the following: M4 is using gnulib's ansi-c++-opt module to enable support for optional C++ compilation support, and has this line in configure.ac to disable C++ by default: AC_DEFUN([gl_CXX_CHOICE_DEFAULT_NO]) Then, when gnulib finally gets around to invoking gl_PROG_ANSI_CXX, $CXX is : (the default for not using C++), and the macro does this (rather than directly calling AC_PROG_CXX which unconditionally requires a working C++ compiler: 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]) Yes, Bruno is exploiting undocumented automake internals. Normally, _AM_DEPENDENCIES is called so early in the build process that conftest.dir does not exist, but in m4's case, there is a leftover conftest.dir from a prior test because the C++ compiler isn't checked until about halfway through configure. Also, _AM_DEPENDENCIES normally assumes that $CXX is a valid compiler (since AC_PROG_CXX aborts configure if the required compiler is not available), but obviously, with Bruno's attempt to conditionalize things, CXX of : will flat out fail the dependency check. The end result is that halfway through configure, automake's attempt to check for C++ dependency mode even though C++ compilation was not requested ends up changing the working directory, so that the remainder of the configure script falls flat because all sorts of assumptions about running directly in $builddir have been violated. First - should autoconf's m4/depend.m4 be changed to use mkdir -p instead of mkdir, when creating conftest.dir? Should it be taught that if CXX is :, that the dependency check should be skipped? Also, should it be made more robust to cd failure, so that it does not leave the rest of the configure running in an unknown temporary sub-directory? Second - when gnulib is avoiding the C++ compiler, why is it still trying to determine the dependency mode? I'm applying this patch to gnulib to avoid the issue in the first place when CXX=3D: (but it still doesn't solve the automake issue of dependency checking not being robust to a pre-existing conftest.dir when C++ compilation is requested via =2E/configure --enable-cxx). =46rom 8a5019c9db43ed95ad763683761a0023bf536efb Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Tue, 18 Jan 2011 21:49:45 -0700 Subject: [PATCH] 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 --- ChangeLog | 7 +++++++ m4/ansi-c++.m4 | 16 ++++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 00f9ebe..263f1a0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-01-18 Eric Blake + + 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 *printf-posix: Avoid test failures. Make tests work on MacOS X, Cygwin.= diff --git a/m4/ansi-c++.m4 b/m4/ansi-c++.m4 index b25cf56..d6352ee 100644 --- 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, I= nc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -116,9 +116,13 @@ EOF AM_CONDITIONAL([$2], [test "$$1" !=3D ":"]) - 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" !=3D ":"; 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 ]) --=20 1.7.3.4 --=20 Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org --------------enig3163D97FA02DFCC0EF61AAC5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJNNm34AAoJEKeha0olJ0NqKOYH/02cPF2k5JbCVFlmu96jb0WA SSOCywNalP6+pTb+HcTcnWgcr3U3lncFHXsBeb0T3w8ZnpW54AJOqRUyM2QZGELZ 0Z559k9IaTP6h6/kmeNMF1zJutuBvwIsLZo8pLgjJQPeyFzwT4J9mjRpQyECH4qo ierVMWKv6kGA9qUhPHiyrAxaTlh+/SpSSDOVDqBrqMs2YWbgCEG65kzikLeEUtHH Xt6pyLym2pQaGXyi3RvPdxaM2B7OY9qP1tauVq0UbznhvXPYseyf+jxFz2H3ahl9 OeeCpB2617Y0pdRJamaYxE3GyBIkPKQ6uv5XwYr2aj7oqI2WeHuo/voj5YEBqL8= =mFxn -----END PGP SIGNATURE----- --------------enig3163D97FA02DFCC0EF61AAC5-- ------------=_1295463782-1068-1--