configure.ac 5.4 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

B
Minor  
Behdad Esfahbod 已提交
14 15 16 17
# Initialize libtool
LT_PREREQ([2.2])
LT_INIT([disable-static])

18
# Check for programs
B
Behdad Esfahbod 已提交
19
AC_PROG_CC
B
Behdad Esfahbod 已提交
20
AM_PROG_CC_C_O
B
Behdad Esfahbod 已提交
21 22
AC_PROG_CXX

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

B
Behdad Esfahbod 已提交
52
dnl GTK_DOC_CHECK([1.15],[--flavour no-tmpl])
53

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
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)

90
PKG_CHECK_MODULES(GOBJECT, gobject-2.0 glib-2.0 >= 2.16, have_gobject=true, have_gobject=false)
91 92
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
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_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 已提交
112 113
dnl ==========================================================================

114
PKG_CHECK_MODULES(ICU, icu, have_icu=true, [
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
	have_icu=true
	AC_CHECK_HEADERS(unicode/uchar.h,, have_icu=false)
	AC_MSG_CHECKING([for libicuuc])
	LIBS_old=$LIBS
	LIBS="$LIBS -licuuc"
	AC_TRY_LINK([#include <unicode/uchar.h>],
		    [u_getIntPropertyValue (0, (UProperty)0);],
		    AC_MSG_RESULT(yes),
		    AC_MSG_RESULT(no);have_icu=false)
	LIBS=$LIBS_old
	if $have_icu; then
		ICU_CFLAGS=-D_REENTRANT
		ICU_LIBS="-licuuc"
		AC_SUBST(ICU_CFLAGS)
		AC_SUBST(ICU_LIBS)
130 131
	fi
])
B
Behdad Esfahbod 已提交
132 133 134 135 136
if $have_icu; then
	AC_DEFINE(HAVE_ICU, 1, [Have ICU library])
fi
AM_CONDITIONAL(HAVE_ICU, $have_icu)

B
Behdad Esfahbod 已提交
137
dnl ==========================================================================
138 139

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

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

147
PKG_CHECK_MODULES(FREETYPE, freetype2 >= 2.3.8, have_freetype=true, have_freetype=false)
148 149
if $have_freetype; then
	AC_DEFINE(HAVE_FREETYPE, 1, [Have FreeType 2 library])
B
Behdad Esfahbod 已提交
150 151 152 153 154 155 156
	_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"
157
fi
B
Behdad Esfahbod 已提交
158 159
AM_CONDITIONAL(HAVE_FREETYPE, $have_freetype)

160
dnl ===========================================================================
B
Behdad Esfahbod 已提交
161

162 163 164 165 166 167 168 169
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 ===========================================================================

170 171 172 173 174 175
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)
176
	AC_DEFINE(HAVE_UNISCRIBE, 1, [Have Uniscribe backend])
177 178 179
fi
AM_CONDITIONAL(HAVE_UNISCRIBE, $have_uniscribe)

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

AC_OUTPUT