======================================================================
PyAudio Compilation Hints
======================================================================

Here are some hints for compiling PortAudio and PyAudio on various
platforms:

    * General UNIX Guide: (GNU/Linux, Mac OS X, Cygwin)
    * Microsoft Windows (native)

Generally speaking, you must first install the PortAudio v19 library
before building PyAudio.


----------------------------------------------------------------------
General UNIX Guide (GNU/Linux, Mac OS X, Cygwin)
----------------------------------------------------------------------

1. Build and install PortAudio, i.e.:

   % ./configure
   % make
   % make install # you may need to be root

   (Or better yet, use your package manager to install PortAudio v19)

2. Extract PyAudio; to build and install, run:

   % python setup.py install


----------------------------------------------------------------------
Microsoft Windows
----------------------------------------------------------------------

If you are targeting native Win32 Python, you will need either
Microsoft Visual Studio or MinGW (via Cygwin). Here are compilation
hints for using MinGW under the Cygwin build environment.

Note: I've only tested this under Cygwin's build environment. Your
mileage may vary in other environments (i.e., compiling PortAudio with
MinGW's compiler and environment).

(If you have instructions for building PyAudio using Visual Studio,
I'd love to hear about it.)

1. Download PortAudio to ./portaudio-v19 in this directory
   and build. When running configure, be sure to use ``-mno-cygwin``
   (under cygwin) to generate native Win32 binaries:

     % cd ./portaudio-v19
     % CFLAGS="-mno-cygwin" LDFLAGS="-mno-cygwin" ./configure
     % make
     % cd ..

2. To build PyAudio, run (from this directory):

     % python setup.py build --static-link -cmingw32

   Be sure to invoke the native Win32 python rather than cygwin's
   python.  The --static-link option statically links in the PortAudio
   library to the PyAudio module, which is probably the best way to go
   on Windows.

   From: http://boodebr.org/main/python/build-windows-extensions

     Update: 2008-09-10

     Recent versions of Cygwin binutils have version numbers that are
     breaking the version number parsing, resulting in errors like:
     ValueError: invalid version number '2.18.50.20080625'

     To fix this, edit distutils/version.py. At line 100, replace:

       version_re = re.compile(r'^(\d+) \. (\d+) (\. (\d+))? ([ab](\d+))?$',
                               re.VERBOSE)

     with

       version_re = re.compile(r'^(\d+) \. (\d+) (\. (\d+))? (\. (\d+))?$',
                               re.VERBOSE)

3. To install PyAudio:

     % python setup.py install --skip-build

   The --skip-build option prevents Python from searching your system
   for Visual Studio and the .NET framework.
