From: Alexandre Duret-Lutz Date: Thu, 16 Feb 2006 21:03:05 +0000 (+0000) Subject: * doc/automake.texi (Python): More examples. X-Git-Tag: Release-1-9b~96 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=98257927ac4c6f6e2e2e933dd56ededdce3c785f;p=thirdparty%2Fautomake.git * doc/automake.texi (Python): More examples. --- diff --git a/ChangeLog b/ChangeLog index 1e8b6a653..4fd7f7c9b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2006-02-16 Alexandre Duret-Lutz + + * doc/automake.texi (Python): More examples. + 2006-02-05 Alexandre Duret-Lutz * doc/automake.texi (distcleancheck): Fix bad wording. Report diff --git a/doc/automake.texi b/doc/automake.texi index 309d4c9d8..ffc1a5f71 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -5831,24 +5831,32 @@ This variable is an @code{sh} expression that is used to set the @cindex Primary variable, @code{PYTHON} @vindex _PYTHON -Automake provides support for Python compilation with the @code{PYTHON} -primary. +Automake provides support for Python compilation with the +@code{PYTHON} primary. A typical setup is to call +@code{AM_PATH_PYTHON} in @file{configure.ac} and use a line like the +following in @file{Makefile.am}: + +@example +python_PYTHON = tree.py leave.py +@end example Any files listed in a @code{_PYTHON} variable will be byte-compiled with @command{py-compile} at install time. @command{py-compile} -actually creates both standard (@file{.pyc}) and byte-compiled -(@file{.pyo}) versions of the source files. Note that because -byte-compilation occurs at install time, any files listed in +actually creates both standard (@file{.pyc}) and optimized +(@file{.pyo}) byte-compiled versions of the source files. Note that +because byte-compilation occurs at install time, any files listed in @code{noinst_PYTHON} will not be compiled. Python source files are -included in the distribution by default. - -Automake ships with an Autoconf macro called @code{AM_PATH_PYTHON} that -will determine some Python-related directory variables (see below). If -you have called @code{AM_PATH_PYTHON} from @file{configure.ac}, then you -may use the following variables to list you Python source files in your -variables: @code{python_PYTHON}, @code{pkgpython_PYTHON}, -@code{pyexecdir_PYTHON}, @code{pkgpyexecdir_PYTHON}, depending where you -want your files installed. +included in the distribution by default, prepend @code{nodist_} (as in +@code{nodist_python_PYTHON}) to omit them. + +Automake ships with an Autoconf macro called @code{AM_PATH_PYTHON} +that will determine some Python-related directory variables (see +below). If you have called @code{AM_PATH_PYTHON} from +@file{configure.ac}, then you may use the variables +@code{python_PYTHON} or @code{pkgpython_PYTHON} to list Python source +files in your @file{Makefile.am}, depending where you want your files +installed (see the definitions of @code{pythondir} and +@code{pkgpythondir} below). @defmac AM_PATH_PYTHON ([@var{VERSION}], [@var{ACTION-IF-FOUND}], [@var{ACTION-IF-NOT-FOUND}]) @@ -5860,10 +5868,17 @@ If an interpreter is found and satisfies @var{VERSION}, then @var{ACTION-IF-FOUND} is run. Otherwise, @var{ACTION-IF-NOT-FOUND} is run. -If @var{ACTION-IF-NOT-FOUND} is not specified, the default is to abort -configure. This is fine when Python is an absolute requirement for the -package. Therefore if Python >= 2.2 is only @emph{optional} to the -package, @code{AM_PATH_PYTHON} could be called as follows. +If @var{ACTION-IF-NOT-FOUND} is not specified, as in the following +example, the default is to abort @command{configure}. + +@example +AM_PATH_PYTHON(2.2) +@end example + +@noindent +This is fine when Python is an absolute requirement for the package. +If Python >= 2.2 was only @emph{optional} to the package, +@code{AM_PATH_PYTHON} could be called as follows. @example AM_PATH_PYTHON(2.2,, :) @@ -5919,7 +5934,14 @@ as a convenience. @item pyexecdir This is the directory where Python extension modules (shared libraries) -should be installed. +should be installed. An extension module written in C could be declared +as follows to Automake: + +@example +pyexec_LTLIBRARIES = quaternion.la +quaternion_SOURCES = quaternion.c support.c support.h +quaternion_la_LDFLAGS = -avoid-version -module +@end example @item pkgpyexecdir This is a convenience variable that is defined as diff --git a/doc/stamp-vti b/doc/stamp-vti index 6608007e1..58b10b588 100644 --- a/doc/stamp-vti +++ b/doc/stamp-vti @@ -1,4 +1,4 @@ -@set UPDATED 5 February 2006 +@set UPDATED 16 February 2006 @set UPDATED-MONTH February 2006 @set EDITION 1.9a @set VERSION 1.9a diff --git a/doc/version.texi b/doc/version.texi index 6608007e1..58b10b588 100644 --- a/doc/version.texi +++ b/doc/version.texi @@ -1,4 +1,4 @@ -@set UPDATED 5 February 2006 +@set UPDATED 16 February 2006 @set UPDATED-MONTH February 2006 @set EDITION 1.9a @set VERSION 1.9a