configure.ac 2.9 KB
Newer Older
1 2 3 4 5 6 7
AC_PREREQ([2.64])
AC_INIT([harfbuzz],
        [0.3],
        [http://bugs.freedesktop.org/enter_bug.cgi?product=harfbuzz],
        [harfbuzz],
        [http://freedesktop.org/wiki/Software/harfbuzz])

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

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

13
AM_SILENT_RULES([yes])
B
Behdad Esfahbod 已提交
14

B
Behdad Esfahbod 已提交
15 16
AC_CANONICAL_HOST

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

22 23
# Initialize libtool
LT_PREREQ([2.2])
B
Behdad Esfahbod 已提交
24
LT_INIT([])
25

B
Behdad Esfahbod 已提交
26
# Functions and headers
B
Behdad Esfahbod 已提交
27 28 29
AC_CHECK_FUNCS(mprotect sysconf getpagesize)
AC_CHECK_HEADERS(unistd.h sys/mman.h)

B
Behdad Esfahbod 已提交
30
# Compiler flags
B
Behdad Esfahbod 已提交
31
if test "x$GCC" = "xyes"; then
32 33

	# Make sure we don't link to libstdc++
B
Behdad Esfahbod 已提交
34
	CXXFLAGS="$CXXFLAGS -fno-rtti -fno-exceptions"
35 36 37 38 39 40 41

	case "$host" in
		arm-*-*)
			# Request byte alignment on arm
			CXXFLAGS="$CXXFLAGS -mstructure-size-boundary=8"
		;;
	esac
B
Behdad Esfahbod 已提交
42 43 44 45
fi

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

B
Behdad Esfahbod 已提交
46
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, have_glib=true, have_glib=false)
47
if $have_glib; then
B
Behdad Esfahbod 已提交
48
	AC_DEFINE(HAVE_GLIB, 1, [Have glib2 library])
49
fi
B
Behdad Esfahbod 已提交
50 51
AM_CONDITIONAL(HAVE_GLIB, $have_glib)

B
Behdad Esfahbod 已提交
52 53
dnl ==========================================================================

B
Behdad Esfahbod 已提交
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
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 已提交
72 73
dnl ==========================================================================

74
PKG_CHECK_MODULES(ICU, icu, have_icu=true, [
B
Behdad Esfahbod 已提交
75
	AC_CHECK_PROG([have_icu], [icu-config], [true], [false])
76 77 78 79 80 81 82
	if $have_icu; then
		icu_cflags=`icu-config --cppflags`
		icu_libs=`icu-config --ldflags-libsonly`
		AC_SUBST(ICU_CFLAGS, [$icu_cflags])
		AC_SUBST(ICU_LIBS, [$icu_libs])
	fi
])
B
Behdad Esfahbod 已提交
83 84 85 86 87
if $have_icu; then
	AC_DEFINE(HAVE_ICU, 1, [Have ICU library])
fi
AM_CONDITIONAL(HAVE_ICU, $have_icu)

B
Behdad Esfahbod 已提交
88 89
dnl ==========================================================================

90
PKG_CHECK_MODULES(FREETYPE, freetype2, have_freetype=true, have_freetype=false)
91 92
if $have_freetype; then
	AC_DEFINE(HAVE_FREETYPE, 1, [Have FreeType 2 library])
B
Behdad Esfahbod 已提交
93 94 95 96 97 98 99
	_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"
100
fi
B
Behdad Esfahbod 已提交
101 102 103 104 105 106 107 108
AM_CONDITIONAL(HAVE_FREETYPE, $have_freetype)

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

AC_CONFIG_FILES([
harfbuzz.pc
Makefile
src/Makefile
B
Behdad Esfahbod 已提交
109
test/Makefile
B
Behdad Esfahbod 已提交
110 111 112
])

AC_OUTPUT