From owner-freebsd-ports@freebsd.org Fri Nov 20 05:03:11 2015 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96D16A33BFC for ; Fri, 20 Nov 2015 05:03:11 +0000 (UTC) (envelope-from jbeich@vfemail.net) Received: from vfemail.net (fiveseven.neocoil.com [12.31.100.157]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 19AF714F0 for ; Fri, 20 Nov 2015 05:03:10 +0000 (UTC) (envelope-from jbeich@vfemail.net) Received: (qmail 38220 invoked by uid 89); 20 Nov 2015 05:03:00 -0000 Received: from localhost (HELO freequeue.vfemail.net) (127.0.0.1) by localhost with (DHE-RSA-AES256-SHA encrypted) SMTP; 20 Nov 2015 05:03:00 -0000 Received: (qmail 38191 invoked by uid 89); 20 Nov 2015 05:02:43 -0000 Received: by simscan 1.3.1 ppid: 38187, pid: 38189, t: 0.0028s scanners:none Received: from unknown (HELO smtp102-2.vfemail.net) (172.16.100.62) by FreeQueue with SMTP; 20 Nov 2015 05:02:43 -0000 Received: (qmail 1522 invoked by uid 89); 20 Nov 2015 05:02:51 -0000 Received: by simscan 1.4.0 ppid: 1509, pid: 1518, t: 0.5557s scanners:none Received: from unknown (HELO nil) (amJlaWNoQHZmZW1haWwubmV0@172.16.100.27) by 172.16.100.62 with ESMTPA; 20 Nov 2015 05:02:50 -0000 From: Jan Beich To: Jason Unovitch Cc: freebsd-ports@freebsd.org Subject: Re: ${PYTHON_CMD}/${PERL} in _CONFIGURE_WITH not working In-Reply-To: <20151120030756.GA28016@Silverstone.nc-us.unovitch.com> (Jason Unovitch's message of "Thu, 19 Nov 2015 22:07:56 -0500") References: <20151120030756.GA28016@Silverstone.nc-us.unovitch.com> Date: Fri, 20 Nov 2015 06:02:41 +0100 Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Nov 2015 05:03:11 -0000 --=-=-= Content-Type: text/plain Jason Unovitch writes: > PERL_USES= perl5 > PERL_CONFIGURE_ENABLE= perl > PERL_CONFIGURE_WITH= perl=${PERL} perl-bindings > PYTHON_USES= python:2 > PYTHON_CONFIGURE_ENABLE= python > PYTHON_CONFIGURE_WITH= python=${PYTHON_CMD} [...] > % make -VCONFIGURE_ARGS > "--enable-python --with-python= " > "--enable-perl --with-perl= --with-perl-bindings" It appears bsd.option.mk expands _WITH and _ENABLE twice unlike _ON/_OFF: once in .for loop and once (lazily) when CONFIGURE_ARGS is referenced. Try using $${PERL} and $${PYTHON_CMD} or the following patch: # XXX incomplete as there're more cases with premature expansion Index: Mk/bsd.options.mk =================================================================== --- Mk/bsd.options.mk (revision 401846) +++ Mk/bsd.options.mk (working copy) @@ -491,16 +491,8 @@ ${_u:tu}= ${${opt}_VARS:M${var}=*:C/[^=]*=//:C/^" . endif . endfor . endif -. if defined(${opt}_CONFIGURE_ENABLE) -. for iopt in ${${opt}_CONFIGURE_ENABLE} -CONFIGURE_ARGS+= --enable-${iopt} -. endfor -. endif -. if defined(${opt}_CONFIGURE_WITH) -. for iopt in ${${opt}_CONFIGURE_WITH} -CONFIGURE_ARGS+= --with-${iopt} -. endfor -. endif +CONFIGURE_ARGS+= ${${opt}_CONFIGURE_ENABLE:C/.+/--enable-&/} +CONFIGURE_ARGS+= ${${opt}_CONFIGURE_WITH:C/.+/--with-&/} . for configure in CONFIGURE CMAKE QMAKE . if defined(${opt}_${configure}_ON) ${configure}_ARGS+= ${${opt}_${configure}_ON} @@ -539,16 +531,8 @@ ${_u:tu}= ${${opt}_VARS_OFF:M${var}=*:C/[^=]*=//: . endif . endfor . endif -. if defined(${opt}_CONFIGURE_ENABLE) -. for iopt in ${${opt}_CONFIGURE_ENABLE} -CONFIGURE_ARGS+= --disable-${iopt:C/=.*//} -. endfor -. endif -. if defined(${opt}_CONFIGURE_WITH) -. for iopt in ${${opt}_CONFIGURE_WITH} -CONFIGURE_ARGS+= --without-${iopt:C/=.*//} -. endfor -. endif +CONFIGURE_ARGS+= ${${opt}_CONFIGURE_ENABLE:C/=.*//:C/.+/--disable-&/} +CONFIGURE_ARGS+= ${${opt}_CONFIGURE_WITH:C/=.*//:C/.+/--without-&/} . for configure in CONFIGURE CMAKE QMAKE . if defined(${opt}_${configure}_OFF) ${configure}_ARGS+= ${${opt}_${configure}_OFF} --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQF8BAEBCgBmBQJWTqlxXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXREQjQ0MzY3NEM3RDIzNTc4NkUxNDkyQ0VF NEM3Nzg4MzQ3OURCRERCAAoJEOTHeINHnb3bwPwH/RHvEZq+IHkpDiDl58cHyFSh brL8Zm294oGLbFdSDAxvMKAzUrteVaj1NiEMe+y0weMhLrgzxQ4Qx4O/wW9nYKH2 vuDwU+pnwljsoVYyN5r9QnZAVRavRMbJQ7GiyS+0C7+nureiY/w//vb0Yps729Vq 9dwbC5p9XHrzrDLkDcbE4Rx0HuhUzr95N2mQ8JkiCur8zRs5lK2LBtQciQinDpkR aVhQGB4uO9Tj045/D4/ebOF4EjjEXUE5sK2Fj/1Wm9KxzlckMlMFvg4p3C+3rqDG tI7yXVNMaGYdk/GVG4PxseaqZgDxYEGKAkI/FHmxc3sq2Wp5jQIKuF9uvgwjKGU= =Nngc -----END PGP SIGNATURE----- --=-=-=--