#!/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 /mingw64
      ;;
    --exec-prefix)
      echo /mingw64
      ;;
    --version)
      echo 1.3.45
      ;;
    --cc)
      echo 'gcc'
      ;;
    --cflags)
      echo '-fopenmp -march=nocona -msahf -mtune=generic -O2 -pipe -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wp,-D__USE_MINGW_ANSI_STDIO=1 -Wall'
      ;;
    --cppflags)
      echo '-I/mingw64/include/GraphicsMagick -D_DLL -D_MT'
      ;;
    --ldflags)
      echo '-L/mingw64/lib '
      ;;
    --libs)
      echo '-lGraphicsMagick -llcms2 -llcms2_fast_float -lfreetype -lbz2 -lz -lltdl -lgdi32 -luser32 -lm -lpthread -lgomp'
      ;;
    *)
      echo "${usage}" 1>&2
      exit 1
      ;;
  esac
  shift
done
