Improve check for iconv
authorAdam Dickmeiss <adam@indexdata.dk>
Fri, 13 Sep 2002 09:24:16 +0000 (09:24 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Fri, 13 Sep 2002 09:24:16 +0000 (09:24 +0000)
configure.in

index 50e51ce..34f28e9 100644 (file)
@@ -1,5 +1,5 @@
 dnl Zebra, Index Data Aps, 1995-2002
-dnl $Id: configure.in,v 1.47 2002-09-09 09:36:24 adam Exp $
+dnl $Id: configure.in,v 1.48 2002-09-13 09:24:16 adam Exp $
 dnl
 AC_INIT(include/zebraver.h)
 AM_INIT_AUTOMAKE(idzebra,1.3.2)
@@ -117,10 +117,25 @@ else
 fi
 dnl
 dnl ------ times
-AC_CHECK_HEADERS(sys/times.h iconv.h)
+AC_CHECK_HEADERS(sys/times.h)
+dnl
 dnl ------ mkstemp
 AC_CHECK_FUNCS(mkstemp)
 dnl
+dnl ------ iconv
+AC_CHECK_FUNCS(iconv_open)
+if test "$ac_cv_func_iconv_open" = "no"; then
+       oldLibs=$LIBS
+       LIBS="$LIBS -liconv"
+       AC_CHECK_FUNCS(iconv_open)
+       if test "$ac_cv_func_iconv_open" = "no"; then
+               LIBS=$oldLibs
+       fi
+fi
+if test "$ac_cv_func_iconv_open" = "yes"; then
+        AC_CHECK_HEADERS(iconv.h)
+fi
+dnl
 dnl ------- BZIP2
 AC_CHECK_LIB(bz2,bzCompressInit)
 if test "$ac_cv_lib_bz2_bzCompressInit" = "yes"; then