tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

make variable expansion oddity



I don't know whether this is a pkgsrc problem or a make problem.

I've run into strange issues (on 7/amd64, in case that matters) with make 
apperantly inconsistently expanding variables.

Case 1:
	FOO_UID!=	${ID} -u ${FOO_USER}
fails because ${ID} is empty (it works with "id" instead of "${ID}".
However make show-var VARNAME=ID gives /usr/bin/id as expected.

Case 2 (artificial):
	FOO_INSTALL!=	${INSTALL}
makes show-var VARNAME=FOO_INSTALL show "install", not "/usr/bin/install"

Case 3a:
	SED_SUBSTS= CC ${CC}
	SED_SUBSTS+= INSTALL ${INSTALL}
	SED_SUBSTS+= SH ${SH}
	SED_SUBSTS+= GZIP /usr/bin/gzip
	SED_SUBSTS+= PERL ${TOOLS_PATH.perl}
and
	SED_CMD= # empty
	.for var val in ${SED_SUBSTS}
	SED_CMD+= -e s,@${var}@,${val},
	.endfor
and
	do-configure:
		echo ${SED_CMD}
shows "install", not "/usr/bin/install" and a mangled command due to empty 
${SH} and ${TOOLS_PATH.perl}

Case 3b:
SED_SUBST as above and
	SED_CMD!= printf -- "-e s,@%s@,%s, " ${SED_SUBSTS}
gives the same broken results.

Case 3c:
SED_SUBST as above and
	do-configure:
	.for i in <FILES>
		${SED} $$(printf -- "-e s,@%s@,%s, " ${SED_SUBSTS}) ${WRKSRC}/${i}.in >${WRKSRC}/${i}
	.endfor
works as expected.


Are these bugs? Am I trying something strage? Is there a better way?


Home | Main Index | Thread Index | Old Index