Werner Lemberg | a723526 | 2005-08-30 00:22:46 +0000 | [diff] [blame] | 1 | Due to our use of `libtool' to generate and install the FreeType 2 |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 2 | libraries on Unix systems, as well as other historical events, it is |
| 3 | generally very difficult to know precisely which release of the font |
| 4 | engine is installed on a given system. |
Werner Lemberg | 73c10ae | 2002-09-10 15:17:32 +0000 | [diff] [blame] | 5 | |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 6 | This file tries to explain why and to document ways to properly detect |
David Turner | 621e488 | 2002-12-16 21:51:24 +0000 | [diff] [blame] | 7 | FreeType on Unix. |
Werner Lemberg | 73c10ae | 2002-09-10 15:17:32 +0000 | [diff] [blame] | 8 | |
Werner Lemberg | 51b6699 | 2002-08-27 16:51:02 +0000 | [diff] [blame] | 9 | |
Werner Lemberg | a723526 | 2005-08-30 00:22:46 +0000 | [diff] [blame] | 10 | 1. Version and Release numbers |
| 11 | ------------------------------ |
David Turner | 621e488 | 2002-12-16 21:51:24 +0000 | [diff] [blame] | 12 | |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 13 | For each new public release of FreeType 2, there are generally *three* |
Werner Lemberg | a723526 | 2005-08-30 00:22:46 +0000 | [diff] [blame] | 14 | distinct `version' numbers to consider: |
David Turner | 621e488 | 2002-12-16 21:51:24 +0000 | [diff] [blame] | 15 | |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 16 | * The official FT2 release number, like 2.0.9, or 2.1.3. |
David Turner | 8291d25 | 2002-12-26 20:51:04 +0000 | [diff] [blame] | 17 | |
Werner Lemberg | a723526 | 2005-08-30 00:22:46 +0000 | [diff] [blame] | 18 | * The libtool (and Unix) specific version number, like 9.2.3. This is |
| 19 | what `freetype-config --version' returns. |
David Turner | 8291d25 | 2002-12-26 20:51:04 +0000 | [diff] [blame] | 20 | |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 21 | * The platform-specific shared object number, used for example when |
Werner Lemberg | a723526 | 2005-08-30 00:22:46 +0000 | [diff] [blame] | 22 | the library is installed as `/usr/lib/libfreetype.so.6.3.2'. |
David Turner | 621e488 | 2002-12-16 21:51:24 +0000 | [diff] [blame] | 23 | |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 24 | The platform-specific number is, unsurprisingly, platform-specific and |
| 25 | varies with the operating system you are using (several variants of |
| 26 | Linux, FreeBSD, Solaris, etc.). You should thus _never_ use it, even |
| 27 | for simple tests. |
David Turner | 621e488 | 2002-12-16 21:51:24 +0000 | [diff] [blame] | 28 | |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 29 | The libtool-specific number does not equal the release number but is |
| 30 | tied to it. |
David Turner | 621e488 | 2002-12-16 21:51:24 +0000 | [diff] [blame] | 31 | |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 32 | The release number is available at *compile* time through the following |
David Turner | 621e488 | 2002-12-16 21:51:24 +0000 | [diff] [blame] | 33 | macros defined in FT_FREETYPE_H: |
| 34 | |
Werner Lemberg | a723526 | 2005-08-30 00:22:46 +0000 | [diff] [blame] | 35 | - FREETYPE_MAJOR: major release number |
| 36 | - FREETYPE_MINOR: minor release number |
| 37 | - FREETYPE_PATCH: patch release number |
David Turner | 621e488 | 2002-12-16 21:51:24 +0000 | [diff] [blame] | 38 | |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 39 | See below for a small autoconf fragment. |
| 40 | |
| 41 | The release number is also available at *runtime* through the |
Werner Lemberg | a723526 | 2005-08-30 00:22:46 +0000 | [diff] [blame] | 42 | `FT_Library_Version' API. Unfortunately, this one wasn't available or |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 43 | working correctly before the 2.1.3 official release. |
David Turner | 621e488 | 2002-12-16 21:51:24 +0000 | [diff] [blame] | 44 | |
| 45 | |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 46 | 2. History |
| 47 | ---------- |
| 48 | |
| 49 | The following table gives, for each official release, the corresponding |
| 50 | libtool number, as well as the shared object number found on _most_ |
| 51 | systems, but not all of them: |
| 52 | |
Werner Lemberg | a723526 | 2005-08-30 00:22:46 +0000 | [diff] [blame] | 53 | |
Werner Lemberg | f9d864a | 2003-07-25 05:57:21 +0000 | [diff] [blame] | 54 | release libtool so |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 55 | ------------------------------- |
Werner Lemberg | 49f4d34 | 2005-06-16 19:07:08 +0000 | [diff] [blame] | 56 | 2.2.0 9.9.3 6.3.9 |
Werner Lemberg | 1743942 | 2004-08-11 05:25:37 +0000 | [diff] [blame] | 57 | 2.1.10 9.8.3 6.3.8 |
Werner Lemberg | e95365b | 2004-04-24 14:43:37 +0000 | [diff] [blame] | 58 | 2.1.9 9.7.3 6.3.7 |
David Turner | ff9d241 | 2003-11-23 21:39:51 +0000 | [diff] [blame] | 59 | 2.1.8 9.6.3 6.3.6 |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 60 | 2.1.7 9.5.3 6.3.5 |
David Turner | 5671e6e | 2003-11-08 10:15:51 +0000 | [diff] [blame] | 61 | 2.1.6 9.5.3 6.3.5 |
Werner Lemberg | 42284f9 | 2003-07-26 06:08:14 +0000 | [diff] [blame] | 62 | 2.1.5 9.4.3 6.3.4 |
Werner Lemberg | f9d864a | 2003-07-25 05:57:21 +0000 | [diff] [blame] | 63 | 2.1.4 9.3.3 6.3.3 |
| 64 | 2.1.3 9.2.3 6.3.2 |
| 65 | 2.1.2 9.1.3 6.3.1 |
| 66 | 2.1.1 9.0.3 ? |
| 67 | 2.1.0 8.0.2 ? |
| 68 | 2.0.9 9.0.3 ? |
| 69 | 2.0.8 8.0.2 ? |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 70 | 2.0.4 7.0.1 ? |
| 71 | 2.0.1 6.1.0 ? |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 72 | |
| 73 | The libtool numbers are a bit inconsistent due to the library's history: |
| 74 | |
| 75 | - 2.1.0 was created as a development branch from 2.0.8 (hence the same |
| 76 | libtool numbers). |
| 77 | |
Werner Lemberg | a723526 | 2005-08-30 00:22:46 +0000 | [diff] [blame] | 78 | - 2.0.9 was a bug-fix release of the `stable' branch, and we |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 79 | incorrectly increased its libtool number. |
| 80 | |
Werner Lemberg | a723526 | 2005-08-30 00:22:46 +0000 | [diff] [blame] | 81 | - 2.1.4 is still in the `development' branch, however it is stable |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 82 | enough to be the basis of an upcoming 2.2.0 release. |
David Turner | 621e488 | 2002-12-16 21:51:24 +0000 | [diff] [blame] | 83 | |
| 84 | |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 85 | 3. Autoconf Code Fragment |
| 86 | ------------------------- |
David Turner | 621e488 | 2002-12-16 21:51:24 +0000 | [diff] [blame] | 87 | |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 88 | Lars Clausen contributed the following autoconf fragment to detect which |
| 89 | version of FreeType is installed on a system. This one tests for a |
Werner Lemberg | a723526 | 2005-08-30 00:22:46 +0000 | [diff] [blame] | 90 | version that is at least 2.0.9; you should change it to check against |
Werner Lemberg | 77c34b8 | 2003-05-20 22:06:38 +0000 | [diff] [blame] | 91 | other release numbers. |
David Turner | 621e488 | 2002-12-16 21:51:24 +0000 | [diff] [blame] | 92 | |
Werner Lemberg | 77c34b8 | 2003-05-20 22:06:38 +0000 | [diff] [blame] | 93 | |
| 94 | AC_MSG_CHECKING([whether FreeType version is 2.0.9 or higher]) |
| 95 | old_CPPFLAGS="$CPPFLAGS" |
| 96 | CPPFLAGS=`freetype-config --cflags` |
| 97 | AC_TRY_CPP([ |
Werner Lemberg | be67c4e | 2003-11-24 22:54:58 +0000 | [diff] [blame] | 98 | |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 99 | #include <ft2build.h> |
| 100 | #include FT_FREETYPE_H |
Werner Lemberg | 77c34b8 | 2003-05-20 22:06:38 +0000 | [diff] [blame] | 101 | #if (FREETYPE_MAJOR*1000 + FREETYPE_MINOR)*1000 + FREETYPE_PATCH < 2000009 |
| 102 | #error Freetype version too low. |
| 103 | #endif |
Werner Lemberg | be67c4e | 2003-11-24 22:54:58 +0000 | [diff] [blame] | 104 | ], |
| 105 | [AC_MSG_RESULT(yes) |
| 106 | FREETYPE_LIBS=`freetype-config --libs` |
| 107 | AC_SUBST(FREETYPE_LIBS) |
| 108 | AC_DEFINE(HAVE_FREETYPE,1,[Define if you have the FreeType2 library]) |
| 109 | CPPFLAGS="$old_CPPFLAGS"], |
| 110 | [AC_MSG_ERROR([Need FreeType library version 2.0.9 or higher])]) |
David Turner | 621e488 | 2002-12-16 21:51:24 +0000 | [diff] [blame] | 111 | |
Werner Lemberg | 56c368c | 2005-06-04 23:00:25 +0000 | [diff] [blame] | 112 | ------------------------------------------------------------------------ |
| 113 | |
Werner Lemberg | 49f4d34 | 2005-06-16 19:07:08 +0000 | [diff] [blame] | 114 | Copyright 2002, 2003, 2004, 2005 by |
Werner Lemberg | 56c368c | 2005-06-04 23:00:25 +0000 | [diff] [blame] | 115 | David Turner, Robert Wilhelm, and Werner Lemberg. |
| 116 | |
Werner Lemberg | a723526 | 2005-08-30 00:22:46 +0000 | [diff] [blame] | 117 | This file is part of the FreeType project, and may only be used, |
| 118 | modified, and distributed under the terms of the FreeType project |
| 119 | license, LICENSE.TXT. By continuing to use, modify, or distribute this |
| 120 | file you indicate that you have read the license and understand and |
Werner Lemberg | 56c368c | 2005-06-04 23:00:25 +0000 | [diff] [blame] | 121 | accept it fully. |
| 122 | |
David Turner | 621e488 | 2002-12-16 21:51:24 +0000 | [diff] [blame] | 123 | |
Werner Lemberg | a16c4a7 | 2003-04-21 13:30:27 +0000 | [diff] [blame] | 124 | --- end of VERSION.DLL --- |