
 This README details the instructions required for compiling DC-API BOINC client libs 
 on MinGW32. Alternatively we provide a package containing precompiled libraries (see
 http://doc.desktopgrid.hu/doku.php?id=manual:dc-api&#linux_mingw32cross-compiling_for_windows
 for details.)


 1. Requirements

 - Debian 6.0


 2. Compiling DC-API on MinGW32

 2.1 As root run:

 $> apt-get update && apt-get upgrade
 $> apt-get install mingw32
 $> apt-get install autoconf libtool make
 $> apt-get install libglib2.0-dev  # DC-API: only needed for autoreconf to finish 
                                    # (it would complain about missing glib2 libs)
 $> apt-get install gtk-doc-tools   # only needed for autoreconf to finish (it would 
                                    # complain about gtk-doc missing)


 2.2. Switch to some non-privileged user. You don't need to be root from now on. 
 Next run:

 $> cd ${HOME}
 $> mkdir -p w32-root/include
 $> mkdir -p w32-root/lib


 2.3. Get the DC-API source and put it in ${HOME}/dcapi-trunk


 2.4. Run:

 $> wget http://mirror.vcu.edu/pub/windows/cygwin/release/util-linux/libuuid-devel/libuuid-devel-2.21.2-1.tar.bz2

 Uncompress and copy include files to ${HOME}/w32-root/include/uuid/ and libraries to ${HOME}/w32-root/lib/


 2.5. Get pthreads-w32-2.9.0-mingw32-pre-20110507-2-dev.tar.lzma from 
 http://sourceforge.net/projects/mingw/files/MinGW/Base/pthreads-w32/ Uncompress and 
 copy include files to ${HOME}/w32-root/include/ and libraries to ${HOME}/w32-root/lib/


 2.6. Get our boinc lib package from (link is at the bottom of the section):

 http://doc.desktopgrid.hu/doku.php?id=manual:dc-api#linux_mingw32cross-compiling_for_windows

 uncompress, build the package following the instructions found in the README file.
 Finally copy includes to ${HOME}/w32-root/include/boinc/ and libraries to 
 ${HOME}/w32-root/lib.


 2.7. Modify "-pthread" in dcapi-trunk/cf/boinc.m4 to "-lpthread" (at two places)


 2.8. Finally execute the following:

 $> cd dcapi-trunk
 $> autoreconf --install --force --symlink
 $> ./configure --host=i586-mingw32msvc --disable-master --disable-backend-local \
       --enable-backend-boinc --with-boinc=${HOME}/w32-root/ LDFLAGS=-L${HOME}/w32-root/lib \
       --prefix=${HOME}/w32-root/ CPPFLAGS=-I${HOME}/w32-root/include/ LIBS="-lpsapi"
 $> make
 $> make install


