#!/bin/sh
################################################################################
# PhotoSpline configuration script
#
# This script can be used to set up the user environment when the PhotoSpline
# software is installed to some central location.
# $Id: $
################################################################################

# No argument: print help
if [ $# -eq 0 ]; then
  sh $0 --help
  exit 1
fi

# Some useful variables
prefix=/tmp/tmps9v68jn6/wheel/platlib
bindir=$prefix/bin
libdir=$prefix/.
incdir=$prefix/../headers

# Usage function
usage()
{
    cat <<EOF 1>&2

Photospline software configuration tool.

Usage: $0 [options]

Options:
    --prefix      show PhotoSpline installation prefix
    --libs        print library linking information
    --cflags      print pre-processor and compiler flags
    --help        print this help message and exit
    --version     output version information

EOF
    exit $1
}

for opt; do
  case $opt in
    --help)
      usage 0
      ;;
    --prefix)
      echo $prefix
      ;;
    --version)
      echo "2.4.1"
      ;;
    --cflags)
      echo " -DPHOTOSPLINE_VERSION=2.4.1 -I/tmp/downloads/local/include -I$incdir"
      ;;
    --libs)
      echo "-L$libdir -lphotospline /tmp/downloads/local/lib64/libcfitsio.so"
      ;;
    *)
      echo "Unknown option $opt " 2>&1
      usage 1
      ;;
  esac
done

