|
1 | 1 | #
|
2 | 2 | # Autoconf macros for configuring the build of Python extension modules
|
3 | 3 | #
|
4 |
| -# $Header: /cvsroot/pgsql/config/python.m4,v 1.2 2001/05/12 17:49:32 petere Exp $ |
| 4 | +# $Header: /cvsroot/pgsql/config/python.m4,v 1.3 2001/07/10 16:33:01 petere Exp $ |
5 | 5 | #
|
6 | 6 |
|
7 | 7 | # PGAC_PATH_PYTHON
|
|
21 | 21 | # Determine the name of various directory of a given Python installation.
|
22 | 22 | AC_DEFUN([_PGAC_CHECK_PYTHON_DIRS],
|
23 | 23 | [AC_REQUIRE([PGAC_PATH_PYTHON])
|
| 24 | +AC_MSG_CHECKING([Python installation directories]) |
24 | 25 | python_version=`${PYTHON} -c "import sys; print sys.version[[:3]]"`
|
25 | 26 | python_prefix=`${PYTHON} -c "import sys; print sys.prefix"`
|
26 | 27 | python_execprefix=`${PYTHON} -c "import sys; print sys.exec_prefix"`
|
27 | 28 | python_configdir="${python_execprefix}/lib/python${python_version}/config"
|
28 |
| -python_moduledir="${python_prefix}/lib/python${python_version}" |
29 |
| -python_includedir="${python_prefix}/include/python${python_version}" |
30 |
| -python_dynlibdir="${python_execprefix}/lib/python${python_version}/lib-dynload" |
| 29 | +python_moduledir="${python_prefix}/lib/python${python_version}/site-packages" |
| 30 | +python_moduleexecdir="${python_execprefix}/lib/python${python_version}/site-packages" |
| 31 | +python_includespec="-I${python_prefix}/include/python${python_version}" |
| 32 | +if test "$python_prefix" != "$python_execprefix"; then |
| 33 | + python_includespec="-I${python_execprefix}/include/python${python_version} $python_includespec" |
| 34 | +fi |
31 | 35 |
|
32 | 36 | AC_SUBST(python_version)[]dnl
|
33 | 37 | AC_SUBST(python_prefix)[]dnl
|
34 | 38 | AC_SUBST(python_execprefix)[]dnl
|
35 | 39 | AC_SUBST(python_configdir)[]dnl
|
36 | 40 | AC_SUBST(python_moduledir)[]dnl
|
37 |
| -AC_SUBST(python_includedir)[]dnl |
38 |
| -AC_SUBST(python_dynlibdir)[]dnl |
| 41 | +AC_SUBST(python_moduleexecdir)[]dnl |
| 42 | +AC_SUBST(python_includespec)[]dnl |
| 43 | +# This should be enough of a message. |
| 44 | +if test "$python_prefix" != "$python_execprefix"; then |
| 45 | +AC_MSG_RESULT([$python_prefix/lib/python${python_version} and $python_execprefix/lib/python${python_version}]) |
| 46 | +else |
| 47 | +AC_MSG_RESULT([$python_prefix/lib/python${python_version}]) |
| 48 | +fi |
39 | 49 | ])# _PGAC_CHECK_PYTHON_DIRS
|
40 | 50 |
|
41 | 51 |
|
42 | 52 | # PGAC_CHECK_PYTHON_MODULE_SETUP
|
43 | 53 | # ------------------------------
|
44 |
| -# Finds things required to build a Python extension module, in |
45 |
| -#particular the makefile. |
| 54 | +# Finds things required to build a Python extension module. |
| 55 | +#This used to do more, that's why it's separate. |
46 | 56 | #
|
47 | 57 | # It would be nice if we could check whether the current setup allows
|
48 | 58 | # the build of the shared module. Future project.
|
49 | 59 | AC_DEFUN([PGAC_CHECK_PYTHON_MODULE_SETUP],
|
50 |
| -[AC_REQUIRE([_PGAC_CHECK_PYTHON_DIRS]) |
51 |
| -AC_MSG_CHECKING([for makefile to build Python module]) |
52 |
| -python_makefile_pre_in="${python_configdir}/Makefile.pre.in" |
53 |
| -
|
54 |
| -if test -f "${python_makefile_pre_in}" ; then |
55 |
| -AC_MSG_RESULT([${python_makefile_pre_in}]) |
56 |
| -else |
57 |
| -AC_MSG_RESULT(no) |
58 |
| -AC_MSG_ERROR( |
59 |
| -[The file |
60 |
| - ${python_makefile_pre_in} |
61 |
| -required to build Python modules does not exist. Make sure that you have |
62 |
| -a full Python installation and that this is the right location.]) |
63 |
| -fi |
64 |
| -
|
65 |
| -AC_SUBST(python_makefile_pre_in)[]dnl |
| 60 | +[ |
| 61 | +AC_REQUIRE([_PGAC_CHECK_PYTHON_DIRS]) |
66 | 62 | ])# PGAC_CHECK_PYTHON_MODULE_SETUP
|
67 | 63 |
|
68 | 64 |
|
|