[vlc-devel] commit: Contribs: remove XML dependency from Fontconfig. ( Jean-Baptiste Kempf )

git version control git at videolan.org
Sat Jul 25 22:30:20 CEST 2009


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sat Jul 25 22:27:16 2009 +0200| [4b1c0509550417d379eb605500055e231a166760] | committer: Jean-Baptiste Kempf 

Contribs: remove XML dependency from Fontconfig.

This removes around 1.1MB on both libass dll and freetype dll (on 2.8MB), which are 4th and 5th dll in size for Windows
(qt4, avcodec, avformat are bigger).
We DON'T use the fonts.conf anyway on Windows, therefore, why having such a dependency, just for parsing a configure file that we don't ship?
I still don't get what is wrong with an .ini/.conf format, but that is not my business, I guess.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4b1c0509550417d379eb605500055e231a166760
---

 extras/contrib/src/Makefile                        |    5 +-
 extras/contrib/src/Patches/fontconfig-noxml2.patch |   64 ++++++++++++++++++++
 2 files changed, 67 insertions(+), 2 deletions(-)

diff --git a/extras/contrib/src/Makefile b/extras/contrib/src/Makefile
index ae8f52d..9f019e0 100644
--- a/extras/contrib/src/Makefile
+++ b/extras/contrib/src/Makefile
@@ -474,15 +474,16 @@ fontconfig: fontconfig-$(FONTCONFIG_VERSION).tar.gz Patches/fontconfig.patch
 	patch -p0 < Patches/fontconfig-nodocs.patch
 ifdef HAVE_WIN32
 	patch -p0 < Patches/fontconfig.patch
+	patch -p0 < Patches/fontconfig-noxml2.patch
 endif
 	(cd $@; autoreconf -ivf)
 
 .fontconfig: fontconfig .xml .freetype
 ifdef HAVE_WIN32
   ifdef HAVE_CYGWIN
-	(cd $<; LIBXML2_CFLAGS=`$(PREFIX)/bin/xml2-config --cflags` ./configure --target=$(HOST) --disable-pic --disable-shared --disable-docs --with-arch=i686 --prefix=$(PREFIX) --with-freetype-config=$(PREFIX)/bin/freetype-config --enable-libxml2 && make && make install)
+	(cd $<;  ./configure --target=$(HOST) --disable-pic --disable-shared --disable-docs --with-arch=i686 --prefix=$(PREFIX) --with-freetype-config=$(PREFIX)/bin/freetype-config --enable-libxml2 && make && make install)
   else
-	(cd $<; $(HOSTCC) LIBXML2_CFLAGS=`$(PREFIX)/bin/xml2-config --cflags` ./configure $(HOSTCONF) --with-arch=i686 --prefix=$(PREFIX) --with-freetype-config=$(PREFIX)/bin/freetype-config --enable-libxml2 --disable-docs && make && make install)
+	(cd $<; $(HOSTCC)  ./configure $(HOSTCONF) --with-arch=i686 --prefix=$(PREFIX) --with-freetype-config=$(PREFIX)/bin/freetype-config --disable-libxml2 --disable-docs && make && make install)
   endif
 else
   ifdef HAVE_DARWIN_OS
diff --git a/extras/contrib/src/Patches/fontconfig-noxml2.patch b/extras/contrib/src/Patches/fontconfig-noxml2.patch
new file mode 100644
index 0000000..29d8926
--- /dev/null
+++ b/extras/contrib/src/Patches/fontconfig-noxml2.patch
@@ -0,0 +1,64 @@
+diff -ruN fontconfig.new/src/fcinit.c fontconfig/src/fcinit.c
+--- fontconfig.new/src/fcinit.c	2009-07-25 21:55:10.000000000 +0200
++++ fontconfig/src/fcinit.c	2009-07-25 21:58:05.000000000 +0200
+@@ -68,7 +68,8 @@
+     if (!config)
+ 	return FcFalse;
+     
+-    if (!FcConfigParseAndLoad (config, 0, FcTrue))
++//    if (!FcConfigParseAndLoad (config, 0, FcTrue))
++    if (1)
+     {
+ 	FcConfigDestroy (config);
+ 	return FcInitFallbackConfig ();
+diff -ruN fontconfig.new/src/fcxml.c fontconfig/src/fcxml.c
+--- fontconfig.new/src/fcxml.c	2009-07-25 21:55:10.000000000 +0200
++++ fontconfig/src/fcxml.c	2009-07-25 21:56:37.000000000 +0200
+@@ -23,6 +23,8 @@
+  */
+ 
+ #include "fcint.h"
++
++#if 0
+ #include <fcntl.h>
+ #include <stdarg.h>
+ #include <dirent.h>
+@@ -58,6 +60,8 @@
+ #undef STRICT
+ #endif
+ 
++#endif
++
+ static void
+ FcExprDestroy (FcExpr *e);
+ 
+@@ -71,6 +75,7 @@
+     free (test);
+ }
+ 
++#if 0
+ static FcExpr *
+ FcExprCreateInteger (FcConfig *config, int i)
+ {
+@@ -179,7 +184,7 @@
+     }
+     return e;
+ }
+-
++#endif
+ static void
+ FcExprDestroy (FcExpr *e)
+ {
+@@ -255,6 +260,7 @@
+     free (e);
+ }
+ 
++#if 0
+ typedef enum _FcElement {
+     FcElementNone,
+     FcElementFontconfig,
+@@ -2589,3 +2595,4 @@
+ #define __fcxml__
+ #include "fcaliastail.h"
+ #undef __fcxml__
++#endif




More information about the vlc-devel mailing list