forked from RoboSherlock/uima-uimacpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
347 lines (273 loc) · 9.78 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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
AC_INIT(uimacpp, 2.4.0)
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_SRCDIR(src/framework/engine.cpp)
AM_INIT_AUTOMAKE([foreign])
AC_CONFIG_MACRO_DIR([m4])
AC_DISABLE_STATIC
AC_PREFIX_DEFAULT(/usr/local/uimacpp)
#[LIB_VERSION=`echo $VERSION | sed -e 's/\.//' -e 's/^\([^.]*\)$/\1.0/'`]
#LIB_VERSION_MAJOR=`echo $LIB_VERSION | sed 's/\..*//'`
AC_ARG_ENABLE(debuguima,
[ --enable-debuguima Turn on debugging],
[case "${enableval}" in
yes) debuguima=true ;;
no) debuguima=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-debuguima) ;;
esac],[debuguima=false])
AM_CONDITIONAL([DEBUG_UIMA], [test x$debuguima = xtrue])
AC_ARG_ENABLE(debugtest,
[ --enable-debugtest Turn on debugging],
[case "${enableval}" in
yes) debugtest=true ;;
no) debugtest=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-debugtest) ;;
esac],[debugtest=false])
AM_CONDITIONAL([DEBUG_TEST], [test x$debugtest = xtrue])
LT_VERSION_NUMBER=0:0:0
AC_SUBST(LT_VERSION_NUMBER)
AC_SUBST(VERSION)
AC_MSG_RESULT([release $VERSION, library $LIB_VERSION])
AC_PROG_LIBTOOL
AC_PROG_CXX
AC_C_BIGENDIAN
######################################
# setup for using default dependencies
UIMACPP_HOME_INCLUDE="-I$UIMACPP_HOME/include"
UIMACPP_HOME_LIB="-L$UIMACPP_HOME/lib"
#########################################################################
#
# new check for XercesC
#
AC_MSG_NOTICE([Xerces C++ library configuration])
AX_LIB_XERCES([2.8])
if test $HAVE_XERCES = "no"; then
AC_MSG_WARN([XERCES not found])
echo "The Xerces C++ library cannot be found."
echo "Please install XERCES on this system and supply the appropriate"
echo "--with-xerces option to 'configure'"
AC_MSG_ERROR([no suitable XERCES found])
fi
echo "Found $XERCES_VERSION $XERCES_CPPFLAGS $XERCES_LDFLAGS $XERCES_LIBS"
# Get build information from XERCES
UIMA_XERCES_INCLUDE="$XERCES_CPPFLAGS"
UIMA_XERCES_LIB="$XERCES_LDFLAGS $XERCES_LIBS"
AC_SUBST(UIMA_XERCES_INCLUDE)
AC_SUBST(UIMA_XERCES_LIB)
#########################################################################
#
# check for XercesC
#
CPPFLAGS_save="$CPPFLAGS"
#CPPFLAGS="$CPPFLAGS $XERCES_TEST_INCLUDE"
CPPFLAGS="$CPPFLAGS $UIMA_XERCES_INCLUDE"
AC_CHECK_HEADER([xercesc/util/XercesVersion.hpp],
[:],
[AC_MSG_ERROR([Unable to find Xerces C++ headers])])
CPPFLAGS="$CPPFLAGS_save"
#########################################################################
#
# new check for APR
#
AC_MSG_NOTICE([Apache Portable Runtime (APR) library configuration])
APR_FIND_APR([], [], 1, [1])
if test $apr_found = "no"; then
AC_MSG_WARN([APR not found])
echo "The Apache Portable Runtime (APR) library cannot be found."
echo "Please install APR on this system and supply the appropriate"
echo "--with-apr option to 'configure'"
AC_MSG_ERROR([no suitable APR found])
fi
# check APR version number agains regex
APR_VER_REGEXES=["1\.3\.[0-9] 1\.3\.1[0-9] 1\.4\.[0-9] 1\.5\.[0-9]"]
AC_MSG_CHECKING([APR version])
apr_version="`$apr_config --version`"
if test $? -ne 0; then
AC_MSG_ERROR([apr-config --version failed])
fi
AC_MSG_RESULT([$apr_version])
APR_WANTED_REGEX_MATCH=0
for apr_wanted_regex in $APR_VER_REGEXES; do
if test `expr $apr_version : $apr_wanted_regex` -ne 0; then
APR_WANTED_REGEX_MATCH=1
break
fi
done
if test $APR_WANTED_REGEX_MATCH -eq 0; then
echo "wanted regexes are $APR_VER_REGEXES"
AC_MSG_ERROR([invalid apr version found, check the README for supported versions.])
fi
# Get build information from APR
APR_CPPFLAGS="`$apr_config --cppflags`"
if test $? -ne 0; then
AC_MSG_ERROR([apr-config --cppflags failed])
fi
APR_INCLUDES="`$apr_config --includes`"
if test $? -ne 0; then
AC_MSG_ERROR([apr-config --includes failed])
fi
APR_LDFLAGS="`$apr_config --ldflags`"
if test $? -ne 0; then
AC_MSG_ERROR([apr-config --ldflags failed])
fi
APR_LIBS="`$apr_config --link-libtool --libs`"
if test $? -ne 0; then
AC_MSG_ERROR([apr-config --link-libtool --libs failed])
fi
UIMA_APR_INCLUDE="$APR_CPPFLAGS $APR_INCLUDES"
UIMA_APR_LIB="$APR_LDFLAGS $APR_LIBS"
#AC_SUBST([APR_LIBS])
#AC_SUBST([APR_LDFLAGS])
#AC_SUBST([APR_CPPFLAGS])
#AC_SUBST([APR_INCLUDES])
AC_SUBST(UIMA_APR_INCLUDE)
AC_SUBST(UIMA_APR_LIB)
#########################################################################
#
# check for APR
#
CPPFLAGS_save="$CPPFLAGS"
#CPPFLAGS="$CPPFLAGS $APR_TEST_INCLUDE -D_GNU_SOURCE"
CPPFLAGS="$CPPFLAGS $UIMA_APR_INCLUDE -D_GNU_SOURCE"
AC_CHECK_HEADER([apr.h],
[:],
[AC_MSG_ERROR([Unable to find APR Headers])])
CPPFLAGS="$CPPFLAGS_save"
#########################################################################
#
# check for ICU
#
AC_MSG_NOTICE([ICU C++ library configuration])
ICU_FIND_ICU([3.2])
if test $icu_found = "no"; then
AC_MSG_WARN([ICU not found])
echo "The ICU C++ library cannot be found."
echo "Please install ICU on this system and supply the appropriate"
echo "--with-icu option to 'configure'"
AC_MSG_ERROR([no suitable ICU found])
fi
# Get build information from XERCES
UIMA_ICU_INCLUDE="$ICU_CPPFLAGS"
UIMA_ICU_LIB="$ICU_LDFLAGS $XERCES_LIBS"
AC_SUBST(UIMA_ICU_INCLUDE)
AC_SUBST(UIMA_ICU_LIB)
#########################################################################
#
# check for ICU
#
CPPFLAGS_save="$CPPFLAGS"
#CPPFLAGS="$CPPFLAGS $ICU_TEST_INCLUDE"
CPPFLAGS="$CPPFLAGS $UIMA_ICU_INCLUDE"
AC_CHECK_HEADER([unicode/uversion.h],
[:],
[AC_MSG_ERROR([Unable to find ICU Headers])])
CPPFLAGS="$CPPFLAGS_save"
########################################################################
# check for ActiveMQ new
#
activemq=true
AC_ARG_WITH([activemq],
[AS_HELP_STRING([--without-activemq],
[disable support for ActiveMQ service wrapper])],
[],
[with_activemq=check])
if test "x$with_activemq" = xno; then
activemq=false
echo "disabling service wrapper"
else
AC_MSG_NOTICE([ActiveMQ C++ library configuration])
AMQ_FIND_AMQ([3.2])
if test $amq_found = "no"; then
AC_MSG_WARN([ACTIVEMQ not found])
echo "The ACTIVEMQ C++ library cannot be found."
echo "Please install ACTIVEMQ 3.2 or higher on this system and supply the appropriate"
echo "--with-activemq option to 'configure'"
AC_MSG_ERROR([no suitable ACTIVEMQ found])
fi
# Get build information from ACTIVEMQ
UIMA_ACTIVEMQ_INCLUDE="$ACTIVEMQ_CXXFLAGS"
UIMA_ACTIVEMQ_LIB="$ACTIVEMQ_LDFLAGS"
AC_SUBST(UIMA_ACTIVEMQ_INCLUDE)
AC_SUBST(UIMA_ACTIVEMQ_LIB)
CPPFLAGS_save="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $UIMA_ACTIVEMQ_INCLUDE"
activemq=true
AC_CHECK_HEADER([activemq/exceptions/ExceptionDefines.h],
[:],
[activemq=false])
CPPFLAGS="$CPPFLAGS_save"
if test "x$activemq" = "xfalse"; then
AC_MSG_ERROR([ActiveMQ Headers not found. Specify valid path to ActiveMQ.])
fi
AC_MSG_NOTICE([Apache Portable Runtime (APR Util ) library configuration])
APR_FIND_APU([], [], 1, [1])
if test $apu_found = "no"; then
AC_MSG_WARN([APR-Util not found])
echo "APR-Util is required if building with ActiveMQ."
echo "Please install APR-Util on this system and supply the appropriate"
echo "--with-apr-util option to 'configure'"
AC_MSG_ERROR([no suitable APR-Util found. Required to build with ActiveMQ. Rerun configure with the option --with-apr-util=PATH ])
fi
fi
#########################################################################
#
# check for ACTIVEMQ
#
#CPPFLAGS_save="$CPPFLAGS"
##CPPFLAGS="$CPPFLAGS $ACTIVEMQ_TEST_INCLUDE"
#CPPFLAGS="$CPPFLAGS $UIMA_ACTIVEMQ_INCLUDE"
#activemq=true
#AC_CHECK_HEADER([activemq/exceptions/ExceptionDefines.h],
# [:],
# [activemq=false])
#CPPFLAGS="$CPPFLAGS_save"
AM_CONDITIONAL([ACTIVEMQ_FOUND], [test x$activemq = xtrue])
if test "x$activemq" = "xfalse"; then
AC_MSG_RESULT(***ACTIVEMQ dependency not found)
AC_MSG_RESULT(***Not building deployCppService)
AC_MSG_RESULT(***To try again ... touch configure before running make)
fi
####################################
#Substitute default paths, if needed
AC_SUBST(UIMACPP_HOME_INCLUDE)
AC_SUBST(UIMACPP_HOME_LIB)
#########################################################################
#
# check for Java JDK
#
AC_ARG_WITH([jdk], AC_HELP_STRING([--with-jdk],
[use local JDK (uses /opt/IBMJava2-142/include by default)]),
[UIMA_JDK_INCLUDE="-I$withval"
JDK_TEST_INCLUDE="$UIMA_JDK_INCLUDE"],
[UIMA_JDK_INCLUDE="-I/opt/IBMJava2-142/include"
JDK_TEST_INCLUDE="-I/opt/IBMJava2-142/include"])
CPPFLAGS_save="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $JDK_TEST_INCLUDE"
AC_CHECK_HEADER([jni.h],
[:],
[AC_MSG_ERROR([Unable to find JDK Headers])])
CPPFLAGS="$CPPFLAGS_save"
AC_SUBST(UIMA_JDK_INCLUDE)
#########################################################################
#
# setup for link with UIMA lib
#
UIMA_LIB="-L\$(top_srcdir)/src/framework -luima"
AC_SUBST(UIMA_LIB)
AM_CONDITIONAL(APPLE, test x$build_vendor = xapple)
AC_OUTPUT(Makefile src/Makefile src/framework/Makefile src/utils/Makefile src/test/Makefile)