David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 1 | dnl This file is part of the FreeType project. |
| 2 | dnl |
| 3 | dnl Process this file with autoconf to produce a configure script. |
| 4 | dnl |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 5 | |
Werner Lemberg | b3f3210 | 2001-06-08 12:19:22 +0000 | [diff] [blame] | 6 | AC_INIT |
| 7 | AC_CONFIG_SRCDIR([ftconfig.in]) |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 8 | |
Werner Lemberg | fd9777e | 2000-07-31 10:56:42 +0000 | [diff] [blame] | 9 | dnl configuration file -- stay in 8.3 limit |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 10 | AC_CONFIG_HEADER(ftconfig.h:ftconfig.in) |
| 11 | |
Werner Lemberg | 73c10ae | 2002-09-10 15:17:32 +0000 | [diff] [blame] | 12 | dnl Don't forget to update VERSION.DLL! |
David Turner | 8291d25 | 2002-12-26 20:51:04 +0000 | [diff] [blame] | 13 | version_info='9:3:3' |
Werner Lemberg | d060a75 | 2000-07-20 06:57:41 +0000 | [diff] [blame] | 14 | AC_SUBST(version_info) |
Werner Lemberg | 3de5b07 | 2001-03-20 07:52:52 +0000 | [diff] [blame] | 15 | ft_version=`echo $version_info | tr : .` |
| 16 | AC_SUBST(ft_version) |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 17 | |
Werner Lemberg | d060a75 | 2000-07-20 06:57:41 +0000 | [diff] [blame] | 18 | dnl checks for system type |
Werner Lemberg | b3f3210 | 2001-06-08 12:19:22 +0000 | [diff] [blame] | 19 | AC_CANONICAL_TARGET([]) |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 20 | |
Werner Lemberg | d060a75 | 2000-07-20 06:57:41 +0000 | [diff] [blame] | 21 | dnl checks for programs |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 22 | AC_PROG_CC |
| 23 | AC_PROG_CPP |
| 24 | |
| 25 | dnl get Compiler flags right. |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 26 | if test "x$CC" = xgcc; then |
| 27 | XX_CFLAGS="-Wall" |
| 28 | XX_ANSIFLAGS="-pedantic -ansi" |
| 29 | else |
| 30 | case "$host" in |
| 31 | *-dec-osf*) |
Werner Lemberg | 07373c8 | 2000-08-01 18:44:18 +0000 | [diff] [blame] | 32 | CFLAGS= |
| 33 | XX_CFLAGS="-std1 -g3" |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 34 | XX_ANSIFLAGS= |
| 35 | ;; |
| 36 | *) |
| 37 | XX_CFLAGS= |
| 38 | XX_ANSIFLAGS= |
| 39 | ;; |
| 40 | esac |
| 41 | fi |
| 42 | AC_SUBST(XX_CFLAGS) |
| 43 | AC_SUBST(XX_ANSIFLAGS) |
| 44 | |
| 45 | AC_CHECK_PROG(RMF, rm, rm -f) |
| 46 | AC_CHECK_PROG(RMDIR, rmdir, rmdir) |
Werner Lemberg | fd9777e | 2000-07-31 10:56:42 +0000 | [diff] [blame] | 47 | |
| 48 | dnl Since this file will be finally moved to another directory we make |
| 49 | dnl the path of the install script absolute. This small code snippet has |
| 50 | dnl been taken from automake's `ylwrap' script. |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 51 | AC_PROG_INSTALL |
Werner Lemberg | fd9777e | 2000-07-31 10:56:42 +0000 | [diff] [blame] | 52 | case "$INSTALL" in |
| 53 | /*) |
| 54 | ;; |
| 55 | */*) |
| 56 | INSTALL="`pwd`/$INSTALL" ;; |
| 57 | esac |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 58 | |
Werner Lemberg | d060a75 | 2000-07-20 06:57:41 +0000 | [diff] [blame] | 59 | dnl checks for header files |
| 60 | AC_HEADER_STDC |
| 61 | AC_CHECK_HEADERS(fcntl.h unistd.h) |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 62 | |
Werner Lemberg | d060a75 | 2000-07-20 06:57:41 +0000 | [diff] [blame] | 63 | dnl checks for typedefs, structures, and compiler characteristics |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 64 | AC_C_CONST |
| 65 | AC_CHECK_SIZEOF(int) |
| 66 | AC_CHECK_SIZEOF(long) |
| 67 | |
Werner Lemberg | fd9777e | 2000-07-31 10:56:42 +0000 | [diff] [blame] | 68 | dnl checks for library functions |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 69 | |
| 70 | dnl Here we check whether we can use our mmap file component. |
| 71 | AC_FUNC_MMAP |
| 72 | if test "$ac_cv_func_mmap_fixed_mapped" != yes; then |
Werner Lemberg | d060a75 | 2000-07-20 06:57:41 +0000 | [diff] [blame] | 73 | FTSYS_SRC='$(BASE_)ftsystem.c' |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 74 | else |
Werner Lemberg | d060a75 | 2000-07-20 06:57:41 +0000 | [diff] [blame] | 75 | FTSYS_SRC='$(BUILD)/ftsystem.c' |
Werner Lemberg | b1dd353 | 2000-07-31 22:51:00 +0000 | [diff] [blame] | 76 | |
| 77 | FT_MUNMAP_DECL |
| 78 | FT_MUNMAP_PARAM |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 79 | fi |
Werner Lemberg | d060a75 | 2000-07-20 06:57:41 +0000 | [diff] [blame] | 80 | AC_SUBST(FTSYS_SRC) |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 81 | |
| 82 | AC_CHECK_FUNCS(memcpy memmove) |
| 83 | |
David Turner | 621e488 | 2002-12-16 21:51:24 +0000 | [diff] [blame] | 84 | dnl Check for system zlib |
| 85 | AC_ARG_WITH(zlib, |
| 86 | [ --without-zlib use internal zlib instead of system-wide]) |
| 87 | if test x$with_zlib != xno && test -z "$LIBZ"; then |
| 88 | AC_CHECK_LIB(z, gzsetparams, [AC_CHECK_HEADER(zlib.h, LIBZ='-lz')]) |
| 89 | fi |
| 90 | if test x$with_zlib != xno && test -n "$LIBZ"; then |
| 91 | CFLAGS="$CFLAGS -DFT_CONFIG_OPTION_SYSTEM_ZLIB" |
David Turner | 19b6b99 | 2002-12-23 22:40:21 +0000 | [diff] [blame] | 92 | LDFLAGS="$LDFLAGS $LIBZ" |
David Turner | 621e488 | 2002-12-16 21:51:24 +0000 | [diff] [blame] | 93 | SYSTEM_ZLIB=yes |
| 94 | fi |
Werner Lemberg | 6eb116e | 2003-05-11 07:12:26 +0000 | [diff] [blame] | 95 | |
| 96 | dnl Whether to use Mac OS resource-based fonts or not |
| 97 | AC_ARG_WITH(old-mac-fonts, |
| 98 | [ --with-old-mac-fonts allow Mac resource-based fonts to be used]) |
| 99 | if test x$with_old_mac_fonts = xyes; then |
| 100 | CFLAGS="$CFLAGS -DTARGET_API_MAC_CARBON" |
| 101 | LDFLAGS="$LDFLAGS -Xlinker -framework -Xlinker CoreServices \ |
| 102 | -Xlinker -framework -Xlinker ApplicationServices" |
| 103 | else |
| 104 | CFLAGS="$CFLAGS -DDARWIN_NO_CARBON" |
| 105 | fi |
| 106 | |
David Turner | 621e488 | 2002-12-16 21:51:24 +0000 | [diff] [blame] | 107 | AC_SUBST(LIBZ) |
| 108 | AC_SUBST(CFLAGS) |
David Turner | 19b6b99 | 2002-12-23 22:40:21 +0000 | [diff] [blame] | 109 | AC_SUBST(LDFLAGS) |
David Turner | 621e488 | 2002-12-16 21:51:24 +0000 | [diff] [blame] | 110 | AC_SUBST(SYSTEM_ZLIB) |
| 111 | |
Werner Lemberg | c0c2abe | 2001-06-07 17:36:17 +0000 | [diff] [blame] | 112 | AC_PROG_LIBTOOL |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 113 | |
Werner Lemberg | e4b32a5 | 2000-10-31 20:42:18 +0000 | [diff] [blame] | 114 | dnl create the Unix-specific sub-Makefiles `builds/unix/unix-def.mk' |
David Turner | 426984e | 2000-09-15 23:47:42 +0000 | [diff] [blame] | 115 | dnl and 'builds/unix/unix-cc.mk' that will be used by the build system |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 116 | dnl |
Werner Lemberg | 3a317c6 | 2003-04-28 09:43:32 +0000 | [diff] [blame] | 117 | AC_CONFIG_FILES([unix-cc.mk:unix-cc.in |
| 118 | unix-def.mk:unix-def.in |
| 119 | freetype-config |
| 120 | freetype2.pc:freetype2.in]) |
David Turner | ce9a044 | 2002-01-08 18:33:55 +0000 | [diff] [blame] | 121 | |
| 122 | dnl re-generate the Jamfile to use libtool now |
| 123 | dnl |
Werner Lemberg | b1e6e59 | 2002-03-29 07:43:04 +0000 | [diff] [blame] | 124 | dnl AC_CONFIG_FILES([../../Jamfile:../../Jamfile.in]) |
David Turner | ce9a044 | 2002-01-08 18:33:55 +0000 | [diff] [blame] | 125 | |
Werner Lemberg | b3f3210 | 2001-06-08 12:19:22 +0000 | [diff] [blame] | 126 | AC_OUTPUT |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 127 | |
Werner Lemberg | b3f3210 | 2001-06-08 12:19:22 +0000 | [diff] [blame] | 128 | dnl end of configure.ac |