Switch iconv support to use AC_AGI_COMPILE.

Originally committed to SVN as r2165.
This commit is contained in:
Amar Takhar 2008-04-01 18:49:01 +00:00
parent b38e6582c2
commit c03fc5b447

View file

@ -406,17 +406,16 @@ if test -z "$ICONV_CFLAGS"; then
fi fi
if test "$enable_libass" != "no"; then if test "$enable_libass" != "no"; then
aegisub_save_CPPFLAGS="$CPPFLAGS" AC_AGI_COMPILE([iconv], [iconv], [$ICONV_CFLAGS], [$ICONV_LDFLAGS],[
CPPFLAGS="$ICONV_CFLAGS" #include <iconv.h>
AC_CHECK_HEADER(iconv.h, [ICONV_CFLAGS="$ICONV_CFLAGS"; with_iconv="yes"], with_iconv="no") int main(void) {
CPPFLAGS="$aegisub_save_CPPFLAGS" iconv_t ic;
ic = iconv_open ("UTF-8", "UTF-8");
if (!ic) return 1;
return 0;
} ])
aegisub_save_LDFLAGS="$LDFLAGS" if test "$agi_with_iconv" = "yes"; then
LDFLAGS="$ICONV_LDFLAGS"
AC_CHECK_LIB([iconv], [iconv_open],[ICONV_LDFLAGS="$ICONV_LDFLAGS"; with_iconv="yes"], with_iconv="no")
LDFLAGS="$aegisub_save_LDFLAGS"
if test "$with_iconv" = "yes"; then
LIBASS_LIBS="-L../libass -lass_aegisub" LIBASS_LIBS="-L../libass -lass_aegisub"
LIBASS_CFLAGS="-I../libass" LIBASS_CFLAGS="-I../libass"
with_libass="yes" with_libass="yes"
@ -428,6 +427,8 @@ fi
if test "$with_libass" = "yes"; then if test "$with_libass" = "yes"; then
AC_DEFINE(WITH_LIBASS, 1, [Enable libass Subtitle Provider]) AC_DEFINE(WITH_LIBASS, 1, [Enable libass Subtitle Provider])
else
with_libass="no"
fi fi
AC_SUBST(ICONV_LDFLAGS) AC_SUBST(ICONV_LDFLAGS)
@ -438,7 +439,6 @@ AM_CONDITIONAL([WITH_LIBASS], [test "$with_libass" = "yes"])
########### ###########
## Hunspell ## Hunspell
########### ###########