62 Commits

Author SHA1 Message Date
Paul Eggert
61075eab73 maint: make update-copyright 2025-01-01 14:39:21 -08:00
Karl Berry
70128b8bcc python: use deb_system instead of posix_local if prefix = /usr.
Continuing with https://debbugs.gnu.org/cgi/bugreport.cgi?bug=54412.

* m4/python.m4 (AM_PATH_PYTHON) <am_python_setup_scheme>:
factor out common scheme-related code to this new variable.
If the scheme is posix_local and the prefix is /usr,
use deb_system (for Debian package builds).
* NEWS: more explanations (and unrelated references, en passant).
2024-01-20 14:33:14 -08:00
Gianfranco Costamagna
ac64ce260a python: use posix_prefix instead of posix_local on Debian.
From https://debbugs.gnu.org/cgi/bugreport.cgi?bug=54412#17.
(Patch slightly adapted by Bogdan from original by Gianfranco,
as posted by Stefano Rivera in message#14.)

* m4/python.m4 (AM_PATH_PYTHON): replace Debian's posix_local
scheme with posix_prefix.
* doc/automake.texi (Python) <pythondir>: say a bit more.
* NEWS: mention this.
2024-01-17 14:48:13 -08:00
Mike Frysinger
3cd8f54560 python: add 3.20 - 3.16 to the version search list.
* m4/python.m4: Add python3.20 - python3.16.
* NEWS: Mention these versions too.
2024-01-13 18:09:02 -08:00
Paul Eggert
b80b5c476e maint: make update-copyright 2024-01-01 13:23:27 -08:00
Mike Frysinger
6b4304c121 python: prioritize python 3.x over 2.x
Since Python 2.x went EOL years ago, stop searching for it before
any of the Python 3 versions.

* m4/python.m4: Move python2 after all python3 versions.
* NEWS: Mention update in version search.
2023-12-02 06:23:31 -05:00
Mike Frysinger
34bdde960f maint: make update-copyright 2023-01-04 02:00:14 -05:00
Mike Frysinger
930a9a73f4 python: add 3.10 - 3.15 to the version search list
Fixes automake bug https://bugs.gnu.org/53530.

Based on the cadence of Automake releases, add the current Python
release (3.10), the current Python development (3.11), and then 4
more versions on top of that.  It doesn't hurt to check for a few
extra versions here since this is the fallback logic when the main
`python` and `python3` programs aren't found.

* m4/python.m4: Add python3.10 - python3.15.
* NEWS: Mention new Python versions.
2022-01-26 21:55:29 -05:00
Jim Meyering
6c8ff6a8f3 maint: make update-copyright 2022-01-12 14:15:12 -08:00
Jim Meyering
524d99612b maint: remove trailing white space from a few files
* NEWS: Remove trailing white space.
* NEWS-2.0: Likewise.
* contrib/checklinkx: Likewise.
* doc/local.mk (chlx_args): Likewise.
* m4/python.m4: Likewise.
* t/test-extensions-empty.sh: Likewise.
2021-10-03 19:51:12 -07:00
Karl Berry
5638784357 python: only use Python's sys.* values if the new option
--with-python-sys-prefix is specified; otherwise, return to
previous behavior of using the GNU ${prefix} and ${exec_prefix}.

* doc/automake.texi (Python): document the new behavior.
* m4/python.m4 (AM_PATH_PYTHON): conditionalize use of Python's
sys.* values on the new option --with-python-sys-prefix.
* t/python-prefix.sh: doc update.
* t/python-vars.sh: test both GNU and Python prefix values.
* NEWS: mention this.
2021-09-19 15:12:27 -07:00
Joshua Root
ed8daa069a python: use Python's sys.prefix and sys.exec_prefix
for PYTHON_PREFIX and PYTHON_EXEC_PREFIX; new configure options
--with-python_prefix and --with-python_exec_prefix to set explicitly.

This change fixes https://bugs.gnu.org/35322.

* m4/python.m4 (AM_PATH_PYTHON): use Python's sys.prefix and
sys.exec_prefix for PYTHON_PREFIX and PYTHON_EXEC_PREFIX,
instead of $prefix and $exec_prefix. But use a variable
reference to ${prefix} if it is contained within sys.prefix;
similarly for exec_prefix. Also support new configure options
to set explicitly.
(PYTHON_PREFIX, PYTHON_EXEC_PREFIX): AC_SUBST these.
(am_cv_python_pythondir): use our new $am_cv_python_prefix,
substituting ${PYTHON_PREFIX}.
(am_cv_python_pyexecdir): likewise.
* doc/automake.texi (Python): PYTHON_PREFIX, PYTHON_EXEC_PREFIX,
document new approach.
* t/instmany-python.sh: set PYTHON_PREFIX as needed.
* t/python-vars.sh (PYTHON_EXEC_PREFIX, PYTHON_PREFIX): also set from
Python's sys.{exec_,}prefix; use ${PYTHON_{EXEC,}PREFIX} instead
of ${exec_,}prefix.
2021-05-18 15:11:59 -07:00
Miro Hron\v{c}ok
e21d46fddd python: determine Python (3.10) version number correctly.
This change fixes https://bugs.gnu.org/44239
(and https://bugzilla.redhat.com/show_bug.cgi?id=1889732).

* m4/python.m4: use print('%u.%u' % sys.version_info[:2]) for
the version number instead of merely sys.version[:3], so the
numbers are treated as numbers.
* t/python-vars.sh (PYTHON_VERSION): Likewise.
* doc/automake.texi: Document it.
* NEWS: mention it. (Minor tweaks from Karl Berry.)
2020-10-27 14:33:46 -07:00
Jim Meyering
cf27a3dfc6 maint: make update-copyright 2020-01-01 11:44:41 -08:00
Paul Eggert
5ae02cc829 maint: make update-copyright 2019-10-14 13:47:25 -07:00
Mathieu Lirzin
9385c16170
python: Support future python version up to 3.9
This change fixes automake bug#28160.

Since AM_PYTHON_PATH macro takes no maximum version argument, there is
no need to generate _AM_PYTHON_INTERPRETER_LIST dynamically, like what
was previously done by the reverted commit
1d60fb72168e62d33fe433380af621de64e22f23.  We could rely on M4 to
generate this list statically however this is likely to be a complex
solution that would not improve maintainability.

* m4/python.m4 (_AM_PYTHON_INTERPRETER_LIST): Add 'python3.7',
'python3.8', and 'python3.9'.
* NEWS: Update.
2018-03-08 21:26:56 +01:00
Mathieu Lirzin
4ef6c2d17d
Revert "python: Generate python interpreter list"
This reverts commit 1d60fb72168e62d33fe433380af621de64e22f23.
2018-03-03 12:00:31 +01:00
Mathieu Lirzin
1d60fb7216
python: Generate python interpreter list
_AM_PYTHON_INTERPRETER_LIST is used by AM_PYTHON_PATH to autodetect
Python programs whose names correspond to a specific Python
version (e.g. python3.6).  Previously this list was updated manually.
The automatic support of newer versions (up to 4.0 excluded) fixes
bug#28160.

* m4/python.m4 (am_py_min_ver, am_py_max_ver): New macros.
(_AM_PYTHON_INTERPRETER_LIST): Generate this list instead of hard-coding
it.  Implementation is taken from GNU Pyconfigure.
2018-02-04 01:33:32 +01:00
Mathieu Lirzin
bbaa4cdcd3
maint: Update copyright years to 2018
This update has been made with 'make update-copyright'.
2018-01-04 16:23:13 +01:00
Mathieu Lirzin
87becfb21a
python: Add python3.6
This fixes bug#27458.

* m4/python.m4 (AM_PATH_PYTHON): Add python3.6.
2017-07-15 15:51:28 +02:00
Mathieu Lirzin
d8add592d8
maint: Update copyright years to 2017.
This update has been made with 'make update-copyright'.
2017-03-02 19:02:28 +01:00
Paul Eggert
e363f9a4b5 python: add python3.5, python3.4
* m4/python.m4 (AM_PATH_PYTHON): Add python3.5, python3.4.
2016-04-20 15:30:13 -07:00
Stefano Lattarini
5de75f07dc maint: update copyright years to 2015 (branch 'micro')
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
2015-01-05 22:51:25 +01:00
Stefano Lattarini
a78f63c5d5 maint: update copyright years
We've been in 2014 already for few months now...

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
2014-04-21 15:10:58 +01:00
Stefano Lattarini
7df8b28cb1 maint: update copyright year for 2013 (in branch maint)
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
2012-12-31 18:22:36 +01:00
Stefano Lattarini
1f113f6bc8 python: make installed modules find by default on Debian and Ubuntu
This change fixes automake bug#10227.

The code used to get the python package directory was wrong for Python 3,
at least on Debian and Ubuntu distributions.  In the case the installation
was using the default prefix "/usr/local", python modules were incorrectly
installed in the directory

    /usr/local/lib/python3/dist-packages

(which is *not* searched by default), rather than in a directory like

    /usr/local/lib/python3.x/dist-packages

which is searched by default.

* m4/python.m4 (AM_PATH_PYTHON): Try to use the 'sysconfig' module if
possible, for better interactions with python 3.x.

Helped-by: Reuben Thomas <rrt@sc3d.org>
Helped-by: Roumen Petrov <bugtrack@roumenpetrov.info>
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
2012-11-24 12:28:20 +01:00
Yaakov Selkowitz
e0e99eda36 python: improve support for modern python (CPython 3.2 and PyPy)
This fixes automake bug#8847.

* m4/python.m4 (AM_PATH_PYTHON): Add python3.3 to
_AM_PYTHON_INTERPRETER_LIST.
* lib/py-compile: Fix compiled filenames for PEP-3147, currently
implemented in CPython 3.2 and newer.  Do not create '.pyo' files
for PyPy.

Copyright-paperwork-exempt: yes
Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
2012-11-11 01:26:43 +01:00
Stefano Lattarini
6e3c0b92fd m4: get rid of "# serial" lines
The "#serial" lines are only considered by aclocal for the system-wide
third-party '.m4' files, not for the Automake-provided ones.  So they
serve no real purpose in the Automake '.m4' files.

In addition, now that we use git and topic branches, and that we are also
writing the Automake-NG fork, the "#serial" lines are becoming more and
more unreliable (e.g., different version of the same file in different
branches can easily end up having the same serial numbers).

So let's just nuke all the "#serial" lines.  See also automake bug#11932.

* m4/*.m4: All "# serial" lines removed.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
2012-07-14 19:02:52 +02:00
Stefano Lattarini
641a5a4bf0 maint: run "make update-copyright" 2012-02-16 10:46:23 +01:00
Stefano Lattarini
72c8dcb2f1 Merge branch 'maint' into master.
* m4/regex.m4: Bump serial number by some notches, for good
measure.  Prefer the deprecation message from maint over that
from master.
* m4/python.m4: Bump serial number.
* tests/Makefile.am (canon6.log): Depend on `libtool-macros.log'.
(canon7.log): Likewise.
(extradep2.log): Likewise.
(ar-lib4.log): Likewise.
(ar-lib6a.log): Likewise.
(ar-lib6b.log): Likewise.
(vartypo2): Likewise.
(posixsubst-ltlibraries.log): Likewise.
* tests/defs: Adjust the path of the included `get.sh' scripts
generated by `libtool-macros.test' and `gettext-macros.test'.
* aclocal.m4: Delete, it's auto-generated now.
* configure: Likewise.
* Makefile.in: Likewise.
* doc/Makefile.in: Likewise.
* m4/Makefile.in: Likewise.
* tests/Makefile.in: Likewise.
* lib/Makefile.in: Likewise.
* lib/am/Makefile.in: Likewise.
* lib/Automake/Makefile.in: Likewise.
* lib/Automake/tests/Makefile.in: Likewise.
* .gitignore: Correctly ignored the autogenerated files
that are not committed anymore.
2011-12-22 22:57:04 +01:00
Reuben Thomas
9999ab7314 python: remove relics for Python 1.5 support
* m4/python.m4: The comments in here claim to support only
Python >= 2.0, yet this file still has specific support for
Python 1.5.  Just remove it, python 1.5 is 12 years old now,
and practically defunct.
* NEWS: Update.

See also commit `Release-1-10-205-gd5bec12', "Support for
Python 3.0, drop support for pre-2.0."
2011-12-22 15:21:19 +01:00
Stefano Lattarini
d583aa6663 Merge branch 'maint'
The following additional changes has been made:
* m4/amversion.in: Bump serial number from `1' to `8', to avoid
potential future conflicts with branch-1.11.
* m4/amversion.m4: Likewise.
* m4/gcj.m4: Likewise.
* m4/python.m4: Likewise.
* m4/install-sh.m4: Likewise.
2011-04-17 12:05:46 +02:00
Stefano Lattarini
1cddf41071 m4: add missing serial numbers to a few files
Related to automake bug#8483.

* m4/amversion.in: Add serial number.
* m4/auxdir.m4: Likewise.
* m4/gcj.m4: Likewise.
* m4/install-sh.m4: Likewise.
* m4/mkdirp.m4: Likewise.
* m4/python.m4: Likewise.
* m4/runlog.m4: Likewise.
* m4/strip.m4: Likewise.
* m4/upc.m4: Likewise.
2011-04-17 11:51:14 +02:00
Stefano Lattarini
3c5d9e8f2d cosmetics: better use of m4 quoting and m4sugar macros
* m4/dmalloc.m4: Better use of m4 quoting.  Bump serial number.
* m4/gcj.m4: Likewise.
* m4/init.m4: Likewise.
* m4/install-sh.m4: Likewise.
* m4/lex.m4: Likewise.
* m4/multi.m4: Likewise.
* m4/option.m4: Likewise.
* m4/python.m4: Likewise.
* m4/sanity.m4: Likewise.
* m4/cond.m4: Likewise.  Also, prefer the m4sugar macro 'm4_if'
over the plain m4 macro 'ifelse'.
* m4/depend.m4: Likewise.
2011-03-17 23:24:38 +01:00
Stefano Lattarini
95b717e8bd Merge branch 'maint' 2011-02-15 10:18:10 +01:00
Stefano Lattarini
5bf7af6e1e python: report the 'PYTHON' influential environment variable
* m4/python.m4 (AM_PATH_PYTHON): Call AC_ARG_VAR on PYTHON.
* doc/automake.texi (Python): Update and extend.
* tests/help-python.test: New test.
* tests/Makefile.am (TESTS): Update.
* THANKS (Jack Kelly): Update e-mail address.

Suggestion by Jack Kelly.
2011-02-15 10:08:47 +01:00
Stefano Lattarini
6366a170d8 python: extend and improve tests, fix minor glitches
* m4/python.m4 (AM_PATH_PYTHON): Ensure the "checking ..." messages
from configure are always complete, even in case of failure.  Tiny
cosmetic improvement in info/error messages.
* tests/python.test: Also check that automake complains if the
PYTHON primary is used but the `py-compile' script is not present.
Make grepping of generated Makefile.in laxer w.r.t. whitespace.
Add trailing `:' command.
* tests/python2.test: Remove repeated calls aclocal: they are
useless because configure.in is never modified.  Make grepping
of automake stderr more comprehensive.  Remove the pre-existing
`py-compile' file before trying to install it with `--add-missing'.
Add trailing `:' command.
* tests/python3.test: Add trailing `:' command.
* tests/python11.test: Likewise.
* tests/python4.test: Likewise.  Also, try to pass PYTHON config
variable to configure from the environment, rather than only from
the command line.
* tests/python5.test: Ensure that the "checking ..." messages from
configure are always complete.  Use proper m4 quoting.  Add a
trailing `:' command.
* tests/python6.test: Simplify test logic, by checking for files
created by configure rather then grepping its output.
* tests/python7.test: Likewise.
* tests/python8.test: Also check that `$PYTHON' is meaningfully
set in the ACTION-IF-TRUE argument of AM_PATH_PYTHON.
* tests/python9.test: Likewise.
* tests/python10.test: Add trailing `:' command.
(Makefile.am): Declare `disttest' target as `.PHONY', and add
an `ls -l' to its recipe, for debugging.
* tests/nobase-python.test: In testing "make uninstall" and
"make install" results, prefer idioms that make verbose logs
more helpful.  Remove a couple of lines of dead code.  Add a
trailing `:' command.
* tests/python5b.test: New test, checking that configure performs
the check on the python version even when the choice of the python
interpreter is forced by the user.
* tests/python-dist.test: New test, checking the distribution of
*_PYTHON files.
* tests/python-vars.test: New test, checking that AM_PATH_PYTHON
correctly set all the output variables advertised in the manual.
* tests/python-virtualenv.test: New test, checking that python
support offered by automake works well with "virtual python
environments" created by the `virtualenv' program.
* tests/instdir-prog.test: Also check `$(pyexecdir)'.  Existing
checks made slightly stricter.
* tests/instdir-prog.test: Also check `$(pyexecdir)'.  Existing
* tests/instdir-ltlib.test: Likewise.
* tests/Makefile.am (TESTS): Update.
2011-02-06 18:33:33 +01:00
Stefano Lattarini
2e5b3599df Add support for newer python versions.
* m4/python.m4 (AM_PATH_PYTHON): Add python2.7 and python3.2 to
_AM_PYTHON_INTERPRETER_LIST.  Since we are at it, break a long
line and fix indentation.
* THANKS: Updated.

From a report by Thomas Klausner.
2010-10-05 17:27:02 +02:00
Julien Danjou
05d41b17c7 Add support for newer python version
* m4/python.m4 (AM_PATH_PYTHON): Add python3.1 to
_AM_PYTHON_INTERPRETER_LIST.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2009-12-21 22:24:02 +01:00
Peter O'Gorman
6d44a667bd python: do not install in system directories on Darwin 9.
On Darwin 9, get_python_lib returns a path below `/Library/Python'
regardless of the `prefix' argument it was passed, causing `make
install' to target the system directories regardless of `--prefix'
argument used.  Work around this Darwin bug by ignoring the result
of get_python_lib if it points outside of the passed prefix, and
the prefix was not a system directory.

* m4/python.m4 (AM_PATH_PYTHON): If the prefix does not match the
initial portion of the pythondir returned by get_python_lib, then
ignore it unless the configured prefix is `/usr' or starts with
`/System'.  Fixes instmany-python.test failure on Mac OS X 10.5.7.
* NEWS: Update.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2009-05-24 14:36:26 +02:00
Matthias Klose
6cfa5cb8a2 Let AM_PATH_PYTHON honor python's idea about the site directory.
* m4/python.m4 (AM_PATH_PYTHON): When computing pythondir and
pyexecdir, pass the expanded prefix resp. exec_prefix as `prefix'
to get_python_lib, so python can determine the name of the site
directory depending on the install location.  Afterwards, replace
the directory names with the unexpanded values of $PYTHON_PREFIX
resp. $PYTHON_EXEC_PREFIX again, to allow override according to
the documentation.  Fixes site directory computation for Debian
and Ubuntu (`dist-packages' for a prefix of `/usr' or `/usr/local',
`site-packages' elsewhere).
* NEWS, THANKS: Update.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2009-05-17 11:37:55 +02:00
Johan Dahlin
d5bec12a1f Support for Python 3.0, drop support for pre-2.0.
* lib/py-compile: Do not import string; use sys.stdout.write
instead of print, files.split instead of string.split.
* m4/python.m4 (AM_PATH_PYTHON): Also look for python3 and
phython3.0; do not look for python1.5.  Use sys.stdout.write.
(AM_PYTHON_CHECK_VERSION): Do not use string; adjust to xrange
removal in Python 3.0, and changed semantics of map.
* doc/automake.texi (Python, Hard-Coded Install Paths): Update
Python versions mentioned in the manual, using 2.5 everywhere.
* NEWS, THANKS: Update.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2008-10-26 10:33:32 +01:00
Alexandre Duret-Lutz
85ae9cba7b * m4/python.m4 (_AM_PYTHON_INTERPRETER_LIST): Add python2.5. 2005-07-01 21:43:42 +00:00
Alexandre Duret-Lutz
391df12b69 * m4/amversion.in, m4/as.m4, m4/auxdir.m4, m4/ccstdc.m4,
m4/cond.m4, m4/depend.m4, m4/depout.m4, m4/dmalloc.m4, m4/gcj.m4,
m4/header.m4, m4/init.m4, m4/install-sh.m4, m4/lead-dot.m4,
m4/lex.m4, m4/lispdir.m4, m4/maintainer.m4, m4/make.m4,
m4/minuso.m4, m4/missing.m4, m4/mkdirp.m4, m4/multi.m4,
m4/obsol-gt.m4, m4/obsol-lt.m4, m4/obsolete.m4, m4/options.m4,
m4/protos.m4, m4/python.m4, m4/regex.m4, m4/runlog.m4,
m4/sanity.m4, m4/strip.m4, m4/tar.m4: Use the same all-permissive
license that is used in aclocal.m4.  Relicensing backed by RMS.
2005-01-09 14:46:22 +00:00
Alexandre Duret-Lutz
e4f1de1eb9 * m4/python.m4 (AM_PATH_PYTHON): Fix the invocation of
AC_PATH_PROGS to correctly define PYTHON as `:' when no interpreter
is found (this worked correctly only when a minimal version was
passed to AM_PATH_PYTHON).  Report from Stepan Kasal.
(_AM_PYTHON_INTERPRETER_LIST): Define using m4_define_default,
so we can easily override the list from the test suite.
* tests/python11.test: New file.
* tests/Makefile.am (TESTS): Add python11.test.
2004-11-10 20:12:34 +00:00
Alexandre Duret-Lutz
0ad0ad79fc * m4/python.m4 (AM_PATH_PYTHON): Make sure am_display_PYTHON is
set when $PYTHON has been set by the user.
From Esben Haabendal Soerensen.
2004-03-26 21:00:47 +00:00
Alexandre Duret-Lutz
476cc7a410 * m4/python.m4 (_AM_PYTHON_INTERPRETER_LIST): Add python2.4. 2004-01-11 11:53:17 +00:00
Paul Eggert
636c807658 Spelling and minor grammar fixes. 2003-09-06 05:36:57 +00:00
Alexandre Duret-Lutz
a4f5cb9af7 Fix for PR automake/398:
* m4/python.m4: Do not call AC_PATH_PROGS if $PYTHON is already
set.  Display `none' instead of `:' and $PYTHON is set to `:'
when no suitable interpreter is found.  Honor ACTION-IF-FOUND and
ACTION-IF-NOT-FOUND.
* automake.texi (Python): Document ACTION-IF-FOUND and
ACTION-IF-NOT-FOUND.
* tests/python4.test, tests/python5.test, tests/python6.test,
tests/python7.test, tests/python8.test, tests/python9.test: New
files.
* tests/Makefile.am (TESTS): Add them.
Report from Per Cederqvist.
2003-08-17 18:09:10 +00:00
Alexandre Duret-Lutz
5fd79af303 Fix for PR automake/399:
* m4/python.m4: Use AC_PATH_PROGS, not AC_PATH_PROG.
Report from Per Cederqvist.
2003-08-13 21:29:58 +00:00