blob: bba36cf9c1ade7a0b213036450786f8bddd64a99 [file] [log] [blame]
Werner Lemberga16c4a72003-04-21 13:30:27 +00001Due to our use of "libtool" to generate and install the FreeType 2
2libraries on Unix systems, as well as other historical events, it is
3generally very difficult to know precisely which release of the font
4engine is installed on a given system.
Werner Lemberg73c10ae2002-09-10 15:17:32 +00005
Werner Lemberga16c4a72003-04-21 13:30:27 +00006This file tries to explain why and to document ways to properly detect
David Turner621e4882002-12-16 21:51:24 +00007FreeType on Unix.
Werner Lemberg73c10ae2002-09-10 15:17:32 +00008
Werner Lemberg51b66992002-08-27 16:51:02 +00009
Werner Lemberga16c4a72003-04-21 13:30:27 +0000101. Version & Release numbers
11----------------------------
David Turner621e4882002-12-16 21:51:24 +000012
Werner Lemberga16c4a72003-04-21 13:30:27 +000013For each new public release of FreeType 2, there are generally *three*
David Turner621e4882002-12-16 21:51:24 +000014distinct "version" numbers to consider:
15
Werner Lemberga16c4a72003-04-21 13:30:27 +000016 * The official FT2 release number, like 2.0.9, or 2.1.3.
David Turner8291d252002-12-26 20:51:04 +000017
Werner Lemberga16c4a72003-04-21 13:30:27 +000018 * The libtool (and Unix) specific version number, like "9.2.3". This
19 is what "freetype-config --version" will return.
David Turner8291d252002-12-26 20:51:04 +000020
Werner Lemberga16c4a72003-04-21 13:30:27 +000021 * The platform-specific shared object number, used for example when
22 the library is installed as "/usr/lib/libfreetype.so.6.3.2".
David Turner621e4882002-12-16 21:51:24 +000023
Werner Lemberga16c4a72003-04-21 13:30:27 +000024The platform-specific number is, unsurprisingly, platform-specific and
25varies with the operating system you are using (several variants of
26Linux, FreeBSD, Solaris, etc.). You should thus _never_ use it, even
27for simple tests.
David Turner621e4882002-12-16 21:51:24 +000028
Werner Lemberga16c4a72003-04-21 13:30:27 +000029The libtool-specific number does not equal the release number but is
30tied to it.
David Turner621e4882002-12-16 21:51:24 +000031
Werner Lemberga16c4a72003-04-21 13:30:27 +000032The release number is available at *compile* time through the following
David Turner621e4882002-12-16 21:51:24 +000033macros defined in FT_FREETYPE_H:
34
35 - FREETYPE_MAJOR : major release number
36 - FREETYPE_MINOR : minor release number
37 - FREETYPE_PATCH : patch release number
38
Werner Lemberga16c4a72003-04-21 13:30:27 +000039See below for a small autoconf fragment.
40
41The release number is also available at *runtime* through the
42"FT_Library_Version" API. Unfortunately, this one wasn't available or
43working correctly before the 2.1.3 official release.
David Turner621e4882002-12-16 21:51:24 +000044
45
Werner Lemberga16c4a72003-04-21 13:30:27 +0000462. History
47----------
48
49The following table gives, for each official release, the corresponding
50libtool number, as well as the shared object number found on _most_
51systems, but not all of them:
52
53 release libtool so
54 -------------------------------------
55 2.1.4 9.3.3 6.3.3
56 2.1.3 9.2.3 6.3.2
57 2.1.2 9.1.3 6.3.1
58 2.1.1 9.0.3 ?
59 2.1.0 8.0.2 ?
60 2.0.9 9.0.3 ?
61 2.0.8 8.0.2 ?
62
63The libtool numbers are a bit inconsistent due to the library's history:
64
65 - 2.1.0 was created as a development branch from 2.0.8 (hence the same
66 libtool numbers).
67
68 - 2.0.9 was a bug-fix release of the "stable" branch, and we
69 incorrectly increased its libtool number.
70
71 - 2.1.4 is still in the "development" branch, however it is stable
72 enough to be the basis of an upcoming 2.2.0 release.
David Turner621e4882002-12-16 21:51:24 +000073
74
Werner Lemberga16c4a72003-04-21 13:30:27 +0000753. Autoconf Code Fragment
76-------------------------
David Turner621e4882002-12-16 21:51:24 +000077
Werner Lemberga16c4a72003-04-21 13:30:27 +000078Lars Clausen contributed the following autoconf fragment to detect which
79version of FreeType is installed on a system. This one tests for a
Werner Lemberg77c34b82003-05-20 22:06:38 +000080version that is at least 2.0.9; you should change it to check against
81other release numbers.
David Turner621e4882002-12-16 21:51:24 +000082
Werner Lemberg77c34b82003-05-20 22:06:38 +000083
84 AC_MSG_CHECKING([whether FreeType version is 2.0.9 or higher])
85 old_CPPFLAGS="$CPPFLAGS"
86 CPPFLAGS=`freetype-config --cflags`
87 AC_TRY_CPP([
88#include <freetype/freetype.h>
89#if (FREETYPE_MAJOR*1000 + FREETYPE_MINOR)*1000 + FREETYPE_PATCH < 2000009
90#error Freetype version too low.
91#endif
92 ],[
93 AC_MSG_RESULT(yes)
94 FREETYPE_LIBS=`freetype-config --libs`
95 AC_SUBST(FREETYPE_LIBS)
96 AC_DEFINE(HAVE_FREETYPE,1,[Define if you have the FreeType2 library])
97 CPPFLAGS="$old_CPPFLAGS"
98 ],[
99 AC_MSG_ERROR([Need FreeType library version 2.0.9 or higher])
100 ])
David Turner621e4882002-12-16 21:51:24 +0000101
102
Werner Lemberga16c4a72003-04-21 13:30:27 +0000103--- end of VERSION.DLL ---