From owner-freebsd-current Tue Sep 29 18:22:15 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA23331 for freebsd-current-outgoing; Tue, 29 Sep 1998 18:22:15 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from isua5.iastate.edu (isua5.iastate.edu [129.186.1.205]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA23326 for ; Tue, 29 Sep 1998 18:22:01 -0700 (PDT) (envelope-from graphix@iastate.edu) Received: from localhost (graphix@localhost) by isua5.iastate.edu (8.8.5/8.8.5) with SMTP id UAA04701 for ; Tue, 29 Sep 1998 20:21:45 -0500 (CDT) Message-Id: <199809300121.UAA04701@isua5.iastate.edu> To: freebsd-current@FreeBSD.ORG Reply-To: kent@iastate.edu Subject: ELF library questions (building and linking) Date: Tue, 29 Sep 1998 20:21:45 CDT From: Kent Vander Velden Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Building an ELF library questions: I have been trying to rebuild a few of the libraries that I use to be in elf format. Is the following the correct way to build an elf library? for every file: cc -c -fpic file.c ld -o shared/file.o -x -r file.o cc -shared -Wl,-x -o libA.so.1 -Wl,-soname,libA.so.1 `lorder file1 file2 ... | tsort` Does `ld -shared ...` not work correctly any longer? When I used `ld -shared ...` to build a shared library and `ar` to build an archive in the same directory, the linker seemed to prefer to link to the archive instead of the shared library. Mush ELF libraries have a name of the form libName.so.version or can try be of the form libName.so.version.reversion? Linking to an ELF library question: I seem to remember there being an environment variable that could be set that held a search path for the linker. Setting this variable was like adding a -L flag to the link line. Is such a thing still available? Mainly I would like to avoid adding "-L/usr/X11/lib" to a bunch of Makefiles. Thanks. --- Kent Vander Velden kent@iastate.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message