ossp-pkg/fsl/fsl-config.in
#!/bin/sh
##
## OSSP fsl - Faking/Flexible Syslog Library
## Copyright (c) 2002-2005 Ralf S. Engelschall <rse@engelschall.com>
## Copyright (c) 2002-2005 The OSSP Project <http://www.ossp.org/>
## Copyright (c) 2002-2005 Cable & Wireless <http://www.cw.com/>
##
## This file is part of OSSP fsl, a syslog(3) API faking library which
## can be found at http://www.ossp.org/pkg/lib/fsl/.
##
## Permission to use, copy, modify, and distribute this software for
## any purpose with or without fee is hereby granted, provided that
## the above copyright notice and this permission notice appear in all
## copies.
##
## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
## SUCH DAMAGE.
##
## fsl-config.in: OSSP fsl build utility
##
DIFS='
'
prefix="@prefix@"
exec_prefix="@exec_prefix@"
fsl_prefix="$prefix"
fsl_exec_prefix="$exec_prefix"
fsl_bindir="@bindir@"
fsl_libdir="@libdir@"
fsl_includedir="@includedir@"
fsl_mandir="@mandir@"
fsl_datadir="@datadir@"
fsl_acdir="@datadir@/aclocal"
fsl_cflags="@CFLAGS@"
fsl_ldflags="@LDFLAGS@"
fsl_libs="@LIBS@"
fsl_version="@FSL_VERSION_STR@"
help=no
version=no
usage="fsl-config"
usage="$usage [--help] [--version] [--all]"
usage="$usage [--prefix] [--exec-prefix] [--bindir] [--libdir] [--includedir] [--mandir] [--datadir] [--acdir]"
usage="$usage [--cflags] [--ldflags] [--libs]"
if [ $# -eq 0 ]; then
echo "fsl-config:Error: Invalid option" 1>&2
echo "fsl-config:Usage: $usage" 1>&2
exit 1
fi
output=''
output_extra=''
all=no
prev=''
OIFS="$IFS" IFS="$DIFS"
for option
do
if [ ".$prev" != . ]; then
eval "$prev=\$option"
prev=''
continue
fi
case "$option" in
-*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg='' ;;
esac
case "$option" in
--help|-h)
echo "Usage: $usage"
exit 0
;;
--version|-v)
echo "OSSP fsl $fsl_version"
exit 0
;;
--all)
all=yes
;;
--prefix)
output="$output $fsl_prefix"
;;
--exec-prefix)
output="$output $fsl_exec_prefix"
;;
--bindir)
output="$output $fsl_bindir"
;;
--libdir)
output="$output $fsl_libdir"
;;
--includedir)
output="$output $fsl_includedir"
;;
--mandir)
output="$output $fsl_mandir"
;;
--datadir)
output="$output $fsl_datadir"
;;
--acdir)
output="$output $fsl_acdir"
;;
--cflags)
output="$output -I$fsl_includedir"
output_extra="$output_extra $fsl_cflags"
;;
--ldflags)
output="$output -L$fsl_libdir"
output_extra="$output_extra $fsl_ldflags"
;;
--libs)
output="$output -lfsl"
output_extra="$output_extra $fsl_libs"
;;
* )
echo "fsl-config:Error: Invalid option" 1>&2
echo "fsl-config:Usage: $usage" 1>&2
exit 1;
;;
esac
done
IFS="$OIFS"
if [ ".$prev" != . ]; then
echo "fsl-config:Error: missing argument to --`echo $prev | sed 's/_/-/g'`" 1>&2
exit 1
fi
if [ ".$output" != . ]; then
if [ ".$all" = .yes ]; then
output="$output $output_extra"
fi
echo $output
fi