diff options
author | Didier Verna <didier@xemacs.org> | 2001-06-05 12:28:20 +0000 |
---|---|---|
committer | Didier Verna <didier@xemacs.org> | 2001-06-05 12:28:20 +0000 |
commit | 99460f2e0ce5484a5ed3ce8f33de40dcbba4b2fd (patch) | |
tree | f91baa68be66a7e4aae279890a7ee808bd5ad628 /aclocal.m4 | |
parent | 48dabcf7b7bc481d1f3076f9a0a8dc39c415fd3f (diff) |
aclocal.m4, configure.ac: Upgrade to Autoconf 2.50.
Diffstat (limited to 'aclocal.m4')
-rw-r--r-- | aclocal.m4 | 81 |
1 files changed, 71 insertions, 10 deletions
@@ -22,13 +22,58 @@ dnl along with this program; if not, write to the Free Software Foundation, dnl Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -dnl Transforms a colon separated list into a space separated one: +dnl BBDB_PRE_INIT +dnl +dnl Find BBDB version number and put it in the m4 macro BBDB_VERSION +dnl +dnl I fought really hard, but finally I got it accepted to make autoconf load +dnl aclocal *before* AC_INIT is called. This is important for me, in +dnl situations like this precise one, where I want to dynamically compute the +dnl version number to pass to AC_INIT. +dnl There's one minor glitch however, the AC_DEFUN mechanism is not available +dnl before AC_INIT is called because of diversions. So this macro is defined +dnl only in terms of "m4 sugar". +m4_define([BBDB_PRE_INIT], +[ m4_define([_BBDB_VERSION], + m4_esyscmd([sed -n 's/^(defconst bbdb-version "\(.*\)")/\1/p' lisp/bbdb.el])) + m4_define([BBDB_VERSION], + m4_substr(_BBDB_VERSION, 0, decr(len(_BBDB_VERSION)))) + m4_undefine([_BBDB_VERSION]) +]) + +dnl BBDB_ARG_SUBST(VAR, OPTION, VAL, DESC[, DEFAULT[, ACTION]]) +dnl +dnl Substitute the autoconf variable VAR to a value specified by the user +dnl option --with-OPTION[=VAL] (described by DESC), or with a DEFAULT value. +dnl If an additional ACTION is given, it is executed at the top of the +dnl ACTION-IF-FOUND part of AC_ARG_WITH. +dnl #### WARNING: pay attention to the quoting of ACTION if given !!!!! +AC_DEFUN([BBDB_ARG_SUBST], +[ + AC_SUBST([$1]) + AC_ARG_WITH([$2], + AC_HELP_STRING([--with-][$2]ifelse($3, [], [], [=$3]), + [$4]ifelse($5, [], [], [ [[[$5]]]])), + [ + ifelse($6, [], [], $6) + $1="${withval}" + ], + ifelse($5, [], [], [$1="$5"])) +]) + +dnl BBDB_COLON_TO_SPACE(VAR) +dnl +dnl Transforms a (possibly) colon separated list VAR into a space separated +dnl one. VAR needs not be quoted. AC_DEFUN([BBDB_COLON_TO_SPACE], [ case "$$1" in *:*) $1="`echo $$1 | sed -e 's/:/ /g'`";; esac ]) -dnl Find GNU tar: +dnl BBDB_PROG_GNU_TAR +dnl +dnl Find a (g)tar program and make sure it is GNU one. A failure is not fatal +dnl since tar is needed for non critical targets only. AC_DEFUN([BBDB_PROG_GNU_TAR], [ AC_CHECK_PROGS(TAR, gtar tar) if test "x${TAR}" = "xtar" ; then @@ -45,7 +90,10 @@ AC_DEFUN([BBDB_PROG_GNU_TAR], AC_MSG_WARN([*** Some targets will be unavailable.]) fi ]) -dnl Choose a compression program: +dnl BBDB_PROG_COMPRESS +dnl +dnl Find a gzip / compress compression program. A failure is not fatal, only +dnl tarballs won't be compressed. AC_DEFUN([BBDB_PROG_COMPRESS], [ AC_CHECK_PROGS(COMPRESS, gzip compress) AC_SUBST(COMPEXT) @@ -60,7 +108,10 @@ AC_DEFUN([BBDB_PROG_COMPRESS], COMPEXT=Z fi ]) -dnl Find makeinfo: +dnl BBDB_PROG_MAKEINFO +dnl +dnl Find a makeinfo program. A failure is not fatal, only info files won't be +dnl built. AC_DEFUN([BBDB_PROG_MAKEINFO], [ AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo) if test "x${MAKEINFO}" = "x" ; then @@ -68,7 +119,10 @@ AC_DEFUN([BBDB_PROG_MAKEINFO], AC_MSG_WARN([*** Info files will not be built.]) fi ]) -dnl Find texi2dvi: +dnl BBDB_PROG_TEXI2DVI +dnl +dnl Find a texi2dvi program. A failure is not fatal, only dvi and pdf files +dnl won't be built. AC_DEFUN([BBDB_PROG_TEXI2DVI], [ AC_CHECK_PROG(TEXI2DVI, texi2dvi, texi2dvi) if test "x${TEXI2DVI}" = "x" ; then @@ -76,7 +130,10 @@ AC_DEFUN([BBDB_PROG_TEXI2DVI], AC_MSG_WARN([*** DVI and PDF files will not be built.]) fi ]) -dnl Find etags: +dnl BBDB_PROG_ETAGS +dnl +dnl Find an etags program. A failure is not fatal, only TAGS file won't be +dnl built. AC_DEFUN([BBDB_PROG_ETAGS], [ AC_CHECK_PROG(ETAGS, etags, etags) if test "x${ETAGS}" = "x" ; then @@ -84,7 +141,10 @@ AC_DEFUN([BBDB_PROG_ETAGS], AC_MSG_WARN([*** Tags file will not be built.]) fi ]) -dnl Choose an Emacs flavor: +dnl BBDB_PROG_EMACS +dnl +dnl Choose an Emacs flavor according to the --with-emacs user option, or try +dnl emacs and xemacs. dnl #### NOTE: when running from an Emacs shell buffer, the variable EMACS is dnl set to t, which confuses AC_CHECK_PROG. The solution we adopt is to use dnl another variable (namely tmp_EMACS) to perform the checkings. However, we @@ -96,9 +156,10 @@ AC_DEFUN([BBDB_PROG_EMACS], tmp_EMACS=${EMACS} fi AC_ARG_WITH([emacs], - [ --with-emacs=PROG which flavor of Emacs to use], - [ tmp_EMACS="${withval}" ], - [ AC_CHECK_PROGS(tmp_EMACS, emacs xemacs) ]) + AC_HELP_STRING([--with-emacs=PROG], + [choose which flavor of Emacs to use]), + [ tmp_EMACS="${withval}" ], + [ AC_CHECK_PROGS(tmp_EMACS, emacs xemacs) ]) if test "x${tmp_EMACS}" = "x" ; then dnl This is critical enough to generate an error and not a warning... AC_MSG_ERROR([*** No Emacs program found.]) |