From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 13 17:30:00 2010 Received: (at submit) by debbugs.gnu.org; 13 Dec 2010 22:30:00 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PSGu8-0000Uf-4B for submit@debbugs.gnu.org; Mon, 13 Dec 2010 17:30:00 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PSGu5-0000UT-BN for submit@debbugs.gnu.org; Mon, 13 Dec 2010 17:29:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PSH00-0000Ql-48 for submit@debbugs.gnu.org; Mon, 13 Dec 2010 17:36:09 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:58725) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PSGzz-0000Qe-RV for submit@debbugs.gnu.org; Mon, 13 Dec 2010 17:36:04 -0500 Received: from [140.186.70.92] (port=43068 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PSGzr-0001QT-8S for bug-automake@gnu.org; Mon, 13 Dec 2010 17:36:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PSGzj-0000KG-5u for bug-automake@gnu.org; Mon, 13 Dec 2010 17:35:55 -0500 Received: from mail-bw0-f43.google.com ([209.85.214.43]:54418) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PSGzj-0000K2-1L for bug-automake@gnu.org; Mon, 13 Dec 2010 17:35:47 -0500 Received: by bwz14 with SMTP id 14so23255bwz.30 for ; Mon, 13 Dec 2010 14:35:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :user-agent:mime-version:content-type:message-id; bh=hE8ElxHv30pO9z1GRAJ2pVO38cY/RKMFI9WB/1BKLCE=; b=NJr4vSK51jdIMmwkEaZ/FNswPG+7Rnp4+xqS9e5mT9b9WKhQpJilH+T1g41f4Dskh2 wPgxZDWVa/4gl8Ey9x1p3QP4+tyrvGxa/hZESVTmF0Zs8EMZBXahGevSlnXt4ovTtNtE XAnE5RB2K04AJZO+mMZHZaCgZWOtfVwIHvGrc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:mime-version:content-type :message-id; b=VYYCbf2flsVqxXPP1utNtTo9lVlCC+20c7+QoxML9/HWVC48bJwxrrH7t+mnXlIa0T bvKP/q6q6KY2LzBWBEzQEloZXWA7eC3O6lAszzy8U4FM2cqoxPtA6y4N611CWNeXig5W lm9rSI9bZJ5+l8sPregyQOIplHSIcGdUsKSY8= Received: by 10.204.82.3 with SMTP id z3mr4140651bkk.179.1292279746172; Mon, 13 Dec 2010 14:35:46 -0800 (PST) Received: from bigio.localnet (host76-38-dynamic.50-82-r.retail.telecomitalia.it [82.50.38.76]) by mx.google.com with ESMTPS id a4sm353284bka.7.2010.12.13.14.35.44 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 13 Dec 2010 14:35:45 -0800 (PST) From: Stefano Lattarini To: bug-automake@gnu.org Subject: AC_LIBSOURCE doesn't fail as it should if AC_OUTPUT is not used Date: Mon, 13 Dec 2010 23:35:32 +0100 User-Agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; ) MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_0+pBNYrQBjIzB7H" Message-Id: <201012132335.32752.stefano.lattarini@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Spam-Score: -5.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: -5.9 (-----) --Boundary-00=_0+pBNYrQBjIzB7H Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit If configure.ac does not contain a call to AC_OUTPUT, Automake does not fail as expected when file(s) specified in calls to macros AC_LIBSOURCE and/or AC_LIBSOURCES do not exist. See the attached test script. Now, while the lack of AC_OUTPUT in configure.ac is almost surely a user error, IMHO it shouldn't prevent Automake from warning about other errors (in this case, the non-existence of files specified in calls to macros AC_LIBSOURCE and AC_LIBSOURCES). Regards, Stefano --Boundary-00=_0+pBNYrQBjIzB7H Content-Type: text/plain; charset="us-ascii"; name="libsource-no-ac_output.test" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="libsource-no-ac_output.test" #! /bin/sh # Nonexistent source for AC_LIBSOURCE should cause Automake to fail. . ./defs || Exit 1 set -e cat >> configure.in << 'END' AC_PROG_CC AC_PROG_RANLIB AC_LIBSOURCE([foobar.c]) AC_LIBSOURCES([bazquux.c]) END cat > Makefile.am << 'END' noinst_LIBRARIES = libtu.a libtu_a_SOURCES = libtu_a_LIBADD = $(LIBOBJS) END $ACLOCAL AUTOMAKE_fails grep 'configure\.in:.*required file.*foobar\.c.*' stderr grep 'configure\.in:.*required file.*bazquux\.c.*' stderr : --Boundary-00=_0+pBNYrQBjIzB7H-- From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 14 02:05:01 2010 Received: (at control) by debbugs.gnu.org; 14 Dec 2010 07:05:01 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PSOwW-0003yX-LR for submit@debbugs.gnu.org; Tue, 14 Dec 2010 02:05:01 -0500 Received: from mailout-de.gmx.net ([213.165.64.23] helo=mail.gmx.net) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1PSOwT-0003yK-Vf for control@debbugs.gnu.org; Tue, 14 Dec 2010 02:04:59 -0500 Received: (qmail invoked by alias); 14 Dec 2010 07:11:09 -0000 Received: from xdsl-89-0-144-66.netcologne.de (EHLO localhost.localdomain) [89.0.144.66] by mail.gmx.net (mp057) with SMTP; 14 Dec 2010 08:11:09 +0100 X-Authenticated: #13673931 X-Provags-ID: V01U2FsdGVkX1/pD+94kA/pz1MoNIKnD3rDPQxOA0jZgSroBq3eFz OA+VyUx45uea2S Received: from ralf by localhost.localdomain with local (Exim 4.69) (envelope-from ) id 1PSP2T-0000Ja-90; Tue, 14 Dec 2010 08:11:09 +0100 Date: Tue, 14 Dec 2010 08:11:09 +0100 From: Ralf Wildenhues To: Stefano Lattarini Subject: Re: bug#7635: AC_LIBSOURCE doesn't fail as it should if AC_OUTPUT is not used Message-ID: <20101214071109.GF20657@gmx.de> References: <201012132335.32752.stefano.lattarini@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201012132335.32752.stefano.lattarini@gmail.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.7 (--) X-Debbugs-Envelope-To: control Cc: 7635@debbugs.gnu.org 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.7 (--) tags 7635 wontfix close 7635 thanks * Stefano Lattarini wrote on Mon, Dec 13, 2010 at 11:35:32PM CET: > If configure.ac does not contain a call to AC_OUTPUT, Automake > does not fail as expected when file(s) specified in calls to > macros AC_LIBSOURCE and/or AC_LIBSOURCES do not exist. See the > attached test script. > > Now, while the lack of AC_OUTPUT in configure.ac is almost surely > a user error, IMHO it shouldn't prevent Automake from warning about > other errors (in this case, the non-existence of files specified in > calls to macros AC_LIBSOURCE and AC_LIBSOURCES). Sorry, but I think the mechanism is fully adequate for any real-life situation: the developer will first see that configure won't produce any files, fix that bug by adding AC_OUTPUT, then see the other automake error. We don't need to ensure that all errors are non-followup ones, that is impossible in practice. I'm thus closing this bug as invalid. Thanks for the report, Ralf From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 14 09:29:45 2010 Received: (at 7635) by debbugs.gnu.org; 14 Dec 2010 14:29:45 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PSVsu-0007yE-MR for submit@debbugs.gnu.org; Tue, 14 Dec 2010 09:29:45 -0500 Received: from mail-wy0-f172.google.com ([74.125.82.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PSVsr-0007y1-IF for 7635@debbugs.gnu.org; Tue, 14 Dec 2010 09:29:42 -0500 Received: by wyf23 with SMTP id 23so565087wyf.3 for <7635@debbugs.gnu.org>; Tue, 14 Dec 2010 06:35:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :user-agent:cc:references:in-reply-to:mime-version:content-type :content-transfer-encoding:message-id; bh=D4lNfo0QX777/yDoQRMQaQpTk2mISm1A9gkUmbnnY6M=; b=GeidQE9TfHnIrfYwWVhf/dnN9os1Yj2GSF9Yyx0EnpkY07ohlMJ8MAw8DLIyHw9ovW fY/9EBafVOp1Q/rNhMdNiAzdXt75mW53YA2Q9/2T45Ayx3toZ2Vd8Nnb/LzJHNRLnX/I TDnDHKON8eeAIxwnGC6HTFOtSSNj8wE4bQw0I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:content-transfer-encoding:message-id; b=gPykeIGMM/gYwG9gv9bOmZEVo1TGBGuUcHi+yY4qRfI1doCexrs8kRoIsUFW+zKJI3 D1MiW0WLGqv+nlNd7pUqALLJv3jnMwt0RaXA3gEBLKgEbWe5fsFXBxyNLNxVr/Z2UdTN xvsUf64Dpg8HjPhr0NJ35lr23yvmiXFmd80l4= Received: by 10.216.155.205 with SMTP id j55mr4669972wek.90.1292337354531; Tue, 14 Dec 2010 06:35:54 -0800 (PST) Received: from bigio.localnet (host130-83-dynamic.24-79-r.retail.telecomitalia.it [79.24.83.130]) by mx.google.com with ESMTPS id n18sm107046wee.16.2010.12.14.06.35.52 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 14 Dec 2010 06:35:53 -0800 (PST) From: Stefano Lattarini To: Ralf Wildenhues Subject: Re: bug#7635: AC_LIBSOURCE doesn't fail as it should if AC_OUTPUT is not used Date: Tue, 14 Dec 2010 15:35:33 +0100 User-Agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; ) References: <201012132335.32752.stefano.lattarini@gmail.com> <20101214071109.GF20657@gmx.de> In-Reply-To: <20101214071109.GF20657@gmx.de> MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <201012141535.33932.stefano.lattarini@gmail.com> X-Spam-Score: -4.8 (----) X-Debbugs-Envelope-To: 7635 Cc: 7635@debbugs.gnu.org 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: -4.4 (----) Hello automakers. On Tuesday 14 December 2010, Ralf Wildenhues wrote: > tags 7635 wontfix > close 7635 > thanks > Even if the bug is closed, I'm following up this thread anyway, since I'd like to share (and put on the trial of peer review) my explanation of why automake currently behaves the way it does w.r.t. AC_LIBSOURCE. > * Stefano Lattarini wrote on Mon, Dec 13, 2010 at 11:35:32PM CET: > > If configure.ac does not contain a call to AC_OUTPUT, Automake > > does not fail as expected when file(s) specified in calls to > > macros AC_LIBSOURCE and/or AC_LIBSOURCES do not exist. See the > > attached test script. > > OK, maybe I've understood why this happens. AC_LIBSOURCE is basically a "dummy" macro, whose only purpose is to be traced by automake, which can then use the traces to automatically distribute any source file listed in AC_LIBSOURCE: $ cat /usr/share/autoconf/autoconf/general.m4 ... # AC_LIBSOURCE(FILE-NAME) # ----------------------- # Announce we might need the file `FILE-NAME'. m4_define([AC_LIBSOURCE], []) ... On the other hand, AC_LIBOBJ actually calls AC_SUBST on `LIBOBJS': $ cat /usr/share/autoconf/autoconf/general.m4 ... # _AC_LIBOBJ(FILE-NAME-NOEXT, ACTION-IF-INDIR) # -------------------------------------------- # We need `FILE-NAME-NOEXT.o', save this into `LIBOBJS'. m4_define([_AC_LIBOBJ], [case " $LIB@&t@OBJS " in *" $1.$ac_objext "* ) ;; *) AC_SUBST([LIB@&t@OBJS], ["$LIB@&t@OBJS $1.$ac_objext"]) ;; esac ]) # AC_LIBOBJ(FILE-NAME-NOEXT) # -------------------------- # We need `FILE-NAME-NOEXT.o', save this into `LIBOBJS'. AC_DEFUN([AC_LIBOBJ], [_AC_LIBOBJ([$1])]dnl [AS_LITERAL_WORD_IF([$1], [AC_LIBSOURCE([$1.c])], [AC_DIAGNOSE([syntax], [$0($1): you should use literals])])]) ... Now, the check that all the files which *might* end up in $(LIBOBJS) truly exist[1][2] is performed by Automake if *and only if* the `@LIBOBJS@' token appears (directly or indirectly) in some proper `_LIBADD' or `_LDADD' variable[3]. [1] or are listed in the $(BUILT_SOURCES) special variable [2] the check is performed in the subroutine `automake:handle_LIBOBJS()' [3] see code in subroutine `automake:handle_lib_objects()' If we use AC_LIBSOURCE in configure.ac without ever calling AC_LIBOBJ (or at least AC_SUBST([LIBOBJS])), $(LIBOBJS) get not defined to @LIBOBJS@, so that even a use of: foo_LDADD = $(LIBOBJS) in Makefile.am will not trigger the check described above[1], because automake doesn't see the token `@LIBOBS@' in the expanded value of $(foo_LIBADD). [1] i.e., the check that all the arguments passed to AC_LIBSOURCE refer to existing files or to files listed in BUILT_SOURCES An example might help to clarify the matter: --- Example --- $ cat > configure.ac <<'END' AC_INIT([foo], [1.0]) AM_INIT_AUTOMAKE([foreign]) AC_CONFIG_FILES([Makefile]) AC_PROG_CC AC_LIBSOURCE([foobar.c]) END $ ls -l foobar.c ls: cannot access foobar.c: No such file or directory $ aclocal $ cat > Makefile.am <<'END' noinst_PROGRAMS = foo foo_SOURCES = foo_LDADD = $(LIBOBJS) END $ automake -a; echo exit_status = $? # gives no error exit_status = 0 $ cat > Makefile.am <<'END' noinst_PROGRAMS = foo foo_SOURCES = foo_LDADD = @LIBOBJS@ END $ automake -a # now it will error out, as expected Makefile.am:3: required file `./foobar.c' not found exit_status = 1 $ cat > Makefile.am <<'END' extra_libs = @LIBOBJS@ noinst_PROGRAMS = foo foo_SOURCES = foo_LDADD = $(extra_libs) END $ automake -a # errors out again, as it's smart enough to follow # indirections in variables' definitions Makefile.am:1: required file `./foobar.c' not found exit_status = 1 # now try with our original Makefile.am, while having # `LIBOBJS' AC_SUBST'd $ cat > Makefile.am <<'END' noinst_PROGRAMS = foo foo_SOURCES = foo_LDADD = $(LIBOBJS) END $ echo 'AC_SUBST([LIBOBJS])' >> configure.ac $ rm -rf autom4te*.cache && aclocal # just to be sure $ automake configure.ac:6: required file `./foobar.c' not found --- End Example --- At this point, the only question remaning is: why does AC_LIBSOURCE warn about non-existing sources when AC_OUTPUT is used, even if AC_LIBOBJ and AC_SUBST([LIBOBJS]) are never called directly? And now the answer is pretty easy: AC_OUTPUT *does* end up calling (through some indirections) AC_SUBST on `LIBOBJS'! Let's see how. AC_OUTPUT calls the macro AC_OUTPUT_COMMANDS_PRE (see code in `autoconf/status.m4'). And we have: $ cat /usr/share/autoconf/autoconf/status.m4 ... # AC_OUTPUT_COMMANDS_PRE # ---------------------- # A *variable* in which we append all the actions that must be # performed before *creating* config.status. For a start, clean # up all the LIBOBJ mess. m4_define([AC_OUTPUT_COMMANDS_PRE], [_AC_LIBOBJS_NORMALIZE ]) ... and: $ cat /usr/share/autoconf/autoconf/general.m4 ... # _AC_LIBOBJS_NORMALIZE # --------------------- # Clean up LIBOBJS and LTLIBOBJS so that they work with 1. ac_objext, # 2. Automake's ANSI2KNR, 3. Libtool, 4. combination of the three. # Used with AC_CONFIG_COMMANDS_PRE. AC_DEFUN([_AC_LIBOBJS_NORMALIZE], [ac_libobjs= ac_ltlibobjs= ... AC_SUBST([LIB@&t@OBJS], [$ac_libobjs]) AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs]) ]) ... See? "AC_SUBST([LIB@&t@OBJS], [$ac_libobjs])". Bingo! Regards, Stefano From unknown Wed Jun 18 23:15:25 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 12 Jan 2011 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator