Javier Jardón | 2abe126 | 2011-01-09 22:18:53 -0500 | [diff] [blame] | 1 | AC_PREREQ([2.64]) |
Behdad Esfahbod | 8c5f5e6 | 2012-06-17 14:58:59 -0400 | [diff] [blame] | 2 | AC_INIT([HarfBuzz], |
Behdad Esfahbod | a6446d4 | 2015-06-18 11:14:56 -0700 | [diff] [blame] | 3 | [0.9.41], |
Javier Jardón | 2abe126 | 2011-01-09 22:18:53 -0500 | [diff] [blame] | 4 | [http://bugs.freedesktop.org/enter_bug.cgi?product=harfbuzz], |
| 5 | [harfbuzz], |
Behdad Esfahbod | 5b21eff | 2011-05-25 14:49:35 -0400 | [diff] [blame] | 6 | [http://harfbuzz.org/]) |
Javier Jardón | 2abe126 | 2011-01-09 22:18:53 -0500 | [diff] [blame] | 7 | |
Behdad Esfahbod | c7afac0 | 2012-10-02 14:44:47 -0400 | [diff] [blame] | 8 | AC_CONFIG_MACRO_DIR([m4]) |
Behdad Esfahbod | 22ce096 | 2013-05-28 17:18:30 -0400 | [diff] [blame] | 9 | AC_CONFIG_SRCDIR([src/harfbuzz.pc.in]) |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 10 | AC_CONFIG_HEADERS([config.h]) |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 11 | |
Behdad Esfahbod | 2646aec | 2013-12-05 18:19:35 -0500 | [diff] [blame] | 12 | AM_INIT_AUTOMAKE([1.11.1 gnits tar-pax dist-bzip2 no-dist-gzip -Wall no-define color-tests -Wno-portability]) |
| 13 | AM_CONDITIONAL(AUTOMAKE_OLDER_THAN_1_13, test $am__api_version = 1.11 -o $am__api_version = 1.12) |
Javier Jardón | 2abe126 | 2011-01-09 22:18:53 -0500 | [diff] [blame] | 14 | AM_SILENT_RULES([yes]) |
| 15 | |
Behdad Esfahbod | c62e41b | 2012-01-27 02:20:58 -0500 | [diff] [blame] | 16 | # Initialize libtool |
Behdad Esfahbod | 03adf38 | 2013-04-29 13:40:52 -0400 | [diff] [blame] | 17 | m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) |
Behdad Esfahbod | c62e41b | 2012-01-27 02:20:58 -0500 | [diff] [blame] | 18 | LT_PREREQ([2.2]) |
| 19 | LT_INIT([disable-static]) |
| 20 | |
Javier Jardón | 2abe126 | 2011-01-09 22:18:53 -0500 | [diff] [blame] | 21 | # Check for programs |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 22 | AC_PROG_CC |
Behdad Esfahbod | 0109816 | 2010-10-05 18:36:45 -0400 | [diff] [blame] | 23 | AM_PROG_CC_C_O |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 24 | AC_PROG_CXX |
Behdad Esfahbod | c7afac0 | 2012-10-02 14:44:47 -0400 | [diff] [blame] | 25 | PKG_PROG_PKG_CONFIG([0.20]) |
Behdad Esfahbod | bb8ffb5 | 2014-03-04 13:03:51 -0800 | [diff] [blame] | 26 | AM_MISSING_PROG([RAGEL], [ragel]) |
| 27 | AM_MISSING_PROG([GIT], [git]) |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 28 | |
Behdad Esfahbod | c78f448 | 2011-05-05 21:31:04 -0400 | [diff] [blame] | 29 | # Version |
Behdad Esfahbod | 329c157 | 2011-05-25 16:07:07 -0400 | [diff] [blame] | 30 | m4_define(hb_version_triplet,m4_split(AC_PACKAGE_VERSION,[[.]])) |
| 31 | m4_define(hb_version_major,m4_argn(1,hb_version_triplet)) |
| 32 | m4_define(hb_version_minor,m4_argn(2,hb_version_triplet)) |
| 33 | m4_define(hb_version_micro,m4_argn(3,hb_version_triplet)) |
| 34 | HB_VERSION_MAJOR=hb_version_major |
| 35 | HB_VERSION_MINOR=hb_version_minor |
| 36 | HB_VERSION_MICRO=hb_version_micro |
Behdad Esfahbod | c78f448 | 2011-05-05 21:31:04 -0400 | [diff] [blame] | 37 | HB_VERSION=AC_PACKAGE_VERSION |
Behdad Esfahbod | c78f448 | 2011-05-05 21:31:04 -0400 | [diff] [blame] | 38 | AC_SUBST(HB_VERSION_MAJOR) |
| 39 | AC_SUBST(HB_VERSION_MINOR) |
| 40 | AC_SUBST(HB_VERSION_MICRO) |
| 41 | AC_SUBST(HB_VERSION) |
| 42 | |
Behdad Esfahbod | 329c157 | 2011-05-25 16:07:07 -0400 | [diff] [blame] | 43 | # Libtool version |
| 44 | m4_define([hb_version_int], |
| 45 | m4_eval(hb_version_major*10000 + hb_version_minor*100 + hb_version_micro)) |
| 46 | m4_if(m4_eval(hb_version_minor % 2), [1], |
| 47 | dnl for unstable releases |
| 48 | [m4_define([hb_libtool_revision], 0)], |
| 49 | dnl for stable releases |
| 50 | [m4_define([hb_libtool_revision], hb_version_micro)]) |
| 51 | m4_define([hb_libtool_age], |
| 52 | m4_eval(hb_version_int - hb_libtool_revision)) |
| 53 | m4_define([hb_libtool_current], |
| 54 | m4_eval(hb_version_major + hb_libtool_age)) |
| 55 | HB_LIBTOOL_VERSION_INFO=hb_libtool_current:hb_libtool_revision:hb_libtool_age |
| 56 | AC_SUBST(HB_LIBTOOL_VERSION_INFO) |
Behdad Esfahbod | c78f448 | 2011-05-05 21:31:04 -0400 | [diff] [blame] | 57 | |
Behdad Esfahbod | 71ef22b | 2013-08-28 12:52:55 -0400 | [diff] [blame] | 58 | # Documentation |
| 59 | have_gtk_doc=false |
| 60 | m4_ifdef([GTK_DOC_CHECK], [ |
Behdad Esfahbod | 79d754e | 2013-08-28 13:43:35 -0400 | [diff] [blame] | 61 | GTK_DOC_CHECK([1.15],[--flavour no-tmpl]) |
Behdad Esfahbod | 71ef22b | 2013-08-28 12:52:55 -0400 | [diff] [blame] | 62 | if test "x$enable_gtk_doc" = xyes; then |
| 63 | have_gtk_doc=true |
| 64 | fi |
| 65 | ], [ |
| 66 | AM_CONDITIONAL([ENABLE_GTK_DOC], false) |
| 67 | ]) |
Behdad Esfahbod | b9b10ad | 2011-09-13 13:30:39 -0400 | [diff] [blame] | 68 | |
Behdad Esfahbod | 174e3fe | 2011-05-05 19:37:53 -0400 | [diff] [blame] | 69 | # Functions and headers |
Behdad Esfahbod | e2aab4b | 2013-02-12 15:35:32 -0500 | [diff] [blame] | 70 | AC_CHECK_FUNCS(atexit mprotect sysconf getpagesize mmap isatty) |
| 71 | AC_CHECK_HEADERS(unistd.h sys/mman.h) |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 72 | |
Behdad Esfahbod | 174e3fe | 2011-05-05 19:37:53 -0400 | [diff] [blame] | 73 | # Compiler flags |
Behdad Esfahbod | c78f448 | 2011-05-05 21:31:04 -0400 | [diff] [blame] | 74 | AC_CANONICAL_HOST |
Behdad Esfahbod | 824d00d | 2014-06-09 14:17:33 -0400 | [diff] [blame] | 75 | AC_CHECK_ALIGNOF([struct{char;}]) |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 76 | if test "x$GCC" = "xyes"; then |
Behdad Esfahbod | 5b7f389 | 2011-04-27 15:10:12 -0400 | [diff] [blame] | 77 | |
Behdad Esfahbod | 71cef14 | 2011-05-06 19:30:59 -0400 | [diff] [blame] | 78 | # Make symbols link locally |
| 79 | LDFLAGS="$LDFLAGS -Bsymbolic-functions" |
| 80 | |
Behdad Esfahbod | 5b7f389 | 2011-04-27 15:10:12 -0400 | [diff] [blame] | 81 | # Make sure we don't link to libstdc++ |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 82 | CXXFLAGS="$CXXFLAGS -fno-rtti -fno-exceptions" |
Behdad Esfahbod | 5b7f389 | 2011-04-27 15:10:12 -0400 | [diff] [blame] | 83 | |
Behdad Esfahbod | 11c4ad4 | 2012-07-13 11:29:31 -0400 | [diff] [blame] | 84 | # Assorted warnings |
| 85 | CXXFLAGS="$CXXFLAGS -Wcast-align" |
| 86 | |
Behdad Esfahbod | 5b7f389 | 2011-04-27 15:10:12 -0400 | [diff] [blame] | 87 | case "$host" in |
Behdad Esfahbod | 560d68a | 2012-08-08 17:16:01 -0400 | [diff] [blame] | 88 | *-*-mingw*) |
Behdad Esfahbod | e3320ec | 2012-08-06 11:44:10 -0700 | [diff] [blame] | 89 | ;; |
| 90 | *) |
| 91 | # Hide inline methods |
| 92 | CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden" |
| 93 | ;; |
| 94 | esac |
| 95 | |
| 96 | case "$host" in |
Behdad Esfahbod | 5b7f389 | 2011-04-27 15:10:12 -0400 | [diff] [blame] | 97 | arm-*-*) |
Behdad Esfahbod | 824d00d | 2014-06-09 14:17:33 -0400 | [diff] [blame] | 98 | if test "x$ac_cv_alignof_struct_char__" != x1; then |
Behdad Esfahbod | 3f38c11 | 2014-06-06 16:03:40 -0400 | [diff] [blame] | 99 | # Request byte alignment |
| 100 | CXXFLAGS="$CXXFLAGS -mstructure-size-boundary=8" |
| 101 | fi |
Behdad Esfahbod | 5b7f389 | 2011-04-27 15:10:12 -0400 | [diff] [blame] | 102 | ;; |
| 103 | esac |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 104 | fi |
| 105 | |
Behdad Esfahbod | e784632 | 2013-01-14 00:27:21 -0600 | [diff] [blame] | 106 | AM_CONDITIONAL(HAVE_GCC, test "x$GCC" = "xyes") |
| 107 | |
Behdad Esfahbod | 0e292eb | 2012-10-02 14:59:00 -0400 | [diff] [blame] | 108 | hb_os_win32=no |
Behdad Esfahbod | 560d68a | 2012-08-08 17:16:01 -0400 | [diff] [blame] | 109 | AC_MSG_CHECKING([for native Win32]) |
| 110 | case "$host" in |
| 111 | *-*-mingw*) |
| 112 | hb_os_win32=yes |
| 113 | ;; |
Behdad Esfahbod | 560d68a | 2012-08-08 17:16:01 -0400 | [diff] [blame] | 114 | esac |
| 115 | AC_MSG_RESULT([$hb_os_win32]) |
| 116 | AM_CONDITIONAL(OS_WIN32, test "$hb_os_win32" = "yes") |
| 117 | |
Behdad Esfahbod | 66efe89 | 2012-10-02 14:55:32 -0400 | [diff] [blame] | 118 | have_pthread=false |
Behdad Esfahbod | 0e292eb | 2012-10-02 14:59:00 -0400 | [diff] [blame] | 119 | if test "$hb_os_win32" = no; then |
| 120 | AX_PTHREAD([have_pthread=true]) |
| 121 | fi |
Behdad Esfahbod | 66efe89 | 2012-10-02 14:55:32 -0400 | [diff] [blame] | 122 | if $have_pthread; then |
| 123 | AC_DEFINE(HAVE_PTHREAD, 1, [Have POSIX threads]) |
| 124 | fi |
| 125 | AM_CONDITIONAL(HAVE_PTHREAD, $have_pthread) |
| 126 | |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 127 | dnl ========================================================================== |
| 128 | |
Behdad Esfahbod | 68c75b4 | 2012-06-05 19:55:46 -0400 | [diff] [blame] | 129 | have_ot=true |
| 130 | if $have_ot; then |
| 131 | AC_DEFINE(HAVE_OT, 1, [Have native OpenType Layout backend]) |
| 132 | fi |
| 133 | AM_CONDITIONAL(HAVE_OT, $have_ot) |
| 134 | |
Konstantin Ritt | c9522de | 2014-01-22 21:07:13 +0200 | [diff] [blame] | 135 | have_fallback=true |
| 136 | if $have_fallback; then |
| 137 | AC_DEFINE(HAVE_FALLBACK, 1, [Have simple TrueType Layout backend]) |
| 138 | fi |
| 139 | AM_CONDITIONAL(HAVE_FALLBACK, $have_fallback) |
| 140 | |
Behdad Esfahbod | 68c75b4 | 2012-06-05 19:55:46 -0400 | [diff] [blame] | 141 | dnl =========================================================================== |
| 142 | |
Behdad Esfahbod | ab2af17 | 2013-05-27 19:27:43 -0400 | [diff] [blame] | 143 | AC_ARG_WITH(glib, |
| 144 | [AS_HELP_STRING([--with-glib=@<:@yes/no/auto@:>@], |
Behdad Esfahbod | 5e25eb7 | 2013-05-27 19:30:48 -0400 | [diff] [blame] | 145 | [Use glib @<:@default=auto@:>@])],, |
| 146 | [with_glib=auto]) |
Behdad Esfahbod | ab2af17 | 2013-05-27 19:27:43 -0400 | [diff] [blame] | 147 | have_glib=false |
| 148 | if test "x$with_glib" = "xyes" -o "x$with_glib" = "xauto"; then |
Behdad Esfahbod | 270cfd7 | 2013-06-06 18:57:15 -0400 | [diff] [blame] | 149 | PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, have_glib=true, :) |
Behdad Esfahbod | ab2af17 | 2013-05-27 19:27:43 -0400 | [diff] [blame] | 150 | fi |
| 151 | if test "x$with_glib" = "xyes" -a "x$have_glib" != "xtrue"; then |
| 152 | AC_MSG_ERROR([glib support requested but glib-2.0 not found]) |
| 153 | fi |
Behdad Esfahbod | f94cf6b | 2009-11-02 18:55:19 -0500 | [diff] [blame] | 154 | if $have_glib; then |
Behdad Esfahbod | d94647e | 2009-11-03 16:35:10 -0500 | [diff] [blame] | 155 | AC_DEFINE(HAVE_GLIB, 1, [Have glib2 library]) |
Behdad Esfahbod | f94cf6b | 2009-11-02 18:55:19 -0500 | [diff] [blame] | 156 | fi |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 157 | AM_CONDITIONAL(HAVE_GLIB, $have_glib) |
| 158 | |
Behdad Esfahbod | 71ef22b | 2013-08-28 12:52:55 -0400 | [diff] [blame] | 159 | dnl =========================================================================== |
| 160 | |
Behdad Esfahbod | 71439a8 | 2013-08-26 20:56:58 -0400 | [diff] [blame] | 161 | AC_ARG_WITH(gobject, |
| 162 | [AS_HELP_STRING([--with-gobject=@<:@yes/no/auto@:>@], |
| 163 | [Use gobject @<:@default=auto@:>@])],, |
Behdad Esfahbod | 71ef22b | 2013-08-28 12:52:55 -0400 | [diff] [blame] | 164 | [with_gobject=no]) |
Behdad Esfahbod | ab2af17 | 2013-05-27 19:27:43 -0400 | [diff] [blame] | 165 | have_gobject=false |
Behdad Esfahbod | 71439a8 | 2013-08-26 20:56:58 -0400 | [diff] [blame] | 166 | if test "x$with_gobject" = "xyes" -o "x$with_gobject" = "xauto"; then |
| 167 | PKG_CHECK_MODULES(GOBJECT, gobject-2.0 glib-2.0, have_gobject=true, :) |
| 168 | fi |
| 169 | if test "x$with_gobject" = "xyes" -a "x$have_gobject" != "xtrue"; then |
| 170 | AC_MSG_ERROR([gobject support requested but gobject-2.0 / glib-2.0 not found]) |
Behdad Esfahbod | ab2af17 | 2013-05-27 19:27:43 -0400 | [diff] [blame] | 171 | fi |
Behdad Esfahbod | c214cff | 2011-08-14 15:17:16 +0200 | [diff] [blame] | 172 | if $have_gobject; then |
| 173 | AC_DEFINE(HAVE_GOBJECT, 1, [Have gobject2 library]) |
Behdad Esfahbod | d75333f | 2011-08-19 19:59:24 +0200 | [diff] [blame] | 174 | GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` |
| 175 | AC_SUBST(GLIB_MKENUMS) |
Behdad Esfahbod | c214cff | 2011-08-14 15:17:16 +0200 | [diff] [blame] | 176 | fi |
| 177 | AM_CONDITIONAL(HAVE_GOBJECT, $have_gobject) |
| 178 | |
Behdad Esfahbod | ca65326 | 2013-05-27 19:09:50 -0400 | [diff] [blame] | 179 | dnl =========================================================================== |
| 180 | |
Behdad Esfahbod | 71ef22b | 2013-08-28 12:52:55 -0400 | [diff] [blame] | 181 | |
| 182 | dnl =========================================================================== |
| 183 | # Gobject-Introspection |
| 184 | have_introspection=false |
| 185 | m4_ifdef([GOBJECT_INTROSPECTION_CHECK], [ |
| 186 | if $have_gobject; then |
Behdad Esfahbod | 50a0053 | 2014-04-10 16:03:29 -0700 | [diff] [blame] | 187 | GOBJECT_INTROSPECTION_CHECK([1.34.0]) |
Behdad Esfahbod | 71ef22b | 2013-08-28 12:52:55 -0400 | [diff] [blame] | 188 | if test "x$found_introspection" = xyes; then |
| 189 | have_introspection=true |
| 190 | fi |
| 191 | else |
| 192 | AM_CONDITIONAL([HAVE_INTROSPECTION], false) |
| 193 | fi |
| 194 | ], [ |
| 195 | AM_CONDITIONAL([HAVE_INTROSPECTION], false) |
| 196 | ]) |
| 197 | |
| 198 | dnl =========================================================================== |
| 199 | |
Behdad Esfahbod | ca65326 | 2013-05-27 19:09:50 -0400 | [diff] [blame] | 200 | have_ucdn=true |
Behdad Esfahbod | 58db2c2 | 2013-05-27 19:10:33 -0400 | [diff] [blame] | 201 | if $have_glib; then |
| 202 | have_ucdn=false |
| 203 | fi |
Behdad Esfahbod | ca65326 | 2013-05-27 19:09:50 -0400 | [diff] [blame] | 204 | if $have_ucdn; then |
| 205 | AC_DEFINE(HAVE_UCDN, 1, [Have UCDN Unicode functions]) |
| 206 | fi |
| 207 | AM_CONDITIONAL(HAVE_UCDN, $have_ucdn) |
| 208 | |
Behdad Esfahbod | 174e3fe | 2011-05-05 19:37:53 -0400 | [diff] [blame] | 209 | dnl ========================================================================== |
| 210 | |
Behdad Esfahbod | f8087ff | 2013-05-27 19:43:48 -0400 | [diff] [blame] | 211 | AC_ARG_WITH(cairo, |
| 212 | [AS_HELP_STRING([--with-cairo=@<:@yes/no/auto@:>@], |
| 213 | [Use cairo @<:@default=auto@:>@])],, |
| 214 | [with_cairo=auto]) |
| 215 | have_cairo=false |
| 216 | if test "x$with_cairo" = "xyes" -o "x$with_cairo" = "xauto"; then |
Behdad Esfahbod | 270cfd7 | 2013-06-06 18:57:15 -0400 | [diff] [blame] | 217 | PKG_CHECK_MODULES(CAIRO, cairo >= 1.8.0, have_cairo=true, :) |
Behdad Esfahbod | f8087ff | 2013-05-27 19:43:48 -0400 | [diff] [blame] | 218 | fi |
| 219 | if test "x$with_cairo" = "xyes" -a "x$have_cairo" != "xtrue"; then |
| 220 | AC_MSG_ERROR([cairo support requested but not found]) |
| 221 | fi |
Behdad Esfahbod | 5353bf4 | 2011-02-22 18:06:19 -0500 | [diff] [blame] | 222 | if $have_cairo; then |
| 223 | AC_DEFINE(HAVE_CAIRO, 1, [Have cairo graphics library]) |
| 224 | fi |
| 225 | AM_CONDITIONAL(HAVE_CAIRO, $have_cairo) |
| 226 | |
Behdad Esfahbod | f8087ff | 2013-05-27 19:43:48 -0400 | [diff] [blame] | 227 | have_cairo_ft=false |
| 228 | if $have_cairo; then |
Behdad Esfahbod | 270cfd7 | 2013-06-06 18:57:15 -0400 | [diff] [blame] | 229 | PKG_CHECK_MODULES(CAIRO_FT, cairo-ft, have_cairo_ft=true, :) |
Behdad Esfahbod | f8087ff | 2013-05-27 19:43:48 -0400 | [diff] [blame] | 230 | fi |
Behdad Esfahbod | 5353bf4 | 2011-02-22 18:06:19 -0500 | [diff] [blame] | 231 | if $have_cairo_ft; then |
| 232 | AC_DEFINE(HAVE_CAIRO_FT, 1, [Have cairo-ft support in cairo graphics library]) |
| 233 | fi |
| 234 | AM_CONDITIONAL(HAVE_CAIRO_FT, $have_cairo_ft) |
| 235 | |
Behdad Esfahbod | 174e3fe | 2011-05-05 19:37:53 -0400 | [diff] [blame] | 236 | dnl ========================================================================== |
| 237 | |
Behdad Esfahbod | fe97b65 | 2014-08-06 16:49:51 -0400 | [diff] [blame] | 238 | AC_ARG_WITH(fontconfig, |
| 239 | [AS_HELP_STRING([--with-fontconfig=@<:@yes/no/auto@:>@], |
| 240 | [Use fontconfig @<:@default=auto@:>@])],, |
| 241 | [with_fontconfig=auto]) |
| 242 | have_fontconfig=false |
| 243 | if test "x$with_fontconfig" = "xyes" -o "x$with_fontconfig" = "xauto"; then |
| 244 | PKG_CHECK_MODULES(FONTCONFIG, fontconfig, have_fontconfig=true, :) |
| 245 | fi |
| 246 | if test "x$with_fontconfig" = "xyes" -a "x$have_fontconfig" != "xtrue"; then |
| 247 | AC_MSG_ERROR([fontconfig support requested but not found]) |
| 248 | fi |
| 249 | if $have_fontconfig; then |
| 250 | AC_DEFINE(HAVE_FONTCONFIG, 1, [Have fontconfig library]) |
| 251 | fi |
| 252 | AM_CONDITIONAL(HAVE_FONTCONFIG, $have_fontconfig) |
| 253 | |
| 254 | dnl ========================================================================== |
| 255 | |
Behdad Esfahbod | 932b747 | 2013-05-27 19:04:40 -0400 | [diff] [blame] | 256 | AC_ARG_WITH(icu, |
| 257 | [AS_HELP_STRING([--with-icu=@<:@yes/no/auto@:>@], |
| 258 | [Use ICU @<:@default=auto@:>@])],, |
| 259 | [with_icu=auto]) |
| 260 | have_icu=false |
| 261 | if test "x$with_icu" = "xyes" -o "x$with_icu" = "xauto"; then |
Behdad Esfahbod | 570bccc | 2013-06-10 13:56:51 -0400 | [diff] [blame] | 262 | PKG_CHECK_MODULES(ICU, icu-uc, have_icu=true, :) |
Behdad Esfahbod | 932b747 | 2013-05-27 19:04:40 -0400 | [diff] [blame] | 263 | |
| 264 | dnl Fallback to icu-config if ICU pkg-config files could not be found |
| 265 | if test "$have_icu" != "true"; then |
| 266 | AC_CHECK_TOOL(ICU_CONFIG, icu-config, no) |
| 267 | AC_MSG_CHECKING([for ICU by using icu-config fallback]) |
| 268 | if test "$ICU_CONFIG" != "no" && "$ICU_CONFIG" --version >/dev/null; then |
| 269 | have_icu=true |
| 270 | # We don't use --cflags as this gives us a lot of things that we don't |
| 271 | # necessarily want, like debugging and optimization flags |
| 272 | # See man (1) icu-config for more info. |
| 273 | ICU_CFLAGS=`$ICU_CONFIG --cppflags` |
| 274 | ICU_LIBS=`$ICU_CONFIG --ldflags-searchpath --ldflags-libsonly` |
| 275 | AC_SUBST(ICU_CFLAGS) |
| 276 | AC_SUBST(ICU_LIBS) |
| 277 | AC_MSG_RESULT([yes]) |
| 278 | else |
| 279 | AC_MSG_RESULT([no]) |
| 280 | fi |
Behdad Esfahbod | 14cfab5 | 2013-03-11 19:53:44 -0400 | [diff] [blame] | 281 | fi |
| 282 | fi |
Behdad Esfahbod | 932b747 | 2013-05-27 19:04:40 -0400 | [diff] [blame] | 283 | if test "x$with_icu" = "xyes" -a "x$have_icu" != "xtrue"; then |
| 284 | AC_MSG_ERROR([icu support requested but icu-uc not found]) |
| 285 | fi |
Behdad Esfahbod | d94647e | 2009-11-03 16:35:10 -0500 | [diff] [blame] | 286 | if $have_icu; then |
Behdad Esfahbod | e5dbf39 | 2013-01-07 17:34:24 -0600 | [diff] [blame] | 287 | CXXFLAGS="$CXXFLAGS `$PKG_CONFIG --variable=CXXFLAGS icu-uc`" |
Behdad Esfahbod | d94647e | 2009-11-03 16:35:10 -0500 | [diff] [blame] | 288 | AC_DEFINE(HAVE_ICU, 1, [Have ICU library]) |
| 289 | fi |
| 290 | AM_CONDITIONAL(HAVE_ICU, $have_icu) |
| 291 | |
Behdad Esfahbod | 4637739 | 2011-08-24 02:12:05 +0200 | [diff] [blame] | 292 | dnl ========================================================================== |
Behdad Esfahbod | 1f49cf3 | 2011-08-24 01:29:25 +0200 | [diff] [blame] | 293 | |
Behdad Esfahbod | 5a78d23 | 2013-05-27 18:47:58 -0400 | [diff] [blame] | 294 | AC_ARG_WITH(graphite2, |
| 295 | [AS_HELP_STRING([--with-graphite2=@<:@yes/no/auto@:>@], |
| 296 | [Use the graphite2 library @<:@default=no@:>@])],, |
| 297 | [with_graphite2=no]) |
| 298 | have_graphite2=false |
| 299 | if test "x$with_graphite2" = "xyes" -o "x$with_graphite2" = "xauto"; then |
Behdad Esfahbod | 270cfd7 | 2013-06-06 18:57:15 -0400 | [diff] [blame] | 300 | PKG_CHECK_MODULES(GRAPHITE2, graphite2, have_graphite2=true, :) |
Behdad Esfahbod | 1f49cf3 | 2011-08-24 01:29:25 +0200 | [diff] [blame] | 301 | fi |
Behdad Esfahbod | 5a78d23 | 2013-05-27 18:47:58 -0400 | [diff] [blame] | 302 | if test "x$with_graphite2" = "xyes" -a "x$have_graphite2" != "xtrue"; then |
| 303 | AC_MSG_ERROR([graphite2 support requested but libgraphite2 not found]) |
| 304 | fi |
| 305 | if $have_graphite2; then |
Behdad Esfahbod | 9a3b748 | 2014-12-28 17:27:39 -0800 | [diff] [blame] | 306 | AC_DEFINE(HAVE_GRAPHITE2, 1, [Have Graphite2 library]) |
Behdad Esfahbod | 5a78d23 | 2013-05-27 18:47:58 -0400 | [diff] [blame] | 307 | fi |
| 308 | AM_CONDITIONAL(HAVE_GRAPHITE2, $have_graphite2) |
Behdad Esfahbod | 4637739 | 2011-08-24 02:12:05 +0200 | [diff] [blame] | 309 | |
| 310 | dnl ========================================================================== |
Behdad Esfahbod | 174e3fe | 2011-05-05 19:37:53 -0400 | [diff] [blame] | 311 | |
Behdad Esfahbod | 82eddfe | 2013-05-27 19:33:36 -0400 | [diff] [blame] | 312 | AC_ARG_WITH(freetype, |
| 313 | [AS_HELP_STRING([--with-freetype=@<:@yes/no/auto@:>@], |
| 314 | [Use the FreeType library @<:@default=auto@:>@])],, |
| 315 | [with_freetype=auto]) |
| 316 | have_freetype=false |
| 317 | if test "x$with_freetype" = "xyes" -o "x$with_freetype" = "xauto"; then |
Behdad Esfahbod | 350f3a0 | 2014-12-28 17:44:26 -0800 | [diff] [blame] | 318 | # See freetype/docs/VERSION.DLL; 12.0.6 means freetype-2.4.2 |
| 319 | PKG_CHECK_MODULES(FREETYPE, freetype2 >= 12.0.6, have_freetype=true, :) |
Behdad Esfahbod | 82eddfe | 2013-05-27 19:33:36 -0400 | [diff] [blame] | 320 | fi |
| 321 | if test "x$with_freetype" = "xyes" -a "x$have_freetype" != "xtrue"; then |
| 322 | AC_MSG_ERROR([FreeType support requested but libfreetype2 not found]) |
| 323 | fi |
Behdad Esfahbod | f94cf6b | 2009-11-02 18:55:19 -0500 | [diff] [blame] | 324 | if $have_freetype; then |
| 325 | AC_DEFINE(HAVE_FREETYPE, 1, [Have FreeType 2 library]) |
| 326 | fi |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 327 | AM_CONDITIONAL(HAVE_FREETYPE, $have_freetype) |
| 328 | |
Behdad Esfahbod | c78f448 | 2011-05-05 21:31:04 -0400 | [diff] [blame] | 329 | dnl =========================================================================== |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 330 | |
Behdad Esfahbod | ab2af17 | 2013-05-27 19:27:43 -0400 | [diff] [blame] | 331 | AC_ARG_WITH(uniscribe, |
| 332 | [AS_HELP_STRING([--with-uniscribe=@<:@yes/no/auto@:>@], |
| 333 | [Use the Uniscribe library @<:@default=no@:>@])],, |
| 334 | [with_uniscribe=no]) |
| 335 | have_uniscribe=false |
| 336 | if test "x$with_uniscribe" = "xyes" -o "x$with_uniscribe" = "xauto"; then |
Behdad Esfahbod | 2a17f95 | 2013-05-28 13:10:51 -0400 | [diff] [blame] | 337 | AC_CHECK_HEADERS(usp10.h windows.h, have_uniscribe=true) |
Behdad Esfahbod | ab2af17 | 2013-05-27 19:27:43 -0400 | [diff] [blame] | 338 | fi |
| 339 | if test "x$with_uniscribe" = "xyes" -a "x$have_uniscribe" != "xtrue"; then |
| 340 | AC_MSG_ERROR([uniscribe support requested but not found]) |
| 341 | fi |
Behdad Esfahbod | 0fbb2dc | 2011-08-03 19:55:04 -0400 | [diff] [blame] | 342 | if $have_uniscribe; then |
| 343 | UNISCRIBE_CFLAGS= |
Behdad Esfahbod | 8ac2e88 | 2013-07-21 16:06:49 -0400 | [diff] [blame] | 344 | UNISCRIBE_LIBS="-lusp10 -lgdi32 -lrpcrt4" |
Behdad Esfahbod | 0fbb2dc | 2011-08-03 19:55:04 -0400 | [diff] [blame] | 345 | AC_SUBST(UNISCRIBE_CFLAGS) |
| 346 | AC_SUBST(UNISCRIBE_LIBS) |
Behdad Esfahbod | ab2af17 | 2013-05-27 19:27:43 -0400 | [diff] [blame] | 347 | AC_DEFINE(HAVE_UNISCRIBE, 1, [Have Uniscribe library]) |
Behdad Esfahbod | 0fbb2dc | 2011-08-03 19:55:04 -0400 | [diff] [blame] | 348 | fi |
| 349 | AM_CONDITIONAL(HAVE_UNISCRIBE, $have_uniscribe) |
| 350 | |
Behdad Esfahbod | 04bc1ee | 2012-06-05 20:16:56 -0400 | [diff] [blame] | 351 | dnl =========================================================================== |
| 352 | |
Behdad Esfahbod | eb63e78 | 2013-05-27 19:29:09 -0400 | [diff] [blame] | 353 | AC_ARG_WITH(coretext, |
| 354 | [AS_HELP_STRING([--with-coretext=@<:@yes/no/auto@:>@], |
| 355 | [Use CoreText @<:@default=no@:>@])],, |
| 356 | [with_coretext=no]) |
| 357 | have_coretext=false |
| 358 | if test "x$with_coretext" = "xyes" -o "x$with_coretext" = "xauto"; then |
| 359 | AC_CHECK_TYPE(CTFontRef, have_coretext=true,, [#include <ApplicationServices/ApplicationServices.h>]) |
Konstantin Ritt | b96af03 | 2014-03-20 16:01:30 +0200 | [diff] [blame] | 360 | |
| 361 | if $have_coretext; then |
| 362 | CORETEXT_CFLAGS= |
| 363 | CORETEXT_LIBS="-framework ApplicationServices" |
| 364 | AC_SUBST(CORETEXT_CFLAGS) |
| 365 | AC_SUBST(CORETEXT_LIBS) |
| 366 | else |
| 367 | # On iOS CoreText and CoreGraphics are stand-alone frameworks |
| 368 | if test "x$have_coretext" != "xtrue"; then |
| 369 | AC_CHECK_TYPE(CTFontRef, have_coretext=true,, [#include <CoreText/CoreText.h>]) |
| 370 | fi |
| 371 | |
| 372 | if $have_coretext; then |
| 373 | CORETEXT_CFLAGS= |
| 374 | CORETEXT_LIBS="-framework CoreText -framework CoreGraphics" |
| 375 | AC_SUBST(CORETEXT_CFLAGS) |
| 376 | AC_SUBST(CORETEXT_LIBS) |
| 377 | fi |
| 378 | fi |
Behdad Esfahbod | eb63e78 | 2013-05-27 19:29:09 -0400 | [diff] [blame] | 379 | fi |
| 380 | if test "x$with_coretext" = "xyes" -a "x$have_coretext" != "xtrue"; then |
| 381 | AC_MSG_ERROR([CoreText support requested but libcoretext not found]) |
| 382 | fi |
Jonathan Kew | aa6d849 | 2012-07-24 15:52:32 -0400 | [diff] [blame] | 383 | if $have_coretext; then |
Jonathan Kew | aa6d849 | 2012-07-24 15:52:32 -0400 | [diff] [blame] | 384 | AC_DEFINE(HAVE_CORETEXT, 1, [Have Core Text backend]) |
| 385 | fi |
| 386 | AM_CONDITIONAL(HAVE_CORETEXT, $have_coretext) |
| 387 | |
| 388 | dnl =========================================================================== |
| 389 | |
Behdad Esfahbod | 04bc1ee | 2012-06-05 20:16:56 -0400 | [diff] [blame] | 390 | AC_CACHE_CHECK([for Intel atomic primitives], hb_cv_have_intel_atomic_primitives, [ |
| 391 | hb_cv_have_intel_atomic_primitives=false |
Behdad Esfahbod | 12f5c0a | 2012-06-26 11:16:13 -0400 | [diff] [blame] | 392 | AC_TRY_LINK([ |
Behdad Esfahbod | 04bc1ee | 2012-06-05 20:16:56 -0400 | [diff] [blame] | 393 | void memory_barrier (void) { __sync_synchronize (); } |
Behdad Esfahbod | 12f5c0a | 2012-06-26 11:16:13 -0400 | [diff] [blame] | 394 | int atomic_add (int *i) { return __sync_fetch_and_add (i, 1); } |
| 395 | int mutex_trylock (int *m) { return __sync_lock_test_and_set (m, 1); } |
| 396 | void mutex_unlock (int *m) { __sync_lock_release (m); } |
| 397 | ], [], hb_cv_have_intel_atomic_primitives=true |
Behdad Esfahbod | 04bc1ee | 2012-06-05 20:16:56 -0400 | [diff] [blame] | 398 | ) |
| 399 | ]) |
| 400 | if $hb_cv_have_intel_atomic_primitives; then |
| 401 | AC_DEFINE(HAVE_INTEL_ATOMIC_PRIMITIVES, 1, [Have Intel __sync_* atomic primitives]) |
| 402 | fi |
| 403 | |
| 404 | dnl =========================================================================== |
| 405 | |
Behdad Esfahbod | 2dcb333 | 2013-01-10 01:17:59 -0600 | [diff] [blame] | 406 | AC_CACHE_CHECK([for Solaris atomic operations], hb_cv_have_solaris_atomic_ops, [ |
| 407 | hb_cv_have_solaris_atomic_ops=false |
| 408 | AC_TRY_LINK([ |
| 409 | #include <atomic.h> |
| 410 | /* This requires Solaris Studio 12.2 or newer: */ |
| 411 | #include <mbarrier.h> |
| 412 | void memory_barrier (void) { __machine_rw_barrier (); } |
| 413 | int atomic_add (volatile unsigned *i) { return atomic_add_int_nv (i, 1); } |
| 414 | void *atomic_ptr_cmpxchg (volatile void **target, void *cmp, void *newval) { return atomic_cas_ptr (target, cmp, newval); } |
| 415 | ], [], hb_cv_have_solaris_atomic_ops=true |
| 416 | ) |
| 417 | ]) |
| 418 | if $hb_cv_have_solaris_atomic_ops; then |
| 419 | AC_DEFINE(HAVE_SOLARIS_ATOMIC_OPS, 1, [Have Solaris __machine_*_barrier and atomic_* operations]) |
| 420 | fi |
| 421 | |
| 422 | if test "$os_win32" = no && ! $have_pthread; then |
| 423 | AC_CHECK_HEADERS(sched.h) |
| 424 | AC_SEARCH_LIBS(sched_yield,rt,AC_DEFINE(HAVE_SCHED_YIELD, 1, [Have sched_yield])) |
| 425 | fi |
| 426 | |
| 427 | dnl =========================================================================== |
| 428 | |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 429 | AC_CONFIG_FILES([ |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 430 | Makefile |
| 431 | src/Makefile |
Behdad Esfahbod | c78f448 | 2011-05-05 21:31:04 -0400 | [diff] [blame] | 432 | src/hb-version.h |
Behdad Esfahbod | 3f33f0d | 2012-10-02 16:03:18 -0400 | [diff] [blame] | 433 | src/hb-ucdn/Makefile |
Behdad Esfahbod | 511a136 | 2011-08-09 15:03:00 +0200 | [diff] [blame] | 434 | util/Makefile |
Behdad Esfahbod | bbdeff5 | 2011-04-07 16:05:07 -0400 | [diff] [blame] | 435 | test/Makefile |
Behdad Esfahbod | 4d6dafd | 2012-01-19 14:52:02 -0500 | [diff] [blame] | 436 | test/api/Makefile |
Behdad Esfahbod | d4de562 | 2012-01-19 15:21:04 -0500 | [diff] [blame] | 437 | test/shaping/Makefile |
Anthony Carrico | f7c72b4 | 2013-02-24 13:00:33 -0500 | [diff] [blame] | 438 | docs/Makefile |
| 439 | docs/reference/Makefile |
Behdad Esfahbod | a2a2823 | 2013-08-30 19:38:47 -0400 | [diff] [blame] | 440 | docs/reference/version.xml |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 441 | ]) |
| 442 | |
| 443 | AC_OUTPUT |
Behdad Esfahbod | d16ddbc | 2012-12-20 01:02:36 -0500 | [diff] [blame] | 444 | |
| 445 | AC_MSG_NOTICE([ |
| 446 | |
| 447 | Build configuration: |
| 448 | |
| 449 | Unicode callbacks (you want at least one): |
| 450 | Glib: ${have_glib} |
| 451 | ICU: ${have_icu} |
| 452 | UCDN: ${have_ucdn} |
| 453 | |
| 454 | Font callbacks (the more the better): |
| 455 | FreeType: ${have_freetype} |
| 456 | |
| 457 | Tools used for command-line utilities: |
| 458 | Cairo: ${have_cairo} |
Behdad Esfahbod | fe97b65 | 2014-08-06 16:49:51 -0400 | [diff] [blame] | 459 | Fontconfig: ${have_fontconfig} |
Behdad Esfahbod | d16ddbc | 2012-12-20 01:02:36 -0500 | [diff] [blame] | 460 | |
| 461 | Additional shapers (the more the better): |
Behdad Esfahbod | 5a78d23 | 2013-05-27 18:47:58 -0400 | [diff] [blame] | 462 | Graphite2: ${have_graphite2} |
Behdad Esfahbod | d16ddbc | 2012-12-20 01:02:36 -0500 | [diff] [blame] | 463 | |
Behdad Esfahbod | ac1b723 | 2013-08-30 19:32:10 -0400 | [diff] [blame] | 464 | Platform shapers (not normally needed): |
Behdad Esfahbod | d16ddbc | 2012-12-20 01:02:36 -0500 | [diff] [blame] | 465 | CoreText: ${have_coretext} |
Behdad Esfahbod | d16ddbc | 2012-12-20 01:02:36 -0500 | [diff] [blame] | 466 | Uniscribe: ${have_uniscribe} |
Anthony Carrico | f7c72b4 | 2013-02-24 13:00:33 -0500 | [diff] [blame] | 467 | |
Behdad Esfahbod | 23027f7 | 2013-08-22 19:03:21 -0400 | [diff] [blame] | 468 | Other features: |
Behdad Esfahbod | 71ef22b | 2013-08-28 12:52:55 -0400 | [diff] [blame] | 469 | Documentation: ${have_gtk_doc} |
Behdad Esfahbod | 71439a8 | 2013-08-26 20:56:58 -0400 | [diff] [blame] | 470 | GObject bindings: ${have_gobject} |
Behdad Esfahbod | 71ef22b | 2013-08-28 12:52:55 -0400 | [diff] [blame] | 471 | Introspection: ${have_introspection} |
Behdad Esfahbod | d16ddbc | 2012-12-20 01:02:36 -0500 | [diff] [blame] | 472 | ]) |