]> git.sesse.net Git - vlc/blob - contrib/src/fontconfig/rules.mak
Use a subfolder for the contribs prebuilt...
[vlc] / contrib / src / fontconfig / rules.mak
1 # fontconfig
2
3 FONTCONFIG_VERSION := 2.8.0
4 FONTCONFIG_URL := http://fontconfig.org/release/fontconfig-$(FONTCONFIG_VERSION).tar.gz
5
6 PKGS += fontconfig
7 ifeq ($(call need_pkg,"fontconfig"),)
8 PKGS_FOUND += fontconfig
9 endif
10
11 $(TARBALLS)/fontconfig-$(FONTCONFIG_VERSION).tar.gz:
12         $(call download,$(FONTCONFIG_URL))
13
14 .sum-fontconfig: fontconfig-$(FONTCONFIG_VERSION).tar.gz
15
16 fontconfig: fontconfig-$(FONTCONFIG_VERSION).tar.gz .sum-fontconfig
17         $(UNPACK)
18         $(APPLY) $(SRC)/fontconfig/fontconfig-march.patch
19 ifdef HAVE_WIN32
20         $(APPLY) $(SRC)/fontconfig/fontconfig-win32.patch
21         $(APPLY) $(SRC)/fontconfig/fontconfig-noxml2.patch
22 endif
23         $(MOVE)
24
25 FONTCONFIG_CONF := $(HOSTCONF) \
26         --enable-libxml2 \
27         --disable-docs
28 FONTCONFIG_ENV := $(HOSTVARS)
29
30 # FreeType flags
31 ifneq ($(findstring freetype2,$(PKGS)),)
32 FONTCONFIG_CONF += --with-freetype-config="$(PREFIX)/bin/freetype-config"
33 endif
34
35 ifdef HAVE_CROSS_COMPILE
36 FONTCONFIG_CONF += --with-arch=$(ARCH)
37 endif
38
39 ifdef HAVE_MACOSX
40 FONTCONFIG_CONF += \
41         --with-cache-dir=~/Library/Caches/fontconfig \
42         --with-confdir=/usr/X11/lib/X11/fonts \
43         --with-default-fonts=/System/Library/Fonts \
44         --with-add-fonts=/Library/Fonts,~/Library/Fonts
45 # libxml2 without pkg-config...
46 FONTCONFIG_ENV += LIBXML2_CFLAGS=`xml2-config --cflags`
47 FONTCONFIG_ENV += LIBXML2_LIBS=`xml2-config --libs`
48 endif
49
50 DEPS_fontconfig = freetype2 $(DEPS_freetype2) libxml2 $(DEPS_libxml2)
51
52 .fontconfig: fontconfig
53 ifdef HAVE_WIN32
54         $(RECONF)
55 endif
56         cd $< && $(FONTCONFIG_ENV) ./configure $(FONTCONFIG_CONF)
57         cd $< && $(MAKE)
58 ifndef HAVE_MACOSX
59         cd $< && $(MAKE) install
60 else
61         cd $< && $(MAKE) install-exec
62         cd $</fontconfig && $(MAKE) install-data
63         sed -e 's%/usr/lib/libiconv.la%%' -i.orig $(PREFIX)/lib/libfontconfig.la
64         cp $</fontconfig.pc $(PREFIX)/lib/pkgconfig/
65 endif
66         touch $@