all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: rms@gnu.org
Cc: emacs-devel@gnu.org
Subject: Re: RFC: status icon support
Date: Fri, 18 Jan 2008 22:18:07 -0700	[thread overview]
Message-ID: <m3tzla5r74.fsf@fleche.redhat.com> (raw)
In-Reply-To: <E1JET4b-0003GB-Oz@fencepost.gnu.org> (Richard Stallman's message of "Mon\, 14 Jan 2008 12\:26\:09 -0500")

>     dnl EMACS_ARG_Y(NAME, HELP-STRING, [IF-GIVEN], [IF-NOT-GIVEN])
>     dnl Define a new --with option which is disabled by default.

rms> If that is the meaning, the name is counterintuitive.
rms> Let's rename EMACS_ARG_Y to OPTION_DEFAULT_OFF,
rms> and rename EMACS_ARG_N to OPTION_DEFAULT_ON.

Here's a patch that renames these and cleans up the uses.  With the
new macros there are no 3rd/4th arguments, just the result variable
which can be tested separately.

This patch also changes --with-pkg-config-prog not to use
OPTION_DEFAULT_ON, since it is not really a binary option, but rather
a path.  And, while I was at it, I cleaned up the code implementing
this option so that the work is done in a single place.

Tom

ChangeLog:
2008-01-19  Tom Tromey  <tromey@redhat.com>

	* configure.in (OPTION_DEFAULT_ON, OPTION_DEFAULT_OFF): New
	macros.
	(EMACS_ARG_Y, EMACS_ARG_N): Remove.
	Update all users.

Index: configure.in
===================================================================
RCS file: /sources/emacs/emacs/configure.in,v
retrieving revision 1.495
diff -u -r1.495 configure.in
--- configure.in	17 Jan 2008 11:41:10 -0000	1.495
+++ configure.in	19 Jan 2008 05:50:48 -0000
@@ -43,47 +43,63 @@
 
 gameuser=games
 
-dnl Autoconf is so much less fun under VMS, maybe
-dnl because everything is less fun under VMS. --ttn
-AC_DEFUN([EMACS_ARG_Y],[dnl
-AC_ARG_WITH([$1],[AS_HELP_STRING([--with-$1],[$2])],[$3],[$4])dnl
+dnl OPTION_DEFAULT_OFF(NAME, HELP-STRING)
+dnl Create a new --with option that defaults to being disabled.
+dnl NAME is the base name of the option.  The shell variable with_NAME
+dnl   will be set to either the user's value (if the option is
+dnl   specified; 'yes' for a plain --with-NAME) or to 'no' (if the
+dnl   option is not specified).  Note that the shell variable name is
+dnl   constructed as autoconf does, by replacing non-alphanumeric
+dnl   characters with "_".
+dnl HELP-STRING is the help text for the option.
+AC_DEFUN([OPTION_DEFAULT_OFF], [dnl
+  AC_ARG_WITH([$1],[AS_HELP_STRING([--with-$1],[$2])],[],[dnl
+    m4_bpatsubst([with_$1], [[^0-9a-z]], [_])=no])dnl
 ])dnl
-AC_DEFUN([EMACS_ARG_N],[dnl
-AC_ARG_WITH([$1],[AS_HELP_STRING([--without-$1],[$2])],[$3],[$4])dnl
+
+dnl OPTION_DEFAULT_ON(NAME, HELP-STRING)
+dnl Create a new --with option that defaults to being enabled.  NAME
+dnl   is the base name of the option.  The shell variable with_NAME
+dnl   will be set either to 'no' (for a plain --without-NAME) or to
+dnl   'yes' (if the option is not specified).  Note that the shell
+dnl   variable name is constructed as autoconf does, by replacing
+dnl   non-alphanumeric characters with "_".
+dnl HELP-STRING is the help text for the option.
+AC_DEFUN([OPTION_DEFAULT_ON], [dnl
+  AC_ARG_WITH([$1],[AS_HELP_STRING([--without-$1],[$2])],[],[dnl
+   m4_bpatsubst([with_$1], [[^0-9a-z]], [_])=yes])dnl
 ])dnl
 
-EMACS_ARG_N([gcc],[don't use GCC to compile Emacs if GCC is found])
+OPTION_DEFAULT_ON([gcc],[don't use GCC to compile Emacs if GCC is found])
 
-EMACS_ARG_N([pop],[don't support POP mail retrieval with movemail],
-[if test "$withval" = yes; then
+OPTION_DEFAULT_ON([pop],[don't support POP mail retrieval with movemail])
+if test "$with_pop" = yes; then
    AC_DEFINE(MAIL_USE_POP)
-else :
-fi],
-AC_DEFINE(MAIL_USE_POP))
+fi
 AH_TEMPLATE(MAIL_USE_POP, [Define to support POP mail retrieval.])dnl
 
-EMACS_ARG_Y([kerberos],[support Kerberos-authenticated POP],
-[if test "$withval" = yes; then
+OPTION_DEFAULT_OFF([kerberos],[support Kerberos-authenticated POP])
+if test "$with_kerberos" = yes; then
    AC_DEFINE(KERBEROS)
-fi])
+fi
 AH_TEMPLATE(KERBEROS,
 	    [Define to support Kerberos-authenticated POP mail retrieval.])dnl
 
-EMACS_ARG_Y([kerberos5],[support Kerberos version 5 authenticated POP],
-[if test "${with_kerberos5+set}" = set; then
-  if test "${with_kerberos+set}" != set; then
+OPTION_DEFAULT_OFF([kerberos5],[support Kerberos version 5 authenticated POP])
+if test "${with_kerberos5}" = yes; then
+  if test "${with_kerberos}" != yes; then
     with_kerberos=yes
     AC_DEFINE(KERBEROS)
   fi
   AC_DEFINE(KERBEROS5, 1, [Define to use Kerberos 5 instead of Kerberos 4.])
-fi])
+fi
 
-EMACS_ARG_Y([hesiod],[support Hesiod to get the POP server host],
-[if test "$withval" = yes; then
+OPTION_DEFAULT_OFF([hesiod],[support Hesiod to get the POP server host])
+if test "$with_hesiod" = yes; then
   AC_DEFINE(HESIOD, 1, [Define to support using a Hesiod database to find the POP server.])
-fi])
+fi
 
-EMACS_ARG_N([sound],[don't compile with sound support])
+OPTION_DEFAULT_ON([sound],[don't compile with sound support])
 
 dnl This should be the last --with option, because --with-x is
 dnl added later on when we find the path of X, and it's best to
@@ -106,20 +122,28 @@
 	  with_x_toolkit=$val
 ])
 
-EMACS_ARG_Y([xpm],[use -lXpm for displaying XPM images])
-EMACS_ARG_Y([jpeg],[use -ljpeg for displaying JPEG images])
-EMACS_ARG_Y([tiff],[use -ltiff for displaying TIFF images])
-EMACS_ARG_Y([gif],[use -lgif (or -lungif) for displaying GIF images])
-EMACS_ARG_Y([png],[use -lpng for displaying PNG images])
-EMACS_ARG_Y([gpm],[use -lgpm for mouse support on a GNU/Linux console])
-EMACS_ARG_Y([rsvg],[use -lrsvg-2 for displaying SVG images])
-EMACS_ARG_Y([gtk],[use GTK (same as --with-x-toolkit=gtk)])
-EMACS_ARG_Y([pkg-config-prog],[Path to pkg-config for finding GTK and librsvg])
-EMACS_ARG_N([toolkit-scroll-bars],[don't use Motif or Xaw3d scroll bars])
-EMACS_ARG_N([xaw3d],[don't use Xaw3d])
-EMACS_ARG_N([xim],[don't use X11 XIM])
-EMACS_ARG_N([carbon],[don't use Carbon GUI on Mac OS X])
-EMACS_ARG_Y([dbus],[use D-Bus])
+OPTION_DEFAULT_OFF([xpm],[use -lXpm for displaying XPM images])
+OPTION_DEFAULT_OFF([jpeg],[use -ljpeg for displaying JPEG images])
+OPTION_DEFAULT_OFF([tiff],[use -ltiff for displaying TIFF images])
+OPTION_DEFAULT_OFF([gif],[use -lgif (or -lungif) for displaying GIF images])
+OPTION_DEFAULT_OFF([png],[use -lpng for displaying PNG images])
+OPTION_DEFAULT_OFF([gpm],[use -lgpm for mouse support on a GNU/Linux console])
+OPTION_DEFAULT_OFF([rsvg],[use -lrsvg-2 for displaying SVG images])
+OPTION_DEFAULT_OFF([gtk],[use GTK (same as --with-x-toolkit=gtk)])
+OPTION_DEFAULT_ON([toolkit-scroll-bars],[don't use Motif or Xaw3d scroll bars])
+OPTION_DEFAULT_ON([xaw3d],[don't use Xaw3d])
+OPTION_DEFAULT_ON([xim],[don't use X11 XIM])
+OPTION_DEFAULT_ON([carbon],[don't use Carbon GUI on Mac OS X])
+OPTION_DEFAULT_ON([dbus],[use D-Bus])
+
+AC_ARG_WITH([pkg-config-prog],dnl
+  [AS_HELP_STRING([--with-pkg-config-prog=PATH],
+                  [Path to pkg-config for finding GTK and librsvg])])
+if test "X${with_pkg_config_prog}" != X; then
+   if test "${with_pkg_config_prog}" != yes; then
+      PKG_CONFIG="${with_pkg_config_prog}"
+   fi
+fi
 
 AC_ARG_ENABLE(carbon-app,
 [AS_HELP_STRING([--enable-carbon-app@<:@=DIR@:>@],
@@ -1089,9 +1113,7 @@
 AC_DEFUN([PKG_CHECK_MODULES], [
   succeeded=no
 
-  if test -z "$PKG_CONFIG"; then
-    AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
-  fi
+  AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
 
   if test "$PKG_CONFIG" = "no" ; then
      ifelse([$4], , [AC_MSG_ERROR([
@@ -1147,10 +1169,6 @@
 
   ALSA_REQUIRED=1.0.0
   ALSA_MODULES="alsa >= $ALSA_REQUIRED"
-  dnl Check if --with-pkg-config-prog has been given.
-  if test "X${with_pkg_config_prog}" != X; then
-    PKG_CONFIG="${with_pkg_config_prog}"
-  fi
   PKG_CHECK_MODULES(ALSA, $ALSA_MODULES, HAVE_ALSA=yes, HAVE_ALSA=no)
   if test $HAVE_ALSA = yes; then
     SAVE_CFLAGS="$CFLAGS"
@@ -1639,11 +1657,6 @@
 HAVE_RSVG=no
 if test "${HAVE_X11}" = "yes" || test "${HAVE_CARBON}" = "yes"; then
   if test "${with_rsvg}" != "no"; then
-    dnl Check if `--with-pkg-config-prog' has been given.
-    if test "X${with_pkg_config_prog}" != X; then
-      PKG_CONFIG="${with_pkg_config_prog}"
-    fi
-
     RSVG_REQUIRED=2.0.0
     RSVG_MODULE="librsvg-2.0 >= $RSVG_REQUIRED"
 
@@ -1674,10 +1687,6 @@
   GTK_REQUIRED=2.6
   GTK_MODULES="gtk+-2.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED"
 
-  dnl Check if --with-pkg-config-prog has been given.
-  if test "X${with_pkg_config_prog}" != X; then
-    PKG_CONFIG="${with_pkg_config_prog}"
-  fi
   dnl Checks for libraries.
   PKG_CHECK_MODULES(GTK, $GTK_MODULES, pkg_check_gtk=yes, pkg_check_gtk=no)
   if test "$pkg_check_gtk" = "no" && test "$USE_X_TOOLKIT" != "maybe"; then
@@ -1765,21 +1774,20 @@
 dnl other platforms.  Support for higher D-Bus versions but 1.0 is
 dnl also not configured.
 HAVE_DBUS=no
+AC_MSG_CHECKING([maybe dbus])
 if test "${with_dbus}" = "yes"; then
    PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.0, HAVE_DBUS=yes, HAVE_DBUS=no)
    if test "$HAVE_DBUS" = yes; then
       AC_DEFINE(HAVE_DBUS, 1, [Define to 1 if using D-Bus.])
    fi
+   AC_MSG_RESULT($HAVE_DBUS)
+else
+   AC_MSG_RESULT(no bub)
 fi
 
 ### Link with -lXft if available to work around a bug.
 HAVE_XFT=maybe
 if test "${HAVE_GTK}" = "yes"; then
-  dnl Check if --with-pkg-config-prog has been given.
-  if test "X${with_pkg_config_prog}" != X; then
-    PKG_CONFIG="${with_pkg_config_prog}"
-  fi
-
   PKG_CHECK_MODULES(XFT, xft >= 0.13.0, , HAVE_XFT=no)
   if test "$HAVE_XFT" != no; then
     OLD_CFLAGS="$CPPFLAGS"

  reply	other threads:[~2008-01-19  5:18 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-11 23:28 RFC: status icon support Tom Tromey
2008-01-12  1:57 ` Dan Nicolaescu
2008-01-12  1:28   ` Tom Tromey
2008-01-12  1:38   ` Tom Tromey
2008-01-12  8:45     ` Ulrich Mueller
2008-01-12 17:45       ` Tom Tromey
2008-01-14  2:01         ` Richard Stallman
2008-01-14  1:35           ` Tom Tromey
2008-01-14 17:26             ` Richard Stallman
2008-01-19  5:18               ` Tom Tromey [this message]
2008-01-20  6:14                 ` Richard Stallman
2008-01-23  4:00                   ` Michael Olson
2008-01-14  1:41           ` Tom Tromey
2008-01-14  1:03     ` Michael Olson
2008-01-14  1:01       ` Tom Tromey
2008-01-14  7:03         ` Jan Djärv
2008-01-15  6:01         ` Michael Olson
2008-01-16  1:10           ` Tom Tromey
2008-01-16  4:10             ` Michael Olson
2008-01-12 11:11   ` Richard Stallman
2008-01-12 11:25     ` David Kastrup
2008-01-12 11:27       ` Andreas Schwab
2008-01-12 11:46         ` David Kastrup
2008-01-12 14:10           ` Andreas Schwab
2008-01-12 14:19             ` David Kastrup
2008-01-12 17:33               ` Andreas Schwab
2008-01-14  2:00               ` Richard Stallman
2008-01-14  2:25                 ` Stefan Monnier
2008-01-14  7:05                 ` Jan Djärv
2008-01-12 13:52     ` Dan Nicolaescu
2008-01-12 14:13       ` Andreas Schwab
2008-01-12 14:26         ` Dan Nicolaescu
2008-01-12 17:36           ` Andreas Schwab
2008-01-12 18:59             ` Dan Nicolaescu
2008-01-12 14:33         ` David Kastrup
2008-01-12 17:45           ` Andreas Schwab
2008-01-12 18:07             ` David Kastrup
2008-01-12 18:16               ` Andreas Schwab
2008-01-14  2:01           ` Richard Stallman
2008-01-14  2:47             ` Dan Nicolaescu
2008-01-14 17:26               ` Richard Stallman
2008-01-14  9:14             ` David Kastrup
2008-01-14 17:26               ` Richard Stallman
2008-01-14  3:47 ` YAMAMOTO Mitsuharu
2008-01-14  3:49   ` Tom Tromey
2008-01-14 13:35     ` Stefan Monnier
2008-01-14 21:40     ` YAMAMOTO Mitsuharu
2008-01-16  1:17       ` Tom Tromey
2008-01-16 11:55         ` YAMAMOTO Mitsuharu
2008-01-14 17:26   ` Richard Stallman
2008-01-14 17:10     ` Tom Tromey
2008-01-16  2:42       ` Richard Stallman
  -- strict thread matches above, loose matches on Subject: below --
2007-12-30 19:56 Tom Tromey
2007-12-31 17:18 ` Dan Nicolaescu
2007-12-31 18:29   ` Tom Tromey

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

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

  git send-email \
    --in-reply-to=m3tzla5r74.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=emacs-devel@gnu.org \
    --cc=rms@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.