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

  "x86_64-tizen-linux-gnu-clang -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.45
      ;;
    --cc)
      echo 'x86_64-tizen-linux-gnu-clang'
      ;;
    --cflags)
      echo '-Os -fstack-protector -Wno-unused-command-line-argument -Wno-error=unused-but-set-variable -Wno-error=unused-command-line-argument -ffunction-sections -fdata-sections -Wl,--gc-sections -fno-dwarf2-cfi-asm -fno-asynchronous-unwind-tables -fno-unwind-tables -fomit-frame-pointer -fno-ident -fno-common -fno-jump-tables -fno-unroll-loops -momit-leaf-frame-pointer -g2 -gdwarf-4 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -Wformat -Wformat-security -fmessage-length=0 -frecord-gcc-switches -fdiagnostics-color=never -m64 -march=nehalem -msse4.2 -mfpmath=sse -fasynchronous-unwind-tables -fno-omit-frame-pointer -g -Wall'
      ;;
    --cppflags)
      echo '-I/usr/include/GraphicsMagick'
      ;;
    --ldflags)
      echo '-L/usr/lib64 -Wl,-z,relro,--as-needed'
      ;;
    --libs)
      echo '-lGraphicsMagick -lz -lltdl -lm -lpthread'
      ;;
    *)
      echo "${usage}" 1>&2
      exit 1
      ;;
  esac
  shift
done
