fixed some bugs in CFLAGS passing. added a specific threaded test case

* configure.in: fixed some bugs in CFLAGS passing.
* test/threads Makefile.am testThreads.c: added a specific
  threaded test case (really nasty, guaranteed).
Daniel
diff --git a/Makefile.am b/Makefile.am
index 7104fc0..c87ca99 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -7,7 +7,7 @@
 
 INCLUDES = -I@srcdir@/include -I$(top_builddir)/include @THREAD_CFLAGS@ @Z_CFLAGS@ 
 
-noinst_PROGRAMS=testSAX testHTML testXPath testURI testDocbook
+noinst_PROGRAMS=testSAX testHTML testXPath testURI testDocbook testThreads
 
 bin_PROGRAMS = xmllint xmlcatalog
 
@@ -72,6 +72,11 @@
 testXPath_DEPENDENCIES = $(DEPS)
 testXPath_LDADD= $(LDADDS)
 
+testThreads_SOURCES=testThreads.c
+testThreads_LDFLAGS = 
+testThreads_DEPENDENCIES = $(DEPS)
+testThreads_LDADD= $(LDADDS)
+
 testURI_SOURCES=testURI.c
 testURI_LDFLAGS = 
 testURI_DEPENDENCIES = $(DEPS)
@@ -81,7 +86,7 @@
 
 testall : tests SVGtests SAXtests
 
-tests: XMLtests XMLenttests HTMLtests Validtests URItests XPathtests XPtrtests XIncludetests Scripttests Catatests
+tests: XMLtests XMLenttests HTMLtests Validtests URItests XPathtests XPtrtests XIncludetests Scripttests Catatests @TEST_THREADS@
 
 HTMLtests : testHTML
 	@(echo > .memdump)
@@ -417,6 +422,12 @@
 	      rm result.$$name result2.$$name ; \
 	  fi ; fi ; done)
 
+Threadtests : testThreads
+	@echo "##"
+	@echo "## Threaded regression tests"
+	@echo "##"
+	testThreads
+
 SAXtests : testSAX
 	@(echo > .memdump)
 	@echo "##"