pkg-waf: add a common variable for each step
authorRomain Naour <romain.naour@gmail.com>
Tue, 6 Dec 2016 19:49:08 +0000 (20:49 +0100)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 11 Dec 2016 14:26:26 +0000 (15:26 +0100)
Some waf packages may want to pass additional variables to waf script
for each build step. Add the possibility to do so by defining
<pkg>_WAF_OPTS.

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/pkg-waf.mk

index f9d435e8791f791f660333a7c402d9efb7aba945..2cdd654b1b7283f83815a9cf19775f19434008f0 100644 (file)
@@ -52,6 +52,7 @@ endif
 $(2)_BUILD_OPTS                        ?=
 $(2)_INSTALL_STAGING_OPTS              ?=
 $(2)_INSTALL_TARGET_OPTS               ?=
+$(2)_WAF_OPTS                          ?=
 
 #
 # Configure step. Only define it if not already defined by the package
@@ -65,7 +66,8 @@ define $(2)_CONFIGURE_CMDS
        $$(HOST_DIR)/usr/bin/python2 $$($(2)_WAF) configure \
                --prefix=/usr \
                --libdir=/usr/lib \
-               $$($(2)_CONF_OPTS)
+               $$($(2)_CONF_OPTS) \
+               $$($(2)_WAF_OPTS)
 endef
 endif
 
@@ -77,7 +79,8 @@ ifndef $(2)_BUILD_CMDS
 define $(2)_BUILD_CMDS
        cd $$(@D) && \
        $$(TARGET_MAKE_ENV) $$(HOST_DIR)/usr/bin/python2 $$($(2)_WAF) \
-               build -j $$(PARALLEL_JOBS) $$($(2)_BUILD_OPTS)
+               build -j $$(PARALLEL_JOBS) $$($(2)_BUILD_OPTS) \
+               $$($(2)_WAF_OPTS)
 endef
 endif
 
@@ -90,7 +93,8 @@ define $(2)_INSTALL_STAGING_CMDS
        cd $$(@D) && \
        $$(TARGET_MAKE_ENV) $$(HOST_DIR)/usr/bin/python2 $$($(2)_WAF) \
                install --destdir=$$(STAGING_DIR) \
-               $$($(2)_INSTALL_STAGING_OPTS)
+               $$($(2)_INSTALL_STAGING_OPTS) \
+               $$($(2)_WAF_OPTS)
 endef
 endif
 
@@ -103,7 +107,8 @@ define $(2)_INSTALL_TARGET_CMDS
        cd $$(@D) && \
        $$(TARGET_MAKE_ENV) $$(HOST_DIR)/usr/bin/python2 $$($(2)_WAF) \
                install --destdir=$$(TARGET_DIR) \
-               $$($(2)_INSTALL_TARGET_OPTS)
+               $$($(2)_INSTALL_TARGET_OPTS) \
+               $$($(2)_WAF_OPTS)
 endef
 endif