Version bump the configure script.
[cfd] / aclocal.glob
index b687e5c..957a9d0 100644 (file)
@@ -1,6 +1,6 @@
 dnl -*-fundamental-*-                                    *@--GLOB-HEADER--@*
 dnl
-dnl $Id: aclocal.glob,v 1.17 2003/09/24 22:45:57 mdw Exp $
+dnl $Id$
 dnl
 dnl Common library of autoconf macros
 dnl
@@ -25,68 +25,8 @@ dnl You should have received a copy of the GNU General Public License
 dnl along with `common'; if not, write to the Free Software Foundation,
 dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-dnl----- Revision history ---------------------------------------------------
-dnl
-dnl $Log: aclocal.glob,v $
-dnl Revision 1.17  2003/09/24 22:45:57  mdw
-dnl Support Automake's `aclocal' scheme.  Deposit Autoconf fragments in
-dnl `aclocal's' repository.  Apply heinous bodging to `txtlib' and
-dnl `mkaclocal'.
-dnl
-dnl Revision 1.16  2003/04/23 12:47:22  mdw
-dnl Add mdw_MANEXT.
-dnl
-dnl Revision 1.15  2002/02/19 22:50:24  mdw
-dnl Fix spelling.  Add new macro which works out where to put TeX files.
-dnl
-dnl Revision 1.14  2002/02/03 19:15:15  mdw
-dnl Add SDL-finding equipment.  Quote some macro names which need it.  Add
-dnl long-overdue macros for expanding configured paths (and do it
-dnl properly).
-dnl
-dnl Revision 1.13  2001/02/23 09:07:24  mdw
-dnl Restore temporary variable on exit.
-dnl
-dnl Revision 1.12  2001/02/04 01:18:52  mdw
-dnl Overhaul the mLib debugging options.
-dnl
-dnl Revision 1.11  2001/01/20 12:03:08  mdw
-dnl Remove redundant stuff.
-dnl
-dnl Revision 1.10  2000/10/14 16:32:15  mdw
-dnl Fixes from upstream.
-dnl
-dnl Revision 1.9  2000/08/15 21:37:49  mdw
-dnl New initialization macro for libraries, and a new base client macro for
-dnl finding libraries with an appropriate version.
-dnl
-dnl Revision 1.8  1999/11/26 01:23:17  mdw
-dnl And support for MXD (not yet released).
-dnl
-dnl Revision 1.7  1999/11/11 20:03:58  mdw
-dnl Add support for mgLib too.
-dnl
-dnl Revision 1.6  1999/11/11 17:49:33  mdw
-dnl New macros for configuring clients of mLib and Catacomb.
-dnl
-dnl Revision 1.5  1999/07/27 18:27:37  mdw
-dnl Fix typo in header line for mdw_DECL_ENVIRON.
-dnl
-dnl Revision 1.4  1999/07/26 23:44:32  mdw
-dnl Reorder and tidy documentation.
-dnl
-dnl Revision 1.3  1999/07/17 10:27:44  mdw
-dnl More useful macros added.
-dnl
-dnl Revision 1.2  1999/05/13 22:57:23  mdw
-dnl Change `-ise' to `-ize' throughout.
-dnl
-dnl Revision 1.1.1.1  1999/05/05 19:23:47  mdw
-dnl New import.  The old CVS repository was lost in a disk disaster.
-dnl
-
 dnl *@--NOTICE--@* Common File Distribution
-dnl $Id: aclocal.glob,v 1.17 2003/09/24 22:45:57 mdw Exp $
+dnl $Id$
 
 dnl --- *@-mdw_REQUIRE-@* ---
 dnl
@@ -99,9 +39,10 @@ dnl          ARGS = arguments to pass
 dnl
 dnl Use:       Like `AC_REQUIRE', only it handles arguments.
 
+m4_define([_m4_divert(mdwdvt_REQUIRE)], 54633)
 AC_DEFUN([mdw_REQUIRE],
 [ifdef([AC_PROVIDE_$1], ,
-[AC_DIVERT_PUSH(builtin(eval, AC_DIVERSION_CURRENT - 1))dnl
+[AC_DIVERT_PUSH([mdwdvt_REQUIRE])dnl
 indir($@)
 AC_DIVERT_POP()dnl
 ])])
@@ -233,12 +174,96 @@ else :
   $4
 fi])
 
+dnl --- *@-mdw__PYTHON_VERSION-@* ---
+dnl
+dnl Will fail hopelessly on Python < 1.5.2.  Nobody uses that any more, 
+dnl right?
+
+AC_DEFUN([mdw__PYTHON_VERSION],
+[$1 -c 'from sys import *; v = argv[1]; vv = v.split("."); x = 0
+for i in range(len(vv)): x = x | (int(vv[i]) << (24 - i * 8))
+exit(x > hexversion)' $2])
+
+dnl --- *@-mdw_PROG_PYTHON-@* ---
+dnl
+dnl Author:    Mark Wooding
+dnl
+dnl Synopsis:  mdw_PROG_PYTHON(VERSION, [IF-FOUND], [IF-NOT-FOUND])
+dnl
+dnl Arguments: VERSION = version number of Python required
+dnl            IF-FOUND = what to do if it's found
+dnl            IF-NOT-FOUND = what to do if it isn't
+dnl
+dnl Use:       Attempts to find a working version of Python with a late
+dnl            enough version number.  It supplies an option `--with-python'
+dnl            to allow the user to provide a Python interpreter.  If one
+dnl            isn't provided explicitly, it searches for `python' and 
+dnl            `pythonVERSION' in the current PATH, asking them whether they
+dnl            have a late enough version number.  The path of the working
+dnl            Python is put into the `PYTHON' environment variable;
+dnl            `AC_SUBST' is used to substitute its value into Python 
+dnl            scripts.  If there is no Python to be found, the value of 
+dnl            `PYTHON' is set to be `none'.
+
+AC_DEFUN([mdw_PROG_PYTHON],
+[AC_ARG_WITH([python],
+[  --with-python=PYTHON          specify path to Python version $1 or newer],
+[PYTHON="$withval"],
+if test -z "$PYTHON"; then
+[AC_CACHE_CHECK([for Python version $1 or later], mdw_cv_prog_python,
+[mdw_cv_prog_python="none"
+for p in `echo "$PATH:/usr/local/bin" | tr ":" " "`; do
+  case $p in /*) ;; *) p=`pwd`/$p ;; esac
+  if mdw__PYTHON_VERSION(["$p/python"], $1); then
+    mdw_cv_prog_python="$p/python"
+    break
+  fi
+  if mdw__PYTHON_VERSION(["$p/python$1"], $1); then
+    mdw_cv_prog_python="$p/python$1"
+    break
+  fi
+done])
+PYTHON="$mdw_cv_prog_python"])
+fi
+
+AC_SUBST(PYTHON)dnl
+if test "$PYTHON" = "none"; then :
+  $3
+else :
+  $2
+fi])
+
+dnl --- *@-mdw_CHECK_PYTHON-@* ---
+dnl
+dnl Author:    Mark Wooding
+dnl
+dnl Synopsis:  mdw_CHECK_PYTHON(VERSION)
+dnl
+dnl Arguments: VERSION = version number of Python required
+dnl
+dnl Use:       Verifies that the Python interpreter in the `PYTHON' shell
+dnl            variable actually works and is of the right version.  If it's
+dnl            not, an error is raised and configuration is aborted.
+
+AC_DEFUN([mdw_CHECK_PYTHON],
+[mdw_REQUIRE([mdw_PROG_PYTHON], [$1])
+AC_MSG_CHECKING([whether Python ($PYTHON) works])
+if test "$PYTHON" != "none" && mdw__PYTHON_VERSION("$PYTHON", $1); then
+  AC_MSG_RESULT([yes])
+else
+  AC_MSG_RESULT([no])
+  AC_MSG_ERROR([Python version $1 or newer not found.
+If you have a recent enough Python, and I just failed to find it, try using
+the --with-python=PYTHON option to give me an explicit pathname.])
+fi])
+
 dnl --- *@-mdw__PERL_VERSION-@* ---
 dnl
 dnl AC_DEFUN relies on `[', `]' being quotes, so I have to drop down a level.
 
+AC_DEFUN([mdw__PERL_VERSION], [mdw__PERL_VERSION_hack([$1], [$2])])
 changequote(<<, >>)
-define([mdw__PERL_VERSION], <<$1 -e 'exit ($] < $2);' >&5 2>&5>>)
+define(<<mdw__PERL_VERSION_hack>>, <<$1 -e 'exit ($] < $2);' >&5 2>&5>>)
 changequote([, ])
 
 dnl --- *@-mdw_PROG_PERL-@* ---