@@ -8230,41 +8230,39 @@ if test x"$PYTHON" = x""; then
8230
8230
fi
8231
8231
8232
8232
8233
- { $as_echo " $as_me :${as_lineno-$LINENO } : checking for Python distutils module" >&5
8234
- $as_echo_n " checking for Python distutils module... " >&6 ; }
8235
- if " ${PYTHON} " -c ' import distutils' 2>&5
8233
+ python_fullversion=` ${PYTHON} -c " import sys; print(sys.version)" | sed q`
8234
+ { $as_echo " $as_me :${as_lineno-$LINENO } : using python $python_fullversion " >&5
8235
+ $as_echo " $as_me : using python $python_fullversion " >&6 ; }
8236
+ # python_fullversion is typically n.n.n plus some trailing junk
8237
+ python_majorversion=` echo " $python_fullversion " | sed ' s/^\([0-9]*\).*/\1/' `
8238
+ python_minorversion=` echo " $python_fullversion " | sed ' s/^[0-9]*\.\([0-9]*\).*/\1/' `
8239
+ python_version=` echo " $python_fullversion " | sed ' s/^\([0-9]*\.[0-9]*\).*/\1/' `
8240
+ # Reject unsupported Python versions as soon as practical.
8241
+ if test " $python_majorversion " -lt 3 -a " $python_minorversion " -lt 7; then
8242
+ as_fn_error $? " Python version $python_version is too old (version 2.7 or later is required)" " $LINENO " 5
8243
+ fi
8244
+
8245
+ { $as_echo " $as_me :${as_lineno-$LINENO } : checking for Python sysconfig module" >&5
8246
+ $as_echo_n " checking for Python sysconfig module... " >&6 ; }
8247
+ if " ${PYTHON} " -c ' import sysconfig' 2>&5
8236
8248
then
8237
8249
{ $as_echo " $as_me :${as_lineno-$LINENO } : result: yes" >&5
8238
8250
$as_echo " yes" >&6 ; }
8239
8251
else
8240
8252
{ $as_echo " $as_me :${as_lineno-$LINENO } : result: no" >&5
8241
8253
$as_echo " no" >&6 ; }
8242
- as_fn_error $? " distutils module not found" " $LINENO " 5
8254
+ as_fn_error $? " sysconfig module not found" " $LINENO " 5
8243
8255
fi
8256
+
8244
8257
{ $as_echo " $as_me :${as_lineno-$LINENO } : checking Python configuration directory" >&5
8245
8258
$as_echo_n " checking Python configuration directory... " >&6 ; }
8246
- python_majorversion=` ${PYTHON} -c " import sys; print(sys.version[0])" `
8247
- python_minorversion=` ${PYTHON} -c " import sys; print(sys.version[2])" `
8248
- python_version=` ${PYTHON} -c " import sys; print(sys.version[:3])" `
8249
- python_configdir=` ${PYTHON} -c " import distutils.sysconfig; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LIBPL'))))" `
8259
+ python_configdir=` ${PYTHON} -c " import sysconfig; print(' '.join(filter(None,sysconfig.get_config_vars('LIBPL'))))" `
8250
8260
{ $as_echo " $as_me :${as_lineno-$LINENO } : result: $python_configdir " >&5
8251
8261
$as_echo " $python_configdir " >&6 ; }
8252
8262
8253
- # Reject unsupported Python versions as soon as practical.
8254
- if test " $python_majorversion " -lt 3 -a " $python_minorversion " -lt 4; then
8255
- as_fn_error $? " Python version $python_version is too old (version 2.4 or later is required)" " $LINENO " 5
8256
- fi
8257
-
8258
- { $as_echo " $as_me :${as_lineno-$LINENO } : checking Python include directories" >&5
8259
- $as_echo_n " checking Python include directories... " >&6 ; }
8260
- python_includespec=` ${PYTHON} -c "
8261
- import distutils.sysconfig
8262
- a = '-I' + distutils.sysconfig.get_python_inc(False)
8263
- b = '-I' + distutils.sysconfig.get_python_inc(True)
8264
- if a == b:
8265
- print(a)
8266
- else:
8267
- print(a + ' ' + b)" `
8263
+ { $as_echo " $as_me :${as_lineno-$LINENO } : checking Python include directory" >&5
8264
+ $as_echo_n " checking Python include directory... " >&6 ; }
8265
+ python_includespec=` ${PYTHON} -c " import sysconfig; print('-I' + sysconfig.get_config_var('INCLUDEPY'))" `
8268
8266
if test " $PORTNAME " = win32 ; then
8269
8267
python_includespec=` echo $python_includespec | sed ' s,[\],/,g' `
8270
8268
fi
@@ -8276,8 +8274,8 @@ $as_echo "$python_includespec" >&6; }
8276
8274
{ $as_echo " $as_me :${as_lineno-$LINENO } : checking how to link an embedded Python application" >&5
8277
8275
$as_echo_n " checking how to link an embedded Python application... " >&6 ; }
8278
8276
8279
- python_libdir=` ${PYTHON} -c " import distutils. sysconfig; print(' '.join(filter(None,distutils. sysconfig.get_config_vars('LIBDIR'))))" `
8280
- python_ldlibrary=` ${PYTHON} -c " import distutils. sysconfig; print(' '.join(filter(None,distutils. sysconfig.get_config_vars('LDLIBRARY'))))" `
8277
+ python_libdir=` ${PYTHON} -c " import sysconfig; print(' '.join(filter(None,sysconfig.get_config_vars('LIBDIR'))))" `
8278
+ python_ldlibrary=` ${PYTHON} -c " import sysconfig; print(' '.join(filter(None,sysconfig.get_config_vars('LDLIBRARY'))))" `
8281
8279
8282
8280
# If LDLIBRARY exists and has a shlib extension, use it verbatim.
8283
8281
ldlibrary=` echo " ${python_ldlibrary} " | sed -e ' s/\.so$//' -e ' s/\.dll$//' -e ' s/\.dylib$//' -e ' s/\.sl$//' `
@@ -8289,11 +8287,11 @@ else
8289
8287
# Otherwise, guess the base name of the shlib.
8290
8288
# LDVERSION was added in Python 3.2, before that use VERSION,
8291
8289
# or failing that, $python_version from _PGAC_CHECK_PYTHON_DIRS.
8292
- python_ldversion=` ${PYTHON} -c " import distutils. sysconfig; print(' '.join(filter(None,distutils. sysconfig.get_config_vars('LDVERSION'))))" `
8290
+ python_ldversion=` ${PYTHON} -c " import sysconfig; print(' '.join(filter(None,sysconfig.get_config_vars('LDVERSION'))))" `
8293
8291
if test x" ${python_ldversion} " ! = x" " ; then
8294
8292
ldlibrary=" python${python_ldversion} "
8295
8293
else
8296
- python_version_var=` ${PYTHON} -c " import distutils. sysconfig; print(' '.join(filter(None,distutils. sysconfig.get_config_vars('VERSION'))))" `
8294
+ python_version_var=` ${PYTHON} -c " import sysconfig; print(' '.join(filter(None,sysconfig.get_config_vars('VERSION'))))" `
8297
8295
if test x" ${python_version_var} " ! = x" " ; then
8298
8296
ldlibrary=" python${python_version_var} "
8299
8297
else
@@ -8353,7 +8351,7 @@ PL/Python." "$LINENO" 5
8353
8351
fi
8354
8352
python_libspec=" -L${python_libdir} -l${ldlibrary} "
8355
8353
8356
- python_additional_libs=` ${PYTHON} -c " import distutils. sysconfig; print(' '.join(filter(None,distutils. sysconfig.get_config_vars('LIBS','LIBC','LIBM','BASEMODLIBS'))))" `
8354
+ python_additional_libs=` ${PYTHON} -c " import sysconfig; print(' '.join(filter(None,sysconfig.get_config_vars('LIBS','LIBC','LIBM','BASEMODLIBS'))))" `
8357
8355
8358
8356
{ $as_echo " $as_me :${as_lineno-$LINENO } : result: ${python_libspec} ${python_additional_libs} " >&5
8359
8357
$as_echo " ${python_libspec} ${python_additional_libs} " >&6 ; }
0 commit comments