I'll attach diffs for building fontconfig on Win32 as a DLL, using the "mingw"
compiler, i.e. gcc, and Cygwin's shell and make. The diffs contain the
- Check for Win32 platform in configure in, set some autoconf variables
accordingly. To enable conditionalisation of Makefile.in's, for instance the
variable IFNOT_WIN32 is set to "## " if on Win32, and "" otherwise. Vice versa
for IF_WIN32. (Yeah, a bit like automake's conditionals.)
Also account for different shared library naming style, I use libfontconfig-
1.dll. No -Wl,-h necessary. No -fPIC necessary.
- Corresponding changes to Makedefs.in and src/Makefile.in, so that only the
DLL is built on Win32, no symlinked versions.
- Replacement mkstemp (from BSD, I think).
- With no link(), use mkdir() instead.
- No getuid() or geteuid(), no need to check for Set-UIDness.
- Try USERPROFILE in addition to HOME.
- Recognize the special <dir> token WINDOWSFONTDIR in the fonts.conf file, and
replace it with the Windows font directory looked up at run time.
- Use a def file listing the entry points to be exported from the DLL.
Hardcoding installation prefixes in binaries is not a good idea on Windows. I
still need to add code to deduce the fonts.conf file location at run time
instead of hardcoding, in the same way as for instance GTK+ looks up its
configuration files. It works like this: In the DLL attach callback function
look up the DLL's full path, and if it's in a standard "lib" subdir, assume
fonts.conf is in the corresponding ../etc directory.
Created attachment 14 [details] [review]
Diffs for Win32
Created attachment 15 [details]
Thanks for the patch. I've looked it over and it looks fine. If you're willing
to maintain this for a while, please send a DSA public key and I'll give you CVS
write access for this work.
As I mailed you, I tried committing my changes to CVS, but it says permission
denied... For instance:
cvs server: ERROR: cannot write file /local/src/CVS/fontconfig/fontconfig-zip.in
,v: Permission denied
I think I've fixed the CVS repository permission issues. However, I've also
reworked fontconfig to use automake in the meantime. This should be good as
that is supposed to make things more portable. If you've got time, could you
see how things stand?
Updated changes now committed to CVS.