Subject: Re: bug#61988: error compiling emacs

From: Ugo Tomei <[email-masked]>
Date: Wed, 8 Mar 2023 10:44:07 +0100

not works:

/usr/bin/ld: image.o: undefined reference to symbol 'WebPGetInfo'
/usr/bin/ld: /lib/x86_64-linux-gnu/libwebp.so.7: error adding symbols: 
DSO missing from command line
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:705: temacs] Errore 1
make[3]: uscita dalla directory «/app/emacs/src»
make[2]: *** [Makefile:544: src] Errore 2
make[2]: uscita dalla directory «/app/emacs»
make[1]: *** [Makefile:1260: actual-bootstrap] Errore 2
make[1]: uscita dalla directory «/app/emacs»
make[1]: ingresso nella directory «/app/emacs»
***
*** "make bootstrap" failed with exit status 2.
***
*** You could try to:
*** - run "make extraclean" and run "make" again (or, equivalently, run
***   "make bootstrap configure=default"), to rebuild Emacs with the
***   default configuration options, which might fix the problem
*** - run "git clean -fdx" and run "make bootstrap" again, which might
***   fix the problem if "make bootstrap configure=default" did not
***   !BEWARE! "git clean -fdx" deletes all files that are not under
***   !BEWARE! version control, which means that all changes to such
***   !BEWARE! files will be lost and cannot be restored later
*** - run "make V=1", which displays the full commands invoked by make,
***   to further investigate the problem
*** - report the problem and ask for help by sending an email to
***   [email-masked], mentioning at least the build error
***   message, the platform, and the repository revision displayed by
***   "git rev-parse HEAD"
***
make[1]: *** [Makefile:414: advice-on-failure] Errore 2
make[1]: uscita dalla directory «/app/emacs»
make: *** [Makefile:1243: bootstrap] Errore 2

attached configure.ac and log

first patch works

last patch not works

best regards

Il 08/03/23 10:02, Po Lu ha scritto:
> Your config.log shows you applied the old patch.  I'm talking about this
> new one:
>
> 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
>
> with this patch applied, and after you run autogen.sh, does Emacs
> configure and build normally?