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 | f7e8dcf | 2012-05-11 22:00:06 +0200 | [diff] [blame] | 3 | [0.9.0], |
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 | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 8 | AC_CONFIG_SRCDIR([harfbuzz.pc.in]) |
| 9 | AC_CONFIG_HEADERS([config.h]) |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 10 | |
Javier Jardón | 2abe126 | 2011-01-09 22:18:53 -0500 | [diff] [blame] | 11 | AM_INIT_AUTOMAKE([1.11.1 gnu dist-bzip2 no-dist-gzip -Wall no-define]) |
Javier Jardón | 2abe126 | 2011-01-09 22:18:53 -0500 | [diff] [blame] | 12 | AM_SILENT_RULES([yes]) |
| 13 | |
Behdad Esfahbod | c62e41b | 2012-01-27 02:20:58 -0500 | [diff] [blame] | 14 | # Initialize libtool |
| 15 | LT_PREREQ([2.2]) |
| 16 | LT_INIT([disable-static]) |
| 17 | |
Javier Jardón | 2abe126 | 2011-01-09 22:18:53 -0500 | [diff] [blame] | 18 | # Check for programs |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 19 | AC_PROG_CC |
Behdad Esfahbod | 0109816 | 2010-10-05 18:36:45 -0400 | [diff] [blame] | 20 | AM_PROG_CC_C_O |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 21 | AC_PROG_CXX |
| 22 | |
Behdad Esfahbod | c78f448 | 2011-05-05 21:31:04 -0400 | [diff] [blame] | 23 | # Version |
Behdad Esfahbod | 329c157 | 2011-05-25 16:07:07 -0400 | [diff] [blame] | 24 | m4_define(hb_version_triplet,m4_split(AC_PACKAGE_VERSION,[[.]])) |
| 25 | m4_define(hb_version_major,m4_argn(1,hb_version_triplet)) |
| 26 | m4_define(hb_version_minor,m4_argn(2,hb_version_triplet)) |
| 27 | m4_define(hb_version_micro,m4_argn(3,hb_version_triplet)) |
| 28 | HB_VERSION_MAJOR=hb_version_major |
| 29 | HB_VERSION_MINOR=hb_version_minor |
| 30 | HB_VERSION_MICRO=hb_version_micro |
Behdad Esfahbod | c78f448 | 2011-05-05 21:31:04 -0400 | [diff] [blame] | 31 | HB_VERSION=AC_PACKAGE_VERSION |
Behdad Esfahbod | c78f448 | 2011-05-05 21:31:04 -0400 | [diff] [blame] | 32 | AC_SUBST(HB_VERSION_MAJOR) |
| 33 | AC_SUBST(HB_VERSION_MINOR) |
| 34 | AC_SUBST(HB_VERSION_MICRO) |
| 35 | AC_SUBST(HB_VERSION) |
| 36 | |
Behdad Esfahbod | 329c157 | 2011-05-25 16:07:07 -0400 | [diff] [blame] | 37 | # Libtool version |
| 38 | m4_define([hb_version_int], |
| 39 | m4_eval(hb_version_major*10000 + hb_version_minor*100 + hb_version_micro)) |
| 40 | m4_if(m4_eval(hb_version_minor % 2), [1], |
| 41 | dnl for unstable releases |
| 42 | [m4_define([hb_libtool_revision], 0)], |
| 43 | dnl for stable releases |
| 44 | [m4_define([hb_libtool_revision], hb_version_micro)]) |
| 45 | m4_define([hb_libtool_age], |
| 46 | m4_eval(hb_version_int - hb_libtool_revision)) |
| 47 | m4_define([hb_libtool_current], |
| 48 | m4_eval(hb_version_major + hb_libtool_age)) |
| 49 | HB_LIBTOOL_VERSION_INFO=hb_libtool_current:hb_libtool_revision:hb_libtool_age |
| 50 | AC_SUBST(HB_LIBTOOL_VERSION_INFO) |
Behdad Esfahbod | c78f448 | 2011-05-05 21:31:04 -0400 | [diff] [blame] | 51 | |
Behdad Esfahbod | 8c0ea7b | 2012-06-24 13:20:56 -0400 | [diff] [blame] | 52 | dnl GOBJECT_INTROSPECTION_CHECK([0.9.0]) |
Behdad Esfahbod | 95ab82a | 2012-01-15 14:56:56 -0500 | [diff] [blame] | 53 | dnl GTK_DOC_CHECK([1.15],[--flavour no-tmpl]) |
Behdad Esfahbod | b9b10ad | 2011-09-13 13:30:39 -0400 | [diff] [blame] | 54 | |
Behdad Esfahbod | 174e3fe | 2011-05-05 19:37:53 -0400 | [diff] [blame] | 55 | # Functions and headers |
Behdad Esfahbod | cdafe3a | 2012-06-05 16:34:49 -0400 | [diff] [blame] | 56 | AC_CHECK_FUNCS(atexit mprotect sysconf getpagesize sched_yield mmap _setmode isatty) |
| 57 | AC_CHECK_HEADERS(unistd.h sys/mman.h sched.h io.h) |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 58 | |
Behdad Esfahbod | 174e3fe | 2011-05-05 19:37:53 -0400 | [diff] [blame] | 59 | # Compiler flags |
Behdad Esfahbod | c78f448 | 2011-05-05 21:31:04 -0400 | [diff] [blame] | 60 | AC_CANONICAL_HOST |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 61 | if test "x$GCC" = "xyes"; then |
Behdad Esfahbod | 5b7f389 | 2011-04-27 15:10:12 -0400 | [diff] [blame] | 62 | |
Behdad Esfahbod | 71cef14 | 2011-05-06 19:30:59 -0400 | [diff] [blame] | 63 | # Make symbols link locally |
| 64 | LDFLAGS="$LDFLAGS -Bsymbolic-functions" |
| 65 | |
Behdad Esfahbod | 5b7f389 | 2011-04-27 15:10:12 -0400 | [diff] [blame] | 66 | # Make sure we don't link to libstdc++ |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 67 | CXXFLAGS="$CXXFLAGS -fno-rtti -fno-exceptions" |
Behdad Esfahbod | 5b7f389 | 2011-04-27 15:10:12 -0400 | [diff] [blame] | 68 | |
| 69 | case "$host" in |
| 70 | arm-*-*) |
| 71 | # Request byte alignment on arm |
| 72 | CXXFLAGS="$CXXFLAGS -mstructure-size-boundary=8" |
| 73 | ;; |
| 74 | esac |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 75 | fi |
| 76 | |
| 77 | dnl ========================================================================== |
| 78 | |
Behdad Esfahbod | 68c75b4 | 2012-06-05 19:55:46 -0400 | [diff] [blame] | 79 | have_ot=true |
| 80 | if $have_ot; then |
| 81 | AC_DEFINE(HAVE_OT, 1, [Have native OpenType Layout backend]) |
| 82 | fi |
| 83 | AM_CONDITIONAL(HAVE_OT, $have_ot) |
| 84 | |
| 85 | dnl =========================================================================== |
| 86 | |
Behdad Esfahbod | e6a5b88 | 2011-05-05 16:24:42 -0400 | [diff] [blame] | 87 | 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] | 88 | if $have_glib; then |
Behdad Esfahbod | d94647e | 2009-11-03 16:35:10 -0500 | [diff] [blame] | 89 | AC_DEFINE(HAVE_GLIB, 1, [Have glib2 library]) |
Behdad Esfahbod | f94cf6b | 2009-11-02 18:55:19 -0500 | [diff] [blame] | 90 | fi |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 91 | AM_CONDITIONAL(HAVE_GLIB, $have_glib) |
| 92 | |
Behdad Esfahbod | c214cff | 2011-08-14 15:17:16 +0200 | [diff] [blame] | 93 | PKG_CHECK_MODULES(GTHREAD, gthread-2.0, have_gthread=true, have_gthread=false) |
| 94 | if $have_gthread; then |
| 95 | AC_DEFINE(HAVE_GTHREAD, 1, [Have gthread2 library]) |
| 96 | fi |
| 97 | AM_CONDITIONAL(HAVE_GTHREAD, $have_gthread) |
| 98 | |
Behdad Esfahbod | 3d0ddd1 | 2012-01-15 15:55:52 -0500 | [diff] [blame] | 99 | 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] | 100 | if $have_gobject; then |
| 101 | AC_DEFINE(HAVE_GOBJECT, 1, [Have gobject2 library]) |
Behdad Esfahbod | d75333f | 2011-08-19 19:59:24 +0200 | [diff] [blame] | 102 | GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` |
| 103 | AC_SUBST(GLIB_MKENUMS) |
Behdad Esfahbod | c214cff | 2011-08-14 15:17:16 +0200 | [diff] [blame] | 104 | fi |
| 105 | AM_CONDITIONAL(HAVE_GOBJECT, $have_gobject) |
| 106 | |
Behdad Esfahbod | 174e3fe | 2011-05-05 19:37:53 -0400 | [diff] [blame] | 107 | dnl ========================================================================== |
| 108 | |
Behdad Esfahbod | 5353bf4 | 2011-02-22 18:06:19 -0500 | [diff] [blame] | 109 | PKG_CHECK_MODULES(CAIRO, cairo >= 1.8.0, have_cairo=true, have_cairo=false) |
| 110 | if $have_cairo; then |
| 111 | AC_DEFINE(HAVE_CAIRO, 1, [Have cairo graphics library]) |
| 112 | fi |
| 113 | AM_CONDITIONAL(HAVE_CAIRO, $have_cairo) |
| 114 | |
Behdad Esfahbod | 5353bf4 | 2011-02-22 18:06:19 -0500 | [diff] [blame] | 115 | PKG_CHECK_MODULES(CAIRO_FT, cairo-ft, have_cairo_ft=true, have_cairo_ft=false) |
| 116 | if $have_cairo_ft; then |
| 117 | AC_DEFINE(HAVE_CAIRO_FT, 1, [Have cairo-ft support in cairo graphics library]) |
| 118 | fi |
| 119 | AM_CONDITIONAL(HAVE_CAIRO_FT, $have_cairo_ft) |
| 120 | |
Behdad Esfahbod | 174e3fe | 2011-05-05 19:37:53 -0400 | [diff] [blame] | 121 | dnl ========================================================================== |
| 122 | |
Behdad Esfahbod | d1f1707 | 2010-11-30 00:57:15 -0500 | [diff] [blame] | 123 | PKG_CHECK_MODULES(ICU, icu, have_icu=true, [ |
Behdad Esfahbod | 880c1f0 | 2011-09-19 23:10:22 -0400 | [diff] [blame] | 124 | have_icu=true |
| 125 | AC_CHECK_HEADERS(unicode/uchar.h,, have_icu=false) |
| 126 | AC_MSG_CHECKING([for libicuuc]) |
| 127 | LIBS_old=$LIBS |
| 128 | LIBS="$LIBS -licuuc" |
| 129 | AC_TRY_LINK([#include <unicode/uchar.h>], |
| 130 | [u_getIntPropertyValue (0, (UProperty)0);], |
| 131 | AC_MSG_RESULT(yes), |
| 132 | AC_MSG_RESULT(no);have_icu=false) |
| 133 | LIBS=$LIBS_old |
| 134 | if $have_icu; then |
| 135 | ICU_CFLAGS=-D_REENTRANT |
| 136 | ICU_LIBS="-licuuc" |
| 137 | AC_SUBST(ICU_CFLAGS) |
| 138 | AC_SUBST(ICU_LIBS) |
Behdad Esfahbod | d1f1707 | 2010-11-30 00:57:15 -0500 | [diff] [blame] | 139 | fi |
| 140 | ]) |
Behdad Esfahbod | d94647e | 2009-11-03 16:35:10 -0500 | [diff] [blame] | 141 | if $have_icu; then |
| 142 | AC_DEFINE(HAVE_ICU, 1, [Have ICU library]) |
| 143 | fi |
| 144 | AM_CONDITIONAL(HAVE_ICU, $have_icu) |
| 145 | |
Behdad Esfahbod | 4637739 | 2011-08-24 02:12:05 +0200 | [diff] [blame] | 146 | dnl ========================================================================== |
Behdad Esfahbod | 1f49cf3 | 2011-08-24 01:29:25 +0200 | [diff] [blame] | 147 | |
Behdad Esfahbod | 6bd9b47 | 2012-04-12 14:53:53 -0400 | [diff] [blame] | 148 | PKG_CHECK_MODULES(GRAPHITE2, graphite2, have_graphite=true, have_graphite=false) |
Behdad Esfahbod | 4637739 | 2011-08-24 02:12:05 +0200 | [diff] [blame] | 149 | if $have_graphite; then |
Behdad Esfahbod | 6bd9b47 | 2012-04-12 14:53:53 -0400 | [diff] [blame] | 150 | AC_DEFINE(HAVE_GRAPHITE2, 1, [Have Graphite library]) |
Behdad Esfahbod | 1f49cf3 | 2011-08-24 01:29:25 +0200 | [diff] [blame] | 151 | fi |
Behdad Esfahbod | 6bd9b47 | 2012-04-12 14:53:53 -0400 | [diff] [blame] | 152 | AM_CONDITIONAL(HAVE_GRAPHITE2, $have_graphite) |
Behdad Esfahbod | 4637739 | 2011-08-24 02:12:05 +0200 | [diff] [blame] | 153 | |
| 154 | dnl ========================================================================== |
Behdad Esfahbod | 174e3fe | 2011-05-05 19:37:53 -0400 | [diff] [blame] | 155 | |
Behdad Esfahbod | 0b7e4d9 | 2011-08-15 20:41:59 +0200 | [diff] [blame] | 156 | 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] | 157 | if $have_freetype; then |
| 158 | AC_DEFINE(HAVE_FREETYPE, 1, [Have FreeType 2 library]) |
Behdad Esfahbod | cd11a98 | 2009-12-20 23:05:02 +0100 | [diff] [blame] | 159 | _save_libs="$LIBS" |
| 160 | _save_cflags="$CFLAGS" |
| 161 | LIBS="$LIBS $FREETYPE_LIBS" |
| 162 | CFLAGS="$CFLAGS $FREETYPE_CFLAGS" |
| 163 | AC_CHECK_FUNCS(FT_Face_GetCharVariantIndex) |
| 164 | LIBS="$_save_libs" |
| 165 | CFLAGS="$_save_cflags" |
Behdad Esfahbod | f94cf6b | 2009-11-02 18:55:19 -0500 | [diff] [blame] | 166 | fi |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 167 | AM_CONDITIONAL(HAVE_FREETYPE, $have_freetype) |
| 168 | |
Behdad Esfahbod | c78f448 | 2011-05-05 21:31:04 -0400 | [diff] [blame] | 169 | dnl =========================================================================== |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 170 | |
Behdad Esfahbod | 0fbb2dc | 2011-08-03 19:55:04 -0400 | [diff] [blame] | 171 | AC_CHECK_HEADERS(usp10.h windows.h, have_uniscribe=true, have_uniscribe=false) |
| 172 | if $have_uniscribe; then |
| 173 | UNISCRIBE_CFLAGS= |
| 174 | UNISCRIBE_LIBS="-lusp10 -lgdi32" |
| 175 | AC_SUBST(UNISCRIBE_CFLAGS) |
| 176 | AC_SUBST(UNISCRIBE_LIBS) |
Behdad Esfahbod | 02aeca9 | 2011-08-04 22:31:05 -0400 | [diff] [blame] | 177 | AC_DEFINE(HAVE_UNISCRIBE, 1, [Have Uniscribe backend]) |
Behdad Esfahbod | 0fbb2dc | 2011-08-03 19:55:04 -0400 | [diff] [blame] | 178 | fi |
| 179 | AM_CONDITIONAL(HAVE_UNISCRIBE, $have_uniscribe) |
| 180 | |
Behdad Esfahbod | 04bc1ee | 2012-06-05 20:16:56 -0400 | [diff] [blame] | 181 | dnl =========================================================================== |
| 182 | |
| 183 | AC_CACHE_CHECK([for Intel atomic primitives], hb_cv_have_intel_atomic_primitives, [ |
| 184 | hb_cv_have_intel_atomic_primitives=false |
Behdad Esfahbod | 12f5c0a | 2012-06-26 11:16:13 -0400 | [diff] [blame^] | 185 | AC_TRY_LINK([ |
Behdad Esfahbod | 04bc1ee | 2012-06-05 20:16:56 -0400 | [diff] [blame] | 186 | void memory_barrier (void) { __sync_synchronize (); } |
Behdad Esfahbod | 12f5c0a | 2012-06-26 11:16:13 -0400 | [diff] [blame^] | 187 | int atomic_add (int *i) { return __sync_fetch_and_add (i, 1); } |
| 188 | int mutex_trylock (int *m) { return __sync_lock_test_and_set (m, 1); } |
| 189 | void mutex_unlock (int *m) { __sync_lock_release (m); } |
| 190 | ], [], hb_cv_have_intel_atomic_primitives=true |
Behdad Esfahbod | 04bc1ee | 2012-06-05 20:16:56 -0400 | [diff] [blame] | 191 | ) |
| 192 | ]) |
| 193 | if $hb_cv_have_intel_atomic_primitives; then |
| 194 | AC_DEFINE(HAVE_INTEL_ATOMIC_PRIMITIVES, 1, [Have Intel __sync_* atomic primitives]) |
| 195 | fi |
| 196 | |
| 197 | dnl =========================================================================== |
| 198 | |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 199 | AC_CONFIG_FILES([ |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 200 | Makefile |
Behdad Esfahbod | c78f448 | 2011-05-05 21:31:04 -0400 | [diff] [blame] | 201 | harfbuzz.pc |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 202 | src/Makefile |
Behdad Esfahbod | c78f448 | 2011-05-05 21:31:04 -0400 | [diff] [blame] | 203 | src/hb-version.h |
Behdad Esfahbod | 511a136 | 2011-08-09 15:03:00 +0200 | [diff] [blame] | 204 | util/Makefile |
Behdad Esfahbod | bbdeff5 | 2011-04-07 16:05:07 -0400 | [diff] [blame] | 205 | test/Makefile |
Behdad Esfahbod | 4d6dafd | 2012-01-19 14:52:02 -0500 | [diff] [blame] | 206 | test/api/Makefile |
Behdad Esfahbod | d4de562 | 2012-01-19 15:21:04 -0500 | [diff] [blame] | 207 | test/shaping/Makefile |
Behdad Esfahbod | 29aa400 | 2009-11-02 16:28:39 -0500 | [diff] [blame] | 208 | ]) |
| 209 | |
| 210 | AC_OUTPUT |