diff mbox

pkg-cmake: pass <pkg>_CONF_ENV for the target configure step

Message ID 1488130968-20114-1-git-send-email-thomas.petazzoni@free-electrons.com
State Accepted
Commit fc4250119582043bf57a6296ae0264aa95f97fac
Headers show

Commit Message

Thomas Petazzoni Feb. 26, 2017, 5:42 p.m. UTC
The Buildroot manual documents that <pkg>_CONF_ENV is passed in the
environment when calling cmake during the configure step. However, the
actual implementation in pkg-cmake passes HOST_<pkg>_CONF_ENV when
configuring the host variant of a cmake package, but does not pass
<pkg>_CONF_ENV when configuring the target variant of a cmake package.

This commit fixes that by passing <pkg>_CONF_ENV in the environment as
expected. It should not cause any behavior change, because this
feature is in fact not used by any package in upstream Buildroot:

$ grep CONF_ENV $(git grep -l cmake-package package/)
package/pkg-cmake.mk:$(2)_CONF_ENV			?=
package/pkg-cmake.mk:	$$($$(PKG)_CONF_ENV) $$(BR2_CMAKE) $$($$(PKG)_SRCDIR) \
package/pkg-cmake.mk:	$$($$(PKG)_CONF_ENV) $$(BR2_CMAKE) $$($$(PKG)_SRCDIR) \

This issue was reported by Olivier <ovalentin@awox.com> as bug #9616.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/pkg-cmake.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Yann E. MORIN Feb. 26, 2017, 5:58 p.m. UTC | #1
Thomas, All,

On 2017-02-26 18:42 +0100, Thomas Petazzoni spake thusly:
> The Buildroot manual documents that <pkg>_CONF_ENV is passed in the
> environment when calling cmake during the configure step. However, the
> actual implementation in pkg-cmake passes HOST_<pkg>_CONF_ENV when
> configuring the host variant of a cmake package, but does not pass
> <pkg>_CONF_ENV when configuring the target variant of a cmake package.
> 
> This commit fixes that by passing <pkg>_CONF_ENV in the environment as
> expected. It should not cause any behavior change, because this
> feature is in fact not used by any package in upstream Buildroot:
> 
> $ grep CONF_ENV $(git grep -l cmake-package package/)
> package/pkg-cmake.mk:$(2)_CONF_ENV			?=
> package/pkg-cmake.mk:	$$($$(PKG)_CONF_ENV) $$(BR2_CMAKE) $$($$(PKG)_SRCDIR) \
> package/pkg-cmake.mk:	$$($$(PKG)_CONF_ENV) $$(BR2_CMAKE) $$($$(PKG)_SRCDIR) \
> 
> This issue was reported by Olivier <ovalentin@awox.com> as bug #9616.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
>  package/pkg-cmake.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
> index 4e0e838..a7c8dc3 100644
> --- a/package/pkg-cmake.mk
> +++ b/package/pkg-cmake.mk
> @@ -109,7 +109,7 @@ define $(2)_CONFIGURE_CMDS
>  	cd $$($$(PKG)_BUILDDIR) && \
>  	rm -f CMakeCache.txt && \
>  	PATH=$$(BR_PATH) \
> -	$$(BR2_CMAKE) $$($$(PKG)_SRCDIR) \
> +	$$($$(PKG)_CONF_ENV) $$(BR2_CMAKE) $$($$(PKG)_SRCDIR) \

I would have written the extra env on its own line, like is done in e.g.
pkg-autotools:

    [...]
    PATH=$$(BR_PATH) \
    $$($$(PKG)_CONF_ENV) \
    $$(BR2_CMAKE) $$($$(PKG)_SRCDIR) \
    [...]

Otherwise;

Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Regards,
Yann E. MORIN.

>  		-DCMAKE_INSTALL_SO_NO_EXE=0 \
>  		-DCMAKE_FIND_ROOT_PATH="$$(HOST_DIR)" \
>  		-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM="BOTH" \
> -- 
> 2.7.4
> 
> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
Thomas Petazzoni Feb. 26, 2017, 6:02 p.m. UTC | #2
Hello,

On Sun, 26 Feb 2017 18:58:48 +0100, Yann E. MORIN wrote:

> > diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
> > index 4e0e838..a7c8dc3 100644
> > --- a/package/pkg-cmake.mk
> > +++ b/package/pkg-cmake.mk
> > @@ -109,7 +109,7 @@ define $(2)_CONFIGURE_CMDS
> >  	cd $$($$(PKG)_BUILDDIR) && \
> >  	rm -f CMakeCache.txt && \
> >  	PATH=$$(BR_PATH) \
> > -	$$(BR2_CMAKE) $$($$(PKG)_SRCDIR) \
> > +	$$($$(PKG)_CONF_ENV) $$(BR2_CMAKE) $$($$(PKG)_SRCDIR) \  
> 
> I would have written the extra env on its own line, like is done in e.g.
> pkg-autotools:

Expect that's not how it's done currently for the host variant of
pkg-cmake, i.e it's done like I'm proposing in my patch. So for
consistency, I prefer my option (and possibly a follow-up patch making
both the host and target variant consistent with pkg-autotools.mk).

Thanks!

Thomas
Peter Korsgaard Feb. 26, 2017, 9:40 p.m. UTC | #3
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

 > The Buildroot manual documents that <pkg>_CONF_ENV is passed in the
 > environment when calling cmake during the configure step. However, the
 > actual implementation in pkg-cmake passes HOST_<pkg>_CONF_ENV when
 > configuring the host variant of a cmake package, but does not pass
 > <pkg>_CONF_ENV when configuring the target variant of a cmake package.

 > This commit fixes that by passing <pkg>_CONF_ENV in the environment as
 > expected. It should not cause any behavior change, because this
 > feature is in fact not used by any package in upstream Buildroot:

 > $ grep CONF_ENV $(git grep -l cmake-package package/)
 > package/pkg-cmake.mk:$(2)_CONF_ENV			?=
 > package/pkg-cmake.mk:	$$($$(PKG)_CONF_ENV) $$(BR2_CMAKE) $$($$(PKG)_SRCDIR) \
 > package/pkg-cmake.mk:	$$($$(PKG)_CONF_ENV) $$(BR2_CMAKE) $$($$(PKG)_SRCDIR) \

 > This issue was reported by Olivier <ovalentin@awox.com> as bug #9616.

 > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Committed, thanks.
diff mbox

Patch

diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
index 4e0e838..a7c8dc3 100644
--- a/package/pkg-cmake.mk
+++ b/package/pkg-cmake.mk
@@ -109,7 +109,7 @@  define $(2)_CONFIGURE_CMDS
 	cd $$($$(PKG)_BUILDDIR) && \
 	rm -f CMakeCache.txt && \
 	PATH=$$(BR_PATH) \
-	$$(BR2_CMAKE) $$($$(PKG)_SRCDIR) \
+	$$($$(PKG)_CONF_ENV) $$(BR2_CMAKE) $$($$(PKG)_SRCDIR) \
 		-DCMAKE_INSTALL_SO_NO_EXE=0 \
 		-DCMAKE_FIND_ROOT_PATH="$$(HOST_DIR)" \
 		-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM="BOTH" \