1 dnl aclocal.m4 generated automatically by aclocal 1.4
3 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
14 # Autoconf macros for configuring the build of Python extension modules
16 # $Header: /cvsroot/pgsql/aclocal.m4,v 1.1 2000/06/10 18:01:34 petere Exp $
21 # Look for Python and set the output variable `PYTHON'
22 # to `python' if found, empty otherwise.
23 AC_DEFUN([PGAC_PROG_PYTHON],
24 [AC_CHECK_PROG(PYTHON, python, python)])
29 # Finds the names of various install dirs and helper files
30 # necessary to build a Python extension module.
32 # It would be nice if we could check whether the current setup allows
33 # the build of the shared module. Future project.
34 AC_DEFUN([PGAC_PATH_PYTHONDIR],
35 [AC_REQUIRE([PGAC_PROG_PYTHON])
36 [if test "${PYTHON+set}" = set ; then
37 python_version=`${PYTHON} -c "import sys; print sys.version[:3]"`
38 python_prefix=`${PYTHON} -c "import sys; print sys.prefix"`
39 python_execprefix=`${PYTHON} -c "import sys; print sys.exec_prefix"`
40 python_configdir="${python_execprefix}/lib/python${python_version}/config"
41 python_moduledir="${python_prefix}/lib/python${python_version}"
42 python_extmakefile="${python_configdir}/Makefile.pre.in"]
44 AC_MSG_CHECKING(for Python extension makefile)
45 if test -f "${python_extmakefile}" ; then
50 [The Python extension makefile was expected at \`${python_extmakefile}\'
51 but does not exist. This means the Python module cannot be built automatically.])
54 AC_SUBST(python_version)
55 AC_SUBST(python_prefix)
56 AC_SUBST(python_execprefix)
57 AC_SUBST(python_configdir)
58 AC_SUBST(python_moduledir)
59 AC_SUBST(python_extmakefile)
61 AC_MSG_ERROR([Python not found])
62 fi])# PGAC_PATH_PYTHONDIR
64 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
65 dnl The program must properly implement --version.
66 AC_DEFUN(AM_MISSING_PROG,
67 [AC_MSG_CHECKING(for working $2)
68 # Run test in a subshell; some versions of sh will print an error if
69 # an executable is not found, even if stderr is redirected.
70 # Redirect stdin to placate older versions of autoconf. Sigh.
71 if ($2 --version) < /dev/null > /dev/null 2>&1; then
76 AC_MSG_RESULT(missing)