blob: 3f13c43656ef0e190f31dbfc8c60b77343bab8ea [file] [log] [blame]
Javier Jardón2abe1262011-01-09 22:18:53 -05001AC_PREREQ([2.64])
2AC_INIT([harfbuzz],
Behdad Esfahbod595dc632011-05-27 04:14:12 -04003 [0.7.0],
Javier Jardón2abe1262011-01-09 22:18:53 -05004 [http://bugs.freedesktop.org/enter_bug.cgi?product=harfbuzz],
5 [harfbuzz],
Behdad Esfahbod5b21eff2011-05-25 14:49:35 -04006 [http://harfbuzz.org/])
Javier Jardón2abe1262011-01-09 22:18:53 -05007
Behdad Esfahbod29aa4002009-11-02 16:28:39 -05008AC_CONFIG_SRCDIR([harfbuzz.pc.in])
9AC_CONFIG_HEADERS([config.h])
Behdad Esfahbod29aa4002009-11-02 16:28:39 -050010
Javier Jardón2abe1262011-01-09 22:18:53 -050011AM_INIT_AUTOMAKE([1.11.1 gnu dist-bzip2 no-dist-gzip -Wall no-define])
Javier Jardón2abe1262011-01-09 22:18:53 -050012AM_SILENT_RULES([yes])
13
14# Check for programs
Behdad Esfahbod29aa4002009-11-02 16:28:39 -050015AC_PROG_CC
Behdad Esfahbod01098162010-10-05 18:36:45 -040016AM_PROG_CC_C_O
Behdad Esfahbod29aa4002009-11-02 16:28:39 -050017AC_PROG_CXX
18
Javier Jardón2abe1262011-01-09 22:18:53 -050019# Initialize libtool
20LT_PREREQ([2.2])
Behdad Esfahbod9ff819f2011-05-05 19:47:59 -040021LT_INIT([disable-static])
Javier Jardón2abe1262011-01-09 22:18:53 -050022
Behdad Esfahbodc78f4482011-05-05 21:31:04 -040023# Version
Behdad Esfahbod329c1572011-05-25 16:07:07 -040024m4_define(hb_version_triplet,m4_split(AC_PACKAGE_VERSION,[[.]]))
25m4_define(hb_version_major,m4_argn(1,hb_version_triplet))
26m4_define(hb_version_minor,m4_argn(2,hb_version_triplet))
27m4_define(hb_version_micro,m4_argn(3,hb_version_triplet))
28HB_VERSION_MAJOR=hb_version_major
29HB_VERSION_MINOR=hb_version_minor
30HB_VERSION_MICRO=hb_version_micro
Behdad Esfahbodc78f4482011-05-05 21:31:04 -040031HB_VERSION=AC_PACKAGE_VERSION
Behdad Esfahbodc78f4482011-05-05 21:31:04 -040032AC_SUBST(HB_VERSION_MAJOR)
33AC_SUBST(HB_VERSION_MINOR)
34AC_SUBST(HB_VERSION_MICRO)
35AC_SUBST(HB_VERSION)
36
Behdad Esfahbod329c1572011-05-25 16:07:07 -040037# Libtool version
38m4_define([hb_version_int],
39 m4_eval(hb_version_major*10000 + hb_version_minor*100 + hb_version_micro))
40m4_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)])
45m4_define([hb_libtool_age],
46 m4_eval(hb_version_int - hb_libtool_revision))
47m4_define([hb_libtool_current],
48 m4_eval(hb_version_major + hb_libtool_age))
49HB_LIBTOOL_VERSION_INFO=hb_libtool_current:hb_libtool_revision:hb_libtool_age
50AC_SUBST(HB_LIBTOOL_VERSION_INFO)
Behdad Esfahbodc78f4482011-05-05 21:31:04 -040051
Behdad Esfahbod174e3fe2011-05-05 19:37:53 -040052# Functions and headers
Behdad Esfahbod5be7d042011-05-17 15:05:34 -040053AC_CHECK_FUNCS(mprotect sysconf getpagesize mmap)
Behdad Esfahbod29aa4002009-11-02 16:28:39 -050054AC_CHECK_HEADERS(unistd.h sys/mman.h)
55
Behdad Esfahbod174e3fe2011-05-05 19:37:53 -040056# Compiler flags
Behdad Esfahbodc78f4482011-05-05 21:31:04 -040057AC_CANONICAL_HOST
Behdad Esfahbod29aa4002009-11-02 16:28:39 -050058if test "x$GCC" = "xyes"; then
Behdad Esfahbod5b7f3892011-04-27 15:10:12 -040059
Behdad Esfahbod71cef142011-05-06 19:30:59 -040060 # Make symbols link locally
61 LDFLAGS="$LDFLAGS -Bsymbolic-functions"
62
Behdad Esfahbod5b7f3892011-04-27 15:10:12 -040063 # Make sure we don't link to libstdc++
Behdad Esfahbod29aa4002009-11-02 16:28:39 -050064 CXXFLAGS="$CXXFLAGS -fno-rtti -fno-exceptions"
Behdad Esfahbod5b7f3892011-04-27 15:10:12 -040065
66 case "$host" in
67 arm-*-*)
68 # Request byte alignment on arm
69 CXXFLAGS="$CXXFLAGS -mstructure-size-boundary=8"
70 ;;
71 esac
Behdad Esfahbod29aa4002009-11-02 16:28:39 -050072fi
73
74dnl ==========================================================================
75
Behdad Esfahbode6a5b882011-05-05 16:24:42 -040076PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, have_glib=true, have_glib=false)
Behdad Esfahbod0c2ec1d2011-05-10 19:11:27 -040077PKG_CHECK_MODULES(GTHREAD, gthread-2.0, , have_glib=false)
Behdad Esfahbodf94cf6b2009-11-02 18:55:19 -050078if $have_glib; then
Behdad Esfahbodd94647e2009-11-03 16:35:10 -050079 AC_DEFINE(HAVE_GLIB, 1, [Have glib2 library])
Behdad Esfahbodf94cf6b2009-11-02 18:55:19 -050080fi
Behdad Esfahbod29aa4002009-11-02 16:28:39 -050081AM_CONDITIONAL(HAVE_GLIB, $have_glib)
82
Behdad Esfahbod174e3fe2011-05-05 19:37:53 -040083dnl ==========================================================================
84
Behdad Esfahbod5353bf42011-02-22 18:06:19 -050085PKG_CHECK_MODULES(CAIRO, cairo >= 1.8.0, have_cairo=true, have_cairo=false)
86if $have_cairo; then
87 AC_DEFINE(HAVE_CAIRO, 1, [Have cairo graphics library])
88fi
89AM_CONDITIONAL(HAVE_CAIRO, $have_cairo)
90
91PKG_CHECK_MODULES(CAIRO_PNG, cairo-png, have_cairo_png=true, have_cairo_png=false)
92if $have_cairo_png; then
93 AC_DEFINE(HAVE_CAIRO_PNG, 1, [Have cairo-png support in cairo graphics library])
94fi
95AM_CONDITIONAL(HAVE_CAIRO_PNG, $have_cairo_png)
96
97PKG_CHECK_MODULES(CAIRO_FT, cairo-ft, have_cairo_ft=true, have_cairo_ft=false)
98if $have_cairo_ft; then
99 AC_DEFINE(HAVE_CAIRO_FT, 1, [Have cairo-ft support in cairo graphics library])
100fi
101AM_CONDITIONAL(HAVE_CAIRO_FT, $have_cairo_ft)
102
Behdad Esfahbod174e3fe2011-05-05 19:37:53 -0400103dnl ==========================================================================
104
Behdad Esfahbodd1f17072010-11-30 00:57:15 -0500105PKG_CHECK_MODULES(ICU, icu, have_icu=true, [
Behdad Esfahbode9c23412011-08-02 11:40:44 -0400106 if test $cross_compiling == no; then
107 AC_CHECK_PROG([have_icu], [icu-config], [true], [false])
108 if $have_icu; then
Behdad Esfahbod0d7d4822011-08-03 17:39:24 -0400109 ICU_CFLAGS=`icu-config --cppflags`
110 ICU_LIBS=`icu-config --ldflags-libsonly`
111 ICU_CFLAGS=`echo "$ICU_CFLAGS" | sed "s@ -I/usr/include @ @"`
112 AC_SUBST(ICU_CFLAGS)
113 AC_SUBST(ICU_LIBS)
Behdad Esfahbode9c23412011-08-02 11:40:44 -0400114 fi
Behdad Esfahbodecd3b6e2011-08-04 01:57:40 -0400115 else
116 have_icu=false
Behdad Esfahbodd1f17072010-11-30 00:57:15 -0500117 fi
118])
Behdad Esfahbodd94647e2009-11-03 16:35:10 -0500119if $have_icu; then
120 AC_DEFINE(HAVE_ICU, 1, [Have ICU library])
121fi
122AM_CONDITIONAL(HAVE_ICU, $have_icu)
123
Behdad Esfahbod174e3fe2011-05-05 19:37:53 -0400124dnl ==========================================================================
125
Behdad Esfahbodeb4ebda2009-11-03 14:09:32 -0500126PKG_CHECK_MODULES(FREETYPE, freetype2, have_freetype=true, have_freetype=false)
Behdad Esfahbodf94cf6b2009-11-02 18:55:19 -0500127if $have_freetype; then
128 AC_DEFINE(HAVE_FREETYPE, 1, [Have FreeType 2 library])
Behdad Esfahbodcd11a982009-12-20 23:05:02 +0100129 _save_libs="$LIBS"
130 _save_cflags="$CFLAGS"
131 LIBS="$LIBS $FREETYPE_LIBS"
132 CFLAGS="$CFLAGS $FREETYPE_CFLAGS"
133 AC_CHECK_FUNCS(FT_Face_GetCharVariantIndex)
134 LIBS="$_save_libs"
135 CFLAGS="$_save_cflags"
Behdad Esfahbodf94cf6b2009-11-02 18:55:19 -0500136fi
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500137AM_CONDITIONAL(HAVE_FREETYPE, $have_freetype)
138
Behdad Esfahbodc78f4482011-05-05 21:31:04 -0400139dnl ===========================================================================
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500140
Behdad Esfahbod02aeca92011-08-04 22:31:05 -0400141have_ot=true;
142if $have_ot; then
143 AC_DEFINE(HAVE_OT, 1, [Have native OpenType Layout backend])
144fi
145AM_CONDITIONAL(HAVE_OT, $have_ot)
146
147dnl ===========================================================================
148
Behdad Esfahbod0fbb2dc2011-08-03 19:55:04 -0400149AC_CHECK_HEADERS(usp10.h windows.h, have_uniscribe=true, have_uniscribe=false)
150if $have_uniscribe; then
151 UNISCRIBE_CFLAGS=
152 UNISCRIBE_LIBS="-lusp10 -lgdi32"
153 AC_SUBST(UNISCRIBE_CFLAGS)
154 AC_SUBST(UNISCRIBE_LIBS)
Behdad Esfahbod02aeca92011-08-04 22:31:05 -0400155 AC_DEFINE(HAVE_UNISCRIBE, 1, [Have Uniscribe backend])
Behdad Esfahbod0fbb2dc2011-08-03 19:55:04 -0400156fi
157AM_CONDITIONAL(HAVE_UNISCRIBE, $have_uniscribe)
158
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500159AC_CONFIG_FILES([
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500160Makefile
Behdad Esfahbodc78f4482011-05-05 21:31:04 -0400161harfbuzz.pc
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500162src/Makefile
Behdad Esfahbodc78f4482011-05-05 21:31:04 -0400163src/hb-version.h
Behdad Esfahbodbbdeff52011-04-07 16:05:07 -0400164test/Makefile
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500165])
166
167AC_OUTPUT