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