Index: /trunk/psLib/configure.ac
===================================================================
--- /trunk/psLib/configure.ac	(revision 8840)
+++ /trunk/psLib/configure.ac	(revision 8841)
@@ -29,5 +29,5 @@
 
 SRCPATH='${top_srcdir}/src'
-SRCDIRS="sys astro db fft fits imageops jpeg math mathtypes types xml"
+SRCDIRS="sys astro db fft fits imageops jpeg math mathtypes types"   dnl xml
 # escape two escapes at this level so \\ gets passed to the shell and \ to perl
 SRCINC=`echo "${SRCDIRS=}" | ${PERL} -pe "s|(\w+)|-I\\\\${SRCPATH=}/\1|g"`
@@ -39,9 +39,10 @@
 AC_PROG_MAKE_SET
 
-dnl handle debug building
+dnl handle optimized building
 AC_ARG_ENABLE(optimize,
   [AS_HELP_STRING(--enable-optimize,enable compiler optimization)],
   [AC_MSG_RESULT(compile optimization enabled)
-   CFLAGS="${CFLAGS=} -O2"],
+   CFLAGS="${CFLAGS=} -O2"
+   PSLIB_CFLAGS="${PSLIB_CFLAGS=} -DPS_NO_TRACE"],
   [AC_MSG_RESULT([compile optimization disabled])
    CFLAGS="${CFLAGS=} -O0 -g"]
@@ -69,4 +70,12 @@
    PSLIB_CFLAGS="${PSLIB_CFLAGS=} -DPS_NO_TRACE"]
 )
+
+dnl build tests at the same time as the source code
+AC_ARG_ENABLE(tests,
+  [AS_HELP_STRING(--enable-tests,build tests at same time as source)],
+  [AC_MSG_RESULT(test building enabled)
+   tests=true],
+   [tests=false])
+AM_CONDITIONAL(BUILD_TESTS, test x$tests = xtrue)
 
 AC_LANG(C)
@@ -303,35 +312,35 @@
 
 dnl ------------------- XML2 options ---------------------
-AC_ARG_WITH(xml2-config,
-[AS_HELP_STRING(--with-xml2-config=FILE,Specify location of xml2-config.)],
-[XML_CONFIG=$withval],
-[XML_CONFIG=`which xml2-config`])
-AC_CHECK_FILE($XML_CONFIG,[],
-    [AC_MSG_ERROR([GNOME XML C parser is required.  Obtain it at http://www.xmlsoft.org or use --with-xml2-config to specify location.])])
-
-AC_MSG_CHECKING([xml2 version])
-XML_VERSION=`xml2-config --version`
-XML_VERSION_major=`echo $XML_VERSION | ${PERL} -pe 's|^(\d+).*|\1|'`
-XML_VERSION_minor=`echo $XML_VERSION | ${PERL} -pe 's|^(\d+)\.(\d+).*|\2|'`
-dnl First test the minimum version of 2.6
-if test $XML_VERSION_major -lt 2 || ( test $XML_VERSION_major -eq 2 && test $XML_VERSION_minor -lt 6 )
-then
-	AC_MSG_ERROR([requires libxml2 2.6.0 or greater, found $XML_VERSION.  Install newer version or use --with-xml2-config to specify another location.])
-else
-    AC_MSG_RESULT([$XML_VERSION... yes])
-fi
-
-AC_MSG_CHECKING([xml2 cflags])
-XML_CFLAGS="`${XML_CONFIG} --cflags`"
-AC_MSG_RESULT([${XML_CFLAGS}])
-
-AC_MSG_CHECKING([xml2 ldflags])
-XML_LDFLAGS="`${XML_CONFIG} --libs`"
-AC_MSG_RESULT([${XML_LDFLAGS}])
-
-PSLIB_CFLAGS="${PSLIB_CFLAGS=} ${XML_CFLAGS}"
-PSLIB_LIBS="${PSLIB_LIBS=} ${XML_LDFLAGS}"
-
-AC_SUBST([XML_CFLAGS])
+dnl AC_ARG_WITH(xml2-config,
+dnl [AS_HELP_STRING(--with-xml2-config=FILE,Specify location of xml2-config.)],
+dnl [XML_CONFIG=$withval],
+dnl [XML_CONFIG=`which xml2-config`])
+dnl AC_CHECK_FILE($XML_CONFIG,[],
+dnl     [AC_MSG_ERROR([GNOME XML C parser is required.  Obtain it at http://www.xmlsoft.org or use --with-xml2-config to specify location.])])
+dnl 
+dnl AC_MSG_CHECKING([xml2 version])
+dnl XML_VERSION=`xml2-config --version`
+dnl XML_VERSION_major=`echo $XML_VERSION | ${PERL} -pe 's|^(\d+).*|\1|'`
+dnl XML_VERSION_minor=`echo $XML_VERSION | ${PERL} -pe 's|^(\d+)\.(\d+).*|\2|'`
+dnl dnl First test the minimum version of 2.6
+dnl if test $XML_VERSION_major -lt 2 || ( test $XML_VERSION_major -eq 2 && test $XML_VERSION_minor -lt 6 )
+dnl then
+dnl 	AC_MSG_ERROR([requires libxml2 2.6.0 or greater, found $XML_VERSION.  Install newer version or use --with-xml2-config to specify another location.])
+dnl else
+dnl     AC_MSG_RESULT([$XML_VERSION... yes])
+dnl fi
+dnl 
+dnl AC_MSG_CHECKING([xml2 cflags])
+dnl XML_CFLAGS="`${XML_CONFIG} --cflags`"
+dnl AC_MSG_RESULT([${XML_CFLAGS}])
+dnl 
+dnl AC_MSG_CHECKING([xml2 ldflags])
+dnl XML_LDFLAGS="`${XML_CONFIG} --libs`"
+dnl AC_MSG_RESULT([${XML_LDFLAGS}])
+dnl 
+dnl PSLIB_CFLAGS="${PSLIB_CFLAGS=} ${XML_CFLAGS}"
+dnl PSLIB_LIBS="${PSLIB_LIBS=} ${XML_LDFLAGS}"
+dnl 
+dnl AC_SUBST([XML_CFLAGS])
 
 dnl ------------------- SWIG options ---------------------
@@ -376,4 +385,5 @@
 AC_CHECK_PROG(doxygen,[doxygen],[true],[false])
 AM_CONDITIONAL(DOXYGEN, test x$doxygen = xtrue)
+
 
 dnl ------- restore CFLAGS / LDFLAGS (tests done) --------
@@ -402,5 +412,4 @@
   src/mathtypes/Makefile
   src/types/Makefile
-  src/xml/Makefile
   test/Makefile
   test/sys/Makefile
@@ -414,5 +423,4 @@
   test/mathtypes/Makefile
   test/types/Makefile
-  test/xml/Makefile
   test/FullUnitTest
   test/pstap/Makefile
@@ -424,4 +432,7 @@
   Doxyfile
 ])
+dnl src/xml/Makefile
+dnl test/xml/Makefile
+
 
 #if test "$SWIG_REQ" == "yes"
Index: /trunk/psLib/src/pslib_strict.h
===================================================================
--- /trunk/psLib/src/pslib_strict.h	(revision 8840)
+++ /trunk/psLib/src/pslib_strict.h	(revision 8841)
@@ -9,6 +9,6 @@
 *  @author Eric Van Alst, MHPCC
 *
-*  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2006-06-30 02:44:42 $
+*  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2006-09-20 00:18:11 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -41,5 +41,5 @@
 #include "psFitsTable.h"
 
-#include "psXML.h"
+//#include "psXML.h"
 
 #include "psImageConvolve.h"
Index: /trunk/psLib/test/astro/Makefile.am
===================================================================
--- /trunk/psLib/test/astro/Makefile.am	(revision 8840)
+++ /trunk/psLib/test/astro/Makefile.am	(revision 8841)
@@ -13,5 +13,12 @@
 	test.ser7.dat
 
-check_PROGRAMS =
+TEST_PROGS =
+
+if BUILD_TESTS
+bin_PROGRAMS = $(TEST_PROGS)
+else
+check_PROGRAMS = $(TEST_PROGS)
+endif
+TESTS = $(TEST_PROGS)
 
 CLEANFILES = $(check_DATA) temp/* core core.* *~ *.bb *.bbg *.da gmon.out
Index: /trunk/psLib/test/db/Makefile.am
===================================================================
--- /trunk/psLib/test/db/Makefile.am	(revision 8840)
+++ /trunk/psLib/test/db/Makefile.am	(revision 8841)
@@ -5,5 +5,12 @@
 	$(PSLIB_LIBS)
 
-check_PROGRAMS = 
+TEST_PROGS = 
+
+if BUILD_TESTS
+bin_PROGRAMS = $(TEST_PROGS)
+else
+check_PROGRAMS = $(TEST_PROGS)
+endif
+TESTS = $(TEST_PROGS)
 
 CLEANFILES = $(check_DATA) temp/* core core.* *~ *.bb *.bbg *.da gmon.out
Index: /trunk/psLib/test/fft/Makefile.am
===================================================================
--- /trunk/psLib/test/fft/Makefile.am	(revision 8840)
+++ /trunk/psLib/test/fft/Makefile.am	(revision 8841)
@@ -5,5 +5,12 @@
 	$(PSLIB_LIBS)
 
-check_PROGRAMS =
+TEST_PROGS =
+
+if BUILD_TESTS
+bin_PROGRAMS = $(TEST_PROGS)
+else
+check_PROGRAMS = $(TEST_PROGS)
+endif
+TESTS = $(TEST_PROGS)
 
 CLEANFILES = $(check_DATA) temp/* core core.* *~ *.bb *.bbg *.da gmon.out
Index: /trunk/psLib/test/fits/Makefile.am
===================================================================
--- /trunk/psLib/test/fits/Makefile.am	(revision 8840)
+++ /trunk/psLib/test/fits/Makefile.am	(revision 8841)
@@ -5,5 +5,12 @@
 	$(PSLIB_LIBS)
 
-check_PROGRAMS =
+TEST_PROGS =
+
+if BUILD_TESTS
+bin_PROGRAMS = $(TEST_PROGS)
+else
+check_PROGRAMS = $(TEST_PROGS)
+endif
+TESTS = $(TEST_PROGS)
 
 CLEANFILES = $(check_DATA) temp/* multi.fits table.fits tmpImages/* core core.* *~ \
Index: /trunk/psLib/test/imageops/Makefile.am
===================================================================
--- /trunk/psLib/test/imageops/Makefile.am	(revision 8840)
+++ /trunk/psLib/test/imageops/Makefile.am	(revision 8841)
@@ -5,5 +5,12 @@
 	$(PSLIB_LIBS)
 
-check_PROGRAMS =
+TEST_PROGS =
+
+if BUILD_TESTS
+bin_PROGRAMS = $(TEST_PROGS)
+else
+check_PROGRAMS = $(TEST_PROGS)
+endif
+TESTS = $(TEST_PROGS)
 
 CLEANFILES = $(check_DATA) temp/* fOut.fits sOut.fits fBiOut.fits sBiOut.fits \
Index: /trunk/psLib/test/jpeg/Makefile.am
===================================================================
--- /trunk/psLib/test/jpeg/Makefile.am	(revision 8840)
+++ /trunk/psLib/test/jpeg/Makefile.am	(revision 8841)
@@ -5,5 +5,12 @@
 	$(PSLIB_LIBS)
 
-check_PROGRAMS =
+TEST_PROGS =
+
+if BUILD_TESTS
+bin_PROGRAMS = $(TEST_PROGS)
+else
+check_PROGRAMS = $(TEST_PROGS)
+endif
+TESTS = $(TEST_PROGS)
 
 CLEANFILES = $(check_DATA) core core.* *~ *.bb *.bbg *.da gmon.out
Index: /trunk/psLib/test/math/Makefile.am
===================================================================
--- /trunk/psLib/test/math/Makefile.am	(revision 8840)
+++ /trunk/psLib/test/math/Makefile.am	(revision 8841)
@@ -5,5 +5,12 @@
 	$(PSLIB_LIBS)
 
-check_PROGRAMS =
+TEST_PROGS =
+
+if BUILD_TESTS
+bin_PROGRAMS = $(TEST_PROGS)
+else
+check_PROGRAMS = $(TEST_PROGS)
+endif
+TESTS = $(TEST_PROGS)
 
 CLEANFILES = $(check_DATA) temp/* seed_msglog1.txt core core.* *~ *.bb *.bbg *.da gmon.out
Index: /trunk/psLib/test/mathtypes/Makefile.am
===================================================================
--- /trunk/psLib/test/mathtypes/Makefile.am	(revision 8840)
+++ /trunk/psLib/test/mathtypes/Makefile.am	(revision 8841)
@@ -10,6 +10,13 @@
 	$(PSLIB_LIBS)
 
-check_PROGRAMS = \
+TEST_PROGS = \
 	tap_psVector
+
+if BUILD_TESTS
+bin_PROGRAMS = $(TEST_PROGS)
+else
+check_PROGRAMS = $(TEST_PROGS)
+endif
+TESTS = $(TEST_PROGS)
 
 CLEANFILES = $(check_DATA) temp/* core core.* *~ *.bb *.bbg *.da gmon.out
Index: /trunk/psLib/test/mathtypes/tap_psVector.c
===================================================================
--- /trunk/psLib/test/mathtypes/tap_psVector.c	(revision 8840)
+++ /trunk/psLib/test/mathtypes/tap_psVector.c	(revision 8841)
@@ -1,3 +1,4 @@
 #include <stdio.h>
+#include <string.h>
 #include <pslib.h>
 
Index: /trunk/psLib/test/pstap/src/Makefile.am
===================================================================
--- /trunk/psLib/test/pstap/src/Makefile.am	(revision 8840)
+++ /trunk/psLib/test/pstap/src/Makefile.am	(revision 8841)
@@ -5,6 +5,12 @@
 	$(PSLIB_LIBS)
 
+TEST_LTLIBS = libpstap.la
+libpstap_la_SOURCES = pstap.c
 noinst_HEADERS = pstap.h
-check_LTLIBRARIES = libpstap.la
 
-libpstap_la_SOURCES = pstap.c
+if BUILD_TESTS
+lib_LTLIBRARIES = $(TEST_LTLIBS)
+else
+check_LTLIBRARIES = $(TEST_LTLIBS)
+endif
+
Index: /trunk/psLib/test/sys/Makefile.am
===================================================================
--- /trunk/psLib/test/sys/Makefile.am	(revision 8840)
+++ /trunk/psLib/test/sys/Makefile.am	(revision 8841)
@@ -10,7 +10,13 @@
 	$(PSLIB_LIBS)
 
+TEST_PROGS = \
+	tap_psStringSubstitute
 
-check_PROGRAMS = \
-	tap_psStringSubstitute
+if BUILD_TESTS
+bin_PROGRAMS = $(TEST_PROGS)
+else
+check_PROGRAMS = $(TEST_PROGS)
+endif
+TESTS = $(TEST_PROGS)
 
 CLEANFILES = $(check_DATA) temp/* log.txt log2.txt test.fits tst_psTrace02_OUT \
Index: /trunk/psLib/test/sys/tap_psStringSubstitute.c
===================================================================
--- /trunk/psLib/test/sys/tap_psStringSubstitute.c	(revision 8840)
+++ /trunk/psLib/test/sys/tap_psStringSubstitute.c	(revision 8841)
@@ -1,3 +1,4 @@
 #include <stdio.h>
+#include <string.h>
 #include <pslib.h>
 
Index: /trunk/psLib/test/tap/configure.in
===================================================================
--- /trunk/psLib/test/tap/configure.in	(revision 8840)
+++ /trunk/psLib/test/tap/configure.in	(revision 8841)
@@ -17,4 +17,12 @@
 		;;
 esac
+
+dnl build tests at the same time as the source code
+AC_ARG_ENABLE(tests,
+  [AS_HELP_STRING(--enable-tests,build tests at same time as source)],
+  [AC_MSG_RESULT(test building enabled)
+   tests=true],
+   [tests=false])
+AM_CONDITIONAL(BUILD_TESTS, test x$tests = xtrue)
 
 # Checks for header files
Index: /trunk/psLib/test/tap/src/Makefile.am
===================================================================
--- /trunk/psLib/test/tap/src/Makefile.am	(revision 8840)
+++ /trunk/psLib/test/tap/src/Makefile.am	(revision 8841)
@@ -1,7 +1,13 @@
-check_LTLIBRARIES = libtap.la
+TEST_LTLIBS = libtap.la
 libtap_la_SOURCES = tap.c tap.h
+include_HEADERS = tap.h
+
+if BUILD_TESTS
+lib_LTLIBRARIES = $(TEST_LTLIBS)
+else
+check_LTLIBRARIES = $(TEST_LTLIBS)
+endif
 
 man_MANS = tap.3
 EXTRA_DIST = $(man_MANS)
 
-include_HEADERS = tap.h
Index: /trunk/psLib/test/types/Makefile.am
===================================================================
--- /trunk/psLib/test/types/Makefile.am	(revision 8840)
+++ /trunk/psLib/test/types/Makefile.am	(revision 8841)
@@ -11,5 +11,5 @@
 AM_CFLAGS = -DXML_CONFIG_FILE="\"$(top_srcdir)/etc/pslib/psTime.xml\""
 
-check_PROGRAMS = \
+TEST_PROGS = \
 	tap_psMetadataIterator \
 	tap_psListIterator \
@@ -25,4 +25,11 @@
 	tap_psArray_all \
 	tap_psArguments_all
+
+if BUILD_TESTS
+bin_PROGRAMS = $(TEST_PROGS)
+else
+check_PROGRAMS = $(TEST_PROGS)
+endif
+TESTS = $(TEST_PROGS)
 
 check_DATA = \
Index: /trunk/psLib/test/types/tap_psListIterator.c
===================================================================
--- /trunk/psLib/test/types/tap_psListIterator.c	(revision 8840)
+++ /trunk/psLib/test/types/tap_psListIterator.c	(revision 8841)
@@ -1,3 +1,4 @@
 #include <stdio.h>
+#include <string.h>
 #include <pslib.h>
 
Index: /trunk/psLib/test/types/tap_psMetadataConfigRead.c
===================================================================
--- /trunk/psLib/test/types/tap_psMetadataConfigRead.c	(revision 8840)
+++ /trunk/psLib/test/types/tap_psMetadataConfigRead.c	(revision 8841)
@@ -1,3 +1,4 @@
 #include <stdio.h>
+#include <string.h>
 #include <pslib.h>
 
Index: /trunk/psLib/test/types/tap_psMetadataItemParse.c
===================================================================
--- /trunk/psLib/test/types/tap_psMetadataItemParse.c	(revision 8840)
+++ /trunk/psLib/test/types/tap_psMetadataItemParse.c	(revision 8841)
@@ -1,3 +1,4 @@
 #include <pslib.h>
+#include <string.h>
 
 #include "tap.h"
Index: /trunk/psLib/test/types/tap_psMetadataIterator.c
===================================================================
--- /trunk/psLib/test/types/tap_psMetadataIterator.c	(revision 8840)
+++ /trunk/psLib/test/types/tap_psMetadataIterator.c	(revision 8841)
@@ -1,3 +1,4 @@
 #include <stdio.h>
+#include <string.h>
 #include <pslib.h>
 
Index: /trunk/psLib/test/types/tap_psMetadata_copying.c
===================================================================
--- /trunk/psLib/test/types/tap_psMetadata_copying.c	(revision 8840)
+++ /trunk/psLib/test/types/tap_psMetadata_copying.c	(revision 8841)
@@ -12,4 +12,5 @@
 
 #include <pslib.h>
+#include <string.h>
 
 #include "tap.h"
Index: /trunk/psLib/test/types/tap_psMetadata_creating.c
===================================================================
--- /trunk/psLib/test/types/tap_psMetadata_creating.c	(revision 8840)
+++ /trunk/psLib/test/types/tap_psMetadata_creating.c	(revision 8841)
@@ -14,4 +14,5 @@
 
 #include <pslib.h>
+#include <string.h>
 
 #include "tap.h"
Index: /trunk/psLib/test/types/tap_psMetadata_manip.c
===================================================================
--- /trunk/psLib/test/types/tap_psMetadata_manip.c	(revision 8840)
+++ /trunk/psLib/test/types/tap_psMetadata_manip.c	(revision 8841)
@@ -12,4 +12,5 @@
 
 #include <pslib.h>
+#include <string.h>
 
 #include "tap.h"
Index: /trunk/psLib/test/types/tap_psMetadata_polynomials.c
===================================================================
--- /trunk/psLib/test/types/tap_psMetadata_polynomials.c	(revision 8840)
+++ /trunk/psLib/test/types/tap_psMetadata_polynomials.c	(revision 8841)
@@ -12,4 +12,5 @@
 
 #include <pslib.h>
+#include <string.h>
 
 #include "tap.h"
Index: /trunk/psLib/test/types/tap_psMetadata_printing.c
===================================================================
--- /trunk/psLib/test/types/tap_psMetadata_printing.c	(revision 8840)
+++ /trunk/psLib/test/types/tap_psMetadata_printing.c	(revision 8841)
@@ -11,4 +11,6 @@
  */
 
+#include <stdio.h>
+#include <string.h>
 #include <fcntl.h>
 #include <pslib.h>
Index: /trunk/psLib/test/xml/Makefile.am
===================================================================
--- /trunk/psLib/test/xml/Makefile.am	(revision 8840)
+++ /trunk/psLib/test/xml/Makefile.am	(revision 8841)
@@ -5,5 +5,12 @@
 	$(PSLIB_LIBS)
 
-check_PROGRAMS =
+TEST_PROGS = 
+
+if BUILD_TESTS
+bin_PROGRAMS = $(TEST_PROGS)
+else
+check_PROGRAMS = $(TEST_PROGS)
+endif
+TESTS = $(TEST_PROGS)
 
 EXTRA_DIST = psTime.xml psTime2.xml psTime3.xml psTime4.xml
