]> granicus.if.org Git - gc/commitdiff
Define GC_DLL if building only dynamic libraries.
authorIvan Maidanski <ivmai@mail.ru>
Thu, 22 Sep 2011 11:46:54 +0000 (15:46 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Thu, 22 Sep 2011 11:55:33 +0000 (15:55 +0400)
Update README for Cygwin/MinGW.

* configure.ac (GC_DLL): New AC template; define if only the dynamic
libraries are being built.
* configure.ac (THREAD_LOCAL_ALLOC): Define for Win32 implicitly
if static libraries are being built (i.e. GC_DLL is not defined).
* doc/README.win32: Update "GNU Tools" section.

configure.ac
doc/README.win32

index 5040363d9339e1274c67001b3b7baf26157c7fa8..89b97a2978f6060d76f6831c227d9890d29dce6d 100644 (file)
@@ -104,6 +104,10 @@ dnl System header feature requests.
 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
 
@@ -261,6 +265,11 @@ case "$THREADS" in
     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],
@@ -407,6 +416,14 @@ esac
 
 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)
index 4a030cf358138e360d9b3aa4c9b1d57cfee06aab..d8772fdacde507e8bc0f47755145155d1344832f 100644 (file)
@@ -68,26 +68,19 @@ absence of thread support).
 
 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
 -------------