unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: "Nelson H. F. Beebe" <beebe@math.utah.edu>, emacs-devel@gnu.org
Subject: Re: [platform-testers] Emacs 26.2 RC1 is out!
Date: Mon, 25 Mar 2019 10:50:11 -0700	[thread overview]
Message-ID: <1733188e-ee18-5204-51c0-dc0b83e22884@cs.ucla.edu> (raw)
In-Reply-To: <jwvpnqjk98t.fsf-monnier+emacs@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 579 bytes --]

On 3/21/19 6:08 PM, Stefan Monnier wrote:
> Hmm... would there be a way to make it so configure accepts options like
>
>     ./configure ... --with-xpm=ifavailable  --with-jpeg=ifavailable ...
>
> so you can use a single script on all systems and it will use xpm
> where available?

That's simple, and it sounds like it would make Nelson's job easier. My
job too, as I occasionally build on multiple Solaris systems, which
often lack some of these libraries.

I installed the attached patch on master; it won't be in the Emacs 26.2
release but I hope it survives into Emacs 27.


[-- Attachment #2: 0001-Support-.-configure-with-gif-ifavailable-etc.patch --]
[-- Type: text/x-patch, Size: 5449 bytes --]

From 97a793cba9fc68a9df67622d8d82c443fe10dd9b Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Mon, 25 Mar 2019 10:46:04 -0700
Subject: [PATCH] Support ./configure --with-gif=ifavailable etc.

Suggested by Stefan Monnier in:
https://lists.gnu.org/r/emacs-devel/2019-03/msg00789.html
* INSTALL, etc/NEWS: Document this.
* configure.ac: Implement this.
---
 INSTALL      |  6 ++++++
 configure.ac | 59 +++++++++++++++++++++++++++++++++++-----------------
 etc/NEWS     |  6 ++++++
 3 files changed, 52 insertions(+), 19 deletions(-)

diff --git a/INSTALL b/INSTALL
index 72bba25df8..8022385010 100644
--- a/INSTALL
+++ b/INSTALL
@@ -318,6 +318,12 @@ features enabled, you can combine --without-all with --with-FEATURE.
 For example, you can use --without-all --without-x --with-dbus to
 build with D-Bus support and nothing more.
 
+Use --with-gnutls=ifavailable to use GnuTLS if available but go ahead
+and build without it if not available.  This overrides Emacs's default
+behavior of refusing to build if GnuTLS is absent.  When X11 support
+is enabled, the libraries for gif, jpeg, png, tiff, and xpm are in the
+same strongly-recommended category as GnuTLS, and have similar options.
+
 Use --with-wide-int to implement Emacs values with the type 'long long',
 even on hosts where a narrower type would do.  With this option, on a
 typical 32-bit host, Emacs integers have 62 bits instead of 30.
diff --git a/configure.ac b/configure.ac
index 110ea2909a..c93cfbbb59 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2941,7 +2941,7 @@ AC_DEFUN
 AC_SUBST(LIBSELINUX_LIBS)
 
 HAVE_GNUTLS=no
-if test "${with_gnutls}" = "yes" ; then
+if test "${with_gnutls}" != "no" ; then
   EMACS_CHECK_MODULES([LIBGNUTLS], [gnutls >= 2.12.2],
     [HAVE_GNUTLS=yes], [HAVE_GNUTLS=no])
   if test "${HAVE_GNUTLS}" = "yes"; then
@@ -3512,7 +3512,10 @@ AC_DEFUN
 
 if test "${HAVE_X11}" = "yes"; then
   dnl Avoid Xpm on AIX unless requested, as it crashes; see Bug#17598.
-  test "$opsys$with_xpm_set" = aix4-2 && with_xpm=no
+  case $opsys,$with_xpm_set,$with_xpm in
+    aix4-2,set,yes) ;;
+    aix4-2,*) with_xpm=no;;
+  esac
 
   if test "${with_xpm}" != "no"; then
     AC_CHECK_HEADER(X11/xpm.h,
@@ -3830,28 +3833,46 @@ AC_DEFUN
 
 dnl Check for required libraries.
 MISSING=
-WITH_NO=
+WITH_IFAVAILABLE=
 if test "${HAVE_X11}" = "yes"; then
-  test "${with_xpm}" != "no" && test "${HAVE_XPM}" != "yes" &&
-    MISSING="libXpm" && WITH_NO="--with-xpm=no"
-  test "${with_jpeg}" != "no" && test "${HAVE_JPEG}" != "yes" &&
-    MISSING="$MISSING libjpeg" && WITH_NO="$WITH_NO --with-jpeg=no"
-  test "${with_png}" != "no" && test "${HAVE_PNG}" != "yes" &&
-    MISSING="$MISSING libpng" && WITH_NO="$WITH_NO --with-png=no"
-  test "${with_gif}" != "no" && test "${HAVE_GIF}" != "yes" &&
-    MISSING="$MISSING libgif/libungif" && WITH_NO="$WITH_NO --with-gif=no"
-  test "${with_tiff}" != "no" && test "${HAVE_TIFF}" != "yes" &&
-    MISSING="$MISSING libtiff" && WITH_NO="$WITH_NO --with-tiff=no"
-fi
-test "${with_gnutls}" != "no" && test "${HAVE_GNUTLS}" != "yes" &&
-  MISSING="$MISSING gnutls" && WITH_NO="$WITH_NO --with-gnutls=no"
+  case $with_xpm,$HAVE_XPM in
+    no,* | ifavailable,* | *,yes) ;;
+    *) MISSING="libXpm"
+       WITH_IFAVAILABLE="--with-xpm=ifavailable";;
+  esac
+  case $with_jpeg,$HAVE_JPEG in
+    no,* | ifavailable,* | *,yes) ;;
+    *) MISSING="$MISSING libjpeg"
+       WITH_IFAVAILABLE="$WITH_IFAVAILABLE --with-jpeg=ifavailable";;
+  esac
+  case $with_png,$HAVE_PNG in
+    no,* | ifavailable,* | *,yes) ;;
+    *) MISSING="$MISSING libpng"
+       WITH_IFAVAILABLE="$WITH_IFAVAILABLE --with-png=ifavailable";;
+  esac
+  case $with_gif,$HAVE_GIF in
+    no,* | ifavailable,* | *,yes) ;;
+    *) MISSING="$MISSING libgif/libungif"
+       WITH_IFAVAILABLE="$WITH_IFAVAILABLE --with-gif=ifavailable";;
+  esac
+  case $with_tiff,$HAVE_TIFF in
+    no,* | ifavailable,* | *,yes) ;;
+    *) MISSING="$MISSING libtiff"
+       WITH_IFAVAILABLE="$WITH_IFAVAILABLE --with-tiff=ifavailable";;
+  esac
+fi
+case $with_gnutls,$HAVE_GNUTLS in
+  no,* | ifavailable,* | *,yes) ;;
+  *) MISSING="$MISSING gnutls"
+     WITH_IFAVAILABLE="$WITH_IFAVAILABLE --with-gnutls=ifavailable";;
+esac
 if test "X${MISSING}" != X; then
   AC_MSG_ERROR([The following required libraries were not found:
     $MISSING
 Maybe some development libraries/packages are missing?
-If you don't want to link with them give
-    $WITH_NO
-as options to configure])
+To build anyway, give:
+    $WITH_IFAVAILABLE
+as options to configure.])
 fi
 
 ### Use -lgpm if available, unless '--with-gpm=no'.
diff --git a/etc/NEWS b/etc/NEWS
index bbba59c549..ad01bd8516 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -37,6 +37,12 @@ functions 'json-serialize', 'json-insert', 'json-parse-string', and
 'json-parse-buffer' are typically much faster than their Lisp
 counterparts from json.el.
 
+** Several configure options now accept an option-argument 'ifavailable'.
+For example, './configure --with-xpm=ifavailable' now configures Emacs
+to attempt to use libxpm but to continue building even if libxpm is absent.
+The other affected options are --with-gif, --with-gnutls, --with-jpeg,
+--with-png, and --with-tiff.
+
 ** The etags program now uses the C library's regular expression matcher
 when possible, and a compatible regex substitute otherwise.  This will
 let developers maintain Emacs's own regex code without having to also
-- 
2.20.1


  parent reply	other threads:[~2019-03-25 17:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-21 16:25 [platform-testers] Emacs 26.2 RC1 is out! Nelson H. F. Beebe
2019-03-21 17:03 ` Eli Zaretskii
2019-03-22  1:08 ` Stefan Monnier
2019-03-22  7:37   ` Eli Zaretskii
2019-03-22 12:20     ` Stefan Monnier
2019-03-22 13:19       ` Eli Zaretskii
2019-03-22 13:58         ` Stefan Monnier
2019-03-25 17:50   ` Paul Eggert [this message]
2019-03-22  3:36 ` Van L
  -- strict thread matches above, loose matches on Subject: below --
2019-03-21 22:35 Nelson H. F. Beebe
2019-03-22  7:25 ` Eli Zaretskii
2019-03-22 12:54   ` Nelson H. F. Beebe
2019-03-22 13:29     ` Eli Zaretskii
2019-03-22 12:25 Nelson H. F. Beebe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1733188e-ee18-5204-51c0-dc0b83e22884@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=beebe@math.utah.edu \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).