#!/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:

  "mipsel-openwrt-linux-gnu-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 /opt
      ;;
    --exec-prefix)
      echo /opt
      ;;
    --version)
      echo 1.3.45
      ;;
    --cc)
      echo 'mipsel-openwrt-linux-gnu-gcc'
      ;;
    --cflags)
      echo '-O2 -pipe -mno-branch-likely -mips32r2 -mtune=mips32r2 -fno-caller-saves -fhonour-copts -msoft-float -flto=auto -fno-fat-lto-objects -Wall -pthread'
      ;;
    --cppflags)
      echo '-I/opt/include/GraphicsMagick'
      ;;
    --ldflags)
      echo '-L/opt/lib -Wl,--dynamic-linker=/opt/lib/ld.so.1 -Wl,-rpath=/opt/lib -L/opt/lib -fuse-ld=bfd -flto=auto -fuse-linker-plugin -L/opt/lib'
      ;;
    --libs)
      echo '-lGraphicsMagick -lfreetype -lz -lltdl -lm -lpthread'
      ;;
    *)
      echo "${usage}" 1>&2
      exit 1
      ;;
  esac
  shift
done
