[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Devel] use of zlib
From: |
David Turner |
Subject: |
Re: [Devel] use of zlib |
Date: |
Tue, 05 Nov 2002 10:50:58 +0100 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2a) Gecko/20020910 |
Jacob (=Jouk) Jansen wrote:
Hi All,
in src/gzip/ftgzip.c it is stated :
# if 1 /* we choose to include directly the zlib sources in this component */
/* this is done to avoid ugly library dependencies */
This statement is rather taste/system dependend. The solution chosen here
is quite ugly for OpenVMS: when you try to use the freetype2 library in one
program together with code where the original zlib is required one get a lot
of warnings about externals which are multiple defined in the libraries.
Ofcourse one can solve it by "prefix" all the zlib routines in ft's zlib.
However : -the list in zconf.h is not complete and has to maintained every
time zlib is upgraded.
-the executables become larger since much code is included twice,
without any gain in performance.
I know it's not optimal, but external library dependencies are a nightmare to
support on multiple platforms; I also really despise Autoconf and don't want
to touch a single line of this atrocity. That's why I did ask in this list
for a volunteer to deal with this issue before committing the changes :o)
Let me propose you a sort of "deal":
A - I modify FreeType in order to:
* move the zlib sources from "src/gzip" to another
place, like "extras/zlib" for example.
* provide a new configuration macro, like
FT_CONFIG_OPTION_SYSTEM_ZLIB (defined in "ftoption.h")
* modify "src/gzip/ftgzip.c" and/or the build system
to include the files in "extras/zlib" *OR* to use
the system zlib when the configuration macro is
defined.
B - someone (that means you, or someone else), provides patches
to perform the latter:
- modify builds/unix/configure.in to allow it to accept a
new option, like "--with-system-zlib", with relevant
actions on the build system.
- provide a similar option for VMS builds (that use
the "descrip.mms" files).
- modify "freetype-config" so that it returns the correct
library dependencies on Unix
I will make the changes to the Jamfiles myself.
I propose to define a build variable named "FT2_SYSTEM_ZLIB"
(in Makefile/Jamfile/descrip.mms). When defined, it should contain
the include path to the zlib header files. When not defined, the
"extras/zlib" sources should be used instead.
If you do part B, I'll do part A. What do you think about that ?
Regards,
- David Turner
- The FreeType Project (www.freetype.org)