This file is about the instructions to build (and use) pacparser on Windows.
For general information on pacparser, please have a look at README in the same
directory.

Building pacparser on Windows:
-----------------------------
For compiling pacparser on Windows, you'll need MinGW (www.mingw.org) tools.

Detailed Instructions:
----------------------

Set up tools:

1.  Install MinGW. Download the automated installer from here:
    http://sourceforge.net/projects/mingw/files/
    Running this installer lets you select what component you want to install.
    Apart from minimal MinGW, we'll need MinGW make. This will install all the
    necessary files in C:\MinGW.

2.  Add your MinGW directory's bin (C:\MinGW\bin) to your system path variable.

======== Done setting up tools ==========

3.  Now download pacparser source code tarball from
    http://code.google.com/p/pacparser/downloads/list and extract it somewhere,
    say C:\workspace.

4.  Now extract the spidermonekey source tarball, js-*.tar.gz, located at
    src\spidermonkey\js-*.tar.gz inside the pacparser source directory.

5.  Compile pacparser and create ditribution.
      make -f Makefile.win32 dist

6. Compile pacparser python module and copy required files to a directory
    (dist).
      make -f Makefile.win32 pymod
      make -f Makefile.win32 dist-pymod

Using pacparser on Windows:
--------------------------
* In C programs:

Make sure that you have pacparser.dll in the sytem path somewhere
(current directory would do just fine for testing purpose).
  Change to your program's directory:
  =>  cd c:\workspace\pacparser-1.2.1\examples
  Copy pacparser.dll here and compile your program:
  => gcc -o pactest pactest.c -lpacparser -L.
  Run your program:
  => pactest wpad.dat http://www.google.com www.google.com
  'PROXY proxy1.manugarg.com:3128; PROXY proxy2.manugarg.com:3128; DIRECT'

* In python programs:

Install pacparser python module by running install.py in the distribution
folder. You'll then be able to use pacparser python module in the following
manner:

  => C:\python25\python
  >>> import pacparser
  >>> pacparser.init()
  >>> pacparser.parse_pac('examples/wpad.dat')
  >>> pacparser.find_proxy('http://www.google.com', 'www.google.com')
  'PROXY proxy1.manugarg.com:3128; PROXY proxy2.manugarg.com:3128; DIRECT'
  >>> pacparser.cleanup()
