From 8f67d4848719475278d43525c7e38f13dce5baa2 Mon Sep 17 00:00:00 2001 From: Grigori Goronzy Date: Mon, 24 May 2010 02:44:31 +0000 Subject: [PATCH] Initial support for external libass with pkg-config This introduces the configure option --with-external-libass; the internal copy is still used by default. Fixes #917. Originally committed to SVN as r4356. --- aegisub/Makefile.am | 2 +- aegisub/configure.in | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/aegisub/Makefile.am b/aegisub/Makefile.am index 59c9ca837..1a0077347 100644 --- a/aegisub/Makefile.am +++ b/aegisub/Makefile.am @@ -5,7 +5,7 @@ if HAVE_UNIVCHARDET univchardet = universalchardet endif -if WITH_LIBASS +if WITH_INTERNAL_LIBASS libass = libass endif diff --git a/aegisub/configure.in b/aegisub/configure.in index 0036a4808..4c2ec8c68 100644 --- a/aegisub/configure.in +++ b/aegisub/configure.in @@ -30,6 +30,7 @@ m4_define([fontconfig_required_version], [2.4]) m4_define([freetype_required_version], [9.7.0]) m4_define([pkgconfig_required_version], [0.20]) m4_define([wx_required_version], [2.9.0]) +m4_define([libass_required_version], [0.9.7]) ####### @@ -757,16 +758,21 @@ fi # Subtitle Provider ################### -AC_ARG_ENABLE(libass, [ --disable-libass disable libass support (default=enabled)],libass_disabled="(disabled)") +AC_ARG_ENABLE(libass, [ --disable-libass disable libass support (default=enabled)], libass_disabled="(disabled)") +AC_ARG_WITH(external-libass, [ --with-external-libass link to external libass (default=use internal)]) if test "$enable_libass" != "no"; then - if test "$agi_cv_with_iconv" = "yes"; then - LIBASS_LIBS="-L../libass -lass_aegisub" - LIBASS_CFLAGS="-I../libass" - with_libass="yes" + if test "$with_external_libass" != "yes"; then + if test "$agi_cv_with_iconv" = "yes"; then + LIBASS_LIBS="-L../libass -lass_aegisub" + LIBASS_CFLAGS="-I../libass" + with_libass="yes" + else + AC_MSG_WARN([libiconv is required for libass support.]) + with_libass="no" + fi else - AC_MSG_WARN([libiconv is required for libass support.]) - with_libass="no" + PKG_CHECK_MODULES(LIBASS, libass >= libass_required_version, [with_libass="yes"], [with_libass="no"]) fi fi @@ -777,6 +783,7 @@ else fi AM_CONDITIONAL([WITH_LIBASS], [test "$with_libass" = "yes"]) +AM_CONDITIONAL([WITH_INTERNAL_LIBASS], [test "$with_libass" = "yes" && test "$with_external_libass" != "yes"]) AC_SUBST(LIBASS_LIBS) AC_SUBST(LIBASS_CFLAGS)