summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marlow <smarlow@fb.com>2016-07-06 05:47:22 -0700
committerSimon Marlow <smarlow@fb.com>2016-07-07 01:44:58 -0700
commit979baecd394137b583d5938bd8f2738185426765 (patch)
tree7ed5844570f801851c1b280b4f6a63f2330c56e4
parentb9cea81ded5dc4da19fc011d96f28ade660438c2 (diff)
downloadhaskell-979baecd394137b583d5938bd8f2738185426765.tar.gz
--without-libcharset disables the use of libcharset
-rw-r--r--libraries/base/configure.ac16
1 files changed, 13 insertions, 3 deletions
diff --git a/libraries/base/configure.ac b/libraries/base/configure.ac
index b8a4774140..8098bc75e9 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