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 | 05686b5 | 2013-02-25 18:19:20 -0500 | [diff] [blame] | 3 | [0.9.13], |
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 | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 9 | AC_CONFIG_SRCDIR([harfbuzz.pc.in]) |
| 10 | AC_CONFIG_HEADERS([config.h]) |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 11 | |
Behdad Esfahbod | 52d66c2 | 2013-02-04 23:31:24 -0500 | [diff] [blame] | 12 | AM_INIT_AUTOMAKE([1.11.1 gnits dist-bzip2 no-dist-gzip -Wall no-define color-tests]) |
Javier Jardón | 2abe126 | 2011-01-09 22:18:53 -0500 | [diff] [blame] | 13 | AM_SILENT_RULES([yes]) |
| 14 | |
Behdad Esfahbod | c62e41b | 2012-01-27 02:20:58 -0500 | [diff] [blame] | 15 | # Initialize libtool |
Behdad Esfahbod | a8ac1d3 | 2013-03-06 20:05:34 -0500 | [diff] [blame] | 16 | AM_PROG_AR |
Behdad Esfahbod | c62e41b | 2012-01-27 02:20:58 -0500 | [diff] [blame] | 17 | LT_PREREQ([2.2]) |
| 18 | LT_INIT([disable-static]) |
| 19 | |
Javier Jardón | 2abe126 | 2011-01-09 22:18:53 -0500 | [diff] [blame] | 20 | # Check for programs |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 21 | AC_PROG_CC |
Behdad Esfahbod | 0109816 | 2010-10-05 18:36:45 -0400 | [diff] [blame] | 22 | AM_PROG_CC_C_O |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 23 | AC_PROG_CXX |
Behdad Esfahbod | c7afac0 | 2012-10-02 14:44:47 -0400 | [diff] [blame] | 24 | PKG_PROG_PKG_CONFIG([0.20]) |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 25 | |
Behdad Esfahbod | c78f448 | 2011-05-05 21:31:04 -0400 | [diff] [blame] | 26 | # Version |
Behdad Esfahbod | 329c157 | 2011-05-25 16:07:07 -0400 | [diff] [blame] | 27 | m4_define(hb_version_triplet,m4_split(AC_PACKAGE_VERSION,[[.]])) |
| 28 | m4_define(hb_version_major,m4_argn(1,hb_version_triplet)) |
| 29 | m4_define(hb_version_minor,m4_argn(2,hb_version_triplet)) |
| 30 | m4_define(hb_version_micro,m4_argn(3,hb_version_triplet)) |
| 31 | HB_VERSION_MAJOR=hb_version_major |
| 32 | HB_VERSION_MINOR=hb_version_minor |
| 33 | HB_VERSION_MICRO=hb_version_micro |
Behdad Esfahbod | c78f448 | 2011-05-05 21:31:04 -0400 | [diff] [blame] | 34 | HB_VERSION=AC_PACKAGE_VERSION |
Behdad Esfahbod | c78f448 | 2011-05-05 21:31:04 -0400 | [diff] [blame] | 35 | AC_SUBST(HB_VERSION_MAJOR) |
| 36 | AC_SUBST(HB_VERSION_MINOR) |
| 37 | AC_SUBST(HB_VERSION_MICRO) |
| 38 | AC_SUBST(HB_VERSION) |
| 39 | |
Behdad Esfahbod | 329c157 | 2011-05-25 16:07:07 -0400 | [diff] [blame] | 40 | # Libtool version |
| 41 | m4_define([hb_version_int], |
| 42 | m4_eval(hb_version_major*10000 + hb_version_minor*100 + hb_version_micro)) |
| 43 | m4_if(m4_eval(hb_version_minor % 2), [1], |
| 44 | dnl for unstable releases |
| 45 | [m4_define([hb_libtool_revision], 0)], |
| 46 | dnl for stable releases |
| 47 | [m4_define([hb_libtool_revision], hb_version_micro)]) |
| 48 | m4_define([hb_libtool_age], |
| 49 | m4_eval(hb_version_int - hb_libtool_revision)) |
| 50 | m4_define([hb_libtool_current], |
| 51 | m4_eval(hb_version_major + hb_libtool_age)) |
| 52 | HB_LIBTOOL_VERSION_INFO=hb_libtool_current:hb_libtool_revision:hb_libtool_age |
| 53 | AC_SUBST(HB_LIBTOOL_VERSION_INFO) |
Behdad Esfahbod | c78f448 | 2011-05-05 21:31:04 -0400 | [diff] [blame] | 54 | |
Behdad Esfahbod | 8c0ea7b | 2012-06-24 13:20:56 -0400 | [diff] [blame] | 55 | dnl GOBJECT_INTROSPECTION_CHECK([0.9.0]) |
Behdad Esfahbod | 95ab82a | 2012-01-15 14:56:56 -0500 | [diff] [blame] | 56 | dnl GTK_DOC_CHECK([1.15],[--flavour no-tmpl]) |
Behdad Esfahbod | b9b10ad | 2011-09-13 13:30:39 -0400 | [diff] [blame] | 57 | |
Behdad Esfahbod | 174e3fe | 2011-05-05 19:37:53 -0400 | [diff] [blame] | 58 | # Functions and headers |
Behdad Esfahbod | e2aab4b | 2013-02-12 15:35:32 -0500 | [diff] [blame] | 59 | AC_CHECK_FUNCS(atexit mprotect sysconf getpagesize mmap isatty) |
| 60 | AC_CHECK_HEADERS(unistd.h sys/mman.h) |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 61 | |
Behdad Esfahbod | 174e3fe | 2011-05-05 19:37:53 -0400 | [diff] [blame] | 62 | # Compiler flags |
Behdad Esfahbod | c78f448 | 2011-05-05 21:31:04 -0400 | [diff] [blame] | 63 | AC_CANONICAL_HOST |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 64 | if test "x$GCC" = "xyes"; then |
Behdad Esfahbod | 5b7f389 | 2011-04-27 15:10:12 -0400 | [diff] [blame] | 65 | |
Behdad Esfahbod | 71cef14 | 2011-05-06 19:30:59 -0400 | [diff] [blame] | 66 | # Make symbols link locally |
| 67 | LDFLAGS="$LDFLAGS -Bsymbolic-functions" |
| 68 | |
Behdad Esfahbod | 5b7f389 | 2011-04-27 15:10:12 -0400 | [diff] [blame] | 69 | # Make sure we don't link to libstdc++ |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 70 | CXXFLAGS="$CXXFLAGS -fno-rtti -fno-exceptions" |
Behdad Esfahbod | 5b7f389 | 2011-04-27 15:10:12 -0400 | [diff] [blame] | 71 | |
Behdad Esfahbod | 11c4ad4 | 2012-07-13 11:29:31 -0400 | [diff] [blame] | 72 | # Assorted warnings |
| 73 | CXXFLAGS="$CXXFLAGS -Wcast-align" |
| 74 | |
Behdad Esfahbod | 5b7f389 | 2011-04-27 15:10:12 -0400 | [diff] [blame] | 75 | case "$host" in |
Behdad Esfahbod | 560d68a | 2012-08-08 17:16:01 -0400 | [diff] [blame] | 76 | *-*-mingw*) |
Behdad Esfahbod | e3320ec | 2012-08-06 11:44:10 -0700 | [diff] [blame] | 77 | ;; |
| 78 | *) |
| 79 | # Hide inline methods |
| 80 | CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden" |
| 81 | ;; |
| 82 | esac |
| 83 | |
| 84 | case "$host" in |
Behdad Esfahbod | 5b7f389 | 2011-04-27 15:10:12 -0400 | [diff] [blame] | 85 | arm-*-*) |
| 86 | # Request byte alignment on arm |
| 87 | CXXFLAGS="$CXXFLAGS -mstructure-size-boundary=8" |
| 88 | ;; |
| 89 | esac |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 90 | fi |
| 91 | |
Behdad Esfahbod | e784632 | 2013-01-14 00:27:21 -0600 | [diff] [blame] | 92 | AM_CONDITIONAL(HAVE_GCC, test "x$GCC" = "xyes") |
| 93 | |
Behdad Esfahbod | 0e292eb | 2012-10-02 14:59:00 -0400 | [diff] [blame] | 94 | hb_os_win32=no |
Behdad Esfahbod | 560d68a | 2012-08-08 17:16:01 -0400 | [diff] [blame] | 95 | AC_MSG_CHECKING([for native Win32]) |
| 96 | case "$host" in |
| 97 | *-*-mingw*) |
| 98 | hb_os_win32=yes |
| 99 | ;; |
Behdad Esfahbod | 560d68a | 2012-08-08 17:16:01 -0400 | [diff] [blame] | 100 | esac |
| 101 | AC_MSG_RESULT([$hb_os_win32]) |
| 102 | AM_CONDITIONAL(OS_WIN32, test "$hb_os_win32" = "yes") |
| 103 | |
Behdad Esfahbod | 66efe89 | 2012-10-02 14:55:32 -0400 | [diff] [blame] | 104 | have_pthread=false |
Behdad Esfahbod | 0e292eb | 2012-10-02 14:59:00 -0400 | [diff] [blame] | 105 | if test "$hb_os_win32" = no; then |
| 106 | AX_PTHREAD([have_pthread=true]) |
| 107 | fi |
Behdad Esfahbod | 66efe89 | 2012-10-02 14:55:32 -0400 | [diff] [blame] | 108 | if $have_pthread; then |
| 109 | AC_DEFINE(HAVE_PTHREAD, 1, [Have POSIX threads]) |
| 110 | fi |
| 111 | AM_CONDITIONAL(HAVE_PTHREAD, $have_pthread) |
| 112 | |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 113 | dnl ========================================================================== |
| 114 | |
Behdad Esfahbod | 68c75b4 | 2012-06-05 19:55:46 -0400 | [diff] [blame] | 115 | have_ot=true |
| 116 | if $have_ot; then |
| 117 | AC_DEFINE(HAVE_OT, 1, [Have native OpenType Layout backend]) |
| 118 | fi |
| 119 | AM_CONDITIONAL(HAVE_OT, $have_ot) |
| 120 | |
| 121 | dnl =========================================================================== |
| 122 | |
Behdad Esfahbod | 8fe4c74 | 2012-07-24 21:05:12 -0400 | [diff] [blame] | 123 | have_hb_old=true |
| 124 | if $have_hb_old; then |
| 125 | AC_DEFINE(HAVE_HB_OLD, 1, [Have Old HarfBuzz backend]) |
| 126 | fi |
| 127 | AM_CONDITIONAL(HAVE_HB_OLD, $have_hb_old) |
| 128 | |
| 129 | dnl =========================================================================== |
| 130 | |
Behdad Esfahbod | 3f33f0d | 2012-10-02 16:03:18 -0400 | [diff] [blame] | 131 | have_ucdn=true |
| 132 | if $have_ucdn; then |
| 133 | AC_DEFINE(HAVE_UCDN, 1, [Have UCDN Unicode functions]) |
| 134 | fi |
| 135 | AM_CONDITIONAL(HAVE_UCDN, $have_ucdn) |
| 136 | |
| 137 | dnl =========================================================================== |
| 138 | |
Behdad Esfahbod | e6a5b88 | 2011-05-05 16:24:42 -0400 | [diff] [blame] | 139 | PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, have_glib=true, have_glib=false) |
Behdad Esfahbod | f94cf6b | 2009-11-02 18:55:19 -0500 | [diff] [blame] | 140 | if $have_glib; then |
Behdad Esfahbod | d94647e | 2009-11-03 16:35:10 -0500 | [diff] [blame] | 141 | AC_DEFINE(HAVE_GLIB, 1, [Have glib2 library]) |
Behdad Esfahbod | f94cf6b | 2009-11-02 18:55:19 -0500 | [diff] [blame] | 142 | fi |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 143 | AM_CONDITIONAL(HAVE_GLIB, $have_glib) |
| 144 | |
Behdad Esfahbod | c214cff | 2011-08-14 15:17:16 +0200 | [diff] [blame] | 145 | PKG_CHECK_MODULES(GTHREAD, gthread-2.0, have_gthread=true, have_gthread=false) |
| 146 | if $have_gthread; then |
| 147 | AC_DEFINE(HAVE_GTHREAD, 1, [Have gthread2 library]) |
| 148 | fi |
| 149 | AM_CONDITIONAL(HAVE_GTHREAD, $have_gthread) |
| 150 | |
Behdad Esfahbod | 3d0ddd1 | 2012-01-15 15:55:52 -0500 | [diff] [blame] | 151 | PKG_CHECK_MODULES(GOBJECT, gobject-2.0 glib-2.0 >= 2.16, have_gobject=true, have_gobject=false) |
Behdad Esfahbod | c214cff | 2011-08-14 15:17:16 +0200 | [diff] [blame] | 152 | if $have_gobject; then |
| 153 | AC_DEFINE(HAVE_GOBJECT, 1, [Have gobject2 library]) |
Behdad Esfahbod | d75333f | 2011-08-19 19:59:24 +0200 | [diff] [blame] | 154 | GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` |
| 155 | AC_SUBST(GLIB_MKENUMS) |
Behdad Esfahbod | c214cff | 2011-08-14 15:17:16 +0200 | [diff] [blame] | 156 | fi |
| 157 | AM_CONDITIONAL(HAVE_GOBJECT, $have_gobject) |
| 158 | |
Behdad Esfahbod | 174e3fe | 2011-05-05 19:37:53 -0400 | [diff] [blame] | 159 | dnl ========================================================================== |
| 160 | |
Behdad Esfahbod | 5353bf4 | 2011-02-22 18:06:19 -0500 | [diff] [blame] | 161 | PKG_CHECK_MODULES(CAIRO, cairo >= 1.8.0, have_cairo=true, have_cairo=false) |
| 162 | if $have_cairo; then |
| 163 | AC_DEFINE(HAVE_CAIRO, 1, [Have cairo graphics library]) |
| 164 | fi |
| 165 | AM_CONDITIONAL(HAVE_CAIRO, $have_cairo) |
| 166 | |
Behdad Esfahbod | 5353bf4 | 2011-02-22 18:06:19 -0500 | [diff] [blame] | 167 | PKG_CHECK_MODULES(CAIRO_FT, cairo-ft, have_cairo_ft=true, have_cairo_ft=false) |
| 168 | if $have_cairo_ft; then |
| 169 | AC_DEFINE(HAVE_CAIRO_FT, 1, [Have cairo-ft support in cairo graphics library]) |
| 170 | fi |
| 171 | AM_CONDITIONAL(HAVE_CAIRO_FT, $have_cairo_ft) |
| 172 | |
Behdad Esfahbod | 174e3fe | 2011-05-05 19:37:53 -0400 | [diff] [blame] | 173 | dnl ========================================================================== |
| 174 | |
Behdad Esfahbod | b161bfc | 2012-08-16 08:09:44 -0400 | [diff] [blame] | 175 | PKG_CHECK_MODULES(ICU, icu-uc, have_icu=true, have_icu=false) |
Behdad Esfahbod | 14cfab5 | 2013-03-11 19:53:44 -0400 | [diff] [blame] | 176 | dnl Fallback to icu-config if ICU pkg-config files could not be found |
| 177 | if test "$have_icu" != "true"; then |
| 178 | AC_PATH_PROG(icu_config, icu-config, no) |
| 179 | AC_MSG_CHECKING([for ICU by using icu-config fallback]) |
Behdad Esfahbod | 8226fb5 | 2013-03-19 05:22:27 -0400 | [diff] [blame] | 180 | if test "$icu_config" != "no" && "$icu_config" --version >/dev/null; then |
Behdad Esfahbod | 14cfab5 | 2013-03-11 19:53:44 -0400 | [diff] [blame] | 181 | have_icu=true |
| 182 | # We don't use --cflags as this gives us a lot of things that we don't |
| 183 | # necessarily want, like debugging and optimization flags |
| 184 | # See man (1) icu-config for more info. |
| 185 | ICU_CFLAGS=`$icu_config --cppflags` |
| 186 | ICU_LIBS=`$icu_config --ldflags-libsonly` |
| 187 | AC_SUBST(ICU_CFLAGS) |
| 188 | AC_SUBST(ICU_LIBS) |
| 189 | AC_MSG_RESULT([yes]) |
| 190 | else |
| 191 | AC_MSG_RESULT([no]) |
| 192 | fi |
| 193 | fi |
| 194 | |
Behdad Esfahbod | d94647e | 2009-11-03 16:35:10 -0500 | [diff] [blame] | 195 | if $have_icu; then |
Behdad Esfahbod | e5dbf39 | 2013-01-07 17:34:24 -0600 | [diff] [blame] | 196 | CXXFLAGS="$CXXFLAGS `$PKG_CONFIG --variable=CXXFLAGS icu-uc`" |
Behdad Esfahbod | d94647e | 2009-11-03 16:35:10 -0500 | [diff] [blame] | 197 | AC_DEFINE(HAVE_ICU, 1, [Have ICU library]) |
| 198 | fi |
| 199 | AM_CONDITIONAL(HAVE_ICU, $have_icu) |
| 200 | |
Behdad Esfahbod | 4637739 | 2011-08-24 02:12:05 +0200 | [diff] [blame] | 201 | dnl ========================================================================== |
Behdad Esfahbod | 1f49cf3 | 2011-08-24 01:29:25 +0200 | [diff] [blame] | 202 | |
Behdad Esfahbod | 2f7586c | 2012-08-23 23:59:55 -0400 | [diff] [blame] | 203 | PKG_CHECK_MODULES(ICU_LE, icu-le icu-uc, have_icu_le=true, have_icu_le=false) |
Behdad Esfahbod | 14cfab5 | 2013-03-11 19:53:44 -0400 | [diff] [blame] | 204 | dnl Fallback to icu-config if ICU pkg-config files could not be found |
| 205 | if test "$have_icu_le" != "true"; then |
| 206 | AC_PATH_PROG(icu_config, icu-config, no) |
| 207 | AC_MSG_CHECKING([for ICU_LE by using icu-config fallback]) |
Behdad Esfahbod | 8226fb5 | 2013-03-19 05:22:27 -0400 | [diff] [blame] | 208 | if test "$icu_config" != "no" && "$icu_config" --version >/dev/null; then |
Behdad Esfahbod | 14cfab5 | 2013-03-11 19:53:44 -0400 | [diff] [blame] | 209 | have_icu_le=true |
| 210 | # We don't use --cflags as this gives us a lot of things that we don't |
| 211 | # necessarily want, like debugging and optimization flags |
| 212 | # See man (1) icu-config for more info. |
| 213 | ICU_LE_CFLAGS=`$icu_config --cppflags` |
| 214 | ICU_LE_LIBS=`$icu_config --ldflags-libsonly --ldflags-layout` |
| 215 | AC_SUBST(ICU_LE_CFLAGS) |
| 216 | AC_SUBST(ICU_LE_LIBS) |
| 217 | AC_MSG_RESULT([yes]) |
| 218 | else |
| 219 | AC_MSG_RESULT([no]) |
| 220 | fi |
| 221 | fi |
Behdad Esfahbod | 7d24236 | 2012-08-23 21:23:41 -0400 | [diff] [blame] | 222 | if $have_icu_le; then |
| 223 | AC_DEFINE(HAVE_ICU_LE, 1, [Have ICU Layout Engine library]) |
| 224 | fi |
| 225 | AM_CONDITIONAL(HAVE_ICU_LE, $have_icu_le) |
| 226 | |
| 227 | dnl ========================================================================== |
| 228 | |
Behdad Esfahbod | 6bd9b47 | 2012-04-12 14:53:53 -0400 | [diff] [blame] | 229 | PKG_CHECK_MODULES(GRAPHITE2, graphite2, have_graphite=true, have_graphite=false) |
Behdad Esfahbod | 4637739 | 2011-08-24 02:12:05 +0200 | [diff] [blame] | 230 | if $have_graphite; then |
Behdad Esfahbod | 6bd9b47 | 2012-04-12 14:53:53 -0400 | [diff] [blame] | 231 | AC_DEFINE(HAVE_GRAPHITE2, 1, [Have Graphite library]) |
Behdad Esfahbod | 1f49cf3 | 2011-08-24 01:29:25 +0200 | [diff] [blame] | 232 | fi |
Behdad Esfahbod | 6bd9b47 | 2012-04-12 14:53:53 -0400 | [diff] [blame] | 233 | AM_CONDITIONAL(HAVE_GRAPHITE2, $have_graphite) |
Behdad Esfahbod | 4637739 | 2011-08-24 02:12:05 +0200 | [diff] [blame] | 234 | |
| 235 | dnl ========================================================================== |
Behdad Esfahbod | 174e3fe | 2011-05-05 19:37:53 -0400 | [diff] [blame] | 236 | |
Behdad Esfahbod | 0b7e4d9 | 2011-08-15 20:41:59 +0200 | [diff] [blame] | 237 | PKG_CHECK_MODULES(FREETYPE, freetype2 >= 2.3.8, have_freetype=true, have_freetype=false) |
Behdad Esfahbod | f94cf6b | 2009-11-02 18:55:19 -0500 | [diff] [blame] | 238 | if $have_freetype; then |
| 239 | AC_DEFINE(HAVE_FREETYPE, 1, [Have FreeType 2 library]) |
Behdad Esfahbod | cd11a98 | 2009-12-20 23:05:02 +0100 | [diff] [blame] | 240 | _save_libs="$LIBS" |
| 241 | _save_cflags="$CFLAGS" |
| 242 | LIBS="$LIBS $FREETYPE_LIBS" |
| 243 | CFLAGS="$CFLAGS $FREETYPE_CFLAGS" |
| 244 | AC_CHECK_FUNCS(FT_Face_GetCharVariantIndex) |
| 245 | LIBS="$_save_libs" |
| 246 | CFLAGS="$_save_cflags" |
Behdad Esfahbod | f94cf6b | 2009-11-02 18:55:19 -0500 | [diff] [blame] | 247 | fi |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 248 | AM_CONDITIONAL(HAVE_FREETYPE, $have_freetype) |
| 249 | |
Behdad Esfahbod | c78f448 | 2011-05-05 21:31:04 -0400 | [diff] [blame] | 250 | dnl =========================================================================== |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 251 | |
Behdad Esfahbod | 5e7e52d | 2012-12-10 17:44:22 -0500 | [diff] [blame] | 252 | AC_MSG_CHECKING([for ScriptShapeOpenType in usp10]) |
| 253 | saved_LIBS=$LIBS |
| 254 | LIBS="$LIBS -lusp10 -lgdi32" |
| 255 | AC_LINK_IFELSE([AC_LANG_PROGRAM( |
| 256 | [[ |
| 257 | #define _WIN32_WINNT 0x0600 |
| 258 | #include <windows.h> |
| 259 | #include <usp10.h> |
| 260 | ]], |
| 261 | ScriptShapeOpenType)], |
| 262 | [have_uniscribe=true; AC_MSG_RESULT(yes)], |
| 263 | [have_uniscribe=false;AC_MSG_RESULT(no)]) |
| 264 | LIBS=$saved_LIBS |
Behdad Esfahbod | 0fbb2dc | 2011-08-03 19:55:04 -0400 | [diff] [blame] | 265 | if $have_uniscribe; then |
| 266 | UNISCRIBE_CFLAGS= |
| 267 | UNISCRIBE_LIBS="-lusp10 -lgdi32" |
| 268 | AC_SUBST(UNISCRIBE_CFLAGS) |
| 269 | AC_SUBST(UNISCRIBE_LIBS) |
Behdad Esfahbod | 02aeca9 | 2011-08-04 22:31:05 -0400 | [diff] [blame] | 270 | AC_DEFINE(HAVE_UNISCRIBE, 1, [Have Uniscribe backend]) |
Behdad Esfahbod | 0fbb2dc | 2011-08-03 19:55:04 -0400 | [diff] [blame] | 271 | fi |
| 272 | AM_CONDITIONAL(HAVE_UNISCRIBE, $have_uniscribe) |
| 273 | |
Behdad Esfahbod | 04bc1ee | 2012-06-05 20:16:56 -0400 | [diff] [blame] | 274 | dnl =========================================================================== |
| 275 | |
John Ralls | c48a04e | 2012-12-10 16:24:24 -0500 | [diff] [blame] | 276 | AC_CHECK_TYPE(CTFontRef, have_coretext=true, have_coretext=false, [#include <ApplicationServices/ApplicationServices.h>]) |
Jonathan Kew | aa6d849 | 2012-07-24 15:52:32 -0400 | [diff] [blame] | 277 | if $have_coretext; then |
| 278 | CORETEXT_CFLAGS= |
Behdad Esfahbod | ae4d4e1 | 2012-08-26 14:27:44 -0400 | [diff] [blame] | 279 | CORETEXT_LIBS="-framework ApplicationServices" |
Jonathan Kew | aa6d849 | 2012-07-24 15:52:32 -0400 | [diff] [blame] | 280 | AC_SUBST(CORETEXT_CFLAGS) |
| 281 | AC_SUBST(CORETEXT_LIBS) |
| 282 | AC_DEFINE(HAVE_CORETEXT, 1, [Have Core Text backend]) |
| 283 | fi |
| 284 | AM_CONDITIONAL(HAVE_CORETEXT, $have_coretext) |
| 285 | |
| 286 | dnl =========================================================================== |
| 287 | |
Behdad Esfahbod | 04bc1ee | 2012-06-05 20:16:56 -0400 | [diff] [blame] | 288 | AC_CACHE_CHECK([for Intel atomic primitives], hb_cv_have_intel_atomic_primitives, [ |
| 289 | hb_cv_have_intel_atomic_primitives=false |
Behdad Esfahbod | 12f5c0a | 2012-06-26 11:16:13 -0400 | [diff] [blame] | 290 | AC_TRY_LINK([ |
Behdad Esfahbod | 04bc1ee | 2012-06-05 20:16:56 -0400 | [diff] [blame] | 291 | void memory_barrier (void) { __sync_synchronize (); } |
Behdad Esfahbod | 12f5c0a | 2012-06-26 11:16:13 -0400 | [diff] [blame] | 292 | int atomic_add (int *i) { return __sync_fetch_and_add (i, 1); } |
| 293 | int mutex_trylock (int *m) { return __sync_lock_test_and_set (m, 1); } |
| 294 | void mutex_unlock (int *m) { __sync_lock_release (m); } |
| 295 | ], [], hb_cv_have_intel_atomic_primitives=true |
Behdad Esfahbod | 04bc1ee | 2012-06-05 20:16:56 -0400 | [diff] [blame] | 296 | ) |
| 297 | ]) |
| 298 | if $hb_cv_have_intel_atomic_primitives; then |
| 299 | AC_DEFINE(HAVE_INTEL_ATOMIC_PRIMITIVES, 1, [Have Intel __sync_* atomic primitives]) |
| 300 | fi |
| 301 | |
| 302 | dnl =========================================================================== |
| 303 | |
Behdad Esfahbod | 2dcb333 | 2013-01-10 01:17:59 -0600 | [diff] [blame] | 304 | AC_CACHE_CHECK([for Solaris atomic operations], hb_cv_have_solaris_atomic_ops, [ |
| 305 | hb_cv_have_solaris_atomic_ops=false |
| 306 | AC_TRY_LINK([ |
| 307 | #include <atomic.h> |
| 308 | /* This requires Solaris Studio 12.2 or newer: */ |
| 309 | #include <mbarrier.h> |
| 310 | void memory_barrier (void) { __machine_rw_barrier (); } |
| 311 | int atomic_add (volatile unsigned *i) { return atomic_add_int_nv (i, 1); } |
| 312 | void *atomic_ptr_cmpxchg (volatile void **target, void *cmp, void *newval) { return atomic_cas_ptr (target, cmp, newval); } |
| 313 | ], [], hb_cv_have_solaris_atomic_ops=true |
| 314 | ) |
| 315 | ]) |
| 316 | if $hb_cv_have_solaris_atomic_ops; then |
| 317 | AC_DEFINE(HAVE_SOLARIS_ATOMIC_OPS, 1, [Have Solaris __machine_*_barrier and atomic_* operations]) |
| 318 | fi |
| 319 | |
| 320 | if test "$os_win32" = no && ! $have_pthread; then |
| 321 | AC_CHECK_HEADERS(sched.h) |
| 322 | AC_SEARCH_LIBS(sched_yield,rt,AC_DEFINE(HAVE_SCHED_YIELD, 1, [Have sched_yield])) |
| 323 | fi |
| 324 | |
| 325 | dnl =========================================================================== |
| 326 | |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 327 | AC_CONFIG_FILES([ |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 328 | Makefile |
Behdad Esfahbod | c78f448 | 2011-05-05 21:31:04 -0400 | [diff] [blame] | 329 | harfbuzz.pc |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 330 | src/Makefile |
Behdad Esfahbod | c78f448 | 2011-05-05 21:31:04 -0400 | [diff] [blame] | 331 | src/hb-version.h |
Behdad Esfahbod | 7d24236 | 2012-08-23 21:23:41 -0400 | [diff] [blame] | 332 | src/hb-icu-le/Makefile |
Behdad Esfahbod | 3f33f0d | 2012-10-02 16:03:18 -0400 | [diff] [blame] | 333 | src/hb-old/Makefile |
| 334 | src/hb-ucdn/Makefile |
Behdad Esfahbod | 511a136 | 2011-08-09 15:03:00 +0200 | [diff] [blame] | 335 | util/Makefile |
Behdad Esfahbod | bbdeff5 | 2011-04-07 16:05:07 -0400 | [diff] [blame] | 336 | test/Makefile |
Behdad Esfahbod | 4d6dafd | 2012-01-19 14:52:02 -0500 | [diff] [blame] | 337 | test/api/Makefile |
Behdad Esfahbod | d4de562 | 2012-01-19 15:21:04 -0500 | [diff] [blame] | 338 | test/shaping/Makefile |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 339 | ]) |
| 340 | |
| 341 | AC_OUTPUT |
Behdad Esfahbod | d16ddbc | 2012-12-20 01:02:36 -0500 | [diff] [blame] | 342 | |
| 343 | AC_MSG_NOTICE([ |
| 344 | |
| 345 | Build configuration: |
| 346 | |
| 347 | Unicode callbacks (you want at least one): |
| 348 | Glib: ${have_glib} |
| 349 | ICU: ${have_icu} |
| 350 | UCDN: ${have_ucdn} |
| 351 | |
| 352 | Font callbacks (the more the better): |
| 353 | FreeType: ${have_freetype} |
| 354 | |
| 355 | Tools used for command-line utilities: |
| 356 | Cairo: ${have_cairo} |
| 357 | |
| 358 | Additional shapers (the more the better): |
| 359 | Graphite2: ${have_graphite} |
| 360 | |
| 361 | Test / platform shapers (not normally needed): |
| 362 | CoreText: ${have_coretext} |
| 363 | ICU Layout Engine: ${have_icu_le} |
| 364 | Old HarfBuzz: ${have_hb_old} |
| 365 | Uniscribe: ${have_uniscribe} |
| 366 | ]) |