From owner-freebsd-ports@freebsd.org Sat Nov 21 03:03:15 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 2928CA34771 for ; Sat, 21 Nov 2015 03:03:15 +0000 (UTC) (envelope-from junovitch@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 0D23D139E; Sat, 21 Nov 2015 03:03:15 +0000 (UTC) (envelope-from junovitch@FreeBSD.org) Received: from Silverstone.nc-us.unovitch.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id A0D6D1F59; Sat, 21 Nov 2015 03:03:14 +0000 (UTC) (envelope-from junovitch@FreeBSD.org) Date: Fri, 20 Nov 2015 22:03:14 -0500 From: Jason Unovitch To: Jan Beich Cc: freebsd-ports@freebsd.org Subject: Re: ${PYTHON_CMD}/${PERL} in _CONFIGURE_WITH not working Message-ID: <20151121030314.GA65559@Silverstone.nc-us.unovitch.com> References: <20151120030756.GA28016@Silverstone.nc-us.unovitch.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; x-action=pgp-signed In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) 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: Sat, 21 Nov 2015 03:03:15 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On Fri, Nov 20, 2015 at 06:02:41AM +0100, Jan Beich wrote: > 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: Yes, this $$ variant fixes CONFIGURE_ARGS and allows a successful build. % make -VPERL_CONFIGURE_WITH perl=${PERL} perl-bindings % make -VPYTHON_CONFIGURE_WITH python=${PYTHON_CMD} % make -VCONFIGURE_ARGS - --with-perl=/usr/local/bin/perl --with-perl-bindings - --with-python=/usr/local/bin/python2.7 > # 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} This patch does indeed fix the issues. I haven't checked for further regressions past this however. % make -VPERL_CONFIGURE_WITH perl=/usr/local/bin/perl perl-bindings % make -VPYTHON_CONFIGURE_WITH python=/usr/local/bin/python2.7 % make -VCONFIGURE_ARGS - --with-perl=/usr/local/bin/perl --with-perl-bindings - --with-python=/usr/local/bin/python2.7 Thanks for the assist, Jan! Any recommendations on the best way ahead? -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAEBCgBmBQJWT97qXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ0NURGNTQ1OTkzQkJFMzc3OTNDQUNERUU2 RkQ0OUMzMDE2MUNBQTZFAAoJEG/UnDAWHKpuBYsH/0nnh4dBBUKa1nQv0+lzMVhd C/2dFymXlMIyZcka3s0s1V7CIjsE5ZEipqYeZv7Cf6zxc2Vg56cJOjmkUGKZvqM1 0jJ7uEz/lF/YNtAiFq6u3KcHDvRiA/ciGcn9o9CMiSadZc+/+fgGE2V9ZflZr+yx s6auJE78hjYDn00iKd5MyXJg+rSQ/JQiYUQH7bL9q4BOH9rLIqXf6Pi24m+Eck5s hNSjr09rExDiciY6Gp4kDoqwWS9kTwP1lJkGupQvEreLmBd9Vjhb9m0iK9/0MSr2 rZSstm1/JfX8LxwJRBe5+7WlfnqYNhmFGY6l1Ejy4PRcm/Mecu46Z8deuRlI8z0= =tG1V -----END PGP SIGNATURE-----