File tree Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Original file line number Diff line number Diff line change 1
1
#
2
2
# Autoconf macros for configuring the build of Python extension modules
3
3
#
4
- # $PostgreSQL: pgsql/config/python.m4,v 1.7 2003/11/29 19:51:17 pgsql Exp $
4
+ # $PostgreSQL: pgsql/config/python.m4,v 1.8 2004/09/16 23:30:30 joe 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 ( [ for Python distutils module] )
25
+ if "${PYTHON}" 2>&- -c 'import distutils'
26
+ then
27
+ AC_MSG_RESULT ( yes )
28
+ else
29
+ AC_MSG_RESULT ( no )
30
+ AC_MSG_ERROR ( [ distutils module not found] )
31
+ fi
24
32
AC_MSG_CHECKING ( [ Python installation directories] )
25
33
python_version=`${PYTHON} -c "import sys; print sys.version[ [ :3] ] "`
26
34
python_prefix=`${PYTHON} -c "import sys; print sys.prefix"`
27
35
python_execprefix=`${PYTHON} -c "import sys; print sys.exec_prefix"`
28
- python_configdir="${python_execprefix}/lib/python${python_version}/ config"
36
+ python_configdir=`${PYTHON} -c "from distutils.sysconfig import get_python_lib as f; import os; print os.path.join(f(plat_specific=1,standard_lib=1),' config')"`
29
37
python_includespec="-I${python_prefix}/include/python${python_version}"
30
38
if test "$python_prefix" != "$python_execprefix"; then
31
39
python_includespec="-I${python_execprefix}/include/python${python_version} $python_includespec"
Original file line number Diff line number Diff line change @@ -4221,12 +4221,25 @@ echo "$as_me: error: Python not found" >&2;}
4221
4221
fi
4222
4222
4223
4223
4224
+ echo "$as_me:$LINENO: checking for Python distutils module" >&5
4225
+ echo $ECHO_N "checking for Python distutils module... $ECHO_C" >&6
4226
+ if "${PYTHON}" 2>&- -c 'import distutils'
4227
+ then
4228
+ echo "$as_me:$LINENO: result: yes" >&5
4229
+ echo "${ECHO_T}yes" >&6
4230
+ else
4231
+ echo "$as_me:$LINENO: result: no" >&5
4232
+ echo "${ECHO_T}no" >&6
4233
+ { { echo "$as_me:$LINENO: error: distutils module not found" >&5
4234
+ echo "$as_me: error: distutils module not found" >&2;}
4235
+ { (exit 1); exit 1; }; }
4236
+ fi
4224
4237
echo "$as_me:$LINENO: checking Python installation directories" >&5
4225
4238
echo $ECHO_N "checking Python installation directories... $ECHO_C" >&6
4226
4239
python_version=`${PYTHON} -c "import sys; print sys.version[:3]"`
4227
4240
python_prefix=`${PYTHON} -c "import sys; print sys.prefix"`
4228
4241
python_execprefix=`${PYTHON} -c "import sys; print sys.exec_prefix"`
4229
- python_configdir="${python_execprefix}/lib/python${python_version}/ config"
4242
+ python_configdir=`${PYTHON} -c "from distutils.sysconfig import get_python_lib as f; import os; print os.path.join(f(plat_specific=1,standard_lib=1),' config')"`
4230
4243
python_includespec="-I${python_prefix}/include/python${python_version}"
4231
4244
if test "$python_prefix" != "$python_execprefix"; then
4232
4245
python_includespec="-I${python_execprefix}/include/python${python_version} $python_includespec"
You can’t perform that action at this time.
0 commit comments