AH_TEMPLATE([_POSIX_C_SOURCE], [The POSIX feature macro.])
AH_TEMPLATE([_PTHREADS], [Indicates the use of pthreads (NetBSD).])
+dnl GC API symbols export control.
+AH_TEMPLATE([GC_DLL],
+ [Define to build dynamic libraries with only API symbols exposed.])
+
dnl Check for a flavor of supported inline keyword.
AC_C_INLINE
if test "${enable_parallel_mark}" = yes; then
AC_DEFINE(PARALLEL_MARK)
AC_DEFINE(THREAD_LOCAL_ALLOC)
+ else
+ if test "${enable_static}" == yes; then
+ # Imply THREAD_LOCAL_ALLOC unless GC_DLL.
+ AC_DEFINE(THREAD_LOCAL_ALLOC)
+ fi
fi
win32_threads=true
AC_DEFINE([EMPTY_GETENV_RESULTS], [1],
AC_MSG_RESULT($enable_shared)
+# Compile with GC_DLL defined unless building static libraries.
+if test "${enable_shared}" == yes; then
+ if test "${enable_static}" == no; then
+ AC_DEFINE(GC_DLL)
+ # FIXME: Also pass -fvisibility=hidden option if GCC v4+ and not Win32.
+ fi
+fi
+
# Configuration of machine-dependent code
#
AC_MSG_CHECKING(which machine-dependent code should be used)
GNU Tools
---------
-The collector should be buildable under Cygwin with either the old standard
-Makefile, or possibly with the "configure --disable-shared;make" machinery.
-(For the latter use --enable-threads=posix for thread support.) The major issue
-here seems to be that dynamic library support is not currently enabled for
-Cygwin. (This is probably fixable without a great deal of difficulty by
-reusing the standard WIN32 code. But it requires some tweaking.) As a result
-of this, "configure; make; make check" currently does not completely succeed,
-though the static library appears to be OK when used only from the main
-programs, and correspondingly the Makefile.direct self tests succeed.
-
-Mingw32 builds are not regularly tested, and may or may not work.
-The following paragraph is probably obsolete:
-
-For GNU-win32, use the regular makefile, possibly after uncommenting
-the line "include Makefile.DLLs". The latter should be necessary only
-if you want to package the collector as a DLL.
-[Is the following sentence obsolete? -HB] The GNU-win32 port is
-believed to work only for b18, not b19, probably due to linker changes
-in b19. This is probably fixable with a different definition of
-DATASTART and DATAEND in gcconfig.h.
+The collector should be buildable under Cygwin with the
+"./configure; make check" machinery.
+
+MinGW builds (including for x86_64) are available via cross-compilation, e.g.
+"./configure --host=i686-pc-mingw32; make check"
+
+To build the collector as a DLL, pass "--enable-shared --disable-static" to
+configure (this will instruct make compile with -D GC_DLL).
+
+Parallel marker could be enabled via "--enable-parallel-mark".
+
+Memory unmapping could be enabled via "--enable-munmap" (not well supported
+on Cygwin currently).
Borland Tools
-------------