#!/bin/sh
#
# Configure options script for re-calling ImageMagick compilation
# options required to use the ImageMagick 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.
#
prefix=/usr/local
prefix_set=no
exec_prefix=${prefix}
exec_prefix_set=no

usage="\
Usage: Magick-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--cppflags] [--ldflags] [--libs]"

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

while test $# -gt 0; do
  case "$1" in
  -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  *) optarg= ;;
  esac

  case $1 in
    --prefix=*)
      prefix=$optarg
      prefix_set=yes
      if test $exec_prefix_set = no ; then
        exec_prefix=$optarg
      fi
      ;;
    --prefix)
      echo $prefix
      ;;
    --exec-prefix=*)
      exec_prefix=$optarg
      exec_prefix_set=yes
      ;;
    --exec-prefix)
      echo $exec_prefix
      ;;
    --version)
      echo 5.2.2
      ;;
    --cflags)
      echo '-O2 -pipe'
      ;;
    --cppflags)
      if test $prefix_set = yes
      then
	echo "-I$prefix/include -DHAVE_CONFIG_H "'-I/usr/local/include -I/usr/local/include -I/usr/X11R6/include'
      else
	echo "-DHAVE_CONFIG_H -I/usr/local/include -I/usr/local/include -I/usr/X11R6/include"
      fi
      ;;
    --ldflags)
      if test $exec_prefix_set = yes || test $prefix_set = yes
      then
	echo "-L$exec_prefix/lib "'-L/usr/local/lib -L/usr/local/lib -L/usr/X11R6/lib'
      else
	echo '-L/usr/local/lib -L/usr/local/lib -L/usr/X11R6/lib'
      fi
      ;;
    --libs)
      echo '-L/usr/local/lib -lMagick -ljbig  -ltiff -lttf -ljpeg -lpng   -lXext -lXt  -lSM -lICE -lX11  -lbz2 -lz    -lm'
      ;;
    *)
      echo "${usage}" 1>&2
      exit 1
      ;;
  esac
  shift
done

