1# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
2#
3# This program is free software; you can redistribute it and/or modify
4# it under the terms of the GNU General Public License as published by
5# the Free Software Foundation; version 2 of the License.
6#
7# This program is distributed in the hope that it will be useful,
8# but WITHOUT ANY WARRANTY; without even the implied warranty of
9# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10# GNU General Public License for more details.
11#
12# You should have received a copy of the GNU General Public License
13# along with this program; if not, write to the Free Software
14# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1335  USA
15
16# Charsets and collations
17IF(NOT DEFAULT_CHARSET)
18  SET(DEFAULT_CHARSET "latin1")
19ENDIF()
20
21IF(NOT DEFAULT_COLLATION)
22  SET(DEFAULT_COLLATION "latin1_swedish_ci")
23ENDIF()
24
25SET(CHARSETS ${DEFAULT_CHARSET} latin1 utf8mb3 utf8mb4)
26SET(CHARSETS_COMPLEX
27  big5 cp1250 cp932 eucjpms euckr gb2312 gbk latin1 latin2
28  sjis tis620 ucs2 ujis utf8mb3 utf8mb4 utf16 utf16le utf32)
29
30SET(CHARSETS_AVAILABLE
31binary armscii8 ascii big5 cp1250 cp1251 cp1256 cp1257
32cp850 cp852 cp866 cp932 dec8 eucjpms euckr gb2312 gbk geostd8
33greek hebrew hp8 keybcs2 koi8r koi8u
34latin1 latin2 latin5 latin7 macce macroman
35sjis swe7 tis620 ucs2 ujis utf8mb3 utf8mb4 utf16 utf16le utf32)
36
37
38SET (EXTRA_CHARSETS "all")
39SET(WITH_EXTRA_CHARSETS ${EXTRA_CHARSETS} CACHE
40  STRING "Options are: none complex all")
41
42
43IF(WITH_EXTRA_CHARSETS MATCHES "complex")
44  SET(CHARSETS ${CHARSETS} ${CHARSETS_COMPLEX})
45ELSEIF(WITH_EXTRA_CHARSETS MATCHES "all")
46  SET(CHARSETS ${CHARSETS} ${CHARSETS_AVAILABLE})
47ENDIF()
48
49SET(MYSQL_DEFAULT_CHARSET_NAME "${DEFAULT_CHARSET}")
50SET(MYSQL_DEFAULT_COLLATION_NAME "${DEFAULT_COLLATION}")
51
52FOREACH(cs in ${CHARSETS})
53  SET(HAVE_CHARSET_${cs} 1)
54ENDFOREACH()
55
56SET(HAVE_UCA_COLLATIONS 1)
57
58SET(HAVE_UTF8_GENERAL_CS 1)
59SET(USE_MB 1)
60SET(USE_MB_IDENT 1)
61
62