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. |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 4 | |
Werner Lemberg | b3f3210 | 2001-06-08 12:19:22 +0000 | [diff] [blame] | 5 | AC_INIT |
| 6 | AC_CONFIG_SRCDIR([ftconfig.in]) |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 7 | |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 8 | |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 9 | # Don't forget to update docs/VERSION.DLL! |
| 10 | |
David Turner | b4e9ca4 | 2003-12-19 04:03:50 +0000 | [diff] [blame] | 11 | version_info='9:6:3' |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 12 | AC_SUBST([version_info]) |
Werner Lemberg | 3de5b07 | 2001-03-20 07:52:52 +0000 | [diff] [blame] | 13 | ft_version=`echo $version_info | tr : .` |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 14 | AC_SUBST([ft_version]) |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 15 | |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 16 | |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 17 | # checks for system type |
| 18 | |
| 19 | AC_CANONICAL_TARGET |
| 20 | |
| 21 | |
| 22 | # checks for programs |
| 23 | |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 24 | AC_PROG_CC |
| 25 | AC_PROG_CPP |
| 26 | |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 27 | |
| 28 | # get compiler flags right |
| 29 | |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 30 | if test "x$CC" = xgcc; then |
| 31 | XX_CFLAGS="-Wall" |
| 32 | XX_ANSIFLAGS="-pedantic -ansi" |
| 33 | else |
| 34 | case "$host" in |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 35 | *-dec-osf*) |
| 36 | CFLAGS= |
| 37 | XX_CFLAGS="-std1 -g3" |
| 38 | XX_ANSIFLAGS= |
| 39 | ;; |
| 40 | *) |
| 41 | XX_CFLAGS= |
| 42 | XX_ANSIFLAGS= |
| 43 | ;; |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 44 | esac |
| 45 | fi |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 46 | AC_SUBST([XX_CFLAGS]) |
| 47 | AC_SUBST([XX_ANSIFLAGS]) |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 48 | |
Werner Lemberg | fd9777e | 2000-07-31 10:56:42 +0000 | [diff] [blame] | 49 | |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 50 | # auxiliary programs |
| 51 | |
| 52 | AC_CHECK_PROG([RMF], [rm], [rm -f]) |
| 53 | AC_CHECK_PROG([RMDIR], [rmdir], [rmdir]) |
| 54 | |
| 55 | |
| 56 | # Since this file will be finally moved to another directory we make |
| 57 | # the path of the install script absolute. This small code snippet has |
| 58 | # been taken from automake's `ylwrap' script. |
| 59 | |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 60 | AC_PROG_INSTALL |
Werner Lemberg | fd9777e | 2000-07-31 10:56:42 +0000 | [diff] [blame] | 61 | case "$INSTALL" in |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 62 | /*) |
| 63 | ;; |
| 64 | */*) |
| 65 | INSTALL="`pwd`/$INSTALL" ;; |
Werner Lemberg | fd9777e | 2000-07-31 10:56:42 +0000 | [diff] [blame] | 66 | esac |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 67 | |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 68 | |
| 69 | # checks for header files |
| 70 | |
Werner Lemberg | d060a75 | 2000-07-20 06:57:41 +0000 | [diff] [blame] | 71 | AC_HEADER_STDC |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 72 | AC_CHECK_HEADERS([fcntl.h unistd.h]) |
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 | # checks for typedefs, structures, and compiler characteristics |
| 76 | |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 77 | AC_C_CONST |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 78 | AC_CHECK_SIZEOF([int]) |
| 79 | AC_CHECK_SIZEOF([long]) |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 80 | |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 81 | |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 82 | # checks for library functions |
| 83 | |
| 84 | # Here we check whether we can use our mmap file component. |
| 85 | |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 86 | AC_FUNC_MMAP |
| 87 | if test "$ac_cv_func_mmap_fixed_mapped" != yes; then |
Werner Lemberg | 858f310 | 2003-06-09 04:46:30 +0000 | [diff] [blame] | 88 | FTSYS_SRC='$(BASE_DIR)/ftsystem.c' |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 89 | else |
Werner Lemberg | 858f310 | 2003-06-09 04:46:30 +0000 | [diff] [blame] | 90 | FTSYS_SRC='$(BUILD_DIR)/ftsystem.c' |
Werner Lemberg | b1dd353 | 2000-07-31 22:51:00 +0000 | [diff] [blame] | 91 | |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 92 | AC_CHECK_DECLS([munmap], |
| 93 | [], |
| 94 | [], |
| 95 | [ |
| 96 | |
| 97 | #ifdef HAVE_UNISTD_H |
| 98 | #include <unistd.h> |
| 99 | #endif |
| 100 | #include <sys/mman.h> |
| 101 | |
| 102 | ]) |
| 103 | |
Werner Lemberg | b1dd353 | 2000-07-31 22:51:00 +0000 | [diff] [blame] | 104 | FT_MUNMAP_PARAM |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 105 | fi |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 106 | AC_SUBST([FTSYS_SRC]) |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 107 | |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 108 | AC_CHECK_FUNCS([memcpy memmove]) |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 109 | |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 110 | |
| 111 | # Check for system zlib |
| 112 | |
| 113 | AC_ARG_WITH([zlib], |
| 114 | dnl don't quote AS_HELP_STRING! |
| 115 | AS_HELP_STRING([--without-zlib], |
| 116 | [use internal zlib instead of system-wide])) |
David Turner | 621e488 | 2002-12-16 21:51:24 +0000 | [diff] [blame] | 117 | if test x$with_zlib != xno && test -z "$LIBZ"; then |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 118 | AC_CHECK_LIB([z], [gzsetparams], [AC_CHECK_HEADER([zlib.h], [LIBZ='-lz'])]) |
David Turner | 621e488 | 2002-12-16 21:51:24 +0000 | [diff] [blame] | 119 | fi |
| 120 | if test x$with_zlib != xno && test -n "$LIBZ"; then |
| 121 | CFLAGS="$CFLAGS -DFT_CONFIG_OPTION_SYSTEM_ZLIB" |
David Turner | 19b6b99 | 2002-12-23 22:40:21 +0000 | [diff] [blame] | 122 | LDFLAGS="$LDFLAGS $LIBZ" |
David Turner | 621e488 | 2002-12-16 21:51:24 +0000 | [diff] [blame] | 123 | SYSTEM_ZLIB=yes |
| 124 | fi |
Werner Lemberg | 6eb116e | 2003-05-11 07:12:26 +0000 | [diff] [blame] | 125 | |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 126 | |
| 127 | # Whether to use Mac OS resource-based fonts or not |
| 128 | |
| 129 | AC_ARG_WITH([old-mac-fonts], |
| 130 | dnl don't quote AS_HELP_STRING! |
| 131 | AS_HELP_STRING([--with-old-mac-fonts], |
| 132 | [allow Mac resource-based fonts to be used])) |
Werner Lemberg | 6eb116e | 2003-05-11 07:12:26 +0000 | [diff] [blame] | 133 | if test x$with_old_mac_fonts = xyes; then |
| 134 | CFLAGS="$CFLAGS -DTARGET_API_MAC_CARBON" |
| 135 | LDFLAGS="$LDFLAGS -Xlinker -framework -Xlinker CoreServices \ |
| 136 | -Xlinker -framework -Xlinker ApplicationServices" |
| 137 | else |
| 138 | CFLAGS="$CFLAGS -DDARWIN_NO_CARBON" |
| 139 | fi |
| 140 | |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 141 | |
| 142 | AC_SUBST([LIBZ]) |
| 143 | AC_SUBST([CFLAGS]) |
| 144 | AC_SUBST([LDFLAGS]) |
| 145 | AC_SUBST([SYSTEM_ZLIB]) |
| 146 | |
David Turner | 621e488 | 2002-12-16 21:51:24 +0000 | [diff] [blame] | 147 | |
Werner Lemberg | c0c2abe | 2001-06-07 17:36:17 +0000 | [diff] [blame] | 148 | AC_PROG_LIBTOOL |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 149 | |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 150 | |
| 151 | # configuration file -- stay in 8.3 limit |
| 152 | # |
| 153 | # since #undef doesn't survive in configuration header files we replace |
| 154 | # `/undef' with `#undef' after creating the output file |
| 155 | |
| 156 | AC_CONFIG_HEADERS([ftconfig.h:ftconfig.in], |
| 157 | [mv ftconfig.h ftconfig.tmp |
| 158 | sed 's|/undef|#undef|' < ftconfig.tmp > ftconfig.h |
| 159 | rm ftconfig.tmp]) |
| 160 | |
| 161 | # create the Unix-specific sub-Makefiles `builds/unix/unix-def.mk' |
| 162 | # and 'builds/unix/unix-cc.mk' that will be used by the build system |
| 163 | # |
Werner Lemberg | 3a317c6 | 2003-04-28 09:43:32 +0000 | [diff] [blame] | 164 | AC_CONFIG_FILES([unix-cc.mk:unix-cc.in |
| 165 | unix-def.mk:unix-def.in |
| 166 | freetype-config |
| 167 | freetype2.pc:freetype2.in]) |
David Turner | ce9a044 | 2002-01-08 18:33:55 +0000 | [diff] [blame] | 168 | |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 169 | # re-generate the Jamfile to use libtool now |
| 170 | # |
| 171 | # AC_CONFIG_FILES([../../Jamfile:../../Jamfile.in]) |
David Turner | ce9a044 | 2002-01-08 18:33:55 +0000 | [diff] [blame] | 172 | |
Werner Lemberg | b3f3210 | 2001-06-08 12:19:22 +0000 | [diff] [blame] | 173 | AC_OUTPUT |
David Turner | 7404301 | 2000-07-08 00:22:20 +0000 | [diff] [blame] | 174 | |
Werner Lemberg | e42dbce | 2003-11-09 08:37:14 +0000 | [diff] [blame] | 175 | # end of configure.ac |