DJGPP port of GNU Pth 1.3.7, release 1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Introduction ------------ This is the Readme file for the DJGPP port GNU Pth 1.3.7. Please see the file 'NEWS' for a full list of user-visible changes from the previous versions. Please see 'changelog.dos' for a list of bugs fixed in each release of the port. But what is GNU Pth? From its README: "Pth is a very portable POSIX/ANSI-C based library for Unix platforms which provides non-preemptive priority-based scheduling for multiple threads of execution (aka `multithreading') inside event-driven applications. All threads run in the same address space of the server application, but each thread has its own individual program-counter, run-time stack, signal mask and errno variable." To use Pth in you own programs, you only need to download the binary distribution. If you wish to examine or rebuild the Pth sources, you need to download the source distribution. The Pth port is available here: Binaries: ftp://ftp.delorie.com/pub/djgpp/current/v2gnu/alpha/pth137b.zip Sources: ftp://ftp.delorie.com/pub/djgpp/current/v2gnu/alpha/pth137s.zip Installing the Binary Distribution of Pth ----------------------------------------- Unzip the distribution preserving the directory structure (use -d switch if you do that with PKUNZIP) from the top DJGPP installation directory. Pth will not be usable in your own programs, unless the following packages have been installed: . DJGPP development environment 2.04 alpha 1; . GNU C compiler 3.2.2; . GNU binutils 2.13; . a BSD-sockets networking library such as Watt-32 (see http://www.bgnett.no/~giva/ ). Due to a bug in the DJGPP ports of gcc between 3.0 and 3.2.2 inclusive, it is recommended that you use only the versions listed above. Rebuilding Pth using the Source Distribution -------------------------------------------- To build the DJGPP port of Pth from sources, I used the following packages: . DJGPP development environment 2.04 alpha 1; . GNU C compiler 3.2.2; . GNU binutils 2.13; . GNU make 3.79.1; . GNU bash 2.04; . GNU sed 3.0.28; . GNU awk 3.0.6; . GNU grep 2.4; . GNU fileutils 4.1; . GNU sh-utils 2.0.11; . GNU textutils 2.0; . libsocket 0.8.0 (v2tk/ls080b.zip). All of these were built by hand using DJGPP 2.04 CVS. You may wish to use the DJGPP 2.04 alpha 1 packages from these pages: ftp://ftp.delorie.com/pub/djgpp/alpha http://clio.rice.edu/djgpp/win2k/main_204.htm Firstly, change into the top-level directory of the Pth sources (i.e.: gnu\pth.137) and configure the package: bash djgpp/djconfig.sh If you want to install Pth somewhere other than the DJGPP directory, modify djgpp/djconfig.sh to use configure's '--prefix' option (use 'bash configure --help' for more information). You may wish to check that Pth has built correctly: make check See the section below entitled 'Expected test suite results' for more details. Once it's built, install the package: make install Changes made to the Fileutils 4.1 Sources ----------------------------------------- The file 'gnu\pth.137\djgpp\diffs' contains all the changes made to the sources, to support DJGPP. Here are the steps necessary to get from a Pth 1.37 tarball (pth-1.3.7.tar.gz) to a patched copy of the sources for DJGPP: 1. Extract the sources: djtarx /path/to/pth-1.3.7.tar.gz 2. Apply the DJGPP patch: You will need the file 'diffs' from the source distribution. Change into the Pth 1.3.7 source directory and apply the patch: patch -Z -p7 -i /path/to/diffs 3. Copy the 'djgpp' directory from the source distribution into the Pth source directory. You can now build as directed in the section 'Rebuilding Pth using the Source Distribution' above. NB: The source distribution of the DJGPP port comes with all patches applied and will build "out of the box". Known Issues ------------ . DJGPP's setjmp/longjmp don't save the floating-point state. Pth uses setgmp/longjmp to save/restore the processor state for switching threads. So floating-point operations will not be thread-safe. You will need to explicitly save the floating-point state, before allowing thread switches. Maybe this will be fixed in a later version. . I have not checked to see whether this package builds with short filenames. Maybe this will be fixed in a later version. Expected test suite results --------------------------- All the tests should pass. NB: I tested with libsocket 0.8.0 on Windows '98 SE. I have no idea what the test results will be with, say, Watt-32. Please let me know, if you test it. Finally ------- Thanks to Ben Decker for his testing of this port and convincing me to make packages of it. ;) Please direct any further discussions about this port to comp.os.msdos.djgpp newsgroup (or write to its e-mail gateway djgpp@delorie.com). I try to read the DJGPP newsgroup on a regular basis, but also please feel free to contact me by e-mail (address below). Regards, Richard Dawe 2003-07-20