Lines 187-201
Link Here
|
187 |
# the variable 'supported_gfx' |
187 |
# the variable 'supported_gfx' |
188 |
# When not found, append info to variable 'unsupported' |
188 |
# When not found, append info to variable 'unsupported' |
189 |
AC_DEFUN_ONCE([WM_IMGFMT_CHECK_WEBP], |
189 |
AC_DEFUN_ONCE([WM_IMGFMT_CHECK_WEBP], |
190 |
[WM_LIB_CHECK([WEBP], ["-lwebp"], [VP8DecodeLayer], [$XLFLAGS $XLIBS], |
190 |
[AS_IF([test "x$enable_webp" = "xno"], |
191 |
[wm_save_CFLAGS="$CFLAGS" |
191 |
[unsupported="$unsupported WebP"], |
192 |
AS_IF([wm_fn_lib_try_compile "webp/decode.h" "" "return 0" ""], |
192 |
[AC_CACHE_CHECK([for WebP support library], [wm_cv_imgfmt_webp], |
193 |
[], |
193 |
[wm_cv_imgfmt_webp=no |
194 |
[AC_MSG_ERROR([found $CACHEVAR but could not find appropriate header - are you missing libwebp-dev package?])]) |
194 |
dnl |
195 |
CFLAGS="$wm_save_CFLAGS"], |
195 |
dnl The library is using a special trick on the functions to provide |
196 |
[supported_gfx], [GFXLIBS])dnl |
196 |
dnl compatibility between versions, so we cannot try linking against |
197 |
]) dnl AC_DEFUN |
197 |
dnl a symbol without first using the header to handle it |
198 |
|
198 |
wm_save_LIBS="$LIBS" |
|
|
199 |
LIBS="$LIBS -lwebp" |
200 |
AC_TRY_LINK( |
201 |
[@%:@include <webp/decode.h>], |
202 |
[WebPGetFeatures(NULL, 1024, NULL);], |
203 |
[wm_cv_imgfmt_webp="-lwebp"]) |
204 |
LIBS="$wm_save_LIBS" |
205 |
AS_IF([test "x$enable_webp$wm_cv_imgfmt_webp" = "xyesno"], |
206 |
[AC_MSG_ERROR([explicit WebP support requested but no library found])])dnl |
207 |
]) |
208 |
AS_IF([test "x$wm_cv_imgfmt_webp" = "xno"], |
209 |
[unsupported="$unsupported WebP" |
210 |
enable_webp="no"], |
211 |
[supported_gfx="$supported_gfx WebP" |
212 |
WM_APPEND_ONCE([$wm_cv_imgfmt_webp], [GFXLIBS])dnl |
213 |
AC_DEFINE([USE_WEBP], [1], |
214 |
[defined when valid Webp library with header was found])])dnl |
215 |
]) |
216 |
AM_CONDITIONAL([USE_WEBP], [test "x$enable_webp" != "xno"])dnl |
217 |
]) |
199 |
|
218 |
|
200 |
# WM_IMGFMT_CHECK_XPM |
219 |
# WM_IMGFMT_CHECK_XPM |
201 |
# ------------------- |
220 |
# ------------------- |