Previous: , Up: Other GNU Tools   [Contents][Index]


11.5 Python

Automake provides support for Python modules. Automake will turn on Python support if the AM_PATH_PYTHON macro is used in configure.in. The ‘PYTHON’ primary is used to hold a list of .py files. Possible prefixes for this primary are ‘python_’ and ‘noinst_’. Note that if python_PYTHON is defined, then configure.in must run AM_PATH_PYTHON. Python source files are included in the distribution by default.

AM_PATH_PYTHON takes a single optional argument. This argument, if present, is the minimum version of Python which can be used for this package. If the version of Python found on the system is older than the required version, then AM_PATH_PYTHON will cause an error.

AM_PATH_PYTHON creates several output variables based on the Python installation found during configuration.

PYTHON

The name of the Python executable.

PYTHON_VERSION

The Python version number, in the form major.minor (e.g. ‘1.5’). This is currently the value of sys.version[:3].

PYTHON_PREFIX

The string $prefix. This term may be used in future work which needs the contents of Python’s sys.prefix, but general consensus is to always use the value from configure.

PYTHON_EXEC_PREFIX

The string $exec_prefix. This term may be used in future work which needs the contents of Python’s sys.exec_prefix, but general consensus is to always use the value from configure.

PYTHON_PLATFORM

The canonical name used by Python to describe the operating system, as given by sys.platform. This value is sometimes needed when building Python extensions.

pythondir

The directory name for the site-packages subdirectory of the standard Python install tree.

pkgpythondir

This is is the directory under pythondir which is named after the package. That is, it is ‘$(pythondir)/$(PACKAGE)’. It is provided as a convenience.

pyexecdir

This is the directory where Python extension modules (shared libraries) should be installed.

pkgpyexecdir

This is a convenience variable which is defined as ‘$(pyexecdir)/$(PACKAGE)’.

By default Automake will byte-compile all Python source files to both .pyc and .pyo forms. If you wish to avoid generating the optimized byte-code files, simply define the variable PYOFILES to be empty. Similarly, if you don’t wish to generate the standard byte-compiled files, define the variable PYCFILES to be empty.


Previous: Java, Up: Other GNU Tools   [Contents][Index]