2 dnl Licensed to the Apache Software Foundation (ASF) under one or more
3 dnl contributor license agreements. See the NOTICE file distributed with
4 dnl this work for additional information regarding copyright ownership.
5 dnl The ASF licenses this file to You under the Apache License, Version 2.0
6 dnl (the "License"); you may not use this file except in compliance with
7 dnl the License. You may obtain a copy of the License at
9 dnl http://www.apache.org/licenses/LICENSE-2.0
11 dnl Unless required by applicable law or agreed to in writing, software
12 dnl distributed under the License is distributed on an "AS IS" BASIS,
13 dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 dnl See the License for the specific language governing permissions and
15 dnl limitations under the License.
18 dnl --------------------------------------------------------------------------
19 dnl Author Henri Gomez <hgomez@apache.org>
21 dnl Inspired by Pier works on webapp m4 macros :)
23 dnl Version $Id: jk_ws.m4 466585 2006-10-21 22:16:34Z markt $
24 dnl --------------------------------------------------------------------------
26 dnl --------------------------------------------------------------------------
28 dnl Set the WebServer source dir.
29 dnl $1 => Webserver name
30 dnl $2 => Webserver vars prefix name
31 dnl $3 => File which should be present
32 dnl $4 => Server specific source directory
33 dnl --------------------------------------------------------------------------
40 [ --with-$1=DIR Location of $1 source dir ],
43 ""|"yes"|"YES"|"true"|"TRUE")
44 AC_MSG_ERROR(valid $1 source dir location required)
46 "no"|"NO"|"false"|"FALSE")
47 AC_MSG_ERROR(Don't use with/without $1 if you don't have $1)
52 if ${TEST} ! -d ${tempval} ; then
53 AC_MSG_ERROR(Not a directory: ${tempval})
56 if ${TEST} ! -f ${tempval}/$3; then
57 AC_MSG_ERROR(can't locate ${tempval}/$3)
60 if ${TEST} ! -z "$tempval" ; then
62 $2_CFLAGS="-I ${tempval}/include"
66 if ${TEST} -d ${withval}/include ; then
67 $2_INCL="-I${tempval}/include"
68 $2_INCDIR="${tempval}/include"
70 if ${TEST} -d ${withval}/src/include ; then
71 # read osdir from the existing apache.
72 osdir=`${GREP} '^OSDIR=' ${withval}/src/Makefile.config | ${SED} -e 's:^OSDIR=.*/os:os:'`
73 if ${TEST} -z "${osdir}" ; then
76 $2_INCL="-I${tempval}/src/include -I${withval}/src/${osdir}"
77 $2_INCDIR="${tempval}/src/include"
79 if ${TEST} -d ${tempval}/srclib/apr ; then
80 # Apache 2 contains apr.
81 if ${TEST} ! -f ${tempval}/srclib/apr/config.status ; then
82 AC_MSG_ERROR(configure Apache2 before mod_jk2)
84 osdir=`${GREP} @OSDIR@ ${tempval}/srclib/apr/config.status | sed 's:s,@OSDIR@,::' | sed 's:,;t t::'`
85 $2_INCL="-I${tempval}/include -I${withval}/os/${osdir}"
86 $2_LIBEXEC=`${GREP} "^exp_libexecdir =" ${tempval}/build/config_vars.mk | sed 's:exp_libexecdir = ::'`
87 LIBTOOL=${tempval}/srclib/apr/libtool
88 APR_INCDIR=-I${tempval}/srclib/apr/include
89 APR_CFLAGS=`${tempval}/srclib/apr/apr-config --cflags`
90 APR_UTIL_INCDIR=-I${tempval}/srclib/apr-util/include
91 APR_LIBDIR_LA=`${tempval}/srclib/apr/apr-config --apr-la-file`
92 $2_LIBDIR=${tempval}/lib
97 AC_SUBST(APR_UTIL_INCDIR)
100 WEBSERVERS="${WEBSERVERS} $4"
116 if ${TEST} -z "$tempval" ; then
117 AC_MSG_RESULT(not provided)
119 AC_MSG_RESULT(${tempval})
126 dnl --------------------------------------------------------------------------
128 dnl Set the WebServer include dir.
129 dnl $1 => Webserver name
130 dnl $2 => Webserver vars prefix name
131 dnl $3 => File which should be present
132 dnl --------------------------------------------------------------------------
139 [ --with-$1-include=DIR Location of $1 include dir ],
142 ""|"yes"|"YES"|"true"|"TRUE")
144 "no"|"NO"|"false"|"FALSE")
145 AC_MSG_ERROR(valid $1 include dir location required)
149 if ${TEST} ! -d ${tempval} ; then
150 AC_MSG_ERROR(Not a directory: ${tempval})
153 if ${TEST} ! -f ${tempval}/$3; then
154 AC_MSG_ERROR(can't locate ${tempval}/$3)
157 if ${TEST} ! -z "$tempval" ; then
159 $2_CFLAGS="-I${tempval}"
163 AC_MSG_RESULT($2_INCDIR)
179 dnl --------------------------------------------------------------------------
181 dnl Set the WebServer library dir.
182 dnl $1 => Webserver name
183 dnl $2 => Webserver vars prefix name
184 dnl --------------------------------------------------------------------------
191 [ --with-$1-lib=DIR Location of $1 lib dir ],
194 ""|"yes"|"YES"|"true"|"TRUE")
196 "no"|"NO"|"false"|"FALSE")
197 AC_MSG_ERROR(valid $1 lib directory location required)
202 if ${TEST} ! -d ${tempval} ; then
203 AC_MSG_ERROR(Not a directory: ${tempval})
206 if ${TEST} ! -z "$tempval" ; then
212 AC_MSG_RESULT($2_LIBDIR)
228 dnl vi:set sts=2 sw=2 autoindent: