2
dnl Copyright 1999-2004 The Apache Software Foundation
4
dnl Licensed under the Apache License, Version 2.0 (the "License");
5
dnl you may not use this file except in compliance with the License.
6
dnl You may obtain a copy of the License at
8
dnl http://www.apache.org/licenses/LICENSE-2.0
10
dnl Unless required by applicable law or agreed to in writing, software
11
dnl distributed under the License is distributed on an "AS IS" BASIS,
12
dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
dnl See the License for the specific language governing permissions and
14
dnl limitations under the License.
17
dnl --------------------------------------------------------------------------
18
dnl Author Henri Gomez <hgomez@apache.org>
20
dnl Inspired by Pier works on webapp m4 macros :)
22
dnl Version $Id: jk_apr.m4,v 1.13 2004/02/24 08:41:40 hgomez Exp $
23
dnl --------------------------------------------------------------------------
25
dnl --------------------------------------------------------------------------
27
dnl Configure APR threading for use with --with-apr.
28
dnl Result goes into APR_CONFIGURE_ARGS
29
dnl --------------------------------------------------------------------------
35
[ --enable-apr-threads Configure APR threading for use with --with-apr ],
37
case "${enableval}" in
38
""|"yes"|"YES"|"true"|"TRUE")
39
APR_CONFIGURE_ARGS="--enable-threads ${APR_CONFIGURE_ARGS}"
41
"no"|"NO"|"false"|"FALSE")
42
APR_CONFIGURE_ARGS="--disable-threads ${APR_CONFIGURE_ARGS}"
45
APR_CONFIGURE_ARGS="--enable-threads=${enableval} ${APR_CONFIGURE_ARGS}"
50
dnl --------------------------------------------------------------------------
52
dnl Set the APR source dir.
53
dnl $1 => File which should be present
54
dnl --------------------------------------------------------------------------
61
[ --with-apr=DIR Location of APR source dir ],
64
""|"yes"|"YES"|"true"|"TRUE")
65
AC_MSG_ERROR(valid apr source dir location required)
67
"no"|"NO"|"false"|"FALSE")
68
AC_MSG_ERROR(valid apr source dir location required)
73
if ${TEST} ! -d ${tempval} ; then
74
AC_MSG_ERROR(Not a directory: ${tempval})
77
if ${TEST} ! -f ${tempval}/$1; then
78
AC_MSG_ERROR(can't locate ${tempval}/$1)
81
if ${TEST} ! -z "$tempval" ; then
83
APR_CFLAGS="-I ${tempval}/include"
86
APR_INCDIR="${tempval}/include"
87
AC_MSG_RESULT(configuring apr...)
91
[${SHELL} ./configure --prefix=${APR_DIR} --with-installbuilddir=${APR_DIR}/instbuild --disable-shared ${APR_CONFIGURE_ARGS}],
94
if ${TEST} "${tempret}" = "0"; then
95
AC_MSG_RESULT(apr configure ok)
97
AC_MSG_ERROR(apr configure failed with ${tempret})
99
JK_APR_LIBNAME(apr_libname,${APR_DIR})
100
APR_LDFLAGS="${APR_DIR}/lib/${apr_libname}"
103
COMMON_APR_OBJECTS="\${COMMON_APR_OBJECTS}"
114
dnl --------------------------------------------------------------------------
116
dnl Set the APR-UTIL source dir.
117
dnl $1 => File which should be present
118
dnl --------------------------------------------------------------------------
125
[ --with-apr-util=DIR Location of APR-UTIL source dir ],
128
""|"yes"|"YES"|"true"|"TRUE")
129
AC_MSG_ERROR(valid apr-util source dir location required)
131
"no"|"NO"|"false"|"FALSE")
132
AC_MSG_ERROR(valid apr-util source dir location required)
137
if ${TEST} ! -d ${tempval} ; then
138
AC_MSG_ERROR(Not a directory: ${tempval})
141
if ${TEST} ! -f ${tempval}/$1; then
142
AC_MSG_ERROR(can't locate ${tempval}/$1)
145
if ${TEST} -z "${APR_BUILD}"; then
146
AC_MSG_ERROR([--with-apr and --with-apr-util must be used together])
149
if ${TEST} ! -z "$tempval" ; then
150
APR_UTIL_DIR=${tempval}
151
APR_CFLAGS="${APR_CFLAGS} -I ${APR_UTIL_DIR}/include"
152
APR_UTIL_INCDIR="${APR_UTIL_DIR}/include"
153
AC_MSG_RESULT(configuring apr-util...)
157
[${SHELL} ./configure --prefix=${APR_UTIL_DIR} --with-apr=${APR_DIR}],
160
if ${TEST} "${tempret}" = "0"; then
161
AC_MSG_RESULT(apr-util configure ok)
163
AC_MSG_ERROR(apr-util configure failed with ${tempret})
165
JK_APR_UTIL_LIBNAME(apr_util_libname,${APR_UTIL_DIR})
166
APR_LDFLAGS="${APR_LDFLAGS} ${APR_UTIL_DIR}/lib/${apr_util_libname}"
169
COMMON_APR_OBJECTS="\${COMMON_APR_OBJECTS}"
177
unset apr_util_libname
181
dnl --------------------------------------------------------------------------
183
dnl Set the APR include dir.
184
dnl $1 => File which should be present
185
dnl --------------------------------------------------------------------------
192
[ --with-apr-include=DIR Location of APR include dir ],
195
""|"yes"|"YES"|"true"|"TRUE")
197
"no"|"NO"|"false"|"FALSE")
198
AC_MSG_ERROR(valid apr include dir location required)
202
if ${TEST} ! -d ${tempval} ; then
203
AC_MSG_ERROR(Not a directory: ${tempval})
206
if ${TEST} ! -f ${tempval}/$1; then
207
AC_MSG_ERROR(can't locate ${tempval}/$1)
210
if ${TEST} ! -z "$tempval" ; then
212
APR_CFLAGS="-I${tempval}"
215
APR_INCDIR=${tempval}
216
COMMON_APR_OBJECTS="\${COMMON_APR_OBJECTS}"
228
dnl --------------------------------------------------------------------------
230
dnl Set the APR library dir.
231
dnl --------------------------------------------------------------------------
238
[ --with-apr-lib=DIR Location of APR lib dir ],
241
""|"yes"|"YES"|"true"|"TRUE")
243
"no"|"NO"|"false"|"FALSE")
244
AC_MSG_ERROR(valid apr lib dir location required)
249
if ${TEST} ! -d ${tempval} ; then
250
AC_MSG_ERROR(Not a directory: ${tempval})
253
if ${TEST} ! -z "$tempval" ; then
257
APR_LIBDIR=${tempval}
258
APR_LDFLAGS="`apr-config --link-ld` -L${tempval}"
259
COMMON_APR_OBJECTS="\${COMMON_APR_OBJECTS}"
271
dnl --------------------------------------------------------------------------
273
dnl Retrieve the complete name of the library.
274
dnl $1 => Environment variable name for the returned value
275
dnl $2 => APR sources directory
276
dnl --------------------------------------------------------------------------
280
AC_MSG_CHECKING([for apr APR_LIBNAME])
281
if ${TEST} ! -f "$2/apr-config" ; then
282
AC_MSG_ERROR([cannot find apr-config file in $2])
284
jk_apr_get_tempval=`$2/apr-config --link-libtool 2> /dev/null`
285
if ${TEST} -z "${jk_apr_get_tempval}" ; then
286
AC_MSG_ERROR([$2/apr-config --link-libtool failed])
288
jk_apr_get_tempval=`basename ${jk_apr_get_tempval}`
289
$1="${jk_apr_get_tempval}"
290
AC_MSG_RESULT([${jk_apr_get_tempval}])
291
unset jk_apr_get_tempval
295
dnl --------------------------------------------------------------------------
296
dnl JK_APR_UTIL_LIBNAME
297
dnl Retrieve the complete name of the library.
298
dnl $1 => Environment variable name for the returned value
299
dnl $2 => APR_UTIL sources directory
300
dnl --------------------------------------------------------------------------
302
[JK_APR_UTIL_LIBNAME],
304
AC_MSG_CHECKING([for apr-util APR_UTIL_LIBNAME])
305
if ${TEST} ! -f "$2/apu-config" ; then
306
AC_MSG_ERROR([cannot find apu-config file in $2])
308
jk_apu_get_tempval=`$2/apu-config --link-libtool 2> /dev/null`
309
if ${TEST} -z "${jk_apu_get_tempval}" ; then
310
AC_MSG_ERROR([$2/apu-config --link-libtool failed])
312
jk_apu_get_tempval=`basename ${jk_apu_get_tempval}`
313
$1="${jk_apu_get_tempval}"
314
AC_MSG_RESULT([${jk_apu_get_tempval}])
315
unset jk_apu_get_tempval
318
dnl vi:set sts=2 sw=2 autoindent: