1
dnl In order to add new charset, you must add charset name to
2
dnl this CHARSETS_AVAILABLE list and sql/share/charsets/Index.xml.
3
dnl If the character set uses strcoll or other special handling,
4
dnl you must also create strings/ctype-$charset_name.c
8
define(CHARSETS_AVAILABLE0,binary)
9
define(CHARSETS_AVAILABLE1,armscii8 ascii big5 cp1250 cp1251 cp1256 cp1257)
10
define(CHARSETS_AVAILABLE2,cp850 cp852 cp866 cp932 dec8 eucjpms euckr gb2312 gbk geostd8)
11
define(CHARSETS_AVAILABLE3,greek hebrew hp8 keybcs2 koi8r koi8u)
12
define(CHARSETS_AVAILABLE4,latin1 latin2 latin5 latin7 macce macroman)
13
define(CHARSETS_AVAILABLE5,sjis swe7 tis620 ucs2 ujis utf8 utf8mb3 utf16 utf32)
15
DEFAULT_CHARSET=latin1
16
CHARSETS_AVAILABLE="CHARSETS_AVAILABLE0 CHARSETS_AVAILABLE1 CHARSETS_AVAILABLE2 CHARSETS_AVAILABLE3 CHARSETS_AVAILABLE4 CHARSETS_AVAILABLE5"
17
CHARSETS_COMPLEX="big5 cp1250 cp932 eucjpms euckr gb2312 gbk latin1 latin2 sjis tis620 ucs2 ujis utf8 utf8mb3 utf16 utf32"
22
[ --with-charset=CHARSET
23
Default character set, use one of:
30
[default_charset="$withval"],
31
[default_charset="$DEFAULT_CHARSET"])
33
AC_ARG_WITH(collation,
34
[ --with-collation=COLLATION
36
[default_collation="$withval"],
37
[default_collation="default"])
40
AC_ARG_WITH(extra-charsets,
41
[ --with-extra-charsets=CHARSET[,CHARSET,...]
42
Use charsets in addition to default (none, complex,
43
all, or a list selected from the above sets)],
44
[extra_charsets="$withval"],
45
[extra_charsets="none"])
48
AC_MSG_CHECKING("character sets")
50
CHARSETS="$default_charset latin1 utf8 utf8mb3"
52
if test "$extra_charsets" = no; then
54
elif test "$extra_charsets" = none; then
56
elif test "$extra_charsets" = complex; then
57
CHARSETS="$CHARSETS $CHARSETS_COMPLEX"
58
AC_DEFINE([DEFINE_ALL_CHARACTER_SETS],1,[all charsets are available])
59
elif test "$extra_charsets" = all; then
60
CHARSETS="$CHARSETS $CHARSETS_AVAILABLE"
61
AC_DEFINE([DEFINE_ALL_CHARACTER_SETS],1,[all charsets are available])
63
EXTRA_CHARSETS=`echo $extra_charsets | sed -e 's/,/ /g'`
64
CHARSETS="$CHARSETS $EXTRA_CHARSETS"
71
AC_DEFINE(HAVE_CHARSET_armscii8, 1,
72
[Define to enable charset armscii8])
75
AC_DEFINE(HAVE_CHARSET_ascii, 1,
76
[Define to enable ascii character set])
79
AC_DEFINE(HAVE_CHARSET_big5, 1, [Define to enable charset big5])
80
AC_DEFINE([USE_MB], [1], [Use multi-byte character routines])
81
AC_DEFINE(USE_MB_IDENT, [1], [ ])
86
AC_DEFINE(HAVE_CHARSET_cp1250, 1, [Define to enable cp1250])
89
AC_DEFINE(HAVE_CHARSET_cp1251, 1, [Define to enable charset cp1251])
92
AC_DEFINE(HAVE_CHARSET_cp1256, 1, [Define to enable charset cp1256])
95
AC_DEFINE(HAVE_CHARSET_cp1257, 1, [Define to enable charset cp1257])
98
AC_DEFINE(HAVE_CHARSET_cp850, 1, [Define to enable charset cp850])
101
AC_DEFINE(HAVE_CHARSET_cp852, 1, [Define to enable charset cp852])
104
AC_DEFINE(HAVE_CHARSET_cp866, 1, [Define to enable charset cp866])
107
AC_DEFINE(HAVE_CHARSET_cp932, 1, [Define to enable charset cp932])
108
AC_DEFINE([USE_MB], 1, [Use multi-byte character routines])
109
AC_DEFINE(USE_MB_IDENT, 1)
112
AC_DEFINE(HAVE_CHARSET_dec8, 1, [Define to enable charset dec8])
115
AC_DEFINE(HAVE_CHARSET_eucjpms, 1, [Define to enable charset eucjpms])
116
AC_DEFINE([USE_MB], [1], [Use multi-byte character routines])
117
AC_DEFINE(USE_MB_IDENT, 1)
120
AC_DEFINE(HAVE_CHARSET_euckr, 1, [Define to enable charset euckr])
121
AC_DEFINE([USE_MB], [1], [Use multi-byte character routines])
122
AC_DEFINE(USE_MB_IDENT, 1)
125
AC_DEFINE(HAVE_CHARSET_gb2312, 1, [Define to enable charset gb2312])
126
AC_DEFINE([USE_MB], 1, [Use multi-byte character routines])
127
AC_DEFINE(USE_MB_IDENT, 1)
130
AC_DEFINE(HAVE_CHARSET_gbk, 1, [Define to enable charset gbk])
131
AC_DEFINE([USE_MB], [1], [Use multi-byte character routines])
132
AC_DEFINE(USE_MB_IDENT, 1)
135
AC_DEFINE(HAVE_CHARSET_geostd8, 1, [Define to enable charset geostd8])
138
AC_DEFINE(HAVE_CHARSET_greek, 1, [Define to enable charset greek])
141
AC_DEFINE(HAVE_CHARSET_hebrew, 1, [Define to enable charset hebrew])
144
AC_DEFINE(HAVE_CHARSET_hp8, 1, [Define to enable charset hp8])
147
AC_DEFINE(HAVE_CHARSET_keybcs2, 1, [Define to enable charset keybcs2])
150
AC_DEFINE(HAVE_CHARSET_koi8r, 1, [Define to enable charset koi8r])
153
AC_DEFINE(HAVE_CHARSET_koi8u, 1, [Define to enable charset koi8u])
156
AC_DEFINE(HAVE_CHARSET_latin1, 1, [Define to enable charset latin1])
159
AC_DEFINE(HAVE_CHARSET_latin2, 1, [Define to enable charset latin2])
162
AC_DEFINE(HAVE_CHARSET_latin5, 1, [Define to enable charset latin5])
165
AC_DEFINE(HAVE_CHARSET_latin7, 1, [Define to enable charset latin7])
168
AC_DEFINE(HAVE_CHARSET_macce, 1, [Define to enable charset macce])
171
AC_DEFINE(HAVE_CHARSET_macroman, 1,
172
[Define to enable charset macroman])
175
AC_DEFINE(HAVE_CHARSET_sjis, 1, [Define to enable charset sjis])
176
AC_DEFINE([USE_MB], 1, [Use multi-byte character routines])
177
AC_DEFINE(USE_MB_IDENT, 1)
180
AC_DEFINE(HAVE_CHARSET_swe7, 1, [Define to enable charset swe7])
183
AC_DEFINE(HAVE_CHARSET_tis620, 1, [Define to enable charset tis620])
186
AC_DEFINE(HAVE_CHARSET_ucs2, 1, [Define to enable charset ucs2])
187
AC_DEFINE([USE_MB], [1], [Use multi-byte character routines])
188
AC_DEFINE(USE_MB_IDENT, 1)
191
AC_DEFINE(HAVE_CHARSET_ujis, 1, [Define to enable charset ujis])
192
AC_DEFINE([USE_MB], [1], [Use multi-byte character routines])
193
AC_DEFINE(USE_MB_IDENT, 1)
196
AC_DEFINE(HAVE_CHARSET_utf8mb4, 1, [Define to enable ut8])
197
AC_DEFINE([USE_MB], 1, [Use multi-byte character routines])
198
AC_DEFINE(USE_MB_IDENT, 1)
201
AC_DEFINE(HAVE_CHARSET_utf8mb3, 1, [Define to enable ut8])
202
AC_DEFINE([USE_MB], 1, [Use multi-byte character routines])
203
AC_DEFINE(USE_MB_IDENT, 1)
206
AC_DEFINE(HAVE_CHARSET_utf16, 1, [Define to enable utf16])
207
AC_DEFINE([USE_MB], 1, [Use multi-byte character routines])
208
AC_DEFINE(USE_MB_IDENT, 1)
211
AC_DEFINE(HAVE_CHARSET_utf32, 1, [Define to enable utf32])
212
AC_DEFINE([USE_MB], 1, [Use multi-byte character routines])
213
AC_DEFINE(USE_MB_IDENT, 1)
216
AC_MSG_ERROR([Charset '$cs' not available. (Available are: $CHARSETS_AVAILABLE).
217
See the Installation chapter in the Reference Manual.])
222
default_charset_collations=""
224
case $default_charset in
226
default_charset_default_collation="armscii8_general_ci"
227
default_charset_collations="armscii8_general_ci armscii8_bin"
230
default_charset_default_collation="ascii_general_ci"
231
default_charset_collations="ascii_general_ci ascii_bin"
234
default_charset_default_collation="big5_chinese_ci"
235
default_charset_collations="big5_chinese_ci big5_bin"
238
default_charset_default_collation="binary"
239
default_charset_collations="binary"
242
default_charset_default_collation="cp1250_general_ci"
243
default_charset_collations="cp1250_general_ci cp1250_czech_cs cp1250_bin"
246
default_charset_default_collation="cp1251_general_ci"
247
default_charset_collations="cp1251_general_ci cp1251_general_cs cp1251_bin cp1251_bulgarian_ci cp1251_ukrainian_ci"
250
default_charset_default_collation="cp1256_general_ci"
251
default_charset_collations="cp1256_general_ci cp1256_bin"
254
default_charset_default_collation="cp1257_general_ci"
255
default_charset_collations="cp1257_general_ci cp1257_lithuanian_ci cp1257_bin"
258
default_charset_default_collation="cp850_general_ci"
259
default_charset_collations="cp850_general_ci cp850_bin"
262
default_charset_default_collation="cp852_general_ci"
263
default_charset_collations="cp852_general_ci cp852_bin"
266
default_charset_default_collation="cp866_general_ci"
267
default_charset_collations="cp866_general_ci cp866_bin"
270
default_charset_default_collation="cp932_japanese_ci"
271
default_charset_collations="cp932_japanese_ci cp932_bin"
274
default_charset_default_collation="dec8_swedish_ci"
275
default_charset_collations="dec8_swedish_ci dec8_bin"
278
default_charset_default_collation="eucjpms_japanese_ci"
279
default_charset_collations="eucjpms_japanese_ci ujis_bin"
282
default_charset_default_collation="euckr_korean_ci"
283
default_charset_collations="euckr_korean_ci euckr_bin"
286
default_charset_default_collation="gb2312_chinese_ci"
287
default_charset_collations="gb2312_chinese_ci gb2312_bin"
290
default_charset_default_collation="gbk_chinese_ci"
291
default_charset_collations="gbk_chinese_ci gbk_bin"
294
default_charset_default_collation="geostd8_general_ci"
295
default_charset_collations="geostd8_general_ci geostd8_bin"
298
default_charset_default_collation="greek_general_ci"
299
default_charset_collations="greek_general_ci greek_bin"
302
default_charset_default_collation="hebrew_general_ci"
303
default_charset_collations="hebrew_general_ci hebrew_bin"
306
default_charset_default_collation="hp8_english_ci"
307
default_charset_collations="hp8_english_ci hp8_bin"
310
default_charset_default_collation="keybcs2_general_ci"
311
default_charset_collations="keybcs2_general_ci keybcs2_bin"
314
default_charset_default_collation="koi8r_general_ci"
315
default_charset_collations="koi8r_general_ci koi8r_bin"
318
default_charset_default_collation="koi8u_general_ci"
319
default_charset_collations="koi8u_general_ci koi8u_bin"
322
default_charset_default_collation="latin1_swedish_ci"
323
default_charset_collations="latin1_general_ci latin1_general_cs latin1_bin latin1_german1_ci latin1_german2_ci latin1_danish_ci latin1_spanish_ci latin1_swedish_ci"
326
default_charset_default_collation="latin2_general_ci"
327
default_charset_collations="latin2_general_ci latin2_bin latin2_czech_cs latin2_hungarian_ci latin2_croatian_ci"
330
default_charset_default_collation="latin5_turkish_ci"
331
default_charset_collations="latin5_turkish_ci latin5_bin"
334
default_charset_default_collation="latin7_general_ci"
335
default_charset_collations="latin7_general_ci latin7_general_cs latin7_bin latin7_estonian_cs"
338
default_charset_default_collation="macce_general_ci"
339
default_charset_collations="macce_general_ci macce_bin"
342
default_charset_default_collation="macroman_general_ci"
343
default_charset_collations="macroman_general_ci macroman_bin"
346
default_charset_default_collation="sjis_japanese_ci"
347
default_charset_collations="sjis_japanese_ci sjis_bin"
350
default_charset_default_collation="swe7_swedish_ci"
351
default_charset_collations="swe7_swedish_ci swe7_bin"
354
default_charset_default_collation="tis620_thai_ci"
355
default_charset_collations="tis620_thai_ci tis620_bin"
358
default_charset_default_collation="ucs2_general_ci"
359
define(UCSC1, ucs2_general_ci ucs2_bin)
360
define(UCSC2, ucs2_czech_ci ucs2_danish_ci)
361
define(UCSC3, ucs2_esperanto_ci ucs2_estonian_ci ucs2_icelandic_ci)
362
define(UCSC4, ucs2_latvian_ci ucs2_lithuanian_ci)
363
define(UCSC5, ucs2_persian_ci ucs2_polish_ci ucs2_romanian_ci)
364
define(UCSC6, ucs2_sinhala_ci ucs2_slovak_ci ucs2_slovenian_ci)
365
define(UCSC7, ucs2_spanish2_ci ucs2_spanish_ci)
366
define(UCSC8, ucs2_swedish_ci ucs2_turkish_ci)
367
define(UCSC9, ucs2_unicode_ci)
368
UCSC="UCSC1 UCSC2 UCSC3 UCSC4 UCSC5 UCSC6 UCSC7 UCSC8 UCSC9"
369
default_charset_collations="$UCSC"
372
default_charset_default_collation="ujis_japanese_ci"
373
default_charset_collations="ujis_japanese_ci ujis_bin"
376
default_charset_default_collation="utf8_general_ci"
377
define(UTFC1, utf8_general_ci utf8_bin)
378
define(UTFC2, utf8_czech_ci utf8_danish_ci)
379
define(UTFC3, utf8_esperanto_ci utf8_estonian_ci utf8_icelandic_ci)
380
define(UTFC4, utf8_latvian_ci utf8_lithuanian_ci)
381
define(UTFC5, utf8_persian_ci utf8_polish_ci utf8_romanian_ci)
382
define(UTFC6, utf8_sinhala_ci utf8_slovak_ci utf8_slovenian_ci)
383
define(UTFC7, utf8_spanish2_ci utf8_spanish_ci)
384
define(UTFC8, utf8_swedish_ci utf8_turkish_ci)
385
define(UTFC9, utf8_unicode_ci)
386
UTFC="UTFC1 UTFC2 UTFC3 UTFC4 UTFC5 UTFC6 UTFC7 UTFC8 UTFC9"
387
default_charset_collations="$UTFC"
390
default_charset_default_collation="utf8mb3_general_ci"
391
if test "$default_collation" = "utf8mb3_general_cs"; then
392
# For those who explicitly desire "utf8mb3_general_cs", support it,
393
# and then also set the CPP switch enabling that code.
394
UTFC="utf8mb3_general_cs"
395
AC_DEFINE([HAVE_UTF8_GENERAL_CS], [1], [certain Japanese customer])
397
define(UTFC1, utf8mb3_general_ci utf8mb3_bin)
398
define(UTFC2, utf8mb3_czech_ci utf8mb3_danish_ci)
399
define(UTFC3, utf8mb3_esperanto_ci utf8mb3_estonian_ci utf8mb3_icelandic_ci)
400
define(UTFC4, utf8mb3_latvian_ci utf8mb3_lithuanian_ci)
401
define(UTFC5, utf8mb3_persian_ci utf8mb3_polish_ci utf8mb3_romanian_ci)
402
define(UTFC6, utf8mb3_sinhala_ci utf8mb3_slovak_ci utf8mb3_slovenian_ci)
403
define(UTFC7, utf8mb3_spanish2_ci utf8mb3_spanish_ci)
404
define(UTFC8, utf8mb3_swedish_ci utf8mb3_turkish_ci)
405
define(UTFC9, utf8mb3_unicode_ci)
406
UTFC="UTFC1 UTFC2 UTFC3 UTFC4 UTFC5 UTFC6 UTFC7 UTFC8 UTFC9"
408
default_charset_collations="$UTFC"
411
default_charset_default_collation="utf16_general_ci"
412
define(UTFC1, utf16_general_ci utf16_bin)
413
define(UTFC2, utf16_czech_ci utf16_danish_ci)
414
define(UTFC3, utf16_esperanto_ci utf16_estonian_ci utf16_icelandic_ci)
415
define(UTFC4, utf16_latvian_ci utf16_lithuanian_ci)
416
define(UTFC5, utf16_persian_ci utf16_polish_ci utf16_romanian_ci)
417
define(UTFC6, utf16_sinhala_ci utf16_slovak_ci utf16_slovenian_ci)
418
define(UTFC7, utf16_spanish2_ci utf16_spanish_ci)
419
define(UTFC8, utf16_swedish_ci utf16_turkish_ci)
420
define(UTFC9, utf16_unicode_ci)
421
UTFC="UTFC1 UTFC2 UTFC3 UTFC4 UTFC5 UTFC6 UTFC7 UTFC8 UTFC9"
422
default_charset_collations="$UTFC"
425
default_charset_default_collation="utf32_general_ci"
426
define(UTFC1, utf32_general_ci utf32_bin)
427
define(UTFC2, utf32_czech_ci utf32_danish_ci)
428
define(UTFC3, utf32_esperanto_ci utf32_estonian_ci utf32_icelandic_ci)
429
define(UTFC4, utf32_latvian_ci utf32_lithuanian_ci)
430
define(UTFC5, utf32_persian_ci utf32_polish_ci utf32_romanian_ci)
431
define(UTFC6, utf32_sinhala_ci utf32_slovak_ci utf32_slovenian_ci)
432
define(UTFC7, utf32_spanish2_ci utf32_spanish_ci)
433
define(UTFC8, utf32_swedish_ci utf32_turkish_ci)
434
define(UTFC9, utf32_unicode_ci)
435
UTFC="UTFC1 UTFC2 UTFC3 UTFC4 UTFC5 UTFC6 UTFC7 UTFC8 UTFC9"
436
default_charset_collations="$UTFC"
439
AC_MSG_ERROR([Charset $cs not available. (Available are: $CHARSETS_AVAILABLE).
440
See the Installation chapter in the Reference Manual.])
443
if test "$default_collation" = default; then
444
default_collation=$default_charset_default_collation
447
valid_default_collation=no
448
for cl in $default_charset_collations
450
if test x"$cl" = x"$default_collation"
452
valid_default_collation=yes
457
if test x$valid_default_collation = xyes
459
AC_MSG_RESULT([default: $default_charset, collation: $default_collation; compiled in: $CHARSETS])
462
Collation $default_collation is not valid for character set $default_charset.
463
Valid collations are: $default_charset_collations.
464
See the Installation chapter in the Reference Manual.
468
AC_DEFINE_UNQUOTED([MYSQL_DEFAULT_CHARSET_NAME], ["$default_charset"],
469
[Define the default charset name])
470
AC_DEFINE_UNQUOTED([MYSQL_DEFAULT_COLLATION_NAME], ["$default_collation"],
471
[Define the default charset name])
473
# Shall we build the UCA-based Unicode collations
475
[ --without-uca Skip building of the national Unicode collations.],
480
AC_MSG_CHECKING([whether to compile national Unicode collations])
482
if test "$with_uca" = "yes"
485
AC_DEFINE([HAVE_UCA_COLLATIONS], [1], [national Unicode collations])
491
# Shall we build experimental collations
492
AC_ARG_WITH(experimental-collations,
494
[with_exp_coll=$withval],
498
if test "$with_exp_coll" = "yes"
500
AC_DEFINE([HAVE_UTF8_GENERAL_CS], [1], [certain Japanese customer])