use boost.locale for charset conversions instead of iconv

This commit is contained in:
Andrzej Rybczak
2012-10-04 21:25:48 +02:00
parent 802886c2e5
commit e40edade0e
12 changed files with 53 additions and 202 deletions

View File

@@ -15,7 +15,6 @@ AC_ARG_ENABLE(clock, AS_HELP_STRING([--enable-clock], [Enable clock screen @<:@d
AC_ARG_ENABLE(unicode, AS_HELP_STRING([--enable-unicode], [Enable utf8 support @<:@default=yes@:>@]), [unicode=$enableval], [unicode=yes])
AC_ARG_WITH(curl, AS_HELP_STRING([--with-curl], [Enable fetching lyrics from the Internet @<:@default=auto@:>@]), [curl=$withval], [curl=auto])
AC_ARG_WITH(fftw, AS_HELP_STRING([--with-fftw], [Enable fftw support (required for frequency spectrum vizualization) @<:@default=auto@:>@]), [fftw=$withval], [fftw=auto])
AC_ARG_WITH(iconv, AS_HELP_STRING([--with-iconv], [Enable iconv support (Note: if you use utf-8 system wide, you can disable this) @<:@default=auto@:>@]), [iconv=$withval], [iconv=auto])
AC_ARG_WITH(pdcurses, AS_HELP_STRING([--with-pdcurses[=LIBNAME]], [Link against pdcurses instead of ncurses @<:@default=XCurses@:>@]), [pdcurses=$withval], [pdcurses=no])
AC_ARG_WITH(taglib, AS_HELP_STRING([--with-taglib], [Enable tag editor @<:@default=auto@:>@]), [taglib=$withval], [taglib=auto])
@@ -27,19 +26,6 @@ if test "$clock" = "yes"; then
AC_DEFINE([ENABLE_CLOCK], [1], [enables clock screen])
fi
dnl =====================================
dnl = checking for -fno-exceptions flag =
dnl =====================================
AC_MSG_CHECKING([whether compiler supports -fno-exceptions])
old_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="-fno-exceptions"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]])],
AC_MSG_RESULT([yes])
no_exceptions="-fno-exceptions",
AC_MSG_RESULT([no])
)
CXXFLAGS="$old_CXXFLAGS $no_exceptions"
dnl ================================
dnl = checking for -std=c++0x flag =
dnl ================================
@@ -96,6 +82,22 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[struct A { virtual void foo() { } }; struct
AC_DEFINE([OVERRIDE], []),
)
dnl =============================
dnl = setting boost environment =
dnl =============================
AS_IF([test -z "${BOOST_LIB_SUFFIX+x}"], [BOOST_LIB_SUFFIX=-mt])
AC_ARG_VAR([BOOST_LIB_SUFFIX], [Boost library name suffix [default=-mt]])
dnl =============================
dnl = checking for boost.locale =
dnl =============================
AC_CHECK_HEADERS([boost/locale/encoding.hpp], ,
AC_MSG_ERROR(boost/locale/encoding.hpp is missing)
)
AC_CHECK_LIB(boost_locale$BOOST_LIB_SUFFIX, main, LDFLAGS="$LDFLAGS -lboost_locale$BOOST_LIB_SUFFIX",
AC_MSG_ERROR([no boost.locale library found])
)
dnl ==============================
dnl = checking for regex (win32) =
dnl ==============================
@@ -132,23 +134,6 @@ AC_CHECK_HEADERS([pthread.h],
),
)
dnl ======================
dnl = checking for iconv =
dnl ======================
if test "$iconv" != "no" ; then
AC_CHECK_HEADERS([iconv.h],
AC_MSG_CHECKING([whether iconv takes const char **])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <iconv.h>]], [[iconv(0, (const char **)0, 0, 0, 0);]])],
AC_MSG_RESULT([yes]) AC_DEFINE([ICONV_CONST], [const], [pass const pointer to iconv]),
AC_MSG_RESULT([no]) AC_DEFINE([ICONV_CONST], [], [pass non-const pointer to iconv]))
AC_CHECK_LIB(iconv, libiconv, LDFLAGS="$LDFLAGS -liconv", )
,
if test "$iconv" = "yes"; then
AC_MSG_ERROR([iconv.h header is required])
fi
)
fi
dnl ========================
dnl = checking for ncurses =
dnl ========================