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 | 17432b5 | 2007-01-12 09:28:44 +0000 | [diff] [blame] | 5 | # Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007 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 | 3b0e500 | 2007-07-03 04:48:19 +0000 | [diff] [blame^] | 20 | version_info='9:16: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([ |
Werner Lemberg | dcbb708 | 2007-02-08 08:54:09 +0000 | [diff] [blame] | 186 | |
Suzuki, Toshiya (鈴木俊哉) | 7e3d601 | 2006-12-15 15:23:21 +0000 | [diff] [blame] | 187 | #if defined(__GNUC__) && defined(__APPLE_CC__) |
| 188 | # include <Carbon/Carbon.h> |
| 189 | # include <ApplicationServices/ApplicationServices.h> |
| 190 | #else |
| 191 | # include <ConditionalMacros.h> |
| 192 | # include <Files.h> |
| 193 | #endif |
Werner Lemberg | dcbb708 | 2007-02-08 08:54:09 +0000 | [diff] [blame] | 194 | |
Suzuki, Toshiya (鈴木俊哉) | 7e3d601 | 2006-12-15 15:23:21 +0000 | [diff] [blame] | 195 | ], |
| 196 | [ |
| 197 | |
| 198 | short res = 0; |
| 199 | |
| 200 | |
| 201 | UseResFile( res ); |
| 202 | |
| 203 | ], |
Suzuki, Toshiya (鈴木俊哉) | 027357f | 2007-02-05 02:50:45 +0000 | [diff] [blame] | 204 | [AC_MSG_RESULT([ok]) |
| 205 | AC_MSG_CHECKING([OS_INLINE macro is ANSI compatible]) |
| 206 | orig_CFLAGS="$CFLAGS" |
| 207 | CFLAGS="$CFLAGS $XX_CFLAGS $XX_ANSIFLAGS" |
| 208 | AC_TRY_COMPILE([ |
Werner Lemberg | dcbb708 | 2007-02-08 08:54:09 +0000 | [diff] [blame] | 209 | |
Suzuki, Toshiya (鈴木俊哉) | 027357f | 2007-02-05 02:50:45 +0000 | [diff] [blame] | 210 | #if defined(__GNUC__) && defined(__APPLE_CC__) |
| 211 | # include <Carbon/Carbon.h> |
| 212 | # include <ApplicationServices/ApplicationServices.h> |
| 213 | #else |
| 214 | # include <ConditionalMacros.h> |
| 215 | # include <Files.h> |
| 216 | #endif |
Werner Lemberg | dcbb708 | 2007-02-08 08:54:09 +0000 | [diff] [blame] | 217 | |
Suzuki, Toshiya (鈴木俊哉) | 027357f | 2007-02-05 02:50:45 +0000 | [diff] [blame] | 218 | ], |
| 219 | [ |
Werner Lemberg | dcbb708 | 2007-02-08 08:54:09 +0000 | [diff] [blame] | 220 | |
Suzuki, Toshiya (鈴木俊哉) | 6fb74f6 | 2007-03-19 06:30:26 +0000 | [diff] [blame] | 221 | /* OSHostByteOrder() is typed as OS_INLINE */ |
Werner Lemberg | dcbb708 | 2007-02-08 08:54:09 +0000 | [diff] [blame] | 222 | int32_t os_byte_order = OSHostByteOrder(); |
| 223 | |
| 224 | |
Suzuki, Toshiya (鈴木俊哉) | 027357f | 2007-02-05 02:50:45 +0000 | [diff] [blame] | 225 | if ( OSBigEndian != os_byte_order ) |
| 226 | return 1; |
Werner Lemberg | dcbb708 | 2007-02-08 08:54:09 +0000 | [diff] [blame] | 227 | |
Suzuki, Toshiya (鈴木俊哉) | 027357f | 2007-02-05 02:50:45 +0000 | [diff] [blame] | 228 | ], |
Werner Lemberg | dcbb708 | 2007-02-08 08:54:09 +0000 | [diff] [blame] | 229 | [AC_MSG_RESULT([ok]) |
| 230 | CFLAGS="$orig_CFLAGS" |
| 231 | CFLAGS="$CFLAGS -DHAVE_ANSI_OS_INLINE=1" |
| 232 | ], |
| 233 | [AC_MSG_RESULT([no, ANSI incompatible]) |
| 234 | CFLAGS="$orig_CFLAGS" |
Suzuki, Toshiya (鈴木俊哉) | 027357f | 2007-02-05 02:50:45 +0000 | [diff] [blame] | 235 | ]) |
| 236 | ], |
Werner Lemberg | 6be99f9 | 2006-02-09 07:38:57 +0000 | [diff] [blame] | 237 | [AC_MSG_RESULT([not found]) |
| 238 | LDFLAGS="${orig_LDFLAGS}" |
| 239 | CFLAGS="$CFLAGS -DDARWIN_NO_CARBON"]) |
Suzuki, Toshiya (鈴木俊哉) | 8cfa8bd | 2006-05-19 22:11:50 +0000 | [diff] [blame] | 240 | else |
| 241 | case x$target_os in |
| 242 | xdarwin*) |
| 243 | dnl AC_MSG_WARN([target system is MacOS but configured to build without Carbon]) |
| 244 | CFLAGS="$CFLAGS -DDARWIN_NO_CARBON" |
| 245 | ;; |
| 246 | *) ;; |
| 247 | esac |
Werner Lemberg | 6eb116e | 2003-05-11 07:12:26 +0000 | [diff] [blame] | 248 | fi |
| 249 | |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 250 | |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 251 | # 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] | 252 | |
| 253 | AC_ARG_WITH([fsspec], |
| 254 | AS_HELP_STRING([--with-fsspec], |
| 255 | [use obsolete FSSpec API of MacOS, if available (default=yes)])) |
| 256 | if test x$with_fsspec = xno; then |
| 257 | CFLAGS="$CFLAGS -DHAVE_FSSPEC=0" |
Suzuki, Toshiya (鈴木俊哉) | 7e3d601 | 2006-12-15 15:23:21 +0000 | [diff] [blame] | 258 | 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] | 259 | AC_MSG_CHECKING([FSSpec-based FileManager]) |
| 260 | AC_TRY_LINK([ |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 261 | |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 262 | #if defined(__GNUC__) && defined(__APPLE_CC__) |
| 263 | # include <Carbon/Carbon.h> |
| 264 | # include <ApplicationServices/ApplicationServices.h> |
| 265 | #else |
| 266 | # include <ConditionalMacros.h> |
| 267 | # include <Files.h> |
| 268 | #endif |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 269 | |
Werner Lemberg | 6be99f9 | 2006-02-09 07:38:57 +0000 | [diff] [blame] | 270 | ], |
| 271 | [ |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 272 | |
Werner Lemberg | dcbb708 | 2007-02-08 08:54:09 +0000 | [diff] [blame] | 273 | FCBPBPtr paramBlock; |
| 274 | short vRefNum; |
| 275 | long dirID; |
| 276 | ConstStr255Param fileName; |
| 277 | FSSpec* spec; |
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 | |
Werner Lemberg | dcbb708 | 2007-02-08 08:54:09 +0000 | [diff] [blame] | 280 | /* FSSpec functions: deprecated since Mac OS X 10.4 */ |
| 281 | PBGetFCBInfoSync( paramBlock ); |
| 282 | FSMakeFSSpec( vRefNum, dirID, fileName, spec ); |
Werner Lemberg | b4142d5 | 2007-01-17 12:45:26 +0000 | [diff] [blame] | 283 | |
Werner Lemberg | 6be99f9 | 2006-02-09 07:38:57 +0000 | [diff] [blame] | 284 | ], |
| 285 | [AC_MSG_RESULT([ok]) |
| 286 | CFLAGS="$CFLAGS -DHAVE_FSSPEC=1"], |
| 287 | [AC_MSG_RESULT([not found]) |
| 288 | CFLAGS="$CFLAGS -DHAVE_FSSPEC=0"]) |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 289 | fi |
| 290 | |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 291 | |
| 292 | # Whether to use FileManager in Carbon since MacOS 9.x. |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 293 | |
| 294 | AC_ARG_WITH([fsref], |
| 295 | AS_HELP_STRING([--with-fsref], |
| 296 | [use Carbon FSRef API of MacOS, if available (default=yes)])) |
| 297 | if test x$with_fsref = xno; then |
| 298 | AC_MSG_WARN([ |
| 299 | *** WARNING |
| 300 | FreeType2 built without FSRef API cannot load |
| 301 | data-fork fonts on MacOS, except of XXX.dfont. |
Werner Lemberg | 6be99f9 | 2006-02-09 07:38:57 +0000 | [diff] [blame] | 302 | ]) |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 303 | CFLAGS="$CFLAGS -DHAVE_FSREF=0" |
Suzuki, Toshiya (鈴木俊哉) | 7e3d601 | 2006-12-15 15:23:21 +0000 | [diff] [blame] | 304 | 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] | 305 | AC_MSG_CHECKING([FSRef-based FileManager]) |
| 306 | AC_TRY_LINK([ |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 307 | |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 308 | #if defined(__GNUC__) && defined(__APPLE_CC__) |
| 309 | # include <Carbon/Carbon.h> |
| 310 | # include <ApplicationServices/ApplicationServices.h> |
| 311 | #else |
| 312 | # include <ConditionalMacros.h> |
| 313 | # include <Files.h> |
| 314 | #endif |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 315 | |
Werner Lemberg | 6be99f9 | 2006-02-09 07:38:57 +0000 | [diff] [blame] | 316 | ], |
| 317 | [ |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 318 | |
Werner Lemberg | dcbb708 | 2007-02-08 08:54:09 +0000 | [diff] [blame] | 319 | FCBPBPtr paramBlock; |
| 320 | short vRefNum; |
| 321 | long dirID; |
| 322 | ConstStr255Param fileName; |
| 323 | FSSpec* spec; |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 324 | |
Werner Lemberg | dcbb708 | 2007-02-08 08:54:09 +0000 | [diff] [blame] | 325 | Boolean* isDirectory; |
| 326 | UInt8* path; |
| 327 | SInt16 desiredRefNum; |
| 328 | SInt16* iterator; |
| 329 | SInt16* actualRefNum; |
| 330 | HFSUniStr255* outForkName; |
| 331 | FSVolumeRefNum volume; |
| 332 | FSCatalogInfoBitmap whichInfo; |
| 333 | FSCatalogInfo* catalogInfo; |
| 334 | FSForkInfo* forkInfo; |
| 335 | FSRef* ref; |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 336 | |
| 337 | |
Werner Lemberg | dcbb708 | 2007-02-08 08:54:09 +0000 | [diff] [blame] | 338 | /* FSRef functions: no need to check? */ |
| 339 | FSGetForkCBInfo( desiredRefNum, volume, iterator, |
| 340 | actualRefNum, forkInfo, ref, |
| 341 | outForkName ); |
| 342 | FSpMakeFSRef ( spec, ref ); |
| 343 | FSGetCatalogInfo( ref, whichInfo, catalogInfo, |
| 344 | outForkName, spec, ref ); |
| 345 | FSPathMakeRef( path, ref, isDirectory ); |
Werner Lemberg | b4142d5 | 2007-01-17 12:45:26 +0000 | [diff] [blame] | 346 | |
Werner Lemberg | 6be99f9 | 2006-02-09 07:38:57 +0000 | [diff] [blame] | 347 | ], |
| 348 | [AC_MSG_RESULT([ok]) |
| 349 | CFLAGS="$CFLAGS -DHAVE_FSREF=1"], |
| 350 | [AC_MSG_RESULT([not found]) |
| 351 | CFLAGS="$CFLAGS -DHAVE_FSREF=0"]) |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 352 | fi |
| 353 | |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 354 | |
Werner Lemberg | dcbb708 | 2007-02-08 08:54:09 +0000 | [diff] [blame] | 355 | # Whether to use QuickDraw API in ToolBox which is deprecated since |
| 356 | # Mac OS X 10.4. |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 357 | |
| 358 | AC_ARG_WITH([quickdraw-toolbox], |
| 359 | AS_HELP_STRING([--with-quickdraw-toolbox], |
| 360 | [use MacOS QuickDraw in ToolBox, if available (default=yes)])) |
| 361 | if test x$with_quickdraw_toolbox = xno; then |
| 362 | CFLAGS="$CFLAGS -DHAVE_QUICKDRAW_TOOLBOX=0" |
Suzuki, Toshiya (鈴木俊哉) | 7e3d601 | 2006-12-15 15:23:21 +0000 | [diff] [blame] | 363 | 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] | 364 | AC_MSG_CHECKING([QuickDraw FontManager functions in ToolBox]) |
| 365 | AC_TRY_LINK([ |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 366 | |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 367 | #if defined(__GNUC__) && defined(__APPLE_CC__) |
| 368 | # include <Carbon/Carbon.h> |
| 369 | # include <ApplicationServices/ApplicationServices.h> |
| 370 | #else |
| 371 | # include <ConditionalMacros.h> |
| 372 | # include <Fonts.h> |
| 373 | #endif |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 374 | |
Werner Lemberg | 6be99f9 | 2006-02-09 07:38:57 +0000 | [diff] [blame] | 375 | ], |
| 376 | [ |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 377 | |
Werner Lemberg | dcbb708 | 2007-02-08 08:54:09 +0000 | [diff] [blame] | 378 | Str255 familyName; |
| 379 | SInt16 familyID = 0; |
| 380 | FMInput* fmIn = NULL; |
| 381 | FMOutput* fmOut = NULL; |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 382 | |
| 383 | |
Werner Lemberg | dcbb708 | 2007-02-08 08:54:09 +0000 | [diff] [blame] | 384 | GetFontName( familyID, familyName ); |
| 385 | GetFNum( familyName, &familyID ); |
| 386 | fmOut = FMSwapFont( fmIn ); |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 387 | |
Werner Lemberg | 6be99f9 | 2006-02-09 07:38:57 +0000 | [diff] [blame] | 388 | ], |
| 389 | [AC_MSG_RESULT([ok]) |
| 390 | CFLAGS="$CFLAGS -DHAVE_QUICKDRAW_TOOLBOX=1"], |
| 391 | [AC_MSG_RESULT([not found]) |
| 392 | CFLAGS="$CFLAGS -DHAVE_QUICKDRAW_TOOLBOX=0"]) |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 393 | fi |
| 394 | |
| 395 | |
Werner Lemberg | dcbb708 | 2007-02-08 08:54:09 +0000 | [diff] [blame] | 396 | # Whether to use QuickDraw API in Carbon which is deprecated since |
| 397 | # Mac OS X 10.4. |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 398 | |
| 399 | AC_ARG_WITH([quickdraw-carbon], |
| 400 | AS_HELP_STRING([--with-quickdraw-carbon], |
| 401 | [use MacOS QuickDraw in Carbon, if available (default=yes)])) |
| 402 | if test x$with_quickdraw_carbon = xno; then |
| 403 | CFLAGS="$CFLAGS -DHAVE_QUICKDRAW_CARBON=0" |
Suzuki, Toshiya (鈴木俊哉) | 7e3d601 | 2006-12-15 15:23:21 +0000 | [diff] [blame] | 404 | 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] | 405 | AC_MSG_CHECKING([QuickDraw FontManager functions in Carbon]) |
| 406 | AC_TRY_LINK([ |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 407 | |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 408 | #if defined(__GNUC__) && defined(__APPLE_CC__) |
| 409 | # include <Carbon/Carbon.h> |
| 410 | # include <ApplicationServices/ApplicationServices.h> |
| 411 | #else |
| 412 | # include <ConditionalMacros.h> |
| 413 | # include <Fonts.h> |
| 414 | #endif |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 415 | |
Werner Lemberg | 6be99f9 | 2006-02-09 07:38:57 +0000 | [diff] [blame] | 416 | ], |
| 417 | [ |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 418 | |
Werner Lemberg | dcbb708 | 2007-02-08 08:54:09 +0000 | [diff] [blame] | 419 | FMFontFamilyIterator famIter; |
| 420 | FMFontFamily family; |
| 421 | Str255 famNameStr; |
| 422 | FMFontFamilyInstanceIterator instIter; |
| 423 | FMFontStyle style; |
| 424 | FMFontSize size; |
| 425 | FMFont font; |
| 426 | FSSpec* pathSpec; |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 427 | |
| 428 | |
Werner Lemberg | dcbb708 | 2007-02-08 08:54:09 +0000 | [diff] [blame] | 429 | FMCreateFontFamilyIterator( NULL, NULL, kFMUseGlobalScopeOption, |
| 430 | &famIter ); |
| 431 | FMGetNextFontFamily( &famIter, &family ); |
| 432 | FMGetFontFamilyName( family, famNameStr ); |
| 433 | FMCreateFontFamilyInstanceIterator( family, &instIter ); |
| 434 | FMGetNextFontFamilyInstance( &instIter, &font, &style, &size ); |
| 435 | FMDisposeFontFamilyInstanceIterator( &instIter ); |
| 436 | FMDisposeFontFamilyIterator( &famIter ); |
| 437 | FMGetFontContainer( font, pathSpec ); |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 438 | |
Werner Lemberg | 6be99f9 | 2006-02-09 07:38:57 +0000 | [diff] [blame] | 439 | ], |
| 440 | [AC_MSG_RESULT([ok]) |
| 441 | CFLAGS="$CFLAGS -DHAVE_QUICKDRAW_CARBON=1"], |
| 442 | [AC_MSG_RESULT([not found]) |
| 443 | CFLAGS="$CFLAGS -DHAVE_QUICKDRAW_CARBON=0"]) |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 444 | fi |
| 445 | |
| 446 | |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 447 | # Whether to use AppleTypeService since Mac OS X. |
| 448 | |
Werner Lemberg | fd7456c | 2006-04-03 15:46:48 +0000 | [diff] [blame] | 449 | # don't quote AS_HELP_STRING! |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 450 | AC_ARG_WITH([ats], |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 451 | AS_HELP_STRING([--with-ats], |
| 452 | [use AppleTypeService, if available (default=yes)])) |
| 453 | if test x$with_ats = xno; then |
| 454 | CFLAGS="$CFLAGS -DHAVE_ATS=0" |
Suzuki, Toshiya (鈴木俊哉) | 7e3d601 | 2006-12-15 15:23:21 +0000 | [diff] [blame] | 455 | 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] | 456 | AC_MSG_CHECKING([AppleTypeService functions]) |
| 457 | AC_TRY_LINK([ |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 458 | |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 459 | #include <Carbon/Carbon.h> |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 460 | |
Werner Lemberg | 6be99f9 | 2006-02-09 07:38:57 +0000 | [diff] [blame] | 461 | ], |
| 462 | [ |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 463 | |
Werner Lemberg | dcbb708 | 2007-02-08 08:54:09 +0000 | [diff] [blame] | 464 | FSSpec* pathSpec; |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 465 | |
| 466 | |
Werner Lemberg | dcbb708 | 2007-02-08 08:54:09 +0000 | [diff] [blame] | 467 | ATSFontFindFromName( NULL, kATSOptionFlagsUnRestrictedScope ); |
| 468 | ATSFontGetFileSpecification( 0, pathSpec ); |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 469 | |
Werner Lemberg | 6be99f9 | 2006-02-09 07:38:57 +0000 | [diff] [blame] | 470 | ], |
| 471 | [AC_MSG_RESULT([ok]) |
| 472 | CFLAGS="$CFLAGS -DHAVE_ATS=1"], |
| 473 | [AC_MSG_RESULT([not found]) |
| 474 | CFLAGS="$CFLAGS -DHAVE_ATS=0"]) |
Werner Lemberg | 435046b | 2006-01-11 10:57:42 +0000 | [diff] [blame] | 475 | fi |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 476 | |
Suzuki, Toshiya (鈴木俊哉) | 7e3d601 | 2006-12-15 15:23:21 +0000 | [diff] [blame] | 477 | case "$CFLAGS" in |
| 478 | *HAVE_FSSPEC* | *HAVE_FSREF* | *HAVE_QUICKDRAW* | *HAVE_ATS* ) |
| 479 | AC_MSG_WARN([ |
| 480 | *** WARNING |
Werner Lemberg | 0fd08bd | 2006-12-16 02:57:46 +0000 | [diff] [blame] | 481 | FSSpec/FSRef/QuickDraw/ATS options are explicitly given, |
| 482 | thus using legacy builds/mac/ftmac.c instead of src/base/ftmac.c. |
Suzuki, Toshiya (鈴木俊哉) | 7e3d601 | 2006-12-15 15:23:21 +0000 | [diff] [blame] | 483 | ]) |
| 484 | CFLAGS="$CFLAGS "'-I$(TOP_DIR)/builds/mac/' |
| 485 | ;; |
| 486 | *) |
| 487 | ;; |
| 488 | esac |
| 489 | |
Suzuki, Toshiya (鈴木俊哉) | f8d16cc | 2006-01-11 09:28:38 +0000 | [diff] [blame] | 490 | |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 491 | AC_SUBST([LIBZ]) |
| 492 | AC_SUBST([CFLAGS]) |
| 493 | AC_SUBST([LDFLAGS]) |
Suzuki, Toshiya (鈴木俊哉) | 9d49961 | 2006-10-12 01:35:54 +0000 | [diff] [blame] | 494 | AC_SUBST([FT2_EXTRA_LIBS]) |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 495 | AC_SUBST([SYSTEM_ZLIB]) |
| 496 | |
David Turner | 621e488 | 2002-12-16 21:51:24 +0000 | [diff] [blame] | 497 | |
Werner Lemberg | c0c2abe | 2001-06-07 17:36:17 +0000 | [diff] [blame] | 498 | AC_PROG_LIBTOOL |
Werner Lemberg | 53a1edd | 2004-02-08 22:45:48 +0000 | [diff] [blame] | 499 | # urgh -- these are internal libtool variables... |
| 500 | AC_SUBST([enable_shared]) |
| 501 | AC_SUBST([hardcode_libdir_flag_spec]) |
| 502 | AC_SUBST([wl]) |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 503 | |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 504 | |
| 505 | # configuration file -- stay in 8.3 limit |
| 506 | # |
| 507 | # since #undef doesn't survive in configuration header files we replace |
| 508 | # `/undef' with `#undef' after creating the output file |
| 509 | |
| 510 | AC_CONFIG_HEADERS([ftconfig.h:ftconfig.in], |
| 511 | [mv ftconfig.h ftconfig.tmp |
| 512 | sed 's|/undef|#undef|' < ftconfig.tmp > ftconfig.h |
| 513 | rm ftconfig.tmp]) |
| 514 | |
| 515 | # create the Unix-specific sub-Makefiles `builds/unix/unix-def.mk' |
Werner Lemberg | dcbb708 | 2007-02-08 08:54:09 +0000 | [diff] [blame] | 516 | # and `builds/unix/unix-cc.mk' that will be used by the build system |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 517 | # |
Werner Lemberg | 3a317c6 | 2003-04-28 09:43:32 +0000 | [diff] [blame] | 518 | AC_CONFIG_FILES([unix-cc.mk:unix-cc.in |
| 519 | unix-def.mk:unix-def.in |
| 520 | freetype-config |
| 521 | freetype2.pc:freetype2.in]) |
David Turner | ce9a044 | 2002-01-08 18:33:55 +0000 | [diff] [blame] | 522 | |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 523 | # re-generate the Jamfile to use libtool now |
| 524 | # |
| 525 | # AC_CONFIG_FILES([../../Jamfile:../../Jamfile.in]) |
David Turner | ce9a044 | 2002-01-08 18:33:55 +0000 | [diff] [blame] | 526 | |
Werner Lemberg | b3f3210 | 2001-06-08 12:19:22 +0000 | [diff] [blame] | 527 | AC_OUTPUT |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 528 | |
Werner Lemberg | dcbb708 | 2007-02-08 08:54:09 +0000 | [diff] [blame] | 529 | # end of configure.raw |