#!/bin/sh
#
# Configure options script for re-calling compilation
# options required to use the Magick++ library.
#
# Concept derived from gtk-config in the Gtk package except that Autoconf-style
# configuration information is presented instead so that it may be used more
# effictively in configure scripts.
#
usage='Usage: GraphicsMagick++-config [--cppflags] [--cxx] [--cxxflags] [--exec-prefix] [--ldflags] [--libs] [--prefix] [--version]

 For example, "example.cpp" may be compiled to produce "example" as follows:

  "clang++ -std=gnu++11 -std=gnu++11 -o example example.cpp `GraphicsMagick++-config --cppflags --cxxflags --ldflags --libs`"'

if test $# -eq 0; then
      echo "${usage}" 1>&2
      exit 1
fi

while test $# -gt 0; do
  case $1 in
    --prefix)
      echo @@HOMEBREW_CELLAR@@/graphicsmagick/1.3.47
      ;;
    --exec-prefix)
      echo @@HOMEBREW_CELLAR@@/graphicsmagick/1.3.47
      ;;
    --version)
      echo 1.3.47
      ;;
    --cppflags)
      echo '-I@@HOMEBREW_CELLAR@@/graphicsmagick/1.3.47/include/GraphicsMagick'
      ;;
    --cxx)
      echo 'clang++ -std=gnu++11 -std=gnu++11'
      ;;
    --cxxflags)
      echo '-D_THREAD_SAFE'
      ;;
    --ldflags)
      echo '-L@@HOMEBREW_CELLAR@@/graphicsmagick/1.3.47/lib -L@@HOMEBREW_PREFIX@@/opt/zstd/lib -L@@HOMEBREW_PREFIX@@/opt/little-cms2/lib -L@@HOMEBREW_PREFIX@@/opt/libpng/lib -L@@HOMEBREW_PREFIX@@/opt/jpeg-turbo/lib -L@@HOMEBREW_PREFIX@@/opt/freetype/lib -L@@HOMEBREW_PREFIX@@/opt/webp/lib -L@@HOMEBREW_PREFIX@@/opt/libtiff/lib -L@@HOMEBREW_PREFIX@@/opt/jpeg-xl/lib -L@@HOMEBREW_PREFIX@@/opt/libheif/lib -L@@HOMEBREW_PREFIX@@/opt/jasper/lib'
      ;;
    --libs)
      echo '-lGraphicsMagick++ -lGraphicsMagick -llcms2 -lfreetype -lbz2 -lz -lltdl -lm -lpthread'
      ;;
    *)
      echo "${usage}" 1>&2
      exit 1
      ;;
  esac
  shift
done
