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

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Ulrich Mueller <ulm@HIDDEN>; Keywords: patch; dated Sat, 10 Aug 2019 11:53:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Added tag(s) patch. Request was from Ulrich Mueller <ulm@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 36995 <at> debbugs.gnu.org:


Received: (at 36995) by debbugs.gnu.org; 11 Aug 2019 09:39:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Aug 11 05:39:23 2019
Received: from localhost ([127.0.0.1]:44705 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hwkJv-000212-0N
	for submit <at> debbugs.gnu.org; Sun, 11 Aug 2019 05:39:23 -0400
Received: from smtp.gentoo.org ([140.211.166.183]:54362)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ulm@HIDDEN>) id 1hwkJr-00020k-Oy
 for 36995 <at> debbugs.gnu.org; Sun, 11 Aug 2019 05:39:21 -0400
Received: from a1i15 (host2092.kph.uni-mainz.de [134.93.134.92])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (No client certificate requested) (Authenticated sender: ulm)
 by smtp.gentoo.org (Postfix) with ESMTPSA id 76F3D3498B7;
 Sun, 11 Aug 2019 09:39:12 +0000 (UTC)
From: Ulrich Mueller <ulm@HIDDEN>
To: 36995 <at> debbugs.gnu.org
Subject: Re: 27.0.50; configure enables HAVE_JPEG in spite of --without-X
References: <w6gr25tme4h.fsf@HIDDEN>
Date: Sun, 11 Aug 2019 11:39:09 +0200
In-Reply-To: <w6gr25tme4h.fsf@HIDDEN> (Ulrich Mueller's message of
 "Sat, 10 Aug 2019 13:52:30 +0200")
Message-ID: <w6gblwwm476.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 36995
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.0 (------)

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@HIDDEN>
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




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#36995; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 10 Aug 2019 11:52:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Aug 10 07:52:43 2019
Received: from localhost ([127.0.0.1]:43508 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hwPvP-0003oT-1e
	for submit <at> debbugs.gnu.org; Sat, 10 Aug 2019 07:52:43 -0400
Received: from lists.gnu.org ([209.51.188.17]:45215)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ulm@HIDDEN>) id 1hwPvM-0003oL-Cf
 for submit <at> debbugs.gnu.org; Sat, 10 Aug 2019 07:52:41 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:50486)
 by lists.gnu.org with esmtp (Exim 4.86_2)
 (envelope-from <ulm@HIDDEN>) id 1hwPvL-0003qY-8d
 for bug-gnu-emacs@HIDDEN; Sat, 10 Aug 2019 07:52:40 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,URIBL_BLOCKED
 autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <ulm@HIDDEN>) id 1hwPvK-0001DM-7q
 for bug-gnu-emacs@HIDDEN; Sat, 10 Aug 2019 07:52:39 -0400
Received: from mail.gentoo.org ([2001:470:ea4a:1:5054:ff:fec7:86e4]:56555
 helo=smtp.gentoo.org)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <ulm@HIDDEN>) id 1hwPvK-0001CT-2F
 for bug-gnu-emacs@HIDDEN; Sat, 10 Aug 2019 07:52:38 -0400
Received: from a1i15 (host2092.kph.uni-mainz.de [134.93.134.92])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (No client certificate requested) (Authenticated sender: ulm)
 by smtp.gentoo.org (Postfix) with ESMTPSA id 0AFC4349827;
 Sat, 10 Aug 2019 11:52:34 +0000 (UTC)
From: Ulrich Mueller <ulm@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 27.0.50; configure enables HAVE_JPEG in spite of --without-X
Date: Sat, 10 Aug 2019 13:52:30 +0200
Message-ID: <w6gr25tme4h.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-Received-From: 2001:470:ea4a:1:5054:ff:fec7:86e4
X-Spam-Score: -1.6 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.6 (--)

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@HIDDEN>
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




Acknowledgement sent to Ulrich Mueller <ulm@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#36995; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 11 Aug 2019 10:00:02 UTC

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