# $Id: yat-config.in 1776 2009-02-05 19:17:47Z peter $
# Copyright (C) 2008, 2009 Peter Johansson
#
# This file is part of the yat library, http://dev.thep.lu.se/yat
#
# The yat library is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# The yat library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with yat. If not, see .
prefix="@prefix@"
exec_prefix="@exec_prefix@"
bindir="@bindir@"
libdir="@libdir@"
includedir="@includedir@"
installed=no
CXX="@CXX@"
CXXCPP="@CXXCPP@"
CPPFLAGS="@CPPFLAGS@"
CXXFLAGS="@CXXFLAGS@"
LDFLAGS="@LDFLAGS@"
LIBS="@LIBS@"
EXTRA_CPPFLAGS="@EXTRA_CPPFLAGS@"
EXTRA_CXXFLAGS="@EXTRA_CXXFLAGS@"
EXTRA_LDFLAGS="@EXTRA_LDFLAGS@"
LA_FILE="$libdir/lib@YAT_LIBNAME@.la"
if test x$installed = xno; then
LA_FILE="@abs_top_builddir@/yat/lib@YAT_LIBNAME@.la"
fi
usage()
{
cat <.
EOF
exit $1
}
if test $# -eq 0; then
usage 1
fi
flags=""
while test $# -gt 0; do
case "$1" in
--prefix)
@ECHO@ $prefix
exit 0
;;
--bindir)
@ECHO@ $bindir
exit 0
;;
--includedir)
@ECHO@ $includedir
exit 0
;;
--libdir)
@ECHO@ $libdir
exit 0
;;
--cxx)
@ECHO@ $CXX
exit 0
;;
--cxxcpp)
@ECHO@ $CXXCPP
exit 0
;;
--cppflags)
if test $installed = yes; then
flags="$flags -I$includedir"
else
# second part is for VPATH builds. No need to separate the
# cases because redundancy will be removed by unique filtering
# below.
flags="$flags -I@abs_top_srcdir@ -I@abs_top_builddir@"
fi
flags="$flags $EXTRA_CPPFLAGS $CPPFLAGS"
;;
--cxxflags)
flags="$flags $EXTRA_CXXFLAGS $CXXFLAGS"
;;
--libs)
flags="$flags -l@YAT_LIBNAME@ $LIBS"
;;
--ldflags)
flags="$flags -L$libdir $EXTRA_LDFLAGS $LDFLAGS"
;;
--link-libtool)
flags="$flags $LA_FILE"
;;
--atleast-version=*)
optarg=`@ECHO@ "$1" | sed 's/--atleast-version=//'`
min_major=`@ECHO@ "$optarg" | sed 's/\([0-9]*\).*/\1/'`
if test "$optarg" = "$min_major"; then
min_minor="0";
else
min_minor=`@ECHO@ "$optarg" | sed 's/[0-9]*.\([0-9]*\).*/\1/'`
fi
if test "$optarg" = "$min_major.$min_minor"; then
min_patch="0";
else
min_patch=`@ECHO@ "$optarg" | sed 's/[0-9]*.[0-9]*.\([0-9]*\).*/\1/'`
fi
if test "$optarg" = "$min_patch"; then
echo "yat-config: \`$optarg' is not a valid VERSION"
exit 255
fi
if !(test -n "$min_major" && test -n "$min_minor" \
&& test -n "$min_patch"); then
echo "yat-config: \`$optarg' is not a valid VERSION"
exit 255
fi
if ( test $min_major -gt @YAT_MAJOR_VERSION@ || \
( test $min_major -eq @YAT_MAJOR_VERSION@ && \
( test $min_minor -gt @YAT_MINOR_VERSION@ || \
( test $min_minor -eq @YAT_MINOR_VERSION@ && \
( test $min_patch -gt @YAT_PATCH_VERSION@ ||
(test $min_patch -eq @YAT_PATCH_VERSION@ &&
test "@YAT_DEV_BUILD@" = "true" )))))) ; then
exit 1;
fi
exit 0
;;
--version)
@ECHO@ @VERSION@
exit 0
;;
--version-major)
@ECHO@ @YAT_MAJOR_VERSION@
exit 0
;;
--version-minor)
@ECHO@ @YAT_MINOR_VERSION@
exit 0
;;
--version-patch)
@ECHO@ @YAT_PATCH_VERSION@
exit 0
;;
--help)
usage 0
;;
*)
usage 1
;;
esac
# Next please.
shift
done
# only keep last of replicates
if test -n "$flags"; then
reversed_flags=
for opt in $flags; do
reversed_flags="$opt $reversed_flags"
done
unique_flags=
for opt in $reversed_flags; do
unique=1;
for opt2 in $unique_flags; do
if test $opt = $opt2; then
unique=0
fi
done
if test $unique -eq 1; then
unique_flags="$opt $unique_flags"
fi
done
@ECHO@ $unique_flags
fi
exit 0