GNU bug report logs - #61988
error compiling emacs

Previous Next

Package: emacs;

Reported by: Ugo Tomei <utomei <at> tiscali.it>

Date: Sun, 5 Mar 2023 19:03:02 UTC

Severity: normal

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Po Lu <luangruo <at> yahoo.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: utomei <at> tiscali.it, 61988 <at> debbugs.gnu.org
Subject: bug#61988: error compiling emacs
Date: Tue, 07 Mar 2023 13:03:55 +0800
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Po Lu <luangruo <at> yahoo.com>
>> Cc: utomei <at> tiscali.it,  61988 <at> debbugs.gnu.org
>> Date: Tue, 07 Mar 2023 08:34:18 +0800
>> 
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>> 
>> > I'd like to know why requiring libwebpdecoder is essential for the
>> > build to work on the OP's system.  It isn't on mine, and if you look
>> > at init_webp_functions, you will see that on Windows we load functions
>> > only from libwebp and libwebpdemux.  Why is the third library needed?
>> 
>> It is here, because Emacs needs the function ``WebPGetInfo'', and on
>> GNU/Linux systems that function is in libwebpdecoder.so:
>
> Then the unconditional test for libwebpdecoder being installed is not
> TRT.  We should instead do that only if that library is required, for
> example by trying to link a program that calls WebPGetInfo without
> libwebpdecoder first.
>
>> and here, I have a pkg-config file named libwebpdecoder.pc
>
> I see that file in the source directory, but it is not installed by
> "make install", and neither is libwebpdecoder library itself.
> Evidently, the way I configured and built libwebp doesn't require that
> library to be installed.  And once again, in my case the offending
> function is in libwebpdemux, not in libwebpdecoder.
>
> So the test needs to be rewritten to be safe and correct.
>
>> GNU ld does not allow you to link to symbols in dependencies of shared
>> libraries, so asking for libwebpdemux while using symbols in
>> libwebpdecoder does not work.
>
> I know, and that's not what I suggested.  It looks like at least on
> some systems (or maybe with some versions of libwebp) the
> libwebpdecoder library is not installed and not needed.  We must
> support such installations; we did until now.

OK, would both you and utomei <at> tiscali.it please try this?

diff --git a/configure.ac b/configure.ac
index bc7e61048c3..1477e04b7d8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2806,6 +2806,22 @@ AC_DEFUN
       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"
+	 EMACS_CHECK_MODULES([WEBP], [$WEBP_MODULE])])
+
+      CFLAGS=$OLD_CFLAGS
+      LIBS=$OLD_LIBS
+
       AC_SUBST([WEBP_CFLAGS])
       AC_SUBST([WEBP_LIBS])
    fi




This bug report was last modified 1 year and 260 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.