michael@0: AC_PREREQ([2.64]) michael@0: AC_INIT([harfbuzz], michael@0: [0.7.0], michael@0: [http://bugs.freedesktop.org/enter_bug.cgi?product=harfbuzz], michael@0: [harfbuzz], michael@0: [http://harfbuzz.org/]) michael@0: michael@0: AC_CONFIG_SRCDIR([harfbuzz.pc.in]) michael@0: AC_CONFIG_HEADERS([config.h]) michael@0: michael@0: AM_INIT_AUTOMAKE([1.11.1 gnu dist-bzip2 no-dist-gzip -Wall no-define]) michael@0: AM_SILENT_RULES([yes]) michael@0: michael@0: # Check for programs michael@0: AC_PROG_CC michael@0: AM_PROG_CC_C_O michael@0: AC_PROG_CXX michael@0: michael@0: # Initialize libtool michael@0: LT_PREREQ([2.2]) michael@0: LT_INIT([disable-static]) michael@0: michael@0: # Version michael@0: m4_define(hb_version_triplet,m4_split(AC_PACKAGE_VERSION,[[.]])) michael@0: m4_define(hb_version_major,m4_argn(1,hb_version_triplet)) michael@0: m4_define(hb_version_minor,m4_argn(2,hb_version_triplet)) michael@0: m4_define(hb_version_micro,m4_argn(3,hb_version_triplet)) michael@0: HB_VERSION_MAJOR=hb_version_major michael@0: HB_VERSION_MINOR=hb_version_minor michael@0: HB_VERSION_MICRO=hb_version_micro michael@0: HB_VERSION=AC_PACKAGE_VERSION michael@0: AC_SUBST(HB_VERSION_MAJOR) michael@0: AC_SUBST(HB_VERSION_MINOR) michael@0: AC_SUBST(HB_VERSION_MICRO) michael@0: AC_SUBST(HB_VERSION) michael@0: michael@0: # Libtool version michael@0: m4_define([hb_version_int], michael@0: m4_eval(hb_version_major*10000 + hb_version_minor*100 + hb_version_micro)) michael@0: m4_if(m4_eval(hb_version_minor % 2), [1], michael@0: dnl for unstable releases michael@0: [m4_define([hb_libtool_revision], 0)], michael@0: dnl for stable releases michael@0: [m4_define([hb_libtool_revision], hb_version_micro)]) michael@0: m4_define([hb_libtool_age], michael@0: m4_eval(hb_version_int - hb_libtool_revision)) michael@0: m4_define([hb_libtool_current], michael@0: m4_eval(hb_version_major + hb_libtool_age)) michael@0: HB_LIBTOOL_VERSION_INFO=hb_libtool_current:hb_libtool_revision:hb_libtool_age michael@0: AC_SUBST(HB_LIBTOOL_VERSION_INFO) michael@0: michael@0: dnl GTK_DOC_CHECK([1.15],[--flavour no-tmpl]) michael@0: michael@0: # Functions and headers michael@0: AC_CHECK_FUNCS(mprotect sysconf getpagesize mmap _setmode) michael@0: AC_CHECK_HEADERS(unistd.h sys/mman.h io.h) michael@0: michael@0: # Compiler flags michael@0: AC_CANONICAL_HOST michael@0: if test "x$GCC" = "xyes"; then michael@0: michael@0: # Make symbols link locally michael@0: LDFLAGS="$LDFLAGS -Bsymbolic-functions" michael@0: michael@0: # Make sure we don't link to libstdc++ michael@0: CXXFLAGS="$CXXFLAGS -fno-rtti -fno-exceptions" michael@0: michael@0: case "$host" in michael@0: arm-*-*) michael@0: # Request byte alignment on arm michael@0: CXXFLAGS="$CXXFLAGS -mstructure-size-boundary=8" michael@0: ;; michael@0: esac michael@0: fi michael@0: michael@0: dnl ========================================================================== michael@0: michael@0: PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, have_glib=true, have_glib=false) michael@0: if $have_glib; then michael@0: AC_DEFINE(HAVE_GLIB, 1, [Have glib2 library]) michael@0: fi michael@0: AM_CONDITIONAL(HAVE_GLIB, $have_glib) michael@0: michael@0: PKG_CHECK_MODULES(GTHREAD, gthread-2.0, have_gthread=true, have_gthread=false) michael@0: if $have_gthread; then michael@0: AC_DEFINE(HAVE_GTHREAD, 1, [Have gthread2 library]) michael@0: fi michael@0: AM_CONDITIONAL(HAVE_GTHREAD, $have_gthread) michael@0: michael@0: PKG_CHECK_MODULES(GOBJECT, gobject-2.0 glib-2.0 >= 2.16, have_gobject=true, have_gobject=false) michael@0: if $have_gobject; then michael@0: AC_DEFINE(HAVE_GOBJECT, 1, [Have gobject2 library]) michael@0: GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` michael@0: AC_SUBST(GLIB_MKENUMS) michael@0: fi michael@0: AM_CONDITIONAL(HAVE_GOBJECT, $have_gobject) michael@0: michael@0: dnl ========================================================================== michael@0: michael@0: PKG_CHECK_MODULES(CAIRO, cairo >= 1.8.0, have_cairo=true, have_cairo=false) michael@0: if $have_cairo; then michael@0: AC_DEFINE(HAVE_CAIRO, 1, [Have cairo graphics library]) michael@0: fi michael@0: AM_CONDITIONAL(HAVE_CAIRO, $have_cairo) michael@0: michael@0: PKG_CHECK_MODULES(CAIRO_FT, cairo-ft, have_cairo_ft=true, have_cairo_ft=false) michael@0: if $have_cairo_ft; then michael@0: AC_DEFINE(HAVE_CAIRO_FT, 1, [Have cairo-ft support in cairo graphics library]) michael@0: fi michael@0: AM_CONDITIONAL(HAVE_CAIRO_FT, $have_cairo_ft) michael@0: michael@0: dnl ========================================================================== michael@0: michael@0: PKG_CHECK_MODULES(ICU, icu, have_icu=true, [ michael@0: have_icu=true michael@0: AC_CHECK_HEADERS(unicode/uchar.h,, have_icu=false) michael@0: AC_MSG_CHECKING([for libicuuc]) michael@0: LIBS_old=$LIBS michael@0: LIBS="$LIBS -licuuc" michael@0: AC_TRY_LINK([#include ], michael@0: [u_getIntPropertyValue (0, (UProperty)0);], michael@0: AC_MSG_RESULT(yes), michael@0: AC_MSG_RESULT(no);have_icu=false) michael@0: LIBS=$LIBS_old michael@0: if $have_icu; then michael@0: ICU_CFLAGS=-D_REENTRANT michael@0: ICU_LIBS="-licuuc" michael@0: AC_SUBST(ICU_CFLAGS) michael@0: AC_SUBST(ICU_LIBS) michael@0: fi michael@0: ]) michael@0: if $have_icu; then michael@0: AC_DEFINE(HAVE_ICU, 1, [Have ICU library]) michael@0: fi michael@0: AM_CONDITIONAL(HAVE_ICU, $have_icu) michael@0: michael@0: dnl ========================================================================== michael@0: michael@0: PKG_CHECK_MODULES(GRAPHITE, graphite2, have_graphite=true, have_graphite=false) michael@0: if $have_graphite; then michael@0: AC_DEFINE(HAVE_GRAPHITE, 1, [Have Graphite library]) michael@0: fi michael@0: AM_CONDITIONAL(HAVE_GRAPHITE, $have_graphite) michael@0: michael@0: dnl ========================================================================== michael@0: michael@0: PKG_CHECK_MODULES(FREETYPE, freetype2 >= 2.3.8, have_freetype=true, have_freetype=false) michael@0: if $have_freetype; then michael@0: AC_DEFINE(HAVE_FREETYPE, 1, [Have FreeType 2 library]) michael@0: _save_libs="$LIBS" michael@0: _save_cflags="$CFLAGS" michael@0: LIBS="$LIBS $FREETYPE_LIBS" michael@0: CFLAGS="$CFLAGS $FREETYPE_CFLAGS" michael@0: AC_CHECK_FUNCS(FT_Face_GetCharVariantIndex) michael@0: LIBS="$_save_libs" michael@0: CFLAGS="$_save_cflags" michael@0: fi michael@0: AM_CONDITIONAL(HAVE_FREETYPE, $have_freetype) michael@0: michael@0: dnl =========================================================================== michael@0: michael@0: have_ot=true; michael@0: if $have_ot; then michael@0: AC_DEFINE(HAVE_OT, 1, [Have native OpenType Layout backend]) michael@0: fi michael@0: AM_CONDITIONAL(HAVE_OT, $have_ot) michael@0: michael@0: dnl =========================================================================== michael@0: michael@0: AC_CHECK_HEADERS(usp10.h windows.h, have_uniscribe=true, have_uniscribe=false) michael@0: if $have_uniscribe; then michael@0: UNISCRIBE_CFLAGS= michael@0: UNISCRIBE_LIBS="-lusp10 -lgdi32" michael@0: AC_SUBST(UNISCRIBE_CFLAGS) michael@0: AC_SUBST(UNISCRIBE_LIBS) michael@0: AC_DEFINE(HAVE_UNISCRIBE, 1, [Have Uniscribe backend]) michael@0: fi michael@0: AM_CONDITIONAL(HAVE_UNISCRIBE, $have_uniscribe) michael@0: michael@0: AC_CONFIG_FILES([ michael@0: Makefile michael@0: harfbuzz.pc michael@0: src/Makefile michael@0: src/hb-version.h michael@0: util/Makefile michael@0: test/Makefile michael@0: ]) michael@0: michael@0: AC_OUTPUT