
Compling for Windows.
-----------------------------------
For Version V0.5.0+ we are switching to GPGme libraries.
This documents a clean compilation of V0.5 for Windows.

Tested on: WinXP July 2009.

You will need:
 * Qt4.5 Development Libraries (from TrollTech)
 * MinGw/MinSys full installation (from sourceforge.net)
 * Cygwin (for OpenSSL compilation / SVN / Unix Tools)
 * OpenSSL standard libraries.
 * GPG Windows Install (includes gpg.exe)
 * MiniUpnp library
 * gpgme Library.
 * libgpg-error Library.


This compilation is a little tricky as different environments 
are needed to compile different libraries.
a) Cygwin: libssl.a libcrypto.a
b) MinGW/MSYS: libgpg-error, libgpgme.a, libretroshare.a, libminiupnp.a
c) Qt/MinGW: Retroshare.exe


/***************** Installation of Development Tools **************/
In this section we install: cygwin, mingw/msys and Qt4.5

1) Install Cygwin 
	a) download the installer and run.
	b) be sure to select from the development packages:
		* mingw
		* svn
		* gcc/gdb
		* make
   links:
	http://www.cygwin.org/

2) install the MinGW/Msys package.
	a) Download MinGW-5.1.4 installer and run.
	b) Download MSYS-1.0.11 installer and run. 

   links:
  http://downloads.sourceforge.net/mingw/MinGW-5.1.4.exe
	http://downloads.sourceforge.net/mingw/MSYS-1.0.11.exe
	http://www.mingw.org/
	http://sourceforge.net/projects/mingw/files/	

3) Install Qt4.5 LGPL Version. (Qt SDK 2009.03)
	a) Download from website and run.
	b) Select all options (including MinGW)

   links:
	http://www.qtsoftware.com/downloads

/***************** Installation of Development Tools **************/
/******************* Compiling Support Libraries ******************/

1) Compile OpenSSL using Cygwin.
	a) launch cygwin xterm
	b) untar openssl source package.
	c) Configure mingw
	d) make.

2) Compile gpg-error
	a) Download from gpg
	b) load up MinGW/MSYS Bash shell.
	c) extract code.
	d) configure
	e) make
	f) make install

	The library will end up in /local/lib
		
3) Compile gpgme
	a) Download from gpg
	b) load up MinGW/MSYS Bash shell.
	c) extract code.
	d) configure
	e) make
	f) make install

	The library will end up in /local/lib

		
4) Compile MiniUPnP.
	up to release v1.3 now.
   links:
	http://miniupnp.free.fr/
	http://miniupnp.free.fr/files/

5) Install pthreads

   links:
	http://sourceware.org/pthreads-win32/
	ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-2-8-0-release.exe

/******************* Compiling Support Libraries ******************/
/*********************** Compiling Retroshare *********************/

1) Setup Source Code TAR (TODO: Update for windows).
   This is useful as it provides a standard structure to work against, 
   we will update this with the required support libraries soon.

	a) open Cygwin shell, and change to this location.
		c:/msys/1.0/home/XXX/retroshare
	b) create a working directory under this.
	c) run compile script (so it will download latest SVN code).

2) Compile libretroshare
	a) change to the libretroshare directory.
	b) modify support directory paths to point at correct locations.
	c) compile libretroshare

3) Copy all the required support libraries into the library directory:
		c:/msys/1.0/home/XXX/retroshare/retroshare-package-v0.4.09b/lib

		This should include:

		gpg-error / gpgme libraries:
				libgpg-error.a
				libgpg-error.dll.a
				libgpg-error.la
				libgpgme.dll.a
				libgpgme.la

		openssl libraries:
				libcrypto.a
				libssl.a

		miniupnpc / pthreads / libz

				libminiupnpc.a
				miniupnpc.dll
				libpthreadGCE2.a
				pthreadGCE2.dll
				libz.a

		extra library from cygwin. (renamed from libcrypt32.a)	
				libcrypt32-cygwin.a

		libretroshare
				libretroshare.a


4) Compile GUI.

/*********************** Compiling Retroshare *********************/
/************************ Running Retroshare **********************/

1) Collect Relevant DLL's with Application.
	a) make retroshare application directory.
	b) copy Retroshare.exe executable into directory.
	c) Copy required DLL's into that directory.
		These include:

		mingw runtime:
			mingwm10.dll

		gpgme/gpg-error:
			libgpg-error-0.dll
			libgpgme-11.dll

		other support libraries:
			miniupnpc.dll
			pthreadGCE2.dll

		Qt DLLs:
			QtCore4.dll, 
			QtGui4.dll,...
			etc.

	d) You should be able to run Retroshare from this directory now!	

2) Install gpg4win package... for gpg.exe

3) Create an OpenGPG identity using gpa or Enigmail or other PGP tool.

4) You should be able to use Retroshare on your PC now.

/************************ Running Retroshare **********************/
/******************************** FAQs ****************************/
Ask and it might be answered!
/******************************** FAQs ****************************/

This is obviously a work in progress - 
drBob.





