1. PortableThreads
-------------------

These are the PortableThreads written by Jean Gressmann. 
The PortableThreads are comprised of a number of classes aimed to faciliate porting 
multithread application between x86 Windows and Unix platforms.

PortableThreads are written in C++ and work with an any flavor of
the win32 platform as well as various Unix platforms.
The PortableThreads may be freely used, modified and redistributed
under the terms of the GPL. See file COPYING for details.

2. Supported platforms
----------------------

OS          Machines
====================
Linux       x86, x86-64
Solaris     sparc-v8, sparc-v9
Win32       x86
	

2.1 Preliminaries Unix
----------------------

You'll need to have the GNU Compiler Collection (GCC) version 3 or
better installed in order to build PortableThreads. 

2.2 Preliminaries Windows
-------------------------

To build PortableThreads you'll need to have Microsoft's Visual Studio .NET
2003 or better. Alternatively you could use MINGW.


3.1 Installation Unix
---------------------

PortableThreads come with a configure script that should determine
the proper values for your system. To build PortableThreads issue

	./configure 
	make
	make install
	
at the prompt. The configure script takes the usual options. 

If you want to turn off assertions call make CXXFLAGS="-DNDEBUG" instead
of plain make. See the INSTALL file for details.


3.1 Installation Windows
------------------------

If you use MINGW follow the Unix instructions. Otherwise use the batch mode
to build everything. Then just include PortableThreads' "include" folder 
in the header file search path or copy it to Visual Studio's include directory. 
The same goes for the created static libraries (build/lib) and dlls (build/bin).


4.1 Usage Unix
--------------

PortableThreads comes with a utility script called pt-config that can output
the necessary compiler and linker flags for your platform (assuming 
you are using GCC). The tool recognizes these options

	--defines	:	prints defines necessary to compile with PortableThreads
	--libs		:	prints libs necessary to link with PortableThreads
	--cxxflags	:	prints C++ compiler flags necessary to use PortableThreads
	--ldflags	:	prints flags for C++ compiler to link with PortableThreads
	--shared	:	use shared library instead of static archive

For example a to compile and link a single C++ file foo.cpp with 
PortableThreads issue

	g++ `pt-config --defines --cxxflags --ldflags --libs` foo.cpp -o foo
	
at the prompt. Alternatively you could have issued:

	g++ `pt-config --defines --cxxflags` -c foo.cpp -o foo.o
	g++ `pt-config --ldflags --libs` foo.o -o foo


4.2 Usage Windows
-----------------

MINGW users follow the same instructions as Unix users. 
Visual Studio users just need to link against the appropriate
portablethreads_xxxx.lib:

- 	MT DEBUG     -> portablethreads_debug_static[_dll]
- 	MT DEBUG DLL -> portablethreads_debug_dll[_dll]
- 	MT           -> portablethreads_release_static[_dll]
- 	MT DLL       -> portablethreads_release_dll[_dll]

If you'd like to link with PortableThreads dll you'll need
to define PT_DLL during your build.


5. Documentation
----------------

Well, doesn't really exist yet. I doubt it ever will. However there
are lots of comments (in English) in the source files and you 
should be able to make some sense out of the examples even though
they are in German.


6. Questions, suggestions, complaints
-------------------------------------

 ... reach me best via email: jean@0x42.de
 