You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

143 lines
4.5 KiB

  1. AC_DEFUN([MYSQL_CHECK_READLINE_DECLARES_HIST_ENTRY], [
  2. AC_CACHE_CHECK([HIST_ENTRY is declared in readline/readline.h], mysql_cv_hist_entry_declared,
  3. AC_TRY_COMPILE(
  4. [
  5. #include "stdio.h"
  6. #include "readline/readline.h"
  7. ],
  8. [
  9. HIST_ENTRY entry;
  10. ],
  11. [
  12. mysql_cv_hist_entry_declared=yes
  13. AC_DEFINE_UNQUOTED(HAVE_HIST_ENTRY, [1],
  14. [HIST_ENTRY is defined in the outer libeditreadline])
  15. ],
  16. [mysql_cv_libedit_interface=no]
  17. )
  18. )
  19. ])
  20. AC_DEFUN([MYSQL_CHECK_LIBEDIT_INTERFACE], [
  21. AC_CACHE_CHECK([libedit variant of rl_completion_entry_function], mysql_cv_libedit_interface,
  22. AC_TRY_COMPILE(
  23. [
  24. #include "stdio.h"
  25. #include "readline/readline.h"
  26. ],
  27. [
  28. char res= *(*rl_completion_entry_function)(0,0);
  29. completion_matches(0,0);
  30. ],
  31. [
  32. mysql_cv_libedit_interface=yes
  33. AC_DEFINE_UNQUOTED([USE_LIBEDIT_INTERFACE], [1],
  34. [used libedit interface (can we dereference result of rl_completion_entry_function)])
  35. ],
  36. [mysql_cv_libedit_interface=no]
  37. )
  38. )
  39. ])
  40. AC_DEFUN([MYSQL_CHECK_NEW_RL_INTERFACE], [
  41. AC_CACHE_CHECK([defined rl_compentry_func_t and rl_completion_func_t], mysql_cv_new_rl_interface,
  42. AC_TRY_COMPILE(
  43. [
  44. #include "stdio.h"
  45. #include "readline/readline.h"
  46. ],
  47. [
  48. rl_completion_func_t *func1= (rl_completion_func_t*)0;
  49. rl_compentry_func_t *func2= (rl_compentry_func_t*)0;
  50. ],
  51. [
  52. mysql_cv_new_rl_interface=yes
  53. AC_DEFINE_UNQUOTED([USE_NEW_READLINE_INTERFACE], [1],
  54. [used new readline interface (are rl_completion_func_t and rl_compentry_func_t defined)])
  55. ],
  56. [mysql_cv_new_rl_interface=no]
  57. )
  58. )
  59. ])
  60. dnl
  61. dnl check for availability of multibyte characters and functions
  62. dnl (Based on BASH_CHECK_MULTIBYTE in aclocal.m4 of readline-5.0)
  63. dnl
  64. AC_DEFUN([MYSQL_CHECK_MULTIBYTE],
  65. [
  66. AC_CHECK_HEADERS(wctype.h)
  67. AC_CHECK_HEADERS(wchar.h)
  68. AC_CHECK_HEADERS(langinfo.h)
  69. AC_CHECK_FUNC(mbrlen, AC_DEFINE(HAVE_MBRLEN,[],[Define if you have mbrlen]))
  70. AC_CHECK_FUNC(mbscmp, AC_DEFINE(HAVE_MBSCMP,[],[Define if you have mbscmp]))
  71. AC_CHECK_FUNC(mbsrtowcs, AC_DEFINE(HAVE_MBSRTOWCS,[],[Define if you have mbsrtowcs]))
  72. AC_CHECK_FUNC(wcrtomb, AC_DEFINE(HAVE_WCRTOMB,[],[Define if you have wcrtomb]))
  73. AC_CHECK_FUNC(mbrtowc, AC_DEFINE(HAVE_MBRTOWC,[],[Define if you have mbrtowc]))
  74. AC_CHECK_FUNC(wcscoll, AC_DEFINE(HAVE_WCSCOLL,[],[Define if you have wcscoll]))
  75. AC_CHECK_FUNC(wcsdup, AC_DEFINE(HAVE_WCSDUP,[],[Define if you have wcsdup]))
  76. AC_CHECK_FUNC(wcwidth, AC_DEFINE(HAVE_WCWIDTH,[],[Define if you have wcwidth]))
  77. AC_CHECK_FUNC(wctype, AC_DEFINE(HAVE_WCTYPE,[],[Define if you have wctype]))
  78. AC_CACHE_CHECK([for mbstate_t], mysql_cv_have_mbstate_t,
  79. [AC_TRY_COMPILE([
  80. #include <wchar.h>], [
  81. mbstate_t ps;
  82. mbstate_t *psp;
  83. psp = (mbstate_t *)0;
  84. ], mysql_cv_have_mbstate_t=yes, mysql_cv_have_mbstate_t=no)])
  85. if test $mysql_cv_have_mbstate_t = yes; then
  86. AC_DEFINE([HAVE_MBSTATE_T],[],[Define if mysql_cv_have_mbstate_t=yes])
  87. fi
  88. AC_CHECK_FUNCS(iswlower iswupper towlower towupper iswctype)
  89. AC_CACHE_CHECK([for nl_langinfo and CODESET], mysql_cv_langinfo_codeset,
  90. [AC_TRY_LINK(
  91. [#include <langinfo.h>],
  92. [char* cs = nl_langinfo(CODESET);],
  93. mysql_cv_langinfo_codeset=yes, mysql_cv_langinfo_codeset=no)])
  94. if test $mysql_cv_langinfo_codeset = yes; then
  95. AC_DEFINE([HAVE_LANGINFO_CODESET],[],[Define if mysql_cv_langinfo_codeset=yes])
  96. fi
  97. dnl check for wchar_t in <wchar.h>
  98. AC_CACHE_CHECK([for wchar_t in wchar.h], bash_cv_type_wchar_t,
  99. [AC_TRY_COMPILE(
  100. [#include <wchar.h>
  101. ],
  102. [
  103. wchar_t foo;
  104. foo = 0;
  105. ], bash_cv_type_wchar_t=yes, bash_cv_type_wchar_t=no)])
  106. if test $bash_cv_type_wchar_t = yes; then
  107. AC_DEFINE(HAVE_WCHAR_T, 1, [systems should define this type here])
  108. fi
  109. dnl check for wctype_t in <wctype.h>
  110. AC_CACHE_CHECK([for wctype_t in wctype.h], bash_cv_type_wctype_t,
  111. [AC_TRY_COMPILE(
  112. [#include <wctype.h>],
  113. [
  114. wctype_t foo;
  115. foo = 0;
  116. ], bash_cv_type_wctype_t=yes, bash_cv_type_wctype_t=no)])
  117. if test $bash_cv_type_wctype_t = yes; then
  118. AC_DEFINE(HAVE_WCTYPE_T, 1, [systems should define this type here])
  119. fi
  120. dnl check for wint_t in <wctype.h>
  121. AC_CACHE_CHECK([for wint_t in wctype.h], bash_cv_type_wint_t,
  122. [AC_TRY_COMPILE(
  123. [#include <wctype.h>],
  124. [
  125. wint_t foo;
  126. foo = 0;
  127. ], bash_cv_type_wint_t=yes, bash_cv_type_wint_t=no)])
  128. if test $bash_cv_type_wint_t = yes; then
  129. AC_DEFINE(HAVE_WINT_T, 1, [systems should define this type here])
  130. fi
  131. ])