unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 57420@debbugs.gnu.org
Subject: bug#57420: 29.0.50; Failure configuring Emacs with animated WebP support
Date: Thu, 25 Aug 2022 23:59:40 +0200	[thread overview]
Message-ID: <m1fshkc7cj.fsf@yahoo.es> (raw)
In-Reply-To: m1fshkc7cj.fsf.ref@yahoo.es

I have a computer that cannot build Emacs since the animated WebP
support was added.

Details of the system:

aarch64-apple-darwin21.1.0, NS appkit-2113.00 Version 12.0.1 (Build
21A559)
Windowing system distributor 'Apple', version 10.3.2113
System Description:  macOS 12.4

Library WebP is installed via the Homebrew package manager.

$ pkg-config --libs libwebp

-L/opt/homebrew/Cellar/webp/1.2.2/lib -lwebp

Steps to reproduce the problem:

make -j

[...]

checking for libwebp >= 0.6.0... yes

[...]

ld: library not found for -lwebp
clang: error: linker command failed with exit code 1 (use -v to see invocation)

One workaround I've been using to build Emacs is to configure it
--with-webp=no

I think this is a bug that was introduced when animated WebP support was
added.  From commit d82e1a873df381b2c35bc9036da5665468bdfd31:

diff --git a/configure.ac b/configure.ac
index 6b834a2f65..185e4d0862 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2695,6 +2695,9 @@ AC_DEFUN
       WEBP_MODULE="libwebp >= $WEBP_REQUIRED"
 
       EMACS_CHECK_MODULES([WEBP], [$WEBP_MODULE])
+      if test "$HAVE_WEBP" = "yes"; then
+        WEBP_LIBS="-lwebp -lwebpdemux"
+      fi
       AC_SUBST(WEBP_CFLAGS)
       AC_SUBST(WEBP_LIBS)
    fi

The problem I see with this part of the patch is that, after you call
EMACS_CHECK_MODULES, the variable WEBP_LIBS is correctly set to
"-L/opt/homebrew/Cellar/webp/1.2.2/lib -lwebp" via pkg-config.  However,
it is overriden to contain "-lwebp -lwebpdemux", so the library path got
removed.

If WebP animated support requires -lwebpdemux, I think we could require
the libwebpdemux module instead (part of the libwebp package), whose
linker flags include "-lwebp -lwebpdemux".  The following patch fixes
the compilation for me:

diff --git a/configure.ac b/configure.ac
index 6ca3052ea3..4590ed3506 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2773,12 +2773,9 @@ AC_DEFUN
    || test "${HAVE_W32}" = "yes" || test "${HAVE_NS}" = "yes" \
    || test "${HAVE_BE_APP}" = "yes" || test "${HAVE_PGTK}" = "yes"; then
       WEBP_REQUIRED=0.6.0
-      WEBP_MODULE="libwebp >= $WEBP_REQUIRED"
+      WEBP_MODULE="libwebpdemux >= $WEBP_REQUIRED"
 
       EMACS_CHECK_MODULES([WEBP], [$WEBP_MODULE])
-      if test "$HAVE_WEBP" = "yes"; then
-        WEBP_LIBS="-lwebp -lwebpdemux"
-      fi
       AC_SUBST([WEBP_CFLAGS])
       AC_SUBST([WEBP_LIBS])
    fi

I checked that the built Emacs has WebP support.

What do you think? I'd need an build system expert to verify that this
is TRT in GNU/Linux, Windows, or when pkg-config is not available.





       reply	other threads:[~2022-08-25 21:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <m1fshkc7cj.fsf.ref@yahoo.es>
2022-08-25 21:59 ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-08-25 22:50   ` bug#57420: 29.0.50; Failure configuring Emacs with animated WebP support Stefan Kangas
2022-08-25 23:12     ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-26  5:51     ` Eli Zaretskii
2022-08-26 20:40       ` Stefan Kangas
2022-08-27  6:37         ` Eli Zaretskii
2022-08-27 13:28           ` Lars Ingebrigtsen
2022-08-26 11:08     ` Lars Ingebrigtsen
2022-08-26  5:43   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1fshkc7cj.fsf@yahoo.es \
    --to=bug-gnu-emacs@gnu.org \
    --cc=57420@debbugs.gnu.org \
    --cc=mardani29@yahoo.es \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).