~drizzle-trunk/drizzle/development

1 by brian
clean slate
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
5
6
AC_DIVERT_PUSH(0)
7
8
define(CHARSETS_AVAILABLE0,binary)
377.1.1 by Brian Aker
More changes in charsets (just deletions)
9
define(CHARSETS_AVAILABLE5,utf8)
1 by brian
clean slate
10
377 by Brian Aker
Changing default character set from this point on.
11
DEFAULT_CHARSET=utf8
377.1.1 by Brian Aker
More changes in charsets (just deletions)
12
CHARSETS_AVAILABLE="CHARSETS_AVAILABLE0 CHARSETS_AVAILABLE5"
13
CHARSETS_COMPLEX="utf8"
1 by brian
clean slate
14
15
AC_DIVERT_POP
16
17
AC_ARG_WITH(charset,
18
   [  --with-charset=CHARSET
377.1.1 by Brian Aker
More changes in charsets (just deletions)
19
                          Default character set, use one of: CHARSETS_AVAILABLE0 CHARSETS_AVAILABLE5],
1 by brian
clean slate
20
   [default_charset="$withval"],
21
   [default_charset="$DEFAULT_CHARSET"])
22
23
AC_ARG_WITH(collation,
24
   [  --with-collation=COLLATION
25
                          Default collation],
26
   [default_collation="$withval"],
27
   [default_collation="default"])
28
29
AC_MSG_CHECKING("character sets")
30
760 by Brian Aker
Cleanup around UTf8 code.
31
CHARSETS="$default_charset utf8"
1 by brian
clean slate
32
33
for cs in $CHARSETS
34
do
35
  case $cs in 
36
    binary)
37
      ;;
38
    utf8)
39
      AC_DEFINE(HAVE_CHARSET_utf8mb4, 1, [Define to enable ut8])
40
      AC_DEFINE([USE_MB], 1, [Use multi-byte character routines])
383.1.2 by Brian Aker
Pass through removing charsets which are dead.
41
      AC_DEFINE(USE_MB_IDENT, [1], [ ])
1 by brian
clean slate
42
      ;;
43
    *)
44
      AC_MSG_ERROR([Charset '$cs' not available. (Available are: $CHARSETS_AVAILABLE).
45
      See the Installation chapter in the Reference Manual.])
46
  esac
47
done
48
49
50
      default_charset_collations=""
51
52
case $default_charset in 
53
    utf8)
54
      default_charset_default_collation="utf8_general_ci"
55
      define(UTFC1, utf8_general_ci utf8_bin)
56
      define(UTFC2, utf8_czech_ci utf8_danish_ci)
57
      define(UTFC3, utf8_esperanto_ci utf8_estonian_ci utf8_icelandic_ci)
58
      define(UTFC4, utf8_latvian_ci utf8_lithuanian_ci)
59
      define(UTFC5, utf8_persian_ci utf8_polish_ci utf8_romanian_ci)
60
      define(UTFC6, utf8_sinhala_ci utf8_slovak_ci utf8_slovenian_ci)
61
      define(UTFC7, utf8_spanish2_ci utf8_spanish_ci)
62
      define(UTFC8, utf8_swedish_ci utf8_turkish_ci)
63
      define(UTFC9, utf8_unicode_ci)
64
      UTFC="UTFC1 UTFC2 UTFC3 UTFC4 UTFC5 UTFC6 UTFC7 UTFC8 UTFC9"
65
      default_charset_collations="$UTFC"
66
      ;;
67
    *)
68
      AC_MSG_ERROR([Charset $cs not available. (Available are: $CHARSETS_AVAILABLE).
69
      See the Installation chapter in the Reference Manual.])
70
esac
71
72
if test "$default_collation" = default; then
73
  default_collation=$default_charset_default_collation
74
fi
75
76
valid_default_collation=no
77
for cl in $default_charset_collations
78
do
79
  if test x"$cl" = x"$default_collation"
80
  then
81
    valid_default_collation=yes
82
    break
83
  fi
84
done
85
86
if test x$valid_default_collation = xyes
87
then
88
  AC_MSG_RESULT([default: $default_charset, collation: $default_collation; compiled in: $CHARSETS])
89
else
90
  AC_MSG_ERROR([
91
      Collation $default_collation is not valid for character set $default_charset.
92
      Valid collations are: $default_charset_collations.
93
      See the Installation chapter in the Reference Manual.
94
  ])
95
fi
96
319.1.1 by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_
97
AC_DEFINE_UNQUOTED([DRIZZLE_DEFAULT_CHARSET_NAME], ["$default_charset"],
1 by brian
clean slate
98
                   [Define the default charset name])
319.1.1 by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_
99
AC_DEFINE_UNQUOTED([DRIZZLE_DEFAULT_COLLATION_NAME], ["$default_collation"],
1 by brian
clean slate
100
                   [Define the default charset name])