address issue#26

try to link with libcharset when locale_charset() is not present in
libiconv
This commit is contained in:
nu774 2017-01-16 15:20:09 +09:00
parent c37edc6051
commit 4682fe4961
3 changed files with 10 additions and 4 deletions

View File

@ -23,7 +23,7 @@ fdkaac_SOURCES = \
dist_man_MANS = man/fdkaac.1
fdkaac_LDADD = \
@LIBICONV@ -lfdk-aac -lm
@LIBICONV@ @CHARSET_LIB@ -lfdk-aac -lm
if FDK_PLATFORM_POSIX
fdkaac_SOURCES += \

View File

@ -13,7 +13,7 @@ AC_PROG_CC
AM_PROG_CC_C_O
AC_CHECK_HEADERS([sys/time.h])
AC_CHECK_HEADERS([localcharset.h langinfo.h endian.h byteswap.h])
AC_CHECK_HEADERS([libcharset.h langinfo.h endian.h byteswap.h])
AC_CHECK_HEADERS([fdk-aac/aacenc_lib.h], ,
AC_MSG_ERROR([libfdk-aac is required]))
@ -38,6 +38,12 @@ AC_CHECK_FUNC(getopt_long)
AM_CONDITIONAL([FDK_NO_GETOPT_LONG],[test "$ac_cv_func_getopt_long" != "yes"])
AC_SEARCH_LIBS([aacEncOpen],[fdk-aac],[],[],[])
CHARSET_LIB=
AC_CHECK_LIB([iconv], [locale_charset],
[CHARSET_LIB=-liconv],
[AC_CHECK_LIB([charset], [locale_charset], [CHARSET_LIB=-lcharset])])
AC_SUBST([CHARSET_LIB])
AC_CANONICAL_HOST
X_PLATFORM=posix

View File

@ -59,8 +59,8 @@ char *aacenc_to_utf8(const char *s)
#include <errno.h>
#include <iconv.h>
#if HAVE_LOCALCHARSET_H
#include <localcharset.h>
#if HAVE_LIBCHARSET_H
#include <libcharset.h>
#elif HAVE_LANGINFO_H
#include <langinfo.h>
static const char *locale_charset(void)