1 # Check for MagickWand (ImageMagick)
3 # FC_CHECK_MAGICKWAND([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
5 AC_DEFUN([FC_CHECK_MAGICKWAND],
7 AC_ARG_WITH([magickwand],
8 [ --with-magickwand[=DIR] Imagemagick installation directory (optional)],
9 magickwand_dir="$withval", magickwand_dir="")
12 if test "x$magickwand_dir" = "x" ; then
13 AC_MSG_CHECKING([for MagickWand-config in default path])
15 for i in /usr/local /usr;
17 test -r $i/bin/${host}-MagicWand-config &&
18 WAND_CONFIG_PATH=$i/bin && WAND_CONFIG_NAME=${host}-MagickWand-config &&
22 if test x$WAND_CONFIG_PATH = x ; then
23 for i in /usr/local /usr;
25 test -r $i/bin/MagickWand-config &&
26 WAND_CONFIG_PATH=$i/bin && WAND_CONFIG_NAME=MagickWand-config && break
30 AC_MSG_CHECKING([for MagickWand-config])
32 if test -r $magickwand_dir/${host}-MagickWand-config &&
33 WAND_CONFIG_PATH=$magickwand_dir && WAND_CONFIG_NAME=${host}-MagickWand-config
37 test -r $magickwand_dir/MagickWand-config &&
38 WAND_CONFIG_PATH=$magickwand_dir && WAND_CONFIG_NAME=MagickWand-config
42 if test -z "$WAND_CONFIG_PATH"; then
50 AC_MSG_RESULT([found in $WAND_CONFIG_PATH])
52 AC_MSG_CHECKING([for $WAND_CONFIG_NAME --cflags])
53 WAND_CFLAGS="`$WAND_CONFIG_PATH/$WAND_CONFIG_NAME --cflags`"
54 AC_MSG_RESULT([$WAND_CFLAGS])
56 AC_MSG_CHECKING([for $WAND_CONFIG_NAME --libs])
57 WAND_LIBS="`$WAND_CONFIG_PATH/$WAND_CONFIG_NAME --libs`"
58 AC_MSG_RESULT([$WAND_LIBS])
63 dnl MagickWand uses -lbz2 (at least on opensuse) - test it
65 ac_save_CFLAGS="$CFLAGS"
67 CFLAGS="$CFLAGS $WAND_CFLAGS"
68 LIBS="$WAND_LIBS $LIBS"
70 AC_MSG_CHECKING([for all development tools needed for MagickWand])
71 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <wand/magick_wand.h>]],
72 [MagickWand *mw = NewMagickWand();])], [AC_MSG_RESULT([yes])],
75 AC_MSG_WARN([MagickWand deactivated due to missing development packages.])])
78 dnl reset variables to old values
80 CFLAGS="$ac_save_CFLAGS"
87 if test "x$wand" = "xyes" ; then
88 ifelse([$1], , :, [$1])
90 ifelse([$2], , :, [$2])