GNU bug report logs - #36995
27.0.50; configure enables HAVE_JPEG in spite of --without-X

Previous Next

Package: emacs;

Reported by: Ulrich Mueller <ulm <at> gentoo.org>

Date: Sat, 10 Aug 2019 11:53:02 UTC

Severity: normal

Tags: patch

Found in version 27.0.50

Done: Ulrich Mueller <ulm <at> gentoo.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 36995 in the body.
You can then email your comments to 36995 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#36995; Package emacs. (Sat, 10 Aug 2019 11:53:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ulrich Mueller <ulm <at> gentoo.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 10 Aug 2019 11:53:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ulrich Mueller <ulm <at> gentoo.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.50; configure enables HAVE_JPEG in spite of --without-X
Date: Sat, 10 Aug 2019 13:52:30 +0200
configure --without-X will result in HAVE_JPEG being enabled, if the
jpeg library is detected on the system.

Unless I am missing something, the only use of the HAVE_JPEG macro
(and inclusion of jpeglib.h) is in image.c, which is only being compiled
if a window system is enabled (via WINDOW_SYSTEM_OBJ). So enabling jpeg
when X is disabled doesn't serve any purpose.

Long time ago, all image formats used to be disabled when configured
--without-X. Behaviour changed between Emacs versions 24.5 and 25.1.
AFAICS, this is due to the following commit, which (intentionally or
unintentionally?) dropped the test for a window system:

commit 5761a2ecb1a5178d2ea69a39725bdee368a754a5
Author: Paul Eggert <eggert <at> cs.ucla.edu>
Date:   Wed Apr 15 18:30:01 2015 -0700

    Port jpeg configuration to Solaris 10 with Sun C
    
    * configure.ac: Check for jpeglib 6b by trying to link it, instead
    of relying on cpp magic that has problems in practice.  Check for
    both jpeglib.h and jerror.h features.  Remove special case for
    mingw32, which should no longer be needed (and if it were needed,
    should now be addressable by hotwiring emacs_cv_jpeglib).
    Fixes: bug#20332


In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu)
 of 2019-08-10 built on themis
Repository revision: 2c5dd680180e978303662d3d32cc9aa5121b4d29
Repository branch: master
System Description: Gentoo/Linux

Configured using:
 'configure --prefix=/usr --build=x86_64-pc-linux-gnu
 --host=x86_64-pc-linux-gnu --mandir=/usr/share/man
 --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc
 --localstatedir=/var/lib --disable-silent-rules
 --docdir=/usr/share/doc/emacs-vcs-27.0.9999
 --htmldir=/usr/share/doc/emacs-vcs-27.0.9999/html --libdir=/usr/lib64
 --program-suffix=-emacs-27-vcs --includedir=/usr/include/emacs-27-vcs
 --infodir=/usr/share/info/emacs-27-vcs --localstatedir=/var
 --enable-locallisppath=/etc/emacs:/usr/share/emacs/site-lisp
 --without-compress-install --without-hesiod --without-pop
 --with-file-notification=no --disable-acl --without-dbus
 --without-modules --without-gameuser --without-libgmp --without-gpm
 --without-json --without-kerberos --without-kerberos5 --without-lcms2
 --without-xml2 --without-mailutils --without-selinux --without-gnutls
 --without-libsystemd --without-threads --without-wide-int
 --without-zlib --with-sound=no --without-x --without-ns
 'CFLAGS=-march=native -ggdb -O2 -pipe' CPPFLAGS= 'LDFLAGS=-Wl,-O1
 -Wl,--as-needed''

Configured features:
JPEG XIM PDUMPER




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36995; Package emacs. (Sun, 11 Aug 2019 09:40:02 GMT) Full text and rfc822 format available.

Message #8 received at 36995 <at> debbugs.gnu.org (full text, mbox):

From: Ulrich Mueller <ulm <at> gentoo.org>
To: 36995 <at> debbugs.gnu.org
Subject: Re: 27.0.50; configure enables HAVE_JPEG in spite of --without-X
Date: Sun, 11 Aug 2019 11:39:09 +0200
Tags: patch

The patch included below fixes the problem for me. (It really adds a
test for HAVE_X11||HAVE_W32 only, the rest are indentation changes.)


From 9fd108e4dd121f9cbe95397cdc743fca6c63b0ff Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ulrich=20M=C3=BCller?= <ulm <at> gentoo.org>
Date: Sun, 11 Aug 2019 11:24:07 +0200
Subject: [PATCH] * configure.ac (HAVE_JPEG): Test for window system.
 (Bug#36995)

---
 configure.ac | 78 +++++++++++++++++++++++++++-------------------------
 1 file changed, 40 insertions(+), 38 deletions(-)

diff --git a/configure.ac b/configure.ac
index c093d8650d..401eb04160 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3606,44 +3606,46 @@ HAVE_JPEG=no
 LIBJPEG=
 if test "${NS_IMPL_COCOA}" = yes; then
   : # Cocoa provides its own jpeg support, so do nothing.
-elif test "${with_jpeg}" != "no"; then
-  AC_CACHE_CHECK([for jpeglib 6b or later],
-    [emacs_cv_jpeglib],
-    [OLD_LIBS=$LIBS
-     for emacs_cv_jpeglib in yes -ljpeg no; do
-       case $emacs_cv_jpeglib in
-	 yes) ;;
-         no) break;;
-	 *) LIBS="$LIBS $emacs_cv_jpeglib";;
-       esac
-       AC_LINK_IFELSE(
-	 [AC_LANG_PROGRAM(
-	    [[#undef HAVE_STDLIB_H /* Avoid config.h/jpeglib.h collision.  */
-	      #include <stdio.h> /* jpeglib.h needs FILE and size_t.  */
-	      #include <jpeglib.h>
-	      #include <jerror.h>
-	      char verify[JPEG_LIB_VERSION < 62 ? -1 : 1];
-	      struct jpeg_decompress_struct cinfo;
-	    ]],
-	    [[
-	      jpeg_create_decompress (&cinfo);
-	      WARNMS (&cinfo, JWRN_JPEG_EOF);
-	      jpeg_destroy_decompress (&cinfo);
-	    ]])],
-	 [emacs_link_ok=yes],
-	 [emacs_link_ok=no])
-       LIBS=$OLD_LIBS
-       test $emacs_link_ok = yes && break
-     done])
-  if test "$emacs_cv_jpeglib" != no; then
-    HAVE_JPEG=yes
-    AC_DEFINE([HAVE_JPEG], 1,
-      [Define to 1 if you have the jpeg library (typically -ljpeg).])
-    ### mingw32 doesn't use -ljpeg, since it loads the library
-    ### dynamically when needed, and doesn't want a run-time
-    ### dependency on the jpeglib DLL.
-    test "$emacs_cv_jpeglib" != yes && test "${opsys}" != "mingw32" \
-    && LIBJPEG=$emacs_cv_jpeglib
+elif test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then
+  if test "${with_jpeg}" != "no"; then
+    AC_CACHE_CHECK([for jpeglib 6b or later],
+      [emacs_cv_jpeglib],
+      [OLD_LIBS=$LIBS
+       for emacs_cv_jpeglib in yes -ljpeg no; do
+	 case $emacs_cv_jpeglib in
+	   yes) ;;
+	   no) break;;
+	   *) LIBS="$LIBS $emacs_cv_jpeglib";;
+	 esac
+	 AC_LINK_IFELSE(
+	   [AC_LANG_PROGRAM(
+	      [[#undef HAVE_STDLIB_H /* Avoid config.h/jpeglib.h collision.  */
+		#include <stdio.h> /* jpeglib.h needs FILE and size_t.  */
+		#include <jpeglib.h>
+		#include <jerror.h>
+		char verify[JPEG_LIB_VERSION < 62 ? -1 : 1];
+		struct jpeg_decompress_struct cinfo;
+	      ]],
+	      [[
+		jpeg_create_decompress (&cinfo);
+		WARNMS (&cinfo, JWRN_JPEG_EOF);
+		jpeg_destroy_decompress (&cinfo);
+	      ]])],
+	   [emacs_link_ok=yes],
+	   [emacs_link_ok=no])
+	 LIBS=$OLD_LIBS
+	 test $emacs_link_ok = yes && break
+       done])
+    if test "$emacs_cv_jpeglib" != no; then
+      HAVE_JPEG=yes
+      AC_DEFINE([HAVE_JPEG], 1,
+	[Define to 1 if you have the jpeg library (typically -ljpeg).])
+      ### mingw32 doesn't use -ljpeg, since it loads the library
+      ### dynamically when needed, and doesn't want a run-time
+      ### dependency on the jpeglib DLL.
+      test "$emacs_cv_jpeglib" != yes && test "${opsys}" != "mingw32" \
+      && LIBJPEG=$emacs_cv_jpeglib
+    fi
   fi
 fi
 AC_SUBST(LIBJPEG)
-- 
2.22.0




Added tag(s) patch. Request was from Ulrich Mueller <ulm <at> gentoo.org> to control <at> debbugs.gnu.org. (Sun, 11 Aug 2019 09:46:02 GMT) Full text and rfc822 format available.

Reply sent to Ulrich Mueller <ulm <at> gentoo.org>:
You have taken responsibility. (Tue, 20 Aug 2019 15:21:02 GMT) Full text and rfc822 format available.

Notification sent to Ulrich Mueller <ulm <at> gentoo.org>:
bug acknowledged by developer. (Tue, 20 Aug 2019 15:21:02 GMT) Full text and rfc822 format available.

Message #15 received at 36995-done <at> debbugs.gnu.org (full text, mbox):

From: Ulrich Mueller <ulm <at> gentoo.org>
To: 36995-done <at> debbugs.gnu.org
Subject: Re: 27.0.50; configure enables HAVE_JPEG in spite of --without-X
Date: Tue, 20 Aug 2019 17:20:22 +0200
> The patch included below fixes the problem for me.

Pushed to master.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 18 Sep 2019 11:24:11 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 218 days ago.

Previous Next


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