Subject: Re: need a C++ compiler? (was: CVS commit: pkgsrc)
To: None <tech-pkg@NetBSD.org>
From: Alan Barrett <apb@cequrux.com>
List: tech-pkg
Date: 02/02/2004 22:52:02
On Mon, 02 Feb 2004, Jeremy C. Reed wrote:
> -	gccpath="`${TYPE} ${CC} | ${AWK} '{ print $$NF }'`";		\
> +	gccpath="`${TYPE} ${CC:C/-.*$//} | ${AWK} '{ print $$NF }'`";

If you want just the first word from ${CC}, then why not use ${CC:[1]}?

If you don't want to rely on having a sufficiently recent make, and if
you think it's safe to assume that all words other than the first will
begin with "-", then you still need to anchor the regexp to the start of
the word, using ${CC:C/^-.*//}.

--apb (Alan Barrett)