summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorEmmanuel Bouthenot <kolter@openics.org>2006-06-15 09:04:12 +0000
committerEmmanuel Bouthenot <kolter@openics.org>2006-06-15 09:04:12 +0000
commita38b9ecf797fb8376faee854899a504c7533669f (patch)
tree8a7d420f7cd51e899be2f6f5dab3204b4e232a3b /configure.in
parentd8b775d2c4d9121e67952a3b81d59fdfdd4619ac (diff)
downloadweechat-a38b9ecf797fb8376faee854899a504c7533669f.zip
add iconv/libiconv detection
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in38
1 files changed, 36 insertions, 2 deletions
diff --git a/configure.in b/configure.in
index 16e4b9e2e..12a4dedbe 100644
--- a/configure.in
+++ b/configure.in
@@ -188,6 +188,42 @@ if test "x$enable_gtk" = "xyes" ; then
fi
# ------------------------------------------------------------------------------
+# iconv
+# ------------------------------------------------------------------------------
+
+iconv_found="no"
+
+AC_CHECK_HEADER(iconv.h,ac_found_iconv_header="yes",ac_found_iconv_header="no")
+if test "x$ac_found_iconv_header" = "xyes" ; then
+ AC_CHECK_LIB(iconv,iconv_open,ac_found_iconv_lib="yes",ac_found_iconv_lib="no")
+ if test "x$ac_found_iconv_lib" = "xyes" ; then
+ LIBS="$LIBS -liconv"
+ fi
+ AC_MSG_CHECKING(for iconv usability in programs)
+ AC_TRY_RUN([
+ #include <iconv.h>
+ int main(int argc, char **argv) {
+ iconv_t conv = iconv_open("ISO8859-1", "UTF-8");
+ if (conv != (iconv_t) -1) {
+ return 0;
+ }
+ return 1;
+ }],iconv_found="yes")
+ if test "x$iconv_found" = "xno" ; then
+ AC_MSG_RESULT(no)
+ else
+ AC_MSG_RESULT(yes)
+ fi
+fi
+
+if test "x$iconv_found" = "xno" ; then
+ AC_MSG_ERROR([
+*** Iconv headers and/or libraries couldn't be found in your system.
+*** Try to install them with your software package manager.
+*** WeeChat can't be built without Iconv support.])
+fi
+
+# ------------------------------------------------------------------------------
# plugins
# ------------------------------------------------------------------------------
@@ -632,8 +668,6 @@ netbsd*)
CFLAGS="$CFLAGS -pthread"
fi
CFLAGS="$CFLAGS $CPPFLAGS"
- # bad hack
- LDFLAGS="$LDFLAGS -liconv"
;;
gnu*)
if test "x$enable_plugins" = "xyes" ; then