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>