Bug 20 - Diffs for Win32
Summary: Diffs for Win32
Alias: None
Product: fontconfig
Classification: Unclassified
Component: library (show other bugs)
Version: 2.1
Hardware: x86 (IA32) Windows (All)
: high normal
Assignee: Tor Lillqvist
QA Contact:
Depends on:
Reported: 2003-02-05 14:02 UTC by Tor Lillqvist
Modified: 2007-01-23 17:34 UTC (History)
0 users

See Also:
i915 platform:
i915 features:

Diffs for Win32 (9.32 KB, patch)
2003-02-05 14:04 UTC, Tor Lillqvist
Details | Splinter Review
fontconfig/src/fontconfig.def (2.74 KB, text/plain)
2003-02-05 14:05 UTC, Tor Lillqvist

Description Tor Lillqvist 2003-02-05 14:02:21 UTC
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 
following changes:

- 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.

Comment 1 Tor Lillqvist 2003-02-05 14:04:57 UTC
Created attachment 14 [details] [review]
Diffs for Win32
Comment 2 Tor Lillqvist 2003-02-05 14:05:55 UTC
Created attachment 15 [details]
Comment 3 Keith Packard 2003-02-05 18:41:03 UTC
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.
Comment 4 Tor Lillqvist 2003-02-13 12:32:42 UTC
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
Comment 5 Keith Packard 2003-03-14 07:44:08 UTC
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?
Comment 6 Tor Lillqvist 2003-03-22 13:29:17 UTC
Updated changes now committed to CVS.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.