[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Devel] Patch for FreeType2 #include problems on Unix (2001-03-17)
From: |
Anthony Fok |
Subject: |
[Devel] Patch for FreeType2 #include problems on Unix (2001-03-17) |
Date: |
Mon, 19 Mar 2001 18:23:38 -0700 |
User-agent: |
Mutt/1.2.5i |
Hello,
I was playing with freetype2-current (2001-03-17) yesterday and today:
IMHO, the current freetype2 source caters too much to broken
compilers that the Unix build suffers.
After some tinkering, and after referring to David, Werner et al.'s
experiments (2000-12-12, 2000-12-13), I think that ftheader.h
doesn't need to be exactly the same across all platforms.
So, why don't we use "sed" in builds/unix/install.mk
to replace all instances of <freetype/{,config/,internal/}*.h>
with FT2_{PUBLIC,CONFIG,INTERNAL}_FILE(*.h), which would
expands to <freetype2/freetype/{,config/,internal/}*.h>
in freetype/config/ftheader.h and freetype/internal/internal.h
for Unix? Isn't this what David and Werner wanted in the first place?
:-)
Since builds/unix/install.mk isn't run for other platforms,
this "hack" does not sacrifice cross-platform compatibility.
It may also mean that "-I/usr/include/freetype2" is no longer mandatory.
But of course, any users who don't use "-I/usr/include/freetype2"
are digging a hole for themselves.
Afterall, Thou shalt always use `freetype-config --cflags`, right? :-)
This was related to http://bugs.debian.org/79951 reported
by Gordon Sandler and forwarded to freetype-devel a while ago.
Another fix is in builds/unix/ft2unix.h:
Debian JP developer Takuo Kitame ran into problems and filed a
bug report (freetype2-current, 2001-03-12):
http://bugs.debian.org/89363
In a nutshell, FT2_PUBLIC_FILE, FT2_CONFIG_FILE and FT2_INTERNAL_FILE
are defined in both ft2unix.h (i.e. /usr/include/ft2build.h)
and freetype/config/ft2build.h (now freetype/config/ftheader.h).
No, cpp doesn't like that, unless you use #undef first.
Anyway, instead of using #undef, I made the following changes to
ft2unix.h:
- Removed the FT2_{PUBLIC,CONFIG,INTERNAL}_FILE macros because
they are already defined in freetype/config/ftheader.h.
- Use FT2_ROOT instead. Afterall, cpp on Unix is not broken. ;-)
Seems to work here. :-)
Please examine the attached patch file and commit it to the CVS
if appropriate. (and run "cd builds/unix ; autoconf".)
I know that using "sed" to change ftheader.h and
internal.h during install may seem "unorthodox", but it works! :-)
All Unix systems have sed; builds/unix/configure already runs sed;
no need to fork two versions of ftheader.h and internal.h;
still compatible with brain-dead compilers, but gives the flexibility
that you wanted, etc.
But of course, if you come up with a better solution, that would be even
better! :-)
Cheers,
Anthony
--
Anthony Fok Tung-Ling Civil and Environmental Engineering
address@hidden, address@hidden University of Alberta, Canada
Debian GNU/Linux Chinese Project -- http://www.debian.org/intl/zh/
Come visit Our Lady of Victory Camp -- http://www.olvc.ab.ca/
freetype_2.0.1.20010317-1.diff
Description: Text document
- [Devel] Patch for FreeType2 #include problems on Unix (2001-03-17),
Anthony Fok <=