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

prefix=/usr/local
exec_prefix=${prefix}

VERSION="2.10.11"
CCFLAGS=" -DP_64BIT -DPTRACING=1 -D_REENTRANT  -I/usr/include  -I/usr/local/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/X11R6/include -DXTHREADS  -fno-exceptions"
LDFLAGS="-L/usr/local/lib -L/usr/local/lib -L/usr/X11R6/lib"
LIBS=" -lpthread -lsasl2 -lldap -llber -lldap_r -pthread -L/usr/lib -lssl -lcrypto -lexpat   -lSDL  -lc -lpt"
LIBDIR="${exec_prefix}/lib"
PTINSTDIR="/usr/local/share/ptlib"
MACHTYPE="x86_64"
OSTYPE="OpenBSD"
OSRELEASE="201405"
SHAREDLIBEXT="so"

# 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
