Add --enable-iconv option to configure

Disable iconv support by default, which provide a feature to convert
non-Unicode SFNT names to UTF-8.
This commit is contained in:
Akira TAGOH 2012-04-24 11:40:51 +09:00
parent 06d6b7c312
commit 526f0da93f
1 changed files with 32 additions and 28 deletions

View File

@ -145,6 +145,9 @@ fi
#
# Checks for iconv
#
AC_ARG_ENABLE(iconv,
[AC_HELP_STRING([--enable-iconv],
[Use iconv to support non-Unicode SFNT name])])
AC_ARG_WITH(libiconv,
[AC_HELP_STRING([--with-libiconv=DIR],
[Use libiconv in DIR])],
@ -186,8 +189,9 @@ if test "x$libiconv_cflags" != "x"; then
fi
use_iconv=0
AC_MSG_CHECKING([for a usable iconv])
if test "x$libiconv_cflags" != "x" -o "x$libiconv_libs" != "x"; then
if test "x$enable_iconv" != "xno"; then
AC_MSG_CHECKING([for a usable iconv])
if test "x$libiconv_cflags" != "x" -o "x$libiconv_libs" != "x"; then
iconvsaved_CFLAGS="$CFLAGS"
iconvsaved_LIBS="$LIBS"
CFLAGS="$CFLAGS $libiconv_cflags"
@ -203,21 +207,21 @@ if test "x$libiconv_cflags" != "x" -o "x$libiconv_libs" != "x"; then
LIBS="$iconvsaved_LIBS"
ICONV_CFLAGS="$libiconv_cflags"
ICONV_LIBS="$libiconv_libs"
fi
if test "x$use_iconv" = "x0"; then
fi
if test "x$use_iconv" = "x0"; then
AC_TRY_LINK([#include <iconv.h>],
[iconv_open ("from", "to");],
[iconv_type="libc"
use_iconv=1],
[iconv_type="not found"
use_iconv=0])
fi
AC_MSG_RESULT([$iconv_type])
AC_SUBST(ICONV_CFLAGS)
AC_SUBST(ICONV_LIBS)
fi
AC_MSG_RESULT([$iconv_type])
AC_SUBST(ICONV_CFLAGS)
AC_SUBST(ICONV_LIBS)
AC_DEFINE_UNQUOTED(USE_ICONV,$use_iconv,[Use iconv.])
#
# Checks for FreeType
#