@@ -106,209 +106,6 @@ AC_DEFUN([CHECK_IPV6_IPPROTO_RAW],
106
106
esac
107
107
] )
108
108
109
- dnl -------------------------------------------------------- -*- autoconf -*-
110
- dnl Licensed to the Apache Software Foundation (ASF) under one or more
111
- dnl contributor license agreements. See the NOTICE file distributed with
112
- dnl this work for additional information regarding copyright ownership.
113
- dnl The ASF licenses this file to You under the Apache License, Version 2.0
114
- dnl (the "License"); you may not use this file except in compliance with
115
- dnl the License. You may obtain a copy of the License at
116
- dnl
117
- dnl http://www.apache.org/licenses/LICENSE-2.0
118
- dnl
119
- dnl Unless required by applicable law or agreed to in writing, software
120
- dnl distributed under the License is distributed on an "AS IS" BASIS,
121
- dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
122
- dnl See the License for the specific language governing permissions and
123
- dnl limitations under the License.
124
-
125
- dnl
126
- dnl find_apr.m4 : locate the APR include files and libraries
127
- dnl
128
- dnl This macro file can be used by applications to find and use the APR
129
- dnl library. It provides a standardized mechanism for using APR. It supports
130
- dnl embedding APR into the application source, or locating an installed
131
- dnl copy of APR.
132
- dnl
133
- dnl APR_FIND_APR(srcdir, builddir, implicit-install-check, acceptable-majors,
134
- dnl detailed-check)
135
- dnl
136
- dnl where srcdir is the location of the bundled APR source directory, or
137
- dnl empty if source is not bundled.
138
- dnl
139
- dnl where builddir is the location where the bundled APR will will be built,
140
- dnl or empty if the build will occur in the srcdir.
141
- dnl
142
- dnl where implicit-install-check set to 1 indicates if there is no
143
- dnl --with-apr option specified, we will look for installed copies.
144
- dnl
145
- dnl where acceptable-majors is a space separated list of acceptable major
146
- dnl version numbers. Often only a single major version will be acceptable.
147
- dnl If multiple versions are specified, and --with-apr=PREFIX or the
148
- dnl implicit installed search are used, then the first (leftmost) version
149
- dnl in the list that is found will be used. Currently defaults to [0 1].
150
- dnl
151
- dnl where detailed-check is an M4 macro which sets the apr_acceptable to
152
- dnl either "yes" or "no". The macro will be invoked for each installed
153
- dnl copy of APR found, with the apr_config variable set appropriately.
154
- dnl Only installed copies of APR which are considered acceptable by
155
- dnl this macro will be considered found. If no installed copies are
156
- dnl considered acceptable by this macro, apr_found will be set to either
157
- dnl either "no" or "reconfig".
158
- dnl
159
- dnl Sets the following variables on exit:
160
- dnl
161
- dnl apr_found : "yes", "no", "reconfig"
162
- dnl
163
- dnl apr_config : If the apr-config tool exists, this refers to it. If
164
- dnl apr_found is "reconfig", then the bundled directory
165
- dnl should be reconfigured *before* using apr_config.
166
- dnl
167
- dnl Note: this macro file assumes that apr-config has been installed; it
168
- dnl is normally considered a required part of an APR installation.
169
- dnl
170
- dnl If a bundled source directory is available and needs to be (re)configured,
171
- dnl then apr_found is set to "reconfig". The caller should reconfigure the
172
- dnl (passed-in) source directory, placing the result in the build directory,
173
- dnl as appropriate.
174
- dnl
175
- dnl If apr_found is "yes" or "reconfig", then the caller should use the
176
- dnl value of apr_config to fetch any necessary build/link information.
177
- dnl
178
-
179
- AC_DEFUN ( [ APR_FIND_APR] , [
180
- apr_found="no"
181
-
182
- if test "$target_os" = "os2-emx"; then
183
- # Scripts don't pass test -x on OS/2
184
- TEST_X="test -f"
185
- else
186
- TEST_X="test -x"
187
- fi
188
-
189
- ifelse ( [ $4 ] , [ ] , [
190
- ifdef ( AC_WARNING ,AC_WARNING ( [ $0 : missing argument 4 (acceptable-majors): Defaulting to APR 0.x then APR 1.x] ) )
191
- acceptable_majors="0 1"] ,
192
- [ acceptable_majors="$4 "] )
193
-
194
- apr_temp_acceptable_apr_config=""
195
- for apr_temp_major in $acceptable_majors
196
- do
197
- case $apr_temp_major in
198
- 0)
199
- apr_temp_acceptable_apr_config="$apr_temp_acceptable_apr_config apr-config"
200
- ;;
201
- *)
202
- apr_temp_acceptable_apr_config="$apr_temp_acceptable_apr_config apr-$apr_temp_major-config"
203
- ;;
204
- esac
205
- done
206
-
207
- AC_MSG_CHECKING ( for APR )
208
- AC_ARG_WITH ( apr ,
209
- [ --with-apr=PATH prefix for installed APR or the full path to
210
- apr-config] ,
211
- [
212
- if test "$withval" = "no" || test "$withval" = "yes"; then
213
- AC_MSG_ERROR ( [ --with-apr requires a directory or file to be provided] )
214
- fi
215
-
216
- for apr_temp_apr_config_file in $apr_temp_acceptable_apr_config
217
- do
218
- for lookdir in "$withval/bin" "$withval"
219
- do
220
- if $TEST_X "$lookdir/$apr_temp_apr_config_file"; then
221
- apr_config="$lookdir/$apr_temp_apr_config_file"
222
- ifelse ( [ $5 ] , [ ] , [ ] , [
223
- apr_acceptable="yes"
224
- $5
225
- if test "$apr_acceptable" != "yes"; then
226
- AC_MSG_WARN ( [ Found APR in $apr_config, but we think it is considered unacceptable] )
227
- continue
228
- fi] )
229
- apr_found="yes"
230
- break 2
231
- fi
232
- done
233
- done
234
-
235
- if test "$apr_found" != "yes" && $TEST_X "$withval" && $withval --help > /dev/null 2>&1 ; then
236
- apr_config="$withval"
237
- ifelse ( [ $5 ] , [ ] , [ apr_found="yes"] , [
238
- apr_acceptable="yes"
239
- $5
240
- if test "$apr_acceptable" = "yes"; then
241
- apr_found="yes"
242
- fi] )
243
- fi
244
-
245
- dnl if --with-apr is used, it is a fatal error for its argument
246
- dnl to be invalid
247
- if test "$apr_found" != "yes"; then
248
- AC_MSG_ERROR ( [ the --with-apr parameter is incorrect. It must specify an install prefix, a build directory, or an apr-config file.] )
249
- fi
250
- ] ,[
251
- dnl If we allow installed copies, check those before using bundled copy.
252
- if test -n "$3 " && test "$3 " = "1"; then
253
- for apr_temp_apr_config_file in $apr_temp_acceptable_apr_config
254
- do
255
- if $apr_temp_apr_config_file --help > /dev/null 2>&1 ; then
256
- apr_config="$apr_temp_apr_config_file"
257
- ifelse ( [ $5 ] , [ ] , [ ] , [
258
- apr_acceptable="yes"
259
- $5
260
- if test "$apr_acceptable" != "yes"; then
261
- AC_MSG_WARN ( [ skipped APR at $apr_config, version not acceptable] )
262
- continue
263
- fi] )
264
- apr_found="yes"
265
- break
266
- else
267
- dnl look in some standard places
268
- for lookdir in /usr /usr/local /usr/local/apr /opt/apr; do
269
- if $TEST_X "$lookdir/bin/$apr_temp_apr_config_file"; then
270
- apr_config="$lookdir/bin/$apr_temp_apr_config_file"
271
- ifelse ( [ $5 ] , [ ] , [ ] , [
272
- apr_acceptable="yes"
273
- $5
274
- if test "$apr_acceptable" != "yes"; then
275
- AC_MSG_WARN ( [ skipped APR at $apr_config, version not acceptable] )
276
- continue
277
- fi] )
278
- apr_found="yes"
279
- break 2
280
- fi
281
- done
282
- fi
283
- done
284
- fi
285
- dnl if we have not found anything yet and have bundled source, use that
286
- if test "$apr_found" = "no" && test -d "$1 "; then
287
- apr_temp_abs_srcdir="`cd \"$1 \" && pwd`"
288
- apr_found="reconfig"
289
- apr_bundled_major="`sed -n '/#define.*APR_MAJOR_VERSION/s/^[ ^0-9] *\([ 0-9] *\).*$/\1/p' \"$1 /include/apr_version.h\"`"
290
- case $apr_bundled_major in
291
- "")
292
- AC_MSG_ERROR ( [ failed to find major version of bundled APR] )
293
- ;;
294
- 0)
295
- apr_temp_apr_config_file="apr-config"
296
- ;;
297
- *)
298
- apr_temp_apr_config_file="apr-$apr_bundled_major-config"
299
- ;;
300
- esac
301
- if test -n "$2 "; then
302
- apr_config="$2 /$apr_temp_apr_config_file"
303
- else
304
- apr_config="$1 /$apr_temp_apr_config_file"
305
- fi
306
- fi
307
- ] )
308
-
309
- AC_MSG_RESULT ( $apr_found )
310
- ] )
311
-
312
109
AC_DEFUN ( [ LARGE_FILES_IF_NOT_BROKEN] ,
313
110
[
314
111
AC_LANG_PUSH ( C++ )
0 commit comments