1
- # generated automatically by aclocal 1.16.1 -*- Autoconf -*-
1
+ # generated automatically by aclocal 1.16.5 -*- Autoconf -*-
2
2
3
- # Copyright (C) 1996-2018 Free Software Foundation, Inc.
3
+ # Copyright (C) 1996-2021 Free Software Foundation, Inc.
4
4
5
5
# This file is free software; the Free Software Foundation
6
6
# gives unlimited permission to copy and/or distribute it,
12
12
# PARTICULAR PURPOSE.
13
13
14
14
m4_ifndef ( [ AC_CONFIG_MACRO_DIRS] , [ m4_defun([ _AM_CONFIG_MACRO_DIRS] , [ ] )m4_defun([ AC_CONFIG_MACRO_DIRS] , [ _AM_CONFIG_MACRO_DIRS($@ )] )] )
15
- # Copyright (C) 1999-2018 Free Software Foundation, Inc.
15
+ # Copyright (C) 1999-2021 Free Software Foundation, Inc.
16
16
#
17
17
# This file is free software; the Free Software Foundation
18
18
# gives unlimited permission to copy and/or distribute it,
@@ -47,6 +47,7 @@ AC_DEFUN([AM_PATH_PYTHON],
47
47
dnl supported. (2.0 was released on October 16, 2000).
48
48
m4_define_default([ _AM_PYTHON_INTERPRETER_LIST] ,
49
49
[ python python2 python3 dnl
50
+ python3.11 python3.10 dnl
50
51
python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 dnl
51
52
python3.2 python3.1 python3.0 dnl
52
53
python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 dnl
@@ -91,34 +92,141 @@ AC_DEFUN([AM_PATH_PYTHON],
91
92
] )
92
93
93
94
if test "$PYTHON" = :; then
94
- dnl Run any user-specified action, or abort.
95
+ dnl Run any user-specified action, or abort.
95
96
m4_default ( [ $3 ] , [ AC_MSG_ERROR ( [ no suitable Python interpreter found] ) ] )
96
97
else
97
98
98
- dnl Query Python for its version number. Getting [ :3] seems to be
99
- dnl the best way to do this; it's what "site.py" does in the standard
100
- dnl library.
101
-
99
+ dnl Query Python for its version number. Although site.py simply uses
100
+ dnl sys.version[ :3] , printing that failed with Python 3.10, since the
101
+ dnl trailing zero was eliminated. So now we output just the major
102
+ dnl and minor version numbers, as numbers. Apparently the tertiary
103
+ dnl version is not of interest.
104
+ dnl
102
105
AC_CACHE_CHECK ( [ for $am_display_PYTHON version] , [ am_cv_python_version] ,
103
- [ am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write( sys.version [ [ :3 ] ] )"`] )
106
+ [ am_cv_python_version=`$PYTHON -c "import sys; print ('%u.%u' % sys.version_info [ [ :2 ] ] )"`] )
104
107
AC_SUBST ( [ PYTHON_VERSION] , [ $am_cv_python_version] )
105
108
106
- dnl Use the values of $prefix and $exec_prefix for the corresponding
107
- dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made
108
- dnl distinct variables so they can be overridden if need be. However,
109
- dnl general consensus is that you shouldn't need this ability.
110
-
111
- AC_SUBST ( [ PYTHON_PREFIX] , [ '${prefix}'] )
112
- AC_SUBST ( [ PYTHON_EXEC_PREFIX] , [ '${exec_prefix}'] )
113
-
114
- dnl At times (like when building shared libraries) you may want
109
+ dnl At times, e.g., when building shared libraries, you may want
115
110
dnl to know which OS platform Python thinks this is.
116
-
111
+ dnl
117
112
AC_CACHE_CHECK ( [ for $am_display_PYTHON platform] , [ am_cv_python_platform] ,
118
113
[ am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`] )
119
114
AC_SUBST ( [ PYTHON_PLATFORM] , [ $am_cv_python_platform] )
120
115
121
- # Just factor out some code duplication.
116
+ dnl emacs-page
117
+ dnl If --with-python-sys-prefix is given, use the values of sys.prefix
118
+ dnl and sys.exec_prefix for the corresponding values of PYTHON_PREFIX
119
+ dnl and PYTHON_EXEC_PREFIX. Otherwise, use the GNU ${prefix} and
120
+ dnl ${exec_prefix} variables.
121
+ dnl
122
+ dnl The two are made distinct variables so they can be overridden if
123
+ dnl need be, although general consensus is that you shouldn't need
124
+ dnl this separation.
125
+ dnl
126
+ dnl Also allow directly setting the prefixes via configure options,
127
+ dnl overriding any default.
128
+ dnl
129
+ if test "x$prefix" = xNONE; then
130
+ am__usable_prefix=$ac_default_prefix
131
+ else
132
+ am__usable_prefix=$prefix
133
+ fi
134
+
135
+ # Allow user to request using sys.* values from Python,
136
+ # instead of the GNU $prefix values.
137
+ AC_ARG_WITH ( [ python-sys-prefix] ,
138
+ [ AS_HELP_STRING ( [ --with-python-sys-prefix] ,
139
+ [ use Python's sys.prefix and sys.exec_prefix values] ) ] ,
140
+ [ am_use_python_sys=:] ,
141
+ [ am_use_python_sys=false] )
142
+
143
+ # Allow user to override whatever the default Python prefix is.
144
+ AC_ARG_WITH ( [ python_prefix] ,
145
+ [ AS_HELP_STRING ( [ --with-python_prefix] ,
146
+ [ override the default PYTHON_PREFIX] ) ] ,
147
+ [ am_python_prefix_subst=$withval
148
+ am_cv_python_prefix=$withval
149
+ AC_MSG_CHECKING ( [ for explicit $am_display_PYTHON prefix] )
150
+ AC_MSG_RESULT ( [ $am_cv_python_prefix] ) ] ,
151
+ [
152
+ if $am_use_python_sys; then
153
+ # using python sys.prefix value, not GNU
154
+ AC_CACHE_CHECK ( [ for python default $am_display_PYTHON prefix] ,
155
+ [ am_cv_python_prefix] ,
156
+ [ am_cv_python_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"`] )
157
+
158
+ dnl If sys.prefix is a subdir of $prefix, replace the literal value of
159
+ dnl $prefix with a variable reference so it can be overridden.
160
+ case $am_cv_python_prefix in
161
+ $am__usable_prefix*)
162
+ am__strip_prefix=`echo "$am__usable_prefix" | sed 's|.|.|g'`
163
+ am_python_prefix_subst=`echo "$am_cv_python_prefix" | sed "s,^$am__strip_prefix,\\${prefix},"`
164
+ ;;
165
+ *)
166
+ am_python_prefix_subst=$am_cv_python_prefix
167
+ ;;
168
+ esac
169
+ else # using GNU prefix value, not python sys.prefix
170
+ am_python_prefix_subst='${prefix}'
171
+ am_python_prefix=$am_python_prefix_subst
172
+ AC_MSG_CHECKING ( [ for GNU default $am_display_PYTHON prefix] )
173
+ AC_MSG_RESULT ( [ $am_python_prefix] )
174
+ fi] )
175
+ # Substituting python_prefix_subst value.
176
+ AC_SUBST ( [ PYTHON_PREFIX] , [ $am_python_prefix_subst] )
177
+
178
+ # emacs-page Now do it all over again for Python exec_prefix, but with yet
179
+ # another conditional: fall back to regular prefix if that was specified.
180
+ AC_ARG_WITH ( [ python_exec_prefix] ,
181
+ [ AS_HELP_STRING ( [ --with-python_exec_prefix] ,
182
+ [ override the default PYTHON_EXEC_PREFIX] ) ] ,
183
+ [ am_python_exec_prefix_subst=$withval
184
+ am_cv_python_exec_prefix=$withval
185
+ AC_MSG_CHECKING ( [ for explicit $am_display_PYTHON exec_prefix] )
186
+ AC_MSG_RESULT ( [ $am_cv_python_exec_prefix] ) ] ,
187
+ [
188
+ # no explicit --with-python_exec_prefix, but if
189
+ # --with-python_prefix was given, use its value for python_exec_prefix too.
190
+ AS_IF ( [ test -n "$with_python_prefix"] ,
191
+ [ am_python_exec_prefix_subst=$with_python_prefix
192
+ am_cv_python_exec_prefix=$with_python_prefix
193
+ AC_MSG_CHECKING ( [ for python_prefix-given $am_display_PYTHON exec_prefix] )
194
+ AC_MSG_RESULT ( [ $am_cv_python_exec_prefix] ) ] ,
195
+ [
196
+ # Set am__usable_exec_prefix whether using GNU or Python values,
197
+ # since we use that variable for pyexecdir.
198
+ if test "x$exec_prefix" = xNONE; then
199
+ am__usable_exec_prefix=$am__usable_prefix
200
+ else
201
+ am__usable_exec_prefix=$exec_prefix
202
+ fi
203
+ #
204
+ if $am_use_python_sys; then # using python sys.exec_prefix, not GNU
205
+ AC_CACHE_CHECK ( [ for python default $am_display_PYTHON exec_prefix] ,
206
+ [ am_cv_python_exec_prefix] ,
207
+ [ am_cv_python_exec_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.exec_prefix)"`] )
208
+ dnl If sys.exec_prefix is a subdir of $exec_prefix, replace the
209
+ dnl literal value of $exec_prefix with a variable reference so it can
210
+ dnl be overridden.
211
+ case $am_cv_python_exec_prefix in
212
+ $am__usable_exec_prefix*)
213
+ am__strip_prefix=`echo "$am__usable_exec_prefix" | sed 's|.|.|g'`
214
+ am_python_exec_prefix_subst=`echo "$am_cv_python_exec_prefix" | sed "s,^$am__strip_prefix,\\${exec_prefix},"`
215
+ ;;
216
+ *)
217
+ am_python_exec_prefix_subst=$am_cv_python_exec_prefix
218
+ ;;
219
+ esac
220
+ else # using GNU $exec_prefix, not python sys.exec_prefix
221
+ am_python_exec_prefix_subst='${exec_prefix}'
222
+ am_python_exec_prefix=$am_python_exec_prefix_subst
223
+ AC_MSG_CHECKING ( [ for GNU default $am_display_PYTHON exec_prefix] )
224
+ AC_MSG_RESULT ( [ $am_python_exec_prefix] )
225
+ fi] ) ] )
226
+ # Substituting python_exec_prefix_subst.
227
+ AC_SUBST ( [ PYTHON_EXEC_PREFIX] , [ $am_python_exec_prefix_subst] )
228
+
229
+ # Factor out some code duplication into this shell variable.
122
230
am_python_setup_sysconfig="\
123
231
import sys
124
232
# Prefer sysconfig over distutils.sysconfig, for better compatibility
@@ -138,96 +246,109 @@ try:
138
246
except ImportError:
139
247
pass"
140
248
141
- dnl Set up 4 directories:
249
+ dnl emacs-page Set up 4 directories:
142
250
143
- dnl pythondir -- where to install python scripts. This is the
144
- dnl site-packages directory, not the python standard library
145
- dnl directory like in previous automake betas. This behavior
146
- dnl is more consistent with lispdir.m4 for example.
251
+ dnl 1. pythondir: where to install python scripts. This is the
252
+ dnl site-packages directory, not the python standard library
253
+ dnl directory like in previous automake betas. This behavior
254
+ dnl is more consistent with lispdir.m4 for example.
147
255
dnl Query distutils for this directory.
148
- AC_CACHE_CHECK ( [ for $am_display_PYTHON script directory ] ,
149
- [ am_cv_python_pythondir ] ,
150
- [ if test "x$prefix" = xNONE
151
- then
152
- am_py_prefix=$ac_default_prefix
153
- else
154
- am_py_prefix=$prefix
155
- fi
156
- am_cv_python_pythondir=`$PYTHON -c "
256
+ dnl
257
+ AC_CACHE_CHECK ( [ for $am_display_PYTHON script directory (pythondir) ] ,
258
+ [ am_cv_python_pythondir ] ,
259
+ [ if test "x$am_cv_python_prefix" = x; then
260
+ am_py_prefix=$am__usable_prefix
261
+ else
262
+ am_py_prefix=$am_cv_python_prefix
263
+ fi
264
+ am_cv_python_pythondir=`$PYTHON -c "
157
265
$am_python_setup_sysconfig
158
266
if can_use_sysconfig:
159
- sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'})
267
+ if hasattr(sysconfig, 'get_default_scheme'):
268
+ scheme = sysconfig.get_default_scheme()
269
+ else:
270
+ scheme = sysconfig._get_default_scheme()
271
+ if scheme == 'posix_local':
272
+ # Debian's default scheme installs to /usr/local/ but we want to find headers in /usr/
273
+ scheme = 'posix_prefix'
274
+ sitedir = sysconfig.get_path('purelib', scheme, vars={'base':'$am_py_prefix'})
160
275
else:
161
- from distutils import sysconfig
162
- sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix')
276
+ from distutils import sysconfig
277
+ sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix')
163
278
sys.stdout.write(sitedir)"`
164
- case $am_cv_python_pythondir in
165
- $am_py_prefix*)
166
- am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'`
167
- am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"`
168
- ;;
169
- *)
170
- case $am_py_prefix in
171
- /usr|/System*) ;;
172
- *)
173
- am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages
174
- ;;
175
- esac
176
- ;;
279
+ #
280
+ case $am_cv_python_pythondir in
281
+ $am_py_prefix*)
282
+ am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'`
283
+ am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,\\${PYTHON_PREFIX},"`
284
+ ;;
285
+ *)
286
+ case $am_py_prefix in
287
+ /usr|/System*) ;;
288
+ *) am_cv_python_pythondir="\${PYTHON_PREFIX}/lib/python$PYTHON_VERSION/site-packages"
289
+ ;;
177
290
esac
178
- ] )
291
+ ;;
292
+ esac
293
+ ] )
179
294
AC_SUBST ( [ pythondir] , [ $am_cv_python_pythondir] )
180
295
181
- dnl pkgpythondir -- $PACKAGE directory under pythondir. Was
182
- dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is
183
- dnl more consistent with the rest of automake.
184
-
296
+ dnl 2. pkgpythondir: $PACKAGE directory under pythondir. Was
297
+ dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is
298
+ dnl more consistent with the rest of automake.
299
+ dnl
185
300
AC_SUBST ( [ pkgpythondir] , [ \${pythondir}/$PACKAGE] )
186
301
187
- dnl pyexecdir -- directory for installing python extension modules
188
- dnl (shared libraries)
302
+ dnl 3. pyexecdir: directory for installing python extension modules
303
+ dnl (shared libraries).
189
304
dnl Query distutils for this directory.
190
- AC_CACHE_CHECK ( [ for $am_display_PYTHON extension module directory ] ,
191
- [ am_cv_python_pyexecdir ] ,
192
- [ if test "x$exec_prefix" = xNONE
193
- then
194
- am_py_exec_prefix=$am_py_prefix
195
- else
196
- am_py_exec_prefix=$exec_prefix
197
- fi
198
- am_cv_python_pyexecdir=`$PYTHON -c "
305
+ dnl
306
+ AC_CACHE_CHECK ( [ for $am_display_PYTHON extension module directory (pyexecdir) ] ,
307
+ [ am_cv_python_pyexecdir ] ,
308
+ [ if test "x$am_cv_python_exec_prefix" = x; then
309
+ am_py_exec_prefix=$am__usable_exec_prefix
310
+ else
311
+ am_py_exec_prefix=$am_cv_python_exec_prefix
312
+ fi
313
+ am_cv_python_pyexecdir=`$PYTHON -c "
199
314
$am_python_setup_sysconfig
200
315
if can_use_sysconfig:
201
- sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_prefix'})
316
+ if hasattr(sysconfig, 'get_default_scheme'):
317
+ scheme = sysconfig.get_default_scheme()
318
+ else:
319
+ scheme = sysconfig._get_default_scheme()
320
+ if scheme == 'posix_local':
321
+ # Debian's default scheme installs to /usr/local/ but we want to find headers in /usr/
322
+ scheme = 'posix_prefix'
323
+ sitedir = sysconfig.get_path('platlib', scheme, vars={'platbase':'$am_py_exec_prefix'})
202
324
else:
203
- from distutils import sysconfig
204
- sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix ')
325
+ from distutils import sysconfig
326
+ sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_exec_prefix ')
205
327
sys.stdout.write(sitedir)"`
206
- case $am_cv_python_pyexecdir in
207
- $am_py_exec_prefix*)
208
- am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'`
209
- am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"`
210
- ;;
211
- *)
212
- case $am_py_exec_prefix in
213
- /usr|/System*) ;;
214
- *)
215
- am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages
216
- ;;
217
- esac
218
- ;;
328
+ #
329
+ case $am_cv_python_pyexecdir in
330
+ $am_py_exec_prefix*)
331
+ am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'`
332
+ am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,\\${PYTHON_EXEC_PREFIX},"`
333
+ ;;
334
+ *)
335
+ case $am_py_exec_prefix in
336
+ /usr|/System*) ;;
337
+ *) am_cv_python_pyexecdir="\${PYTHON_EXEC_PREFIX}/lib/python$PYTHON_VERSION/site-packages"
338
+ ;;
219
339
esac
220
- ] )
340
+ ;;
341
+ esac
342
+ ] )
221
343
AC_SUBST ( [ pyexecdir] , [ $am_cv_python_pyexecdir] )
222
344
223
- dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE)
224
-
345
+ dnl 4. pkgpyexecdir: $(pyexecdir)/$(PACKAGE)
346
+ dnl
225
347
AC_SUBST ( [ pkgpyexecdir] , [ \${pyexecdir}/$PACKAGE] )
226
348
227
349
dnl Run any user-specified action.
228
350
$2
229
351
fi
230
-
231
352
] )
232
353
233
354
0 commit comments