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

« back to all changes in this revision

Viewing changes to jk/support/jk_apr.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_apr.m4,v 1.13 2004/02/24 08:41:40 hgomez Exp $
23
 
dnl --------------------------------------------------------------------------
24
 
 
25
 
dnl --------------------------------------------------------------------------
26
 
dnl JK_APR_THREADS
27
 
dnl   Configure APR threading for use with --with-apr.
28
 
dnl   Result goes into APR_CONFIGURE_ARGS
29
 
dnl --------------------------------------------------------------------------
30
 
AC_DEFUN(
31
 
  [JK_APR_THREADS],
32
 
  [
33
 
    AC_ARG_ENABLE(
34
 
      [apr-threads],
35
 
      [  --enable-apr-threads        Configure APR threading for use with --with-apr ],
36
 
      [
37
 
        case "${enableval}" in
38
 
          ""|"yes"|"YES"|"true"|"TRUE")
39
 
            APR_CONFIGURE_ARGS="--enable-threads ${APR_CONFIGURE_ARGS}"
40
 
          ;;
41
 
          "no"|"NO"|"false"|"FALSE")
42
 
            APR_CONFIGURE_ARGS="--disable-threads ${APR_CONFIGURE_ARGS}"
43
 
          ;;
44
 
        *)
45
 
          APR_CONFIGURE_ARGS="--enable-threads=${enableval} ${APR_CONFIGURE_ARGS}"
46
 
         esac
47
 
      ])
48
 
  ])
49
 
 
50
 
dnl --------------------------------------------------------------------------
51
 
dnl JK_APR
52
 
dnl   Set the APR source dir.
53
 
dnl   $1 => File which should be present
54
 
dnl --------------------------------------------------------------------------
55
 
AC_DEFUN(
56
 
  [JK_APR],
57
 
  [
58
 
    tempval=""
59
 
    AC_ARG_WITH(
60
 
      [apr],
61
 
      [  --with-apr=DIR           Location of APR source dir ],
62
 
      [
63
 
        case "${withval}" in
64
 
          ""|"yes"|"YES"|"true"|"TRUE")
65
 
            AC_MSG_ERROR(valid apr source dir location required)
66
 
          ;;
67
 
          "no"|"NO"|"false"|"FALSE")
68
 
            AC_MSG_ERROR(valid apr source dir location required)
69
 
          ;;
70
 
        *)
71
 
          tempval="${withval}"
72
 
 
73
 
          if ${TEST} ! -d ${tempval} ; then
74
 
            AC_MSG_ERROR(Not a directory: ${tempval})
75
 
          fi
76
 
 
77
 
          if ${TEST} ! -f ${tempval}/$1; then
78
 
            AC_MSG_ERROR(can't locate ${tempval}/$1)
79
 
          fi
80
 
 
81
 
          if ${TEST} ! -z "$tempval" ; then
82
 
            APR_BUILD="apr-build"
83
 
            APR_CFLAGS="-I ${tempval}/include"
84
 
            APR_CLEAN="apr-clean"
85
 
            APR_DIR=${tempval}
86
 
            APR_INCDIR="${tempval}/include"
87
 
            AC_MSG_RESULT(configuring apr...)
88
 
            tempret="0"
89
 
            JK_EXEC(
90
 
              [tempret],
91
 
              [${SHELL} ./configure --prefix=${APR_DIR} --with-installbuilddir=${APR_DIR}/instbuild --disable-shared ${APR_CONFIGURE_ARGS}],
92
 
              [apr],
93
 
              [${APR_DIR}])
94
 
            if ${TEST} "${tempret}" = "0"; then
95
 
              AC_MSG_RESULT(apr configure ok)
96
 
            else
97
 
              AC_MSG_ERROR(apr configure failed with ${tempret})
98
 
            fi
99
 
            JK_APR_LIBNAME(apr_libname,${APR_DIR})
100
 
            APR_LDFLAGS="${APR_DIR}/lib/${apr_libname}"
101
 
            APR_LIBDIR=""
102
 
                        use_apr=true
103
 
            COMMON_APR_OBJECTS="\${COMMON_APR_OBJECTS}"
104
 
          fi
105
 
          ;;
106
 
        esac
107
 
      ])
108
 
 
109
 
      unset tempret
110
 
      unset tempval
111
 
      unset apr_libname
112
 
  ])
113
 
 
114
 
dnl --------------------------------------------------------------------------
115
 
dnl JK_APR_UTIL
116
 
dnl   Set the APR-UTIL source dir.
117
 
dnl   $1 => File which should be present
118
 
dnl --------------------------------------------------------------------------
119
 
AC_DEFUN(
120
 
  [JK_APR_UTIL],
121
 
  [
122
 
    tempval=""
123
 
    AC_ARG_WITH(
124
 
      [apr-util],
125
 
      [  --with-apr-util=DIR      Location of APR-UTIL source dir ],
126
 
      [
127
 
        case "${withval}" in
128
 
          ""|"yes"|"YES"|"true"|"TRUE")
129
 
            AC_MSG_ERROR(valid apr-util source dir location required)
130
 
          ;;
131
 
          "no"|"NO"|"false"|"FALSE")
132
 
            AC_MSG_ERROR(valid apr-util source dir location required)
133
 
          ;;
134
 
        *)
135
 
          tempval="${withval}"
136
 
 
137
 
          if ${TEST} ! -d ${tempval} ; then
138
 
            AC_MSG_ERROR(Not a directory: ${tempval})
139
 
          fi
140
 
 
141
 
          if ${TEST} ! -f ${tempval}/$1; then
142
 
            AC_MSG_ERROR(can't locate ${tempval}/$1)
143
 
          fi
144
 
 
145
 
          if ${TEST} -z "${APR_BUILD}"; then
146
 
            AC_MSG_ERROR([--with-apr and --with-apr-util must be used together])
147
 
          fi
148
 
 
149
 
          if ${TEST} ! -z "$tempval" ; then
150
 
            APR_UTIL_DIR=${tempval}
151
 
            APR_CFLAGS="${APR_CFLAGS} -I ${APR_UTIL_DIR}/include"
152
 
            APR_UTIL_INCDIR="${APR_UTIL_DIR}/include"
153
 
            AC_MSG_RESULT(configuring apr-util...)
154
 
            tempret="0"
155
 
            JK_EXEC(
156
 
              [tempret],
157
 
              [${SHELL} ./configure --prefix=${APR_UTIL_DIR} --with-apr=${APR_DIR}],
158
 
              [apr-util],
159
 
              [${APR_UTIL_DIR}])
160
 
            if ${TEST} "${tempret}" = "0"; then
161
 
              AC_MSG_RESULT(apr-util configure ok)
162
 
            else
163
 
              AC_MSG_ERROR(apr-util configure failed with ${tempret})
164
 
            fi
165
 
            JK_APR_UTIL_LIBNAME(apr_util_libname,${APR_UTIL_DIR})
166
 
            APR_LDFLAGS="${APR_LDFLAGS} ${APR_UTIL_DIR}/lib/${apr_util_libname}"
167
 
            APR_UTIL_LIBDIR=""
168
 
                        use_apr=true
169
 
            COMMON_APR_OBJECTS="\${COMMON_APR_OBJECTS}"
170
 
          fi
171
 
          ;;
172
 
        esac
173
 
      ])
174
 
 
175
 
      unset tempret
176
 
      unset tempval
177
 
      unset apr_util_libname
178
 
  ])
179
 
 
180
 
 
181
 
dnl --------------------------------------------------------------------------
182
 
dnl JK_APR_INCDIR
183
 
dnl   Set the APR include dir.
184
 
dnl   $1 => File which should be present
185
 
dnl --------------------------------------------------------------------------
186
 
AC_DEFUN(
187
 
  [JK_APR_INCDIR],
188
 
  [
189
 
    tempval=""
190
 
    AC_ARG_WITH(
191
 
      [apr-include],
192
 
      [  --with-apr-include=DIR   Location of APR include dir ],
193
 
      [  
194
 
        case "${withval}" in
195
 
          ""|"yes"|"YES"|"true"|"TRUE")
196
 
          ;;
197
 
          "no"|"NO"|"false"|"FALSE")
198
 
            AC_MSG_ERROR(valid apr include dir location required)
199
 
          ;;
200
 
        *)
201
 
          tempval="${withval}"
202
 
          if ${TEST} ! -d ${tempval} ; then
203
 
            AC_MSG_ERROR(Not a directory: ${tempval})
204
 
          fi
205
 
 
206
 
          if ${TEST} ! -f ${tempval}/$1; then
207
 
            AC_MSG_ERROR(can't locate ${tempval}/$1)
208
 
          fi
209
 
 
210
 
          if ${TEST} ! -z "$tempval" ; then
211
 
            APR_BUILD=""
212
 
            APR_CFLAGS="-I${tempval}"
213
 
            APR_CLEAN=""
214
 
            APR_DIR=""
215
 
            APR_INCDIR=${tempval}
216
 
            COMMON_APR_OBJECTS="\${COMMON_APR_OBJECTS}"
217
 
                        use_apr=true
218
 
          fi
219
 
          ;;
220
 
 
221
 
        esac
222
 
      ])
223
 
 
224
 
      unset tempval
225
 
  ])
226
 
 
227
 
 
228
 
dnl --------------------------------------------------------------------------
229
 
dnl JK_APR_LIBDIR
230
 
dnl   Set the APR library dir.
231
 
dnl --------------------------------------------------------------------------
232
 
AC_DEFUN(
233
 
  [JK_APR_LIBDIR],
234
 
  [
235
 
    tempval=""
236
 
    AC_ARG_WITH(
237
 
      [apr-lib],
238
 
      [  --with-apr-lib=DIR       Location of APR lib dir ],
239
 
      [
240
 
        case "${withval}" in
241
 
          ""|"yes"|"YES"|"true"|"TRUE")
242
 
          ;;
243
 
          "no"|"NO"|"false"|"FALSE")
244
 
            AC_MSG_ERROR(valid apr lib dir location required)
245
 
          ;;
246
 
          *)
247
 
            tempval="${withval}"
248
 
 
249
 
            if ${TEST} ! -d ${tempval} ; then
250
 
              AC_MSG_ERROR(Not a directory: ${tempval})
251
 
            fi
252
 
 
253
 
            if ${TEST} ! -z "$tempval" ; then
254
 
              APR_BUILD=""
255
 
              APR_CLEAN=""
256
 
              APR_DIR=""
257
 
              APR_LIBDIR=${tempval}
258
 
              APR_LDFLAGS="`apr-config --link-ld` -L${tempval}"
259
 
              COMMON_APR_OBJECTS="\${COMMON_APR_OBJECTS}"
260
 
                          use_apr=true
261
 
            fi
262
 
 
263
 
            ;;
264
 
            esac
265
 
      ])
266
 
 
267
 
      unset tempval
268
 
  ])
269
 
 
270
 
 
271
 
dnl --------------------------------------------------------------------------
272
 
dnl JK_APR_LIBNAME
273
 
dnl   Retrieve the complete name of the library.
274
 
dnl   $1 => Environment variable name for the returned value
275
 
dnl   $2 => APR sources directory
276
 
dnl --------------------------------------------------------------------------
277
 
AC_DEFUN(
278
 
  [JK_APR_LIBNAME],
279
 
  [
280
 
    AC_MSG_CHECKING([for apr APR_LIBNAME])
281
 
    if ${TEST} ! -f "$2/apr-config" ; then
282
 
      AC_MSG_ERROR([cannot find apr-config file in $2])
283
 
    fi
284
 
    jk_apr_get_tempval=`$2/apr-config --link-libtool 2> /dev/null`
285
 
    if ${TEST} -z "${jk_apr_get_tempval}" ; then
286
 
      AC_MSG_ERROR([$2/apr-config --link-libtool failed])
287
 
    fi
288
 
    jk_apr_get_tempval=`basename ${jk_apr_get_tempval}`
289
 
    $1="${jk_apr_get_tempval}"
290
 
    AC_MSG_RESULT([${jk_apr_get_tempval}])
291
 
    unset jk_apr_get_tempval
292
 
  ])
293
 
 
294
 
 
295
 
dnl --------------------------------------------------------------------------
296
 
dnl JK_APR_UTIL_LIBNAME
297
 
dnl   Retrieve the complete name of the library.
298
 
dnl   $1 => Environment variable name for the returned value
299
 
dnl   $2 => APR_UTIL sources directory
300
 
dnl --------------------------------------------------------------------------
301
 
AC_DEFUN(
302
 
  [JK_APR_UTIL_LIBNAME],
303
 
  [
304
 
    AC_MSG_CHECKING([for apr-util APR_UTIL_LIBNAME])
305
 
    if ${TEST} ! -f "$2/apu-config" ; then
306
 
      AC_MSG_ERROR([cannot find apu-config file in $2])
307
 
    fi
308
 
    jk_apu_get_tempval=`$2/apu-config --link-libtool 2> /dev/null`
309
 
    if ${TEST} -z "${jk_apu_get_tempval}" ; then
310
 
      AC_MSG_ERROR([$2/apu-config --link-libtool failed])
311
 
    fi
312
 
    jk_apu_get_tempval=`basename ${jk_apu_get_tempval}`
313
 
    $1="${jk_apu_get_tempval}"
314
 
    AC_MSG_RESULT([${jk_apu_get_tempval}])
315
 
    unset jk_apu_get_tempval
316
 
  ])
317
 
 
318
 
dnl vi:set sts=2 sw=2 autoindent:
319