[commit: ghc] master: --without-libcharset disables the use of libcharset (979baec)

git at git.haskell.org git at git.haskell.org
Thu Jul 7 08:43:22 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/979baecd394137b583d5938bd8f2738185426765/ghc

>---------------------------------------------------------------

commit 979baecd394137b583d5938bd8f2738185426765
Author: Simon Marlow <smarlow at fb.com>
Date:   Wed Jul 6 05:47:22 2016 -0700

    --without-libcharset disables the use of libcharset


>---------------------------------------------------------------

979baecd394137b583d5938bd8f2738185426765
 libraries/base/configure.ac | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/libraries/base/configure.ac b/libraries/base/configure.ac
index b8a4774..8098bc7 100644
--- a/libraries/base/configure.ac
+++ b/libraries/base/configure.ac
@@ -192,14 +192,24 @@ FP_SEARCH_LIBS_PROTO(iconv,
                      [AC_MSG_ERROR([iconv is required on non-Windows platforms])])
 
 # If possible, we use libcharset instead of nl_langinfo(CODESET) to
-# determine the current locale's character encoding.
-FP_SEARCH_LIBS_PROTO(
+# determine the current locale's character encoding.  Allow the user
+# to disable this with --without-libcharset if they don't want a
+# dependency on libcharset.
+AC_ARG_WITH([libcharset],
+  [AS_HELP_STRING([--with-libcharset],
+    [Use libcharset [default=only if available]])],
+  [],
+  [with_libcharset=check])
+
+AS_IF([test "x$with_libcharset" != xno],
+  FP_SEARCH_LIBS_PROTO(
     [locale_charset],
     [#include <libcharset.h>],
     [const char* charset = locale_charset();],
     [charset],
     [AC_DEFINE([HAVE_LIBCHARSET], [1], [Define to 1 if you have libcharset.])
-     EXTRA_LIBS="$EXTRA_LIBS $ac_lib"])
+     EXTRA_LIBS="$EXTRA_LIBS $ac_lib"]
+  ))
 
 fi
 



More information about the ghc-commits mailing list