zlib: enable compilation on the host
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sat, 20 Feb 2010 17:19:06 +0000 (18:19 +0100)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 23 Feb 2010 19:08:11 +0000 (20:08 +0100)
zlib is needed on the host, to build xlib_libfontenc on the host, to
build xapp_mkfontscale on the host, in order to finally build xfonts
encodings on the target.

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

index 743247309a942d856efa56e0ccc0547e473a235c..3144ae9fa1c058f7a2bef85b62069d842c534513 100644 (file)
@@ -30,10 +30,26 @@ define ZLIB_CONFIGURE_CMDS
        )
 endef
 
+define HOST_ZLIB_CONFIGURE_CMDS
+       (cd $(@D); rm -rf config.cache; \
+               $(HOST_CONFIGURE_ARGS) \
+               $(HOST_CONFIGURE_OPTS) \
+               CFLAGS="$(ZLIB_PIC)" \
+               ./configure \
+               $(ZLIB_SHARED) \
+               --prefix="$(HOST_DIR)/usr" \
+               --sysconfdir="$(HOST_DIR)/etc" \
+       )
+endef
+
 define ZLIB_BUILD_CMDS
        $(MAKE) -C $(@D) all libz.a
 endef
 
+define HOST_ZLIB_BUILD_CMDS
+       $(MAKE) -C $(@D) all libz.a
+endef
+
 define ZLIB_INSTALL_STAGING_CMDS
        $(INSTALL) -D $(@D)/libz.a $(STAGING_DIR)/usr/lib/libz.a
        $(INSTALL) -D $(@D)/zlib.h $(STAGING_DIR)/usr/include/zlib.h
@@ -41,6 +57,13 @@ define ZLIB_INSTALL_STAGING_CMDS
        cp -dpf $(@D)/libz.so* $(STAGING_DIR)/usr/lib/
 endef
 
+define HOST_ZLIB_INSTALL_CMDS
+       $(INSTALL) -D $(@D)/libz.a $(HOST_DIR)/usr/lib/libz.a
+       $(INSTALL) -D $(@D)/zlib.h $(HOST_DIR)/usr/include/zlib.h
+       $(INSTALL) $(@D)/zconf.h $(HOST_DIR)/usr/include/
+       cp -dpf $(@D)/libz.so* $(HOST_DIR)/usr/lib/
+endef
+
 ifeq ($(BR2_HAVE_DEVFILES),y)
 define ZLIB_INSTALL_TARGET_HEADERS
        $(INSTALL) -D $(@D)/zlib.h $(TARGET_DIR)/usr/include/zlib.h
@@ -57,3 +80,5 @@ define ZLIB_INSTALL_TARGET_CMDS
 endef
 
 $(eval $(call GENTARGETS,package,zlib))
+$(eval $(call GENTARGETS,package,zlib,host))
+