1 AC_INIT(libass, 0.9.12)
3 AC_CONFIG_MACRO_DIR([m4])
4 # Disable C++/Fortran checks
5 define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])
6 define([AC_LIBTOOL_LANG_F77_CONFIG], [:])
8 AC_CONFIG_SRCDIR([libass/ass.c])
9 AC_CONFIG_HEADER([config.h])
11 # Checks for programs.
16 # Checks for header files.
19 AC_CHECK_HEADERS([inttypes.h stdint.h stdlib.h string.h sys/time.h unistd.h iconv.h])
21 # Checks for typedefs, structures, and compiler characteristics.
29 # Checks for library functions.
30 AC_CHECK_FUNCS([mkdir strcasecmp strdup strtol])
32 # Checks for libraries.
33 AC_SEARCH_LIBS([iconv_open], [iconv], AC_DEFINE(CONFIG_ICONV, 1, [use iconv]))
34 AC_CHECK_LIB([m], [fabs])
36 # Check for libraries via pkg-config
37 AC_ARG_ENABLE([test], AS_HELP_STRING([--enable-test],
38 [enable test program (requires libpng) @<:@default=no@:>@]))
39 AC_ARG_ENABLE([enca], AS_HELP_STRING([--disable-enca],
40 [disable enca (charset autodetect) support @<:@default=check@:>@]))
41 AC_ARG_ENABLE([fontconfig], AS_HELP_STRING([--disable-fontconfig],
42 [disable fontconfig support @<:@default=enabled@:>@]))
43 AC_ARG_ENABLE([fribidi], AS_HELP_STRING([--disable-fribidi],
44 [disable bidi support @<:@default=enabled@:>@]))
46 PKG_CHECK_MODULES([FREETYPE], freetype2 >= 9.10.3, [
47 CFLAGS="$CFLAGS $FREETYPE_CFLAGS"
48 LIBS="$LIBS $FREETYPE_LIBS"
49 AC_DEFINE(CONFIG_FREETYPE, 1, [found freetype2 via pkg-config])
52 if test x$enable_fontconfig != xno; then
53 PKG_CHECK_MODULES([FONTCONFIG], fontconfig >= 2.4.2, [
54 CFLAGS="$CFLAGS $FONTCONFIG_CFLAGS"
55 LIBS="$LIBS $FONTCONFIG_LIBS"
56 AC_DEFINE(CONFIG_FONTCONFIG, 1, [found fontconfig via pkg-config])
61 if test x$enable_fribidi != xno; then
62 PKG_CHECK_MODULES([FRIBIDI], fribidi >= 0.19.0, [
63 CFLAGS="$CFLAGS $FRIBIDI_CFLAGS"
64 LIBS="$LIBS $FRIBIDI_LIBS"
65 AC_DEFINE(CONFIG_FRIBIDI, 1, [found fribidi via pkg-config])
70 if test x$enable_enca != xno; then
71 PKG_CHECK_MODULES([ENCA], enca, [
72 CFLAGS="$CFLAGS $ENCA_CFLAGS"
73 LIBS="$LIBS $ENCA_LIBS"
74 AC_DEFINE(CONFIG_ENCA, 1, [found enca via pkg-config])
80 if test x$enable_test = xyes; then
81 PKG_CHECK_MODULES([LIBPNG], libpng >= 1.2.0, [
82 CFLAGS="$CFLAGS $LIBPNG_CFLAGS"
83 LIBS="$LIBS $LIBPNG_LIBS"
84 AC_DEFINE(CONFIG_LIBPNG, 1, [found libpng via pkg-config])
88 AM_CONDITIONAL([HAVE_LIBPNG], [test x$libpng = xtrue])
90 # Add dependent libraries to pkg-config for static linking
91 PKG_REQUIRES="freetype2 >= 9.6.3"
92 if test x$enca = xtrue; then
93 PKG_REQUIRES="enca, ${PKG_REQUIRES}"
95 if test x$fontconfig = xtrue; then
96 PKG_REQUIRES="fontconfig >= 2.2.0, ${PKG_REQUIRES}"
98 if test x$fribidi = xtrue; then
99 PKG_REQUIRES="fribidi >= 0.19.0, ${PKG_REQUIRES}"
101 AC_SUBST([PKG_REQUIRES])
103 # Setup output beautifier.
104 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
106 AC_CONFIG_FILES([Makefile libass/Makefile test/Makefile libass.pc])