OSDN Git Service

libraries:
[handbrake-jp/handbrake-jp-git.git] / contrib / fontconfig / module.defs
1 __deps__ := FREETYPE LIBXML2
2 $(eval $(call import.MODULE.defs,FONTCONFIG,fontconfig,$(__deps__)))
3 $(eval $(call import.CONTRIB.defs,FONTCONFIG))
4
5 FONTCONFIG.FETCH.url = http://download.handbrake.fr/handbrake/contrib/fontconfig-2.8.0.tar.gz
6 FONTCONFIG.EXTRACT.tarbase = fontconfig-2.8.0
7
8 #
9 # Under MinGW:
10
11 # - A 'i386-ming32-gcc' $(FONTCONFIG.GCC.gcc) command will be available,
12 #   and the '-arch <arch>' argument should be omitted, as it will confuse this compiler.
13
14 # - The $(FONTCONFIG.GCC.archs) variable is not set.
15 #   Therefore statically guess the target arch to be i386.
16
17 ifeq ($(BUILD.system),mingw)
18     FONTCONFIG.cc_archoption      = 
19     FONTCONFIG.config_archoption  = --with-arch=i386
20 else ifeq ($(BUILD.system),linux)
21     FONTCONFIG.cc_archoption      = 
22 else
23     FONTCONFIG.cc_archoption      = -arch $(FONTCONFIG.GCC.archs)
24     FONTCONFIG.config_archoption  = --with-arch=$(FONTCONFIG.GCC.archs)
25 endif
26
27 #
28 # Support cross-compiling:
29
30 # - Add '-arch <arch>' to CC argument to avoid the need to put a <host_triplet>-gcc
31 #   trampoline script in the PATH, since fontconfig's configure looks for this when
32 #   in cross-compile mode. If such a trampoline were used, it would just call "gcc -arch <arch> $@".
33
34 # - In the case of MinGW (on i386), a 'i386-ming32-gcc' command will be available,
35 #   and the '-arch <arch>' argument should be omitted, as it will confuse the compiler.
36
37 # The following line overrides the original line in /make/include/contrib.defs,
38 # but has the -arch argument added (and '$(1)' presubstituted for 'FONTCONFIG').
39
40 FONTCONFIG.CONFIGURE.env.CC       = CC="$(FONTCONFIG.GCC.gcc) $(FONTCONFIG.cc_archoption)"
41
42 #
43 # Support cross-compiling:
44 # - Remove '-arch <arch>' from *FLAGS variables, since fontconfig's configure script
45 #   needs to be given the freedom to insert that flag as necessary, since there are
46 #   some trampoline executables that need to be built in the native build architecture
47 #   (without the -arch flag).
48
49 # The following lines override the original lines in /make/include/contrib.defs,
50 # but have '*archs' removed (and '$(1)' presubstituted for 'FONTCONFIG').
51
52 FONTCONFIG.CONFIGURE.env.CFLAGS   = CFLAGS="$(call fn.ARGS,FONTCONFIG.GCC,*sysroot *minver ?extra)"
53 FONTCONFIG.CONFIGURE.env.CXXFLAGS = CXXFLAGS="$(call fn.ARGS,FONTCONFIG.GCC,*sysroot *minver ?extra)"
54 FONTCONFIG.CONFIGURE.env.CPPFLAGS = CPPFLAGS="$(call fn.ARGS,FONTCONFIG.GCC,*sysroot *minver ?extra)"
55 FONTCONFIG.CONFIGURE.env.LDFLAGS  = LDFLAGS="$(call fn.ARGS,FONTCONFIG.GCC,*sysroot *minver)"
56
57
58 # Force use of libxml2 instead of expat with --enable-libxml2.
59
60 # Tell configure where to find our (cross-compiled) versions of freetype and libxml2.
61
62 # Support cross-compiling:
63 # - Add --with-arch argument since fontconfig's configure isn't smart enough
64 #   to infer it from the --host argument
65
66 FONTCONFIG.CONFIGURE.extra = \
67     --enable-libxml2 \
68     --with-freetype-config=$(call fn.ABSOLUTE,$(CONTRIB.build/)bin/freetype-config) \
69     LIBXML2_LIBS="-L$(call fn.ABSOLUTE,$(CONTRIB.build/))lib -lxml2" \
70     LIBXML2_CFLAGS="-I$(call fn.ABSOLUTE,$(CONTRIB.build/))include/libxml2" \
71     $(FONTCONFIG.config_archoption)