Date: Thu, 3 Apr 2008 22:04:16 +0200 From: Max Laier <max@love2party.net> To: freebsd-ports@freebsd.org Subject: Re: How to set CFLAGS for the build step? Message-ID: <200804032204.16975.max@love2party.net> In-Reply-To: <200804021834.43014.max@love2party.net> References: <200804021834.43014.max@love2party.net>
next in thread | previous in thread | raw e-mail | index | archive | help
--Boundary-00=_AhT9HiMrjlk9idg Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Wednesday 02 April 2008 18:34:42 Max Laier wrote: > Hi, > > I have some trouble with sysutils/pftop. It seems that if a user sets > CFLAGS in make.conf the additional "CFLAGS+= -DHAVE_ALTQ=1" I have in > the port's Makefile doesn't get through to the build step's > environment. This might be due to the fact that this port uses the > bsd.*.mk scripts, but I'm puzzled as to how to do this right. Any > insight? Nothing helpful yet - so maybe I wasn't clear about the problem. Attached is a small test port Makefile to demonstrate the problem. The objective is to change the CFLAGS setting in there in a way that will result in "-addme" being part of the final output of: make MCONF=empty clean all make MCONF=test1 clean all make MCONF=test2 clean all make MCONF=test3 clean all This currently works for empty and test{1,2}, but fails for test3. This test3 uses a make.conf (passed via MAKE_ARGS= __MAKE_CONF=...) that has a CFLAGS= -test line. Any help appreciated! -- /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News --Boundary-00=_AhT9HiMrjlk9idg Content-Type: text/plain; charset="iso-8859-1"; name="Makefile" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="Makefile" PORTNAME= cflags-test PORTVERSION= 0.1 CATEGORIES= sysutils MAINTAINER= mlaier@freebsd.org COMMENT= Test if CFLAGS are properly propagated to the build step .include <bsd.port.pre.mk> .if defined(MCONF) MAKE_ARGS= __MAKE_CONF=${WRKSRC}/${MCONF} .endif # CHANGE HERE CFLAGS+= -addme # CHANGE HERE do-fetch: echo "Nothing to do" do-extract: @mkdir -p ${WRKSRC} @touch ${WRKSRC}/empty @echo "CFLAGS?= -test" > ${WRKSRC}/test1 @echo "CFLAGS+= -test" > ${WRKSRC}/test2 @echo "CFLAGS= -test" > ${WRKSRC}/test3 @echo "all:" > ${WRKSRC}/Makefile @echo " @echo \"'\$${CFLAGS}'\"" >> ${WRKSRC}/Makefile @echo ".include <bsd.prog.mk>" >> ${WRKSRC}/Makefile .include <bsd.port.post.mk> --Boundary-00=_AhT9HiMrjlk9idg--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200804032204.16975.max>