From owner-freebsd-ports Fri Mar 26 9:27:55 1999 Delivered-To: freebsd-ports@freebsd.org Received: from mail.HiWAAY.net (fly.HiWAAY.net [208.147.154.56]) by hub.freebsd.org (Postfix) with ESMTP id AA03A1558A for ; Fri, 26 Mar 1999 09:27:43 -0800 (PST) (envelope-from sprice@hiwaay.net) Received: from localhost (sprice@localhost) by mail.HiWAAY.net (8.9.1a/8.9.0) with SMTP id LAA13693; Fri, 26 Mar 1999 11:27:22 -0600 (CST) Date: Fri, 26 Mar 1999 11:27:22 -0600 (CST) From: Steve Price To: Nate Williams Cc: freebsd-ports@FreeBSD.ORG Subject: Re: Ports question In-Reply-To: <199903261620.JAA00260@mt.sri.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Fri, 26 Mar 1999, Nate Williams wrote: # I just made a new JDK release for FreeBSD, and I need a way to determine # which 'flavor' of FreeBSD is being used on the build system in order to # determine which 'flavor' of binary should be used. # # I have both an A.OUT version and an ELF version, and I'd like to install # the most appropriate version on the system. You can use something like this: .include .if ${PORTOBJFORMAT} == "elf" DISTFILES+= jdk1.1.7-elf.tar.gz .else DISTFILES+= jdk1.1.7-aout.tar.gz .endif ... .include # Second, on ELF systems, if the data of /usr/libexec/ld-elf.so.1 is older # than March 24, I need to install a new loader. Or, I need to abort the # installation since it requires a new runtime loader. Installing a new loader would be a bad thing to do from the ports tree. As for testing the date that is not a perfect solution either. I'd like to see a quick-n-dirty test prgram written and add that to the ELF distfiles. Then you could do something like this: do-install: @${WRKDIR}/dladdr-test || (${CAT} ${PKGDIR}/LOADER-UPGRADE \ && exit 1) 'dladdr-test' is a simple little program like this. #include int main() { Dl_info dlinfo; if (dladdr((void *)&main, &dlinfo) == 0) return 1; return 0; } This works since older versions of dladdr were guaranteed to return a zero every time and the new version shouldn't fail in this simple case. # Does anyone have any suggestions on how I would go about doing this? # I'm *NOT* a ports person, nor have I made any port from scratch, so be # gentle with me. :) :) # # # Nate To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message