Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

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