summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authoraurel <aurel@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-07-30 01:07:27 +0000
committeraurel <aurel@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-07-30 01:07:27 +0000
commitc9215ede1771839d7630ae63ce9346d4d4d2262b (patch)
tree53dacf0c1395c085bd59c3c5cce981039f45c6f1 /configure
parentc95fe61fd82843049babb20d1d9c0f634718c97c (diff)
downloadmpv-c9215ede1771839d7630ae63ce9346d4d4d2262b.tar.bz2
mpv-c9215ede1771839d7630ae63ce9346d4d4d2262b.tar.xz
fix detection of iconv implementations which require libdl
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16151 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure105
1 files changed, 54 insertions, 51 deletions
diff --git a/configure b/configure
index 274f2c497e..74cc50463a 100755
--- a/configure
+++ b/configure
@@ -2270,57 +2270,6 @@ else
fi
-echocheck "iconv"
-if test "$_iconv" = auto ; then
- _iconv_tmp='#include <iconv.h>'
-
- cat > $TMPC << EOF
-#include <stdio.h>
-#include <unistd.h>
-$_iconv_tmp
-#define INBUFSIZE 1024
-#define OUTBUFSIZE 4096
-
-char inbuffer[INBUFSIZE];
-char outbuffer[OUTBUFSIZE];
-
-int main(void) {
- size_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=no
- if cc_check $_ld_lm ; then
- _iconv=yes
- elif cc_check $_ld_lm -liconv ; then
- _iconv=yes
- _ld_iconv='-liconv'
- fi
-fi
-if test "$_iconv" = yes ; then
- _def_iconv='#define USE_ICONV 1'
-else
- _def_iconv='#undef USE_ICONV'
-fi
-echores "$_iconv"
-
-
echocheck "langinfo"
if test "$_langinfo" = auto ; then
cat > $TMPC <<EOF
@@ -2848,6 +2797,60 @@ else
fi
+echocheck "iconv"
+if test "$_iconv" = auto ; then
+ _iconv_tmp='#include <iconv.h>'
+
+ cat > $TMPC << EOF
+#include <stdio.h>
+#include <unistd.h>
+$_iconv_tmp
+#define INBUFSIZE 1024
+#define OUTBUFSIZE 4096
+
+char inbuffer[INBUFSIZE];
+char outbuffer[OUTBUFSIZE];
+
+int main(void) {
+ size_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=no
+ if cc_check $_ld_lm ; then
+ _iconv=yes
+ elif cc_check $_ld_lm -liconv ; then
+ _iconv=yes
+ _ld_iconv='-liconv'
+ elif cc_check $_ld_lm -liconv $_ld_dl ; then
+ _iconv=yes
+ _ld_iconv='-liconv $_ld_dl'
+ fi
+fi
+if test "$_iconv" = yes ; then
+ _def_iconv='#define USE_ICONV 1'
+else
+ _def_iconv='#undef USE_ICONV'
+fi
+echores "$_iconv"
+
+
echocheck "sys/soundcard.h"
cat > $TMPC << EOF
#include <sys/soundcard.h>