]> granicus.if.org Git - postgresql/blob - aclocal.m4
Moved the intricacies of the perl interface build into its own makefile
[postgresql] / aclocal.m4
1 dnl aclocal.m4 generated automatically by aclocal 1.4
2
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.
7
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.
12
13 #
14 # Autoconf macros for configuring the build of Python extension modules
15 #
16 # $Header: /cvsroot/pgsql/aclocal.m4,v 1.1 2000/06/10 18:01:34 petere Exp $
17 #
18
19 # PGAC_PROG_PYTHON
20 # ----------------
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)])
25
26
27 # PGAC_PATH_PYTHONDIR
28 # -------------------
29 # Finds the names of various install dirs and helper files
30 # necessary to build a Python extension module.
31 #
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"]
43
44   AC_MSG_CHECKING(for Python extension makefile)
45   if test -f "${python_extmakefile}" ; then
46     AC_MSG_RESULT(found)
47   else
48     AC_MSG_RESULT(no)
49     AC_MSG_ERROR(
50 [The Python extension makefile was expected at \`${python_extmakefile}\'
51 but does not exist. This means the Python module cannot be built automatically.])
52   fi
53
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)
60 else
61   AC_MSG_ERROR([Python not found])
62 fi])# PGAC_PATH_PYTHONDIR
63
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
72    $1=$2
73    AC_MSG_RESULT(found)
74 else
75    $1="$3/missing $2"
76    AC_MSG_RESULT(missing)
77 fi
78 AC_SUBST($1)])
79