This jumbo-checkin is the Full Virtualization checkin.  This eliminates
Valgrind's dependency on the dynamic linker for getting started, and
instead takes things into its own hands.

This checkin doesn't add much in the way of new functionality, but it
is the basis for all future work on Valgrind.  It allows us much more
flexibility in implementation, and well as increasing the reliability
of Valgrind by protecting it more from its clients.

This patch requires some changes to tools to update them to the changes
in the tool API, but they are straightforward.  See the posting "Heads
up: Full Virtualization" on valgrind-developers for a more complete
description of this change and its effects on you.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2118 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/helgrind/Makefile.am b/helgrind/Makefile.am
index c31517a..f9df724 100644
--- a/helgrind/Makefile.am
+++ b/helgrind/Makefile.am
@@ -6,13 +6,24 @@
 		@PREFERRED_STACK_BOUNDARY@ -g
 
 valdir = $(libdir)/valgrind
+inplacedir = $(top_srcdir)/.in_place
 
-val_PROGRAMS = vgskin_helgrind.so
+val_PROGRAMS = vgskin_helgrind.so vgpreload_helgrind.so
 
 vgskin_helgrind_so_SOURCES = hg_main.c
 vgskin_helgrind_so_LDFLAGS = -shared
 vgskin_helgrind_so_LDADD = ../coregrind/vg_replace_malloc.o
 
+vgpreload_helgrind_so_SOURCES = 
+vgpreload_helgrind_so_LDADD = $(top_srcdir)/coregrind/vg_replace_malloc.o
+vgpreload_helgrind_so_DEPENDENCIES = $(top_srcdir)/coregrind/vg_replace_malloc.o
+vgpreload_helgrind_so_LDFLAGS = -shared -Wl,-z,interpose,-z,initfirst
+
 hgincludedir = $(includedir)/valgrind
 
 hginclude_HEADERS = helgrind.h
+
+all-local:
+	mkdir -p $(inplacedir)
+	-rm -f $(addprefix $(inplacedir)/,$(val_PROGRAMS))
+	ln -f -s $(addprefix $(top_srcdir)/$(subdir)/,$(val_PROGRAMS)) $(inplacedir)