configure: improve libheif detection and output.

Replace the "Heif >= 1.4.0" line in the summary output by a comment in
the "Heif" line explaining this is about profile support.

Also add a >= 1.6.0 test and output a warning for Windows and macOS (cf.
bug #4185).
This commit is contained in:
Jehan
2019-11-12 14:48:26 +01:00
parent 1032632e63
commit 41285813a5

View File

@ -1789,27 +1789,45 @@ AM_CONDITIONAL(HAVE_WEBP, test "x$have_webp" = xyes)
AC_ARG_WITH(libheif, [ --without-libheif build without libheif support]) AC_ARG_WITH(libheif, [ --without-libheif build without libheif support])
have_libheif=no have_libheif=no
have_libheif_1_4_0=no
have_libheif_1_6_0=no
if test "x$with_libheif" != xno; then if test "x$with_libheif" != xno; then
have_libheif_1_4_0=yes have_libheif_1_4_0=yes
have_libheif_1_6_0=yes
have_libheif=yes have_libheif=yes
PKG_CHECK_MODULES(LIBHEIF, libheif >= 1.4.0,, PKG_CHECK_MODULES(LIBHEIF, libheif >= 1.6.0,,
[have_libheif_1_4_0="no (libheif >= 1.4.0 not found)"]) [
PKG_CHECK_MODULES(LIBHEIF, libheif >= libheif_required_version, have_libheif_1_6_0="no (libheif >= 1.6.0 not found)"
FILE_HEIF='file-heif$(EXEEXT)', PKG_CHECK_MODULES(LIBHEIF, libheif >= 1.4.0,,
[have_libheif="no (libheif not found)"]) [
fi have_libheif_1_4_0="no (libheif >= 1.4.0 not found)"
PKG_CHECK_MODULES(LIBHEIF, libheif >= libheif_required_version,
if test "x$have_libheif" = xyes; then FILE_HEIF='file-heif$(EXEEXT)',
MIME_TYPES="$MIME_TYPES;image/heif;image/heic" [have_libheif="no (libheif not found)"])
])
])
fi fi
AC_SUBST(FILE_HEIF) AC_SUBST(FILE_HEIF)
AM_CONDITIONAL(HAVE_LIBHEIF, test "x$have_libheif" = xyes) AM_CONDITIONAL(HAVE_LIBHEIF, test "x$have_libheif" = xyes)
if test "x$have_libheif" = xyes; then
MIME_TYPES="$MIME_TYPES;image/heif;image/heic"
have_libheif="yes [[profile support: $have_libheif_1_4_0]]"
fi
if test "x$have_libheif_1_4_0" = xyes; then if test "x$have_libheif_1_4_0" = xyes; then
AC_DEFINE(HAVE_LIBHEIF_1_4_0, 1, AC_DEFINE(HAVE_LIBHEIF_1_4_0, 1,
[Define to 1 if libheif >= 1.4.0 is available]) [Define to 1 if libheif >= 1.4.0 is available])
fi fi
if test "x$have_libheif_1_6_0" = xyes; then
AC_DEFINE(HAVE_LIBHEIF_1_6_0, 1,
[Define to 1 if libheif >= 1.6.0 is available])
elif test "x$platform_win32" = xyes || test "x$platform_osx" = xyes; then
warning_libheif="
WARNING: libheif lower than version 1.6.0 are known to crash when
exporting on Windows and macOS (bug #4185). Please update."
fi
######################## ########################
@ -3134,7 +3152,6 @@ Optional Plug-Ins:
OpenEXR: $have_openexr OpenEXR: $have_openexr
WebP: $have_webp WebP: $have_webp
Heif: $have_libheif Heif: $have_libheif
Heif >= 1.4.0: $have_libheif_1_4_0
PDF (export): $have_cairo_pdf PDF (export): $have_cairo_pdf
Print: $enable_print Print: $enable_print
Python 3 plug-ins: $with_python Python 3 plug-ins: $with_python
@ -3158,7 +3175,7 @@ Tests:
Test desktop file $have_desktop_file_validate Test desktop file $have_desktop_file_validate
Bug report URL: $with_bug_report_url Bug report URL: $with_bug_report_url
$override_bug_report_url$warning_vector_icons_windows$warning_glib_networking$warning_gcc$warning_python$warning_javascript$warning_lua" $override_bug_report_url$warning_vector_icons_windows$warning_glib_networking$warning_gcc$warning_python$warning_javascript$warning_lua$warning_libheif"
if test "x$required_deps" = "x"; then if test "x$required_deps" = "x"; then
AC_OUTPUT AC_OUTPUT