#!/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.6.7"
CCFLAGS=" -DP_64BIT=1 -DPTRACING=1 -D_REENTRANT -I/usr/include -I/usr/local/include -I/usr/local/include/SDL -I/usr/local/include -D_GNU_SOURCE=1 -D_REENTRANT -D_THREAD_SAFE    -fno-exceptions"
LDFLAGS=" -Wl,-rpath=/usr/lib:/usr/local/lib"
LIBS=" -lpthread -lrt -L/usr/lib -lssl -lexpat -L/usr/local/lib -L/usr/local/lib -Wl,-rpath,/usr/local/lib -lSDL  -pthread    -lc -lpt"
LIBDIR="${exec_prefix}/lib"
PTINSTDIR="/usr/local/share/ptlib"
MACHTYPE="ia64"
OSTYPE="FreeBSD"
OSRELEASE="901504"
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
