[patch] Don't detect libiconv/libcharset on Windows to avoid changing GHCs build behavior on windows with newer mingw installs

Bill Tutt bill at tutts.org
Sat Sep 17 01:10:13 CEST 2011


This change allows me to have a successful bootstrap from 7.2.1
bootstrapping compiler (with devel1) of ghc-HEAD

I suggest putting the change in 7.0.x, 7.2.1, and ghc-HEAD so that
updated Windows build instructions can be created in the wiki.

If iconv is detected vector-0.8 fails to build because ghc can't find
iconv.dll. Mingw has versioned .dll names and this may be why.
libraries/base/GHC/IO/Encoding/Iconv.hs doesn't expect Windows to have
iconv anyway. Therefore that is a problem for another day
and another person.

Thanks,
Bill

diff --git a/configure.ac b/configure.ac
index 1db0c26..96457a2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -141,6 +141,10 @@ FP_CHECK_CONST([O_BINARY], [#include <fcntl.h>], [0])
 # header needs to be included as iconv_open is #define'd to something
 # else. We therefore use our own FP_SEARCH_LIBS_PROTO, which allows us
 # to give prototype text.
+#
+# Windows note: newer mingw installs include libiconv and libcharset
+# Continue to ignore iconv/libcharset support on Windows machines
+if test "$WINDOWS" != "YES"; then
 FP_SEARCH_LIBS_PROTO(iconv,
                      [
 #include <stddef.h>
@@ -166,6 +170,10 @@ FP_SEARCH_LIBS_PROTO(
     [charset],
     [AC_DEFINE([HAVE_LIBCHARSET], [1], [Define to 1 if you have libcharset.])
      EXTRA_LIBS="$EXTRA_LIBS $ac_lib"])
+else
+echo "skipped checking for iconv and libcharset on Windows: GHC
doesn't support using iconv on Windows currently"
+fi
+

 # Hack - md5.h needs HsFFI.h.  Is there a better way to do this?
 CFLAGS="-I../../includes $CFLAGS"



More information about the Cvs-ghc mailing list