#!/bin/sh
#
# $Id: redland-config.in,v 1.12 2004/07/12 10:03:45 cmdjb Exp $
#
# Copyright (C) 2000-2004 David Beckett - http://purl.org/net/dajobe/
# Institute for Learning and Research Technology - http://www.ilrt.bris.ac.uk/
# 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=${prefix}

if test "${prefix}/include" != /usr/include ; then
  includes="-I${prefix}/include"
else
  includes=
fi


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

known values for OPTION are:

  --prefix[=DIR]        change redland prefix [default $prefix]

  --cflags              print pre-processor and compiler flags
  --help                display this help and exit
  --libs                print library linking information
  --libtool-libs        print linking information for use with libtool
  --swig                display the SWIG interface file
  --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 0.9.18
      exit 0
      ;;

    --version-decimal)
      echo 918
      exit 0
      ;;

    --cflags)
      echo_cflags=yes
      ;;

    --libs)
      echo_libs=yes
      ;;

    --libtool-libs)
      echo_libtool_libs=yes
      ;;

    --swig)
      echo_swig=yes
      ;;

    --help|--usage)
      usage 0
      ;;
    *)
      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${exec_prefix}/lib -lrdf  -L/usr/lib -lrasqal -L/usr/lib -lraptor -L/usr/lib -lcurl -lidn -lssl -lcrypto -ldl -lssl -lcrypto -ldl -lz -L/usr/lib -lxml2 -lz -lpthread -lm -L/usr/lib -lraptor -L/usr/lib -lcurl -lidn -lssl -lcrypto -ldl -lssl -lcrypto -ldl -lz -L/usr/lib -lxml2 -lz -lpthread -lm    -ldb-4.2 -lcrypto
fi

if test "$echo_libtool_libs" = "yes"; then
  echo ${exec_prefix}/lib/librdf.la
fi

if test "$echo_swig" = "yes"; then  
  echo ${prefix}/share/redland/Redland.i
fi
