#! /bin/sh
#
# Copyright (C) 2004 - 2007 Bojan Smojver, Rexursive
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 2.1 of the License, or (at your
# option) any later version.
#
# This program 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 Lesser General Public License
# for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# 

USAGE="usage: `basename $0` --variable
variables: prefix,bindir,libdir,libexecdir,includedir,docdir,
           apxs,aprconfig,apuconfig,apreq2config,xml2config,
           cflags,libs,cflags-only-I,libs-only-L,libs-only-l"

if test $# -eq 0; then
  echo "$USAGE"
  exit 1
fi

while test $# -gt 0; do
  case "$1" in 
    --prefix|--exec_prefix|--datarootdir|--bindir|--libdir|--libexecdir|--includedir|--docdir|--apxs|--aprconfig|--apuconfig|--apreq2config|--xml2config)
      var="`echo $1 | cut -c 3-`"
      echo "`pkg-config --variable=${var} mod_spin`"
    ;;
    --cflags|--cflags-only-I|--libs|--libs-only-L|--libs-only-l)
      echo "`pkg-config $1 mod_spin`"
    ;;
    *)
      echo "$USAGE" 
      exit 1
    ;;
  esac
  shift
done

exit 0
