[Gc] Automake patches for gc7.0alpha2

Petter Urkedal petter.urkedal at nordita.dk
Tue Apr 19 15:52:27 PDT 2005


Attatched are fixes of the Automake build.  I think it was enough effort
that reviewing it can save you time; that is, if you approve of my
choices.  There quite many changes, maybe a 1/3 rewrite.  One thing to
notice is that I flattened the build with AM includes instead of
SUBDIRS, to enhance dependency tracking and maybe reduce build time a
bit.

Also, it depends on Automake-1.7 or higher to avoid many

    if SOME_CASE
    foo_sources = foo.c
    else
    foo_sources =
    endif

kludges in Makefile.am.

There is some details in ChangeLog.contrib in the patch.  'make
distcheck' now works on Linux x86 and AMD64 when the 'TESTS += ...'
lines in 'tests/tests.am' for leak-related test cases (which fail with
threads) are commented out.

('chmod +x autogen.sh' and remove 'Makefile's and 'Makefile.in's
after patching.)

Petter
-------------- next part --------------
diff -Naur --exclude-from mkpatch.exclude gc7.0alpha2/autogen.sh gc-fixes/autogen.sh
--- gc7.0alpha2/autogen.sh	1970-01-01 01:00:00.000000000 +0100
+++ gc-fixes/autogen.sh	2005-04-20 00:22:32.212862736 +0200
@@ -0,0 +1,31 @@
+#! /bin/sh
+
+set -e
+
+# These version are ok, pre-1.7 is not.  Post 1.7 may produce a lot of
+# warnings for unrelated projects, so prefer 1.7 for now.
+am_version=
+for v in 1.7 1.9 1.8; do
+    if type -p &>/dev/null automake-$v; then
+	am_version="-$v"
+	break
+    fi
+done
+if [ -z "$am_version" ]; then
+    case "`automake --version`" in
+	*\ 0.*|*\ 1.[0-6].*|*\ 1.[0-6]\ *)
+	    echo "$0: Automake-1.7 or later is needed."
+	    exit 2
+	    ;;
+    esac
+fi
+
+set -x
+libtoolize --automake --force
+aclocal$am_version
+automake$am_version -ac
+autoconf
+set +x
+echo
+echo "Ready to run './configure'."
+echo
diff -Naur --exclude-from mkpatch.exclude gc7.0alpha2/boehm-gc.pc.in gc-fixes/boehm-gc.pc.in
--- gc7.0alpha2/boehm-gc.pc.in	1970-01-01 01:00:00.000000000 +0100
+++ gc-fixes/boehm-gc.pc.in	2005-04-17 17:44:04.000000000 +0200
@@ -0,0 +1,10 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: Boehm Conservative Garbage Collector
+Description: A garbage collector for C and C++
+Version: @PACKAGE_VERSION@
+Libs: -L${libdir} -lgc
+Cflags: -I${includedir}
diff -Naur --exclude-from mkpatch.exclude gc7.0alpha2/ChangeLog.contrib gc-fixes/ChangeLog.contrib
--- gc7.0alpha2/ChangeLog.contrib	1970-01-01 01:00:00.000000000 +0100
+++ gc-fixes/ChangeLog.contrib	2005-04-19 22:44:18.674816704 +0200
@@ -0,0 +1,27 @@
+2005-04-19 Petter Urkedal <petter.urkedal at nordita.dk>
+
+	* include/include.am: Adapted from include/Makefile.am and
+	Makefile.am to support non-recursive build. Removed duplicates
+	from variables.
+	* tests/tests.am: Similar.
+	* cord/cord.am: Similar.
+	* doc/doc.am: Similar.
+	* Makefile.am: Include the above files.
+	* include/Makefile.am: Removed.
+	* tests/Makefile.am: Removed.
+	* cord/Makefile.am: Removed.
+	* doc/Makefile.am: Removed.
+	* configure.ac: Automake option subdir-objects to preserve the
+	hierachical layout of built files.
+
+	* configure.ac: Added some missing AC_ARG_ENABLE.
+
+	* Makefile.am, configure.ac: Use more AC_CONDITIONALs instead of
+	substituted file lists.  Some modernisation.
+
+	* configure.ac: Detect presence of libatomic_ops. If not present
+	hook internal version to build.
+
+	* boehm-gc.pc.in: Provide pkgconfig heaven to clients.
+	* configure.ac: AC_SUBST and
+	* Makefile.am: install.
diff -Naur --exclude-from mkpatch.exclude gc7.0alpha2/configure.ac gc-fixes/configure.ac
--- gc7.0alpha2/configure.ac	2004-12-18 02:27:43.000000000 +0100
+++ gc-fixes/configure.ac	2005-04-19 22:53:07.357444728 +0200
@@ -24,13 +24,13 @@
 AC_PREREQ(2.53)
 AC_REVISION($Revision: 1.2 $)
 GC_SET_VERSION
-AM_INIT_AUTOMAKE
+AM_INIT_AUTOMAKE([foreign dist-bzip2 subdir-objects nostdinc])
 AM_MAINTAINER_MODE
 
 AC_SUBST(PACKAGE)
 AC_SUBST(GC_VERSION)
 
-AC_PROG_CC
+AM_PROG_CC_C_O
 AC_PROG_CXX
 
 AM_PROG_AS
@@ -45,27 +45,28 @@
 GC_CFLAGS=${gc_cflags}
 AC_SUBST(GC_CFLAGS)
 
-AC_ARG_ENABLE(threads, [  --enable-threads=TYPE   choose threading package],
+AC_ARG_ENABLE(threads,
+  [AC_HELP_STRING([--enable-threads=TYPE], [choose threading package])],
   THREADS=$enableval,
   [ AC_MSG_CHECKING([for thread model used by GCC])
     THREADS=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
     if test -z "$THREADS"; then
       THREADS=no
     fi
-    AC_MSG_RESULT([$THREADS])])
+    AC_MSG_RESULT([$THREADS]) ])
 
 AC_ARG_ENABLE(parallel-mark,
-[  --enable-parallel-mark	parallelize marking and free list construction],
+   [AC_HELP_STRING([--enable-parallel-mark],
+	[parallelize marking and free list construction])],
    [case "$THREADS" in
       no | none | single)
 	AC_MSG_ERROR([Parallel mark requires --enable-threads=x spec])
 	;;
-    esac]
+    esac ]
 )
 
 AC_ARG_ENABLE(cplusplus,
-[  --enable-cplusplus		install C++ support],
-)
+    [AC_HELP_STRING([--enable-cplusplus], [install C++ support])])
 
 INCLUDES=-I${srcdir}/include
 THREADDLLIBS=
@@ -93,6 +94,7 @@
      *-*-aix*)
 	AC_DEFINE(GC_AIX_THREADS)
 	AC_DEFINE(_REENTRANT)
+	aix_irix_threads=true
 	;;
      *-*-hpux*)
 	AC_MSG_WARN("Only HP/UX 11 threads are supported.")
@@ -113,12 +115,15 @@
      *-*-solaris*)
 	AC_DEFINE(GC_SOLARIS_THREADS)
 	AC_DEFINE(GC_SOLARIS_PTHREADS)
+	solaris_threads=true
 	;;
      *-*-irix*)
 	AC_DEFINE(GC_IRIX_THREADS)
+	aix_irix_threads=true
 	;;
      *-*-cygwin*)
 	AC_DEFINE(GC_WIN32_THREADS)
+	win32_threads=true
 	;;
      *-*-darwin*)
 	AC_DEFINE(GC_DARWIN_THREADS)
@@ -126,6 +131,7 @@
 	if test "${enable_parallel_mark}" = yes; then
 	  AC_DEFINE(PARALLEL_MARK)
 	fi
+	darwin_threads=true
 	;;
      *-*-osf*)
 	AC_DEFINE(GC_OSF1_THREADS)
@@ -176,6 +182,12 @@
     ;;
 esac
 AC_SUBST(THREADDLLIBS)
+AM_CONDITIONAL(THREADS, test x$THREADS != xnone)
+AM_CONDITIONAL(PTHREADS, test x$THREADS = xposix)
+AM_CONDITIONAL(AIX_IRIX_THREADS, test x$aix_irix_threads = xtrue)
+AM_CONDITIONAL(DARWIN_THREADS, test x$darwin_threads = xtrue)
+AM_CONDITIONAL(ARCH_SOLARIS, test x$solaris_threads = xtrue)
+AM_CONDITIONAL(WIN32_THREADS, test x$win32_threads = xtrue)
 
 case "$host" in 
    powerpc-*-darwin*)
@@ -210,8 +222,6 @@
 
 addobjs=
 addlibs=
-addincludes=
-addtests=
 CXXINCLUDES=
 case "$TARGET_ECOS" in
    no)
@@ -223,11 +233,6 @@
       ;;
 esac
 
-if test "${enable_cplusplus}" = yes; then
-      addincludes="$addincludes include/gc_cpp.h include/gc_allocator.h"
-      addtests="$addtests test_cpp"
-fi
-
 AM_CONDITIONAL(CPLUSPLUS, test "${enable_cplusplus}" = yes)
 
 AC_SUBST(CXX)
@@ -303,9 +308,7 @@
 fi
 addobjs="$addobjs $machdep"
 AC_SUBST(addobjs)
-AC_SUBST(addincludes)
 AC_SUBST(addlibs)
-AC_SUBST(addtests)
 
 AC_PROG_LIBTOOL
 
@@ -382,10 +385,52 @@
 AC_DEFINE(NO_EXECUTE_PERMISSION)
 AC_DEFINE(ALL_INTERIOR_POINTERS)
 
+
+dnl Interface Selection
+dnl -------------------
+dnl
 dnl By default, make the library as general as possible.
-AC_DEFINE(JAVA_FINALIZATION)
-AC_DEFINE(GC_GCJ_SUPPORT)
-AC_DEFINE(ATOMIC_UNCOLLECTABLE)
+
+dnl :FIXME: gcj does not work as of gc-7.0_alpha2, so default set to no.
+enable_gcj_support=no
+AC_ARG_ENABLE(gcj-support,
+    [AC_HELP_STRING([--enable-gcj-support],
+	[Enable support for gcj.])])
+AM_CONDITIONAL(ENABLE_GCJ_SUPPORT,
+    [test x"$enable_gcj_support" != xno])
+if test x"$enable_gcj_support" != xno; then
+    AC_DEFINE(GC_GCJ_SUPPORT, 1, [Define to include support for gcj])
+fi
+
+AC_ARG_ENABLE(java-finalization,
+    [AC_HELP_STRING([--disable-java-finalization],
+	[Disable support for java finalization.])])
+if test x"$enable_java_finalization" != xno; then
+    AC_DEFINE(JAVA_FINALIZATION)
+fi
+
+AC_ARG_ENABLE(atomic-uncollectable,
+    [AC_HELP_STRING([--disable-atomic-uncollectible],
+	[Disable support for atomic uncollectible allocation.])])
+if test x"$enable_atomic_uncollectible" != x"no"; then
+    AC_DEFINE(ATOMIC_UNCOLLECTABLE, 1,
+	[Define to enable atomic uncollectible allocation.])
+fi
+
+AC_ARG_ENABLE(redirect-malloc,
+    [AC_HELP_STRING([--enable-redirect-malloc],
+	[Redirect malloc and friends to GC routines])])
+
+if test "${enable_redirect_malloc}" = yes; then
+    if test "${enable_full_debug}" = yes; then
+	AC_DEFINE(REDIRECT_MALLOC, GC_debug_malloc_replacement)
+	AC_DEFINE(REDIRECT_REALLOC, GC_debug_realloc_replacement)
+	AC_DEFINE(REDIRECT_FREE, GC_debug_free)
+    else
+	AC_DEFINE(REDIRECT_MALLOC, GC_malloc)
+    fi
+fi
+
 
 dnl This is something of a hack.  When cross-compiling we turn off
 dnl some functionality.  We also enable the "small" configuration.
@@ -397,9 +442,14 @@
    AC_DEFINE(NO_DEBUGGING)
 fi
 
+
+dnl Debugging
+dnl ---------
+
 UNWINDLIBS=
 AC_ARG_ENABLE(gc-debug,
-[  --enable-gc-debug	include full support for pointer backtracing etc.],
+[AC_HELP_STRING([--enable-gc-debug],
+    [include full support for pointer backtracing etc.])],
 [ if test "$enable_gc_debug" = "yes"; then
     AC_MSG_WARN("Should define GC_DEBUG and use debug alloc. in clients.")
     AC_DEFINE(KEEP_BACK_PTRS)
@@ -427,32 +477,61 @@
 
 AC_SUBST(UNWINDLIBS)
 
-AC_ARG_ENABLE(redirect-malloc,
-[  --enable-redirect-malloc  redirect malloc and friends to GC routines])
-
-if test "${enable_redirect_malloc}" = yes; then
-    if test "${enable_full_debug}" = yes; then
-	AC_DEFINE(REDIRECT_MALLOC, GC_debug_malloc_replacement)
-	AC_DEFINE(REDIRECT_REALLOC, GC_debug_realloc_replacement)
-	AC_DEFINE(REDIRECT_FREE, GC_debug_free)
-    else
-	AC_DEFINE(REDIRECT_MALLOC, GC_malloc)
-    fi
-fi
-
 AC_ARG_ENABLE(gc-assertions,
-[  --enable-gc-assertions  collector-internal assertion checking])
+    [AC_HELP_STRING([--enable-gc-assertions],
+	[collector-internal assertion checking])])
 if test "${enable_gc_assertions}" = yes; then
     AC_DEFINE(GC_ASSERTIONS)
 fi
 
 AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
 
-AC_OUTPUT(
-[Makefile doc/Makefile include/Makefile tests/Makefile cord/Makefile],,
-srcdir=${srcdir}
-host=${host}
-CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-CC="${CC}"
-DEFS="$DEFS"
-)
+
+dnl Atomic Ops
+dnl ----------
+
+AC_CHECK_HEADER(libatomic_ops.h,
+  [ AC_MSG_NOTICE([Using pre-installed libatomic_ops]) ],
+  [ ao_dir=
+    for candidate in ${srcdir}/libatomic_ops*; do
+	case $candidate in
+	    *.tar.gz)
+		;;
+	    *)
+		if test -e "$candidate"; then
+		    ao_dir="$candidate"
+		fi
+		;;
+	esac
+    done
+    if test -z "$ao_dir"; then
+	AC_MSG_ERROR([Missig libatomic_ops.])
+    fi
+    ao_version="${ao_dir#*libatomic_ops-}"
+    ao_dir=libatomic_ops-${ao_version}
+    AC_MSG_NOTICE([Using internal version of libatomic_ops])
+
+    dnl Automake does not accept shell variables in AC_CONFIG_SUBDIRS
+    test -e ${srcdir}/libatomic_ops \
+	|| ln -sf ${ao_dir} ${srcdir}/libatomic_ops
+    AC_CONFIG_SUBDIRS(libatomic_ops)
+
+    GC_CFLAGS="${MY_CFLAGS} -I \$(top_srcdir)/libatomic_ops/src"
+    ATOMIC_OPS_LIBS="-L \$(top_builddir)/libatomic_ops/src -latomic_ops"
+    maybe_libatomic_ops=libatomic_ops
+  ])
+AC_SUBST(maybe_libatomic_ops)
+
+dnl Produce the Files
+dnl -----------------
+
+AC_CONFIG_FILES([Makefile boehm-gc.pc])
+
+AC_CONFIG_COMMANDS([default],,
+  [ srcdir=${srcdir}
+    host=${host}
+    CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+    CC="${CC}"
+    DEFS="$DEFS" ])
+
+AC_OUTPUT
diff -Naur --exclude-from mkpatch.exclude gc7.0alpha2/cord/cord.am gc-fixes/cord/cord.am
--- gc7.0alpha2/cord/cord.am	1970-01-01 01:00:00.000000000 +0100
+++ gc-fixes/cord/cord.am	2005-04-17 21:29:35.000000000 +0200
@@ -0,0 +1,14 @@
+
+lib_LTLIBRARIES += libcord.la
+
+libcord_la_SOURCES = \
+	cord/cordbscs.c				\
+	cord/cordprnt.c				\
+	cord/cordtest.c				\
+	cord/cordxtra.c				
+
+
+EXTRA_DIST += \
+	cord/cordbscs.c cord/cordtest.c cord/de.c \
+	cord/cordprnt.c cord/cordxtra.c cord/de_cmds.h \
+	cord/de_win.h cord/de_win.c cord/de_win.RC cord/de_win.ICO
diff -Naur --exclude-from mkpatch.exclude gc7.0alpha2/cord/Makefile.am gc-fixes/cord/Makefile.am
--- gc7.0alpha2/cord/Makefile.am	2004-12-17 00:34:54.000000000 +0100
+++ gc-fixes/cord/Makefile.am	1970-01-01 01:00:00.000000000 +0100
@@ -1,12 +0,0 @@
-AM_CPPFLAGS=-I $(top_srcdir)/include -I$(top_srcdir)/include/private
-
-lib_LTLIBRARIES = libcord.la
-
-libcord_la_SOURCES = \
-	cordbscs.c				\
-	cordprnt.c				\
-	cordtest.c				\
-	cordxtra.c				
-
-
-EXTRA_DIST = de.c de_cmds.h de_win.ICO de_win.RC de_win.c de_win.h
diff -Naur --exclude-from mkpatch.exclude gc7.0alpha2/doc/doc.am gc-fixes/doc/doc.am
--- gc7.0alpha2/doc/doc.am	1970-01-01 01:00:00.000000000 +0100
+++ gc-fixes/doc/doc.am	2005-04-17 21:21:50.000000000 +0200
@@ -0,0 +1,52 @@
+# 
+# 
+# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
+# OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
+# 
+# Permission is hereby granted to use or copy this program
+# for any purpose,  provided the above notices are retained on all copies.
+# Permission to modify the code and to distribute modified code is granted,
+# provided the above notices are retained, and a notice that the code was
+# modified is included with the above copyright notice.
+#
+# Modified by: Grzegorz Jakacki <jakacki at acm dot org>
+# Modified by: Petter Urkedal <petter.urkedal at nordita.dk>
+
+## Process this file with automake to produce Makefile.in.
+
+# installed documentation
+#
+dist_pkgdata_DATA = \
+	doc/barrett_diagram \
+	doc/debugging.html \
+	doc/gc.man \
+	doc/gcdescr.html \
+	doc/README \
+	doc/README.amiga \
+	doc/README.arm.cross \
+	doc/README.autoconf \
+	doc/README.changes \
+	doc/README.contributors \
+	doc/README.cords \
+	doc/README.DGUX386 \
+	doc/README.dj \
+	doc/README.environment \
+	doc/README.ews4800 \
+	doc/README.hp \
+	doc/README.linux \
+	doc/README.Mac \
+	doc/README.MacOSX \
+	doc/README.macros \
+	doc/README.OS2 \
+	doc/README.rs6000 \
+	doc/README.sgi \
+	doc/README.solaris2 \
+	doc/README.uts \
+	doc/README.win32 \
+	doc/tree.html \
+	doc/leak.html \
+	doc/gcinterface.html \
+	doc/scale.html \
+	doc/README.darwin \
+	doc/simple_example.html
+
diff -Naur --exclude-from mkpatch.exclude gc7.0alpha2/doc/Makefile.am gc-fixes/doc/Makefile.am
--- gc7.0alpha2/doc/Makefile.am	2004-04-07 00:43:26.000000000 +0200
+++ gc-fixes/doc/Makefile.am	1970-01-01 01:00:00.000000000 +0100
@@ -1,27 +0,0 @@
-# 
-# 
-# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
-# OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
-# 
-# Permission is hereby granted to use or copy this program
-# for any purpose,  provided the above notices are retained on all copies.
-# Permission to modify the code and to distribute modified code is granted,
-# provided the above notices are retained, and a notice that the code was
-# modified is included with the above copyright notice.
-#
-# Modified by: Grzegorz Jakacki <jakacki at acm dot org>
-
-## Process this file with automake to produce Makefile.in.
-
-# installed documentation
-#
-dist_pkgdata_DATA = barrett_diagram debugging.html gc.man \
-    gcdescr.html README README.amiga README.arm.cross \
-    README.autoconf README.changes README.contributors \
-    README.cords README.DGUX386 README.dj README.environment \
-    README.ews4800 README.hp README.linux README.Mac \
-    README.MacOSX README.macros README.OS2 README.rs6000 \
-    README.sgi README.solaris2 README.uts README.win32 \
-    tree.html leak.html gcinterface.html scale.html \
-    README.darwin simple_example.html
-
diff -Naur --exclude-from mkpatch.exclude gc7.0alpha2/include/include.am gc-fixes/include/include.am
--- gc7.0alpha2/include/include.am	1970-01-01 01:00:00.000000000 +0100
+++ gc-fixes/include/include.am	2005-04-17 21:22:39.000000000 +0200
@@ -0,0 +1,53 @@
+# 
+# 
+# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
+# OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
+# 
+# Permission is hereby granted to use or copy this program
+# for any purpose,  provided the above notices are retained on all copies.
+# Permission to modify the code and to distribute modified code is granted,
+# provided the above notices are retained, and a notice that the code was
+# modified is included with the above copyright notice.
+#
+# Modified by: Grzegorz Jakacki <jakacki at acm dot org>
+# Modified by: Petter Urkedal <petter.urkedal at nordita.dk>
+
+## Process this file with automake to produce Makefile.in.
+
+# installed headers
+#
+pkginclude_HEADERS += \
+	include/gc.h \
+	include/gc_typed.h \
+	include/gc_inline.h \
+	include/gc_mark.h \
+	include/gc_cpp.h \
+	include/weakpointer.h \
+	include/new_gc_alloc.h \
+	include/gc_allocator.h \
+	include/gc_backptr.h \
+	include/gc_gcj.h \
+	include/leak_detector.h \
+	include/gc_amiga_redirects.h \
+	include/gc_pthread_redirects.h \
+	include/gc_config_macros.h \
+	include/gc_tiny_fl.h
+
+# headers which are not installed
+#
+dist_noinst_HEADERS += \
+	include/private/gc_hdrs.h \
+	include/private/gc_priv.h \
+	include/private/gcconfig.h \
+	include/private/gc_pmark.h \
+	include/private/gc_locks.h \
+	include/private/dbg_mlc.h \
+	include/private/specific.h \
+	include/private/cord_pos.h \
+	include/private/pthread_support.h \
+	include/private/pthread_stop_world.h \
+	include/private/darwin_semaphore.h \
+	include/private/darwin_stop_world.h \
+	include/cord.h \
+	include/ec.h \
+	include/javaxfc.h 
diff -Naur --exclude-from mkpatch.exclude gc7.0alpha2/include/Makefile.am gc-fixes/include/Makefile.am
--- gc7.0alpha2/include/Makefile.am	2004-11-09 21:01:17.000000000 +0100
+++ gc-fixes/include/Makefile.am	1970-01-01 01:00:00.000000000 +0100
@@ -1,35 +0,0 @@
-# 
-# 
-# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
-# OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
-# 
-# Permission is hereby granted to use or copy this program
-# for any purpose,  provided the above notices are retained on all copies.
-# Permission to modify the code and to distribute modified code is granted,
-# provided the above notices are retained, and a notice that the code was
-# modified is included with the above copyright notice.
-#
-# Modified by: Grzegorz Jakacki <jakacki at acm dot org>
-
-## Process this file with automake to produce Makefile.in.
-
-# installed headers
-#
-pkginclude_HEADERS = gc.h gc_typed.h gc_inl.h \
-    gc_inline.h gc_mark.h gc_cpp.h \
-    weakpointer.h new_gc_alloc.h \
-    gc_allocator.h gc_backptr.h \
-    gc_gcj.h gc_local_alloc.h leak_detector.h \
-    gc_amiga_redirects.h gc_pthread_redirects.h \
-    gc_config_macros.h
-
-# headers which are not installed
-#
-dist_noinst_HEADERS = private/gc_hdrs.h \
-    private/gc_priv.h private/gcconfig.h \
-    private/gc_pmark.h private/gc_locks.h \
-    private/dbg_mlc.h \
-    private/specific.h private/cord_pos.h \
-    private/pthread_support.h private/pthread_stop_world.h \
-    private/darwin_semaphore.h private/darwin_stop_world.h \
-    cord.h ec.h javaxfc.h 
diff -Naur --exclude-from mkpatch.exclude gc7.0alpha2/Makefile.am gc-fixes/Makefile.am
--- gc7.0alpha2/Makefile.am	2004-12-17 01:28:30.000000000 +0100
+++ gc-fixes/Makefile.am	2005-04-19 22:51:16.392313992 +0200
@@ -12,49 +12,71 @@
 # Original author: Tom Tromey
 # Severely truncated by Hans-J. Boehm
 # Modified by: Grzegorz Jakacki <jakacki at acm dot org>
+# Modified by: Petter Urkedal <petter.urkedal at nordita.dk> (2005-04)
 
 ## Process this file with automake to produce Makefile.in.
 
 ## FIXME: `make distcheck' in this directory will not currently work.
 ##     This is most likely to the explicit flags passed to submakes.
 
-## FIXME: I'll use AM_AUTOMAKE_INIT(options) macro call in configure.in 
-AUTOMAKE_OPTIONS = foreign
-
-SUBDIRS = include cord . tests doc  
+SUBDIRS = @maybe_libatomic_ops@ .
 
+# Initialize variables so that we can declare files locally.
 EXTRA_DIST = 
-    ## more items will be succesively added below
+lib_LTLIBRARIES =
+include_HEADERS =
+pkginclude_HEADERS =
+dist_noinst_HEADERS =
+check_PROGRAMS =
+TESTS =
+
+pkgconfigdir = $(libdir)/pkgconfig
+dist_pkgconfig_DATA = boehm-gc.pc
+
+include include/include.am
+include cord/cord.am
+include tests/tests.am
+include doc/doc.am
+
+
+# C Library
+# ---------
+
+lib_LTLIBRARIES += libgc.la
+libgc_la_SOURCES = \
+	allchblk.c alloc.c blacklst.c checksums.c dbg_mlc.c \
+	dyn_load.c finalize.c gc_dlopen.c gcj_mlc.c headers.c \
+	malloc.c mallocx.c mark.c mark_rts.c misc.c new_hblk.c \
+	obj_map.c os_dep.c pcr_interface.c ptr_chck.c real_malloc.c reclaim.c \
+	specific.c stubborn.c typd_mlc.c \
+	backgraph.c
 
-if CPLUSPLUS
-extra = libgccpp.la
-else
-extra = 
-endif
+# C Library: Architecture Dependent
+# ---------------------------------
 
-lib_LTLIBRARIES = libgc.la $(extra) 
+if PTHREADS
+libgc_la_SOURCES += pthread_support.c pthread_stop_world.c
+endif
 
-include_HEADERS = include/gc.h include/gc_local_alloc.h \
-	include/gc_pthread_redirects.h include/gc_config_macros.h \
-	include/leak_detector.h include/gc_typed.h include/gc_tiny_fl.h \
-	@addincludes@
+if AIX_IRIX_THREADS
+libgc_la_SOURCES += aix_irix_threads.c
+endif
 
-EXTRA_HEADERS = include/gc_cpp.h include/gc_allocator.h
+# CHECK: No solaris_pthreads.c solaris_threads.c in gc7.0alpha2.tar.gz.
+#if ARCH_SOLARIS
+#libgc_la_SOURCES += solaris_pthreads.c solaris_threads.c
+#endif
 
 if POWERPC_DARWIN
-asm_libgc_sources = powerpc_darwin_mach_dep.s
-else
-asm_libgc_sources = 
+libgc_la_SOURCES += powerpc_darwin_mach_dep.s
+endif
+if DARWIN_THREADS
+libgc_la_SOURCES += darwin_stop_world.c
 endif
 
-libgc_la_SOURCES = allchblk.c alloc.c blacklst.c checksums.c dbg_mlc.c \
-dyn_load.c finalize.c gc_dlopen.c gcj_mlc.c headers.c aix_irix_threads.c \
-malloc.c mallocx.c mark.c mark_rts.c misc.c new_hblk.c \
-obj_map.c os_dep.c pcr_interface.c ptr_chck.c real_malloc.c reclaim.c \
-solaris_pthreads.c solaris_threads.c specific.c stubborn.c typd_mlc.c \
-backgraph.c win32_threads.c \
-pthread_support.c pthread_stop_world.c darwin_stop_world.c \
-$(asm_libgc_sources)
+if WIN32_THREADS
+libgc_la_SOURCES += win32_threads.c
+endif
 
 # Include THREADDLLIBS here to ensure that the correct versions of
 # linuxthread semaphore functions get linked:
@@ -67,25 +89,37 @@
     rs6000_mach_dep.s sparc_mach_dep.S sparc_netbsd_mach_dep.s \
     sparc_sunos4_mach_dep.s ia64_save_regs_in_stack.s
 
+
+# C++ Interface
+# -------------
+
 if CPLUSPLUS
+lib_LTLIBRARIES += libgccpp.la
+pkginclude_HEADERS += include/gc_cpp.h include/gc_allocator.h
 libgccpp_la_SOURCES = gc_cpp.cc
 libgccpp_la_LIBADD = $(THREADDLLIBS) $(UNWINDLIBS)
 libgccpp_la_LDFLAGS = -version-info 1:2:0
 endif
-## FIXME: automatically added to make dist if EXTRA_*_la_SOURCES
-#EXTRA_DIST += alpha_mach_dep.S mips_sgi_mach_dep.s sparc_mach_dep.S
+
+# FIXME: If Visual C++ users use Makefile.am, this should go into
+# pkginclude_HEADERS with proper AM_CONDITIONALization.  Otherwise
+# delete this comment.
+EXTRA_DIST += gc_cpp.cpp
+
+
+# Misc
+# ----
 
 AM_CXXFLAGS = @GC_CFLAGS@
 AM_CFLAGS = @GC_CFLAGS@
 
-
 ## FIXME: relies on internal code generated by automake.
 ## FIXME: ./configure --enable-dependency-tracking should be used 
-all_objs = @addobjs@ $(libgc_la_OBJECTS)
-$(all_objs) : include/private/gcconfig.h include/private/gc_priv.h \
-include/private/gc_hdrs.h include/gc.h include/gc_gcj.h \
-include/gc_pthread_redirects.h include/gc_config_macros.h \
-include/gc_mark.h @addincludes@
+#all_objs = @addobjs@ $(libgc_la_OBJECTS)
+#$(all_objs) : include/private/gcconfig.h include/private/gc_priv.h \
+#include/private/gc_hdrs.h include/gc.h include/gc_gcj.h \
+#include/gc_pthread_redirects.h include/gc_config_macros.h \
+#include/gc_mark.h @addincludes@
 
 ## FIXME: we shouldn't have to do this, but automake forces us to.
 .s.lo:
@@ -112,9 +146,9 @@
     ## configure.host --- used by Makefile.{am,dj,direct}
 
 # headers which are not installed
-# (see include/Makefile.am for more)
+# (see include/include.am for more)
 #
-dist_noinst_HEADERS = version.h
+dist_noinst_HEADERS += version.h
 
 # documentation which is not installed
 #
@@ -130,21 +164,13 @@
 # files used by makefiles other than Makefile.am
 #
 EXTRA_DIST += add_gc_prefix.c gcname.c if_mach.c if_not_there.c \
-    hpux_test_and_clear.s pc_excludes gc.mak MacOS.c \
+    hpux_test_and_clear.s gc.mak MacOS.c \
     MacProjects.sit.hqx mach_dep.c setjmp_t.c \
     threadlibs.c AmigaOS.c \
     Mac_files/datastart.c Mac_files/dataend.c \
     Mac_files/MacOS_config.h Mac_files/MacOS_Test_config.h
+# :CHECK: If pc_excludes still around, re-add to EXTRA_DIST.
 
-# part of C++ interface
-#
-EXTRA_DIST += gc_cpp.cc gc_cpp.cpp
-
-# cord package
-#
-EXTRA_DIST += cord/cordbscs.c cord/cordtest.c cord/de.c cord/de_win.c \
-    cord/de_win.ICO cord/cordprnt.c cord/cordxtra.c cord/de_cmds.h \
-    cord/de_win.h cord/de_win.RC
 
 # this is an auxiliary shell file used by Makefile and Makefile.direct
 #
diff -Naur --exclude-from mkpatch.exclude gc7.0alpha2/tests/Makefile.am gc-fixes/tests/Makefile.am
--- gc7.0alpha2/tests/Makefile.am	2004-12-17 00:35:21.000000000 +0100
+++ gc-fixes/tests/Makefile.am	1970-01-01 01:00:00.000000000 +0100
@@ -1,37 +0,0 @@
-AM_CPPFLAGS=-I$(top_builddir)/include -I$(top_builddir)/include/private
-
-if CPLUSPLUS
-extra_checks = test_cpp
-else
-extra_checks = 
-endif
-
-## FIXME: trace_test don't works on macosx 10.3 
-## gcc -g -O2 -o .libs/tracetest trace_test.o  ../.libs/libgc.dylib -lpthread
-## ld: Undefined symbols:
-## _GC_generate_random_backtrace
-
-check_PROGRAMS = gctest leaktest middletest threadleaktest $(extra_checks)
-
-gctest_SOURCES = test.c
-gctest_LDADD = $(top_builddir)/libgc.la $(THREADLIBS) $(UNWINDLIBS) $(EXTRA_TEST_LIBS)
-gctest_DEPENDENCIES = $(top_builddir)/libgc.la
-
-leaktest_SOURCES = leak_test.c
-leaktest_LDADD = $(top_builddir)/libgc.la $(THREADLIBS) $(UNWINDLIBS) $(EXTRA_TEST_LIBS)
-
-middletest_SOURCES = middle.c
-middletest_LDADD = $(top_builddir)/libgc.la $(THREADLIBS) $(UNWINDLIBS) $(EXTRA_TEST_LIBS)
-
-## tracetest_SOURCES = trace_test.c
-## tracetest_LDADD = $(top_builddir)/libgc.la $(THREADLIBS) $(UNWINDLIBS) $(EXTRA_TEST_LIBS)
-
-threadleaktest_SOURCES = thread_leak_test.c
-threadleaktest_LDADD = $(top_builddir)/libgc.la $(THREADLIBS) $(UNWINDLIBS) $(EXTRA_TEST_LIBS)
-
-if CPLUSPLUS
-test_cpp_SOURCES = test_cpp.cc
-test_cpp_LDADD = $(top_builddir)/libgc.la $(top_builddir)/libgccpp.la $(THREADLIBS) $(UNWINDLIBS) $(EXTRA_TEST_LIBS)
-endif
-
-TESTS = gctest leaktest middletest threadleaktest $(extra_checks)
diff -Naur --exclude-from mkpatch.exclude gc7.0alpha2/tests/tests.am gc-fixes/tests/tests.am
--- gc7.0alpha2/tests/tests.am	1970-01-01 01:00:00.000000000 +0100
+++ gc-fixes/tests/tests.am	2005-04-20 00:40:36.387043208 +0200
@@ -0,0 +1,60 @@
+#
+#
+# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
+# OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
+#
+# Permission is hereby granted to use or copy this program
+# for any purpose,  provided the above notices are retained on all copies.
+# Permission to modify the code and to distribute modified code is granted,
+# provided the above notices are retained, and a notice that the code was
+# modified is included with the above copyright notice.
+
+
+## FIXME: trace_test don't works on macosx 10.3 
+## gcc -g -O2 -o .libs/tracetest trace_test.o  ../.libs/libgc.dylib -lpthread
+## ld: Undefined symbols:
+## _GC_generate_random_backtrace
+
+
+# Common libs to _LDADD for all tests.
+test_ldadd = \
+	$(top_builddir)/libgc.la \
+	$(THREADLIBS) $(UNWINDLIBS) $(EXTRA_TEST_LIBS)
+
+
+
+TESTS += gctest
+check_PROGRAMS += gctest
+gctest_SOURCES = tests/test.c
+gctest_LDADD = $(test_ldadd)
+gctest_DEPENDENCIES = $(top_builddir)/libgc.la
+
+TESTS += leaktest
+check_PROGRAMS += leaktest
+leaktest_SOURCES = tests/leak_test.c
+leaktest_LDADD = $(test_ldadd)
+
+TESTS += middletest
+check_PROGRAMS += middletest
+middletest_SOURCES = tests/middle.c
+middletest_LDADD = $(test_ldadd)
+
+#TESTS += tracetest
+#check_PROGRAMS += tracetest
+#tracetest_SOURCES = tests/trace_test.c
+#tracetest_LDADD = $(test_ldadd)
+
+if THREADS
+TESTS += threadleaktest
+check_PROGRAMS += threadleaktest
+threadleaktest_SOURCES = tests/thread_leak_test.c
+threadleaktest_LDADD = $(test_ldadd)
+endif
+
+if CPLUSPLUS
+TESTS += test_cpp
+check_PROGRAMS += test_cpp
+test_cpp_SOURCES = tests/test_cpp.cc
+test_cpp_LDADD = libgccpp.la $(test_ldadd)
+endif
+


More information about the Gc mailing list