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_apxs.m4 300131 2005-01-31 08:14:03Z jfclere $
23
dnl --------------------------------------------------------------------------
25
dnl --------------------------------------------------------------------------
28
dnl Get APXS to be used, determine if Apache 1.3 or 2.0 are target
29
dnl $1 => blank/2 if you want to detect Apache 1.3 & 2.0
30
dnl $2 => comment for --with-apxs
31
dnl --------------------------------------------------------------------------
37
[ --with-apxs$1[=FILE] $2],
40
y | yes | true) find_apxs=true ;;
41
n | no | false) find_apxs=false ;;
45
if ${TEST} ${find_apxs} ; then
46
AC_MSG_RESULT([need to check for Perl first, apxs depends on it...])
47
AC_PATH_PROG(PERL,perl,$PATH)dnl
49
if ${TEST} ${find_apxs} ; then
52
AC_PATH_PROG(APXS$1,apxs$1,$PATH)dnl
57
if ${TEST} -n "${APXS$1}" ; then
58
dnl Seems that we have it, but have to check if it is OK first
59
if ${TEST} ! -x "${APXS$1}" ; then
60
AC_MSG_ERROR(Invalid location for apxs: '${APXS$1}')
63
${APXS$1} -q PREFIX >/dev/null 2>/dev/null || apxs_support=false
65
if ${TEST} "${apxs_support}" = "false" ; then
66
AC_MSG_RESULT(could not find ${APXS$1})
67
AC_MSG_ERROR(You must specify a valid --with-apxs$1 path)
70
dnl apache_dir and apache_include are also needed.
71
APACHE$1_HOME=`${APXS$1} -q PREFIX`
72
APACHE$1_INCL="-I`${APXS$1} -q INCLUDEDIR`"
73
APACHE$1_INCDIR="`${APXS$1} -q INCLUDEDIR`"
74
APACHE$1_LIBEXEC="`${APXS$1} -q LIBEXECDIR`"
75
APACHE$1_CC="`${APXS$1} -q CC`"
77
dnl test apache version
78
APA=`${GREP} STANDARD20 ${APXS$1}`
80
dnl check if we have an apxs for Apache 1.3 or 2.0
81
if ${TEST} -z "$APA" ; then
82
if ${TEST} ! -z "$1" ; then
83
AC_MSG_ERROR(Do not use --with-apxs$1 but --with-apxs)
85
WEBSERVERS="${WEBSERVERS} server/apache13"
86
RWEBSERVER="apache-1.3"
87
APXS$1_CFLAGS="`${APXS$1} -q CFLAGS`"
90
if ${TEST} -z "$1" ; then
91
AC_MSG_ERROR(Do not use --with-apxs but --with-apxs2)
93
WEBSERVERS="${WEBSERVERS} server/apache2"
94
RWEBSERVER="apache-2.0"
95
APACHE2_CONFIG_VARS=${apache_dir}/build/config_vars.mk
96
JK_CHANNEL_APR_SOCKET="\${JK}jk_channel_apr_socket\${OEXT}"
97
JK_POOL_APR="\${JK}jk_pool_apr\${OEXT}"
98
APXS$1_CFLAGS="`${APXS$1} -q CFLAGS` `${APXS$1} -q EXTRA_CFLAGS`"
99
APXS$1_CPPFLAGS="`${APXS$1} -q EXTRA_CPPFLAGS`"
100
APR_INCDIR="-I`${APXS$1} -q APR_INCLUDEDIR`"
101
APR_UTIL_INCDIR="-I`${APXS$1} -q APU_INCLUDEDIR`"
102
APACHE2_LIBDIR="`${APXS$1} -q LIBDIR`"
103
LIBTOOL=`${APXS$1} -q LIBTOOL`
104
if ${TEST} -f ${APACHE2_LIBDIR}/libapr-1.so \
105
-o -f ${APACHE2_LIBDIR}/libapr-1.sl \
106
-o -f ${APACHE2_LIBDIR}/libapr-1.dylib; then
107
APR_LIBS="-L${APACHE2_LIBDIR} -lapr-1"
108
elif ${TEST} -f ${APACHE2_LIBDIR}/libapr-0.so \
109
-o -f ${APACHE2_LIBDIR}/libapr-0.sl \
110
-o -f ${APACHE2_LIBDIR}/libapr-0.dylib; then
111
APR_LIBS="-L${APACHE2_LIBDIR} -lapr-0"
112
elif ${TEST} -f ${APACHE2_LIBDIR}/libapr.so \
113
-o -f ${APACHE2_LIBDIR}/libapr.sl \
114
-o -f ${APACHE2_LIBDIR}/libapr.dylib; then
115
APR_LIBS="-L${APACHE2_LIBDIR} -lapr"
117
AC_MSG_ERROR(can't locate libapr)
121
AC_MSG_RESULT([building connector for \"$RWEBSERVER\"])
127
AC_MSG_RESULT(no apxs$1 given)
133
AC_SUBST(APXS$1_CFLAGS)
134
AC_SUBST(APACHE$1_CONFIG_VARS)
135
AC_SUBST(APXS$1_CPPFLAGS)
136
AC_SUBST(APACHE$1_DIR)
137
AC_SUBST(APACHE$1_HOME)
138
AC_SUBST(APACHE$1_INCDIR)
139
AC_SUBST(APACHE$1_INCL)
140
AC_SUBST(APACHE$1_LIBEXEC)
141
AC_SUBST(APACHE$1_LIBDIR)
142
AC_SUBST(APACHE$1_CC)
143
AC_SUBST(APXS$1_LDFLAGS)
148
dnl vi:set sts=2 sw=2 autoindent: