5172
|
1 |
# This file is part of the FreeType project.
|
|
2 |
#
|
|
3 |
# Process this file with autoconf to produce a configure script.
|
|
4 |
#
|
|
5 |
# Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by
|
|
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.
|
|
13 |
|
|
14 |
AC_INIT([FreeType], [@VERSION@], [freetype@nongnu.org], [freetype])
|
|
15 |
AC_CONFIG_SRCDIR([ftconfig.in])
|
|
16 |
|
|
17 |
|
|
18 |
# Don't forget to update docs/VERSION.DLL!
|
|
19 |
|
|
20 |
version_info='12:2:6'
|
|
21 |
AC_SUBST([version_info])
|
|
22 |
ft_version=`echo $version_info | tr : .`
|
|
23 |
AC_SUBST([ft_version])
|
|
24 |
|
|
25 |
|
|
26 |
# checks for system type
|
|
27 |
|
|
28 |
AC_CANONICAL_HOST
|
|
29 |
|
|
30 |
|
|
31 |
# checks for programs
|
|
32 |
|
|
33 |
AC_PROG_CC
|
|
34 |
AC_PROG_CPP
|
|
35 |
AC_SUBST(EXEEXT)
|
|
36 |
|
|
37 |
|
|
38 |
# checks for native programs to generate building tool
|
|
39 |
|
|
40 |
if test ${cross_compiling} = yes; then
|
|
41 |
AC_CHECK_PROG(CC_BUILD, ${build}-gcc, ${build}-gcc)
|
|
42 |
test -z "${CC_BUILD}" && AC_CHECK_PROG(CC_BUILD, gcc, gcc)
|
|
43 |
test -z "${CC_BUILD}" && AC_CHECK_PROG(CC_BUILD, cc, cc, , , /usr/ucb/cc)
|
|
44 |
test -z "${CC_BUILD}" && AC_MSG_ERROR([cannot find native C compiler])
|
|
45 |
|
|
46 |
AC_MSG_CHECKING([for suffix of native executables])
|
|
47 |
rm -f a.* b.* a_out.exe conftest.*
|
|
48 |
echo > conftest.c "int main() { return 0;}"
|
|
49 |
${CC_BUILD} conftest.c || AC_MSG_ERROR([native C compiler is not working])
|
|
50 |
rm -f conftest.c
|
|
51 |
if test -x a.out -o -x b.out -o -x conftest; then
|
|
52 |
EXEEXT_BUILD=""
|
|
53 |
elif test -x a_out.exe -o -x conftest.exe; then
|
|
54 |
EXEEXT_BUILD=".exe"
|
|
55 |
elif test -x conftest.* ; then
|
|
56 |
EXEEXT_BUILD=`echo conftest.* | sed -n '1s/^.*\././'`
|
|
57 |
fi
|
|
58 |
rm -f a.* b.* a_out.exe conftest.*
|
|
59 |
AC_MSG_RESULT($EXEEXT_BUILD)
|
|
60 |
else
|
|
61 |
CC_BUILD=${CC}
|
|
62 |
EXEEXT_BUILD=${EXEEXT}
|
|
63 |
fi
|
|
64 |
|
|
65 |
AC_SUBST(CC_BUILD)
|
|
66 |
AC_SUBST(EXEEXT_BUILD)
|
|
67 |
|
|
68 |
|
|
69 |
|
|
70 |
# get compiler flags right
|
|
71 |
|
|
72 |
if test "x$GCC" = xyes; then
|
|
73 |
XX_CFLAGS="-Wall"
|
|
74 |
XX_ANSIFLAGS="-pedantic -ansi"
|
|
75 |
else
|
|
76 |
case "$host" in
|
|
77 |
*-dec-osf*)
|
|
78 |
CFLAGS=
|
|
79 |
XX_CFLAGS="-std1 -g3"
|
|
80 |
XX_ANSIFLAGS=
|
|
81 |
;;
|
|
82 |
*)
|
|
83 |
XX_CFLAGS=
|
|
84 |
XX_ANSIFLAGS=
|
|
85 |
;;
|
|
86 |
esac
|
|
87 |
fi
|
|
88 |
AC_SUBST([XX_CFLAGS])
|
|
89 |
AC_SUBST([XX_ANSIFLAGS])
|
|
90 |
|
|
91 |
|
|
92 |
# auxiliary programs
|
|
93 |
|
|
94 |
AC_CHECK_PROG([RMF], [rm], [rm -f])
|
|
95 |
AC_CHECK_PROG([RMDIR], [rmdir], [rmdir])
|
|
96 |
|
|
97 |
|
|
98 |
# Since this file will be finally moved to another directory we make
|
|
99 |
# the path of the install script absolute. This small code snippet has
|
|
100 |
# been taken from automake's `ylwrap' script.
|
|
101 |
|
|
102 |
AC_PROG_INSTALL
|
|
103 |
case "$INSTALL" in
|
|
104 |
/*)
|
|
105 |
;;
|
|
106 |
*/*)
|
|
107 |
INSTALL="`pwd`/$INSTALL" ;;
|
|
108 |
esac
|
|
109 |
|
|
110 |
|
|
111 |
# checks for header files
|
|
112 |
|
|
113 |
AC_HEADER_STDC
|
|
114 |
AC_CHECK_HEADERS([fcntl.h unistd.h])
|
|
115 |
|
|
116 |
|
|
117 |
# checks for typedefs, structures, and compiler characteristics
|
|
118 |
|
|
119 |
AC_C_CONST
|
|
120 |
AC_CHECK_SIZEOF([int])
|
|
121 |
AC_CHECK_SIZEOF([long])
|
|
122 |
|
|
123 |
|
|
124 |
# check whether cpp computation of size of int and long in ftconfig.in works
|
|
125 |
|
|
126 |
AC_MSG_CHECKING([cpp computation of bit length in ftconfig.in works])
|
|
127 |
orig_CPPFLAGS="${CPPFLAGS}"
|
|
128 |
CPPFLAGS="-I${srcdir} -I. ${CPPFLAGS}"
|
|
129 |
ac_clean_files="ft2build.h ftoption.h ftstdlib.h"
|
|
130 |
touch ft2build.h ftoption.h ftstdlib.h
|
|
131 |
|
|
132 |
cat > conftest.c <<\_ACEOF
|
|
133 |
#include <limits.h>
|
|
134 |
#define FT_CONFIG_OPTIONS_H "ftoption.h"
|
|
135 |
#define FT_CONFIG_STANDARD_LIBRARY_H "ftstdlib.h"
|
|
136 |
#define FT_UINT_MAX UINT_MAX
|
|
137 |
#define FT_ULONG_MAX ULONG_MAX
|
|
138 |
#include "ftconfig.in"
|
|
139 |
_ACEOF
|
|
140 |
echo >> conftest.c "#if FT_SIZEOF_INT == "${ac_cv_sizeof_int}
|
|
141 |
echo >> conftest.c "ac_cpp_ft_sizeof_int="${ac_cv_sizeof_int}
|
|
142 |
echo >> conftest.c "#endif"
|
|
143 |
echo >> conftest.c "#if FT_SIZEOF_LONG == "${ac_cv_sizeof_long}
|
|
144 |
echo >> conftest.c "ac_cpp_ft_sizeof_long="${ac_cv_sizeof_long}
|
|
145 |
echo >> conftest.c "#endif"
|
|
146 |
|
|
147 |
${CPP} ${CPPFLAGS} conftest.c | ${GREP} ac_cpp_ft > conftest.sh
|
|
148 |
eval `cat conftest.sh`
|
|
149 |
${RMF} conftest.c conftest.sh confft2build.h ftoption.h ftstdlib.h
|
|
150 |
|
|
151 |
if test x != "x${ac_cpp_ft_sizeof_int}" \
|
|
152 |
-a x != x"${ac_cpp_ft_sizeof_long}"; then
|
|
153 |
unset ft_use_autoconf_sizeof_types
|
|
154 |
else
|
|
155 |
ft_use_autoconf_sizeof_types=yes
|
|
156 |
fi
|
|
157 |
|
|
158 |
AC_ARG_ENABLE(biarch-config,
|
|
159 |
[ --enable-biarch-config install biarch ftconfig.h to support multiple
|
|
160 |
architectures by single file], [], [])
|
|
161 |
|
|
162 |
case :${ft_use_autoconf_sizeof_types}:${enable_biarch_config}: in
|
|
163 |
:yes:yes:)
|
|
164 |
AC_MSG_RESULT([broken but use it])
|
|
165 |
unset ft_use_autoconf_sizeof_types
|
|
166 |
;;
|
|
167 |
::no:)
|
|
168 |
AC_MSG_RESULT([works but ignore it])
|
|
169 |
ft_use_autoconf_sizeof_types=yes
|
|
170 |
;;
|
|
171 |
::yes: | :::)
|
|
172 |
AC_MSG_RESULT([yes])
|
|
173 |
unset ft_use_autoconf_sizeof_types
|
|
174 |
;;
|
|
175 |
*)
|
|
176 |
AC_MSG_RESULT([no])
|
|
177 |
ft_use_autoconf_sizeof_types=yes
|
|
178 |
;;
|
|
179 |
esac
|
|
180 |
|
|
181 |
if test x"${ft_use_autoconf_sizeof_types}" = xyes; then
|
|
182 |
AC_DEFINE([FT_USE_AUTOCONF_SIZEOF_TYPES])
|
|
183 |
fi
|
|
184 |
|
|
185 |
CPPFLAGS="${orig_CPPFLAGS}"
|
|
186 |
|
|
187 |
|
|
188 |
# checks for library functions
|
|
189 |
|
|
190 |
# Here we check whether we can use our mmap file component.
|
|
191 |
|
|
192 |
AC_FUNC_MMAP
|
|
193 |
if test "$ac_cv_func_mmap_fixed_mapped" != yes; then
|
|
194 |
FTSYS_SRC='$(BASE_DIR)/ftsystem.c'
|
|
195 |
else
|
|
196 |
FTSYS_SRC='$(BUILD_DIR)/ftsystem.c'
|
|
197 |
|
|
198 |
AC_CHECK_DECLS([munmap],
|
|
199 |
[],
|
|
200 |
[],
|
|
201 |
[
|
|
202 |
|
|
203 |
#ifdef HAVE_UNISTD_H
|
|
204 |
#include <unistd.h>
|
|
205 |
#endif
|
|
206 |
#include <sys/mman.h>
|
|
207 |
|
|
208 |
])
|
|
209 |
|
|
210 |
FT_MUNMAP_PARAM
|
|
211 |
fi
|
|
212 |
AC_SUBST([FTSYS_SRC])
|
|
213 |
|
|
214 |
AC_CHECK_FUNCS([memcpy memmove])
|
|
215 |
|
|
216 |
|
|
217 |
# check for system zlib
|
|
218 |
|
|
219 |
# don't quote AS_HELP_STRING!
|
|
220 |
AC_ARG_WITH([zlib],
|
|
221 |
AS_HELP_STRING([--without-zlib],
|
|
222 |
[use internal zlib instead of system-wide]))
|
|
223 |
if test x$with_zlib != xno && test -z "$LIBZ"; then
|
|
224 |
AC_CHECK_LIB([z], [gzsetparams], [AC_CHECK_HEADER([zlib.h], [LIBZ='-lz'])])
|
|
225 |
fi
|
|
226 |
if test x$with_zlib != xno && test -n "$LIBZ"; then
|
|
227 |
CFLAGS="$CFLAGS -DFT_CONFIG_OPTION_SYSTEM_ZLIB"
|
|
228 |
LDFLAGS="$LDFLAGS $LIBZ"
|
|
229 |
SYSTEM_ZLIB=yes
|
|
230 |
fi
|
|
231 |
|
|
232 |
# check for system libbz2
|
|
233 |
|
|
234 |
# don't quote AS_HELP_STRING!
|
|
235 |
AC_ARG_WITH([bzip2],
|
|
236 |
AS_HELP_STRING([--without-bzip2],
|
|
237 |
[do not support bzip2 compressed fonts]))
|
|
238 |
if test x$with_bzip2 != xno && test -z "$LIBBZ2"; then
|
|
239 |
AC_CHECK_LIB([bz2], [BZ2_bzDecompress], [AC_CHECK_HEADER([bzlib.h], [LIBBZ2='-lbz2'])])
|
|
240 |
fi
|
|
241 |
if test x$with_bzip2 != xno && test -n "$LIBBZ2"; then
|
|
242 |
CFLAGS="$CFLAGS -DFT_CONFIG_OPTION_USE_BZIP2"
|
|
243 |
LDFLAGS="$LDFLAGS $LIBBZ2"
|
|
244 |
fi
|
|
245 |
|
|
246 |
# Some options handling SDKs/archs in CFLAGS should be copied
|
|
247 |
# to LDFLAGS. Apple TechNote 2137 recommends to include these
|
|
248 |
# options in CFLAGS but not in LDFLAGS.
|
|
249 |
|
|
250 |
save_config_args=$*
|
|
251 |
set dummy ${CFLAGS}
|
|
252 |
i=1
|
|
253 |
while test $i -le $#
|
|
254 |
do
|
|
255 |
c=$1
|
|
256 |
|
|
257 |
case "${c}" in
|
|
258 |
-isysroot|-arch) # options taking 1 argument
|
|
259 |
a=$2
|
|
260 |
AC_MSG_CHECKING([whether CFLAGS and LDFLAGS share ${c} ${a}])
|
|
261 |
if expr " ${LDFLAGS} " : ".* ${c} *${a}.*" > /dev/null
|
|
262 |
then
|
|
263 |
AC_MSG_RESULT([yes])
|
|
264 |
else
|
|
265 |
AC_MSG_RESULT([no, copy to LDFLAGS])
|
|
266 |
LDFLAGS="${LDFLAGS} ${c} ${a}"
|
|
267 |
fi
|
|
268 |
shift 1
|
|
269 |
;;
|
|
270 |
-m32|-m64|-march=*|-mcpu=*) # options taking no argument
|
|
271 |
AC_MSG_RESULT([whether CFLAGS and LDFLAGS share ${c}])
|
|
272 |
if expr " ${LDFLAGS} " : ".* ${c} *${a}.*" > /dev/null
|
|
273 |
then
|
|
274 |
AC_MSG_RESULT([yes])
|
|
275 |
else
|
|
276 |
AC_MSG_RESULT([no, copy to LDFLAGS])
|
|
277 |
LDFLAGS="${LDFLAGS} ${c}"
|
|
278 |
fi
|
|
279 |
;;
|
|
280 |
# *)
|
|
281 |
# AC_MSG_RESULT([${c} is not copied to LDFLAGS])
|
|
282 |
# ;;
|
|
283 |
esac
|
|
284 |
|
|
285 |
shift 1
|
|
286 |
done
|
|
287 |
set ${save_config_args}
|
|
288 |
|
|
289 |
|
|
290 |
# Whether to use Mac OS resource-based fonts.
|
|
291 |
|
|
292 |
ftmac_c="" # src/base/ftmac.c should not be included in makefiles by default
|
|
293 |
|
|
294 |
# don't quote AS_HELP_STRING!
|
|
295 |
AC_ARG_WITH([old-mac-fonts],
|
|
296 |
AS_HELP_STRING([--with-old-mac-fonts],
|
|
297 |
[allow Mac resource-based fonts to be used]))
|
|
298 |
if test x$with_old_mac_fonts = xyes; then
|
|
299 |
orig_LDFLAGS="${LDFLAGS}"
|
|
300 |
AC_MSG_CHECKING([CoreServices & ApplicationServices of Mac OS X])
|
|
301 |
FT2_EXTRA_LIBS="-Wl,-framework,CoreServices -Wl,-framework,ApplicationServices"
|
|
302 |
LDFLAGS="$LDFLAGS $FT2_EXTRA_LIBS"
|
|
303 |
AC_LINK_IFELSE([
|
|
304 |
AC_LANG_PROGRAM([
|
|
305 |
|
|
306 |
#if defined(__GNUC__) && defined(__APPLE_CC__)
|
|
307 |
# include <CoreServices/CoreServices.h>
|
|
308 |
# include <ApplicationServices/ApplicationServices.h>
|
|
309 |
#else
|
|
310 |
# include <ConditionalMacros.h>
|
|
311 |
# include <Files.h>
|
|
312 |
#endif
|
|
313 |
|
|
314 |
],
|
|
315 |
[
|
|
316 |
|
|
317 |
short res = 0;
|
|
318 |
|
|
319 |
|
|
320 |
UseResFile( res );
|
|
321 |
|
|
322 |
])],
|
|
323 |
[AC_MSG_RESULT([ok])
|
|
324 |
ftmac_c='ftmac.c'
|
|
325 |
AC_MSG_CHECKING([OS_INLINE macro is ANSI compatible])
|
|
326 |
orig_CFLAGS="$CFLAGS"
|
|
327 |
CFLAGS="$CFLAGS $XX_CFLAGS $XX_ANSIFLAGS"
|
|
328 |
AC_COMPILE_IFELSE([
|
|
329 |
AC_LANG_PROGRAM([
|
|
330 |
|
|
331 |
#if defined(__GNUC__) && defined(__APPLE_CC__)
|
|
332 |
# include <CoreServices/CoreServices.h>
|
|
333 |
# include <ApplicationServices/ApplicationServices.h>
|
|
334 |
#else
|
|
335 |
# include <ConditionalMacros.h>
|
|
336 |
# include <Files.h>
|
|
337 |
#endif
|
|
338 |
|
|
339 |
],
|
|
340 |
[
|
|
341 |
|
|
342 |
/* OSHostByteOrder() is typed as OS_INLINE */
|
|
343 |
int32_t os_byte_order = OSHostByteOrder();
|
|
344 |
|
|
345 |
|
|
346 |
if ( OSBigEndian != os_byte_order )
|
|
347 |
return 1;
|
|
348 |
|
|
349 |
])],
|
|
350 |
[AC_MSG_RESULT([ok])
|
|
351 |
CFLAGS="$orig_CFLAGS"
|
|
352 |
CFLAGS="$CFLAGS -DHAVE_ANSI_OS_INLINE=1"
|
|
353 |
],
|
|
354 |
[AC_MSG_RESULT([no, ANSI incompatible])
|
|
355 |
CFLAGS="$orig_CFLAGS"
|
|
356 |
])
|
|
357 |
AC_MSG_CHECKING([type ResourceIndex])
|
|
358 |
orig_CFLAGS="$CFLAGS"
|
|
359 |
CFLAGS="$CFLAGS $XX_CFLAGS $XX_ANSIFLAGS"
|
|
360 |
AC_COMPILE_IFELSE([
|
|
361 |
AC_LANG_PROGRAM([
|
|
362 |
|
|
363 |
#if defined(__GNUC__) && defined(__APPLE_CC__)
|
|
364 |
# include <CoreServices/CoreServices.h>
|
|
365 |
# include <ApplicationServices/ApplicationServices.h>
|
|
366 |
#else
|
|
367 |
# include <ConditionalMacros.h>
|
|
368 |
# include <Files.h>
|
|
369 |
# include <Resources.h>
|
|
370 |
#endif
|
|
371 |
|
|
372 |
],
|
|
373 |
[
|
|
374 |
|
|
375 |
ResourceIndex i = 0;
|
|
376 |
return i;
|
|
377 |
|
|
378 |
])],
|
|
379 |
[AC_MSG_RESULT([ok])
|
|
380 |
CFLAGS="$orig_CFLAGS"
|
|
381 |
CFLAGS="$CFLAGS -DHAVE_TYPE_RESOURCE_INDEX=1"
|
|
382 |
],
|
|
383 |
[AC_MSG_RESULT([no])
|
|
384 |
CFLAGS="$orig_CFLAGS"
|
|
385 |
CFLAGS="$CFLAGS -DHAVE_TYPE_RESOURCE_INDEX=0"
|
|
386 |
])],
|
|
387 |
[AC_MSG_RESULT([not found])
|
|
388 |
FT2_EXTRA_LIBS=""
|
|
389 |
LDFLAGS="${orig_LDFLAGS}"
|
|
390 |
CFLAGS="$CFLAGS -DDARWIN_NO_CARBON"])
|
|
391 |
else
|
|
392 |
case x$host_os in
|
|
393 |
xdarwin*)
|
|
394 |
dnl AC_MSG_WARN([host system is MacOS but configured to build without Carbon])
|
|
395 |
CFLAGS="$CFLAGS -DDARWIN_NO_CARBON"
|
|
396 |
;;
|
|
397 |
*) ;;
|
|
398 |
esac
|
|
399 |
fi
|
|
400 |
|
|
401 |
|
|
402 |
# Whether to use FileManager which is deprecated since Mac OS X 10.4.
|
|
403 |
|
|
404 |
AC_ARG_WITH([fsspec],
|
|
405 |
AS_HELP_STRING([--with-fsspec],
|
|
406 |
[use obsolete FSSpec API of MacOS, if available (default=yes)]))
|
|
407 |
if test x$with_fsspec = xno; then
|
|
408 |
CFLAGS="$CFLAGS -DHAVE_FSSPEC=0"
|
|
409 |
elif test x$with_old_mac_fonts = xyes -a x$with_fsspec != x; then
|
|
410 |
AC_MSG_CHECKING([FSSpec-based FileManager])
|
|
411 |
AC_LINK_IFELSE([
|
|
412 |
AC_LANG_PROGRAM([
|
|
413 |
|
|
414 |
#if defined(__GNUC__) && defined(__APPLE_CC__)
|
|
415 |
# include <CoreServices/CoreServices.h>
|
|
416 |
# include <ApplicationServices/ApplicationServices.h>
|
|
417 |
#else
|
|
418 |
# include <ConditionalMacros.h>
|
|
419 |
# include <Files.h>
|
|
420 |
#endif
|
|
421 |
|
|
422 |
],
|
|
423 |
[
|
|
424 |
|
|
425 |
FCBPBPtr paramBlock;
|
|
426 |
short vRefNum;
|
|
427 |
long dirID;
|
|
428 |
ConstStr255Param fileName;
|
|
429 |
FSSpec* spec;
|
|
430 |
|
|
431 |
|
|
432 |
/* FSSpec functions: deprecated since Mac OS X 10.4 */
|
|
433 |
PBGetFCBInfoSync( paramBlock );
|
|
434 |
FSMakeFSSpec( vRefNum, dirID, fileName, spec );
|
|
435 |
|
|
436 |
])],
|
|
437 |
[AC_MSG_RESULT([ok])
|
|
438 |
CFLAGS="$CFLAGS -DHAVE_FSSPEC=1"],
|
|
439 |
[AC_MSG_RESULT([not found])
|
|
440 |
CFLAGS="$CFLAGS -DHAVE_FSSPEC=0"])
|
|
441 |
fi
|
|
442 |
|
|
443 |
|
|
444 |
# Whether to use FileManager in Carbon since MacOS 9.x.
|
|
445 |
|
|
446 |
AC_ARG_WITH([fsref],
|
|
447 |
AS_HELP_STRING([--with-fsref],
|
|
448 |
[use Carbon FSRef API of MacOS, if available (default=yes)]))
|
|
449 |
if test x$with_fsref = xno; then
|
|
450 |
AC_MSG_WARN([
|
|
451 |
*** WARNING
|
|
452 |
FreeType2 built without FSRef API cannot load
|
|
453 |
data-fork fonts on MacOS, except of XXX.dfont.
|
|
454 |
])
|
|
455 |
CFLAGS="$CFLAGS -DHAVE_FSREF=0"
|
|
456 |
elif test x$with_old_mac_fonts = xyes -a x$with_fsref != x; then
|
|
457 |
AC_MSG_CHECKING([FSRef-based FileManager])
|
|
458 |
AC_LINK_IFELSE([
|
|
459 |
AC_LANG_PROGRAM([
|
|
460 |
|
|
461 |
#if defined(__GNUC__) && defined(__APPLE_CC__)
|
|
462 |
# include <CoreServices/CoreServices.h>
|
|
463 |
# include <ApplicationServices/ApplicationServices.h>
|
|
464 |
#else
|
|
465 |
# include <ConditionalMacros.h>
|
|
466 |
# include <Files.h>
|
|
467 |
#endif
|
|
468 |
|
|
469 |
],
|
|
470 |
[
|
|
471 |
|
|
472 |
short vRefNum;
|
|
473 |
long dirID;
|
|
474 |
ConstStr255Param fileName;
|
|
475 |
|
|
476 |
Boolean* isDirectory;
|
|
477 |
UInt8* path;
|
|
478 |
SInt16 desiredRefNum;
|
|
479 |
SInt16* iterator;
|
|
480 |
SInt16* actualRefNum;
|
|
481 |
HFSUniStr255* outForkName;
|
|
482 |
FSVolumeRefNum volume;
|
|
483 |
FSCatalogInfoBitmap whichInfo;
|
|
484 |
FSCatalogInfo* catalogInfo;
|
|
485 |
FSForkInfo* forkInfo;
|
|
486 |
FSRef* ref;
|
|
487 |
|
|
488 |
#if HAVE_FSSPEC
|
|
489 |
FSSpec* spec;
|
|
490 |
#endif
|
|
491 |
|
|
492 |
/* FSRef functions: no need to check? */
|
|
493 |
FSGetForkCBInfo( desiredRefNum, volume, iterator,
|
|
494 |
actualRefNum, forkInfo, ref,
|
|
495 |
outForkName );
|
|
496 |
FSPathMakeRef( path, ref, isDirectory );
|
|
497 |
|
|
498 |
#if HAVE_FSSPEC
|
|
499 |
FSpMakeFSRef ( spec, ref );
|
|
500 |
FSGetCatalogInfo( ref, whichInfo, catalogInfo,
|
|
501 |
outForkName, spec, ref );
|
|
502 |
#endif
|
|
503 |
])],
|
|
504 |
[AC_MSG_RESULT([ok])
|
|
505 |
CFLAGS="$CFLAGS -DHAVE_FSREF=1"],
|
|
506 |
[AC_MSG_RESULT([not found])
|
|
507 |
CFLAGS="$CFLAGS -DHAVE_FSREF=0"])
|
|
508 |
fi
|
|
509 |
|
|
510 |
|
|
511 |
# Whether to use QuickDraw API in ToolBox which is deprecated since
|
|
512 |
# Mac OS X 10.4.
|
|
513 |
|
|
514 |
AC_ARG_WITH([quickdraw-toolbox],
|
|
515 |
AS_HELP_STRING([--with-quickdraw-toolbox],
|
|
516 |
[use MacOS QuickDraw in ToolBox, if available (default=yes)]))
|
|
517 |
if test x$with_quickdraw_toolbox = xno; then
|
|
518 |
CFLAGS="$CFLAGS -DHAVE_QUICKDRAW_TOOLBOX=0"
|
|
519 |
elif test x$with_old_mac_fonts = xyes -a x$with_quickdraw_toolbox != x; then
|
|
520 |
AC_MSG_CHECKING([QuickDraw FontManager functions in ToolBox])
|
|
521 |
AC_LINK_IFELSE([
|
|
522 |
AC_LANG_PROGRAM([
|
|
523 |
|
|
524 |
#if defined(__GNUC__) && defined(__APPLE_CC__)
|
|
525 |
# include <CoreServices/CoreServices.h>
|
|
526 |
# include <ApplicationServices/ApplicationServices.h>
|
|
527 |
#else
|
|
528 |
# include <ConditionalMacros.h>
|
|
529 |
# include <Fonts.h>
|
|
530 |
#endif
|
|
531 |
|
|
532 |
],
|
|
533 |
[
|
|
534 |
|
|
535 |
Str255 familyName;
|
|
536 |
SInt16 familyID = 0;
|
|
537 |
FMInput* fmIn = NULL;
|
|
538 |
FMOutput* fmOut = NULL;
|
|
539 |
|
|
540 |
|
|
541 |
GetFontName( familyID, familyName );
|
|
542 |
GetFNum( familyName, &familyID );
|
|
543 |
fmOut = FMSwapFont( fmIn );
|
|
544 |
|
|
545 |
])],
|
|
546 |
[AC_MSG_RESULT([ok])
|
|
547 |
CFLAGS="$CFLAGS -DHAVE_QUICKDRAW_TOOLBOX=1"],
|
|
548 |
[AC_MSG_RESULT([not found])
|
|
549 |
CFLAGS="$CFLAGS -DHAVE_QUICKDRAW_TOOLBOX=0"])
|
|
550 |
fi
|
|
551 |
|
|
552 |
|
|
553 |
# Whether to use QuickDraw API in Carbon which is deprecated since
|
|
554 |
# Mac OS X 10.4.
|
|
555 |
|
|
556 |
AC_ARG_WITH([quickdraw-carbon],
|
|
557 |
AS_HELP_STRING([--with-quickdraw-carbon],
|
|
558 |
[use MacOS QuickDraw in Carbon, if available (default=yes)]))
|
|
559 |
if test x$with_quickdraw_carbon = xno; then
|
|
560 |
CFLAGS="$CFLAGS -DHAVE_QUICKDRAW_CARBON=0"
|
|
561 |
elif test x$with_old_mac_fonts = xyes -a x$with_quickdraw_carbon != x; then
|
|
562 |
AC_MSG_CHECKING([QuickDraw FontManager functions in Carbon])
|
|
563 |
AC_LINK_IFELSE([
|
|
564 |
AC_LANG_PROGRAM([
|
|
565 |
|
|
566 |
#if defined(__GNUC__) && defined(__APPLE_CC__)
|
|
567 |
# include <CoreServices/CoreServices.h>
|
|
568 |
# include <ApplicationServices/ApplicationServices.h>
|
|
569 |
#else
|
|
570 |
# include <ConditionalMacros.h>
|
|
571 |
# include <Fonts.h>
|
|
572 |
#endif
|
|
573 |
|
|
574 |
],
|
|
575 |
[
|
|
576 |
|
|
577 |
FMFontFamilyIterator famIter;
|
|
578 |
FMFontFamily family;
|
|
579 |
Str255 famNameStr;
|
|
580 |
FMFontFamilyInstanceIterator instIter;
|
|
581 |
FMFontStyle style;
|
|
582 |
FMFontSize size;
|
|
583 |
FMFont font;
|
|
584 |
FSSpec* pathSpec;
|
|
585 |
|
|
586 |
|
|
587 |
FMCreateFontFamilyIterator( NULL, NULL, kFMUseGlobalScopeOption,
|
|
588 |
&famIter );
|
|
589 |
FMGetNextFontFamily( &famIter, &family );
|
|
590 |
FMGetFontFamilyName( family, famNameStr );
|
|
591 |
FMCreateFontFamilyInstanceIterator( family, &instIter );
|
|
592 |
FMGetNextFontFamilyInstance( &instIter, &font, &style, &size );
|
|
593 |
FMDisposeFontFamilyInstanceIterator( &instIter );
|
|
594 |
FMDisposeFontFamilyIterator( &famIter );
|
|
595 |
FMGetFontContainer( font, pathSpec );
|
|
596 |
|
|
597 |
])],
|
|
598 |
[AC_MSG_RESULT([ok])
|
|
599 |
CFLAGS="$CFLAGS -DHAVE_QUICKDRAW_CARBON=1"],
|
|
600 |
[AC_MSG_RESULT([not found])
|
|
601 |
CFLAGS="$CFLAGS -DHAVE_QUICKDRAW_CARBON=0"])
|
|
602 |
fi
|
|
603 |
|
|
604 |
|
|
605 |
# Whether to use AppleTypeService since Mac OS X.
|
|
606 |
|
|
607 |
# don't quote AS_HELP_STRING!
|
|
608 |
AC_ARG_WITH([ats],
|
|
609 |
AS_HELP_STRING([--with-ats],
|
|
610 |
[use AppleTypeService, if available (default=yes)]))
|
|
611 |
if test x$with_ats = xno; then
|
|
612 |
CFLAGS="$CFLAGS -DHAVE_ATS=0"
|
|
613 |
elif test x$with_old_mac_fonts = xyes -a x$with_ats != x ; then
|
|
614 |
AC_MSG_CHECKING([AppleTypeService functions])
|
|
615 |
AC_LINK_IFELSE([
|
|
616 |
AC_LANG_PROGRAM([
|
|
617 |
|
|
618 |
#if defined(__GNUC__) && defined(__APPLE_CC__)
|
|
619 |
# include <CoreServices/CoreServices.h>
|
|
620 |
# include <ApplicationServices/ApplicationServices.h>
|
|
621 |
#else
|
|
622 |
# include <ConditionalMacros.h>
|
|
623 |
# include <Files.h>
|
|
624 |
#endif
|
|
625 |
|
|
626 |
],
|
|
627 |
[
|
|
628 |
|
|
629 |
FSSpec* pathSpec;
|
|
630 |
|
|
631 |
|
|
632 |
ATSFontFindFromName( NULL, kATSOptionFlagsUnRestrictedScope );
|
|
633 |
#if HAVE_FSSPEC
|
|
634 |
ATSFontGetFileSpecification( 0, pathSpec );
|
|
635 |
#endif
|
|
636 |
|
|
637 |
])],
|
|
638 |
[AC_MSG_RESULT([ok])
|
|
639 |
CFLAGS="$CFLAGS -DHAVE_ATS=1"],
|
|
640 |
[AC_MSG_RESULT([not found])
|
|
641 |
CFLAGS="$CFLAGS -DHAVE_ATS=0"])
|
|
642 |
fi
|
|
643 |
|
|
644 |
case "$CFLAGS" in
|
|
645 |
*HAVE_FSSPEC* | *HAVE_FSREF* | *HAVE_QUICKDRAW* | *HAVE_ATS* )
|
|
646 |
AC_MSG_WARN([
|
|
647 |
*** WARNING
|
|
648 |
FSSpec/FSRef/QuickDraw/ATS options are explicitly given,
|
|
649 |
thus it is recommended to replace src/base/ftmac.c by builds/mac/ftmac.c.
|
|
650 |
])
|
|
651 |
CFLAGS="$CFLAGS "'-I$(TOP_DIR)/builds/mac/'
|
|
652 |
;;
|
|
653 |
*)
|
|
654 |
;;
|
|
655 |
esac
|
|
656 |
|
|
657 |
|
|
658 |
AC_SUBST([ftmac_c])
|
|
659 |
AC_SUBST([LIBZ])
|
|
660 |
AC_SUBST([LIBBZ2])
|
|
661 |
AC_SUBST([CFLAGS])
|
|
662 |
AC_SUBST([LDFLAGS])
|
|
663 |
AC_SUBST([FT2_EXTRA_LIBS])
|
|
664 |
AC_SUBST([SYSTEM_ZLIB])
|
|
665 |
|
|
666 |
|
|
667 |
LT_INIT(win32-dll)
|
|
668 |
|
|
669 |
AC_SUBST([hardcode_libdir_flag_spec])
|
|
670 |
AC_SUBST([wl])
|
|
671 |
AC_SUBST([build_libtool_libs])
|
|
672 |
|
|
673 |
|
|
674 |
# configuration file -- stay in 8.3 limit
|
|
675 |
#
|
|
676 |
# since #undef doesn't survive in configuration header files we replace
|
|
677 |
# `/undef' with `#undef' after creating the output file
|
|
678 |
|
|
679 |
AC_CONFIG_HEADERS([ftconfig.h:ftconfig.in],
|
|
680 |
[mv ftconfig.h ftconfig.tmp
|
|
681 |
sed 's|/undef|#undef|' < ftconfig.tmp > ftconfig.h
|
|
682 |
rm ftconfig.tmp])
|
|
683 |
|
|
684 |
# create the Unix-specific sub-Makefiles `builds/unix/unix-def.mk'
|
|
685 |
# and `builds/unix/unix-cc.mk' that will be used by the build system
|
|
686 |
#
|
|
687 |
AC_CONFIG_FILES([unix-cc.mk:unix-cc.in
|
|
688 |
unix-def.mk:unix-def.in
|
|
689 |
freetype-config
|
|
690 |
freetype2.pc:freetype2.in])
|
|
691 |
|
|
692 |
# re-generate the Jamfile to use libtool now
|
|
693 |
#
|
|
694 |
# AC_CONFIG_FILES([../../Jamfile:../../Jamfile.in])
|
|
695 |
|
|
696 |
AC_OUTPUT
|
|
697 |
|
|
698 |
# end of configure.raw
|