~ubuntu-branches/ubuntu/oneiric/libapache-mod-jk/oneiric

« back to all changes in this revision

Viewing changes to jk/support/jk_ws.m4

  • Committer: Bazaar Package Importer
  • Author(s): Steve Kowalik
  • Date: 2006-08-05 16:30:53 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060805163053-myf66gm6j1a21ps6
Tags: 1:1.2.18-1ubuntu1
Merge from Debian unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dnl
2
 
dnl Copyright 1999-2004 The Apache Software Foundation
3
 
dnl
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
7
 
dnl
8
 
dnl     http://www.apache.org/licenses/LICENSE-2.0
9
 
dnl
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.
15
 
dnl
16
 
 
17
 
dnl --------------------------------------------------------------------------
18
 
dnl Author Henri Gomez <hgomez@apache.org>
19
 
dnl
20
 
dnl Inspired by Pier works on webapp m4 macros :)
21
 
dnl 
22
 
dnl Version $Id: jk_ws.m4,v 1.9 2004/02/24 13:17:07 truk Exp $
23
 
dnl --------------------------------------------------------------------------
24
 
 
25
 
dnl --------------------------------------------------------------------------
26
 
dnl JK_WS_DIR
27
 
dnl   Set the WebServer source dir.
28
 
dnl   $1 => Webserver name
29
 
dnl   $2 => Webserver vars prefix name
30
 
dnl   $3 => File which should be present
31
 
dnl   $4 => Server specific source directory 
32
 
dnl --------------------------------------------------------------------------
33
 
AC_DEFUN(
34
 
  [JK_WS_DIR],
35
 
  [
36
 
    tempval=""
37
 
    AC_ARG_WITH(
38
 
      [$1],
39
 
      [  --with-$1=DIR           Location of $1 source dir ],
40
 
      [
41
 
        case "${withval}" in
42
 
          ""|"yes"|"YES"|"true"|"TRUE")
43
 
          AC_MSG_ERROR(valid $1 source dir location required)
44
 
          ;;
45
 
          "no"|"NO"|"false"|"FALSE")
46
 
          AC_MSG_ERROR(Don't use with/without $1 if you don't have $1)
47
 
          ;;
48
 
          *)
49
 
          tempval="${withval}"
50
 
 
51
 
          if ${TEST} ! -d ${tempval} ; then
52
 
            AC_MSG_ERROR(Not a directory: ${tempval})
53
 
          fi
54
 
 
55
 
          if ${TEST} ! -f ${tempval}/$3; then
56
 
            AC_MSG_ERROR(can't locate ${tempval}/$3)
57
 
          fi
58
 
 
59
 
          if ${TEST} ! -z "$tempval" ; then
60
 
            $2_BUILD="true"
61
 
            $2_CFLAGS="-I ${tempval}/include"
62
 
            $2_DIR=${tempval}
63
 
            $2_HOME="${tempval}"
64
 
            $2_LIBDIR=""
65
 
            if ${TEST} -d ${withval}/include ; then
66
 
              $2_INCL="-I${tempval}/include"
67
 
              $2_INCDIR="${tempval}/include"
68
 
            fi
69
 
            if ${TEST} -d ${withval}/src/include ; then
70
 
              # read osdir from the existing apache.
71
 
              osdir=`${GREP} '^OSDIR=' ${withval}/src/Makefile.config | ${SED} -e 's:^OSDIR=.*/os:os:'`
72
 
              if ${TEST} -z "${osdir}" ; then
73
 
                osdir=os/unix
74
 
              fi
75
 
              $2_INCL="-I${tempval}/src/include -I${withval}/src/${osdir}"
76
 
              $2_INCDIR="${tempval}/src/include"
77
 
            fi
78
 
            if ${TEST} -d ${tempval}/srclib/apr ; then
79
 
              # Apache 2 contains apr.
80
 
              if ${TEST} ! -f ${tempval}/srclib/apr/config.status ; then
81
 
                AC_MSG_ERROR(configure Apache2 before mod_jk2)
82
 
              fi
83
 
              osdir=`${GREP} @OSDIR@ ${tempval}/srclib/apr/config.status | sed 's:s,@OSDIR@,::' | sed 's:,;t t::'`
84
 
              $2_INCL="-I${tempval}/include -I${withval}/os/${osdir}"
85
 
              $2_LIBEXEC=`${GREP} "^exp_libexecdir =" ${tempval}/build/config_vars.mk | sed 's:exp_libexecdir = ::'`
86
 
              LIBTOOL=${tempval}/srclib/apr/libtool
87
 
              APR_INCDIR=-I${tempval}/srclib/apr/include
88
 
              APR_CFLAGS=`${tempval}/srclib/apr/apr-config --cflags`
89
 
              APR_UTIL_INCDIR=-I${tempval}/srclib/apr-util/include
90
 
              APR_LIBDIR_LA=`${tempval}/srclib/apr/apr-config --apr-la-file`
91
 
              $2_LIBDIR=${tempval}/lib
92
 
 
93
 
              AC_SUBST(APR_INCDIR)
94
 
              AC_SUBST(APR_CFLAGS)
95
 
              AC_SUBST(APR_INCDIR)
96
 
              AC_SUBST(APR_UTIL_INCDIR)
97
 
            fi
98
 
            $2_LDFLAGS=""
99
 
            WEBSERVERS="${WEBSERVERS} $4"
100
 
 
101
 
            AC_SUBST($2_BUILD)
102
 
            AC_SUBST($2_CFLAGS)
103
 
            AC_SUBST($2_DIR)
104
 
            AC_SUBST($2_HOME)
105
 
            AC_SUBST($2_INCL)
106
 
            AC_SUBST($2_INCDIR)
107
 
            AC_SUBST($2_LDFLAGS)
108
 
            AC_SUBST($2_LIBDIR)
109
 
 
110
 
          fi
111
 
          ;;
112
 
        esac
113
 
      ])
114
 
 
115
 
      if ${TEST} -z "$tempval" ; then
116
 
        AC_MSG_RESULT(not provided)
117
 
      else      
118
 
        AC_MSG_RESULT(${tempval})
119
 
      fi
120
 
 
121
 
      unset tempval
122
 
  ])
123
 
 
124
 
 
125
 
dnl --------------------------------------------------------------------------
126
 
dnl JK_WS_INCDIR
127
 
dnl   Set the WebServer include dir.
128
 
dnl   $1 => Webserver name
129
 
dnl   $2 => Webserver vars prefix name
130
 
dnl   $3 => File which should be present
131
 
dnl --------------------------------------------------------------------------
132
 
AC_DEFUN(
133
 
  [JK_WS_INCDIR],
134
 
  [
135
 
    tempval=""
136
 
    AC_ARG_WITH(
137
 
      [$1-include],
138
 
      [  --with-$1-include=DIR   Location of $1 include dir ],
139
 
      [  
140
 
        case "${withval}" in
141
 
          ""|"yes"|"YES"|"true"|"TRUE")
142
 
          ;;
143
 
          "no"|"NO"|"false"|"FALSE")
144
 
          AC_MSG_ERROR(valid $1 include dir location required)
145
 
          ;;
146
 
          *)
147
 
          tempval="${withval}"
148
 
          if ${TEST} ! -d ${tempval} ; then
149
 
            AC_MSG_ERROR(Not a directory: ${tempval})
150
 
          fi
151
 
 
152
 
          if ${TEST} ! -f ${tempval}/$3; then
153
 
            AC_MSG_ERROR(can't locate ${tempval}/$3)
154
 
          fi
155
 
 
156
 
          if ${TEST} ! -z "$tempval" ; then
157
 
            $2_BUILD=""
158
 
            $2_CFLAGS="-I${tempval}"
159
 
            $2_CLEAN=""
160
 
            $2_DIR=""
161
 
            $2_INCDIR=${tempval}
162
 
            AC_MSG_RESULT($2_INCDIR)
163
 
            
164
 
            AC_SUBST($2_BUILD)
165
 
            AC_SUBST($2_CFLAGS)
166
 
            AC_SUBST($2_CLEAN)
167
 
            AC_SUBST($2_DIR)
168
 
            AC_SUBST($2_INCDIR)
169
 
          fi
170
 
          ;;
171
 
        esac
172
 
      ])
173
 
 
174
 
      unset tempval
175
 
  ])
176
 
 
177
 
 
178
 
dnl --------------------------------------------------------------------------
179
 
dnl JK_WS_LIBDIR
180
 
dnl   Set the WebServer library dir.
181
 
dnl   $1 => Webserver name
182
 
dnl   $2 => Webserver vars prefix name
183
 
dnl --------------------------------------------------------------------------
184
 
AC_DEFUN(
185
 
  [JK_WS_LIBDIR],
186
 
  [
187
 
    tempval=""
188
 
    AC_ARG_WITH(
189
 
      [$1-lib],
190
 
      [  --with-$1-lib=DIR       Location of $1 lib dir ],
191
 
      [
192
 
        case "${withval}" in
193
 
          ""|"yes"|"YES"|"true"|"TRUE")
194
 
          ;;
195
 
          "no"|"NO"|"false"|"FALSE")
196
 
          AC_MSG_ERROR(valid $1 lib directory location required)
197
 
          ;;
198
 
        *)
199
 
          tempval="${withval}"
200
 
 
201
 
          if ${TEST} ! -d ${tempval} ; then
202
 
            AC_MSG_ERROR(Not a directory: ${tempval})
203
 
          fi
204
 
 
205
 
          if ${TEST} ! -z "$tempval" ; then
206
 
            $2_BUILD=""
207
 
            $2_CLEAN=""
208
 
            $2_DIR=""
209
 
            $2_LIBDIR=${tempval}
210
 
            $2_LDFLAGS=""
211
 
            AC_MSG_RESULT($2_LIBDIR)
212
 
 
213
 
            AC_SUBST($2_BUILD)
214
 
            AC_SUBST($2_CLEAN)
215
 
            AC_SUBST($2_DIR)
216
 
            AC_SUBST($2_LIBDIR)
217
 
            AC_SUBST($2_LDFLAGS)
218
 
          fi
219
 
 
220
 
          ;;
221
 
          esac
222
 
      ])
223
 
 
224
 
      unset tempval
225
 
  ])
226
 
 
227
 
dnl vi:set sts=2 sw=2 autoindent:
228