summaryrefslogtreecommitdiff
path: root/core/mk/pkg-macros/configure.mk
diff options
context:
space:
mode:
authorAbdoulaye Walsimou Gaye <awg@embtoolkit.org>2014-05-10 20:39:13 +0200
committerAbdoulaye Walsimou Gaye <awg@embtoolkit.org>2014-05-10 20:47:49 +0200
commit5de829c9ee3bd76012df0a73e66ba1ea7a435c66 (patch)
treefe72ed0f42156b0d3415ed2653226c8df02b6752 /core/mk/pkg-macros/configure.mk
parent5d44167723c5b863b69f9fa08a9e220e941a44d7 (diff)
downloadembtoolkit-5de829c9ee3bd76012df0a73e66ba1ea7a435c66.tar.gz
embtoolkit-5de829c9ee3bd76012df0a73e66ba1ea7a435c66.tar.bz2
embtoolkit-5de829c9ee3bd76012df0a73e66ba1ea7a435c66.tar.xz
Build system: Initial support of waf build system for host/taget packages
This patch adds initial support of waf build syste. Beside other requirements the packages using this build system feature are required to: - Define in their .kconfig file config EMBTK_PACKAGENAME_USE_WAF bool default y select EMBTK_HOST_HAVE_WAF - Have waf commands: configure build install Signed-off-by: Abdoulaye Walsimou Gaye <awg@embtoolkit.org>
Diffstat (limited to 'core/mk/pkg-macros/configure.mk')
-rw-r--r--core/mk/pkg-macros/configure.mk57
1 files changed, 57 insertions, 0 deletions
diff --git a/core/mk/pkg-macros/configure.mk b/core/mk/pkg-macros/configure.mk
index 1485d5f..2761c7b 100644
--- a/core/mk/pkg-macros/configure.mk
+++ b/core/mk/pkg-macros/configure.mk
@@ -143,3 +143,60 @@ define embtk_configure_hostpkg
$(__embtk_pkg_configureopts)
$(Q)$(call __embtk_setconfigured_pkg,$(1))
endef
+
+#
+#
+# Usage:
+# $(call embtk_wafconfigure_pkg,xxxx)
+#
+define embtk_wafconfigure_pkg
+ $(Q)test -e $(__embtk_pkg_srcdir)/wscript || exit 1
+ $(call __embtk_print_configure_opts,$(__embtk_pkg_configureopts))
+ $(Q)cd $(__embtk_pkg_srcdir); \
+ $(__embtk_pkg_cc) \
+ $(__embtk_pkg_cxx) \
+ AR=$(TARGETAR) \
+ RANLIB=$(TARGETRANLIB) \
+ AS=$(CROSS_COMPILE)as \
+ NM=$(TARGETNM) \
+ STRIP=$(TARGETSTRIP) \
+ OBJDUMP=$(TARGETOBJDUMP) \
+ OBJCOPY=$(TARGETOBJCOPY) \
+ CFLAGS="$(__embtk_pkg_cflags) $(TARGET_CFLAGS)" \
+ CXXFLAGS="$(__embtk_pkg_cxxflags) $(TARGET_CXXFLAGS)" \
+ LDFLAGS="$(__embtk_pkg_ildflags) $(__embtk_pkg_ldflags)" \
+ CPPFLAGS="-I$(embtk_sysroot)/usr/include $(__embtk_pkg_cppflags)" \
+ PKG_CONFIG="$(PKGCONFIG_BIN)" \
+ PKG_CONFIG_PATH="$(EMBTK_PKG_CONFIG_PATH)" \
+ PKG_CONFIG_LIBDIR="$(EMBTK_PKG_CONFIG_LIBDIR)" \
+ $(__embtk_pkg_configureenv) $(__embtk_pkg_scanbuild) \
+ $(embtk_waf) configure \
+ --prefix=/usr \
+ --out=$(__embtk_pkg_builddir) \
+ $(__embtk_pkg_configureopts)
+ $(Q)$(call __embtk_setconfigured_pkg,$(1))
+endef
+
+#
+#
+# Usage:
+# $(call embtk_wafconfigure_hostpkg,xxxx)
+#
+define embtk_wafconfigure_hostpkg
+ $(Q)test -e $(__embtk_pkg_srcdir)/wscript || exit 1
+ $(call __embtk_print_configure_opts,$(__embtk_pkg_configureopts))
+ $(Q)cd $(__embtk_pkg_srcdir); \
+ CPPFLAGS="$(__embtk_hostpkg_cppflags)" \
+ LDFLAGS="$(__embtk_hostpkg_ldflags)" \
+ PKG_CONFIG="$(PKGCONFIG_BIN)" \
+ PKG_CONFIG_PATH="$(EMBTK_HOST_PKG_CONFIG_PATH)" \
+ $(if $(__embtk_pkg_noccache),,CC=$(HOSTCC_CACHED)) \
+ $(if $(__embtk_pkg_noccache),,CXX=$(HOSTCXX_CACHED)) \
+ $(__embtk_pkg_configureenv) \
+ $(embtk_waf) configure \
+ --prefix=$(strip $(if $(__embtk_pkg_prefix), \
+ $(__embtk_pkg_prefix),$(embtk_htools)/usr)) \
+ --out=$(__embtk_pkg_builddir) \
+ $(__embtk_pkg_configureopts)
+ $(Q)$(call __embtk_setconfigured_pkg,$(1))
+endef