Re-add relevant files and tests from libjpeg v6b


git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@81 632fc199-4ca6-4c93-a231-07263d6284db
diff --git a/Makefile.am b/Makefile.am
index 81c6d6b..43b5f98 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -31,7 +31,7 @@
 
 TSTHDRS = rrutil.h rrtimer.h
 
-noinst_PROGRAMS = jpgtest jpegut cjpeg djpeg
+noinst_PROGRAMS = jpgtest jpegut cjpeg djpeg jpegtran rdjpgcom wrjpgcom
 
 jpgtest_SOURCES = $(TSTHDRS) jpgtest.cxx bmp.h bmp.c
 
@@ -56,3 +56,31 @@
 
 djpeg_CFLAGS = -DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED \
 	-DTARGA_SUPPORTED
+
+jpegtran_SOURCES = jpegtran.c rdswitch.c cdjpeg.c transupp.c
+
+jpegtran_LDADD = $(top_srcdir)/libjpeg.la
+
+rdjpgcom_SOURCES = wrjpgcom.c
+
+rdjpgcom_LDADD = $(top_srcdir)/libjpeg.la
+
+wrjpgcom_SOURCES = wrjpgcom.c
+
+wrjpgcom_LDADD = $(top_srcdir)/libjpeg.la
+
+test: cjpeg djpeg jpegtran
+	$(RM) testout*
+	$(top_srcdir)/jpegut
+	$(top_srcdir)/djpeg -dct int -ppm -outfile testout.ppm  $(top_srcdir)/testorig.jpg
+	$(top_srcdir)/djpeg -dct int -bmp -colors 256 -outfile testout.bmp  $(top_srcdir)/testorig.jpg
+	$(top_srcdir)/cjpeg -dct int -outfile testout.jpg  $(top_srcdir)/testimg.ppm
+	$(top_srcdir)/djpeg -dct int -ppm -outfile testoutp.ppm $(top_srcdir)/testprog.jpg
+	$(top_srcdir)/cjpeg -dct int -progressive -opt -outfile testoutp.jpg $(top_srcdir)/testimg.ppm
+	$(top_srcdir)/jpegtran -outfile testoutt.jpg $(top_srcdir)/testprog.jpg
+	cmp $(top_srcdir)/testimg.ppm testout.ppm
+	cmp $(top_srcdir)/testimg.bmp testout.bmp
+	cmp $(top_srcdir)/testimg.jpg testout.jpg
+	cmp $(top_srcdir)/testimg.ppm testoutp.ppm
+	cmp $(top_srcdir)/testimgp.jpg testoutp.jpg
+	cmp $(top_srcdir)/testorig.jpg testoutt.jpg