#!/bin/sh
# Copyright Bob Friesenhahn, 2002-2023
# SPDX-License-Identifier: MIT
#
# 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:

  "/Services/Sofin/exports/ccache /usr/bin/clang++ -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 /Software/Graphicsmagick
      ;;
    --exec-prefix)
      echo /Software/Graphicsmagick
      ;;
    --version)
      echo 1.3.49
      ;;
    --cppflags)
      echo '-I/Software/Graphicsmagick/include/GraphicsMagick'
      ;;
    --cxx)
      echo '/Services/Sofin/exports/ccache /usr/bin/clang++'
      ;;
    --cxxflags)
      echo '-pipe -fuse-ld=lld -ferror-limit=1 -fstack-protector -Wformat -Wformat-security -Wl,-z,relro,-z,now -I/Software/Graphicsmagick/include -w -O3 -fvisibility=default -gdwarf-5 -fPIC -fPIE -Wl,-rpath=/Software/Graphicsmagick/lib,--enable-new-dtags -ftrapv --param ssp-buffer-size=4 -std=c++14 -D_THREAD_SAFE -pthread'
      ;;
    --ldflags)
      echo '-L/Software/Graphicsmagick/lib -z relro -z now -L/Software/Graphicsmagick/lib -pie -L/lib'
      ;;
    --libs)
      echo '-lGraphicsMagick++ -lGraphicsMagick -ltiff -ljbig -lfreetype -ljpeg -lpng16 -lxml2 -llzma -lbz2 -lz -lm -lpthread -lomp'
      ;;
    *)
      echo "${usage}" 1>&2
      exit 1
      ;;
  esac
  shift
done
