* [Buildroot] [PATCH v1 1/2] package/pkg-meson: change to use <PKG>_BUILDDIR
@ 2019-05-02 20:14 Peter Seiderer
2019-05-02 20:14 ` [Buildroot] [PATCH v1 2/2] package/pkg-meson: change to use upper-case package name as parameter Peter Seiderer
2019-05-03 8:34 ` [Buildroot] [PATCH v1 1/2] package/pkg-meson: change to use <PKG>_BUILDDIR Arnout Vandecappelle
0 siblings, 2 replies; 5+ messages in thread
From: Peter Seiderer @ 2019-05-02 20:14 UTC (permalink / raw)
To: buildroot
Change to use <PKG>_BUILDDIR (and change from <PKG>_SRCDIR/build
to <PKG>_SRCDIR/buildroot-build as in package/pkg-cmake.mk).
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
Notes:
- suggested change by Arnout Vandecappelle
- <PKG>_SRCDIR seems to contain already an trailing '/', so
<PKG>_BUILDDIR gets an double '//' path seperator
---
package/pkg-meson.mk | 28 +++++++++++++++-------------
1 file changed, 15 insertions(+), 13 deletions(-)
diff --git a/package/pkg-meson.mk b/package/pkg-meson.mk
index 886fcf7205..597c48b90a 100644
--- a/package/pkg-meson.mk
+++ b/package/pkg-meson.mk
@@ -49,6 +49,8 @@ $(2)_CONF_ENV ?=
$(2)_CONF_OPTS ?=
$(2)_NINJA_ENV ?=
+$(2)_BUILDDIR ?= $$($(2)_SRCDIR)/buildroot-build
+
#
# Configure step. Only define it if not already defined by the package
# .mk file. And take care of the differences between host and target
@@ -61,8 +63,8 @@ ifeq ($(4),target)
#
#
define $(2)_CONFIGURE_CMDS
- rm -rf $$($$(PKG)_SRCDIR)/build
- mkdir -p $$($$(PKG)_SRCDIR)/build
+ rm -rf $$($$(PKG)_BUILDDIR)
+ mkdir -p $$($$(PKG)_BUILDDIR)
sed -e "s%@TARGET_CROSS@%$$(TARGET_CROSS)%g" \
-e "s%@TARGET_ARCH@%$$(HOST_MESON_TARGET_CPU_FAMILY)%g" \
-e "s%@TARGET_CPU@%$$(GCC_TARGET_CPU)%g" \
@@ -72,22 +74,22 @@ define $(2)_CONFIGURE_CMDS
-e "s%@TARGET_CXXFLAGS@%$$(HOST_MESON_SED_CXXFLAGS)%g" \
-e "s%@HOST_DIR@%$$(HOST_DIR)%g" \
package/meson/cross-compilation.conf.in \
- > $$($$(PKG)_SRCDIR)/build/cross-compilation.conf
+ > $$($$(PKG)_BUILDDIR)/cross-compilation.conf
PATH=$$(BR_PATH) $$($$(PKG)_CONF_ENV) $$(MESON) \
--prefix=/usr \
--libdir=lib \
--default-library=$(if $(BR2_STATIC_LIBS),static,shared) \
--buildtype=$(if $(BR2_ENABLE_DEBUG),debug,release) \
- --cross-file=$$($$(PKG)_SRCDIR)/build/cross-compilation.conf \
+ --cross-file=$$($$(PKG)_BUILDDIR)/cross-compilation.conf \
$$($$(PKG)_CONF_OPTS) \
- $$($$(PKG)_SRCDIR) $$($$(PKG)_SRCDIR)/build
+ $$($$(PKG)_SRCDIR) $$($$(PKG)_BUILDDIR)
endef
else
# Configure package for host
define $(2)_CONFIGURE_CMDS
- rm -rf $$($$(PKG)_SRCDIR)/build
- mkdir -p $$($$(PKG)_SRCDIR)/build
+ rm -rf $$($$(PKG)_BUILDDIR)
+ mkdir -p $$($$(PKG)_BUILDDIR)
$$(HOST_CONFIGURE_OPTS) \
$$($$(PKG)_CONF_ENV) $$(MESON) \
--prefix=$$(HOST_DIR) \
@@ -97,7 +99,7 @@ define $(2)_CONFIGURE_CMDS
--default-library=shared \
--buildtype=release \
$$($$(PKG)_CONF_OPTS) \
- $$($$(PKG)_SRCDIR) $$($$(PKG)_SRCDIR)/build
+ $$($$(PKG)_SRCDIR) $$($$(PKG)_BUILDDIR)
endef
endif
endif
@@ -112,12 +114,12 @@ ifndef $(2)_BUILD_CMDS
ifeq ($(4),target)
define $(2)_BUILD_CMDS
$$(TARGET_MAKE_ENV) $$($$(PKG)_NINJA_ENV) \
- $$(NINJA) $$(NINJA_OPTS) $$($$(PKG)_NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build
+ $$(NINJA) $$(NINJA_OPTS) $$($$(PKG)_NINJA_OPTS) -C $$($$(PKG)_BUILDDIR)
endef
else
define $(2)_BUILD_CMDS
$$(HOST_MAKE_ENV) $$($$(PKG)_NINJA_ENV) \
- $$(NINJA) $$(NINJA_OPTS) $$($$(PKG)_NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build
+ $$(NINJA) $$(NINJA_OPTS) $$($$(PKG)_NINJA_OPTS) -C $$($$(PKG)_BUILDDIR)
endef
endif
endif
@@ -129,7 +131,7 @@ endif
ifndef $(2)_INSTALL_CMDS
define $(2)_INSTALL_CMDS
$$(HOST_MAKE_ENV) $$($$(PKG)_NINJA_ENV) \
- $$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build install
+ $$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_BUILDDIR) install
endef
endif
@@ -140,7 +142,7 @@ endif
ifndef $(2)_INSTALL_STAGING_CMDS
define $(2)_INSTALL_STAGING_CMDS
$$(TARGET_MAKE_ENV) $$($$(PKG)_NINJA_ENV) DESTDIR=$$(STAGING_DIR) \
- $$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build install
+ $$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_BUILDDIR) install
endef
endif
@@ -151,7 +153,7 @@ endif
ifndef $(2)_INSTALL_TARGET_CMDS
define $(2)_INSTALL_TARGET_CMDS
$$(TARGET_MAKE_ENV) $$($$(PKG)_NINJA_ENV) DESTDIR=$$(TARGET_DIR) \
- $$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build install
+ $$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_BUILDDIR) install
endef
endif
--
2.21.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* [Buildroot] [PATCH v1 2/2] package/pkg-meson: change to use upper-case package name as parameter
2019-05-02 20:14 [Buildroot] [PATCH v1 1/2] package/pkg-meson: change to use <PKG>_BUILDDIR Peter Seiderer
@ 2019-05-02 20:14 ` Peter Seiderer
2019-05-03 8:53 ` Arnout Vandecappelle
2019-05-03 8:34 ` [Buildroot] [PATCH v1 1/2] package/pkg-meson: change to use <PKG>_BUILDDIR Arnout Vandecappelle
1 sibling, 1 reply; 5+ messages in thread
From: Peter Seiderer @ 2019-05-02 20:14 UTC (permalink / raw)
To: buildroot
Change to use upper-case package name as parameter, rather than expect
it from a variable.
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
Notes:
- suggested by Arnout Vandecappelle
---
package/pkg-meson.mk | 44 ++++++++++++++++++++++----------------------
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/package/pkg-meson.mk b/package/pkg-meson.mk
index 597c48b90a..09d98d61a7 100644
--- a/package/pkg-meson.mk
+++ b/package/pkg-meson.mk
@@ -63,8 +63,8 @@ ifeq ($(4),target)
#
#
define $(2)_CONFIGURE_CMDS
- rm -rf $$($$(PKG)_BUILDDIR)
- mkdir -p $$($$(PKG)_BUILDDIR)
+ rm -rf $$($(2)_BUILDDIR)
+ mkdir -p $$($(2)_BUILDDIR)
sed -e "s%@TARGET_CROSS@%$$(TARGET_CROSS)%g" \
-e "s%@TARGET_ARCH@%$$(HOST_MESON_TARGET_CPU_FAMILY)%g" \
-e "s%@TARGET_CPU@%$$(GCC_TARGET_CPU)%g" \
@@ -74,32 +74,32 @@ define $(2)_CONFIGURE_CMDS
-e "s%@TARGET_CXXFLAGS@%$$(HOST_MESON_SED_CXXFLAGS)%g" \
-e "s%@HOST_DIR@%$$(HOST_DIR)%g" \
package/meson/cross-compilation.conf.in \
- > $$($$(PKG)_BUILDDIR)/cross-compilation.conf
- PATH=$$(BR_PATH) $$($$(PKG)_CONF_ENV) $$(MESON) \
+ > $$($(2)_BUILDDIR)/cross-compilation.conf
+ PATH=$$(BR_PATH) $$($(2)_CONF_ENV) $$(MESON) \
--prefix=/usr \
--libdir=lib \
--default-library=$(if $(BR2_STATIC_LIBS),static,shared) \
--buildtype=$(if $(BR2_ENABLE_DEBUG),debug,release) \
- --cross-file=$$($$(PKG)_BUILDDIR)/cross-compilation.conf \
- $$($$(PKG)_CONF_OPTS) \
- $$($$(PKG)_SRCDIR) $$($$(PKG)_BUILDDIR)
+ --cross-file=$$($(2)_BUILDDIR)/cross-compilation.conf \
+ $$($(2)_CONF_OPTS) \
+ $$($(2)_SRCDIR) $$($(2)_BUILDDIR)
endef
else
# Configure package for host
define $(2)_CONFIGURE_CMDS
- rm -rf $$($$(PKG)_BUILDDIR)
- mkdir -p $$($$(PKG)_BUILDDIR)
+ rm -rf $$($(2)_BUILDDIR)
+ mkdir -p $$($(2)_BUILDDIR)
$$(HOST_CONFIGURE_OPTS) \
- $$($$(PKG)_CONF_ENV) $$(MESON) \
+ $$($(2)_CONF_ENV) $$(MESON) \
--prefix=$$(HOST_DIR) \
--libdir=lib \
--sysconfdir=$$(HOST_DIR)/etc \
--localstatedir=$$(HOST_DIR)/var \
--default-library=shared \
--buildtype=release \
- $$($$(PKG)_CONF_OPTS) \
- $$($$(PKG)_SRCDIR) $$($$(PKG)_BUILDDIR)
+ $$($(2)_CONF_OPTS) \
+ $$($(2)_SRCDIR) $$($(2)_BUILDDIR)
endef
endif
endif
@@ -113,13 +113,13 @@ $(2)_DEPENDENCIES += host-meson
ifndef $(2)_BUILD_CMDS
ifeq ($(4),target)
define $(2)_BUILD_CMDS
- $$(TARGET_MAKE_ENV) $$($$(PKG)_NINJA_ENV) \
- $$(NINJA) $$(NINJA_OPTS) $$($$(PKG)_NINJA_OPTS) -C $$($$(PKG)_BUILDDIR)
+ $$(TARGET_MAKE_ENV) $$($(2)_NINJA_ENV) \
+ $$(NINJA) $$(NINJA_OPTS) $$($(2)_NINJA_OPTS) -C $$($(2)_BUILDDIR)
endef
else
define $(2)_BUILD_CMDS
- $$(HOST_MAKE_ENV) $$($$(PKG)_NINJA_ENV) \
- $$(NINJA) $$(NINJA_OPTS) $$($$(PKG)_NINJA_OPTS) -C $$($$(PKG)_BUILDDIR)
+ $$(HOST_MAKE_ENV) $$($(2)_NINJA_ENV) \
+ $$(NINJA) $$(NINJA_OPTS) $$($(2)_NINJA_OPTS) -C $$($(2)_BUILDDIR)
endef
endif
endif
@@ -130,8 +130,8 @@ endif
#
ifndef $(2)_INSTALL_CMDS
define $(2)_INSTALL_CMDS
- $$(HOST_MAKE_ENV) $$($$(PKG)_NINJA_ENV) \
- $$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_BUILDDIR) install
+ $$(HOST_MAKE_ENV) $$($(2)_NINJA_ENV) \
+ $$(NINJA) $$(NINJA_OPTS) -C $$($(2)_BUILDDIR) install
endef
endif
@@ -141,8 +141,8 @@ endif
#
ifndef $(2)_INSTALL_STAGING_CMDS
define $(2)_INSTALL_STAGING_CMDS
- $$(TARGET_MAKE_ENV) $$($$(PKG)_NINJA_ENV) DESTDIR=$$(STAGING_DIR) \
- $$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_BUILDDIR) install
+ $$(TARGET_MAKE_ENV) $$($(2)_NINJA_ENV) DESTDIR=$$(STAGING_DIR) \
+ $$(NINJA) $$(NINJA_OPTS) -C $$($(2)_BUILDDIR) install
endef
endif
@@ -152,8 +152,8 @@ endif
#
ifndef $(2)_INSTALL_TARGET_CMDS
define $(2)_INSTALL_TARGET_CMDS
- $$(TARGET_MAKE_ENV) $$($$(PKG)_NINJA_ENV) DESTDIR=$$(TARGET_DIR) \
- $$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_BUILDDIR) install
+ $$(TARGET_MAKE_ENV) $$($(2)_NINJA_ENV) DESTDIR=$$(TARGET_DIR) \
+ $$(NINJA) $$(NINJA_OPTS) -C $$($(2)_BUILDDIR) install
endef
endif
--
2.21.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Buildroot] [PATCH v1 2/2] package/pkg-meson: change to use upper-case package name as parameter
2019-05-02 20:14 ` [Buildroot] [PATCH v1 2/2] package/pkg-meson: change to use upper-case package name as parameter Peter Seiderer
@ 2019-05-03 8:53 ` Arnout Vandecappelle
0 siblings, 0 replies; 5+ messages in thread
From: Arnout Vandecappelle @ 2019-05-03 8:53 UTC (permalink / raw)
To: buildroot
On 02/05/2019 22:14, Peter Seiderer wrote:
> Change to use upper-case package name as parameter, rather than expect
> it from a variable.
>
> Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> ---
> Notes:
> - suggested by Arnout Vandecappelle
We first need to get general agreement that this is the way to go.
We currently have 158 instances of $(PKG). 5 of those are in package .mk files
that could just as well use the package name directly - but they're less
important. 7 are in various places outside of the package infra where it makes
complete sense to use $(PKG) because the package name is not statically "known".
About 40 are in the generic and other package infra rules, where it was
originally intended for. Roughly 100 are inside infra context where they can be
directly replaced with $(2). And then there are about 10 in the autotools infra
where it is used inside a hook, where we could choose to turn the hooks into
calls with $(1) == $($(PKG)_NAME) and $(2) == $(PKG).
So, do we really want this churn? And does it make sense to begin with to
prefer $(2) over $(PKG)?
Regards,
Arnout
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Buildroot] [PATCH v1 1/2] package/pkg-meson: change to use <PKG>_BUILDDIR
2019-05-02 20:14 [Buildroot] [PATCH v1 1/2] package/pkg-meson: change to use <PKG>_BUILDDIR Peter Seiderer
2019-05-02 20:14 ` [Buildroot] [PATCH v1 2/2] package/pkg-meson: change to use upper-case package name as parameter Peter Seiderer
@ 2019-05-03 8:34 ` Arnout Vandecappelle
2019-05-03 18:10 ` Peter Seiderer
1 sibling, 1 reply; 5+ messages in thread
From: Arnout Vandecappelle @ 2019-05-03 8:34 UTC (permalink / raw)
To: buildroot
On 02/05/2019 22:14, Peter Seiderer wrote:
> Change to use <PKG>_BUILDDIR (and change from <PKG>_SRCDIR/build
> to <PKG>_SRCDIR/buildroot-build as in package/pkg-cmake.mk).
Could you do a build-test of BR2_PACKAGE_SYSTEMD_BOOT=y ? I believe it will fail...
There may be others as well. You should check all meson packages if they refer
to the build directory.
> Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> ---
> Notes:
> - suggested change by Arnout Vandecappelle
> - <PKG>_SRCDIR seems to contain already an trailing '/', so
> <PKG>_BUILDDIR gets an double '//' path seperator
$(2)_SRCDIR = $$($(2)_DIR)/$$($(2)_SUBDIR)
_SUBDIR is usually empty.
You can't simply remove the / for the case where _SUBDIR is not empty.
If we really want to avoid it, we could change that into
$(2)_SRCDIR = $$($(2)_DIR)$$(if $$($(2)_SUBDIR),/$$($(2)_SUBDIR))
but I don't think it's worth it.
Regards,
Arnout
> ---
> package/pkg-meson.mk | 28 +++++++++++++++-------------
> 1 file changed, 15 insertions(+), 13 deletions(-)
>
> diff --git a/package/pkg-meson.mk b/package/pkg-meson.mk
> index 886fcf7205..597c48b90a 100644
> --- a/package/pkg-meson.mk
> +++ b/package/pkg-meson.mk
> @@ -49,6 +49,8 @@ $(2)_CONF_ENV ?=
> $(2)_CONF_OPTS ?=
> $(2)_NINJA_ENV ?=
>
> +$(2)_BUILDDIR ?= $$($(2)_SRCDIR)/buildroot-build
> +
> #
> # Configure step. Only define it if not already defined by the package
> # .mk file. And take care of the differences between host and target
> @@ -61,8 +63,8 @@ ifeq ($(4),target)
> #
> #
> define $(2)_CONFIGURE_CMDS
> - rm -rf $$($$(PKG)_SRCDIR)/build
> - mkdir -p $$($$(PKG)_SRCDIR)/build
> + rm -rf $$($$(PKG)_BUILDDIR)
> + mkdir -p $$($$(PKG)_BUILDDIR)
> sed -e "s%@TARGET_CROSS@%$$(TARGET_CROSS)%g" \
> -e "s%@TARGET_ARCH@%$$(HOST_MESON_TARGET_CPU_FAMILY)%g" \
> -e "s%@TARGET_CPU@%$$(GCC_TARGET_CPU)%g" \
> @@ -72,22 +74,22 @@ define $(2)_CONFIGURE_CMDS
> -e "s%@TARGET_CXXFLAGS@%$$(HOST_MESON_SED_CXXFLAGS)%g" \
> -e "s%@HOST_DIR@%$$(HOST_DIR)%g" \
> package/meson/cross-compilation.conf.in \
> - > $$($$(PKG)_SRCDIR)/build/cross-compilation.conf
> + > $$($$(PKG)_BUILDDIR)/cross-compilation.conf
> PATH=$$(BR_PATH) $$($$(PKG)_CONF_ENV) $$(MESON) \
> --prefix=/usr \
> --libdir=lib \
> --default-library=$(if $(BR2_STATIC_LIBS),static,shared) \
> --buildtype=$(if $(BR2_ENABLE_DEBUG),debug,release) \
> - --cross-file=$$($$(PKG)_SRCDIR)/build/cross-compilation.conf \
> + --cross-file=$$($$(PKG)_BUILDDIR)/cross-compilation.conf \
> $$($$(PKG)_CONF_OPTS) \
> - $$($$(PKG)_SRCDIR) $$($$(PKG)_SRCDIR)/build
> + $$($$(PKG)_SRCDIR) $$($$(PKG)_BUILDDIR)
> endef
> else
>
> # Configure package for host
> define $(2)_CONFIGURE_CMDS
> - rm -rf $$($$(PKG)_SRCDIR)/build
> - mkdir -p $$($$(PKG)_SRCDIR)/build
> + rm -rf $$($$(PKG)_BUILDDIR)
> + mkdir -p $$($$(PKG)_BUILDDIR)
> $$(HOST_CONFIGURE_OPTS) \
> $$($$(PKG)_CONF_ENV) $$(MESON) \
> --prefix=$$(HOST_DIR) \
> @@ -97,7 +99,7 @@ define $(2)_CONFIGURE_CMDS
> --default-library=shared \
> --buildtype=release \
> $$($$(PKG)_CONF_OPTS) \
> - $$($$(PKG)_SRCDIR) $$($$(PKG)_SRCDIR)/build
> + $$($$(PKG)_SRCDIR) $$($$(PKG)_BUILDDIR)
> endef
> endif
> endif
> @@ -112,12 +114,12 @@ ifndef $(2)_BUILD_CMDS
> ifeq ($(4),target)
> define $(2)_BUILD_CMDS
> $$(TARGET_MAKE_ENV) $$($$(PKG)_NINJA_ENV) \
> - $$(NINJA) $$(NINJA_OPTS) $$($$(PKG)_NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build
> + $$(NINJA) $$(NINJA_OPTS) $$($$(PKG)_NINJA_OPTS) -C $$($$(PKG)_BUILDDIR)
> endef
> else
> define $(2)_BUILD_CMDS
> $$(HOST_MAKE_ENV) $$($$(PKG)_NINJA_ENV) \
> - $$(NINJA) $$(NINJA_OPTS) $$($$(PKG)_NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build
> + $$(NINJA) $$(NINJA_OPTS) $$($$(PKG)_NINJA_OPTS) -C $$($$(PKG)_BUILDDIR)
> endef
> endif
> endif
> @@ -129,7 +131,7 @@ endif
> ifndef $(2)_INSTALL_CMDS
> define $(2)_INSTALL_CMDS
> $$(HOST_MAKE_ENV) $$($$(PKG)_NINJA_ENV) \
> - $$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build install
> + $$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_BUILDDIR) install
> endef
> endif
>
> @@ -140,7 +142,7 @@ endif
> ifndef $(2)_INSTALL_STAGING_CMDS
> define $(2)_INSTALL_STAGING_CMDS
> $$(TARGET_MAKE_ENV) $$($$(PKG)_NINJA_ENV) DESTDIR=$$(STAGING_DIR) \
> - $$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build install
> + $$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_BUILDDIR) install
> endef
> endif
>
> @@ -151,7 +153,7 @@ endif
> ifndef $(2)_INSTALL_TARGET_CMDS
> define $(2)_INSTALL_TARGET_CMDS
> $$(TARGET_MAKE_ENV) $$($$(PKG)_NINJA_ENV) DESTDIR=$$(TARGET_DIR) \
> - $$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build install
> + $$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_BUILDDIR) install
> endef
> endif
>
> --
> 2.21.0
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Buildroot] [PATCH v1 1/2] package/pkg-meson: change to use <PKG>_BUILDDIR
2019-05-03 8:34 ` [Buildroot] [PATCH v1 1/2] package/pkg-meson: change to use <PKG>_BUILDDIR Arnout Vandecappelle
@ 2019-05-03 18:10 ` Peter Seiderer
0 siblings, 0 replies; 5+ messages in thread
From: Peter Seiderer @ 2019-05-03 18:10 UTC (permalink / raw)
To: buildroot
Hello Arnout,
On Fri, 3 May 2019 10:34:47 +0200, Arnout Vandecappelle <arnout@mind.be> wrote:
> On 02/05/2019 22:14, Peter Seiderer wrote:
> > Change to use <PKG>_BUILDDIR (and change from <PKG>_SRCDIR/build
> > to <PKG>_SRCDIR/buildroot-build as in package/pkg-cmake.mk).
>
> Could you do a build-test of BR2_PACKAGE_SYSTEMD_BOOT=y ? I believe it will fail...
Thanks for the hint (one more time libdrm only is not sufficient for meson changes
test), it fails because of the build vs. buildroot-build change, will add an
additional change on the next patch iteration...
>
> There may be others as well. You should check all meson packages if they refer
> to the build directory.
Checked, systemd is the only package affected...
>
>
> > Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> > ---
> > Notes:
> > - suggested change by Arnout Vandecappelle
> > - <PKG>_SRCDIR seems to contain already an trailing '/', so
> > <PKG>_BUILDDIR gets an double '//' path seperator
>
> $(2)_SRCDIR = $$($(2)_DIR)/$$($(2)_SUBDIR)
>
> _SUBDIR is usually empty.
>
> You can't simply remove the / for the case where _SUBDIR is not empty.
>
> If we really want to avoid it, we could change that into
>
>
> $(2)_SRCDIR = $$($(2)_DIR)$$(if $$($(2)_SUBDIR),/$$($(2)_SUBDIR))
>
> but I don't think it's worth it.
Will test it (and suggest an patch in case it works, it always catches my attention
when a // traverses the console)...
Regards,
Peter
>
> Regards,
> Arnout
>
> > ---
> > package/pkg-meson.mk | 28 +++++++++++++++-------------
> > 1 file changed, 15 insertions(+), 13 deletions(-)
> >
> > diff --git a/package/pkg-meson.mk b/package/pkg-meson.mk
> > index 886fcf7205..597c48b90a 100644
> > --- a/package/pkg-meson.mk
> > +++ b/package/pkg-meson.mk
> > @@ -49,6 +49,8 @@ $(2)_CONF_ENV ?=
> > $(2)_CONF_OPTS ?=
> > $(2)_NINJA_ENV ?=
> >
> > +$(2)_BUILDDIR ?= $$($(2)_SRCDIR)/buildroot-build
> > +
> > #
> > # Configure step. Only define it if not already defined by the package
> > # .mk file. And take care of the differences between host and target
> > @@ -61,8 +63,8 @@ ifeq ($(4),target)
> > #
> > #
> > define $(2)_CONFIGURE_CMDS
> > - rm -rf $$($$(PKG)_SRCDIR)/build
> > - mkdir -p $$($$(PKG)_SRCDIR)/build
> > + rm -rf $$($$(PKG)_BUILDDIR)
> > + mkdir -p $$($$(PKG)_BUILDDIR)
> > sed -e "s%@TARGET_CROSS@%$$(TARGET_CROSS)%g" \
> > -e "s%@TARGET_ARCH@%$$(HOST_MESON_TARGET_CPU_FAMILY)%g" \
> > -e "s%@TARGET_CPU@%$$(GCC_TARGET_CPU)%g" \
> > @@ -72,22 +74,22 @@ define $(2)_CONFIGURE_CMDS
> > -e "s%@TARGET_CXXFLAGS@%$$(HOST_MESON_SED_CXXFLAGS)%g" \
> > -e "s%@HOST_DIR@%$$(HOST_DIR)%g" \
> > package/meson/cross-compilation.conf.in \
> > - > $$($$(PKG)_SRCDIR)/build/cross-compilation.conf
> > + > $$($$(PKG)_BUILDDIR)/cross-compilation.conf
> > PATH=$$(BR_PATH) $$($$(PKG)_CONF_ENV) $$(MESON) \
> > --prefix=/usr \
> > --libdir=lib \
> > --default-library=$(if $(BR2_STATIC_LIBS),static,shared) \
> > --buildtype=$(if $(BR2_ENABLE_DEBUG),debug,release) \
> > - --cross-file=$$($$(PKG)_SRCDIR)/build/cross-compilation.conf \
> > + --cross-file=$$($$(PKG)_BUILDDIR)/cross-compilation.conf \
> > $$($$(PKG)_CONF_OPTS) \
> > - $$($$(PKG)_SRCDIR) $$($$(PKG)_SRCDIR)/build
> > + $$($$(PKG)_SRCDIR) $$($$(PKG)_BUILDDIR)
> > endef
> > else
> >
> > # Configure package for host
> > define $(2)_CONFIGURE_CMDS
> > - rm -rf $$($$(PKG)_SRCDIR)/build
> > - mkdir -p $$($$(PKG)_SRCDIR)/build
> > + rm -rf $$($$(PKG)_BUILDDIR)
> > + mkdir -p $$($$(PKG)_BUILDDIR)
> > $$(HOST_CONFIGURE_OPTS) \
> > $$($$(PKG)_CONF_ENV) $$(MESON) \
> > --prefix=$$(HOST_DIR) \
> > @@ -97,7 +99,7 @@ define $(2)_CONFIGURE_CMDS
> > --default-library=shared \
> > --buildtype=release \
> > $$($$(PKG)_CONF_OPTS) \
> > - $$($$(PKG)_SRCDIR) $$($$(PKG)_SRCDIR)/build
> > + $$($$(PKG)_SRCDIR) $$($$(PKG)_BUILDDIR)
> > endef
> > endif
> > endif
> > @@ -112,12 +114,12 @@ ifndef $(2)_BUILD_CMDS
> > ifeq ($(4),target)
> > define $(2)_BUILD_CMDS
> > $$(TARGET_MAKE_ENV) $$($$(PKG)_NINJA_ENV) \
> > - $$(NINJA) $$(NINJA_OPTS) $$($$(PKG)_NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build
> > + $$(NINJA) $$(NINJA_OPTS) $$($$(PKG)_NINJA_OPTS) -C $$($$(PKG)_BUILDDIR)
> > endef
> > else
> > define $(2)_BUILD_CMDS
> > $$(HOST_MAKE_ENV) $$($$(PKG)_NINJA_ENV) \
> > - $$(NINJA) $$(NINJA_OPTS) $$($$(PKG)_NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build
> > + $$(NINJA) $$(NINJA_OPTS) $$($$(PKG)_NINJA_OPTS) -C $$($$(PKG)_BUILDDIR)
> > endef
> > endif
> > endif
> > @@ -129,7 +131,7 @@ endif
> > ifndef $(2)_INSTALL_CMDS
> > define $(2)_INSTALL_CMDS
> > $$(HOST_MAKE_ENV) $$($$(PKG)_NINJA_ENV) \
> > - $$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build install
> > + $$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_BUILDDIR) install
> > endef
> > endif
> >
> > @@ -140,7 +142,7 @@ endif
> > ifndef $(2)_INSTALL_STAGING_CMDS
> > define $(2)_INSTALL_STAGING_CMDS
> > $$(TARGET_MAKE_ENV) $$($$(PKG)_NINJA_ENV) DESTDIR=$$(STAGING_DIR) \
> > - $$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build install
> > + $$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_BUILDDIR) install
> > endef
> > endif
> >
> > @@ -151,7 +153,7 @@ endif
> > ifndef $(2)_INSTALL_TARGET_CMDS
> > define $(2)_INSTALL_TARGET_CMDS
> > $$(TARGET_MAKE_ENV) $$($$(PKG)_NINJA_ENV) DESTDIR=$$(TARGET_DIR) \
> > - $$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_SRCDIR)/build install
> > + $$(NINJA) $$(NINJA_OPTS) -C $$($$(PKG)_BUILDDIR) install
> > endef
> > endif
> >
> > --
> > 2.21.0
> >
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-05-03 18:10 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-02 20:14 [Buildroot] [PATCH v1 1/2] package/pkg-meson: change to use <PKG>_BUILDDIR Peter Seiderer
2019-05-02 20:14 ` [Buildroot] [PATCH v1 2/2] package/pkg-meson: change to use upper-case package name as parameter Peter Seiderer
2019-05-03 8:53 ` Arnout Vandecappelle
2019-05-03 8:34 ` [Buildroot] [PATCH v1 1/2] package/pkg-meson: change to use <PKG>_BUILDDIR Arnout Vandecappelle
2019-05-03 18:10 ` Peter Seiderer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox