2
# Copyright 2001-2005 The Apache Software Foundation or its licensors, as
5
# Licensed under the Apache License, Version 2.0 (the "License");
6
# you may not use this file except in compliance with the License.
7
# You may obtain a copy of the License at
9
# http://www.apache.org/licenses/LICENSE-2.0
11
# Unless required by applicable law or agreed to in writing, software
12
# distributed under the License is distributed on an "AS IS" BASIS,
13
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
# See the License for the specific language governing permissions and
15
# limitations under the License.
18
# APR script designed to allow easy command line access to APR configuration
21
APR_MAJOR_VERSION="@APR_MAJOR_VERSION@"
22
APR_DOTTED_VERSION="@APR_DOTTED_VERSION@"
25
exec_prefix="@exec_prefix@"
29
installbuilddir="@installbuilddir@"
30
includedir="@includedir@"
35
CPPFLAGS="@EXTRA_CPPFLAGS@"
36
CFLAGS="@EXTRA_CFLAGS@"
37
LDFLAGS="@EXTRA_LDFLAGS@"
39
EXTRA_INCLUDES="@EXTRA_INCLUDES@"
40
SHLIBPATH_VAR="@shlibpath_var@"
41
APR_SOURCE_DIR="@apr_srcdir@"
42
APR_BUILD_DIR="@apr_builddir@"
44
APR_LIB_TARGET="@export_lib_target@"
45
APR_LIBNAME="@APR_LIBNAME@"
47
# NOTE: the following line is modified during 'make install': alter with care!
48
location=@APR_CONFIG_LOCATION@
53
Usage: apr-$APR_MAJOR_VERSION-config [OPTION]
55
Known values for OPTION are:
56
--prefix[=DIR] change prefix to DIR
57
--bindir print location where binaries are installed
58
--includedir print location where headers are installed
59
--cc print C compiler name
60
--cpp print C preprocessor name and any required options
61
--cflags print C compiler flags
62
--cppflags print C preprocessor flags
63
--includes print include information
64
--ldflags print linker flags
65
--libs print additional libraries to link against
66
--srcdir print APR source directory
67
--installbuilddir print APR build helper directory
68
--link-ld print link switch(es) for linking to APR
69
--link-libtool print the libtool inputs for linking to APR
70
--shlib-path-var print the name of the shared library path env var
71
--apr-la-file print the path to the .la file, if available
72
--apr-so-ext print the extensions of shared objects on this platform
73
--apr-lib-target print the libtool target information
74
--apr-libtool print the path to APR's libtool
75
--version print the APR's version as a dotted triple
76
--help print this help
78
When linking with libtool, an application should do something like:
79
APR_LIBS="\`apr-$APR_MAJOR_VERSION-config --link-libtool --libs\`"
80
or when linking directly:
81
APR_LIBS="\`apr-$APR_MAJOR_VERSION-config --link-ld --libs\`"
83
An application should use the results of --cflags, --cppflags, --includes,
84
and --ldflags in their build process.
88
if test $# -eq 0; then
93
if test "$location" = "installed"; then
94
LA_FILE="$libdir/lib${APR_LIBNAME}.la"
96
LA_FILE="$APR_BUILD_DIR/lib${APR_LIBNAME}.la"
101
while test $# -gt 0; do
102
# Normalize the prefix.
104
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
109
# It is possible for the user to override our prefix.
122
if test "$location" = "installed"; then
124
elif test "$location" = "source"; then
125
flags="$APR_SOURCE_DIR/include"
127
# this is for VPATH builds
128
flags="$APR_BUILD_DIR/include $APR_SOURCE_DIR/include"
142
flags="$flags $CFLAGS"
145
flags="$flags $CPPFLAGS"
151
flags="$flags $LDFLAGS"
154
if test "$location" = "installed"; then
155
flags="$flags -I$includedir $EXTRA_INCLUDES"
156
elif test "$location" = "source"; then
157
flags="$flags -I$APR_SOURCE_DIR/include $EXTRA_INCLUDES"
159
# this is for VPATH builds
160
flags="$flags -I$APR_BUILD_DIR/include -I$APR_SOURCE_DIR/include $EXTRA_INCLUDES"
168
if test "$location" = "installed"; then
169
echo "${installbuilddir}"
170
elif test "$location" = "source"; then
171
echo "$APR_SOURCE_DIR/build"
173
# this is for VPATH builds
174
echo "$APR_BUILD_DIR/build"
179
echo $APR_DOTTED_VERSION
183
if test "$location" = "installed"; then
184
### avoid using -L if libdir is a "standard" location like /usr/lib
185
flags="$flags -L$libdir -l${APR_LIBNAME}"
187
### this surely can't work since the library is in .libs?
188
flags="$flags -L$APR_BUILD_DIR -l${APR_LIBNAME}"
192
# If the LA_FILE exists where we think it should be, use it. If we're
193
# installed and the LA_FILE does not exist, assume to use -L/-l
194
# (the LA_FILE may not have been installed). If we're building ourselves,
195
# we'll assume that at some point the .la file be created.
196
if test -f "$LA_FILE"; then
197
flags="$flags $LA_FILE"
198
elif test "$location" = "installed"; then
199
### avoid using -L if libdir is a "standard" location like /usr/lib
200
# Since the user is specifying they are linking with libtool, we
201
# *know* that -R will be recognized by libtool.
202
flags="$flags -L$libdir -R$libdir -l${APR_LIBNAME}"
204
flags="$flags $LA_FILE"
208
echo "$SHLIBPATH_VAR"
212
if test -f "$LA_FILE"; then
213
flags="$flags $LA_FILE"
221
echo "$APR_LIB_TARGET"
225
if test "$location" = "installed"; then
226
echo "${installbuilddir}/libtool"
228
echo "$APR_BUILD_DIR/libtool"
246
if test -n "$flags"; then