#!/bin/sh
#
# Shamelessly ripped from imlib-config that was 
# apparently shamelessly ripped from gtk's gtk-config.in
#

prefix=@prefix@
exec_prefix=@exec_prefix@

VERSION="@PTLIB_VERSION@"
CCFLAGS="@STDCCFLAGS@"
LDFLAGS="@LDFLAGS@"
LIBS="@ENDLDLIBS@ -lpt"
LIBDIR="@LIBDIR@"
PTINSTDIR="@prefix@/share/ptlib"
MACHTYPE="@MACHTYPE@"
OSTYPE="@OSTYPE@"
OSRELEASE="@OSRELEASE@"
SHAREDLIBEXT="@SHAREDLIBEXT@"

# usage="Usage: ptlib-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--libs] [--cflags]"
usage="Usage: ptlib-config [--version] [--ptlibdir] [--ccflags] [--ldflags] [--libs] [--machtype] [--ostype] [--osrelease] [--sharedlibext] [--prefix] [--libdir]"

if test $# -eq 0; then
      echo "${usage}" 1>&2
      exit 1
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
      ;;
    --ptlibdir)
      echo $PTINSTDIR
      ;;
    --ldflags)
      echo $LDFLAGS
      ;;
    --ccflags)
      echo $CCFLAGS
      ;;
    --libs)
      echo $LIBS
      ;;
    --machtype)
      echo $MACHTYPE
      ;;
    --ostype)
      echo $OSTYPE
      ;;
    --osrelease)
      echo $OSRELEASE
      ;;
    --sharedlibext)
      echo $SHAREDLIBEXT
      ;;
    --prefix)
      echo $prefix
      ;;
    --libdir)
      echo $LIBDIR
      ;;
    --all)
      echo VERSION      = $VERSION
      echo PTLIBDIR     = $PTINSTDIR
      echo LDFLAGS      = $LDFLAGS
      echo CCFLAGS      = $CCFLAGS
      echo LIBS         = $LIBS
      echo MACHTYPE     = $MACHTYPE
      echo OSTYPE       = $OSTYPE
      echo OSRELEASE    = $OSRELEASE
      echo SHAREDLIBEXT = $SHAREDLIBEXT
      echo PREFIX       = $prefix
      echo LIBDIR       = $LIBDIR
      ;;

    *)
      echo "${usage}" 1>&2
      exit 1
      ;;
  esac
  shift
done

exit 0
