Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Mar 1999 10:29:03 -0700
From:      Nate Williams <nate@mt.sri.com>
To:        Steve Price <sprice@hiwaay.net>
Cc:        Nate Williams <nate@mt.sri.com>, freebsd-ports@FreeBSD.ORG
Subject:   Re: Ports question
Message-ID:  <199903261729.KAA01141@mt.sri.com>
In-Reply-To: <Pine.OSF.4.02.9903261108280.22203-100000@fly.HiWAAY.net>
References:  <199903261620.JAA00260@mt.sri.com> <Pine.OSF.4.02.9903261108280.22203-100000@fly.HiWAAY.net>

next in thread | previous in thread | raw e-mail | index | archive | help
> # 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 <bsd.port.pre.mk>
> 
> .if ${PORTOBJFORMAT} == "elf"
> DISTFILES+=	jdk1.1.7-elf.tar.gz
> .else
> DISTFILES+=	jdk1.1.7-aout.tar.gz
> .endif
> ...
> 
> .include <bsd.port.post.mk>

Ahh, OK.

> # 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.

Agreed.

> 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 <dlfcn.h>
> 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.

Since you seem qualified, do you want to do it or are you gonna make me?
:) :)


Nate


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199903261729.KAA01141>