# HG changeset patch # User nexus # Date 1003736612 0 # Node ID 8b971caf9e03c0cb00cd09f6232bfb482e27fe21 # Parent 427dc863fe4b1b058fc9b348b2e66608d847a8ad better FreeBSD iconv implementation diff -r 427dc863fe4b -r 8b971caf9e03 configure --- a/configure Mon Oct 22 07:42:57 2001 +0000 +++ b/configure Mon Oct 22 07:43:32 2001 +0000 @@ -896,10 +896,16 @@ 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 @@ 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 @@ 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 -r 427dc863fe4b -r 8b971caf9e03 subreader.c --- a/subreader.c Mon Oct 22 07:42:57 2001 +0000 +++ b/subreader.c Mon Oct 22 07:43:32 2001 +0000 @@ -18,7 +18,11 @@ #define ERR (void *)-1 #ifdef USE_ICONV +#ifdef __FreeBSD__ +#include +#else #include +#endif char *sub_cp=NULL; #endif