#!/bin/sh

#
# This is intended to be the equivalent of gtk-config
# to allow other packages/software that want to locate the
# header/include files and libraries for a ggobi source
#
# --libs
# --cflags
# --version

TOP=/usr
GGOBI_ROOT=/usr/ggobi/
VERSION="1.0-4"

GTK_CONFIG=/usr/bin/gtk-config
PKG_CONFIG=/usr/bin/pkg-config

GTK_CFLAGS="`${GTK_CONFIG} --cflags`"
GTK_LIBS="`${GTK_CONFIG} --libs`"

XML_LIB_DIRS="-L/usr/lib -lxml2 -lz -lpthread -lm"
XML_LIB_DIRS_PATH=""


CFLAGS="-I/usr/include/ggobi ${GTK_CFLAGS} -I/usr/include/libxml2 -DUSE_XML=2 -DSUPPORT_PLUGINS=1 -DSUPPORT_INIT_FILES=1 -DHAVE_GGOBI_CONFIG_H"
# -DHAVE_CONFIG_H contains the HAVE_CONFIG_H which we don't want. We use HAVE_GGOBI_CONFIG_H to avoid
# name conflict ambiguities.

LIBS="-L/usr/lib -lggobi"


usage="
Usage: ggobi-config [option]

Options:
  --cflags
  --libs
  --xml-support
  --xml
  --xml-libs
  --xml-path
  --ld-library-path   
  --home
  --install-dir
"


if test $# -lt 1 ; then
 echo "$usage"
 exit 0
fi


case $1 in
   "--v")
          echo "${VERSION}"
          shift ;;
   "--cflags") 
          echo "${CFLAGS}"
          shift ;;
   "--libs")
        echo "${LIBS}"
        shift ;;
   "--xml-support")
        echo "yes" ;;
   "--xml-libs")
         echo "${XML_LIB_DIRS}"
         shift ;;
   "--xml-path")
         echo "${XML_LIB_DIRS_PATH}"
         shift ;;
   --ld-library-path)
         echo "/tmp/buildd/ggobi-0.99.99.4/lib"
         shift ;;
   --help|-h)
       echo "$usage"
       exit 0;;
   --home)
       echo "$GGOBI_ROOT"
       shift ;;
   --home)
       echo "$TOP"
       shift ;;
   "*") echo "Unrecognized argument $1"
          shift ;;
esac
