bottleneck testcase based on rubbos
[bottlenecks.git] / rubbos / app / tomcat-connectors-1.2.32-src / support / jk_apache_static.m4
1 dnl
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
8 dnl
9 dnl     http://www.apache.org/licenses/LICENSE-2.0
10 dnl
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.
16 dnl
17
18 dnl --------------------------------------------------------------------------
19 dnl Author Henri Gomez <hgomez@apache.org>
20 dnl
21 dnl Inspired by Pier works on webapp m4 macros :)
22 dnl 
23 dnl Version $Id: jk_apache_static.m4 466585 2006-10-21 22:16:34Z markt $
24 dnl --------------------------------------------------------------------------
25
26 dnl Apache-2.0 needs the os subdirectory to include os.h
27 dnl this include is copy from os/config.m4
28 sinclude(os_apache.m4)
29
30 dnl --------------------------------------------------------------------------
31 dnl JK_APACHE_STATIC
32 dnl   Set the APACHE 1.3/2.0 source dir.
33 dnl   $1 => apache source dir to detect ("", 2)
34 dnl   $2 => apache 1.3 build dir 
35 dnl   $3 => apache 2.0 build dir
36 dnl
37 dnl --------------------------------------------------------------------------
38 AC_DEFUN(
39   [JK_APACHE_STATIC],
40   [
41     tempval=""
42
43     AC_ARG_WITH(
44       [apache$1],
45       [  --with-apache$1=DIR  Location of Apache$2 source dir],
46       [
47         if ${TEST} ${use_apxs$1} ; then
48           AC_MSG_ERROR([Sorry cannot use --with-apxs= and --with-apache= together, please choose one])
49         fi
50
51         AC_MSG_CHECKING([for Apache source directory (assume static build)])
52         
53         if ${TEST} -n "${withval}" && ${TEST} -d "${withval}" ; then
54
55           if ${TEST} -d "${withval}/src" ; then
56             # handle the case where people use relative paths to 
57             # the apache source directory by pre-pending the current
58             # build directory to the path. there are probably 
59             # errors with this if configure is run while in a 
60             # different directory than what you are in at the time
61             if ${TEST} -n "`${ECHO} ${withval}|${GREP} \"^\.\.\"`" ; then
62               withval=`pwd`/${withval}
63             fi
64
65             APACHE$1_DIR=${withval}
66             use_static="true"
67             AC_MSG_RESULT(${APACHE$1_DIR})
68         
69             AC_MSG_CHECKING(for Apache include directory)
70
71             if ${TEST} -d "${withval}/src/include" ; then
72               # read osdir from the existing apache.
73               osdir=`${GREP} '^OSDIR=' ${withval}/src/Makefile.config | ${SED} -e 's:^OSDIR=.*/os:os:'`
74
75               if ${TEST} -z "${osdir}" ; then
76                 osdir=os/unix
77               fi
78
79               APACHE$1_DIR=${withval}
80               APACHE$1_HOME=${withval}
81               APACHE$1_INCL="-I${withval}/src/include -I${withval}/src/${osdir}"
82               EXTRA_CFLAGS=""
83               EXTRA_CPPFLAGS=""
84               REPORTED_SERVER="apache-1.3"
85               SERVER_DIR="$3"
86               use_static="true"
87               use_apache13="true"
88               AC_MSG_RESULT([${APACHE$1_INCL}, version 1.3])
89             else
90               AC_MSG_ERROR([Sorry Apache 1.2.x is no longer supported.])
91             fi
92
93           else
94
95             if ${TEST} -d "${withval}/include" ; then
96               # osdir for Apache20.
97               APACHE$1_DIR=${withval}
98               APACHE$1_HOME=${withval}
99               APACHE$1_INCL="-I${withval}/include -I${withval}/srclib/apr/include -I${withval}/os/${OS_APACHE_DIR} -I${withval}/srclib/apr-util/include"
100               EXTRA_CFLAGS=""
101               EXTRA_CPPFLAGS=""
102               REPORTED_SERVER="apache-2.0"
103               SERVER_DIR="$3"
104               use_static="true"
105               use_apache2="true"
106               APACHE$1_INCL="-I${withval}/include -I${withval}/srclib/apr/include -I${withval}/os/${OS_APACHE_DIR} -I${withval}/srclib/apr-util/include"
107               AC_MSG_RESULT(${APACHE$1_DIR})
108
109               
110               JK_CHANNEL_APR_SOCKET="\${JK}jk_channel_apr_socket\${OEXT}"
111               JK_POOL_APR="\${JK}jk_pool_apr\${OEXT}"
112               HAS_APR="-DHAS_APR"
113            fi
114         fi
115     fi
116
117     dnl Make sure we have a result.
118     if ${TEST} -z "$WEBSERVER" ; then
119         AC_MSG_ERROR([Directory $apache_dir is not a valid Apache source distribution])
120     fi
121
122 # VT: Now, which one I'm supposed to use? Let's figure it out later
123
124     configure_apache=true
125     configure_src=true
126     
127     AC_MSG_RESULT([building connector for \"$WEBSERVER\"])
128 ],
129 [
130         AC_MSG_RESULT(no apache$1 dir given)
131 ])
132
133 dnl vi:set sts=2 sw=2 autoindent: