---
ChangeLog | 4 ++++
configure.ac | 23 +++++++++++++++++++++--
2 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 596ad39..f62ded0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2011-09-15 Guillaume Lazzara <z(a)lrde.epita.fr>
+ * configure.ac: Handle both GraphicsMagick and ImageMagick.
+
+2011-09-15 Guillaume Lazzara <z(a)lrde.epita.fr>
+
* distrib/macports/Portfile.in: Use -fno-strict-aliasing flag for
Mac OS X Lion.
diff --git a/configure.ac b/configure.ac
index 2563153..670727b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -209,8 +209,27 @@ OLN_WITH_LIB([CFITSIO], [fitsio.h], [cfitsio])
# Magick++. #
# ---------- #
-OLN_WITH_LIB_PKG_CONFIG([Magick++], [Magick++.h], [Magick++], [magickxx],
- [MAGICKXX], [], [ImageMagick++])
+OLN_WITH_LIB_PKG_CONFIG([ImageMagick++], [Magick++.h], [Magick++],
+ [imagemagickxx], [IMAGEMAGICKXX])
+
+OLN_WITH_LIB_PKG_CONFIG([GraphicsMagick++], [Magick++.h], [Magick++],
+ [graphicsmagickxx], [GRAPHICSMAGICKXX])
+
+# If both ImageMagick and GraphicsMagic are available, choose the
+# former by default. (Use `--with-imagemagickxx=no' to ignore an
+# installation of ImageMagick and let configure try GraphicsMagick).
+if test "x$oln_have_imagemagickxx"; then
+ MAGICKXX_CPPFLAGS=$IMAGEMAGICKXX_CPPFLAGS
+ MAGICKXX_LDFLAGS=$IMAGEMAGICKXX_LDFLAGS
+else
+ MAGICKXX_CPPFLAGS=$GRAPHICSMAGICKXX_CPPFLAGS
+ MAGICKXX_LDFLAGS=$GRAPHICSMAGICKXX_LDFLAGS
+fi
+AC_SUBST([MAGICKXX_CPPFLAGS])
+AC_SUBST([MAGICKXX_LDFLAGS])
+AM_CONDITIONAL([HAVE_MAGICKXX],
+ [test "x$oln_have_imagemagickxx" = xyes \
+ || test "x$oln_have_graphicsmagickxx" = xyes])
# ---- #
# Qt. #
--
1.7.2.5