#!/bin/sh
#
# $Id: redland-config.in,v 1.5 2002/04/25 17:13:32 cmdjb Exp $
#
# Copyright (C) 2000-2001 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/local
exec_prefix=${prefix}
exec_prefix_set=no

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]
  --exec-prefix[=DIR]   change redland exec prefix [default $exec_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
        if test $exec_prefix_set = no ; then
          exec_prefix=$optarg
        fi
        ;;
    --prefix)
      echo_prefix=yes
      ;;
    --exec-prefix=*)
      exec_prefix=$optarg
      exec_prefix_set=yes
      ;;
    --exec-prefix)
      echo_exec_prefix=yes
      ;;
    --version)
      echo 0.9.11
      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_exec_prefix" = "yes"; then
  echo $exec_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/local/lib -L/usr/local/lib -L/usr/local/lib -lwwwxml -lxmltok -lxmlparse -lwwwzip -lwwwinit -lwwwapp -lwwwhtml -lwwwtelnet -lwwwnews -lwwwhttp -lwwwmime -lwwwgopher -lwwwftp -lwwwfile -lwwwdir -lwwwcache -lwwwstream -lwwwmux -lwwwtrans -lwwwcore -lwwwutils -lmd5 -ldl -lz -lexpat -L/usr/local/lib -lxml2 -lz -L/usr/local/lib -liconv -lm -L/usr/local/lib -lcrypto  -ldb2 -L/usr/local/lib -lwwwxml -lxmltok -lxmlparse -lwwwzip -lwwwinit -lwwwapp -lwwwhtml -lwwwtelnet -lwwwnews -lwwwhttp -lwwwmime -lwwwgopher -lwwwftp -lwwwfile -lwwwdir -lwwwcache -lwwwstream -lwwwmux -lwwwtrans -lwwwcore -lwwwutils -lmd5 -ldl -lz
fi
