From 664af8498a96da1ca3649bc1b7e7dfc8412afecc Mon Sep 17 00:00:00 2001 From: Amar Takhar Date: Sat, 22 Mar 2008 07:33:57 +0000 Subject: [PATCH] Fix the detection of libiconv (for required for internal libass support), also fix libiconv ldflags, and the detection order for libass (internal first, external second). Originally committed to SVN as r2097. --- configure.in | 43 +++++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/configure.in b/configure.in index c13606e90..2a7c3d882 100644 --- a/configure.in +++ b/configure.in @@ -279,10 +279,28 @@ AC_ARG_WITH(libass, [ --without-libass disable libass (default=enable)], AC_ARG_ENABLE(libass, [ --disable-libass disable internal libass support (default=enabled)],libass_internal_disabled="(disabled)") AC_ARG_VAR([ICONV_CFLAGS], [CFLAGS to use for iconv (default: CPPFLAGS)]) -AC_ARG_VAR([ICONV_LDFLAGS], [LDFLAGS to use for iconv (default: LDFLAGS)]) +AC_ARG_VAR([ICONV_LDFLAGS], [LDFLAGS to use for iconv (default: -liconv)]) + +if test -z "ICONV_LDFLAGS"; then + ICONV_LDFLAGS="-liconv"; +fi if test "$with_libass" != "no"; then - if test "$enable_libass" = "no"; then + + if test "$enable_libass" != "no"; then + AC_CHECK_HEADER(iconv.h, [ICONV_CFLAGS="$ICONV_CFLAGS"; with_iconv="yes"], with_iconv="no") + AC_CHECK_LIB([iconv], [iconv_open],[ICONV_LDFLAGS="$ICONV_LIBS"; with_iconv="yes"], with_iconv="no") + + if test "$with_iconv" = "yes"; then + LIBASS_LIBS="-L../libass -lass_aegisub" + LIBASS_CFLAGS="-I../libass" + with_internal_libass="yes" + else + with_internal_libass="no" + fi + fi + + if test "$with_internal_libass" != "yes"; then PKG_CHECK_MODULES(LIBASS, libass >= 0.9.1) aegisub_save_LDFLAGS="$LDFLAGS" @@ -296,24 +314,13 @@ if test "$with_libass" != "no"; then CPPFLAGS="$aegisub_save_CPPFLAGS" with_internal_libass="no" else - AC_CHECK_HEADER(iconv.h, [ICONV_CFLAGS="$ICONV_CFLAGS"; with_iconv="yes"], with_iconv="no") - AC_CHECK_LIB([iconv], [iconv_open],[ICONV_LDFLAGS="ICONV_LIBS"; with_iconv="yes"], with_iconv="no") - - if test "$with_iconv" = "yes"; then - LIBASS_LIBS="-L../libass -lass_aegisub" - LIBASS_CFLAGS="-I../libass" - with_internal_libass="yes" - else - with_internal_libass="no" - fi + with_libass="no" fi + fi -if test "$with_libass" != "no"; then +if test "$with_libass" = "yes" || test "$with_internal_libass" = "yes"; then AC_DEFINE(WITH_LIBASS, 1, [Enable libass Subtitle Provider]) - with_libass="yes" -else - with_internal_libass="no" fi AC_SUBST(LIBASS_LIBS) @@ -706,8 +713,8 @@ Video Providers Subtitle Providers: asa: $with_asa - libass: $with_libass $libass_disabled (internal: $with_internal_libass) - + libass (external): $with_libass $libass_disabled + libass (internal) $with_internal_libass (requires iconv, fontconfig) $libass_internal_disabled Misc Packages: hunspell: $with_hunspell $hunspell_disabled universalchardet: $with_univchardet $univchardet_disabled