Subject: unquoted ':' in .if empty()
To: None <tech-pkg@netbsd.org, current-users@netbsd.org>
From: Eric Haszlakiewicz <erh@jodi.nimenees.com>
List: current-users
Date: 12/08/2003 14:18:46
	I ran into a problem in either make, or bsd.buildlink2.mk.  Around line
119 of bsd.buildlink2.mk is this:

.for FLAG in ${_BLNK_LDFLAGS}
.  if empty(LDFLAGS:M${FLAG})
LDFLAGS+=   ${FLAG}
.  endif
.endfor

Which results in a "malformed conditional" error because one of the
ld flags (on AIX) contains a ':'.

I can fix this by changing that line to this:
.  if empty(LDFLAGS:M${FLAG:C/:/\:/})

my first thought was use ${FLAG:Q}, but that's for shell metacharacters,
not make variable expansion metacharacters.
I'm thinking maybe add another modifier type ("q"?) to do this,
or maybe make should do it automatically.  What do you all think?

eric