Subject: Re: how to to detect gcc 2.95.*
To: Martti Kuparinen <martti.kuparinen@iki.fi>
From: Frederick Bruckman <fredb@immanent.net>
List: tech-pkg
Date: 08/27/2001 10:38:04
On Mon, 27 Aug 2001, Martti Kuparinen wrote:

> I'm creating a package which requires GCC 2.95.*
>
> I have copied the idea of detecting path to gcc from
> pkgsrc/devel/stlport but this is not the right way
> of doing things in 1.5X as it already has (at least sparc64)
> version 2.95.2 in /usr/bin/gcc and doesn't need therefore
> a packaged version of gcc.
>
> Has anyone come to the "right" way of doing this? This seems
> to be easy to do but I don't want to re-invent the wheel...

Doubt it. :-)

Here's part of what I was doing with ooffice, before I tabled the
project:


CONFIGURE_ARGS+=        --with-gcc-home=${GCC_HOME}

.include "../../mk/bsd.prefs.mk"

.if !defined(CC_IN_PATH_VERSION)
CC_IN_PATH_VERSION!=    ${CC} --version
MAKEFLAGS+=             CC_IN_PATH_VERSION="${CC_IN_PATH_VERSION}"
.endif

.if ${CC_IN_PATH_VERSION} == "2.95.2"
GCC_HOME=               /usr
.else
BUILD_DEPENDS+=         gcc-2.95.2:../../lang/gcc
GCC_HOME=               ${LOCALBASE}/gcc-2.95.2
.endif

.include "../../mk/bsd.pkg.mk"


The first ".if" is designed to _not_ fork "cc --version" with each
recursive make, the rest is self-explanatory.

You're working on Open Office? With 6.19, you needed "tcsh" and
"dmake"  to build, which complicated things tremendously. Is that
still the case?

Frederick