unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#36995: 27.0.50; configure enables HAVE_JPEG in spite of --without-X
@ 2019-08-10 11:52 Ulrich Mueller
  2019-08-11  9:39 ` Ulrich Mueller
  0 siblings, 1 reply; 3+ messages in thread
From: Ulrich Mueller @ 2019-08-10 11:52 UTC (permalink / raw)
  To: 36995

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





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#36995: 27.0.50; configure enables HAVE_JPEG in spite of --without-X
  2019-08-10 11:52 bug#36995: 27.0.50; configure enables HAVE_JPEG in spite of --without-X Ulrich Mueller
@ 2019-08-11  9:39 ` Ulrich Mueller
  2019-08-20 15:20   ` Ulrich Mueller
  0 siblings, 1 reply; 3+ messages in thread
From: Ulrich Mueller @ 2019-08-11  9:39 UTC (permalink / raw)
  To: 36995

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





^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#36995: 27.0.50; configure enables HAVE_JPEG in spite of --without-X
  2019-08-11  9:39 ` Ulrich Mueller
@ 2019-08-20 15:20   ` Ulrich Mueller
  0 siblings, 0 replies; 3+ messages in thread
From: Ulrich Mueller @ 2019-08-20 15:20 UTC (permalink / raw)
  To: 36995-done

> The patch included below fixes the problem for me.

Pushed to master.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-08-20 15:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-10 11:52 bug#36995: 27.0.50; configure enables HAVE_JPEG in spite of --without-X Ulrich Mueller
2019-08-11  9:39 ` Ulrich Mueller
2019-08-20 15:20   ` Ulrich Mueller

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).