GNU logs - #21106, boring messages


Message sent to bug-automake@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#21106: AC_SUBST([FOO_LIB], ['libfoo.la']) breaks dependency checker
Resent-From: Stanislav Brabec <sbrabec@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-automake@HIDDEN
Resent-Date: Tue, 21 Jul 2015 20:18:02 +0000
Resent-Message-ID: <handler.21106.B.143750984116948 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 21106
X-GNU-PR-Package: automake
X-GNU-PR-Keywords: 
To: 21106 <at> debbugs.gnu.org
X-Debbugs-Original-To: bug-automake@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.143750984116948
          (code B ref -1); Tue, 21 Jul 2015 20:18:02 +0000
Received: (at submit) by debbugs.gnu.org; 21 Jul 2015 20:17:21 +0000
Received: from localhost ([127.0.0.1]:55695 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ZHdya-0004PI-N1
	for submit <at> debbugs.gnu.org; Tue, 21 Jul 2015 16:17:21 -0400
Received: from eggs.gnu.org ([208.118.235.92]:47058)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <sbrabec@HIDDEN>) id 1ZHdyX-0004P4-IC
 for submit <at> debbugs.gnu.org; Tue, 21 Jul 2015 16:17:19 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <sbrabec@HIDDEN>) id 1ZHdyR-0002RE-Di
 for submit <at> debbugs.gnu.org; Tue, 21 Jul 2015 16:17:12 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20 autolearn=disabled
 version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:58051)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <sbrabec@HIDDEN>) id 1ZHdyR-0002RA-BM
 for submit <at> debbugs.gnu.org; Tue, 21 Jul 2015 16:17:11 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:60553)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <sbrabec@HIDDEN>) id 1ZHdyQ-0000OP-3Q
 for bug-automake@HIDDEN; Tue, 21 Jul 2015 16:17:11 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <sbrabec@HIDDEN>) id 1ZHdyL-0002Pa-GQ
 for bug-automake@HIDDEN; Tue, 21 Jul 2015 16:17:10 -0400
Received: from cantor2.suse.de ([195.135.220.15]:54760 helo=mx2.suse.de)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <sbrabec@HIDDEN>) id 1ZHdyL-0002PU-5t
 for bug-automake@HIDDEN; Tue, 21 Jul 2015 16:17:05 -0400
X-Virus-Scanned: by amavisd-new at test-mx.suse.de
Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254])
 by mx2.suse.de (Postfix) with ESMTP id 7B05FAC26
 for <bug-automake@HIDDEN>; Tue, 21 Jul 2015 20:17:03 +0000 (UTC)
Message-ID: <55AEA8BF.6040102@HIDDEN>
Date: Tue, 21 Jul 2015 22:17:03 +0200
From: Stanislav Brabec <sbrabec@HIDDEN>
Organization: SUSE Linux, s. r. o.
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
 rv:31.0) Gecko/20100101 Thunderbird/31.7.0
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="------------080704030105020601070409"
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no
 timestamps) [generic]
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.1 (----)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.1 (----)

This is a multi-part message in MIME format.
--------------080704030105020601070409
Content-Type: text/plain; charset=iso-8859-2
Content-Transfer-Encoding: quoted-printable

I just wanted to make an option to link the program either against
in-package instance or external instance.

To make things as easy as possible, I wanted to define FOO_LIB in
configure.ac either as 'libfoo.la' or '-lfoo' using e. g.:

AC_SUBST([FOO_LIB], ['libfoo.la'])

and then in Makefile.am use just:

myprogram_LDADD =3D $(FOO_LIB)

Everything works well except parallel build. It seems that dependency
checker is not able to see such dependency, and if I try to compile the
project with "make -j7", it fails:

libtool:   error: cannot find the library 'libfoo.la' or unhandled argume=
nt 'libfoo.la'

Plain "make" works.

Is it a bug or expected behavior?

Is there any better way how to do such things than use

if USE_BUILTIN_LIBFOO
myprogram_LDADD =3D libfoo.la
else
myprogram_LDADD =3D -lfoo
endif

everywhere I need to link with libfoo?

Attaching a minimalistic example.

--=20
Best Regards / S pozdravem,

Stanislav Brabec
software developer
---------------------------------------------------------------------
SUSE LINUX, s. r. o.                         e-mail: sbrabec@HIDDEN
Lihovarsk=E1 1060/12                            tel: +49 911 7405384547
190 00 Praha 9                                 fax:  +420 284 084 001
Czech Republic                                    http://www.suse.cz/
PGP: 830B 40D5 9E05 35D8 5E27 6FA3 717C 209F A04F CD76

--------------080704030105020601070409
Content-Type: application/gzip;
 name="libfoo.tar.gz"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="libfoo.tar.gz"

H4sIADKorlUAA+2Za2+jRhSG83XnV6DtSutIDWFuXJTuqixxEqs4pNhRP7grRLBj09oQAV5t
UvW/dwwksU2cxF2H1N3zKBIDA57h8p73nIm8f+Z/PRn4/UGSyphTqu6Pw4vLON7ZHIpAZSzf
Cpa3CqZkBxPOKSdU49qOgglW2Y70dYNzWMk0zfxETKWOsf6DUEWaZOFk8AEz8ewVQ8Vc5qpO
NF28FyR6/cVeVTZ0TDRV19VZb7D62te+M+A5FGLff9ExZhrXOBdbQhmn+T6+jwd5LFjUP8Ua
2ZH4i86q5Fb/6UXiXwyCR84TEfKR31kObltC+f4rJtD2/xxchuOB7E++eYx14r+qYfH+GaYU
4n8dLMd/rmKZMUIJUw29Ev+5SmXOFEoIx1ol/i9e+9p3BjyHUv+blHuFe/0/HP8pZ0v654QI
/deiye88/l+EkXfmOseu2e5IH6TJ9VUSDxN/gtBd0+s4567VXOiWg7l+6+zsyDaPZyfstd41
svjKS5OgHya7cyfZh+bhoTjjXePEtG3Hs1ufdhESn59nd0XbNd1WPkTxQcpjHxUtb+zPTaDs
DVAYBeNpf+CdNM3DpjvXNULItGzHMm3PbN9PS5owiEgPsMr/gzi6DIfTRESE1Zp4JuvXf8JP
CPh/Haxb/xmyiNZEtDGD+u9/QKn/Tcq9wlP+L1LGJf1zJjbg/zVgWsL+m27z10aPyCr9vCvc
02udtrqNXvFpfP5R6ikynm06mR+F6dj/In3Kn5X0U/nQfk7F05GDm4/F5ZZzetQ69jquddhy
G725pGGhv21aruMVp7BZTzsf2DPPu07b/KXZ6PXDNNu7uAmviOhG+VSdY8+y7poiceg6jp33
dc4/dcSs77KL2Yzf32UT78tfKMc+atnNTqN3m/YW83LOu2fn3e8rcK3y/2QaTQZyOtrEGOv4
PxdtcYBzDv5fB8v+z1RVxkxYPFU4qdb/miarRKOKpqvV9d/iWjW/Fvx/Oyj1v0m5V3hq/ZfM
+X+hf/ERQf1fC1k8DUaSK6rodhMVO6fN3zplU1jxiePe7lkjPxoO7Hg4K82zOB6HNwNpb+8y
ToLZNoivrpEfjOPAHyN/msUT4a7iuN/v703CNA2jodgbRtO8c5ZxIvk+8UTF2X9oEDjqZJX/
3y60bGKMf+P/GIP/18Ga/k812aCYMkPRq/U/07gsXiDDVFU4yHgrKPW/SblXeKr+xwpf9n+u
gf/Xwg/lQrqo5bN+GMujjwh9icM+Sv1rT3wSjV30F3pzlYRRdtl42x2FqST+ys/l9+jt7gH6
G6S+vazy/7lFm28eYy3/13L9E1UB/6+Div8buswIp7qh6w/4vy4cXuVUwRp5wP8Xrn3tOwOe
Q6n/Tcq9wpP+j9Ul/YskkoH/18ED/n9/6PZf6iInEP4vKvQwKvKBu+TgAL1JBtk0iSQFEoFt
5In6/9XW/0VIAP+vgTXr/0f9f7Y6oHCDMsPQYRlvO1is/19u/f8x/1eIUq3/wf9rYbHWPwDV
AgAAAAAAAAAAAAAAAAAAAAAAAMAW8w+rUb48AFAAAA==
--------------080704030105020601070409--




Message sent:


Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.503 (Entity 5.503)
Content-Type: text/plain; charset=utf-8
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: Stanislav Brabec <sbrabec@HIDDEN>
Subject: bug#21106: Acknowledgement (AC_SUBST([FOO_LIB], ['libfoo.la'])
 breaks dependency checker)
Message-ID: <handler.21106.B.143750984116948.ack <at> debbugs.gnu.org>
References: <55AEA8BF.6040102@HIDDEN>
X-Gnu-PR-Message: ack 21106
X-Gnu-PR-Package: automake
Reply-To: 21106 <at> debbugs.gnu.org
Date: Tue, 21 Jul 2015 20:18:03 +0000

Thank you for filing a new bug report with debbugs.gnu.org.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 bug-automake@HIDDEN

If you wish to submit further information on this problem, please
send it to 21106 <at> debbugs.gnu.org.

Please do not send mail to help-debbugs@HIDDEN unless you wish
to report a problem with the Bug-tracking system.

--=20
21106: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D21106
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems


Message sent to bug-automake@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#21106: AC_SUBST([FOO_LIB], ['libfoo.la']) breaks dependency checker
Resent-From: Gavin Smith <gavinsmith0123@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-automake@HIDDEN
Resent-Date: Tue, 21 Jul 2015 22:02:01 +0000
Resent-Message-ID: <handler.21106.B21106.143751607325886 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 21106
X-GNU-PR-Package: automake
X-GNU-PR-Keywords: 
To: Stanislav Brabec <sbrabec@HIDDEN>
Cc: 21106 <at> debbugs.gnu.org
Received: via spool by 21106-submit <at> debbugs.gnu.org id=B21106.143751607325886
          (code B ref 21106); Tue, 21 Jul 2015 22:02:01 +0000
Received: (at 21106) by debbugs.gnu.org; 21 Jul 2015 22:01:13 +0000
Received: from localhost ([127.0.0.1]:55727 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ZHfb6-0006jQ-By
	for submit <at> debbugs.gnu.org; Tue, 21 Jul 2015 18:01:12 -0400
Received: from mail-ig0-f175.google.com ([209.85.213.175]:37418)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <gavinsmith0123@HIDDEN>) id 1ZHfb3-0006jC-EK
 for 21106 <at> debbugs.gnu.org; Tue, 21 Jul 2015 18:01:10 -0400
Received: by igbpg9 with SMTP id pg9so118628728igb.0
 for <21106 <at> debbugs.gnu.org>; Tue, 21 Jul 2015 15:01:03 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:in-reply-to:references:date:message-id:subject:from:to
 :cc:content-type;
 bh=mJA1Veal8EHhnkqFDx6nMT8ujEktfmslIOBjDHRJvHs=;
 b=eeJ9i10ya7Ytxo2S3iA4rsdID3wkdmYjpuHXqOBk9pJhKo5tdsTdUXDKgKurwZMXiF
 bf0E3H4G4KOpvhVqG2lKifXVGeYGKcQDLOocfZT3S0MHwsb2DLEo3CR9Tw2iPSwBs97t
 YQQPVC1LaR5Dvj/60uK7b1V8ElXt58Hodwn/f8g5C2lsg8xIjEB2O6Izr0nlrTXTqgRt
 3h1xB+sJmSIpmZE/zC2BFGuyg5YpPsoRVC5DWhVMUSCgk0PYgIekpZyzVxTCQUfogXBC
 gASWd7720NQBwA3MfYL7t9LlF1KaXgmMElaVKhCH2pJhNgZn1PynUjU1enYx7T2oUg+X
 BsHA==
MIME-Version: 1.0
X-Received: by 10.50.98.3 with SMTP id ee3mr302791igb.10.1437516063754; Tue,
 21 Jul 2015 15:01:03 -0700 (PDT)
Received: by 10.36.87.212 with HTTP; Tue, 21 Jul 2015 15:01:03 -0700 (PDT)
In-Reply-To: <55AEA8BF.6040102@HIDDEN>
References: <55AEA8BF.6040102@HIDDEN>
Date: Tue, 21 Jul 2015 23:01:03 +0100
Message-ID: <CAKPWYQ2-BPf=_YsWAGMuam7TT=wzGA_+7R3n9ox19Cg+RAigSg@HIDDEN>
From: Gavin Smith <gavinsmith0123@HIDDEN>
Content-Type: text/plain; charset=UTF-8
X-Spam-Score: -0.4 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.4 (/)

On 21 July 2015 at 21:17, Stanislav Brabec <sbrabec@HIDDEN> wrote:
> I just wanted to make an option to link the program either against
> in-package instance or external instance.
>
> To make things as easy as possible, I wanted to define FOO_LIB in
> configure.ac either as 'libfoo.la' or '-lfoo' using e. g.:
>
> AC_SUBST([FOO_LIB], ['libfoo.la'])
>
> and then in Makefile.am use just:
>
> myprogram_LDADD = $(FOO_LIB)
>
> Everything works well except parallel build. It seems that dependency
> checker is not able to see such dependency, and if I try to compile the
> project with "make -j7", it fails:
>
> libtool:   error: cannot find the library 'libfoo.la' or unhandled argument 'libfoo.la'
>
> Plain "make" works.
>
> Is it a bug or expected behavior?
>
> Is there any better way how to do such things than use
>
> if USE_BUILTIN_LIBFOO
> myprogram_LDADD = libfoo.la
> else
> myprogram_LDADD = -lfoo
> endif
>
> everywhere I need to link with libfoo?

It seems similar to the questions of conditional sources, which is
covered in the Automake manual. It suggests two approaches, one with
Automake conditionals, which you imply you don't like; the other
similar to the approach you've been trying with a *.la file in the
place of a *.o file, with the exception that the Automake manual uses
an EXTRA_myprogram_SOURCES variable.

I don't know if adding "EXTRA_myprogram_SOURCES = libfoo.c" (or
"EXTRA_myprogram_SOURCES = $(libfoo_la_SOURCES)") is the right
solution?




Message sent to bug-automake@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#21106: AC_SUBST([FOO_LIB], ['libfoo.la']) breaks dependency checker
Resent-From: Stanislav Brabec <sbrabec@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-automake@HIDDEN
Resent-Date: Thu, 23 Jul 2015 13:55:02 +0000
Resent-Message-ID: <handler.21106.B21106.143765969118176 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 21106
X-GNU-PR-Package: automake
X-GNU-PR-Keywords: 
To: Gavin Smith <gavinsmith0123@HIDDEN>
Cc: 21106 <at> debbugs.gnu.org
Received: via spool by 21106-submit <at> debbugs.gnu.org id=B21106.143765969118176
          (code B ref 21106); Thu, 23 Jul 2015 13:55:02 +0000
Received: (at 21106) by debbugs.gnu.org; 23 Jul 2015 13:54:51 +0000
Received: from localhost ([127.0.0.1]:57037 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ZIGxW-0004j4-MN
	for submit <at> debbugs.gnu.org; Thu, 23 Jul 2015 09:54:51 -0400
Received: from mx2.suse.de ([195.135.220.15]:42817)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <sbrabec@HIDDEN>) id 1ZIGxU-0004iv-Gd
 for 21106 <at> debbugs.gnu.org; Thu, 23 Jul 2015 09:54:49 -0400
X-Virus-Scanned: by amavisd-new at test-mx.suse.de
Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254])
 by mx2.suse.de (Postfix) with ESMTP id 8C94AAC3B;
 Thu, 23 Jul 2015 13:54:47 +0000 (UTC)
Message-ID: <55B0F227.8010802@HIDDEN>
Date: Thu, 23 Jul 2015 15:54:47 +0200
From: Stanislav Brabec <sbrabec@HIDDEN>
Organization: SUSE Linux, s. r. o.
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
 rv:31.0) Gecko/20100101 Thunderbird/31.7.0
MIME-Version: 1.0
References: <55AEA8BF.6040102@HIDDEN>
 <CAKPWYQ2-BPf=_YsWAGMuam7TT=wzGA_+7R3n9ox19Cg+RAigSg@HIDDEN>
In-Reply-To: <CAKPWYQ2-BPf=_YsWAGMuam7TT=wzGA_+7R3n9ox19Cg+RAigSg@HIDDEN>
Content-Type: multipart/mixed; boundary="------------040809060509070001080903"
X-Spam-Score: -5.0 (-----)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

This is a multi-part message in MIME format.
--------------040809060509070001080903
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

Gavin Smith wrote:
> On 21 July 2015 at 21:17, Stanislav Brabec <sbrabec@HIDDEN> wrote:
>> Is there any better way how to do such things than use
>>
>> if USE_BUILTIN_LIBFOO
>> myprogram_LDADD = libfoo.la
>> else
>> myprogram_LDADD = -lfoo
>> endif
>>
>> everywhere I need to link with libfoo?
> 
> It seems similar to the questions of conditional sources, which is
> covered in the Automake manual. It suggests two approaches, one with
> Automake conditionals, which you imply you don't like;

I just wanted to avoid it because Makefile.am with hundreds of
conditionals is less readable. But if it is the recommended way,
I'll use it.

> the other
> similar to the approach you've been trying with a *.la file in the
> place of a *.o file, with the exception that the Automake manual uses
> an EXTRA_myprogram_SOURCES variable.

This does not work. It just compiles all sources of the libfoo.la, but
the linking the library itself is run in parallel with linking of
myprogram. Parallel build ends with the same error as before.

But this works:
EXTRA_myprogram_SOURCES = libfoo.la
BUILT_SOURCES = libfoo.la

> I don't know if adding "EXTRA_myprogram_SOURCES = libfoo.c" (or
> "EXTRA_myprogram_SOURCES = $(libfoo_la_SOURCES)") is the right
> solution?
> 
Even in a form mentioned above, it is not allowed:

configure.ac:10: error: 'FOO_LIB' includes configure substitution '@FOO_LIB@'
configure.ac:10: and is referred to from 'EXTRA_myprogram_SOURCES';
configure.ac:10: configure substitutions are not allowed in _SOURCES variables

But following works: Move the if/else from configure.ac to Makefile.am:

if BUILTIN_FOO
FOOLIB = libfoo.la
else
FOOLIB = -lfoo
endif

myprogram_LDADD = $(FOO_LIB)

Now automatic dependency checker is able to expand libfoo.la and properly link
libfoo.la before myprogram, and the conditional is used just once instead of
hundred times.

I propose to improve AC_SUBST documentation. See attached patch.

-- 
Best Regards / S pozdravem,

Stanislav Brabec
software developer
---------------------------------------------------------------------
SUSE LINUX, s. r. o.                         e-mail: sbrabec@HIDDEN
Lihovarská 1060/12                            tel: +49 911 7405384547
190 00 Praha 9                                 fax:  +420 284 084 001
Czech Republic                                    http://www.suse.cz/
PGP: 830B 40D5 9E05 35D8 5E27 6FA3 717C 209F A04F CD76

--------------040809060509070001080903
Content-Type: text/x-patch;
 name="0001-Document-that-AC_SUBST-can-break-dependencies.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="0001-Document-that-AC_SUBST-can-break-dependencies.patch"

From abc71e35fb0fe44cb5ec8e8d31030833310b62be Mon Sep 17 00:00:00 2001
From: Stanislav Brabec <sbrabec@HIDDEN>
Date: Thu, 23 Jul 2015 15:43:30 +0200
Subject: [PATCH] Document that AC_SUBST can break dependencies

If configure.ac contains
AC_SUBST([FOO_LIB], ['libfoo.la'])
and Makefile am contains
myprogram_LDADD = $(FOO_LIB)
the dependency checker is not capable to detect such dependency, and
parallel build could be broken.
Document this behavior, reported in bug #21106.

Signed-off-by: Stanislav Brabec <sbrabec@HIDDEN>
---
 doc/automake.texi | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/doc/automake.texi b/doc/automake.texi
index ecfbbc8..efd8d74 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -3076,6 +3076,11 @@ this way, e.g., @code{AC_PATH_XTRA} defines @code{X_CFLAGS} and
 @code{$(X_CFLAGS)} and @code{$(X_LIBS)} in any @file{Makefile.am}
 if @code{AC_PATH_XTRA} is called.
 
+The substituted value should not contain names of any generated files,
+as dependency checker is not able to evaluate them. If you need such
+assignment, use @code{AM_CONDITIONAL} and assign a proper value in
+@file{Makefile.am}.
+
 @item AM_CONDITIONAL
 This introduces an Automake conditional (@pxref{Conditionals}).
 
-- 
2.4.5


--------------040809060509070001080903--





Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.