The current Waf version requires an interpreter for the Python programming language such as http://www.python.org[cPython] 2.5 to 3.1, http://pypy.org[Pypy] or http://www.jython.org[Jython] >= 2.5.
The Waf binary is a python script which does not require any installation whatsoever. It may be executed directly from a writable folder. Just rename it as +waf+ if necessary:
The +waf+ file has its own library compressed in a binary stream in the same file. Upon execution, the library is uncompressed in a hidden folder in the current directory. The folder will be re-created if removed. This scheme enables different Waf versions to be executed from the same folders:
NOTE: The binary file requires http://docs.python.org/library/bz2.html[bzip2] compression support, which may be unavailable in some self-compiled cPython installations.
For older interpreters, it is possible to build the +waf+ file with gzip compression instead of bzip2:
[source,shishell]
---------------
$ python waf-light --zip-type=gz
---------------
The files present in the folder _waflib/extras_ represent extensions (Waf tools) that are in a testing phase. They may be added to the Waf binary by using the _--tools_ switch:
[source,shishell]
---------------
$ python waf-light --tools=compat15,swig,doxygen
---------------
The tool _compat15_ is required to provide some compatibility with previous Waf versions.
To remove it, it is necessary to modify the initialization by changing the _--prelude_ switch:
Foreign files to add into the folder 'extras' must be given by absolute paths in the _--tools_ switch.
Such files do not have to be Python files, yet, a typical scenario is to add an initializer to modify existing
functions and classes from the Waf modules. Various from the http://code.google.com/p/waf/source/browse/trunk/build_system_kit/[build system kit] illustrate how to create custom
In the next sections of the book, we assume that either an alias or the execution path have been set in a way that +waf+ may be called directly.
==== Local waflib folders
Although the waf library is unpacked automatically from the waf binary file, it is sometimes necessary to keep the files in a visible folder, which may even be kept in a source control tool (subversion, git, etc). For example, the +waf-light+ script does not contain the waf library, yet it is used to create the +waf+ script by using the directory +waflib+.
The following diagram represents the process used to find the +waflib+ directory:
By default, the recommended Python interpreter is cPython, for which the supported versions are 2.5 to 3.4. For maximum convenience for the user, a copy of the http://www.jython.org[Jython] interpreter (version >= 2.5) could be redistributed along with a copy of the Waf executable.