blob: 96dbca52569a2ab36c43cb243a3c9f6c3f5572f3 [file] [log] [blame]
Javier Jardón2abe1262011-01-09 22:18:53 -05001AC_PREREQ([2.64])
2AC_INIT([harfbuzz],
Behdad Esfahbodc78f4482011-05-05 21:31:04 -04003 [0.5.0],
Javier Jardón2abe1262011-01-09 22:18:53 -05004 [http://bugs.freedesktop.org/enter_bug.cgi?product=harfbuzz],
5 [harfbuzz],
6 [http://freedesktop.org/wiki/Software/harfbuzz])
7
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
24m4_define(version_triplet,m4_split(AC_PACKAGE_VERSION,[[.]]))
25HB_VERSION_MAJOR=m4_argn(1,version_triplet)
26HB_VERSION_MINOR=m4_argn(2,version_triplet)
27HB_VERSION_MICRO=m4_argn(3,version_triplet)
28HB_VERSION=AC_PACKAGE_VERSION
29
30AC_SUBST(HB_VERSION_MAJOR)
31AC_SUBST(HB_VERSION_MINOR)
32AC_SUBST(HB_VERSION_MICRO)
33AC_SUBST(HB_VERSION)
34
35
Behdad Esfahbod174e3fe2011-05-05 19:37:53 -040036# Functions and headers
Behdad Esfahbod29aa4002009-11-02 16:28:39 -050037AC_CHECK_FUNCS(mprotect sysconf getpagesize)
38AC_CHECK_HEADERS(unistd.h sys/mman.h)
39
Behdad Esfahbod174e3fe2011-05-05 19:37:53 -040040# Compiler flags
Behdad Esfahbodc78f4482011-05-05 21:31:04 -040041AC_CANONICAL_HOST
Behdad Esfahbod29aa4002009-11-02 16:28:39 -050042if test "x$GCC" = "xyes"; then
Behdad Esfahbod5b7f3892011-04-27 15:10:12 -040043
Behdad Esfahbod71cef142011-05-06 19:30:59 -040044 # Make symbols link locally
45 LDFLAGS="$LDFLAGS -Bsymbolic-functions"
46
Behdad Esfahbod5b7f3892011-04-27 15:10:12 -040047 # Make sure we don't link to libstdc++
Behdad Esfahbod29aa4002009-11-02 16:28:39 -050048 CXXFLAGS="$CXXFLAGS -fno-rtti -fno-exceptions"
Behdad Esfahbod5b7f3892011-04-27 15:10:12 -040049
50 case "$host" in
51 arm-*-*)
52 # Request byte alignment on arm
53 CXXFLAGS="$CXXFLAGS -mstructure-size-boundary=8"
54 ;;
55 esac
Behdad Esfahbod29aa4002009-11-02 16:28:39 -050056fi
57
58dnl ==========================================================================
59
Behdad Esfahbode6a5b882011-05-05 16:24:42 -040060PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, have_glib=true, have_glib=false)
Behdad Esfahbod0c2ec1d2011-05-10 19:11:27 -040061PKG_CHECK_MODULES(GTHREAD, gthread-2.0, , have_glib=false)
Behdad Esfahbodf94cf6b2009-11-02 18:55:19 -050062if $have_glib; then
Behdad Esfahbodd94647e2009-11-03 16:35:10 -050063 AC_DEFINE(HAVE_GLIB, 1, [Have glib2 library])
Behdad Esfahbodf94cf6b2009-11-02 18:55:19 -050064fi
Behdad Esfahbod29aa4002009-11-02 16:28:39 -050065AM_CONDITIONAL(HAVE_GLIB, $have_glib)
66
Behdad Esfahbod174e3fe2011-05-05 19:37:53 -040067dnl ==========================================================================
68
Behdad Esfahbod5353bf42011-02-22 18:06:19 -050069PKG_CHECK_MODULES(CAIRO, cairo >= 1.8.0, have_cairo=true, have_cairo=false)
70if $have_cairo; then
71 AC_DEFINE(HAVE_CAIRO, 1, [Have cairo graphics library])
72fi
73AM_CONDITIONAL(HAVE_CAIRO, $have_cairo)
74
75PKG_CHECK_MODULES(CAIRO_PNG, cairo-png, have_cairo_png=true, have_cairo_png=false)
76if $have_cairo_png; then
77 AC_DEFINE(HAVE_CAIRO_PNG, 1, [Have cairo-png support in cairo graphics library])
78fi
79AM_CONDITIONAL(HAVE_CAIRO_PNG, $have_cairo_png)
80
81PKG_CHECK_MODULES(CAIRO_FT, cairo-ft, have_cairo_ft=true, have_cairo_ft=false)
82if $have_cairo_ft; then
83 AC_DEFINE(HAVE_CAIRO_FT, 1, [Have cairo-ft support in cairo graphics library])
84fi
85AM_CONDITIONAL(HAVE_CAIRO_FT, $have_cairo_ft)
86
Behdad Esfahbod174e3fe2011-05-05 19:37:53 -040087dnl ==========================================================================
88
Behdad Esfahbodd1f17072010-11-30 00:57:15 -050089PKG_CHECK_MODULES(ICU, icu, have_icu=true, [
Behdad Esfahbod76691f02011-01-06 14:16:59 -050090 AC_CHECK_PROG([have_icu], [icu-config], [true], [false])
Behdad Esfahbodd1f17072010-11-30 00:57:15 -050091 if $have_icu; then
92 icu_cflags=`icu-config --cppflags`
93 icu_libs=`icu-config --ldflags-libsonly`
94 AC_SUBST(ICU_CFLAGS, [$icu_cflags])
95 AC_SUBST(ICU_LIBS, [$icu_libs])
96 fi
97])
Behdad Esfahbodd94647e2009-11-03 16:35:10 -050098if $have_icu; then
99 AC_DEFINE(HAVE_ICU, 1, [Have ICU library])
100fi
101AM_CONDITIONAL(HAVE_ICU, $have_icu)
102
Behdad Esfahbod174e3fe2011-05-05 19:37:53 -0400103dnl ==========================================================================
104
Behdad Esfahbodeb4ebda2009-11-03 14:09:32 -0500105PKG_CHECK_MODULES(FREETYPE, freetype2, have_freetype=true, have_freetype=false)
Behdad Esfahbodf94cf6b2009-11-02 18:55:19 -0500106if $have_freetype; then
107 AC_DEFINE(HAVE_FREETYPE, 1, [Have FreeType 2 library])
Behdad Esfahbodcd11a982009-12-20 23:05:02 +0100108 _save_libs="$LIBS"
109 _save_cflags="$CFLAGS"
110 LIBS="$LIBS $FREETYPE_LIBS"
111 CFLAGS="$CFLAGS $FREETYPE_CFLAGS"
112 AC_CHECK_FUNCS(FT_Face_GetCharVariantIndex)
113 LIBS="$_save_libs"
114 CFLAGS="$_save_cflags"
Behdad Esfahbodf94cf6b2009-11-02 18:55:19 -0500115fi
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500116AM_CONDITIONAL(HAVE_FREETYPE, $have_freetype)
117
Behdad Esfahbodc78f4482011-05-05 21:31:04 -0400118dnl ===========================================================================
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500119
120AC_CONFIG_FILES([
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500121Makefile
Behdad Esfahbodc78f4482011-05-05 21:31:04 -0400122harfbuzz.pc
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500123src/Makefile
Behdad Esfahbodc78f4482011-05-05 21:31:04 -0400124src/hb-version.h
Behdad Esfahbodbbdeff52011-04-07 16:05:07 -0400125test/Makefile
Behdad Esfahbod29aa4002009-11-02 16:28:39 -0500126])
127
128AC_OUTPUT