From edc90ca70ffc9dd7c5465446bf5bffb4605ae509 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 14 Sep 2005 21:47:24 -0700 Subject: Fix for Bug#3982 Added check for availability of multibyte characters and functions --- config/ac-macros/readline.m4 | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'config') diff --git a/config/ac-macros/readline.m4 b/config/ac-macros/readline.m4 index 79c6479d15d..e47d0a44483 100644 --- a/config/ac-macros/readline.m4 +++ b/config/ac-macros/readline.m4 @@ -59,3 +59,42 @@ AC_DEFUN([MYSQL_CHECK_NEW_RL_INTERFACE], [ ) ) ]) + +dnl +dnl check for availability of multibyte characters and functions +dnl (Based on BASH_CHECK_MULTIBYTE in aclocal.m4 of readline-5.0) +dnl +AC_DEFUN([MYSQL_CHECK_MULTIBYTE], +[ +AC_CHECK_HEADERS(wctype.h) +AC_CHECK_HEADERS(wchar.h) +AC_CHECK_HEADERS(langinfo.h) + +AC_CHECK_FUNC(mbsrtowcs, AC_DEFINE([HAVE_MBSRTOWCS],[],[Define if you have mbsrtowcs])) +AC_CHECK_FUNC(mbrtowc, AC_DEFINE([HAVE_MBRTOWC],[],[Define if you have mbrtowc])) +AC_CHECK_FUNC(mbrlen, AC_DEFINE([HAVE_MBRLEN],[],[Define if you have mbrlen])) +AC_CHECK_FUNC(wctomb, AC_DEFINE([HAVE_WCTOMB],[],[Define if you have wctomb])) +AC_CHECK_FUNC(wcwidth, AC_DEFINE([HAVE_WCWIDTH],[],[Define if you have wcwidth])) +AC_CHECK_FUNC(wcsdup, AC_DEFINE([HAVE_WCSDUP],[],[Define if you check wcsdup])) + +AC_CACHE_CHECK([for mbstate_t], mysql_cv_have_mbstate_t, +[AC_TRY_COMPILE([ +#include ], [ + mbstate_t ps; + mbstate_t *psp; + psp = (mbstate_t *)0; +], mysql_cv_have_mbstate_t=yes, mysql_cv_have_mbstate_t=no)]) +if test $mysql_cv_have_mbstate_t = yes; then + AC_DEFINE([HAVE_MBSTATE_T],[],[Define if mysql_cv_have_mbstate_t=yes]) +fi + +AC_CACHE_CHECK([for nl_langinfo and CODESET], mysql_cv_langinfo_codeset, +[AC_TRY_LINK( +[#include ], +[char* cs = nl_langinfo(CODESET);], +mysql_cv_langinfo_codeset=yes, mysql_cv_langinfo_codeset=no)]) +if test $mysql_cv_langinfo_codeset = yes; then + AC_DEFINE([HAVE_LANGINFO_CODESET],[],[Define if mysql_cv_langinfo_codeset=yes]) +fi + +]) -- cgit v1.2.1