From owner-freebsd-arch@FreeBSD.ORG Tue May 7 19:27:39 2013 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A1304E87 for ; Tue, 7 May 2013 19:27:39 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx1.freebsd.org (Postfix) with ESMTP id 62882DB9 for ; Tue, 7 May 2013 19:27:39 +0000 (UTC) Received: by mail-vc0-f176.google.com with SMTP id ib11so903314vcb.21 for ; Tue, 07 May 2013 12:27:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to:x-mailer:x-gm-message-state; bh=hi0/SiDKekiiOXDNZVcVec0DXgRHqrLp414lpZ+vb2o=; b=pfs7I0Ptd3TvV88Cfn/PfDWJyAZedHp4aH1Q4WZMV7sXub9EuM5l/qkW+mbJubcTFO 5jmeV0yfMa/1GlAKJZLMUU+r4VZiY9r1qeGKJZBGYRHvczdvQcjWYP1QcNi9TUhg9RoQ i48vwTwb02B/89827Jq2AgUhUPgC/A55+DteZCE2GH075F4CuOTfzoJGKiLn5pl7xwof VG3p7UdcAziTrS6ZlTORYkPEJcyUFNUaihkRNvijqSkCBX/s3HSNkIOXjkgj+6k8pIHB ih+O5ffcHbfoNKJu1Bb1ESuswx2/lMHPoT8wY2tI4VJMjQFWwgHAWKkIlTIouWo+XPiC PzwQ== X-Received: by 10.52.93.179 with SMTP id cv19mr1970005vdb.20.1367954858659; Tue, 07 May 2013 12:27:38 -0700 (PDT) Received: from fusionlt2834a.int.fusionio.com ([209.117.142.2]) by mx.google.com with ESMTPSA id s14sm7411198vdg.6.2013.05.07.12.27.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 07 May 2013 12:27:38 -0700 (PDT) Sender: Warner Losh Subject: Re: Building library that depends on another library. Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=iso-8859-1 From: Warner Losh In-Reply-To: <20130507185005.GB1888@garage.freebsd.pl> Date: Tue, 7 May 2013 13:27:34 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <20130505201436.GJ1374@garage.freebsd.pl> <86r4hkgd04.fsf@nine.des.no> <20130507185005.GB1888@garage.freebsd.pl> To: Pawel Jakub Dawidek X-Mailer: Apple Mail (2.1085) X-Gm-Message-State: ALoCoQmYLm/5ceAMXy+VXCVN349+p28dX6PAwDs72d2pvrTjbwllUUN424+U/VpdeEcm5qlxitYI Cc: =?iso-8859-1?Q?Dag-Erling_Sm=F8rgrav?= , freebsd-arch@FreeBSD.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2013 19:27:39 -0000 On May 7, 2013, at 12:50 PM, Pawel Jakub Dawidek wrote: > On Mon, May 06, 2013 at 08:49:15PM +0200, Dag-Erling Sm=F8rgrav wrote: >> Pawel Jakub Dawidek writes: >>> It looks like to make such dependency work one HAS TO add libnv to >>> _prebuild_libs in src/Makefile.inc1, which seems wrong. >>=20 >> It may seem wrong, but it is correct, cf the following comment in >> Makefile.inc1: >>=20 >> # The list of libraries with dependents (${_prebuild_libs}) and their >> # interdependencies (__L) are built automatically by the >> # ${.CURDIR}/tools/make_libdeps.sh script. >=20 > Yes, this also means SUBDIR_ORDERED in lib/Makefile doesn't make = sense. >=20 > All in all I really don't like to add libraries to Makefile.inc1, it > doesn't sound right. I'd like this to be self-contained. For = bsd.prog.mk > it is enough to specify DPADD/LDADD in program's Makefile instead of > hacking some central Makefile. >=20 > I came up with something like the following. Instead of: >=20 > DPADD=3D ${LIBNV} > LDADD=3D -lnv > (plus modifying src/Makefile.inc1) >=20 > I only add: >=20 > LDADD=3D -L${.OBJDIR}/../libnv -lnv >=20 > What do people think? Still won't work. It won't ensure that libnv is built, leading to = cross-threading on upgrade issues. Better would be a 'plus modifying src/Makefile.inc1' would instead be = 'have Makefile.inc1 figure it out fast.' We have to get the order right, = there's no way around that. Warner=