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.
This commit is contained in:
Grigori Goronzy 2010-05-24 02:44:31 +00:00
parent 61ab7d1f2c
commit 8f67d48487
2 changed files with 15 additions and 8 deletions

View file

@ -5,7 +5,7 @@ if HAVE_UNIVCHARDET
univchardet = universalchardet
endif
if WITH_LIBASS
if WITH_INTERNAL_LIBASS
libass = libass
endif

View file

@ -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)