]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix libwebp check for some webp installations
authorPo Lu <luangruo@yahoo.com>
Thu, 9 Mar 2023 00:52:54 +0000 (08:52 +0800)
committerPo Lu <luangruo@yahoo.com>
Thu, 9 Mar 2023 00:53:24 +0000 (08:53 +0800)
* configure.ac: Look for WebPGetInfo; if it is not there, look
for libwebpdecoder as well.  (bug#61988)

configure.ac

index bc7e61048c3b031c77df06259d15df4484f38fbf..ac93d003b7028d6155a375aa370e9e7183f13276 100644 (file)
@@ -2806,6 +2806,25 @@ if test "${with_webp}" != "no"; then
       WEBP_MODULE="libwebpdemux >= $WEBP_REQUIRED"
 
       EMACS_CHECK_MODULES([WEBP], [$WEBP_MODULE])
+
+      # WebPGetInfo is sometimes not present inside libwebpdemux, so
+      # if it does not link, also check for libwebpdecoder.
+
+      OLD_CFLAGS=$CFLAGS
+      OLD_LIBS=$LIBS
+      CFLAGS="$CFLAGS $WEBP_CFLAGS"
+      LIBS="$LIBS $WEBP_LIBS"
+
+      AC_CHECK_FUNC([WebPGetInfo], [],
+        [WEBP_MODULE="$WEBP_MODULE libwebpdecoder >= $WEBP_REQUIRED"
+        HAVE_WEBP=no
+        AS_UNSET([WEBP_LIBS])
+        AS_UNSET([WEBP_CFLAGS])
+        EMACS_CHECK_MODULES([WEBP], [$WEBP_MODULE])])
+
+      CFLAGS=$OLD_CFLAGS
+      LIBS=$OLD_LIBS
+
       AC_SUBST([WEBP_CFLAGS])
       AC_SUBST([WEBP_LIBS])
    fi