freetype: add host version
authorPeter Korsgaard <jacmet@sunsite.dk>
Wed, 18 Mar 2009 21:22:00 +0000 (21:22 -0000)
committerPeter Korsgaard <jacmet@sunsite.dk>
Wed, 18 Mar 2009 21:22:00 +0000 (21:22 -0000)
package/freetype/freetype.mk

index 262053435a1c84c2f98fb5f39bbbd909f3ffd5e8..940510f8631ea618e51b363126f7a9a6c5d9b2fa 100644 (file)
@@ -23,3 +23,42 @@ $(FREETYPE_HOOK_POST_INSTALL):
                $(STAGING_DIR)/usr/bin/freetype-config
        touch $@
 
+# freetype for the host
+FREETYPE_HOST_DIR:=$(BUILD_DIR)/freetype-$(FREETYPE_VERSION)-host
+FREETYPE_HOST_BINARY:=$(HOST_DIR)/usr/bin/freetype-config
+
+$(FREETYPE_HOST_DIR)/.unpacked: $(DL_DIR)/$(FREETYPE_SOURCE)
+       mkdir -p $(@D)
+       $(INFLATE$(suffix $(FREETYPE_SOURCE))) $< | \
+               $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(@D) $(TAR_OPTIONS) -
+       touch $@
+
+$(FREETYPE_HOST_DIR)/.configured: $(FREETYPE_HOST_DIR)/.unpacked $(PKGCONFIG_HOST_BINARY)
+       (cd $(@D); rm -rf config.cache; \
+               $(HOST_CONFIGURE_OPTS) \
+               CFLAGS="$(HOST_CFLAGS)" \
+               LDFLAGS="$(HOST_LDFLAGS)" \
+               $(@D)/configure \
+               --prefix=$(HOST_DIR)/usr \
+               --sysconfdir=$(HOST_DIR)/etc \
+       )
+       touch $@
+
+$(FREETYPE_HOST_DIR)/.compiled: $(FREETYPE_HOST_DIR)/.configured
+       $(MAKE) -C $(@D)
+       touch $@
+
+$(FREETYPE_HOST_BINARY): $(FREETYPE_HOST_DIR)/.compiled
+       $(HOST_MAKE_ENV) $(MAKE) -C $(<D) install
+
+host-freetype: $(FREETYPE_HOST_BINARY)
+
+host-freetype-source: freetype-source
+
+host-freetype-clean:
+       rm -f $(addprefix $(FREETYPE_HOST_DIR)/,.unpacked .configured .compiled)
+       -$(MAKE) -C $(FREETYPE_HOST_DIR) uninstall
+       -$(MAKE) -C $(FREETYPE_HOST_DIR) clean
+
+host-freetype-dirclean:
+       rm -rf $(FREETYPE_HOST_DIR)