diff options
Diffstat (limited to 'contrib/fontconfig')
-rw-r--r-- | contrib/fontconfig/A00-mingw-disableShared.patch | 73 | ||||
-rw-r--r-- | contrib/fontconfig/module.defs | 71 | ||||
-rw-r--r-- | contrib/fontconfig/module.rules | 2 |
3 files changed, 146 insertions, 0 deletions
diff --git a/contrib/fontconfig/A00-mingw-disableShared.patch b/contrib/fontconfig/A00-mingw-disableShared.patch new file mode 100644 index 000000000..1fd7474b1 --- /dev/null +++ b/contrib/fontconfig/A00-mingw-disableShared.patch @@ -0,0 +1,73 @@ +--- fontconfig-2.8.0/configure 2009-11-18 15:49:41.000000000 -0800 ++++ fontconfig-2.8.0/configure 2010-09-09 21:23:24.000000000 -0700 +@@ -825,6 +825,8 @@ + ms_librarian + OS_WIN32_FALSE + OS_WIN32_TRUE ++OS_WIN32_ENABLE_SHARED_TRUE ++OS_WIN32_ENABLE_SHARED_FALSE + LTCXXCOMPILE + LTCOMPILE + DOLT_BASH +@@ -11782,6 +11784,14 @@ + OS_WIN32_FALSE= + fi + ++ if test "$os_win32-$enable_shared" = "yes-yes"; then ++ OS_WIN32_ENABLE_SHARED_TRUE= ++ OS_WIN32_ENABLE_SHARED_FALSE='#' ++else ++ OS_WIN32_ENABLE_SHARED_TRUE='#' ++ OS_WIN32_ENABLE_SHARED_FALSE= ++fi ++ + + if test "$os_win32" = "yes"; then + # Extract the first word of "lib.exe", so it can be a program name with args. +@@ -15155,6 +15165,13 @@ + Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } + fi ++if test -z "${OS_WIN32_ENABLE_SHARED_TRUE}" && test -z "${OS_WIN32_ENABLE_SHARED_FALSE}"; then ++ { { echo "$as_me:$LINENO: error: conditional \"OS_WIN32_ENABLE_SHARED\" was never defined. ++Usually this means the macro was only invoked conditionally." >&5 ++echo "$as_me: error: conditional \"OS_WIN32_ENABLE_SHARED\" was never defined. ++Usually this means the macro was only invoked conditionally." >&2;} ++ { (exit 1); exit 1; }; } ++fi + if test -z "${MS_LIB_AVAILABLE_TRUE}" && test -z "${MS_LIB_AVAILABLE_FALSE}"; then + { { $as_echo "$as_me:$LINENO: error: conditional \"MS_LIB_AVAILABLE\" was never defined. + Usually this means the macro was only invoked conditionally." >&5 +--- fontconfig-2.8.0/configure.in 2009-11-18 15:49:23.000000000 -0800 ++++ fontconfig-2.8.0/configure.in 2010-09-09 21:11:37.000000000 -0700 +@@ -76,6 +76,7 @@ + os_win32=no + esac + AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes") ++AM_CONDITIONAL(OS_WIN32_ENABLE_SHARED, test "$os_win32-$enable_shared" = "yes-yes") + + if test "$os_win32" = "yes"; then + AC_CHECK_PROG(ms_librarian, lib.exe, yes, no) +--- fontconfig-2.8.0/src/Makefile.am 2010-09-09 21:12:43.000000000 -0700 ++++ fontconfig-2.8.0/src/Makefile.am 2010-09-09 21:13:07.000000000 -0700 +@@ -30,7 +30,9 @@ + # gcc import library install/uninstall + + install-libtool-import-lib: ++if OS_WIN32_ENABLE_SHARED + $(INSTALL) .libs/libfontconfig.dll.a $(DESTDIR)$(libdir) ++endif + $(INSTALL) fontconfig.def $(DESTDIR)$(libdir)/fontconfig.def + + uninstall-libtool-import-lib: +--- fontconfig-2.8.0/src/Makefile.in 2009-11-18 15:49:39.000000000 -0800 ++++ fontconfig-2.8.0/src/Makefile.in 2010-09-09 21:14:38.000000000 -0700 +@@ -688,7 +688,7 @@ + # gcc import library install/uninstall + + @OS_WIN32_TRUE@install-libtool-import-lib: +-@OS_WIN32_TRUE@ $(INSTALL) .libs/libfontconfig.dll.a $(DESTDIR)$(libdir) ++@OS_WIN32_ENABLE_SHARED_TRUE@@OS_WIN32_TRUE@ $(INSTALL) .libs/libfontconfig.dll.a $(DESTDIR)$(libdir) + @OS_WIN32_TRUE@ $(INSTALL) fontconfig.def $(DESTDIR)$(libdir)/fontconfig.def + + @OS_WIN32_TRUE@uninstall-libtool-import-lib: diff --git a/contrib/fontconfig/module.defs b/contrib/fontconfig/module.defs new file mode 100644 index 000000000..ce96c8235 --- /dev/null +++ b/contrib/fontconfig/module.defs @@ -0,0 +1,71 @@ +__deps__ := FREETYPE LIBXML2 +$(eval $(call import.MODULE.defs,FONTCONFIG,fontconfig,$(__deps__))) +$(eval $(call import.CONTRIB.defs,FONTCONFIG)) + +FONTCONFIG.FETCH.url = http://download.m0k.org/handbrake/contrib/fontconfig-2.8.0.tar.gz +FONTCONFIG.EXTRACT.tarbase = fontconfig-2.8.0 + +# +# Under MinGW: +# +# - A 'i386-ming32-gcc' $(FONTCONFIG.GCC.gcc) command will be available, +# and the '-arch <arch>' argument should be omitted, as it will confuse this compiler. +# +# - The $(FONTCONFIG.GCC.archs) variable is not set. +# Therefore statically guess the target arch to be i386. +# +ifeq ($(BUILD.system),mingw) + FONTCONFIG.cc_archoption = + FONTCONFIG.config_archoption = --with-arch=i386 +else ifeq ($(BUILD.system),linux) + FONTCONFIG.cc_archoption = +else + FONTCONFIG.cc_archoption = -arch $(FONTCONFIG.GCC.archs) + FONTCONFIG.config_archoption = --with-arch=$(FONTCONFIG.GCC.archs) +endif + +# +# Support cross-compiling: +# +# - Add '-arch <arch>' to CC argument to avoid the need to put a <host_triplet>-gcc +# trampoline script in the PATH, since fontconfig's configure looks for this when +# in cross-compile mode. If such a trampoline were used, it would just call "gcc -arch <arch> $@". +# +# - In the case of MinGW (on i386), a 'i386-ming32-gcc' command will be available, +# and the '-arch <arch>' argument should be omitted, as it will confuse the compiler. +# +# The following line overrides the original line in /make/include/contrib.defs, +# but has the -arch argument added (and '$(1)' presubstituted for 'FONTCONFIG'). +# +FONTCONFIG.CONFIGURE.env.CC = CC="$(FONTCONFIG.GCC.gcc) $(FONTCONFIG.cc_archoption)" + +# +# Support cross-compiling: +# - Remove '-arch <arch>' from *FLAGS variables, since fontconfig's configure script +# needs to be given the freedom to insert that flag as necessary, since there are +# some trampoline executables that need to be built in the native build architecture +# (without the -arch flag). +# +# The following lines override the original lines in /make/include/contrib.defs, +# but have '*archs' removed (and '$(1)' presubstituted for 'FONTCONFIG'). +# +FONTCONFIG.CONFIGURE.env.CFLAGS = CFLAGS="$(call fn.ARGS,FONTCONFIG.GCC,*sysroot *minver ?extra)" +FONTCONFIG.CONFIGURE.env.CXXFLAGS = CXXFLAGS="$(call fn.ARGS,FONTCONFIG.GCC,*sysroot *minver ?extra)" +FONTCONFIG.CONFIGURE.env.CPPFLAGS = CPPFLAGS="$(call fn.ARGS,FONTCONFIG.GCC,*sysroot *minver ?extra)" +FONTCONFIG.CONFIGURE.env.LDFLAGS = LDFLAGS="$(call fn.ARGS,FONTCONFIG.GCC,*sysroot *minver)" + +# +# Force use of libxml2 instead of expat with --enable-libxml2. +# +# Tell configure where to find our (cross-compiled) versions of freetype and libxml2. +# +# Support cross-compiling: +# - Add --with-arch argument since fontconfig's configure isn't smart enough +# to infer it from the --host argument +# +FONTCONFIG.CONFIGURE.extra = \ + --enable-libxml2 \ + --with-freetype-config=$(call fn.ABSOLUTE,$(CONTRIB.build/)bin/freetype-config) \ + LIBXML2_LIBS="-L$(call fn.ABSOLUTE,$(CONTRIB.build/))lib -lxml2" \ + LIBXML2_CFLAGS="-I$(call fn.ABSOLUTE,$(CONTRIB.build/))include/libxml2" \ + $(FONTCONFIG.config_archoption) diff --git a/contrib/fontconfig/module.rules b/contrib/fontconfig/module.rules new file mode 100644 index 000000000..72ebbd965 --- /dev/null +++ b/contrib/fontconfig/module.rules @@ -0,0 +1,2 @@ +$(eval $(call import.MODULE.rules,FONTCONFIG)) +$(eval $(call import.CONTRIB.rules,FONTCONFIG)) |