#!/bin/sh
#
# $Id: redland-config.in,v 1.3 2003/06/24 15:54:54 cmdjb Exp $
#
# Copyright (C) 2000-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=@prefix@
exec_prefix=@exec_prefix@

if test "@includedir@" != /usr/include ; then
  includes="-I@includedir@"
else
  includes=
fi


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

known values for OPTION are:

  --prefix[=DIR]        change redland prefix [default $prefix]
  --libs                print library linking information
  --cflags              print pre-processor and compiler flags
  --help                display this help and exit
  --version             output version information
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 @VERSION@
      exit 0
      ;;
    --cflags)
      echo_cflags=yes
      ;;
    --libs)
      echo_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 -L@libdir@ -lrdf @LIBRDF_LDFLAGS@ @LIBRDF_LIBS@
fi
