From 43e4f2c79241c56f92f838e401fc67a4799c7a4a Mon Sep 17 00:00:00 2001 From: nexus Date: Mon, 22 Oct 2001 07:43:32 +0000 Subject: better FreeBSD iconv implementation git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2359 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 17 ++++++++++++++--- subreader.c | 4 ++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/configure b/configure index a29215e899..652f67de26 100755 --- a/configure +++ b/configure @@ -896,10 +896,16 @@ else cc_check $_x11libdir -lX11 -lXext -lGL -lm $_socklib && _gl=yes fi +if freebsd ; then + _iconv_tmp='#include ' +else + _iconv_tmp='#include ' +fi + cat > $TMPC << EOF #include #include -#include +$_iconv_tmp #define INBUFSIZE 1024 #define OUTBUFSIZE 4096 @@ -930,7 +936,10 @@ main() EOF _iconv=yes -if freebsd || bsdos ; then +if freebsd ; then + cc_check $_extraincdir $_extralibdir -lm -lgiconv >/dev/null 2>&1 || \ + { _iconv=no ; echo "iconv(3) function not detected!" ;} +elif bsdos ; then cc_check $_extraincdir $_extralibdir -lm -liconv >/dev/null 2>&1 || \ { _iconv=no ; echo "iconv(3) function not detected!" ;} else @@ -1878,7 +1887,9 @@ fi if test "$_iconv" = yes ; then _iconv='#define USE_ICONV' - if freebsd || bsdos ; then + if freebsd ; then + _iconvlib="-lgiconv" + elif bsdos ; then _iconvlib="-liconv" fi else diff --git a/subreader.c b/subreader.c index 456a1bfb89..1754a50a46 100644 --- a/subreader.c +++ b/subreader.c @@ -18,7 +18,11 @@ #define ERR (void *)-1 #ifdef USE_ICONV +#ifdef __FreeBSD__ +#include +#else #include +#endif char *sub_cp=NULL; #endif -- cgit v1.2.3