2 # Licensed to the Apache Software Foundation (ASF) under one or more
3 # contributor license agreements. See the NOTICE file distributed with
4 # this work for additional information regarding copyright ownership.
5 # The ASF licenses this file to You under the Apache License, Version 2.0
6 # (the "License"); you may not use this file except in compliance with
7 # the License. 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
22 APR_DOTTED_VERSION
="0.9.17"
25 exec_prefix
="${prefix}"
26 bindir
="${exec_prefix}/bin"
27 libdir
="${exec_prefix}/lib"
29 installbuilddir
="${prefix}/build"
30 includedir
="${prefix}/include/apr-${APR_MAJOR_VERSION}"
41 APR_SOURCE_DIR
="/src/subversion/subversion-1.4.6/apr"
42 APR_BUILD_DIR
="/src/subversion/subversion-1.4.6/apr"
44 APR_LIB_TARGET
="-rpath \$(libdir) \$\$objects"
45 APR_LIBNAME
="apr-${APR_MAJOR_VERSION}"
47 # NOTE: the following line is modified during 'make install': alter with care!
53 Usage: apr-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 cpp 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-config --link-libtool --libs\`"
80 or when linking directly:
81 APR_LIBS="\`apr-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 flags
="$flags -L$libdir -l${APR_LIBNAME}"
202 flags
="$flags $LA_FILE"
206 echo "$SHLIBPATH_VAR"
210 if test -f "$LA_FILE"; then
211 flags
="$flags $LA_FILE"
219 echo "$APR_LIB_TARGET"
223 if test "$location" = "installed"; then
224 echo "${installbuilddir}/libtool"
226 echo "$APR_BUILD_DIR/libtool"
244 if test -n "$flags"; then