#!/bin/sh
#
# Configure options script for re-calling GraphicsMagick compilation
# options required to use the GraphicsMagick 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
# effectively in configure scripts.
#
usage='Usage: GraphicsMagick-config [--cflags] [--cppflags] [--exec-prefix] [--ldflags] [--libs] [--prefix] [--version]

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

  "gcc -o example example.c `GraphicsMagick-config --cppflags --cflags --ldflags --libs`"'

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

while test $# -gt 0; do
  case $1 in
    --prefix)
      echo /usr
      ;;
    --exec-prefix)
      echo /usr
      ;;
    --version)
      echo 1.3.46
      ;;
    --cc)
      echo 'gcc'
      ;;
    --cflags)
      echo '-fopenmp -g -O2 -Werror=implicit-function-declaration -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -ffile-prefix-map=/build/graphicsmagick-Px2yaX/graphicsmagick-1.4+really1.3.46=. -flto=auto -ffat-lto-objects -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -mbranch-protection=standard -fdebug-prefix-map=/build/graphicsmagick-Px2yaX/graphicsmagick-1.4+really1.3.46=/usr/src/graphicsmagick-1.4+really1.3.46-2 -Wall'
      ;;
    --cppflags)
      echo '-I/usr/include/GraphicsMagick'
      ;;
    --ldflags)
      echo '-L/usr/lib -Wl,-Bsymbolic-functions -Wl,--package-metadata={%22type%22:%22deb%22%2C%22os%22:%22ubuntu%22%2C%22name%22:%22graphicsmagick%22%2C%22version%22:%221.4+really1.3.46-2%22%2C%22architecture%22:%22arm64%22} -flto=auto -ffat-lto-objects -Wl,-z,relro -Wl,-z,now'
      ;;
    --libs)
      echo '-lGraphicsMagick -lheif -lwmflite -ljxl -ljxl_threads -ltiff -ljbig -lwebpmux -lwebp -lsharpyuv -lfreetype -ljpeg -lpng16 -llcms2 -llcms2_fast_float -llcms2_threaded -lXext -lSM -lICE -lX11 -lxml2 -lzstd -llzma -lbz2 -lz -lm -lpthread -lgomp'
      ;;
    *)
      echo "${usage}" 1>&2
      exit 1
      ;;
  esac
  shift
done
