From owner-freebsd-ports Wed Sep 16 18:16:05 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA03233 for freebsd-ports-outgoing; Wed, 16 Sep 1998 18:16:05 -0700 (PDT) (envelope-from owner-freebsd-ports@FreeBSD.ORG) Received: from vader.cs.berkeley.edu (vader.CS.Berkeley.EDU [128.32.38.234]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA03132; Wed, 16 Sep 1998 18:15:30 -0700 (PDT) (envelope-from asami@vader.cs.berkeley.edu) Received: from silvia.hip.berkeley.edu (sji-ca5-24.ix.netcom.com [209.109.234.24]) by vader.cs.berkeley.edu (8.8.7/8.7.3) with ESMTP id SAA06495; Wed, 16 Sep 1998 18:14:58 -0700 (PDT) Received: (from asami@localhost) by silvia.hip.berkeley.edu (8.8.8/8.6.9) id SAA10463; Wed, 16 Sep 1998 18:14:55 -0700 (PDT) Date: Wed, 16 Sep 1998 18:14:55 -0700 (PDT) Message-Id: <199809170114.SAA10463@silvia.hip.berkeley.edu> To: current@FreeBSD.ORG, ports@FreeBSD.ORG Reply-to: ports@FreeBSD.ORG Subject: ELF transition for ports (revised) From: asami@cs.berkeley.edu (Satoshi Asami) Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org (This file is also available from: http://www.freebsd.org/~asami/elf-guidelines.txt ) Here is the guidelines for converting ports to ELF, and to use ports in the post-ELF world. You will need the latest bsd.port.mk (1.289 or 1.227.2.53) to use the converted ports. (Note that -stable users should also get the new bsd.port.mk if you want to use the latest ports.) Note the policy regarding aout shared version number has changed somewhat. It is no longer necessary to bump the number right now because of ELF conversion. Please be patient while we fix the ports tree to work on both a.out and ELF. Please report any breakages to the ports list. Thanks. Satoshi (and the incredible ELF team) ------- (1) Aout libraries should be moved out of /usr/local/lib and friends to an "aout" subdirectory. If you don't move them out of the way, elf ports will happily overwrite aout libraries. The "move-aout-libs" target in the -current src/Makefile (called from "aout-to-elf") will do this for you. It will only move aout libs so it is safe to call it on a system with both elf and aout libs in the standard directories. (2) The ports tree will build packages in the format the machine is in. This means aout for 2.2-stable and aout or elf for 3.0-current depending on what `objformat` returns. Also, once users convert to elf with (1) (i.e., move aout libraries to a subdirectory), building aout libraries will be unsupported. (It may still work if they know what they are doing, but they are on their own.) (3) bsd.port.mk will set PORTOBJFORMAT to "aout" or "elf" and export it in the environments CONFIGURE_ENV and MAKE_ENV. (It's always going to be "aout" in -stable). It is also passed to PLIST_SUB as "PORTOBJFORMAT=${PORTOBJFORMAT}". (See (7) below.) The variable is set using this line: PORTOBJFORMAT!= test -x /usr/bin/objformat && /usr/bin/objformat || echo aout Ports' make processes can use this variable to decide what to do. If the port's own configure script (or something) already correctly detects an ELF system, it is not necessary to check PORTOBJFORMAT. (3a) Elf libraries should be called "libfoo.so.M". (It is not allowed to create an elf library with a name "libfoo.so.M.N", even if you create a symlink to make it accessible via "libfoo.so.M".) Also, assuming "cc -shared" is used rather than "ld" directly, the only difference is that they need to add "-Wl,-soname,libfoo.so.M" on the command line. (3b) Aout libraries should be called "libfoo.so.M.N". There should not be any symlinks in the form "libfoo.so.M". The elf shared library version should be bumped next time the port undergoes an incompatible change. At that point the aout minor version number will be set to zero and will stay that way. (This means pkg/PLIST will only list elf shlib names from there on -- see (4) below.) (4) pkg/PLIST should contain the short (elf) shlib names if the aout minor number is zero, and the long (aout) names otherwise. bsd.port.mk will add ".0" to the end of shlib lines if PORTOBJFORMAT==aout if there is a short shlib name, and will delete the minor number if PORTOBJFORMAT==elf and there is a long shlib name. (5) Ports should install a symlink "libfoo.so" pointing to the real shared library (libfoo.so.M.N for aout, libfoo.so.M for elf). This link is listed in pkg/PLIST as well. (6) All port Makefiles are edited to remove minor numbers from LIB_DEPENDS, and also to have the regexp support removed. (E.g., "foo\\.1\\.\\(33|40\\)" -> "foo.2". They will be matched using "grep -wF". (7) The ldconfig line in Makefiles should read: ${SETENV} OBJFORMAT=${PORTOBJFORMAT} ${LDCONFIG} -m .... and in pkg/PLIST: @exec /usr/bin/env OBJFORMAT=%%PORTOBJFORMAT%% /sbin/ldconfig -m ... @unexec /usr/bin/env OBJFORMAT=%%PORTOBJFORMAT%% /sbin/ldconfig -R To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message