bottleneck testcase based on rubbos
[bottlenecks.git] / rubbos / app / tomcat-connectors-1.2.32-src / support / jk_tchome.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_tchome.m4 466585 2006-10-21 22:16:34Z markt $
24 dnl --------------------------------------------------------------------------
25
26 dnl --------------------------------------------------------------------------
27 dnl JK_TCHOME
28 dnl   Set the Tomcat Home directory.
29 dnl   $1 => Tomcat Name
30 dnl   $2 => Tomcat VarName
31 dnl   $3 => File which should be present
32 dnl --------------------------------------------------------------------------
33 AC_DEFUN(
34   [JK_TCHOME],
35   [
36     tempval=""
37
38     AC_MSG_CHECKING([for $1 location])
39     AC_ARG_WITH(
40       [$1],
41       [  --with-$1=DIR      Location of $1 ],
42       [ 
43         case "${withval}" in
44         ""|"yes"|"YES"|"true"|"TRUE")
45           ;;
46         "no"|"NO"|"false"|"FALSE")
47           AC_MSG_ERROR(valid $1 location required)
48           ;;
49         *)
50           tempval="${withval}"
51
52           if ${TEST} ! -d ${tempval} ; then
53             AC_MSG_ERROR(Not a directory: ${tempval})
54           fi
55
56           if ${TEST} ! -f ${tempval}/$3; then
57             AC_MSG_ERROR(can't locate ${tempval}/$3)
58           fi
59           ;;
60         esac
61       ])  
62
63       if ${TEST} -z "$tempval" ; then
64         AC_MSG_RESULT(not provided)
65       else
66         [$2]=${tempval}
67         AC_MSG_RESULT(${[$2]})
68       fi
69
70       unset tempval
71   ])
72
73 dnl vi:set sts=2 sw=2 autoindent: