Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 1 | # This file is part of the FreeType project. |
| 2 | # |
| 3 | # Process this file with autoconf to produce a configure script. |
Werner Lemberg | 60a04df | 2005-06-04 23:04:30 +0000 | [diff] [blame] | 4 | # |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 5 | # Copyright 2001, 2002, 2003, 2004, 2005, 2006 by |
Werner Lemberg | 60a04df | 2005-06-04 23:04:30 +0000 | [diff] [blame] | 6 | # David Turner, Robert Wilhelm, and Werner Lemberg. |
| 7 | # |
| 8 | # This file is part of the FreeType project, and may only be used, modified, |
| 9 | # and distributed under the terms of the FreeType project license, |
| 10 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you |
| 11 | # indicate that you have read the license and understand and accept it |
| 12 | # fully. |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 13 | |
Werner Lemberg | 4df5b26 | 2006-05-08 07:10:29 +0000 | [diff] [blame] | 14 | AC_INIT([FreeType], [@VERSION@], [freetype@nongnu.org], [freetype]) |
Werner Lemberg | b3f3210 | 2001-06-08 12:19:22 +0000 | [diff] [blame] | 15 | AC_CONFIG_SRCDIR([ftconfig.in]) |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 16 | |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 17 | |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 18 | # Don't forget to update docs/VERSION.DLL! |
| 19 | |
Werner Lemberg | 1639c79 | 2006-05-06 16:44:58 +0000 | [diff] [blame] | 20 | version_info='9:10:3' |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 21 | AC_SUBST([version_info]) |
Werner Lemberg | 3de5b07 | 2001-03-20 07:52:52 +0000 | [diff] [blame] | 22 | ft_version=`echo $version_info | tr : .` |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 23 | AC_SUBST([ft_version]) |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 24 | |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 25 | |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 26 | # checks for system type |
| 27 | |
| 28 | AC_CANONICAL_TARGET |
| 29 | |
| 30 | |
| 31 | # checks for programs |
| 32 | |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 33 | AC_PROG_CC |
| 34 | AC_PROG_CPP |
| 35 | |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 36 | |
| 37 | # get compiler flags right |
| 38 | |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 39 | if test "x$CC" = xgcc; then |
Werner Lemberg | 92aa527 | 2005-05-23 21:33:02 +0000 | [diff] [blame] | 40 | XX_CFLAGS="-Wall" |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 41 | XX_ANSIFLAGS="-pedantic -ansi" |
| 42 | else |
| 43 | case "$host" in |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 44 | *-dec-osf*) |
| 45 | CFLAGS= |
| 46 | XX_CFLAGS="-std1 -g3" |
| 47 | XX_ANSIFLAGS= |
| 48 | ;; |
| 49 | *) |
| 50 | XX_CFLAGS= |
| 51 | XX_ANSIFLAGS= |
| 52 | ;; |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 53 | esac |
| 54 | fi |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 55 | AC_SUBST([XX_CFLAGS]) |
| 56 | AC_SUBST([XX_ANSIFLAGS]) |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 57 | |
Werner Lemberg | fd9777e | 2000-07-31 10:56:42 +0000 | [diff] [blame] | 58 | |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 59 | # auxiliary programs |
| 60 | |
| 61 | AC_CHECK_PROG([RMF], [rm], [rm -f]) |
| 62 | AC_CHECK_PROG([RMDIR], [rmdir], [rmdir]) |
| 63 | |
| 64 | |
| 65 | # Since this file will be finally moved to another directory we make |
| 66 | # the path of the install script absolute. This small code snippet has |
| 67 | # been taken from automake's `ylwrap' script. |
| 68 | |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 69 | AC_PROG_INSTALL |
Werner Lemberg | fd9777e | 2000-07-31 10:56:42 +0000 | [diff] [blame] | 70 | case "$INSTALL" in |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 71 | /*) |
| 72 | ;; |
| 73 | */*) |
| 74 | INSTALL="`pwd`/$INSTALL" ;; |
Werner Lemberg | fd9777e | 2000-07-31 10:56:42 +0000 | [diff] [blame] | 75 | esac |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 76 | |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 77 | |
| 78 | # checks for header files |
| 79 | |
Werner Lemberg | d060a75 | 2000-07-20 06:57:41 +0000 | [diff] [blame] | 80 | AC_HEADER_STDC |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 81 | AC_CHECK_HEADERS([fcntl.h unistd.h]) |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 82 | |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 83 | |
| 84 | # checks for typedefs, structures, and compiler characteristics |
| 85 | |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 86 | AC_C_CONST |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 87 | AC_CHECK_SIZEOF([int]) |
| 88 | AC_CHECK_SIZEOF([long]) |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 89 | |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 90 | |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 91 | # checks for library functions |
| 92 | |
| 93 | # Here we check whether we can use our mmap file component. |
| 94 | |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 95 | AC_FUNC_MMAP |
| 96 | if test "$ac_cv_func_mmap_fixed_mapped" != yes; then |
Werner Lemberg | 858f310 | 2003-06-09 04:46:30 +0000 | [diff] [blame] | 97 | FTSYS_SRC='$(BASE_DIR)/ftsystem.c' |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 98 | else |
Werner Lemberg | 858f310 | 2003-06-09 04:46:30 +0000 | [diff] [blame] | 99 | FTSYS_SRC='$(BUILD_DIR)/ftsystem.c' |
Werner Lemberg | b1dd353 | 2000-07-31 22:51:00 +0000 | [diff] [blame] | 100 | |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 101 | AC_CHECK_DECLS([munmap], |
| 102 | [], |
| 103 | [], |
| 104 | [ |
| 105 | |
| 106 | #ifdef HAVE_UNISTD_H |
| 107 | #include <unistd.h> |
| 108 | #endif |
| 109 | #include <sys/mman.h> |
| 110 | |
| 111 | ]) |
| 112 | |
Werner Lemberg | b1dd353 | 2000-07-31 22:51:00 +0000 | [diff] [blame] | 113 | FT_MUNMAP_PARAM |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 114 | fi |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 115 | AC_SUBST([FTSYS_SRC]) |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 116 | |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 117 | AC_CHECK_FUNCS([memcpy memmove]) |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 118 | |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 119 | |
| 120 | # Check for system zlib |
| 121 | |
Werner Lemberg | fd7456c | 2006-04-03 15:46:48 +0000 | [diff] [blame] | 122 | # don't quote AS_HELP_STRING! |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 123 | AC_ARG_WITH([zlib], |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 124 | AS_HELP_STRING([--without-zlib], |
| 125 | [use internal zlib instead of system-wide])) |
David Turner | 621e488 | 2002-12-16 21:51:24 +0000 | [diff] [blame] | 126 | if test x$with_zlib != xno && test -z "$LIBZ"; then |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 127 | AC_CHECK_LIB([z], [gzsetparams], [AC_CHECK_HEADER([zlib.h], [LIBZ='-lz'])]) |
David Turner | 621e488 | 2002-12-16 21:51:24 +0000 | [diff] [blame] | 128 | fi |
| 129 | if test x$with_zlib != xno && test -n "$LIBZ"; then |
| 130 | CFLAGS="$CFLAGS -DFT_CONFIG_OPTION_SYSTEM_ZLIB" |
David Turner | 19b6b99 | 2002-12-23 22:40:21 +0000 | [diff] [blame] | 131 | LDFLAGS="$LDFLAGS $LIBZ" |
David Turner | 621e488 | 2002-12-16 21:51:24 +0000 | [diff] [blame] | 132 | SYSTEM_ZLIB=yes |
| 133 | fi |
Werner Lemberg | 6eb116e | 2003-05-11 07:12:26 +0000 | [diff] [blame] | 134 | |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 135 | |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 136 | # Whether to use Mac OS resource-based fonts. |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 137 | |
Werner Lemberg | fd7456c | 2006-04-03 15:46:48 +0000 | [diff] [blame] | 138 | # don't quote AS_HELP_STRING! |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 139 | AC_ARG_WITH([old-mac-fonts], |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 140 | AS_HELP_STRING([--with-old-mac-fonts], |
| 141 | [allow Mac resource-based fonts to be used])) |
Werner Lemberg | 6eb116e | 2003-05-11 07:12:26 +0000 | [diff] [blame] | 142 | if test x$with_old_mac_fonts = xyes; then |
Suzuki, Toshiya (鈴木俊哉) | 458c342 | 2006-02-08 12:58:24 +0000 | [diff] [blame] | 143 | orig_LDFLAGS="${LDFLAGS}" |
| 144 | AC_MSG_CHECKING([CoreServices & ApplicationServices of Mac OS X]) |
Werner Lemberg | 6eb116e | 2003-05-11 07:12:26 +0000 | [diff] [blame] | 145 | LDFLAGS="$LDFLAGS -Xlinker -framework -Xlinker CoreServices \ |
| 146 | -Xlinker -framework -Xlinker ApplicationServices" |
Werner Lemberg | 6be99f9 | 2006-02-09 07:38:57 +0000 | [diff] [blame] | 147 | AC_TRY_LINK([], |
| 148 | [], |
| 149 | [AC_MSG_RESULT([ok])], |
| 150 | [AC_MSG_RESULT([not found]) |
| 151 | LDFLAGS="${orig_LDFLAGS}" |
| 152 | CFLAGS="$CFLAGS -DDARWIN_NO_CARBON"]) |
Suzuki, Toshiya (鈴木俊哉) | 8cfa8bd | 2006-05-19 22:11:50 +0000 | [diff] [blame] | 153 | else |
| 154 | case x$target_os in |
| 155 | xdarwin*) |
| 156 | dnl AC_MSG_WARN([target system is MacOS but configured to build without Carbon]) |
| 157 | CFLAGS="$CFLAGS -DDARWIN_NO_CARBON" |
| 158 | ;; |
| 159 | *) ;; |
| 160 | esac |
Werner Lemberg | 6eb116e | 2003-05-11 07:12:26 +0000 | [diff] [blame] | 161 | fi |
| 162 | |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 163 | |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 164 | # Whether to use FileManager which is deprecated since Mac OS X 10.4. |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 165 | |
| 166 | AC_ARG_WITH([fsspec], |
| 167 | AS_HELP_STRING([--with-fsspec], |
| 168 | [use obsolete FSSpec API of MacOS, if available (default=yes)])) |
| 169 | if test x$with_fsspec = xno; then |
| 170 | CFLAGS="$CFLAGS -DHAVE_FSSPEC=0" |
| 171 | elif test x$with_old_mac_fonts = xyes; then |
| 172 | AC_MSG_CHECKING([FSSpec-based FileManager]) |
| 173 | AC_TRY_LINK([ |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 174 | |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 175 | #if defined(__GNUC__) && defined(__APPLE_CC__) |
| 176 | # include <Carbon/Carbon.h> |
| 177 | # include <ApplicationServices/ApplicationServices.h> |
| 178 | #else |
| 179 | # include <ConditionalMacros.h> |
| 180 | # include <Files.h> |
| 181 | #endif |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 182 | |
Werner Lemberg | 6be99f9 | 2006-02-09 07:38:57 +0000 | [diff] [blame] | 183 | ], |
| 184 | [ |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 185 | |
| 186 | FCBPBPtr paramBlock; |
| 187 | short vRefNum; |
| 188 | long dirID; |
| 189 | ConstStr255Param fileName; |
| 190 | FSSpec* spec; |
| 191 | |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 192 | |
| 193 | /* FSSpec functions: deprecated sicne Mac OS X 10.4 */ |
| 194 | PBGetFCBInfoSync( paramBlock ); |
| 195 | FSMakeFSSpec( vRefNum, dirID, fileName, spec ); |
| 196 | |
Werner Lemberg | 6be99f9 | 2006-02-09 07:38:57 +0000 | [diff] [blame] | 197 | ], |
| 198 | [AC_MSG_RESULT([ok]) |
| 199 | CFLAGS="$CFLAGS -DHAVE_FSSPEC=1"], |
| 200 | [AC_MSG_RESULT([not found]) |
| 201 | CFLAGS="$CFLAGS -DHAVE_FSSPEC=0"]) |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 202 | fi |
| 203 | |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 204 | |
| 205 | # Whether to use FileManager in Carbon since MacOS 9.x. |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 206 | |
| 207 | AC_ARG_WITH([fsref], |
| 208 | AS_HELP_STRING([--with-fsref], |
| 209 | [use Carbon FSRef API of MacOS, if available (default=yes)])) |
| 210 | if test x$with_fsref = xno; then |
| 211 | AC_MSG_WARN([ |
| 212 | *** WARNING |
| 213 | FreeType2 built without FSRef API cannot load |
| 214 | data-fork fonts on MacOS, except of XXX.dfont. |
Werner Lemberg | 6be99f9 | 2006-02-09 07:38:57 +0000 | [diff] [blame] | 215 | ]) |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 216 | CFLAGS="$CFLAGS -DHAVE_FSREF=0" |
| 217 | elif test x$with_old_mac_fonts = xyes; then |
| 218 | AC_MSG_CHECKING([FSRef-based FileManager]) |
| 219 | AC_TRY_LINK([ |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 220 | |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 221 | #if defined(__GNUC__) && defined(__APPLE_CC__) |
| 222 | # include <Carbon/Carbon.h> |
| 223 | # include <ApplicationServices/ApplicationServices.h> |
| 224 | #else |
| 225 | # include <ConditionalMacros.h> |
| 226 | # include <Files.h> |
| 227 | #endif |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 228 | |
Werner Lemberg | 6be99f9 | 2006-02-09 07:38:57 +0000 | [diff] [blame] | 229 | ], |
| 230 | [ |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 231 | |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 232 | FCBPBPtr paramBlock; |
| 233 | short vRefNum; |
| 234 | long dirID; |
| 235 | ConstStr255Param fileName; |
| 236 | FSSpec* spec; |
| 237 | |
| 238 | Boolean* isDirectory; |
| 239 | UInt8* path; |
| 240 | SInt16 desiredRefNum; |
| 241 | SInt16* iterator; |
| 242 | SInt16* actualRefNum; |
| 243 | HFSUniStr255* outForkName; |
| 244 | FSVolumeRefNum volume; |
| 245 | FSCatalogInfoBitmap whichInfo; |
| 246 | FSCatalogInfo* catalogInfo; |
| 247 | FSForkInfo* forkInfo; |
| 248 | FSRef* ref; |
| 249 | |
| 250 | |
| 251 | /* FSRef functions: no need to check? */ |
| 252 | FSGetForkCBInfo( desiredRefNum, volume, iterator, |
| 253 | actualRefNum, forkInfo, ref, |
| 254 | outForkName ); |
| 255 | FSpMakeFSRef ( spec, ref ); |
| 256 | FSGetCatalogInfo( ref, whichInfo, catalogInfo, |
| 257 | outForkName, spec, ref ); |
| 258 | FSPathMakeRef( path, ref, isDirectory ); |
| 259 | |
Werner Lemberg | 6be99f9 | 2006-02-09 07:38:57 +0000 | [diff] [blame] | 260 | ], |
| 261 | [AC_MSG_RESULT([ok]) |
| 262 | CFLAGS="$CFLAGS -DHAVE_FSREF=1"], |
| 263 | [AC_MSG_RESULT([not found]) |
| 264 | CFLAGS="$CFLAGS -DHAVE_FSREF=0"]) |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 265 | fi |
| 266 | |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 267 | |
| 268 | # Whether to use QuickDraw API in ToolBox which is deprecated since Mac OS X 10.4. |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 269 | |
| 270 | AC_ARG_WITH([quickdraw-toolbox], |
| 271 | AS_HELP_STRING([--with-quickdraw-toolbox], |
| 272 | [use MacOS QuickDraw in ToolBox, if available (default=yes)])) |
| 273 | if test x$with_quickdraw_toolbox = xno; then |
| 274 | CFLAGS="$CFLAGS -DHAVE_QUICKDRAW_TOOLBOX=0" |
| 275 | elif test x$with_old_mac_fonts = xyes; then |
| 276 | AC_MSG_CHECKING([QuickDraw FontManager functions in ToolBox]) |
| 277 | AC_TRY_LINK([ |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 278 | |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 279 | #if defined(__GNUC__) && defined(__APPLE_CC__) |
| 280 | # include <Carbon/Carbon.h> |
| 281 | # include <ApplicationServices/ApplicationServices.h> |
| 282 | #else |
| 283 | # include <ConditionalMacros.h> |
| 284 | # include <Fonts.h> |
| 285 | #endif |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 286 | |
Werner Lemberg | 6be99f9 | 2006-02-09 07:38:57 +0000 | [diff] [blame] | 287 | ], |
| 288 | [ |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 289 | |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 290 | Str255 familyName; |
| 291 | SInt16 familyID = 0; |
| 292 | FMInput* fmIn = NULL; |
| 293 | FMOutput* fmOut = NULL; |
| 294 | |
| 295 | |
| 296 | GetFontName( familyID, familyName ); |
| 297 | GetFNum( familyName, &familyID ); |
| 298 | fmOut = FMSwapFont( fmIn ); |
| 299 | |
Werner Lemberg | 6be99f9 | 2006-02-09 07:38:57 +0000 | [diff] [blame] | 300 | ], |
| 301 | [AC_MSG_RESULT([ok]) |
| 302 | CFLAGS="$CFLAGS -DHAVE_QUICKDRAW_TOOLBOX=1"], |
| 303 | [AC_MSG_RESULT([not found]) |
| 304 | CFLAGS="$CFLAGS -DHAVE_QUICKDRAW_TOOLBOX=0"]) |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 305 | fi |
| 306 | |
| 307 | |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 308 | # Whether to use QuickDraw API in Carbon which is deprecated since Mac OS X 10.4. |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 309 | |
| 310 | AC_ARG_WITH([quickdraw-carbon], |
| 311 | AS_HELP_STRING([--with-quickdraw-carbon], |
| 312 | [use MacOS QuickDraw in Carbon, if available (default=yes)])) |
| 313 | if test x$with_quickdraw_carbon = xno; then |
| 314 | CFLAGS="$CFLAGS -DHAVE_QUICKDRAW_CARBON=0" |
| 315 | elif test x$with_old_mac_fonts = xyes; then |
| 316 | AC_MSG_CHECKING([QuickDraw FontManager functions in Carbon]) |
| 317 | AC_TRY_LINK([ |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 318 | |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 319 | #if defined(__GNUC__) && defined(__APPLE_CC__) |
| 320 | # include <Carbon/Carbon.h> |
| 321 | # include <ApplicationServices/ApplicationServices.h> |
| 322 | #else |
| 323 | # include <ConditionalMacros.h> |
| 324 | # include <Fonts.h> |
| 325 | #endif |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 326 | |
Werner Lemberg | 6be99f9 | 2006-02-09 07:38:57 +0000 | [diff] [blame] | 327 | ], |
| 328 | [ |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 329 | |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 330 | FMFontFamilyIterator famIter; |
| 331 | FMFontFamily family; |
| 332 | Str255 famNameStr; |
| 333 | FMFontFamilyInstanceIterator instIter; |
| 334 | FMFontStyle style; |
| 335 | FMFontSize size; |
| 336 | FMFont font; |
| 337 | FSSpec* pathSpec; |
| 338 | |
| 339 | |
| 340 | FMCreateFontFamilyIterator( NULL, NULL, kFMUseGlobalScopeOption, &famIter ); |
| 341 | FMGetNextFontFamily( &famIter, &family ); |
| 342 | FMGetFontFamilyName( family, famNameStr ); |
| 343 | FMCreateFontFamilyInstanceIterator( family, &instIter ); |
| 344 | FMGetNextFontFamilyInstance( &instIter, &font, &style, &size ); |
| 345 | FMDisposeFontFamilyInstanceIterator( &instIter ); |
| 346 | FMDisposeFontFamilyIterator( &famIter ); |
| 347 | FMGetFontContainer( font, pathSpec ); |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 348 | |
Werner Lemberg | 6be99f9 | 2006-02-09 07:38:57 +0000 | [diff] [blame] | 349 | ], |
| 350 | [AC_MSG_RESULT([ok]) |
| 351 | CFLAGS="$CFLAGS -DHAVE_QUICKDRAW_CARBON=1"], |
| 352 | [AC_MSG_RESULT([not found]) |
| 353 | CFLAGS="$CFLAGS -DHAVE_QUICKDRAW_CARBON=0"]) |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 354 | fi |
| 355 | |
| 356 | |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 357 | # Whether to use AppleTypeService since Mac OS X. |
| 358 | |
Werner Lemberg | fd7456c | 2006-04-03 15:46:48 +0000 | [diff] [blame] | 359 | # don't quote AS_HELP_STRING! |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 360 | AC_ARG_WITH([ats], |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 361 | AS_HELP_STRING([--with-ats], |
| 362 | [use AppleTypeService, if available (default=yes)])) |
| 363 | if test x$with_ats = xno; then |
| 364 | CFLAGS="$CFLAGS -DHAVE_ATS=0" |
| 365 | elif test x$with_old_mac_fonts = xyes; then |
| 366 | AC_MSG_CHECKING([AppleTypeService functions]) |
| 367 | AC_TRY_LINK([ |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 368 | |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 369 | #include <Carbon/Carbon.h> |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 370 | |
Werner Lemberg | 6be99f9 | 2006-02-09 07:38:57 +0000 | [diff] [blame] | 371 | ], |
| 372 | [ |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 373 | |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 374 | FSSpec* pathSpec; |
| 375 | |
| 376 | |
| 377 | ATSFontFindFromName( NULL, kATSOptionFlagsUnRestrictedScope ); |
| 378 | ATSFontGetFileSpecification( 0, pathSpec ); |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 379 | |
Werner Lemberg | 6be99f9 | 2006-02-09 07:38:57 +0000 | [diff] [blame] | 380 | ], |
| 381 | [AC_MSG_RESULT([ok]) |
| 382 | CFLAGS="$CFLAGS -DHAVE_ATS=1"], |
| 383 | [AC_MSG_RESULT([not found]) |
| 384 | CFLAGS="$CFLAGS -DHAVE_ATS=0"]) |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 385 | fi |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 386 | |
| 387 | |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 388 | AC_SUBST([LIBZ]) |
| 389 | AC_SUBST([CFLAGS]) |
| 390 | AC_SUBST([LDFLAGS]) |
| 391 | AC_SUBST([SYSTEM_ZLIB]) |
| 392 | |
David Turner | 621e488 | 2002-12-16 21:51:24 +0000 | [diff] [blame] | 393 | |
Werner Lemberg | c0c2abe | 2001-06-07 17:36:17 +0000 | [diff] [blame] | 394 | AC_PROG_LIBTOOL |
Werner Lemberg | 53a1edd | 2004-02-08 22:45:48 +0000 | [diff] [blame] | 395 | # urgh -- these are internal libtool variables... |
| 396 | AC_SUBST([enable_shared]) |
| 397 | AC_SUBST([hardcode_libdir_flag_spec]) |
| 398 | AC_SUBST([wl]) |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 399 | |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 400 | |
| 401 | # configuration file -- stay in 8.3 limit |
| 402 | # |
| 403 | # since #undef doesn't survive in configuration header files we replace |
| 404 | # `/undef' with `#undef' after creating the output file |
| 405 | |
| 406 | AC_CONFIG_HEADERS([ftconfig.h:ftconfig.in], |
| 407 | [mv ftconfig.h ftconfig.tmp |
| 408 | sed 's|/undef|#undef|' < ftconfig.tmp > ftconfig.h |
| 409 | rm ftconfig.tmp]) |
| 410 | |
| 411 | # create the Unix-specific sub-Makefiles `builds/unix/unix-def.mk' |
| 412 | # and 'builds/unix/unix-cc.mk' that will be used by the build system |
| 413 | # |
Werner Lemberg | 3a317c6 | 2003-04-28 09:43:32 +0000 | [diff] [blame] | 414 | AC_CONFIG_FILES([unix-cc.mk:unix-cc.in |
| 415 | unix-def.mk:unix-def.in |
| 416 | freetype-config |
| 417 | freetype2.pc:freetype2.in]) |
David Turner | ce9a044 | 2002-01-08 18:33:55 +0000 | [diff] [blame] | 418 | |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 419 | # re-generate the Jamfile to use libtool now |
| 420 | # |
| 421 | # AC_CONFIG_FILES([../../Jamfile:../../Jamfile.in]) |
David Turner | ce9a044 | 2002-01-08 18:33:55 +0000 | [diff] [blame] | 422 | |
Werner Lemberg | b3f3210 | 2001-06-08 12:19:22 +0000 | [diff] [blame] | 423 | AC_OUTPUT |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 424 | |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 425 | # end of configure.ac |