#!/bin/sh
# $Id: yaz-config.in,v 1.23 2005/09/09 10:34:09 adam Exp $
yaz_echo_help=no

usage()
{
	cat <<EOF
Usage: yaz-config [OPTIONS] [LIBRARIES]
Options:
	[--prefix[=DIR]]
	[--version]
	[--libs]
	[--lalibs]
	[--cflags]
	[--comp]
EOF
	exit $1
}

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

  case $1 in
    --prefix=*)
      yazprefix=$optarg
      ;;
    --prefix)
      echo "/usr"
      exit 0
      ;;
    --version)
      echo "2.1.10"
      exit 0
      ;;
    --cflags)
      echo "-I/usr/include  -DYAZ_POSIX_THREADS=1 -D_REENTRANT"
      ;;
    --libs)
      echo "-L/usr/lib -lyaz -lxml2 -lz -lm  -lssl -lcrypto -ldl   -lwrap -lnsl -lpthread"
      ;;
    --lalibs)
      echo "/usr/lib/libyaz.la -lxml2 -lz -lm  -lssl -lcrypto -ldl   -lwrap -lnsl -lpthread"
      ;;
    --comp)
      echo "/usr/bin/yaz-asncomp"
      ;;
    -*)
      yaz_echo_help=yes
      ;;
  esac
  shift
done

if test "$yaz_echo_help" = "yes"; then
	usage 1 1>&2
fi
