mirror of
https://github.com/gryf/wmaker.git
synced 2026-02-16 14:15:46 +01:00
wrlib: grouped the detection of ImageMagick in the CHECK_MAGICK macro
Took the opportunity to expand the WM_LIB_CHECK macro because it is not suited for the case where compilation flags can be queried but was meant for the case when they have to be guessed Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
committed by
Carlos R. Mafra
parent
9a0c3ab737
commit
698cffacc5
25
configure.ac
25
configure.ac
@@ -322,11 +322,6 @@ dnl ==========
|
|||||||
dnl AC_ARG_VAR(PKGCONFIG, [pkg-config command])
|
dnl AC_ARG_VAR(PKGCONFIG, [pkg-config command])
|
||||||
AC_CHECK_PROG(PKGCONFIG, pkg-config, pkg-config)
|
AC_CHECK_PROG(PKGCONFIG, pkg-config, pkg-config)
|
||||||
|
|
||||||
dnl MagickWand-config
|
|
||||||
dnl ==========
|
|
||||||
dnl AC_ARG_VAR(MAGICKWCONFIG, [MagickWand-config command])
|
|
||||||
AC_CHECK_PROG(MAGICKWCONFIG, MagickWand-config, MagickWand-config)
|
|
||||||
|
|
||||||
dnl gettext
|
dnl gettext
|
||||||
dnl =======
|
dnl =======
|
||||||
|
|
||||||
@@ -564,26 +559,6 @@ else
|
|||||||
fi
|
fi
|
||||||
AC_SUBST(FCLIBS)
|
AC_SUBST(FCLIBS)
|
||||||
|
|
||||||
dnl
|
|
||||||
dnl libMagickWand
|
|
||||||
dnl
|
|
||||||
AC_MSG_CHECKING([for libmagickwand header])
|
|
||||||
MAGICKFLAGS=`$MAGICKWCONFIG --cflags`
|
|
||||||
if test "x$MAGICKFLAGS" = "x" ; then
|
|
||||||
AC_MSG_RESULT([not found])
|
|
||||||
else
|
|
||||||
AC_MSG_RESULT([found])
|
|
||||||
fi
|
|
||||||
AC_SUBST(MAGICKFLAGS)
|
|
||||||
|
|
||||||
AC_MSG_CHECKING([for libmagickwand library])
|
|
||||||
MAGICKLIBS=`$MAGICKWCONFIG --ldflags`
|
|
||||||
if test "x$MAGICKLIBS" = "x" ; then
|
|
||||||
AC_MSG_RESULT([not found])
|
|
||||||
else
|
|
||||||
AC_MSG_RESULT([found])
|
|
||||||
fi
|
|
||||||
AC_SUBST(MAGICKLIBS)
|
|
||||||
|
|
||||||
dnl Xft2 antialiased font support
|
dnl Xft2 antialiased font support
|
||||||
dnl =============================
|
dnl =============================
|
||||||
|
|||||||
@@ -259,11 +259,47 @@ AM_CONDITIONAL([USE_XPM], [test "x$enable_xpm" != "xno"])dnl
|
|||||||
# and MAGICKLIBS, and append info to the variable 'supported_gfx'
|
# and MAGICKLIBS, and append info to the variable 'supported_gfx'
|
||||||
# When not found, append info to variable 'unsupported'
|
# When not found, append info to variable 'unsupported'
|
||||||
AC_DEFUN_ONCE([WM_IMGFMT_CHECK_MAGICK],
|
AC_DEFUN_ONCE([WM_IMGFMT_CHECK_MAGICK],
|
||||||
[WM_LIB_CHECK([MAGICK], ["$MAGICKLIBS"], [MagickGetImagePixels], [$XLFLAGS $XLIBS],
|
[AC_REQUIRE([_WM_LIB_CHECK_FUNCTS])
|
||||||
[wm_save_CFLAGS="$CFLAGS $MAGICKLIBS"
|
AS_IF([test "x$enable_magick" = "xno"],
|
||||||
AS_IF([wm_fn_lib_try_compile "wand/magick_wand.h" "" "return 0" ""],
|
[unsupported="$unsupported Magick"],
|
||||||
[],
|
[AC_CHECK_PROG([MAGICKWCONFIG], [MagickWand-config], [MagickWand-config])
|
||||||
[AC_MSG_ERROR([found $CACHEVAR but could not find appropriate header - are you missing libmagickwand package?])])
|
AS_IF([test "x$MAGICKWCONFIG" = "x"],
|
||||||
CFLAGS="$wm_save_CFLAGS"],
|
[AS_IF([test "x$enable_magick" = "xyes"],
|
||||||
[supported_gfx], [GFXLIBS])dnl
|
[AC_MSG_ERROR([explicit Magick support requested but MagickWand-config not found])])
|
||||||
|
enable_magick=no
|
||||||
|
unsupported="$unsupported Magick"],
|
||||||
|
[AC_CACHE_CHECK([for Magick support library], [wm_cv_libchk_magick],
|
||||||
|
[wm_cv_libchk_magick=no
|
||||||
|
wm_cv_libchk_magick_cflags=`$MAGICKWCONFIG --cflags`
|
||||||
|
wm_cv_libchk_magick_libs=`$MAGICKWCONFIG --ldflags`
|
||||||
|
wm_save_LIBS="$LIBS"
|
||||||
|
dnl
|
||||||
|
dnl We check that the library is available
|
||||||
|
AS_IF([wm_fn_lib_try_link "MagickGetImagePixels" "$wm_cv_libchk_magick_libs"],
|
||||||
|
[wm_cv_libchk_magick=maybe])
|
||||||
|
LIBS="$wm_save_LIBS"
|
||||||
|
AS_IF([test "x$enable_magick$wm_cv_libchk_magick" = "xyesno"],
|
||||||
|
[AC_MSG_ERROR([explicit Magick support requested but library does not link])])
|
||||||
|
dnl
|
||||||
|
dnl The library was found, check if header is available and compiles
|
||||||
|
AS_IF([test "x$wm_cv_libchk_magick" != "xno"],
|
||||||
|
[wm_save_CFLAGS="$CFLAGS"
|
||||||
|
AS_IF([wm_fn_lib_try_compile "wand/magick_wand.h" "" "return 0" "$wm_cv_libchk_magick_cflags"],
|
||||||
|
[wm_cv_libchk_magick="$wm_cv_libchk_magick_cflags % $wm_cv_libchk_magick_libs"],
|
||||||
|
[AC_MSG_ERROR([found Magick library but could not compile appropriate header - are you missing libmagickwand-dev package?])])
|
||||||
|
CFLAGS="$wm_save_CFLAGS"])
|
||||||
|
])
|
||||||
|
AS_IF([test "x$wm_cv_libchk_magick" = "xno"],
|
||||||
|
[unsupported="$unsupported Magick"
|
||||||
|
enable_magick="no"],
|
||||||
|
[supported_gfx="$supported_gfx Magick"
|
||||||
|
MAGICKFLAGS=`echo "$wm_cv_libchk_magick" | sed -e 's, *%.*$,,' `
|
||||||
|
MAGICKLIBS=`echo "$wm_cv_libchk_magick" | sed -e 's,^.*% *,,' `
|
||||||
|
AC_DEFINE([USE_MAGICK], [1],
|
||||||
|
[defined when MagickWand library with header was found])])
|
||||||
|
])dnl AS_IF(MAGICKWCONFIG != "")
|
||||||
|
])
|
||||||
|
AM_CONDITIONAL([USE_MAGICK], [test "x$enable_magick" != "xno"])dnl
|
||||||
|
AC_SUBST(MAGICKFLAGS)dnl
|
||||||
|
AC_SUBST(MAGICKLIBS)dnl
|
||||||
]) dnl AC_DEFUN
|
]) dnl AC_DEFUN
|
||||||
|
|||||||
Reference in New Issue
Block a user