Subject: Re: need a C++ compiler? (was: CVS commit: pkgsrc)
To: Alan Barrett <>
From: Jeremy C. Reed <>
List: tech-pkg
Date: 02/02/2004 12:56:36
On Mon, 2 Feb 2004, Alan Barrett wrote:

> 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]}?

That is exactly what I want. I looked and looked in make(1) man page and
could not find that (or any other method to get first word) documented.

(Can you consider adding that explanation to make man page?)

> If you don't want to rely on having a sufficiently recent make, and if

I am using make from 1.6.2 (upcominmg). I assume that you mean that [1]
feature in new make.

> 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/^-.*//}.

Yes. (That was in my follow-up mail.)

   Jeremy C. Reed