implemented Setup.hs to build boehm cpp libs and install them;
[hs-boehmgc.git] / gc-7.2 / README.QUICK
1 Copyright 1988, 1989 Hans-J. Boehm, Alan J. Demers
2 Copyright (c) 1991-1995 by Xerox Corporation.  All rights reserved.
3 Copyright (c) 1996-1999 by Silicon Graphics.  All rights reserved.
4 Copyright (c) 1999-2001 by Hewlett-Packard. All rights reserved.
5
6 THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
7 OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
8
9 Permission is hereby granted to use or copy this program
10 for any purpose,  provided the above notices are retained on all copies.
11 Permission to modify the code and to distribute modified code is granted,
12 provided the above notices are retained, and a notice that the code was
13 modified is included with the above copyright notice.
14
15 A few files have other copyright holders. A few of the files needed
16 to use the GNU-style build procedure come with a modified GPL license
17 that appears not to significantly restrict use of the collector, though
18 use of those files for a purpose other than building the collector may
19 require the resulting code to be covered by the GPL.
20
21 For more details and the names of other contributors, see the
22 doc/README* files and include/gc.h.  This file describes typical use of
23 the collector on a machine that is already supported.
24
25 For the version number, see doc/README or version.h.
26
27 INSTALLATION:
28 Under UN*X, Linux:
29 Alternative 1 (the old way): type "make test" in this directory.
30         Link against gc.a.  With the most recent GC distributions
31         you may have to type "make -f Makefile.direct test" or
32         copy Makefile.direct to Makefile first.
33
34 Alternative 2 (the new way): type
35         "./configure --prefix=<dir>; make; make check; make install".
36         Link against <dir>/lib/libgc.a or <dir>/lib/libgc.so.
37         See README.autoconf for details
38
39 Under Windows 95, 98, Me, NT, or 2000:
40 copy the appropriate makefile to MAKEFILE, read it, and type "nmake test".
41 (Under Windows, this assumes you have Microsoft command-line tools
42 installed, and suitably configured.)
43 Read the machine specific README in the doc directory if one exists.
44
45 If you need thread support, you will need to follow the special
46 platform-dependent instructions (win32), or define GC_THREADS
47 as described in doc/README.macros, or possibly use
48 --enable-threads=posix when running the configure script.
49
50 If you wish to use the cord (structured string) library with the stand-alone
51 Makefile.direct, type "make cords", after copying to "Makefile".
52 (This requires an ANSI C compiler.  You may
53 need to redefine CC in the Makefile. The CORD_printf implementation in
54 cordprnt.c is known to be less than perfectly portable.  The rest of the
55 package should still work.)
56
57 If you wish to use the collector from C++, type "make c++", or use
58 --enable-cplusplus with the configure script.   With Makefile.direct,
59 these ones add further files to gc.a and to the include subdirectory.
60 With the alternate build process,this generates libgccpp.
61 See cord/cord.h and include/gc_cpp.h.
62
63 TYPICAL USE:
64 Include "gc.h" from the include subdirectory.  Link against the
65 appropriate library ("gc.a" under UN*X).  Replace calls to malloc
66 by calls to GC_MALLOC, and calls to realloc by calls to GC_REALLOC.
67 If the object is known to never contain pointers, use GC_MALLOC_ATOMIC
68 instead of GC_MALLOC.
69
70 Define GC_DEBUG before including gc.h for additional checking.
71
72 More documentation on the collector interface can be found at
73 http://www.hpl.hp.com/personal/Hans_Boehm/gc/gcinterface.html,
74 in doc/README and other files in the doc directory, and in include/gc.h .
75
76 WARNINGS:
77
78 Do not store the only pointer to an object in memory allocated
79 with system malloc, since the collector usually does not scan
80 memory allocated in this way.
81
82 Use with threads may be supported on your system, but requires the
83 collector to be built with thread support.  See Makefile.  The collector
84 does not guarantee to scan thread-local storage (e.g. of the kind
85 accessed with pthread_getspecific()).  The collector does scan
86 thread stacks though, so generally the best solution is to ensure that
87 any pointers stored in thread-local storage are also stored on the
88 thread's stack for the duration of their lifetime.