From owner-freebsd-ports@FreeBSD.ORG Sun Jul 9 14:01:54 2006 Return-Path: X-Original-To: ports@FreeBSD.org Delivered-To: freebsd-ports@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DF9B716A4DA; Sun, 9 Jul 2006 14:01:54 +0000 (UTC) (envelope-from Alexander@Leidinger.net) Received: from www.ebusiness-leidinger.de (jojo.ms-net.de [84.16.236.246]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1A6AE43D46; Sun, 9 Jul 2006 14:01:53 +0000 (GMT) (envelope-from Alexander@Leidinger.net) Received: from Andro-Beta.Leidinger.net (p54A5FDD6.dip.t-dialin.net [84.165.253.214]) (authenticated bits=0) by www.ebusiness-leidinger.de (8.13.6/8.13.6) with ESMTP id k69Dr4Zb092195; Sun, 9 Jul 2006 15:53:05 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Received: from Magellan.Leidinger.net (Magellan.Leidinger.net [192.168.1.1]) by Andro-Beta.Leidinger.net (8.13.4/8.13.3) with ESMTP id k69E1rid026406; Sun, 9 Jul 2006 16:01:53 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Date: Sun, 9 Jul 2006 16:02:58 +0200 From: Alexander Leidinger To: Alejandro Pulver Message-ID: <20060709160258.5871bc1b@Magellan.Leidinger.net> In-Reply-To: <20060706161534.4b8d2639@phobos.mars.bsd> References: <20060701202522.00da2f4e@phobos.mars.bsd> <20060703114027.tj9s4h5mog8ww0ck@netchild.homeip.net> <20060703142907.62215dae@phobos.mars.bsd> <20060704074308.9gtr3ucj7ogs8kcs@netchild.homeip.net> <20060706161534.4b8d2639@phobos.mars.bsd> X-Mailer: Sylpheed-Claws 2.3.1 (GTK+ 2.8.19; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new Cc: ports@FreeBSD.org Subject: Re: Renaming and symlinking shared libraries X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jul 2006 14:01:55 -0000 Quoting Alejandro Pulver (Thu, 6 Jul 2006 16:15:34 -0300): > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On Tue, 04 Jul 2006 07:43:08 +0200 > Alexander Leidinger wrote: > > > > >> Quoting Alejandro Pulver (from Sat, 1 Jul 2006 > > >> 20:25:22 -0300): > > > > > > But then how do the databases/dbXX ports achieve the same result > > > without it? I thought it should find it since there is a symlink > > > in /usr/local/lib that points to it. I want that when I compile a > > > program with -L/usr/local/lib/test -ltest it actually links to test-2 > > > for example. Please look at the dbXX ports to see what I mean. > > > > If you link with "-ltest-2" or if you link lib/libtest.so -> > > lib/test2/libtest-2.so, it should work, else you have to use the new > > LDCONFIG infrastructure. > > > > The problem is that there are many versions of libtest > (lib/libtest-2.so, lib/libtest-3.so), and I want to select the library > by adding a -L linker flag to the corresponding directory, without > altering the program (each lib/test2, lib/test3, etc. has a symlink > libtest.so which points to the corresponding one; I want the mapping to > take effect at link time). > > For example (note that I didn't specify -ldb-4.2, just -ldb, and > lib/db42 isn't in the linker path): > % cc test.c -L/usr/local/lib/db42 -ldb > % ldd a.out > a.out: > libdb-4.2.so.2 => /usr/local/lib/libdb-4.2.so.2 (0x28077000) > libc.so.6 => /lib/libc.so.6 (0x2814a000) > > When I try it after symlinking the lua4 library this happens: > % cc test.c -L/usr/local/lib/lua4 -llua > % ldd a.out > a.out: > liblua.so => (not found) > libc.so.6 => /lib/libc.so.6 (0x2814a000) > > I would like to achieve the same result as the first case. Does the lua4 lib contain a SONAME entry? % objdump -R -x /usr/lib/libsdp.so | grep SONAME SONAME libsdp.so.2 Does our runtime linker follow runtime linker paths embedded into a lib (gcc -L/path -R/path/foo -lbar) and does the libdb-4.2.so.2 contain a runtime linker path entry (don't know how to check, maybe you have to search the build logs for -R). Bye, Alexander. -- You can disable tcsh's terminal beep if you `set nobeep'. http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137