#!/bin/sh
#
# $Id: redland-src-config.in,v 1.8 2003/08/20 23:19:21 cmdjb Exp $
#
# Copyright (C) 2002 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.
# 
# 
#

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

known values for OPTION are:

  --libs                print library linking information
  --static-libs         print static 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
    --version)
      echo @VERSION@
      exit 0
      ;;
    --cflags)
      echo_cflags=yes
      ;;
    --libs)
      echo_libs=yes
      ;;
    --static-libs)
      echo_static_libs=yes
      ;;
    --usage)
      usage 0 1>&2
      ;;
    *)
      usage 1 1>&2
      ;;
  esac

  shift
done
  

if test ! -r @abs_top_builddir@/raptor/raptor-src-config; then
  echo "redland-src-config: Source tree not configured - no raptor-src-config, exiting" 1>&2
  exit 0
fi

if test "$echo_cflags" = "yes"; then
  echo -I@abs_top_srcdir@/librdf `@abs_top_builddir@/raptor/raptor-src-config --cflags`
fi
if test "$echo_libs" = "yes"; then
  echo -L@abs_top_builddir@/librdf/.libs -lrdf  @LIBRDF_LDFLAGS@ @LIBRDF_LIBS@ `@abs_top_builddir@/raptor/raptor-src-config --libs`
fi
if test "$echo_static_libs" = "yes"; then
  echo @abs_top_builddir@/librdf/.libs/librdf.a @LIBRDF_LDFLAGS@ @LIBRDF_LIBS@ `@abs_top_builddir@/raptor/raptor-src-config --static-libs`
fi
