>From facc909306885f013843ae48b78d916626c6b55f Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Tue, 17 Oct 2017 21:17:53 -0400 Subject: [PATCH v1] Support ./configure --with-all=maybe * configure.ac: Change all --with-foo options to accept 'maybe' as a synonym for 'yes' (except that there's no error if the option can't be used). --- configure.ac | 67 ++++++++++++++++++++++++++++++------------------------------ 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/configure.ac b/configure.ac index 63324c2c7c..0ef9ca5147 100644 --- a/configure.ac +++ b/configure.ac @@ -243,7 +243,7 @@ AC_DEFUN installed])], [], [with_mailutils=$with_features - if test "$with_mailutils" = yes; then + if test "$with_mailutils" != no; then (movemail --version) >/dev/null 2>&1 || with_mailutils=no fi]) if test "$with_mailutils" = no; then @@ -302,9 +302,9 @@ AC_DEFUN [compile with sound support (VALUE one of: yes, alsa, oss, bsd-ossaudio, no; default yes). Only for GNU/Linux, FreeBSD, NetBSD, MinGW, Cygwin.])], [ case "${withval}" in - yes|no|alsa|oss|bsd-ossaudio) val=$withval ;; + yes|no|maybe|alsa|oss|bsd-ossaudio) val=$withval ;; *) AC_MSG_ERROR(['--with-sound=$withval' is invalid; -this option's value should be 'yes', 'no', 'alsa', 'oss', or 'bsd-ossaudio'.]) +this option's value should be 'yes', 'no', 'maybe', 'alsa', 'oss', or 'bsd-ossaudio'.]) ;; esac with_sound=$val @@ -316,10 +316,11 @@ AC_DEFUN dnl added later on when we find the file name of X, and it's best to dnl keep them together visually. AC_ARG_WITH([x-toolkit],[AS_HELP_STRING([--with-x-toolkit=KIT], - [use an X toolkit (KIT one of: yes or gtk, gtk2, gtk3, lucid or athena, motif, no)])], + [use an X toolkit (KIT one of: yes or gtk, gtk2, gtk3, lucid or athena, motif, maybe, no)])], [ case "${withval}" in y | ye | yes ) val=gtk ;; n | no ) val=no ;; + maybe ) val=maybe ;; l | lu | luc | luci | lucid ) val=lucid ;; a | at | ath | athe | athen | athena ) val=athena ;; m | mo | mot | moti | motif ) val=motif ;; @@ -328,7 +329,7 @@ AC_DEFUN gtk3 ) val=gtk3 ;; * ) AC_MSG_ERROR(['--with-x-toolkit=$withval' is invalid; -this option's value should be 'yes', 'no', 'lucid', 'athena', 'motif', 'gtk', +this option's value should be 'yes', 'no', 'maybe', 'lucid', 'athena', 'motif', 'gtk', 'gtk2' or 'gtk3'. 'yes' and 'gtk' are synonyms. 'athena' and 'lucid' are synonyms.]) ;; @@ -337,7 +338,7 @@ AC_DEFUN ]) OPTION_DEFAULT_OFF([wide-int], [prefer wide Emacs integers (typically 62-bit); allows buffer and string size up to 2GB on 32-bit hosts, at the cost of 10% to 30% slowdown of Lisp interpreter and larger memory footprint]) -if test "$with_wide_int" = yes; then +if test "$with_wide_int" != no; then AC_DEFINE([WIDE_EMACS_INT], 1, [Use long long for EMACS_INT if available.]) fi @@ -384,13 +385,14 @@ AC_DEFUN [ case "${withval}" in y | ye | yes ) val=yes ;; n | no ) val=no ;; + maybe ) val=maybe ;; i | in | ino | inot | inoti | inotif | inotify ) val=inotify ;; k | kq | kqu | kque | kqueu | kqueue ) val=kqueue ;; g | gf | gfi | gfil | gfile ) val=gfile ;; w | w3 | w32 ) val=w32 ;; * ) AC_MSG_ERROR(['--with-file-notification=$withval' is invalid; -this option's value should be 'yes', 'no', 'inotify', 'kqueue', 'gfile' or 'w32'. -'yes' is a synonym for 'w32' on MS-Windows, for 'no' on Nextstep, +this option's value should be 'yes', 'no', 'maybe', 'inotify', 'kqueue', 'gfile' or 'w32'. +'yes' and 'maybe' are a synonyms for 'w32' on MS-Windows, for 'no' on Nextstep, otherwise for the first of 'inotify', 'kqueue' or 'gfile' that is usable.]) ;; esac @@ -423,7 +425,7 @@ AC_DEFUN gamegroup= case ${with_gameuser} in '' | no) ;; - yes) gamegroup=games ;; + yes | maybe) gamegroup=games ;; :*) gamegroup=${with_gameuser#:} ;; *) gameuser=${with_gameuser} ;; esac @@ -1622,7 +1624,7 @@ AC_DEFUN fi AC_SUBST(LIBSOUND) - if test "${with_sound}" = "alsa" || test "${with_sound}" = "yes"; then + if test "${with_sound}" = "alsa" || test "${with_sound}" = "yes" || test "${with_sound}" = "maybe" ; then ALSA_REQUIRED=1.0.0 ALSA_MODULES="alsa >= $ALSA_REQUIRED" EMACS_CHECK_MODULES([ALSA], [$ALSA_MODULES]) @@ -2357,7 +2359,7 @@ AC_DEFUN AC_MSG_CHECKING([for thread support]) threads_enabled=no -if test "$with_threads" = yes; then +if test "$with_threads" != no; then if test "$emacs_cv_pthread_lib" != no; then AC_DEFINE(THREADS_ENABLED, 1, [Define to 1 if you want elisp thread support.]) @@ -2729,7 +2731,7 @@ AC_DEFUN dnl other platforms. HAVE_DBUS=no DBUS_OBJ= -if test "${with_dbus}" = "yes"; then +if test "${with_dbus}" != "no"; then EMACS_CHECK_MODULES([DBUS], [dbus-1 >= 1.0]) if test "$HAVE_DBUS" = yes; then AC_DEFINE(HAVE_DBUS, 1, [Define to 1 if using D-Bus.]) @@ -2754,7 +2756,7 @@ AC_DEFUN dnl GSettings has been tested under GNU/Linux only. HAVE_GSETTINGS=no -if test "${HAVE_X11}" = "yes" && test "${with_gsettings}" = "yes"; then +if test "${HAVE_X11}" = "yes" && test "${with_gsettings}" != "no"; then EMACS_CHECK_MODULES([GSETTINGS], [gio-2.0 >= 2.26]) if test "$HAVE_GSETTINGS" = "yes"; then old_CFLAGS=$CFLAGS @@ -2818,7 +2820,7 @@ AC_DEFUN dnl SELinux is available for GNU/Linux only. HAVE_LIBSELINUX=no LIBSELINUX_LIBS= -if test "${with_selinux}" = "yes"; then +if test "${with_selinux}" != "no"; then AC_CHECK_LIB([selinux], [lgetfilecon], HAVE_LIBSELINUX=yes, HAVE_LIBSELINUX=no) if test "$HAVE_LIBSELINUX" = yes; then AC_DEFINE(HAVE_LIBSELINUX, 1, [Define to 1 if using SELinux.]) @@ -2828,7 +2830,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 @@ -2845,7 +2847,7 @@ AC_DEFUN AC_SUBST(LIBGNUTLS_CFLAGS) HAVE_LIBSYSTEMD=no -if test "${with_libsystemd}" = "yes" ; then +if test "${with_libsystemd}" != "no" ; then dnl This code has been tested with libsystemd 222 and later. dnl FIXME: Find the earliest version number for which Emacs should work, dnl and change '222' to that number. @@ -2869,7 +2871,7 @@ AC_DEFUN this is only supported on MS-Windows native and MinGW32 builds. Consider using gfile instead.]) ;; - w32,* | yes,mingw32) + w32,* | yes,mingw32 | maybe,mingw32) AC_CHECK_HEADER(windows.h) if test "$ac_cv_header_windows_h" = yes ; then AC_DEFINE(HAVE_W32NOTIFY, 1, [Define to 1 to use w32notify.]) @@ -2880,7 +2882,7 @@ AC_DEFUN dnl inotify is available only on GNU/Linux. case $with_file_notification,$NOTIFY_OBJ in - inotify, | yes,) + inotify, | yes, | maybe,) AC_CHECK_HEADER(sys/inotify.h) if test "$ac_cv_header_sys_inotify_h" = yes ; then AC_CHECK_FUNC(inotify_init1) @@ -2894,7 +2896,7 @@ AC_DEFUN dnl kqueue is available on BSD-like systems. case $with_file_notification,$NOTIFY_OBJ in - kqueue,* | yes,) + kqueue,* | yes, | maybe,) EMACS_CHECK_MODULES([KQUEUE], [libkqueue]) if test "$HAVE_KQUEUE" = "yes"; then AC_DEFINE(HAVE_KQUEUE, 1, [Define to 1 to use kqueue.]) @@ -2917,7 +2919,7 @@ AC_DEFUN dnl has been added in glib 2.24. It has been tested under dnl GNU/Linux only. case $with_file_notification,$NOTIFY_OBJ in - gfile,* | yes,) + gfile,* | yes, |maybe,) if test "${HAVE_NS}" = yes; then AC_MSG_ERROR(['--with-file-notification=gfile' is not supported in NextStep builds. Consider kqueue instead.]) @@ -2934,7 +2936,7 @@ AC_DEFUN esac case $with_file_notification,$NOTIFY_OBJ in - yes,* | no,* | *,?*) ;; + yes,* | no,* | maybe,* | *,?*) ;; *) AC_MSG_ERROR([File notification '$with_file_notification' requested but requirements not found.]) ;; esac @@ -3298,14 +3300,13 @@ AC_DEFUN EMACS_CHECK_MODULES(CAIRO, $CAIRO_MODULE) if test $HAVE_CAIRO = yes; then AC_DEFINE(USE_CAIRO, 1, [Define to 1 if using cairo.]) - else + CFLAGS="$CFLAGS $CAIRO_CFLAGS" + LIBS="$LIBS $CAIRO_LIBS" + AC_SUBST(CAIRO_CFLAGS) + AC_SUBST(CAIRO_LIBS) + elif test "${with_cairo}" = "yes" ; then AC_MSG_ERROR([cairo requested but not found.]) fi - - CFLAGS="$CFLAGS $CAIRO_CFLAGS" - LIBS="$LIBS $CAIRO_LIBS" - AC_SUBST(CAIRO_CFLAGS) - AC_SUBST(CAIRO_LIBS) fi fi @@ -3672,18 +3673,18 @@ AC_DEFUN MISSING= WITH_NO= if test "${HAVE_X11}" = "yes"; then - test "${with_xpm}" != "no" && test "${HAVE_XPM}" != "yes" && + test "${with_xpm}" = "yes" && test "${HAVE_XPM}" != "yes" && MISSING="libXpm" && WITH_NO="--with-xpm=no" - test "${with_jpeg}" != "no" && test "${HAVE_JPEG}" != "yes" && + test "${with_jpeg}" = "yes" && test "${HAVE_JPEG}" != "yes" && MISSING="$MISSING libjpeg" && WITH_NO="$WITH_NO --with-jpeg=no" - test "${with_png}" != "no" && test "${HAVE_PNG}" != "yes" && + test "${with_png}" = "yes" && test "${HAVE_PNG}" != "yes" && MISSING="$MISSING libpng" && WITH_NO="$WITH_NO --with-png=no" - test "${with_gif}" != "no" && test "${HAVE_GIF}" != "yes" && + test "${with_gif}" = "yes" && test "${HAVE_GIF}" != "yes" && MISSING="$MISSING libgif/libungif" && WITH_NO="$WITH_NO --with-gif=no" - test "${with_tiff}" != "no" && test "${HAVE_TIFF}" != "yes" && + test "${with_tiff}" = "yes" && test "${HAVE_TIFF}" != "yes" && MISSING="$MISSING libtiff" && WITH_NO="$WITH_NO --with-tiff=no" fi -test "${with_gnutls}" != "no" && test "${HAVE_GNUTLS}" != "yes" && +test "${with_gnutls}" = "yes" && test "${HAVE_GNUTLS}" != "yes" && MISSING="$MISSING gnutls" && WITH_NO="$WITH_NO --with-gnutls=no" if test "X${MISSING}" != X; then AC_MSG_ERROR([The following required libraries were not found: -- 2.11.0