bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#61988: error compiling emacs


From: Po Lu
Subject: bug#61988: error compiling emacs
Date: Tue, 07 Mar 2023 13:03:55 +0800
User-agent: Gnus/5.13 (Gnus v5.13)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Po Lu <luangruo@yahoo.com>
>> Cc: utomei@tiscali.it,  61988@debbugs.gnu.org
>> Date: Tue, 07 Mar 2023 08:34:18 +0800
>> 
>> Eli Zaretskii <eliz@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@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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]