#!/bin/sh
#
# Configure options script for re-calling MagickCore compilation options
# required to use the MagickCore library.
#

prefix=/opt/local/lib/ImageMagick7
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
pkgconfigdir=${libdir}/pkgconfig
export PKG_CONFIG_LIBDIR="${pkgconfigdir}"

usage="\
Usage: MagickCore-config [--cflags] [--cppflags] [--exec-prefix] [--ldflags] [--libs] [--prefix] [--version]"

if test $# -eq 0; then
      echo "${usage}" 1>&2
      echo "Example: gcc \`MagickCore-config --cflags --cppflags\` -o core core.c \`MagickCore-config --ldflags --libs\`" 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
    --prefix=*)
      prefix=$optarg
      ;;
    --prefix)
      echo $prefix
      ;;
    --exec-prefix=*)
      exec_prefix=$optarg
      ;;
    --exec-prefix)
      echo $exec_prefix
      ;;
    --version)
      echo '7.1.2-10 Q16 '
      ;;
    --cc)
      echo '/usr/bin/clang'
      ;;
    --cflags)
      /opt/local/bin/pkg-config --cflags MagickCore-7.Q16
      ;;
    --cxx)
      echo '/usr/bin/clang++ -std=gnu++11 -std=gnu++11'
      ;;
    --cxxflags)
      /opt/local/bin/pkg-config --cflags MagickCore-7.Q16
      ;;
    --cppflags)
      /opt/local/bin/pkg-config --cflags MagickCore-7.Q16
      ;;
    --ldflags)
      /opt/local/bin/pkg-config --libs MagickCore-7.Q16
      ;;
    --libs)
      /opt/local/bin/pkg-config --libs MagickCore-7.Q16
      ;;
    --coder-path)
      echo "/opt/local/lib/ImageMagick7/lib/ImageMagick-7.1.2/modules-Q16/coders"
      ;;
    --filter-path)
      echo "/opt/local/lib/ImageMagick7/lib/ImageMagick-7.1.2/modules-Q16/filters"
      ;;
    *)
      echo "${usage}" 1>&2
      exit 1
      ;;
  esac
  shift
done
