From owner-freebsd-arch@FreeBSD.ORG Sun May 5 20:12:32 2013 Return-Path: Delivered-To: freebsd-arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9EDD0FC5 for ; Sun, 5 May 2013 20:12:32 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 6D35BC48 for ; Sun, 5 May 2013 20:12:31 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id AB9602FB for ; Sun, 5 May 2013 22:08:30 +0200 (CEST) Date: Sun, 5 May 2013 22:14:36 +0200 From: Pawel Jakub Dawidek To: freebsd-arch@FreeBSD.org Subject: Building library that depends on another library. Message-ID: <20130505201436.GJ1374@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="d6iqOn7HZPWKXx18" Content-Disposition: inline X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) 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: Sun, 05 May 2013 20:12:32 -0000 --d6iqOn7HZPWKXx18 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi. I'm trying to connect two libraries to the build without hacks and it doesn't work... My two libraries are libcapsicum and libnv. libcapsicum depends on libnv. I want to specify this dependency explicitely in libcapsicum's Makefile: DPADD=3D ${LIBNV} LDADD=3D -lnv (LIBNV was added to bsd.libnames.mk, in case you wonder.) =46rom conversation with kan@ (Alexander Kabaev) declaring dependency directly in library's Makefile is required for symbol versioning to work. It just sounds right, too. If this is done, libcapsicum doesn't compile: =3D=3D=3D> lib/libcapsicum (all) cc [...] cc [...] building static capsicum library ranlib libcapsicum.a cc [...] cc [...] make: don't know how to make /usr/home/pjd/obj/usr/home/pjd/p4/capsicum/tmp/usr/lib/libnv.a. Stop *** [all] Error code 2 Stop in /usr/home/pjd/p4/capsicum/lib. *** [lib__L] Error code 1 Note that when build fails libnv.{a,so} exist in /lib/libnv/, but of course not in /tmp/usr/lib/. It looks like to make such dependency work one HAS TO add libnv to _prebuild_libs in src/Makefile.inc1, which seems wrong. Libraries specified there from my understanding are just used by build tools: LD_LIBRARY_PATH=3D${INSTALLTMP} # This is from src/Makefile.inc1. My understanding was that all I need to do is to add my two libraries in proper order to SUBDIR_ORDERED variable in src/lib/Makefile. This means that currently SUBDIR_ORDERED is totally useless. No matter how libraries are ordered there, to compile, they need libraries they depend on in Makefile.inc1's _prebuild_libs. I can of course just add libnv to _prebuild_libs and make it compile twice for no reason, but maybe there is a better way or maybe I'm just missing something? --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://mobter.com --d6iqOn7HZPWKXx18 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlGGvawACgkQForvXbEpPzRsWgCg8nPMvZGjbs2JBIcTS9nq9WNH zAAAoIikolVH5v0UMCN5bwzG62GPyc+M =Z+C5 -----END PGP SIGNATURE----- --d6iqOn7HZPWKXx18--