From cd0bf3db35a4fa0e7f5ac52453755f7f1f2d444f Mon Sep 17 00:00:00 2001 From: Grigori Goronzy Date: Sat, 11 Jul 2009 02:38:21 +0200 Subject: [PATCH] configure: use pkg-config for libpng, enca Use pkg-config to check for enca and libpng, like it is already done for freetype and fontconfig. Also, use libass/ass.c instead of the test program, test/test.cpp, as the unique source identification. --- configure.ac | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index ca2ba21..cb57653 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ AC_INIT(libass, 0.9.6) AM_INIT_AUTOMAKE AC_CONFIG_MACRO_DIR([shave]) AM_PROG_LIBTOOL -AC_CONFIG_SRCDIR([test/test.cpp]) +AC_CONFIG_SRCDIR([libass/ass.c]) AC_CONFIG_HEADER([config.h]) # Checks for programs. @@ -12,14 +12,13 @@ AC_PROG_CC AC_PROG_CPP # Checks for libraries. -AC_CHECK_LIB([png], [png_create_write_struct], AC_DEFINE(CONFIG_LIBPNG, 1, [use libpng])) AC_SEARCH_LIBS([iconv_open], [iconv], AC_DEFINE(CONFIG_ICONV, 1, [use iconv])) -AC_CHECK_LIB([enca], [enca_analyser_alloc], [AC_DEFINE(CONFIG_ENCA, 1, [use enca]) LIBS="$LIBS -lenca"]) # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([inttypes.h stdint.h stdlib.h string.h sys/time.h unistd.h iconv.h enca.h]) +# Check for libraries via pkg-config PKG_CHECK_MODULES([FONTCONFIG], fontconfig >= 2.2.0, [ CFLAGS="$CFLAGS $FONTCONFIG_CFLAGS" LIBS="$LIBS $FONTCONFIG_LIBS" @@ -32,6 +31,18 @@ PKG_CHECK_MODULES([FREETYPE], freetype2 >= 9.6.3, [ AC_DEFINE(CONFIG_FREETYPE, 1, [found freetype2 via pkg-config]) ]) +PKG_CHECK_MODULES([ENCA], enca, [ + CFLAGS="$CFLAGS $ENCA_CFLAGS" + LIBS="$LIBS $ENCA_LIBS" + AC_DEFINE(CONFIG_ENCA, 1, [found enca via pkg-config]) + ]) + +PKG_CHECK_MODULES([LIBPNG], libpng >= 1.2.0, [ + CFLAGS="$CFLAGS $LIBPNG_CFLAGS" + LIBS="$LIBS $LIBPNG_LIBS" + AC_DEFINE(CONFIG_LIBPNG, 1, [found libpng via pkg-config]) + ]) + # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL AC_C_CONST -- 2.40.0