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

index c1f80d7b112105380fa5e79905a944976ba691f5..b52fef02363b48b6b82a1355bb6be46ddd4a4c79 100644 (file)
@@ -84,3 +84,49 @@ else
 endif
 
 $(eval $(call AUTOTARGETS,package,cairo))
+
+# cairo for the host
+CAIRO_HOST_DIR:=$(BUILD_DIR)/cairo-$(CAIRO_VERSION)-host
+CAIRO_HOST_BINARY:=$(HOST_DIR)/usr/lib/libcairo.a
+
+$(CAIRO_HOST_DIR)/.unpacked: $(DL_DIR)/$(CAIRO_SOURCE)
+       mkdir -p $(@D)
+       $(INFLATE$(suffix $(CAIRO_SOURCE))) $< | \
+               $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(@D) $(TAR_OPTIONS) -
+       touch $@
+
+$(CAIRO_HOST_DIR)/.configured: $(CAIRO_HOST_DIR)/.unpacked $(PKGCONFIG_HOST_BINARY) $(FONTCONFIG_HOST_BINARY) $(PIXMAN_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 \
+               --enable-ps \
+               --enable-pdf \
+               --enable-xlib \
+               --with-x \
+               --disable-png \
+               --disable-svg \
+       )
+       touch $@
+
+$(CAIRO_HOST_DIR)/.compiled: $(CAIRO_HOST_DIR)/.configured
+       $(HOST_MAKE_ENV) $(MAKE) -C $(@D)
+       touch $@
+
+$(CAIRO_HOST_BINARY): $(CAIRO_HOST_DIR)/.compiled
+       $(HOST_MAKE_ENV) $(MAKE) -C $(<D) install
+
+host-cairo: $(CAIRO_HOST_BINARY)
+
+host-cairo-source: cairo-source
+
+host-cairo-clean:
+       rm -f $(addprefix $(CAIRO_HOST_DIR)/,.unpacked .configured .compiled)
+       -$(MAKE) -C $(CAIRO_HOST_DIR) uninstall
+       -$(MAKE) -C $(CAIRO_HOST_DIR) clean
+
+host-cairo-dirclean:
+       rm -rf $(CAIRO_HOST_DIR)
index 28830d6a10f49deaef94000d2de0f05d74aa9087..81181cc8b4fa251eb8714856cd18a3c3f655491a 100644 (file)
@@ -24,3 +24,45 @@ FONTCONFIG_CONF_OPT = --with-arch=$(GNU_TARGET_NAME) \
 FONTCONFIG_DEPENDENCIES = uclibc freetype expat
 
 $(eval $(call AUTOTARGETS,package,fontconfig))
+
+# fontconfig for the host
+FONTCONFIG_HOST_DIR:=$(BUILD_DIR)/fontconfig-$(FONTCONFIG_VERSION)-host
+FONTCONFIG_HOST_BINARY:=$(HOST_DIR)/usr/bin/fc-cache
+
+$(FONTCONFIG_HOST_DIR)/.unpacked: $(DL_DIR)/$(FONTCONFIG_SOURCE)
+       mkdir -p $(@D)
+       $(INFLATE$(suffix $(FONTCONFIG_SOURCE))) $< | \
+               $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(@D) $(TAR_OPTIONS) -
+       touch $@
+
+$(FONTCONFIG_HOST_DIR)/.configured: $(FONTCONFIG_HOST_DIR)/.unpacked $(FREETYPE_HOST_BINARY) $(EXPAT_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 \
+               --disable-docs \
+               --disable-static \
+       )
+       touch $@
+
+$(FONTCONFIG_HOST_DIR)/.compiled: $(FONTCONFIG_HOST_DIR)/.configured
+       $(HOST_MAKE_ENV) $(MAKE) -C $(@D)
+       touch $@
+
+$(FONTCONFIG_HOST_BINARY): $(FONTCONFIG_HOST_DIR)/.compiled
+       $(HOST_MAKE_ENV) $(MAKE) -C $(<D) install
+
+host-fontconfig: $(FONTCONFIG_HOST_BINARY)
+
+host-fontconfig-source: fontconfig-source
+
+host-fontconfig-clean:
+       rm -f $(addprefix $(FONTCONFIG_HOST_DIR)/,.unpacked .configured .compiled)
+       -$(MAKE) -C $(FONTCONFIG_HOST_DIR) uninstall
+       -$(MAKE) -C $(FONTCONFIG_HOST_DIR) clean
+
+host-fontconfig-dirclean:
+       rm -rf $(FONTCONFIG_HOST_DIR)