#!/bin/sh
# config/vigra-config.  Generated from vigra-config.in by configure.

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

usage()
{
  if test -z '  -lfftw3 -lm  '; then
    fftwstatus=" (not configured)"
    fftwflags=" (fftw not configured)"
  else
    fftwflags=" and fftw"
  fi

  cat <<EOF
Usage: $0 [OPTIONS]
Options:
    [--version]      output version ("1.5.0")
    [--target]       output platform this VIGRA library was configured for
    [--impex-lib]    output flags for linking libvigraimpex
    [--fftw-lib]     output flags for linking libfftw$fftwstatus
    [--rfftw-lib]    output flags for linking librfftw and libfftw$fftwstatus
    [--cppflags]     output include flags for vigra$fftwflags
    [--include-path] output path to VIGRA includes
    [--docdir]       output path to VIGRA documentation
   ([--libs]         synonym for --impex-lib)
EOF
    exit $1
}

echopath()
{
    echo "$1" \
    | sed "s,\$[({]exec_prefix[})],${prefix}," \
    | sed "s,\$[({]prefix[})],/usr,"
}

if test $# -eq 0; then
    echo "ERROR: no parameters given!" 1>&2
    usage 1 1>&2
fi

try=false

while test $# -gt 0; do
  case $1 in
    --version)
      echo 1.5.0
      ;;
    --target|--platform)
      echo i486-slackware-linux-gnu
      ;;
    --cppflags|--cxxincludes|--cxxflags|--cincludes|--cflags)
      echopath '-I${prefix}/include'
      ;;
    --impex_lib|--impex-lib|--libs)
      echopath '-L${exec_prefix}/lib -lvigraimpex   -lpng12    -ljpeg   -ltiff -lm '
      ;;
    --fftw_lib|--fftw-lib)
      if test -z '  -lfftw3 -lm  '; then
        echo "VIGRA was configured without fftw switches, libpath unknown!" 1>&2
      else
        echopath '  -lfftw3 -lm  '
      fi
      ;;
    --rfftw_lib|--rfftw-lib)
      if test -z '@RFFTW_LIB@'; then
        echo "VIGRA was configured without fftw switches, libpath unknown!" 1>&2
      else
        echopath '@RFFTW_LIB@'
      fi
      ;;
    --include_path|--include-path|--includepath)
      echopath '${prefix}/include'
      ;;
    --docdir)
      echopath '${prefix}/doc/vigra'
      ;;
    --help|-h|-?)
      usage 0 1>&2
      ;;
    --try)
      try=true
      ;;
    *)
      if $try; then
        exit 2
      else
        echo "ERROR: unknown parameter '$1'!"
        usage 2 1>&2
      fi
      ;;
  esac
  shift
done
