bottleneck testcase based on rubbos
[bottlenecks.git] / rubbos / app / apache2 / bin / apu-config
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-util script designed to allow easy command line access to APR-util
19 # configuration parameters.
20
21 APRUTIL_MAJOR_VERSION="0"
22 APRUTIL_DOTTED_VERSION="0.9.19"
23
24 prefix="/bottlenecks/rubbos/app/apache2"
25 exec_prefix="/bottlenecks/rubbos/app/apache2"
26 bindir="${prefix}/bin"
27 libdir="${prefix}/lib"
28 includedir="/bottlenecks/rubbos/app/apache2/include"
29
30 LIBS="/bottlenecks/rubbos/app/httpd-2.0.64/srclib/apr-util/xml/expat/libexpat.la"
31 INCLUDES="-I/bottlenecks/rubbos/app/httpd-2.0.64/srclib/apr-util/xml/expat/lib"
32 LDFLAGS="-L/bottlenecks/rubbos/app/httpd-2.0.64/srclib/apr-util/xml/expat/lib"
33
34 APRUTIL_LIBNAME="aprutil-${APRUTIL_MAJOR_VERSION}"
35
36 APU_SOURCE_DIR="/bottlenecks/rubbos/app/httpd-2.0.64/srclib/apr-util"
37 APU_BUILD_DIR="/bottlenecks/rubbos/app/httpd-2.0.64/srclib/apr-util"
38 APR_XML_EXPAT_OLD=""
39 APU_DB_VERSION="0"
40
41 # NOTE: the following line is modified during 'make install': alter with care!
42 location=installed
43
44 show_usage()
45 {
46     cat << EOF
47 Usage: apu-config [OPTION]
48
49 Known values for OPTION are:
50   --prefix[=DIR]    change prefix to DIR
51   --bindir          print location where binaries are installed
52   --includes        print include information
53   --includedir      print location where headers are installed
54   --ldflags         print linker flags
55   --libs            print library information
56   --srcdir          print APR-util source directory
57   --link-ld         print link switch(es) for linking to APR-util
58   --link-libtool    print the libtool inputs for linking to APR-util
59   --apu-la-file     print the path to the .la file, if available
60   --old-expat       indicate if APR-util was built against an old expat
61   --db-version      print the DB version
62   --version         print APR-util's version as a dotted triple
63   --help            print this help
64
65 When linking with libtool, an application should do something like:
66   APU_LIBS="\`apu-config --link-libtool --libs\`"
67 or when linking directly:
68   APU_LIBS="\`apu-config --link-ld --libs\`"
69
70 An application should use the results of --includes, and --ldflags in
71 their build process.
72 EOF
73 }
74
75 if test $# -eq 0; then
76     show_usage
77     exit 1
78 fi
79
80 if test "$location" = "installed"; then
81     LA_FILE="$libdir/lib${APRUTIL_LIBNAME}.la"
82
83     LIBS=`echo "$LIBS" | sed -e "s $APU_BUILD_DIR/xml/expat $prefix g" -e "s $prefix/libexpat.la -lexpat g"`
84     LDFLAGS=`echo "$LDFLAGS" | sed -e "s $APU_BUILD_DIR/xml/expat $prefix g"`
85     INCLUDES=`echo "$INCLUDES" | sed -e "s $APU_BUILD_DIR/xml/expat $prefix g" -e "s -I$prefix/lib  g"`
86 else
87     LA_FILE="$APU_BUILD_DIR/lib${APRUTIL_LIBNAME}.la"
88 fi
89
90 flags=""
91
92 while test $# -gt 0; do
93     # Normalize the prefix.
94     case "$1" in
95     -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
96     *) optarg= ;;
97     esac
98
99     case "$1" in
100     # It is possible for the user to override our prefix.
101     --prefix=*)
102     prefix=$optarg
103     ;;
104     --prefix)
105     echo $prefix
106     exit 0
107     ;;
108     --bindir)
109     echo $bindir
110     exit 0
111     ;;
112     --libs)
113     flags="$flags $LIBS"
114     ;;
115     --includedir)
116     if test "$location" = "installed"; then
117         flags="$includedir"
118     elif test "$location" = "source"; then
119         flags="$APU_SOURCE_DIR/include"
120     else
121         # this is for VPATH builds
122         flags="$APU_BUILD_DIR/include $APU_SOURCE_DIR/include"
123     fi
124     echo $flags
125     exit 0
126     ;;
127     --includes)
128     if test "$location" = "installed"; then
129         flags="$flags -I$includedir $INCLUDES"
130     elif test "$location" = "source"; then
131         flags="$flags -I$APU_SOURCE_DIR/include $INCLUDES"
132     else
133         # this is for VPATH builds
134         flags="$flags -I$APU_BUILD_DIR/include -I$APU_SOURCE_DIR/include $INCLUDES"
135     fi
136     ;;
137     --ldflags)
138     flags="$flags $LDFLAGS"
139     ;;
140     --srcdir)
141     echo $APU_SOURCE_DIR
142     exit 0
143     ;;
144     --version)
145     echo $APRUTIL_DOTTED_VERSION
146     exit 0
147     ;;
148     --link-ld)
149     if test "$location" = "installed"; then
150         ### avoid using -L if libdir is a "standard" location like /usr/lib
151         flags="$flags -L$libdir -l$APRUTIL_LIBNAME"
152     else
153         flags="$flags -L$APU_BUILD_DIR -l$APRUTIL_LIBNAME"
154     fi
155     ;;
156     --link-libtool)
157     # If the LA_FILE exists where we think it should be, use it.  If we're
158     # installed and the LA_FILE does not exist, assume to use -L/-l
159     # (the LA_FILE may not have been installed).  If we're building ourselves,
160     # we'll assume that at some point the .la file be created.
161     if test -f "$LA_FILE"; then
162         flags="$flags $LA_FILE"
163     elif test "$location" = "installed"; then
164         ### avoid using -L if libdir is a "standard" location like /usr/lib
165         flags="$flags -L$libdir -l$APRUTIL_LIBNAME"
166     else
167         flags="$flags $LA_FILE"
168     fi
169     ;;
170     --apu-la-file)
171     if test -f "$LA_FILE"; then
172         flags="$flags $LA_FILE"
173     fi
174     ;;
175     --old-expat)
176     if test ! -n "$APR_XML_EXPAT_OLD"; then
177         echo "no"
178     else
179         echo "$APR_XML_EXPAT_OLD"
180     fi
181     exit 0
182     ;;
183     --db-version)
184     echo $APU_DB_VERSION
185     exit 0
186     ;;
187     --help)
188     show_usage
189     exit 0
190     ;;
191     *)
192     show_usage
193     exit 1
194     ;;
195     esac
196
197     # Next please.
198     shift
199 done
200
201 if test -n "$flags"; then
202   echo "$flags"
203 fi
204
205 exit 0