Matěj Týč
2018-03-21 16:49:36 UTC
Hello,
there is a Python autoconf support macro in automake AM_PATH_PYTHON that
can be used to find Python interpreters.
The problem of this macro is that it treats Python versions in a linear
manner - if I write that I want Python >= 2.7 on a machine that has
Python 2.6 and Python 3.1, I probably want the rule to fail, not to
assert that 3.1 >= 2.7, so it will pick this Python 3.1.
On a related note, a C library may build bindings for Python2 and for
Python3, so in general, it seems to be a good idea to output results for
more Python versions. Like to provide PYTHON2 and PYTHON3 instead of
just PYTHON if the users desires so. My next observation is that in
Makefile.am, one can use the foo_PYTHON to ensure special treatment of
Python files during the installation s.a. compilation (and maybe
something else?). I think that if I want to install bindings for Python2
and Python3, each of them should be compiled with the interpreter of the
corresponding major version.
The question stands like this: Is there a demand on automake side to fix
this issue - to allow developers addressing multiple Python interpreters
of different major versions? If so, I think that I can come up with some
patches to get this working.
Best regards,
Matej Tyc
there is a Python autoconf support macro in automake AM_PATH_PYTHON that
can be used to find Python interpreters.
The problem of this macro is that it treats Python versions in a linear
manner - if I write that I want Python >= 2.7 on a machine that has
Python 2.6 and Python 3.1, I probably want the rule to fail, not to
assert that 3.1 >= 2.7, so it will pick this Python 3.1.
On a related note, a C library may build bindings for Python2 and for
Python3, so in general, it seems to be a good idea to output results for
more Python versions. Like to provide PYTHON2 and PYTHON3 instead of
just PYTHON if the users desires so. My next observation is that in
Makefile.am, one can use the foo_PYTHON to ensure special treatment of
Python files during the installation s.a. compilation (and maybe
something else?). I think that if I want to install bindings for Python2
and Python3, each of them should be compiled with the interpreter of the
corresponding major version.
The question stands like this: Is there a demand on automake side to fix
this issue - to allow developers addressing multiple Python interpreters
of different major versions? If so, I think that I can come up with some
patches to get this working.
Best regards,
Matej Tyc