rest25/extending/building.rst => rest262/extending/building.rst
34   setup (name = 'PackageName',
35          version = '1.0',
36          description = 'This is a demo package',
37          ext_modules = [module1])
38
39
40With this :file:`setup.py`, and a file :file:`demo.c`, running ::
41
n42-   python setup.py build 
n42+   python setup.py build
43
44will compile :file:`demo.c`, and produce an extension module named ``demo`` in
45the :file:`build` directory. Depending on the system, the module file will end
46up in a subdirectory :file:`build/lib.system`, and may have a name like
47:file:`demo.so` or :file:`demo.pyd`.
48
49In the :file:`setup.py`, all execution is performed by calling the ``setup``
n50-function. This takes a variable number of keyword  arguments, of which the
n50+function. This takes a variable number of keyword arguments, of which the
51-example above uses only a subset. Specifically, the example specifies meta-
51+example above uses only a subset. Specifically, the example specifies
52-information to build packages, and it specifies the contents of the package.
52+meta-information to build packages, and it specifies the contents of the
53-Normally, a package will contain of addition modules, like Python source
53+package.  Normally, a package will contain of addition modules, like Python
54-modules, documentation, subpackages, etc. Please refer to the distutils
54+source modules, documentation, subpackages, etc. Please refer to the distutils
55-documentation in Distributing Python Modules (XXX reference: ../dist/dist.html)
55+documentation in :ref:`distutils-index` to learn more about the features of
56-to learn more about the features of distutils; this section explains building
56+distutils; this section explains building extension modules only.
57-extension modules only.
58
59It is common to pre-compute arguments to :func:`setup`, to better structure the
60driver script. In the example above, the\ ``ext_modules`` argument to
61:func:`setup` is a list of extension modules, each of which is an instance of
62the :class:`Extension`. In the example, the instance defines an extension named
63``demo`` which is build by compiling a single source file, :file:`demo.c`.
64
65In many cases, building an extension is more complex, since additional
76                       library_dirs = ['/usr/local/lib'],
77                       sources = ['demo.c'])
78
79   setup (name = 'PackageName',
80          version = '1.0',
81          description = 'This is a demo package',
82          author = 'Martin v. Loewis',
83          author_email = 'martin@v.loewis.de',
t84-          url = 'http://www.python.org/doc/current/ext/building.html',
t83+          url = 'http://docs.python.org/extending/building',
85          long_description = '''
86   This is really just a demo package.
87   ''',
88          ext_modules = [module1])
89
90
91In this example, :func:`setup` is called with additional meta-information, which
92is recommended when distribution packages have to be built. For the extension
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op