From d76816e58bc6f54e114a9fa69df4baba3d524d87 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Thu, 12 Jul 2018 10:40:41 +0300 Subject: [PATCH] Update NT_MAKEFILE usage information in README files for Win32 and Win64 Issue #223 (bdwgc). * doc/README.win32 (Microsoft Tools): Provide a sample how to build static library without threads support. * doc/README.win64: Likewise. * doc/README.win32 (Threads): Provide a sample how to build dynamic collector with threads support using NT_MAKEFILE. * doc/README.win64: Likewise. --- doc/README.win32 | 23 ++++++++++++++++------- doc/README.win64 | 16 ++++++++-------- 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/doc/README.win32 b/doc/README.win32 index 6e772de..aa81e66 100644 --- a/doc/README.win32 +++ b/doc/README.win32 @@ -40,10 +40,13 @@ since we now separate heap sections with an unused page.) Microsoft Tools --------------- -For Microsoft development tools, rename NT_MAKEFILE as -MAKEFILE. (Make sure that the CPU environment variable is defined -to be i386.) In order to use the gc_cpp.h C++ interface, all -client code should include gc_cpp.h. +For Microsoft development tools, type +"nmake -f NT_MAKEFILE cpu=i386 make_as_lib=1 nothreads=1 nodebug=1" +to build the release variant of the collector as a static library without +threads support. + +In order to use the gc_cpp.h C++ interface, all client code should include +gc_cpp.h. [See above for gctest.] @@ -171,9 +174,15 @@ to the collector DLL still exists, but requires that both We generally recommend avoiding this if possible, since it seems to be less than 100% reliable. -Use gc.mak instead of NT_MAKEFILE to build a version that supports -both kinds of thread tracking. To build the garbage collector -test with VC++ from the command line, use +To build the collector as a dynamic library which handles threads similarly +to other platforms, type "nmake -f NT_MAKEFILE". If automatic tracking of +threads attached to the collector DLL (i.e. support of both kinds of thread +tracking) is needed then delete "-DTHREAD_LOCAL_ALLOC" from NT_MAKEFILE +manually before the build. + +The alternate way (not well tested) to build the dynamic library that supports +both kinds of thread tracking is to use gc.mak instead of NT_MAKEFILE. +To build the garbage collector test with VC++ from the command line, use nmake /F ".\gc.mak" CFG="gctest - Win32 Release" diff --git a/doc/README.win64 b/doc/README.win64 index 82b9456..7714b5b 100644 --- a/doc/README.win64 +++ b/doc/README.win64 @@ -1,12 +1,11 @@ 64-bit Windows on AMD64/Intel EM64T is somewhat supported in the 7.0 and later release. A collector can be built with Microsoft Visual C++ 2005 or with mingw-w64 gcc. -More testing would clearly be helpful. -NT_MAKEFILE has been used in this environment. Uncomment the corresponding -definitions of CPU and CVTRES_CPU variables (commenting out the ones for X86), -and then type "nmake -f NT_MAKEFILE" in a Visual C++ command line window to -build the dynamic library with threads support and the usual test programs. +NT_MAKEFILE has been used in this environment. Type +"nmake -f NT_MAKEFILE cpu=AMD64 nodebug=1" in a Visual C++ command line +window to build the release variant of the dynamic library with threads +support and the usual test programs. To verify that the collector is at least somewhat functional, run gctest.exe. This should create gctest.gc.log after a few seconds. @@ -16,9 +15,10 @@ that we're getting wrong instances of operator new/delete in some cases.) This process is completely analogous to NT_MAKEFILE usage for the 32-bit library version. -A similar procedure using NT_MAKEFILE should be usable to -build the static library (see comments for CFLAGS_SPECIFIC and LINK_GC -variables in NT_MAKEFILE). +A similar procedure using NT_MAKEFILE is applicable to build the static +library - just pass "make_as_lib=1" as an extra argument to nmake. +If needed, it is also possible to build the library without threads +support - this could be done by passing "nothreads=1" argument to nmake. Note that some warnings have been explicitly turned off in the makefile. -- 2.7.4