Index: /trunk/archive/scripts/src/phase2/Makefile.am
===================================================================
--- /trunk/archive/scripts/src/phase2/Makefile.am	(revision 5630)
+++ /trunk/archive/scripts/src/phase2/Makefile.am	(revision 5630)
@@ -0,0 +1,53 @@
+bin_PROGRAMS = phase2
+
+phase2_CPPFLAGS = $(PSLIB_CFLAGS) $(phase2_CFLAGS)
+phase2_LDADD = $(PSLIB_LIBS)
+phase2_SOURCES = \
+	papPhase2.c \
+	papStuff.c \
+	pmChipMosaic.c \
+	pmConfig.c \
+	pmFPA.c \
+	pmFPAConceptsGet.c \
+	pmFPAConceptsSet.c \
+	pmFPAConstruct.c \
+	pmFPARead.c \
+	pmFPAWrite.c \
+	pmFlatField.c \
+	pmMaskBadPixels.c \
+	pmNonLinear.c \
+	pmSubtractBias.c \
+	psAdditionals.c
+
+noinst_HEADERS = \
+	papStuff.h \
+	pmChipMosaic.h \
+	pmConfig.h \
+	pmFPA.h \
+	pmFPAConceptsGet.h \
+	pmFPAConceptsSet.h \
+	pmFPAConstruct.h \
+	pmFPAMorph.h \
+	pmFPARead.h \
+	pmFPAWrite.h \
+	pmFlatField.h \
+	pmFlatFieldErrors.h \
+	pmMaskBadPixels.h \
+	pmMaskBadPixelsErrors.h \
+	pmNonLinear.h \
+	pmSubtractBias.h \
+	psAdditionals.h
+
+EXTRA_DIST = \
+	autogen.sh \
+	gpc1_raw.config \
+	ipprc.config \
+	megacam_raw.config \
+	phase2.config \
+	nonlin.dat
+
+clean-local:
+	-rm TAGS
+# Tags for emacs
+tags:
+	etags `find . -name \*.[ch] -print`
Index: /trunk/archive/scripts/src/phase2/autogen.sh
===================================================================
--- /trunk/archive/scripts/src/phase2/autogen.sh	(revision 5630)
+++ /trunk/archive/scripts/src/phase2/autogen.sh	(revision 5630)
@@ -0,0 +1,103 @@
+#!/bin/sh
+# Run this to generate all the initial makefiles, etc.
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd $srcdir
+
+PROJECT=phase2
+TEST_TYPE=-f
+# change this to be a unique filename in the top level dir
+FILE=autogen.sh
+
+DIE=0
+
+LIBTOOLIZE=libtoolize
+ACLOCAL=aclocal
+AUTOHEADER=autoheader
+AUTOMAKE=automake
+AUTOCONF=autoconf
+
+($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 || {
+        echo
+        echo "You must have $LIBTOOlIZE installed to compile $PROJECT."
+        echo "Download the appropriate package for your distribution,"
+        echo "or get the source tarball at http://ftp.gnu.org/gnu/libtool/"
+        DIE=1
+}
+
+($ACLOCAL --version) < /dev/null > /dev/null 2>&1 || {
+        echo
+        echo "You must have $ACLOCAL installed to compile $PROJECT."
+        echo "Download the appropriate package for your distribution,"
+        echo "or get the source tarball at http://ftp.gnu.org/gnu/automake/"
+        DIE=1
+}
+
+($AUTOHEADER --version) < /dev/null > /dev/null 2>&1 || {
+        echo
+        echo "You must have $AUTOHEADER installed to compile $PROJECT."
+        echo "Download the appropriate package for your distribution,"
+        echo "or get the source tarball at http://ftp.gnu.org/gnu/autoconf/"
+        DIE=1
+}
+
+($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || {
+        echo
+        echo "You must have $AUTOMAKE installed to compile $PROJECT."
+        echo "Download the appropriate package for your distribution,"
+        echo "or get the source tarball at http://ftp.gnu.org/gnu/automake/"
+        DIE=1
+}
+
+($AUTOCONF --version) < /dev/null > /dev/null 2>&1 || {
+        echo
+        echo "You must have $AUTOCONF installed to compile $PROJECT."
+        echo "Download the appropriate package for your distribution,"
+        echo "or get the source tarball at http://ftp.gnu.org/gnu/autoconf/"
+        DIE=1
+}
+
+if test "$DIE" -eq 1; then
+        exit 1
+fi
+
+test $TEST_TYPE $FILE || {
+        echo "You must run this script in the top-level $PROJECT directory"
+        exit 1
+}
+
+if test -z "$*"; then
+        echo "I am going to run ./configure with no arguments - if you wish "
+        echo "to pass any to it, please specify them on the $0 command line."
+fi
+
+$LIBTOOLIZE --copy --force || echo "$LIBTOOlIZE failed"
+$ACLOCAL || echo "$ACLOCAL failed"
+$AUTOHEADER || echo "$AUTOHEADER failed"
+$AUTOMAKE --add-missing --force-missing --copy || echo "$AUTOMAKE failed"
+$AUTOCONF || echo "$AUTOCONF failed"
+
+cd $ORIGDIR
+
+run_configure=true
+for arg in $*; do
+    case $arg in
+        --no-configure)
+            run_configure=false
+            ;;
+        *)
+            ;;
+    esac
+done
+
+if $run_configure; then
+    $srcdir/configure --enable-maintainer-mode "$@"
+    echo
+    echo "Now type 'make' to compile $PROJECT."
+else
+    echo
+    echo "Now run 'configure' and 'make' to compile $PROJECT."
+fi
Index: /trunk/archive/scripts/src/phase2/configure.ac
===================================================================
--- /trunk/archive/scripts/src/phase2/configure.ac	(revision 5630)
+++ /trunk/archive/scripts/src/phase2/configure.ac	(revision 5630)
@@ -0,0 +1,26 @@
+AC_PREREQ(2.59)
+
+AC_INIT([phase2], [0.0.1], [price@ifa.hawaii.edu])
+AC_CONFIG_SRCDIR([phase2.config])
+
+AM_INIT_AUTOMAKE([1.6 foreign dist-bzip2])
+AM_CONFIG_HEADER([config.h])
+AM_MAINTAINER_MODE
+
+AC_LANG(C)
+AC_GNU_SOURCE
+AC_PROG_CC
+AC_PROG_INSTALL
+dnl AC_PROG_LIBTOOL
+
+PKG_CHECK_MODULES([PSLIB], [pslib >= 0.8.0]) 
+
+CFLAGS="${CFLAGS} -DTESTING"
+dnl is this the best was to setup recursive CFLAGS?
+phase2_CFLAGS="-Werror -std=c99 "
+AC_SUBST([phase2_CFLAGS])
+
+AC_CONFIG_FILES([
+  Makefile
+])
+AC_OUTPUT
