Commit 1330bc95 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Fontconfig update for Win32

parent c1fd947c
...@@ -134,7 +134,6 @@ FFMPEGCONF+= --enable-small --disable-debug --disable-mpegaudio-hp ...@@ -134,7 +134,6 @@ FFMPEGCONF+= --enable-small --disable-debug --disable-mpegaudio-hp
FFMPEG_CFLAGS += -DHAVE_LRINTF --std=c99 FFMPEG_CFLAGS += -DHAVE_LRINTF --std=c99
else else
FFMPEGCONF+= --enable-libmp3lame --enable-libgsm FFMPEGCONF+= --enable-libmp3lame --enable-libgsm
#--enable-libfaac
endif endif
ifdef HAVE_BEOS ifdef HAVE_BEOS
...@@ -474,6 +473,9 @@ fontconfig-$(FONTCONFIG_VERSION).tar.gz: ...@@ -474,6 +473,9 @@ fontconfig-$(FONTCONFIG_VERSION).tar.gz:
fontconfig: fontconfig-$(FONTCONFIG_VERSION).tar.gz Patches/fontconfig.patch fontconfig: fontconfig-$(FONTCONFIG_VERSION).tar.gz Patches/fontconfig.patch
$(EXTRACT_GZ) $(EXTRACT_GZ)
patch -p0 < Patches/fontconfig-nodocs.patch patch -p0 < Patches/fontconfig-nodocs.patch
ifdef HAVE_WIN32
patch -p0 < Patches/fontconfig.patch
endif
(cd $@; autoreconf -ivf) (cd $@; autoreconf -ivf)
.fontconfig: fontconfig .xml .freetype .fontconfig: fontconfig .xml .freetype
......
--- fontconfig/src/Makefile.am Mon Sep 18 07:06:41 2006 diff -ruN fontconfig/src/fcinit.c fontconfig.good/src/fcinit.c
+++ fontconfig/src/Makefile.am Sat Aug 18 20:48:45 2007 --- fontconfig/src/fcinit.c 2009-06-06 00:59:27.000000000 +0200
*************** +++ fontconfig.good/src/fcinit.c 2009-07-07 01:33:48.000000000 +0200
*** 31,35 **** @@ -24,6 +24,7 @@
install-libtool-import-lib: #include "fcint.h"
- $(INSTALL) .libs/libfontconfig.dll.a $(DESTDIR)$(libdir) #include <stdlib.h>
$(INSTALL) fontconfig.def $(DESTDIR)$(libdir)/fontconfig.def +# include <shlobj.h>
--- 31,34 ---- static FcConfig *
--- fontconfig/src/Makefile.in Sun Dec 3 10:27:33 2006 FcInitFallbackConfig (void)
+++ fontconfig/src/Makefile.in Sat Aug 18 20:53:40 2007 @@ -35,7 +36,9 @@
*************** goto bail0;
*** 614,618 **** if (!FcConfigAddDir (config, (FcChar8 *) FC_DEFAULT_FONTS))
goto bail1;
@OS_WIN32_TRUE@install-libtool-import-lib: - if (!FcConfigAddCacheDir (config, (FcChar8 *) FC_CACHEDIR))
- @OS_WIN32_TRUE@ $(INSTALL) .libs/libfontconfig.dll.a $(DESTDIR)$(libdir) + char dir[MAX_PATH];
@OS_WIN32_TRUE@ $(INSTALL) fontconfig.def $(DESTDIR)$(libdir)/fontconfig.def + SHGetFolderPath( NULL, CSIDL_APPDATA, NULL, 0, dir );
+ if (!FcConfigAddCacheDir (config, (FcChar8 *)dir))
--- 614,617 ---- goto bail1;
--- fontconfig/src/fcinit.c Sun Dec 3 07:10:30 2006 return config;
+++ fontconfig/src/fcinit.c Sun Aug 19 00:52:07 2007
*************** diff -ruN fontconfig/src/fcint.h fontconfig.good/src/fcint.h
*** 26,32 **** --- fontconfig/src/fcint.h 2009-06-24 19:52:13.000000000 +0200
--- 26,94 ---- +++ fontconfig.good/src/fcint.h 2009-07-03 00:13:56.000000000 +0200
#include <stdlib.h> @@ -538,7 +538,7 @@
+ #ifdef _WIN32 #ifdef _WIN32
+ #define STRICT FcPrivate int
+ #include <windows.h> -FcStat (const char *file, struct stat *statb)
+ #undef STRICT +FcStat (const char *file, struct stat *statb);
+ #else
+ static char *IsWindowsDir(char *p_dir_in, char **p_dir_out) #define FcStat stat
+ { #endif
+ *p_dir_out = NULL; --- fontconfig/src/Makefile.in 2009-06-24 21:05:27.000000000 +0200
+ +++ fontconfig.good/src/Makefile.in 2009-07-03 00:13:38.000000000 +0200
+ if( ! strcmp( p_dir_in, "WINDOWSFONTDIR" )) @@ -664,7 +664,6 @@
+ { # gcc import library install/uninstall
+ int rc;
+ @OS_WIN32_TRUE@install-libtool-import-lib:
+ *p_dir_out = malloc( 1000 ); -@OS_WIN32_TRUE@ $(INSTALL) .libs/libfontconfig.dll.a $(DESTDIR)$(libdir)
+ if( !*p_dir_out ) @OS_WIN32_TRUE@ $(INSTALL) fontconfig.def $(DESTDIR)$(libdir)/fontconfig.def
+ {
+ fprintf( stderr, "Fontconfig error: out of memory" ); @OS_WIN32_TRUE@uninstall-libtool-import-lib:
+ return p_dir_in; --- fontconfig/src/Makefile.am 2009-03-18 22:02:22.000000000 +0100
+ } +++ fontconfig.good/src/Makefile.am 2009-07-03 00:12:50.000000000 +0200
+ rc = GetWindowsDirectory( *p_dir_out, 800 ); @@ -30,7 +30,6 @@
+ if( rc == 0 || rc > 800 ) # gcc import library install/uninstall
+ {
+ fprintf( stderr, "Fontconfig error: GetWindowsDirectory failed" ); install-libtool-import-lib:
+ free( *p_dir_out ); - $(INSTALL) .libs/libfontconfig.dll.a $(DESTDIR)$(libdir)
+ *p_dir_out = NULL; $(INSTALL) fontconfig.def $(DESTDIR)$(libdir)/fontconfig.def
+
+ return p_dir_in; uninstall-libtool-import-lib:
+ }
+ if( (*p_dir_out)[ rc - 1 ] != '\\' )
+ strcpy( (*p_dir_out)+rc, "\\" );
+ strcat( *p_dir_out, "fonts" );
+
+ return *p_dir_out;
+ }
+ else if( ! strcmp( p_dir_in, "WINDOWSTEMPDIR" ))
+ {
+ int rc;
+
+ *p_dir_out = malloc( 1000 );
+ if( !*p_dir_out )
+ {
+ fprintf( stderr, "Fontconfig error: out of memory" );
+ return p_dir_in;
+ }
+ rc = GetTempPath( 800, *p_dir_out );
+ if( rc == 0 || rc > 800 )
+ {
+ fprintf( stderr, "Fontconfig error: GetTempPath failed" );
+ free( *p_dir_out );
+ *p_dir_out = NULL;
+
+ return p_dir_in;
+ }
+ return *p_dir_out;
+ }
+ return p_dir_in;
+ }
+ #else
+ #define IsWindowsDir(A, B) A
+ #endif
+
static FcConfig *
FcInitFallbackConfig (void)
{
+ char *p_dir_out = NULL;
FcConfig *config;
***************
*** 34,40 ****
if (!config)
goto bail0;
! if (!FcConfigAddDir (config, (FcChar8 *) FC_DEFAULT_FONTS))
goto bail1;
! if (!FcConfigAddCacheDir (config, (FcChar8 *) FC_CACHEDIR))
goto bail1;
return config;
--- 96,106 ----
if (!config)
goto bail0;
! if (!FcConfigAddDir (config, (FcChar8 *) IsWindowsDir(FC_DEFAULT_FONTS, &p_dir_out)))
goto bail1;
! if (p_dir_out)
! free(p_dir_out);
! p_dir_out = NULL;
!
! if (!FcConfigAddCacheDir (config, (FcChar8 *) IsWindowsDir(FC_CACHEDIR, &p_dir_out)))
goto bail1;
return config;
***************
*** 43,46 ****
--- 109,114 ----
FcConfigDestroy (config);
bail0:
+ if (p_dir_out)
+ free(p_dir_out);
return 0;
}
***************
*** 73,84 ****
if (config->cacheDirs && config->cacheDirs->num == 0)
{
fprintf (stderr,
"Fontconfig warning: no <cachedir> elements found. Check configuration.\n");
fprintf (stderr,
"Fontconfig warning: adding <cachedir>%s</cachedir>\n",
! FC_CACHEDIR);
fprintf (stderr,
"Fontconfig warning: adding <cachedir>~/.fontconfig</cachedir>\n");
! if (!FcConfigAddCacheDir (config, (FcChar8 *) FC_CACHEDIR) ||
!FcConfigAddCacheDir (config, (FcChar8 *) "~/.fontconfig"))
{
--- 141,158 ----
if (config->cacheDirs && config->cacheDirs->num == 0)
{
+ char *p_dir_out = NULL;
+
fprintf (stderr,
"Fontconfig warning: no <cachedir> elements found. Check configuration.\n");
fprintf (stderr,
"Fontconfig warning: adding <cachedir>%s</cachedir>\n",
! IsWindowsDir(FC_CACHEDIR, &p_dir_out));
fprintf (stderr,
"Fontconfig warning: adding <cachedir>~/.fontconfig</cachedir>\n");
! if (p_dir_out)
! free(p_dir_out);
! p_dir_out = NULL;
!
! if (!FcConfigAddCacheDir (config, (FcChar8 *) IsWindowsDir(FC_CACHEDIR, &p_dir_out)) ||
!FcConfigAddCacheDir (config, (FcChar8 *) "~/.fontconfig"))
{
***************
*** 86,91 ****
--- 160,172 ----
"Fontconfig error: out of memory");
FcConfigDestroy (config);
+
+ if (p_dir_out)
+ free(p_dir_out);
+ p_dir_out = NULL;
+
return FcInitFallbackConfig ();
}
+ if (p_dir_out)
+ free(p_dir_out);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment