*** empty log message ***
authorJim Meyering <jim@meyering.net>
Sat, 4 Mar 2000 12:19:57 +0000 (12:19 +0000)
committerJim Meyering <jim@meyering.net>
Sat, 4 Mar 2000 12:19:57 +0000 (12:19 +0000)
m4/ChangeLog
m4/codeset.m4 [new file with mode: 0644]
m4/iconv.m4 [new file with mode: 0644]

index 908abb33eeaefe8ebbdd6a5a2bca61387c6266ed..baf3d7540a4e641713cde08ca154cff0c4c51e9f 100644 (file)
@@ -1,3 +1,9 @@
+2000-02-02  Bruno Haible  <haible@clisp.cons.org>
+
+       * codeset.m4: New file.
+       * iconv.m4: New file.
+       * jm-macros.m4 (jm_MACROS): Call jm_LANGINFO_CODESET and jm_ICONV.
+
 2000-03-04  Jim Meyering  <meyering@lucent.com>
 
        * jm-macros.m4 (jm_CHECK_ALL_TYPES): Require AC_C_VOLATILE,
diff --git a/m4/codeset.m4 b/m4/codeset.m4
new file mode 100644 (file)
index 0000000..6f0b58e
--- /dev/null
@@ -0,0 +1,17 @@
+#serial 1
+
+dnl From Bruno Haible.
+
+AC_DEFUN(jm_LANGINFO_CODESET,
+[
+  AC_CACHE_CHECK([for nl_langinfo and CODESET], jm_cv_langinfo_codeset,
+    [AC_TRY_LINK([#include <langinfo.h>],
+      [char* cs = nl_langinfo(CODESET);],
+      jm_cv_langinfo_codeset=yes,
+      jm_cv_langinfo_codeset=no)
+    ])
+  if test $jm_cv_langinfo_codeset = yes; then
+    AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
+      [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
+  fi
+])
diff --git a/m4/iconv.m4 b/m4/iconv.m4
new file mode 100644 (file)
index 0000000..7320bef
--- /dev/null
@@ -0,0 +1,39 @@
+#serial 1
+
+dnl From Bruno Haible.
+
+AC_DEFUN(jm_ICONV,
+[
+  dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
+  dnl those with the standalone portable libiconv installed).
+  AC_CACHE_CHECK(for iconv, jm_cv_func_iconv, [
+    jm_cv_func_iconv="no, consider installing libiconv"
+    jm_cv_lib_iconv=no
+    AC_TRY_LINK([#include <stdlib.h>
+#include <iconv.h>],
+      [iconv_t cd = iconv_open("","");
+       iconv(cd,NULL,NULL,NULL,NULL);
+       iconv_close(cd);],
+      jm_cv_func_iconv=yes)
+    if test "$jm_cv_func_iconv" != yes; then
+      jm_save_LIBS="$LIBS"
+      LIBS="$LIBS -liconv"
+      AC_TRY_LINK([#include <stdlib.h>
+#include <iconv.h>],
+        [iconv_t cd = iconv_open("","");
+         iconv(cd,NULL,NULL,NULL,NULL);
+         iconv_close(cd);],
+        jm_cv_lib_iconv=yes
+        jm_cv_func_iconv=yes)
+      LIBS="$jm_save_LIBS"
+    fi
+  ])
+  if test "$jm_cv_func_iconv" = yes; then
+    AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
+  fi
+  LIBICONV=
+  if test "$jm_cv_lib_iconv" = yes; then
+    LIBICONV="-liconv"
+  fi
+  AC_SUBST(LIBICONV)
+])