Mega-merge of my last 2 weeks hacking.  This basically does the groundwork
for pthread_* support.  Major changes:

* Valgrind now contains a (skeletal!) user-space pthreads
  implementation.  The exciting bits are in new file vg_scheduler.c.
  This contains thread management and scheduling, including nasty crud
  to do with making some syscalls (read,write,nanosleep) nonblocking.
  Also implementation of pthread_ functions: create join
  mutex_{create,destroy,lock,unlock} and cancel.

* As a side effect of the above, major improvements to signal handling
  and to the client-request machinery.  This is now used to intercept
  malloc/free etc too; the hacky way this is done before is gone.
  Another side effect is that vg_dispatch.S is greatly simplified.
  Also, the horrible hacks to do with delivering signals to threads
  blocked in syscalls are gone, since the new mechanisms cover this case
  easily.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@52 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/Makefile.am b/Makefile.am
index 4f0034a..9e73341 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -29,6 +29,7 @@
 valgrinq_so_SOURCES = vg_valgrinq_dummy.c
 
 valgrind_so_SOURCES = \
+	vg_scheduler.c \
 	vg_clientmalloc.c \
 	vg_clientperms.c \
 	vg_demangle.c \
@@ -70,10 +71,10 @@
         vg_unsafe.h
 
 
-vg_memory.o: vg_memory.c
+vg_memory.o: vg_memory.c $(noinst_HEADERS)
 	$(COMPILE) -O2 @PREFERRED_STACK_BOUNDARY@ -c $<
 
-vg_clientmalloc.o: vg_clientmalloc.c
+vg_clientmalloc.o: vg_clientmalloc.c $(noinst_HEADERS)
 	$(COMPILE) -fno-omit-frame-pointer -c $<