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

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

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

60 61 62
	# Make symbols link locally
	LDFLAGS="$LDFLAGS -Bsymbolic-functions"

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

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

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

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

B
Behdad Esfahbod 已提交
83 84
dnl ==========================================================================

B
Behdad Esfahbod 已提交
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
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 已提交
103 104
dnl ==========================================================================

105
PKG_CHECK_MODULES(ICU, icu, have_icu=true, [
106 107 108
	if test $cross_compiling == no; then
		AC_CHECK_PROG([have_icu], [icu-config], [true], [false])
		if $have_icu; then
B
Minor  
Behdad Esfahbod 已提交
109 110 111 112 113
			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)
114
		fi
B
Behdad Esfahbod 已提交
115 116
	else
		have_icu=false
117 118
	fi
])
B
Behdad Esfahbod 已提交
119 120 121 122 123
if $have_icu; then
	AC_DEFINE(HAVE_ICU, 1, [Have ICU library])
fi
AM_CONDITIONAL(HAVE_ICU, $have_icu)

B
Behdad Esfahbod 已提交
124 125
dnl ==========================================================================

126
PKG_CHECK_MODULES(FREETYPE, freetype2, have_freetype=true, have_freetype=false)
127 128
if $have_freetype; then
	AC_DEFINE(HAVE_FREETYPE, 1, [Have FreeType 2 library])
B
Behdad Esfahbod 已提交
129 130 131 132 133 134 135
	_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"
136
fi
B
Behdad Esfahbod 已提交
137 138
AM_CONDITIONAL(HAVE_FREETYPE, $have_freetype)

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

141 142 143 144 145 146 147 148 149
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)
fi
AM_CONDITIONAL(HAVE_UNISCRIBE, $have_uniscribe)

B
Behdad Esfahbod 已提交
150 151
AC_CONFIG_FILES([
Makefile
152
harfbuzz.pc
B
Behdad Esfahbod 已提交
153
src/Makefile
154
src/hb-version.h
B
Behdad Esfahbod 已提交
155
test/Makefile
B
Behdad Esfahbod 已提交
156 157 158
])

AC_OUTPUT