-
Notifications
You must be signed in to change notification settings - Fork 11
/
configure.ac
162 lines (130 loc) · 3.89 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
#also adapt version number in codemeta.json
AC_INIT([frog],[0.34],[[email protected]]) #adapt version number in codemeta.json as well
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
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
# when running tests, use CXX
AC_LANG([C++])
# Checks for libraries.
# Checks for typedefs, structures, and compiler characteristics.
# check OpenMP support
AC_OPENMP
if test "x$ac_cv_prog_cxx_openmp" != "x"; then
if test "x$ac_cv_prog_cxx_openmp" != "xunsupported"; then
CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS"
AC_DEFINE([HAVE_OPENMP], [1] , [Define to 1 if you have OpenMP] )
else
AC_MSG_NOTICE([We don't have OpenMP. Multithreaded operation is disabled])
fi
fi
AC_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_SIZE_T
AC_CHECK_HEADERS([unistd.h])
# Checks for library functions.
AC_FUNC_FORK
AC_CHECK_FUNCS([strerror])
AX_PTHREAD([],[AC_MSG_ERROR([We need pthread support!])])
if test x"$acx_pthread_ok" = xyes; then
LIBS="$PTHREAD_LIBS $LIBS" \
CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
fi
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] )
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([XML2], [libxml-2.0 >= 2.6.16] )
CXXFLAGS="$CXXFLAGS $XML2_CFLAGS"
LIBS="$XML2_LIBS $LIBS"
PKG_CHECK_MODULES([ICU], [icu-uc >= 50 icu-io] )
CXXFLAGS="$CXXFLAGS $ICU_CFLAGS"
LIBS="$ICU_LIBS $LIBS"
AX_LIB_READLINE
PKG_CHECK_MODULES([ticcutils], [ticcutils >= 0.30] )
CXXFLAGS="$CXXFLAGS $ticcutils_CFLAGS"
LIBS="$ticcutils_LIBS $LIBS"
PKG_CHECK_MODULES([timbl], [timbl >= 6.8] )
CXXFLAGS="$CXXFLAGS $timbl_CFLAGS"
LIBS="$timbl_LIBS $LIBS"
PKG_CHECK_MODULES([mbt], [mbt >= 3.7] )
CXXFLAGS="$CXXFLAGS $mbt_CFLAGS"
LIBS="$mbt_LIBS $LIBS"
PKG_CHECK_MODULES([folia],[folia >= 2.17])
CXXFLAGS="$CXXFLAGS $folia_CFLAGS"
LIBS="$folia_LIBS $LIBS"
PKG_CHECK_MODULES([ucto], [ucto >= 0.30] )
CXXFLAGS="$CXXFLAGS $ucto_CFLAGS"
LIBS="$ucto_LIBS $LIBS"
UCTO_VERSION=`$PKG_CONFIG --modversion ucto`
UCTO_INT="${UCTO_VERSION//.}" # no dots
UCTO_INT=$((10#$UCTO_INT)) # no leading 0 (that's octal)
AC_DEFINE_UNQUOTED( [UCTO_INT_VERSION],
[${UCTO_INT}],
[The integer representation of the ucto version])
PKG_CHECK_MODULES([frogdata], [frogdata >= 0.21] )
AC_CHECK_PROGS([DOXYGEN], [doxygen])
if test -z "$DOXYGEN"; then
AC_MSG_WARN([Doxygen not found - continue without Doxygen support])
else
AC_CHECK_PROGS([DOT], [dot])
if test -z "$DOT"; then
AC_MSG_ERROR([Doxygen needs dot, please install dot first])
fi
fi
AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"])
AC_CONFIG_FILES([
Makefile
frog.pc
m4/Makefile
docs/Makefile
tests/Makefile
src/Makefile
include/Makefile
include/frog/Makefile
])
AC_OUTPUT