summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorAbdoulaye Walsimou Gaye <awg@embtoolkit.org>2012-01-15 12:24:31 +0100
committerAbdoulaye Walsimou Gaye <awg@embtoolkit.org>2012-01-15 12:24:31 +0100
commitdec7ba98333dcf69a97ea8a22583171fbe035e00 (patch)
treec9093c836df3071b368c7ba1a05ab96adb35dfff /mk
parentebeb7a5dc4451545d24a51f2f21a3a0fe15f36a8 (diff)
downloadembtoolkit-dec7ba98333dcf69a97ea8a22583171fbe035e00.tar.gz
embtoolkit-dec7ba98333dcf69a97ea8a22583171fbe035e00.tar.bz2
embtoolkit-dec7ba98333dcf69a97ea8a22583171fbe035e00.tar.xz
Packages: zlib: separate zlib and zlib_host to avoid unmet dependency EMBTK_HAVE_ROOTFS
Signed-off-by: Abdoulaye Walsimou Gaye <awg@embtoolkit.org>
Diffstat (limited to 'mk')
-rw-r--r--mk/macros.packages.mk1
-rw-r--r--mk/packages.mk5
-rw-r--r--mk/zlib_host.mk61
3 files changed, 67 insertions, 0 deletions
diff --git a/mk/macros.packages.mk b/mk/macros.packages.mk
index 5be7470..4b3e903 100644
--- a/mk/macros.packages.mk
+++ b/mk/macros.packages.mk
@@ -250,6 +250,7 @@ endef
define __embtk_print_configure_opts
$(if $(strip $(1)),
$(call embtk_echo_blue,"Configure options:$(strip $(1))") | sed "s/\(--\)/\n\t\1/g")
+ echo
endef
define embtk_configure_pkg
$(if $(EMBTK_BUILDSYS_DEBUG),
diff --git a/mk/packages.mk b/mk/packages.mk
index 3bdc9f4..7e9be1b 100644
--- a/mk/packages.mk
+++ b/mk/packages.mk
@@ -32,6 +32,11 @@ include $(EMBTK_ROOT)/mk/mkimage.mk
include $(EMBTK_ROOT)/mk/mtd-utils.mk
include $(EMBTK_ROOT)/mk/pkgconfig.mk
+include $(EMBTK_ROOT)/mk/zlib_host.mk
+HOSTTOOLS_COMPONENTS-$(CONFIG_EMBTK_HOST_HAVE_ZLIB) += zlib_host_install
+
+
+
#
# Packages for TARGET and HOST
#
diff --git a/mk/zlib_host.mk b/mk/zlib_host.mk
new file mode 100644
index 0000000..1d5b87c
--- /dev/null
+++ b/mk/zlib_host.mk
@@ -0,0 +1,61 @@
+################################################################################
+# Embtoolkit
+# Copyright(C) 2009-2012 Abdoulaye Walsimou GAYE.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+################################################################################
+#
+# \file zlib_host.mk
+# \brief zlib_host.mk of Embtoolkit.
+# \author Abdoulaye Walsimou GAYE <awg@embtoolkit.org>
+# \date June 2009
+################################################################################
+
+ZLIB_HOST_NAME := zlib
+ZLIB_HOST_VERSION := $(call embtk_get_pkgversion,zlib_host)
+ZLIB_HOST_SITE := http://zlib.net
+ZLIB_HOST_PACKAGE := zlib-$(ZLIB_HOST_VERSION).tar.bz2
+ZLIB_HOST_SRC_DIR := $(TOOLS_BUILD)/zlib-$(ZLIB_HOST_VERSION)
+ZLIB_HOST_BUILD_DIR := $(TOOLS_BUILD)/zlib-$(ZLIB_HOST_VERSION)
+
+ZLIB_HOST_CONFIGURE_ENV := CC=$(HOSTCC_CACHED)
+
+zlib_host_install:
+ $(Q)test -e $(ZLIB_HOST_BUILD_DIR)/.installed || \
+ $(MAKE) $(ZLIB_HOST_BUILD_DIR)/.installed
+
+$(ZLIB_HOST_BUILD_DIR)/.installed: download_zlib_host \
+ $(ZLIB_HOST_SRC_DIR)/.decompressed \
+ $(ZLIB_HOST_BUILD_DIR)/.configured
+ $(embtk_pinfo,"Compile/Install $(ZLIB_HOST_PACKAGE) for host")
+ $(Q)$(MAKE) -C $(ZLIB_HOST_BUILD_DIR) $(J)
+ $(Q)$(MAKE) -C $(ZLIB_HOST_BUILD_DIR) install
+ $(Q)touch $@
+
+$(ZLIB_HOST_SRC_DIR)/.decompressed:
+ $(call embtk_decompress_pkg,zlib_host)
+
+$(ZLIB_HOST_BUILD_DIR)/.configured:
+ $(call embtk_pinfo,"Configure $(ZLIB_HOST_PACKAGE) for host...")
+ $(Q)cd $(ZLIB_HOST_BUILD_DIR); \
+ CPPFLAGS="-I$(HOSTTOOLS)/usr/include" \
+ LDFLAGS="-L$(HOSTTOOLS)/$(LIBDIR) -L$(HOSTTOOLS)/usr/$(LIBDIR)" \
+ $(ZLIB_HOST_CONFIGURE_ENV) \
+ $(CONFIG_SHELL) $(ZLIB_HOST_SRC_DIR)/configure \
+ --prefix=$(HOSTTOOLS)/usr $(ZLIB_HOST_CONFIGURE_OPTS)
+ $(Q)touch $@
+
+zlib_host_clean:
+ $(call embtk_pinfo,"Clean up zlib for host")