Blame apu-config.in

Packit 383869
#!/bin/sh
Packit 383869
# Licensed to the Apache Software Foundation (ASF) under one or more
Packit 383869
# contributor license agreements.  See the NOTICE file distributed with
Packit 383869
# this work for additional information regarding copyright ownership.
Packit 383869
# The ASF licenses this file to You under the Apache License, Version 2.0
Packit 383869
# (the "License"); you may not use this file except in compliance with
Packit 383869
# the License.  You may obtain a copy of the License at
Packit 383869
#
Packit 383869
#     http://www.apache.org/licenses/LICENSE-2.0
Packit 383869
#
Packit 383869
# Unless required by applicable law or agreed to in writing, software
Packit 383869
# distributed under the License is distributed on an "AS IS" BASIS,
Packit 383869
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Packit 383869
# See the License for the specific language governing permissions and
Packit 383869
# limitations under the License.
Packit 383869
#
Packit 383869
Packit 383869
# APR-util script designed to allow easy command line access to APR-util
Packit 383869
# configuration parameters.
Packit 383869
Packit 383869
APRUTIL_MAJOR_VERSION="@APRUTIL_MAJOR_VERSION@"
Packit 383869
APRUTIL_DOTTED_VERSION="@APRUTIL_DOTTED_VERSION@"
Packit 383869
Packit 383869
prefix="@prefix@"
Packit 383869
exec_prefix="@exec_prefix@"
Packit 383869
bindir="@bindir@"
Packit 383869
includedir="@includedir@"
Packit 383869
Packit Service 38cf5f
libdir=`pkg-config --variable=libdir apr-util-@APRUTIL_MAJOR_VERSION@`
Packit Service 38cf5f
Packit 383869
LIBS="@APRUTIL_EXPORT_LIBS@"
Packit 383869
INCLUDES="@APRUTIL_INCLUDES@"
Packit 383869
LDFLAGS="@APRUTIL_LDFLAGS@"
Packit 383869
LDAP_LIBS="@LDADD_ldap@"
Packit 383869
DBM_LIBS="@LDADD_dbm_db@ @LDADD_dbm_gdbm@ @LDADD_dbm_ndbm@"
Packit 383869
Packit 383869
APRUTIL_LIBNAME="@APRUTIL_LIBNAME@"
Packit 383869
Packit 383869
APU_SOURCE_DIR="@abs_srcdir@"
Packit 383869
APU_BUILD_DIR="@abs_builddir@"
Packit 383869
APR_XML_EXPAT_OLD="@APR_XML_EXPAT_OLD@"
Packit 383869
APU_DB_VERSION="@apu_db_version@"
Packit 383869
Packit 383869
# NOTE: the following line is modified during 'make install': alter with care!
Packit 383869
location=@APU_CONFIG_LOCATION@
Packit 383869
Packit 383869
show_usage()
Packit 383869
{
Packit 383869
    cat << EOF
Packit 383869
Usage: apu-$APRUTIL_MAJOR_VERSION-config [OPTION]
Packit 383869
Packit 383869
Known values for OPTION are:
Packit 383869
  --prefix[=DIR]    change prefix to DIR
Packit 383869
  --bindir          print location where binaries are installed
Packit 383869
  --includes        print include information
Packit 383869
  --includedir      print location where headers are installed
Packit 383869
  --ldflags         print linker flags
Packit 383869
  --libs            print library information
Packit 383869
  --avoid-ldap      do not include ldap library information with --libs
Packit 383869
  --ldap-libs       print library information to link with ldap
Packit 383869
  --avoid-dbm       do not include DBM library information with --libs
Packit 383869
  --dbm-libs        print additional library information to link with DBM
Packit 383869
  --srcdir          print APR-util source directory
Packit 383869
  --link-ld         print link switch(es) for linking to APR-util
Packit 383869
  --link-libtool    print the libtool inputs for linking to APR-util
Packit 383869
  --apu-la-file     print the path to the .la file, if available
Packit 383869
  --old-expat       indicate if APR-util was built against an old expat
Packit 383869
  --db-version      print the DB version
Packit 383869
  --version         print APR-util's version as a dotted triple
Packit 383869
  --help            print this help
Packit 383869
Packit 383869
When linking with libtool, an application should do something like:
Packit 383869
  APU_LIBS="\`apu-$APRUTIL_MAJOR_VERSION-config --link-libtool --libs\`"
Packit 383869
or when linking directly:
Packit 383869
  APU_LIBS="\`apu-$APRUTIL_MAJOR_VERSION-config --link-ld --libs\`"
Packit 383869
Packit 383869
An application should use the results of --includes, and --ldflags in
Packit 383869
their build process.
Packit 383869
EOF
Packit 383869
}
Packit 383869
Packit 383869
if test $# -eq 0; then
Packit 383869
    show_usage
Packit 383869
    exit 1
Packit 383869
fi
Packit 383869
Packit 383869
if test "$location" = "installed"; then
Packit 383869
    LA_FILE="$libdir/lib${APRUTIL_LIBNAME}.la"
Packit 383869
else
Packit 383869
    LA_FILE="$APU_BUILD_DIR/lib${APRUTIL_LIBNAME}.la"
Packit 383869
fi
Packit 383869
Packit 383869
flags=""
Packit 383869
Packit 383869
while test $# -gt 0; do
Packit 383869
    # Normalize the prefix.
Packit 383869
    case "$1" in
Packit 383869
    -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
Packit 383869
    *) optarg= ;;
Packit 383869
    esac
Packit 383869
Packit 383869
    case "$1" in
Packit 383869
    # It is possible for the user to override our prefix.
Packit 383869
    --prefix=*)
Packit 383869
    prefix=$optarg
Packit 383869
    ;;
Packit 383869
    --prefix)
Packit 383869
    echo $prefix
Packit 383869
    exit 0
Packit 383869
    ;;
Packit 383869
    --bindir)
Packit 383869
    echo $bindir
Packit 383869
    exit 0
Packit 383869
    ;;
Packit 383869
    --avoid-ldap)
Packit 383869
    LDAP_LIBS=""
Packit 383869
    ;;
Packit 383869
    --avoid-dbm)
Packit 383869
    DBM_LIBS=""
Packit 383869
    ;;
Packit 383869
    --libs)
Packit 383869
    flags="$flags $LDAP_LIBS $DBM_LIBS $LIBS"
Packit 383869
    ;;
Packit 383869
    --ldap-libs)
Packit 383869
    flags="$flags $LDAP_LIBS"
Packit 383869
    ;;
Packit 383869
    --dbm-libs)
Packit 383869
    flags="$flags $DBM_LIBS"
Packit 383869
    ;;
Packit 383869
    --includedir)
Packit 383869
    if test "$location" = "installed"; then
Packit 383869
        flags="$includedir"
Packit 383869
    elif test "$location" = "source"; then
Packit 383869
        flags="$APU_SOURCE_DIR/include"
Packit 383869
    else
Packit 383869
        # this is for VPATH builds
Packit 383869
        flags="$APU_BUILD_DIR/include $APU_SOURCE_DIR/include"
Packit 383869
    fi
Packit 383869
    echo $flags
Packit 383869
    exit 0
Packit 383869
    ;;
Packit 383869
    --includes)
Packit 383869
    if test "$location" = "installed"; then
Packit 383869
        flags="$flags -I$includedir $INCLUDES"
Packit 383869
    elif test "$location" = "source"; then
Packit 383869
        flags="$flags -I$APU_SOURCE_DIR/include $INCLUDES"
Packit 383869
    else
Packit 383869
        # this is for VPATH builds
Packit 383869
        flags="$flags -I$APU_BUILD_DIR/include -I$APU_SOURCE_DIR/include $INCLUDES"
Packit 383869
    fi
Packit 383869
    ;;
Packit 383869
    --ldflags)
Packit 383869
    flags="$flags $LDFLAGS"
Packit 383869
    ;;
Packit 383869
    --srcdir)
Packit 383869
    echo $APU_SOURCE_DIR
Packit 383869
    exit 0
Packit 383869
    ;;
Packit 383869
    --version)
Packit 383869
    echo $APRUTIL_DOTTED_VERSION
Packit 383869
    exit 0
Packit 383869
    ;;
Packit 383869
    --link-ld)
Packit 383869
    if test "$location" = "installed"; then
Packit 383869
        ### avoid using -L if libdir is a "standard" location like /usr/lib
Packit 383869
        flags="$flags -L$libdir -l$APRUTIL_LIBNAME"
Packit 383869
    else
Packit 383869
        flags="$flags -L$APU_BUILD_DIR -l$APRUTIL_LIBNAME"
Packit 383869
    fi
Packit 383869
    ;;
Packit 383869
    --link-libtool)
Packit 383869
    # If the LA_FILE exists where we think it should be, use it.  If we're
Packit 383869
    # installed and the LA_FILE does not exist, assume to use -L/-l
Packit 383869
    # (the LA_FILE may not have been installed).  If we're building ourselves,
Packit 383869
    # we'll assume that at some point the .la file be created.
Packit 383869
    if test -f "$LA_FILE"; then
Packit 383869
        flags="$flags $LA_FILE"
Packit 383869
    elif test "$location" = "installed"; then
Packit 383869
        ### avoid using -L if libdir is a "standard" location like /usr/lib
Packit 383869
        # Since the user is specifying they are linking with libtool, we
Packit 383869
        # *know* that -R will be recognized by libtool.
Packit 383869
        flags="$flags -L$libdir -R$libdir -l$APRUTIL_LIBNAME"
Packit 383869
    else
Packit 383869
        flags="$flags $LA_FILE"
Packit 383869
    fi
Packit 383869
    ;;
Packit 383869
    --apu-la-file)
Packit 383869
    if test -f "$LA_FILE"; then
Packit 383869
        flags="$flags $LA_FILE"
Packit 383869
    fi
Packit 383869
    ;;
Packit 383869
    --old-expat)
Packit 383869
    if test ! -n "$APR_XML_EXPAT_OLD"; then
Packit 383869
        echo "no"
Packit 383869
    else
Packit 383869
        echo "$APR_XML_EXPAT_OLD"
Packit 383869
    fi
Packit 383869
    exit 0
Packit 383869
    ;;
Packit 383869
    --db-version)
Packit 383869
    echo $APU_DB_VERSION
Packit 383869
    exit 0
Packit 383869
    ;;
Packit 383869
    --help)
Packit 383869
    show_usage
Packit 383869
    exit 0
Packit 383869
    ;;
Packit 383869
    *)
Packit 383869
    show_usage
Packit 383869
    exit 1
Packit 383869
    ;;
Packit 383869
    esac
Packit 383869
Packit 383869
    # Next please.
Packit 383869
    shift
Packit 383869
done
Packit 383869
Packit 383869
if test -n "$flags"; then
Packit 383869
  echo "$flags"
Packit 383869
fi
Packit 383869
Packit 383869
exit 0