mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 04:20:27 +01:00
configure: rewrote the detection for WebP image library
Unfortunately, the detection was broken because the header is using a hack on the function name to provide compatibility between different versions of the API, which means the usual link test, which uses a known name of a symbol, cannot work without also using the header to get the hack applied on the function's name. The new detection mechanism now simply check for both header and link at the same time, so we're probably safe until a Major API change is decided, in which case we will also have to update WRaster's code anyway. Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
committed by
Carlos R. Mafra
parent
7d6ecb51f6
commit
e1146e56e0
@@ -187,14 +187,34 @@ AC_DEFUN_ONCE([WM_IMGFMT_CHECK_TIFF],
|
|||||||
# the variable 'supported_gfx'
|
# 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_WEBP],
|
AC_DEFUN_ONCE([WM_IMGFMT_CHECK_WEBP],
|
||||||
[WM_LIB_CHECK([WEBP], ["-lwebp"], [VP8DecodeLayer], [$XLFLAGS $XLIBS],
|
[AS_IF([test "x$enable_webp" = "xno"],
|
||||||
[wm_save_CFLAGS="$CFLAGS"
|
[unsupported="$unsupported WebP"],
|
||||||
AS_IF([wm_fn_lib_try_compile "webp/decode.h" "" "return 0" ""],
|
[AC_CACHE_CHECK([for WebP support library], [wm_cv_imgfmt_webp],
|
||||||
[],
|
[wm_cv_imgfmt_webp=no
|
||||||
[AC_MSG_ERROR([found $CACHEVAR but could not find appropriate header - are you missing libwebp-dev package?])])
|
dnl
|
||||||
CFLAGS="$wm_save_CFLAGS"],
|
dnl The library is using a special trick on the functions to provide
|
||||||
[supported_gfx], [GFXLIBS])dnl
|
dnl compatibility between versions, so we cannot try linking against
|
||||||
]) dnl AC_DEFUN
|
dnl a symbol without first using the header to handle it
|
||||||
|
wm_save_LIBS="$LIBS"
|
||||||
|
LIBS="$LIBS -lwebp"
|
||||||
|
AC_TRY_LINK(
|
||||||
|
[@%:@include <webp/decode.h>],
|
||||||
|
[WebPGetFeatures(NULL, 1024, NULL);],
|
||||||
|
[wm_cv_imgfmt_webp="-lwebp"])
|
||||||
|
LIBS="$wm_save_LIBS"
|
||||||
|
AS_IF([test "x$enable_webp$wm_cv_imgfmt_webp" = "xyesno"],
|
||||||
|
[AC_MSG_ERROR([explicit WebP support requested but no library found])])dnl
|
||||||
|
])
|
||||||
|
AS_IF([test "x$wm_cv_imgfmt_webp" = "xno"],
|
||||||
|
[unsupported="$unsupported WebP"
|
||||||
|
enable_webp="no"],
|
||||||
|
[supported_gfx="$supported_gfx WebP"
|
||||||
|
WM_APPEND_ONCE([$wm_cv_imgfmt_webp], [GFXLIBS])dnl
|
||||||
|
AC_DEFINE([USE_WEBP], [1],
|
||||||
|
[defined when valid Webp library with header was found])])dnl
|
||||||
|
])
|
||||||
|
AM_CONDITIONAL([USE_WEBP], [test "x$enable_webp" != "xno"])dnl
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
# WM_IMGFMT_CHECK_XPM
|
# WM_IMGFMT_CHECK_XPM
|
||||||
|
|||||||
Reference in New Issue
Block a user