configure.ac 5.5 KB
Newer Older
1 2
AC_PREREQ([2.64])
AC_INIT([harfbuzz],
3
        [0.7.0],
4 5
        [http://bugs.freedesktop.org/enter_bug.cgi?product=harfbuzz],
        [harfbuzz],
B
Behdad Esfahbod 已提交
6
        [http://harfbuzz.org/])
7

B
Behdad Esfahbod 已提交
8 9
AC_CONFIG_SRCDIR([harfbuzz.pc.in])
AC_CONFIG_HEADERS([config.h])
10 11 12

AM_INIT_AUTOMAKE([1.11.1 gnu dist-bzip2 no-dist-gzip -Wall no-define])
AM_SILENT_RULES([yes])
B
Behdad Esfahbod 已提交
13

14
# Check for programs
B
Behdad Esfahbod 已提交
15
AC_PROG_CC
B
Behdad Esfahbod 已提交
16
AM_PROG_CC_C_O
B
Behdad Esfahbod 已提交
17 18
AC_PROG_CXX

19 20
# Initialize libtool
LT_PREREQ([2.2])
21
LT_INIT([disable-static])
22

23
# Version
B
Behdad Esfahbod 已提交
24 25 26 27 28 29 30
m4_define(hb_version_triplet,m4_split(AC_PACKAGE_VERSION,[[.]]))
m4_define(hb_version_major,m4_argn(1,hb_version_triplet))
m4_define(hb_version_minor,m4_argn(2,hb_version_triplet))
m4_define(hb_version_micro,m4_argn(3,hb_version_triplet))
HB_VERSION_MAJOR=hb_version_major
HB_VERSION_MINOR=hb_version_minor
HB_VERSION_MICRO=hb_version_micro
31 32 33 34 35 36
HB_VERSION=AC_PACKAGE_VERSION
AC_SUBST(HB_VERSION_MAJOR)
AC_SUBST(HB_VERSION_MINOR)
AC_SUBST(HB_VERSION_MICRO)
AC_SUBST(HB_VERSION)

B
Behdad Esfahbod 已提交
37 38 39 40 41 42 43 44 45 46 47 48 49 50
# Libtool version
m4_define([hb_version_int],
	  m4_eval(hb_version_major*10000 + hb_version_minor*100 + hb_version_micro))
m4_if(m4_eval(hb_version_minor % 2), [1],
      dnl for unstable releases
      [m4_define([hb_libtool_revision], 0)],
      dnl for stable releases
      [m4_define([hb_libtool_revision], hb_version_micro)])
m4_define([hb_libtool_age],
	  m4_eval(hb_version_int - hb_libtool_revision))
m4_define([hb_libtool_current],
	  m4_eval(hb_version_major + hb_libtool_age))
HB_LIBTOOL_VERSION_INFO=hb_libtool_current:hb_libtool_revision:hb_libtool_age
AC_SUBST(HB_LIBTOOL_VERSION_INFO)
51

52 53
GTK_DOC_CHECK([1.15],[--flavour no-tmpl])

B
Behdad Esfahbod 已提交
54
# Functions and headers
55
AC_CHECK_FUNCS(mprotect sysconf getpagesize mmap _setmode)
56
AC_CHECK_HEADERS(unistd.h sys/mman.h io.h)
B
Behdad Esfahbod 已提交
57

B
Behdad Esfahbod 已提交
58
# Compiler flags
59
AC_CANONICAL_HOST
B
Behdad Esfahbod 已提交
60
if test "x$GCC" = "xyes"; then
61

62 63 64
	# Make symbols link locally
	LDFLAGS="$LDFLAGS -Bsymbolic-functions"

65
	# Make sure we don't link to libstdc++
B
Behdad Esfahbod 已提交
66
	CXXFLAGS="$CXXFLAGS -fno-rtti -fno-exceptions"
67 68 69 70 71 72 73

	case "$host" in
		arm-*-*)
			# Request byte alignment on arm
			CXXFLAGS="$CXXFLAGS -mstructure-size-boundary=8"
		;;
	esac
B
Behdad Esfahbod 已提交
74 75 76 77
fi

dnl ==========================================================================

B
Behdad Esfahbod 已提交
78
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, have_glib=true, have_glib=false)
79
if $have_glib; then
B
Behdad Esfahbod 已提交
80
	AC_DEFINE(HAVE_GLIB, 1, [Have glib2 library])
81
fi
B
Behdad Esfahbod 已提交
82 83
AM_CONDITIONAL(HAVE_GLIB, $have_glib)

84 85 86 87 88 89 90 91 92
PKG_CHECK_MODULES(GTHREAD, gthread-2.0, have_gthread=true, have_gthread=false)
if $have_gthread; then
	AC_DEFINE(HAVE_GTHREAD, 1, [Have gthread2 library])
fi
AM_CONDITIONAL(HAVE_GTHREAD, $have_gthread)

PKG_CHECK_MODULES(GOBJECT, gobject-2.0, have_gobject=true, have_gobject=false)
if $have_gobject; then
	AC_DEFINE(HAVE_GOBJECT, 1, [Have gobject2 library])
93 94
	GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
	AC_SUBST(GLIB_MKENUMS)
95 96 97
fi
AM_CONDITIONAL(HAVE_GOBJECT, $have_gobject)

B
Behdad Esfahbod 已提交
98 99
dnl ==========================================================================

B
Behdad Esfahbod 已提交
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
PKG_CHECK_MODULES(CAIRO, cairo >= 1.8.0, have_cairo=true, have_cairo=false)
if $have_cairo; then
	AC_DEFINE(HAVE_CAIRO, 1, [Have cairo graphics library])
fi
AM_CONDITIONAL(HAVE_CAIRO, $have_cairo)

PKG_CHECK_MODULES(CAIRO_PNG, cairo-png, have_cairo_png=true, have_cairo_png=false)
if $have_cairo_png; then
	AC_DEFINE(HAVE_CAIRO_PNG, 1, [Have cairo-png support in cairo graphics library])
fi
AM_CONDITIONAL(HAVE_CAIRO_PNG, $have_cairo_png)

PKG_CHECK_MODULES(CAIRO_FT, cairo-ft, have_cairo_ft=true, have_cairo_ft=false)
if $have_cairo_ft; then
	AC_DEFINE(HAVE_CAIRO_FT, 1, [Have cairo-ft support in cairo graphics library])
fi
AM_CONDITIONAL(HAVE_CAIRO_FT, $have_cairo_ft)

B
Behdad Esfahbod 已提交
118 119
dnl ==========================================================================

120
PKG_CHECK_MODULES(ICU, icu, have_icu=true, [
121 122 123
	if test $cross_compiling == no; then
		AC_CHECK_PROG([have_icu], [icu-config], [true], [false])
		if $have_icu; then
B
Minor  
Behdad Esfahbod 已提交
124 125 126 127 128
			ICU_CFLAGS=`icu-config --cppflags`
			ICU_LIBS=`icu-config --ldflags-libsonly`
			ICU_CFLAGS=`echo "$ICU_CFLAGS" | sed "s@ -I/usr/include @ @"`
			AC_SUBST(ICU_CFLAGS)
			AC_SUBST(ICU_LIBS)
129
		fi
B
Behdad Esfahbod 已提交
130 131
	else
		have_icu=false
132 133
	fi
])
B
Behdad Esfahbod 已提交
134 135 136 137 138
if $have_icu; then
	AC_DEFINE(HAVE_ICU, 1, [Have ICU library])
fi
AM_CONDITIONAL(HAVE_ICU, $have_icu)

B
Behdad Esfahbod 已提交
139
dnl ==========================================================================
140 141

PKG_CHECK_MODULES(GRAPHITE, graphite2, have_graphite=true, have_graphite=false)
B
Behdad Esfahbod 已提交
142
if $have_graphite; then
143 144
    AC_DEFINE(HAVE_GRAPHITE, 1, [Have Graphite library])
fi
B
Behdad Esfahbod 已提交
145 146 147
AM_CONDITIONAL(HAVE_GRAPHITE, $have_graphite)

dnl ==========================================================================
B
Behdad Esfahbod 已提交
148

149
PKG_CHECK_MODULES(FREETYPE, freetype2 >= 2.3.8, have_freetype=true, have_freetype=false)
150 151
if $have_freetype; then
	AC_DEFINE(HAVE_FREETYPE, 1, [Have FreeType 2 library])
B
Behdad Esfahbod 已提交
152 153 154 155 156 157 158
	_save_libs="$LIBS"
	_save_cflags="$CFLAGS"
	LIBS="$LIBS $FREETYPE_LIBS"
	CFLAGS="$CFLAGS $FREETYPE_CFLAGS"
	AC_CHECK_FUNCS(FT_Face_GetCharVariantIndex)
	LIBS="$_save_libs"
	CFLAGS="$_save_cflags"
159
fi
B
Behdad Esfahbod 已提交
160 161
AM_CONDITIONAL(HAVE_FREETYPE, $have_freetype)

162
dnl ===========================================================================
B
Behdad Esfahbod 已提交
163

164 165 166 167 168 169 170 171
have_ot=true;
if $have_ot; then
	AC_DEFINE(HAVE_OT, 1, [Have native OpenType Layout backend])
fi
AM_CONDITIONAL(HAVE_OT, $have_ot)

dnl ===========================================================================

172 173 174 175 176 177
AC_CHECK_HEADERS(usp10.h windows.h, have_uniscribe=true, have_uniscribe=false)
if $have_uniscribe; then
	UNISCRIBE_CFLAGS=
	UNISCRIBE_LIBS="-lusp10 -lgdi32"
	AC_SUBST(UNISCRIBE_CFLAGS)
	AC_SUBST(UNISCRIBE_LIBS)
178
	AC_DEFINE(HAVE_UNISCRIBE, 1, [Have Uniscribe backend])
179 180 181
fi
AM_CONDITIONAL(HAVE_UNISCRIBE, $have_uniscribe)

B
Behdad Esfahbod 已提交
182 183
AC_CONFIG_FILES([
Makefile
184
harfbuzz.pc
B
Behdad Esfahbod 已提交
185
src/Makefile
186
src/hb-version.h
B
Behdad Esfahbod 已提交
187
util/Makefile
B
Behdad Esfahbod 已提交
188
test/Makefile
B
Behdad Esfahbod 已提交
189 190 191
])

AC_OUTPUT