summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authoratlka <atlka@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-10-10 13:07:42 +0000
committeratlka <atlka@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-10-10 13:07:42 +0000
commit0a5c47a028ec53413f55781b99fcc67fca764aa1 (patch)
tree5acecd782c186adf00fa28ec54c125ffcb8df60d /configure
parent8137a7a4b2802bd244cf523f50f12d1154bbe89b (diff)
downloadmpv-0a5c47a028ec53413f55781b99fcc67fca764aa1.tar.bz2
mpv-0a5c47a028ec53413f55781b99fcc67fca764aa1.tar.xz
modifications to use iconv(3) function to recode text of subs (autodetect)
added option -subcp <cpname> # for example cp1250, latin2 etc. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2152 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure53
1 files changed, 53 insertions, 0 deletions
diff --git a/configure b/configure
index 6e6b2eab15..5a34404832 100755
--- a/configure
+++ b/configure
@@ -160,6 +160,7 @@ params:
--enable-xmmp use XMMP audio drivers
--enable-lirc enable LIRC (remote control) support
+ --disable-iconv do not use iconv(3) function [autodetect]
--disable-ossaudio disable OSS sound support [autodetect]
--disable-alsa disable alsa sound support [autodetect]
--disable-esd disable esd sound support [autodetect]
@@ -903,6 +904,42 @@ $_cc $TMPC -o $TMPO $_x11libdir -lX11 -lXext -lGL -lm $_socklib > /dev/null 2>&1
fi
cat > $TMPC << EOF
+#include <stdio.h>
+#include <unistd.h>
+#include <iconv.h>
+
+#define INBUFSIZE 1024
+#define OUTBUFSIZE 4096
+
+char inbuffer[INBUFSIZE];
+char outbuffer[OUTBUFSIZE];
+
+main()
+{ ssize_t numread;
+ iconv_t icdsc;
+ char *tocode="UTF-8";
+ char *fromcode="cp1250";
+ if ((icdsc = iconv_open (tocode, fromcode)) != (iconv_t)(-1)){
+ while ((numread = read (0, inbuffer, INBUFSIZE))){
+ char *iptr=inbuffer;
+ char *optr=outbuffer;
+ size_t inleft=numread;
+ size_t outleft=OUTBUFSIZE;
+ if (iconv (icdsc,
+ (const char **)&iptr, &inleft, &optr, &outleft)
+ !=(size_t)(-1)){
+ write (1, outbuffer, OUTBUFSIZE - outleft);
+ }
+ }
+ if (iconv_close (icdsc) == -1) ;
+ }
+}
+
+EOF
+_iconv=yes
+$_cc $TMPC -o $TMPO -lm > /dev/null 2>&1 || \
+ { _iconv=no ; echo "iconv(3) function not detected!" ;}
+cat > $TMPC << EOF
#include <GL/gl.h>
int main( void ) { return 0; }
EOF
@@ -1216,6 +1253,9 @@ for ac_option do
--enable-fbdev)
_fbdev=yes
;;
+ --enable-iconv)
+ _iconv=yes
+ ;;
--enable-mlib)
_mlib=yes
;;
@@ -1326,6 +1366,9 @@ for ac_option do
--disable-fbdev)
_fbdev=no
;;
+ --disable-iconv)
+ _iconv=no
+ ;;
--disable-termcap)
_termcap=no
;;
@@ -1585,6 +1628,7 @@ echo "Checking for PNG support ... $_png"
echo "Checking for OggVorbis support ... $_vorbis"
echo "Checking for Win32 DLL support ... $_win32dll"
echo "Checking for DirectShow ... $_dshow"
+echo "Checking for iconv function ... $_iconv"
# check if compiler supports C++ and C++-libs are installed correctly
if [ $_win32dll = yes -a $_dshow = yes ] ; then
@@ -1844,6 +1888,12 @@ else
_xmmpaudio='#undef USE_XMMP_AUDIO'
fi
+if [ "$_iconv" = "yes" ]; then
+_iconv='#define USE_ICONV'
+else
+_iconv='#undef USE_ICONV'
+fi
+
if [ "$_lirc" = "yes" ]; then
_lircdefs='#define HAVE_LIRC'
_lirclibs='-llirc_client'
@@ -2279,6 +2329,9 @@ $_divx4def
try to recompile MPlayer with this option disabled! */
$_select
+/* define this to use iconv(3) function to codepage conversions */
+$_iconv
+
/* XMMP support: (test code) */
$_xmmpaudio
#define LIBDIR "/usr/local/lib"