summaryrefslogtreecommitdiffstats
path: root/unicode/m4/courier-unicode.m4
blob: 9619b4524580f3a0367883ad471739d807616b2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
dnl Sets the COURIER_UNICODE_CXXFLAGS variable to any additional compiler
dnl flags needed to build the courier-unicode package and packages that
dnl use the courier-unicode package.

AC_DEFUN([AX_COURIER_UNICODE_CXXFLAGS],[

AC_REQUIRE([AC_PROG_CXX])

save_FLAGS="$CXXFLAGS"

AC_LANG_PUSH([C++])


AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <string>
]], [[
     std::u32string s;
     char32_t c;
     ]])],
     [
     ],
     [

COURIER_UNICODE_CXXFLAGS="-std=c++11"
CXXFLAGS="$save_CFLAGS $COURIER_UNICODE_CXXFLAGS"

AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <string>
]], [[
     std::u32string s;
     char32_t c;
     ]])],
     [
     ],
     [

COURIER_UNICODE_CXXFLAGS="-std=c++0x"
CXXFLAGS="$save_CFLAGS $COURIER_UNICODE_CXXFLAGS"

AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <string>
]], [[
     std::u32string s;
     char32_t c;
     ]])],
     [
     ],
     [
AC_MSG_ERROR([*** A compiler with C++11 Unicode support was not found])
])
])
])
CXXFLAGS="$save_FLAGS"

AC_LANG_POP([C++])
])