~ubuntu-branches/ubuntu/feisty/apache2/feisty

« back to all changes in this revision

Viewing changes to srclib/apr/apr-config.in

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Barth
  • Date: 2006-12-09 21:05:45 UTC
  • mfrom: (0.6.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20061209210545-h70s0xaqc2v8vqr2
Tags: 2.2.3-3.2
* Non-maintainer upload.
* 043_ajp_connection_reuse: Patch from upstream Bugzilla, fixing a critical
  issue with regard to connection reuse in mod_proxy_ajp.
  Closes: #396265

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
# Copyright 2001-2005 The Apache Software Foundation or its licensors, as
 
3
# applicable.
 
4
#
 
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
 
8
#
 
9
#     http://www.apache.org/licenses/LICENSE-2.0
 
10
#
 
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.
 
16
#
 
17
 
 
18
# APR script designed to allow easy command line access to APR configuration
 
19
# parameters.
 
20
 
 
21
APR_MAJOR_VERSION="@APR_MAJOR_VERSION@"
 
22
APR_DOTTED_VERSION="@APR_DOTTED_VERSION@"
 
23
 
 
24
prefix="@prefix@"
 
25
exec_prefix="@exec_prefix@"
 
26
bindir="@bindir@"
 
27
libdir="@libdir@"
 
28
datadir="@datadir@"
 
29
installbuilddir="@installbuilddir@"
 
30
includedir="@includedir@"
 
31
 
 
32
CC="@CC@"
 
33
CPP="@CPP@"
 
34
SHELL="@SHELL@"
 
35
CPPFLAGS="@EXTRA_CPPFLAGS@"
 
36
CFLAGS="@EXTRA_CFLAGS@"
 
37
LDFLAGS="@EXTRA_LDFLAGS@"
 
38
LIBS="@EXTRA_LIBS@"
 
39
EXTRA_INCLUDES="@EXTRA_INCLUDES@"
 
40
SHLIBPATH_VAR="@shlibpath_var@"
 
41
APR_SOURCE_DIR="@apr_srcdir@"
 
42
APR_BUILD_DIR="@apr_builddir@"
 
43
APR_SO_EXT="@so_ext@"
 
44
APR_LIB_TARGET="@export_lib_target@"
 
45
APR_LIBNAME="@APR_LIBNAME@"
 
46
 
 
47
# NOTE: the following line is modified during 'make install': alter with care!
 
48
location=@APR_CONFIG_LOCATION@
 
49
 
 
50
show_usage()
 
51
{
 
52
    cat << EOF
 
53
Usage: apr-$APR_MAJOR_VERSION-config [OPTION]
 
54
 
 
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
 
77
 
 
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\`"
 
82
 
 
83
An application should use the results of --cflags, --cppflags, --includes,
 
84
and --ldflags in their build process.
 
85
EOF
 
86
}
 
87
 
 
88
if test $# -eq 0; then
 
89
    show_usage
 
90
    exit 1
 
91
fi
 
92
 
 
93
if test "$location" = "installed"; then
 
94
    LA_FILE="$libdir/lib${APR_LIBNAME}.la"
 
95
else
 
96
    LA_FILE="$APR_BUILD_DIR/lib${APR_LIBNAME}.la"
 
97
fi
 
98
 
 
99
flags=""
 
100
 
 
101
while test $# -gt 0; do
 
102
    # Normalize the prefix.
 
103
    case "$1" in
 
104
    -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
 
105
    *) optarg= ;;
 
106
    esac
 
107
 
 
108
    case "$1" in
 
109
    # It is possible for the user to override our prefix.
 
110
    --prefix=*)
 
111
    prefix=$optarg
 
112
    ;;
 
113
    --prefix)
 
114
    echo $prefix
 
115
    exit 0
 
116
    ;;
 
117
    --bindir)
 
118
    echo $bindir
 
119
    exit 0
 
120
    ;;
 
121
    --includedir)
 
122
    if test "$location" = "installed"; then
 
123
        flags="$includedir"
 
124
    elif test "$location" = "source"; then
 
125
        flags="$APR_SOURCE_DIR/include"
 
126
    else
 
127
        # this is for VPATH builds
 
128
        flags="$APR_BUILD_DIR/include $APR_SOURCE_DIR/include"
 
129
    fi
 
130
    echo $flags
 
131
    exit 0
 
132
    ;;
 
133
    --cc)
 
134
    echo $CC
 
135
    exit 0
 
136
    ;;
 
137
    --cpp)
 
138
    echo $CPP
 
139
    exit 0
 
140
    ;;
 
141
    --cflags)
 
142
    flags="$flags $CFLAGS"
 
143
    ;;
 
144
    --cppflags)
 
145
    flags="$flags $CPPFLAGS"
 
146
    ;;
 
147
    --libs)
 
148
    flags="$flags $LIBS"
 
149
    ;;
 
150
    --ldflags)
 
151
    flags="$flags $LDFLAGS"
 
152
    ;;
 
153
    --includes)
 
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"
 
158
    else
 
159
        # this is for VPATH builds
 
160
        flags="$flags -I$APR_BUILD_DIR/include -I$APR_SOURCE_DIR/include $EXTRA_INCLUDES"
 
161
    fi
 
162
    ;;
 
163
    --srcdir)
 
164
    echo $APR_SOURCE_DIR
 
165
    exit 0
 
166
    ;;
 
167
    --installbuilddir)
 
168
    if test "$location" = "installed"; then
 
169
        echo "${installbuilddir}"
 
170
    elif test "$location" = "source"; then
 
171
        echo "$APR_SOURCE_DIR/build"
 
172
    else
 
173
        # this is for VPATH builds
 
174
        echo "$APR_BUILD_DIR/build"
 
175
    fi
 
176
    exit 0
 
177
    ;;
 
178
    --version)
 
179
    echo $APR_DOTTED_VERSION
 
180
    exit 0
 
181
    ;;
 
182
    --link-ld)
 
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}"
 
186
    else
 
187
        ### this surely can't work since the library is in .libs?
 
188
        flags="$flags -L$APR_BUILD_DIR -l${APR_LIBNAME}"
 
189
    fi
 
190
    ;;
 
191
    --link-libtool)
 
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}"
 
203
    else
 
204
        flags="$flags $LA_FILE"
 
205
    fi
 
206
    ;;
 
207
    --shlib-path-var)
 
208
    echo "$SHLIBPATH_VAR"
 
209
    exit 0
 
210
    ;;
 
211
    --apr-la-file)
 
212
    if test -f "$LA_FILE"; then
 
213
        flags="$flags $LA_FILE"
 
214
    fi
 
215
    ;;
 
216
    --apr-so-ext)
 
217
    echo "$APR_SO_EXT"
 
218
    exit 0
 
219
    ;;
 
220
    --apr-lib-target)
 
221
    echo "$APR_LIB_TARGET"
 
222
    exit 0
 
223
    ;;
 
224
    --apr-libtool)
 
225
    if test "$location" = "installed"; then
 
226
        echo "${installbuilddir}/libtool"
 
227
    else
 
228
        echo "$APR_BUILD_DIR/libtool"
 
229
    fi
 
230
    exit 0
 
231
    ;;
 
232
    --help)
 
233
    show_usage
 
234
    exit 0
 
235
    ;;
 
236
    *)
 
237
    show_usage
 
238
    exit 1
 
239
    ;;
 
240
    esac
 
241
 
 
242
    # Next please.
 
243
    shift
 
244
done
 
245
 
 
246
if test -n "$flags"; then
 
247
  echo "$flags"
 
248
fi
 
249
 
 
250
exit 0