-
Notifications
You must be signed in to change notification settings - Fork 13
/
configure.ac
146 lines (118 loc) · 3.3 KB
/
configure.ac
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([ucto],[0.35],[[email protected]]) #adapt version number in codemeta.json as well
AM_INIT_AUTOMAKE([foreign])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
SYSCONFDIR=$sysconfdir
AC_SUBST([SYSCONFDIR])
AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX_17])
# Checks for programs.
AC_PROG_CXX( [g++ c++] )
AX_CXX_COMPILE_STDCXX_17
# use libtool
LT_INIT
AC_PROG_LN_S
# when running tests, use CXX
AC_LANG([C++])
# Checks for libraries.
# Checks for header files.
AC_HEADER_STDBOOL
# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
AC_TYPE_SIZE_T
AC_TYPE_INT8_T
AC_TYPE_INT32_T
# Checks for library functions.
AX_LIB_READLINE
if test $prefix = "NONE"; then
prefix="$ac_default_prefix"
fi
PKG_PROG_PKG_CONFIG
if test "x$PKG_CONFIG_PATH" = x; then
export PKG_CONFIG_PATH="$prefix/lib/pkgconfig"
else
export PKG_CONFIG_PATH="$prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
fi
AC_OSX_PKG( [icu4c libtextcat] )
AC_MSG_NOTICE([pkg-config: PATH=$PKG_CONFIG_PATH])
PKG_CHECK_MODULES( [TEXTCAT],
[libexttextcat],
[TEXTCAT_FOUND=1
CXXFLAGS="$CXXFLAGS $TEXTCAT_CFLAGS"
LIBS="$TEXTCAT_LIBS $LIBS"],
[PKG_CHECK_MODULES( [TEXTCAT],
[libtextcat],
[TEXTCAT_FOUND=1
CXXFLAGS="$CXXFLAGS $TEXTCAT_CFLAGS"
LIBS="$TEXTCAT_LIBS $LIBS"],
[TEXTCAT_FOUND=0]
)]
)
if test $TEXTCAT_FOUND = 0; then
# So, no pkg-config for textcat found.
# Hopefully an old style version can be found???
AC_CHECK_OLD_TEXTCAT
if test $TEXTCAT_FOUND = 1; then
AC_DEFINE([HAVE_OLD_TEXTCAT], [1], [textcat needs C linkage])
fi
fi
if test $TEXTCAT_FOUND = 1; then
AC_SEARCH_LM
fi
if test $TEXTCAT_FOUND = 0; then
AC_MSG_ERROR( [no working libtextcat or libexttextcat found!] )
else
AC_DEFINE([HAVE_TEXTCAT], [1], [textcat])
fi
PKG_CHECK_MODULES([ICU], [icu-uc >= 50 icu-io] )
CXXFLAGS="$CXXFLAGS $ICU_CFLAGS"
LIBS="$ICU_LIBS $LIBS"
PKG_CHECK_MODULES([XML2], [libxml-2.0 >= 2.9.4] )
CXXFLAGS="$CXXFLAGS $XML2_CFLAGS"
LIBS="$LIBS $XML2_LIBS"
PKG_CHECK_MODULES([folia], [folia >= 2.19] )
CXXFLAGS="$folia_CFLAGS $CXXFLAGS"
LIBS="$folia_LIBS $LIBS"
PKG_CHECK_MODULES([ticcutils], [ticcutils >= 0.36] )
CXXFLAGS="$CXXFLAGS $ticcutils_CFLAGS"
LIBS="$LIBS $ticcutils_LIBS"
PKG_CHECK_MODULES(
[uctodata],
[uctodata],
[PKG_CHECK_MODULES(
[uctodata],
[uctodata >= 0.9],
[],
[AC_MSG_NOTICE([ATTENTION:
Your ucto datafiles are outdated
You should consider installing a newer version of the uctodata package!])])
],
[AC_MSG_ERROR([ATTENTION:
ucto datafiles are not installed!. Please install uctodata package.] )] )
UCTODATA_PRE=`pkg-config --variable=prefix uctodata`
UCTODATA_DIR=$UCTODATA_PRE/share/ucto
AC_DEFINE_UNQUOTED( [UCTODATA_DIR],
["$UCTODATA_DIR/"],
[location of uctodata files])
UCTODATA_VER=`pkg-config --modversion uctodata`
AC_DEFINE_UNQUOTED( [UCTODATA_VERSION],
["${UCTODATA_VER}"],
[the uctodata version])
# Checks for library functions.
AC_CONFIG_FILES([
Makefile
ucto.pc
m4/Makefile
config/Makefile
config/textcat_normal.cfg
config/textcat_alt.cfg
docs/Makefile
src/Makefile
tests/Makefile
include/Makefile
include/ucto/Makefile
])
AC_OUTPUT