glib/aclibcharset.m4
Owen Taylor b5fa5b9867 Fixes for #58195, based on some ideas from Hidetosh Tajima.
Wed Sep 26 22:34:12 2001  Owen Taylor  <otaylor@redhat.com>

        Fixes for #58195, based on some ideas from Hidetosh Tajima.

        * aclibcharset.m4 glib/libcharset: Add Bruno Haible's
        portable-current charset detection code from libiconv.

        * glib/gutf8.c (g_utf8_get_charset_internal): Rewrite
        to use _g_locale_charset().

        * glib/gutf8.c (_g_charset_get_aliases): Private functions
        to get aliases from libcharset for a particular canonical
        name.

        * glib/gconvert.c: If loading a charset fails, try
        aliases to look for fallbacks.
2001-09-27 02:49:05 +00:00

48 lines
1.1 KiB
Plaintext

dnl From libcharset 1.1
#serial 2
dnl From Bruno Haible.
AC_DEFUN(jm_LANGINFO_CODESET,
[
AC_CHECK_HEADERS(langinfo.h)
AC_CHECK_FUNCS(nl_langinfo)
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
])
#serial 2
# Test for the GNU C Library, version 2.1 or newer.
# From Bruno Haible.
AC_DEFUN(jm_GLIBC21,
[
AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
ac_cv_gnu_library_2_1,
[AC_EGREP_CPP([Lucky GNU user],
[
#include <features.h>
#ifdef __GNU_LIBRARY__
#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
Lucky GNU user
#endif
#endif
],
ac_cv_gnu_library_2_1=yes,
ac_cv_gnu_library_2_1=no)
]
)
AC_SUBST(GLIBC21)
GLIBC21="$ac_cv_gnu_library_2_1"
]
)