blob: e7a4026a4a1aa383dcc70a204894940db74cfcf0 [file] [log] [blame]
Werner Lemberge42dbce2003-11-09 08:37:14 +00001# This file is part of the FreeType project.
2#
3# Process this file with autoconf to produce a configure script.
Werner Lemberg60a04df2005-06-04 23:04:30 +00004#
Werner Lemberg17432b52007-01-12 09:28:44 +00005# Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007 by
Werner Lemberg60a04df2005-06-04 23:04:30 +00006# 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 Turner74043012000-07-08 00:22:20 +000013
Werner Lemberg4df5b262006-05-08 07:10:29 +000014AC_INIT([FreeType], [@VERSION@], [freetype@nongnu.org], [freetype])
Werner Lembergb3f32102001-06-08 12:19:22 +000015AC_CONFIG_SRCDIR([ftconfig.in])
David Turner74043012000-07-08 00:22:20 +000016
David Turner74043012000-07-08 00:22:20 +000017
Werner Lemberge42dbce2003-11-09 08:37:14 +000018# Don't forget to update docs/VERSION.DLL!
19
Werner Lemberg3b0e5002007-07-03 04:48:19 +000020version_info='9:16:3'
Werner Lemberge42dbce2003-11-09 08:37:14 +000021AC_SUBST([version_info])
Werner Lemberg3de5b072001-03-20 07:52:52 +000022ft_version=`echo $version_info | tr : .`
Werner Lemberge42dbce2003-11-09 08:37:14 +000023AC_SUBST([ft_version])
David Turner74043012000-07-08 00:22:20 +000024
David Turner74043012000-07-08 00:22:20 +000025
Werner Lemberge42dbce2003-11-09 08:37:14 +000026# checks for system type
27
Suzuki, Toshiya (鈴木俊哉)bfe872d2006-10-14 13:08:05 +000028AC_CANONICAL_BUILD
29AC_CANONICAL_HOST
Werner Lemberge42dbce2003-11-09 08:37:14 +000030AC_CANONICAL_TARGET
31
32
33# checks for programs
34
David Turner74043012000-07-08 00:22:20 +000035AC_PROG_CC
36AC_PROG_CPP
Suzuki, Toshiya (鈴木俊哉)bfe872d2006-10-14 13:08:05 +000037AC_SUBST(EXEEXT)
38
39
40# checks for native programs to generate building tool
41
42if 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)
61else
62 CC_BUILD=${CC}
63 EXEEXT_BUILD=${EXEEXT}
64fi
65
66
67if test ! -z ${EXEEXT_BUILD}; then
68 EXEEXT_BUILD=."${EXEEXT_BUILD}"
69fi
70AC_SUBST(CC_BUILD)
71AC_SUBST(EXEEXT_BUILD)
72
David Turner74043012000-07-08 00:22:20 +000073
Werner Lemberge42dbce2003-11-09 08:37:14 +000074
75# get compiler flags right
76
David Turner74043012000-07-08 00:22:20 +000077if test "x$CC" = xgcc; then
Werner Lemberg92aa5272005-05-23 21:33:02 +000078 XX_CFLAGS="-Wall"
David Turner74043012000-07-08 00:22:20 +000079 XX_ANSIFLAGS="-pedantic -ansi"
80else
81 case "$host" in
Werner Lemberge42dbce2003-11-09 08:37:14 +000082 *-dec-osf*)
83 CFLAGS=
84 XX_CFLAGS="-std1 -g3"
85 XX_ANSIFLAGS=
86 ;;
87 *)
88 XX_CFLAGS=
89 XX_ANSIFLAGS=
90 ;;
David Turner74043012000-07-08 00:22:20 +000091 esac
92fi
Werner Lemberge42dbce2003-11-09 08:37:14 +000093AC_SUBST([XX_CFLAGS])
94AC_SUBST([XX_ANSIFLAGS])
David Turner74043012000-07-08 00:22:20 +000095
Werner Lembergfd9777e2000-07-31 10:56:42 +000096
Werner Lemberge42dbce2003-11-09 08:37:14 +000097# auxiliary programs
98
99AC_CHECK_PROG([RMF], [rm], [rm -f])
100AC_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 Turner74043012000-07-08 00:22:20 +0000107AC_PROG_INSTALL
Werner Lembergfd9777e2000-07-31 10:56:42 +0000108case "$INSTALL" in
Werner Lemberge42dbce2003-11-09 08:37:14 +0000109/*)
110 ;;
111*/*)
112 INSTALL="`pwd`/$INSTALL" ;;
Werner Lembergfd9777e2000-07-31 10:56:42 +0000113esac
David Turner74043012000-07-08 00:22:20 +0000114
Werner Lemberge42dbce2003-11-09 08:37:14 +0000115
116# checks for header files
117
Werner Lembergd060a752000-07-20 06:57:41 +0000118AC_HEADER_STDC
Werner Lemberge42dbce2003-11-09 08:37:14 +0000119AC_CHECK_HEADERS([fcntl.h unistd.h])
David Turner74043012000-07-08 00:22:20 +0000120
Werner Lemberge42dbce2003-11-09 08:37:14 +0000121
122# checks for typedefs, structures, and compiler characteristics
123
David Turner74043012000-07-08 00:22:20 +0000124AC_C_CONST
Werner Lemberge42dbce2003-11-09 08:37:14 +0000125AC_CHECK_SIZEOF([int])
126AC_CHECK_SIZEOF([long])
David Turner74043012000-07-08 00:22:20 +0000127
David Turner74043012000-07-08 00:22:20 +0000128
Werner Lemberge42dbce2003-11-09 08:37:14 +0000129# checks for library functions
130
131# Here we check whether we can use our mmap file component.
132
David Turner74043012000-07-08 00:22:20 +0000133AC_FUNC_MMAP
134if test "$ac_cv_func_mmap_fixed_mapped" != yes; then
Werner Lemberg858f3102003-06-09 04:46:30 +0000135 FTSYS_SRC='$(BASE_DIR)/ftsystem.c'
David Turner74043012000-07-08 00:22:20 +0000136else
Werner Lemberg858f3102003-06-09 04:46:30 +0000137 FTSYS_SRC='$(BUILD_DIR)/ftsystem.c'
Werner Lembergb1dd3532000-07-31 22:51:00 +0000138
Werner Lemberge42dbce2003-11-09 08:37:14 +0000139 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 Lembergb1dd3532000-07-31 22:51:00 +0000151 FT_MUNMAP_PARAM
David Turner74043012000-07-08 00:22:20 +0000152fi
Werner Lemberge42dbce2003-11-09 08:37:14 +0000153AC_SUBST([FTSYS_SRC])
David Turner74043012000-07-08 00:22:20 +0000154
Werner Lemberge42dbce2003-11-09 08:37:14 +0000155AC_CHECK_FUNCS([memcpy memmove])
David Turner74043012000-07-08 00:22:20 +0000156
Werner Lemberge42dbce2003-11-09 08:37:14 +0000157
158# Check for system zlib
159
Werner Lembergfd7456c2006-04-03 15:46:48 +0000160# don't quote AS_HELP_STRING!
Werner Lemberge42dbce2003-11-09 08:37:14 +0000161AC_ARG_WITH([zlib],
Werner Lemberge42dbce2003-11-09 08:37:14 +0000162 AS_HELP_STRING([--without-zlib],
163 [use internal zlib instead of system-wide]))
David Turner621e4882002-12-16 21:51:24 +0000164if test x$with_zlib != xno && test -z "$LIBZ"; then
Werner Lemberge42dbce2003-11-09 08:37:14 +0000165 AC_CHECK_LIB([z], [gzsetparams], [AC_CHECK_HEADER([zlib.h], [LIBZ='-lz'])])
David Turner621e4882002-12-16 21:51:24 +0000166fi
167if test x$with_zlib != xno && test -n "$LIBZ"; then
168 CFLAGS="$CFLAGS -DFT_CONFIG_OPTION_SYSTEM_ZLIB"
David Turner19b6b992002-12-23 22:40:21 +0000169 LDFLAGS="$LDFLAGS $LIBZ"
David Turner621e4882002-12-16 21:51:24 +0000170 SYSTEM_ZLIB=yes
171fi
Werner Lemberg6eb116e2003-05-11 07:12:26 +0000172
Werner Lemberge42dbce2003-11-09 08:37:14 +0000173
Werner Lemberg435046b2006-01-11 10:57:42 +0000174# Whether to use Mac OS resource-based fonts.
Werner Lemberge42dbce2003-11-09 08:37:14 +0000175
Werner Lembergfd7456c2006-04-03 15:46:48 +0000176# don't quote AS_HELP_STRING!
Werner Lemberge42dbce2003-11-09 08:37:14 +0000177AC_ARG_WITH([old-mac-fonts],
Werner Lemberge42dbce2003-11-09 08:37:14 +0000178 AS_HELP_STRING([--with-old-mac-fonts],
179 [allow Mac resource-based fonts to be used]))
Werner Lemberg6eb116e2003-05-11 07:12:26 +0000180if test x$with_old_mac_fonts = xyes; then
Suzuki, Toshiya (鈴木俊哉)458c3422006-02-08 12:58:24 +0000181 orig_LDFLAGS="${LDFLAGS}"
182 AC_MSG_CHECKING([CoreServices & ApplicationServices of Mac OS X])
Suzuki, Toshiya (鈴木俊哉)9d499612006-10-12 01:35:54 +0000183 FT2_EXTRA_LIBS="-Wl,-framework,CoreServices,-framework,ApplicationServices"
184 LDFLAGS="$LDFLAGS $FT2_EXTRA_LIBS"
Suzuki, Toshiya (鈴木俊哉)7e3d6012006-12-15 15:23:21 +0000185 AC_TRY_LINK([
Werner Lembergdcbb7082007-02-08 08:54:09 +0000186
Suzuki, Toshiya (鈴木俊哉)7e3d6012006-12-15 15:23:21 +0000187#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 Lembergdcbb7082007-02-08 08:54:09 +0000194
Suzuki, Toshiya (鈴木俊哉)7e3d6012006-12-15 15:23:21 +0000195 ],
196 [
197
198 short res = 0;
199
200
201 UseResFile( res );
202
203 ],
Suzuki, Toshiya (鈴木俊哉)027357f2007-02-05 02:50:45 +0000204 [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 Lembergdcbb7082007-02-08 08:54:09 +0000209
Suzuki, Toshiya (鈴木俊哉)027357f2007-02-05 02:50:45 +0000210#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 Lembergdcbb7082007-02-08 08:54:09 +0000217
Suzuki, Toshiya (鈴木俊哉)027357f2007-02-05 02:50:45 +0000218 ],
219 [
Werner Lembergdcbb7082007-02-08 08:54:09 +0000220
Suzuki, Toshiya (鈴木俊哉)6fb74f62007-03-19 06:30:26 +0000221 /* OSHostByteOrder() is typed as OS_INLINE */
Werner Lembergdcbb7082007-02-08 08:54:09 +0000222 int32_t os_byte_order = OSHostByteOrder();
223
224
Suzuki, Toshiya (鈴木俊哉)027357f2007-02-05 02:50:45 +0000225 if ( OSBigEndian != os_byte_order )
226 return 1;
Werner Lembergdcbb7082007-02-08 08:54:09 +0000227
Suzuki, Toshiya (鈴木俊哉)027357f2007-02-05 02:50:45 +0000228 ],
Werner Lembergdcbb7082007-02-08 08:54:09 +0000229 [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 (鈴木俊哉)027357f2007-02-05 02:50:45 +0000235 ])
236 ],
Werner Lemberg6be99f92006-02-09 07:38:57 +0000237 [AC_MSG_RESULT([not found])
238 LDFLAGS="${orig_LDFLAGS}"
239 CFLAGS="$CFLAGS -DDARWIN_NO_CARBON"])
Suzuki, Toshiya (鈴木俊哉)8cfa8bd2006-05-19 22:11:50 +0000240else
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 Lemberg6eb116e2003-05-11 07:12:26 +0000248fi
249
Werner Lemberge42dbce2003-11-09 08:37:14 +0000250
Werner Lemberg435046b2006-01-11 10:57:42 +0000251# Whether to use FileManager which is deprecated since Mac OS X 10.4.
Suzuki, Toshiya (鈴木俊哉)f8d16cc2006-01-11 09:28:38 +0000252
253AC_ARG_WITH([fsspec],
254 AS_HELP_STRING([--with-fsspec],
255 [use obsolete FSSpec API of MacOS, if available (default=yes)]))
256if test x$with_fsspec = xno; then
257 CFLAGS="$CFLAGS -DHAVE_FSSPEC=0"
Suzuki, Toshiya (鈴木俊哉)7e3d6012006-12-15 15:23:21 +0000258elif test x$with_old_mac_fonts = xyes -a x$with_fsspec != x; then
Suzuki, Toshiya (鈴木俊哉)f8d16cc2006-01-11 09:28:38 +0000259 AC_MSG_CHECKING([FSSpec-based FileManager])
260 AC_TRY_LINK([
Werner Lemberg435046b2006-01-11 10:57:42 +0000261
Suzuki, Toshiya (鈴木俊哉)f8d16cc2006-01-11 09:28:38 +0000262#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 Lemberg435046b2006-01-11 10:57:42 +0000269
Werner Lemberg6be99f92006-02-09 07:38:57 +0000270 ],
271 [
Werner Lemberg435046b2006-01-11 10:57:42 +0000272
Werner Lembergdcbb7082007-02-08 08:54:09 +0000273 FCBPBPtr paramBlock;
274 short vRefNum;
275 long dirID;
276 ConstStr255Param fileName;
277 FSSpec* spec;
Werner Lemberg435046b2006-01-11 10:57:42 +0000278
Suzuki, Toshiya (鈴木俊哉)f8d16cc2006-01-11 09:28:38 +0000279
Werner Lembergdcbb7082007-02-08 08:54:09 +0000280 /* FSSpec functions: deprecated since Mac OS X 10.4 */
281 PBGetFCBInfoSync( paramBlock );
282 FSMakeFSSpec( vRefNum, dirID, fileName, spec );
Werner Lembergb4142d52007-01-17 12:45:26 +0000283
Werner Lemberg6be99f92006-02-09 07:38:57 +0000284 ],
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 (鈴木俊哉)f8d16cc2006-01-11 09:28:38 +0000289fi
290
Werner Lemberg435046b2006-01-11 10:57:42 +0000291
292# Whether to use FileManager in Carbon since MacOS 9.x.
Suzuki, Toshiya (鈴木俊哉)f8d16cc2006-01-11 09:28:38 +0000293
294AC_ARG_WITH([fsref],
295 AS_HELP_STRING([--with-fsref],
296 [use Carbon FSRef API of MacOS, if available (default=yes)]))
297if 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 Lemberg6be99f92006-02-09 07:38:57 +0000302 ])
Suzuki, Toshiya (鈴木俊哉)f8d16cc2006-01-11 09:28:38 +0000303 CFLAGS="$CFLAGS -DHAVE_FSREF=0"
Suzuki, Toshiya (鈴木俊哉)7e3d6012006-12-15 15:23:21 +0000304elif test x$with_old_mac_fonts = xyes -a x$with_fsref != x; then
Suzuki, Toshiya (鈴木俊哉)f8d16cc2006-01-11 09:28:38 +0000305 AC_MSG_CHECKING([FSRef-based FileManager])
306 AC_TRY_LINK([
Werner Lemberg435046b2006-01-11 10:57:42 +0000307
Suzuki, Toshiya (鈴木俊哉)f8d16cc2006-01-11 09:28:38 +0000308#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 Lemberg435046b2006-01-11 10:57:42 +0000315
Werner Lemberg6be99f92006-02-09 07:38:57 +0000316 ],
317 [
Werner Lemberg435046b2006-01-11 10:57:42 +0000318
Werner Lembergdcbb7082007-02-08 08:54:09 +0000319 FCBPBPtr paramBlock;
320 short vRefNum;
321 long dirID;
322 ConstStr255Param fileName;
323 FSSpec* spec;
Suzuki, Toshiya (鈴木俊哉)f8d16cc2006-01-11 09:28:38 +0000324
Werner Lembergdcbb7082007-02-08 08:54:09 +0000325 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 (鈴木俊哉)f8d16cc2006-01-11 09:28:38 +0000336
337
Werner Lembergdcbb7082007-02-08 08:54:09 +0000338 /* 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 Lembergb4142d52007-01-17 12:45:26 +0000346
Werner Lemberg6be99f92006-02-09 07:38:57 +0000347 ],
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 (鈴木俊哉)f8d16cc2006-01-11 09:28:38 +0000352fi
353
Werner Lemberg435046b2006-01-11 10:57:42 +0000354
Werner Lembergdcbb7082007-02-08 08:54:09 +0000355# Whether to use QuickDraw API in ToolBox which is deprecated since
356# Mac OS X 10.4.
Suzuki, Toshiya (鈴木俊哉)f8d16cc2006-01-11 09:28:38 +0000357
358AC_ARG_WITH([quickdraw-toolbox],
359 AS_HELP_STRING([--with-quickdraw-toolbox],
360 [use MacOS QuickDraw in ToolBox, if available (default=yes)]))
361if test x$with_quickdraw_toolbox = xno; then
362 CFLAGS="$CFLAGS -DHAVE_QUICKDRAW_TOOLBOX=0"
Suzuki, Toshiya (鈴木俊哉)7e3d6012006-12-15 15:23:21 +0000363elif test x$with_old_mac_fonts = xyes -a x$with_quickdraw_toolbox != x; then
Suzuki, Toshiya (鈴木俊哉)f8d16cc2006-01-11 09:28:38 +0000364 AC_MSG_CHECKING([QuickDraw FontManager functions in ToolBox])
365 AC_TRY_LINK([
Werner Lemberg435046b2006-01-11 10:57:42 +0000366
Suzuki, Toshiya (鈴木俊哉)f8d16cc2006-01-11 09:28:38 +0000367#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 Lemberg435046b2006-01-11 10:57:42 +0000374
Werner Lemberg6be99f92006-02-09 07:38:57 +0000375 ],
376 [
Werner Lemberg435046b2006-01-11 10:57:42 +0000377
Werner Lembergdcbb7082007-02-08 08:54:09 +0000378 Str255 familyName;
379 SInt16 familyID = 0;
380 FMInput* fmIn = NULL;
381 FMOutput* fmOut = NULL;
Suzuki, Toshiya (鈴木俊哉)f8d16cc2006-01-11 09:28:38 +0000382
383
Werner Lembergdcbb7082007-02-08 08:54:09 +0000384 GetFontName( familyID, familyName );
385 GetFNum( familyName, &familyID );
386 fmOut = FMSwapFont( fmIn );
Suzuki, Toshiya (鈴木俊哉)f8d16cc2006-01-11 09:28:38 +0000387
Werner Lemberg6be99f92006-02-09 07:38:57 +0000388 ],
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 (鈴木俊哉)f8d16cc2006-01-11 09:28:38 +0000393fi
394
395
Werner Lembergdcbb7082007-02-08 08:54:09 +0000396# Whether to use QuickDraw API in Carbon which is deprecated since
397# Mac OS X 10.4.
Suzuki, Toshiya (鈴木俊哉)f8d16cc2006-01-11 09:28:38 +0000398
399AC_ARG_WITH([quickdraw-carbon],
400 AS_HELP_STRING([--with-quickdraw-carbon],
401 [use MacOS QuickDraw in Carbon, if available (default=yes)]))
402if test x$with_quickdraw_carbon = xno; then
403 CFLAGS="$CFLAGS -DHAVE_QUICKDRAW_CARBON=0"
Suzuki, Toshiya (鈴木俊哉)7e3d6012006-12-15 15:23:21 +0000404elif test x$with_old_mac_fonts = xyes -a x$with_quickdraw_carbon != x; then
Suzuki, Toshiya (鈴木俊哉)f8d16cc2006-01-11 09:28:38 +0000405 AC_MSG_CHECKING([QuickDraw FontManager functions in Carbon])
406 AC_TRY_LINK([
Werner Lemberg435046b2006-01-11 10:57:42 +0000407
Suzuki, Toshiya (鈴木俊哉)f8d16cc2006-01-11 09:28:38 +0000408#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 Lemberg435046b2006-01-11 10:57:42 +0000415
Werner Lemberg6be99f92006-02-09 07:38:57 +0000416 ],
417 [
Werner Lemberg435046b2006-01-11 10:57:42 +0000418
Werner Lembergdcbb7082007-02-08 08:54:09 +0000419 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 (鈴木俊哉)f8d16cc2006-01-11 09:28:38 +0000427
428
Werner Lembergdcbb7082007-02-08 08:54:09 +0000429 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 Lemberg435046b2006-01-11 10:57:42 +0000438
Werner Lemberg6be99f92006-02-09 07:38:57 +0000439 ],
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 (鈴木俊哉)f8d16cc2006-01-11 09:28:38 +0000444fi
445
446
Werner Lemberg435046b2006-01-11 10:57:42 +0000447# Whether to use AppleTypeService since Mac OS X.
448
Werner Lembergfd7456c2006-04-03 15:46:48 +0000449# don't quote AS_HELP_STRING!
Suzuki, Toshiya (鈴木俊哉)f8d16cc2006-01-11 09:28:38 +0000450AC_ARG_WITH([ats],
Suzuki, Toshiya (鈴木俊哉)f8d16cc2006-01-11 09:28:38 +0000451 AS_HELP_STRING([--with-ats],
452 [use AppleTypeService, if available (default=yes)]))
453if test x$with_ats = xno; then
454 CFLAGS="$CFLAGS -DHAVE_ATS=0"
Suzuki, Toshiya (鈴木俊哉)7e3d6012006-12-15 15:23:21 +0000455elif test x$with_old_mac_fonts = xyes -a x$with_ats != x ; then
Suzuki, Toshiya (鈴木俊哉)f8d16cc2006-01-11 09:28:38 +0000456 AC_MSG_CHECKING([AppleTypeService functions])
457 AC_TRY_LINK([
Werner Lemberg435046b2006-01-11 10:57:42 +0000458
Suzuki, Toshiya (鈴木俊哉)f8d16cc2006-01-11 09:28:38 +0000459#include <Carbon/Carbon.h>
Werner Lemberg435046b2006-01-11 10:57:42 +0000460
Werner Lemberg6be99f92006-02-09 07:38:57 +0000461 ],
462 [
Werner Lemberg435046b2006-01-11 10:57:42 +0000463
Werner Lembergdcbb7082007-02-08 08:54:09 +0000464 FSSpec* pathSpec;
Suzuki, Toshiya (鈴木俊哉)f8d16cc2006-01-11 09:28:38 +0000465
466
Werner Lembergdcbb7082007-02-08 08:54:09 +0000467 ATSFontFindFromName( NULL, kATSOptionFlagsUnRestrictedScope );
468 ATSFontGetFileSpecification( 0, pathSpec );
Suzuki, Toshiya (鈴木俊哉)f8d16cc2006-01-11 09:28:38 +0000469
Werner Lemberg6be99f92006-02-09 07:38:57 +0000470 ],
471 [AC_MSG_RESULT([ok])
472 CFLAGS="$CFLAGS -DHAVE_ATS=1"],
473 [AC_MSG_RESULT([not found])
474 CFLAGS="$CFLAGS -DHAVE_ATS=0"])
Werner Lemberg435046b2006-01-11 10:57:42 +0000475fi
Suzuki, Toshiya (鈴木俊哉)f8d16cc2006-01-11 09:28:38 +0000476
Suzuki, Toshiya (鈴木俊哉)7e3d6012006-12-15 15:23:21 +0000477case "$CFLAGS" in
478 *HAVE_FSSPEC* | *HAVE_FSREF* | *HAVE_QUICKDRAW* | *HAVE_ATS* )
479 AC_MSG_WARN([
480*** WARNING
Werner Lemberg0fd08bd2006-12-16 02:57:46 +0000481 FSSpec/FSRef/QuickDraw/ATS options are explicitly given,
482 thus using legacy builds/mac/ftmac.c instead of src/base/ftmac.c.
Suzuki, Toshiya (鈴木俊哉)7e3d6012006-12-15 15:23:21 +0000483 ])
484 CFLAGS="$CFLAGS "'-I$(TOP_DIR)/builds/mac/'
485 ;;
486 *)
487 ;;
488esac
489
Suzuki, Toshiya (鈴木俊哉)f8d16cc2006-01-11 09:28:38 +0000490
Werner Lemberge42dbce2003-11-09 08:37:14 +0000491AC_SUBST([LIBZ])
492AC_SUBST([CFLAGS])
493AC_SUBST([LDFLAGS])
Suzuki, Toshiya (鈴木俊哉)9d499612006-10-12 01:35:54 +0000494AC_SUBST([FT2_EXTRA_LIBS])
Werner Lemberge42dbce2003-11-09 08:37:14 +0000495AC_SUBST([SYSTEM_ZLIB])
496
David Turner621e4882002-12-16 21:51:24 +0000497
Werner Lembergb6617882007-08-04 22:17:48 +0000498AC_LIBTOOL_WIN32_DLL
499
Werner Lembergc0c2abe2001-06-07 17:36:17 +0000500AC_PROG_LIBTOOL
Werner Lemberg53a1edd2004-02-08 22:45:48 +0000501# urgh -- these are internal libtool variables...
502AC_SUBST([enable_shared])
503AC_SUBST([hardcode_libdir_flag_spec])
504AC_SUBST([wl])
David Turner74043012000-07-08 00:22:20 +0000505
Werner Lemberge42dbce2003-11-09 08:37:14 +0000506
507# configuration file -- stay in 8.3 limit
508#
509# since #undef doesn't survive in configuration header files we replace
510# `/undef' with `#undef' after creating the output file
511
512AC_CONFIG_HEADERS([ftconfig.h:ftconfig.in],
513 [mv ftconfig.h ftconfig.tmp
514 sed 's|/undef|#undef|' < ftconfig.tmp > ftconfig.h
515 rm ftconfig.tmp])
516
517# create the Unix-specific sub-Makefiles `builds/unix/unix-def.mk'
Werner Lembergdcbb7082007-02-08 08:54:09 +0000518# and `builds/unix/unix-cc.mk' that will be used by the build system
Werner Lemberge42dbce2003-11-09 08:37:14 +0000519#
Werner Lemberg3a317c62003-04-28 09:43:32 +0000520AC_CONFIG_FILES([unix-cc.mk:unix-cc.in
521 unix-def.mk:unix-def.in
522 freetype-config
523 freetype2.pc:freetype2.in])
David Turnerce9a0442002-01-08 18:33:55 +0000524
Werner Lemberge42dbce2003-11-09 08:37:14 +0000525# re-generate the Jamfile to use libtool now
526#
527# AC_CONFIG_FILES([../../Jamfile:../../Jamfile.in])
David Turnerce9a0442002-01-08 18:33:55 +0000528
Werner Lembergb3f32102001-06-08 12:19:22 +0000529AC_OUTPUT
David Turner74043012000-07-08 00:22:20 +0000530
Werner Lembergdcbb7082007-02-08 08:54:09 +0000531# end of configure.raw