#!/bin/sh
#
# $Id: raptor-config.in,v 1.5 2003/09/04 21:52:12 cmdjb Exp $
#
# Copyright (C) 2002-2003 David Beckett - http://purl.org/net/dajobe/
# Institute for Learning and Research Technology - http://www.ilrt.org/
# University of Bristol - http://www.bristol.ac.uk/
# 
# This package is Free Software or Open Source available under the
# following licenses (these are alternatives):
#   1. GNU Lesser General Public License (LGPL)
#   2. GNU General Public License (GPL)
#   3. Mozilla Public License (MPL)
# 
# See LICENSE.html or LICENSE.txt at the top of this package for the
# full license terms.
# 
# 
#

prefix=/usr
exec_prefix=/usr

if test "/usr/include" != /usr/include ; then
  includes=""
else
  includes=
fi


usage()
{
	cat<<EOF
Usage: raptor-config [OPTION]

known values for OPTION are:

  --prefix[=DIR]        change raptor prefix [default $prefix]
  --libs                print library linking information
  --libtool-libs        print linking information for use with libtool
  --cflags		print pre-processor and compiler flags
  --help                display this help and exit
  --version             output version information
  --version-decimal     output version as a decimal integer
EOF
  exit $1
}


if test $# -eq 0; then
  usage 1 1>&2
fi


while test $# -gt 0; do
  case "$1" in
    -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
    *) optarg= ;;
  esac

  case $1 in
    --prefix=*)
        prefix=$optarg
        ;;
    --prefix)
      echo_prefix=yes
      ;;
    --version)
      echo 1.0.0
      exit 0
      ;;
    --version-decimal)
      echo 10000
      exit 0
      ;;
    --cflags)
      echo_cflags=yes
      ;;
    --libs)
      echo_libs=yes
      ;;
    --libtool-libs)
      echo_libtool_libs=yes
      ;;
    --usage)
      usage 0 1>&2
      ;;
    *)
      usage 1 1>&2
      ;;
  esac

  shift
done
  

if test "$echo_prefix" = "yes"; then
  echo $prefix
fi
if test "$echo_cflags" = "yes"; then
  echo $includes
fi
if test "$echo_libs" = "yes"; then
  echo  -lraptor   -lxml2 -lz -lpthread -lm
fi
if test "$echo_libtool_libs" = "yes"; then
  echo /usr/lib/libraptor.la
fi
