Imported Upstream version 1.900.1 upstream upstream/1.900.1
authorChris E Ferron <chris.e.ferron@linux.intel.com>
Mon, 12 Nov 2012 21:56:08 +0000 (13:56 -0800)
committerChris E Ferron <chris.e.ferron@linux.intel.com>
Mon, 12 Nov 2012 21:56:08 +0000 (13:56 -0800)
212 files changed:
COPYRIGHT [new file with mode: 0644]
ChangeLog [new file with mode: 0644]
INSTALL [new file with mode: 0644]
LICENSE [new file with mode: 0644]
Makefile.am [new file with mode: 0644]
Makefile.in [new file with mode: 0644]
NEWS [new file with mode: 0644]
README [new file with mode: 0644]
acaux/config.guess [new file with mode: 0755]
acaux/config.sub [new file with mode: 0755]
acaux/depcomp [new file with mode: 0755]
acaux/install-sh [new file with mode: 0755]
acaux/ltmain.sh [new file with mode: 0755]
acaux/missing [new file with mode: 0755]
acaux/mkinstalldirs [new file with mode: 0755]
aclocal.m4 [new file with mode: 0644]
configure [new file with mode: 0755]
configure.ac [new file with mode: 0644]
data/colorprofiles/README [new file with mode: 0644]
data/colorprofiles/erimm.icm [new file with mode: 0644]
data/colorprofiles/esrgb.icm [new file with mode: 0644]
data/colorprofiles/esrgbgrey.icm [new file with mode: 0644]
data/colorprofiles/grey.icm [new file with mode: 0644]
data/colorprofiles/greyromm.icm [new file with mode: 0644]
data/colorprofiles/romm.icm [new file with mode: 0644]
data/colorprofiles/sgray.icm [new file with mode: 0644]
data/colorprofiles/srgb.icm [new file with mode: 0644]
data/colorprofiles/sycc.icm [new file with mode: 0644]
data/images/README [new file with mode: 0644]
data/images/example.mif [new file with mode: 0644]
data/images/example.mif0 [new file with mode: 0644]
data/images/feep.pnm [new file with mode: 0644]
data/images/feep2.pnm [new file with mode: 0644]
data/images/goldenears.bmp [new file with mode: 0644]
data/images/goldenears.jpg [new file with mode: 0644]
data/images/goldenears.pnm [new file with mode: 0644]
data/images/goldenears.ras [new file with mode: 0644]
data/images/goldenears_gray.jpg [new file with mode: 0644]
data/images/goldenears_gray.pnm [new file with mode: 0644]
data/images/goldenears_gray.ras [new file with mode: 0644]
data/images/small_16x1.pnm [new file with mode: 0644]
data/images/small_1x1.pnm [new file with mode: 0644]
data/images/stawamuschief.pnm [new file with mode: 0644]
data/images/stawamuschief_gray.pnm [new file with mode: 0644]
data/images/test.pnm [new file with mode: 0644]
doc/README [new file with mode: 0644]
doc/jasper.pdf [new file with mode: 0644]
doc/jpeg2000.pdf [new file with mode: 0644]
jasper.spec [new file with mode: 0644]
jasper.spec.in [new file with mode: 0644]
src/Makefile.am [new file with mode: 0644]
src/Makefile.in [new file with mode: 0644]
src/README [new file with mode: 0644]
src/appl/Makefile.am [new file with mode: 0644]
src/appl/Makefile.in [new file with mode: 0644]
src/appl/dummy.c [new file with mode: 0644]
src/appl/dummy2.c [new file with mode: 0644]
src/appl/imgcmp.1 [new file with mode: 0644]
src/appl/imgcmp.c [new file with mode: 0644]
src/appl/imginfo.1 [new file with mode: 0644]
src/appl/imginfo.c [new file with mode: 0644]
src/appl/jasper.1 [new file with mode: 0644]
src/appl/jasper.c [new file with mode: 0644]
src/appl/jiv.1 [new file with mode: 0644]
src/appl/jiv.c [new file with mode: 0644]
src/appl/tmrdemo.c [new file with mode: 0644]
src/libjasper/Makefile.am [new file with mode: 0644]
src/libjasper/Makefile.in [new file with mode: 0644]
src/libjasper/README [new file with mode: 0644]
src/libjasper/base/Makefile.am [new file with mode: 0644]
src/libjasper/base/Makefile.in [new file with mode: 0644]
src/libjasper/base/jas_cm.c [new file with mode: 0644]
src/libjasper/base/jas_debug.c [new file with mode: 0644]
src/libjasper/base/jas_getopt.c [new file with mode: 0644]
src/libjasper/base/jas_icc.c [new file with mode: 0644]
src/libjasper/base/jas_iccdata.c [new file with mode: 0644]
src/libjasper/base/jas_image.c [new file with mode: 0644]
src/libjasper/base/jas_init.c [new file with mode: 0644]
src/libjasper/base/jas_malloc.c [new file with mode: 0644]
src/libjasper/base/jas_seq.c [new file with mode: 0644]
src/libjasper/base/jas_stream.c [new file with mode: 0644]
src/libjasper/base/jas_string.c [new file with mode: 0644]
src/libjasper/base/jas_tmr.c [new file with mode: 0644]
src/libjasper/base/jas_tvp.c [new file with mode: 0644]
src/libjasper/base/jas_version.c [new file with mode: 0644]
src/libjasper/bmp/Makefile.am [new file with mode: 0644]
src/libjasper/bmp/Makefile.in [new file with mode: 0644]
src/libjasper/bmp/bmp_cod.c [new file with mode: 0644]
src/libjasper/bmp/bmp_cod.h [new file with mode: 0644]
src/libjasper/bmp/bmp_dec.c [new file with mode: 0644]
src/libjasper/bmp/bmp_enc.c [new file with mode: 0644]
src/libjasper/bmp/bmp_enc.h [new file with mode: 0644]
src/libjasper/dummy.c [new file with mode: 0644]
src/libjasper/include/Makefile.am [new file with mode: 0644]
src/libjasper/include/Makefile.in [new file with mode: 0644]
src/libjasper/include/jasper/Makefile.am [new file with mode: 0644]
src/libjasper/include/jasper/Makefile.in [new file with mode: 0644]
src/libjasper/include/jasper/jas_cm.h [new file with mode: 0644]
src/libjasper/include/jasper/jas_config.h [new file with mode: 0644]
src/libjasper/include/jasper/jas_config.h.in [new file with mode: 0644]
src/libjasper/include/jasper/jas_config2.h [new file with mode: 0644]
src/libjasper/include/jasper/jas_debug.h [new file with mode: 0644]
src/libjasper/include/jasper/jas_fix.h [new file with mode: 0644]
src/libjasper/include/jasper/jas_getopt.h [new file with mode: 0644]
src/libjasper/include/jasper/jas_icc.h [new file with mode: 0644]
src/libjasper/include/jasper/jas_image.h [new file with mode: 0644]
src/libjasper/include/jasper/jas_init.h [new file with mode: 0644]
src/libjasper/include/jasper/jas_malloc.h [new file with mode: 0644]
src/libjasper/include/jasper/jas_math.h [new file with mode: 0644]
src/libjasper/include/jasper/jas_seq.h [new file with mode: 0644]
src/libjasper/include/jasper/jas_stream.h [new file with mode: 0644]
src/libjasper/include/jasper/jas_string.h [new file with mode: 0644]
src/libjasper/include/jasper/jas_tmr.h [new file with mode: 0644]
src/libjasper/include/jasper/jas_tvp.h [new file with mode: 0644]
src/libjasper/include/jasper/jas_types.h [new file with mode: 0644]
src/libjasper/include/jasper/jas_version.h [new file with mode: 0644]
src/libjasper/include/jasper/jasper.h [new file with mode: 0644]
src/libjasper/jp2/Makefile.am [new file with mode: 0644]
src/libjasper/jp2/Makefile.in [new file with mode: 0644]
src/libjasper/jp2/jp2_cod.c [new file with mode: 0644]
src/libjasper/jp2/jp2_cod.h [new file with mode: 0644]
src/libjasper/jp2/jp2_dec.c [new file with mode: 0644]
src/libjasper/jp2/jp2_dec.h [new file with mode: 0644]
src/libjasper/jp2/jp2_enc.c [new file with mode: 0644]
src/libjasper/jpc/Makefile.am [new file with mode: 0644]
src/libjasper/jpc/Makefile.in [new file with mode: 0644]
src/libjasper/jpc/jpc_bs.c [new file with mode: 0644]
src/libjasper/jpc/jpc_bs.h [new file with mode: 0644]
src/libjasper/jpc/jpc_cod.h [new file with mode: 0644]
src/libjasper/jpc/jpc_cs.c [new file with mode: 0644]
src/libjasper/jpc/jpc_cs.h [new file with mode: 0644]
src/libjasper/jpc/jpc_dec.c [new file with mode: 0644]
src/libjasper/jpc/jpc_dec.h [new file with mode: 0644]
src/libjasper/jpc/jpc_enc.c [new file with mode: 0644]
src/libjasper/jpc/jpc_enc.h [new file with mode: 0644]
src/libjasper/jpc/jpc_fix.h [new file with mode: 0644]
src/libjasper/jpc/jpc_flt.h [new file with mode: 0644]
src/libjasper/jpc/jpc_math.c [new file with mode: 0644]
src/libjasper/jpc/jpc_math.h [new file with mode: 0644]
src/libjasper/jpc/jpc_mct.c [new file with mode: 0644]
src/libjasper/jpc/jpc_mct.h [new file with mode: 0644]
src/libjasper/jpc/jpc_mqcod.c [new file with mode: 0644]
src/libjasper/jpc/jpc_mqcod.h [new file with mode: 0644]
src/libjasper/jpc/jpc_mqdec.c [new file with mode: 0644]
src/libjasper/jpc/jpc_mqdec.h [new file with mode: 0644]
src/libjasper/jpc/jpc_mqenc.c [new file with mode: 0644]
src/libjasper/jpc/jpc_mqenc.h [new file with mode: 0644]
src/libjasper/jpc/jpc_qmfb.c [new file with mode: 0644]
src/libjasper/jpc/jpc_qmfb.h [new file with mode: 0644]
src/libjasper/jpc/jpc_t1cod.c [new file with mode: 0644]
src/libjasper/jpc/jpc_t1cod.h [new file with mode: 0644]
src/libjasper/jpc/jpc_t1dec.c [new file with mode: 0644]
src/libjasper/jpc/jpc_t1dec.h [new file with mode: 0644]
src/libjasper/jpc/jpc_t1enc.c [new file with mode: 0644]
src/libjasper/jpc/jpc_t1enc.h [new file with mode: 0644]
src/libjasper/jpc/jpc_t2cod.c [new file with mode: 0644]
src/libjasper/jpc/jpc_t2cod.h [new file with mode: 0644]
src/libjasper/jpc/jpc_t2dec.c [new file with mode: 0644]
src/libjasper/jpc/jpc_t2dec.h [new file with mode: 0644]
src/libjasper/jpc/jpc_t2enc.c [new file with mode: 0644]
src/libjasper/jpc/jpc_t2enc.h [new file with mode: 0644]
src/libjasper/jpc/jpc_tagtree.c [new file with mode: 0644]
src/libjasper/jpc/jpc_tagtree.h [new file with mode: 0644]
src/libjasper/jpc/jpc_tsfb.c [new file with mode: 0644]
src/libjasper/jpc/jpc_tsfb.h [new file with mode: 0644]
src/libjasper/jpc/jpc_util.c [new file with mode: 0644]
src/libjasper/jpc/jpc_util.h [new file with mode: 0644]
src/libjasper/jpg/Makefile.am [new file with mode: 0644]
src/libjasper/jpg/Makefile.in [new file with mode: 0644]
src/libjasper/jpg/README [new file with mode: 0644]
src/libjasper/jpg/jpg_cod.h [new file with mode: 0644]
src/libjasper/jpg/jpg_dec.c [new file with mode: 0644]
src/libjasper/jpg/jpg_dummy.c [new file with mode: 0644]
src/libjasper/jpg/jpg_enc.c [new file with mode: 0644]
src/libjasper/jpg/jpg_enc.h [new file with mode: 0644]
src/libjasper/jpg/jpg_jpeglib.h [new file with mode: 0644]
src/libjasper/jpg/jpg_val.c [new file with mode: 0644]
src/libjasper/mif/Makefile.am [new file with mode: 0644]
src/libjasper/mif/Makefile.in [new file with mode: 0644]
src/libjasper/mif/README [new file with mode: 0644]
src/libjasper/mif/mif_cod.c [new file with mode: 0644]
src/libjasper/mif/mif_cod.h [new file with mode: 0644]
src/libjasper/pgx/Makefile.am [new file with mode: 0644]
src/libjasper/pgx/Makefile.in [new file with mode: 0644]
src/libjasper/pgx/pgx_cod.c [new file with mode: 0644]
src/libjasper/pgx/pgx_cod.h [new file with mode: 0644]
src/libjasper/pgx/pgx_dec.c [new file with mode: 0644]
src/libjasper/pgx/pgx_enc.c [new file with mode: 0644]
src/libjasper/pgx/pgx_enc.h [new file with mode: 0644]
src/libjasper/pnm/Makefile.am [new file with mode: 0644]
src/libjasper/pnm/Makefile.in [new file with mode: 0644]
src/libjasper/pnm/pnm_cod.c [new file with mode: 0644]
src/libjasper/pnm/pnm_cod.h [new file with mode: 0644]
src/libjasper/pnm/pnm_dec.c [new file with mode: 0644]
src/libjasper/pnm/pnm_enc.c [new file with mode: 0644]
src/libjasper/pnm/pnm_enc.h [new file with mode: 0644]
src/libjasper/ras/Makefile.am [new file with mode: 0644]
src/libjasper/ras/Makefile.in [new file with mode: 0644]
src/libjasper/ras/ras_cod.c [new file with mode: 0644]
src/libjasper/ras/ras_cod.h [new file with mode: 0644]
src/libjasper/ras/ras_dec.c [new file with mode: 0644]
src/libjasper/ras/ras_enc.c [new file with mode: 0644]
src/libjasper/ras/ras_enc.h [new file with mode: 0644]
src/msvc/Makefile.am [new file with mode: 0644]
src/msvc/Makefile.in [new file with mode: 0644]
src/msvc/README [new file with mode: 0644]
src/msvc/imgcmp.dsp [new file with mode: 0644]
src/msvc/imginfo.dsp [new file with mode: 0644]
src/msvc/jasper.dsp [new file with mode: 0644]
src/msvc/jasper.dsw [new file with mode: 0644]
src/msvc/jiv.dsp [new file with mode: 0644]
src/msvc/libjasper.dsp [new file with mode: 0644]

diff --git a/COPYRIGHT b/COPYRIGHT
new file mode 100644 (file)
index 0000000..db023aa
--- /dev/null
+++ b/COPYRIGHT
@@ -0,0 +1,2 @@
+The copyright information for the JasPer software accompanies the software
+license, and can be found in the file named "LICENSE".
diff --git a/ChangeLog b/ChangeLog
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/INSTALL b/INSTALL
new file mode 100644 (file)
index 0000000..857e21a
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,3 @@
+Detailed instructions on how to build and install the JasPer software
+can be found in the JasPer Software Reference Manual which is located
+in the doc directory.  (See the section titled "Building the Software".)
diff --git a/LICENSE b/LICENSE
new file mode 100644 (file)
index 0000000..f817ef4
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,51 @@
+JasPer License Version 2.0
+
+Copyright (c) 2001-2006 Michael David Adams
+Copyright (c) 1999-2000 Image Power, Inc.
+Copyright (c) 1999-2000 The University of British Columbia
+
+All rights reserved.
+
+Permission is hereby granted, free of charge, to any person (the
+"User") obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without restriction,
+including without limitation the rights to use, copy, modify, merge,
+publish, distribute, and/or sell copies of the Software, and to permit
+persons to whom the Software is furnished to do so, subject to the
+following conditions:
+
+1.  The above copyright notices and this permission notice (which
+includes the disclaimer below) shall be included in all copies or
+substantial portions of the Software.
+
+2.  The name of a copyright holder shall not be used to endorse or
+promote products derived from the Software without specific prior
+written permission.
+
+THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+"AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+
diff --git a/Makefile.am b/Makefile.am
new file mode 100644 (file)
index 0000000..344987b
--- /dev/null
@@ -0,0 +1,91 @@
+# Copyright (c) 2001-2003 Michael David Adams.
+# All rights reserved. 
+
+# __START_OF_JASPER_LICENSE__
+# 
+# JasPer License Version 2.0
+# 
+# Copyright (c) 2001-2006 Michael David Adams
+# Copyright (c) 1999-2000 Image Power, Inc.
+# Copyright (c) 1999-2000 The University of British Columbia
+# 
+# All rights reserved.
+# 
+# Permission is hereby granted, free of charge, to any person (the
+# "User") obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the
+# following conditions:
+# 
+# 1.  The above copyright notices and this permission notice (which
+# includes the disclaimer below) shall be included in all copies or
+# substantial portions of the Software.
+# 
+# 2.  The name of a copyright holder shall not be used to endorse or
+# promote products derived from the Software without specific prior
+# written permission.
+# 
+# THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+# LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+# THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+# "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+# PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+# EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+# PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+# THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+# EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+# BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+# PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+# GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+# ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+# IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+# SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+# AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+# SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+# THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+# PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+# RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+# EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+# 
+# __END_OF_JASPER_LICENSE__
+
+AUTOMAKE_OPTIONS = foreign dist-zip dist-tarZ
+
+EXTRA_DIST = README INSTALL COPYRIGHT LICENSE NEWS ChangeLog data doc \
+  jasper.spec.in jasper.spec acaux
+
+# Note: We need to put the derived file "jasper.spec" in the distribution
+# in order to facilitate RPM building.
+
+SUBDIRS = src
+
+rpm: dist
+       for i in BUILD RPMS SRPMS SOURCES SPECS; do \
+               j=$$PWD/RPMTOP/$$i; \
+               if ! -d $$j; then \
+                       mkdir -p $$j || exit 1; \
+               fi \
+       done
+       rpmbuild  --rmsource --define "_topdir $$PWD/RPMTOP" \
+         -ta $(PACKAGE)-$(JAS_VERSION).tar.gz
+       rm -rf $$PWD/RPMTOP/BUILD/$(PACKAGE)-$(JAS_VERSION)
+
+# We need to ensure that any Subversion directories in the extra directories
+# are removed before the distribution archive is made.
+dist-hook:
+       for i in $(EXTRA_DIST); do \
+               if test -d $$i; then \
+                       j=`find $(distdir)/$$i -name .svn`; \
+                       if test -n "$$j"; then \
+                               rm -rf $$j; \
+                       fi; \
+               fi; \
+       done
+
diff --git a/Makefile.in b/Makefile.in
new file mode 100644 (file)
index 0000000..a3e560d
--- /dev/null
@@ -0,0 +1,711 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# Copyright (c) 2001-2003 Michael David Adams.
+# All rights reserved. 
+
+# __START_OF_JASPER_LICENSE__
+# 
+# JasPer License Version 2.0
+# 
+# Copyright (c) 2001-2006 Michael David Adams
+# Copyright (c) 1999-2000 Image Power, Inc.
+# Copyright (c) 1999-2000 The University of British Columbia
+# 
+# All rights reserved.
+# 
+# Permission is hereby granted, free of charge, to any person (the
+# "User") obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the
+# following conditions:
+# 
+# 1.  The above copyright notices and this permission notice (which
+# includes the disclaimer below) shall be included in all copies or
+# substantial portions of the Software.
+# 
+# 2.  The name of a copyright holder shall not be used to endorse or
+# promote products derived from the Software without specific prior
+# written permission.
+# 
+# THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+# LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+# THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+# "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+# PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+# EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+# PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+# THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+# EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+# BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+# PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+# GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+# ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+# IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+# SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+# AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+# SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+# THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+# PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+# RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+# EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+# 
+# __END_OF_JASPER_LICENSE__
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = .
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
+       $(srcdir)/Makefile.in $(srcdir)/jasper.spec.in \
+       $(top_srcdir)/configure ChangeLog INSTALL NEWS \
+       acaux/config.guess acaux/config.sub acaux/depcomp \
+       acaux/install-sh acaux/ltmain.sh acaux/missing \
+       acaux/mkinstalldirs
+subdir = .
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno configure.status.lineno
+mkinstalldirs = $(SHELL) $(top_srcdir)/acaux/mkinstalldirs
+CONFIG_HEADER =  \
+       $(top_builddir)/src/libjasper/include/jasper/jas_config.h
+CONFIG_CLEAN_FILES = jasper.spec
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+       html-recursive info-recursive install-data-recursive \
+       install-exec-recursive install-info-recursive \
+       install-recursive installcheck-recursive installdirs-recursive \
+       pdf-recursive ps-recursive uninstall-info-recursive \
+       uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+  { test ! -d $(distdir) \
+    || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
+         && rm -fr $(distdir); }; }
+DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.Z $(distdir).zip
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+HAVE_LIBJPEG_FALSE = @HAVE_LIBJPEG_FALSE@
+HAVE_LIBJPEG_TRUE = @HAVE_LIBJPEG_TRUE@
+HAVE_OPENGL_FALSE = @HAVE_OPENGL_FALSE@
+HAVE_OPENGL_TRUE = @HAVE_OPENGL_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAS_MAJOR_VERSION = @JAS_MAJOR_VERSION@
+JAS_MICRO_VERSION = @JAS_MICRO_VERSION@
+JAS_MINOR_VERSION = @JAS_MINOR_VERSION@
+JAS_RPM_RELEASE = @JAS_RPM_RELEASE@
+JAS_VERSION = @JAS_VERSION@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_AGE = @LT_AGE@
+LT_CURRENT = @LT_CURRENT@
+LT_RELEASE = @LT_RELEASE@
+LT_REVISION = @LT_REVISION@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OPENGL_LIBS = @OPENGL_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+AUTOMAKE_OPTIONS = foreign dist-zip dist-tarZ
+EXTRA_DIST = README INSTALL COPYRIGHT LICENSE NEWS ChangeLog data doc \
+  jasper.spec.in jasper.spec acaux
+
+
+# Note: We need to put the derived file "jasper.spec" in the distribution
+# in order to facilitate RPM building.
+SUBDIRS = src
+all: all-recursive
+
+.SUFFIXES:
+am--refresh:
+       @:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
+             cd $(srcdir) && $(AUTOMAKE) --foreign  \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Makefile'; \
+       cd $(top_srcdir) && \
+         $(AUTOMAKE) --foreign  Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           echo ' $(SHELL) ./config.status'; \
+           $(SHELL) ./config.status;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+       cd $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+       cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+jasper.spec: $(top_builddir)/config.status $(srcdir)/jasper.spec.in
+       cd $(top_builddir) && $(SHELL) ./config.status $@
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+
+distclean-libtool:
+       -rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+       @failcom='exit 1'; \
+       for f in x $$MAKEFLAGS; do \
+         case $$f in \
+           *=* | --[!k]*);; \
+           *k*) failcom='fail=yes';; \
+         esac; \
+       done; \
+       dot_seen=no; \
+       target=`echo $@ | sed s/-recursive//`; \
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         echo "Making $$target in $$subdir"; \
+         if test "$$subdir" = "."; then \
+           dot_seen=yes; \
+           local_target="$$target-am"; \
+         else \
+           local_target="$$target"; \
+         fi; \
+         (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+         || eval $$failcom; \
+       done; \
+       if test "$$dot_seen" = "no"; then \
+         $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+       fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+       @failcom='exit 1'; \
+       for f in x $$MAKEFLAGS; do \
+         case $$f in \
+           *=* | --[!k]*);; \
+           *k*) failcom='fail=yes';; \
+         esac; \
+       done; \
+       dot_seen=no; \
+       case "$@" in \
+         distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+         *) list='$(SUBDIRS)' ;; \
+       esac; \
+       rev=''; for subdir in $$list; do \
+         if test "$$subdir" = "."; then :; else \
+           rev="$$subdir $$rev"; \
+         fi; \
+       done; \
+       rev="$$rev ."; \
+       target=`echo $@ | sed s/-recursive//`; \
+       for subdir in $$rev; do \
+         echo "Making $$target in $$subdir"; \
+         if test "$$subdir" = "."; then \
+           local_target="$$target-am"; \
+         else \
+           local_target="$$target"; \
+         fi; \
+         (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+         || eval $$failcom; \
+       done && test -z "$$fail"
+tags-recursive:
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+       done
+ctags-recursive:
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+       done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+         include_option=--etags-include; \
+         empty_fix=.; \
+       else \
+         include_option=--include; \
+         empty_fix=; \
+       fi; \
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         if test "$$subdir" = .; then :; else \
+           test ! -f $$subdir/TAGS || \
+             tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+         fi; \
+       done; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+           $$tags $$unique; \
+       fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       test -z "$(CTAGS_ARGS)$$tags$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$tags $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && cd $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+       $(am__remove_distdir)
+       mkdir $(distdir)
+       $(mkdir_p) $(distdir)/. $(distdir)/acaux
+       @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+       list='$(DISTFILES)'; for file in $$list; do \
+         case $$file in \
+           $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+           $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+         esac; \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+         if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+           dir="/$$dir"; \
+           $(mkdir_p) "$(distdir)$$dir"; \
+         else \
+           dir=''; \
+         fi; \
+         if test -d $$d/$$file; then \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+           fi; \
+           cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+         else \
+           test -f $(distdir)/$$file \
+           || cp -p $$d/$$file $(distdir)/$$file \
+           || exit 1; \
+         fi; \
+       done
+       list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+         if test "$$subdir" = .; then :; else \
+           test -d "$(distdir)/$$subdir" \
+           || $(mkdir_p) "$(distdir)/$$subdir" \
+           || exit 1; \
+           distdir=`$(am__cd) $(distdir) && pwd`; \
+           top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+           (cd $$subdir && \
+             $(MAKE) $(AM_MAKEFLAGS) \
+               top_distdir="$$top_distdir" \
+               distdir="$$distdir/$$subdir" \
+               distdir) \
+             || exit 1; \
+         fi; \
+       done
+       $(MAKE) $(AM_MAKEFLAGS) \
+         top_distdir="$(top_distdir)" distdir="$(distdir)" \
+         dist-hook
+       -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+         ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+         ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+         ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
+       || chmod -R a+r $(distdir)
+dist-gzip: distdir
+       tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+       $(am__remove_distdir)
+
+dist-bzip2: distdir
+       tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+       $(am__remove_distdir)
+dist-tarZ: distdir
+       tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+       $(am__remove_distdir)
+
+dist-shar: distdir
+       shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+       $(am__remove_distdir)
+dist-zip: distdir
+       -rm -f $(distdir).zip
+       zip -rq $(distdir).zip $(distdir)
+       $(am__remove_distdir)
+
+dist dist-all: distdir
+       tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+       tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+       -rm -f $(distdir).zip
+       zip -rq $(distdir).zip $(distdir)
+       $(am__remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration.  Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+       case '$(DIST_ARCHIVES)' in \
+       *.tar.gz*) \
+         GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
+       *.tar.bz2*) \
+         bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+       *.tar.Z*) \
+         uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+       *.shar.gz*) \
+         GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
+       *.zip*) \
+         unzip $(distdir).zip ;;\
+       esac
+       chmod -R a-w $(distdir); chmod a+w $(distdir)
+       mkdir $(distdir)/_build
+       mkdir $(distdir)/_inst
+       chmod a-w $(distdir)
+       dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+         && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+         && cd $(distdir)/_build \
+         && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+           $(DISTCHECK_CONFIGURE_FLAGS) \
+         && $(MAKE) $(AM_MAKEFLAGS) \
+         && $(MAKE) $(AM_MAKEFLAGS) dvi \
+         && $(MAKE) $(AM_MAKEFLAGS) check \
+         && $(MAKE) $(AM_MAKEFLAGS) install \
+         && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+         && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+         && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+               distuninstallcheck \
+         && chmod -R a-w "$$dc_install_base" \
+         && ({ \
+              (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+              && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+              && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+              && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+                   distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+             } || { rm -rf "$$dc_destdir"; exit 1; }) \
+         && rm -rf "$$dc_destdir" \
+         && $(MAKE) $(AM_MAKEFLAGS) dist \
+         && rm -rf $(DIST_ARCHIVES) \
+         && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
+       $(am__remove_distdir)
+       @(echo "$(distdir) archives ready for distribution: "; \
+         list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+         sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
+distuninstallcheck:
+       @cd $(distuninstallcheck_dir) \
+       && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+          || { echo "ERROR: files left after uninstall:" ; \
+               if test -n "$(DESTDIR)"; then \
+                 echo "  (check DESTDIR support)"; \
+               fi ; \
+               $(distuninstallcheck_listfiles) ; \
+               exit 1; } >&2
+distcleancheck: distclean
+       @if test '$(srcdir)' = . ; then \
+         echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+         exit 1 ; \
+       fi
+       @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+         || { echo "ERROR: files left in build directory after distclean:" ; \
+              $(distcleancheck_listfiles) ; \
+              exit 1; } >&2
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+         `test -z '$(STRIP)' || \
+           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+       distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+       -rm -rf $(top_srcdir)/autom4te.cache
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
+       check-am clean clean-generic clean-libtool clean-recursive \
+       ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
+       dist-hook dist-shar dist-tarZ dist-zip distcheck distclean \
+       distclean-generic distclean-libtool distclean-recursive \
+       distclean-tags distcleancheck distdir distuninstallcheck dvi \
+       dvi-am html html-am info info-am install install-am \
+       install-data install-data-am install-exec install-exec-am \
+       install-info install-info-am install-man install-strip \
+       installcheck installcheck-am installdirs installdirs-am \
+       maintainer-clean maintainer-clean-generic \
+       maintainer-clean-recursive mostlyclean mostlyclean-generic \
+       mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \
+       tags tags-recursive uninstall uninstall-am uninstall-info-am
+
+
+rpm: dist
+       for i in BUILD RPMS SRPMS SOURCES SPECS; do \
+               j=$$PWD/RPMTOP/$$i; \
+               if ! -d $$j; then \
+                       mkdir -p $$j || exit 1; \
+               fi \
+       done
+       rpmbuild  --rmsource --define "_topdir $$PWD/RPMTOP" \
+         -ta $(PACKAGE)-$(JAS_VERSION).tar.gz
+       rm -rf $$PWD/RPMTOP/BUILD/$(PACKAGE)-$(JAS_VERSION)
+
+# We need to ensure that any Subversion directories in the extra directories
+# are removed before the distribution archive is made.
+dist-hook:
+       for i in $(EXTRA_DIST); do \
+               if test -d $$i; then \
+                       j=`find $(distdir)/$$i -name .svn`; \
+                       if test -n "$$j"; then \
+                               rm -rf $$j; \
+                       fi; \
+               fi; \
+       done
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/NEWS b/NEWS
new file mode 100644 (file)
index 0000000..25e1fa9
--- /dev/null
+++ b/NEWS
@@ -0,0 +1,19 @@
+Dear JasPer Users:
+
+I am pleased to announce the availability of JasPer version 1.900.1.
+
+This release fixes some build problems as well as
+a multiply-defined symbol problem in jpc_qmfb.h.
+
+The new JasPer release is available from the JasPer Project Home Page
+(i.e., http://www.ece.uvic.ca/~mdadams/jasper) and the JPEG web site
+(i.e., http://www.jpeg.org/software).
+
+Regards,
+Michael
+
+---
+Michael Adams, Assistant Professor
+Dept. of Elec. and Comp. Engineering, University of Victoria
+P.O. Box 3055 STN CSC, Victoria, BC, V8W 3P6, CANADA
+E-mail: mdadams@ece.uvic.ca, Web: www.ece.uvic.ca/~mdadams
diff --git a/README b/README
new file mode 100644 (file)
index 0000000..88fd2f1
--- /dev/null
+++ b/README
@@ -0,0 +1,22 @@
+JasPer Readme
+*************
+
+This is the source code distribution for JasPer.  JasPer is a collection
+of software (i.e., a library and application programs) for the coding
+and manipulation of images.  This software can handle image data in a
+variety of formats.  One such format supported by JasPer is the JPEG-2000
+format defined in ISO/IEC 15444-1.
+
+The complete licensing terms for the JasPer software can be found in
+the file named "LICENSE" in the top level directory of this software
+distribution.  Any use of this software contrary to the terms of the
+license is strictly prohibited.  The changes made to the software
+since the last release are described in the file "NEWS".  Detailed
+documentation on the JasPer software can be found in the JasPer Software
+Reference Manual.  This manual is located in the "doc" directory, and
+includes useful information such as: 1) how to build, install, and use
+the software, 2) how to submit report bugs, and 3) where to find
+additional information about the software.
+
+Enjoy! :)
+
diff --git a/acaux/config.guess b/acaux/config.guess
new file mode 100755 (executable)
index 0000000..2fc3acc
--- /dev/null
@@ -0,0 +1,1411 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
+timestamp='2003-06-17'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Per Bothner <per@bothner.com>.
+# Please send patches to <config-patches@gnu.org>.  Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub.  If it succeeds, it prints the system name on stdout, and
+# exits with 0.  Otherwise, it exits with 1.
+#
+# The plan is that this can be called by configure scripts if you
+# don't specify an explicit build system type.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit 0 ;;
+    --version | -v )
+       echo "$version" ; exit 0 ;;
+    --help | --h* | -h )
+       echo "$usage"; exit 0 ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )        # Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help" >&2
+       exit 1 ;;
+    * )
+       break ;;
+  esac
+done
+
+if test $# != 0; then
+  echo "$me: too many arguments$help" >&2
+  exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,)    echo "int x;" > $dummy.c ;
+       for c in cc gcc c89 c99 ; do
+         if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+            CC_FOR_BUILD="$c"; break ;
+         fi ;
+       done ;
+       if test x"$CC_FOR_BUILD" = x ; then
+         CC_FOR_BUILD=no_compiler_found ;
+       fi
+       ;;
+ ,,*)   CC_FOR_BUILD=$CC ;;
+ ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
+esac ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi@noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+       PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+## for Red Hat Linux
+if test -f /etc/redhat-release ; then
+    VENDOR=redhat ;
+else
+    VENDOR= ;
+fi
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+    *:NetBSD:*:*)
+       # NetBSD (nbsd) targets should (where applicable) match one or
+       # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+       # *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
+       # switched to ELF, *-*-netbsd* would select the old
+       # object file format.  This provides both forward
+       # compatibility and a consistent mechanism for selecting the
+       # object file format.
+       #
+       # Note: NetBSD doesn't particularly care about the vendor
+       # portion of the name.  We always set it to "unknown".
+       sysctl="sysctl -n hw.machine_arch"
+       UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+           /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+       case "${UNAME_MACHINE_ARCH}" in
+           armeb) machine=armeb-unknown ;;
+           arm*) machine=arm-unknown ;;
+           sh3el) machine=shl-unknown ;;
+           sh3eb) machine=sh-unknown ;;
+           *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+       esac
+       # The Operating System including object format, if it has switched
+       # to ELF recently, or will in the future.
+       case "${UNAME_MACHINE_ARCH}" in
+           arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+               eval $set_cc_for_build
+               if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+                       | grep __ELF__ >/dev/null
+               then
+                   # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+                   # Return netbsd for either.  FIX?
+                   os=netbsd
+               else
+                   os=netbsdelf
+               fi
+               ;;
+           *)
+               os=netbsd
+               ;;
+       esac
+       # The OS release
+       # Debian GNU/NetBSD machines have a different userland, and
+       # thus, need a distinct triplet. However, they do not need
+       # kernel version information, so it can be replaced with a
+       # suitable tag, in the style of linux-gnu.
+       case "${UNAME_VERSION}" in
+           Debian*)
+               release='-gnu'
+               ;;
+           *)
+               release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+               ;;
+       esac
+       # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+       # contains redundant information, the shorter form:
+       # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+       echo "${machine}-${os}${release}"
+       exit 0 ;;
+    amiga:OpenBSD:*:*)
+       echo m68k-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    arc:OpenBSD:*:*)
+       echo mipsel-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    hp300:OpenBSD:*:*)
+       echo m68k-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    mac68k:OpenBSD:*:*)
+       echo m68k-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    macppc:OpenBSD:*:*)
+       echo powerpc-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    mvme68k:OpenBSD:*:*)
+       echo m68k-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    mvme88k:OpenBSD:*:*)
+       echo m88k-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    mvmeppc:OpenBSD:*:*)
+       echo powerpc-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    pmax:OpenBSD:*:*)
+       echo mipsel-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    sgi:OpenBSD:*:*)
+       echo mipseb-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    sun3:OpenBSD:*:*)
+       echo m68k-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    wgrisc:OpenBSD:*:*)
+       echo mipsel-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    *:OpenBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    alpha:OSF1:*:*)
+       if test $UNAME_RELEASE = "V4.0"; then
+               UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+       fi
+       # According to Compaq, /usr/sbin/psrinfo has been available on
+       # OSF/1 and Tru64 systems produced since 1995.  I hope that
+       # covers most systems running today.  This code pipes the CPU
+       # types through head -n 1, so we only detect the type of CPU 0.
+       ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+       case "$ALPHA_CPU_TYPE" in
+           "EV4 (21064)")
+               UNAME_MACHINE="alpha" ;;
+           "EV4.5 (21064)")
+               UNAME_MACHINE="alpha" ;;
+           "LCA4 (21066/21068)")
+               UNAME_MACHINE="alpha" ;;
+           "EV5 (21164)")
+               UNAME_MACHINE="alphaev5" ;;
+           "EV5.6 (21164A)")
+               UNAME_MACHINE="alphaev56" ;;
+           "EV5.6 (21164PC)")
+               UNAME_MACHINE="alphapca56" ;;
+           "EV5.7 (21164PC)")
+               UNAME_MACHINE="alphapca57" ;;
+           "EV6 (21264)")
+               UNAME_MACHINE="alphaev6" ;;
+           "EV6.7 (21264A)")
+               UNAME_MACHINE="alphaev67" ;;
+           "EV6.8CB (21264C)")
+               UNAME_MACHINE="alphaev68" ;;
+           "EV6.8AL (21264B)")
+               UNAME_MACHINE="alphaev68" ;;
+           "EV6.8CX (21264D)")
+               UNAME_MACHINE="alphaev68" ;;
+           "EV6.9A (21264/EV69A)")
+               UNAME_MACHINE="alphaev69" ;;
+           "EV7 (21364)")
+               UNAME_MACHINE="alphaev7" ;;
+           "EV7.9 (21364A)")
+               UNAME_MACHINE="alphaev79" ;;
+       esac
+       # A Vn.n version is a released version.
+       # A Tn.n version is a released field test version.
+       # A Xn.n version is an unreleased experimental baselevel.
+       # 1.2 uses "1.2" for uname -r.
+       echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+       exit 0 ;;
+    Alpha*:OpenVMS:*:*)
+       echo alpha-hp-vms
+       exit 0 ;;
+    Alpha\ *:Windows_NT*:*)
+       # How do we know it's Interix rather than the generic POSIX subsystem?
+       # Should we change UNAME_MACHINE based on the output of uname instead
+       # of the specific Alpha model?
+       echo alpha-pc-interix
+       exit 0 ;;
+    21064:Windows_NT:50:3)
+       echo alpha-dec-winnt3.5
+       exit 0 ;;
+    Amiga*:UNIX_System_V:4.0:*)
+       echo m68k-unknown-sysv4
+       exit 0;;
+    *:[Aa]miga[Oo][Ss]:*:*)
+       echo ${UNAME_MACHINE}-unknown-amigaos
+       exit 0 ;;
+    *:[Mm]orph[Oo][Ss]:*:*)
+       echo ${UNAME_MACHINE}-unknown-morphos
+       exit 0 ;;
+    *:OS/390:*:*)
+       echo i370-ibm-openedition
+       exit 0 ;;
+    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+       echo arm-acorn-riscix${UNAME_RELEASE}
+       exit 0;;
+    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+       echo hppa1.1-hitachi-hiuxmpp
+       exit 0;;
+    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+       # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+       if test "`(/bin/universe) 2>/dev/null`" = att ; then
+               echo pyramid-pyramid-sysv3
+       else
+               echo pyramid-pyramid-bsd
+       fi
+       exit 0 ;;
+    NILE*:*:*:dcosx)
+       echo pyramid-pyramid-svr4
+       exit 0 ;;
+    DRS?6000:unix:4.0:6*)
+       echo sparc-icl-nx6
+       exit 0 ;;
+    DRS?6000:UNIX_SV:4.2*:7*)
+       case `/usr/bin/uname -p` in
+           sparc) echo sparc-icl-nx7 && exit 0 ;;
+       esac ;;
+    sun4H:SunOS:5.*:*)
+       echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit 0 ;;
+    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+       echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit 0 ;;
+    i86pc:SunOS:5.*:*)
+       echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit 0 ;;
+    sun4*:SunOS:6*:*)
+       # According to config.sub, this is the proper way to canonicalize
+       # SunOS6.  Hard to guess exactly what SunOS6 will be like, but
+       # it's likely to be more like Solaris than SunOS4.
+       echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit 0 ;;
+    sun4*:SunOS:*:*)
+       case "`/usr/bin/arch -k`" in
+           Series*|S4*)
+               UNAME_RELEASE=`uname -v`
+               ;;
+       esac
+       # Japanese Language versions have a version number like `4.1.3-JL'.
+       echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+       exit 0 ;;
+    sun3*:SunOS:*:*)
+       echo m68k-sun-sunos${UNAME_RELEASE}
+       exit 0 ;;
+    sun*:*:4.2BSD:*)
+       UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+       test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+       case "`/bin/arch`" in
+           sun3)
+               echo m68k-sun-sunos${UNAME_RELEASE}
+               ;;
+           sun4)
+               echo sparc-sun-sunos${UNAME_RELEASE}
+               ;;
+       esac
+       exit 0 ;;
+    aushp:SunOS:*:*)
+       echo sparc-auspex-sunos${UNAME_RELEASE}
+       exit 0 ;;
+    # The situation for MiNT is a little confusing.  The machine name
+    # can be virtually everything (everything which is not
+    # "atarist" or "atariste" at least should have a processor
+    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
+    # to the lowercase version "mint" (or "freemint").  Finally
+    # the system name "TOS" denotes a system which is actually not
+    # MiNT.  But MiNT is downward compatible to TOS, so this should
+    # be no problem.
+    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+        echo m68k-atari-mint${UNAME_RELEASE}
+       exit 0 ;;
+    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+       echo m68k-atari-mint${UNAME_RELEASE}
+        exit 0 ;;
+    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+        echo m68k-atari-mint${UNAME_RELEASE}
+       exit 0 ;;
+    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+        echo m68k-milan-mint${UNAME_RELEASE}
+        exit 0 ;;
+    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+        echo m68k-hades-mint${UNAME_RELEASE}
+        exit 0 ;;
+    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+        echo m68k-unknown-mint${UNAME_RELEASE}
+        exit 0 ;;
+    powerpc:machten:*:*)
+       echo powerpc-apple-machten${UNAME_RELEASE}
+       exit 0 ;;
+    RISC*:Mach:*:*)
+       echo mips-dec-mach_bsd4.3
+       exit 0 ;;
+    RISC*:ULTRIX:*:*)
+       echo mips-dec-ultrix${UNAME_RELEASE}
+       exit 0 ;;
+    VAX*:ULTRIX*:*:*)
+       echo vax-dec-ultrix${UNAME_RELEASE}
+       exit 0 ;;
+    2020:CLIX:*:* | 2430:CLIX:*:*)
+       echo clipper-intergraph-clix${UNAME_RELEASE}
+       exit 0 ;;
+    mips:*:*:UMIPS | mips:*:*:RISCos)
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h>  /* for printf() prototype */
+       int main (int argc, char *argv[]) {
+#else
+       int main (argc, argv) int argc; char *argv[]; {
+#endif
+       #if defined (host_mips) && defined (MIPSEB)
+       #if defined (SYSTYPE_SYSV)
+         printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+       #endif
+       #if defined (SYSTYPE_SVR4)
+         printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+       #endif
+       #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+         printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+       #endif
+       #endif
+         exit (-1);
+       }
+EOF
+       $CC_FOR_BUILD -o $dummy $dummy.c \
+         && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+         && exit 0
+       echo mips-mips-riscos${UNAME_RELEASE}
+       exit 0 ;;
+    Motorola:PowerMAX_OS:*:*)
+       echo powerpc-motorola-powermax
+       exit 0 ;;
+    Motorola:*:4.3:PL8-*)
+       echo powerpc-harris-powermax
+       exit 0 ;;
+    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+       echo powerpc-harris-powermax
+       exit 0 ;;
+    Night_Hawk:Power_UNIX:*:*)
+       echo powerpc-harris-powerunix
+       exit 0 ;;
+    m88k:CX/UX:7*:*)
+       echo m88k-harris-cxux7
+       exit 0 ;;
+    m88k:*:4*:R4*)
+       echo m88k-motorola-sysv4
+       exit 0 ;;
+    m88k:*:3*:R3*)
+       echo m88k-motorola-sysv3
+       exit 0 ;;
+    AViiON:dgux:*:*)
+        # DG/UX returns AViiON for all architectures
+        UNAME_PROCESSOR=`/usr/bin/uname -p`
+       if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+       then
+           if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+              [ ${TARGET_BINARY_INTERFACE}x = x ]
+           then
+               echo m88k-dg-dgux${UNAME_RELEASE}
+           else
+               echo m88k-dg-dguxbcs${UNAME_RELEASE}
+           fi
+       else
+           echo i586-dg-dgux${UNAME_RELEASE}
+       fi
+       exit 0 ;;
+    M88*:DolphinOS:*:*)        # DolphinOS (SVR3)
+       echo m88k-dolphin-sysv3
+       exit 0 ;;
+    M88*:*:R3*:*)
+       # Delta 88k system running SVR3
+       echo m88k-motorola-sysv3
+       exit 0 ;;
+    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+       echo m88k-tektronix-sysv3
+       exit 0 ;;
+    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+       echo m68k-tektronix-bsd
+       exit 0 ;;
+    *:IRIX*:*:*)
+       echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+       exit 0 ;;
+    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+       echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
+       exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
+    i*86:AIX:*:*)
+       echo i386-ibm-aix
+       exit 0 ;;
+    ia64:AIX:*:*)
+       if [ -x /usr/bin/oslevel ] ; then
+               IBM_REV=`/usr/bin/oslevel`
+       else
+               IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+       fi
+       echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+       exit 0 ;;
+    *:AIX:2:3)
+       if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+               eval $set_cc_for_build
+               sed 's/^                //' << EOF >$dummy.c
+               #include <sys/systemcfg.h>
+
+               main()
+                       {
+                       if (!__power_pc())
+                               exit(1);
+                       puts("powerpc-ibm-aix3.2.5");
+                       exit(0);
+                       }
+EOF
+               $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
+               echo rs6000-ibm-aix3.2.5
+       elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+               echo rs6000-ibm-aix3.2.4
+       else
+               echo rs6000-ibm-aix3.2
+       fi
+       exit 0 ;;
+    *:AIX:*:[45])
+       IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+       if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+               IBM_ARCH=rs6000
+       else
+               IBM_ARCH=powerpc
+       fi
+       if [ -x /usr/bin/oslevel ] ; then
+               IBM_REV=`/usr/bin/oslevel`
+       else
+               IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+       fi
+       echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+       exit 0 ;;
+    *:AIX:*:*)
+       echo rs6000-ibm-aix
+       exit 0 ;;
+    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+       echo romp-ibm-bsd4.4
+       exit 0 ;;
+    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
+       echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
+       exit 0 ;;                           # report: romp-ibm BSD 4.3
+    *:BOSX:*:*)
+       echo rs6000-bull-bosx
+       exit 0 ;;
+    DPX/2?00:B.O.S.:*:*)
+       echo m68k-bull-sysv3
+       exit 0 ;;
+    9000/[34]??:4.3bsd:1.*:*)
+       echo m68k-hp-bsd
+       exit 0 ;;
+    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+       echo m68k-hp-bsd4.4
+       exit 0 ;;
+    9000/[34678]??:HP-UX:*:*)
+       HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+       case "${UNAME_MACHINE}" in
+           9000/31? )            HP_ARCH=m68000 ;;
+           9000/[34]?? )         HP_ARCH=m68k ;;
+           9000/[678][0-9][0-9])
+               if [ -x /usr/bin/getconf ]; then
+                   sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+                    case "${sc_cpu_version}" in
+                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+                      532)                      # CPU_PA_RISC2_0
+                        case "${sc_kernel_bits}" in
+                          32) HP_ARCH="hppa2.0n" ;;
+                          64) HP_ARCH="hppa2.0w" ;;
+                         '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
+                        esac ;;
+                    esac
+               fi
+               if [ "${HP_ARCH}" = "" ]; then
+                   eval $set_cc_for_build
+                   sed 's/^              //' << EOF >$dummy.c
+
+              #define _HPUX_SOURCE
+              #include <stdlib.h>
+              #include <unistd.h>
+
+              int main ()
+              {
+              #if defined(_SC_KERNEL_BITS)
+                  long bits = sysconf(_SC_KERNEL_BITS);
+              #endif
+                  long cpu  = sysconf (_SC_CPU_VERSION);
+
+                  switch (cpu)
+               {
+               case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+               case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+               case CPU_PA_RISC2_0:
+              #if defined(_SC_KERNEL_BITS)
+                   switch (bits)
+                       {
+                       case 64: puts ("hppa2.0w"); break;
+                       case 32: puts ("hppa2.0n"); break;
+                       default: puts ("hppa2.0"); break;
+                       } break;
+              #else  /* !defined(_SC_KERNEL_BITS) */
+                   puts ("hppa2.0"); break;
+              #endif
+               default: puts ("hppa1.0"); break;
+               }
+                  exit (0);
+              }
+EOF
+                   (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+                   test -z "$HP_ARCH" && HP_ARCH=hppa
+               fi ;;
+       esac
+       if [ ${HP_ARCH} = "hppa2.0w" ]
+       then
+           # avoid double evaluation of $set_cc_for_build
+           test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
+           if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
+           then
+               HP_ARCH="hppa2.0w"
+           else
+               HP_ARCH="hppa64"
+           fi
+       fi
+       echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+       exit 0 ;;
+    ia64:HP-UX:*:*)
+       HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+       echo ia64-hp-hpux${HPUX_REV}
+       exit 0 ;;
+    3050*:HI-UX:*:*)
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+       #include <unistd.h>
+       int
+       main ()
+       {
+         long cpu = sysconf (_SC_CPU_VERSION);
+         /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+            true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
+            results, however.  */
+         if (CPU_IS_PA_RISC (cpu))
+           {
+             switch (cpu)
+               {
+                 case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+                 case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+                 case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+                 default: puts ("hppa-hitachi-hiuxwe2"); break;
+               }
+           }
+         else if (CPU_IS_HP_MC68K (cpu))
+           puts ("m68k-hitachi-hiuxwe2");
+         else puts ("unknown-hitachi-hiuxwe2");
+         exit (0);
+       }
+EOF
+       $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
+       echo unknown-hitachi-hiuxwe2
+       exit 0 ;;
+    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+       echo hppa1.1-hp-bsd
+       exit 0 ;;
+    9000/8??:4.3bsd:*:*)
+       echo hppa1.0-hp-bsd
+       exit 0 ;;
+    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+       echo hppa1.0-hp-mpeix
+       exit 0 ;;
+    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+       echo hppa1.1-hp-osf
+       exit 0 ;;
+    hp8??:OSF1:*:*)
+       echo hppa1.0-hp-osf
+       exit 0 ;;
+    i*86:OSF1:*:*)
+       if [ -x /usr/sbin/sysversion ] ; then
+           echo ${UNAME_MACHINE}-unknown-osf1mk
+       else
+           echo ${UNAME_MACHINE}-unknown-osf1
+       fi
+       exit 0 ;;
+    parisc*:Lites*:*:*)
+       echo hppa1.1-hp-lites
+       exit 0 ;;
+    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+       echo c1-convex-bsd
+        exit 0 ;;
+    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+       if getsysinfo -f scalar_acc
+       then echo c32-convex-bsd
+       else echo c2-convex-bsd
+       fi
+        exit 0 ;;
+    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+       echo c34-convex-bsd
+        exit 0 ;;
+    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+       echo c38-convex-bsd
+        exit 0 ;;
+    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+       echo c4-convex-bsd
+        exit 0 ;;
+    CRAY*Y-MP:*:*:*)
+       echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       exit 0 ;;
+    CRAY*[A-Z]90:*:*:*)
+       echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+       | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+             -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+             -e 's/\.[^.]*$/.X/'
+       exit 0 ;;
+    CRAY*TS:*:*:*)
+       echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       exit 0 ;;
+    CRAY*T3E:*:*:*)
+       echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       exit 0 ;;
+    CRAY*SV1:*:*:*)
+       echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       exit 0 ;;
+    *:UNICOS/mp:*:*)
+       echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 
+       exit 0 ;;
+    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+       FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+        exit 0 ;;
+    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+       echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+       exit 0 ;;
+    sparc*:BSD/OS:*:*)
+       echo sparc-unknown-bsdi${UNAME_RELEASE}
+       exit 0 ;;
+    *:BSD/OS:*:*)
+       echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+       exit 0 ;;
+    *:FreeBSD:*:*|*:GNU/FreeBSD:*:*)
+       # Determine whether the default compiler uses glibc.
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+       #include <features.h>
+       #if __GLIBC__ >= 2
+       LIBC=gnu
+       #else
+       LIBC=
+       #endif
+EOF
+       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+       echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
+       exit 0 ;;
+    i*:CYGWIN*:*)
+       echo ${UNAME_MACHINE}-pc-cygwin
+       exit 0 ;;
+    i*:MINGW*:*)
+       echo ${UNAME_MACHINE}-pc-mingw32
+       exit 0 ;;
+    i*:PW*:*)
+       echo ${UNAME_MACHINE}-pc-pw32
+       exit 0 ;;
+    x86:Interix*:[34]*)
+       echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
+       exit 0 ;;
+    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+       echo i${UNAME_MACHINE}-pc-mks
+       exit 0 ;;
+    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+       # How do we know it's Interix rather than the generic POSIX subsystem?
+       # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+       # UNAME_MACHINE based on the output of uname instead of i386?
+       echo i586-pc-interix
+       exit 0 ;;
+    i*:UWIN*:*)
+       echo ${UNAME_MACHINE}-pc-uwin
+       exit 0 ;;
+    p*:CYGWIN*:*)
+       echo powerpcle-unknown-cygwin
+       exit 0 ;;
+    prep*:SunOS:5.*:*)
+       echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit 0 ;;
+    *:GNU:*:*)
+       echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+       exit 0 ;;
+    i*86:Minix:*:*)
+       echo ${UNAME_MACHINE}-pc-minix
+       exit 0 ;;
+    arm*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       exit 0 ;;
+    cris:Linux:*:*)
+       echo cris-axis-linux-gnu
+       exit 0 ;;
+    ia64:Linux:*:*)
+       echo ${UNAME_MACHINE}-${VENDOR:-unknown}-linux-gnu
+       exit 0 ;;
+    m68*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       exit 0 ;;
+    mips:Linux:*:*)
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+       #undef CPU
+       #undef mips
+       #undef mipsel
+       #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+       CPU=mipsel
+       #else
+       #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+       CPU=mips
+       #else
+       CPU=
+       #endif
+       #endif
+EOF
+       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+       test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
+       ;;
+    mips64:Linux:*:*)
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+       #undef CPU
+       #undef mips64
+       #undef mips64el
+       #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+       CPU=mips64el
+       #else
+       #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+       CPU=mips64
+       #else
+       CPU=
+       #endif
+       #endif
+EOF
+       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+       test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
+       ;;
+    ppc:Linux:*:*)
+       echo powerpc-${VENDOR:-unknown}-linux-gnu
+       exit 0 ;;
+    ppc64:Linux:*:*)
+       echo powerpc64-${VENDOR:-unknown}-linux-gnu
+       exit 0 ;;
+    alpha:Linux:*:*)
+       case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+         EV5)   UNAME_MACHINE=alphaev5 ;;
+         EV56)  UNAME_MACHINE=alphaev56 ;;
+         PCA56) UNAME_MACHINE=alphapca56 ;;
+         PCA57) UNAME_MACHINE=alphapca56 ;;
+         EV6)   UNAME_MACHINE=alphaev6 ;;
+         EV67)  UNAME_MACHINE=alphaev67 ;;
+         EV68*) UNAME_MACHINE=alphaev68 ;;
+        esac
+       objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
+       if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+       echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+       exit 0 ;;
+    parisc:Linux:*:* | hppa:Linux:*:*)
+       # Look for CPU level
+       case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+         PA7*) echo hppa1.1-unknown-linux-gnu ;;
+         PA8*) echo hppa2.0-unknown-linux-gnu ;;
+         *)    echo hppa-unknown-linux-gnu ;;
+       esac
+       exit 0 ;;
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
+       echo hppa64-unknown-linux-gnu
+       exit 0 ;;
+    s390:Linux:*:* | s390x:Linux:*:*)
+       echo ${UNAME_MACHINE}-${VENDOR:-ibm}-linux-gnu
+       exit 0 ;;
+    sh64*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       exit 0 ;;
+    sh*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       exit 0 ;;
+    sparc:Linux:*:* | sparc64:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       exit 0 ;;
+    x86_64:Linux:*:*)
+       echo x86_64-${VENDOR:-unknown}-linux-gnu
+       exit 0 ;;
+    i*86:Linux:*:*)
+       # The BFD linker knows what the default object file format is, so
+       # first see if it will tell us. cd to the root directory to prevent
+       # problems with other programs or directories called `ld' in the path.
+       # Set LC_ALL=C to ensure ld outputs messages in English.
+       ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
+                        | sed -ne '/supported targets:/!d
+                                   s/[         ][      ]*/ /g
+                                   s/.*supported targets: *//
+                                   s/ .*//
+                                   p'`
+        case "$ld_supported_targets" in
+         elf32-i386)
+               TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
+               ;;
+         a.out-i386-linux)
+               echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+               exit 0 ;;
+         coff-i386)
+               echo "${UNAME_MACHINE}-pc-linux-gnucoff"
+               exit 0 ;;
+         "")
+               # Either a pre-BFD a.out linker (linux-gnuoldld) or
+               # one that does not give us useful --help.
+               echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
+               exit 0 ;;
+       esac
+       # Determine whether the default compiler is a.out or elf
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+       #include <features.h>
+       #ifdef __ELF__
+       # ifdef __GLIBC__
+       #  if __GLIBC__ >= 2
+       LIBC=gnu
+       #  else
+       LIBC=gnulibc1
+       #  endif
+       # else
+       LIBC=gnulibc1
+       # endif
+       #else
+       #ifdef __INTEL_COMPILER
+       LIBC=gnu
+       #else
+       LIBC=gnuaout
+       #endif
+       #endif
+EOF
+       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+       test x"${LIBC}" != x && echo "${UNAME_MACHINE}-${VENDOR:-pc}-linux-${LIBC}" && exit 0
+       test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
+       ;;
+    i*86:DYNIX/ptx:4*:*)
+       # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+       # earlier versions are messed up and put the nodename in both
+       # sysname and nodename.
+       echo i386-sequent-sysv4
+       exit 0 ;;
+    i*86:UNIX_SV:4.2MP:2.*)
+        # Unixware is an offshoot of SVR4, but it has its own version
+        # number series starting with 2...
+        # I am not positive that other SVR4 systems won't match this,
+       # I just have to hope.  -- rms.
+        # Use sysv4.2uw... so that sysv4* matches it.
+       echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+       exit 0 ;;
+    i*86:OS/2:*:*)
+       # If we were able to find `uname', then EMX Unix compatibility
+       # is probably installed.
+       echo ${UNAME_MACHINE}-pc-os2-emx
+       exit 0 ;;
+    i*86:XTS-300:*:STOP)
+       echo ${UNAME_MACHINE}-unknown-stop
+       exit 0 ;;
+    i*86:atheos:*:*)
+       echo ${UNAME_MACHINE}-unknown-atheos
+       exit 0 ;;
+    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+       echo i386-unknown-lynxos${UNAME_RELEASE}
+       exit 0 ;;
+    i*86:*DOS:*:*)
+       echo ${UNAME_MACHINE}-pc-msdosdjgpp
+       exit 0 ;;
+    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+       UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+       if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+               echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+       else
+               echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+       fi
+       exit 0 ;;
+    i*86:*:5:[78]*)
+       case `/bin/uname -X | grep "^Machine"` in
+           *486*)           UNAME_MACHINE=i486 ;;
+           *Pentium)        UNAME_MACHINE=i586 ;;
+           *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+       esac
+       echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+       exit 0 ;;
+    i*86:*:3.2:*)
+       if test -f /usr/options/cb.name; then
+               UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+               echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+       elif /bin/uname -X 2>/dev/null >/dev/null ; then
+               UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+               (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+               (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+                       && UNAME_MACHINE=i586
+               (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+                       && UNAME_MACHINE=i686
+               (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+                       && UNAME_MACHINE=i686
+               echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+       else
+               echo ${UNAME_MACHINE}-pc-sysv32
+       fi
+       exit 0 ;;
+    pc:*:*:*)
+       # Left here for compatibility:
+        # uname -m prints for DJGPP always 'pc', but it prints nothing about
+        # the processor, so we play safe by assuming i386.
+       echo i386-pc-msdosdjgpp
+        exit 0 ;;
+    Intel:Mach:3*:*)
+       echo i386-pc-mach3
+       exit 0 ;;
+    paragon:*:*:*)
+       echo i860-intel-osf1
+       exit 0 ;;
+    i860:*:4.*:*) # i860-SVR4
+       if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+         echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+       else # Add other i860-SVR4 vendors below as they are discovered.
+         echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
+       fi
+       exit 0 ;;
+    mini*:CTIX:SYS*5:*)
+       # "miniframe"
+       echo m68010-convergent-sysv
+       exit 0 ;;
+    mc68k:UNIX:SYSTEM5:3.51m)
+       echo m68k-convergent-sysv
+       exit 0 ;;
+    M680?0:D-NIX:5.3:*)
+       echo m68k-diab-dnix
+       exit 0 ;;
+    M68*:*:R3V[567]*:*)
+       test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
+    3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0)
+       OS_REL=''
+       test -r /etc/.relid \
+       && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+       /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+         && echo i486-ncr-sysv4.3${OS_REL} && exit 0
+       /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+         && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
+    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+          && echo i486-ncr-sysv4 && exit 0 ;;
+    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+       echo m68k-unknown-lynxos${UNAME_RELEASE}
+       exit 0 ;;
+    mc68030:UNIX_System_V:4.*:*)
+       echo m68k-atari-sysv4
+       exit 0 ;;
+    TSUNAMI:LynxOS:2.*:*)
+       echo sparc-unknown-lynxos${UNAME_RELEASE}
+       exit 0 ;;
+    rs6000:LynxOS:2.*:*)
+       echo rs6000-unknown-lynxos${UNAME_RELEASE}
+       exit 0 ;;
+    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+       echo powerpc-unknown-lynxos${UNAME_RELEASE}
+       exit 0 ;;
+    SM[BE]S:UNIX_SV:*:*)
+       echo mips-dde-sysv${UNAME_RELEASE}
+       exit 0 ;;
+    RM*:ReliantUNIX-*:*:*)
+       echo mips-sni-sysv4
+       exit 0 ;;
+    RM*:SINIX-*:*:*)
+       echo mips-sni-sysv4
+       exit 0 ;;
+    *:SINIX-*:*:*)
+       if uname -p 2>/dev/null >/dev/null ; then
+               UNAME_MACHINE=`(uname -p) 2>/dev/null`
+               echo ${UNAME_MACHINE}-sni-sysv4
+       else
+               echo ns32k-sni-sysv
+       fi
+       exit 0 ;;
+    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+                      # says <Richard.M.Bartel@ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit 0 ;;
+    *:UNIX_System_V:4*:FTX*)
+       # From Gerald Hewes <hewes@openmarket.com>.
+       # How about differentiating between stratus architectures? -djm
+       echo hppa1.1-stratus-sysv4
+       exit 0 ;;
+    *:*:*:FTX*)
+       # From seanf@swdc.stratus.com.
+       echo i860-stratus-sysv4
+       exit 0 ;;
+    *:VOS:*:*)
+       # From Paul.Green@stratus.com.
+       echo hppa1.1-stratus-vos
+       exit 0 ;;
+    mc68*:A/UX:*:*)
+       echo m68k-apple-aux${UNAME_RELEASE}
+       exit 0 ;;
+    news*:NEWS-OS:6*:*)
+       echo mips-sony-newsos6
+       exit 0 ;;
+    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+       if [ -d /usr/nec ]; then
+               echo mips-nec-sysv${UNAME_RELEASE}
+       else
+               echo mips-unknown-sysv${UNAME_RELEASE}
+       fi
+        exit 0 ;;
+    BeBox:BeOS:*:*)    # BeOS running on hardware made by Be, PPC only.
+       echo powerpc-be-beos
+       exit 0 ;;
+    BeMac:BeOS:*:*)    # BeOS running on Mac or Mac clone, PPC only.
+       echo powerpc-apple-beos
+       exit 0 ;;
+    BePC:BeOS:*:*)     # BeOS running on Intel PC compatible.
+       echo i586-pc-beos
+       exit 0 ;;
+    SX-4:SUPER-UX:*:*)
+       echo sx4-nec-superux${UNAME_RELEASE}
+       exit 0 ;;
+    SX-5:SUPER-UX:*:*)
+       echo sx5-nec-superux${UNAME_RELEASE}
+       exit 0 ;;
+    SX-6:SUPER-UX:*:*)
+       echo sx6-nec-superux${UNAME_RELEASE}
+       exit 0 ;;
+    Power*:Rhapsody:*:*)
+       echo powerpc-apple-rhapsody${UNAME_RELEASE}
+       exit 0 ;;
+    *:Rhapsody:*:*)
+       echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+       exit 0 ;;
+    *:Darwin:*:*)
+       case `uname -p` in
+           *86) UNAME_PROCESSOR=i686 ;;
+           powerpc) UNAME_PROCESSOR=powerpc ;;
+       esac
+       echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+       exit 0 ;;
+    *:procnto*:*:* | *:QNX:[0123456789]*:*)
+       UNAME_PROCESSOR=`uname -p`
+       if test "$UNAME_PROCESSOR" = "x86"; then
+               UNAME_PROCESSOR=i386
+               UNAME_MACHINE=pc
+       fi
+       echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+       exit 0 ;;
+    *:QNX:*:4*)
+       echo i386-pc-qnx
+       exit 0 ;;
+    NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
+       echo nsr-tandem-nsk${UNAME_RELEASE}
+       exit 0 ;;
+    *:NonStop-UX:*:*)
+       echo mips-compaq-nonstopux
+       exit 0 ;;
+    BS2000:POSIX*:*:*)
+       echo bs2000-siemens-sysv
+       exit 0 ;;
+    DS/*:UNIX_System_V:*:*)
+       echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+       exit 0 ;;
+    *:Plan9:*:*)
+       # "uname -m" is not consistent, so use $cputype instead. 386
+       # is converted to i386 for consistency with other x86
+       # operating systems.
+       if test "$cputype" = "386"; then
+           UNAME_MACHINE=i386
+       else
+           UNAME_MACHINE="$cputype"
+       fi
+       echo ${UNAME_MACHINE}-unknown-plan9
+       exit 0 ;;
+    *:TOPS-10:*:*)
+       echo pdp10-unknown-tops10
+       exit 0 ;;
+    *:TENEX:*:*)
+       echo pdp10-unknown-tenex
+       exit 0 ;;
+    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+       echo pdp10-dec-tops20
+       exit 0 ;;
+    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+       echo pdp10-xkl-tops20
+       exit 0 ;;
+    *:TOPS-20:*:*)
+       echo pdp10-unknown-tops20
+       exit 0 ;;
+    *:ITS:*:*)
+       echo pdp10-unknown-its
+       exit 0 ;;
+    SEI:*:*:SEIUX)
+        echo mips-sei-seiux${UNAME_RELEASE}
+       exit 0 ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
+     I don't know....  */
+  printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+  printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+          "4"
+#else
+         ""
+#endif
+         ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+  printf ("arm-acorn-riscix"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+  printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+  int version;
+  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+  if (version < 4)
+    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+  else
+    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+  exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+  printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+  printf ("ns32k-encore-mach\n"); exit (0);
+#else
+  printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+  printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+  printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+  printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+    struct utsname un;
+
+    uname(&un);
+
+    if (strncmp(un.version, "V2", 2) == 0) {
+       printf ("i386-sequent-ptx2\n"); exit (0);
+    }
+    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+       printf ("i386-sequent-ptx1\n"); exit (0);
+    }
+    printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+#  include <sys/param.h>
+#  if defined (BSD)
+#   if BSD == 43
+      printf ("vax-dec-bsd4.3\n"); exit (0);
+#   else
+#    if BSD == 199006
+      printf ("vax-dec-bsd4.3reno\n"); exit (0);
+#    else
+      printf ("vax-dec-bsd\n"); exit (0);
+#    endif
+#   endif
+#  else
+    printf ("vax-dec-bsd\n"); exit (0);
+#  endif
+# else
+    printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+  printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+  exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+    case `getsysinfo -f cpu_type` in
+    c1*)
+       echo c1-convex-bsd
+       exit 0 ;;
+    c2*)
+       if getsysinfo -f scalar_acc
+       then echo c32-convex-bsd
+       else echo c2-convex-bsd
+       fi
+       exit 0 ;;
+    c34*)
+       echo c34-convex-bsd
+       exit 0 ;;
+    c38*)
+       echo c38-convex-bsd
+       exit 0 ;;
+    c4*)
+       echo c4-convex-bsd
+       exit 0 ;;
+    esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+    ftp://ftp.gnu.org/pub/gnu/config/
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo               = `(hostinfo) 2>/dev/null`
+/bin/universe          = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch              = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM  = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/acaux/config.sub b/acaux/config.sub
new file mode 100755 (executable)
index 0000000..6b2ff9f
--- /dev/null
@@ -0,0 +1,1500 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
+timestamp='2003-06-18'
+
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine.  It does not imply ALL GNU software can.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Please send patches to <config-patches@gnu.org>.  Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support.  The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+#      CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+#      CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+       $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit 0 ;;
+    --version | -v )
+       echo "$version" ; exit 0 ;;
+    --help | --h* | -h )
+       echo "$usage"; exit 0 ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )        # Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help"
+       exit 1 ;;
+
+    *local*)
+       # First pass through any local machine types.
+       echo $1
+       exit 0;;
+
+    * )
+       break ;;
+  esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+    exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+    exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+  nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
+    os=-$maybe_os
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+    ;;
+  *)
+    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+    if [ $basic_machine != $1 ]
+    then os=`echo $1 | sed 's/.*-/-/'`
+    else os=; fi
+    ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work.  We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+       -sun*os*)
+               # Prevent following clause from handling this invalid input.
+               ;;
+       -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+       -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+       -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+       -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+       -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+       -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+       -apple | -axis)
+               os=
+               basic_machine=$1
+               ;;
+       -sim | -cisco | -oki | -wec | -winbond)
+               os=
+               basic_machine=$1
+               ;;
+       -scout)
+               ;;
+       -wrs)
+               os=-vxworks
+               basic_machine=$1
+               ;;
+       -chorusos*)
+               os=-chorusos
+               basic_machine=$1
+               ;;
+       -chorusrdb)
+               os=-chorusrdb
+               basic_machine=$1
+               ;;
+       -hiux*)
+               os=-hiuxwe2
+               ;;
+       -sco5)
+               os=-sco3.2v5
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -sco4)
+               os=-sco3.2v4
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -sco3.2.[4-9]*)
+               os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -sco3.2v[4-9]*)
+               # Don't forget version if it is 3.2v4 or newer.
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -sco*)
+               os=-sco3.2v2
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -udk*)
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -isc)
+               os=-isc2.2
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -clix*)
+               basic_machine=clipper-intergraph
+               ;;
+       -isc*)
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -lynx*)
+               os=-lynxos
+               ;;
+       -ptx*)
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+               ;;
+       -windowsnt*)
+               os=`echo $os | sed -e 's/windowsnt/winnt/'`
+               ;;
+       -psos*)
+               os=-psos
+               ;;
+       -mint | -mint[0-9]*)
+               basic_machine=m68k-atari
+               os=-mint
+               ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+       # Recognize the basic CPU types without company name.
+       # Some are omitted here because they have special meanings below.
+       1750a | 580 \
+       | a29k \
+       | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+       | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+       | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+       | c4x | clipper \
+       | d10v | d30v | dlx | dsp16xx \
+       | fr30 | frv \
+       | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+       | i370 | i860 | i960 | ia64 \
+       | ip2k \
+       | m32r | m68000 | m68k | m88k | mcore \
+       | mips | mipsbe | mipseb | mipsel | mipsle \
+       | mips16 \
+       | mips64 | mips64el \
+       | mips64vr | mips64vrel \
+       | mips64orion | mips64orionel \
+       | mips64vr4100 | mips64vr4100el \
+       | mips64vr4300 | mips64vr4300el \
+       | mips64vr5000 | mips64vr5000el \
+       | mipsisa32 | mipsisa32el \
+       | mipsisa32r2 | mipsisa32r2el \
+       | mipsisa64 | mipsisa64el \
+       | mipsisa64sb1 | mipsisa64sb1el \
+       | mipsisa64sr71k | mipsisa64sr71kel \
+       | mipstx39 | mipstx39el \
+       | mn10200 | mn10300 \
+       | msp430 \
+       | ns16k | ns32k \
+       | openrisc | or32 \
+       | pdp10 | pdp11 | pj | pjl \
+       | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+       | pyramid \
+       | s390 | s390x \
+       | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
+       | sh64 | sh64le \
+       | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \
+       | strongarm \
+       | tahoe | thumb | tic4x | tic80 | tron \
+       | v850 | v850e \
+       | we32k \
+       | x86 | xscale | xstormy16 | xtensa \
+       | z8k)
+               basic_machine=$basic_machine-unknown
+               ;;
+       m6811 | m68hc11 | m6812 | m68hc12)
+               # Motorola 68HC11/12.
+               basic_machine=$basic_machine-unknown
+               os=-none
+               ;;
+       m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+               ;;
+
+       # We use `pc' rather than `unknown'
+       # because (1) that's what they normally are, and
+       # (2) the word "unknown" tends to confuse beginning users.
+       i*86 | x86_64)
+         basic_machine=$basic_machine-pc
+         ;;
+       # Object if more than one company name word.
+       *-*-*)
+               echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+               exit 1
+               ;;
+       # Recognize the basic CPU types with company name.
+       580-* \
+       | a29k-* \
+       | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+       | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+       | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+       | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
+       | avr-* \
+       | bs2000-* \
+       | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+       | clipper-* | cydra-* \
+       | d10v-* | d30v-* | dlx-* \
+       | elxsi-* \
+       | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
+       | h8300-* | h8500-* \
+       | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+       | i*86-* | i860-* | i960-* | ia64-* \
+       | ip2k-* \
+       | m32r-* \
+       | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+       | m88110-* | m88k-* | mcore-* \
+       | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+       | mips16-* \
+       | mips64-* | mips64el-* \
+       | mips64vr-* | mips64vrel-* \
+       | mips64orion-* | mips64orionel-* \
+       | mips64vr4100-* | mips64vr4100el-* \
+       | mips64vr4300-* | mips64vr4300el-* \
+       | mips64vr5000-* | mips64vr5000el-* \
+       | mipsisa32-* | mipsisa32el-* \
+       | mipsisa32r2-* | mipsisa32r2el-* \
+       | mipsisa64-* | mipsisa64el-* \
+       | mipsisa64sb1-* | mipsisa64sb1el-* \
+       | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+       | mipstx39-* | mipstx39el-* \
+       | msp430-* \
+       | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
+       | orion-* \
+       | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+       | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+       | pyramid-* \
+       | romp-* | rs6000-* \
+       | s390-* | s390x-* \
+       | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
+       | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+       | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
+       | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
+       | tahoe-* | thumb-* \
+       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+       | tron-* \
+       | v850-* | v850e-* | vax-* \
+       | we32k-* \
+       | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
+       | xtensa-* \
+       | ymp-* \
+       | z8k-*)
+               ;;
+       # Recognize the various machine names and aliases which stand
+       # for a CPU type and a company and sometimes even an OS.
+       386bsd)
+               basic_machine=i386-unknown
+               os=-bsd
+               ;;
+       3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+               basic_machine=m68000-att
+               ;;
+       3b*)
+               basic_machine=we32k-att
+               ;;
+       a29khif)
+               basic_machine=a29k-amd
+               os=-udi
+               ;;
+       adobe68k)
+               basic_machine=m68010-adobe
+               os=-scout
+               ;;
+       alliant | fx80)
+               basic_machine=fx80-alliant
+               ;;
+       altos | altos3068)
+               basic_machine=m68k-altos
+               ;;
+       am29k)
+               basic_machine=a29k-none
+               os=-bsd
+               ;;
+       amd64)
+               basic_machine=x86_64-pc
+               ;;
+       amdahl)
+               basic_machine=580-amdahl
+               os=-sysv
+               ;;
+       amiga | amiga-*)
+               basic_machine=m68k-unknown
+               ;;
+       amigaos | amigados)
+               basic_machine=m68k-unknown
+               os=-amigaos
+               ;;
+       amigaunix | amix)
+               basic_machine=m68k-unknown
+               os=-sysv4
+               ;;
+       apollo68)
+               basic_machine=m68k-apollo
+               os=-sysv
+               ;;
+       apollo68bsd)
+               basic_machine=m68k-apollo
+               os=-bsd
+               ;;
+       aux)
+               basic_machine=m68k-apple
+               os=-aux
+               ;;
+       balance)
+               basic_machine=ns32k-sequent
+               os=-dynix
+               ;;
+       c90)
+               basic_machine=c90-cray
+               os=-unicos
+               ;;
+       convex-c1)
+               basic_machine=c1-convex
+               os=-bsd
+               ;;
+       convex-c2)
+               basic_machine=c2-convex
+               os=-bsd
+               ;;
+       convex-c32)
+               basic_machine=c32-convex
+               os=-bsd
+               ;;
+       convex-c34)
+               basic_machine=c34-convex
+               os=-bsd
+               ;;
+       convex-c38)
+               basic_machine=c38-convex
+               os=-bsd
+               ;;
+       cray | j90)
+               basic_machine=j90-cray
+               os=-unicos
+               ;;
+       crds | unos)
+               basic_machine=m68k-crds
+               ;;
+       cris | cris-* | etrax*)
+               basic_machine=cris-axis
+               ;;
+       da30 | da30-*)
+               basic_machine=m68k-da30
+               ;;
+       decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+               basic_machine=mips-dec
+               ;;
+       decsystem10* | dec10*)
+               basic_machine=pdp10-dec
+               os=-tops10
+               ;;
+       decsystem20* | dec20*)
+               basic_machine=pdp10-dec
+               os=-tops20
+               ;;
+       delta | 3300 | motorola-3300 | motorola-delta \
+             | 3300-motorola | delta-motorola)
+               basic_machine=m68k-motorola
+               ;;
+       delta88)
+               basic_machine=m88k-motorola
+               os=-sysv3
+               ;;
+       dpx20 | dpx20-*)
+               basic_machine=rs6000-bull
+               os=-bosx
+               ;;
+       dpx2* | dpx2*-bull)
+               basic_machine=m68k-bull
+               os=-sysv3
+               ;;
+       ebmon29k)
+               basic_machine=a29k-amd
+               os=-ebmon
+               ;;
+       elxsi)
+               basic_machine=elxsi-elxsi
+               os=-bsd
+               ;;
+       encore | umax | mmax)
+               basic_machine=ns32k-encore
+               ;;
+       es1800 | OSE68k | ose68k | ose | OSE)
+               basic_machine=m68k-ericsson
+               os=-ose
+               ;;
+       fx2800)
+               basic_machine=i860-alliant
+               ;;
+       genix)
+               basic_machine=ns32k-ns
+               ;;
+       gmicro)
+               basic_machine=tron-gmicro
+               os=-sysv
+               ;;
+       go32)
+               basic_machine=i386-pc
+               os=-go32
+               ;;
+       h3050r* | hiux*)
+               basic_machine=hppa1.1-hitachi
+               os=-hiuxwe2
+               ;;
+       h8300hms)
+               basic_machine=h8300-hitachi
+               os=-hms
+               ;;
+       h8300xray)
+               basic_machine=h8300-hitachi
+               os=-xray
+               ;;
+       h8500hms)
+               basic_machine=h8500-hitachi
+               os=-hms
+               ;;
+       harris)
+               basic_machine=m88k-harris
+               os=-sysv3
+               ;;
+       hp300-*)
+               basic_machine=m68k-hp
+               ;;
+       hp300bsd)
+               basic_machine=m68k-hp
+               os=-bsd
+               ;;
+       hp300hpux)
+               basic_machine=m68k-hp
+               os=-hpux
+               ;;
+       hp3k9[0-9][0-9] | hp9[0-9][0-9])
+               basic_machine=hppa1.0-hp
+               ;;
+       hp9k2[0-9][0-9] | hp9k31[0-9])
+               basic_machine=m68000-hp
+               ;;
+       hp9k3[2-9][0-9])
+               basic_machine=m68k-hp
+               ;;
+       hp9k6[0-9][0-9] | hp6[0-9][0-9])
+               basic_machine=hppa1.0-hp
+               ;;
+       hp9k7[0-79][0-9] | hp7[0-79][0-9])
+               basic_machine=hppa1.1-hp
+               ;;
+       hp9k78[0-9] | hp78[0-9])
+               # FIXME: really hppa2.0-hp
+               basic_machine=hppa1.1-hp
+               ;;
+       hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+               # FIXME: really hppa2.0-hp
+               basic_machine=hppa1.1-hp
+               ;;
+       hp9k8[0-9][13679] | hp8[0-9][13679])
+               basic_machine=hppa1.1-hp
+               ;;
+       hp9k8[0-9][0-9] | hp8[0-9][0-9])
+               basic_machine=hppa1.0-hp
+               ;;
+       hppa-next)
+               os=-nextstep3
+               ;;
+       hppaosf)
+               basic_machine=hppa1.1-hp
+               os=-osf
+               ;;
+       hppro)
+               basic_machine=hppa1.1-hp
+               os=-proelf
+               ;;
+       i370-ibm* | ibm*)
+               basic_machine=i370-ibm
+               ;;
+# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
+       i*86v32)
+               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+               os=-sysv32
+               ;;
+       i*86v4*)
+               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+               os=-sysv4
+               ;;
+       i*86v)
+               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+               os=-sysv
+               ;;
+       i*86sol2)
+               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+               os=-solaris2
+               ;;
+       i386mach)
+               basic_machine=i386-mach
+               os=-mach
+               ;;
+       i386-vsta | vsta)
+               basic_machine=i386-unknown
+               os=-vsta
+               ;;
+       iris | iris4d)
+               basic_machine=mips-sgi
+               case $os in
+                   -irix*)
+                       ;;
+                   *)
+                       os=-irix4
+                       ;;
+               esac
+               ;;
+       isi68 | isi)
+               basic_machine=m68k-isi
+               os=-sysv
+               ;;
+       m88k-omron*)
+               basic_machine=m88k-omron
+               ;;
+       magnum | m3230)
+               basic_machine=mips-mips
+               os=-sysv
+               ;;
+       merlin)
+               basic_machine=ns32k-utek
+               os=-sysv
+               ;;
+       mingw32)
+               basic_machine=i386-pc
+               os=-mingw32
+               ;;
+       miniframe)
+               basic_machine=m68000-convergent
+               ;;
+       *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+               basic_machine=m68k-atari
+               os=-mint
+               ;;
+       mips3*-*)
+               basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+               ;;
+       mips3*)
+               basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+               ;;
+       mmix*)
+               basic_machine=mmix-knuth
+               os=-mmixware
+               ;;
+       monitor)
+               basic_machine=m68k-rom68k
+               os=-coff
+               ;;
+       morphos)
+               basic_machine=powerpc-unknown
+               os=-morphos
+               ;;
+       msdos)
+               basic_machine=i386-pc
+               os=-msdos
+               ;;
+       mvs)
+               basic_machine=i370-ibm
+               os=-mvs
+               ;;
+       ncr3000)
+               basic_machine=i486-ncr
+               os=-sysv4
+               ;;
+       netbsd386)
+               basic_machine=i386-unknown
+               os=-netbsd
+               ;;
+       netwinder)
+               basic_machine=armv4l-rebel
+               os=-linux
+               ;;
+       news | news700 | news800 | news900)
+               basic_machine=m68k-sony
+               os=-newsos
+               ;;
+       news1000)
+               basic_machine=m68030-sony
+               os=-newsos
+               ;;
+       news-3600 | risc-news)
+               basic_machine=mips-sony
+               os=-newsos
+               ;;
+       necv70)
+               basic_machine=v70-nec
+               os=-sysv
+               ;;
+       next | m*-next )
+               basic_machine=m68k-next
+               case $os in
+                   -nextstep* )
+                       ;;
+                   -ns2*)
+                     os=-nextstep2
+                       ;;
+                   *)
+                     os=-nextstep3
+                       ;;
+               esac
+               ;;
+       nh3000)
+               basic_machine=m68k-harris
+               os=-cxux
+               ;;
+       nh[45]000)
+               basic_machine=m88k-harris
+               os=-cxux
+               ;;
+       nindy960)
+               basic_machine=i960-intel
+               os=-nindy
+               ;;
+       mon960)
+               basic_machine=i960-intel
+               os=-mon960
+               ;;
+       nonstopux)
+               basic_machine=mips-compaq
+               os=-nonstopux
+               ;;
+       np1)
+               basic_machine=np1-gould
+               ;;
+       nv1)
+               basic_machine=nv1-cray
+               os=-unicosmp
+               ;;
+       nsr-tandem)
+               basic_machine=nsr-tandem
+               ;;
+       op50n-* | op60c-*)
+               basic_machine=hppa1.1-oki
+               os=-proelf
+               ;;
+       or32 | or32-*)
+               basic_machine=or32-unknown
+               os=-coff
+               ;;
+       OSE68000 | ose68000)
+               basic_machine=m68000-ericsson
+               os=-ose
+               ;;
+       os68k)
+               basic_machine=m68k-none
+               os=-os68k
+               ;;
+       pa-hitachi)
+               basic_machine=hppa1.1-hitachi
+               os=-hiuxwe2
+               ;;
+       paragon)
+               basic_machine=i860-intel
+               os=-osf
+               ;;
+       pbd)
+               basic_machine=sparc-tti
+               ;;
+       pbb)
+               basic_machine=m68k-tti
+               ;;
+       pc532 | pc532-*)
+               basic_machine=ns32k-pc532
+               ;;
+       pentium | p5 | k5 | k6 | nexgen | viac3)
+               basic_machine=i586-pc
+               ;;
+       pentiumpro | p6 | 6x86 | athlon | athlon_*)
+               basic_machine=i686-pc
+               ;;
+       pentiumii | pentium2 | pentiumiii | pentium3)
+               basic_machine=i686-pc
+               ;;
+       pentium4)
+               basic_machine=i786-pc
+               ;;
+       pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+               basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       pentiumpro-* | p6-* | 6x86-* | athlon-*)
+               basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+               basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       pentium4-*)
+               basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       pn)
+               basic_machine=pn-gould
+               ;;
+       power)  basic_machine=power-ibm
+               ;;
+       ppc)    basic_machine=powerpc-unknown
+               ;;
+       ppc-*)  basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       ppcle | powerpclittle | ppc-le | powerpc-little)
+               basic_machine=powerpcle-unknown
+               ;;
+       ppcle-* | powerpclittle-*)
+               basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       ppc64)  basic_machine=powerpc64-unknown
+               ;;
+       ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+               basic_machine=powerpc64le-unknown
+               ;;
+       ppc64le-* | powerpc64little-*)
+               basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       ps2)
+               basic_machine=i386-ibm
+               ;;
+       pw32)
+               basic_machine=i586-unknown
+               os=-pw32
+               ;;
+       rom68k)
+               basic_machine=m68k-rom68k
+               os=-coff
+               ;;
+       rm[46]00)
+               basic_machine=mips-siemens
+               ;;
+       rtpc | rtpc-*)
+               basic_machine=romp-ibm
+               ;;
+       sa29200)
+               basic_machine=a29k-amd
+               os=-udi
+               ;;
+       sb1)
+               basic_machine=mipsisa64sb1-unknown
+               ;;
+       sb1el)
+               basic_machine=mipsisa64sb1el-unknown
+               ;;
+       sei)
+               basic_machine=mips-sei
+               os=-seiux
+               ;;
+       sequent)
+               basic_machine=i386-sequent
+               ;;
+       sh)
+               basic_machine=sh-hitachi
+               os=-hms
+               ;;
+       sh64)
+               basic_machine=sh64-unknown
+               ;;
+       sparclite-wrs | simso-wrs)
+               basic_machine=sparclite-wrs
+               os=-vxworks
+               ;;
+       sps7)
+               basic_machine=m68k-bull
+               os=-sysv2
+               ;;
+       spur)
+               basic_machine=spur-unknown
+               ;;
+       st2000)
+               basic_machine=m68k-tandem
+               ;;
+       stratus)
+               basic_machine=i860-stratus
+               os=-sysv4
+               ;;
+       sun2)
+               basic_machine=m68000-sun
+               ;;
+       sun2os3)
+               basic_machine=m68000-sun
+               os=-sunos3
+               ;;
+       sun2os4)
+               basic_machine=m68000-sun
+               os=-sunos4
+               ;;
+       sun3os3)
+               basic_machine=m68k-sun
+               os=-sunos3
+               ;;
+       sun3os4)
+               basic_machine=m68k-sun
+               os=-sunos4
+               ;;
+       sun4os3)
+               basic_machine=sparc-sun
+               os=-sunos3
+               ;;
+       sun4os4)
+               basic_machine=sparc-sun
+               os=-sunos4
+               ;;
+       sun4sol2)
+               basic_machine=sparc-sun
+               os=-solaris2
+               ;;
+       sun3 | sun3-*)
+               basic_machine=m68k-sun
+               ;;
+       sun4)
+               basic_machine=sparc-sun
+               ;;
+       sun386 | sun386i | roadrunner)
+               basic_machine=i386-sun
+               ;;
+       sv1)
+               basic_machine=sv1-cray
+               os=-unicos
+               ;;
+       symmetry)
+               basic_machine=i386-sequent
+               os=-dynix
+               ;;
+       t3e)
+               basic_machine=alphaev5-cray
+               os=-unicos
+               ;;
+       t90)
+               basic_machine=t90-cray
+               os=-unicos
+               ;;
+       tic54x | c54x*)
+               basic_machine=tic54x-unknown
+               os=-coff
+               ;;
+       tic55x | c55x*)
+               basic_machine=tic55x-unknown
+               os=-coff
+               ;;
+       tic6x | c6x*)
+               basic_machine=tic6x-unknown
+               os=-coff
+               ;;
+       tx39)
+               basic_machine=mipstx39-unknown
+               ;;
+       tx39el)
+               basic_machine=mipstx39el-unknown
+               ;;
+       toad1)
+               basic_machine=pdp10-xkl
+               os=-tops20
+               ;;
+       tower | tower-32)
+               basic_machine=m68k-ncr
+               ;;
+       udi29k)
+               basic_machine=a29k-amd
+               os=-udi
+               ;;
+       ultra3)
+               basic_machine=a29k-nyu
+               os=-sym1
+               ;;
+       v810 | necv810)
+               basic_machine=v810-nec
+               os=-none
+               ;;
+       vaxv)
+               basic_machine=vax-dec
+               os=-sysv
+               ;;
+       vms)
+               basic_machine=vax-dec
+               os=-vms
+               ;;
+       vpp*|vx|vx-*)
+               basic_machine=f301-fujitsu
+               ;;
+       vxworks960)
+               basic_machine=i960-wrs
+               os=-vxworks
+               ;;
+       vxworks68)
+               basic_machine=m68k-wrs
+               os=-vxworks
+               ;;
+       vxworks29k)
+               basic_machine=a29k-wrs
+               os=-vxworks
+               ;;
+       w65*)
+               basic_machine=w65-wdc
+               os=-none
+               ;;
+       w89k-*)
+               basic_machine=hppa1.1-winbond
+               os=-proelf
+               ;;
+       xps | xps100)
+               basic_machine=xps100-honeywell
+               ;;
+       ymp)
+               basic_machine=ymp-cray
+               os=-unicos
+               ;;
+       z8k-*-coff)
+               basic_machine=z8k-unknown
+               os=-sim
+               ;;
+       none)
+               basic_machine=none-none
+               os=-none
+               ;;
+
+# Here we handle the default manufacturer of certain CPU types.  It is in
+# some cases the only manufacturer, in others, it is the most popular.
+       w89k)
+               basic_machine=hppa1.1-winbond
+               ;;
+       op50n)
+               basic_machine=hppa1.1-oki
+               ;;
+       op60c)
+               basic_machine=hppa1.1-oki
+               ;;
+       romp)
+               basic_machine=romp-ibm
+               ;;
+       rs6000)
+               basic_machine=rs6000-ibm
+               ;;
+       vax)
+               basic_machine=vax-dec
+               ;;
+       pdp10)
+               # there are many clones, so DEC is not a safe bet
+               basic_machine=pdp10-unknown
+               ;;
+       pdp11)
+               basic_machine=pdp11-dec
+               ;;
+       we32k)
+               basic_machine=we32k-att
+               ;;
+       sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
+               basic_machine=sh-unknown
+               ;;
+       sh64)
+               basic_machine=sh64-unknown
+               ;;
+       sparc | sparcv8 | sparcv9 | sparcv9b)
+               basic_machine=sparc-sun
+               ;;
+       cydra)
+               basic_machine=cydra-cydrome
+               ;;
+       orion)
+               basic_machine=orion-highlevel
+               ;;
+       orion105)
+               basic_machine=clipper-highlevel
+               ;;
+       mac | mpw | mac-mpw)
+               basic_machine=m68k-apple
+               ;;
+       pmac | pmac-mpw)
+               basic_machine=powerpc-apple
+               ;;
+       *-unknown)
+               # Make sure to match an already-canonicalized machine name.
+               ;;
+       *)
+               echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+               exit 1
+               ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+       *-digital*)
+               basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+               ;;
+       *-commodore*)
+               basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+               ;;
+       *)
+               ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+        # First match some system type aliases
+        # that might get confused with valid system types.
+       # -solaris* is a basic system type, with this one exception.
+       -solaris1 | -solaris1.*)
+               os=`echo $os | sed -e 's|solaris1|sunos4|'`
+               ;;
+       -solaris)
+               os=-solaris2
+               ;;
+       -svr4*)
+               os=-sysv4
+               ;;
+       -unixware*)
+               os=-sysv4.2uw
+               ;;
+       -gnu/linux*)
+               os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+               ;;
+       # First accept the basic system types.
+       # The portable systems comes first.
+       # Each alternative MUST END IN A *, to match a version number.
+       # -sysv* is not here because it comes later, after sysvr4.
+       -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+             | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
+             | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+             | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+             | -aos* \
+             | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+             | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+             | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
+             | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+             | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+             | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+             | -chorusos* | -chorusrdb* \
+             | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+             | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
+             | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+             | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+             | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+             | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+             | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+             | -powermax* | -dnix* | -nx6 | -nx7 | -sei*)
+       # Remember, each alternative MUST END IN *, to match a version number.
+               ;;
+       -qnx*)
+               case $basic_machine in
+                   x86-* | i*86-*)
+                       ;;
+                   *)
+                       os=-nto$os
+                       ;;
+               esac
+               ;;
+       -nto-qnx*)
+               ;;
+       -nto*)
+               os=`echo $os | sed -e 's|nto|nto-qnx|'`
+               ;;
+       -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+             | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
+             | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+               ;;
+       -mac*)
+               os=`echo $os | sed -e 's|mac|macos|'`
+               ;;
+       -linux*)
+               os=`echo $os | sed -e 's|linux|linux-gnu|'`
+               ;;
+       -sunos5*)
+               os=`echo $os | sed -e 's|sunos5|solaris2|'`
+               ;;
+       -sunos6*)
+               os=`echo $os | sed -e 's|sunos6|solaris3|'`
+               ;;
+       -opened*)
+               os=-openedition
+               ;;
+       -wince*)
+               os=-wince
+               ;;
+       -osfrose*)
+               os=-osfrose
+               ;;
+       -osf*)
+               os=-osf
+               ;;
+       -utek*)
+               os=-bsd
+               ;;
+       -dynix*)
+               os=-bsd
+               ;;
+       -acis*)
+               os=-aos
+               ;;
+       -atheos*)
+               os=-atheos
+               ;;
+       -386bsd)
+               os=-bsd
+               ;;
+       -ctix* | -uts*)
+               os=-sysv
+               ;;
+       -nova*)
+               os=-rtmk-nova
+               ;;
+       -ns2 )
+               os=-nextstep2
+               ;;
+       -nsk*)
+               os=-nsk
+               ;;
+       # Preserve the version number of sinix5.
+       -sinix5.*)
+               os=`echo $os | sed -e 's|sinix|sysv|'`
+               ;;
+       -sinix*)
+               os=-sysv4
+               ;;
+       -triton*)
+               os=-sysv3
+               ;;
+       -oss*)
+               os=-sysv3
+               ;;
+       -svr4)
+               os=-sysv4
+               ;;
+       -svr3)
+               os=-sysv3
+               ;;
+       -sysvr4)
+               os=-sysv4
+               ;;
+       # This must come after -sysvr4.
+       -sysv*)
+               ;;
+       -ose*)
+               os=-ose
+               ;;
+       -es1800*)
+               os=-ose
+               ;;
+       -xenix)
+               os=-xenix
+               ;;
+       -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+               os=-mint
+               ;;
+       -aros*)
+               os=-aros
+               ;;
+       -kaos*)
+               os=-kaos
+               ;;
+       -none)
+               ;;
+       *)
+               # Get rid of the `-' at the beginning of $os.
+               os=`echo $os | sed 's/[^-]*-//'`
+               echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+               exit 1
+               ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system.  Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+       *-acorn)
+               os=-riscix1.2
+               ;;
+       arm*-rebel)
+               os=-linux
+               ;;
+       arm*-semi)
+               os=-aout
+               ;;
+       c4x-* | tic4x-*)
+               os=-coff
+               ;;
+       # This must come before the *-dec entry.
+       pdp10-*)
+               os=-tops20
+               ;;
+       pdp11-*)
+               os=-none
+               ;;
+       *-dec | vax-*)
+               os=-ultrix4.2
+               ;;
+       m68*-apollo)
+               os=-domain
+               ;;
+       i386-sun)
+               os=-sunos4.0.2
+               ;;
+       m68000-sun)
+               os=-sunos3
+               # This also exists in the configure program, but was not the
+               # default.
+               # os=-sunos4
+               ;;
+       m68*-cisco)
+               os=-aout
+               ;;
+       mips*-cisco)
+               os=-elf
+               ;;
+       mips*-*)
+               os=-elf
+               ;;
+       or32-*)
+               os=-coff
+               ;;
+       *-tti)  # must be before sparc entry or we get the wrong os.
+               os=-sysv3
+               ;;
+       sparc-* | *-sun)
+               os=-sunos4.1.1
+               ;;
+       *-be)
+               os=-beos
+               ;;
+       *-ibm)
+               os=-aix
+               ;;
+       *-wec)
+               os=-proelf
+               ;;
+       *-winbond)
+               os=-proelf
+               ;;
+       *-oki)
+               os=-proelf
+               ;;
+       *-hp)
+               os=-hpux
+               ;;
+       *-hitachi)
+               os=-hiux
+               ;;
+       i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+               os=-sysv
+               ;;
+       *-cbm)
+               os=-amigaos
+               ;;
+       *-dg)
+               os=-dgux
+               ;;
+       *-dolphin)
+               os=-sysv3
+               ;;
+       m68k-ccur)
+               os=-rtu
+               ;;
+       m88k-omron*)
+               os=-luna
+               ;;
+       *-next )
+               os=-nextstep
+               ;;
+       *-sequent)
+               os=-ptx
+               ;;
+       *-crds)
+               os=-unos
+               ;;
+       *-ns)
+               os=-genix
+               ;;
+       i370-*)
+               os=-mvs
+               ;;
+       *-next)
+               os=-nextstep3
+               ;;
+       *-gould)
+               os=-sysv
+               ;;
+       *-highlevel)
+               os=-bsd
+               ;;
+       *-encore)
+               os=-bsd
+               ;;
+       *-sgi)
+               os=-irix
+               ;;
+       *-siemens)
+               os=-sysv4
+               ;;
+       *-masscomp)
+               os=-rtu
+               ;;
+       f30[01]-fujitsu | f700-fujitsu)
+               os=-uxpv
+               ;;
+       *-rom68k)
+               os=-coff
+               ;;
+       *-*bug)
+               os=-coff
+               ;;
+       *-apple)
+               os=-macos
+               ;;
+       *-atari*)
+               os=-mint
+               ;;
+       *)
+               os=-none
+               ;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer.  We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+       *-unknown)
+               case $os in
+                       -riscix*)
+                               vendor=acorn
+                               ;;
+                       -sunos*)
+                               vendor=sun
+                               ;;
+                       -aix*)
+                               vendor=ibm
+                               ;;
+                       -beos*)
+                               vendor=be
+                               ;;
+                       -hpux*)
+                               vendor=hp
+                               ;;
+                       -mpeix*)
+                               vendor=hp
+                               ;;
+                       -hiux*)
+                               vendor=hitachi
+                               ;;
+                       -unos*)
+                               vendor=crds
+                               ;;
+                       -dgux*)
+                               vendor=dg
+                               ;;
+                       -luna*)
+                               vendor=omron
+                               ;;
+                       -genix*)
+                               vendor=ns
+                               ;;
+                       -mvs* | -opened*)
+                               vendor=ibm
+                               ;;
+                       -ptx*)
+                               vendor=sequent
+                               ;;
+                       -vxsim* | -vxworks* | -windiss*)
+                               vendor=wrs
+                               ;;
+                       -aux*)
+                               vendor=apple
+                               ;;
+                       -hms*)
+                               vendor=hitachi
+                               ;;
+                       -mpw* | -macos*)
+                               vendor=apple
+                               ;;
+                       -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+                               vendor=atari
+                               ;;
+                       -vos*)
+                               vendor=stratus
+                               ;;
+               esac
+               basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+               ;;
+esac
+
+echo $basic_machine$os
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/acaux/depcomp b/acaux/depcomp
new file mode 100755 (executable)
index 0000000..807b991
--- /dev/null
@@ -0,0 +1,423 @@
+#! /bin/sh
+
+# depcomp - compile a program generating dependencies as side-effects
+# Copyright 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+  echo "depcomp: Variables source, object and depmode must be set" 1>&2
+  exit 1
+fi
+# `libtool' can also be set to `yes' or `no'.
+
+if test -z "$depfile"; then
+   base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'`
+   dir=`echo "$object" | sed 's,/.*$,/,'`
+   if test "$dir" = "$object"; then
+      dir=
+   fi
+   # FIXME: should be _deps on DOS.
+   depfile="$dir.deps/$base"
+fi
+
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags.  We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write.  Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+  # HP compiler uses -M and no extra arg.
+  gccflag=-M
+  depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+   # This is just like dashmstdout with a different argument.
+   dashmflag=-xM
+   depmode=dashmstdout
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff.  Hmm.
+  "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  mv "$tmpdepfile" "$depfile"
+  ;;
+
+gcc)
+## There are various ways to get dependency output from gcc.  Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+##   up in a subdir.  Having to rename by hand is ugly.
+##   (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+##   -MM, not -M (despite what the docs say).
+## - Using -M directly means running the compiler twice (even worse
+##   than renaming).
+  if test -z "$gccflag"; then
+    gccflag=-MD,
+  fi
+  "$@" -Wp,"$gccflag$tmpdepfile"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+## The second -e expression handles DOS-style file names with drive letters.
+  sed -e 's/^[^:]*: / /' \
+      -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the `deleted header file' problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header).  We avoid this by adding
+## dummy dependencies for each header file.  Too bad gcc doesn't do
+## this for us directly.
+  tr ' ' '
+' < "$tmpdepfile" |
+## Some versions of gcc put a space before the `:'.  On the theory
+## that the space means something, we add a space to the output as
+## well.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+hp)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
+sgi)
+  if test "$libtool" = yes; then
+    "$@" "-Wp,-MDupdate,$tmpdepfile"
+  else
+    "$@" -MDupdate "$tmpdepfile"
+  fi
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+
+  if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
+    echo "$object : \\" > "$depfile"
+
+    # Clip off the initial element (the dependent).  Don't try to be
+    # clever and replace this with sed code, as IRIX sed won't handle
+    # lines with more than a fixed number of characters (4096 in
+    # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
+    # the IRIX cc adds comments like `#:fec' to the end of the
+    # dependency line.
+    tr ' ' '
+' < "$tmpdepfile" \
+    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
+    tr '
+' ' ' >> $depfile
+    echo >> $depfile
+
+    # The second pass generates a dummy entry for each header file.
+    tr ' ' '
+' < "$tmpdepfile" \
+   | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+   >> $depfile
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "include basename.Plo" scheme.
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile"
+  ;;
+
+aix)
+  # The C for AIX Compiler uses -M and outputs the dependencies
+  # in a .u file.  This file always lives in the current directory.
+  # Also, the AIX compiler puts `$object:' at the start of each line;
+  # $object doesn't have directory information.
+  stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'`
+  tmpdepfile="$stripped.u"
+  outname="$stripped.o"
+  if test "$libtool" = yes; then
+    "$@" -Wc,-M
+  else
+    "$@" -M
+  fi
+
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+
+  if test -f "$tmpdepfile"; then
+    # Each line is of the form `foo.o: dependent.h'.
+    # Do two passes, one to just change these to
+    # `$object: dependent.h' and one to simply `dependent.h:'.
+    sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
+    sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "include basename.Plo" scheme.
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile"
+  ;;
+
+tru64)
+   # The Tru64 compiler uses -MD to generate dependencies as a side
+   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+   # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+   # dependencies in `foo.d' instead, so we check for that too.
+   # Subdirectories are respected.
+   dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+   test "x$dir" = "x$object" && dir=
+   base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+
+   if test "$libtool" = yes; then
+      tmpdepfile1="$dir.libs/$base.lo.d"
+      tmpdepfile2="$dir.libs/$base.d"
+      "$@" -Wc,-MD
+   else
+      tmpdepfile1="$dir$base.o.d"
+      tmpdepfile2="$dir$base.d"
+      "$@" -MD
+   fi
+
+   stat=$?
+   if test $stat -eq 0; then :
+   else
+      rm -f "$tmpdepfile1" "$tmpdepfile2"
+      exit $stat
+   fi
+
+   if test -f "$tmpdepfile1"; then
+      tmpdepfile="$tmpdepfile1"
+   else
+      tmpdepfile="$tmpdepfile2"
+   fi
+   if test -f "$tmpdepfile"; then
+      sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+      # That's a space and a tab in the [].
+      sed -e 's,^.*\.[a-z]*:[  ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+   else
+      echo "#dummy" > "$depfile"
+   fi
+   rm -f "$tmpdepfile"
+   ;;
+
+#nosideeffect)
+  # This comment above is used by automake to tell side-effect
+  # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the proprocessed file to stdout, regardless of -o.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test $1 != '--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove `-o $object'.  We will use -o /dev/null later,
+  # however we can't do the remplacement now because
+  # `-o $object' might simply not be used
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
+      ;;
+    esac
+  done
+
+  test -z "$dashmflag" && dashmflag=-M
+  "$@" -o /dev/null $dashmflag | sed 's:^[^:]*\:[      ]*:'"$object"'\: :' > "$tmpdepfile"
+  rm -f "$depfile"
+  cat < "$tmpdepfile" > "$depfile"
+  tr ' ' '
+' < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+dashXmstdout)
+  # This case only exists to satisfy depend.m4.  It is never actually
+  # run, as this mode is specially recognized in the preamble.
+  exit 1
+  ;;
+
+makedepend)
+  "$@" || exit $?
+  # X makedepend
+  shift
+  cleared=no
+  for arg in "$@"; do
+    case $cleared in
+    no)
+      set ""; shift
+      cleared=yes ;;
+    esac
+    case "$arg" in
+    -D*|-I*)
+      set fnord "$@" "$arg"; shift ;;
+    -*)
+      ;;
+    *)
+      set fnord "$@" "$arg"; shift ;;
+    esac
+  done
+  obj_suffix="`echo $object | sed 's/^.*\././'`"
+  touch "$tmpdepfile"
+  ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+  rm -f "$depfile"
+  cat < "$tmpdepfile" > "$depfile"
+  sed '1,2d' "$tmpdepfile" | tr ' ' '
+' | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile" "$tmpdepfile".bak
+  ;;
+
+cpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the proprocessed file to stdout.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test $1 != '--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove `-o $object'.
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
+      ;;
+    esac
+  done
+
+  "$@" -E |
+    sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+    sed '$ s: \\$::' > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  cat < "$tmpdepfile" >> "$depfile"
+  sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvisualcpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the proprocessed file to stdout, regardless of -o,
+  # because we must use -o when running libtool.
+  "$@" || exit $?
+  IFS=" "
+  for arg
+  do
+    case "$arg" in
+    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+       set fnord "$@"
+       shift
+       shift
+       ;;
+    *)
+       set fnord "$@" "$arg"
+       shift
+       shift
+       ;;
+    esac
+  done
+  "$@" -E |
+  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::   \1 \\:p' >> "$depfile"
+  echo "       " >> "$depfile"
+  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+none)
+  exec "$@"
+  ;;
+
+*)
+  echo "Unknown depmode $depmode" 1>&2
+  exit 1
+  ;;
+esac
+
+exit 0
diff --git a/acaux/install-sh b/acaux/install-sh
new file mode 100755 (executable)
index 0000000..11870f1
--- /dev/null
@@ -0,0 +1,251 @@
+#!/bin/sh
+#
+# install - install a program, script, or datafile
+# This comes from X11R5 (mit/util/scripts/install.sh).
+#
+# Copyright 1991 by the Massachusetts Institute of Technology
+#
+# Permission to use, copy, modify, distribute, and sell this software and its
+# documentation for any purpose is hereby granted without fee, provided that
+# the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of M.I.T. not be used in advertising or
+# publicity pertaining to distribution of the software without specific,
+# written prior permission.  M.I.T. makes no representations about the
+# suitability of this software for any purpose.  It is provided "as is"
+# without express or implied warranty.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.  It can only install one file at a time, a restriction
+# shared with many OS's install programs.
+
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+transformbasename=""
+transform_arg=""
+instcmd="$mvprog"
+chmodcmd="$chmodprog 0755"
+chowncmd=""
+chgrpcmd=""
+stripcmd=""
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=""
+dst=""
+dir_arg=""
+
+while [ x"$1" != x ]; do
+    case $1 in
+       -c) instcmd="$cpprog"
+           shift
+           continue;;
+
+       -d) dir_arg=true
+           shift
+           continue;;
+
+       -m) chmodcmd="$chmodprog $2"
+           shift
+           shift
+           continue;;
+
+       -o) chowncmd="$chownprog $2"
+           shift
+           shift
+           continue;;
+
+       -g) chgrpcmd="$chgrpprog $2"
+           shift
+           shift
+           continue;;
+
+       -s) stripcmd="$stripprog"
+           shift
+           continue;;
+
+       -t=*) transformarg=`echo $1 | sed 's/-t=//'`
+           shift
+           continue;;
+
+       -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
+           shift
+           continue;;
+
+       *)  if [ x"$src" = x ]
+           then
+               src=$1
+           else
+               # this colon is to work around a 386BSD /bin/sh bug
+               :
+               dst=$1
+           fi
+           shift
+           continue;;
+    esac
+done
+
+if [ x"$src" = x ]
+then
+       echo "install:  no input file specified"
+       exit 1
+else
+       :
+fi
+
+if [ x"$dir_arg" != x ]; then
+       dst=$src
+       src=""
+       
+       if [ -d $dst ]; then
+               instcmd=:
+               chmodcmd=""
+       else
+               instcmd=$mkdirprog
+       fi
+else
+
+# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
+# might cause directories to be created, which would be especially bad 
+# if $src (and thus $dsttmp) contains '*'.
+
+       if [ -f "$src" ] || [ -d "$src" ]
+       then
+               :
+       else
+               echo "install:  $src does not exist"
+               exit 1
+       fi
+       
+       if [ x"$dst" = x ]
+       then
+               echo "install:  no destination specified"
+               exit 1
+       else
+               :
+       fi
+
+# If destination is a directory, append the input filename; if your system
+# does not like double slashes in filenames, you may need to add some logic
+
+       if [ -d $dst ]
+       then
+               dst="$dst"/`basename $src`
+       else
+               :
+       fi
+fi
+
+## this sed command emulates the dirname command
+dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+
+# Make sure that the destination directory exists.
+#  this part is taken from Noah Friedman's mkinstalldirs script
+
+# Skip lots of stat calls in the usual case.
+if [ ! -d "$dstdir" ]; then
+defaultIFS='
+       '
+IFS="${IFS-${defaultIFS}}"
+
+oIFS="${IFS}"
+# Some sh's can't handle IFS=/ for some reason.
+IFS='%'
+set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
+IFS="${oIFS}"
+
+pathcomp=''
+
+while [ $# -ne 0 ] ; do
+       pathcomp="${pathcomp}${1}"
+       shift
+
+       if [ ! -d "${pathcomp}" ] ;
+        then
+               $mkdirprog "${pathcomp}"
+       else
+               :
+       fi
+
+       pathcomp="${pathcomp}/"
+done
+fi
+
+if [ x"$dir_arg" != x ]
+then
+       $doit $instcmd $dst &&
+
+       if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi &&
+       if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi &&
+       if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi &&
+       if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; fi
+else
+
+# If we're going to rename the final executable, determine the name now.
+
+       if [ x"$transformarg" = x ] 
+       then
+               dstfile=`basename $dst`
+       else
+               dstfile=`basename $dst $transformbasename | 
+                       sed $transformarg`$transformbasename
+       fi
+
+# don't allow the sed command to completely eliminate the filename
+
+       if [ x"$dstfile" = x ] 
+       then
+               dstfile=`basename $dst`
+       else
+               :
+       fi
+
+# Make a temp file name in the proper directory.
+
+       dsttmp=$dstdir/#inst.$$#
+
+# Move or copy the file name to the temp name
+
+       $doit $instcmd $src $dsttmp &&
+
+       trap "rm -f ${dsttmp}" 0 &&
+
+# and set any options; do chmod last to preserve setuid bits
+
+# If any of these fail, we abort the whole thing.  If we want to
+# ignore errors from any of these, just make sure not to ignore
+# errors from the above "$doit $instcmd $src $dsttmp" command.
+
+       if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else :;fi &&
+       if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else :;fi &&
+       if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else :;fi &&
+       if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi &&
+
+# Now rename the file to the real destination.
+
+       $doit $rmcmd -f $dstdir/$dstfile &&
+       $doit $mvcmd $dsttmp $dstdir/$dstfile 
+
+fi &&
+
+
+exit 0
diff --git a/acaux/ltmain.sh b/acaux/ltmain.sh
new file mode 100755 (executable)
index 0000000..0223495
--- /dev/null
@@ -0,0 +1,6911 @@
+# ltmain.sh - Provide generalized library-building support services.
+# NOTE: Changing this file will not affect anything until you rerun configure.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+basename="s,^.*/,,g"
+
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath="$0"
+
+# The name of this program:
+progname=`echo "$progpath" | $SED $basename`
+modename="$progname"
+
+# Global variables:
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+
+PROGRAM=ltmain.sh
+PACKAGE=libtool
+VERSION=1.5.22
+TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)"
+
+# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+
+# Check that we have a working $echo.
+if test "X$1" = X--no-reexec; then
+  # Discard the --no-reexec flag, and continue.
+  shift
+elif test "X$1" = X--fallback-echo; then
+  # Avoid inline document here, it may be left over
+  :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
+  # Yippee, $echo works!
+  :
+else
+  # Restart under the correct shell, and then maybe $echo will work.
+  exec $SHELL "$progpath" --no-reexec ${1+"$@"}
+fi
+
+if test "X$1" = X--fallback-echo; then
+  # used as fallback echo
+  shift
+  cat <<EOF
+$*
+EOF
+  exit $EXIT_SUCCESS
+fi
+
+default_mode=
+help="Try \`$progname --help' for more information."
+magic="%%%MAGIC variable%%%"
+mkdir="mkdir"
+mv="mv -f"
+rm="rm -f"
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed="${SED}"' -e 1s/^X//'
+sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+  SP2NL='tr \040 \012'
+  NL2SP='tr \015\012 \040\040'
+  ;;
+ *) # EBCDIC based system
+  SP2NL='tr \100 \n'
+  NL2SP='tr \r\n \100\100'
+  ;;
+esac
+
+# NLS nuisances.
+# Only set LANG and LC_ALL to C if already set.
+# These must not be set unconditionally because not all systems understand
+# e.g. LANG=C (notably SCO).
+# We save the old values to restore during execute mode.
+for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+do
+  eval "if test \"\${$lt_var+set}\" = set; then
+         save_$lt_var=\$$lt_var
+         $lt_var=C
+         export $lt_var
+       fi"
+done
+
+# Make sure IFS has a sensible default
+lt_nl='
+'
+IFS="  $lt_nl"
+
+if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+  $echo "$modename: not configured to build any kind of library" 1>&2
+  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
+  exit $EXIT_FAILURE
+fi
+
+# Global variables.
+mode=$default_mode
+nonopt=
+prev=
+prevopt=
+run=
+show="$echo"
+show_help=
+execute_dlfiles=
+duplicate_deps=no
+preserve_args=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+extracted_archives=
+extracted_serial=0
+
+#####################################
+# Shell function definitions:
+# This seems to be the best place for them
+
+# func_mktempdir [string]
+# Make a temporary directory that won't clash with other running
+# libtool processes, and avoids race conditions if possible.  If
+# given, STRING is the basename for that directory.
+func_mktempdir ()
+{
+    my_template="${TMPDIR-/tmp}/${1-$progname}"
+
+    if test "$run" = ":"; then
+      # Return a directory name, but don't create it in dry-run mode
+      my_tmpdir="${my_template}-$$"
+    else
+
+      # If mktemp works, use that first and foremost
+      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
+
+      if test ! -d "$my_tmpdir"; then
+       # Failing that, at least try and use $RANDOM to avoid a race
+       my_tmpdir="${my_template}-${RANDOM-0}$$"
+
+       save_mktempdir_umask=`umask`
+       umask 0077
+       $mkdir "$my_tmpdir"
+       umask $save_mktempdir_umask
+      fi
+
+      # If we're not in dry-run mode, bomb out on failure
+      test -d "$my_tmpdir" || {
+        $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
+       exit $EXIT_FAILURE
+      }
+    fi
+
+    $echo "X$my_tmpdir" | $Xsed
+}
+
+
+# func_win32_libid arg
+# return the library type of file 'arg'
+#
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+func_win32_libid ()
+{
+  win32_libid_type="unknown"
+  win32_fileres=`file -L $1 2>/dev/null`
+  case $win32_fileres in
+  *ar\ archive\ import\ library*) # definitely import
+    win32_libid_type="x86 archive import"
+    ;;
+  *ar\ archive*) # could be an import, or static
+    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
+      $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
+      win32_nmres=`eval $NM -f posix -A $1 | \
+       $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'`
+      case $win32_nmres in
+      import*)  win32_libid_type="x86 archive import";;
+      *)        win32_libid_type="x86 archive static";;
+      esac
+    fi
+    ;;
+  *DLL*)
+    win32_libid_type="x86 DLL"
+    ;;
+  *executable*) # but shell scripts are "executable" too...
+    case $win32_fileres in
+    *MS\ Windows\ PE\ Intel*)
+      win32_libid_type="x86 DLL"
+      ;;
+    esac
+    ;;
+  esac
+  $echo $win32_libid_type
+}
+
+
+# func_infer_tag arg
+# Infer tagged configuration to use if any are available and
+# if one wasn't chosen via the "--tag" command line option.
+# Only attempt this if the compiler in the base compile
+# command doesn't match the default compiler.
+# arg is usually of the form 'gcc ...'
+func_infer_tag ()
+{
+    if test -n "$available_tags" && test -z "$tagname"; then
+      CC_quoted=
+      for arg in $CC; do
+       case $arg in
+         *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+         arg="\"$arg\""
+         ;;
+       esac
+       CC_quoted="$CC_quoted $arg"
+      done
+      case $@ in
+      # Blanks in the command may have been stripped by the calling shell,
+      # but not from the CC environment variable when configure was run.
+      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
+      # Blanks at the start of $base_compile will cause this to fail
+      # if we don't check for them as well.
+      *)
+       for z in $available_tags; do
+         if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
+           # Evaluate the configuration.
+           eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+           CC_quoted=
+           for arg in $CC; do
+           # Double-quote args containing other shell metacharacters.
+           case $arg in
+             *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
+             arg="\"$arg\""
+             ;;
+           esac
+           CC_quoted="$CC_quoted $arg"
+         done
+           case "$@ " in
+             " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
+             # The compiler in the base compile command matches
+             # the one in the tagged configuration.
+             # Assume this is the tagged configuration we want.
+             tagname=$z
+             break
+             ;;
+           esac
+         fi
+       done
+       # If $tagname still isn't set, then no tagged configuration
+       # was found and let the user know that the "--tag" command
+       # line option must be used.
+       if test -z "$tagname"; then
+         $echo "$modename: unable to infer tagged configuration"
+         $echo "$modename: specify a tag with \`--tag'" 1>&2
+         exit $EXIT_FAILURE
+#        else
+#          $echo "$modename: using $tagname tagged configuration"
+       fi
+       ;;
+      esac
+    fi
+}
+
+
+# func_extract_an_archive dir oldlib
+func_extract_an_archive ()
+{
+    f_ex_an_ar_dir="$1"; shift
+    f_ex_an_ar_oldlib="$1"
+
+    $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
+    $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
+    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
+     :
+    else
+      $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
+      exit $EXIT_FAILURE
+    fi
+}
+
+# func_extract_archives gentop oldlib ...
+func_extract_archives ()
+{
+    my_gentop="$1"; shift
+    my_oldlibs=${1+"$@"}
+    my_oldobjs=""
+    my_xlib=""
+    my_xabs=""
+    my_xdir=""
+    my_status=""
+
+    $show "${rm}r $my_gentop"
+    $run ${rm}r "$my_gentop"
+    $show "$mkdir $my_gentop"
+    $run $mkdir "$my_gentop"
+    my_status=$?
+    if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
+      exit $my_status
+    fi
+
+    for my_xlib in $my_oldlibs; do
+      # Extract the objects.
+      case $my_xlib in
+       [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+       *) my_xabs=`pwd`"/$my_xlib" ;;
+      esac
+      my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
+      my_xlib_u=$my_xlib
+      while :; do
+        case " $extracted_archives " in
+       *" $my_xlib_u "*)
+         extracted_serial=`expr $extracted_serial + 1`
+         my_xlib_u=lt$extracted_serial-$my_xlib ;;
+       *) break ;;
+       esac
+      done
+      extracted_archives="$extracted_archives $my_xlib_u"
+      my_xdir="$my_gentop/$my_xlib_u"
+
+      $show "${rm}r $my_xdir"
+      $run ${rm}r "$my_xdir"
+      $show "$mkdir $my_xdir"
+      $run $mkdir "$my_xdir"
+      exit_status=$?
+      if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
+       exit $exit_status
+      fi
+      case $host in
+      *-darwin*)
+       $show "Extracting $my_xabs"
+       # Do not bother doing anything if just a dry run
+       if test -z "$run"; then
+         darwin_orig_dir=`pwd`
+         cd $my_xdir || exit $?
+         darwin_archive=$my_xabs
+         darwin_curdir=`pwd`
+         darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
+         darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
+         if test -n "$darwin_arches"; then 
+           darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
+           darwin_arch=
+           $show "$darwin_base_archive has multiple architectures $darwin_arches"
+           for darwin_arch in  $darwin_arches ; do
+             mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+             lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
+             cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+             func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+             cd "$darwin_curdir"
+             $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
+           done # $darwin_arches
+      ## Okay now we have a bunch of thin objects, gotta fatten them up :)
+           darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
+           darwin_file=
+           darwin_files=
+           for darwin_file in $darwin_filelist; do
+             darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
+             lipo -create -output "$darwin_file" $darwin_files
+           done # $darwin_filelist
+           ${rm}r unfat-$$
+           cd "$darwin_orig_dir"
+         else
+           cd "$darwin_orig_dir"
+           func_extract_an_archive "$my_xdir" "$my_xabs"
+         fi # $darwin_arches
+       fi # $run
+       ;;
+      *)
+        func_extract_an_archive "$my_xdir" "$my_xabs"
+        ;;
+      esac
+      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
+    done
+    func_extract_archives_result="$my_oldobjs"
+}
+# End of Shell function definitions
+#####################################
+
+# Darwin sucks
+eval std_shrext=\"$shrext_cmds\"
+
+disable_libs=no
+
+# Parse our command line options once, thoroughly.
+while test "$#" -gt 0
+do
+  arg="$1"
+  shift
+
+  case $arg in
+  -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
+  *) optarg= ;;
+  esac
+
+  # If the previous option needs an argument, assign it.
+  if test -n "$prev"; then
+    case $prev in
+    execute_dlfiles)
+      execute_dlfiles="$execute_dlfiles $arg"
+      ;;
+    tag)
+      tagname="$arg"
+      preserve_args="${preserve_args}=$arg"
+
+      # Check whether tagname contains only valid characters
+      case $tagname in
+      *[!-_A-Za-z0-9,/]*)
+       $echo "$progname: invalid tag name: $tagname" 1>&2
+       exit $EXIT_FAILURE
+       ;;
+      esac
+
+      case $tagname in
+      CC)
+       # Don't test for the "default" C tag, as we know, it's there, but
+       # not specially marked.
+       ;;
+      *)
+       if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
+         taglist="$taglist $tagname"
+         # Evaluate the configuration.
+         eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
+       else
+         $echo "$progname: ignoring unknown tag $tagname" 1>&2
+       fi
+       ;;
+      esac
+      ;;
+    *)
+      eval "$prev=\$arg"
+      ;;
+    esac
+
+    prev=
+    prevopt=
+    continue
+  fi
+
+  # Have we seen a non-optional argument yet?
+  case $arg in
+  --help)
+    show_help=yes
+    ;;
+
+  --version)
+    $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
+    $echo
+    $echo "Copyright (C) 2005  Free Software Foundation, Inc."
+    $echo "This is free software; see the source for copying conditions.  There is NO"
+    $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+    exit $?
+    ;;
+
+  --config)
+    ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
+    # Now print the configurations for the tags.
+    for tagname in $taglist; do
+      ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
+    done
+    exit $?
+    ;;
+
+  --debug)
+    $echo "$progname: enabling shell trace mode"
+    set -x
+    preserve_args="$preserve_args $arg"
+    ;;
+
+  --dry-run | -n)
+    run=:
+    ;;
+
+  --features)
+    $echo "host: $host"
+    if test "$build_libtool_libs" = yes; then
+      $echo "enable shared libraries"
+    else
+      $echo "disable shared libraries"
+    fi
+    if test "$build_old_libs" = yes; then
+      $echo "enable static libraries"
+    else
+      $echo "disable static libraries"
+    fi
+    exit $?
+    ;;
+
+  --finish) mode="finish" ;;
+
+  --mode) prevopt="--mode" prev=mode ;;
+  --mode=*) mode="$optarg" ;;
+
+  --preserve-dup-deps) duplicate_deps="yes" ;;
+
+  --quiet | --silent)
+    show=:
+    preserve_args="$preserve_args $arg"
+    ;;
+
+  --tag)
+    prevopt="--tag"
+    prev=tag
+    preserve_args="$preserve_args --tag"
+    ;;
+  --tag=*)
+    set tag "$optarg" ${1+"$@"}
+    shift
+    prev=tag
+    preserve_args="$preserve_args --tag"
+    ;;
+
+  -dlopen)
+    prevopt="-dlopen"
+    prev=execute_dlfiles
+    ;;
+
+  -*)
+    $echo "$modename: unrecognized option \`$arg'" 1>&2
+    $echo "$help" 1>&2
+    exit $EXIT_FAILURE
+    ;;
+
+  *)
+    nonopt="$arg"
+    break
+    ;;
+  esac
+done
+
+if test -n "$prevopt"; then
+  $echo "$modename: option \`$prevopt' requires an argument" 1>&2
+  $echo "$help" 1>&2
+  exit $EXIT_FAILURE
+fi
+
+case $disable_libs in
+no) 
+  ;;
+shared)
+  build_libtool_libs=no
+  build_old_libs=yes
+  ;;
+static)
+  build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
+  ;;
+esac
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end.  This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+if test -z "$show_help"; then
+
+  # Infer the operation mode.
+  if test -z "$mode"; then
+    $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
+    $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
+    case $nonopt in
+    *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
+      mode=link
+      for arg
+      do
+       case $arg in
+       -c)
+          mode=compile
+          break
+          ;;
+       esac
+      done
+      ;;
+    *db | *dbx | *strace | *truss)
+      mode=execute
+      ;;
+    *install*|cp|mv)
+      mode=install
+      ;;
+    *rm)
+      mode=uninstall
+      ;;
+    *)
+      # If we have no mode, but dlfiles were specified, then do execute mode.
+      test -n "$execute_dlfiles" && mode=execute
+
+      # Just use the default operation mode.
+      if test -z "$mode"; then
+       if test -n "$nonopt"; then
+         $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
+       else
+         $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
+       fi
+      fi
+      ;;
+    esac
+  fi
+
+  # Only execute mode is allowed to have -dlopen flags.
+  if test -n "$execute_dlfiles" && test "$mode" != execute; then
+    $echo "$modename: unrecognized option \`-dlopen'" 1>&2
+    $echo "$help" 1>&2
+    exit $EXIT_FAILURE
+  fi
+
+  # Change the help message to a mode-specific one.
+  generic_help="$help"
+  help="Try \`$modename --help --mode=$mode' for more information."
+
+  # These modes are in order of execution frequency so that they run quickly.
+  case $mode in
+  # libtool compile mode
+  compile)
+    modename="$modename: compile"
+    # Get the compilation command and the source file.
+    base_compile=
+    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
+    suppress_opt=yes
+    suppress_output=
+    arg_mode=normal
+    libobj=
+    later=
+
+    for arg
+    do
+      case $arg_mode in
+      arg  )
+       # do not "continue".  Instead, add this to base_compile
+       lastarg="$arg"
+       arg_mode=normal
+       ;;
+
+      target )
+       libobj="$arg"
+       arg_mode=normal
+       continue
+       ;;
+
+      normal )
+       # Accept any command-line options.
+       case $arg in
+       -o)
+         if test -n "$libobj" ; then
+           $echo "$modename: you cannot specify \`-o' more than once" 1>&2
+           exit $EXIT_FAILURE
+         fi
+         arg_mode=target
+         continue
+         ;;
+
+       -static | -prefer-pic | -prefer-non-pic)
+         later="$later $arg"
+         continue
+         ;;
+
+       -no-suppress)
+         suppress_opt=no
+         continue
+         ;;
+
+       -Xcompiler)
+         arg_mode=arg  #  the next one goes into the "base_compile" arg list
+         continue      #  The current "srcfile" will either be retained or
+         ;;            #  replaced later.  I would guess that would be a bug.
+
+       -Wc,*)
+         args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
+         lastarg=
+         save_ifs="$IFS"; IFS=','
+         for arg in $args; do
+           IFS="$save_ifs"
+
+           # Double-quote args containing other shell metacharacters.
+           # Many Bourne shells cannot handle close brackets correctly
+           # in scan sets, so we specify it separately.
+           case $arg in
+             *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
+             arg="\"$arg\""
+             ;;
+           esac
+           lastarg="$lastarg $arg"
+         done
+         IFS="$save_ifs"
+         lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
+
+         # Add the arguments to base_compile.
+         base_compile="$base_compile $lastarg"
+         continue
+         ;;
+
+       * )
+         # Accept the current argument as the source file.
+         # The previous "srcfile" becomes the current argument.
+         #
+         lastarg="$srcfile"
+         srcfile="$arg"
+         ;;
+       esac  #  case $arg
+       ;;
+      esac    #  case $arg_mode
+
+      # Aesthetically quote the previous argument.
+      lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
+
+      case $lastarg in
+      # Double-quote args containing other shell metacharacters.
+      # Many Bourne shells cannot handle close brackets correctly
+      # in scan sets, and some SunOS ksh mistreat backslash-escaping
+      # in scan sets (worked around with variable expansion),
+      # and furthermore cannot handle '|' '&' '(' ')' in scan sets 
+      # at all, so we specify them separately.
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*|"")
+       lastarg="\"$lastarg\""
+       ;;
+      esac
+
+      base_compile="$base_compile $lastarg"
+    done # for arg
+
+    case $arg_mode in
+    arg)
+      $echo "$modename: you must specify an argument for -Xcompile"
+      exit $EXIT_FAILURE
+      ;;
+    target)
+      $echo "$modename: you must specify a target with \`-o'" 1>&2
+      exit $EXIT_FAILURE
+      ;;
+    *)
+      # Get the name of the library object.
+      [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
+      ;;
+    esac
+
+    # Recognize several different file suffixes.
+    # If the user specifies -o file.o, it is replaced with file.lo
+    xform='[cCFSifmso]'
+    case $libobj in
+    *.ada) xform=ada ;;
+    *.adb) xform=adb ;;
+    *.ads) xform=ads ;;
+    *.asm) xform=asm ;;
+    *.c++) xform=c++ ;;
+    *.cc) xform=cc ;;
+    *.ii) xform=ii ;;
+    *.class) xform=class ;;
+    *.cpp) xform=cpp ;;
+    *.cxx) xform=cxx ;;
+    *.f90) xform=f90 ;;
+    *.for) xform=for ;;
+    *.java) xform=java ;;
+    *.obj) xform=obj ;;
+    esac
+
+    libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
+
+    case $libobj in
+    *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
+    *)
+      $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
+      exit $EXIT_FAILURE
+      ;;
+    esac
+
+    func_infer_tag $base_compile
+
+    for arg in $later; do
+      case $arg in
+      -static)
+       build_old_libs=yes
+       continue
+       ;;
+
+      -prefer-pic)
+       pic_mode=yes
+       continue
+       ;;
+
+      -prefer-non-pic)
+       pic_mode=no
+       continue
+       ;;
+      esac
+    done
+
+    qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
+    case $qlibobj in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*|"")
+       qlibobj="\"$qlibobj\"" ;;
+    esac
+    test "X$libobj" != "X$qlibobj" \
+       && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"'  &()|`$[]' \
+       && $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
+    objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
+    xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
+    if test "X$xdir" = "X$obj"; then
+      xdir=
+    else
+      xdir=$xdir/
+    fi
+    lobj=${xdir}$objdir/$objname
+
+    if test -z "$base_compile"; then
+      $echo "$modename: you must specify a compilation command" 1>&2
+      $echo "$help" 1>&2
+      exit $EXIT_FAILURE
+    fi
+
+    # Delete any leftover library objects.
+    if test "$build_old_libs" = yes; then
+      removelist="$obj $lobj $libobj ${libobj}T"
+    else
+      removelist="$lobj $libobj ${libobj}T"
+    fi
+
+    $run $rm $removelist
+    trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
+
+    # On Cygwin there's no "real" PIC flag so we must build both object types
+    case $host_os in
+    cygwin* | mingw* | pw32* | os2*)
+      pic_mode=default
+      ;;
+    esac
+    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
+      # non-PIC code in shared libraries is not supported
+      pic_mode=default
+    fi
+
+    # Calculate the filename of the output object if compiler does
+    # not support -o with -c
+    if test "$compiler_c_o" = no; then
+      output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
+      lockfile="$output_obj.lock"
+      removelist="$removelist $output_obj $lockfile"
+      trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
+    else
+      output_obj=
+      need_locks=no
+      lockfile=
+    fi
+
+    # Lock this critical section if it is needed
+    # We use this script file to make the link, it avoids creating a new file
+    if test "$need_locks" = yes; then
+      until $run ln "$progpath" "$lockfile" 2>/dev/null; do
+       $show "Waiting for $lockfile to be removed"
+       sleep 2
+      done
+    elif test "$need_locks" = warn; then
+      if test -f "$lockfile"; then
+       $echo "\
+*** ERROR, $lockfile exists and contains:
+`cat $lockfile 2>/dev/null`
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+       $run $rm $removelist
+       exit $EXIT_FAILURE
+      fi
+      $echo "$srcfile" > "$lockfile"
+    fi
+
+    if test -n "$fix_srcfile_path"; then
+      eval srcfile=\"$fix_srcfile_path\"
+    fi
+    qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
+    case $qsrcfile in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*|"")
+      qsrcfile="\"$qsrcfile\"" ;;
+    esac
+
+    $run $rm "$libobj" "${libobj}T"
+
+    # Create a libtool object file (analogous to a ".la" file),
+    # but don't create it if we're doing a dry run.
+    test -z "$run" && cat > ${libobj}T <<EOF
+# $libobj - a libtool object file
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+EOF
+
+    # Only build a PIC object if we are building libtool libraries.
+    if test "$build_libtool_libs" = yes; then
+      # Without this assignment, base_compile gets emptied.
+      fbsd_hideous_sh_bug=$base_compile
+
+      if test "$pic_mode" != no; then
+       command="$base_compile $qsrcfile $pic_flag"
+      else
+       # Don't build PIC code
+       command="$base_compile $qsrcfile"
+      fi
+
+      if test ! -d "${xdir}$objdir"; then
+       $show "$mkdir ${xdir}$objdir"
+       $run $mkdir ${xdir}$objdir
+       exit_status=$?
+       if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
+         exit $exit_status
+       fi
+      fi
+
+      if test -z "$output_obj"; then
+       # Place PIC objects in $objdir
+       command="$command -o $lobj"
+      fi
+
+      $run $rm "$lobj" "$output_obj"
+
+      $show "$command"
+      if $run eval "$command"; then :
+      else
+       test -n "$output_obj" && $run $rm $removelist
+       exit $EXIT_FAILURE
+      fi
+
+      if test "$need_locks" = warn &&
+        test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+       $echo "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+       $run $rm $removelist
+       exit $EXIT_FAILURE
+      fi
+
+      # Just move the object if needed, then go on to compile the next one
+      if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
+       $show "$mv $output_obj $lobj"
+       if $run $mv $output_obj $lobj; then :
+       else
+         error=$?
+         $run $rm $removelist
+         exit $error
+       fi
+      fi
+
+      # Append the name of the PIC object to the libtool object file.
+      test -z "$run" && cat >> ${libobj}T <<EOF
+pic_object='$objdir/$objname'
+
+EOF
+
+      # Allow error messages only from the first compilation.
+      if test "$suppress_opt" = yes; then
+        suppress_output=' >/dev/null 2>&1'
+      fi
+    else
+      # No PIC object so indicate it doesn't exist in the libtool
+      # object file.
+      test -z "$run" && cat >> ${libobj}T <<EOF
+pic_object=none
+
+EOF
+    fi
+
+    # Only build a position-dependent object if we build old libraries.
+    if test "$build_old_libs" = yes; then
+      if test "$pic_mode" != yes; then
+       # Don't build PIC code
+       command="$base_compile $qsrcfile"
+      else
+       command="$base_compile $qsrcfile $pic_flag"
+      fi
+      if test "$compiler_c_o" = yes; then
+       command="$command -o $obj"
+      fi
+
+      # Suppress compiler output if we already did a PIC compilation.
+      command="$command$suppress_output"
+      $run $rm "$obj" "$output_obj"
+      $show "$command"
+      if $run eval "$command"; then :
+      else
+       $run $rm $removelist
+       exit $EXIT_FAILURE
+      fi
+
+      if test "$need_locks" = warn &&
+        test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+       $echo "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+       $run $rm $removelist
+       exit $EXIT_FAILURE
+      fi
+
+      # Just move the object if needed
+      if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
+       $show "$mv $output_obj $obj"
+       if $run $mv $output_obj $obj; then :
+       else
+         error=$?
+         $run $rm $removelist
+         exit $error
+       fi
+      fi
+
+      # Append the name of the non-PIC object the libtool object file.
+      # Only append if the libtool object file exists.
+      test -z "$run" && cat >> ${libobj}T <<EOF
+# Name of the non-PIC object.
+non_pic_object='$objname'
+
+EOF
+    else
+      # Append the name of the non-PIC object the libtool object file.
+      # Only append if the libtool object file exists.
+      test -z "$run" && cat >> ${libobj}T <<EOF
+# Name of the non-PIC object.
+non_pic_object=none
+
+EOF
+    fi
+
+    $run $mv "${libobj}T" "${libobj}"
+
+    # Unlock the critical section if it was locked
+    if test "$need_locks" != no; then
+      $run $rm "$lockfile"
+    fi
+
+    exit $EXIT_SUCCESS
+    ;;
+
+  # libtool link mode
+  link | relink)
+    modename="$modename: link"
+    case $host in
+    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+      # It is impossible to link a dll without this setting, and
+      # we shouldn't force the makefile maintainer to figure out
+      # which system we are compiling for in order to pass an extra
+      # flag for every libtool invocation.
+      # allow_undefined=no
+
+      # FIXME: Unfortunately, there are problems with the above when trying
+      # to make a dll which has undefined symbols, in which case not
+      # even a static library is built.  For now, we need to specify
+      # -no-undefined on the libtool link line when we can be certain
+      # that all symbols are satisfied, otherwise we get a static library.
+      allow_undefined=yes
+      ;;
+    *)
+      allow_undefined=yes
+      ;;
+    esac
+    libtool_args="$nonopt"
+    base_compile="$nonopt $@"
+    compile_command="$nonopt"
+    finalize_command="$nonopt"
+
+    compile_rpath=
+    finalize_rpath=
+    compile_shlibpath=
+    finalize_shlibpath=
+    convenience=
+    old_convenience=
+    deplibs=
+    old_deplibs=
+    compiler_flags=
+    linker_flags=
+    dllsearchpath=
+    lib_search_path=`pwd`
+    inst_prefix_dir=
+
+    avoid_version=no
+    dlfiles=
+    dlprefiles=
+    dlself=no
+    export_dynamic=no
+    export_symbols=
+    export_symbols_regex=
+    generated=
+    libobjs=
+    ltlibs=
+    module=no
+    no_install=no
+    objs=
+    non_pic_objects=
+    notinst_path= # paths that contain not-installed libtool libraries
+    precious_files_regex=
+    prefer_static_libs=no
+    preload=no
+    prev=
+    prevarg=
+    release=
+    rpath=
+    xrpath=
+    perm_rpath=
+    temp_rpath=
+    thread_safe=no
+    vinfo=
+    vinfo_number=no
+
+    func_infer_tag $base_compile
+
+    # We need to know -static, to get the right output filenames.
+    for arg
+    do
+      case $arg in
+      -all-static | -static | -static-libtool-libs)
+    case $arg in
+    -all-static)
+         if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+           $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
+         fi
+         if test -n "$link_static_flag"; then
+           dlopen_self=$dlopen_self_static
+         fi
+         prefer_static_libs=yes
+         ;;
+    -static)
+         if test -z "$pic_flag" && test -n "$link_static_flag"; then
+           dlopen_self=$dlopen_self_static
+         fi
+         prefer_static_libs=built
+         ;;
+    -static-libtool-libs)
+      if test -z "$pic_flag" && test -n "$link_static_flag"; then
+        dlopen_self=$dlopen_self_static
+      fi
+      prefer_static_libs=yes
+      ;;
+    esac
+       build_libtool_libs=no
+       build_old_libs=yes
+       break
+       ;;
+      esac
+    done
+
+    # See if our shared archives depend on static archives.
+    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+    # Go through the arguments, transforming them on the way.
+    while test "$#" -gt 0; do
+      arg="$1"
+      shift
+      case $arg in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*|"")
+       qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
+       ;;
+      *) qarg=$arg ;;
+      esac
+      libtool_args="$libtool_args $qarg"
+
+      # If the previous option needs an argument, assign it.
+      if test -n "$prev"; then
+       case $prev in
+       output)
+         compile_command="$compile_command @OUTPUT@"
+         finalize_command="$finalize_command @OUTPUT@"
+         ;;
+       esac
+
+       case $prev in
+       dlfiles|dlprefiles)
+         if test "$preload" = no; then
+           # Add the symbol object into the linking commands.
+           compile_command="$compile_command @SYMFILE@"
+           finalize_command="$finalize_command @SYMFILE@"
+           preload=yes
+         fi
+         case $arg in
+         *.la | *.lo) ;;  # We handle these cases below.
+         force)
+           if test "$dlself" = no; then
+             dlself=needless
+             export_dynamic=yes
+           fi
+           prev=
+           continue
+           ;;
+         self)
+           if test "$prev" = dlprefiles; then
+             dlself=yes
+           elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+             dlself=yes
+           else
+             dlself=needless
+             export_dynamic=yes
+           fi
+           prev=
+           continue
+           ;;
+         *)
+           if test "$prev" = dlfiles; then
+             dlfiles="$dlfiles $arg"
+           else
+             dlprefiles="$dlprefiles $arg"
+           fi
+           prev=
+           continue
+           ;;
+         esac
+         ;;
+       expsyms)
+         export_symbols="$arg"
+         if test ! -f "$arg"; then
+           $echo "$modename: symbol file \`$arg' does not exist"
+           exit $EXIT_FAILURE
+         fi
+         prev=
+         continue
+         ;;
+       expsyms_regex)
+         export_symbols_regex="$arg"
+         prev=
+         continue
+         ;;
+       inst_prefix)
+         inst_prefix_dir="$arg"
+         prev=
+         continue
+         ;;
+       precious_regex)
+         precious_files_regex="$arg"
+         prev=
+         continue
+         ;;
+       release)
+         release="-$arg"
+         prev=
+         continue
+         ;;
+       objectlist)
+         if test -f "$arg"; then
+           save_arg=$arg
+           moreargs=
+           for fil in `cat $save_arg`
+           do
+#            moreargs="$moreargs $fil"
+             arg=$fil
+             # A libtool-controlled object.
+
+             # Check to see that this really is a libtool object.
+             if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+               pic_object=
+               non_pic_object=
+
+               # Read the .lo file
+               # If there is no directory component, then add one.
+               case $arg in
+               */* | *\\*) . $arg ;;
+               *) . ./$arg ;;
+               esac
+
+               if test -z "$pic_object" || \
+                  test -z "$non_pic_object" ||
+                  test "$pic_object" = none && \
+                  test "$non_pic_object" = none; then
+                 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
+                 exit $EXIT_FAILURE
+               fi
+
+               # Extract subdirectory from the argument.
+               xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+               if test "X$xdir" = "X$arg"; then
+                 xdir=
+               else
+                 xdir="$xdir/"
+               fi
+
+               if test "$pic_object" != none; then
+                 # Prepend the subdirectory the object is found in.
+                 pic_object="$xdir$pic_object"
+
+                 if test "$prev" = dlfiles; then
+                   if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+                     dlfiles="$dlfiles $pic_object"
+                     prev=
+                     continue
+                   else
+                     # If libtool objects are unsupported, then we need to preload.
+                     prev=dlprefiles
+                   fi
+                 fi
+
+                 # CHECK ME:  I think I busted this.  -Ossama
+                 if test "$prev" = dlprefiles; then
+                   # Preload the old-style object.
+                   dlprefiles="$dlprefiles $pic_object"
+                   prev=
+                 fi
+
+                 # A PIC object.
+                 libobjs="$libobjs $pic_object"
+                 arg="$pic_object"
+               fi
+
+               # Non-PIC object.
+               if test "$non_pic_object" != none; then
+                 # Prepend the subdirectory the object is found in.
+                 non_pic_object="$xdir$non_pic_object"
+
+                 # A standard non-PIC object
+                 non_pic_objects="$non_pic_objects $non_pic_object"
+                 if test -z "$pic_object" || test "$pic_object" = none ; then
+                   arg="$non_pic_object"
+                 fi
+               else
+                 # If the PIC object exists, use it instead.
+                 # $xdir was prepended to $pic_object above.
+                 non_pic_object="$pic_object"
+                 non_pic_objects="$non_pic_objects $non_pic_object"
+               fi
+             else
+               # Only an error if not doing a dry-run.
+               if test -z "$run"; then
+                 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
+                 exit $EXIT_FAILURE
+               else
+                 # Dry-run case.
+
+                 # Extract subdirectory from the argument.
+                 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+                 if test "X$xdir" = "X$arg"; then
+                   xdir=
+                 else
+                   xdir="$xdir/"
+                 fi
+
+                 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
+                 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
+                 libobjs="$libobjs $pic_object"
+                 non_pic_objects="$non_pic_objects $non_pic_object"
+               fi
+             fi
+           done
+         else
+           $echo "$modename: link input file \`$save_arg' does not exist"
+           exit $EXIT_FAILURE
+         fi
+         arg=$save_arg
+         prev=
+         continue
+         ;;
+       rpath | xrpath)
+         # We need an absolute path.
+         case $arg in
+         [\\/]* | [A-Za-z]:[\\/]*) ;;
+         *)
+           $echo "$modename: only absolute run-paths are allowed" 1>&2
+           exit $EXIT_FAILURE
+           ;;
+         esac
+         if test "$prev" = rpath; then
+           case "$rpath " in
+           *" $arg "*) ;;
+           *) rpath="$rpath $arg" ;;
+           esac
+         else
+           case "$xrpath " in
+           *" $arg "*) ;;
+           *) xrpath="$xrpath $arg" ;;
+           esac
+         fi
+         prev=
+         continue
+         ;;
+       xcompiler)
+         compiler_flags="$compiler_flags $qarg"
+         prev=
+         compile_command="$compile_command $qarg"
+         finalize_command="$finalize_command $qarg"
+         continue
+         ;;
+       xlinker)
+         linker_flags="$linker_flags $qarg"
+         compiler_flags="$compiler_flags $wl$qarg"
+         prev=
+         compile_command="$compile_command $wl$qarg"
+         finalize_command="$finalize_command $wl$qarg"
+         continue
+         ;;
+       xcclinker)
+         linker_flags="$linker_flags $qarg"
+         compiler_flags="$compiler_flags $qarg"
+         prev=
+         compile_command="$compile_command $qarg"
+         finalize_command="$finalize_command $qarg"
+         continue
+         ;;
+       shrext)
+         shrext_cmds="$arg"
+         prev=
+         continue
+         ;;
+       darwin_framework|darwin_framework_skip)
+         test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
+         compile_command="$compile_command $arg"
+         finalize_command="$finalize_command $arg"
+         prev=
+         continue
+         ;;
+       *)
+         eval "$prev=\"\$arg\""
+         prev=
+         continue
+         ;;
+       esac
+      fi # test -n "$prev"
+
+      prevarg="$arg"
+
+      case $arg in
+      -all-static)
+       if test -n "$link_static_flag"; then
+         compile_command="$compile_command $link_static_flag"
+         finalize_command="$finalize_command $link_static_flag"
+       fi
+       continue
+       ;;
+
+      -allow-undefined)
+       # FIXME: remove this flag sometime in the future.
+       $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
+       continue
+       ;;
+
+      -avoid-version)
+       avoid_version=yes
+       continue
+       ;;
+
+      -dlopen)
+       prev=dlfiles
+       continue
+       ;;
+
+      -dlpreopen)
+       prev=dlprefiles
+       continue
+       ;;
+
+      -export-dynamic)
+       export_dynamic=yes
+       continue
+       ;;
+
+      -export-symbols | -export-symbols-regex)
+       if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+         $echo "$modename: more than one -exported-symbols argument is not allowed"
+         exit $EXIT_FAILURE
+       fi
+       if test "X$arg" = "X-export-symbols"; then
+         prev=expsyms
+       else
+         prev=expsyms_regex
+       fi
+       continue
+       ;;
+
+      -framework|-arch|-isysroot)
+       case " $CC " in
+         *" ${arg} ${1} "* | *" ${arg} ${1} "*) 
+               prev=darwin_framework_skip ;;
+         *) compiler_flags="$compiler_flags $arg"
+            prev=darwin_framework ;;
+       esac
+       compile_command="$compile_command $arg"
+       finalize_command="$finalize_command $arg"
+       continue
+       ;;
+
+      -inst-prefix-dir)
+       prev=inst_prefix
+       continue
+       ;;
+
+      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
+      # so, if we see these flags be careful not to treat them like -L
+      -L[A-Z][A-Z]*:*)
+       case $with_gcc/$host in
+       no/*-*-irix* | /*-*-irix*)
+         compile_command="$compile_command $arg"
+         finalize_command="$finalize_command $arg"
+         ;;
+       esac
+       continue
+       ;;
+
+      -L*)
+       dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
+       # We need an absolute path.
+       case $dir in
+       [\\/]* | [A-Za-z]:[\\/]*) ;;
+       *)
+         absdir=`cd "$dir" && pwd`
+         if test -z "$absdir"; then
+           $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
+           absdir="$dir"
+           notinst_path="$notinst_path $dir"
+         fi
+         dir="$absdir"
+         ;;
+       esac
+       case "$deplibs " in
+       *" -L$dir "*) ;;
+       *)
+         deplibs="$deplibs -L$dir"
+         lib_search_path="$lib_search_path $dir"
+         ;;
+       esac
+       case $host in
+       *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+         testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
+         case :$dllsearchpath: in
+         *":$dir:"*) ;;
+         *) dllsearchpath="$dllsearchpath:$dir";;
+         esac
+         case :$dllsearchpath: in
+         *":$testbindir:"*) ;;
+         *) dllsearchpath="$dllsearchpath:$testbindir";;
+         esac
+         ;;
+       esac
+       continue
+       ;;
+
+      -l*)
+       if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+         case $host in
+         *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
+           # These systems don't actually have a C or math library (as such)
+           continue
+           ;;
+         *-*-os2*)
+           # These systems don't actually have a C library (as such)
+           test "X$arg" = "X-lc" && continue
+           ;;
+         *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+           # Do not include libc due to us having libc/libc_r.
+           test "X$arg" = "X-lc" && continue
+           ;;
+         *-*-rhapsody* | *-*-darwin1.[012])
+           # Rhapsody C and math libraries are in the System framework
+           deplibs="$deplibs -framework System"
+           continue
+           ;;
+         *-*-sco3.2v5* | *-*-sco5v6*)
+           # Causes problems with __ctype
+           test "X$arg" = "X-lc" && continue
+           ;;
+         *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+           # Compiler inserts libc in the correct place for threads to work
+           test "X$arg" = "X-lc" && continue
+           ;;
+         esac
+       elif test "X$arg" = "X-lc_r"; then
+        case $host in
+        *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+          # Do not include libc_r directly, use -pthread flag.
+          continue
+          ;;
+        esac
+       fi
+       deplibs="$deplibs $arg"
+       continue
+       ;;
+
+      # Tru64 UNIX uses -model [arg] to determine the layout of C++
+      # classes, name mangling, and exception handling.
+      -model)
+       compile_command="$compile_command $arg"
+       compiler_flags="$compiler_flags $arg"
+       finalize_command="$finalize_command $arg"
+       prev=xcompiler
+       continue
+       ;;
+
+     -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
+       compiler_flags="$compiler_flags $arg"
+       compile_command="$compile_command $arg"
+       finalize_command="$finalize_command $arg"
+       continue
+       ;;
+
+      -module)
+       module=yes
+       continue
+       ;;
+
+      # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
+      # -r[0-9][0-9]* specifies the processor on the SGI compiler
+      # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
+      # +DA*, +DD* enable 64-bit mode on the HP compiler
+      # -q* pass through compiler args for the IBM compiler
+      # -m* pass through architecture-specific compiler args for GCC
+      # -m*, -t[45]*, -txscale* pass through architecture-specific
+      # compiler args for GCC
+      # -pg pass through profiling flag for GCC
+      # @file GCC response files
+      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \
+      -t[45]*|-txscale*|@*)
+
+       # Unknown arguments in both finalize_command and compile_command need
+       # to be aesthetically quoted because they are evaled later.
+       arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+       case $arg in
+       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*|"")
+         arg="\"$arg\""
+         ;;
+       esac
+        compile_command="$compile_command $arg"
+        finalize_command="$finalize_command $arg"
+        compiler_flags="$compiler_flags $arg"
+        continue
+        ;;
+
+      -shrext)
+       prev=shrext
+       continue
+       ;;
+
+      -no-fast-install)
+       fast_install=no
+       continue
+       ;;
+
+      -no-install)
+       case $host in
+       *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+         # The PATH hackery in wrapper scripts is required on Windows
+         # in order for the loader to find any dlls it needs.
+         $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
+         $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
+         fast_install=no
+         ;;
+       *) no_install=yes ;;
+       esac
+       continue
+       ;;
+
+      -no-undefined)
+       allow_undefined=no
+       continue
+       ;;
+
+      -objectlist)
+       prev=objectlist
+       continue
+       ;;
+
+      -o) prev=output ;;
+
+      -precious-files-regex)
+       prev=precious_regex
+       continue
+       ;;
+
+      -release)
+       prev=release
+       continue
+       ;;
+
+      -rpath)
+       prev=rpath
+       continue
+       ;;
+
+      -R)
+       prev=xrpath
+       continue
+       ;;
+
+      -R*)
+       dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
+       # We need an absolute path.
+       case $dir in
+       [\\/]* | [A-Za-z]:[\\/]*) ;;
+       *)
+         $echo "$modename: only absolute run-paths are allowed" 1>&2
+         exit $EXIT_FAILURE
+         ;;
+       esac
+       case "$xrpath " in
+       *" $dir "*) ;;
+       *) xrpath="$xrpath $dir" ;;
+       esac
+       continue
+       ;;
+
+      -static | -static-libtool-libs)
+       # The effects of -static are defined in a previous loop.
+       # We used to do the same as -all-static on platforms that
+       # didn't have a PIC flag, but the assumption that the effects
+       # would be equivalent was wrong.  It would break on at least
+       # Digital Unix and AIX.
+       continue
+       ;;
+
+      -thread-safe)
+       thread_safe=yes
+       continue
+       ;;
+
+      -version-info)
+       prev=vinfo
+       continue
+       ;;
+      -version-number)
+       prev=vinfo
+       vinfo_number=yes
+       continue
+       ;;
+
+      -Wc,*)
+       args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
+       arg=
+       save_ifs="$IFS"; IFS=','
+       for flag in $args; do
+         IFS="$save_ifs"
+         case $flag in
+           *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*|"")
+           flag="\"$flag\""
+           ;;
+         esac
+         arg="$arg $wl$flag"
+         compiler_flags="$compiler_flags $flag"
+       done
+       IFS="$save_ifs"
+       arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
+       ;;
+
+      -Wl,*)
+       args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
+       arg=
+       save_ifs="$IFS"; IFS=','
+       for flag in $args; do
+         IFS="$save_ifs"
+         case $flag in
+           *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*|"")
+           flag="\"$flag\""
+           ;;
+         esac
+         arg="$arg $wl$flag"
+         compiler_flags="$compiler_flags $wl$flag"
+         linker_flags="$linker_flags $flag"
+       done
+       IFS="$save_ifs"
+       arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
+       ;;
+
+      -Xcompiler)
+       prev=xcompiler
+       continue
+       ;;
+
+      -Xlinker)
+       prev=xlinker
+       continue
+       ;;
+
+      -XCClinker)
+       prev=xcclinker
+       continue
+       ;;
+
+      # Some other compiler flag.
+      -* | +*)
+       # Unknown arguments in both finalize_command and compile_command need
+       # to be aesthetically quoted because they are evaled later.
+       arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+       case $arg in
+       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*|"")
+         arg="\"$arg\""
+         ;;
+       esac
+       ;;
+
+      *.$objext)
+       # A standard object.
+       objs="$objs $arg"
+       ;;
+
+      *.lo)
+       # A libtool-controlled object.
+
+       # Check to see that this really is a libtool object.
+       if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+         pic_object=
+         non_pic_object=
+
+         # Read the .lo file
+         # If there is no directory component, then add one.
+         case $arg in
+         */* | *\\*) . $arg ;;
+         *) . ./$arg ;;
+         esac
+
+         if test -z "$pic_object" || \
+            test -z "$non_pic_object" ||
+            test "$pic_object" = none && \
+            test "$non_pic_object" = none; then
+           $echo "$modename: cannot find name of object for \`$arg'" 1>&2
+           exit $EXIT_FAILURE
+         fi
+
+         # Extract subdirectory from the argument.
+         xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+         if test "X$xdir" = "X$arg"; then
+           xdir=
+         else
+           xdir="$xdir/"
+         fi
+
+         if test "$pic_object" != none; then
+           # Prepend the subdirectory the object is found in.
+           pic_object="$xdir$pic_object"
+
+           if test "$prev" = dlfiles; then
+             if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+               dlfiles="$dlfiles $pic_object"
+               prev=
+               continue
+             else
+               # If libtool objects are unsupported, then we need to preload.
+               prev=dlprefiles
+             fi
+           fi
+
+           # CHECK ME:  I think I busted this.  -Ossama
+           if test "$prev" = dlprefiles; then
+             # Preload the old-style object.
+             dlprefiles="$dlprefiles $pic_object"
+             prev=
+           fi
+
+           # A PIC object.
+           libobjs="$libobjs $pic_object"
+           arg="$pic_object"
+         fi
+
+         # Non-PIC object.
+         if test "$non_pic_object" != none; then
+           # Prepend the subdirectory the object is found in.
+           non_pic_object="$xdir$non_pic_object"
+
+           # A standard non-PIC object
+           non_pic_objects="$non_pic_objects $non_pic_object"
+           if test -z "$pic_object" || test "$pic_object" = none ; then
+             arg="$non_pic_object"
+           fi
+         else
+           # If the PIC object exists, use it instead.
+           # $xdir was prepended to $pic_object above.
+           non_pic_object="$pic_object"
+           non_pic_objects="$non_pic_objects $non_pic_object"
+         fi
+       else
+         # Only an error if not doing a dry-run.
+         if test -z "$run"; then
+           $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
+           exit $EXIT_FAILURE
+         else
+           # Dry-run case.
+
+           # Extract subdirectory from the argument.
+           xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+           if test "X$xdir" = "X$arg"; then
+             xdir=
+           else
+             xdir="$xdir/"
+           fi
+
+           pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
+           non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
+           libobjs="$libobjs $pic_object"
+           non_pic_objects="$non_pic_objects $non_pic_object"
+         fi
+       fi
+       ;;
+
+      *.$libext)
+       # An archive.
+       deplibs="$deplibs $arg"
+       old_deplibs="$old_deplibs $arg"
+       continue
+       ;;
+
+      *.la)
+       # A libtool-controlled library.
+
+       if test "$prev" = dlfiles; then
+         # This library was specified with -dlopen.
+         dlfiles="$dlfiles $arg"
+         prev=
+       elif test "$prev" = dlprefiles; then
+         # The library was specified with -dlpreopen.
+         dlprefiles="$dlprefiles $arg"
+         prev=
+       else
+         deplibs="$deplibs $arg"
+       fi
+       continue
+       ;;
+
+      # Some other compiler argument.
+      *)
+       # Unknown arguments in both finalize_command and compile_command need
+       # to be aesthetically quoted because they are evaled later.
+       arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+       case $arg in
+       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*|"")
+         arg="\"$arg\""
+         ;;
+       esac
+       ;;
+      esac # arg
+
+      # Now actually substitute the argument into the commands.
+      if test -n "$arg"; then
+       compile_command="$compile_command $arg"
+       finalize_command="$finalize_command $arg"
+      fi
+    done # argument parsing loop
+
+    if test -n "$prev"; then
+      $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
+      $echo "$help" 1>&2
+      exit $EXIT_FAILURE
+    fi
+
+    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+      eval arg=\"$export_dynamic_flag_spec\"
+      compile_command="$compile_command $arg"
+      finalize_command="$finalize_command $arg"
+    fi
+
+    oldlibs=
+    # calculate the name of the file, without its directory
+    outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
+    libobjs_save="$libobjs"
+
+    if test -n "$shlibpath_var"; then
+      # get the directories listed in $shlibpath_var
+      eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
+    else
+      shlib_search_path=
+    fi
+    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
+    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+
+    output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
+    if test "X$output_objdir" = "X$output"; then
+      output_objdir="$objdir"
+    else
+      output_objdir="$output_objdir/$objdir"
+    fi
+    # Create the object directory.
+    if test ! -d "$output_objdir"; then
+      $show "$mkdir $output_objdir"
+      $run $mkdir $output_objdir
+      exit_status=$?
+      if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
+       exit $exit_status
+      fi
+    fi
+
+    # Determine the type of output
+    case $output in
+    "")
+      $echo "$modename: you must specify an output file" 1>&2
+      $echo "$help" 1>&2
+      exit $EXIT_FAILURE
+      ;;
+    *.$libext) linkmode=oldlib ;;
+    *.lo | *.$objext) linkmode=obj ;;
+    *.la) linkmode=lib ;;
+    *) linkmode=prog ;; # Anything else should be a program.
+    esac
+
+    case $host in
+    *cygwin* | *mingw* | *pw32*)
+      # don't eliminate duplications in $postdeps and $predeps
+      duplicate_compiler_generated_deps=yes
+      ;;
+    *)
+      duplicate_compiler_generated_deps=$duplicate_deps
+      ;;
+    esac
+    specialdeplibs=
+
+    libs=
+    # Find all interdependent deplibs by searching for libraries
+    # that are linked more than once (e.g. -la -lb -la)
+    for deplib in $deplibs; do
+      if test "X$duplicate_deps" = "Xyes" ; then
+       case "$libs " in
+       *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+       esac
+      fi
+      libs="$libs $deplib"
+    done
+
+    if test "$linkmode" = lib; then
+      libs="$predeps $libs $compiler_lib_search_path $postdeps"
+
+      # Compute libraries that are listed more than once in $predeps
+      # $postdeps and mark them as special (i.e., whose duplicates are
+      # not to be eliminated).
+      pre_post_deps=
+      if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
+       for pre_post_dep in $predeps $postdeps; do
+         case "$pre_post_deps " in
+         *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
+         esac
+         pre_post_deps="$pre_post_deps $pre_post_dep"
+       done
+      fi
+      pre_post_deps=
+    fi
+
+    deplibs=
+    newdependency_libs=
+    newlib_search_path=
+    need_relink=no # whether we're linking any uninstalled libtool libraries
+    notinst_deplibs= # not-installed libtool libraries
+    case $linkmode in
+    lib)
+       passes="conv link"
+       for file in $dlfiles $dlprefiles; do
+         case $file in
+         *.la) ;;
+         *)
+           $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
+           exit $EXIT_FAILURE
+           ;;
+         esac
+       done
+       ;;
+    prog)
+       compile_deplibs=
+       finalize_deplibs=
+       alldeplibs=no
+       newdlfiles=
+       newdlprefiles=
+       passes="conv scan dlopen dlpreopen link"
+       ;;
+    *)  passes="conv"
+       ;;
+    esac
+    for pass in $passes; do
+      if test "$linkmode,$pass" = "lib,link" ||
+        test "$linkmode,$pass" = "prog,scan"; then
+       libs="$deplibs"
+       deplibs=
+      fi
+      if test "$linkmode" = prog; then
+       case $pass in
+       dlopen) libs="$dlfiles" ;;
+       dlpreopen) libs="$dlprefiles" ;;
+       link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+       esac
+      fi
+      if test "$pass" = dlopen; then
+       # Collect dlpreopened libraries
+       save_deplibs="$deplibs"
+       deplibs=
+      fi
+      for deplib in $libs; do
+       lib=
+       found=no
+       case $deplib in
+       -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
+         if test "$linkmode,$pass" = "prog,link"; then
+           compile_deplibs="$deplib $compile_deplibs"
+           finalize_deplibs="$deplib $finalize_deplibs"
+         else
+           compiler_flags="$compiler_flags $deplib"
+         fi
+         continue
+         ;;
+       -l*)
+         if test "$linkmode" != lib && test "$linkmode" != prog; then
+           $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
+           continue
+         fi
+         name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
+         for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
+           for search_ext in .la $std_shrext .so .a; do
+             # Search the libtool library
+             lib="$searchdir/lib${name}${search_ext}"
+             if test -f "$lib"; then
+               if test "$search_ext" = ".la"; then
+                 found=yes
+               else
+                 found=no
+               fi
+               break 2
+             fi
+           done
+         done
+         if test "$found" != yes; then
+           # deplib doesn't seem to be a libtool library
+           if test "$linkmode,$pass" = "prog,link"; then
+             compile_deplibs="$deplib $compile_deplibs"
+             finalize_deplibs="$deplib $finalize_deplibs"
+           else
+             deplibs="$deplib $deplibs"
+             test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+           fi
+           continue
+         else # deplib is a libtool library
+           # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
+           # We need to do some special things here, and not later.
+           if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+             case " $predeps $postdeps " in
+             *" $deplib "*)
+               if (${SED} -e '2q' $lib |
+                    grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+                 library_names=
+                 old_library=
+                 case $lib in
+                 */* | *\\*) . $lib ;;
+                 *) . ./$lib ;;
+                 esac
+                 for l in $old_library $library_names; do
+                   ll="$l"
+                 done
+                 if test "X$ll" = "X$old_library" ; then # only static version available
+                   found=no
+                   ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
+                   test "X$ladir" = "X$lib" && ladir="."
+                   lib=$ladir/$old_library
+                   if test "$linkmode,$pass" = "prog,link"; then
+                     compile_deplibs="$deplib $compile_deplibs"
+                     finalize_deplibs="$deplib $finalize_deplibs"
+                   else
+                     deplibs="$deplib $deplibs"
+                     test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+                   fi
+                   continue
+                 fi
+               fi
+               ;;
+             *) ;;
+             esac
+           fi
+         fi
+         ;; # -l
+       -L*)
+         case $linkmode in
+         lib)
+           deplibs="$deplib $deplibs"
+           test "$pass" = conv && continue
+           newdependency_libs="$deplib $newdependency_libs"
+           newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+           ;;
+         prog)
+           if test "$pass" = conv; then
+             deplibs="$deplib $deplibs"
+             continue
+           fi
+           if test "$pass" = scan; then
+             deplibs="$deplib $deplibs"
+           else
+             compile_deplibs="$deplib $compile_deplibs"
+             finalize_deplibs="$deplib $finalize_deplibs"
+           fi
+           newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+           ;;
+         *)
+           $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
+           ;;
+         esac # linkmode
+         continue
+         ;; # -L
+       -R*)
+         if test "$pass" = link; then
+           dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
+           # Make sure the xrpath contains only unique directories.
+           case "$xrpath " in
+           *" $dir "*) ;;
+           *) xrpath="$xrpath $dir" ;;
+           esac
+         fi
+         deplibs="$deplib $deplibs"
+         continue
+         ;;
+       *.la) lib="$deplib" ;;
+       *.$libext)
+         if test "$pass" = conv; then
+           deplibs="$deplib $deplibs"
+           continue
+         fi
+         case $linkmode in
+         lib)
+           valid_a_lib=no
+           case $deplibs_check_method in
+             match_pattern*)
+               set dummy $deplibs_check_method
+               match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+               if eval $echo \"$deplib\" 2>/dev/null \
+                   | $SED 10q \
+                   | $EGREP "$match_pattern_regex" > /dev/null; then
+                 valid_a_lib=yes
+               fi
+               ;;
+             pass_all)
+               valid_a_lib=yes
+               ;;
+            esac
+           if test "$valid_a_lib" != yes; then
+             $echo
+             $echo "*** Warning: Trying to link with static lib archive $deplib."
+             $echo "*** I have the capability to make that library automatically link in when"
+             $echo "*** you link to this library.  But I can only do this if you have a"
+             $echo "*** shared version of the library, which you do not appear to have"
+             $echo "*** because the file extensions .$libext of this argument makes me believe"
+             $echo "*** that it is just a static archive that I should not used here."
+           else
+             $echo
+             $echo "*** Warning: Linking the shared library $output against the"
+             $echo "*** static library $deplib is not portable!"
+             deplibs="$deplib $deplibs"
+           fi
+           continue
+           ;;
+         prog)
+           if test "$pass" != link; then
+             deplibs="$deplib $deplibs"
+           else
+             compile_deplibs="$deplib $compile_deplibs"
+             finalize_deplibs="$deplib $finalize_deplibs"
+           fi
+           continue
+           ;;
+         esac # linkmode
+         ;; # *.$libext
+       *.lo | *.$objext)
+         if test "$pass" = conv; then
+           deplibs="$deplib $deplibs"
+         elif test "$linkmode" = prog; then
+           if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+             # If there is no dlopen support or we're linking statically,
+             # we need to preload.
+             newdlprefiles="$newdlprefiles $deplib"
+             compile_deplibs="$deplib $compile_deplibs"
+             finalize_deplibs="$deplib $finalize_deplibs"
+           else
+             newdlfiles="$newdlfiles $deplib"
+           fi
+         fi
+         continue
+         ;;
+       %DEPLIBS%)
+         alldeplibs=yes
+         continue
+         ;;
+       esac # case $deplib
+       if test "$found" = yes || test -f "$lib"; then :
+       else
+         $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
+         exit $EXIT_FAILURE
+       fi
+
+       # Check to see that this really is a libtool archive.
+       if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+       else
+         $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+         exit $EXIT_FAILURE
+       fi
+
+       ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
+       test "X$ladir" = "X$lib" && ladir="."
+
+       dlname=
+       dlopen=
+       dlpreopen=
+       libdir=
+       library_names=
+       old_library=
+       # If the library was installed with an old release of libtool,
+       # it will not redefine variables installed, or shouldnotlink
+       installed=yes
+       shouldnotlink=no
+       avoidtemprpath=
+
+
+       # Read the .la file
+       case $lib in
+       */* | *\\*) . $lib ;;
+       *) . ./$lib ;;
+       esac
+
+       if test "$linkmode,$pass" = "lib,link" ||
+          test "$linkmode,$pass" = "prog,scan" ||
+          { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+         test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
+         test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
+       fi
+
+       if test "$pass" = conv; then
+         # Only check for convenience libraries
+         deplibs="$lib $deplibs"
+         if test -z "$libdir"; then
+           if test -z "$old_library"; then
+             $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
+             exit $EXIT_FAILURE
+           fi
+           # It is a libtool convenience library, so add in its objects.
+           convenience="$convenience $ladir/$objdir/$old_library"
+           old_convenience="$old_convenience $ladir/$objdir/$old_library"
+           tmp_libs=
+           for deplib in $dependency_libs; do
+             deplibs="$deplib $deplibs"
+              if test "X$duplicate_deps" = "Xyes" ; then
+               case "$tmp_libs " in
+               *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+               esac
+              fi
+             tmp_libs="$tmp_libs $deplib"
+           done
+         elif test "$linkmode" != prog && test "$linkmode" != lib; then
+           $echo "$modename: \`$lib' is not a convenience library" 1>&2
+           exit $EXIT_FAILURE
+         fi
+         continue
+       fi # $pass = conv
+
+
+       # Get the name of the library we link against.
+       linklib=
+       for l in $old_library $library_names; do
+         linklib="$l"
+       done
+       if test -z "$linklib"; then
+         $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
+         exit $EXIT_FAILURE
+       fi
+
+       # This library was specified with -dlopen.
+       if test "$pass" = dlopen; then
+         if test -z "$libdir"; then
+           $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
+           exit $EXIT_FAILURE
+         fi
+         if test -z "$dlname" ||
+            test "$dlopen_support" != yes ||
+            test "$build_libtool_libs" = no; then
+           # If there is no dlname, no dlopen support or we're linking
+           # statically, we need to preload.  We also need to preload any
+           # dependent libraries so libltdl's deplib preloader doesn't
+           # bomb out in the load deplibs phase.
+           dlprefiles="$dlprefiles $lib $dependency_libs"
+         else
+           newdlfiles="$newdlfiles $lib"
+         fi
+         continue
+       fi # $pass = dlopen
+
+       # We need an absolute path.
+       case $ladir in
+       [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+       *)
+         abs_ladir=`cd "$ladir" && pwd`
+         if test -z "$abs_ladir"; then
+           $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
+           $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
+           abs_ladir="$ladir"
+         fi
+         ;;
+       esac
+       laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+
+       # Find the relevant object directory and library name.
+       if test "X$installed" = Xyes; then
+         if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+           $echo "$modename: warning: library \`$lib' was moved." 1>&2
+           dir="$ladir"
+           absdir="$abs_ladir"
+           libdir="$abs_ladir"
+         else
+           dir="$libdir"
+           absdir="$libdir"
+         fi
+         test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
+       else
+         if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+           dir="$ladir"
+           absdir="$abs_ladir"
+           # Remove this search path later
+           notinst_path="$notinst_path $abs_ladir"
+         else
+           dir="$ladir/$objdir"
+           absdir="$abs_ladir/$objdir"
+           # Remove this search path later
+           notinst_path="$notinst_path $abs_ladir"
+         fi
+       fi # $installed = yes
+       name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+
+       # This library was specified with -dlpreopen.
+       if test "$pass" = dlpreopen; then
+         if test -z "$libdir"; then
+           $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
+           exit $EXIT_FAILURE
+         fi
+         # Prefer using a static library (so that no silly _DYNAMIC symbols
+         # are required to link).
+         if test -n "$old_library"; then
+           newdlprefiles="$newdlprefiles $dir/$old_library"
+         # Otherwise, use the dlname, so that lt_dlopen finds it.
+         elif test -n "$dlname"; then
+           newdlprefiles="$newdlprefiles $dir/$dlname"
+         else
+           newdlprefiles="$newdlprefiles $dir/$linklib"
+         fi
+       fi # $pass = dlpreopen
+
+       if test -z "$libdir"; then
+         # Link the convenience library
+         if test "$linkmode" = lib; then
+           deplibs="$dir/$old_library $deplibs"
+         elif test "$linkmode,$pass" = "prog,link"; then
+           compile_deplibs="$dir/$old_library $compile_deplibs"
+           finalize_deplibs="$dir/$old_library $finalize_deplibs"
+         else
+           deplibs="$lib $deplibs" # used for prog,scan pass
+         fi
+         continue
+       fi
+
+
+       if test "$linkmode" = prog && test "$pass" != link; then
+         newlib_search_path="$newlib_search_path $ladir"
+         deplibs="$lib $deplibs"
+
+         linkalldeplibs=no
+         if test "$link_all_deplibs" != no || test -z "$library_names" ||
+            test "$build_libtool_libs" = no; then
+           linkalldeplibs=yes
+         fi
+
+         tmp_libs=
+         for deplib in $dependency_libs; do
+           case $deplib in
+           -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
+           esac
+           # Need to link against all dependency_libs?
+           if test "$linkalldeplibs" = yes; then
+             deplibs="$deplib $deplibs"
+           else
+             # Need to hardcode shared library paths
+             # or/and link against static libraries
+             newdependency_libs="$deplib $newdependency_libs"
+           fi
+           if test "X$duplicate_deps" = "Xyes" ; then
+             case "$tmp_libs " in
+             *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+             esac
+           fi
+           tmp_libs="$tmp_libs $deplib"
+         done # for deplib
+         continue
+       fi # $linkmode = prog...
+
+       if test "$linkmode,$pass" = "prog,link"; then
+         if test -n "$library_names" &&
+         { { test "$prefer_static_libs" = no ||
+             test "$prefer_static_libs,$installed" = "built,yes"; } ||
+           test -z "$old_library"; }; then
+           # We need to hardcode the library path
+           if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
+             # Make sure the rpath contains only unique directories.
+             case "$temp_rpath " in
+             *" $dir "*) ;;
+             *" $absdir "*) ;;
+             *) temp_rpath="$temp_rpath $absdir" ;;
+             esac
+           fi
+
+           # Hardcode the library path.
+           # Skip directories that are in the system default run-time
+           # search path.
+           case " $sys_lib_dlsearch_path " in
+           *" $absdir "*) ;;
+           *)
+             case "$compile_rpath " in
+             *" $absdir "*) ;;
+             *) compile_rpath="$compile_rpath $absdir"
+             esac
+             ;;
+           esac
+           case " $sys_lib_dlsearch_path " in
+           *" $libdir "*) ;;
+           *)
+             case "$finalize_rpath " in
+             *" $libdir "*) ;;
+             *) finalize_rpath="$finalize_rpath $libdir"
+             esac
+             ;;
+           esac
+         fi # $linkmode,$pass = prog,link...
+
+         if test "$alldeplibs" = yes &&
+            { test "$deplibs_check_method" = pass_all ||
+              { test "$build_libtool_libs" = yes &&
+                test -n "$library_names"; }; }; then
+           # We only need to search for static libraries
+           continue
+         fi
+       fi
+
+       link_static=no # Whether the deplib will be linked statically
+       use_static_libs=$prefer_static_libs
+       if test "$use_static_libs" = built && test "$installed" = yes ; then
+         use_static_libs=no
+       fi
+       if test -n "$library_names" &&
+          { test "$use_static_libs" = no || test -z "$old_library"; }; then
+         if test "$installed" = no; then
+           notinst_deplibs="$notinst_deplibs $lib"
+           need_relink=yes
+         fi
+         # This is a shared library
+
+         # Warn about portability, can't link against -module's on
+         # some systems (darwin)
+         if test "$shouldnotlink" = yes && test "$pass" = link ; then
+           $echo
+           if test "$linkmode" = prog; then
+             $echo "*** Warning: Linking the executable $output against the loadable module"
+           else
+             $echo "*** Warning: Linking the shared library $output against the loadable module"
+           fi
+           $echo "*** $linklib is not portable!"
+         fi
+         if test "$linkmode" = lib &&
+            test "$hardcode_into_libs" = yes; then
+           # Hardcode the library path.
+           # Skip directories that are in the system default run-time
+           # search path.
+           case " $sys_lib_dlsearch_path " in
+           *" $absdir "*) ;;
+           *)
+             case "$compile_rpath " in
+             *" $absdir "*) ;;
+             *) compile_rpath="$compile_rpath $absdir"
+             esac
+             ;;
+           esac
+           case " $sys_lib_dlsearch_path " in
+           *" $libdir "*) ;;
+           *)
+             case "$finalize_rpath " in
+             *" $libdir "*) ;;
+             *) finalize_rpath="$finalize_rpath $libdir"
+             esac
+             ;;
+           esac
+         fi
+
+         if test -n "$old_archive_from_expsyms_cmds"; then
+           # figure out the soname
+           set dummy $library_names
+           realname="$2"
+           shift; shift
+           libname=`eval \\$echo \"$libname_spec\"`
+           # use dlname if we got it. it's perfectly good, no?
+           if test -n "$dlname"; then
+             soname="$dlname"
+           elif test -n "$soname_spec"; then
+             # bleh windows
+             case $host in
+             *cygwin* | mingw*)
+               major=`expr $current - $age`
+               versuffix="-$major"
+               ;;
+             esac
+             eval soname=\"$soname_spec\"
+           else
+             soname="$realname"
+           fi
+
+           # Make a new name for the extract_expsyms_cmds to use
+           soroot="$soname"
+           soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
+           newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
+
+           # If the library has no export list, then create one now
+           if test -f "$output_objdir/$soname-def"; then :
+           else
+             $show "extracting exported symbol list from \`$soname'"
+             save_ifs="$IFS"; IFS='~'
+             cmds=$extract_expsyms_cmds
+             for cmd in $cmds; do
+               IFS="$save_ifs"
+               eval cmd=\"$cmd\"
+               $show "$cmd"
+               $run eval "$cmd" || exit $?
+             done
+             IFS="$save_ifs"
+           fi
+
+           # Create $newlib
+           if test -f "$output_objdir/$newlib"; then :; else
+             $show "generating import library for \`$soname'"
+             save_ifs="$IFS"; IFS='~'
+             cmds=$old_archive_from_expsyms_cmds
+             for cmd in $cmds; do
+               IFS="$save_ifs"
+               eval cmd=\"$cmd\"
+               $show "$cmd"
+               $run eval "$cmd" || exit $?
+             done
+             IFS="$save_ifs"
+           fi
+           # make sure the library variables are pointing to the new library
+           dir=$output_objdir
+           linklib=$newlib
+         fi # test -n "$old_archive_from_expsyms_cmds"
+
+         if test "$linkmode" = prog || test "$mode" != relink; then
+           add_shlibpath=
+           add_dir=
+           add=
+           lib_linked=yes
+           case $hardcode_action in
+           immediate | unsupported)
+             if test "$hardcode_direct" = no; then
+               add="$dir/$linklib"
+               case $host in
+                 *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
+                 *-*-sysv4*uw2*) add_dir="-L$dir" ;;
+                 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
+                   *-*-unixware7*) add_dir="-L$dir" ;;
+                 *-*-darwin* )
+                   # if the lib is a module then we can not link against
+                   # it, someone is ignoring the new warnings I added
+                   if /usr/bin/file -L $add 2> /dev/null |
+                      $EGREP ": [^:]* bundle" >/dev/null ; then
+                     $echo "** Warning, lib $linklib is a module, not a shared library"
+                     if test -z "$old_library" ; then
+                       $echo
+                       $echo "** And there doesn't seem to be a static archive available"
+                       $echo "** The link will probably fail, sorry"
+                     else
+                       add="$dir/$old_library"
+                     fi
+                   fi
+               esac
+             elif test "$hardcode_minus_L" = no; then
+               case $host in
+               *-*-sunos*) add_shlibpath="$dir" ;;
+               esac
+               add_dir="-L$dir"
+               add="-l$name"
+             elif test "$hardcode_shlibpath_var" = no; then
+               add_shlibpath="$dir"
+               add="-l$name"
+             else
+               lib_linked=no
+             fi
+             ;;
+           relink)
+             if test "$hardcode_direct" = yes; then
+               add="$dir/$linklib"
+             elif test "$hardcode_minus_L" = yes; then
+               add_dir="-L$dir"
+               # Try looking first in the location we're being installed to.
+               if test -n "$inst_prefix_dir"; then
+                 case $libdir in
+                   [\\/]*)
+                     add_dir="$add_dir -L$inst_prefix_dir$libdir"
+                     ;;
+                 esac
+               fi
+               add="-l$name"
+             elif test "$hardcode_shlibpath_var" = yes; then
+               add_shlibpath="$dir"
+               add="-l$name"
+             else
+               lib_linked=no
+             fi
+             ;;
+           *) lib_linked=no ;;
+           esac
+
+           if test "$lib_linked" != yes; then
+             $echo "$modename: configuration error: unsupported hardcode properties"
+             exit $EXIT_FAILURE
+           fi
+
+           if test -n "$add_shlibpath"; then
+             case :$compile_shlibpath: in
+             *":$add_shlibpath:"*) ;;
+             *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
+             esac
+           fi
+           if test "$linkmode" = prog; then
+             test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
+             test -n "$add" && compile_deplibs="$add $compile_deplibs"
+           else
+             test -n "$add_dir" && deplibs="$add_dir $deplibs"
+             test -n "$add" && deplibs="$add $deplibs"
+             if test "$hardcode_direct" != yes && \
+                test "$hardcode_minus_L" != yes && \
+                test "$hardcode_shlibpath_var" = yes; then
+               case :$finalize_shlibpath: in
+               *":$libdir:"*) ;;
+               *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+               esac
+             fi
+           fi
+         fi
+
+         if test "$linkmode" = prog || test "$mode" = relink; then
+           add_shlibpath=
+           add_dir=
+           add=
+           # Finalize command for both is simple: just hardcode it.
+           if test "$hardcode_direct" = yes; then
+             add="$libdir/$linklib"
+           elif test "$hardcode_minus_L" = yes; then
+             add_dir="-L$libdir"
+             add="-l$name"
+           elif test "$hardcode_shlibpath_var" = yes; then
+             case :$finalize_shlibpath: in
+             *":$libdir:"*) ;;
+             *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+             esac
+             add="-l$name"
+           elif test "$hardcode_automatic" = yes; then
+             if test -n "$inst_prefix_dir" &&
+                test -f "$inst_prefix_dir$libdir/$linklib" ; then
+               add="$inst_prefix_dir$libdir/$linklib"
+             else
+               add="$libdir/$linklib"
+             fi
+           else
+             # We cannot seem to hardcode it, guess we'll fake it.
+             add_dir="-L$libdir"
+             # Try looking first in the location we're being installed to.
+             if test -n "$inst_prefix_dir"; then
+               case $libdir in
+                 [\\/]*)
+                   add_dir="$add_dir -L$inst_prefix_dir$libdir"
+                   ;;
+               esac
+             fi
+             add="-l$name"
+           fi
+
+           if test "$linkmode" = prog; then
+             test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
+             test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
+           else
+             test -n "$add_dir" && deplibs="$add_dir $deplibs"
+             test -n "$add" && deplibs="$add $deplibs"
+           fi
+         fi
+       elif test "$linkmode" = prog; then
+         # Here we assume that one of hardcode_direct or hardcode_minus_L
+         # is not unsupported.  This is valid on all known static and
+         # shared platforms.
+         if test "$hardcode_direct" != unsupported; then
+           test -n "$old_library" && linklib="$old_library"
+           compile_deplibs="$dir/$linklib $compile_deplibs"
+           finalize_deplibs="$dir/$linklib $finalize_deplibs"
+         else
+           compile_deplibs="-l$name -L$dir $compile_deplibs"
+           finalize_deplibs="-l$name -L$dir $finalize_deplibs"
+         fi
+       elif test "$build_libtool_libs" = yes; then
+         # Not a shared library
+         if test "$deplibs_check_method" != pass_all; then
+           # We're trying link a shared library against a static one
+           # but the system doesn't support it.
+
+           # Just print a warning and add the library to dependency_libs so
+           # that the program can be linked against the static library.
+           $echo
+           $echo "*** Warning: This system can not link to static lib archive $lib."
+           $echo "*** I have the capability to make that library automatically link in when"
+           $echo "*** you link to this library.  But I can only do this if you have a"
+           $echo "*** shared version of the library, which you do not appear to have."
+           if test "$module" = yes; then
+             $echo "*** But as you try to build a module library, libtool will still create "
+             $echo "*** a static module, that should work as long as the dlopening application"
+             $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
+             if test -z "$global_symbol_pipe"; then
+               $echo
+               $echo "*** However, this would only work if libtool was able to extract symbol"
+               $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+               $echo "*** not find such a program.  So, this module is probably useless."
+               $echo "*** \`nm' from GNU binutils and a full rebuild may help."
+             fi
+             if test "$build_old_libs" = no; then
+               build_libtool_libs=module
+               build_old_libs=yes
+             else
+               build_libtool_libs=no
+             fi
+           fi
+         else
+           deplibs="$dir/$old_library $deplibs"
+           link_static=yes
+         fi
+       fi # link shared/static library?
+
+       if test "$linkmode" = lib; then
+         if test -n "$dependency_libs" &&
+            { test "$hardcode_into_libs" != yes ||
+              test "$build_old_libs" = yes ||
+              test "$link_static" = yes; }; then
+           # Extract -R from dependency_libs
+           temp_deplibs=
+           for libdir in $dependency_libs; do
+             case $libdir in
+             -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
+                  case " $xrpath " in
+                  *" $temp_xrpath "*) ;;
+                  *) xrpath="$xrpath $temp_xrpath";;
+                  esac;;
+             *) temp_deplibs="$temp_deplibs $libdir";;
+             esac
+           done
+           dependency_libs="$temp_deplibs"
+         fi
+
+         newlib_search_path="$newlib_search_path $absdir"
+         # Link against this library
+         test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+         # ... and its dependency_libs
+         tmp_libs=
+         for deplib in $dependency_libs; do
+           newdependency_libs="$deplib $newdependency_libs"
+           if test "X$duplicate_deps" = "Xyes" ; then
+             case "$tmp_libs " in
+             *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+             esac
+           fi
+           tmp_libs="$tmp_libs $deplib"
+         done
+
+         if test "$link_all_deplibs" != no; then
+           # Add the search paths of all dependency libraries
+           for deplib in $dependency_libs; do
+             case $deplib in
+             -L*) path="$deplib" ;;
+             *.la)
+               dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
+               test "X$dir" = "X$deplib" && dir="."
+               # We need an absolute path.
+               case $dir in
+               [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+               *)
+                 absdir=`cd "$dir" && pwd`
+                 if test -z "$absdir"; then
+                   $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
+                   absdir="$dir"
+                 fi
+                 ;;
+               esac
+               if grep "^installed=no" $deplib > /dev/null; then
+                 path="$absdir/$objdir"
+               else
+                 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+                 if test -z "$libdir"; then
+                   $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
+                   exit $EXIT_FAILURE
+                 fi
+                 if test "$absdir" != "$libdir"; then
+                   $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
+                 fi
+                 path="$absdir"
+               fi
+               depdepl=
+               case $host in
+               *-*-darwin*)
+                 # we do not want to link against static libs,
+                 # but need to link against shared
+                 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+                 if test -n "$deplibrary_names" ; then
+                   for tmp in $deplibrary_names ; do
+                     depdepl=$tmp
+                   done
+                   if test -f "$path/$depdepl" ; then
+                     depdepl="$path/$depdepl"
+                   fi
+                   # do not add paths which are already there
+                   case " $newlib_search_path " in
+                   *" $path "*) ;;
+                   *) newlib_search_path="$newlib_search_path $path";;
+                   esac
+                 fi
+                 path=""
+                 ;;
+               *)
+                 path="-L$path"
+                 ;;
+               esac
+               ;;
+             -l*)
+               case $host in
+               *-*-darwin*)
+                 # Again, we only want to link against shared libraries
+                 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
+                 for tmp in $newlib_search_path ; do
+                   if test -f "$tmp/lib$tmp_libs.dylib" ; then
+                     eval depdepl="$tmp/lib$tmp_libs.dylib"
+                     break
+                   fi
+                 done
+                 path=""
+                 ;;
+               *) continue ;;
+               esac
+               ;;
+             *) continue ;;
+             esac
+             case " $deplibs " in
+             *" $path "*) ;;
+             *) deplibs="$path $deplibs" ;;
+             esac
+             case " $deplibs " in
+             *" $depdepl "*) ;;
+             *) deplibs="$depdepl $deplibs" ;;
+             esac
+           done
+         fi # link_all_deplibs != no
+       fi # linkmode = lib
+      done # for deplib in $libs
+      dependency_libs="$newdependency_libs"
+      if test "$pass" = dlpreopen; then
+       # Link the dlpreopened libraries before other libraries
+       for deplib in $save_deplibs; do
+         deplibs="$deplib $deplibs"
+       done
+      fi
+      if test "$pass" != dlopen; then
+       if test "$pass" != conv; then
+         # Make sure lib_search_path contains only unique directories.
+         lib_search_path=
+         for dir in $newlib_search_path; do
+           case "$lib_search_path " in
+           *" $dir "*) ;;
+           *) lib_search_path="$lib_search_path $dir" ;;
+           esac
+         done
+         newlib_search_path=
+       fi
+
+       if test "$linkmode,$pass" != "prog,link"; then
+         vars="deplibs"
+       else
+         vars="compile_deplibs finalize_deplibs"
+       fi
+       for var in $vars dependency_libs; do
+         # Add libraries to $var in reverse order
+         eval tmp_libs=\"\$$var\"
+         new_libs=
+         for deplib in $tmp_libs; do
+           # FIXME: Pedantically, this is the right thing to do, so
+           #        that some nasty dependency loop isn't accidentally
+           #        broken:
+           #new_libs="$deplib $new_libs"
+           # Pragmatically, this seems to cause very few problems in
+           # practice:
+           case $deplib in
+           -L*) new_libs="$deplib $new_libs" ;;
+           -R*) ;;
+           *)
+             # And here is the reason: when a library appears more
+             # than once as an explicit dependence of a library, or
+             # is implicitly linked in more than once by the
+             # compiler, it is considered special, and multiple
+             # occurrences thereof are not removed.  Compare this
+             # with having the same library being listed as a
+             # dependency of multiple other libraries: in this case,
+             # we know (pedantically, we assume) the library does not
+             # need to be listed more than once, so we keep only the
+             # last copy.  This is not always right, but it is rare
+             # enough that we require users that really mean to play
+             # such unportable linking tricks to link the library
+             # using -Wl,-lname, so that libtool does not consider it
+             # for duplicate removal.
+             case " $specialdeplibs " in
+             *" $deplib "*) new_libs="$deplib $new_libs" ;;
+             *)
+               case " $new_libs " in
+               *" $deplib "*) ;;
+               *) new_libs="$deplib $new_libs" ;;
+               esac
+               ;;
+             esac
+             ;;
+           esac
+         done
+         tmp_libs=
+         for deplib in $new_libs; do
+           case $deplib in
+           -L*)
+             case " $tmp_libs " in
+             *" $deplib "*) ;;
+             *) tmp_libs="$tmp_libs $deplib" ;;
+             esac
+             ;;
+           *) tmp_libs="$tmp_libs $deplib" ;;
+           esac
+         done
+         eval $var=\"$tmp_libs\"
+       done # for var
+      fi
+      # Last step: remove runtime libs from dependency_libs
+      # (they stay in deplibs)
+      tmp_libs=
+      for i in $dependency_libs ; do
+       case " $predeps $postdeps $compiler_lib_search_path " in
+       *" $i "*)
+         i=""
+         ;;
+       esac
+       if test -n "$i" ; then
+         tmp_libs="$tmp_libs $i"
+       fi
+      done
+      dependency_libs=$tmp_libs
+    done # for pass
+    if test "$linkmode" = prog; then
+      dlfiles="$newdlfiles"
+      dlprefiles="$newdlprefiles"
+    fi
+
+    case $linkmode in
+    oldlib)
+      if test -n "$deplibs"; then
+       $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
+      fi
+
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+       $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
+      fi
+
+      if test -n "$rpath"; then
+       $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
+      fi
+
+      if test -n "$xrpath"; then
+       $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
+      fi
+
+      if test -n "$vinfo"; then
+       $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
+      fi
+
+      if test -n "$release"; then
+       $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
+      fi
+
+      if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+       $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
+      fi
+
+      # Now set the variables for building old libraries.
+      build_libtool_libs=no
+      oldlibs="$output"
+      objs="$objs$old_deplibs"
+      ;;
+
+    lib)
+      # Make sure we only generate libraries of the form `libNAME.la'.
+      case $outputname in
+      lib*)
+       name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+       eval shared_ext=\"$shrext_cmds\"
+       eval libname=\"$libname_spec\"
+       ;;
+      *)
+       if test "$module" = no; then
+         $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
+         $echo "$help" 1>&2
+         exit $EXIT_FAILURE
+       fi
+       if test "$need_lib_prefix" != no; then
+         # Add the "lib" prefix for modules if required
+         name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
+         eval shared_ext=\"$shrext_cmds\"
+         eval libname=\"$libname_spec\"
+       else
+         libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
+       fi
+       ;;
+      esac
+
+      if test -n "$objs"; then
+       if test "$deplibs_check_method" != pass_all; then
+         $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
+         exit $EXIT_FAILURE
+       else
+         $echo
+         $echo "*** Warning: Linking the shared library $output against the non-libtool"
+         $echo "*** objects $objs is not portable!"
+         libobjs="$libobjs $objs"
+       fi
+      fi
+
+      if test "$dlself" != no; then
+       $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
+      fi
+
+      set dummy $rpath
+      if test "$#" -gt 2; then
+       $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
+      fi
+      install_libdir="$2"
+
+      oldlibs=
+      if test -z "$rpath"; then
+       if test "$build_libtool_libs" = yes; then
+         # Building a libtool convenience library.
+         # Some compilers have problems with a `.al' extension so
+         # convenience libraries should have the same extension an
+         # archive normally would.
+         oldlibs="$output_objdir/$libname.$libext $oldlibs"
+         build_libtool_libs=convenience
+         build_old_libs=yes
+       fi
+
+       if test -n "$vinfo"; then
+         $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
+       fi
+
+       if test -n "$release"; then
+         $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
+       fi
+      else
+
+       # Parse the version information argument.
+       save_ifs="$IFS"; IFS=':'
+       set dummy $vinfo 0 0 0
+       IFS="$save_ifs"
+
+       if test -n "$8"; then
+         $echo "$modename: too many parameters to \`-version-info'" 1>&2
+         $echo "$help" 1>&2
+         exit $EXIT_FAILURE
+       fi
+
+       # convert absolute version numbers to libtool ages
+       # this retains compatibility with .la files and attempts
+       # to make the code below a bit more comprehensible
+
+       case $vinfo_number in
+       yes)
+         number_major="$2"
+         number_minor="$3"
+         number_revision="$4"
+         #
+         # There are really only two kinds -- those that
+         # use the current revision as the major version
+         # and those that subtract age and use age as
+         # a minor version.  But, then there is irix
+         # which has an extra 1 added just for fun
+         #
+         case $version_type in
+         darwin|linux|osf|windows|none)
+           current=`expr $number_major + $number_minor`
+           age="$number_minor"
+           revision="$number_revision"
+           ;;
+         freebsd-aout|freebsd-elf|sunos)
+           current="$number_major"
+           revision="$number_minor"
+           age="0"
+           ;;
+         irix|nonstopux)
+           current=`expr $number_major + $number_minor - 1`
+           age="$number_minor"
+           revision="$number_minor"
+           ;;
+         esac
+         ;;
+       no)
+         current="$2"
+         revision="$3"
+         age="$4"
+         ;;
+       esac
+
+       # Check that each of the things are valid numbers.
+       case $current in
+       0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+       *)
+         $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
+         $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+         exit $EXIT_FAILURE
+         ;;
+       esac
+
+       case $revision in
+       0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+       *)
+         $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
+         $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+         exit $EXIT_FAILURE
+         ;;
+       esac
+
+       case $age in
+       0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+       *)
+         $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
+         $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+         exit $EXIT_FAILURE
+         ;;
+       esac
+
+       if test "$age" -gt "$current"; then
+         $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
+         $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+         exit $EXIT_FAILURE
+       fi
+
+       # Calculate the version variables.
+       major=
+       versuffix=
+       verstring=
+       case $version_type in
+       none) ;;
+
+       darwin)
+         # Like Linux, but with the current version available in
+         # verstring for coding it into the library header
+         major=.`expr $current - $age`
+         versuffix="$major.$age.$revision"
+         # Darwin ld doesn't like 0 for these options...
+         minor_current=`expr $current + 1`
+         verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+         ;;
+
+       freebsd-aout)
+         major=".$current"
+         versuffix=".$current.$revision";
+         ;;
+
+       freebsd-elf)
+         major=".$current"
+         versuffix=".$current";
+         ;;
+
+       irix | nonstopux)
+         major=`expr $current - $age + 1`
+
+         case $version_type in
+           nonstopux) verstring_prefix=nonstopux ;;
+           *)         verstring_prefix=sgi ;;
+         esac
+         verstring="$verstring_prefix$major.$revision"
+
+         # Add in all the interfaces that we are compatible with.
+         loop=$revision
+         while test "$loop" -ne 0; do
+           iface=`expr $revision - $loop`
+           loop=`expr $loop - 1`
+           verstring="$verstring_prefix$major.$iface:$verstring"
+         done
+
+         # Before this point, $major must not contain `.'.
+         major=.$major
+         versuffix="$major.$revision"
+         ;;
+
+       linux)
+         major=.`expr $current - $age`
+         versuffix="$major.$age.$revision"
+         ;;
+
+       osf)
+         major=.`expr $current - $age`
+         versuffix=".$current.$age.$revision"
+         verstring="$current.$age.$revision"
+
+         # Add in all the interfaces that we are compatible with.
+         loop=$age
+         while test "$loop" -ne 0; do
+           iface=`expr $current - $loop`
+           loop=`expr $loop - 1`
+           verstring="$verstring:${iface}.0"
+         done
+
+         # Make executables depend on our current version.
+         verstring="$verstring:${current}.0"
+         ;;
+
+       sunos)
+         major=".$current"
+         versuffix=".$current.$revision"
+         ;;
+
+       windows)
+         # Use '-' rather than '.', since we only want one
+         # extension on DOS 8.3 filesystems.
+         major=`expr $current - $age`
+         versuffix="-$major"
+         ;;
+
+       *)
+         $echo "$modename: unknown library version type \`$version_type'" 1>&2
+         $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
+         exit $EXIT_FAILURE
+         ;;
+       esac
+
+       # Clear the version info if we defaulted, and they specified a release.
+       if test -z "$vinfo" && test -n "$release"; then
+         major=
+         case $version_type in
+         darwin)
+           # we can't check for "0.0" in archive_cmds due to quoting
+           # problems, so we reset it completely
+           verstring=
+           ;;
+         *)
+           verstring="0.0"
+           ;;
+         esac
+         if test "$need_version" = no; then
+           versuffix=
+         else
+           versuffix=".0.0"
+         fi
+       fi
+
+       # Remove version info from name if versioning should be avoided
+       if test "$avoid_version" = yes && test "$need_version" = no; then
+         major=
+         versuffix=
+         verstring=""
+       fi
+
+       # Check to see if the archive will have undefined symbols.
+       if test "$allow_undefined" = yes; then
+         if test "$allow_undefined_flag" = unsupported; then
+           $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
+           build_libtool_libs=no
+           build_old_libs=yes
+         fi
+       else
+         # Don't allow undefined symbols.
+         allow_undefined_flag="$no_undefined_flag"
+       fi
+      fi
+
+      if test "$mode" != relink; then
+       # Remove our outputs, but don't remove object files since they
+       # may have been created when compiling PIC objects.
+       removelist=
+       tempremovelist=`$echo "$output_objdir/*"`
+       for p in $tempremovelist; do
+         case $p in
+           *.$objext)
+              ;;
+           $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
+              if test "X$precious_files_regex" != "X"; then
+                if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
+                then
+                  continue
+                fi
+              fi
+              removelist="$removelist $p"
+              ;;
+           *) ;;
+         esac
+       done
+       if test -n "$removelist"; then
+         $show "${rm}r $removelist"
+         $run ${rm}r $removelist
+       fi
+      fi
+
+      # Now set the variables for building old libraries.
+      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+       oldlibs="$oldlibs $output_objdir/$libname.$libext"
+
+       # Transform .lo files to .o files.
+       oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
+      fi
+
+      # Eliminate all temporary directories.
+#      for path in $notinst_path; do
+#      lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
+#      deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
+#      dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
+#      done
+
+      if test -n "$xrpath"; then
+       # If the user specified any rpath flags, then add them.
+       temp_xrpath=
+       for libdir in $xrpath; do
+         temp_xrpath="$temp_xrpath -R$libdir"
+         case "$finalize_rpath " in
+         *" $libdir "*) ;;
+         *) finalize_rpath="$finalize_rpath $libdir" ;;
+         esac
+       done
+       if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+         dependency_libs="$temp_xrpath $dependency_libs"
+       fi
+      fi
+
+      # Make sure dlfiles contains only unique files that won't be dlpreopened
+      old_dlfiles="$dlfiles"
+      dlfiles=
+      for lib in $old_dlfiles; do
+       case " $dlprefiles $dlfiles " in
+       *" $lib "*) ;;
+       *) dlfiles="$dlfiles $lib" ;;
+       esac
+      done
+
+      # Make sure dlprefiles contains only unique files
+      old_dlprefiles="$dlprefiles"
+      dlprefiles=
+      for lib in $old_dlprefiles; do
+       case "$dlprefiles " in
+       *" $lib "*) ;;
+       *) dlprefiles="$dlprefiles $lib" ;;
+       esac
+      done
+
+      if test "$build_libtool_libs" = yes; then
+       if test -n "$rpath"; then
+         case $host in
+         *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
+           # these systems don't actually have a c library (as such)!
+           ;;
+         *-*-rhapsody* | *-*-darwin1.[012])
+           # Rhapsody C library is in the System framework
+           deplibs="$deplibs -framework System"
+           ;;
+         *-*-netbsd*)
+           # Don't link with libc until the a.out ld.so is fixed.
+           ;;
+         *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+           # Do not include libc due to us having libc/libc_r.
+           ;;
+         *-*-sco3.2v5* | *-*-sco5v6*)
+           # Causes problems with __ctype
+           ;;
+         *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+           # Compiler inserts libc in the correct place for threads to work
+           ;;
+         *)
+           # Add libc to deplibs on all other systems if necessary.
+           if test "$build_libtool_need_lc" = "yes"; then
+             deplibs="$deplibs -lc"
+           fi
+           ;;
+         esac
+       fi
+
+       # Transform deplibs into only deplibs that can be linked in shared.
+       name_save=$name
+       libname_save=$libname
+       release_save=$release
+       versuffix_save=$versuffix
+       major_save=$major
+       # I'm not sure if I'm treating the release correctly.  I think
+       # release should show up in the -l (ie -lgmp5) so we don't want to
+       # add it in twice.  Is that correct?
+       release=""
+       versuffix=""
+       major=""
+       newdeplibs=
+       droppeddeps=no
+       case $deplibs_check_method in
+       pass_all)
+         # Don't check for shared/static.  Everything works.
+         # This might be a little naive.  We might want to check
+         # whether the library exists or not.  But this is on
+         # osf3 & osf4 and I'm not really sure... Just
+         # implementing what was already the behavior.
+         newdeplibs=$deplibs
+         ;;
+       test_compile)
+         # This code stresses the "libraries are programs" paradigm to its
+         # limits. Maybe even breaks it.  We compile a program, linking it
+         # against the deplibs as a proxy for the library.  Then we can check
+         # whether they linked in statically or dynamically with ldd.
+         $rm conftest.c
+         cat > conftest.c <<EOF
+         int main() { return 0; }
+EOF
+         $rm conftest
+      if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
+           ldd_output=`ldd conftest`
+           for i in $deplibs; do
+             name=`expr $i : '-l\(.*\)'`
+             # If $name is empty we are operating on a -L argument.
+              if test "$name" != "" && test "$name" != "0"; then
+               if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+                 case " $predeps $postdeps " in
+                 *" $i "*)
+                   newdeplibs="$newdeplibs $i"
+                   i=""
+                   ;;
+                 esac
+               fi
+               if test -n "$i" ; then
+                 libname=`eval \\$echo \"$libname_spec\"`
+                 deplib_matches=`eval \\$echo \"$library_names_spec\"`
+                 set dummy $deplib_matches
+                 deplib_match=$2
+                 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+                   newdeplibs="$newdeplibs $i"
+                 else
+                   droppeddeps=yes
+                   $echo
+                   $echo "*** Warning: dynamic linker does not accept needed library $i."
+                   $echo "*** I have the capability to make that library automatically link in when"
+                   $echo "*** you link to this library.  But I can only do this if you have a"
+                   $echo "*** shared version of the library, which I believe you do not have"
+                   $echo "*** because a test_compile did reveal that the linker did not use it for"
+                   $echo "*** its dynamic dependency list that programs get resolved with at runtime."
+                 fi
+               fi
+             else
+               newdeplibs="$newdeplibs $i"
+             fi
+           done
+         else
+           # Error occurred in the first compile.  Let's try to salvage
+           # the situation: Compile a separate program for each library.
+           for i in $deplibs; do
+             name=`expr $i : '-l\(.*\)'`
+             # If $name is empty we are operating on a -L argument.
+              if test "$name" != "" && test "$name" != "0"; then
+               $rm conftest
+               if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
+                 ldd_output=`ldd conftest`
+                 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+                   case " $predeps $postdeps " in
+                   *" $i "*)
+                     newdeplibs="$newdeplibs $i"
+                     i=""
+                     ;;
+                   esac
+                 fi
+                 if test -n "$i" ; then
+                   libname=`eval \\$echo \"$libname_spec\"`
+                   deplib_matches=`eval \\$echo \"$library_names_spec\"`
+                   set dummy $deplib_matches
+                   deplib_match=$2
+                   if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+                     newdeplibs="$newdeplibs $i"
+                   else
+                     droppeddeps=yes
+                     $echo
+                     $echo "*** Warning: dynamic linker does not accept needed library $i."
+                     $echo "*** I have the capability to make that library automatically link in when"
+                     $echo "*** you link to this library.  But I can only do this if you have a"
+                     $echo "*** shared version of the library, which you do not appear to have"
+                     $echo "*** because a test_compile did reveal that the linker did not use this one"
+                     $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
+                   fi
+                 fi
+               else
+                 droppeddeps=yes
+                 $echo
+                 $echo "*** Warning!  Library $i is needed by this library but I was not able to"
+                 $echo "*** make it link in!  You will probably need to install it or some"
+                 $echo "*** library that it depends on before this library will be fully"
+                 $echo "*** functional.  Installing it before continuing would be even better."
+               fi
+             else
+               newdeplibs="$newdeplibs $i"
+             fi
+           done
+         fi
+         ;;
+       file_magic*)
+         set dummy $deplibs_check_method
+         file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+         for a_deplib in $deplibs; do
+           name=`expr $a_deplib : '-l\(.*\)'`
+           # If $name is empty we are operating on a -L argument.
+            if test "$name" != "" && test  "$name" != "0"; then
+             if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+               case " $predeps $postdeps " in
+               *" $a_deplib "*)
+                 newdeplibs="$newdeplibs $a_deplib"
+                 a_deplib=""
+                 ;;
+               esac
+             fi
+             if test -n "$a_deplib" ; then
+               libname=`eval \\$echo \"$libname_spec\"`
+               for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+                 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+                 for potent_lib in $potential_libs; do
+                     # Follow soft links.
+                     if ls -lLd "$potent_lib" 2>/dev/null \
+                        | grep " -> " >/dev/null; then
+                       continue
+                     fi
+                     # The statement above tries to avoid entering an
+                     # endless loop below, in case of cyclic links.
+                     # We might still enter an endless loop, since a link
+                     # loop can be closed while we follow links,
+                     # but so what?
+                     potlib="$potent_lib"
+                     while test -h "$potlib" 2>/dev/null; do
+                       potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+                       case $potliblink in
+                       [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+                       *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
+                       esac
+                     done
+                     if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
+                        | ${SED} 10q \
+                        | $EGREP "$file_magic_regex" > /dev/null; then
+                       newdeplibs="$newdeplibs $a_deplib"
+                       a_deplib=""
+                       break 2
+                     fi
+                 done
+               done
+             fi
+             if test -n "$a_deplib" ; then
+               droppeddeps=yes
+               $echo
+               $echo "*** Warning: linker path does not have real file for library $a_deplib."
+               $echo "*** I have the capability to make that library automatically link in when"
+               $echo "*** you link to this library.  But I can only do this if you have a"
+               $echo "*** shared version of the library, which you do not appear to have"
+               $echo "*** because I did check the linker path looking for a file starting"
+               if test -z "$potlib" ; then
+                 $echo "*** with $libname but no candidates were found. (...for file magic test)"
+               else
+                 $echo "*** with $libname and none of the candidates passed a file format test"
+                 $echo "*** using a file magic. Last file checked: $potlib"
+               fi
+             fi
+           else
+             # Add a -L argument.
+             newdeplibs="$newdeplibs $a_deplib"
+           fi
+         done # Gone through all deplibs.
+         ;;
+       match_pattern*)
+         set dummy $deplibs_check_method
+         match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+         for a_deplib in $deplibs; do
+           name=`expr $a_deplib : '-l\(.*\)'`
+           # If $name is empty we are operating on a -L argument.
+           if test -n "$name" && test "$name" != "0"; then
+             if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+               case " $predeps $postdeps " in
+               *" $a_deplib "*)
+                 newdeplibs="$newdeplibs $a_deplib"
+                 a_deplib=""
+                 ;;
+               esac
+             fi
+             if test -n "$a_deplib" ; then
+               libname=`eval \\$echo \"$libname_spec\"`
+               for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+                 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+                 for potent_lib in $potential_libs; do
+                   potlib="$potent_lib" # see symlink-check above in file_magic test
+                   if eval $echo \"$potent_lib\" 2>/dev/null \
+                       | ${SED} 10q \
+                       | $EGREP "$match_pattern_regex" > /dev/null; then
+                     newdeplibs="$newdeplibs $a_deplib"
+                     a_deplib=""
+                     break 2
+                   fi
+                 done
+               done
+             fi
+             if test -n "$a_deplib" ; then
+               droppeddeps=yes
+               $echo
+               $echo "*** Warning: linker path does not have real file for library $a_deplib."
+               $echo "*** I have the capability to make that library automatically link in when"
+               $echo "*** you link to this library.  But I can only do this if you have a"
+               $echo "*** shared version of the library, which you do not appear to have"
+               $echo "*** because I did check the linker path looking for a file starting"
+               if test -z "$potlib" ; then
+                 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
+               else
+                 $echo "*** with $libname and none of the candidates passed a file format test"
+                 $echo "*** using a regex pattern. Last file checked: $potlib"
+               fi
+             fi
+           else
+             # Add a -L argument.
+             newdeplibs="$newdeplibs $a_deplib"
+           fi
+         done # Gone through all deplibs.
+         ;;
+       none | unknown | *)
+         newdeplibs=""
+         tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
+           -e 's/ -[LR][^ ]*//g'`
+         if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+           for i in $predeps $postdeps ; do
+             # can't use Xsed below, because $i might contain '/'
+             tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
+           done
+         fi
+         if $echo "X $tmp_deplibs" | $Xsed -e 's/[     ]//g' \
+           | grep . >/dev/null; then
+           $echo
+           if test "X$deplibs_check_method" = "Xnone"; then
+             $echo "*** Warning: inter-library dependencies are not supported in this platform."
+           else
+             $echo "*** Warning: inter-library dependencies are not known to be supported."
+           fi
+           $echo "*** All declared inter-library dependencies are being dropped."
+           droppeddeps=yes
+         fi
+         ;;
+       esac
+       versuffix=$versuffix_save
+       major=$major_save
+       release=$release_save
+       libname=$libname_save
+       name=$name_save
+
+       case $host in
+       *-*-rhapsody* | *-*-darwin1.[012])
+         # On Rhapsody replace the C library is the System framework
+         newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
+         ;;
+       esac
+
+       if test "$droppeddeps" = yes; then
+         if test "$module" = yes; then
+           $echo
+           $echo "*** Warning: libtool could not satisfy all declared inter-library"
+           $echo "*** dependencies of module $libname.  Therefore, libtool will create"
+           $echo "*** a static module, that should work as long as the dlopening"
+           $echo "*** application is linked with the -dlopen flag."
+           if test -z "$global_symbol_pipe"; then
+             $echo
+             $echo "*** However, this would only work if libtool was able to extract symbol"
+             $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+             $echo "*** not find such a program.  So, this module is probably useless."
+             $echo "*** \`nm' from GNU binutils and a full rebuild may help."
+           fi
+           if test "$build_old_libs" = no; then
+             oldlibs="$output_objdir/$libname.$libext"
+             build_libtool_libs=module
+             build_old_libs=yes
+           else
+             build_libtool_libs=no
+           fi
+         else
+           $echo "*** The inter-library dependencies that have been dropped here will be"
+           $echo "*** automatically added whenever a program is linked with this library"
+           $echo "*** or is declared to -dlopen it."
+
+           if test "$allow_undefined" = no; then
+             $echo
+             $echo "*** Since this library must not contain undefined symbols,"
+             $echo "*** because either the platform does not support them or"
+             $echo "*** it was explicitly requested with -no-undefined,"
+             $echo "*** libtool will only create a static version of it."
+             if test "$build_old_libs" = no; then
+               oldlibs="$output_objdir/$libname.$libext"
+               build_libtool_libs=module
+               build_old_libs=yes
+             else
+               build_libtool_libs=no
+             fi
+           fi
+         fi
+       fi
+       # Done checking deplibs!
+       deplibs=$newdeplibs
+      fi
+
+
+      # move library search paths that coincide with paths to not yet
+      # installed libraries to the beginning of the library search list
+      new_libs=
+      for path in $notinst_path; do
+       case " $new_libs " in
+       *" -L$path/$objdir "*) ;;
+       *)
+         case " $deplibs " in
+         *" -L$path/$objdir "*)
+           new_libs="$new_libs -L$path/$objdir" ;;
+         esac
+         ;;
+       esac
+      done
+      for deplib in $deplibs; do
+       case $deplib in
+       -L*)
+         case " $new_libs " in
+         *" $deplib "*) ;;
+         *) new_libs="$new_libs $deplib" ;;
+         esac
+         ;;
+       *) new_libs="$new_libs $deplib" ;;
+       esac
+      done
+      deplibs="$new_libs"
+
+
+      # All the library-specific variables (install_libdir is set above).
+      library_names=
+      old_library=
+      dlname=
+
+      # Test again, we may have decided not to build it any more
+      if test "$build_libtool_libs" = yes; then
+       if test "$hardcode_into_libs" = yes; then
+         # Hardcode the library paths
+         hardcode_libdirs=
+         dep_rpath=
+         rpath="$finalize_rpath"
+         test "$mode" != relink && rpath="$compile_rpath$rpath"
+         for libdir in $rpath; do
+           if test -n "$hardcode_libdir_flag_spec"; then
+             if test -n "$hardcode_libdir_separator"; then
+               if test -z "$hardcode_libdirs"; then
+                 hardcode_libdirs="$libdir"
+               else
+                 # Just accumulate the unique libdirs.
+                 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+                 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+                   ;;
+                 *)
+                   hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+                   ;;
+                 esac
+               fi
+             else
+               eval flag=\"$hardcode_libdir_flag_spec\"
+               dep_rpath="$dep_rpath $flag"
+             fi
+           elif test -n "$runpath_var"; then
+             case "$perm_rpath " in
+             *" $libdir "*) ;;
+             *) perm_rpath="$perm_rpath $libdir" ;;
+             esac
+           fi
+         done
+         # Substitute the hardcoded libdirs into the rpath.
+         if test -n "$hardcode_libdir_separator" &&
+            test -n "$hardcode_libdirs"; then
+           libdir="$hardcode_libdirs"
+           if test -n "$hardcode_libdir_flag_spec_ld"; then
+             eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
+           else
+             eval dep_rpath=\"$hardcode_libdir_flag_spec\"
+           fi
+         fi
+         if test -n "$runpath_var" && test -n "$perm_rpath"; then
+           # We should set the runpath_var.
+           rpath=
+           for dir in $perm_rpath; do
+             rpath="$rpath$dir:"
+           done
+           eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+         fi
+         test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
+       fi
+
+       shlibpath="$finalize_shlibpath"
+       test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+       if test -n "$shlibpath"; then
+         eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
+       fi
+
+       # Get the real and link names of the library.
+       eval shared_ext=\"$shrext_cmds\"
+       eval library_names=\"$library_names_spec\"
+       set dummy $library_names
+       realname="$2"
+       shift; shift
+
+       if test -n "$soname_spec"; then
+         eval soname=\"$soname_spec\"
+       else
+         soname="$realname"
+       fi
+       if test -z "$dlname"; then
+         dlname=$soname
+       fi
+
+       lib="$output_objdir/$realname"
+       linknames=
+       for link
+       do
+         linknames="$linknames $link"
+       done
+
+       # Use standard objects if they are pic
+       test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+
+       # Prepare the list of exported symbols
+       if test -z "$export_symbols"; then
+         if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
+           $show "generating symbol list for \`$libname.la'"
+           export_symbols="$output_objdir/$libname.exp"
+           $run $rm $export_symbols
+           cmds=$export_symbols_cmds
+           save_ifs="$IFS"; IFS='~'
+           for cmd in $cmds; do
+             IFS="$save_ifs"
+             eval cmd=\"$cmd\"
+             if len=`expr "X$cmd" : ".*"` &&
+              test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+               $show "$cmd"
+               $run eval "$cmd" || exit $?
+               skipped_export=false
+             else
+               # The command line is too long to execute in one step.
+               $show "using reloadable object file for export list..."
+               skipped_export=:
+               # Break out early, otherwise skipped_export may be
+               # set to false by a later but shorter cmd.
+               break
+             fi
+           done
+           IFS="$save_ifs"
+           if test -n "$export_symbols_regex"; then
+             $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
+             $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+             $show "$mv \"${export_symbols}T\" \"$export_symbols\""
+             $run eval '$mv "${export_symbols}T" "$export_symbols"'
+           fi
+         fi
+       fi
+
+       if test -n "$export_symbols" && test -n "$include_expsyms"; then
+         $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
+       fi
+
+       tmp_deplibs=
+       for test_deplib in $deplibs; do
+               case " $convenience " in
+               *" $test_deplib "*) ;;
+               *)
+                       tmp_deplibs="$tmp_deplibs $test_deplib"
+                       ;;
+               esac
+       done
+       deplibs="$tmp_deplibs"
+
+       if test -n "$convenience"; then
+         if test -n "$whole_archive_flag_spec"; then
+           save_libobjs=$libobjs
+           eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+         else
+           gentop="$output_objdir/${outputname}x"
+           generated="$generated $gentop"
+
+           func_extract_archives $gentop $convenience
+           libobjs="$libobjs $func_extract_archives_result"
+         fi
+       fi
+       
+       if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+         eval flag=\"$thread_safe_flag_spec\"
+         linker_flags="$linker_flags $flag"
+       fi
+
+       # Make a backup of the uninstalled library when relinking
+       if test "$mode" = relink; then
+         $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
+       fi
+
+       # Do each of the archive commands.
+       if test "$module" = yes && test -n "$module_cmds" ; then
+         if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+           eval test_cmds=\"$module_expsym_cmds\"
+           cmds=$module_expsym_cmds
+         else
+           eval test_cmds=\"$module_cmds\"
+           cmds=$module_cmds
+         fi
+       else
+       if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+         eval test_cmds=\"$archive_expsym_cmds\"
+         cmds=$archive_expsym_cmds
+       else
+         eval test_cmds=\"$archive_cmds\"
+         cmds=$archive_cmds
+         fi
+       fi
+
+       if test "X$skipped_export" != "X:" &&
+          len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
+          test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+         :
+       else
+         # The command line is too long to link in one step, link piecewise.
+         $echo "creating reloadable object files..."
+
+         # Save the value of $output and $libobjs because we want to
+         # use them later.  If we have whole_archive_flag_spec, we
+         # want to use save_libobjs as it was before
+         # whole_archive_flag_spec was expanded, because we can't
+         # assume the linker understands whole_archive_flag_spec.
+         # This may have to be revisited, in case too many
+         # convenience libraries get linked in and end up exceeding
+         # the spec.
+         if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
+           save_libobjs=$libobjs
+         fi
+         save_output=$output
+         output_la=`$echo "X$output" | $Xsed -e "$basename"`
+
+         # Clear the reloadable object creation command queue and
+         # initialize k to one.
+         test_cmds=
+         concat_cmds=
+         objlist=
+         delfiles=
+         last_robj=
+         k=1
+         output=$output_objdir/$output_la-${k}.$objext
+         # Loop over the list of objects to be linked.
+         for obj in $save_libobjs
+         do
+           eval test_cmds=\"$reload_cmds $objlist $last_robj\"
+           if test "X$objlist" = X ||
+              { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
+                test "$len" -le "$max_cmd_len"; }; then
+             objlist="$objlist $obj"
+           else
+             # The command $test_cmds is almost too long, add a
+             # command to the queue.
+             if test "$k" -eq 1 ; then
+               # The first file doesn't have a previous command to add.
+               eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
+             else
+               # All subsequent reloadable object files will link in
+               # the last one created.
+               eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
+             fi
+             last_robj=$output_objdir/$output_la-${k}.$objext
+             k=`expr $k + 1`
+             output=$output_objdir/$output_la-${k}.$objext
+             objlist=$obj
+             len=1
+           fi
+         done
+         # Handle the remaining objects by creating one last
+         # reloadable object file.  All subsequent reloadable object
+         # files will link in the last one created.
+         test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+         eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
+
+         if ${skipped_export-false}; then
+           $show "generating symbol list for \`$libname.la'"
+           export_symbols="$output_objdir/$libname.exp"
+           $run $rm $export_symbols
+           libobjs=$output
+           # Append the command to create the export file.
+           eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
+          fi
+
+         # Set up a command to remove the reloadable object files
+         # after they are used.
+         i=0
+         while test "$i" -lt "$k"
+         do
+           i=`expr $i + 1`
+           delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
+         done
+
+         $echo "creating a temporary reloadable object file: $output"
+
+         # Loop through the commands generated above and execute them.
+         save_ifs="$IFS"; IFS='~'
+         for cmd in $concat_cmds; do
+           IFS="$save_ifs"
+           $show "$cmd"
+           $run eval "$cmd" || exit $?
+         done
+         IFS="$save_ifs"
+
+         libobjs=$output
+         # Restore the value of output.
+         output=$save_output
+
+         if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+           eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+         fi
+         # Expand the library linking commands again to reset the
+         # value of $libobjs for piecewise linking.
+
+         # Do each of the archive commands.
+         if test "$module" = yes && test -n "$module_cmds" ; then
+           if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+             cmds=$module_expsym_cmds
+           else
+             cmds=$module_cmds
+           fi
+         else
+         if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+           cmds=$archive_expsym_cmds
+         else
+           cmds=$archive_cmds
+           fi
+         fi
+
+         # Append the command to remove the reloadable object files
+         # to the just-reset $cmds.
+         eval cmds=\"\$cmds~\$rm $delfiles\"
+       fi
+       save_ifs="$IFS"; IFS='~'
+       for cmd in $cmds; do
+         IFS="$save_ifs"
+         eval cmd=\"$cmd\"
+         $show "$cmd"
+         $run eval "$cmd" || {
+           lt_exit=$?
+
+           # Restore the uninstalled library and exit
+           if test "$mode" = relink; then
+             $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
+           fi
+
+           exit $lt_exit
+         }
+       done
+       IFS="$save_ifs"
+
+       # Restore the uninstalled library and exit
+       if test "$mode" = relink; then
+         $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
+
+         if test -n "$convenience"; then
+           if test -z "$whole_archive_flag_spec"; then
+             $show "${rm}r $gentop"
+             $run ${rm}r "$gentop"
+           fi
+         fi
+
+         exit $EXIT_SUCCESS
+       fi
+
+       # Create links to the real library.
+       for linkname in $linknames; do
+         if test "$realname" != "$linkname"; then
+           $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
+           $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
+         fi
+       done
+
+       # If -module or -export-dynamic was specified, set the dlname.
+       if test "$module" = yes || test "$export_dynamic" = yes; then
+         # On all known operating systems, these are identical.
+         dlname="$soname"
+       fi
+      fi
+      ;;
+
+    obj)
+      if test -n "$deplibs"; then
+       $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
+      fi
+
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+       $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
+      fi
+
+      if test -n "$rpath"; then
+       $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
+      fi
+
+      if test -n "$xrpath"; then
+       $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
+      fi
+
+      if test -n "$vinfo"; then
+       $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
+      fi
+
+      if test -n "$release"; then
+       $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
+      fi
+
+      case $output in
+      *.lo)
+       if test -n "$objs$old_deplibs"; then
+         $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
+         exit $EXIT_FAILURE
+       fi
+       libobj="$output"
+       obj=`$echo "X$output" | $Xsed -e "$lo2o"`
+       ;;
+      *)
+       libobj=
+       obj="$output"
+       ;;
+      esac
+
+      # Delete the old objects.
+      $run $rm $obj $libobj
+
+      # Objects from convenience libraries.  This assumes
+      # single-version convenience libraries.  Whenever we create
+      # different ones for PIC/non-PIC, this we'll have to duplicate
+      # the extraction.
+      reload_conv_objs=
+      gentop=
+      # reload_cmds runs $LD directly, so let us get rid of
+      # -Wl from whole_archive_flag_spec and hope we can get by with
+      # turning comma into space..
+      wl=
+
+      if test -n "$convenience"; then
+       if test -n "$whole_archive_flag_spec"; then
+         eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
+      reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
+       else
+         gentop="$output_objdir/${obj}x"
+         generated="$generated $gentop"
+
+         func_extract_archives $gentop $convenience
+         reload_conv_objs="$reload_objs $func_extract_archives_result"
+       fi
+      fi
+
+      # Create the old-style object.
+      reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+
+      output="$obj"
+      cmds=$reload_cmds
+      save_ifs="$IFS"; IFS='~'
+      for cmd in $cmds; do
+       IFS="$save_ifs"
+       eval cmd=\"$cmd\"
+       $show "$cmd"
+       $run eval "$cmd" || exit $?
+      done
+      IFS="$save_ifs"
+
+      # Exit if we aren't doing a library object file.
+      if test -z "$libobj"; then
+       if test -n "$gentop"; then
+         $show "${rm}r $gentop"
+         $run ${rm}r $gentop
+       fi
+
+       exit $EXIT_SUCCESS
+      fi
+
+      if test "$build_libtool_libs" != yes; then
+       if test -n "$gentop"; then
+         $show "${rm}r $gentop"
+         $run ${rm}r $gentop
+       fi
+
+       # Create an invalid libtool object if no PIC, so that we don't
+       # accidentally link it into a program.
+       # $show "echo timestamp > $libobj"
+       # $run eval "echo timestamp > $libobj" || exit $?
+       exit $EXIT_SUCCESS
+      fi
+
+      if test -n "$pic_flag" || test "$pic_mode" != default; then
+       # Only do commands if we really have different PIC objects.
+       reload_objs="$libobjs $reload_conv_objs"
+       output="$libobj"
+       cmds=$reload_cmds
+       save_ifs="$IFS"; IFS='~'
+       for cmd in $cmds; do
+         IFS="$save_ifs"
+         eval cmd=\"$cmd\"
+         $show "$cmd"
+         $run eval "$cmd" || exit $?
+       done
+       IFS="$save_ifs"
+      fi
+
+      if test -n "$gentop"; then
+       $show "${rm}r $gentop"
+       $run ${rm}r $gentop
+      fi
+
+      exit $EXIT_SUCCESS
+      ;;
+
+    prog)
+      case $host in
+       *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
+      esac
+      if test -n "$vinfo"; then
+       $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
+      fi
+
+      if test -n "$release"; then
+       $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
+      fi
+
+      if test "$preload" = yes; then
+       if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
+          test "$dlopen_self_static" = unknown; then
+         $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
+       fi
+      fi
+
+      case $host in
+      *-*-rhapsody* | *-*-darwin1.[012])
+       # On Rhapsody replace the C library is the System framework
+       compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
+       finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
+       ;;
+      esac
+
+      case $host in
+      *darwin*)
+        # Don't allow lazy linking, it breaks C++ global constructors
+        if test "$tagname" = CXX ; then
+        compile_command="$compile_command ${wl}-bind_at_load"
+        finalize_command="$finalize_command ${wl}-bind_at_load"
+        fi
+        ;;
+      esac
+
+
+      # move library search paths that coincide with paths to not yet
+      # installed libraries to the beginning of the library search list
+      new_libs=
+      for path in $notinst_path; do
+       case " $new_libs " in
+       *" -L$path/$objdir "*) ;;
+       *)
+         case " $compile_deplibs " in
+         *" -L$path/$objdir "*)
+           new_libs="$new_libs -L$path/$objdir" ;;
+         esac
+         ;;
+       esac
+      done
+      for deplib in $compile_deplibs; do
+       case $deplib in
+       -L*)
+         case " $new_libs " in
+         *" $deplib "*) ;;
+         *) new_libs="$new_libs $deplib" ;;
+         esac
+         ;;
+       *) new_libs="$new_libs $deplib" ;;
+       esac
+      done
+      compile_deplibs="$new_libs"
+
+
+      compile_command="$compile_command $compile_deplibs"
+      finalize_command="$finalize_command $finalize_deplibs"
+
+      if test -n "$rpath$xrpath"; then
+       # If the user specified any rpath flags, then add them.
+       for libdir in $rpath $xrpath; do
+         # This is the magic to use -rpath.
+         case "$finalize_rpath " in
+         *" $libdir "*) ;;
+         *) finalize_rpath="$finalize_rpath $libdir" ;;
+         esac
+       done
+      fi
+
+      # Now hardcode the library paths
+      rpath=
+      hardcode_libdirs=
+      for libdir in $compile_rpath $finalize_rpath; do
+       if test -n "$hardcode_libdir_flag_spec"; then
+         if test -n "$hardcode_libdir_separator"; then
+           if test -z "$hardcode_libdirs"; then
+             hardcode_libdirs="$libdir"
+           else
+             # Just accumulate the unique libdirs.
+             case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+             *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+               ;;
+             *)
+               hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+               ;;
+             esac
+           fi
+         else
+           eval flag=\"$hardcode_libdir_flag_spec\"
+           rpath="$rpath $flag"
+         fi
+       elif test -n "$runpath_var"; then
+         case "$perm_rpath " in
+         *" $libdir "*) ;;
+         *) perm_rpath="$perm_rpath $libdir" ;;
+         esac
+       fi
+       case $host in
+       *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+         testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
+         case :$dllsearchpath: in
+         *":$libdir:"*) ;;
+         *) dllsearchpath="$dllsearchpath:$libdir";;
+         esac
+         case :$dllsearchpath: in
+         *":$testbindir:"*) ;;
+         *) dllsearchpath="$dllsearchpath:$testbindir";;
+         esac
+         ;;
+       esac
+      done
+      # Substitute the hardcoded libdirs into the rpath.
+      if test -n "$hardcode_libdir_separator" &&
+        test -n "$hardcode_libdirs"; then
+       libdir="$hardcode_libdirs"
+       eval rpath=\" $hardcode_libdir_flag_spec\"
+      fi
+      compile_rpath="$rpath"
+
+      rpath=
+      hardcode_libdirs=
+      for libdir in $finalize_rpath; do
+       if test -n "$hardcode_libdir_flag_spec"; then
+         if test -n "$hardcode_libdir_separator"; then
+           if test -z "$hardcode_libdirs"; then
+             hardcode_libdirs="$libdir"
+           else
+             # Just accumulate the unique libdirs.
+             case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+             *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+               ;;
+             *)
+               hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+               ;;
+             esac
+           fi
+         else
+           eval flag=\"$hardcode_libdir_flag_spec\"
+           rpath="$rpath $flag"
+         fi
+       elif test -n "$runpath_var"; then
+         case "$finalize_perm_rpath " in
+         *" $libdir "*) ;;
+         *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
+         esac
+       fi
+      done
+      # Substitute the hardcoded libdirs into the rpath.
+      if test -n "$hardcode_libdir_separator" &&
+        test -n "$hardcode_libdirs"; then
+       libdir="$hardcode_libdirs"
+       eval rpath=\" $hardcode_libdir_flag_spec\"
+      fi
+      finalize_rpath="$rpath"
+
+      if test -n "$libobjs" && test "$build_old_libs" = yes; then
+       # Transform all the library objects into standard objects.
+       compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+       finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+      fi
+
+      dlsyms=
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+       if test -n "$NM" && test -n "$global_symbol_pipe"; then
+         dlsyms="${outputname}S.c"
+       else
+         $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
+       fi
+      fi
+
+      if test -n "$dlsyms"; then
+       case $dlsyms in
+       "") ;;
+       *.c)
+         # Discover the nlist of each of the dlfiles.
+         nlist="$output_objdir/${outputname}.nm"
+
+         $show "$rm $nlist ${nlist}S ${nlist}T"
+         $run $rm "$nlist" "${nlist}S" "${nlist}T"
+
+         # Parse the name list into a source file.
+         $show "creating $output_objdir/$dlsyms"
+
+         test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
+/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
+/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+/* Prevent the only kind of declaration conflicts we can make. */
+#define lt_preloaded_symbols some_other_symbol
+
+/* External symbol declarations for the compiler. */\
+"
+
+         if test "$dlself" = yes; then
+           $show "generating symbol list for \`$output'"
+
+           test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
+
+           # Add our own program objects to the symbol list.
+           progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+           for arg in $progfiles; do
+             $show "extracting global C symbols from \`$arg'"
+             $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+           done
+
+           if test -n "$exclude_expsyms"; then
+             $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+             $run eval '$mv "$nlist"T "$nlist"'
+           fi
+
+           if test -n "$export_symbols_regex"; then
+             $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+             $run eval '$mv "$nlist"T "$nlist"'
+           fi
+
+           # Prepare the list of exported symbols
+           if test -z "$export_symbols"; then
+             export_symbols="$output_objdir/$outputname.exp"
+             $run $rm $export_symbols
+             $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+              case $host in
+              *cygwin* | *mingw* )
+               $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+               $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
+                ;;
+              esac
+           else
+             $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+             $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
+             $run eval 'mv "$nlist"T "$nlist"'
+              case $host in
+              *cygwin* | *mingw* )
+               $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+               $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
+                ;;
+              esac
+           fi
+         fi
+
+         for arg in $dlprefiles; do
+           $show "extracting global C symbols from \`$arg'"
+           name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
+           $run eval '$echo ": $name " >> "$nlist"'
+           $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+         done
+
+         if test -z "$run"; then
+           # Make sure we have at least an empty file.
+           test -f "$nlist" || : > "$nlist"
+
+           if test -n "$exclude_expsyms"; then
+             $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+             $mv "$nlist"T "$nlist"
+           fi
+
+           # Try sorting and uniquifying the output.
+           if grep -v "^: " < "$nlist" |
+               if sort -k 3 </dev/null >/dev/null 2>&1; then
+                 sort -k 3
+               else
+                 sort +2
+               fi |
+               uniq > "$nlist"S; then
+             :
+           else
+             grep -v "^: " < "$nlist" > "$nlist"S
+           fi
+
+           if test -f "$nlist"S; then
+             eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
+           else
+             $echo '/* NONE */' >> "$output_objdir/$dlsyms"
+           fi
+
+           $echo >> "$output_objdir/$dlsyms" "\
+
+#undef lt_preloaded_symbols
+
+#if defined (__STDC__) && __STDC__
+# define lt_ptr void *
+#else
+# define lt_ptr char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+"
+
+           case $host in
+           *cygwin* | *mingw* )
+         $echo >> "$output_objdir/$dlsyms" "\
+/* DATA imports from DLLs on WIN32 can't be const, because
+   runtime relocations are performed -- see ld's documentation
+   on pseudo-relocs */
+struct {
+"
+             ;;
+           * )
+         $echo >> "$output_objdir/$dlsyms" "\
+const struct {
+"
+             ;;
+           esac
+
+
+         $echo >> "$output_objdir/$dlsyms" "\
+  const char *name;
+  lt_ptr address;
+}
+lt_preloaded_symbols[] =
+{\
+"
+
+           eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
+
+           $echo >> "$output_objdir/$dlsyms" "\
+  {0, (lt_ptr) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+         fi
+
+         pic_flag_for_symtable=
+         case $host in
+         # compiling the symbol table file with pic_flag works around
+         # a FreeBSD bug that causes programs to crash when -lm is
+         # linked before any other PIC object.  But we must not use
+         # pic_flag when linking with -static.  The problem exists in
+         # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+         *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+           case "$compile_command " in
+           *" -static "*) ;;
+           *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
+           esac;;
+         *-*-hpux*)
+           case "$compile_command " in
+           *" -static "*) ;;
+           *) pic_flag_for_symtable=" $pic_flag";;
+           esac
+         esac
+
+         # Now compile the dynamic symbol file.
+         $show "(cd $output_objdir && $LTCC  $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
+         $run eval '(cd $output_objdir && $LTCC  $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
+
+         # Clean up the generated files.
+         $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
+         $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
+
+         # Transform the symbol file into the correct name.
+          case $host in
+          *cygwin* | *mingw* )
+            if test -f "$output_objdir/${outputname}.def" ; then
+              compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
+              finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
+            else
+              compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
+              finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
+             fi
+            ;;
+          * )
+            compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
+            finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
+            ;;
+          esac
+         ;;
+       *)
+         $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
+         exit $EXIT_FAILURE
+         ;;
+       esac
+      else
+       # We keep going just in case the user didn't refer to
+       # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
+       # really was required.
+
+       # Nullify the symbol file.
+       compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
+       finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
+      fi
+
+      if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
+       # Replace the output file specification.
+       compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP`
+       link_command="$compile_command$compile_rpath"
+
+       # We have no uninstalled library dependencies, so finalize right now.
+       $show "$link_command"
+       $run eval "$link_command"
+       exit_status=$?
+
+       # Delete the generated files.
+       if test -n "$dlsyms"; then
+         $show "$rm $output_objdir/${outputname}S.${objext}"
+         $run $rm "$output_objdir/${outputname}S.${objext}"
+       fi
+
+       exit $exit_status
+      fi
+
+      if test -n "$shlibpath_var"; then
+       # We should set the shlibpath_var
+       rpath=
+       for dir in $temp_rpath; do
+         case $dir in
+         [\\/]* | [A-Za-z]:[\\/]*)
+           # Absolute path.
+           rpath="$rpath$dir:"
+           ;;
+         *)
+           # Relative path: add a thisdir entry.
+           rpath="$rpath\$thisdir/$dir:"
+           ;;
+         esac
+       done
+       temp_rpath="$rpath"
+      fi
+
+      if test -n "$compile_shlibpath$finalize_shlibpath"; then
+       compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
+      fi
+      if test -n "$finalize_shlibpath"; then
+       finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+      fi
+
+      compile_var=
+      finalize_var=
+      if test -n "$runpath_var"; then
+       if test -n "$perm_rpath"; then
+         # We should set the runpath_var.
+         rpath=
+         for dir in $perm_rpath; do
+           rpath="$rpath$dir:"
+         done
+         compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+       fi
+       if test -n "$finalize_perm_rpath"; then
+         # We should set the runpath_var.
+         rpath=
+         for dir in $finalize_perm_rpath; do
+           rpath="$rpath$dir:"
+         done
+         finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+       fi
+      fi
+
+      if test "$no_install" = yes; then
+       # We don't need to create a wrapper script.
+       link_command="$compile_var$compile_command$compile_rpath"
+       # Replace the output file specification.
+       link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+       # Delete the old output file.
+       $run $rm $output
+       # Link the executable and exit
+       $show "$link_command"
+       $run eval "$link_command" || exit $?
+       exit $EXIT_SUCCESS
+      fi
+
+      if test "$hardcode_action" = relink; then
+       # Fast installation is not supported
+       link_command="$compile_var$compile_command$compile_rpath"
+       relink_command="$finalize_var$finalize_command$finalize_rpath"
+
+       $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
+       $echo "$modename: \`$output' will be relinked during installation" 1>&2
+      else
+       if test "$fast_install" != no; then
+         link_command="$finalize_var$compile_command$finalize_rpath"
+         if test "$fast_install" = yes; then
+           relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP`
+         else
+           # fast_install is set to needless
+           relink_command=
+         fi
+       else
+         link_command="$compile_var$compile_command$compile_rpath"
+         relink_command="$finalize_var$finalize_command$finalize_rpath"
+       fi
+      fi
+
+      # Replace the output file specification.
+      link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+
+      # Delete the old output files.
+      $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+      $show "$link_command"
+      $run eval "$link_command" || exit $?
+
+      # Now create the wrapper script.
+      $show "creating $output"
+
+      # Quote the relink command for shipping.
+      if test -n "$relink_command"; then
+       # Preserve any variables that may affect compiler behavior
+       for var in $variables_saved_for_relink; do
+         if eval test -z \"\${$var+set}\"; then
+           relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
+         elif eval var_value=\$$var; test -z "$var_value"; then
+           relink_command="$var=; export $var; $relink_command"
+         else
+           var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
+           relink_command="$var=\"$var_value\"; export $var; $relink_command"
+         fi
+       done
+       relink_command="(cd `pwd`; $relink_command)"
+       relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
+      fi
+
+      # Quote $echo for shipping.
+      if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
+       case $progpath in
+       [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
+       *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
+       esac
+       qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
+      else
+       qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
+      fi
+
+      # Only actually do things if our run command is non-null.
+      if test -z "$run"; then
+       # win32 will think the script is a binary if it has
+       # a .exe suffix, so we strip it off here.
+       case $output in
+         *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
+       esac
+       # test for cygwin because mv fails w/o .exe extensions
+       case $host in
+         *cygwin*)
+           exeext=.exe
+           outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
+         *) exeext= ;;
+       esac
+       case $host in
+         *cygwin* | *mingw* )
+            output_name=`basename $output`
+            output_path=`dirname $output`
+            cwrappersource="$output_path/$objdir/lt-$output_name.c"
+            cwrapper="$output_path/$output_name.exe"
+            $rm $cwrappersource $cwrapper
+            trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+
+           cat > $cwrappersource <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+   Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+
+   The $output program cannot be directly executed until all the libtool
+   libraries that it depends on are installed.
+
+   This wrapper executable should never be moved out of the build directory.
+   If it is, it will not operate correctly.
+
+   Currently, it simply execs the wrapper *script* "/bin/sh $output",
+   but could eventually absorb all of the scripts functionality and
+   exec $objdir/$outputname directly.
+*/
+EOF
+           cat >> $cwrappersource<<"EOF"
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <string.h>
+#include <ctype.h>
+#include <sys/stat.h>
+
+#if defined(PATH_MAX)
+# define LT_PATHMAX PATH_MAX
+#elif defined(MAXPATHLEN)
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef DIR_SEPARATOR
+# define DIR_SEPARATOR '/'
+# define PATH_SEPARATOR ':'
+#endif
+
+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
+  defined (__OS2__)
+# define HAVE_DOS_BASED_FILE_SYSTEM
+# ifndef DIR_SEPARATOR_2
+#  define DIR_SEPARATOR_2 '\\'
+# endif
+# ifndef PATH_SEPARATOR_2
+#  define PATH_SEPARATOR_2 ';'
+# endif
+#endif
+
+#ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+#else /* DIR_SEPARATOR_2 */
+# define IS_DIR_SEPARATOR(ch) \
+        (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+#endif /* DIR_SEPARATOR_2 */
+
+#ifndef PATH_SEPARATOR_2
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
+#else /* PATH_SEPARATOR_2 */
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
+#endif /* PATH_SEPARATOR_2 */
+
+#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+  if (stale) { free ((void *) stale); stale = 0; } \
+} while (0)
+
+/* -DDEBUG is fairly common in CFLAGS.  */
+#undef DEBUG
+#if defined DEBUGWRAPPER
+# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
+#else
+# define DEBUG(format, ...)
+#endif
+
+const char *program_name = NULL;
+
+void * xmalloc (size_t num);
+char * xstrdup (const char *string);
+const char * base_name (const char *name);
+char * find_executable(const char *wrapper);
+int    check_executable(const char *path);
+char * strendzap(char *str, const char *pat);
+void lt_fatal (const char *message, ...);
+
+int
+main (int argc, char *argv[])
+{
+  char **newargz;
+  int i;
+
+  program_name = (char *) xstrdup (base_name (argv[0]));
+  DEBUG("(main) argv[0]      : %s\n",argv[0]);
+  DEBUG("(main) program_name : %s\n",program_name);
+  newargz = XMALLOC(char *, argc+2);
+EOF
+
+            cat >> $cwrappersource <<EOF
+  newargz[0] = (char *) xstrdup("$SHELL");
+EOF
+
+            cat >> $cwrappersource <<"EOF"
+  newargz[1] = find_executable(argv[0]);
+  if (newargz[1] == NULL)
+    lt_fatal("Couldn't find %s", argv[0]);
+  DEBUG("(main) found exe at : %s\n",newargz[1]);
+  /* we know the script has the same name, without the .exe */
+  /* so make sure newargz[1] doesn't end in .exe */
+  strendzap(newargz[1],".exe");
+  for (i = 1; i < argc; i++)
+    newargz[i+1] = xstrdup(argv[i]);
+  newargz[argc+1] = NULL;
+
+  for (i=0; i<argc+1; i++)
+  {
+    DEBUG("(main) newargz[%d]   : %s\n",i,newargz[i]);
+    ;
+  }
+
+EOF
+
+            case $host_os in
+              mingw*)
+                cat >> $cwrappersource <<EOF
+  execv("$SHELL",(char const **)newargz);
+EOF
+              ;;
+              *)
+                cat >> $cwrappersource <<EOF
+  execv("$SHELL",newargz);
+EOF
+              ;;
+            esac
+
+            cat >> $cwrappersource <<"EOF"
+  return 127;
+}
+
+void *
+xmalloc (size_t num)
+{
+  void * p = (void *) malloc (num);
+  if (!p)
+    lt_fatal ("Memory exhausted");
+
+  return p;
+}
+
+char *
+xstrdup (const char *string)
+{
+  return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
+;
+}
+
+const char *
+base_name (const char *name)
+{
+  const char *base;
+
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  /* Skip over the disk name in MSDOS pathnames. */
+  if (isalpha ((unsigned char)name[0]) && name[1] == ':')
+    name += 2;
+#endif
+
+  for (base = name; *name; name++)
+    if (IS_DIR_SEPARATOR (*name))
+      base = name + 1;
+  return base;
+}
+
+int
+check_executable(const char * path)
+{
+  struct stat st;
+
+  DEBUG("(check_executable)  : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
+  if ((!path) || (!*path))
+    return 0;
+
+  if ((stat (path, &st) >= 0) &&
+      (
+        /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
+#if defined (S_IXOTH)
+       ((st.st_mode & S_IXOTH) == S_IXOTH) ||
+#endif
+#if defined (S_IXGRP)
+       ((st.st_mode & S_IXGRP) == S_IXGRP) ||
+#endif
+       ((st.st_mode & S_IXUSR) == S_IXUSR))
+      )
+    return 1;
+  else
+    return 0;
+}
+
+/* Searches for the full path of the wrapper.  Returns
+   newly allocated full path name if found, NULL otherwise */
+char *
+find_executable (const char* wrapper)
+{
+  int has_slash = 0;
+  const char* p;
+  const char* p_next;
+  /* static buffer for getcwd */
+  char tmp[LT_PATHMAX + 1];
+  int tmp_len;
+  char* concat_name;
+
+  DEBUG("(find_executable)  : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
+
+  if ((wrapper == NULL) || (*wrapper == '\0'))
+    return NULL;
+
+  /* Absolute path? */
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
+  {
+    concat_name = xstrdup (wrapper);
+    if (check_executable(concat_name))
+      return concat_name;
+    XFREE(concat_name);
+  }
+  else
+  {
+#endif
+    if (IS_DIR_SEPARATOR (wrapper[0]))
+    {
+      concat_name = xstrdup (wrapper);
+      if (check_executable(concat_name))
+        return concat_name;
+      XFREE(concat_name);
+    }
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  }
+#endif
+
+  for (p = wrapper; *p; p++)
+    if (*p == '/')
+    {
+      has_slash = 1;
+      break;
+    }
+  if (!has_slash)
+  {
+    /* no slashes; search PATH */
+    const char* path = getenv ("PATH");
+    if (path != NULL)
+    {
+      for (p = path; *p; p = p_next)
+      {
+        const char* q;
+        size_t p_len;
+        for (q = p; *q; q++)
+          if (IS_PATH_SEPARATOR(*q))
+            break;
+        p_len = q - p;
+        p_next = (*q == '\0' ? q : q + 1);
+        if (p_len == 0)
+        {
+          /* empty path: current directory */
+          if (getcwd (tmp, LT_PATHMAX) == NULL)
+            lt_fatal ("getcwd failed");
+          tmp_len = strlen(tmp);
+          concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
+          memcpy (concat_name, tmp, tmp_len);
+          concat_name[tmp_len] = '/';
+          strcpy (concat_name + tmp_len + 1, wrapper);
+        }
+        else
+        {
+          concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
+          memcpy (concat_name, p, p_len);
+          concat_name[p_len] = '/';
+          strcpy (concat_name + p_len + 1, wrapper);
+        }
+        if (check_executable(concat_name))
+          return concat_name;
+        XFREE(concat_name);
+      }
+    }
+    /* not found in PATH; assume curdir */
+  }
+  /* Relative path | not found in path: prepend cwd */
+  if (getcwd (tmp, LT_PATHMAX) == NULL)
+    lt_fatal ("getcwd failed");
+  tmp_len = strlen(tmp);
+  concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
+  memcpy (concat_name, tmp, tmp_len);
+  concat_name[tmp_len] = '/';
+  strcpy (concat_name + tmp_len + 1, wrapper);
+
+  if (check_executable(concat_name))
+    return concat_name;
+  XFREE(concat_name);
+  return NULL;
+}
+
+char *
+strendzap(char *str, const char *pat)
+{
+  size_t len, patlen;
+
+  assert(str != NULL);
+  assert(pat != NULL);
+
+  len = strlen(str);
+  patlen = strlen(pat);
+
+  if (patlen <= len)
+  {
+    str += len - patlen;
+    if (strcmp(str, pat) == 0)
+      *str = '\0';
+  }
+  return str;
+}
+
+static void
+lt_error_core (int exit_status, const char * mode,
+          const char * message, va_list ap)
+{
+  fprintf (stderr, "%s: %s: ", program_name, mode);
+  vfprintf (stderr, message, ap);
+  fprintf (stderr, ".\n");
+
+  if (exit_status >= 0)
+    exit (exit_status);
+}
+
+void
+lt_fatal (const char *message, ...)
+{
+  va_list ap;
+  va_start (ap, message);
+  lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
+  va_end (ap);
+}
+EOF
+          # we should really use a build-platform specific compiler
+          # here, but OTOH, the wrappers (shell script and this C one)
+          # are only useful if you want to execute the "real" binary.
+          # Since the "real" binary is built for $host, then this
+          # wrapper might as well be built for $host, too.
+          $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
+          ;;
+        esac
+        $rm $output
+        trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
+
+       $echo > $output "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='${SED} -e 1s/^X//'
+sed_quote_subst='$sed_quote_subst'
+
+# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
+if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+  # install mode needs the following variable:
+  notinst_deplibs='$notinst_deplibs'
+else
+  # When we are sourced in execute mode, \$file and \$echo are already set.
+  if test \"\$libtool_execute_magic\" != \"$magic\"; then
+    echo=\"$qecho\"
+    file=\"\$0\"
+    # Make sure echo works.
+    if test \"X\$1\" = X--no-reexec; then
+      # Discard the --no-reexec flag, and continue.
+      shift
+    elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
+      # Yippee, \$echo works!
+      :
+    else
+      # Restart under the correct shell, and then maybe \$echo will work.
+      exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
+    fi
+  fi\
+"
+       $echo >> $output "\
+
+  # Find the directory that this script lives in.
+  thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
+  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+  # Follow symbolic links until we get to the real thisdir.
+  file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
+  while test -n \"\$file\"; do
+    destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
+
+    # If there was a directory component, then change thisdir.
+    if test \"x\$destdir\" != \"x\$file\"; then
+      case \"\$destdir\" in
+      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+      *) thisdir=\"\$thisdir/\$destdir\" ;;
+      esac
+    fi
+
+    file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
+    file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
+  done
+
+  # Try to get the absolute directory name.
+  absdir=\`cd \"\$thisdir\" && pwd\`
+  test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+       if test "$fast_install" = yes; then
+         $echo >> $output "\
+  program=lt-'$outputname'$exeext
+  progdir=\"\$thisdir/$objdir\"
+
+  if test ! -f \"\$progdir/\$program\" || \\
+     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+    file=\"\$\$-\$program\"
+
+    if test ! -d \"\$progdir\"; then
+      $mkdir \"\$progdir\"
+    else
+      $rm \"\$progdir/\$file\"
+    fi"
+
+         $echo >> $output "\
+
+    # relink executable if necessary
+    if test -n \"\$relink_command\"; then
+      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+      else
+       $echo \"\$relink_command_output\" >&2
+       $rm \"\$progdir/\$file\"
+       exit $EXIT_FAILURE
+      fi
+    fi
+
+    $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+    { $rm \"\$progdir/\$program\";
+      $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+    $rm \"\$progdir/\$file\"
+  fi"
+       else
+         $echo >> $output "\
+  program='$outputname'
+  progdir=\"\$thisdir/$objdir\"
+"
+       fi
+
+       $echo >> $output "\
+
+  if test -f \"\$progdir/\$program\"; then"
+
+       # Export our shlibpath_var if we have one.
+       if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+         $echo >> $output "\
+    # Add our own library path to $shlibpath_var
+    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+    # Some systems cannot cope with colon-terminated $shlibpath_var
+    # The second colon is a workaround for a bug in BeOS R4 sed
+    $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
+
+    export $shlibpath_var
+"
+       fi
+
+       # fixup the dll searchpath if we need to.
+       if test -n "$dllsearchpath"; then
+         $echo >> $output "\
+    # Add the dll search path components to the executable PATH
+    PATH=$dllsearchpath:\$PATH
+"
+       fi
+
+       $echo >> $output "\
+    if test \"\$libtool_execute_magic\" != \"$magic\"; then
+      # Run the actual program with our arguments.
+"
+       case $host in
+       # Backslashes separate directories on plain windows
+       *-*-mingw | *-*-os2*)
+         $echo >> $output "\
+      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+"
+         ;;
+
+       *)
+         $echo >> $output "\
+      exec \"\$progdir/\$program\" \${1+\"\$@\"}
+"
+         ;;
+       esac
+       $echo >> $output "\
+      \$echo \"\$0: cannot exec \$program \$*\"
+      exit $EXIT_FAILURE
+    fi
+  else
+    # The program doesn't exist.
+    \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
+    \$echo \"This script is just a wrapper for \$program.\" 1>&2
+    $echo \"See the $PACKAGE documentation for more information.\" 1>&2
+    exit $EXIT_FAILURE
+  fi
+fi\
+"
+       chmod +x $output
+      fi
+      exit $EXIT_SUCCESS
+      ;;
+    esac
+
+    # See if we need to build an old-fashioned archive.
+    for oldlib in $oldlibs; do
+
+      if test "$build_libtool_libs" = convenience; then
+       oldobjs="$libobjs_save"
+       addlibs="$convenience"
+       build_libtool_libs=no
+      else
+       if test "$build_libtool_libs" = module; then
+         oldobjs="$libobjs_save"
+         build_libtool_libs=no
+       else
+         oldobjs="$old_deplibs $non_pic_objects"
+       fi
+       addlibs="$old_convenience"
+      fi
+
+      if test -n "$addlibs"; then
+       gentop="$output_objdir/${outputname}x"
+       generated="$generated $gentop"
+
+       func_extract_archives $gentop $addlibs
+       oldobjs="$oldobjs $func_extract_archives_result"
+      fi
+
+      # Do each command in the archive commands.
+      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+       cmds=$old_archive_from_new_cmds
+      else
+       # POSIX demands no paths to be encoded in archives.  We have
+       # to avoid creating archives with duplicate basenames if we
+       # might have to extract them afterwards, e.g., when creating a
+       # static archive out of a convenience library, or when linking
+       # the entirety of a libtool archive into another (currently
+       # not supported by libtool).
+       if (for obj in $oldobjs
+           do
+             $echo "X$obj" | $Xsed -e 's%^.*/%%'
+           done | sort | sort -uc >/dev/null 2>&1); then
+         :
+       else
+         $echo "copying selected object files to avoid basename conflicts..."
+
+         if test -z "$gentop"; then
+           gentop="$output_objdir/${outputname}x"
+           generated="$generated $gentop"
+
+           $show "${rm}r $gentop"
+           $run ${rm}r "$gentop"
+           $show "$mkdir $gentop"
+           $run $mkdir "$gentop"
+           exit_status=$?
+           if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
+             exit $exit_status
+           fi
+         fi
+
+         save_oldobjs=$oldobjs
+         oldobjs=
+         counter=1
+         for obj in $save_oldobjs
+         do
+           objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
+           case " $oldobjs " in
+           " ") oldobjs=$obj ;;
+           *[\ /]"$objbase "*)
+             while :; do
+               # Make sure we don't pick an alternate name that also
+               # overlaps.
+               newobj=lt$counter-$objbase
+               counter=`expr $counter + 1`
+               case " $oldobjs " in
+               *[\ /]"$newobj "*) ;;
+               *) if test ! -f "$gentop/$newobj"; then break; fi ;;
+               esac
+             done
+             $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+             $run ln "$obj" "$gentop/$newobj" ||
+             $run cp "$obj" "$gentop/$newobj"
+             oldobjs="$oldobjs $gentop/$newobj"
+             ;;
+           *) oldobjs="$oldobjs $obj" ;;
+           esac
+         done
+       fi
+
+       eval cmds=\"$old_archive_cmds\"
+
+       if len=`expr "X$cmds" : ".*"` &&
+            test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+         cmds=$old_archive_cmds
+       else
+         # the command line is too long to link in one step, link in parts
+         $echo "using piecewise archive linking..."
+         save_RANLIB=$RANLIB
+         RANLIB=:
+         objlist=
+         concat_cmds=
+         save_oldobjs=$oldobjs
+
+         # Is there a better way of finding the last object in the list?
+         for obj in $save_oldobjs
+         do
+           last_oldobj=$obj
+         done
+         for obj in $save_oldobjs
+         do
+           oldobjs="$objlist $obj"
+           objlist="$objlist $obj"
+           eval test_cmds=\"$old_archive_cmds\"
+           if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
+              test "$len" -le "$max_cmd_len"; then
+             :
+           else
+             # the above command should be used before it gets too long
+             oldobjs=$objlist
+             if test "$obj" = "$last_oldobj" ; then
+               RANLIB=$save_RANLIB
+             fi
+             test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+             eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+             objlist=
+           fi
+         done
+         RANLIB=$save_RANLIB
+         oldobjs=$objlist
+         if test "X$oldobjs" = "X" ; then
+           eval cmds=\"\$concat_cmds\"
+         else
+           eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
+         fi
+       fi
+      fi
+      save_ifs="$IFS"; IFS='~'
+      for cmd in $cmds; do
+        eval cmd=\"$cmd\"
+       IFS="$save_ifs"
+       $show "$cmd"
+       $run eval "$cmd" || exit $?
+      done
+      IFS="$save_ifs"
+    done
+
+    if test -n "$generated"; then
+      $show "${rm}r$generated"
+      $run ${rm}r$generated
+    fi
+
+    # Now create the libtool archive.
+    case $output in
+    *.la)
+      old_library=
+      test "$build_old_libs" = yes && old_library="$libname.$libext"
+      $show "creating $output"
+
+      # Preserve any variables that may affect compiler behavior
+      for var in $variables_saved_for_relink; do
+       if eval test -z \"\${$var+set}\"; then
+         relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
+       elif eval var_value=\$$var; test -z "$var_value"; then
+         relink_command="$var=; export $var; $relink_command"
+       else
+         var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
+         relink_command="$var=\"$var_value\"; export $var; $relink_command"
+       fi
+      done
+      # Quote the link command for shipping.
+      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+      relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
+      if test "$hardcode_automatic" = yes ; then
+       relink_command=
+      fi
+
+
+      # Only create the output if not a dry run.
+      if test -z "$run"; then
+       for installed in no yes; do
+         if test "$installed" = yes; then
+           if test -z "$install_libdir"; then
+             break
+           fi
+           output="$output_objdir/$outputname"i
+           # Replace all uninstalled libtool libraries with the installed ones
+           newdependency_libs=
+           for deplib in $dependency_libs; do
+             case $deplib in
+             *.la)
+               name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
+               eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+               if test -z "$libdir"; then
+                 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
+                 exit $EXIT_FAILURE
+               fi
+               newdependency_libs="$newdependency_libs $libdir/$name"
+               ;;
+             *) newdependency_libs="$newdependency_libs $deplib" ;;
+             esac
+           done
+           dependency_libs="$newdependency_libs"
+           newdlfiles=
+           for lib in $dlfiles; do
+             name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+             eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+             if test -z "$libdir"; then
+               $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+               exit $EXIT_FAILURE
+             fi
+             newdlfiles="$newdlfiles $libdir/$name"
+           done
+           dlfiles="$newdlfiles"
+           newdlprefiles=
+           for lib in $dlprefiles; do
+             name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+             eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+             if test -z "$libdir"; then
+               $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+               exit $EXIT_FAILURE
+             fi
+             newdlprefiles="$newdlprefiles $libdir/$name"
+           done
+           dlprefiles="$newdlprefiles"
+         else
+           newdlfiles=
+           for lib in $dlfiles; do
+             case $lib in
+               [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+               *) abs=`pwd`"/$lib" ;;
+             esac
+             newdlfiles="$newdlfiles $abs"
+           done
+           dlfiles="$newdlfiles"
+           newdlprefiles=
+           for lib in $dlprefiles; do
+             case $lib in
+               [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+               *) abs=`pwd`"/$lib" ;;
+             esac
+             newdlprefiles="$newdlprefiles $abs"
+           done
+           dlprefiles="$newdlprefiles"
+         fi
+         $rm $output
+         # place dlname in correct position for cygwin
+         tdlname=$dlname
+         case $host,$output,$installed,$module,$dlname in
+           *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
+         esac
+         $echo > $output "\
+# $outputname - a libtool library file
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='$tdlname'
+
+# Names of this library.
+library_names='$library_names'
+
+# The name of the static archive.
+old_library='$old_library'
+
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
+
+# Version information for $libname.
+current=$current
+age=$age
+revision=$revision
+
+# Is this an already installed library?
+installed=$installed
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=$module
+
+# Files to dlopen/dlpreopen
+dlopen='$dlfiles'
+dlpreopen='$dlprefiles'
+
+# Directory that this library needs to be installed in:
+libdir='$install_libdir'"
+         if test "$installed" = no && test "$need_relink" = yes; then
+           $echo >> $output "\
+relink_command=\"$relink_command\""
+         fi
+       done
+      fi
+
+      # Do a symbolic link so that the libtool archive can be found in
+      # LD_LIBRARY_PATH before the program is installed.
+      $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
+      $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
+      ;;
+    esac
+    exit $EXIT_SUCCESS
+    ;;
+
+  # libtool install mode
+  install)
+    modename="$modename: install"
+
+    # There may be an optional sh(1) argument at the beginning of
+    # install_prog (especially on Windows NT).
+    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+       # Allow the use of GNU shtool's install command.
+       $echo "X$nonopt" | grep shtool > /dev/null; then
+      # Aesthetically quote it.
+      arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
+      case $arg in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*|"")
+       arg="\"$arg\""
+       ;;
+      esac
+      install_prog="$arg "
+      arg="$1"
+      shift
+    else
+      install_prog=
+      arg=$nonopt
+    fi
+
+    # The real first argument should be the name of the installation program.
+    # Aesthetically quote it.
+    arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+    case $arg in
+    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \      ]*|*]*|"")
+      arg="\"$arg\""
+      ;;
+    esac
+    install_prog="$install_prog$arg"
+
+    # We need to accept at least all the BSD install flags.
+    dest=
+    files=
+    opts=
+    prev=
+    install_type=
+    isdir=no
+    stripme=
+    for arg
+    do
+      if test -n "$dest"; then
+       files="$files $dest"
+       dest=$arg
+       continue
+      fi
+
+      case $arg in
+      -d) isdir=yes ;;
+      -f) 
+       case " $install_prog " in
+       *[\\\ /]cp\ *) ;;
+       *) prev=$arg ;;
+       esac
+       ;;
+      -g | -m | -o) prev=$arg ;;
+      -s)
+       stripme=" -s"
+       continue
+       ;;
+      -*)
+       ;;
+      *)
+       # If the previous option needed an argument, then skip it.
+       if test -n "$prev"; then
+         prev=
+       else
+         dest=$arg
+         continue
+       fi
+       ;;
+      esac
+
+      # Aesthetically quote the argument.
+      arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+      case $arg in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*|"")
+       arg="\"$arg\""
+       ;;
+      esac
+      install_prog="$install_prog $arg"
+    done
+
+    if test -z "$install_prog"; then
+      $echo "$modename: you must specify an install program" 1>&2
+      $echo "$help" 1>&2
+      exit $EXIT_FAILURE
+    fi
+
+    if test -n "$prev"; then
+      $echo "$modename: the \`$prev' option requires an argument" 1>&2
+      $echo "$help" 1>&2
+      exit $EXIT_FAILURE
+    fi
+
+    if test -z "$files"; then
+      if test -z "$dest"; then
+       $echo "$modename: no file or destination specified" 1>&2
+      else
+       $echo "$modename: you must specify a destination" 1>&2
+      fi
+      $echo "$help" 1>&2
+      exit $EXIT_FAILURE
+    fi
+
+    # Strip any trailing slash from the destination.
+    dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
+
+    # Check to see that the destination is a directory.
+    test -d "$dest" && isdir=yes
+    if test "$isdir" = yes; then
+      destdir="$dest"
+      destname=
+    else
+      destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
+      test "X$destdir" = "X$dest" && destdir=.
+      destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
+
+      # Not a directory, so check to see that there is only one file specified.
+      set dummy $files
+      if test "$#" -gt 2; then
+       $echo "$modename: \`$dest' is not a directory" 1>&2
+       $echo "$help" 1>&2
+       exit $EXIT_FAILURE
+      fi
+    fi
+    case $destdir in
+    [\\/]* | [A-Za-z]:[\\/]*) ;;
+    *)
+      for file in $files; do
+       case $file in
+       *.lo) ;;
+       *)
+         $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
+         $echo "$help" 1>&2
+         exit $EXIT_FAILURE
+         ;;
+       esac
+      done
+      ;;
+    esac
+
+    # This variable tells wrapper scripts just to set variables rather
+    # than running their programs.
+    libtool_install_magic="$magic"
+
+    staticlibs=
+    future_libdirs=
+    current_libdirs=
+    for file in $files; do
+
+      # Do each installation.
+      case $file in
+      *.$libext)
+       # Do the static libraries later.
+       staticlibs="$staticlibs $file"
+       ;;
+
+      *.la)
+       # Check to see that this really is a libtool archive.
+       if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+       else
+         $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
+         $echo "$help" 1>&2
+         exit $EXIT_FAILURE
+       fi
+
+       library_names=
+       old_library=
+       relink_command=
+       # If there is no directory component, then add one.
+       case $file in
+       */* | *\\*) . $file ;;
+       *) . ./$file ;;
+       esac
+
+       # Add the libdir to current_libdirs if it is the destination.
+       if test "X$destdir" = "X$libdir"; then
+         case "$current_libdirs " in
+         *" $libdir "*) ;;
+         *) current_libdirs="$current_libdirs $libdir" ;;
+         esac
+       else
+         # Note the libdir as a future libdir.
+         case "$future_libdirs " in
+         *" $libdir "*) ;;
+         *) future_libdirs="$future_libdirs $libdir" ;;
+         esac
+       fi
+
+       dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
+       test "X$dir" = "X$file/" && dir=
+       dir="$dir$objdir"
+
+       if test -n "$relink_command"; then
+         # Determine the prefix the user has applied to our future dir.
+         inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
+
+         # Don't allow the user to place us outside of our expected
+         # location b/c this prevents finding dependent libraries that
+         # are installed to the same prefix.
+         # At present, this check doesn't affect windows .dll's that
+         # are installed into $libdir/../bin (currently, that works fine)
+         # but it's something to keep an eye on.
+         if test "$inst_prefix_dir" = "$destdir"; then
+           $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
+           exit $EXIT_FAILURE
+         fi
+
+         if test -n "$inst_prefix_dir"; then
+           # Stick the inst_prefix_dir data into the link command.
+           relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP`
+         else
+           relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP`
+         fi
+
+         $echo "$modename: warning: relinking \`$file'" 1>&2
+         $show "$relink_command"
+         if $run eval "$relink_command"; then :
+         else
+           $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
+           exit $EXIT_FAILURE
+         fi
+       fi
+
+       # See the names of the shared library.
+       set dummy $library_names
+       if test -n "$2"; then
+         realname="$2"
+         shift
+         shift
+
+         srcname="$realname"
+         test -n "$relink_command" && srcname="$realname"T
+
+         # Install the shared library and build the symlinks.
+         $show "$install_prog $dir/$srcname $destdir/$realname"
+         $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
+         if test -n "$stripme" && test -n "$striplib"; then
+           $show "$striplib $destdir/$realname"
+           $run eval "$striplib $destdir/$realname" || exit $?
+         fi
+
+         if test "$#" -gt 0; then
+           # Delete the old symlinks, and create new ones.
+           # Try `ln -sf' first, because the `ln' binary might depend on
+           # the symlink we replace!  Solaris /bin/ln does not understand -f,
+           # so we also need to try rm && ln -s.
+           for linkname
+           do
+             if test "$linkname" != "$realname"; then
+                $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
+                $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
+             fi
+           done
+         fi
+
+         # Do each command in the postinstall commands.
+         lib="$destdir/$realname"
+         cmds=$postinstall_cmds
+         save_ifs="$IFS"; IFS='~'
+         for cmd in $cmds; do
+           IFS="$save_ifs"
+           eval cmd=\"$cmd\"
+           $show "$cmd"
+           $run eval "$cmd" || {
+             lt_exit=$?
+
+             # Restore the uninstalled library and exit
+             if test "$mode" = relink; then
+               $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
+             fi
+
+             exit $lt_exit
+           }
+         done
+         IFS="$save_ifs"
+       fi
+
+       # Install the pseudo-library for information purposes.
+       name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+       instname="$dir/$name"i
+       $show "$install_prog $instname $destdir/$name"
+       $run eval "$install_prog $instname $destdir/$name" || exit $?
+
+       # Maybe install the static library, too.
+       test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
+       ;;
+
+      *.lo)
+       # Install (i.e. copy) a libtool object.
+
+       # Figure out destination file name, if it wasn't already specified.
+       if test -n "$destname"; then
+         destfile="$destdir/$destname"
+       else
+         destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+         destfile="$destdir/$destfile"
+       fi
+
+       # Deduce the name of the destination old-style object file.
+       case $destfile in
+       *.lo)
+         staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
+         ;;
+       *.$objext)
+         staticdest="$destfile"
+         destfile=
+         ;;
+       *)
+         $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
+         $echo "$help" 1>&2
+         exit $EXIT_FAILURE
+         ;;
+       esac
+
+       # Install the libtool object if requested.
+       if test -n "$destfile"; then
+         $show "$install_prog $file $destfile"
+         $run eval "$install_prog $file $destfile" || exit $?
+       fi
+
+       # Install the old object if enabled.
+       if test "$build_old_libs" = yes; then
+         # Deduce the name of the old-style object file.
+         staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
+
+         $show "$install_prog $staticobj $staticdest"
+         $run eval "$install_prog \$staticobj \$staticdest" || exit $?
+       fi
+       exit $EXIT_SUCCESS
+       ;;
+
+      *)
+       # Figure out destination file name, if it wasn't already specified.
+       if test -n "$destname"; then
+         destfile="$destdir/$destname"
+       else
+         destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+         destfile="$destdir/$destfile"
+       fi
+
+       # If the file is missing, and there is a .exe on the end, strip it
+       # because it is most likely a libtool script we actually want to
+       # install
+       stripped_ext=""
+       case $file in
+         *.exe)
+           if test ! -f "$file"; then
+             file=`$echo $file|${SED} 's,.exe$,,'`
+             stripped_ext=".exe"
+           fi
+           ;;
+       esac
+
+       # Do a test to see if this is really a libtool program.
+       case $host in
+       *cygwin*|*mingw*)
+           wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
+           ;;
+       *)
+           wrapper=$file
+           ;;
+       esac
+       if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
+         notinst_deplibs=
+         relink_command=
+
+         # Note that it is not necessary on cygwin/mingw to append a dot to
+         # foo even if both foo and FILE.exe exist: automatic-append-.exe
+         # behavior happens only for exec(3), not for open(2)!  Also, sourcing
+         # `FILE.' does not work on cygwin managed mounts.
+         #
+         # If there is no directory component, then add one.
+         case $wrapper in
+         */* | *\\*) . ${wrapper} ;;
+         *) . ./${wrapper} ;;
+         esac
+
+         # Check the variables that should have been set.
+         if test -z "$notinst_deplibs"; then
+           $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
+           exit $EXIT_FAILURE
+         fi
+
+         finalize=yes
+         for lib in $notinst_deplibs; do
+           # Check to see that each library is installed.
+           libdir=
+           if test -f "$lib"; then
+             # If there is no directory component, then add one.
+             case $lib in
+             */* | *\\*) . $lib ;;
+             *) . ./$lib ;;
+             esac
+           fi
+           libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
+           if test -n "$libdir" && test ! -f "$libfile"; then
+             $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
+             finalize=no
+           fi
+         done
+
+         relink_command=
+         # Note that it is not necessary on cygwin/mingw to append a dot to
+         # foo even if both foo and FILE.exe exist: automatic-append-.exe
+         # behavior happens only for exec(3), not for open(2)!  Also, sourcing
+         # `FILE.' does not work on cygwin managed mounts.
+         #
+         # If there is no directory component, then add one.
+         case $wrapper in
+         */* | *\\*) . ${wrapper} ;;
+         *) . ./${wrapper} ;;
+         esac
+
+         outputname=
+         if test "$fast_install" = no && test -n "$relink_command"; then
+           if test "$finalize" = yes && test -z "$run"; then
+             tmpdir=`func_mktempdir`
+             file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
+             outputname="$tmpdir/$file"
+             # Replace the output file specification.
+             relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP`
+
+             $show "$relink_command"
+             if $run eval "$relink_command"; then :
+             else
+               $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
+               ${rm}r "$tmpdir"
+               continue
+             fi
+             file="$outputname"
+           else
+             $echo "$modename: warning: cannot relink \`$file'" 1>&2
+           fi
+         else
+           # Install the binary that we compiled earlier.
+           file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
+         fi
+       fi
+
+       # remove .exe since cygwin /usr/bin/install will append another
+       # one anyway 
+       case $install_prog,$host in
+       */usr/bin/install*,*cygwin*)
+         case $file:$destfile in
+         *.exe:*.exe)
+           # this is ok
+           ;;
+         *.exe:*)
+           destfile=$destfile.exe
+           ;;
+         *:*.exe)
+           destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
+           ;;
+         esac
+         ;;
+       esac
+       $show "$install_prog$stripme $file $destfile"
+       $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
+       test -n "$outputname" && ${rm}r "$tmpdir"
+       ;;
+      esac
+    done
+
+    for file in $staticlibs; do
+      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+
+      # Set up the ranlib parameters.
+      oldlib="$destdir/$name"
+
+      $show "$install_prog $file $oldlib"
+      $run eval "$install_prog \$file \$oldlib" || exit $?
+
+      if test -n "$stripme" && test -n "$old_striplib"; then
+       $show "$old_striplib $oldlib"
+       $run eval "$old_striplib $oldlib" || exit $?
+      fi
+
+      # Do each command in the postinstall commands.
+      cmds=$old_postinstall_cmds
+      save_ifs="$IFS"; IFS='~'
+      for cmd in $cmds; do
+       IFS="$save_ifs"
+       eval cmd=\"$cmd\"
+       $show "$cmd"
+       $run eval "$cmd" || exit $?
+      done
+      IFS="$save_ifs"
+    done
+
+    if test -n "$future_libdirs"; then
+      $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
+    fi
+
+    if test -n "$current_libdirs"; then
+      # Maybe just do a dry run.
+      test -n "$run" && current_libdirs=" -n$current_libdirs"
+      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+    else
+      exit $EXIT_SUCCESS
+    fi
+    ;;
+
+  # libtool finish mode
+  finish)
+    modename="$modename: finish"
+    libdirs="$nonopt"
+    admincmds=
+
+    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+      for dir
+      do
+       libdirs="$libdirs $dir"
+      done
+
+      for libdir in $libdirs; do
+       if test -n "$finish_cmds"; then
+         # Do each command in the finish commands.
+         cmds=$finish_cmds
+         save_ifs="$IFS"; IFS='~'
+         for cmd in $cmds; do
+           IFS="$save_ifs"
+           eval cmd=\"$cmd\"
+           $show "$cmd"
+           $run eval "$cmd" || admincmds="$admincmds
+       $cmd"
+         done
+         IFS="$save_ifs"
+       fi
+       if test -n "$finish_eval"; then
+         # Do the single finish_eval.
+         eval cmds=\"$finish_eval\"
+         $run eval "$cmds" || admincmds="$admincmds
+       $cmds"
+       fi
+      done
+    fi
+
+    # Exit here if they wanted silent mode.
+    test "$show" = : && exit $EXIT_SUCCESS
+
+    $echo "X----------------------------------------------------------------------" | $Xsed
+    $echo "Libraries have been installed in:"
+    for libdir in $libdirs; do
+      $echo "   $libdir"
+    done
+    $echo
+    $echo "If you ever happen to want to link against installed libraries"
+    $echo "in a given directory, LIBDIR, you must either use libtool, and"
+    $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+    $echo "flag during linking and do at least one of the following:"
+    if test -n "$shlibpath_var"; then
+      $echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
+      $echo "     during execution"
+    fi
+    if test -n "$runpath_var"; then
+      $echo "   - add LIBDIR to the \`$runpath_var' environment variable"
+      $echo "     during linking"
+    fi
+    if test -n "$hardcode_libdir_flag_spec"; then
+      libdir=LIBDIR
+      eval flag=\"$hardcode_libdir_flag_spec\"
+
+      $echo "   - use the \`$flag' linker flag"
+    fi
+    if test -n "$admincmds"; then
+      $echo "   - have your system administrator run these commands:$admincmds"
+    fi
+    if test -f /etc/ld.so.conf; then
+      $echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+    fi
+    $echo
+    $echo "See any operating system documentation about shared libraries for"
+    $echo "more information, such as the ld(1) and ld.so(8) manual pages."
+    $echo "X----------------------------------------------------------------------" | $Xsed
+    exit $EXIT_SUCCESS
+    ;;
+
+  # libtool execute mode
+  execute)
+    modename="$modename: execute"
+
+    # The first argument is the command name.
+    cmd="$nonopt"
+    if test -z "$cmd"; then
+      $echo "$modename: you must specify a COMMAND" 1>&2
+      $echo "$help"
+      exit $EXIT_FAILURE
+    fi
+
+    # Handle -dlopen flags immediately.
+    for file in $execute_dlfiles; do
+      if test ! -f "$file"; then
+       $echo "$modename: \`$file' is not a file" 1>&2
+       $echo "$help" 1>&2
+       exit $EXIT_FAILURE
+      fi
+
+      dir=
+      case $file in
+      *.la)
+       # Check to see that this really is a libtool archive.
+       if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+       else
+         $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+         $echo "$help" 1>&2
+         exit $EXIT_FAILURE
+       fi
+
+       # Read the libtool library.
+       dlname=
+       library_names=
+
+       # If there is no directory component, then add one.
+       case $file in
+       */* | *\\*) . $file ;;
+       *) . ./$file ;;
+       esac
+
+       # Skip this library if it cannot be dlopened.
+       if test -z "$dlname"; then
+         # Warn if it was a shared library.
+         test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
+         continue
+       fi
+
+       dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+       test "X$dir" = "X$file" && dir=.
+
+       if test -f "$dir/$objdir/$dlname"; then
+         dir="$dir/$objdir"
+       else
+         $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
+         exit $EXIT_FAILURE
+       fi
+       ;;
+
+      *.lo)
+       # Just add the directory containing the .lo file.
+       dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+       test "X$dir" = "X$file" && dir=.
+       ;;
+
+      *)
+       $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
+       continue
+       ;;
+      esac
+
+      # Get the absolute pathname.
+      absdir=`cd "$dir" && pwd`
+      test -n "$absdir" && dir="$absdir"
+
+      # Now add the directory to shlibpath_var.
+      if eval "test -z \"\$$shlibpath_var\""; then
+       eval "$shlibpath_var=\"\$dir\""
+      else
+       eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+      fi
+    done
+
+    # This variable tells wrapper scripts just to set shlibpath_var
+    # rather than running their programs.
+    libtool_execute_magic="$magic"
+
+    # Check if any of the arguments is a wrapper script.
+    args=
+    for file
+    do
+      case $file in
+      -*) ;;
+      *)
+       # Do a test to see if this is really a libtool program.
+       if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+         # If there is no directory component, then add one.
+         case $file in
+         */* | *\\*) . $file ;;
+         *) . ./$file ;;
+         esac
+
+         # Transform arg to wrapped name.
+         file="$progdir/$program"
+       fi
+       ;;
+      esac
+      # Quote arguments (to preserve shell metacharacters).
+      file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
+      args="$args \"$file\""
+    done
+
+    if test -z "$run"; then
+      if test -n "$shlibpath_var"; then
+       # Export the shlibpath_var.
+       eval "export $shlibpath_var"
+      fi
+
+      # Restore saved environment variables
+      for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+      do
+       eval "if test \"\${save_$lt_var+set}\" = set; then
+               $lt_var=\$save_$lt_var; export $lt_var
+             else
+               $lt_unset $lt_var
+             fi"
+      done
+
+
+      # Now prepare to actually exec the command.
+      exec_cmd="\$cmd$args"
+    else
+      # Display what would be done.
+      if test -n "$shlibpath_var"; then
+       eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
+       $echo "export $shlibpath_var"
+      fi
+      $echo "$cmd$args"
+      exit $EXIT_SUCCESS
+    fi
+    ;;
+
+  # libtool clean and uninstall mode
+  clean | uninstall)
+    modename="$modename: $mode"
+    rm="$nonopt"
+    files=
+    rmforce=
+    exit_status=0
+
+    # This variable tells wrapper scripts just to set variables rather
+    # than running their programs.
+    libtool_install_magic="$magic"
+
+    for arg
+    do
+      case $arg in
+      -f) rm="$rm $arg"; rmforce=yes ;;
+      -*) rm="$rm $arg" ;;
+      *) files="$files $arg" ;;
+      esac
+    done
+
+    if test -z "$rm"; then
+      $echo "$modename: you must specify an RM program" 1>&2
+      $echo "$help" 1>&2
+      exit $EXIT_FAILURE
+    fi
+
+    rmdirs=
+
+    origobjdir="$objdir"
+    for file in $files; do
+      dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+      if test "X$dir" = "X$file"; then
+       dir=.
+       objdir="$origobjdir"
+      else
+       objdir="$dir/$origobjdir"
+      fi
+      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+      test "$mode" = uninstall && objdir="$dir"
+
+      # Remember objdir for removal later, being careful to avoid duplicates
+      if test "$mode" = clean; then
+       case " $rmdirs " in
+         *" $objdir "*) ;;
+         *) rmdirs="$rmdirs $objdir" ;;
+       esac
+      fi
+
+      # Don't error if the file doesn't exist and rm -f was used.
+      if (test -L "$file") >/dev/null 2>&1 \
+       || (test -h "$file") >/dev/null 2>&1 \
+       || test -f "$file"; then
+       :
+      elif test -d "$file"; then
+       exit_status=1
+       continue
+      elif test "$rmforce" = yes; then
+       continue
+      fi
+
+      rmfiles="$file"
+
+      case $name in
+      *.la)
+       # Possibly a libtool archive, so verify it.
+       if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+         . $dir/$name
+
+         # Delete the libtool libraries and symlinks.
+         for n in $library_names; do
+           rmfiles="$rmfiles $objdir/$n"
+         done
+         test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
+
+         case "$mode" in
+         clean)
+           case "  $library_names " in
+           # "  " in the beginning catches empty $dlname
+           *" $dlname "*) ;;
+           *) rmfiles="$rmfiles $objdir/$dlname" ;;
+           esac
+            test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
+           ;;
+         uninstall)
+           if test -n "$library_names"; then
+             # Do each command in the postuninstall commands.
+             cmds=$postuninstall_cmds
+             save_ifs="$IFS"; IFS='~'
+             for cmd in $cmds; do
+               IFS="$save_ifs"
+               eval cmd=\"$cmd\"
+               $show "$cmd"
+               $run eval "$cmd"
+               if test "$?" -ne 0 && test "$rmforce" != yes; then
+                 exit_status=1
+               fi
+             done
+             IFS="$save_ifs"
+           fi
+
+           if test -n "$old_library"; then
+             # Do each command in the old_postuninstall commands.
+             cmds=$old_postuninstall_cmds
+             save_ifs="$IFS"; IFS='~'
+             for cmd in $cmds; do
+               IFS="$save_ifs"
+               eval cmd=\"$cmd\"
+               $show "$cmd"
+               $run eval "$cmd"
+               if test "$?" -ne 0 && test "$rmforce" != yes; then
+                 exit_status=1
+               fi
+             done
+             IFS="$save_ifs"
+           fi
+           # FIXME: should reinstall the best remaining shared library.
+           ;;
+         esac
+       fi
+       ;;
+
+      *.lo)
+       # Possibly a libtool object, so verify it.
+       if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+
+         # Read the .lo file
+         . $dir/$name
+
+         # Add PIC object to the list of files to remove.
+         if test -n "$pic_object" \
+            && test "$pic_object" != none; then
+           rmfiles="$rmfiles $dir/$pic_object"
+         fi
+
+         # Add non-PIC object to the list of files to remove.
+         if test -n "$non_pic_object" \
+            && test "$non_pic_object" != none; then
+           rmfiles="$rmfiles $dir/$non_pic_object"
+         fi
+       fi
+       ;;
+
+      *)
+       if test "$mode" = clean ; then
+         noexename=$name
+         case $file in
+         *.exe)
+           file=`$echo $file|${SED} 's,.exe$,,'`
+           noexename=`$echo $name|${SED} 's,.exe$,,'`
+           # $file with .exe has already been added to rmfiles,
+           # add $file without .exe
+           rmfiles="$rmfiles $file"
+           ;;
+         esac
+         # Do a test to see if this is a libtool program.
+         if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+           relink_command=
+           . $dir/$noexename
+
+           # note $name still contains .exe if it was in $file originally
+           # as does the version of $file that was added into $rmfiles
+           rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
+           if test "$fast_install" = yes && test -n "$relink_command"; then
+             rmfiles="$rmfiles $objdir/lt-$name"
+           fi
+           if test "X$noexename" != "X$name" ; then
+             rmfiles="$rmfiles $objdir/lt-${noexename}.c"
+           fi
+         fi
+       fi
+       ;;
+      esac
+      $show "$rm $rmfiles"
+      $run $rm $rmfiles || exit_status=1
+    done
+    objdir="$origobjdir"
+
+    # Try to remove the ${objdir}s in the directories where we deleted files
+    for dir in $rmdirs; do
+      if test -d "$dir"; then
+       $show "rmdir $dir"
+       $run rmdir $dir >/dev/null 2>&1
+      fi
+    done
+
+    exit $exit_status
+    ;;
+
+  "")
+    $echo "$modename: you must specify a MODE" 1>&2
+    $echo "$generic_help" 1>&2
+    exit $EXIT_FAILURE
+    ;;
+  esac
+
+  if test -z "$exec_cmd"; then
+    $echo "$modename: invalid operation mode \`$mode'" 1>&2
+    $echo "$generic_help" 1>&2
+    exit $EXIT_FAILURE
+  fi
+fi # test -z "$show_help"
+
+if test -n "$exec_cmd"; then
+  eval exec $exec_cmd
+  exit $EXIT_FAILURE
+fi
+
+# We need to display help for each of the modes.
+case $mode in
+"") $echo \
+"Usage: $modename [OPTION]... [MODE-ARG]...
+
+Provide generalized library-building support services.
+
+    --config          show all configuration variables
+    --debug           enable verbose shell tracing
+-n, --dry-run         display commands without modifying any files
+    --features        display basic configuration information and exit
+    --finish          same as \`--mode=finish'
+    --help            display this help message and exit
+    --mode=MODE       use operation mode MODE [default=inferred from MODE-ARGS]
+    --quiet           same as \`--silent'
+    --silent          don't print informational messages
+    --tag=TAG         use configuration variables from tag TAG
+    --version         print version information
+
+MODE must be one of the following:
+
+      clean           remove files from the build directory
+      compile         compile a source file into a libtool object
+      execute         automatically set library path, then run a program
+      finish          complete the installation of libtool libraries
+      install         install libraries or executables
+      link            create a library or an executable
+      uninstall       remove libraries from an installed directory
+
+MODE-ARGS vary depending on the MODE.  Try \`$modename --help --mode=MODE' for
+a more detailed description of MODE.
+
+Report bugs to <bug-libtool@gnu.org>."
+  exit $EXIT_SUCCESS
+  ;;
+
+clean)
+  $echo \
+"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
+
+Remove files from the build directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, object or program, all the files associated
+with it are deleted. Otherwise, only FILE itself is deleted using RM."
+  ;;
+
+compile)
+  $echo \
+"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+Compile a source file into a libtool library object.
+
+This mode accepts the following additional options:
+
+  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
+  -prefer-pic       try to building PIC objects only
+  -prefer-non-pic   try to building non-PIC objects only
+  -static           always build a \`.o' file suitable for static linking
+
+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix \`.c' with the
+library object suffix, \`.lo'."
+  ;;
+
+execute)
+  $echo \
+"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+  -dlopen FILE      add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to \`-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+  ;;
+
+finish)
+  $echo \
+"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges.  Use
+the \`--dry-run' option if you just want to see what would be executed."
+  ;;
+
+install)
+  $echo \
+"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command.  The first component should be
+either the \`install' or \`cp' program.
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+  ;;
+
+link)
+  $echo \
+"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+  -all-static       do not do any dynamic linking at all
+  -avoid-version    do not add a version suffix if possible
+  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
+  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
+  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+  -export-symbols SYMFILE
+                    try to export only the symbols listed in SYMFILE
+  -export-symbols-regex REGEX
+                    try to export only the symbols matching REGEX
+  -LLIBDIR          search LIBDIR for required installed libraries
+  -lNAME            OUTPUT-FILE requires the installed library libNAME
+  -module           build a library that can dlopened
+  -no-fast-install  disable the fast-install mode
+  -no-install       link a not-installable executable
+  -no-undefined     declare that a library does not refer to external symbols
+  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
+  -objectlist FILE  Use a list of object files found in FILE to specify objects
+  -precious-files-regex REGEX
+                    don't remove output files matching REGEX
+  -release RELEASE  specify package release information
+  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
+  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
+  -static           do not do any dynamic linking of uninstalled libtool libraries
+  -static-libtool-libs
+                    do not do any dynamic linking of libtool libraries
+  -version-info CURRENT[:REVISION[:AGE]]
+                    specify library version info [each variable defaults to 0]
+
+All other options (arguments beginning with \`-') are ignored.
+
+Every other argument is treated as a filename.  Files ending in \`.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
+only library objects (\`.lo' files) may be specified, and \`-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
+using \`ar' and \`ranlib', or on Windows using \`lib'.
+
+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+is created, otherwise an executable program is created."
+  ;;
+
+uninstall)
+  $echo \
+"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+  ;;
+
+*)
+  $echo "$modename: invalid operation mode \`$mode'" 1>&2
+  $echo "$help" 1>&2
+  exit $EXIT_FAILURE
+  ;;
+esac
+
+$echo
+$echo "Try \`$modename --help' for more information about other modes."
+
+exit $?
+
+# The TAGs below are defined such that we never get into a situation
+# in which we disable both kinds of libraries.  Given conflicting
+# choices, we go for a static library, that is the most portable,
+# since we can't tell whether shared libraries were disabled because
+# the user asked for that or because the platform doesn't support
+# them.  This is particularly important on AIX, because we don't
+# support having both static and shared libraries enabled at the same
+# time on that platform, so we default to a shared-only configuration.
+# If a disable-shared tag is given, we'll fallback to a static-only
+# configuration.  But we'll never go from static-only to shared-only.
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
+disable_libs=shared
+# ### END LIBTOOL TAG CONFIG: disable-shared
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-static
+disable_libs=static
+# ### END LIBTOOL TAG CONFIG: disable-static
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
diff --git a/acaux/missing b/acaux/missing
new file mode 100755 (executable)
index 0000000..6a37006
--- /dev/null
@@ -0,0 +1,336 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+# Copyright (C) 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+  echo 1>&2 "Try \`$0 --help' for more information"
+  exit 1
+fi
+
+run=:
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+  configure_ac=configure.ac
+else
+  configure_ac=configure.in
+fi
+
+case "$1" in
+--run)
+  # Try to run requested program, and just exit if it succeeds.
+  run=
+  shift
+  "$@" && exit 0
+  ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case "$1" in
+
+  -h|--h|--he|--hel|--help)
+    echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+  -h, --help      display this help and exit
+  -v, --version   output version information and exit
+  --run           try to run the given command, and emulate it if it fails
+
+Supported PROGRAM values:
+  aclocal      touch file \`aclocal.m4'
+  autoconf     touch file \`configure'
+  autoheader   touch file \`config.h.in'
+  automake     touch all \`Makefile.in' files
+  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
+  flex         create \`lex.yy.c', if possible, from existing .c
+  help2man     touch the output file
+  lex          create \`lex.yy.c', if possible, from existing .c
+  makeinfo     touch the output file
+  tar          try tar, gnutar, gtar, then tar without non-portable flags
+  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]"
+    ;;
+
+  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+    echo "missing 0.4 - GNU automake"
+    ;;
+
+  -*)
+    echo 1>&2 "$0: Unknown \`$1' option"
+    echo 1>&2 "Try \`$0 --help' for more information"
+    exit 1
+    ;;
+
+  aclocal*)
+    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+       # We have it, but it failed.
+       exit 1
+    fi
+
+    echo 1>&2 "\
+WARNING: \`$1' is missing on your system.  You should only need it if
+         you modified \`acinclude.m4' or \`${configure_ac}'.  You might want
+         to install the \`Automake' and \`Perl' packages.  Grab them from
+         any GNU archive site."
+    touch aclocal.m4
+    ;;
+
+  autoconf)
+    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+       # We have it, but it failed.
+       exit 1
+    fi
+
+    echo 1>&2 "\
+WARNING: \`$1' is missing on your system.  You should only need it if
+         you modified \`${configure_ac}'.  You might want to install the
+         \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
+         archive site."
+    touch configure
+    ;;
+
+  autoheader)
+    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+       # We have it, but it failed.
+       exit 1
+    fi
+
+    echo 1>&2 "\
+WARNING: \`$1' is missing on your system.  You should only need it if
+         you modified \`acconfig.h' or \`${configure_ac}'.  You might want
+         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
+         from any GNU archive site."
+    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
+    test -z "$files" && files="config.h"
+    touch_files=
+    for f in $files; do
+      case "$f" in
+      *:*) touch_files="$touch_files "`echo "$f" |
+                                      sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+      *) touch_files="$touch_files $f.in";;
+      esac
+    done
+    touch $touch_files
+    ;;
+
+  automake*)
+    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+       # We have it, but it failed.
+       exit 1
+    fi
+
+    echo 1>&2 "\
+WARNING: \`$1' is missing on your system.  You should only need it if
+         you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
+         You might want to install the \`Automake' and \`Perl' packages.
+         Grab them from any GNU archive site."
+    find . -type f -name Makefile.am -print |
+          sed 's/\.am$/.in/' |
+          while read f; do touch "$f"; done
+    ;;
+
+  autom4te)
+    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+       # We have it, but it failed.
+       exit 1
+    fi
+
+    echo 1>&2 "\
+WARNING: \`$1' is needed, and you do not seem to have it handy on your
+         system.  You might have modified some files without having the
+         proper tools for further handling them.
+         You can get \`$1Help2man' as part of \`Autoconf' from any GNU
+         archive site."
+
+    file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
+    test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
+    if test -f "$file"; then
+       touch $file
+    else
+       test -z "$file" || exec >$file
+       echo "#! /bin/sh"
+       echo "# Created by GNU Automake missing as a replacement of"
+       echo "#  $ $@"
+       echo "exit 0"
+       chmod +x $file
+       exit 1
+    fi
+    ;;
+
+  bison|yacc)
+    echo 1>&2 "\
+WARNING: \`$1' is missing on your system.  You should only need it if
+         you modified a \`.y' file.  You may need the \`Bison' package
+         in order for those modifications to take effect.  You can get
+         \`Bison' from any GNU archive site."
+    rm -f y.tab.c y.tab.h
+    if [ $# -ne 1 ]; then
+        eval LASTARG="\${$#}"
+       case "$LASTARG" in
+       *.y)
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+           if [ -f "$SRCFILE" ]; then
+                cp "$SRCFILE" y.tab.c
+           fi
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+           if [ -f "$SRCFILE" ]; then
+                cp "$SRCFILE" y.tab.h
+           fi
+         ;;
+       esac
+    fi
+    if [ ! -f y.tab.h ]; then
+       echo >y.tab.h
+    fi
+    if [ ! -f y.tab.c ]; then
+       echo 'main() { return 0; }' >y.tab.c
+    fi
+    ;;
+
+  lex|flex)
+    echo 1>&2 "\
+WARNING: \`$1' is missing on your system.  You should only need it if
+         you modified a \`.l' file.  You may need the \`Flex' package
+         in order for those modifications to take effect.  You can get
+         \`Flex' from any GNU archive site."
+    rm -f lex.yy.c
+    if [ $# -ne 1 ]; then
+        eval LASTARG="\${$#}"
+       case "$LASTARG" in
+       *.l)
+           SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+           if [ -f "$SRCFILE" ]; then
+                cp "$SRCFILE" lex.yy.c
+           fi
+         ;;
+       esac
+    fi
+    if [ ! -f lex.yy.c ]; then
+       echo 'main() { return 0; }' >lex.yy.c
+    fi
+    ;;
+
+  help2man)
+    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+       # We have it, but it failed.
+       exit 1
+    fi
+
+    echo 1>&2 "\
+WARNING: \`$1' is missing on your system.  You should only need it if
+        you modified a dependency of a manual page.  You may need the
+        \`Help2man' package in order for those modifications to take
+        effect.  You can get \`Help2man' from any GNU archive site."
+
+    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+    if test -z "$file"; then
+       file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
+    fi
+    if [ -f "$file" ]; then
+       touch $file
+    else
+       test -z "$file" || exec >$file
+       echo ".ab help2man is required to generate this page"
+       exit 1
+    fi
+    ;;
+
+  makeinfo)
+    if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
+       # We have makeinfo, but it failed.
+       exit 1
+    fi
+
+    echo 1>&2 "\
+WARNING: \`$1' is missing on your system.  You should only need it if
+         you modified a \`.texi' or \`.texinfo' file, or any other file
+         indirectly affecting the aspect of the manual.  The spurious
+         call might also be the consequence of using a buggy \`make' (AIX,
+         DU, IRIX).  You might want to install the \`Texinfo' package or
+         the \`GNU make' package.  Grab either from any GNU archive site."
+    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+    if test -z "$file"; then
+      file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+      file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
+    fi
+    touch $file
+    ;;
+
+  tar)
+    shift
+    if test -n "$run"; then
+      echo 1>&2 "ERROR: \`tar' requires --run"
+      exit 1
+    fi
+
+    # We have already tried tar in the generic part.
+    # Look for gnutar/gtar before invocation to avoid ugly error
+    # messages.
+    if (gnutar --version > /dev/null 2>&1); then
+       gnutar "$@" && exit 0
+    fi
+    if (gtar --version > /dev/null 2>&1); then
+       gtar "$@" && exit 0
+    fi
+    firstarg="$1"
+    if shift; then
+       case "$firstarg" in
+       *o*)
+           firstarg=`echo "$firstarg" | sed s/o//`
+           tar "$firstarg" "$@" && exit 0
+           ;;
+       esac
+       case "$firstarg" in
+       *h*)
+           firstarg=`echo "$firstarg" | sed s/h//`
+           tar "$firstarg" "$@" && exit 0
+           ;;
+       esac
+    fi
+
+    echo 1>&2 "\
+WARNING: I can't seem to be able to run \`tar' with the given arguments.
+         You may want to install GNU tar or Free paxutils, or check the
+         command line arguments."
+    exit 1
+    ;;
+
+  *)
+    echo 1>&2 "\
+WARNING: \`$1' is needed, and you do not seem to have it handy on your
+         system.  You might have modified some files without having the
+         proper tools for further handling them.  Check the \`README' file,
+         it often tells you about the needed prerequirements for installing
+         this package.  You may also peek at any GNU archive site, in case
+         some other package would contain this missing \`$1' program."
+    exit 1
+    ;;
+esac
+
+exit 0
diff --git a/acaux/mkinstalldirs b/acaux/mkinstalldirs
new file mode 100755 (executable)
index 0000000..8ab885e
--- /dev/null
@@ -0,0 +1,99 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+# Author: Noah Friedman <friedman@prep.ai.mit.edu>
+# Created: 1993-05-16
+# Public domain
+
+errstatus=0
+dirmode=""
+
+usage="\
+Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
+
+# process command line arguments
+while test $# -gt 0 ; do
+   case "${1}" in
+     -h | --help | --h* )                      # -h for help
+       echo "${usage}" 1>&2; exit 0 ;;
+     -m )                                      # -m PERM arg
+       shift
+       test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
+       dirmode="${1}"
+       shift ;;
+     -- ) shift; break ;;                      # stop option processing
+     -* ) echo "${usage}" 1>&2; exit 1 ;;      # unknown option
+     * )  break ;;                             # first non-opt arg
+   esac
+done
+
+for file
+do
+  if test -d "$file"; then
+    shift
+  else
+    break
+  fi
+done
+
+case $# in
+0) exit 0 ;;
+esac
+
+case $dirmode in
+'')
+  if mkdir -p -- . 2>/dev/null; then
+    echo "mkdir -p -- $*"
+    exec mkdir -p -- "$@"
+  fi ;;
+*)
+  if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
+    echo "mkdir -m $dirmode -p -- $*"
+    exec mkdir -m "$dirmode" -p -- "$@"
+  fi ;;
+esac
+
+for file
+do
+   set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+   shift
+
+   pathcomp=
+   for d
+   do
+     pathcomp="$pathcomp$d"
+     case "$pathcomp" in
+       -* ) pathcomp=./$pathcomp ;;
+     esac
+
+     if test ! -d "$pathcomp"; then
+       echo "mkdir $pathcomp"
+
+       mkdir "$pathcomp" || lasterr=$?
+
+       if test ! -d "$pathcomp"; then
+         errstatus=$lasterr
+       else
+         if test ! -z "$dirmode"; then
+            echo "chmod $dirmode $pathcomp"
+
+            lasterr=""
+            chmod "$dirmode" "$pathcomp" || lasterr=$?
+
+            if test ! -z "$lasterr"; then
+              errstatus=$lasterr
+            fi
+         fi
+       fi
+     fi
+
+     pathcomp="$pathcomp/"
+   done
+done
+
+exit $errstatus
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 3
+# End:
+# mkinstalldirs ends here
diff --git a/aclocal.m4 b/aclocal.m4
new file mode 100644 (file)
index 0000000..b9e32cf
--- /dev/null
@@ -0,0 +1,7249 @@
+# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005  Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+
+# serial 48 AC_PROG_LIBTOOL
+
+
+# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
+# -----------------------------------------------------------
+# If this macro is not defined by Autoconf, define it here.
+m4_ifdef([AC_PROVIDE_IFELSE],
+         [],
+         [m4_define([AC_PROVIDE_IFELSE],
+                [m4_ifdef([AC_PROVIDE_$1],
+                          [$2], [$3])])])
+
+
+# AC_PROG_LIBTOOL
+# ---------------
+AC_DEFUN([AC_PROG_LIBTOOL],
+[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
+dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
+dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
+  AC_PROVIDE_IFELSE([AC_PROG_CXX],
+    [AC_LIBTOOL_CXX],
+    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
+  ])])
+dnl And a similar setup for Fortran 77 support
+  AC_PROVIDE_IFELSE([AC_PROG_F77],
+    [AC_LIBTOOL_F77],
+    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
+])])
+
+dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
+dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
+dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
+  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+    [AC_LIBTOOL_GCJ],
+    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+      [AC_LIBTOOL_GCJ],
+      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
+       [AC_LIBTOOL_GCJ],
+      [ifdef([AC_PROG_GCJ],
+            [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
+       ifdef([A][M_PROG_GCJ],
+            [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
+       ifdef([LT_AC_PROG_GCJ],
+            [define([LT_AC_PROG_GCJ],
+               defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
+])])# AC_PROG_LIBTOOL
+
+
+# _AC_PROG_LIBTOOL
+# ----------------
+AC_DEFUN([_AC_PROG_LIBTOOL],
+[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+# Prevent multiple expansion
+define([AC_PROG_LIBTOOL], [])
+])# _AC_PROG_LIBTOOL
+
+
+# AC_LIBTOOL_SETUP
+# ----------------
+AC_DEFUN([AC_LIBTOOL_SETUP],
+[AC_PREREQ(2.50)dnl
+AC_REQUIRE([AC_ENABLE_SHARED])dnl
+AC_REQUIRE([AC_ENABLE_STATIC])dnl
+AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_LD])dnl
+AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
+AC_REQUIRE([AC_PROG_NM])dnl
+
+AC_REQUIRE([AC_PROG_LN_S])dnl
+AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+AC_REQUIRE([AC_OBJEXT])dnl
+AC_REQUIRE([AC_EXEEXT])dnl
+dnl
+
+AC_LIBTOOL_SYS_MAX_CMD_LEN
+AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+AC_LIBTOOL_OBJDIR
+
+AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+_LT_AC_PROG_ECHO_BACKSLASH
+
+case $host_os in
+aix3*)
+  # AIX sometimes has problems with the GCC collect2 program.  For some
+  # reason, if we set the COLLECT_NAMES environment variable, the problems
+  # vanish in a puff of smoke.
+  if test "X${COLLECT_NAMES+set}" != Xset; then
+    COLLECT_NAMES=
+    export COLLECT_NAMES
+  fi
+  ;;
+esac
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e 1s/^X//'
+[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
+
+# Same as above, but do not quote variable references.
+[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Constants:
+rm="rm -f"
+
+# Global variables:
+default_ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+ltmain="$ac_aux_dir/ltmain.sh"
+ofile="$default_ofile"
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+AC_CHECK_TOOL(AR, ar, false)
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+AC_CHECK_TOOL(STRIP, strip, :)
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+test -z "$AS" && AS=as
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+test -z "$LD" && LD=ld
+test -z "$LN_S" && LN_S="ln -s"
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+test -z "$NM" && NM=nm
+test -z "$SED" && SED=sed
+test -z "$OBJDUMP" && OBJDUMP=objdump
+test -z "$RANLIB" && RANLIB=:
+test -z "$STRIP" && STRIP=:
+test -z "$ac_objext" && ac_objext=o
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+    ;;
+  *)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+_LT_CC_BASENAME([$compiler])
+
+# Only perform the check for file, if the check method requires it
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    AC_PATH_MAGIC
+  fi
+  ;;
+esac
+
+AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
+enable_win32_dll=yes, enable_win32_dll=no)
+
+AC_ARG_ENABLE([libtool-lock],
+    [AC_HELP_STRING([--disable-libtool-lock],
+       [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+AC_ARG_WITH([pic],
+    [AC_HELP_STRING([--with-pic],
+       [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+    [pic_mode="$withval"],
+    [pic_mode=default])
+test -z "$pic_mode" && pic_mode=default
+
+# Use C for the default configuration in the libtool script
+tagname=
+AC_LIBTOOL_LANG_C_CONFIG
+_LT_AC_TAGCONFIG
+])# AC_LIBTOOL_SETUP
+
+
+# _LT_AC_SYS_COMPILER
+# -------------------
+AC_DEFUN([_LT_AC_SYS_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_AC_SYS_COMPILER
+
+
+# _LT_CC_BASENAME(CC)
+# -------------------
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+AC_DEFUN([_LT_CC_BASENAME],
+[for cc_temp in $1""; do
+  case $cc_temp in
+    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+])
+
+
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+AC_DEFUN([_LT_COMPILER_BOILERPLATE],
+[ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+])# _LT_COMPILER_BOILERPLATE
+
+
+# _LT_LINKER_BOILERPLATE
+# ----------------------
+# Check for linker boilerplate output or warnings with
+# the simple link test code.
+AC_DEFUN([_LT_LINKER_BOILERPLATE],
+[ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+])# _LT_LINKER_BOILERPLATE
+
+
+# _LT_AC_SYS_LIBPATH_AIX
+# ----------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
+[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi],[])
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+])# _LT_AC_SYS_LIBPATH_AIX
+
+
+# _LT_AC_SHELL_INIT(ARG)
+# ----------------------
+AC_DEFUN([_LT_AC_SHELL_INIT],
+[ifdef([AC_DIVERSION_NOTICE],
+            [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
+        [AC_DIVERT_PUSH(NOTICE)])
+$1
+AC_DIVERT_POP
+])# _LT_AC_SHELL_INIT
+
+
+# _LT_AC_PROG_ECHO_BACKSLASH
+# --------------------------
+# Add some code to the start of the generated configure script which
+# will find an echo command which doesn't interpret backslashes.
+AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
+[_LT_AC_SHELL_INIT([
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$ECHO in
+X*--fallback-echo)
+  # Remove one level of quotation (which was required for Make).
+  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
+  ;;
+esac
+
+echo=${ECHO-echo}
+if test "X[$]1" = X--no-reexec; then
+  # Discard the --no-reexec flag, and continue.
+  shift
+elif test "X[$]1" = X--fallback-echo; then
+  # Avoid inline document here, it may be left over
+  :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
+  # Yippee, $echo works!
+  :
+else
+  # Restart under the correct shell.
+  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
+fi
+
+if test "X[$]1" = X--fallback-echo; then
+  # used as fallback echo
+  shift
+  cat <<EOF
+[$]*
+EOF
+  exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test -z "$ECHO"; then
+if test "X${echo_test_string+set}" != Xset; then
+# find a string as large as possible, as long as the shell can cope with it
+  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
+    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+    if (echo_test_string=`eval $cmd`) 2>/dev/null &&
+       echo_test_string=`eval $cmd` &&
+       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
+    then
+      break
+    fi
+  done
+fi
+
+if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+   test "X$echo_testing_string" = "X$echo_test_string"; then
+  :
+else
+  # The Solaris, AIX, and Digital Unix default echo programs unquote
+  # backslashes.  This makes it impossible to quote backslashes using
+  #   echo "$something" | sed 's/\\/\\\\/g'
+  #
+  # So, first we look for a working echo in the user's PATH.
+
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for dir in $PATH /usr/ucb; do
+    IFS="$lt_save_ifs"
+    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+       test "X$echo_testing_string" = "X$echo_test_string"; then
+      echo="$dir/echo"
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+
+  if test "X$echo" = Xecho; then
+    # We didn't find a better echo, so look for alternatives.
+    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
+       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
+       test "X$echo_testing_string" = "X$echo_test_string"; then
+      # This shell has a builtin print -r that does the trick.
+      echo='print -r'
+    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
+        test "X$CONFIG_SHELL" != X/bin/ksh; then
+      # If we have ksh, try running configure again with it.
+      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+      export ORIGINAL_CONFIG_SHELL
+      CONFIG_SHELL=/bin/ksh
+      export CONFIG_SHELL
+      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
+    else
+      # Try using printf.
+      echo='printf %s\n'
+      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+        echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+        test "X$echo_testing_string" = "X$echo_test_string"; then
+       # Cool, printf works
+       :
+      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+          test "X$echo_testing_string" = 'X\t' &&
+          echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+          test "X$echo_testing_string" = "X$echo_test_string"; then
+       CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+       export CONFIG_SHELL
+       SHELL="$CONFIG_SHELL"
+       export SHELL
+       echo="$CONFIG_SHELL [$]0 --fallback-echo"
+      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+          test "X$echo_testing_string" = 'X\t' &&
+          echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+          test "X$echo_testing_string" = "X$echo_test_string"; then
+       echo="$CONFIG_SHELL [$]0 --fallback-echo"
+      else
+       # maybe with a smaller string...
+       prev=:
+
+       for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
+         if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
+         then
+           break
+         fi
+         prev="$cmd"
+       done
+
+       if test "$prev" != 'sed 50q "[$]0"'; then
+         echo_test_string=`eval $prev`
+         export echo_test_string
+         exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
+       else
+         # Oops.  We lost completely, so just stick with echo.
+         echo=echo
+       fi
+      fi
+    fi
+  fi
+fi
+fi
+
+# Copy echo and quote the copy suitably for passing to libtool from
+# the Makefile, instead of quoting the original, which is used later.
+ECHO=$echo
+if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
+   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
+fi
+
+AC_SUBST(ECHO)
+])])# _LT_AC_PROG_ECHO_BACKSLASH
+
+
+# _LT_AC_LOCK
+# -----------
+AC_DEFUN([_LT_AC_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+    [AC_HELP_STRING([--disable-libtool-lock],
+       [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.$ac_objext` in
+    *ELF-32*)
+      HPUX_IA64_MODE="32"
+      ;;
+    *ELF-64*)
+      HPUX_IA64_MODE="64"
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+*-*-irix6*)
+  # Find out which ABI we are using.
+  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+   if test "$lt_cv_prog_gnu_ld" = yes; then
+    case `/usr/bin/file conftest.$ac_objext` in
+    *32-bit*)
+      LD="${LD-ld} -melf32bsmip"
+      ;;
+    *N32*)
+      LD="${LD-ld} -melf32bmipn32"
+      ;;
+    *64-bit*)
+      LD="${LD-ld} -melf64bmip"
+      ;;
+    esac
+   else
+    case `/usr/bin/file conftest.$ac_objext` in
+    *32-bit*)
+      LD="${LD-ld} -32"
+      ;;
+    *N32*)
+      LD="${LD-ld} -n32"
+      ;;
+    *64-bit*)
+      LD="${LD-ld} -64"
+      ;;
+    esac
+   fi
+  fi
+  rm -rf conftest*
+  ;;
+
+x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.o` in
+    *32-bit*)
+      case $host in
+        x86_64-*linux*)
+          LD="${LD-ld} -m elf_i386"
+          ;;
+        ppc64-*linux*|powerpc64-*linux*)
+          LD="${LD-ld} -m elf32ppclinux"
+          ;;
+        s390x-*linux*)
+          LD="${LD-ld} -m elf_s390"
+          ;;
+        sparc64-*linux*)
+          LD="${LD-ld} -m elf32_sparc"
+          ;;
+      esac
+      ;;
+    *64-bit*)
+      case $host in
+        x86_64-*linux*)
+          LD="${LD-ld} -m elf_x86_64"
+          ;;
+        ppc*-*linux*|powerpc*-*linux*)
+          LD="${LD-ld} -m elf64ppc"
+          ;;
+        s390*-*linux*)
+          LD="${LD-ld} -m elf64_s390"
+          ;;
+        sparc*-*linux*)
+          LD="${LD-ld} -m elf64_sparc"
+          ;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+    [AC_LANG_PUSH(C)
+     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+     AC_LANG_POP])
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
+  ;;
+sparc*-*solaris*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.o` in
+    *64-bit*)
+      case $lt_cv_prog_gnu_ld in
+      yes*) LD="${LD-ld} -m elf64_sparc" ;;
+      *)    LD="${LD-ld} -64" ;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
+[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
+  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+  AC_CHECK_TOOL(AS, as, false)
+  AC_CHECK_TOOL(OBJDUMP, objdump, false)
+  ;;
+  ])
+esac
+
+need_locks="$enable_libtool_lock"
+
+])# _LT_AC_LOCK
+
+
+# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#              [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
+[AC_REQUIRE([LT_AC_PROG_SED])
+AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$3"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&AS_MESSAGE_LOG_FD
+   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       $2=yes
+     fi
+   fi
+   $rm conftest*
+])
+
+if test x"[$]$2" = xyes; then
+    ifelse([$5], , :, [$5])
+else
+    ifelse([$6], , :, [$6])
+fi
+])# AC_LIBTOOL_COMPILER_OPTION
+
+
+# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#                          [ACTION-SUCCESS], [ACTION-FAILURE])
+# ------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
+[AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $3"
+   printf "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&AS_MESSAGE_LOG_FD
+       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         $2=yes
+       fi
+     else
+       $2=yes
+     fi
+   fi
+   $rm conftest*
+   LDFLAGS="$save_LDFLAGS"
+])
+
+if test x"[$]$2" = xyes; then
+    ifelse([$4], , :, [$4])
+else
+    ifelse([$5], , :, [$5])
+fi
+])# AC_LIBTOOL_LINKER_OPTION
+
+
+# AC_LIBTOOL_SYS_MAX_CMD_LEN
+# --------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
+[# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+  i=0
+  teststring="ABCD"
+
+  case $build_os in
+  msdosdjgpp*)
+    # On DJGPP, this test can blow up pretty badly due to problems in libc
+    # (any single argument exceeding 2000 bytes causes a buffer overrun
+    # during glob expansion).  Even if it were fixed, the result of this
+    # check would be larger than it should be.
+    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
+    ;;
+
+  gnu*)
+    # Under GNU Hurd, this test is not required because there is
+    # no limit to the length of command line arguments.
+    # Libtool will interpret -1 as no limit whatsoever
+    lt_cv_sys_max_cmd_len=-1;
+    ;;
+
+  cygwin* | mingw*)
+    # On Win9x/ME, this test blows up -- it succeeds, but takes
+    # about 5 minutes as the teststring grows exponentially.
+    # Worse, since 9x/ME are not pre-emptively multitasking,
+    # you end up with a "frozen" computer, even though with patience
+    # the test eventually succeeds (with a max line length of 256k).
+    # Instead, let's just punt: use the minimum linelength reported by
+    # all of the supported platforms: 8192 (on NT/2K/XP).
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  amigaos*)
+    # On AmigaOS with pdksh, this test takes hours, literally.
+    # So we just punt and use a minimum line length of 8192.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+    # This has been around since 386BSD, at least.  Likely further.
+    if test -x /sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+    elif test -x /usr/sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+    else
+      lt_cv_sys_max_cmd_len=65536      # usable default for all BSDs
+    fi
+    # And add a safety zone
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    ;;
+
+  interix*)
+    # We know the value 262144 and hardcode it with a safety zone (like BSD)
+    lt_cv_sys_max_cmd_len=196608
+    ;;
+
+  osf*)
+    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+    # nice to cause kernel panics so lets avoid the loop below.
+    # First set a reasonable default.
+    lt_cv_sys_max_cmd_len=16384
+    #
+    if test -x /sbin/sysconfig; then
+      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+        *1*) lt_cv_sys_max_cmd_len=-1 ;;
+      esac
+    fi
+    ;;
+  sco3.2v5*)
+    lt_cv_sys_max_cmd_len=102400
+    ;;
+  sysv5* | sco5v6* | sysv4.2uw2*)
+    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+    if test -n "$kargmax"; then
+      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[       ]]//'`
+    else
+      lt_cv_sys_max_cmd_len=32768
+    fi
+    ;;
+  *)
+    # If test is not a shell built-in, we'll probably end up computing a
+    # maximum length that is only half of the actual maximum length, but
+    # we can't tell.
+    SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+    while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
+              = "XX$teststring") >/dev/null 2>&1 &&
+           new_result=`expr "X$teststring" : ".*" 2>&1` &&
+           lt_cv_sys_max_cmd_len=$new_result &&
+           test $i != 17 # 1/2 MB should be enough
+    do
+      i=`expr $i + 1`
+      teststring=$teststring$teststring
+    done
+    teststring=
+    # Add a significant safety factor because C++ compilers can tack on massive
+    # amounts of additional arguments before passing them to the linker.
+    # It appears as though 1/2 is a usable value.
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+    ;;
+  esac
+])
+if test -n $lt_cv_sys_max_cmd_len ; then
+  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+  AC_MSG_RESULT(none)
+fi
+])# AC_LIBTOOL_SYS_MAX_CMD_LEN
+
+
+# _LT_AC_CHECK_DLFCN
+# ------------------
+AC_DEFUN([_LT_AC_CHECK_DLFCN],
+[AC_CHECK_HEADERS(dlfcn.h)dnl
+])# _LT_AC_CHECK_DLFCN
+
+
+# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ---------------------------------------------------------------------
+AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
+[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
+if test "$cross_compiling" = yes; then :
+  [$4]
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+[#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL          RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL                DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL                0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW           RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW         DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW       RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW     DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW     0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+      /* dlclose (self); */
+    }
+  else
+    puts (dlerror ());
+
+    exit (status);
+}]
+EOF
+  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) $1 ;;
+      x$lt_dlneed_uscore) $2 ;;
+      x$lt_dlunknown|x*) $3 ;;
+    esac
+  else :
+    # compilation failed
+    $3
+  fi
+fi
+rm -fr conftest*
+])# _LT_AC_TRY_DLOPEN_SELF
+
+
+# AC_LIBTOOL_DLOPEN_SELF
+# ----------------------
+AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
+[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
+if test "x$enable_dlopen" != xyes; then
+  enable_dlopen=unknown
+  enable_dlopen_self=unknown
+  enable_dlopen_self_static=unknown
+else
+  lt_cv_dlopen=no
+  lt_cv_dlopen_libs=
+
+  case $host_os in
+  beos*)
+    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ;;
+
+  mingw* | pw32*)
+    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen_libs=
+   ;;
+
+  cygwin*)
+    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen_libs=
+   ;;
+
+  darwin*)
+  # if libdl is installed we need to link against it
+    AC_CHECK_LIB([dl], [dlopen],
+               [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ])
+   ;;
+
+  *)
+    AC_CHECK_FUNC([shl_load],
+         [lt_cv_dlopen="shl_load"],
+      [AC_CHECK_LIB([dld], [shl_load],
+           [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
+       [AC_CHECK_FUNC([dlopen],
+             [lt_cv_dlopen="dlopen"],
+         [AC_CHECK_LIB([dl], [dlopen],
+               [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+           [AC_CHECK_LIB([svld], [dlopen],
+                 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+             [AC_CHECK_LIB([dld], [dld_link],
+                   [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
+             ])
+           ])
+         ])
+       ])
+      ])
+    ;;
+  esac
+
+  if test "x$lt_cv_dlopen" != xno; then
+    enable_dlopen=yes
+  else
+    enable_dlopen=no
+  fi
+
+  case $lt_cv_dlopen in
+  dlopen)
+    save_CPPFLAGS="$CPPFLAGS"
+    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+    save_LDFLAGS="$LDFLAGS"
+    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    AC_CACHE_CHECK([whether a program can dlopen itself],
+         lt_cv_dlopen_self, [dnl
+         _LT_AC_TRY_DLOPEN_SELF(
+           lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+           lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+    ])
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+         lt_cv_dlopen_self_static, [dnl
+         _LT_AC_TRY_DLOPEN_SELF(
+           lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+           lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
+      ])
+    fi
+
+    CPPFLAGS="$save_CPPFLAGS"
+    LDFLAGS="$save_LDFLAGS"
+    LIBS="$save_LIBS"
+    ;;
+  esac
+
+  case $lt_cv_dlopen_self in
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+  *) enable_dlopen_self=unknown ;;
+  esac
+
+  case $lt_cv_dlopen_self_static in
+  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+  *) enable_dlopen_self_static=unknown ;;
+  esac
+fi
+])# AC_LIBTOOL_DLOPEN_SELF
+
+
+# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
+# ---------------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler
+AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
+[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&AS_MESSAGE_LOG_FD
+   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+     fi
+   fi
+   chmod u+w . 2>&AS_MESSAGE_LOG_FD
+   $rm conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
+   $rm out/* && rmdir out
+   cd ..
+   rmdir conftest
+   $rm conftest*
+])
+])# AC_LIBTOOL_PROG_CC_C_O
+
+
+# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
+# -----------------------------------------
+# Check to see if we can do hard links to lock some files if needed
+AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
+[AC_REQUIRE([_LT_AC_LOCK])dnl
+
+hard_links="nottested"
+if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  AC_MSG_CHECKING([if we can lock with hard links])
+  hard_links=yes
+  $rm conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  AC_MSG_RESULT([$hard_links])
+  if test "$hard_links" = no; then
+    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
+
+
+# AC_LIBTOOL_OBJDIR
+# -----------------
+AC_DEFUN([AC_LIBTOOL_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+  lt_cv_objdir=.libs
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+])# AC_LIBTOOL_OBJDIR
+
+
+# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
+# ----------------------------------------------
+# Check hardcoding attributes.
+AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_AC_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
+   test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
+   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+     test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
+    # Linking always hardcodes the temporary library directory.
+    _LT_AC_TAGVAR(hardcode_action, $1)=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    _LT_AC_TAGVAR(hardcode_action, $1)=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
+
+
+# AC_LIBTOOL_SYS_LIB_STRIP
+# ------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
+[striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+   darwin*)
+       if test -n "$STRIP" ; then
+         striplib="$STRIP -x"
+         AC_MSG_RESULT([yes])
+       else
+  AC_MSG_RESULT([no])
+fi
+       ;;
+   *)
+  AC_MSG_RESULT([no])
+    ;;
+  esac
+fi
+])# AC_LIBTOOL_SYS_LIB_STRIP
+
+
+# AC_LIBTOOL_SYS_DYNAMIC_LINKER
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
+[AC_MSG_CHECKING([dynamic linker characteristics])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+if test "$GCC" = yes; then
+  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+    # if the path contains ";" then we assume it to be the separator
+    # otherwise default to the standard path separator (i.e. ":") - it is
+    # assumed that no part of a normal pathname contains ";" but that should
+    # okay in the real world where ";" in dirpaths is itself problematic.
+    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+  else
+    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+  fi
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix4* | aix5*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[[01]] | aix4.[[01]].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+          echo ' yes '
+          echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+       :
+      else
+       can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  library_names_spec='$libname.ixlibrary $libname.a'
+  # Create ${libname}_ixlibrary.a entries in /sys/libs.
+  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[[45]]*)
+  version_type=linux
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $rm \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+      if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
+        # It is most probably a Windows format PATH printed by
+        # mingw gcc, but we are running on Cygwin. Gcc prints its search
+        # path with ; separators, and with drive letters. We can handle the
+        # drive letters (cygwin fileutils understands them), so leave them,
+        # especially as we might pass files found there to a mingw objdump,
+        # which wouldn't understand a cygwinified path. Ahh.
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    ;;
+
+  *)
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    ;;
+  esac
+  dynamic_linker='Win32 ld.exe'
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd1*)
+  dynamic_linker=no
+  ;;
+
+kfreebsd*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[[123]]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
+  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  freebsd*) # from 4.6 on
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+   hppa*64*)
+     shrext_cmds='.sl'
+     hardcode_into_libs=yes
+     dynamic_linker="$host_os dld.sl"
+     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+     soname_spec='${libname}${release}${shared_ext}$major'
+     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+     ;;
+   *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555.
+  postinstall_cmds='chmod 555 $lib'
+  ;;
+
+interix3*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+       if test "$lt_cv_prog_gnu_ld" = yes; then
+               version_type=linux
+       else
+               version_type=irix
+       fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be Linux ELF.
+linux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # find out which ABI we are using
+  libsuff=
+  case "$host_cpu" in
+  x86_64*|s390x*|powerpc64*)
+    echo '[#]line __oline__ "configure"' > conftest.$ac_ext
+    if AC_TRY_EVAL(ac_compile); then
+      case `/usr/bin/file conftest.$ac_objext` in
+      *64-bit*)
+        libsuff=64
+        sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+        ;;
+      esac
+    fi
+    rm -rf conftest*
+    ;;
+  esac
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,       ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+knetbsd*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+nto-qnx*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+openbsd*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+    *)                         need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[[89]] | openbsd2.[[89]].*)
+       shlibpath_overrides_runpath=no
+       ;;
+      *)
+       shlibpath_overrides_runpath=yes
+       ;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+    shlibpath_overrides_runpath=no
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    shlibpath_overrides_runpath=yes
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+       ;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
+
+
+# _LT_AC_TAGCONFIG
+# ----------------
+AC_DEFUN([_LT_AC_TAGCONFIG],
+[AC_ARG_WITH([tags],
+    [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
+        [include additional configurations @<:@automatic@:>@])],
+    [tagnames="$withval"])
+
+if test -f "$ltmain" && test -n "$tagnames"; then
+  if test ! -f "${ofile}"; then
+    AC_MSG_WARN([output file `$ofile' does not exist])
+  fi
+
+  if test -z "$LTCC"; then
+    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
+    if test -z "$LTCC"; then
+      AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
+    else
+      AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
+    fi
+  fi
+  if test -z "$LTCFLAGS"; then
+    eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
+  fi
+
+  # Extract list of available tagged configurations in $ofile.
+  # Note that this assumes the entire list is on one line.
+  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
+
+  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+  for tagname in $tagnames; do
+    IFS="$lt_save_ifs"
+    # Check whether tagname contains only valid characters
+    case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
+    "") ;;
+    *)  AC_MSG_ERROR([invalid tag name: $tagname])
+       ;;
+    esac
+
+    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
+    then
+      AC_MSG_ERROR([tag name \"$tagname\" already exists])
+    fi
+
+    # Update the list of available tags.
+    if test -n "$tagname"; then
+      echo appending configuration tag \"$tagname\" to $ofile
+
+      case $tagname in
+      CXX)
+       if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+           ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+           (test "X$CXX" != "Xg++"))) ; then
+         AC_LIBTOOL_LANG_CXX_CONFIG
+       else
+         tagname=""
+       fi
+       ;;
+
+      F77)
+       if test -n "$F77" && test "X$F77" != "Xno"; then
+         AC_LIBTOOL_LANG_F77_CONFIG
+       else
+         tagname=""
+       fi
+       ;;
+
+      GCJ)
+       if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
+         AC_LIBTOOL_LANG_GCJ_CONFIG
+       else
+         tagname=""
+       fi
+       ;;
+
+      RC)
+       AC_LIBTOOL_LANG_RC_CONFIG
+       ;;
+
+      *)
+       AC_MSG_ERROR([Unsupported tag name: $tagname])
+       ;;
+      esac
+
+      # Append the new tag name to the list of available tags.
+      if test -n "$tagname" ; then
+      available_tags="$available_tags $tagname"
+    fi
+    fi
+  done
+  IFS="$lt_save_ifs"
+
+  # Now substitute the updated list of available tags.
+  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
+    mv "${ofile}T" "$ofile"
+    chmod +x "$ofile"
+  else
+    rm -f "${ofile}T"
+    AC_MSG_ERROR([unable to update list of available tagged configurations.])
+  fi
+fi
+])# _LT_AC_TAGCONFIG
+
+
+# AC_LIBTOOL_DLOPEN
+# -----------------
+# enable checks for dlopen support
+AC_DEFUN([AC_LIBTOOL_DLOPEN],
+ [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
+])# AC_LIBTOOL_DLOPEN
+
+
+# AC_LIBTOOL_WIN32_DLL
+# --------------------
+# declare package support for building win32 DLLs
+AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
+])# AC_LIBTOOL_WIN32_DLL
+
+
+# AC_ENABLE_SHARED([DEFAULT])
+# ---------------------------
+# implement the --enable-shared flag
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_SHARED],
+[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([shared],
+    [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+       [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_shared=yes ;;
+    no) enable_shared=no ;;
+    *)
+      enable_shared=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_shared=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
+])# AC_ENABLE_SHARED
+
+
+# AC_DISABLE_SHARED
+# -----------------
+# set the default shared flag to --disable-shared
+AC_DEFUN([AC_DISABLE_SHARED],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_SHARED(no)
+])# AC_DISABLE_SHARED
+
+
+# AC_ENABLE_STATIC([DEFAULT])
+# ---------------------------
+# implement the --enable-static flag
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_STATIC],
+[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([static],
+    [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+       [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
+    *)
+     enable_static=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_static=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_static=]AC_ENABLE_STATIC_DEFAULT)
+])# AC_ENABLE_STATIC
+
+
+# AC_DISABLE_STATIC
+# -----------------
+# set the default static flag to --disable-static
+AC_DEFUN([AC_DISABLE_STATIC],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_STATIC(no)
+])# AC_DISABLE_STATIC
+
+
+# AC_ENABLE_FAST_INSTALL([DEFAULT])
+# ---------------------------------
+# implement the --enable-fast-install flag
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_FAST_INSTALL],
+[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([fast-install],
+    [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+    [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_fast_install=yes ;;
+    no) enable_fast_install=no ;;
+    *)
+      enable_fast_install=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_fast_install=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
+])# AC_ENABLE_FAST_INSTALL
+
+
+# AC_DISABLE_FAST_INSTALL
+# -----------------------
+# set the default to --disable-fast-install
+AC_DEFUN([AC_DISABLE_FAST_INSTALL],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_FAST_INSTALL(no)
+])# AC_DISABLE_FAST_INSTALL
+
+
+# AC_LIBTOOL_PICMODE([MODE])
+# --------------------------
+# implement the --with-pic flag
+# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
+AC_DEFUN([AC_LIBTOOL_PICMODE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+pic_mode=ifelse($#,1,$1,default)
+])# AC_LIBTOOL_PICMODE
+
+
+# AC_PROG_EGREP
+# -------------
+# This is predefined starting with Autoconf 2.54, so this conditional
+# definition can be removed once we require Autoconf 2.54 or later.
+m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
+[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
+   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+    then ac_cv_prog_egrep='grep -E'
+    else ac_cv_prog_egrep='egrep'
+    fi])
+ EGREP=$ac_cv_prog_egrep
+ AC_SUBST([EGREP])
+])])
+
+
+# AC_PATH_TOOL_PREFIX
+# -------------------
+# find a file program which can recognise shared library
+AC_DEFUN([AC_PATH_TOOL_PREFIX],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] |  ?:[\\/]*])
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word.  This closes a longstanding sh security hole.
+  ac_dummy="ifelse([$2], , $PATH, [$2])"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$1; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+      if test -n "$file_magic_test_file"; then
+       case $deplibs_check_method in
+       "file_magic "*)
+         file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+         MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+           $EGREP "$file_magic_regex" > /dev/null; then
+           :
+         else
+           cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+EOF
+         fi ;;
+       esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac])
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  AC_MSG_RESULT($MAGIC_CMD)
+else
+  AC_MSG_RESULT(no)
+fi
+])# AC_PATH_TOOL_PREFIX
+
+
+# AC_PATH_MAGIC
+# -------------
+# find a file program which can recognise a shared library
+AC_DEFUN([AC_PATH_MAGIC],
+[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+  else
+    MAGIC_CMD=:
+  fi
+fi
+])# AC_PATH_MAGIC
+
+
+# AC_PROG_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([AC_PROG_LD],
+[AC_ARG_WITH([gnu-ld],
+    [AC_HELP_STRING([--with-gnu-ld],
+       [assume the C compiler uses GNU ld @<:@default=no@:>@])],
+    [test "$withval" = no || with_gnu_ld=yes],
+    [with_gnu_ld=no])
+AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  AC_MSG_CHECKING([for ld used by $CC])
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [[\\/]]* | ?:[[\\/]]*)
+      re_direlt='/[[^/]][[^/]]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+       ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  AC_MSG_CHECKING([for GNU ld])
+else
+  AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some variants of GNU ld only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+       test "$with_gnu_ld" != no && break
+       ;;
+      *)
+       test "$with_gnu_ld" != yes && break
+       ;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  AC_MSG_RESULT($LD)
+else
+  AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AC_PROG_LD_GNU
+])# AC_PROG_LD
+
+
+# AC_PROG_LD_GNU
+# --------------
+AC_DEFUN([AC_PROG_LD_GNU],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# AC_PROG_LD_GNU
+
+
+# AC_PROG_LD_RELOAD_FLAG
+# ----------------------
+# find reload flag for linker
+#   -- PORTME Some linkers may need a different reload flag.
+AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+  lt_cv_ld_reload_flag,
+  [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  darwin*)
+    if test "$GCC" = yes; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
+])# AC_PROG_LD_RELOAD_FLAG
+
+
+# AC_DEPLIBS_CHECK_METHOD
+# -----------------------
+# how to check for library dependencies
+#  -- PORTME fill in with the dynamic library characteristics
+AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
+[AC_CACHE_CHECK([how to recognise dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix4* | aix5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi[[45]]*)
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin*)
+  # func_win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='func_win32_libid'
+  ;;
+
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump'.
+  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | kfreebsd*-gnu | dragonfly*)
+  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+    case $host_cpu in
+    i*86 )
+      # Not sure whether the presence of OpenBSD here was a mistake.
+      # Let's accept both of them until this is cleared up.
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
+      lt_cv_file_magic_cmd=/usr/bin/file
+      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+      ;;
+    esac
+  else
+    lt_cv_deplibs_check_method=pass_all
+  fi
+  ;;
+
+gnu*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+hpux10.20* | hpux11*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  case $host_cpu in
+  ia64*)
+    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+    ;;
+  hppa*64*)
+    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
+    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+    ;;
+  *)
+    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
+    lt_cv_file_magic_test_file=/usr/lib/libc.sl
+    ;;
+  esac
+  ;;
+
+interix3*)
+  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $LD in
+  *-32|*"-32 ") libmagic=32-bit;;
+  *-n32|*"-n32 ") libmagic=N32;;
+  *-64|*"-64 ") libmagic=64-bit;;
+  *) libmagic=never-match;;
+  esac
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+# This must be Linux ELF.
+linux*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+netbsd*)
+  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
+  fi
+  ;;
+
+newos6*)
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libnls.so
+  ;;
+
+nto-qnx*)
+  lt_cv_deplibs_check_method=unknown
+  ;;
+
+openbsd*)
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+  fi
+  ;;
+
+osf3* | osf4* | osf5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv4 | sysv4.3*)
+  case $host_vendor in
+  motorola)
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+    ;;
+  ncr)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  sequent)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+    ;;
+  sni)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+    lt_cv_file_magic_test_file=/lib/libc.so
+    ;;
+  siemens)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  pc)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  esac
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
+])
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+])# AC_DEPLIBS_CHECK_METHOD
+
+
+# AC_PROG_NM
+# ----------
+# find the pathname to a BSD-compatible name lister
+AC_DEFUN([AC_PROG_NM],
+[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
+[if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_nm_to_check="${ac_tool_prefix}nm"
+  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then 
+    lt_nm_to_check="$lt_nm_to_check nm"
+  fi
+  for lt_tmp_nm in $lt_nm_to_check; do
+    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+      IFS="$lt_save_ifs"
+      test -z "$ac_dir" && ac_dir=.
+      tmp_nm="$ac_dir/$lt_tmp_nm"
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+       # Check to see if the nm accepts a BSD-compat flag.
+       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+       #   nm: unknown option "B" ignored
+       # Tru64's nm complains that /dev/null is an invalid object file
+       case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+       */dev/null* | *'Invalid file or object type'*)
+         lt_cv_path_NM="$tmp_nm -B"
+         break
+         ;;
+       *)
+         case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+         */dev/null*)
+           lt_cv_path_NM="$tmp_nm -p"
+           break
+           ;;
+         *)
+           lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+           continue # so that we can try to find one that supports BSD flags
+           ;;
+         esac
+         ;;
+       esac
+      fi
+    done
+    IFS="$lt_save_ifs"
+  done
+  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+fi])
+NM="$lt_cv_path_NM"
+])# AC_PROG_NM
+
+
+# AC_CHECK_LIBM
+# -------------
+# check for math library
+AC_DEFUN([AC_CHECK_LIBM],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
+  # These system don't have libm, or don't need it
+  ;;
+*-ncr-sysv4.3*)
+  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+  ;;
+*)
+  AC_CHECK_LIB(m, cos, LIBM="-lm")
+  ;;
+esac
+])# AC_CHECK_LIBM
+
+
+# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
+# -----------------------------------
+# sets LIBLTDL to the link flags for the libltdl convenience library and
+# LTDLINCL to the include flags for the libltdl header and adds
+# --enable-ltdl-convenience to the configure arguments.  Note that
+# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
+# it is assumed to be `libltdl'.  LIBLTDL will be prefixed with
+# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/'
+# (note the single quotes!).  If your package is not flat and you're not
+# using automake, define top_builddir and top_srcdir appropriately in
+# the Makefiles.
+AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+  case $enable_ltdl_convenience in
+  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
+  "") enable_ltdl_convenience=yes
+      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
+  esac
+  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
+  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+  # For backwards non-gettext consistent compatibility...
+  INCLTDL="$LTDLINCL"
+])# AC_LIBLTDL_CONVENIENCE
+
+
+# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
+# -----------------------------------
+# sets LIBLTDL to the link flags for the libltdl installable library and
+# LTDLINCL to the include flags for the libltdl header and adds
+# --enable-ltdl-install to the configure arguments.  Note that
+# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
+# and an installed libltdl is not found, it is assumed to be `libltdl'.
+# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with
+# '${top_srcdir}/' (note the single quotes!).  If your package is not
+# flat and you're not using automake, define top_builddir and top_srcdir
+# appropriately in the Makefiles.
+# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
+AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+  AC_CHECK_LIB(ltdl, lt_dlinit,
+  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
+  [if test x"$enable_ltdl_install" = xno; then
+     AC_MSG_WARN([libltdl not installed, but installation disabled])
+   else
+     enable_ltdl_install=yes
+   fi
+  ])
+  if test x"$enable_ltdl_install" = x"yes"; then
+    ac_configure_args="$ac_configure_args --enable-ltdl-install"
+    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
+    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+  else
+    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
+    LIBLTDL="-lltdl"
+    LTDLINCL=
+  fi
+  # For backwards non-gettext consistent compatibility...
+  INCLTDL="$LTDLINCL"
+])# AC_LIBLTDL_INSTALLABLE
+
+
+# AC_LIBTOOL_CXX
+# --------------
+# enable support for C++ libraries
+AC_DEFUN([AC_LIBTOOL_CXX],
+[AC_REQUIRE([_LT_AC_LANG_CXX])
+])# AC_LIBTOOL_CXX
+
+
+# _LT_AC_LANG_CXX
+# ---------------
+AC_DEFUN([_LT_AC_LANG_CXX],
+[AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([_LT_AC_PROG_CXXCPP])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
+])# _LT_AC_LANG_CXX
+
+# _LT_AC_PROG_CXXCPP
+# ------------------
+AC_DEFUN([_LT_AC_PROG_CXXCPP],
+[
+AC_REQUIRE([AC_PROG_CXX])
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+    (test "X$CXX" != "Xg++"))) ; then
+  AC_PROG_CXXCPP
+fi
+])# _LT_AC_PROG_CXXCPP
+
+# AC_LIBTOOL_F77
+# --------------
+# enable support for Fortran 77 libraries
+AC_DEFUN([AC_LIBTOOL_F77],
+[AC_REQUIRE([_LT_AC_LANG_F77])
+])# AC_LIBTOOL_F77
+
+
+# _LT_AC_LANG_F77
+# ---------------
+AC_DEFUN([_LT_AC_LANG_F77],
+[AC_REQUIRE([AC_PROG_F77])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
+])# _LT_AC_LANG_F77
+
+
+# AC_LIBTOOL_GCJ
+# --------------
+# enable support for GCJ libraries
+AC_DEFUN([AC_LIBTOOL_GCJ],
+[AC_REQUIRE([_LT_AC_LANG_GCJ])
+])# AC_LIBTOOL_GCJ
+
+
+# _LT_AC_LANG_GCJ
+# ---------------
+AC_DEFUN([_LT_AC_LANG_GCJ],
+[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
+  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
+    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
+      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
+        [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
+          [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
+])# _LT_AC_LANG_GCJ
+
+
+# AC_LIBTOOL_RC
+# -------------
+# enable support for Windows resource files
+AC_DEFUN([AC_LIBTOOL_RC],
+[AC_REQUIRE([LT_AC_PROG_RC])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
+])# AC_LIBTOOL_RC
+
+
+# AC_LIBTOOL_LANG_C_CONFIG
+# ------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
+AC_DEFUN([_LT_AC_LANG_C_CONFIG],
+[lt_save_CC="$CC"
+AC_LANG_PUSH(C)
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}\n'
+
+_LT_AC_SYS_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF
+
+# Report which library types will actually be built
+AC_MSG_CHECKING([if libtool supports shared libraries])
+AC_MSG_RESULT([$can_build_shared])
+
+AC_MSG_CHECKING([whether to build shared libraries])
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case $host_os in
+aix3*)
+  test "$enable_shared" = yes && enable_static=no
+  if test -n "$RANLIB"; then
+    archive_cmds="$archive_cmds~\$RANLIB \$lib"
+    postinstall_cmds='$RANLIB $lib'
+  fi
+  ;;
+
+aix4* | aix5*)
+  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+    test "$enable_shared" = yes && enable_static=no
+  fi
+    ;;
+esac
+AC_MSG_RESULT([$enable_shared])
+
+AC_MSG_CHECKING([whether to build static libraries])
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+AC_MSG_RESULT([$enable_static])
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_C_CONFIG
+
+
+# AC_LIBTOOL_LANG_CXX_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
+AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
+[AC_LANG_PUSH(C++)
+AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([_LT_AC_PROG_CXXCPP])
+
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_AC_TAGVAR(allow_undefined_flag, $1)=
+_LT_AC_TAGVAR(always_export_symbols, $1)=no
+_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_direct, $1)=no
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+_LT_AC_TAGVAR(hardcode_automatic, $1)=no
+_LT_AC_TAGVAR(module_cmds, $1)=
+_LT_AC_TAGVAR(module_expsym_cmds, $1)=
+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_AC_TAGVAR(no_undefined_flag, $1)=
+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Dependencies to place before and after the object being linked:
+_LT_AC_TAGVAR(predep_objects, $1)=
+_LT_AC_TAGVAR(postdep_objects, $1)=
+_LT_AC_TAGVAR(predeps, $1)=
+_LT_AC_TAGVAR(postdeps, $1)=
+_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_LD=$LD
+lt_save_GCC=$GCC
+GCC=$GXX
+lt_save_with_gnu_ld=$with_gnu_ld
+lt_save_path_LD=$lt_cv_path_LD
+if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+  lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+else
+  $as_unset lt_cv_prog_gnu_ld
+fi
+if test -n "${lt_cv_path_LDCXX+set}"; then
+  lt_cv_path_LD=$lt_cv_path_LDCXX
+else
+  $as_unset lt_cv_path_LD
+fi
+test -z "${LDCXX+set}" || LD=$LDCXX
+CC=${CXX-"c++"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+
+# We don't want -fno-exception wen compiling C++ code, so set the
+# no_builtin_flag separately
+if test "$GXX" = yes; then
+  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+else
+  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+fi
+
+if test "$GXX" = yes; then
+  # Set up default GNU C++ configuration
+
+  AC_PROG_LD
+
+  # Check if GNU C++ uses GNU ld as the underlying linker, since the
+  # archiving commands below assume that GNU ld is being used.
+  if test "$with_gnu_ld" = yes; then
+    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+    #     investigate it a little bit more. (MM)
+    wlarc='${wl}'
+
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
+       grep 'no-whole-archive' > /dev/null; then
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+  else
+    with_gnu_ld=no
+    wlarc=
+
+    # A generic and very simple default shared library creation
+    # command for GNU C++ for the case where it uses the native
+    # linker, instead of GNU ld.  If possible, this setting should
+    # overridden to take advantage of the native linker features on
+    # the platform it is being used on.
+    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+  fi
+
+  # Commands to make compiler produce verbose output that lists
+  # what "hidden" libraries, object files and flags are used when
+  # linking a shared library.
+  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+else
+  GXX=no
+  with_gnu_ld=no
+  wlarc=
+fi
+
+# PORTME: fill in a description of your system's C++ link characteristics
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+_LT_AC_TAGVAR(ld_shlibs, $1)=yes
+case $host_os in
+  aix3*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  aix4* | aix5*)
+    if test "$host_cpu" = ia64; then
+      # On IA64, the linker does run time linking by default, so we don't
+      # have to do anything special.
+      aix_use_runtimelinking=no
+      exp_sym_flag='-Bexport'
+      no_entry_flag=""
+    else
+      aix_use_runtimelinking=no
+
+      # Test if we are trying to use run time linking or normal
+      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+      # need to do runtime linking.
+      case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
+       for ld_flag in $LDFLAGS; do
+         case $ld_flag in
+         *-brtl*)
+           aix_use_runtimelinking=yes
+           break
+           ;;
+         esac
+       done
+       ;;
+      esac
+
+      exp_sym_flag='-bexport'
+      no_entry_flag='-bnoentry'
+    fi
+
+    # When large executables or shared objects are built, AIX ld can
+    # have problems creating the table of contents.  If linking a library
+    # or program results in "error TOC overflow" add -mminimal-toc to
+    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+    _LT_AC_TAGVAR(archive_cmds, $1)=''
+    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+    if test "$GXX" = yes; then
+      case $host_os in aix4.[[012]]|aix4.[[012]].*)
+      # We only want to do this on AIX 4.2 and lower, the check
+      # below for broken collect2 doesn't work under 4.3+
+       collect2name=`${CC} -print-prog-name=collect2`
+       if test -f "$collect2name" && \
+          strings "$collect2name" | grep resolve_lib_name >/dev/null
+       then
+         # We have reworked collect2
+         _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+       else
+         # We have old collect2
+         _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+         # It fails to find uninstalled libraries when the uninstalled
+         # path is not listed in the libpath.  Setting hardcode_minus_L
+         # to unsupported forces relinking
+         _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+       fi
+       ;;
+      esac
+      shared_flag='-shared'
+      if test "$aix_use_runtimelinking" = yes; then
+       shared_flag="$shared_flag "'${wl}-G'
+      fi
+    else
+      # not using gcc
+      if test "$host_cpu" = ia64; then
+       # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+       # chokes on -Wl,-G. The following line is correct:
+       shared_flag='-G'
+      else
+       if test "$aix_use_runtimelinking" = yes; then
+         shared_flag='${wl}-G'
+       else
+         shared_flag='${wl}-bM:SRE'
+       fi
+      fi
+    fi
+
+    # It seems that -bexpall does not export symbols beginning with
+    # underscore (_), so it is better to generate a list of symbols to export.
+    _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+    if test "$aix_use_runtimelinking" = yes; then
+      # Warning - without using the other runtime loading flags (-brtl),
+      # -berok will link without error, but may produce a broken library.
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
+      # Determine the default libpath from the value encoded in an empty executable.
+      _LT_AC_SYS_LIBPATH_AIX
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+     else
+      if test "$host_cpu" = ia64; then
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+      else
+       # Determine the default libpath from the value encoded in an empty executable.
+       _LT_AC_SYS_LIBPATH_AIX
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+       # Warning - without using the other run time loading flags,
+       # -berok will link without error, but may produce a broken library.
+       _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+       # Exported symbols can be pulled into shared objects from archives
+       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+       _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+       # This is similar to how AIX traditionally builds its shared libraries.
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+      fi
+    fi
+    ;;
+
+  beos*)
+    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+      # support --undefined.  This deserves some investigation.  FIXME
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+    else
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    fi
+    ;;
+
+  chorus*)
+    case $cc_basename in
+      *)
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+    esac
+    ;;
+
+  cygwin* | mingw* | pw32*)
+    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+    # as there is no search path for DLLs.
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+    _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+    _LT_AC_TAGVAR(always_export_symbols, $1)=no
+    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      # If the export-symbols file already is a .def file (1st line
+      # is EXPORTS), use it as is; otherwise, prepend...
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+       cp $export_symbols $output_objdir/$soname.def;
+      else
+       echo EXPORTS > $output_objdir/$soname.def;
+       cat $export_symbols >> $output_objdir/$soname.def;
+      fi~
+      $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+    else
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    fi
+  ;;
+      darwin* | rhapsody*)
+        case $host_os in
+        rhapsody* | darwin1.[[012]])
+         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[[012]])
+               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+        esac
+      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+    if test "$GXX" = yes ; then
+      lt_int_apple_cc_single_mod=no
+      output_verbose_link_cmd='echo'
+      if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
+       lt_int_apple_cc_single_mod=yes
+      fi
+      if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      else
+          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+        fi
+        _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+          if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          else
+            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          fi
+            _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+          _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         _LT_AC_TAGVAR(ld_shlibs, $1)=no
+          ;;
+      esac
+      fi
+        ;;
+
+  dgux*)
+    case $cc_basename in
+      ec++*)
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+      ghcx*)
+       # Green Hills C++ Compiler
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+      *)
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+    esac
+    ;;
+  freebsd[[12]]*)
+    # C++ shared libraries reported to be fairly broken before switch to ELF
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  freebsd-elf*)
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    ;;
+  freebsd* | kfreebsd*-gnu | dragonfly*)
+    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+    # conventions
+    _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+    ;;
+  gnu*)
+    ;;
+  hpux9*)
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+    _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+                               # but as the default
+                               # location of the library.
+
+    case $cc_basename in
+    CC*)
+      # FIXME: insert proper C++ library support
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+    aCC*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      # Commands to make compiler produce verbose output that lists
+      # what "hidden" libraries, object files and flags are used when
+      # linking a shared library.
+      #
+      # There doesn't appear to be a way to prevent this compiler from
+      # explicitly linking system object files so we need to strip them
+      # from the output so that they don't get included in the library
+      # dependencies.
+      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+      ;;
+    *)
+      if test "$GXX" = yes; then
+        _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+        # FIXME: insert proper C++ library support
+        _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+    esac
+    ;;
+  hpux10*|hpux11*)
+    if test $with_gnu_ld = no; then
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+      case $host_cpu in
+      hppa*64*|ia64*)
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+        ;;
+      *)
+       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+        ;;
+      esac
+    fi
+    case $host_cpu in
+    hppa*64*|ia64*)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+    *)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+                                             # but as the default
+                                             # location of the library.
+      ;;
+    esac
+
+    case $cc_basename in
+      CC*)
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+      aCC*)
+       case $host_cpu in
+       hppa*64*)
+         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+         ;;
+       ia64*)
+         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+         ;;
+       *)
+         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+         ;;
+       esac
+       # Commands to make compiler produce verbose output that lists
+       # what "hidden" libraries, object files and flags are used when
+       # linking a shared library.
+       #
+       # There doesn't appear to be a way to prevent this compiler from
+       # explicitly linking system object files so we need to strip them
+       # from the output so that they don't get included in the library
+       # dependencies.
+       output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+       ;;
+      *)
+       if test "$GXX" = yes; then
+         if test $with_gnu_ld = no; then
+           case $host_cpu in
+           hppa*64*)
+             _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+             ;;
+           ia64*)
+             _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+             ;;
+           *)
+             _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+             ;;
+           esac
+         fi
+       else
+         # FIXME: insert proper C++ library support
+         _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       fi
+       ;;
+    esac
+    ;;
+  interix3*)
+    _LT_AC_TAGVAR(hardcode_direct, $1)=no
+    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+    # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+    # Instead, shared libraries are loaded at an image base (0x10000000 by
+    # default) and relocated if they conflict, which is a slow very memory
+    # consuming and fragmenting process.  To avoid this, we pick a random,
+    # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+    # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+    ;;
+  irix5* | irix6*)
+    case $cc_basename in
+      CC*)
+       # SGI C++
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+
+       # Archives containing C++ object files must be created using
+       # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
+       # necessary to make sure instantiated templates are included
+       # in the archive.
+       _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+       ;;
+      *)
+       if test "$GXX" = yes; then
+         if test "$with_gnu_ld" = no; then
+           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+         else
+           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
+         fi
+       fi
+       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+       ;;
+    esac
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+    ;;
+  linux*)
+    case $cc_basename in
+      KCC*)
+       # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+       # KCC will only create a shared library if the output file
+       # ends with ".so" (or ".sl" for HP-UX), so rename the library
+       # to its proper name (with version) after linking.
+       _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+       # Commands to make compiler produce verbose output that lists
+       # what "hidden" libraries, object files and flags are used when
+       # linking a shared library.
+       #
+       # There doesn't appear to be a way to prevent this compiler from
+       # explicitly linking system object files so we need to strip them
+       # from the output so that they don't get included in the library
+       # dependencies.
+       output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
+       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+       # Archives containing C++ object files must be created using
+       # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+       _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+       ;;
+      icpc*)
+       # Intel C++
+       with_gnu_ld=yes
+       # version 8.0 and above of icpc choke on multiply defined symbols
+       # if we add $predep_objects and $postdep_objects, however 7.1 and
+       # earlier do not add the objects themselves.
+       case `$CC -V 2>&1` in
+       *"Version 7."*)
+         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+         ;;
+       *)  # Version 8.0 or newer
+         tmp_idyn=
+         case $host_cpu in
+           ia64*) tmp_idyn=' -i_dynamic';;
+         esac
+         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+         ;;
+       esac
+       _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+       ;;
+      pgCC*)
+        # Portland Group C++ compiler
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+        ;;
+      cxx*)
+       # Compaq C++
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+       runpath_var=LD_RUN_PATH
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+       # Commands to make compiler produce verbose output that lists
+       # what "hidden" libraries, object files and flags are used when
+       # linking a shared library.
+       #
+       # There doesn't appear to be a way to prevent this compiler from
+       # explicitly linking system object files so we need to strip them
+       # from the output so that they don't get included in the library
+       # dependencies.
+       output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+       ;;
+    esac
+    ;;
+  lynxos*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  m88k*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  mvs*)
+    case $cc_basename in
+      cxx*)
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+      *)
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+    esac
+    ;;
+  netbsd*)
+    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+      wlarc=
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+    fi
+    # Workaround some broken pre-1.5 toolchains
+    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+    ;;
+  openbsd2*)
+    # C++ shared libraries are fairly broken
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  openbsd*)
+    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    fi
+    output_verbose_link_cmd='echo'
+    ;;
+  osf3*)
+    case $cc_basename in
+      KCC*)
+       # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+       # KCC will only create a shared library if the output file
+       # ends with ".so" (or ".sl" for HP-UX), so rename the library
+       # to its proper name (with version) after linking.
+       _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+       # Archives containing C++ object files must be created using
+       # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+       _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+
+       ;;
+      RCC*)
+       # Rational C++ 2.4.1
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+      cxx*)
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+       # Commands to make compiler produce verbose output that lists
+       # what "hidden" libraries, object files and flags are used when
+       # linking a shared library.
+       #
+       # There doesn't appear to be a way to prevent this compiler from
+       # explicitly linking system object files so we need to strip them
+       # from the output so that they don't get included in the library
+       # dependencies.
+       output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+       ;;
+      *)
+       if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+
+         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+         # Commands to make compiler produce verbose output that lists
+         # what "hidden" libraries, object files and flags are used when
+         # linking a shared library.
+         output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+       else
+         # FIXME: insert proper C++ library support
+         _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       fi
+       ;;
+    esac
+    ;;
+  osf4* | osf5*)
+    case $cc_basename in
+      KCC*)
+       # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+       # KCC will only create a shared library if the output file
+       # ends with ".so" (or ".sl" for HP-UX), so rename the library
+       # to its proper name (with version) after linking.
+       _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+       # Archives containing C++ object files must be created using
+       # the KAI C++ compiler.
+       _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
+       ;;
+      RCC*)
+       # Rational C++ 2.4.1
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+      cxx*)
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+         echo "-hidden">> $lib.exp~
+         $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~
+         $rm $lib.exp'
+
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+       # Commands to make compiler produce verbose output that lists
+       # what "hidden" libraries, object files and flags are used when
+       # linking a shared library.
+       #
+       # There doesn't appear to be a way to prevent this compiler from
+       # explicitly linking system object files so we need to strip them
+       # from the output so that they don't get included in the library
+       # dependencies.
+       output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+       ;;
+      *)
+       if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+
+         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+         # Commands to make compiler produce verbose output that lists
+         # what "hidden" libraries, object files and flags are used when
+         # linking a shared library.
+         output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+       else
+         # FIXME: insert proper C++ library support
+         _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       fi
+       ;;
+    esac
+    ;;
+  psos*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  sunos4*)
+    case $cc_basename in
+      CC*)
+       # Sun C++ 4.x
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+      lcc*)
+       # Lucid
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+      *)
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+    esac
+    ;;
+  solaris*)
+    case $cc_basename in
+      CC*)
+       # Sun C++ 4.2, 5.x and Centerline C++
+        _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes
+       _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+       $CC -G${allow_undefined_flag}  ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+       case $host_os in
+         solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+         *)
+           # The C++ compiler is used as linker so we must use $wl
+           # flag to pass the commands to the underlying system
+           # linker. We must also pass each convience library through
+           # to the system linker between allextract/defaultextract.
+           # The C++ compiler will combine linker options so we
+           # cannot just pass the convience library names through
+           # without $wl.
+           # Supported since Solaris 2.6 (maybe 2.5.1?)
+           _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
+           ;;
+       esac
+       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+       output_verbose_link_cmd='echo'
+
+       # Archives containing C++ object files must be created using
+       # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+       # necessary to make sure instantiated templates are included
+       # in the archive.
+       _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+       ;;
+      gcx*)
+       # Green Hills C++ Compiler
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+       # The C++ compiler must be used to create the archive.
+       _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+       ;;
+      *)
+       # GNU C++ compiler with Solaris linker
+       if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+         _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+         if $CC --version | grep -v '^2\.7' > /dev/null; then
+           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+           _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+               $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+           # Commands to make compiler produce verbose output that lists
+           # what "hidden" libraries, object files and flags are used when
+           # linking a shared library.
+           output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+         else
+           # g++ 2.7 appears to require `-G' NOT `-shared' on this
+           # platform.
+           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+           _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+               $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+           # Commands to make compiler produce verbose output that lists
+           # what "hidden" libraries, object files and flags are used when
+           # linking a shared library.
+           output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+         fi
+
+         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+       fi
+       ;;
+    esac
+    ;;
+  sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+    runpath_var='LD_RUN_PATH'
+
+    case $cc_basename in
+      CC*)
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       ;;
+      *)
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       ;;
+    esac
+    ;;
+  sysv5* | sco3.2v5* | sco5v6*)
+    # Note: We can NOT use -z defs as we might desire, because we do not
+    # link with -lc, and that would cause any symbols used from libc to
+    # always be unresolved, which means just about no library would
+    # ever link correctly.  If we're not using GNU ld we use -z text
+    # though, which does catch some bad symbols but isn't as heavy-handed
+    # as -z defs.
+    # For security reasons, it is highly recommended that you always
+    # use absolute paths for naming shared libraries, and exclude the
+    # DT_RUNPATH tag from executables and libraries.  But doing so
+    # requires that you compile everything twice, which is a pain.
+    # So that behaviour is only enabled if SCOABSPATH is set to a
+    # non-empty value in the environment.  Most likely only useful for
+    # creating official distributions of packages.
+    # This is a hack until libtool officially supports absolute path
+    # names for shared libraries.
+    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+    _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+    runpath_var='LD_RUN_PATH'
+
+    case $cc_basename in
+      CC*)
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+       ;;
+      *)
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+       ;;
+    esac
+    ;;
+  tandem*)
+    case $cc_basename in
+      NCC*)
+       # NonStop-UX NCC 3.20
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+      *)
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+    esac
+    ;;
+  vxworks*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  *)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+esac
+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_AC_TAGVAR(GCC, $1)="$GXX"
+_LT_AC_TAGVAR(LD, $1)="$LD"
+
+AC_LIBTOOL_POSTDEP_PREDEP($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC=$lt_save_CC
+LDCXX=$LD
+LD=$lt_save_LD
+GCC=$lt_save_GCC
+with_gnu_ldcxx=$with_gnu_ld
+with_gnu_ld=$lt_save_with_gnu_ld
+lt_cv_path_LDCXX=$lt_cv_path_LD
+lt_cv_path_LD=$lt_save_path_LD
+lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+])# AC_LIBTOOL_LANG_CXX_CONFIG
+
+# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
+# ------------------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library.  It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
+int a;
+void foo (void) { a = 0; }
+EOF
+],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+EOF
+],[$1],[F77],[cat > conftest.$ac_ext <<EOF
+      subroutine foo
+      implicit none
+      integer*4 a
+      a=0
+      return
+      end
+EOF
+],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
+public class foo {
+  private int a;
+  public void bar (void) {
+    a = 0;
+  }
+};
+EOF
+])
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+  # Parse the compiler output and extract the necessary
+  # objects, libraries and library flags.
+
+  # Sentinel used to keep track of whether or not we are before
+  # the conftest object file.
+  pre_test_object_deps_done=no
+
+  # The `*' in the case matches for architectures that use `case' in
+  # $output_verbose_cmd can trigger glob expansion during the loop
+  # eval without this substitution.
+  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
+
+  for p in `eval $output_verbose_link_cmd`; do
+    case $p in
+
+    -L* | -R* | -l*)
+       # Some compilers place space between "-{L,R}" and the path.
+       # Remove the space.
+       if test $p = "-L" \
+         || test $p = "-R"; then
+        prev=$p
+        continue
+       else
+        prev=
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+        case $p in
+        -L* | -R*)
+          # Internal compiler library paths should come after those
+          # provided the user.  The postdeps already come after the
+          # user supplied libs so there is no need to process them.
+          if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
+            _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+          else
+            _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+          fi
+          ;;
+        # The "-l" case would never come before the object being
+        # linked, so don't bother handling this case.
+        esac
+       else
+        if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
+          _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
+        else
+          _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
+        fi
+       fi
+       ;;
+
+    *.$objext)
+       # This assumes that the test object file only shows up
+       # once in the compiler output.
+       if test "$p" = "conftest.$objext"; then
+        pre_test_object_deps_done=yes
+        continue
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+        if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
+          _LT_AC_TAGVAR(predep_objects, $1)="$p"
+        else
+          _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
+        fi
+       else
+        if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
+          _LT_AC_TAGVAR(postdep_objects, $1)="$p"
+        else
+          _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
+        fi
+       fi
+       ;;
+
+    *) ;; # Ignore the rest.
+
+    esac
+  done
+
+  # Clean up.
+  rm -f a.out a.exe
+else
+  echo "libtool.m4: error: problem compiling $1 test program"
+fi
+
+$rm -f confest.$objext
+
+# PORTME: override above test on systems where it is broken
+ifelse([$1],[CXX],
+[case $host_os in
+interix3*)
+  # Interix 3.5 installs completely hosed .la files for C++, so rather than
+  # hack all around it, let's just trust "g++" to DTRT.
+  _LT_AC_TAGVAR(predep_objects,$1)=
+  _LT_AC_TAGVAR(postdep_objects,$1)=
+  _LT_AC_TAGVAR(postdeps,$1)=
+  ;;
+
+solaris*)
+  case $cc_basename in
+  CC*)
+    # Adding this requires a known-good setup of shared libraries for
+    # Sun compiler versions before 5.6, else PIC objects from an old
+    # archive will be linked into the output, leading to subtle bugs.
+    _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun'
+    ;;
+  esac
+  ;;
+esac
+])
+
+case " $_LT_AC_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+])# AC_LIBTOOL_POSTDEP_PREDEP
+
+# AC_LIBTOOL_LANG_F77_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
+AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
+[AC_REQUIRE([AC_PROG_F77])
+AC_LANG_PUSH(Fortran 77)
+
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_AC_TAGVAR(allow_undefined_flag, $1)=
+_LT_AC_TAGVAR(always_export_symbols, $1)=no
+_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_direct, $1)=no
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(hardcode_automatic, $1)=no
+_LT_AC_TAGVAR(module_cmds, $1)=
+_LT_AC_TAGVAR(module_expsym_cmds, $1)=
+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_AC_TAGVAR(no_undefined_flag, $1)=
+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="      program t\n      end\n"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${F77-"f77"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+
+AC_MSG_CHECKING([if libtool supports shared libraries])
+AC_MSG_RESULT([$can_build_shared])
+
+AC_MSG_CHECKING([whether to build shared libraries])
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case $host_os in
+aix3*)
+  test "$enable_shared" = yes && enable_static=no
+  if test -n "$RANLIB"; then
+    archive_cmds="$archive_cmds~\$RANLIB \$lib"
+    postinstall_cmds='$RANLIB $lib'
+  fi
+  ;;
+aix4* | aix5*)
+  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+    test "$enable_shared" = yes && enable_static=no
+  fi
+  ;;
+esac
+AC_MSG_RESULT([$enable_shared])
+
+AC_MSG_CHECKING([whether to build static libraries])
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+AC_MSG_RESULT([$enable_static])
+
+_LT_AC_TAGVAR(GCC, $1)="$G77"
+_LT_AC_TAGVAR(LD, $1)="$LD"
+
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_F77_CONFIG
+
+
+# AC_LIBTOOL_LANG_GCJ_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
+AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
+[AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${GCJ-"gcj"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+
+AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_GCJ_CONFIG
+
+
+# AC_LIBTOOL_LANG_RC_CONFIG
+# -------------------------
+# Ensure that the configuration vars for the Windows resource compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
+AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
+[AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${RC-"windres"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_RC_CONFIG
+
+
+# AC_LIBTOOL_CONFIG([TAGNAME])
+# ----------------------------
+# If TAGNAME is not passed, then create an initial libtool script
+# with a default configuration from the untagged config vars.  Otherwise
+# add code to config.status for appending the configuration named by
+# TAGNAME from the matching tagged config vars.
+AC_DEFUN([AC_LIBTOOL_CONFIG],
+[# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # See if we are running on zsh, and set the options which allow our commands through
+  # without removal of \ escapes.
+  if test -n "${ZSH_VERSION+set}" ; then
+    setopt NO_GLOB_SUBST
+  fi
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    _LT_AC_TAGVAR(compiler, $1) \
+    _LT_AC_TAGVAR(CC, $1) \
+    _LT_AC_TAGVAR(LD, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
+    _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
+    _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
+    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
+    _LT_AC_TAGVAR(old_archive_cmds, $1) \
+    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
+    _LT_AC_TAGVAR(predep_objects, $1) \
+    _LT_AC_TAGVAR(postdep_objects, $1) \
+    _LT_AC_TAGVAR(predeps, $1) \
+    _LT_AC_TAGVAR(postdeps, $1) \
+    _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
+    _LT_AC_TAGVAR(archive_cmds, $1) \
+    _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
+    _LT_AC_TAGVAR(postinstall_cmds, $1) \
+    _LT_AC_TAGVAR(postuninstall_cmds, $1) \
+    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
+    _LT_AC_TAGVAR(allow_undefined_flag, $1) \
+    _LT_AC_TAGVAR(no_undefined_flag, $1) \
+    _LT_AC_TAGVAR(export_symbols_cmds, $1) \
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
+    _LT_AC_TAGVAR(hardcode_automatic, $1) \
+    _LT_AC_TAGVAR(module_cmds, $1) \
+    _LT_AC_TAGVAR(module_expsym_cmds, $1) \
+    _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
+    _LT_AC_TAGVAR(exclude_expsyms, $1) \
+    _LT_AC_TAGVAR(include_expsyms, $1); do
+
+    case $var in
+    _LT_AC_TAGVAR(old_archive_cmds, $1) | \
+    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
+    _LT_AC_TAGVAR(archive_cmds, $1) | \
+    _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
+    _LT_AC_TAGVAR(module_cmds, $1) | \
+    _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
+    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
+    _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\[$]0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
+    ;;
+  esac
+
+ifelse([$1], [],
+  [cfgfile="${ofile}T"
+  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
+  $rm -f "$cfgfile"
+  AC_MSG_NOTICE([creating $ofile])],
+  [cfgfile="$ofile"])
+
+  cat <<__EOF__ >> "$cfgfile"
+ifelse([$1], [],
+[#! $SHELL
+
+# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+#
+# This file is part of GNU Libtool:
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="$SED -e 1s/^X//"
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# The names of the tagged configurations supported by this script.
+available_tags=
+
+# ### BEGIN LIBTOOL CONFIG],
+[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
+# A language-specific compiler.
+CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
+
+# Is the compiler the GNU C compiler?
+with_gcc=$_LT_AC_TAGVAR(GCC, $1)
+
+gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\`
+gcc_ver=\`gcc -dumpversion\`
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
+archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
+module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=\`echo $lt_[]_LT_AC_TAGVAR(predep_objects, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=\`echo $lt_[]_LT_AC_TAGVAR(postdep_objects, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=\`echo $lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
+
+# Symbols that must always be exported.
+include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
+
+ifelse([$1],[],
+[# ### END LIBTOOL CONFIG],
+[# ### END LIBTOOL TAG CONFIG: $tagname])
+
+__EOF__
+
+ifelse([$1],[], [
+  case $host_os in
+  aix3*)
+    cat <<\EOF >> "$cfgfile"
+
+# AIX sometimes has problems with the GCC collect2 program.  For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+  COLLECT_NAMES=
+  export COLLECT_NAMES
+fi
+EOF
+    ;;
+  esac
+
+  # We use sed instead of cat because bash on DJGPP gets confused if
+  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+  # text mode, it properly converts lines to CR/LF.  This bash problem
+  # is reportedly fixed, but why not run on old versions too?
+  sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
+
+  mv -f "$cfgfile" "$ofile" || \
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+])
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+])# AC_LIBTOOL_CONFIG
+
+
+# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------------------
+AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
+[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+
+_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+
+  AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+    lt_cv_prog_compiler_rtti_exceptions,
+    [-fno-rtti -fno-exceptions], [],
+    [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
+
+
+# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+# ---------------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
+[AC_REQUIRE([AC_CANONICAL_HOST])
+AC_REQUIRE([AC_PROG_NM])
+AC_REQUIRE([AC_OBJEXT])
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
+[
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[[BCDEGRST]]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+# Transform an extracted symbol line into a proper C declaration
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[[BCDT]]'
+  ;;
+cygwin* | mingw* | pw32*)
+  symcode='[[ABCDGISTW]]'
+  ;;
+hpux*) # Its linker distinguishes data from code symbols
+  if test "$host_cpu" = ia64; then
+    symcode='[[ABCDEGRST]]'
+  fi
+  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+  ;;
+linux*)
+  if test "$host_cpu" = ia64; then
+    symcode='[[ABCDGIRSTW]]'
+    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+    lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+  fi
+  ;;
+irix* | nonstopux*)
+  symcode='[[BCDEGRST]]'
+  ;;
+osf*)
+  symcode='[[BCDEGQRST]]'
+  ;;
+solaris*)
+  symcode='[[BDRT]]'
+  ;;
+sco3.2v5*)
+  symcode='[[DT]]'
+  ;;
+sysv4.2uw2*)
+  symcode='[[DT]]'
+  ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+  symcode='[[ABDT]]'
+  ;;
+sysv4)
+  symcode='[[DFNSTU]]'
+  ;;
+esac
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+  ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
+
+  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+  symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+  # Write the raw and C identifiers.
+  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[     ]]\($symcode$symcode*\)[[       ]][[    ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -f conftest*
+  cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+EOF
+
+  if AC_TRY_EVAL(ac_compile); then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
+      # Try sorting and uniquifying the output.
+      if sort "$nlist" | uniq > "$nlist"T; then
+       mv -f "$nlist"T "$nlist"
+      else
+       rm -f "$nlist"T
+      fi
+
+      # Make sure that we snagged all the symbols we need.
+      if grep ' nm_test_var$' "$nlist" >/dev/null; then
+       if grep ' nm_test_func$' "$nlist" >/dev/null; then
+         cat <<EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+         # Now generate the symbol file.
+         eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
+
+         cat <<EOF >> conftest.$ac_ext
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+  const char *name;
+  lt_ptr_t address;
+}
+lt_preloaded_symbols[[]] =
+{
+EOF
+         $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
+         cat <<\EOF >> conftest.$ac_ext
+  {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+EOF
+         # Now try linking the two files.
+         mv conftest.$ac_objext conftstm.$ac_objext
+         lt_save_LIBS="$LIBS"
+         lt_save_CFLAGS="$CFLAGS"
+         LIBS="conftstm.$ac_objext"
+         CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+         if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+           pipe_works=yes
+         fi
+         LIBS="$lt_save_LIBS"
+         CFLAGS="$lt_save_CFLAGS"
+       else
+         echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+       fi
+      else
+       echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
+      fi
+    else
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+    fi
+  else
+    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+    cat conftest.$ac_ext >&5
+  fi
+  rm -f conftest* conftst*
+
+  # Do not use the global_symbol_pipe unless it works.
+  if test "$pipe_works" = yes; then
+    break
+  else
+    lt_cv_sys_global_symbol_pipe=
+  fi
+done
+])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+  lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+  AC_MSG_RESULT(failed)
+else
+  AC_MSG_RESULT(ok)
+fi
+]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+
+
+# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
+# ---------------------------------------
+AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
+[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
+
+AC_MSG_CHECKING([for $compiler option to produce PIC])
+ ifelse([$1],[CXX],[
+  # C++ specific cases for pic, static, wl, etc.
+  if test "$GXX" = yes; then
+    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+    case $host_os in
+    aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+    amigaos*)
+      # FIXME: we need at least 68020 code to build shared libraries, but
+      # adding the `-m68020' flag to GCC prevents building anything better,
+      # like `-m68040'.
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+      ;;
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | os2* | pw32*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+      ;;
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+      ;;
+    interix3*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+    hpux*)
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+       ;;
+      *)
+       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+       ;;
+      esac
+      ;;
+    *)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+    esac
+  else
+    case $host_os in
+      aix4* | aix5*)
+       # All AIX code is PIC.
+       if test "$host_cpu" = ia64; then
+         # AIX 5 now supports IA64 processor
+         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+       else
+         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+       fi
+       ;;
+      chorus*)
+       case $cc_basename in
+       cxch68*)
+         # Green Hills C++ Compiler
+         # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+         ;;
+       esac
+       ;;
+       darwin*)
+         # PIC is the default on this platform
+         # Common symbols not allowed in MH_DYLIB files
+         case $cc_basename in
+           xlc*)
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
+           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           ;;
+         esac
+       ;;
+      dgux*)
+       case $cc_basename in
+         ec++*)
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+           ;;
+         ghcx*)
+           # Green Hills C++ Compiler
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      freebsd* | kfreebsd*-gnu | dragonfly*)
+       # FreeBSD uses GNU C++
+       ;;
+      hpux9* | hpux10* | hpux11*)
+       case $cc_basename in
+         CC*)
+           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+           if test "$host_cpu" != ia64; then
+             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+           fi
+           ;;
+         aCC*)
+           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+           case $host_cpu in
+           hppa*64*|ia64*)
+             # +Z the default
+             ;;
+           *)
+             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+             ;;
+           esac
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      interix*)
+       # This is c89, which is MS Visual C++ (no shared libs)
+       # Anyone wants to do a port?
+       ;;
+      irix5* | irix6* | nonstopux*)
+       case $cc_basename in
+         CC*)
+           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+           # CC pic flag -KPIC is the default.
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      linux*)
+       case $cc_basename in
+         KCC*)
+           # KAI C++ Compiler
+           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+           ;;
+         icpc* | ecpc*)
+           # Intel C++
+           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+           ;;
+         pgCC*)
+           # Portland Group C++ compiler.
+           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+           ;;
+         cxx*)
+           # Compaq C++
+           # Make sure the PIC flag is empty.  It appears that all Alpha
+           # Linux and Compaq Tru64 Unix objects are PIC.
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      lynxos*)
+       ;;
+      m88k*)
+       ;;
+      mvs*)
+       case $cc_basename in
+         cxx*)
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      netbsd*)
+       ;;
+      osf3* | osf4* | osf5*)
+       case $cc_basename in
+         KCC*)
+           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+           ;;
+         RCC*)
+           # Rational C++ 2.4.1
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+           ;;
+         cxx*)
+           # Digital/Compaq C++
+           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           # Make sure the PIC flag is empty.  It appears that all Alpha
+           # Linux and Compaq Tru64 Unix objects are PIC.
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      psos*)
+       ;;
+      solaris*)
+       case $cc_basename in
+         CC*)
+           # Sun C++ 4.2, 5.x and Centerline C++
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+           ;;
+         gcx*)
+           # Green Hills C++ Compiler
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      sunos4*)
+       case $cc_basename in
+         CC*)
+           # Sun C++ 4.x
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+           ;;
+         lcc*)
+           # Lucid
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      tandem*)
+       case $cc_basename in
+         NCC*)
+           # NonStop-UX NCC 3.20
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+       case $cc_basename in
+         CC*)
+           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+           ;;
+       esac
+       ;;
+      vxworks*)
+       ;;
+      *)
+       _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+       ;;
+    esac
+  fi
+],
+[
+  if test "$GCC" = yes; then
+    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      # FIXME: we need at least 68020 code to build shared libraries, but
+      # adding the `-m68020' flag to GCC prevents building anything better,
+      # like `-m68040'.
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+      ;;
+
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+
+    interix3*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      enable_shared=no
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+
+    hpux*)
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+       # +Z the default
+       ;;
+      *)
+       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+       ;;
+      esac
+      ;;
+
+    *)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      else
+       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+      darwin*)
+        # PIC is the default on this platform
+        # Common symbols not allowed in MH_DYLIB files
+       case $cc_basename in
+         xlc*)
+         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
+         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+         ;;
+       esac
+       ;;
+
+    mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+       # +Z the default
+       ;;
+      *)
+       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+       ;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # PIC (with -KPIC) is the default.
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    newsos6)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    linux*)
+      case $cc_basename in
+      icc* | ecc*)
+       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+        ;;
+      pgcc* | pgf77* | pgf90* | pgf95*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+       # which looks to be a dead project)
+       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+        ;;
+      ccc*)
+        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+        # All Alpha code is PIC.
+        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+        ;;
+      esac
+      ;;
+
+    osf3* | osf4* | osf5*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # All OSF/1 code is PIC.
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    solaris*)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+      *)
+       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    unicos*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+
+    uts4*)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    *)
+      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+    esac
+  fi
+])
+AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
+  AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
+    _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
+    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
+    [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
+     "" | " "*) ;;
+     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+     esac],
+    [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+    ;;
+  *)
+    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
+    ;;
+esac
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\"
+AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
+  _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
+  $lt_tmp_static_flag,
+  [],
+  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
+])
+
+
+# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
+# ------------------------------------
+# See if the linker supports building shared libraries.
+AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
+[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+ifelse([$1],[CXX],[
+  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  case $host_os in
+  aix4* | aix5*)
+    # If we're using GNU nm, then we don't want the "-C" option.
+    # -C means demangle to AIX nm, but means don't demangle with GNU nm
+    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+    else
+      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+    fi
+    ;;
+  pw32*)
+    _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+  ;;
+  cygwin* | mingw*)
+    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  *)
+    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  esac
+],[
+  runpath_var=
+  _LT_AC_TAGVAR(allow_undefined_flag, $1)=
+  _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+  _LT_AC_TAGVAR(archive_cmds, $1)=
+  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+  _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
+  _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+  _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
+  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+  _LT_AC_TAGVAR(hardcode_direct, $1)=no
+  _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+  _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+  _LT_AC_TAGVAR(hardcode_automatic, $1)=no
+  _LT_AC_TAGVAR(module_cmds, $1)=
+  _LT_AC_TAGVAR(module_expsym_cmds, $1)=
+  _LT_AC_TAGVAR(always_export_symbols, $1)=no
+  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  _LT_AC_TAGVAR(include_expsyms, $1)=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  extract_expsyms_cmds=
+  # Just being paranoid about ensuring that cc_basename is set.
+  _LT_CC_BASENAME([$compiler])
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+  if test "$with_gnu_ld" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>/dev/null` in
+      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       cat <<EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+      fi
+      ;;
+
+    amigaos*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+
+      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+       # support --undefined.  This deserves some investigation.  FIXME
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+      # as there is no search path for DLLs.
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_AC_TAGVAR(always_export_symbols, $1)=no
+      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+       # If the export-symbols file already is a .def file (1st line
+       # is EXPORTS), use it as is; otherwise, prepend...
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+         cp $export_symbols $output_objdir/$soname.def;
+       else
+         echo EXPORTS > $output_objdir/$soname.def;
+         cat $export_symbols >> $output_objdir/$soname.def;
+       fi~
+       $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      else
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    interix3*)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
+
+    linux*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       tmp_addflag=
+       case $cc_basename,$host_cpu in
+       pgcc*)                          # Portland Group C compiler
+         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag'
+         ;;
+       pgf77* | pgf90* | pgf95*)       # Portland Group f77 and f90 compilers
+         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag -Mnomain' ;;
+       ecc*,ia64* | icc*,ia64*)                # Intel C compiler on ia64
+         tmp_addflag=' -i_dynamic' ;;
+       efc*,ia64* | ifort*,ia64*)      # Intel Fortran compiler on ia64
+         tmp_addflag=' -i_dynamic -nofor_main' ;;
+       ifc* | ifort*)                  # Intel Fortran compiler
+         tmp_addflag=' -nofor_main' ;;
+       esac
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+       if test $supports_anon_versioning = yes; then
+         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
+  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+  $echo "local: *; };" >> $output_objdir/$libname.ver~
+         $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+       fi
+      else
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+       wlarc=
+      else
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) 
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+       ;;
+       *)
+         if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
+           _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
+         else
+           _LT_AC_TAGVAR(ld_shlibs, $1)=no
+         fi
+       ;;
+      esac
+      ;;
+
+    sunos4*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+    esac
+
+    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then
+      runpath_var=
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+       # Neither direct hardcoding nor static linking is supported with a
+       # broken collect2.
+       _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+      fi
+      ;;
+
+    aix4* | aix5*)
+      if test "$host_cpu" = ia64; then
+       # On IA64, the linker does run time linking by default, so we don't
+       # have to do anything special.
+       aix_use_runtimelinking=no
+       exp_sym_flag='-Bexport'
+       no_entry_flag=""
+      else
+       # If we're using GNU nm, then we don't want the "-C" option.
+       # -C means demangle to AIX nm, but means don't demangle with GNU nm
+       if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+         _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+       else
+         _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+       fi
+       aix_use_runtimelinking=no
+
+       # Test if we are trying to use run time linking or normal
+       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+       # need to do runtime linking.
+       case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
+         for ld_flag in $LDFLAGS; do
+         if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+           aix_use_runtimelinking=yes
+           break
+         fi
+         done
+         ;;
+       esac
+
+       exp_sym_flag='-bexport'
+       no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      _LT_AC_TAGVAR(archive_cmds, $1)=''
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+      if test "$GCC" = yes; then
+       case $host_os in aix4.[[012]]|aix4.[[012]].*)
+       # We only want to do this on AIX 4.2 and lower, the check
+       # below for broken collect2 doesn't work under 4.3+
+         collect2name=`${CC} -print-prog-name=collect2`
+         if test -f "$collect2name" && \
+          strings "$collect2name" | grep resolve_lib_name >/dev/null
+         then
+         # We have reworked collect2
+         _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+         else
+         # We have old collect2
+         _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+         # It fails to find uninstalled libraries when the uninstalled
+         # path is not listed in the libpath.  Setting hardcode_minus_L
+         # to unsupported forces relinking
+         _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+         fi
+         ;;
+       esac
+       shared_flag='-shared'
+       if test "$aix_use_runtimelinking" = yes; then
+         shared_flag="$shared_flag "'${wl}-G'
+       fi
+      else
+       # not using gcc
+       if test "$host_cpu" = ia64; then
+       # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+       # chokes on -Wl,-G. The following line is correct:
+         shared_flag='-G'
+       else
+         if test "$aix_use_runtimelinking" = yes; then
+           shared_flag='${wl}-G'
+         else
+           shared_flag='${wl}-bM:SRE'
+         fi
+       fi
+      fi
+
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+      if test "$aix_use_runtimelinking" = yes; then
+       # Warning - without using the other runtime loading flags (-brtl),
+       # -berok will link without error, but may produce a broken library.
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+       _LT_AC_SYS_LIBPATH_AIX
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+       if test "$host_cpu" = ia64; then
+         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+         _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+         _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+       else
+        # Determine the default libpath from the value encoded in an empty executable.
+        _LT_AC_SYS_LIBPATH_AIX
+        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+         # Warning - without using the other run time loading flags,
+         # -berok will link without error, but may produce a broken library.
+         _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+         # Exported symbols can be pulled into shared objects from archives
+         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+         _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+         # This is similar to how AIX traditionally builds its shared libraries.
+         _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+       fi
+      fi
+      ;;
+
+    amigaos*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      # see comment about different semantics on the GNU ld section
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+
+    bsdi[[45]]*)
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      # Tell ltmain to make .lib files, not .a files.
+      libext=lib
+      # Tell ltmain to make .dll files, not .so files.
+      shrext_cmds=".dll"
+      # FIXME: Setting linknames here is a bad hack.
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
+      # FIXME: Should let the user specify the lib program.
+      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
+      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      ;;
+
+    darwin* | rhapsody*)
+      case $host_os in
+        rhapsody* | darwin1.[[012]])
+         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[[012]])
+               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+      esac
+      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+    if test "$GCC" = yes ; then
+       output_verbose_link_cmd='echo'
+        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+         _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         _LT_AC_TAGVAR(ld_shlibs, $1)=no
+          ;;
+      esac
+    fi
+      ;;
+
+    dgux*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    freebsd1*)
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu | dragonfly*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+       _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      ;;
+
+    hpux10*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test "$with_gnu_ld" = no; then
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+       # hardcode_minus_L: Not really in the search PATH,
+       # but as the default location of the library.
+       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+       case $host_cpu in
+       hppa*64*)
+         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       ia64*)
+         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       esac
+      else
+       case $host_cpu in
+       hppa*64*)
+         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       ia64*)
+         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       esac
+      fi
+      if test "$with_gnu_ld" = no; then
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+       case $host_cpu in
+       hppa*64*|ia64*)
+         _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+         _LT_AC_TAGVAR(hardcode_direct, $1)=no
+         _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+         ;;
+       *)
+         _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+         _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+         # hardcode_minus_L: Not really in the search PATH,
+         # but as the default location of the library.
+         _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+         ;;
+       esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    newsos6)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    openbsd*)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      else
+       case $host_os in
+        openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+          _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+          ;;
+        *)
+          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+          ;;
+       esac
+      fi
+      ;;
+
+    os2*)
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    osf4* | osf5*)     # as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      else
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+       $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+
+       # Both c and cxx compiler support -rpath directly
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    solaris*)
+      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
+      if test "$GCC" = yes; then
+       wlarc='${wl}'
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+         $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+      else
+       wlarc=''
+       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+       $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      case $host_os in
+      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+      *)
+       # The compiler driver will combine linker options so we
+       # cannot just pass the convience library names through
+       # without $wl, iff we do not link with $LD.
+       # Luckily, gcc supports the same syntax we need for Sun Studio.
+       # Supported since Solaris 2.6 (maybe 2.5.1?)
+       case $wlarc in
+       '')
+         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
+       *)
+         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+       esac ;;
+      esac
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+       # Use $CC to link under sequent, because it throws in some extra .o
+       # files that make .init and .fini sections work.
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+       sni)
+         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+       ;;
+       siemens)
+         ## LD is ld it makes a PLAMLIB
+         ## CC just makes a GrossModule.
+         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+         _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+         _LT_AC_TAGVAR(hardcode_direct, $1)=no
+        ;;
+       motorola)
+         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+       ;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4.3*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+       runpath_var=LD_RUN_PATH
+       hardcode_runpath_var=yes
+       _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+      fi
+      ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*)
+      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We can NOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    uts4*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+    esac
+  fi
+])
+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+  # Assume -lc should be added
+  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $_LT_AC_TAGVAR(archive_cmds, $1) in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
+       pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
+        _LT_AC_TAGVAR(allow_undefined_flag, $1)=
+        if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
+        then
+         _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+        else
+         _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+        fi
+        _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
+      ;;
+    esac
+  fi
+  ;;
+esac
+])# AC_LIBTOOL_PROG_LD_SHLIBS
+
+
+# _LT_AC_FILE_LTDLL_C
+# -------------------
+# Be careful that the start marker always follows a newline.
+AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
+# /* ltdll.c starts here */
+# #define WIN32_LEAN_AND_MEAN
+# #include <windows.h>
+# #undef WIN32_LEAN_AND_MEAN
+# #include <stdio.h>
+#
+# #ifndef __CYGWIN__
+# #  ifdef __CYGWIN32__
+# #    define __CYGWIN__ __CYGWIN32__
+# #  endif
+# #endif
+#
+# #ifdef __cplusplus
+# extern "C" {
+# #endif
+# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
+# #ifdef __cplusplus
+# }
+# #endif
+#
+# #ifdef __CYGWIN__
+# #include <cygwin/cygwin_dll.h>
+# DECLARE_CYGWIN_DLL( DllMain );
+# #endif
+# HINSTANCE __hDllInstance_base;
+#
+# BOOL APIENTRY
+# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
+# {
+#   __hDllInstance_base = hInst;
+#   return TRUE;
+# }
+# /* ltdll.c ends here */
+])# _LT_AC_FILE_LTDLL_C
+
+
+# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
+# ---------------------------------
+AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
+
+
+# old names
+AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
+AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
+AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
+AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
+AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
+
+# This is just to silence aclocal about the macro not being used
+ifelse([AC_DISABLE_FAST_INSTALL])
+
+AC_DEFUN([LT_AC_PROG_GCJ],
+[AC_CHECK_TOOL(GCJ, gcj, no)
+  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+  AC_SUBST(GCJFLAGS)
+])
+
+AC_DEFUN([LT_AC_PROG_RC],
+[AC_CHECK_TOOL(RC, windres, no)
+])
+
+# NOTE: This macro has been submitted for inclusion into   #
+#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
+#  a released version of Autoconf we should remove this    #
+#  macro and use it instead.                               #
+# LT_AC_PROG_SED
+# --------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible.  Prefer GNU sed if found.
+AC_DEFUN([LT_AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for lt_ac_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+      fi
+    done
+  done
+done
+IFS=$as_save_IFS
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+  test ! -f $lt_ac_sed && continue
+  cat /dev/null > conftest.in
+  lt_ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+  # Check for GNU sed and select it if it is found.
+  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+    lt_cv_path_SED=$lt_ac_sed
+    break
+  fi
+  while true; do
+    cat conftest.in conftest.in >conftest.tmp
+    mv conftest.tmp conftest.in
+    cp conftest.in conftest.nl
+    echo >>conftest.nl
+    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+    cmp -s conftest.out conftest.nl || break
+    # 10000 chars as input seems more than enough
+    test $lt_ac_count -gt 10 && break
+    lt_ac_count=`expr $lt_ac_count + 1`
+    if test $lt_ac_count -gt $lt_ac_max; then
+      lt_ac_max=$lt_ac_count
+      lt_cv_path_SED=$lt_ac_sed
+    fi
+  done
+done
+])
+SED=$lt_cv_path_SED
+AC_SUBST([SED])
+AC_MSG_RESULT([$SED])
+])
+
+# Copyright (C) 2002, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION so it can be traced.
+# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+        [AM_AUTOMAKE_VERSION([1.9.6])])
+
+# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory.  The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run.  This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+#    fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+#    fails if $ac_aux_dir is absolute,
+#    fails when called from a subdirectory in a VPATH build with
+#          a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir.  In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
+#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+#   MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH.  The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL                                            -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 7
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
+       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])
+AC_SUBST([$1_FALSE])
+if $2; then
+  $1_TRUE=
+  $1_FALSE='#'
+else
+  $1_TRUE='#'
+  $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+  AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 8
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery.  Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
+       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
+       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
+                   [depcc="$$1"   am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+               [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_$1_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+       continue
+      else
+       break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_$1_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])
+])
+
+# Generate code to set up dependency tracking.              -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 3
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[for mf in $CONFIG_FILES; do
+  # Strip MF so we end up with the name of the file.
+  mf=`echo "$mf" | sed -e 's/:.*$//'`
+  # Check whether this is an Automake generated Makefile or not.
+  # We used to match only the files named `Makefile.in', but
+  # some people rename them; so instead we look at the file content.
+  # Grep'ing the first line is not enough: some people post-process
+  # each Makefile.in and add a new line on top of each file to say so.
+  # So let's grep whole file.
+  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+    dirpart=`AS_DIRNAME("$mf")`
+  else
+    continue
+  fi
+  # Extract the definition of DEPDIR, am__include, and am__quote
+  # from the Makefile without running `make'.
+  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+  test -z "$DEPDIR" && continue
+  am__include=`sed -n 's/^am__include = //p' < "$mf"`
+  test -z "am__include" && continue
+  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+  # When using ansi2knr, U may be empty or an underscore; expand it
+  U=`sed -n 's/^U = //p' < "$mf"`
+  # Find all dependency output files, they are included files with
+  # $(DEPDIR) in their names.  We invoke sed twice because it is the
+  # simplest approach to changing $(DEPDIR) to its actual value in the
+  # expansion.
+  for file in `sed -n "
+    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+    # Make sure the directory exists.
+    test -f "$dirpart/$file" && continue
+    fdir=`AS_DIRNAME(["$file"])`
+    AS_MKDIR_P([$dirpart/$fdir])
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled.  FIXME.  This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Do all the work for Automake.                             -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 12
+
+# This macro actually does too much.  Some checks are only needed if
+# your package does certain things.  But this isn't really a big deal.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out.  PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition.  After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.58])dnl
+dnl Autoconf wants to disallow AM_ names.  We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+# test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+   test -f $srcdir/config.status; then
+  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_PROG_INSTALL_SH
+AM_PROG_INSTALL_STRIP
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+                            [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+                  [_AM_DEPENDENCIES(CC)],
+                  [define([AC_PROG_CC],
+                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+                  [_AM_DEPENDENCIES(CXX)],
+                  [define([AC_PROG_CXX],
+                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+])
+])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated.  The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $1 | $1:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+AC_SUBST(install_sh)])
+
+# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot.  For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Check to see how 'make' treats includes.                 -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+       @echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+   am__include=include
+   am__quote=
+   _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+      am__include=.include
+      am__quote="\""
+      _am_result=BSD
+   fi
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+
+# Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
+#
+# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
+# created by `make install' are always world readable, even if the
+# installer happens to have an overly restrictive umask (e.g. 077).
+# This was a mistake.  There are at least two reasons why we must not
+# use `-m 0755':
+#   - it causes special bits like SGID to be ignored,
+#   - it may be too restrictive (some setups expect 775 directories).
+#
+# Do not use -m 0755 and let people choose whatever they expect by
+# setting umask.
+#
+# We cannot accept any implementation of `mkdir' that recognizes `-p'.
+# Some implementations (such as Solaris 8's) are not thread-safe: if a
+# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
+# concurrently, both version can detect that a/ is missing, but only
+# one can create it and the other will error out.  Consequently we
+# restrict ourselves to GNU make (using the --version option ensures
+# this.)
+AC_DEFUN([AM_PROG_MKDIR_P],
+[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+  # We used to keeping the `.' as first argument, in order to
+  # allow $(mkdir_p) to be used without argument.  As in
+  #   $(mkdir_p) $(somedir)
+  # where $(somedir) is conditionally defined.  However this is wrong
+  # for two reasons:
+  #  1. if the package is installed by a user who cannot write `.'
+  #     make install will fail,
+  #  2. the above comment should most certainly read
+  #     $(mkdir_p) $(DESTDIR)$(somedir)
+  #     so it does not work when $(somedir) is undefined and
+  #     $(DESTDIR) is not.
+  #  To support the latter case, we have to write
+  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
+  #  so the `.' trick is pointless.
+  mkdir_p='mkdir -p --'
+else
+  # On NextStep and OpenStep, the `mkdir' command does not
+  # recognize any option.  It will interpret all options as
+  # directories to create, and then abort because `.' already
+  # exists.
+  for d in ./-p ./--version;
+  do
+    test -d $d && rmdir $d
+  done
+  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
+  if test -f "$ac_aux_dir/mkinstalldirs"; then
+    mkdir_p='$(mkinstalldirs)'
+  else
+    mkdir_p='$(install_sh) -d'
+  fi
+fi
+AC_SUBST([mkdir_p])])
+
+# Helper functions for option handling.                     -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# ------------------------------
+# Set option NAME.  Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Check to make sure that the build environment is sane.    -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   if test "$[*]" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$[*]" != "X $srcdir/configure conftest.file" \
+      && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
+alias in your environment])
+   fi
+
+   test "$[2]" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries.  This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+  AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Check how to create a tarball.                            -*- Autoconf -*-
+
+# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of `v7', `ustar', or `pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+#     tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+#     $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+     [m4_case([$1], [ustar],, [pax],,
+              [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+  case $_am_tool in
+  gnutar)
+    for _am_tar in tar gnutar gtar;
+    do
+      AM_RUN_LOG([$_am_tar --version]) && break
+    done
+    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+    am__untar="$_am_tar -xf -"
+    ;;
+  plaintar)
+    # Must skip GNU tar: if it does not support --format= it doesn't create
+    # ustar tarball either.
+    (tar --version) >/dev/null 2>&1 && continue
+    am__tar='tar chf - "$$tardir"'
+    am__tar_='tar chf - "$tardir"'
+    am__untar='tar xf -'
+    ;;
+  pax)
+    am__tar='pax -L -x $1 -w "$$tardir"'
+    am__tar_='pax -L -x $1 -w "$tardir"'
+    am__untar='pax -r'
+    ;;
+  cpio)
+    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+    am__untar='cpio -i -H $1 -d'
+    ;;
+  none)
+    am__tar=false
+    am__tar_=false
+    am__untar=false
+    ;;
+  esac
+
+  # If the value was cached, stop now.  We just wanted to have am__tar
+  # and am__untar set.
+  test -n "${am_cv_prog_tar_$1}" && break
+
+  # tar/untar a dummy directory, and stop if the command works
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  echo GrepMe > conftest.dir/file
+  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+  rm -rf conftest.dir
+  if test -s conftest.tar; then
+    AM_RUN_LOG([$am__untar <conftest.tar])
+    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+  fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
diff --git a/configure b/configure
new file mode 100755 (executable)
index 0000000..87e9b02
--- /dev/null
+++ b/configure
@@ -0,0 +1,23856 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.59 for jasper 1.900.1.
+#
+# Copyright (C) 2003 Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)$' \| \
+        .     : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+         /^X\/\(\/\/\)$/{ s//\1/; q; }
+         /^X\/\(\/\).*/{ s//\1/; q; }
+         s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
+  # Find who we are.  Look in the path if we contain no path at all
+  # relative or not.
+  case $0 in
+    *[\\/]* ) as_myself=$0 ;;
+    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+       ;;
+  esac
+  # We did not find ourselves, most probably we were run as `sh COMMAND'
+  # in which case we are not to be found in the path.
+  if test "x$as_myself" = x; then
+    as_myself=$0
+  fi
+  if test ! -f "$as_myself"; then
+    { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+   { (exit 1); exit 1; }; }
+  fi
+  case $CONFIG_SHELL in
+  '')
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for as_base in sh bash ksh sh5; do
+        case $as_dir in
+        /*)
+          if ("$as_dir/$as_base" -c '
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
+            $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+            $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+            CONFIG_SHELL=$as_dir/$as_base
+            export CONFIG_SHELL
+            exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+          fi;;
+        esac
+       done
+done
+;;
+  esac
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line before each line; the second 'sed' does the real
+  # work.  The second script uses 'N' to pair each line-number line
+  # with the numbered line, and appends trailing '-' during
+  # substitution so that $LINENO is not a special case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
+  sed '=' <$as_myself |
+    sed '
+      N
+      s,$,-,
+      : loop
+      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      t loop
+      s,-$,,
+      s,^['$as_cr_digits']*\n,,
+    ' >$as_me.lineno &&
+  chmod +x $as_me.lineno ||
+    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensible to this).
+  . ./$as_me.lineno
+  # Exit status is that of the last command.
+  exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+  *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T='     ' ;;
+  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more generic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conf$$.exe; then
+    # Don't use ln at all; we don't have any links
+    as_ln_s='cp -p'
+  else
+    as_ln_s='ln -s'
+  fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS="  $as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$ECHO in
+X*--fallback-echo)
+  # Remove one level of quotation (which was required for Make).
+  ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
+  ;;
+esac
+
+echo=${ECHO-echo}
+if test "X$1" = X--no-reexec; then
+  # Discard the --no-reexec flag, and continue.
+  shift
+elif test "X$1" = X--fallback-echo; then
+  # Avoid inline document here, it may be left over
+  :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
+  # Yippee, $echo works!
+  :
+else
+  # Restart under the correct shell.
+  exec $SHELL "$0" --no-reexec ${1+"$@"}
+fi
+
+if test "X$1" = X--fallback-echo; then
+  # used as fallback echo
+  shift
+  cat <<EOF
+$*
+EOF
+  exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test -z "$ECHO"; then
+if test "X${echo_test_string+set}" != Xset; then
+# find a string as large as possible, as long as the shell can cope with it
+  for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
+    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+    if (echo_test_string=`eval $cmd`) 2>/dev/null &&
+       echo_test_string=`eval $cmd` &&
+       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
+    then
+      break
+    fi
+  done
+fi
+
+if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+   test "X$echo_testing_string" = "X$echo_test_string"; then
+  :
+else
+  # The Solaris, AIX, and Digital Unix default echo programs unquote
+  # backslashes.  This makes it impossible to quote backslashes using
+  #   echo "$something" | sed 's/\\/\\\\/g'
+  #
+  # So, first we look for a working echo in the user's PATH.
+
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for dir in $PATH /usr/ucb; do
+    IFS="$lt_save_ifs"
+    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+       test "X$echo_testing_string" = "X$echo_test_string"; then
+      echo="$dir/echo"
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+
+  if test "X$echo" = Xecho; then
+    # We didn't find a better echo, so look for alternatives.
+    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
+       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
+       test "X$echo_testing_string" = "X$echo_test_string"; then
+      # This shell has a builtin print -r that does the trick.
+      echo='print -r'
+    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
+        test "X$CONFIG_SHELL" != X/bin/ksh; then
+      # If we have ksh, try running configure again with it.
+      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+      export ORIGINAL_CONFIG_SHELL
+      CONFIG_SHELL=/bin/ksh
+      export CONFIG_SHELL
+      exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
+    else
+      # Try using printf.
+      echo='printf %s\n'
+      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+        echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+        test "X$echo_testing_string" = "X$echo_test_string"; then
+       # Cool, printf works
+       :
+      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
+          test "X$echo_testing_string" = 'X\t' &&
+          echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+          test "X$echo_testing_string" = "X$echo_test_string"; then
+       CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+       export CONFIG_SHELL
+       SHELL="$CONFIG_SHELL"
+       export SHELL
+       echo="$CONFIG_SHELL $0 --fallback-echo"
+      elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
+          test "X$echo_testing_string" = 'X\t' &&
+          echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+          test "X$echo_testing_string" = "X$echo_test_string"; then
+       echo="$CONFIG_SHELL $0 --fallback-echo"
+      else
+       # maybe with a smaller string...
+       prev=:
+
+       for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
+         if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
+         then
+           break
+         fi
+         prev="$cmd"
+       done
+
+       if test "$prev" != 'sed 50q "$0"'; then
+         echo_test_string=`eval $prev`
+         export echo_test_string
+         exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
+       else
+         # Oops.  We lost completely, so just stick with echo.
+         echo=echo
+       fi
+      fi
+    fi
+  fi
+fi
+fi
+
+# Copy echo and quote the copy suitably for passing to libtool from
+# the Makefile, instead of quoting the original, which is used later.
+ECHO=$echo
+if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
+   ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
+fi
+
+
+
+
+tagnames=${tagnames+${tagnames},}CXX
+
+tagnames=${tagnames+${tagnames},}F77
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+exec 6>&1
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_config_libobj_dir=.
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Maximum number of lines to put in a shell here document.
+# This variable seems obsolete.  It should probably be removed, and
+# only ac_max_sed_lines should be used.
+: ${ac_max_here_lines=38}
+
+# Identity of this package.
+PACKAGE_NAME='jasper'
+PACKAGE_TARNAME='jasper'
+PACKAGE_VERSION='1.900.1'
+PACKAGE_STRING='jasper 1.900.1'
+PACKAGE_BUGREPORT=''
+
+ac_unique_file="README"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#else
+# if HAVE_STDINT_H
+#  include <stdint.h>
+# endif
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar JAS_MAJOR_VERSION JAS_MINOR_VERSION JAS_MICRO_VERSION JAS_VERSION JAS_RPM_RELEASE LT_RELEASE LT_CURRENT LT_REVISION LT_AGE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE RANLIB ac_ct_RANLIB SED EGREP LN_S ECHO AR ac_ct_AR CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS HAVE_LIBJPEG_TRUE HAVE_LIBJPEG_FALSE HAVE_OPENGL_TRUE HAVE_OPENGL_FALSE OPENGL_LIBS LIBOBJS LTLIBOBJS'
+ac_subst_files=''
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+ac_prev=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval "$ac_prev=\$ac_option"
+    ac_prev=
+    continue
+  fi
+
+  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_option in
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias=$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+  | --da=*)
+    datadir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    eval "enable_$ac_feature=no" ;;
+
+  -enable-* | --enable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "enable_$ac_feature='$ac_optarg'" ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst \
+  | --locals | --local | --loca | --loc | --lo)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix=$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix=$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name=$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site=$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias=$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "with_$ac_package='$ac_optarg'" ;;
+
+  -without-* | --without-*)
+    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package | sed 's/-/_/g'`
+    eval "with_$ac_package=no" ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes=$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries=$ac_optarg ;;
+
+  -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; }
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+   { (exit 1); exit 1; }; }
+    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+    eval "$ac_envvar='$ac_optarg'"
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  { echo "$as_me: error: missing argument to $ac_option" >&2
+   { (exit 1); exit 1; }; }
+fi
+
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
+do
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+             localstatedir libdir includedir oldincludedir infodir mandir
+do
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* ) ;;
+    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used." >&2
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then its parent.
+  ac_confdir=`(dirname "$0") 2>/dev/null ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$0" : 'X\(//\)[^/]' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| \
+        .     : '\(.\)' 2>/dev/null ||
+echo X"$0" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+         /^X\(\/\/\)$/{ s//\1/; q; }
+         /^X\(\/\).*/{ s//\1/; q; }
+         s/.*/./; q'`
+  srcdir=$ac_confdir
+  if test ! -r $srcdir/$ac_unique_file; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+  if test "$ac_srcdir_defaulted" = yes; then
+    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+   { (exit 1); exit 1; }; }
+  else
+    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+  fi
+fi
+(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
+  { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+   { (exit 1); exit 1; }; }
+srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+ac_env_build_alias_set=${build_alias+set}
+ac_env_build_alias_value=$build_alias
+ac_cv_env_build_alias_set=${build_alias+set}
+ac_cv_env_build_alias_value=$build_alias
+ac_env_host_alias_set=${host_alias+set}
+ac_env_host_alias_value=$host_alias
+ac_cv_env_host_alias_set=${host_alias+set}
+ac_cv_env_host_alias_value=$host_alias
+ac_env_target_alias_set=${target_alias+set}
+ac_env_target_alias_value=$target_alias
+ac_cv_env_target_alias_set=${target_alias+set}
+ac_cv_env_target_alias_value=$target_alias
+ac_env_CC_set=${CC+set}
+ac_env_CC_value=$CC
+ac_cv_env_CC_set=${CC+set}
+ac_cv_env_CC_value=$CC
+ac_env_CFLAGS_set=${CFLAGS+set}
+ac_env_CFLAGS_value=$CFLAGS
+ac_cv_env_CFLAGS_set=${CFLAGS+set}
+ac_cv_env_CFLAGS_value=$CFLAGS
+ac_env_LDFLAGS_set=${LDFLAGS+set}
+ac_env_LDFLAGS_value=$LDFLAGS
+ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
+ac_cv_env_LDFLAGS_value=$LDFLAGS
+ac_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_env_CPPFLAGS_value=$CPPFLAGS
+ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_cv_env_CPPFLAGS_value=$CPPFLAGS
+ac_env_CPP_set=${CPP+set}
+ac_env_CPP_value=$CPP
+ac_cv_env_CPP_set=${CPP+set}
+ac_cv_env_CPP_value=$CPP
+ac_env_CXX_set=${CXX+set}
+ac_env_CXX_value=$CXX
+ac_cv_env_CXX_set=${CXX+set}
+ac_cv_env_CXX_value=$CXX
+ac_env_CXXFLAGS_set=${CXXFLAGS+set}
+ac_env_CXXFLAGS_value=$CXXFLAGS
+ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set}
+ac_cv_env_CXXFLAGS_value=$CXXFLAGS
+ac_env_CXXCPP_set=${CXXCPP+set}
+ac_env_CXXCPP_value=$CXXCPP
+ac_cv_env_CXXCPP_set=${CXXCPP+set}
+ac_cv_env_CXXCPP_value=$CXXCPP
+ac_env_F77_set=${F77+set}
+ac_env_F77_value=$F77
+ac_cv_env_F77_set=${F77+set}
+ac_cv_env_F77_value=$F77
+ac_env_FFLAGS_set=${FFLAGS+set}
+ac_env_FFLAGS_value=$FFLAGS
+ac_cv_env_FFLAGS_set=${FFLAGS+set}
+ac_cv_env_FFLAGS_value=$FFLAGS
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+  # Omit some internal or obsolete options to make the list less imposing.
+  # This message is too long to be a string in the A/UX 3.1 sh.
+  cat <<_ACEOF
+\`configure' configures jasper 1.900.1 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+_ACEOF
+
+  cat <<_ACEOF
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                         [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                         [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR           user executables [EPREFIX/bin]
+  --sbindir=DIR          system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR       program executables [EPREFIX/libexec]
+  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
+  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
+  --libdir=DIR           object code libraries [EPREFIX/lib]
+  --includedir=DIR       C header files [PREFIX/include]
+  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
+  --infodir=DIR          info documentation [PREFIX/info]
+  --mandir=DIR           man documentation [PREFIX/man]
+_ACEOF
+
+  cat <<\_ACEOF
+
+Program names:
+  --program-prefix=PREFIX            prepend PREFIX to installed program names
+  --program-suffix=SUFFIX            append SUFFIX to installed program names
+  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
+
+X features:
+  --x-includes=DIR    X include files are in DIR
+  --x-libraries=DIR   X library files are in DIR
+
+System types:
+  --build=BUILD     configure for building on BUILD [guessed]
+  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
+  --target=TARGET   configure for building compilers for TARGET [HOST]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+  case $ac_init_help in
+     short | recursive ) echo "Configuration of jasper 1.900.1:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors
+  --enable-shared[=PKGS]
+                          build shared libraries [default=no]
+  --enable-static[=PKGS]
+                          build static libraries [default=yes]
+  --enable-fast-install[=PKGS]
+                          optimize for fast installation [default=yes]
+  --disable-libtool-lock  avoid locking (might break parallel builds)
+  --disable-libjpeg    Force the IJG JPEG library to be ignored
+  --disable-opengl    Disable use of OpenGL.
+  --enable-dmalloc    use special memory allocator for debugging
+  --enable-debug    add extra code for debugging
+  --enable-special0    enable something
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
+  --with-pic              try to use only PIC/non-PIC objects [default=use
+                          both]
+  --with-tags[=TAGS]
+                          include additional configurations [automatic]
+  --with-x                use the X Window System
+  --with-glut-include-dir=DIR    Set GLUT include directory.
+  --with-glut-lib-dir=DIR        Set GLUT library directory.
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
+              headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+  CXX         C++ compiler command
+  CXXFLAGS    C++ compiler flags
+  CXXCPP      C++ preprocessor
+  F77         Fortran 77 compiler command
+  FFLAGS      Fortran 77 compiler flags
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+_ACEOF
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  ac_popdir=`pwd`
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d $ac_dir || continue
+    ac_builddir=.
+
+if test "$ac_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+  .)  # No --srcdir option.  We are building in place.
+    ac_srcdir=.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
+
+    cd $ac_dir
+    # Check for guested configure; otherwise get Cygnus style configure.
+    if test -f $ac_srcdir/configure.gnu; then
+      echo
+      $SHELL $ac_srcdir/configure.gnu  --help=recursive
+    elif test -f $ac_srcdir/configure; then
+      echo
+      $SHELL $ac_srcdir/configure  --help=recursive
+    elif test -f $ac_srcdir/configure.ac ||
+          test -f $ac_srcdir/configure.in; then
+      echo
+      $ac_configure --help
+    else
+      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi
+    cd $ac_popdir
+  done
+fi
+
+test -n "$ac_init_help" && exit 0
+if $ac_init_version; then
+  cat <<\_ACEOF
+jasper configure 1.900.1
+generated by GNU Autoconf 2.59
+
+Copyright (C) 2003 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit 0
+fi
+exec 5>config.log
+cat >&5 <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by jasper $as_me 1.900.1, which was
+generated by GNU Autoconf 2.59.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  echo "PATH: $as_dir"
+done
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_sep=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *" "*|*"   "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    2)
+      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+       ac_must_keep_next=false # Got value, back to normal.
+      else
+       case $ac_arg in
+         *=* | --config-cache | -C | -disable-* | --disable-* \
+         | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+         | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+         | -with-* | --with-* | -without-* | --without-* | --x)
+           case "$ac_configure_args0 " in
+             "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+           esac
+           ;;
+         -* ) ac_must_keep_next=true ;;
+       esac
+      fi
+      ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+      # Get rid of the leading space.
+      ac_sep=" "
+      ;;
+    esac
+  done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Be sure not to use single quotes in there, as some shells,
+# such as our DU 5.0 friend, will then `close' the trap.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+{
+  (set) 2>&1 |
+    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+    *ac_space=\ *)
+      sed -n \
+       "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+      ;;
+    *)
+      sed -n \
+       "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      ;;
+    esac;
+}
+    echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=$`echo $ac_var`
+      echo "$ac_var='"'"'$ac_val'"'"'"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------- ##
+## Output files. ##
+## ------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+       eval ac_val=$`echo $ac_var`
+       echo "$ac_var='"'"'$ac_val'"'"'"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      sed "/^$/d" confdefs.h | sort
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      echo "$as_me: caught signal $ac_signal"
+    echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core &&
+  rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+     ' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo >confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+  if test "x$prefix" != xNONE; then
+    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+  else
+    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+  fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+  if test -r "$ac_site_file"; then
+    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special
+  # files actually), so we avoid doing that.
+  if test -f "$cache_file"; then
+    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . $cache_file;;
+      *)                      . ./$cache_file;;
+    esac
+  fi
+else
+  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in `(set) 2>&1 |
+              sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+  eval ac_new_val="\$ac_env_${ac_var}_value"
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+       { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+       { echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
+echo "$as_me:   former value:  $ac_old_val" >&2;}
+       { echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
+echo "$as_me:   current value: $ac_new_val" >&2;}
+       ac_cache_corrupted=:
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *" "*|*"   "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+      ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ac_aux_dir=
+for ac_dir in acaux $srcdir/acaux; do
+  if test -f $ac_dir/install-sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f $ac_dir/install.sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f $ac_dir/shtool; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in acaux $srcdir/acaux" >&5
+echo "$as_me: error: cannot find install-sh or install.sh in acaux $srcdir/acaux" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"
+ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
+
+
+# Detect the canonical host and target build environment.
+# Note: This precedes automake initialization to avoid warnings.
+# Make sure we can run config.sub.
+$ac_config_sub sun4 >/dev/null 2>&1 ||
+  { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
+echo "$as_me: error: cannot run $ac_config_sub" >&2;}
+   { (exit 1); exit 1; }; }
+
+echo "$as_me:$LINENO: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6
+if test "${ac_cv_build+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_build_alias=$build_alias
+test -z "$ac_cv_build_alias" &&
+  ac_cv_build_alias=`$ac_config_guess`
+test -z "$ac_cv_build_alias" &&
+  { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+   { (exit 1); exit 1; }; }
+ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
+  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6
+build=$ac_cv_build
+build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+echo "$as_me:$LINENO: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6
+if test "${ac_cv_host+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_host_alias=$host_alias
+test -z "$ac_cv_host_alias" &&
+  ac_cv_host_alias=$ac_cv_build_alias
+ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
+  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6
+host=$ac_cv_host
+host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+echo "$as_me:$LINENO: checking target system type" >&5
+echo $ECHO_N "checking target system type... $ECHO_C" >&6
+if test "${ac_cv_target+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_target_alias=$target_alias
+test "x$ac_cv_target_alias" = "x" &&
+  ac_cv_target_alias=$ac_cv_host_alias
+ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
+  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_target" >&5
+echo "${ECHO_T}$ac_cv_target" >&6
+target=$ac_cv_target
+target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+test -n "$target_alias" &&
+  test "$program_prefix$program_suffix$program_transform_name" = \
+    NONENONEs,x,x, &&
+  program_prefix=${target_alias}-
+
+# Initialize automake.
+am__api_version="1.9"
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+  ./ | .// | /cC/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+       if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+         if test $ac_prog = install &&
+           grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+           # AIX install.  It has an incompatible calling convention.
+           :
+         elif test $ac_prog = install &&
+           grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+           # program-specific install script used by HP pwplus--don't use.
+           :
+         else
+           ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+           break 3
+         fi
+       fi
+      done
+    done
+    ;;
+esac
+done
+
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  We don't cache a
+    # path for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the path is relative.
+    INSTALL=$ac_install_sh
+  fi
+fi
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   if test "$*" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$*" != "X $srcdir/configure conftest.file" \
+      && test "$*" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      { { echo "$as_me:$LINENO: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&5
+echo "$as_me: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&2;}
+   { (exit 1); exit 1; }; }
+   fi
+
+   test "$2" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+test "$program_prefix" != NONE &&
+  program_transform_name="s,^,$program_prefix,;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+  program_transform_name="s,\$,$program_suffix,;$program_transform_name"
+# Double any \ or $.  echo might interpret backslashes.
+# By default was `s,x,x', remove it if useless.
+cat <<\_ACEOF >conftest.sed
+s/[\\$]/&&/g;s/;s,x,x,$//
+_ACEOF
+program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
+rm conftest.sed
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+  # We used to keeping the `.' as first argument, in order to
+  # allow $(mkdir_p) to be used without argument.  As in
+  #   $(mkdir_p) $(somedir)
+  # where $(somedir) is conditionally defined.  However this is wrong
+  # for two reasons:
+  #  1. if the package is installed by a user who cannot write `.'
+  #     make install will fail,
+  #  2. the above comment should most certainly read
+  #     $(mkdir_p) $(DESTDIR)$(somedir)
+  #     so it does not work when $(somedir) is undefined and
+  #     $(DESTDIR) is not.
+  #  To support the latter case, we have to write
+  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
+  #  so the `.' trick is pointless.
+  mkdir_p='mkdir -p --'
+else
+  # On NextStep and OpenStep, the `mkdir' command does not
+  # recognize any option.  It will interpret all options as
+  # directories to create, and then abort because `.' already
+  # exists.
+  for d in ./-p ./--version;
+  do
+    test -d $d && rmdir $d
+  done
+  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
+  if test -f "$ac_aux_dir/mkinstalldirs"; then
+    mkdir_p='$(mkinstalldirs)'
+  else
+    mkdir_p='$(install_sh) -d'
+  fi
+fi
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AWK+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AWK="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$AWK" && break
+done
+
+echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.make <<\_ACEOF
+all:
+       @echo 'ac_maketemp="$(MAKE)"'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+  eval ac_cv_prog_make_${ac_make}_set=yes
+else
+  eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftest.make
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+  SET_MAKE=
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+# test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+   test -f $srcdir/config.status; then
+  { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='jasper'
+ VERSION='1.900.1'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  STRIP=$ac_ct_STRIP
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
+
+
+
+
+# Initialize version information parameters.
+JAS_MAJOR_VERSION=1
+JAS_MINOR_VERSION=900
+JAS_MICRO_VERSION=1
+JAS_VERSION=1.900.1
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define JAS_VERSION "$JAS_VERSION"
+_ACEOF
+
+JAS_RPM_RELEASE=1
+
+
+# Initialize version information for libtool.
+LT_RELEASE=1.900
+LT_CURRENT=1
+LT_REVISION=0
+LT_AGE=0
+
+
+
+
+
+# Indicate a configure-based build is being used.
+cat >>confdefs.h <<\_ACEOF
+#define JAS_CONFIGURE 1
+_ACEOF
+
+
+############################################################
+# Configuration header file.
+############################################################
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+############################################################
+# Checks for programs.
+############################################################
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  CC=$ac_ct_CC
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  CC=$ac_ct_CC
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$ac_ct_CC" && break
+done
+
+  CC=$ac_ct_CC
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+     "checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+  (eval $ac_compiler --version </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+  (eval $ac_compiler -v </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+  (eval $ac_compiler -V </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
+  (eval $ac_link_default) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Find the output, starting from the most likely.  This scheme is
+# not robust to junk in `.', hence go to wildcards (a.*) only as a last
+# resort.
+
+# Be careful to initialize this variable, since it used to be cached.
+# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
+ac_cv_exeext=
+# b.out is created by i960 compilers.
+for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+       ;;
+    conftest.$ac_ext )
+       # This is the source file.
+       ;;
+    [ab].out )
+       # We found the default executable, but exeext='' is most
+       # certainly right.
+       break;;
+    *.* )
+       ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+       # FIXME: I believe we export ac_cv_exeext for Libtool,
+       # but it would be cool to find out if it's true.  Does anybody
+       # maintain Libtool? --akim.
+       export ac_cv_exeext
+       break;;
+    * )
+       break;;
+  esac
+done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6
+
+# Check the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+  if { ac_try='./$ac_file'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+       cross_compiling=yes
+    else
+       { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6
+
+echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+         export ac_cv_exeext
+         break;;
+    * ) break;;
+  esac
+done
+else
+  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+if test "${ac_cv_objext+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+CFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cc_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std1 is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std1.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX                  -qlanglvl=ansi
+# Ultrix and OSF/1     -std1
+# HP-UX 10.20 and later        -Ae
+# HP-UX older versions -Aa -D_HPUX_SOURCE
+# SVR4                 -Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+  x|xno)
+    echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+  *)
+    echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+    CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+
+# Some people use a C++ compiler to compile C.  Since we use `exit',
+# in C++ we need to declare it.  In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+#ifndef __cplusplus
+  choke me
+#endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  for ac_declaration in \
+   '' \
+   'extern "C" void std::exit (int) throw (); using std::exit;' \
+   'extern "C" void std::exit (int); using std::exit;' \
+   'extern "C" void exit (int) throw ();' \
+   'extern "C" void exit (int);' \
+   'void exit (int);'
+do
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_declaration
+#include <stdlib.h>
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+  echo '#ifdef __cplusplus' >>confdefs.h
+  echo $ac_declaration      >>confdefs.h
+  echo '#endif'             >>confdefs.h
+fi
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+DEPDIR="${am__leading_dot}deps"
+
+          ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+       @echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+   am__include=include
+   am__quote=
+   _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+      am__include=.include
+      am__quote="\""
+      _am_result=BSD
+   fi
+fi
+
+
+echo "$as_me:$LINENO: result: $_am_result" >&5
+echo "${ECHO_T}$_am_result" >&6
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then
+  enableval="$enable_dependency_tracking"
+
+fi;
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+
+
+if test "x$enable_dependency_tracking" != xno; then
+  AMDEP_TRUE=
+  AMDEP_FALSE='#'
+else
+  AMDEP_TRUE='#'
+  AMDEP_FALSE=
+fi
+
+
+
+
+depcc="$CC"   am_compiler_list=
+
+echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CC_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+       continue
+      else
+       break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CC_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+
+
+if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+  am__fastdepCC_TRUE=
+  am__fastdepCC_FALSE='#'
+else
+  am__fastdepCC_TRUE='#'
+  am__fastdepCC_FALSE=
+fi
+
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+  ./ | .// | /cC/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+       if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+         if test $ac_prog = install &&
+           grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+           # AIX install.  It has an incompatible calling convention.
+           :
+         elif test $ac_prog = install &&
+           grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+           # program-specific install script used by HP pwplus--don't use.
+           :
+         else
+           ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+           break 3
+         fi
+       fi
+      done
+    done
+    ;;
+esac
+done
+
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  We don't cache a
+    # path for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the path is relative.
+    INSTALL=$ac_install_sh
+  fi
+fi
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  RANLIB=$ac_ct_RANLIB
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+# AC_PROG_AWK
+# AC_PROG_CPP
+# AC_PROG_LN_S
+
+# Check whether --enable-shared or --disable-shared was given.
+if test "${enable_shared+set}" = set; then
+  enableval="$enable_shared"
+  p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_shared=yes ;;
+    no) enable_shared=no ;;
+    *)
+      enable_shared=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_shared=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
+else
+  enable_shared=no
+fi;
+
+
+# Check whether --enable-static or --disable-static was given.
+if test "${enable_static+set}" = set; then
+  enableval="$enable_static"
+  p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
+    *)
+     enable_static=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_static=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
+else
+  enable_static=yes
+fi;
+
+# Check whether --enable-fast-install or --disable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then
+  enableval="$enable_fast_install"
+  p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_fast_install=yes ;;
+    no) enable_fast_install=no ;;
+    *)
+      enable_fast_install=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_fast_install=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
+else
+  enable_fast_install=yes
+fi;
+
+echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
+echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6
+if test "${lt_cv_path_SED+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for lt_ac_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+      fi
+    done
+  done
+done
+IFS=$as_save_IFS
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+  test ! -f $lt_ac_sed && continue
+  cat /dev/null > conftest.in
+  lt_ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+  # Check for GNU sed and select it if it is found.
+  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+    lt_cv_path_SED=$lt_ac_sed
+    break
+  fi
+  while true; do
+    cat conftest.in conftest.in >conftest.tmp
+    mv conftest.tmp conftest.in
+    cp conftest.in conftest.nl
+    echo >>conftest.nl
+    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+    cmp -s conftest.out conftest.nl || break
+    # 10000 chars as input seems more than enough
+    test $lt_ac_count -gt 10 && break
+    lt_ac_count=`expr $lt_ac_count + 1`
+    if test $lt_ac_count -gt $lt_ac_max; then
+      lt_ac_max=$lt_ac_count
+      lt_cv_path_SED=$lt_ac_sed
+    fi
+  done
+done
+
+fi
+
+SED=$lt_cv_path_SED
+
+echo "$as_me:$LINENO: result: $SED" >&5
+echo "${ECHO_T}$SED" >&6
+
+echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6
+if test "${ac_cv_prog_egrep+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+    then ac_cv_prog_egrep='grep -E'
+    else ac_cv_prog_egrep='egrep'
+    fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
+echo "${ECHO_T}$ac_cv_prog_egrep" >&6
+ EGREP=$ac_cv_prog_egrep
+
+
+
+# Check whether --with-gnu-ld or --without-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+  withval="$with_gnu_ld"
+  test "$withval" = no || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi;
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [\\/]* | ?:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+       ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
+else
+  echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
+fi
+if test "${lt_cv_path_LD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -z "$LD"; then
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some variants of GNU ld only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+       test "$with_gnu_ld" != no && break
+       ;;
+      *)
+       test "$with_gnu_ld" != yes && break
+       ;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+   { (exit 1); exit 1; }; }
+echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
+echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6
+if test "${lt_cv_ld_reload_flag+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_ld_reload_flag='-r'
+fi
+echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
+echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  darwin*)
+    if test "$GCC" = yes; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
+
+echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
+echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6
+if test "${lt_cv_path_NM+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_nm_to_check="${ac_tool_prefix}nm"
+  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+    lt_nm_to_check="$lt_nm_to_check nm"
+  fi
+  for lt_tmp_nm in $lt_nm_to_check; do
+    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+      IFS="$lt_save_ifs"
+      test -z "$ac_dir" && ac_dir=.
+      tmp_nm="$ac_dir/$lt_tmp_nm"
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+       # Check to see if the nm accepts a BSD-compat flag.
+       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+       #   nm: unknown option "B" ignored
+       # Tru64's nm complains that /dev/null is an invalid object file
+       case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+       */dev/null* | *'Invalid file or object type'*)
+         lt_cv_path_NM="$tmp_nm -B"
+         break
+         ;;
+       *)
+         case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+         */dev/null*)
+           lt_cv_path_NM="$tmp_nm -p"
+           break
+           ;;
+         *)
+           lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+           continue # so that we can try to find one that supports BSD flags
+           ;;
+         esac
+         ;;
+       esac
+      fi
+    done
+    IFS="$lt_save_ifs"
+  done
+  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+fi
+fi
+echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
+echo "${ECHO_T}$lt_cv_path_NM" >&6
+NM="$lt_cv_path_NM"
+
+echo "$as_me:$LINENO: checking whether ln -s works" >&5
+echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+  echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+echo "${ECHO_T}no, using $LN_S" >&6
+fi
+
+echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5
+echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6
+if test "${lt_cv_deplibs_check_method+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix4* | aix5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi[45]*)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin*)
+  # func_win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='func_win32_libid'
+  ;;
+
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump'.
+  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | kfreebsd*-gnu | dragonfly*)
+  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+    case $host_cpu in
+    i*86 )
+      # Not sure whether the presence of OpenBSD here was a mistake.
+      # Let's accept both of them until this is cleared up.
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
+      lt_cv_file_magic_cmd=/usr/bin/file
+      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+      ;;
+    esac
+  else
+    lt_cv_deplibs_check_method=pass_all
+  fi
+  ;;
+
+gnu*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+hpux10.20* | hpux11*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  case $host_cpu in
+  ia64*)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
+    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+    ;;
+  hppa*64*)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'
+    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+    ;;
+  *)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
+    lt_cv_file_magic_test_file=/usr/lib/libc.sl
+    ;;
+  esac
+  ;;
+
+interix3*)
+  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+  lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $LD in
+  *-32|*"-32 ") libmagic=32-bit;;
+  *-n32|*"-n32 ") libmagic=N32;;
+  *-64|*"-64 ") libmagic=64-bit;;
+  *) libmagic=never-match;;
+  esac
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+# This must be Linux ELF.
+linux*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+netbsd*)
+  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
+  fi
+  ;;
+
+newos6*)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libnls.so
+  ;;
+
+nto-qnx*)
+  lt_cv_deplibs_check_method=unknown
+  ;;
+
+openbsd*)
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+  fi
+  ;;
+
+osf3* | osf4* | osf5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv4 | sysv4.3*)
+  case $host_vendor in
+  motorola)
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+    ;;
+  ncr)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  sequent)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
+    ;;
+  sni)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
+    lt_cv_file_magic_test_file=/lib/libc.so
+    ;;
+  siemens)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  pc)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  esac
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
+echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+  enableval="$enable_libtool_lock"
+
+fi;
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    case `/usr/bin/file conftest.$ac_objext` in
+    *ELF-32*)
+      HPUX_IA64_MODE="32"
+      ;;
+    *ELF-64*)
+      HPUX_IA64_MODE="64"
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+*-*-irix6*)
+  # Find out which ABI we are using.
+  echo '#line 3944 "configure"' > conftest.$ac_ext
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+   if test "$lt_cv_prog_gnu_ld" = yes; then
+    case `/usr/bin/file conftest.$ac_objext` in
+    *32-bit*)
+      LD="${LD-ld} -melf32bsmip"
+      ;;
+    *N32*)
+      LD="${LD-ld} -melf32bmipn32"
+      ;;
+    *64-bit*)
+      LD="${LD-ld} -melf64bmip"
+      ;;
+    esac
+   else
+    case `/usr/bin/file conftest.$ac_objext` in
+    *32-bit*)
+      LD="${LD-ld} -32"
+      ;;
+    *N32*)
+      LD="${LD-ld} -n32"
+      ;;
+    *64-bit*)
+      LD="${LD-ld} -64"
+      ;;
+    esac
+   fi
+  fi
+  rm -rf conftest*
+  ;;
+
+x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    case `/usr/bin/file conftest.o` in
+    *32-bit*)
+      case $host in
+        x86_64-*linux*)
+          LD="${LD-ld} -m elf_i386"
+          ;;
+        ppc64-*linux*|powerpc64-*linux*)
+          LD="${LD-ld} -m elf32ppclinux"
+          ;;
+        s390x-*linux*)
+          LD="${LD-ld} -m elf_s390"
+          ;;
+        sparc64-*linux*)
+          LD="${LD-ld} -m elf32_sparc"
+          ;;
+      esac
+      ;;
+    *64-bit*)
+      case $host in
+        x86_64-*linux*)
+          LD="${LD-ld} -m elf_x86_64"
+          ;;
+        ppc*-*linux*|powerpc*-*linux*)
+          LD="${LD-ld} -m elf64ppc"
+          ;;
+        s390*-*linux*)
+          LD="${LD-ld} -m elf64_s390"
+          ;;
+        sparc*-*linux*)
+          LD="${LD-ld} -m elf64_sparc"
+          ;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
+echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6
+if test "${lt_cv_cc_needs_belf+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+     cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  lt_cv_cc_needs_belf=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+lt_cv_cc_needs_belf=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+     ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
+echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
+  ;;
+sparc*-*solaris*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    case `/usr/bin/file conftest.o` in
+    *64-bit*)
+      case $lt_cv_prog_gnu_ld in
+      yes*) LD="${LD-ld} -m elf64_sparc" ;;
+      *)    LD="${LD-ld} -64" ;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
+
+esac
+
+need_locks="$enable_libtool_lock"
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_header_stdc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_stdc=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then
+  :
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+                  (('a' <= (c) && (c) <= 'i') \
+                    || ('j' <= (c) && (c) <= 'r') \
+                    || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+       || toupper (i) != TOUPPER (i))
+      exit(2);
+  exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+                 inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+for ac_header in dlfcn.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## --------------------------------- ##
+## Report this to the jasper lists.  ##
+## --------------------------------- ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CXX"; then
+  ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+  echo "$as_me:$LINENO: result: $CXX" >&5
+echo "${ECHO_T}$CXX" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+    test -n "$CXX" && break
+  done
+fi
+if test -z "$CXX"; then
+  ac_ct_CXX=$CXX
+  for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CXX"; then
+  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CXX="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
+echo "${ECHO_T}$ac_ct_CXX" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$ac_ct_CXX" && break
+done
+test -n "$ac_ct_CXX" || ac_ct_CXX="g++"
+
+  CXX=$ac_ct_CXX
+fi
+
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+     "checking for C++ compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+  (eval $ac_compiler --version </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+  (eval $ac_compiler -v </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+  (eval $ac_compiler -V </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6
+if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6
+GXX=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+CXXFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
+echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cxx_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cxx_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cxx_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6
+if test "$ac_test_CXXFLAGS" = set; then
+  CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+  if test "$GXX" = yes; then
+    CXXFLAGS="-g -O2"
+  else
+    CXXFLAGS="-g"
+  fi
+else
+  if test "$GXX" = yes; then
+    CXXFLAGS="-O2"
+  else
+    CXXFLAGS=
+  fi
+fi
+for ac_declaration in \
+   '' \
+   'extern "C" void std::exit (int) throw (); using std::exit;' \
+   'extern "C" void std::exit (int); using std::exit;' \
+   'extern "C" void exit (int) throw ();' \
+   'extern "C" void exit (int);' \
+   'void exit (int);'
+do
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_declaration
+#include <stdlib.h>
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+  echo '#ifdef __cplusplus' >>confdefs.h
+  echo $ac_declaration      >>confdefs.h
+  echo '#endif'             >>confdefs.h
+fi
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+depcc="$CXX"  am_compiler_list=
+
+echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
+if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CXX_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+       continue
+      else
+       break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CXX_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CXX_dependencies_compiler_type=none
+fi
+
+fi
+echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6
+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+
+
+
+if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+  am__fastdepCXX_TRUE=
+  am__fastdepCXX_FALSE='#'
+else
+  am__fastdepCXX_TRUE='#'
+  am__fastdepCXX_FALSE=
+fi
+
+
+
+
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+    (test "X$CXX" != "Xg++"))) ; then
+  ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
+echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6
+if test -z "$CXXCPP"; then
+  if test "${ac_cv_prog_CXXCPP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+      # Double quotes because CXXCPP needs to be expanded
+    for CXXCPP in "$CXX -E" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_cxx_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_cxx_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CXXCPP=$CXXCPP
+
+fi
+  CXXCPP=$ac_cv_prog_CXXCPP
+else
+  ac_cv_prog_CXXCPP=$CXXCPP
+fi
+echo "$as_me:$LINENO: result: $CXXCPP" >&5
+echo "${ECHO_T}$CXXCPP" >&6
+ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_cxx_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_cxx_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+fi
+
+
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$F77"; then
+  ac_cv_prog_F77="$F77" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+F77=$ac_cv_prog_F77
+if test -n "$F77"; then
+  echo "$as_me:$LINENO: result: $F77" >&5
+echo "${ECHO_T}$F77" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+    test -n "$F77" && break
+  done
+fi
+if test -z "$F77"; then
+  ac_ct_F77=$F77
+  for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_F77"; then
+  ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_F77="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_F77=$ac_cv_prog_ac_ct_F77
+if test -n "$ac_ct_F77"; then
+  echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
+echo "${ECHO_T}$ac_ct_F77" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$ac_ct_F77" && break
+done
+
+  F77=$ac_ct_F77
+fi
+
+
+# Provide some information about the compiler.
+echo "$as_me:5543:" \
+     "checking for Fortran 77 compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+  (eval $ac_compiler --version </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+  (eval $ac_compiler -v </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+  (eval $ac_compiler -V </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+rm -f a.out
+
+# If we don't use `.F' as extension, the preprocessor is not run on the
+# input file.  (Note that this only needs to work for GNU compilers.)
+ac_save_ext=$ac_ext
+ac_ext=F
+echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6
+if test "${ac_cv_f77_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+      program main
+#ifndef __GNUC__
+       choke me
+#endif
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_f77_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_f77_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6
+ac_ext=$ac_save_ext
+ac_test_FFLAGS=${FFLAGS+set}
+ac_save_FFLAGS=$FFLAGS
+FFLAGS=
+echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
+echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_f77_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  FFLAGS=-g
+cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_f77_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_f77_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_f77_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
+echo "${ECHO_T}$ac_cv_prog_f77_g" >&6
+if test "$ac_test_FFLAGS" = set; then
+  FFLAGS=$ac_save_FFLAGS
+elif test $ac_cv_prog_f77_g = yes; then
+  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+    FFLAGS="-g -O2"
+  else
+    FFLAGS="-g"
+  fi
+else
+  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+    FFLAGS="-O2"
+  else
+    FFLAGS=
+  fi
+fi
+
+G77=`test $ac_compiler_gnu = yes && echo yes`
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+
+# find the maximum length of command line arguments
+echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
+echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6
+if test "${lt_cv_sys_max_cmd_len+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+    i=0
+  teststring="ABCD"
+
+  case $build_os in
+  msdosdjgpp*)
+    # On DJGPP, this test can blow up pretty badly due to problems in libc
+    # (any single argument exceeding 2000 bytes causes a buffer overrun
+    # during glob expansion).  Even if it were fixed, the result of this
+    # check would be larger than it should be.
+    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
+    ;;
+
+  gnu*)
+    # Under GNU Hurd, this test is not required because there is
+    # no limit to the length of command line arguments.
+    # Libtool will interpret -1 as no limit whatsoever
+    lt_cv_sys_max_cmd_len=-1;
+    ;;
+
+  cygwin* | mingw*)
+    # On Win9x/ME, this test blows up -- it succeeds, but takes
+    # about 5 minutes as the teststring grows exponentially.
+    # Worse, since 9x/ME are not pre-emptively multitasking,
+    # you end up with a "frozen" computer, even though with patience
+    # the test eventually succeeds (with a max line length of 256k).
+    # Instead, let's just punt: use the minimum linelength reported by
+    # all of the supported platforms: 8192 (on NT/2K/XP).
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  amigaos*)
+    # On AmigaOS with pdksh, this test takes hours, literally.
+    # So we just punt and use a minimum line length of 8192.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+    # This has been around since 386BSD, at least.  Likely further.
+    if test -x /sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+    elif test -x /usr/sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+    else
+      lt_cv_sys_max_cmd_len=65536      # usable default for all BSDs
+    fi
+    # And add a safety zone
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    ;;
+
+  interix*)
+    # We know the value 262144 and hardcode it with a safety zone (like BSD)
+    lt_cv_sys_max_cmd_len=196608
+    ;;
+
+  osf*)
+    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+    # nice to cause kernel panics so lets avoid the loop below.
+    # First set a reasonable default.
+    lt_cv_sys_max_cmd_len=16384
+    #
+    if test -x /sbin/sysconfig; then
+      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+        *1*) lt_cv_sys_max_cmd_len=-1 ;;
+      esac
+    fi
+    ;;
+  sco3.2v5*)
+    lt_cv_sys_max_cmd_len=102400
+    ;;
+  sysv5* | sco5v6* | sysv4.2uw2*)
+    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+    if test -n "$kargmax"; then
+      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[        ]//'`
+    else
+      lt_cv_sys_max_cmd_len=32768
+    fi
+    ;;
+  *)
+    # If test is not a shell built-in, we'll probably end up computing a
+    # maximum length that is only half of the actual maximum length, but
+    # we can't tell.
+    SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+    while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \
+              = "XX$teststring") >/dev/null 2>&1 &&
+           new_result=`expr "X$teststring" : ".*" 2>&1` &&
+           lt_cv_sys_max_cmd_len=$new_result &&
+           test $i != 17 # 1/2 MB should be enough
+    do
+      i=`expr $i + 1`
+      teststring=$teststring$teststring
+    done
+    teststring=
+    # Add a significant safety factor because C++ compilers can tack on massive
+    # amounts of additional arguments before passing them to the linker.
+    # It appears as though 1/2 is a usable value.
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+    ;;
+  esac
+
+fi
+
+if test -n $lt_cv_sys_max_cmd_len ; then
+  echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
+echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6
+else
+  echo "$as_me:$LINENO: result: none" >&5
+echo "${ECHO_T}none" >&6
+fi
+
+
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
+echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6
+if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Transform an extracted symbol line into a proper C declaration
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[BCDT]'
+  ;;
+cygwin* | mingw* | pw32*)
+  symcode='[ABCDGISTW]'
+  ;;
+hpux*) # Its linker distinguishes data from code symbols
+  if test "$host_cpu" = ia64; then
+    symcode='[ABCDEGRST]'
+  fi
+  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+  ;;
+linux*)
+  if test "$host_cpu" = ia64; then
+    symcode='[ABCDGIRSTW]'
+    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+    lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+  fi
+  ;;
+irix* | nonstopux*)
+  symcode='[BCDEGRST]'
+  ;;
+osf*)
+  symcode='[BCDEGQRST]'
+  ;;
+solaris*)
+  symcode='[BDRT]'
+  ;;
+sco3.2v5*)
+  symcode='[DT]'
+  ;;
+sysv4.2uw2*)
+  symcode='[DT]'
+  ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+  symcode='[ABDT]'
+  ;;
+sysv4)
+  symcode='[DFNSTU]'
+  ;;
+esac
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+  ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[ABCDGIRSTW]' ;;
+esac
+
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
+
+  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+  symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+  # Write the raw and C identifiers.
+  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[      ]\($symcode$symcode*\)[         ][      ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -f conftest*
+  cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+EOF
+
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5
+  (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s "$nlist"; then
+      # Try sorting and uniquifying the output.
+      if sort "$nlist" | uniq > "$nlist"T; then
+       mv -f "$nlist"T "$nlist"
+      else
+       rm -f "$nlist"T
+      fi
+
+      # Make sure that we snagged all the symbols we need.
+      if grep ' nm_test_var$' "$nlist" >/dev/null; then
+       if grep ' nm_test_func$' "$nlist" >/dev/null; then
+         cat <<EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+         # Now generate the symbol file.
+         eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
+
+         cat <<EOF >> conftest.$ac_ext
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+  const char *name;
+  lt_ptr_t address;
+}
+lt_preloaded_symbols[] =
+{
+EOF
+         $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
+         cat <<\EOF >> conftest.$ac_ext
+  {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+EOF
+         # Now try linking the two files.
+         mv conftest.$ac_objext conftstm.$ac_objext
+         lt_save_LIBS="$LIBS"
+         lt_save_CFLAGS="$CFLAGS"
+         LIBS="conftstm.$ac_objext"
+         CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+         if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext}; then
+           pipe_works=yes
+         fi
+         LIBS="$lt_save_LIBS"
+         CFLAGS="$lt_save_CFLAGS"
+       else
+         echo "cannot find nm_test_func in $nlist" >&5
+       fi
+      else
+       echo "cannot find nm_test_var in $nlist" >&5
+      fi
+    else
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+    fi
+  else
+    echo "$progname: failed program was:" >&5
+    cat conftest.$ac_ext >&5
+  fi
+  rm -f conftest* conftst*
+
+  # Do not use the global_symbol_pipe unless it works.
+  if test "$pipe_works" = yes; then
+    break
+  else
+    lt_cv_sys_global_symbol_pipe=
+  fi
+done
+
+fi
+
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+  lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+  echo "$as_me:$LINENO: result: failed" >&5
+echo "${ECHO_T}failed" >&6
+else
+  echo "$as_me:$LINENO: result: ok" >&5
+echo "${ECHO_T}ok" >&6
+fi
+
+echo "$as_me:$LINENO: checking for objdir" >&5
+echo $ECHO_N "checking for objdir... $ECHO_C" >&6
+if test "${lt_cv_objdir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+  lt_cv_objdir=.libs
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+fi
+echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
+echo "${ECHO_T}$lt_cv_objdir" >&6
+objdir=$lt_cv_objdir
+
+
+
+
+
+case $host_os in
+aix3*)
+  # AIX sometimes has problems with the GCC collect2 program.  For some
+  # reason, if we set the COLLECT_NAMES environment variable, the problems
+  # vanish in a puff of smoke.
+  if test "X${COLLECT_NAMES+set}" != Xset; then
+    COLLECT_NAMES=
+    export COLLECT_NAMES
+  fi
+  ;;
+esac
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e 1s/^X//'
+sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Constants:
+rm="rm -f"
+
+# Global variables:
+default_ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+ltmain="$ac_aux_dir/ltmain.sh"
+ofile="$default_ofile"
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AR+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AR="${ac_tool_prefix}ar"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  echo "$as_me:$LINENO: result: $AR" >&5
+echo "${ECHO_T}$AR" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_AR"; then
+  ac_ct_AR=$AR
+  # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_AR="ar"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false"
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
+echo "${ECHO_T}$ac_ct_AR" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  AR=$ac_ct_AR
+else
+  AR="$ac_cv_prog_AR"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  RANLIB=$ac_ct_RANLIB
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  STRIP=$ac_ct_STRIP
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+test -z "$AS" && AS=as
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+test -z "$LD" && LD=ld
+test -z "$LN_S" && LN_S="ln -s"
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+test -z "$NM" && NM=nm
+test -z "$SED" && SED=sed
+test -z "$OBJDUMP" && OBJDUMP=objdump
+test -z "$RANLIB" && RANLIB=:
+test -z "$STRIP" && STRIP=:
+test -z "$ac_objext" && ac_objext=o
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+    ;;
+  *)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+
+# Only perform the check for file, if the check method requires it
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
+echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $MAGIC_CMD in
+[\\/*] |  ?:[\\/]*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/${ac_tool_prefix}file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+      if test -n "$file_magic_test_file"; then
+       case $deplibs_check_method in
+       "file_magic "*)
+         file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+         MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+           $EGREP "$file_magic_regex" > /dev/null; then
+           :
+         else
+           cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+EOF
+         fi ;;
+       esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    echo "$as_me:$LINENO: checking for file" >&5
+echo $ECHO_N "checking for file... $ECHO_C" >&6
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $MAGIC_CMD in
+[\\/*] |  ?:[\\/]*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/file"
+      if test -n "$file_magic_test_file"; then
+       case $deplibs_check_method in
+       "file_magic "*)
+         file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+         MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+           $EGREP "$file_magic_regex" > /dev/null; then
+           :
+         else
+           cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+EOF
+         fi ;;
+       esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  else
+    MAGIC_CMD=:
+  fi
+fi
+
+  fi
+  ;;
+esac
+
+enable_dlopen=no
+enable_win32_dll=no
+
+# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+  enableval="$enable_libtool_lock"
+
+fi;
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+
+# Check whether --with-pic or --without-pic was given.
+if test "${with_pic+set}" = set; then
+  withval="$with_pic"
+  pic_mode="$withval"
+else
+  pic_mode=default
+fi;
+test -z "$pic_mode" && pic_mode=default
+
+# Use C for the default configuration in the libtool script
+tagname=
+lt_save_CC="$CC"
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}\n'
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+
+lt_prog_compiler_no_builtin_flag=
+
+if test "$GCC" = yes; then
+  lt_prog_compiler_no_builtin_flag=' -fno-builtin'
+
+
+echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_rtti_exceptions=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="-fno-rtti -fno-exceptions"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:6606: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:6610: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_rtti_exceptions=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+    lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+else
+    :
+fi
+
+fi
+
+lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
+
+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl='-Wl,'
+    lt_prog_compiler_static='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      # FIXME: we need at least 68020 code to build shared libraries, but
+      # adding the `-m68020' flag to GCC prevents building anything better,
+      # like `-m68040'.
+      lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+      ;;
+
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic='-fno-common'
+      ;;
+
+    interix3*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared=no
+      enable_shared=no
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       lt_prog_compiler_pic=-Kconform_pic
+      fi
+      ;;
+
+    hpux*)
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+       # +Z the default
+       ;;
+      *)
+       lt_prog_compiler_pic='-fPIC'
+       ;;
+      esac
+      ;;
+
+    *)
+      lt_prog_compiler_pic='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl='-Wl,'
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       lt_prog_compiler_static='-Bstatic'
+      else
+       lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+      darwin*)
+        # PIC is the default on this platform
+        # Common symbols not allowed in MH_DYLIB files
+       case $cc_basename in
+         xlc*)
+         lt_prog_compiler_pic='-qnocommon'
+         lt_prog_compiler_wl='-Wl,'
+         ;;
+       esac
+       ;;
+
+    mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+       # +Z the default
+       ;;
+      *)
+       lt_prog_compiler_pic='+Z'
+       ;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    linux*)
+      case $cc_basename in
+      icc* | ecc*)
+       lt_prog_compiler_wl='-Wl,'
+       lt_prog_compiler_pic='-KPIC'
+       lt_prog_compiler_static='-static'
+        ;;
+      pgcc* | pgf77* | pgf90* | pgf95*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+       # which looks to be a dead project)
+       lt_prog_compiler_wl='-Wl,'
+       lt_prog_compiler_pic='-fpic'
+       lt_prog_compiler_static='-Bstatic'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static='-non_shared'
+        ;;
+      esac
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+       lt_prog_compiler_wl='-Qoption ld ';;
+      *)
+       lt_prog_compiler_wl='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl='-Qoption ld '
+      lt_prog_compiler_pic='-PIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+       lt_prog_compiler_pic='-Kconform_pic'
+       lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
+
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    unicos*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_can_build_shared=no
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic='-pic'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared=no
+      ;;
+    esac
+  fi
+
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic" >&6
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+
+echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6
+if test "${lt_prog_compiler_pic_works+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:6874: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:6878: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_prog_compiler_pic_works=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6
+
+if test x"$lt_prog_compiler_pic_works" = xyes; then
+    case $lt_prog_compiler_pic in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+     esac
+else
+    lt_prog_compiler_pic=
+     lt_prog_compiler_can_build_shared=no
+fi
+
+fi
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic=
+    ;;
+  *)
+    lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+    ;;
+esac
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
+echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6
+if test "${lt_prog_compiler_static_works+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_static_works=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+   printf "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_prog_compiler_static_works=yes
+       fi
+     else
+       lt_prog_compiler_static_works=yes
+     fi
+   fi
+   $rm conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5
+echo "${ECHO_T}$lt_prog_compiler_static_works" >&6
+
+if test x"$lt_prog_compiler_static_works" = xyes; then
+    :
+else
+    lt_prog_compiler_static=
+fi
+
+
+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_c_o+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:6978: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:6982: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $rm conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
+   $rm out/* && rmdir out
+   cd ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+  hard_links=yes
+  $rm conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+
+  runpath_var=
+  allow_undefined_flag=
+  enable_shared_with_static_runtimes=no
+  archive_cmds=
+  archive_expsym_cmds=
+  old_archive_From_new_cmds=
+  old_archive_from_expsyms_cmds=
+  export_dynamic_flag_spec=
+  whole_archive_flag_spec=
+  thread_safe_flag_spec=
+  hardcode_libdir_flag_spec=
+  hardcode_libdir_flag_spec_ld=
+  hardcode_libdir_separator=
+  hardcode_direct=no
+  hardcode_minus_L=no
+  hardcode_shlibpath_var=unsupported
+  link_all_deplibs=unknown
+  hardcode_automatic=no
+  module_cmds=
+  module_expsym_cmds=
+  always_export_symbols=no
+  export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  extract_expsyms_cmds=
+  # Just being paranoid about ensuring that cc_basename is set.
+  for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs=yes
+  if test "$with_gnu_ld" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec='${wl}--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+       whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+       whole_archive_flag_spec=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>/dev/null` in
+      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+       ld_shlibs=no
+       cat <<EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+
+      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      ld_shlibs=no
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       allow_undefined_flag=unsupported
+       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+       # support --undefined.  This deserves some investigation.  FIXME
+       archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+       ld_shlibs=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec='-L$libdir'
+      allow_undefined_flag=unsupported
+      always_export_symbols=no
+      enable_shared_with_static_runtimes=yes
+      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+       # If the export-symbols file already is a .def file (1st line
+       # is EXPORTS), use it as is; otherwise, prepend...
+       archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+         cp $export_symbols $output_objdir/$soname.def;
+       else
+         echo EXPORTS > $output_objdir/$soname.def;
+         cat $export_symbols >> $output_objdir/$soname.def;
+       fi~
+       $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      else
+       ld_shlibs=no
+      fi
+      ;;
+
+    interix3*)
+      hardcode_direct=no
+      hardcode_shlibpath_var=no
+      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+      export_dynamic_flag_spec='${wl}-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
+
+    linux*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       tmp_addflag=
+       case $cc_basename,$host_cpu in
+       pgcc*)                          # Portland Group C compiler
+         whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag'
+         ;;
+       pgf77* | pgf90* | pgf95*)       # Portland Group f77 and f90 compilers
+         whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag -Mnomain' ;;
+       ecc*,ia64* | icc*,ia64*)                # Intel C compiler on ia64
+         tmp_addflag=' -i_dynamic' ;;
+       efc*,ia64* | ifort*,ia64*)      # Intel Fortran compiler on ia64
+         tmp_addflag=' -i_dynamic -nofor_main' ;;
+       ifc* | ifort*)                  # Intel Fortran compiler
+         tmp_addflag=' -nofor_main' ;;
+       esac
+       archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+       if test $supports_anon_versioning = yes; then
+         archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
+  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+  $echo "local: *; };" >> $output_objdir/$libname.ver~
+         $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+       fi
+      else
+       ld_shlibs=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+       archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+       wlarc=
+      else
+       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+       ld_shlibs=no
+       cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       ld_shlibs=no
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+       ld_shlibs=no
+       cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+       ;;
+       *)
+         if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+           hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+           archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
+           archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
+         else
+           ld_shlibs=no
+         fi
+       ;;
+      esac
+      ;;
+
+    sunos4*)
+      archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       ld_shlibs=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs" = no; then
+      runpath_var=
+      hardcode_libdir_flag_spec=
+      export_dynamic_flag_spec=
+      whole_archive_flag_spec=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag=unsupported
+      always_export_symbols=yes
+      archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      hardcode_minus_L=yes
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+       # Neither direct hardcoding nor static linking is supported with a
+       # broken collect2.
+       hardcode_direct=unsupported
+      fi
+      ;;
+
+    aix4* | aix5*)
+      if test "$host_cpu" = ia64; then
+       # On IA64, the linker does run time linking by default, so we don't
+       # have to do anything special.
+       aix_use_runtimelinking=no
+       exp_sym_flag='-Bexport'
+       no_entry_flag=""
+      else
+       # If we're using GNU nm, then we don't want the "-C" option.
+       # -C means demangle to AIX nm, but means don't demangle with GNU nm
+       if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+         export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+       else
+         export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+       fi
+       aix_use_runtimelinking=no
+
+       # Test if we are trying to use run time linking or normal
+       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+       # need to do runtime linking.
+       case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+         for ld_flag in $LDFLAGS; do
+         if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+           aix_use_runtimelinking=yes
+           break
+         fi
+         done
+         ;;
+       esac
+
+       exp_sym_flag='-bexport'
+       no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      archive_cmds=''
+      hardcode_direct=yes
+      hardcode_libdir_separator=':'
+      link_all_deplibs=yes
+
+      if test "$GCC" = yes; then
+       case $host_os in aix4.[012]|aix4.[012].*)
+       # We only want to do this on AIX 4.2 and lower, the check
+       # below for broken collect2 doesn't work under 4.3+
+         collect2name=`${CC} -print-prog-name=collect2`
+         if test -f "$collect2name" && \
+          strings "$collect2name" | grep resolve_lib_name >/dev/null
+         then
+         # We have reworked collect2
+         hardcode_direct=yes
+         else
+         # We have old collect2
+         hardcode_direct=unsupported
+         # It fails to find uninstalled libraries when the uninstalled
+         # path is not listed in the libpath.  Setting hardcode_minus_L
+         # to unsupported forces relinking
+         hardcode_minus_L=yes
+         hardcode_libdir_flag_spec='-L$libdir'
+         hardcode_libdir_separator=
+         fi
+         ;;
+       esac
+       shared_flag='-shared'
+       if test "$aix_use_runtimelinking" = yes; then
+         shared_flag="$shared_flag "'${wl}-G'
+       fi
+      else
+       # not using gcc
+       if test "$host_cpu" = ia64; then
+       # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+       # chokes on -Wl,-G. The following line is correct:
+         shared_flag='-G'
+       else
+         if test "$aix_use_runtimelinking" = yes; then
+           shared_flag='${wl}-G'
+         else
+           shared_flag='${wl}-bM:SRE'
+         fi
+       fi
+      fi
+
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols=yes
+      if test "$aix_use_runtimelinking" = yes; then
+       # Warning - without using the other runtime loading flags (-brtl),
+       # -berok will link without error, but may produce a broken library.
+       allow_undefined_flag='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+       hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+       archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+       if test "$host_cpu" = ia64; then
+         hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+         allow_undefined_flag="-z nodefs"
+         archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+       else
+        # Determine the default libpath from the value encoded in an empty executable.
+        cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+         # Warning - without using the other run time loading flags,
+         # -berok will link without error, but may produce a broken library.
+         no_undefined_flag=' ${wl}-bernotok'
+         allow_undefined_flag=' ${wl}-berok'
+         # Exported symbols can be pulled into shared objects from archives
+         whole_archive_flag_spec='$convenience'
+         archive_cmds_need_lc=yes
+         # This is similar to how AIX traditionally builds its shared libraries.
+         archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+       fi
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      # see comment about different semantics on the GNU ld section
+      ld_shlibs=no
+      ;;
+
+    bsdi[45]*)
+      export_dynamic_flag_spec=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      hardcode_libdir_flag_spec=' '
+      allow_undefined_flag=unsupported
+      # Tell ltmain to make .lib files, not .a files.
+      libext=lib
+      # Tell ltmain to make .dll files, not .so files.
+      shrext_cmds=".dll"
+      # FIXME: Setting linknames here is a bad hack.
+      archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      old_archive_From_new_cmds='true'
+      # FIXME: Should let the user specify the lib program.
+      old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path='`cygpath -w "$srcfile"`'
+      enable_shared_with_static_runtimes=yes
+      ;;
+
+    darwin* | rhapsody*)
+      case $host_os in
+        rhapsody* | darwin1.[012])
+         allow_undefined_flag='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[012])
+               allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+      esac
+      archive_cmds_need_lc=no
+      hardcode_direct=no
+      hardcode_automatic=yes
+      hardcode_shlibpath_var=unsupported
+      whole_archive_flag_spec=''
+      link_all_deplibs=yes
+    if test "$GCC" = yes ; then
+       output_verbose_link_cmd='echo'
+        archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+      archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      module_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+         archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+         module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+         archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          module_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         ld_shlibs=no
+          ;;
+      esac
+    fi
+      ;;
+
+    dgux*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
+
+    freebsd1*)
+      ld_shlibs=no
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu | dragonfly*)
+      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+       archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+       archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      fi
+      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_direct=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L=yes
+      export_dynamic_flag_spec='${wl}-E'
+      ;;
+
+    hpux10*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+       archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test "$with_gnu_ld" = no; then
+       hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+       hardcode_libdir_separator=:
+
+       hardcode_direct=yes
+       export_dynamic_flag_spec='${wl}-E'
+
+       # hardcode_minus_L: Not really in the search PATH,
+       # but as the default location of the library.
+       hardcode_minus_L=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+       case $host_cpu in
+       hppa*64*)
+         archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       ia64*)
+         archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+         archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       esac
+      else
+       case $host_cpu in
+       hppa*64*)
+         archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       ia64*)
+         archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+         archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       esac
+      fi
+      if test "$with_gnu_ld" = no; then
+       hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+       hardcode_libdir_separator=:
+
+       case $host_cpu in
+       hppa*64*|ia64*)
+         hardcode_libdir_flag_spec_ld='+b $libdir'
+         hardcode_direct=no
+         hardcode_shlibpath_var=no
+         ;;
+       *)
+         hardcode_direct=yes
+         export_dynamic_flag_spec='${wl}-E'
+
+         # hardcode_minus_L: Not really in the search PATH,
+         # but as the default location of the library.
+         hardcode_minus_L=yes
+         ;;
+       esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+       archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+       hardcode_libdir_flag_spec_ld='-rpath $libdir'
+      fi
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      link_all_deplibs=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+       archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+       archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    newsos6)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_shlibpath_var=no
+      ;;
+
+    openbsd*)
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+       archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+       hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+       export_dynamic_flag_spec='${wl}-E'
+      else
+       case $host_os in
+        openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+          archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+          hardcode_libdir_flag_spec='-R$libdir'
+          ;;
+        *)
+          archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+          hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+          ;;
+       esac
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      allow_undefined_flag=unsupported
+      archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+       archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+       allow_undefined_flag=' -expect_unresolved \*'
+       archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      ;;
+
+    osf4* | osf5*)     # as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+       archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      else
+       allow_undefined_flag=' -expect_unresolved \*'
+       archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+       archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+       $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+
+       # Both c and cxx compiler support -rpath directly
+       hardcode_libdir_flag_spec='-rpath $libdir'
+      fi
+      hardcode_libdir_separator=:
+      ;;
+
+    solaris*)
+      no_undefined_flag=' -z text'
+      if test "$GCC" = yes; then
+       wlarc='${wl}'
+       archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+         $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+      else
+       wlarc=''
+       archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+       archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+       $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_shlibpath_var=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *)
+       # The compiler driver will combine linker options so we
+       # cannot just pass the convience library names through
+       # without $wl, iff we do not link with $LD.
+       # Luckily, gcc supports the same syntax we need for Sun Studio.
+       # Supported since Solaris 2.6 (maybe 2.5.1?)
+       case $wlarc in
+       '')
+         whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
+       *)
+         whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+       esac ;;
+      esac
+      link_all_deplibs=yes
+      ;;
+
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+       # Use $CC to link under sequent, because it throws in some extra .o
+       # files that make .init and .fini sections work.
+       archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+       sni)
+         archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         hardcode_direct=yes # is this really true???
+       ;;
+       siemens)
+         ## LD is ld it makes a PLAMLIB
+         ## CC just makes a GrossModule.
+         archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+         reload_cmds='$CC -r -o $output$reload_objs'
+         hardcode_direct=no
+        ;;
+       motorola)
+         archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+       ;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var=no
+      export_dynamic_flag_spec='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+       hardcode_shlibpath_var=no
+       runpath_var=LD_RUN_PATH
+       hardcode_runpath_var=yes
+       ld_shlibs=yes
+      fi
+      ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
+      no_undefined_flag='${wl}-z,text'
+      archive_cmds_need_lc=no
+      hardcode_shlibpath_var=no
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+       archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We can NOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      no_undefined_flag='${wl}-z,text'
+      allow_undefined_flag='${wl}-z,nodefs'
+      archive_cmds_need_lc=no
+      hardcode_shlibpath_var=no
+      hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+      hardcode_libdir_separator=':'
+      link_all_deplibs=yes
+      export_dynamic_flag_spec='${wl}-Bexport'
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+       archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    uts4*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
+
+    *)
+      ld_shlibs=no
+      ;;
+    esac
+  fi
+
+echo "$as_me:$LINENO: result: $ld_shlibs" >&5
+echo "${ECHO_T}$ld_shlibs" >&6
+test "$ld_shlibs" = no && can_build_shared=no
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl
+       pic_flag=$lt_prog_compiler_pic
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag
+        allow_undefined_flag=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+         archive_cmds_need_lc=no
+        else
+         archive_cmds_need_lc=yes
+        fi
+        allow_undefined_flag=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
+echo "${ECHO_T}$archive_cmds_need_lc" >&6
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+if test "$GCC" = yes; then
+  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+    # if the path contains ";" then we assume it to be the separator
+    # otherwise default to the standard path separator (i.e. ":") - it is
+    # assumed that no part of a normal pathname contains ";" but that should
+    # okay in the real world where ";" in dirpaths is itself problematic.
+    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+  else
+    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+  fi
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix4* | aix5*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[01] | aix4.[01].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+          echo ' yes '
+          echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+       :
+      else
+       can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  library_names_spec='$libname.ixlibrary $libname.a'
+  # Create ${libname}_ixlibrary.a entries in /sys/libs.
+  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[45]*)
+  version_type=linux
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $rm \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+      if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+        # It is most probably a Windows format PATH printed by
+        # mingw gcc, but we are running on Cygwin. Gcc prints its search
+        # path with ; separators, and with drive letters. We can handle the
+        # drive letters (cygwin fileutils understands them), so leave them,
+        # especially as we might pass files found there to a mingw objdump,
+        # which wouldn't understand a cygwinified path. Ahh.
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    ;;
+
+  *)
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    ;;
+  esac
+  dynamic_linker='Win32 ld.exe'
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd1*)
+  dynamic_linker=no
+  ;;
+
+kfreebsd*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[123]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[01]* | freebsdelf3.[01]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  freebsd*) # from 4.6 on
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+   hppa*64*)
+     shrext_cmds='.sl'
+     hardcode_into_libs=yes
+     dynamic_linker="$host_os dld.sl"
+     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+     soname_spec='${libname}${release}${shared_ext}$major'
+     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+     ;;
+   *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555.
+  postinstall_cmds='chmod 555 $lib'
+  ;;
+
+interix3*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+       if test "$lt_cv_prog_gnu_ld" = yes; then
+               version_type=linux
+       else
+               version_type=irix
+       fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be Linux ELF.
+linux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # find out which ABI we are using
+  libsuff=
+  case "$host_cpu" in
+  x86_64*|s390x*|powerpc64*)
+    echo '#line 8447 "configure"' > conftest.$ac_ext
+    if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+      case `/usr/bin/file conftest.$ac_objext` in
+      *64-bit*)
+        libsuff=64
+        sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+        ;;
+      esac
+    fi
+    rm -rf conftest*
+    ;;
+  esac
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,   ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+knetbsd*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+nto-qnx*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+openbsd*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+    *)                         need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[89] | openbsd2.[89].*)
+       shlibpath_overrides_runpath=no
+       ;;
+      *)
+       shlibpath_overrides_runpath=yes
+       ;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+    shlibpath_overrides_runpath=no
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    shlibpath_overrides_runpath=yes
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+       ;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" || \
+   test -n "$runpath_var" || \
+   test "X$hardcode_automatic" = "Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no &&
+     test "$hardcode_minus_L" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action=unsupported
+fi
+echo "$as_me:$LINENO: result: $hardcode_action" >&5
+echo "${ECHO_T}$hardcode_action" >&6
+
+if test "$hardcode_action" = relink; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+
+striplib=
+old_striplib=
+echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+   darwin*)
+       if test -n "$STRIP" ; then
+         striplib="$STRIP -x"
+         echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+       else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+       ;;
+   *)
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+    ;;
+  esac
+fi
+
+if test "x$enable_dlopen" != xyes; then
+  enable_dlopen=unknown
+  enable_dlopen_self=unknown
+  enable_dlopen_self_static=unknown
+else
+  lt_cv_dlopen=no
+  lt_cv_dlopen_libs=
+
+  case $host_os in
+  beos*)
+    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ;;
+
+  mingw* | pw32*)
+    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen_libs=
+   ;;
+
+  cygwin*)
+    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen_libs=
+   ;;
+
+  darwin*)
+  # if libdl is installed we need to link against it
+    echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+
+fi
+
+   ;;
+
+  *)
+    echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
+if test "${ac_cv_func_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shl_load innocuous_shl_load
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shl_load (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shl_load
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char shl_load ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_shl_load) || defined (__stub___shl_load)
+choke me
+#else
+char (*f) () = shl_load;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != shl_load;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_shl_load=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6
+if test $ac_cv_func_shl_load = yes; then
+  lt_cv_dlopen="shl_load"
+else
+  echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char shl_load ();
+int
+main ()
+{
+shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dld_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_shl_load=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
+if test $ac_cv_lib_dld_shl_load = yes; then
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+else
+  echo "$as_me:$LINENO: checking for dlopen" >&5
+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
+if test "${ac_cv_func_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define dlopen innocuous_dlopen
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char dlopen (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef dlopen
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_dlopen) || defined (__stub___dlopen)
+choke me
+#else
+char (*f) () = dlopen;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != dlopen;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+echo "${ECHO_T}$ac_cv_func_dlopen" >&6
+if test $ac_cv_func_dlopen = yes; then
+  lt_cv_dlopen="dlopen"
+else
+  echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_svld_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_svld_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
+if test $ac_cv_lib_svld_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dld_link ();
+int
+main ()
+{
+dld_link ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dld_dld_link=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_dld_link=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
+if test $ac_cv_lib_dld_dld_link = yes; then
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+    ;;
+  esac
+
+  if test "x$lt_cv_dlopen" != xno; then
+    enable_dlopen=yes
+  else
+    enable_dlopen=no
+  fi
+
+  case $lt_cv_dlopen in
+  dlopen)
+    save_CPPFLAGS="$CPPFLAGS"
+    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+    save_LDFLAGS="$LDFLAGS"
+    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+         if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line 9344 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL          RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL                DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL                0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW           RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW         DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW       RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW     DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW     0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+      /* dlclose (self); */
+    }
+  else
+    puts (dlerror ());
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+      echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+         if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line 9444 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL          RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL                DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL                0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW           RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW         DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW       RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW     DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW     0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+      /* dlclose (self); */
+    }
+  else
+    puts (dlerror ());
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6
+    fi
+
+    CPPFLAGS="$save_CPPFLAGS"
+    LDFLAGS="$save_LDFLAGS"
+    LIBS="$save_LIBS"
+    ;;
+  esac
+
+  case $lt_cv_dlopen_self in
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+  *) enable_dlopen_self=unknown ;;
+  esac
+
+  case $lt_cv_dlopen_self_static in
+  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+  *) enable_dlopen_self_static=unknown ;;
+  esac
+fi
+
+
+# Report which library types will actually be built
+echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $can_build_shared" >&5
+echo "${ECHO_T}$can_build_shared" >&6
+
+echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case $host_os in
+aix3*)
+  test "$enable_shared" = yes && enable_static=no
+  if test -n "$RANLIB"; then
+    archive_cmds="$archive_cmds~\$RANLIB \$lib"
+    postinstall_cmds='$RANLIB $lib'
+  fi
+  ;;
+
+aix4* | aix5*)
+  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+    test "$enable_shared" = yes && enable_static=no
+  fi
+    ;;
+esac
+echo "$as_me:$LINENO: result: $enable_shared" >&5
+echo "${ECHO_T}$enable_shared" >&6
+
+echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+echo "$as_me:$LINENO: result: $enable_static" >&5
+echo "${ECHO_T}$enable_static" >&6
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # See if we are running on zsh, and set the options which allow our commands through
+  # without removal of \ escapes.
+  if test -n "${ZSH_VERSION+set}" ; then
+    setopt NO_GLOB_SUBST
+  fi
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler \
+    CC \
+    LD \
+    lt_prog_compiler_wl \
+    lt_prog_compiler_pic \
+    lt_prog_compiler_static \
+    lt_prog_compiler_no_builtin_flag \
+    export_dynamic_flag_spec \
+    thread_safe_flag_spec \
+    whole_archive_flag_spec \
+    enable_shared_with_static_runtimes \
+    old_archive_cmds \
+    old_archive_from_new_cmds \
+    predep_objects \
+    postdep_objects \
+    predeps \
+    postdeps \
+    compiler_lib_search_path \
+    archive_cmds \
+    archive_expsym_cmds \
+    postinstall_cmds \
+    postuninstall_cmds \
+    old_archive_from_expsyms_cmds \
+    allow_undefined_flag \
+    no_undefined_flag \
+    export_symbols_cmds \
+    hardcode_libdir_flag_spec \
+    hardcode_libdir_flag_spec_ld \
+    hardcode_libdir_separator \
+    hardcode_automatic \
+    module_cmds \
+    module_expsym_cmds \
+    lt_cv_prog_compiler_c_o \
+    exclude_expsyms \
+    include_expsyms; do
+
+    case $var in
+    old_archive_cmds | \
+    old_archive_from_new_cmds | \
+    archive_cmds | \
+    archive_expsym_cmds | \
+    module_cmds | \
+    module_expsym_cmds | \
+    old_archive_from_expsyms_cmds | \
+    export_symbols_cmds | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="${ofile}T"
+  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
+  $rm -f "$cfgfile"
+  { echo "$as_me:$LINENO: creating $ofile" >&5
+echo "$as_me: creating $ofile" >&6;}
+
+  cat <<__EOF__ >> "$cfgfile"
+#! $SHELL
+
+# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+#
+# This file is part of GNU Libtool:
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="$SED -e 1s/^X//"
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# The names of the tagged configurations supported by this script.
+available_tags=
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
+# A language-specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC
+
+gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\`
+gcc_ver=\`gcc -dumpversion\`
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=\`echo $lt_predep_objects | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=\`echo $lt_postdep_objects | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=\`echo $lt_compiler_lib_search_path | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# ### END LIBTOOL CONFIG
+
+__EOF__
+
+
+  case $host_os in
+  aix3*)
+    cat <<\EOF >> "$cfgfile"
+
+# AIX sometimes has problems with the GCC collect2 program.  For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+  COLLECT_NAMES=
+  export COLLECT_NAMES
+fi
+EOF
+    ;;
+  esac
+
+  # We use sed instead of cat because bash on DJGPP gets confused if
+  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+  # text mode, it properly converts lines to CR/LF.  This bash problem
+  # is reportedly fixed, but why not run on old versions too?
+  sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
+
+  mv -f "$cfgfile" "$ofile" || \
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+
+# Check whether --with-tags or --without-tags was given.
+if test "${with_tags+set}" = set; then
+  withval="$with_tags"
+  tagnames="$withval"
+fi;
+
+if test -f "$ltmain" && test -n "$tagnames"; then
+  if test ! -f "${ofile}"; then
+    { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5
+echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;}
+  fi
+
+  if test -z "$LTCC"; then
+    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
+    if test -z "$LTCC"; then
+      { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5
+echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;}
+    else
+      { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5
+echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;}
+    fi
+  fi
+  if test -z "$LTCFLAGS"; then
+    eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
+  fi
+
+  # Extract list of available tagged configurations in $ofile.
+  # Note that this assumes the entire list is on one line.
+  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
+
+  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+  for tagname in $tagnames; do
+    IFS="$lt_save_ifs"
+    # Check whether tagname contains only valid characters
+    case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in
+    "") ;;
+    *)  { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5
+echo "$as_me: error: invalid tag name: $tagname" >&2;}
+   { (exit 1); exit 1; }; }
+       ;;
+    esac
+
+    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
+    then
+      { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5
+echo "$as_me: error: tag name \"$tagname\" already exists" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+
+    # Update the list of available tags.
+    if test -n "$tagname"; then
+      echo appending configuration tag \"$tagname\" to $ofile
+
+      case $tagname in
+      CXX)
+       if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+           ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+           (test "X$CXX" != "Xg++"))) ; then
+         ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+
+archive_cmds_need_lc_CXX=no
+allow_undefined_flag_CXX=
+always_export_symbols_CXX=no
+archive_expsym_cmds_CXX=
+export_dynamic_flag_spec_CXX=
+hardcode_direct_CXX=no
+hardcode_libdir_flag_spec_CXX=
+hardcode_libdir_flag_spec_ld_CXX=
+hardcode_libdir_separator_CXX=
+hardcode_minus_L_CXX=no
+hardcode_shlibpath_var_CXX=unsupported
+hardcode_automatic_CXX=no
+module_cmds_CXX=
+module_expsym_cmds_CXX=
+link_all_deplibs_CXX=unknown
+old_archive_cmds_CXX=$old_archive_cmds
+no_undefined_flag_CXX=
+whole_archive_flag_spec_CXX=
+enable_shared_with_static_runtimes_CXX=no
+
+# Dependencies to place before and after the object being linked:
+predep_objects_CXX=
+postdep_objects_CXX=
+predeps_CXX=
+postdeps_CXX=
+compiler_lib_search_path_CXX=
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+objext_CXX=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_LD=$LD
+lt_save_GCC=$GCC
+GCC=$GXX
+lt_save_with_gnu_ld=$with_gnu_ld
+lt_save_path_LD=$lt_cv_path_LD
+if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+  lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+else
+  $as_unset lt_cv_prog_gnu_ld
+fi
+if test -n "${lt_cv_path_LDCXX+set}"; then
+  lt_cv_path_LD=$lt_cv_path_LDCXX
+else
+  $as_unset lt_cv_path_LD
+fi
+test -z "${LDCXX+set}" || LD=$LDCXX
+CC=${CXX-"c++"}
+compiler=$CC
+compiler_CXX=$CC
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+
+# We don't want -fno-exception wen compiling C++ code, so set the
+# no_builtin_flag separately
+if test "$GXX" = yes; then
+  lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
+else
+  lt_prog_compiler_no_builtin_flag_CXX=
+fi
+
+if test "$GXX" = yes; then
+  # Set up default GNU C++ configuration
+
+
+# Check whether --with-gnu-ld or --without-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+  withval="$with_gnu_ld"
+  test "$withval" = no || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi;
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [\\/]* | ?:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+       ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
+else
+  echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
+fi
+if test "${lt_cv_path_LD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -z "$LD"; then
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some variants of GNU ld only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+       test "$with_gnu_ld" != no && break
+       ;;
+      *)
+       test "$with_gnu_ld" != yes && break
+       ;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+   { (exit 1); exit 1; }; }
+echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+  # Check if GNU C++ uses GNU ld as the underlying linker, since the
+  # archiving commands below assume that GNU ld is being used.
+  if test "$with_gnu_ld" = yes; then
+    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+    archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+    hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+    #     investigate it a little bit more. (MM)
+    wlarc='${wl}'
+
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
+       grep 'no-whole-archive' > /dev/null; then
+      whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      whole_archive_flag_spec_CXX=
+    fi
+  else
+    with_gnu_ld=no
+    wlarc=
+
+    # A generic and very simple default shared library creation
+    # command for GNU C++ for the case where it uses the native
+    # linker, instead of GNU ld.  If possible, this setting should
+    # overridden to take advantage of the native linker features on
+    # the platform it is being used on.
+    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+  fi
+
+  # Commands to make compiler produce verbose output that lists
+  # what "hidden" libraries, object files and flags are used when
+  # linking a shared library.
+  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+else
+  GXX=no
+  with_gnu_ld=no
+  wlarc=
+fi
+
+# PORTME: fill in a description of your system's C++ link characteristics
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+ld_shlibs_CXX=yes
+case $host_os in
+  aix3*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  aix4* | aix5*)
+    if test "$host_cpu" = ia64; then
+      # On IA64, the linker does run time linking by default, so we don't
+      # have to do anything special.
+      aix_use_runtimelinking=no
+      exp_sym_flag='-Bexport'
+      no_entry_flag=""
+    else
+      aix_use_runtimelinking=no
+
+      # Test if we are trying to use run time linking or normal
+      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+      # need to do runtime linking.
+      case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+       for ld_flag in $LDFLAGS; do
+         case $ld_flag in
+         *-brtl*)
+           aix_use_runtimelinking=yes
+           break
+           ;;
+         esac
+       done
+       ;;
+      esac
+
+      exp_sym_flag='-bexport'
+      no_entry_flag='-bnoentry'
+    fi
+
+    # When large executables or shared objects are built, AIX ld can
+    # have problems creating the table of contents.  If linking a library
+    # or program results in "error TOC overflow" add -mminimal-toc to
+    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+    archive_cmds_CXX=''
+    hardcode_direct_CXX=yes
+    hardcode_libdir_separator_CXX=':'
+    link_all_deplibs_CXX=yes
+
+    if test "$GXX" = yes; then
+      case $host_os in aix4.[012]|aix4.[012].*)
+      # We only want to do this on AIX 4.2 and lower, the check
+      # below for broken collect2 doesn't work under 4.3+
+       collect2name=`${CC} -print-prog-name=collect2`
+       if test -f "$collect2name" && \
+          strings "$collect2name" | grep resolve_lib_name >/dev/null
+       then
+         # We have reworked collect2
+         hardcode_direct_CXX=yes
+       else
+         # We have old collect2
+         hardcode_direct_CXX=unsupported
+         # It fails to find uninstalled libraries when the uninstalled
+         # path is not listed in the libpath.  Setting hardcode_minus_L
+         # to unsupported forces relinking
+         hardcode_minus_L_CXX=yes
+         hardcode_libdir_flag_spec_CXX='-L$libdir'
+         hardcode_libdir_separator_CXX=
+       fi
+       ;;
+      esac
+      shared_flag='-shared'
+      if test "$aix_use_runtimelinking" = yes; then
+       shared_flag="$shared_flag "'${wl}-G'
+      fi
+    else
+      # not using gcc
+      if test "$host_cpu" = ia64; then
+       # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+       # chokes on -Wl,-G. The following line is correct:
+       shared_flag='-G'
+      else
+       if test "$aix_use_runtimelinking" = yes; then
+         shared_flag='${wl}-G'
+       else
+         shared_flag='${wl}-bM:SRE'
+       fi
+      fi
+    fi
+
+    # It seems that -bexpall does not export symbols beginning with
+    # underscore (_), so it is better to generate a list of symbols to export.
+    always_export_symbols_CXX=yes
+    if test "$aix_use_runtimelinking" = yes; then
+      # Warning - without using the other runtime loading flags (-brtl),
+      # -berok will link without error, but may produce a broken library.
+      allow_undefined_flag_CXX='-berok'
+      # Determine the default libpath from the value encoded in an empty executable.
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+      hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+      archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+     else
+      if test "$host_cpu" = ia64; then
+       hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
+       allow_undefined_flag_CXX="-z nodefs"
+       archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+      else
+       # Determine the default libpath from the value encoded in an empty executable.
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+       hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+       # Warning - without using the other run time loading flags,
+       # -berok will link without error, but may produce a broken library.
+       no_undefined_flag_CXX=' ${wl}-bernotok'
+       allow_undefined_flag_CXX=' ${wl}-berok'
+       # Exported symbols can be pulled into shared objects from archives
+       whole_archive_flag_spec_CXX='$convenience'
+       archive_cmds_need_lc_CXX=yes
+       # This is similar to how AIX traditionally builds its shared libraries.
+       archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+      fi
+    fi
+    ;;
+
+  beos*)
+    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+      allow_undefined_flag_CXX=unsupported
+      # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+      # support --undefined.  This deserves some investigation.  FIXME
+      archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+    else
+      ld_shlibs_CXX=no
+    fi
+    ;;
+
+  chorus*)
+    case $cc_basename in
+      *)
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+    esac
+    ;;
+
+  cygwin* | mingw* | pw32*)
+    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
+    # as there is no search path for DLLs.
+    hardcode_libdir_flag_spec_CXX='-L$libdir'
+    allow_undefined_flag_CXX=unsupported
+    always_export_symbols_CXX=no
+    enable_shared_with_static_runtimes_CXX=yes
+
+    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+      archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      # If the export-symbols file already is a .def file (1st line
+      # is EXPORTS), use it as is; otherwise, prepend...
+      archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+       cp $export_symbols $output_objdir/$soname.def;
+      else
+       echo EXPORTS > $output_objdir/$soname.def;
+       cat $export_symbols >> $output_objdir/$soname.def;
+      fi~
+      $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+    else
+      ld_shlibs_CXX=no
+    fi
+  ;;
+      darwin* | rhapsody*)
+        case $host_os in
+        rhapsody* | darwin1.[012])
+         allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[012])
+               allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+        esac
+      archive_cmds_need_lc_CXX=no
+      hardcode_direct_CXX=no
+      hardcode_automatic_CXX=yes
+      hardcode_shlibpath_var_CXX=unsupported
+      whole_archive_flag_spec_CXX=''
+      link_all_deplibs_CXX=yes
+
+    if test "$GXX" = yes ; then
+      lt_int_apple_cc_single_mod=no
+      output_verbose_link_cmd='echo'
+      if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
+       lt_int_apple_cc_single_mod=yes
+      fi
+      if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+       archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      else
+          archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+        fi
+        module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+          if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+            archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          else
+            archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          fi
+            module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+          archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+          module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+          archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         ld_shlibs_CXX=no
+          ;;
+      esac
+      fi
+        ;;
+
+  dgux*)
+    case $cc_basename in
+      ec++*)
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+      ghcx*)
+       # Green Hills C++ Compiler
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+      *)
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+    esac
+    ;;
+  freebsd[12]*)
+    # C++ shared libraries reported to be fairly broken before switch to ELF
+    ld_shlibs_CXX=no
+    ;;
+  freebsd-elf*)
+    archive_cmds_need_lc_CXX=no
+    ;;
+  freebsd* | kfreebsd*-gnu | dragonfly*)
+    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+    # conventions
+    ld_shlibs_CXX=yes
+    ;;
+  gnu*)
+    ;;
+  hpux9*)
+    hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+    hardcode_libdir_separator_CXX=:
+    export_dynamic_flag_spec_CXX='${wl}-E'
+    hardcode_direct_CXX=yes
+    hardcode_minus_L_CXX=yes # Not in the search PATH,
+                               # but as the default
+                               # location of the library.
+
+    case $cc_basename in
+    CC*)
+      # FIXME: insert proper C++ library support
+      ld_shlibs_CXX=no
+      ;;
+    aCC*)
+      archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      # Commands to make compiler produce verbose output that lists
+      # what "hidden" libraries, object files and flags are used when
+      # linking a shared library.
+      #
+      # There doesn't appear to be a way to prevent this compiler from
+      # explicitly linking system object files so we need to strip them
+      # from the output so that they don't get included in the library
+      # dependencies.
+      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+      ;;
+    *)
+      if test "$GXX" = yes; then
+        archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+        # FIXME: insert proper C++ library support
+        ld_shlibs_CXX=no
+      fi
+      ;;
+    esac
+    ;;
+  hpux10*|hpux11*)
+    if test $with_gnu_ld = no; then
+      hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator_CXX=:
+
+      case $host_cpu in
+      hppa*64*|ia64*)
+       hardcode_libdir_flag_spec_ld_CXX='+b $libdir'
+        ;;
+      *)
+       export_dynamic_flag_spec_CXX='${wl}-E'
+        ;;
+      esac
+    fi
+    case $host_cpu in
+    hppa*64*|ia64*)
+      hardcode_direct_CXX=no
+      hardcode_shlibpath_var_CXX=no
+      ;;
+    *)
+      hardcode_direct_CXX=yes
+      hardcode_minus_L_CXX=yes # Not in the search PATH,
+                                             # but as the default
+                                             # location of the library.
+      ;;
+    esac
+
+    case $cc_basename in
+      CC*)
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+      aCC*)
+       case $host_cpu in
+       hppa*64*)
+         archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+         ;;
+       ia64*)
+         archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+         ;;
+       *)
+         archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+         ;;
+       esac
+       # Commands to make compiler produce verbose output that lists
+       # what "hidden" libraries, object files and flags are used when
+       # linking a shared library.
+       #
+       # There doesn't appear to be a way to prevent this compiler from
+       # explicitly linking system object files so we need to strip them
+       # from the output so that they don't get included in the library
+       # dependencies.
+       output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+       ;;
+      *)
+       if test "$GXX" = yes; then
+         if test $with_gnu_ld = no; then
+           case $host_cpu in
+           hppa*64*)
+             archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+             ;;
+           ia64*)
+             archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+             ;;
+           *)
+             archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+             ;;
+           esac
+         fi
+       else
+         # FIXME: insert proper C++ library support
+         ld_shlibs_CXX=no
+       fi
+       ;;
+    esac
+    ;;
+  interix3*)
+    hardcode_direct_CXX=no
+    hardcode_shlibpath_var_CXX=no
+    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+    export_dynamic_flag_spec_CXX='${wl}-E'
+    # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+    # Instead, shared libraries are loaded at an image base (0x10000000 by
+    # default) and relocated if they conflict, which is a slow very memory
+    # consuming and fragmenting process.  To avoid this, we pick a random,
+    # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+    # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+    archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+    archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+    ;;
+  irix5* | irix6*)
+    case $cc_basename in
+      CC*)
+       # SGI C++
+       archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+
+       # Archives containing C++ object files must be created using
+       # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
+       # necessary to make sure instantiated templates are included
+       # in the archive.
+       old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
+       ;;
+      *)
+       if test "$GXX" = yes; then
+         if test "$with_gnu_ld" = no; then
+           archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+         else
+           archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
+         fi
+       fi
+       link_all_deplibs_CXX=yes
+       ;;
+    esac
+    hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+    hardcode_libdir_separator_CXX=:
+    ;;
+  linux*)
+    case $cc_basename in
+      KCC*)
+       # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+       # KCC will only create a shared library if the output file
+       # ends with ".so" (or ".sl" for HP-UX), so rename the library
+       # to its proper name (with version) after linking.
+       archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+       archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+       # Commands to make compiler produce verbose output that lists
+       # what "hidden" libraries, object files and flags are used when
+       # linking a shared library.
+       #
+       # There doesn't appear to be a way to prevent this compiler from
+       # explicitly linking system object files so we need to strip them
+       # from the output so that they don't get included in the library
+       # dependencies.
+       output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+
+       hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir'
+       export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+       # Archives containing C++ object files must be created using
+       # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+       old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+       ;;
+      icpc*)
+       # Intel C++
+       with_gnu_ld=yes
+       # version 8.0 and above of icpc choke on multiply defined symbols
+       # if we add $predep_objects and $postdep_objects, however 7.1 and
+       # earlier do not add the objects themselves.
+       case `$CC -V 2>&1` in
+       *"Version 7."*)
+         archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+         archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+         ;;
+       *)  # Version 8.0 or newer
+         tmp_idyn=
+         case $host_cpu in
+           ia64*) tmp_idyn=' -i_dynamic';;
+         esac
+         archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+         archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+         ;;
+       esac
+       archive_cmds_need_lc_CXX=no
+       hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+       export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+       whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+       ;;
+      pgCC*)
+        # Portland Group C++ compiler
+       archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+       archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+
+       hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+       export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+       whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+        ;;
+      cxx*)
+       # Compaq C++
+       archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+       runpath_var=LD_RUN_PATH
+       hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+       hardcode_libdir_separator_CXX=:
+
+       # Commands to make compiler produce verbose output that lists
+       # what "hidden" libraries, object files and flags are used when
+       # linking a shared library.
+       #
+       # There doesn't appear to be a way to prevent this compiler from
+       # explicitly linking system object files so we need to strip them
+       # from the output so that they don't get included in the library
+       # dependencies.
+       output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+       ;;
+    esac
+    ;;
+  lynxos*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  m88k*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  mvs*)
+    case $cc_basename in
+      cxx*)
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+      *)
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+    esac
+    ;;
+  netbsd*)
+    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+      archive_cmds_CXX='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+      wlarc=
+      hardcode_libdir_flag_spec_CXX='-R$libdir'
+      hardcode_direct_CXX=yes
+      hardcode_shlibpath_var_CXX=no
+    fi
+    # Workaround some broken pre-1.5 toolchains
+    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+    ;;
+  openbsd2*)
+    # C++ shared libraries are fairly broken
+    ld_shlibs_CXX=no
+    ;;
+  openbsd*)
+    hardcode_direct_CXX=yes
+    hardcode_shlibpath_var_CXX=no
+    archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+      archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+      export_dynamic_flag_spec_CXX='${wl}-E'
+      whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    fi
+    output_verbose_link_cmd='echo'
+    ;;
+  osf3*)
+    case $cc_basename in
+      KCC*)
+       # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+       # KCC will only create a shared library if the output file
+       # ends with ".so" (or ".sl" for HP-UX), so rename the library
+       # to its proper name (with version) after linking.
+       archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+       hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+       hardcode_libdir_separator_CXX=:
+
+       # Archives containing C++ object files must be created using
+       # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+       old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+
+       ;;
+      RCC*)
+       # Rational C++ 2.4.1
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+      cxx*)
+       allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+       archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+
+       hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+       hardcode_libdir_separator_CXX=:
+
+       # Commands to make compiler produce verbose output that lists
+       # what "hidden" libraries, object files and flags are used when
+       # linking a shared library.
+       #
+       # There doesn't appear to be a way to prevent this compiler from
+       # explicitly linking system object files so we need to strip them
+       # from the output so that they don't get included in the library
+       # dependencies.
+       output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+       ;;
+      *)
+       if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+         allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+         archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+
+         hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+         hardcode_libdir_separator_CXX=:
+
+         # Commands to make compiler produce verbose output that lists
+         # what "hidden" libraries, object files and flags are used when
+         # linking a shared library.
+         output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+       else
+         # FIXME: insert proper C++ library support
+         ld_shlibs_CXX=no
+       fi
+       ;;
+    esac
+    ;;
+  osf4* | osf5*)
+    case $cc_basename in
+      KCC*)
+       # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+       # KCC will only create a shared library if the output file
+       # ends with ".so" (or ".sl" for HP-UX), so rename the library
+       # to its proper name (with version) after linking.
+       archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+       hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+       hardcode_libdir_separator_CXX=:
+
+       # Archives containing C++ object files must be created using
+       # the KAI C++ compiler.
+       old_archive_cmds_CXX='$CC -o $oldlib $oldobjs'
+       ;;
+      RCC*)
+       # Rational C++ 2.4.1
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+      cxx*)
+       allow_undefined_flag_CXX=' -expect_unresolved \*'
+       archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+       archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+         echo "-hidden">> $lib.exp~
+         $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~
+         $rm $lib.exp'
+
+       hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+       hardcode_libdir_separator_CXX=:
+
+       # Commands to make compiler produce verbose output that lists
+       # what "hidden" libraries, object files and flags are used when
+       # linking a shared library.
+       #
+       # There doesn't appear to be a way to prevent this compiler from
+       # explicitly linking system object files so we need to strip them
+       # from the output so that they don't get included in the library
+       # dependencies.
+       output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+       ;;
+      *)
+       if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+         allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+        archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+
+         hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+         hardcode_libdir_separator_CXX=:
+
+         # Commands to make compiler produce verbose output that lists
+         # what "hidden" libraries, object files and flags are used when
+         # linking a shared library.
+         output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+       else
+         # FIXME: insert proper C++ library support
+         ld_shlibs_CXX=no
+       fi
+       ;;
+    esac
+    ;;
+  psos*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  sunos4*)
+    case $cc_basename in
+      CC*)
+       # Sun C++ 4.x
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+      lcc*)
+       # Lucid
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+      *)
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+    esac
+    ;;
+  solaris*)
+    case $cc_basename in
+      CC*)
+       # Sun C++ 4.2, 5.x and Centerline C++
+        archive_cmds_need_lc_CXX=yes
+       no_undefined_flag_CXX=' -zdefs'
+       archive_cmds_CXX='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+       archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+       $CC -G${allow_undefined_flag}  ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+       hardcode_libdir_flag_spec_CXX='-R$libdir'
+       hardcode_shlibpath_var_CXX=no
+       case $host_os in
+         solaris2.[0-5] | solaris2.[0-5].*) ;;
+         *)
+           # The C++ compiler is used as linker so we must use $wl
+           # flag to pass the commands to the underlying system
+           # linker. We must also pass each convience library through
+           # to the system linker between allextract/defaultextract.
+           # The C++ compiler will combine linker options so we
+           # cannot just pass the convience library names through
+           # without $wl.
+           # Supported since Solaris 2.6 (maybe 2.5.1?)
+           whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
+           ;;
+       esac
+       link_all_deplibs_CXX=yes
+
+       output_verbose_link_cmd='echo'
+
+       # Archives containing C++ object files must be created using
+       # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+       # necessary to make sure instantiated templates are included
+       # in the archive.
+       old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+       ;;
+      gcx*)
+       # Green Hills C++ Compiler
+       archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+       # The C++ compiler must be used to create the archive.
+       old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+       ;;
+      *)
+       # GNU C++ compiler with Solaris linker
+       if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+         no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
+         if $CC --version | grep -v '^2\.7' > /dev/null; then
+           archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+           archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+               $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+           # Commands to make compiler produce verbose output that lists
+           # what "hidden" libraries, object files and flags are used when
+           # linking a shared library.
+           output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+         else
+           # g++ 2.7 appears to require `-G' NOT `-shared' on this
+           # platform.
+           archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+           archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+               $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+           # Commands to make compiler produce verbose output that lists
+           # what "hidden" libraries, object files and flags are used when
+           # linking a shared library.
+           output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+         fi
+
+         hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
+       fi
+       ;;
+    esac
+    ;;
+  sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+    no_undefined_flag_CXX='${wl}-z,text'
+    archive_cmds_need_lc_CXX=no
+    hardcode_shlibpath_var_CXX=no
+    runpath_var='LD_RUN_PATH'
+
+    case $cc_basename in
+      CC*)
+       archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       ;;
+      *)
+       archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       ;;
+    esac
+    ;;
+  sysv5* | sco3.2v5* | sco5v6*)
+    # Note: We can NOT use -z defs as we might desire, because we do not
+    # link with -lc, and that would cause any symbols used from libc to
+    # always be unresolved, which means just about no library would
+    # ever link correctly.  If we're not using GNU ld we use -z text
+    # though, which does catch some bad symbols but isn't as heavy-handed
+    # as -z defs.
+    # For security reasons, it is highly recommended that you always
+    # use absolute paths for naming shared libraries, and exclude the
+    # DT_RUNPATH tag from executables and libraries.  But doing so
+    # requires that you compile everything twice, which is a pain.
+    # So that behaviour is only enabled if SCOABSPATH is set to a
+    # non-empty value in the environment.  Most likely only useful for
+    # creating official distributions of packages.
+    # This is a hack until libtool officially supports absolute path
+    # names for shared libraries.
+    no_undefined_flag_CXX='${wl}-z,text'
+    allow_undefined_flag_CXX='${wl}-z,nodefs'
+    archive_cmds_need_lc_CXX=no
+    hardcode_shlibpath_var_CXX=no
+    hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+    hardcode_libdir_separator_CXX=':'
+    link_all_deplibs_CXX=yes
+    export_dynamic_flag_spec_CXX='${wl}-Bexport'
+    runpath_var='LD_RUN_PATH'
+
+    case $cc_basename in
+      CC*)
+       archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+       ;;
+      *)
+       archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+       ;;
+    esac
+    ;;
+  tandem*)
+    case $cc_basename in
+      NCC*)
+       # NonStop-UX NCC 3.20
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+      *)
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+    esac
+    ;;
+  vxworks*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  *)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+esac
+echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+echo "${ECHO_T}$ld_shlibs_CXX" >&6
+test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+GCC_CXX="$GXX"
+LD_CXX="$LD"
+
+
+cat > conftest.$ac_ext <<EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+EOF
+
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Parse the compiler output and extract the necessary
+  # objects, libraries and library flags.
+
+  # Sentinel used to keep track of whether or not we are before
+  # the conftest object file.
+  pre_test_object_deps_done=no
+
+  # The `*' in the case matches for architectures that use `case' in
+  # $output_verbose_cmd can trigger glob expansion during the loop
+  # eval without this substitution.
+  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
+
+  for p in `eval $output_verbose_link_cmd`; do
+    case $p in
+
+    -L* | -R* | -l*)
+       # Some compilers place space between "-{L,R}" and the path.
+       # Remove the space.
+       if test $p = "-L" \
+         || test $p = "-R"; then
+        prev=$p
+        continue
+       else
+        prev=
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+        case $p in
+        -L* | -R*)
+          # Internal compiler library paths should come after those
+          # provided the user.  The postdeps already come after the
+          # user supplied libs so there is no need to process them.
+          if test -z "$compiler_lib_search_path_CXX"; then
+            compiler_lib_search_path_CXX="${prev}${p}"
+          else
+            compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}"
+          fi
+          ;;
+        # The "-l" case would never come before the object being
+        # linked, so don't bother handling this case.
+        esac
+       else
+        if test -z "$postdeps_CXX"; then
+          postdeps_CXX="${prev}${p}"
+        else
+          postdeps_CXX="${postdeps_CXX} ${prev}${p}"
+        fi
+       fi
+       ;;
+
+    *.$objext)
+       # This assumes that the test object file only shows up
+       # once in the compiler output.
+       if test "$p" = "conftest.$objext"; then
+        pre_test_object_deps_done=yes
+        continue
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+        if test -z "$predep_objects_CXX"; then
+          predep_objects_CXX="$p"
+        else
+          predep_objects_CXX="$predep_objects_CXX $p"
+        fi
+       else
+        if test -z "$postdep_objects_CXX"; then
+          postdep_objects_CXX="$p"
+        else
+          postdep_objects_CXX="$postdep_objects_CXX $p"
+        fi
+       fi
+       ;;
+
+    *) ;; # Ignore the rest.
+
+    esac
+  done
+
+  # Clean up.
+  rm -f a.out a.exe
+else
+  echo "libtool.m4: error: problem compiling CXX test program"
+fi
+
+$rm -f confest.$objext
+
+# PORTME: override above test on systems where it is broken
+case $host_os in
+interix3*)
+  # Interix 3.5 installs completely hosed .la files for C++, so rather than
+  # hack all around it, let's just trust "g++" to DTRT.
+  predep_objects_CXX=
+  postdep_objects_CXX=
+  postdeps_CXX=
+  ;;
+
+solaris*)
+  case $cc_basename in
+  CC*)
+    # Adding this requires a known-good setup of shared libraries for
+    # Sun compiler versions before 5.6, else PIC objects from an old
+    # archive will be linked into the output, leading to subtle bugs.
+    postdeps_CXX='-lCstd -lCrun'
+    ;;
+  esac
+  ;;
+esac
+
+
+case " $postdeps_CXX " in
+*" -lc "*) archive_cmds_need_lc_CXX=no ;;
+esac
+
+lt_prog_compiler_wl_CXX=
+lt_prog_compiler_pic_CXX=
+lt_prog_compiler_static_CXX=
+
+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+
+  # C++ specific cases for pic, static, wl, etc.
+  if test "$GXX" = yes; then
+    lt_prog_compiler_wl_CXX='-Wl,'
+    lt_prog_compiler_static_CXX='-static'
+
+    case $host_os in
+    aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       lt_prog_compiler_static_CXX='-Bstatic'
+      fi
+      ;;
+    amigaos*)
+      # FIXME: we need at least 68020 code to build shared libraries, but
+      # adding the `-m68020' flag to GCC prevents building anything better,
+      # like `-m68040'.
+      lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
+      ;;
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | os2* | pw32*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+      ;;
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_CXX='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      lt_prog_compiler_pic_CXX=
+      ;;
+    interix3*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       lt_prog_compiler_pic_CXX=-Kconform_pic
+      fi
+      ;;
+    hpux*)
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+       ;;
+      *)
+       lt_prog_compiler_pic_CXX='-fPIC'
+       ;;
+      esac
+      ;;
+    *)
+      lt_prog_compiler_pic_CXX='-fPIC'
+      ;;
+    esac
+  else
+    case $host_os in
+      aix4* | aix5*)
+       # All AIX code is PIC.
+       if test "$host_cpu" = ia64; then
+         # AIX 5 now supports IA64 processor
+         lt_prog_compiler_static_CXX='-Bstatic'
+       else
+         lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
+       fi
+       ;;
+      chorus*)
+       case $cc_basename in
+       cxch68*)
+         # Green Hills C++ Compiler
+         # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+         ;;
+       esac
+       ;;
+       darwin*)
+         # PIC is the default on this platform
+         # Common symbols not allowed in MH_DYLIB files
+         case $cc_basename in
+           xlc*)
+           lt_prog_compiler_pic_CXX='-qnocommon'
+           lt_prog_compiler_wl_CXX='-Wl,'
+           ;;
+         esac
+       ;;
+      dgux*)
+       case $cc_basename in
+         ec++*)
+           lt_prog_compiler_pic_CXX='-KPIC'
+           ;;
+         ghcx*)
+           # Green Hills C++ Compiler
+           lt_prog_compiler_pic_CXX='-pic'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      freebsd* | kfreebsd*-gnu | dragonfly*)
+       # FreeBSD uses GNU C++
+       ;;
+      hpux9* | hpux10* | hpux11*)
+       case $cc_basename in
+         CC*)
+           lt_prog_compiler_wl_CXX='-Wl,'
+           lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
+           if test "$host_cpu" != ia64; then
+             lt_prog_compiler_pic_CXX='+Z'
+           fi
+           ;;
+         aCC*)
+           lt_prog_compiler_wl_CXX='-Wl,'
+           lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
+           case $host_cpu in
+           hppa*64*|ia64*)
+             # +Z the default
+             ;;
+           *)
+             lt_prog_compiler_pic_CXX='+Z'
+             ;;
+           esac
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      interix*)
+       # This is c89, which is MS Visual C++ (no shared libs)
+       # Anyone wants to do a port?
+       ;;
+      irix5* | irix6* | nonstopux*)
+       case $cc_basename in
+         CC*)
+           lt_prog_compiler_wl_CXX='-Wl,'
+           lt_prog_compiler_static_CXX='-non_shared'
+           # CC pic flag -KPIC is the default.
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      linux*)
+       case $cc_basename in
+         KCC*)
+           # KAI C++ Compiler
+           lt_prog_compiler_wl_CXX='--backend -Wl,'
+           lt_prog_compiler_pic_CXX='-fPIC'
+           ;;
+         icpc* | ecpc*)
+           # Intel C++
+           lt_prog_compiler_wl_CXX='-Wl,'
+           lt_prog_compiler_pic_CXX='-KPIC'
+           lt_prog_compiler_static_CXX='-static'
+           ;;
+         pgCC*)
+           # Portland Group C++ compiler.
+           lt_prog_compiler_wl_CXX='-Wl,'
+           lt_prog_compiler_pic_CXX='-fpic'
+           lt_prog_compiler_static_CXX='-Bstatic'
+           ;;
+         cxx*)
+           # Compaq C++
+           # Make sure the PIC flag is empty.  It appears that all Alpha
+           # Linux and Compaq Tru64 Unix objects are PIC.
+           lt_prog_compiler_pic_CXX=
+           lt_prog_compiler_static_CXX='-non_shared'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      lynxos*)
+       ;;
+      m88k*)
+       ;;
+      mvs*)
+       case $cc_basename in
+         cxx*)
+           lt_prog_compiler_pic_CXX='-W c,exportall'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      netbsd*)
+       ;;
+      osf3* | osf4* | osf5*)
+       case $cc_basename in
+         KCC*)
+           lt_prog_compiler_wl_CXX='--backend -Wl,'
+           ;;
+         RCC*)
+           # Rational C++ 2.4.1
+           lt_prog_compiler_pic_CXX='-pic'
+           ;;
+         cxx*)
+           # Digital/Compaq C++
+           lt_prog_compiler_wl_CXX='-Wl,'
+           # Make sure the PIC flag is empty.  It appears that all Alpha
+           # Linux and Compaq Tru64 Unix objects are PIC.
+           lt_prog_compiler_pic_CXX=
+           lt_prog_compiler_static_CXX='-non_shared'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      psos*)
+       ;;
+      solaris*)
+       case $cc_basename in
+         CC*)
+           # Sun C++ 4.2, 5.x and Centerline C++
+           lt_prog_compiler_pic_CXX='-KPIC'
+           lt_prog_compiler_static_CXX='-Bstatic'
+           lt_prog_compiler_wl_CXX='-Qoption ld '
+           ;;
+         gcx*)
+           # Green Hills C++ Compiler
+           lt_prog_compiler_pic_CXX='-PIC'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      sunos4*)
+       case $cc_basename in
+         CC*)
+           # Sun C++ 4.x
+           lt_prog_compiler_pic_CXX='-pic'
+           lt_prog_compiler_static_CXX='-Bstatic'
+           ;;
+         lcc*)
+           # Lucid
+           lt_prog_compiler_pic_CXX='-pic'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      tandem*)
+       case $cc_basename in
+         NCC*)
+           # NonStop-UX NCC 3.20
+           lt_prog_compiler_pic_CXX='-KPIC'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+       case $cc_basename in
+         CC*)
+           lt_prog_compiler_wl_CXX='-Wl,'
+           lt_prog_compiler_pic_CXX='-KPIC'
+           lt_prog_compiler_static_CXX='-Bstatic'
+           ;;
+       esac
+       ;;
+      vxworks*)
+       ;;
+      *)
+       lt_prog_compiler_can_build_shared_CXX=no
+       ;;
+    esac
+  fi
+
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_CXX"; then
+
+echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6
+if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works_CXX=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:11787: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:11791: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_prog_compiler_pic_works_CXX=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6
+
+if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then
+    case $lt_prog_compiler_pic_CXX in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
+     esac
+else
+    lt_prog_compiler_pic_CXX=
+     lt_prog_compiler_can_build_shared_CXX=no
+fi
+
+fi
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_CXX=
+    ;;
+  *)
+    lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
+    ;;
+esac
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
+echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6
+if test "${lt_prog_compiler_static_works_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_static_works_CXX=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+   printf "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_prog_compiler_static_works_CXX=yes
+       fi
+     else
+       lt_prog_compiler_static_works_CXX=yes
+     fi
+   fi
+   $rm conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6
+
+if test x"$lt_prog_compiler_static_works_CXX" = xyes; then
+    :
+else
+    lt_prog_compiler_static_CXX=
+fi
+
+
+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o_CXX=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:11891: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:11895: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_CXX=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $rm conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
+   $rm out/* && rmdir out
+   cd ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+  hard_links=yes
+  $rm conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+
+  export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  case $host_os in
+  aix4* | aix5*)
+    # If we're using GNU nm, then we don't want the "-C" option.
+    # -C means demangle to AIX nm, but means don't demangle with GNU nm
+    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+    else
+      export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+    fi
+    ;;
+  pw32*)
+    export_symbols_cmds_CXX="$ltdll_cmds"
+  ;;
+  cygwin* | mingw*)
+    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  *)
+    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  esac
+
+echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+echo "${ECHO_T}$ld_shlibs_CXX" >&6
+test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_CXX" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_CXX=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_CXX in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl_CXX
+       pic_flag=$lt_prog_compiler_pic_CXX
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
+        allow_undefined_flag_CXX=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+         archive_cmds_need_lc_CXX=no
+        else
+         archive_cmds_need_lc_CXX=yes
+        fi
+        allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+if test "$GCC" = yes; then
+  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+    # if the path contains ";" then we assume it to be the separator
+    # otherwise default to the standard path separator (i.e. ":") - it is
+    # assumed that no part of a normal pathname contains ";" but that should
+    # okay in the real world where ";" in dirpaths is itself problematic.
+    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+  else
+    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+  fi
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix4* | aix5*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[01] | aix4.[01].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+          echo ' yes '
+          echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+       :
+      else
+       can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  library_names_spec='$libname.ixlibrary $libname.a'
+  # Create ${libname}_ixlibrary.a entries in /sys/libs.
+  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[45]*)
+  version_type=linux
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $rm \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+      if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+        # It is most probably a Windows format PATH printed by
+        # mingw gcc, but we are running on Cygwin. Gcc prints its search
+        # path with ; separators, and with drive letters. We can handle the
+        # drive letters (cygwin fileutils understands them), so leave them,
+        # especially as we might pass files found there to a mingw objdump,
+        # which wouldn't understand a cygwinified path. Ahh.
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    ;;
+
+  *)
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    ;;
+  esac
+  dynamic_linker='Win32 ld.exe'
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd1*)
+  dynamic_linker=no
+  ;;
+
+kfreebsd*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[123]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[01]* | freebsdelf3.[01]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  freebsd*) # from 4.6 on
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+   hppa*64*)
+     shrext_cmds='.sl'
+     hardcode_into_libs=yes
+     dynamic_linker="$host_os dld.sl"
+     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+     soname_spec='${libname}${release}${shared_ext}$major'
+     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+     ;;
+   *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555.
+  postinstall_cmds='chmod 555 $lib'
+  ;;
+
+interix3*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+       if test "$lt_cv_prog_gnu_ld" = yes; then
+               version_type=linux
+       else
+               version_type=irix
+       fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be Linux ELF.
+linux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # find out which ABI we are using
+  libsuff=
+  case "$host_cpu" in
+  x86_64*|s390x*|powerpc64*)
+    echo '#line 12427 "configure"' > conftest.$ac_ext
+    if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+      case `/usr/bin/file conftest.$ac_objext` in
+      *64-bit*)
+        libsuff=64
+        sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+        ;;
+      esac
+    fi
+    rm -rf conftest*
+    ;;
+  esac
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,   ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+knetbsd*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+nto-qnx*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+openbsd*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+    *)                         need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[89] | openbsd2.[89].*)
+       shlibpath_overrides_runpath=no
+       ;;
+      *)
+       shlibpath_overrides_runpath=yes
+       ;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+    shlibpath_overrides_runpath=no
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    shlibpath_overrides_runpath=yes
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+       ;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+hardcode_action_CXX=
+if test -n "$hardcode_libdir_flag_spec_CXX" || \
+   test -n "$runpath_var_CXX" || \
+   test "X$hardcode_automatic_CXX" = "Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct_CXX" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
+     test "$hardcode_minus_L_CXX" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_CXX=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_CXX=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_CXX=unsupported
+fi
+echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5
+echo "${ECHO_T}$hardcode_action_CXX" >&6
+
+if test "$hardcode_action_CXX" = relink; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # See if we are running on zsh, and set the options which allow our commands through
+  # without removal of \ escapes.
+  if test -n "${ZSH_VERSION+set}" ; then
+    setopt NO_GLOB_SUBST
+  fi
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_CXX \
+    CC_CXX \
+    LD_CXX \
+    lt_prog_compiler_wl_CXX \
+    lt_prog_compiler_pic_CXX \
+    lt_prog_compiler_static_CXX \
+    lt_prog_compiler_no_builtin_flag_CXX \
+    export_dynamic_flag_spec_CXX \
+    thread_safe_flag_spec_CXX \
+    whole_archive_flag_spec_CXX \
+    enable_shared_with_static_runtimes_CXX \
+    old_archive_cmds_CXX \
+    old_archive_from_new_cmds_CXX \
+    predep_objects_CXX \
+    postdep_objects_CXX \
+    predeps_CXX \
+    postdeps_CXX \
+    compiler_lib_search_path_CXX \
+    archive_cmds_CXX \
+    archive_expsym_cmds_CXX \
+    postinstall_cmds_CXX \
+    postuninstall_cmds_CXX \
+    old_archive_from_expsyms_cmds_CXX \
+    allow_undefined_flag_CXX \
+    no_undefined_flag_CXX \
+    export_symbols_cmds_CXX \
+    hardcode_libdir_flag_spec_CXX \
+    hardcode_libdir_flag_spec_ld_CXX \
+    hardcode_libdir_separator_CXX \
+    hardcode_automatic_CXX \
+    module_cmds_CXX \
+    module_expsym_cmds_CXX \
+    lt_cv_prog_compiler_c_o_CXX \
+    exclude_expsyms_CXX \
+    include_expsyms_CXX; do
+
+    case $var in
+    old_archive_cmds_CXX | \
+    old_archive_from_new_cmds_CXX | \
+    archive_cmds_CXX | \
+    archive_expsym_cmds_CXX | \
+    module_cmds_CXX | \
+    module_expsym_cmds_CXX | \
+    old_archive_from_expsyms_cmds_CXX | \
+    export_symbols_cmds_CXX | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_CXX
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
+# A language-specific compiler.
+CC=$lt_compiler_CXX
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_CXX
+
+gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\`
+gcc_ver=\`gcc -dumpversion\`
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_CXX
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_CXX
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_CXX
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_CXX
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_CXX
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_CXX
+archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_CXX
+module_expsym_cmds=$lt_module_expsym_cmds_CXX
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=\`echo $lt_predep_objects_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=\`echo $lt_postdep_objects_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_CXX
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_CXX
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_CXX
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_CXX
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_CXX
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_CXX
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_CXX
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_CXX
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_CXX
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_CXX"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_CXX
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_CXX
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_CXX
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_CXX
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC=$lt_save_CC
+LDCXX=$LD
+LD=$lt_save_LD
+GCC=$lt_save_GCC
+with_gnu_ldcxx=$with_gnu_ld
+with_gnu_ld=$lt_save_with_gnu_ld
+lt_cv_path_LDCXX=$lt_cv_path_LD
+lt_cv_path_LD=$lt_save_path_LD
+lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+
+       else
+         tagname=""
+       fi
+       ;;
+
+      F77)
+       if test -n "$F77" && test "X$F77" != "Xno"; then
+
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+
+
+archive_cmds_need_lc_F77=no
+allow_undefined_flag_F77=
+always_export_symbols_F77=no
+archive_expsym_cmds_F77=
+export_dynamic_flag_spec_F77=
+hardcode_direct_F77=no
+hardcode_libdir_flag_spec_F77=
+hardcode_libdir_flag_spec_ld_F77=
+hardcode_libdir_separator_F77=
+hardcode_minus_L_F77=no
+hardcode_automatic_F77=no
+module_cmds_F77=
+module_expsym_cmds_F77=
+link_all_deplibs_F77=unknown
+old_archive_cmds_F77=$old_archive_cmds
+no_undefined_flag_F77=
+whole_archive_flag_spec_F77=
+enable_shared_with_static_runtimes_F77=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+objext_F77=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="      program t\n      end\n"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${F77-"f77"}
+compiler=$CC
+compiler_F77=$CC
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+
+echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $can_build_shared" >&5
+echo "${ECHO_T}$can_build_shared" >&6
+
+echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case $host_os in
+aix3*)
+  test "$enable_shared" = yes && enable_static=no
+  if test -n "$RANLIB"; then
+    archive_cmds="$archive_cmds~\$RANLIB \$lib"
+    postinstall_cmds='$RANLIB $lib'
+  fi
+  ;;
+aix4* | aix5*)
+  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+    test "$enable_shared" = yes && enable_static=no
+  fi
+  ;;
+esac
+echo "$as_me:$LINENO: result: $enable_shared" >&5
+echo "${ECHO_T}$enable_shared" >&6
+
+echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+echo "$as_me:$LINENO: result: $enable_static" >&5
+echo "${ECHO_T}$enable_static" >&6
+
+GCC_F77="$G77"
+LD_F77="$LD"
+
+lt_prog_compiler_wl_F77=
+lt_prog_compiler_pic_F77=
+lt_prog_compiler_static_F77=
+
+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl_F77='-Wl,'
+    lt_prog_compiler_static_F77='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       lt_prog_compiler_static_F77='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      # FIXME: we need at least 68020 code to build shared libraries, but
+      # adding the `-m68020' flag to GCC prevents building anything better,
+      # like `-m68040'.
+      lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4'
+      ;;
+
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic_F77='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_F77='-fno-common'
+      ;;
+
+    interix3*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared_F77=no
+      enable_shared=no
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       lt_prog_compiler_pic_F77=-Kconform_pic
+      fi
+      ;;
+
+    hpux*)
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+       # +Z the default
+       ;;
+      *)
+       lt_prog_compiler_pic_F77='-fPIC'
+       ;;
+      esac
+      ;;
+
+    *)
+      lt_prog_compiler_pic_F77='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       lt_prog_compiler_static_F77='-Bstatic'
+      else
+       lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+      darwin*)
+        # PIC is the default on this platform
+        # Common symbols not allowed in MH_DYLIB files
+       case $cc_basename in
+         xlc*)
+         lt_prog_compiler_pic_F77='-qnocommon'
+         lt_prog_compiler_wl_F77='-Wl,'
+         ;;
+       esac
+       ;;
+
+    mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic_F77='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+       # +Z the default
+       ;;
+      *)
+       lt_prog_compiler_pic_F77='+Z'
+       ;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static_F77='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static_F77='-non_shared'
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    linux*)
+      case $cc_basename in
+      icc* | ecc*)
+       lt_prog_compiler_wl_F77='-Wl,'
+       lt_prog_compiler_pic_F77='-KPIC'
+       lt_prog_compiler_static_F77='-static'
+        ;;
+      pgcc* | pgf77* | pgf90* | pgf95*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+       # which looks to be a dead project)
+       lt_prog_compiler_wl_F77='-Wl,'
+       lt_prog_compiler_pic_F77='-fpic'
+       lt_prog_compiler_static_F77='-Bstatic'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl_F77='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static_F77='-non_shared'
+        ;;
+      esac
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static_F77='-non_shared'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+       lt_prog_compiler_wl_F77='-Qoption ld ';;
+      *)
+       lt_prog_compiler_wl_F77='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl_F77='-Qoption ld '
+      lt_prog_compiler_pic_F77='-PIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+       lt_prog_compiler_pic_F77='-Kconform_pic'
+       lt_prog_compiler_static_F77='-Bstatic'
+      fi
+      ;;
+
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    unicos*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      lt_prog_compiler_can_build_shared_F77=no
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic_F77='-pic'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared_F77=no
+      ;;
+    esac
+  fi
+
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_F77"; then
+
+echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6
+if test "${lt_prog_compiler_pic_works_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works_F77=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_F77"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:13485: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:13489: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_prog_compiler_pic_works_F77=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6
+
+if test x"$lt_prog_compiler_pic_works_F77" = xyes; then
+    case $lt_prog_compiler_pic_F77 in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;;
+     esac
+else
+    lt_prog_compiler_pic_F77=
+     lt_prog_compiler_can_build_shared_F77=no
+fi
+
+fi
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_F77=
+    ;;
+  *)
+    lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77"
+    ;;
+esac
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\"
+echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6
+if test "${lt_prog_compiler_static_works_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_static_works_F77=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+   printf "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_prog_compiler_static_works_F77=yes
+       fi
+     else
+       lt_prog_compiler_static_works_F77=yes
+     fi
+   fi
+   $rm conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5
+echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6
+
+if test x"$lt_prog_compiler_static_works_F77" = xyes; then
+    :
+else
+    lt_prog_compiler_static_F77=
+fi
+
+
+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o_F77=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:13589: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:13593: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_F77=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $rm conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
+   $rm out/* && rmdir out
+   cd ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+  hard_links=yes
+  $rm conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+
+  runpath_var=
+  allow_undefined_flag_F77=
+  enable_shared_with_static_runtimes_F77=no
+  archive_cmds_F77=
+  archive_expsym_cmds_F77=
+  old_archive_From_new_cmds_F77=
+  old_archive_from_expsyms_cmds_F77=
+  export_dynamic_flag_spec_F77=
+  whole_archive_flag_spec_F77=
+  thread_safe_flag_spec_F77=
+  hardcode_libdir_flag_spec_F77=
+  hardcode_libdir_flag_spec_ld_F77=
+  hardcode_libdir_separator_F77=
+  hardcode_direct_F77=no
+  hardcode_minus_L_F77=no
+  hardcode_shlibpath_var_F77=unsupported
+  link_all_deplibs_F77=unknown
+  hardcode_automatic_F77=no
+  module_cmds_F77=
+  module_expsym_cmds_F77=
+  always_export_symbols_F77=no
+  export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms_F77=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_"
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  extract_expsyms_cmds=
+  # Just being paranoid about ensuring that cc_basename is set.
+  for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs_F77=yes
+  if test "$with_gnu_ld" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec_F77='${wl}--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+       whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+       whole_archive_flag_spec_F77=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>/dev/null` in
+      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+       ld_shlibs_F77=no
+       cat <<EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_minus_L_F77=yes
+
+      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      ld_shlibs_F77=no
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       allow_undefined_flag_F77=unsupported
+       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+       # support --undefined.  This deserves some investigation.  FIXME
+       archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+       ld_shlibs_F77=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      allow_undefined_flag_F77=unsupported
+      always_export_symbols_F77=no
+      enable_shared_with_static_runtimes_F77=yes
+      export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+        archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+       # If the export-symbols file already is a .def file (1st line
+       # is EXPORTS), use it as is; otherwise, prepend...
+       archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+         cp $export_symbols $output_objdir/$soname.def;
+       else
+         echo EXPORTS > $output_objdir/$soname.def;
+         cat $export_symbols >> $output_objdir/$soname.def;
+       fi~
+       $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      else
+       ld_shlibs_F77=no
+      fi
+      ;;
+
+    interix3*)
+      hardcode_direct_F77=no
+      hardcode_shlibpath_var_F77=no
+      hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+      export_dynamic_flag_spec_F77='${wl}-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
+
+    linux*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       tmp_addflag=
+       case $cc_basename,$host_cpu in
+       pgcc*)                          # Portland Group C compiler
+         whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag'
+         ;;
+       pgf77* | pgf90* | pgf95*)       # Portland Group f77 and f90 compilers
+         whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag -Mnomain' ;;
+       ecc*,ia64* | icc*,ia64*)                # Intel C compiler on ia64
+         tmp_addflag=' -i_dynamic' ;;
+       efc*,ia64* | ifort*,ia64*)      # Intel Fortran compiler on ia64
+         tmp_addflag=' -i_dynamic -nofor_main' ;;
+       ifc* | ifort*)                  # Intel Fortran compiler
+         tmp_addflag=' -nofor_main' ;;
+       esac
+       archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+       if test $supports_anon_versioning = yes; then
+         archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~
+  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+  $echo "local: *; };" >> $output_objdir/$libname.ver~
+         $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+       fi
+      else
+       ld_shlibs_F77=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+       archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+       wlarc=
+      else
+       archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+       ld_shlibs_F77=no
+       cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       ld_shlibs_F77=no
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+       ld_shlibs_F77=no
+       cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+       ;;
+       *)
+         if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+           hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+           archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
+           archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
+         else
+           ld_shlibs_F77=no
+         fi
+       ;;
+      esac
+      ;;
+
+    sunos4*)
+      archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       ld_shlibs_F77=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs_F77" = no; then
+      runpath_var=
+      hardcode_libdir_flag_spec_F77=
+      export_dynamic_flag_spec_F77=
+      whole_archive_flag_spec_F77=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag_F77=unsupported
+      always_export_symbols_F77=yes
+      archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      hardcode_minus_L_F77=yes
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+       # Neither direct hardcoding nor static linking is supported with a
+       # broken collect2.
+       hardcode_direct_F77=unsupported
+      fi
+      ;;
+
+    aix4* | aix5*)
+      if test "$host_cpu" = ia64; then
+       # On IA64, the linker does run time linking by default, so we don't
+       # have to do anything special.
+       aix_use_runtimelinking=no
+       exp_sym_flag='-Bexport'
+       no_entry_flag=""
+      else
+       # If we're using GNU nm, then we don't want the "-C" option.
+       # -C means demangle to AIX nm, but means don't demangle with GNU nm
+       if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+         export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+       else
+         export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+       fi
+       aix_use_runtimelinking=no
+
+       # Test if we are trying to use run time linking or normal
+       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+       # need to do runtime linking.
+       case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+         for ld_flag in $LDFLAGS; do
+         if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+           aix_use_runtimelinking=yes
+           break
+         fi
+         done
+         ;;
+       esac
+
+       exp_sym_flag='-bexport'
+       no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      archive_cmds_F77=''
+      hardcode_direct_F77=yes
+      hardcode_libdir_separator_F77=':'
+      link_all_deplibs_F77=yes
+
+      if test "$GCC" = yes; then
+       case $host_os in aix4.[012]|aix4.[012].*)
+       # We only want to do this on AIX 4.2 and lower, the check
+       # below for broken collect2 doesn't work under 4.3+
+         collect2name=`${CC} -print-prog-name=collect2`
+         if test -f "$collect2name" && \
+          strings "$collect2name" | grep resolve_lib_name >/dev/null
+         then
+         # We have reworked collect2
+         hardcode_direct_F77=yes
+         else
+         # We have old collect2
+         hardcode_direct_F77=unsupported
+         # It fails to find uninstalled libraries when the uninstalled
+         # path is not listed in the libpath.  Setting hardcode_minus_L
+         # to unsupported forces relinking
+         hardcode_minus_L_F77=yes
+         hardcode_libdir_flag_spec_F77='-L$libdir'
+         hardcode_libdir_separator_F77=
+         fi
+         ;;
+       esac
+       shared_flag='-shared'
+       if test "$aix_use_runtimelinking" = yes; then
+         shared_flag="$shared_flag "'${wl}-G'
+       fi
+      else
+       # not using gcc
+       if test "$host_cpu" = ia64; then
+       # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+       # chokes on -Wl,-G. The following line is correct:
+         shared_flag='-G'
+       else
+         if test "$aix_use_runtimelinking" = yes; then
+           shared_flag='${wl}-G'
+         else
+           shared_flag='${wl}-bM:SRE'
+         fi
+       fi
+      fi
+
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols_F77=yes
+      if test "$aix_use_runtimelinking" = yes; then
+       # Warning - without using the other runtime loading flags (-brtl),
+       # -berok will link without error, but may produce a broken library.
+       allow_undefined_flag_F77='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+       cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_f77_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+       hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
+       archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+       if test "$host_cpu" = ia64; then
+         hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib'
+         allow_undefined_flag_F77="-z nodefs"
+         archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+       else
+        # Determine the default libpath from the value encoded in an empty executable.
+        cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_f77_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+        hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
+         # Warning - without using the other run time loading flags,
+         # -berok will link without error, but may produce a broken library.
+         no_undefined_flag_F77=' ${wl}-bernotok'
+         allow_undefined_flag_F77=' ${wl}-berok'
+         # Exported symbols can be pulled into shared objects from archives
+         whole_archive_flag_spec_F77='$convenience'
+         archive_cmds_need_lc_F77=yes
+         # This is similar to how AIX traditionally builds its shared libraries.
+         archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+       fi
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_minus_L_F77=yes
+      # see comment about different semantics on the GNU ld section
+      ld_shlibs_F77=no
+      ;;
+
+    bsdi[45]*)
+      export_dynamic_flag_spec_F77=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      hardcode_libdir_flag_spec_F77=' '
+      allow_undefined_flag_F77=unsupported
+      # Tell ltmain to make .lib files, not .a files.
+      libext=lib
+      # Tell ltmain to make .dll files, not .so files.
+      shrext_cmds=".dll"
+      # FIXME: Setting linknames here is a bad hack.
+      archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      old_archive_From_new_cmds_F77='true'
+      # FIXME: Should let the user specify the lib program.
+      old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path_F77='`cygpath -w "$srcfile"`'
+      enable_shared_with_static_runtimes_F77=yes
+      ;;
+
+    darwin* | rhapsody*)
+      case $host_os in
+        rhapsody* | darwin1.[012])
+         allow_undefined_flag_F77='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[012])
+               allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+      esac
+      archive_cmds_need_lc_F77=no
+      hardcode_direct_F77=no
+      hardcode_automatic_F77=yes
+      hardcode_shlibpath_var_F77=unsupported
+      whole_archive_flag_spec_F77=''
+      link_all_deplibs_F77=yes
+    if test "$GCC" = yes ; then
+       output_verbose_link_cmd='echo'
+        archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+      archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+         archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+         module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+         archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         ld_shlibs_F77=no
+          ;;
+      esac
+    fi
+      ;;
+
+    dgux*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    freebsd1*)
+      ld_shlibs_F77=no
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_F77=yes
+      hardcode_minus_L_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu | dragonfly*)
+      archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+       archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+       archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      fi
+      hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      hardcode_direct_F77=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L_F77=yes
+      export_dynamic_flag_spec_F77='${wl}-E'
+      ;;
+
+    hpux10*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+       archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test "$with_gnu_ld" = no; then
+       hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+       hardcode_libdir_separator_F77=:
+
+       hardcode_direct_F77=yes
+       export_dynamic_flag_spec_F77='${wl}-E'
+
+       # hardcode_minus_L: Not really in the search PATH,
+       # but as the default location of the library.
+       hardcode_minus_L_F77=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+       case $host_cpu in
+       hppa*64*)
+         archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       ia64*)
+         archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+         archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       esac
+      else
+       case $host_cpu in
+       hppa*64*)
+         archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       ia64*)
+         archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+         archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       esac
+      fi
+      if test "$with_gnu_ld" = no; then
+       hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+       hardcode_libdir_separator_F77=:
+
+       case $host_cpu in
+       hppa*64*|ia64*)
+         hardcode_libdir_flag_spec_ld_F77='+b $libdir'
+         hardcode_direct_F77=no
+         hardcode_shlibpath_var_F77=no
+         ;;
+       *)
+         hardcode_direct_F77=yes
+         export_dynamic_flag_spec_F77='${wl}-E'
+
+         # hardcode_minus_L: Not really in the search PATH,
+         # but as the default location of the library.
+         hardcode_minus_L_F77=yes
+         ;;
+       esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+       archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+       archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+       hardcode_libdir_flag_spec_ld_F77='-rpath $libdir'
+      fi
+      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      link_all_deplibs_F77=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+       archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+       archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    newsos6)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_F77=yes
+      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    openbsd*)
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+       archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+       hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+       export_dynamic_flag_spec_F77='${wl}-E'
+      else
+       case $host_os in
+        openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+          archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+          hardcode_libdir_flag_spec_F77='-R$libdir'
+          ;;
+        *)
+          archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+          hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+          ;;
+       esac
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_minus_L_F77=yes
+      allow_undefined_flag_F77=unsupported
+      archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+       allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
+       archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+       allow_undefined_flag_F77=' -expect_unresolved \*'
+       archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      ;;
+
+    osf4* | osf5*)     # as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+       allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
+       archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+       hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      else
+       allow_undefined_flag_F77=' -expect_unresolved \*'
+       archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+       archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+       $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+
+       # Both c and cxx compiler support -rpath directly
+       hardcode_libdir_flag_spec_F77='-rpath $libdir'
+      fi
+      hardcode_libdir_separator_F77=:
+      ;;
+
+    solaris*)
+      no_undefined_flag_F77=' -z text'
+      if test "$GCC" = yes; then
+       wlarc='${wl}'
+       archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+         $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+      else
+       wlarc=''
+       archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+       archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+       $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+      fi
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_shlibpath_var_F77=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *)
+       # The compiler driver will combine linker options so we
+       # cannot just pass the convience library names through
+       # without $wl, iff we do not link with $LD.
+       # Luckily, gcc supports the same syntax we need for Sun Studio.
+       # Supported since Solaris 2.6 (maybe 2.5.1?)
+       case $wlarc in
+       '')
+         whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;;
+       *)
+         whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+       esac ;;
+      esac
+      link_all_deplibs_F77=yes
+      ;;
+
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+       # Use $CC to link under sequent, because it throws in some extra .o
+       # files that make .init and .fini sections work.
+       archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_direct_F77=yes
+      hardcode_minus_L_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+       sni)
+         archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         hardcode_direct_F77=yes # is this really true???
+       ;;
+       siemens)
+         ## LD is ld it makes a PLAMLIB
+         ## CC just makes a GrossModule.
+         archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+         reload_cmds_F77='$CC -r -o $output$reload_objs'
+         hardcode_direct_F77=no
+        ;;
+       motorola)
+         archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie
+       ;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_F77=no
+      export_dynamic_flag_spec_F77='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+       hardcode_shlibpath_var_F77=no
+       runpath_var=LD_RUN_PATH
+       hardcode_runpath_var=yes
+       ld_shlibs_F77=yes
+      fi
+      ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
+      no_undefined_flag_F77='${wl}-z,text'
+      archive_cmds_need_lc_F77=no
+      hardcode_shlibpath_var_F77=no
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+       archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We can NOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      no_undefined_flag_F77='${wl}-z,text'
+      allow_undefined_flag_F77='${wl}-z,nodefs'
+      archive_cmds_need_lc_F77=no
+      hardcode_shlibpath_var_F77=no
+      hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+      hardcode_libdir_separator_F77=':'
+      link_all_deplibs_F77=yes
+      export_dynamic_flag_spec_F77='${wl}-Bexport'
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+       archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    uts4*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    *)
+      ld_shlibs_F77=no
+      ;;
+    esac
+  fi
+
+echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5
+echo "${ECHO_T}$ld_shlibs_F77" >&6
+test "$ld_shlibs_F77" = no && can_build_shared=no
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_F77" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_F77=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_F77 in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl_F77
+       pic_flag=$lt_prog_compiler_pic_F77
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag_F77
+        allow_undefined_flag_F77=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+         archive_cmds_need_lc_F77=no
+        else
+         archive_cmds_need_lc_F77=yes
+        fi
+        allow_undefined_flag_F77=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+if test "$GCC" = yes; then
+  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+    # if the path contains ";" then we assume it to be the separator
+    # otherwise default to the standard path separator (i.e. ":") - it is
+    # assumed that no part of a normal pathname contains ";" but that should
+    # okay in the real world where ";" in dirpaths is itself problematic.
+    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+  else
+    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+  fi
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix4* | aix5*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[01] | aix4.[01].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+          echo ' yes '
+          echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+       :
+      else
+       can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  library_names_spec='$libname.ixlibrary $libname.a'
+  # Create ${libname}_ixlibrary.a entries in /sys/libs.
+  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[45]*)
+  version_type=linux
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $rm \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+      if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+        # It is most probably a Windows format PATH printed by
+        # mingw gcc, but we are running on Cygwin. Gcc prints its search
+        # path with ; separators, and with drive letters. We can handle the
+        # drive letters (cygwin fileutils understands them), so leave them,
+        # especially as we might pass files found there to a mingw objdump,
+        # which wouldn't understand a cygwinified path. Ahh.
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    ;;
+
+  *)
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    ;;
+  esac
+  dynamic_linker='Win32 ld.exe'
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd1*)
+  dynamic_linker=no
+  ;;
+
+kfreebsd*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[123]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[01]* | freebsdelf3.[01]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  freebsd*) # from 4.6 on
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+   hppa*64*)
+     shrext_cmds='.sl'
+     hardcode_into_libs=yes
+     dynamic_linker="$host_os dld.sl"
+     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+     soname_spec='${libname}${release}${shared_ext}$major'
+     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+     ;;
+   *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555.
+  postinstall_cmds='chmod 555 $lib'
+  ;;
+
+interix3*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+       if test "$lt_cv_prog_gnu_ld" = yes; then
+               version_type=linux
+       else
+               version_type=irix
+       fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be Linux ELF.
+linux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # find out which ABI we are using
+  libsuff=
+  case "$host_cpu" in
+  x86_64*|s390x*|powerpc64*)
+    echo '#line 15038 "configure"' > conftest.$ac_ext
+    if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+      case `/usr/bin/file conftest.$ac_objext` in
+      *64-bit*)
+        libsuff=64
+        sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+        ;;
+      esac
+    fi
+    rm -rf conftest*
+    ;;
+  esac
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,   ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+knetbsd*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+nto-qnx*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+openbsd*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+    *)                         need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[89] | openbsd2.[89].*)
+       shlibpath_overrides_runpath=no
+       ;;
+      *)
+       shlibpath_overrides_runpath=yes
+       ;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+    shlibpath_overrides_runpath=no
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    shlibpath_overrides_runpath=yes
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+       ;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+hardcode_action_F77=
+if test -n "$hardcode_libdir_flag_spec_F77" || \
+   test -n "$runpath_var_F77" || \
+   test "X$hardcode_automatic_F77" = "Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct_F77" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no &&
+     test "$hardcode_minus_L_F77" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_F77=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_F77=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_F77=unsupported
+fi
+echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5
+echo "${ECHO_T}$hardcode_action_F77" >&6
+
+if test "$hardcode_action_F77" = relink; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # See if we are running on zsh, and set the options which allow our commands through
+  # without removal of \ escapes.
+  if test -n "${ZSH_VERSION+set}" ; then
+    setopt NO_GLOB_SUBST
+  fi
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_F77 \
+    CC_F77 \
+    LD_F77 \
+    lt_prog_compiler_wl_F77 \
+    lt_prog_compiler_pic_F77 \
+    lt_prog_compiler_static_F77 \
+    lt_prog_compiler_no_builtin_flag_F77 \
+    export_dynamic_flag_spec_F77 \
+    thread_safe_flag_spec_F77 \
+    whole_archive_flag_spec_F77 \
+    enable_shared_with_static_runtimes_F77 \
+    old_archive_cmds_F77 \
+    old_archive_from_new_cmds_F77 \
+    predep_objects_F77 \
+    postdep_objects_F77 \
+    predeps_F77 \
+    postdeps_F77 \
+    compiler_lib_search_path_F77 \
+    archive_cmds_F77 \
+    archive_expsym_cmds_F77 \
+    postinstall_cmds_F77 \
+    postuninstall_cmds_F77 \
+    old_archive_from_expsyms_cmds_F77 \
+    allow_undefined_flag_F77 \
+    no_undefined_flag_F77 \
+    export_symbols_cmds_F77 \
+    hardcode_libdir_flag_spec_F77 \
+    hardcode_libdir_flag_spec_ld_F77 \
+    hardcode_libdir_separator_F77 \
+    hardcode_automatic_F77 \
+    module_cmds_F77 \
+    module_expsym_cmds_F77 \
+    lt_cv_prog_compiler_c_o_F77 \
+    exclude_expsyms_F77 \
+    include_expsyms_F77; do
+
+    case $var in
+    old_archive_cmds_F77 | \
+    old_archive_from_new_cmds_F77 | \
+    archive_cmds_F77 | \
+    archive_expsym_cmds_F77 | \
+    module_cmds_F77 | \
+    module_expsym_cmds_F77 | \
+    old_archive_from_expsyms_cmds_F77 | \
+    export_symbols_cmds_F77 | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_F77
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
+# A language-specific compiler.
+CC=$lt_compiler_F77
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_F77
+
+gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\`
+gcc_ver=\`gcc -dumpversion\`
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_F77
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_F77
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_F77
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_F77
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_F77
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_F77
+archive_expsym_cmds=$lt_archive_expsym_cmds_F77
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_F77
+module_expsym_cmds=$lt_module_expsym_cmds_F77
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=\`echo $lt_predep_objects_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=\`echo $lt_postdep_objects_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_F77
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_F77
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_F77
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_F77
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_F77
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_F77
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_F77
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_F77
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_F77
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_F77
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_F77"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_F77
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_F77
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_F77
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_F77
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+       else
+         tagname=""
+       fi
+       ;;
+
+      GCJ)
+       if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
+
+
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+objext_GCJ=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${GCJ-"gcj"}
+compiler=$CC
+compiler_GCJ=$CC
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+archive_cmds_need_lc_GCJ=no
+
+old_archive_cmds_GCJ=$old_archive_cmds
+
+
+lt_prog_compiler_no_builtin_flag_GCJ=
+
+if test "$GCC" = yes; then
+  lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin'
+
+
+echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_rtti_exceptions=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="-fno-rtti -fno-exceptions"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:15816: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:15820: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_rtti_exceptions=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+    lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions"
+else
+    :
+fi
+
+fi
+
+lt_prog_compiler_wl_GCJ=
+lt_prog_compiler_pic_GCJ=
+lt_prog_compiler_static_GCJ=
+
+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl_GCJ='-Wl,'
+    lt_prog_compiler_static_GCJ='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       lt_prog_compiler_static_GCJ='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      # FIXME: we need at least 68020 code to build shared libraries, but
+      # adding the `-m68020' flag to GCC prevents building anything better,
+      # like `-m68040'.
+      lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4'
+      ;;
+
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_GCJ='-fno-common'
+      ;;
+
+    interix3*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared_GCJ=no
+      enable_shared=no
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       lt_prog_compiler_pic_GCJ=-Kconform_pic
+      fi
+      ;;
+
+    hpux*)
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+       # +Z the default
+       ;;
+      *)
+       lt_prog_compiler_pic_GCJ='-fPIC'
+       ;;
+      esac
+      ;;
+
+    *)
+      lt_prog_compiler_pic_GCJ='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       lt_prog_compiler_static_GCJ='-Bstatic'
+      else
+       lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+      darwin*)
+        # PIC is the default on this platform
+        # Common symbols not allowed in MH_DYLIB files
+       case $cc_basename in
+         xlc*)
+         lt_prog_compiler_pic_GCJ='-qnocommon'
+         lt_prog_compiler_wl_GCJ='-Wl,'
+         ;;
+       esac
+       ;;
+
+    mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+       # +Z the default
+       ;;
+      *)
+       lt_prog_compiler_pic_GCJ='+Z'
+       ;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static_GCJ='-non_shared'
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic_GCJ='-KPIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    linux*)
+      case $cc_basename in
+      icc* | ecc*)
+       lt_prog_compiler_wl_GCJ='-Wl,'
+       lt_prog_compiler_pic_GCJ='-KPIC'
+       lt_prog_compiler_static_GCJ='-static'
+        ;;
+      pgcc* | pgf77* | pgf90* | pgf95*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+       # which looks to be a dead project)
+       lt_prog_compiler_wl_GCJ='-Wl,'
+       lt_prog_compiler_pic_GCJ='-fpic'
+       lt_prog_compiler_static_GCJ='-Bstatic'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl_GCJ='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static_GCJ='-non_shared'
+        ;;
+      esac
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static_GCJ='-non_shared'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_pic_GCJ='-KPIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+       lt_prog_compiler_wl_GCJ='-Qoption ld ';;
+      *)
+       lt_prog_compiler_wl_GCJ='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl_GCJ='-Qoption ld '
+      lt_prog_compiler_pic_GCJ='-PIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      lt_prog_compiler_pic_GCJ='-KPIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+       lt_prog_compiler_pic_GCJ='-Kconform_pic'
+       lt_prog_compiler_static_GCJ='-Bstatic'
+      fi
+      ;;
+
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      lt_prog_compiler_pic_GCJ='-KPIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    unicos*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      lt_prog_compiler_can_build_shared_GCJ=no
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic_GCJ='-pic'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared_GCJ=no
+      ;;
+    esac
+  fi
+
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_GCJ"; then
+
+echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6
+if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works_GCJ=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_GCJ"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:16084: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:16088: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_prog_compiler_pic_works_GCJ=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6
+
+if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then
+    case $lt_prog_compiler_pic_GCJ in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;;
+     esac
+else
+    lt_prog_compiler_pic_GCJ=
+     lt_prog_compiler_can_build_shared_GCJ=no
+fi
+
+fi
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_GCJ=
+    ;;
+  *)
+    lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ"
+    ;;
+esac
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\"
+echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6
+if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_static_works_GCJ=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+   printf "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_prog_compiler_static_works_GCJ=yes
+       fi
+     else
+       lt_prog_compiler_static_works_GCJ=yes
+     fi
+   fi
+   $rm conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5
+echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6
+
+if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then
+    :
+else
+    lt_prog_compiler_static_GCJ=
+fi
+
+
+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o_GCJ=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:16188: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:16192: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_GCJ=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $rm conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
+   $rm out/* && rmdir out
+   cd ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+  hard_links=yes
+  $rm conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+
+  runpath_var=
+  allow_undefined_flag_GCJ=
+  enable_shared_with_static_runtimes_GCJ=no
+  archive_cmds_GCJ=
+  archive_expsym_cmds_GCJ=
+  old_archive_From_new_cmds_GCJ=
+  old_archive_from_expsyms_cmds_GCJ=
+  export_dynamic_flag_spec_GCJ=
+  whole_archive_flag_spec_GCJ=
+  thread_safe_flag_spec_GCJ=
+  hardcode_libdir_flag_spec_GCJ=
+  hardcode_libdir_flag_spec_ld_GCJ=
+  hardcode_libdir_separator_GCJ=
+  hardcode_direct_GCJ=no
+  hardcode_minus_L_GCJ=no
+  hardcode_shlibpath_var_GCJ=unsupported
+  link_all_deplibs_GCJ=unknown
+  hardcode_automatic_GCJ=no
+  module_cmds_GCJ=
+  module_expsym_cmds_GCJ=
+  always_export_symbols_GCJ=no
+  export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms_GCJ=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_"
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  extract_expsyms_cmds=
+  # Just being paranoid about ensuring that cc_basename is set.
+  for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs_GCJ=yes
+  if test "$with_gnu_ld" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec_GCJ='${wl}--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+       whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+       whole_archive_flag_spec_GCJ=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>/dev/null` in
+      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+       ld_shlibs_GCJ=no
+       cat <<EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_minus_L_GCJ=yes
+
+      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      ld_shlibs_GCJ=no
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       allow_undefined_flag_GCJ=unsupported
+       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+       # support --undefined.  This deserves some investigation.  FIXME
+       archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+       ld_shlibs_GCJ=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      allow_undefined_flag_GCJ=unsupported
+      always_export_symbols_GCJ=no
+      enable_shared_with_static_runtimes_GCJ=yes
+      export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+        archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+       # If the export-symbols file already is a .def file (1st line
+       # is EXPORTS), use it as is; otherwise, prepend...
+       archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+         cp $export_symbols $output_objdir/$soname.def;
+       else
+         echo EXPORTS > $output_objdir/$soname.def;
+         cat $export_symbols >> $output_objdir/$soname.def;
+       fi~
+       $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      else
+       ld_shlibs_GCJ=no
+      fi
+      ;;
+
+    interix3*)
+      hardcode_direct_GCJ=no
+      hardcode_shlibpath_var_GCJ=no
+      hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
+      export_dynamic_flag_spec_GCJ='${wl}-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
+
+    linux*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       tmp_addflag=
+       case $cc_basename,$host_cpu in
+       pgcc*)                          # Portland Group C compiler
+         whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag'
+         ;;
+       pgf77* | pgf90* | pgf95*)       # Portland Group f77 and f90 compilers
+         whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag -Mnomain' ;;
+       ecc*,ia64* | icc*,ia64*)                # Intel C compiler on ia64
+         tmp_addflag=' -i_dynamic' ;;
+       efc*,ia64* | ifort*,ia64*)      # Intel Fortran compiler on ia64
+         tmp_addflag=' -i_dynamic -nofor_main' ;;
+       ifc* | ifort*)                  # Intel Fortran compiler
+         tmp_addflag=' -nofor_main' ;;
+       esac
+       archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+       if test $supports_anon_versioning = yes; then
+         archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~
+  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+  $echo "local: *; };" >> $output_objdir/$libname.ver~
+         $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+       fi
+      else
+       ld_shlibs_GCJ=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+       archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+       wlarc=
+      else
+       archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+       ld_shlibs_GCJ=no
+       cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       ld_shlibs_GCJ=no
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+       ld_shlibs_GCJ=no
+       cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+       ;;
+       *)
+         if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+           hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+           archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
+           archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
+         else
+           ld_shlibs_GCJ=no
+         fi
+       ;;
+      esac
+      ;;
+
+    sunos4*)
+      archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       ld_shlibs_GCJ=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs_GCJ" = no; then
+      runpath_var=
+      hardcode_libdir_flag_spec_GCJ=
+      export_dynamic_flag_spec_GCJ=
+      whole_archive_flag_spec_GCJ=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag_GCJ=unsupported
+      always_export_symbols_GCJ=yes
+      archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      hardcode_minus_L_GCJ=yes
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+       # Neither direct hardcoding nor static linking is supported with a
+       # broken collect2.
+       hardcode_direct_GCJ=unsupported
+      fi
+      ;;
+
+    aix4* | aix5*)
+      if test "$host_cpu" = ia64; then
+       # On IA64, the linker does run time linking by default, so we don't
+       # have to do anything special.
+       aix_use_runtimelinking=no
+       exp_sym_flag='-Bexport'
+       no_entry_flag=""
+      else
+       # If we're using GNU nm, then we don't want the "-C" option.
+       # -C means demangle to AIX nm, but means don't demangle with GNU nm
+       if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+         export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+       else
+         export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+       fi
+       aix_use_runtimelinking=no
+
+       # Test if we are trying to use run time linking or normal
+       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+       # need to do runtime linking.
+       case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+         for ld_flag in $LDFLAGS; do
+         if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+           aix_use_runtimelinking=yes
+           break
+         fi
+         done
+         ;;
+       esac
+
+       exp_sym_flag='-bexport'
+       no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      archive_cmds_GCJ=''
+      hardcode_direct_GCJ=yes
+      hardcode_libdir_separator_GCJ=':'
+      link_all_deplibs_GCJ=yes
+
+      if test "$GCC" = yes; then
+       case $host_os in aix4.[012]|aix4.[012].*)
+       # We only want to do this on AIX 4.2 and lower, the check
+       # below for broken collect2 doesn't work under 4.3+
+         collect2name=`${CC} -print-prog-name=collect2`
+         if test -f "$collect2name" && \
+          strings "$collect2name" | grep resolve_lib_name >/dev/null
+         then
+         # We have reworked collect2
+         hardcode_direct_GCJ=yes
+         else
+         # We have old collect2
+         hardcode_direct_GCJ=unsupported
+         # It fails to find uninstalled libraries when the uninstalled
+         # path is not listed in the libpath.  Setting hardcode_minus_L
+         # to unsupported forces relinking
+         hardcode_minus_L_GCJ=yes
+         hardcode_libdir_flag_spec_GCJ='-L$libdir'
+         hardcode_libdir_separator_GCJ=
+         fi
+         ;;
+       esac
+       shared_flag='-shared'
+       if test "$aix_use_runtimelinking" = yes; then
+         shared_flag="$shared_flag "'${wl}-G'
+       fi
+      else
+       # not using gcc
+       if test "$host_cpu" = ia64; then
+       # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+       # chokes on -Wl,-G. The following line is correct:
+         shared_flag='-G'
+       else
+         if test "$aix_use_runtimelinking" = yes; then
+           shared_flag='${wl}-G'
+         else
+           shared_flag='${wl}-bM:SRE'
+         fi
+       fi
+      fi
+
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols_GCJ=yes
+      if test "$aix_use_runtimelinking" = yes; then
+       # Warning - without using the other runtime loading flags (-brtl),
+       # -berok will link without error, but may produce a broken library.
+       allow_undefined_flag_GCJ='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+       hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
+       archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+       if test "$host_cpu" = ia64; then
+         hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib'
+         allow_undefined_flag_GCJ="-z nodefs"
+         archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+       else
+        # Determine the default libpath from the value encoded in an empty executable.
+        cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+        hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
+         # Warning - without using the other run time loading flags,
+         # -berok will link without error, but may produce a broken library.
+         no_undefined_flag_GCJ=' ${wl}-bernotok'
+         allow_undefined_flag_GCJ=' ${wl}-berok'
+         # Exported symbols can be pulled into shared objects from archives
+         whole_archive_flag_spec_GCJ='$convenience'
+         archive_cmds_need_lc_GCJ=yes
+         # This is similar to how AIX traditionally builds its shared libraries.
+         archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+       fi
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_minus_L_GCJ=yes
+      # see comment about different semantics on the GNU ld section
+      ld_shlibs_GCJ=no
+      ;;
+
+    bsdi[45]*)
+      export_dynamic_flag_spec_GCJ=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      hardcode_libdir_flag_spec_GCJ=' '
+      allow_undefined_flag_GCJ=unsupported
+      # Tell ltmain to make .lib files, not .a files.
+      libext=lib
+      # Tell ltmain to make .dll files, not .so files.
+      shrext_cmds=".dll"
+      # FIXME: Setting linknames here is a bad hack.
+      archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      old_archive_From_new_cmds_GCJ='true'
+      # FIXME: Should let the user specify the lib program.
+      old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`'
+      enable_shared_with_static_runtimes_GCJ=yes
+      ;;
+
+    darwin* | rhapsody*)
+      case $host_os in
+        rhapsody* | darwin1.[012])
+         allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[012])
+               allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+      esac
+      archive_cmds_need_lc_GCJ=no
+      hardcode_direct_GCJ=no
+      hardcode_automatic_GCJ=yes
+      hardcode_shlibpath_var_GCJ=unsupported
+      whole_archive_flag_spec_GCJ=''
+      link_all_deplibs_GCJ=yes
+    if test "$GCC" = yes ; then
+       output_verbose_link_cmd='echo'
+        archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+      archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+         archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+         module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+         archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         ld_shlibs_GCJ=no
+          ;;
+      esac
+    fi
+      ;;
+
+    dgux*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    freebsd1*)
+      ld_shlibs_GCJ=no
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_GCJ=yes
+      hardcode_minus_L_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu | dragonfly*)
+      archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+       archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+       archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      fi
+      hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      hardcode_direct_GCJ=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L_GCJ=yes
+      export_dynamic_flag_spec_GCJ='${wl}-E'
+      ;;
+
+    hpux10*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+       archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test "$with_gnu_ld" = no; then
+       hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+       hardcode_libdir_separator_GCJ=:
+
+       hardcode_direct_GCJ=yes
+       export_dynamic_flag_spec_GCJ='${wl}-E'
+
+       # hardcode_minus_L: Not really in the search PATH,
+       # but as the default location of the library.
+       hardcode_minus_L_GCJ=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+       case $host_cpu in
+       hppa*64*)
+         archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       ia64*)
+         archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+         archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       esac
+      else
+       case $host_cpu in
+       hppa*64*)
+         archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       ia64*)
+         archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+         archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       esac
+      fi
+      if test "$with_gnu_ld" = no; then
+       hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+       hardcode_libdir_separator_GCJ=:
+
+       case $host_cpu in
+       hppa*64*|ia64*)
+         hardcode_libdir_flag_spec_ld_GCJ='+b $libdir'
+         hardcode_direct_GCJ=no
+         hardcode_shlibpath_var_GCJ=no
+         ;;
+       *)
+         hardcode_direct_GCJ=yes
+         export_dynamic_flag_spec_GCJ='${wl}-E'
+
+         # hardcode_minus_L: Not really in the search PATH,
+         # but as the default location of the library.
+         hardcode_minus_L_GCJ=yes
+         ;;
+       esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+       archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+       archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+       hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir'
+      fi
+      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      link_all_deplibs_GCJ=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+       archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+       archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    newsos6)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_GCJ=yes
+      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    openbsd*)
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+       archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+       hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
+       export_dynamic_flag_spec_GCJ='${wl}-E'
+      else
+       case $host_os in
+        openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+          archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+          hardcode_libdir_flag_spec_GCJ='-R$libdir'
+          ;;
+        *)
+          archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+          hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
+          ;;
+       esac
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_minus_L_GCJ=yes
+      allow_undefined_flag_GCJ=unsupported
+      archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+       allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
+       archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+       allow_undefined_flag_GCJ=' -expect_unresolved \*'
+       archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      ;;
+
+    osf4* | osf5*)     # as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+       allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
+       archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+       hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      else
+       allow_undefined_flag_GCJ=' -expect_unresolved \*'
+       archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+       archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+       $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+
+       # Both c and cxx compiler support -rpath directly
+       hardcode_libdir_flag_spec_GCJ='-rpath $libdir'
+      fi
+      hardcode_libdir_separator_GCJ=:
+      ;;
+
+    solaris*)
+      no_undefined_flag_GCJ=' -z text'
+      if test "$GCC" = yes; then
+       wlarc='${wl}'
+       archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+         $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+      else
+       wlarc=''
+       archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+       archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+       $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+      fi
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_shlibpath_var_GCJ=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *)
+       # The compiler driver will combine linker options so we
+       # cannot just pass the convience library names through
+       # without $wl, iff we do not link with $LD.
+       # Luckily, gcc supports the same syntax we need for Sun Studio.
+       # Supported since Solaris 2.6 (maybe 2.5.1?)
+       case $wlarc in
+       '')
+         whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;;
+       *)
+         whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+       esac ;;
+      esac
+      link_all_deplibs_GCJ=yes
+      ;;
+
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+       # Use $CC to link under sequent, because it throws in some extra .o
+       # files that make .init and .fini sections work.
+       archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_minus_L_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+       sni)
+         archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         hardcode_direct_GCJ=yes # is this really true???
+       ;;
+       siemens)
+         ## LD is ld it makes a PLAMLIB
+         ## CC just makes a GrossModule.
+         archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+         reload_cmds_GCJ='$CC -r -o $output$reload_objs'
+         hardcode_direct_GCJ=no
+        ;;
+       motorola)
+         archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie
+       ;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_GCJ=no
+      export_dynamic_flag_spec_GCJ='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+       hardcode_shlibpath_var_GCJ=no
+       runpath_var=LD_RUN_PATH
+       hardcode_runpath_var=yes
+       ld_shlibs_GCJ=yes
+      fi
+      ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
+      no_undefined_flag_GCJ='${wl}-z,text'
+      archive_cmds_need_lc_GCJ=no
+      hardcode_shlibpath_var_GCJ=no
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+       archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We can NOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      no_undefined_flag_GCJ='${wl}-z,text'
+      allow_undefined_flag_GCJ='${wl}-z,nodefs'
+      archive_cmds_need_lc_GCJ=no
+      hardcode_shlibpath_var_GCJ=no
+      hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+      hardcode_libdir_separator_GCJ=':'
+      link_all_deplibs_GCJ=yes
+      export_dynamic_flag_spec_GCJ='${wl}-Bexport'
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+       archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    uts4*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    *)
+      ld_shlibs_GCJ=no
+      ;;
+    esac
+  fi
+
+echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5
+echo "${ECHO_T}$ld_shlibs_GCJ" >&6
+test "$ld_shlibs_GCJ" = no && can_build_shared=no
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_GCJ" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_GCJ=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_GCJ in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl_GCJ
+       pic_flag=$lt_prog_compiler_pic_GCJ
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ
+        allow_undefined_flag_GCJ=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+         archive_cmds_need_lc_GCJ=no
+        else
+         archive_cmds_need_lc_GCJ=yes
+        fi
+        allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+if test "$GCC" = yes; then
+  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+    # if the path contains ";" then we assume it to be the separator
+    # otherwise default to the standard path separator (i.e. ":") - it is
+    # assumed that no part of a normal pathname contains ";" but that should
+    # okay in the real world where ";" in dirpaths is itself problematic.
+    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+  else
+    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+  fi
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix4* | aix5*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[01] | aix4.[01].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+          echo ' yes '
+          echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+       :
+      else
+       can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  library_names_spec='$libname.ixlibrary $libname.a'
+  # Create ${libname}_ixlibrary.a entries in /sys/libs.
+  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[45]*)
+  version_type=linux
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $rm \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+      if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+        # It is most probably a Windows format PATH printed by
+        # mingw gcc, but we are running on Cygwin. Gcc prints its search
+        # path with ; separators, and with drive letters. We can handle the
+        # drive letters (cygwin fileutils understands them), so leave them,
+        # especially as we might pass files found there to a mingw objdump,
+        # which wouldn't understand a cygwinified path. Ahh.
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    ;;
+
+  *)
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    ;;
+  esac
+  dynamic_linker='Win32 ld.exe'
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd1*)
+  dynamic_linker=no
+  ;;
+
+kfreebsd*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[123]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[01]* | freebsdelf3.[01]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  freebsd*) # from 4.6 on
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+   hppa*64*)
+     shrext_cmds='.sl'
+     hardcode_into_libs=yes
+     dynamic_linker="$host_os dld.sl"
+     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+     soname_spec='${libname}${release}${shared_ext}$major'
+     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+     ;;
+   *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555.
+  postinstall_cmds='chmod 555 $lib'
+  ;;
+
+interix3*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+       if test "$lt_cv_prog_gnu_ld" = yes; then
+               version_type=linux
+       else
+               version_type=irix
+       fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be Linux ELF.
+linux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # find out which ABI we are using
+  libsuff=
+  case "$host_cpu" in
+  x86_64*|s390x*|powerpc64*)
+    echo '#line 17657 "configure"' > conftest.$ac_ext
+    if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+      case `/usr/bin/file conftest.$ac_objext` in
+      *64-bit*)
+        libsuff=64
+        sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+        ;;
+      esac
+    fi
+    rm -rf conftest*
+    ;;
+  esac
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,   ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+knetbsd*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+nto-qnx*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+openbsd*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+    *)                         need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[89] | openbsd2.[89].*)
+       shlibpath_overrides_runpath=no
+       ;;
+      *)
+       shlibpath_overrides_runpath=yes
+       ;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+    shlibpath_overrides_runpath=no
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    shlibpath_overrides_runpath=yes
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+       ;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+hardcode_action_GCJ=
+if test -n "$hardcode_libdir_flag_spec_GCJ" || \
+   test -n "$runpath_var_GCJ" || \
+   test "X$hardcode_automatic_GCJ" = "Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct_GCJ" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no &&
+     test "$hardcode_minus_L_GCJ" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_GCJ=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_GCJ=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_GCJ=unsupported
+fi
+echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5
+echo "${ECHO_T}$hardcode_action_GCJ" >&6
+
+if test "$hardcode_action_GCJ" = relink; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # See if we are running on zsh, and set the options which allow our commands through
+  # without removal of \ escapes.
+  if test -n "${ZSH_VERSION+set}" ; then
+    setopt NO_GLOB_SUBST
+  fi
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_GCJ \
+    CC_GCJ \
+    LD_GCJ \
+    lt_prog_compiler_wl_GCJ \
+    lt_prog_compiler_pic_GCJ \
+    lt_prog_compiler_static_GCJ \
+    lt_prog_compiler_no_builtin_flag_GCJ \
+    export_dynamic_flag_spec_GCJ \
+    thread_safe_flag_spec_GCJ \
+    whole_archive_flag_spec_GCJ \
+    enable_shared_with_static_runtimes_GCJ \
+    old_archive_cmds_GCJ \
+    old_archive_from_new_cmds_GCJ \
+    predep_objects_GCJ \
+    postdep_objects_GCJ \
+    predeps_GCJ \
+    postdeps_GCJ \
+    compiler_lib_search_path_GCJ \
+    archive_cmds_GCJ \
+    archive_expsym_cmds_GCJ \
+    postinstall_cmds_GCJ \
+    postuninstall_cmds_GCJ \
+    old_archive_from_expsyms_cmds_GCJ \
+    allow_undefined_flag_GCJ \
+    no_undefined_flag_GCJ \
+    export_symbols_cmds_GCJ \
+    hardcode_libdir_flag_spec_GCJ \
+    hardcode_libdir_flag_spec_ld_GCJ \
+    hardcode_libdir_separator_GCJ \
+    hardcode_automatic_GCJ \
+    module_cmds_GCJ \
+    module_expsym_cmds_GCJ \
+    lt_cv_prog_compiler_c_o_GCJ \
+    exclude_expsyms_GCJ \
+    include_expsyms_GCJ; do
+
+    case $var in
+    old_archive_cmds_GCJ | \
+    old_archive_from_new_cmds_GCJ | \
+    archive_cmds_GCJ | \
+    archive_expsym_cmds_GCJ | \
+    module_cmds_GCJ | \
+    module_expsym_cmds_GCJ | \
+    old_archive_from_expsyms_cmds_GCJ | \
+    export_symbols_cmds_GCJ | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_GCJ
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
+# A language-specific compiler.
+CC=$lt_compiler_GCJ
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_GCJ
+
+gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\`
+gcc_ver=\`gcc -dumpversion\`
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_GCJ
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_GCJ
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_GCJ
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_GCJ
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_GCJ
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_GCJ
+archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_GCJ
+module_expsym_cmds=$lt_module_expsym_cmds_GCJ
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=\`echo $lt_predep_objects_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=\`echo $lt_postdep_objects_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_GCJ
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_GCJ
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_GCJ
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_GCJ
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_GCJ
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_GCJ
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_GCJ
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_GCJ
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_GCJ
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_GCJ"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_GCJ
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_GCJ
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_GCJ
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_GCJ
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+       else
+         tagname=""
+       fi
+       ;;
+
+      RC)
+
+
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+objext_RC=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${RC-"windres"}
+compiler=$CC
+compiler_RC=$CC
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+lt_cv_prog_compiler_c_o_RC=yes
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # See if we are running on zsh, and set the options which allow our commands through
+  # without removal of \ escapes.
+  if test -n "${ZSH_VERSION+set}" ; then
+    setopt NO_GLOB_SUBST
+  fi
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_RC \
+    CC_RC \
+    LD_RC \
+    lt_prog_compiler_wl_RC \
+    lt_prog_compiler_pic_RC \
+    lt_prog_compiler_static_RC \
+    lt_prog_compiler_no_builtin_flag_RC \
+    export_dynamic_flag_spec_RC \
+    thread_safe_flag_spec_RC \
+    whole_archive_flag_spec_RC \
+    enable_shared_with_static_runtimes_RC \
+    old_archive_cmds_RC \
+    old_archive_from_new_cmds_RC \
+    predep_objects_RC \
+    postdep_objects_RC \
+    predeps_RC \
+    postdeps_RC \
+    compiler_lib_search_path_RC \
+    archive_cmds_RC \
+    archive_expsym_cmds_RC \
+    postinstall_cmds_RC \
+    postuninstall_cmds_RC \
+    old_archive_from_expsyms_cmds_RC \
+    allow_undefined_flag_RC \
+    no_undefined_flag_RC \
+    export_symbols_cmds_RC \
+    hardcode_libdir_flag_spec_RC \
+    hardcode_libdir_flag_spec_ld_RC \
+    hardcode_libdir_separator_RC \
+    hardcode_automatic_RC \
+    module_cmds_RC \
+    module_expsym_cmds_RC \
+    lt_cv_prog_compiler_c_o_RC \
+    exclude_expsyms_RC \
+    include_expsyms_RC; do
+
+    case $var in
+    old_archive_cmds_RC | \
+    old_archive_from_new_cmds_RC | \
+    archive_cmds_RC | \
+    archive_expsym_cmds_RC | \
+    module_cmds_RC | \
+    module_expsym_cmds_RC | \
+    old_archive_from_expsyms_cmds_RC | \
+    export_symbols_cmds_RC | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_RC
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
+# A language-specific compiler.
+CC=$lt_compiler_RC
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_RC
+
+gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\`
+gcc_ver=\`gcc -dumpversion\`
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_RC
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_RC
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_RC
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_RC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_RC
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_RC
+archive_expsym_cmds=$lt_archive_expsym_cmds_RC
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_RC
+module_expsym_cmds=$lt_module_expsym_cmds_RC
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=\`echo $lt_predep_objects_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=\`echo $lt_postdep_objects_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_RC
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_RC
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_RC
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_RC
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_RC
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_RC
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_RC
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_RC
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_RC
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_RC
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_RC"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_RC
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_RC
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_RC
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_RC
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+       ;;
+
+      *)
+       { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5
+echo "$as_me: error: Unsupported tag name: $tagname" >&2;}
+   { (exit 1); exit 1; }; }
+       ;;
+      esac
+
+      # Append the new tag name to the list of available tags.
+      if test -n "$tagname" ; then
+      available_tags="$available_tags $tagname"
+    fi
+    fi
+  done
+  IFS="$lt_save_ifs"
+
+  # Now substitute the updated list of available tags.
+  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
+    mv "${ofile}T" "$ofile"
+    chmod +x "$ofile"
+  else
+    rm -f "${ofile}T"
+    { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5
+echo "$as_me: error: unable to update list of available tagged configurations." >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+fi
+
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+# Prevent multiple expansion
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+echo "$as_me:$LINENO: checking for X" >&5
+echo $ECHO_N "checking for X... $ECHO_C" >&6
+
+
+# Check whether --with-x or --without-x was given.
+if test "${with_x+set}" = set; then
+  withval="$with_x"
+
+fi;
+# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
+if test "x$with_x" = xno; then
+  # The user explicitly disabled X.
+  have_x=disabled
+else
+  if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
+    # Both variables are already set.
+    have_x=yes
+  else
+    if test "${ac_cv_have_x+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # One or both of the vars are not set, and there is no cached value.
+ac_x_includes=no ac_x_libraries=no
+rm -fr conftest.dir
+if mkdir conftest.dir; then
+  cd conftest.dir
+  # Make sure to not put "make" in the Imakefile rules, since we grep it out.
+  cat >Imakefile <<'_ACEOF'
+acfindx:
+       @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
+_ACEOF
+  if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
+    # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+    eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
+    # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
+    for ac_extension in a so sl; do
+      if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
+        test -f $ac_im_libdir/libX11.$ac_extension; then
+       ac_im_usrlibdir=$ac_im_libdir; break
+      fi
+    done
+    # Screen out bogus values from the imake configuration.  They are
+    # bogus both because they are the default anyway, and because
+    # using them would break gcc on systems where it needs fixed includes.
+    case $ac_im_incroot in
+       /usr/include) ;;
+       *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
+    esac
+    case $ac_im_usrlibdir in
+       /usr/lib | /lib) ;;
+       *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
+    esac
+  fi
+  cd ..
+  rm -fr conftest.dir
+fi
+
+# Standard set of common directories for X headers.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+ac_x_header_dirs='
+/usr/X11/include
+/usr/X11R6/include
+/usr/X11R5/include
+/usr/X11R4/include
+
+/usr/include/X11
+/usr/include/X11R6
+/usr/include/X11R5
+/usr/include/X11R4
+
+/usr/local/X11/include
+/usr/local/X11R6/include
+/usr/local/X11R5/include
+/usr/local/X11R4/include
+
+/usr/local/include/X11
+/usr/local/include/X11R6
+/usr/local/include/X11R5
+/usr/local/include/X11R4
+
+/usr/X386/include
+/usr/x386/include
+/usr/XFree86/include/X11
+
+/usr/include
+/usr/local/include
+/usr/unsupported/include
+/usr/athena/include
+/usr/local/x11r5/include
+/usr/lpp/Xamples/include
+
+/usr/openwin/include
+/usr/openwin/share/include'
+
+if test "$ac_x_includes" = no; then
+  # Guess where to find include files, by looking for Xlib.h.
+  # First, try using that file with no special directory specified.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <X11/Xlib.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # We can compile using X headers with no special include directory.
+ac_x_includes=
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  for ac_dir in $ac_x_header_dirs; do
+  if test -r "$ac_dir/X11/Xlib.h"; then
+    ac_x_includes=$ac_dir
+    break
+  fi
+done
+fi
+rm -f conftest.err conftest.$ac_ext
+fi # $ac_x_includes = no
+
+if test "$ac_x_libraries" = no; then
+  # Check for the libraries.
+  # See if we find them without any special options.
+  # Don't add to $LIBS permanently.
+  ac_save_LIBS=$LIBS
+  LIBS="-lX11 $LIBS"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <X11/Xlib.h>
+int
+main ()
+{
+XrmInitialize ()
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  LIBS=$ac_save_LIBS
+# We can link X programs with no special library path.
+ac_x_libraries=
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+LIBS=$ac_save_LIBS
+for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
+do
+  # Don't even attempt the hair of trying to link an X program!
+  for ac_extension in a so sl; do
+    if test -r $ac_dir/libXt.$ac_extension; then
+      ac_x_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi # $ac_x_libraries = no
+
+if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
+  # Didn't find X anywhere.  Cache the known absence of X.
+  ac_cv_have_x="have_x=no"
+else
+  # Record where we found X for the cache.
+  ac_cv_have_x="have_x=yes \
+               ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
+fi
+fi
+
+  fi
+  eval "$ac_cv_have_x"
+fi # $with_x != no
+
+if test "$have_x" != yes; then
+  echo "$as_me:$LINENO: result: $have_x" >&5
+echo "${ECHO_T}$have_x" >&6
+  no_x=yes
+else
+  # If each of the values was on the command line, it overrides each guess.
+  test "x$x_includes" = xNONE && x_includes=$ac_x_includes
+  test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
+  # Update the cache value to reflect the command line values.
+  ac_cv_have_x="have_x=yes \
+               ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
+  echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5
+echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
+fi
+
+if test "$no_x" = yes; then
+  # Not all programs may use this symbol, but it does not hurt to define it.
+
+cat >>confdefs.h <<\_ACEOF
+#define X_DISPLAY_MISSING 1
+_ACEOF
+
+  X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
+else
+  if test -n "$x_includes"; then
+    X_CFLAGS="$X_CFLAGS -I$x_includes"
+  fi
+
+  # It would also be nice to do this for all -L options, not just this one.
+  if test -n "$x_libraries"; then
+    X_LIBS="$X_LIBS -L$x_libraries"
+    # For Solaris; some versions of Sun CC require a space after -R and
+    # others require no space.  Words are not sufficient . . . .
+    case `(uname -sr) 2>/dev/null` in
+    "SunOS 5"*)
+      echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5
+echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
+      ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_R_nospace=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_R_nospace=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+      if test $ac_R_nospace = yes; then
+       echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+       X_LIBS="$X_LIBS -R$x_libraries"
+      else
+       LIBS="$ac_xsave_LIBS -R $x_libraries"
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_R_space=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_R_space=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+       if test $ac_R_space = yes; then
+         echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+         X_LIBS="$X_LIBS -R $x_libraries"
+       else
+         echo "$as_me:$LINENO: result: neither works" >&5
+echo "${ECHO_T}neither works" >&6
+       fi
+      fi
+      LIBS=$ac_xsave_LIBS
+    esac
+  fi
+
+  # Check for system-dependent libraries X programs must link with.
+  # Do this before checking for the system-independent R6 libraries
+  # (-lICE), since we may need -lsocket or whatever for X linking.
+
+  if test "$ISC" = yes; then
+    X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
+  else
+    # Martyn Johnson says this is needed for Ultrix, if the X
+    # libraries were built with DECnet support.  And Karl Berry says
+    # the Alpha needs dnet_stub (dnet does not exist).
+    ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char XOpenDisplay ();
+int
+main ()
+{
+XOpenDisplay ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5
+echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
+if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldnet  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dnet_ntoa ();
+int
+main ()
+{
+dnet_ntoa ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dnet_dnet_ntoa=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dnet_dnet_ntoa=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
+echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
+if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
+fi
+
+    if test $ac_cv_lib_dnet_dnet_ntoa = no; then
+      echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5
+echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
+if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldnet_stub  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dnet_ntoa ();
+int
+main ()
+{
+dnet_ntoa ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dnet_stub_dnet_ntoa=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dnet_stub_dnet_ntoa=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
+echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
+if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
+fi
+
+    fi
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+    LIBS="$ac_xsave_LIBS"
+
+    # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
+    # to get the SysV transport functions.
+    # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
+    # needs -lnsl.
+    # The nsl library prevents programs from opening the X display
+    # on Irix 5.2, according to T.E. Dickey.
+    # The functions gethostbyname, getservbyname, and inet_addr are
+    # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
+    echo "$as_me:$LINENO: checking for gethostbyname" >&5
+echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
+if test "${ac_cv_func_gethostbyname+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define gethostbyname to an innocuous variant, in case <limits.h> declares gethostbyname.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define gethostbyname innocuous_gethostbyname
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char gethostbyname (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef gethostbyname
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char gethostbyname ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
+choke me
+#else
+char (*f) () = gethostbyname;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != gethostbyname;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_gethostbyname=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_gethostbyname=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5
+echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
+
+    if test $ac_cv_func_gethostbyname = no; then
+      echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5
+echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
+if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnsl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char gethostbyname ();
+int
+main ()
+{
+gethostbyname ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_nsl_gethostbyname=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_nsl_gethostbyname=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5
+echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
+if test $ac_cv_lib_nsl_gethostbyname = yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
+fi
+
+      if test $ac_cv_lib_nsl_gethostbyname = no; then
+       echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5
+echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
+if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lbsd  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char gethostbyname ();
+int
+main ()
+{
+gethostbyname ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_bsd_gethostbyname=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_bsd_gethostbyname=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5
+echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
+if test $ac_cv_lib_bsd_gethostbyname = yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
+fi
+
+      fi
+    fi
+
+    # lieder@skyler.mavd.honeywell.com says without -lsocket,
+    # socket/setsockopt and other routines are undefined under SCO ODT
+    # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
+    # on later versions), says Simon Leinen: it contains gethostby*
+    # variants that don't use the name server (or something).  -lsocket
+    # must be given before -lnsl if both are needed.  We assume that
+    # if connect needs -lnsl, so does gethostbyname.
+    echo "$as_me:$LINENO: checking for connect" >&5
+echo $ECHO_N "checking for connect... $ECHO_C" >&6
+if test "${ac_cv_func_connect+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define connect to an innocuous variant, in case <limits.h> declares connect.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define connect innocuous_connect
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char connect (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef connect
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char connect ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_connect) || defined (__stub___connect)
+choke me
+#else
+char (*f) () = connect;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != connect;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_connect=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_connect=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5
+echo "${ECHO_T}$ac_cv_func_connect" >&6
+
+    if test $ac_cv_func_connect = no; then
+      echo "$as_me:$LINENO: checking for connect in -lsocket" >&5
+echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
+if test "${ac_cv_lib_socket_connect+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char connect ();
+int
+main ()
+{
+connect ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_socket_connect=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_socket_connect=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5
+echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
+if test $ac_cv_lib_socket_connect = yes; then
+  X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
+fi
+
+    fi
+
+    # Guillermo Gomez says -lposix is necessary on A/UX.
+    echo "$as_me:$LINENO: checking for remove" >&5
+echo $ECHO_N "checking for remove... $ECHO_C" >&6
+if test "${ac_cv_func_remove+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define remove to an innocuous variant, in case <limits.h> declares remove.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define remove innocuous_remove
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char remove (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef remove
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char remove ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_remove) || defined (__stub___remove)
+choke me
+#else
+char (*f) () = remove;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != remove;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_remove=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_remove=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5
+echo "${ECHO_T}$ac_cv_func_remove" >&6
+
+    if test $ac_cv_func_remove = no; then
+      echo "$as_me:$LINENO: checking for remove in -lposix" >&5
+echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
+if test "${ac_cv_lib_posix_remove+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lposix  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char remove ();
+int
+main ()
+{
+remove ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_posix_remove=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_posix_remove=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5
+echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
+if test $ac_cv_lib_posix_remove = yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
+fi
+
+    fi
+
+    # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
+    echo "$as_me:$LINENO: checking for shmat" >&5
+echo $ECHO_N "checking for shmat... $ECHO_C" >&6
+if test "${ac_cv_func_shmat+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define shmat to an innocuous variant, in case <limits.h> declares shmat.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shmat innocuous_shmat
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shmat (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shmat
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char shmat ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_shmat) || defined (__stub___shmat)
+choke me
+#else
+char (*f) () = shmat;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != shmat;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_shmat=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_shmat=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5
+echo "${ECHO_T}$ac_cv_func_shmat" >&6
+
+    if test $ac_cv_func_shmat = no; then
+      echo "$as_me:$LINENO: checking for shmat in -lipc" >&5
+echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
+if test "${ac_cv_lib_ipc_shmat+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lipc  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char shmat ();
+int
+main ()
+{
+shmat ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_ipc_shmat=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_ipc_shmat=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5
+echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
+if test $ac_cv_lib_ipc_shmat = yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
+fi
+
+    fi
+  fi
+
+  # Check for libraries that X11R6 Xt/Xaw programs need.
+  ac_save_LDFLAGS=$LDFLAGS
+  test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
+  # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
+  # check for ICE first), but we must link in the order -lSM -lICE or
+  # we get undefined symbols.  So assume we have SM if we have ICE.
+  # These have to be linked with before -lX11, unlike the other
+  # libraries we check for below, so use a different variable.
+  # John Interrante, Karl Berry
+  echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5
+echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
+if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lICE $X_EXTRA_LIBS $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char IceConnectionNumber ();
+int
+main ()
+{
+IceConnectionNumber ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_ICE_IceConnectionNumber=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_ICE_IceConnectionNumber=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
+echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
+if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
+  X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
+fi
+
+  LDFLAGS=$ac_save_LDFLAGS
+
+fi
+
+
+echo "$as_me:$LINENO: checking whether variable-length arrays are supported" >&5
+echo $ECHO_N "checking whether variable-length arrays are supported... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+       int n; int foo[n];
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; cat >>confdefs.h <<\_ACEOF
+#define HAVE_VLA 1
+_ACEOF
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
+############################################################
+# Check for the IJG JPEG library.
+############################################################
+
+# Allow the user to explicitly specify whether the JPEG library is present.
+# Check whether --enable-libjpeg or --disable-libjpeg was given.
+if test "${enable_libjpeg+set}" = set; then
+  enableval="$enable_libjpeg"
+
+case "${enableval}" in
+yes)
+       ENABLE_LIBJPEG=yes;;
+no)
+       ENABLE_LIBJPEG=no;;
+*)
+       { { echo "$as_me:$LINENO: error: bad value ${enableval} for --disable-libjpeg" >&5
+echo "$as_me: error: bad value ${enableval} for --disable-libjpeg" >&2;}
+   { (exit 1); exit 1; }; }
+       ;;
+esac
+
+else
+  ENABLE_LIBJPEG=yes
+fi;
+
+HAVE_LIBJPEG=no
+if test $ENABLE_LIBJPEG = yes; then
+       # Check for the JPEG library.
+       echo "$as_me:$LINENO: checking for jpeg_destroy in -ljpeg" >&5
+echo $ECHO_N "checking for jpeg_destroy in -ljpeg... $ECHO_C" >&6
+if test "${ac_cv_lib_jpeg_jpeg_destroy+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ljpeg  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char jpeg_destroy ();
+int
+main ()
+{
+jpeg_destroy ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_jpeg_jpeg_destroy=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_jpeg_jpeg_destroy=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_jpeg_jpeg_destroy" >&5
+echo "${ECHO_T}$ac_cv_lib_jpeg_jpeg_destroy" >&6
+if test $ac_cv_lib_jpeg_jpeg_destroy = yes; then
+  HAVE_LIBJPEG=yes
+else
+  HAVE_LIBJPEG=no
+fi
+
+       if test $HAVE_LIBJPEG = yes; then
+               LIBS="$LIBS -ljpeg"
+       fi
+fi
+
+
+if test $HAVE_LIBJPEG = yes; then
+  HAVE_LIBJPEG_TRUE=
+  HAVE_LIBJPEG_FALSE='#'
+else
+  HAVE_LIBJPEG_TRUE='#'
+  HAVE_LIBJPEG_FALSE=
+fi
+
+
+############################################################
+# Check for OpenGL libraries.
+############################################################
+
+
+# Check whether --with-glut-include-dir or --without-glut-include-dir was given.
+if test "${with_glut_include_dir+set}" = set; then
+  withval="$with_glut_include_dir"
+
+       case "$withval" in
+       /*)
+               CFLAGS="$CFLAGS -I$withval"
+               CPPFLAGS="$CPPFLAGS -I$withval";;
+       *)
+               { { echo "$as_me:$LINENO: error: --with-glut-include-dir requires absolute path" >&5
+echo "$as_me: error: --with-glut-include-dir requires absolute path" >&2;}
+   { (exit 1); exit 1; }; }
+               ;;
+       esac
+
+fi;
+
+# Check whether --with-glut-lib-dir or --without-glut-lib-dir was given.
+if test "${with_glut_lib_dir+set}" = set; then
+  withval="$with_glut_lib_dir"
+
+       case "$withval" in
+       /*)
+               LIBS="$LIBS -L$withval";;
+       *)
+               { { echo "$as_me:$LINENO: error: --with-glut-lib-dir requires absolute path" >&5
+echo "$as_me: error: --with-glut-lib-dir requires absolute path" >&2;}
+   { (exit 1); exit 1; }; }
+               ;;
+       esac
+
+fi;
+
+# Check whether --enable-opengl or --disable-opengl was given.
+if test "${enable_opengl+set}" = set; then
+  enableval="$enable_opengl"
+
+       case "$enableval" in
+       yes)
+               ENABLE_OPENGL=yes;;
+       no)
+               ENABLE_OPENGL=no;;
+       *)
+               { { echo "$as_me:$LINENO: error: bad value ${enableval} for --disable-libjpeg" >&5
+echo "$as_me: error: bad value ${enableval} for --disable-libjpeg" >&2;}
+   { (exit 1); exit 1; }; }
+               ;;
+       esac
+
+else
+  ENABLE_OPENGL=yes
+fi;
+
+HAVE_OPENGL=no
+OPENGL_LIBS=""
+if test $ENABLE_OPENGL = yes; then
+       if test $HAVE_OPENGL = no; then
+               TMPLIBS="-lglut -lGL -lGLU $X_PRE_LIBS -lX11 -lXmu -lXi -lXext -lXt $X_EXTRA_LIBS $X_LIBS"
+               echo "$as_me:$LINENO: checking for glutInit in -lglut" >&5
+echo $ECHO_N "checking for glutInit in -lglut... $ECHO_C" >&6
+if test "${ac_cv_lib_glut_glutInit+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lglut $TMPLIBS $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char glutInit ();
+int
+main ()
+{
+glutInit ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_glut_glutInit=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_glut_glutInit=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_glut_glutInit" >&5
+echo "${ECHO_T}$ac_cv_lib_glut_glutInit" >&6
+if test $ac_cv_lib_glut_glutInit = yes; then
+  HAVE_OPENGL=yes;
+                 OPENGL_LIBS=$TMPLIBS
+else
+  HAVE_OPENGL=no
+fi
+
+       fi
+       if test "${ac_cv_header_GL_glut_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for GL/glut.h" >&5
+echo $ECHO_N "checking for GL/glut.h... $ECHO_C" >&6
+if test "${ac_cv_header_GL_glut_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_GL_glut_h" >&5
+echo "${ECHO_T}$ac_cv_header_GL_glut_h" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking GL/glut.h usability" >&5
+echo $ECHO_N "checking GL/glut.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <GL/glut.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking GL/glut.h presence" >&5
+echo $ECHO_N "checking GL/glut.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <GL/glut.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: GL/glut.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: GL/glut.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: GL/glut.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: GL/glut.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: GL/glut.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: GL/glut.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: GL/glut.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: GL/glut.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: GL/glut.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: GL/glut.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: GL/glut.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: GL/glut.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: GL/glut.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: GL/glut.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: GL/glut.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: GL/glut.h: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## --------------------------------- ##
+## Report this to the jasper lists.  ##
+## --------------------------------- ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for GL/glut.h" >&5
+echo $ECHO_N "checking for GL/glut.h... $ECHO_C" >&6
+if test "${ac_cv_header_GL_glut_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_GL_glut_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_GL_glut_h" >&5
+echo "${ECHO_T}$ac_cv_header_GL_glut_h" >&6
+
+fi
+if test $ac_cv_header_GL_glut_h = yes; then
+  :
+else
+  HAVE_OPENGL=no; OPENGL_LIBS="";
+fi
+
+
+fi
+
+
+
+if test $HAVE_OPENGL = yes; then
+  HAVE_OPENGL_TRUE=
+  HAVE_OPENGL_FALSE='#'
+else
+  HAVE_OPENGL_TRUE='#'
+  HAVE_OPENGL_FALSE=
+fi
+
+
+echo "$as_me:$LINENO: checking whether OpenGL libraries and headers were detected" >&5
+echo $ECHO_N "checking whether OpenGL libraries and headers were detected... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $HAVE_OPENGL" >&5
+echo "${ECHO_T}$HAVE_OPENGL" >&6
+
+############################################################
+# Check for other libraries.
+############################################################
+
+# Check for the math library.
+
+echo "$as_me:$LINENO: checking for main in -lm" >&5
+echo $ECHO_N "checking for main in -lm... $ECHO_C" >&6
+if test "${ac_cv_lib_m_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+
+int
+main ()
+{
+main ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_m_main=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_m_main=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_m_main" >&5
+echo "${ECHO_T}$ac_cv_lib_m_main" >&6
+if test $ac_cv_lib_m_main = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+  LIBS="-lm $LIBS"
+
+fi
+
+
+############################################################
+# Check for header files.
+############################################################
+
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_header_stdc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_stdc=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then
+  :
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+                  (('a' <= (c) && (c) <= 'i') \
+                    || ('j' <= (c) && (c) <= 'r') \
+                    || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+       || toupper (i) != TOUPPER (i))
+      exit(2);
+  exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_header in fcntl.h limits.h unistd.h stdint.h stdbool.h io.h windows.h sys/types.h sys/time.h stdlib.h stddef.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## --------------------------------- ##
+## Report this to the jasper lists.  ##
+## --------------------------------- ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+############################################################
+# Check for typedefs, structures, and compiler characteristics.
+############################################################
+
+echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
+echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
+if test "${ac_cv_c_const+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+/* FIXME: Include the comments suggested by Paul. */
+#ifndef __cplusplus
+  /* Ultrix mips cc rejects this.  */
+  typedef int charset[2];
+  const charset x;
+  /* SunOS 4.1.1 cc rejects this.  */
+  char const *const *ccp;
+  char **p;
+  /* NEC SVR4.0.2 mips cc rejects this.  */
+  struct point {int x, y;};
+  static struct point const zero = {0,0};
+  /* AIX XL C 1.02.0.0 rejects this.
+     It does not let you subtract one const X* pointer from another in
+     an arm of an if-expression whose if-part is not a constant
+     expression */
+  const char *g = "string";
+  ccp = &g + (g ? g-g : 0);
+  /* HPUX 7.0 cc rejects these. */
+  ++ccp;
+  p = (char**) ccp;
+  ccp = (char const *const *) p;
+  { /* SCO 3.2v4 cc rejects this.  */
+    char *t;
+    char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+    *t++ = 0;
+  }
+  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
+    int x[] = {25, 17};
+    const int *foo = &x[0];
+    ++foo;
+  }
+  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+    typedef const int *iptr;
+    iptr p = 0;
+    ++p;
+  }
+  { /* AIX XL C 1.02.0.0 rejects this saying
+       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+    struct s { int j; const int *ap[3]; };
+    struct s *b; b->j = 5;
+  }
+  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+    const int foo = 10;
+  }
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_c_const=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_c_const=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
+echo "${ECHO_T}$ac_cv_c_const" >&6
+if test $ac_cv_c_const = no; then
+
+cat >>confdefs.h <<\_ACEOF
+#define const
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for inline" >&5
+echo $ECHO_N "checking for inline... $ECHO_C" >&6
+if test "${ac_cv_c_inline+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifndef __cplusplus
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
+#endif
+
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_c_inline=$ac_kw; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5
+echo "${ECHO_T}$ac_cv_c_inline" >&6
+
+
+case $ac_cv_c_inline in
+  inline | yes) ;;
+  *)
+    case $ac_cv_c_inline in
+      no) ac_val=;;
+      *) ac_val=$ac_cv_c_inline;;
+    esac
+    cat >>confdefs.h <<_ACEOF
+#ifndef __cplusplus
+#define inline $ac_val
+#endif
+_ACEOF
+    ;;
+esac
+
+echo "$as_me:$LINENO: checking for size_t" >&5
+echo $ECHO_N "checking for size_t... $ECHO_C" >&6
+if test "${ac_cv_type_size_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+if ((size_t *) 0)
+  return 0;
+if (sizeof (size_t))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_size_t=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_size_t=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
+echo "${ECHO_T}$ac_cv_type_size_t" >&6
+if test $ac_cv_type_size_t = yes; then
+  :
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for uchar" >&5
+echo $ECHO_N "checking for uchar... $ECHO_C" >&6
+if test "${ac_cv_type_uchar+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+if ((uchar *) 0)
+  return 0;
+if (sizeof (uchar))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_uchar=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_uchar=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_uchar" >&5
+echo "${ECHO_T}$ac_cv_type_uchar" >&6
+if test $ac_cv_type_uchar = yes; then
+  :
+else
+
+cat >>confdefs.h <<_ACEOF
+#define uchar unsigned char
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for ushort" >&5
+echo $ECHO_N "checking for ushort... $ECHO_C" >&6
+if test "${ac_cv_type_ushort+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+if ((ushort *) 0)
+  return 0;
+if (sizeof (ushort))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_ushort=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_ushort=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_ushort" >&5
+echo "${ECHO_T}$ac_cv_type_ushort" >&6
+if test $ac_cv_type_ushort = yes; then
+  :
+else
+
+cat >>confdefs.h <<_ACEOF
+#define ushort unsigned short
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for uint" >&5
+echo $ECHO_N "checking for uint... $ECHO_C" >&6
+if test "${ac_cv_type_uint+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+if ((uint *) 0)
+  return 0;
+if (sizeof (uint))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_uint=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_uint=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_uint" >&5
+echo "${ECHO_T}$ac_cv_type_uint" >&6
+if test $ac_cv_type_uint = yes; then
+  :
+else
+
+cat >>confdefs.h <<_ACEOF
+#define uint unsigned int
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for ulong" >&5
+echo $ECHO_N "checking for ulong... $ECHO_C" >&6
+if test "${ac_cv_type_ulong+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+if ((ulong *) 0)
+  return 0;
+if (sizeof (ulong))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_ulong=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_ulong=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_ulong" >&5
+echo "${ECHO_T}$ac_cv_type_ulong" >&6
+if test $ac_cv_type_ulong = yes; then
+  :
+else
+
+cat >>confdefs.h <<_ACEOF
+#define ulong unsigned long
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for longlong" >&5
+echo $ECHO_N "checking for longlong... $ECHO_C" >&6
+if test "${ac_cv_type_longlong+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+if ((longlong *) 0)
+  return 0;
+if (sizeof (longlong))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_longlong=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_longlong=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_longlong" >&5
+echo "${ECHO_T}$ac_cv_type_longlong" >&6
+if test $ac_cv_type_longlong = yes; then
+  :
+else
+
+cat >>confdefs.h <<_ACEOF
+#define longlong long long
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for ulonglong" >&5
+echo $ECHO_N "checking for ulonglong... $ECHO_C" >&6
+if test "${ac_cv_type_ulonglong+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+if ((ulonglong *) 0)
+  return 0;
+if (sizeof (ulonglong))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_ulonglong=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_ulonglong=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_ulonglong" >&5
+echo "${ECHO_T}$ac_cv_type_ulonglong" >&6
+if test $ac_cv_type_ulonglong = yes; then
+  :
+else
+
+cat >>confdefs.h <<_ACEOF
+#define ulonglong unsigned long long
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for ssize_t" >&5
+echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6
+if test "${ac_cv_type_ssize_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+if ((ssize_t *) 0)
+  return 0;
+if (sizeof (ssize_t))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_ssize_t=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_ssize_t=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5
+echo "${ECHO_T}$ac_cv_type_ssize_t" >&6
+if test $ac_cv_type_ssize_t = yes; then
+  :
+else
+
+cat >>confdefs.h <<_ACEOF
+#define ssize_t int
+_ACEOF
+
+fi
+
+
+for ac_func in gettimeofday
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+for ac_func in getrusage
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+############################################################
+# Checks for library functions.
+############################################################
+
+
+for ac_func in vprintf
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+echo "$as_me:$LINENO: checking for _doprnt" >&5
+echo $ECHO_N "checking for _doprnt... $ECHO_C" >&6
+if test "${ac_cv_func__doprnt+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define _doprnt to an innocuous variant, in case <limits.h> declares _doprnt.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define _doprnt innocuous__doprnt
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char _doprnt (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef _doprnt
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char _doprnt ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub__doprnt) || defined (__stub____doprnt)
+choke me
+#else
+char (*f) () = _doprnt;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != _doprnt;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func__doprnt=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func__doprnt=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5
+echo "${ECHO_T}$ac_cv_func__doprnt" >&6
+if test $ac_cv_func__doprnt = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_DOPRNT 1
+_ACEOF
+
+fi
+
+fi
+done
+
+
+
+############################################################
+# Enable/disable special memory allocator for debugging.
+############################################################
+
+# Check whether --enable-dmalloc or --disable-dmalloc was given.
+if test "${enable_dmalloc+set}" = set; then
+  enableval="$enable_dmalloc"
+
+case "${enableval}" in
+yes)
+       cat >>confdefs.h <<\_ACEOF
+#define DEBUG_MEMALLOC 1
+_ACEOF
+
+       ;;
+no)
+       ;;
+*)
+       { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-dmalloc" >&5
+echo "$as_me: error: bad value ${enableval} for --enable-dmalloc" >&2;}
+   { (exit 1); exit 1; }; }
+       ;;
+esac
+
+fi;
+
+############################################################
+# Enable/disable extra code for debugging.
+############################################################
+
+# Check whether --enable-debug or --disable-debug was given.
+if test "${enable_debug+set}" = set; then
+  enableval="$enable_debug"
+
+case "${enableval}" in
+yes)
+       debug=yes
+       cat >>confdefs.h <<\_ACEOF
+#define DEBUG 1
+_ACEOF
+
+       cat >>confdefs.h <<\_ACEOF
+#define DEBUG_OVERFLOW 1
+_ACEOF
+
+       if test "$GCC" = yes; then
+               CFLAGS="-g -O0"
+       fi
+       ;;
+no)
+       debug=no
+       ;;
+*)
+       { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-debug" >&5
+echo "$as_me: error: bad value ${enableval} for --enable-debug" >&2;}
+   { (exit 1); exit 1; }; }
+       ;;
+esac
+
+else
+  debug=no
+fi;
+
+if test "$GCC" = yes; then
+       CFLAGS="$CFLAGS"
+       #CFLAGS="$CFLAGS -std=c99"
+       #CFLAGS="$CFLAGS -pedantic"
+       #CFLAGS="$CFLAGS -pedantic-errors"
+       #CFLAGS="$CFLAGS -W -Wall -Wno-long-long -Wformat -Wmissing-prototypes -Wstrict-prototypes"
+fi
+
+############################################################
+# Extra stuff for research purposes.
+############################################################
+
+# Check whether --enable-special0 or --disable-special0 was given.
+if test "${enable_special0+set}" = set; then
+  enableval="$enable_special0"
+
+case "${enableval}" in
+yes)
+       if test "$GCC" = yes; then
+               CFLAGS="-g -O0"
+       fi
+       ;;
+no)
+       ;;
+*)
+       { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-special0" >&5
+echo "$as_me: error: bad value ${enableval} for --enable-special0" >&2;}
+   { (exit 1); exit 1; }; }
+       ;;
+esac
+
+fi;
+
+if test -n "$EXTRACFLAGS"; then
+       CFLAGS="$CFLAGS $EXTRACFLAGS"
+fi
+
+############################################################
+# Generate the configuration header file.
+############################################################
+
+          ac_config_headers="$ac_config_headers src/libjasper/include/jasper/jas_config.h"
+
+
+############################################################
+# Generate the makefiles.
+############################################################
+
+                                                                                                                                                                          ac_config_files="$ac_config_files Makefile src/Makefile src/appl/Makefile src/libjasper/Makefile src/libjasper/base/Makefile src/libjasper/bmp/Makefile src/libjasper/include/Makefile src/libjasper/include/jasper/Makefile src/libjasper/jp2/Makefile src/libjasper/jpc/Makefile src/libjasper/jpg/Makefile src/libjasper/mif/Makefile src/libjasper/pgx/Makefile src/libjasper/pnm/Makefile src/libjasper/ras/Makefile src/msvc/Makefile jasper.spec"
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+{
+  (set) 2>&1 |
+    case `(ac_space=' '; set | grep ac_space) 2>&1` in
+    *ac_space=\ *)
+      # `set' does not quote correctly, so add quotes (double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \).
+      sed -n \
+       "s/'/'\\\\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;;
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n \
+       "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      ;;
+    esac;
+} |
+  sed '
+     t clear
+     : clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     : end' >>confcache
+if diff $cache_file confcache >/dev/null 2>&1; then :; else
+  if test -w $cache_file; then
+    test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+    cat confcache >$cache_file
+  else
+    echo "not updating unwritable cache $cache_file"
+  fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[         ]*VPATH[        ]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@srcdir@:*/:/;
+s/^\([^=]*=[    ]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[      ]*$//;
+}'
+fi
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_i=`echo "$ac_i" |
+        sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+  # 2. Add them.
+  ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_LIBJPEG_TRUE}" && test -z "${HAVE_LIBJPEG_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_LIBJPEG\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_LIBJPEG\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_OPENGL_TRUE}" && test -z "${HAVE_OPENGL_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_OPENGL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_OPENGL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)$' \| \
+        .     : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+         /^X\/\(\/\/\)$/{ s//\1/; q; }
+         /^X\/\(\/\).*/{ s//\1/; q; }
+         s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
+  # Find who we are.  Look in the path if we contain no path at all
+  # relative or not.
+  case $0 in
+    *[\\/]* ) as_myself=$0 ;;
+    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+       ;;
+  esac
+  # We did not find ourselves, most probably we were run as `sh COMMAND'
+  # in which case we are not to be found in the path.
+  if test "x$as_myself" = x; then
+    as_myself=$0
+  fi
+  if test ! -f "$as_myself"; then
+    { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
+echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+  case $CONFIG_SHELL in
+  '')
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for as_base in sh bash ksh sh5; do
+        case $as_dir in
+        /*)
+          if ("$as_dir/$as_base" -c '
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
+            $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+            $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+            CONFIG_SHELL=$as_dir/$as_base
+            export CONFIG_SHELL
+            exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+          fi;;
+        esac
+       done
+done
+;;
+  esac
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line before each line; the second 'sed' does the real
+  # work.  The second script uses 'N' to pair each line-number line
+  # with the numbered line, and appends trailing '-' during
+  # substitution so that $LINENO is not a special case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
+  sed '=' <$as_myself |
+    sed '
+      N
+      s,$,-,
+      : loop
+      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      t loop
+      s,-$,,
+      s,^['$as_cr_digits']*\n,,
+    ' >$as_me.lineno &&
+  chmod +x $as_me.lineno ||
+    { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
+echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensible to this).
+  . ./$as_me.lineno
+  # Exit status is that of the last command.
+  exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+  *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T='     ' ;;
+  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more generic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conf$$.exe; then
+    # Don't use ln at all; we don't have any links
+    as_ln_s='cp -p'
+  else
+    as_ln_s='ln -s'
+  fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS="  $as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+exec 6>&1
+
+# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.  Logging --version etc. is OK.
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+} >&5
+cat >&5 <<_CSEOF
+
+This file was extended by jasper $as_me 1.900.1, which was
+generated by GNU Autoconf 2.59.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+_CSEOF
+echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
+echo >&5
+_ACEOF
+
+# Files that config.status was made for.
+if test -n "$ac_config_files"; then
+  echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_headers"; then
+  echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_links"; then
+  echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_commands"; then
+  echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number, then exit
+  -q, --quiet      do not print progress messages
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+  --file=FILE[:TEMPLATE]
+                  instantiate the configuration file FILE
+  --header=FILE[:TEMPLATE]
+                  instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf@gnu.org>."
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+jasper config.status 1.900.1
+configured by $0, generated by GNU Autoconf 2.59,
+  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2003 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+srcdir=$srcdir
+INSTALL="$INSTALL"
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value.  By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=*)
+    ac_option=`expr "x$1" : 'x\([^=]*\)='`
+    ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  -*)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  *) # This is not an option, so the user has probably given explicit
+     # arguments.
+     ac_option=$1
+     ac_need_defaults=false;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --vers* | -V )
+    echo "$ac_cs_version"; exit 0 ;;
+  --he | --h)
+    # Conflict between --help and --header
+    { { echo "$as_me:$LINENO: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2;}
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    echo "$ac_cs_usage"; exit 0 ;;
+  --debug | --d* | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+    ac_need_defaults=false;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2;}
+   { (exit 1); exit 1; }; } ;;
+
+  *) ac_config_targets="$ac_config_targets $1" ;;
+
+  esac
+  shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+  echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+  exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+#
+# INIT-COMMANDS section.
+#
+
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_config_target in $ac_config_targets
+do
+  case "$ac_config_target" in
+  # Handling of arguments.
+  "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+  "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
+  "src/appl/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/appl/Makefile" ;;
+  "src/libjasper/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/libjasper/Makefile" ;;
+  "src/libjasper/base/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/libjasper/base/Makefile" ;;
+  "src/libjasper/bmp/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/libjasper/bmp/Makefile" ;;
+  "src/libjasper/include/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/libjasper/include/Makefile" ;;
+  "src/libjasper/include/jasper/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/libjasper/include/jasper/Makefile" ;;
+  "src/libjasper/jp2/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/libjasper/jp2/Makefile" ;;
+  "src/libjasper/jpc/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/libjasper/jpc/Makefile" ;;
+  "src/libjasper/jpg/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/libjasper/jpg/Makefile" ;;
+  "src/libjasper/mif/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/libjasper/mif/Makefile" ;;
+  "src/libjasper/pgx/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/libjasper/pgx/Makefile" ;;
+  "src/libjasper/pnm/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/libjasper/pnm/Makefile" ;;
+  "src/libjasper/ras/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/libjasper/ras/Makefile" ;;
+  "src/msvc/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/msvc/Makefile" ;;
+  "jasper.spec" ) CONFIG_FILES="$CONFIG_FILES jasper.spec" ;;
+  "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+  "src/libjasper/include/jasper/jas_config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS src/libjasper/include/jasper/jas_config.h" ;;
+  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason to put it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+  trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./confstat$$-$RANDOM
+  (umask 077 && mkdir $tmp)
+} ||
+{
+   echo "$me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+
+#
+# CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "\$CONFIG_FILES"; then
+  # Protect against being on the right side of a sed subst in config.status.
+  sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
+   s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
+s,@SHELL@,$SHELL,;t t
+s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s,@exec_prefix@,$exec_prefix,;t t
+s,@prefix@,$prefix,;t t
+s,@program_transform_name@,$program_transform_name,;t t
+s,@bindir@,$bindir,;t t
+s,@sbindir@,$sbindir,;t t
+s,@libexecdir@,$libexecdir,;t t
+s,@datadir@,$datadir,;t t
+s,@sysconfdir@,$sysconfdir,;t t
+s,@sharedstatedir@,$sharedstatedir,;t t
+s,@localstatedir@,$localstatedir,;t t
+s,@libdir@,$libdir,;t t
+s,@includedir@,$includedir,;t t
+s,@oldincludedir@,$oldincludedir,;t t
+s,@infodir@,$infodir,;t t
+s,@mandir@,$mandir,;t t
+s,@build_alias@,$build_alias,;t t
+s,@host_alias@,$host_alias,;t t
+s,@target_alias@,$target_alias,;t t
+s,@DEFS@,$DEFS,;t t
+s,@ECHO_C@,$ECHO_C,;t t
+s,@ECHO_N@,$ECHO_N,;t t
+s,@ECHO_T@,$ECHO_T,;t t
+s,@LIBS@,$LIBS,;t t
+s,@build@,$build,;t t
+s,@build_cpu@,$build_cpu,;t t
+s,@build_vendor@,$build_vendor,;t t
+s,@build_os@,$build_os,;t t
+s,@host@,$host,;t t
+s,@host_cpu@,$host_cpu,;t t
+s,@host_vendor@,$host_vendor,;t t
+s,@host_os@,$host_os,;t t
+s,@target@,$target,;t t
+s,@target_cpu@,$target_cpu,;t t
+s,@target_vendor@,$target_vendor,;t t
+s,@target_os@,$target_os,;t t
+s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
+s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
+s,@INSTALL_DATA@,$INSTALL_DATA,;t t
+s,@CYGPATH_W@,$CYGPATH_W,;t t
+s,@PACKAGE@,$PACKAGE,;t t
+s,@VERSION@,$VERSION,;t t
+s,@ACLOCAL@,$ACLOCAL,;t t
+s,@AUTOCONF@,$AUTOCONF,;t t
+s,@AUTOMAKE@,$AUTOMAKE,;t t
+s,@AUTOHEADER@,$AUTOHEADER,;t t
+s,@MAKEINFO@,$MAKEINFO,;t t
+s,@install_sh@,$install_sh,;t t
+s,@STRIP@,$STRIP,;t t
+s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
+s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
+s,@mkdir_p@,$mkdir_p,;t t
+s,@AWK@,$AWK,;t t
+s,@SET_MAKE@,$SET_MAKE,;t t
+s,@am__leading_dot@,$am__leading_dot,;t t
+s,@AMTAR@,$AMTAR,;t t
+s,@am__tar@,$am__tar,;t t
+s,@am__untar@,$am__untar,;t t
+s,@JAS_MAJOR_VERSION@,$JAS_MAJOR_VERSION,;t t
+s,@JAS_MINOR_VERSION@,$JAS_MINOR_VERSION,;t t
+s,@JAS_MICRO_VERSION@,$JAS_MICRO_VERSION,;t t
+s,@JAS_VERSION@,$JAS_VERSION,;t t
+s,@JAS_RPM_RELEASE@,$JAS_RPM_RELEASE,;t t
+s,@LT_RELEASE@,$LT_RELEASE,;t t
+s,@LT_CURRENT@,$LT_CURRENT,;t t
+s,@LT_REVISION@,$LT_REVISION,;t t
+s,@LT_AGE@,$LT_AGE,;t t
+s,@CC@,$CC,;t t
+s,@CFLAGS@,$CFLAGS,;t t
+s,@LDFLAGS@,$LDFLAGS,;t t
+s,@CPPFLAGS@,$CPPFLAGS,;t t
+s,@ac_ct_CC@,$ac_ct_CC,;t t
+s,@EXEEXT@,$EXEEXT,;t t
+s,@OBJEXT@,$OBJEXT,;t t
+s,@DEPDIR@,$DEPDIR,;t t
+s,@am__include@,$am__include,;t t
+s,@am__quote@,$am__quote,;t t
+s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t
+s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t
+s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
+s,@CCDEPMODE@,$CCDEPMODE,;t t
+s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
+s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
+s,@RANLIB@,$RANLIB,;t t
+s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
+s,@SED@,$SED,;t t
+s,@EGREP@,$EGREP,;t t
+s,@LN_S@,$LN_S,;t t
+s,@ECHO@,$ECHO,;t t
+s,@AR@,$AR,;t t
+s,@ac_ct_AR@,$ac_ct_AR,;t t
+s,@CPP@,$CPP,;t t
+s,@CXX@,$CXX,;t t
+s,@CXXFLAGS@,$CXXFLAGS,;t t
+s,@ac_ct_CXX@,$ac_ct_CXX,;t t
+s,@CXXDEPMODE@,$CXXDEPMODE,;t t
+s,@am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t
+s,@am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t
+s,@CXXCPP@,$CXXCPP,;t t
+s,@F77@,$F77,;t t
+s,@FFLAGS@,$FFLAGS,;t t
+s,@ac_ct_F77@,$ac_ct_F77,;t t
+s,@LIBTOOL@,$LIBTOOL,;t t
+s,@X_CFLAGS@,$X_CFLAGS,;t t
+s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
+s,@X_LIBS@,$X_LIBS,;t t
+s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
+s,@HAVE_LIBJPEG_TRUE@,$HAVE_LIBJPEG_TRUE,;t t
+s,@HAVE_LIBJPEG_FALSE@,$HAVE_LIBJPEG_FALSE,;t t
+s,@HAVE_OPENGL_TRUE@,$HAVE_OPENGL_TRUE,;t t
+s,@HAVE_OPENGL_FALSE@,$HAVE_OPENGL_FALSE,;t t
+s,@OPENGL_LIBS@,$OPENGL_LIBS,;t t
+s,@LIBOBJS@,$LIBOBJS,;t t
+s,@LTLIBOBJS@,$LTLIBOBJS,;t t
+CEOF
+
+_ACEOF
+
+  cat >>$CONFIG_STATUS <<\_ACEOF
+  # Split the substitutions into bite-sized pieces for seds with
+  # small command number limits, like on Digital OSF/1 and HP-UX.
+  ac_max_sed_lines=48
+  ac_sed_frag=1 # Number of current file.
+  ac_beg=1 # First line for current file.
+  ac_end=$ac_max_sed_lines # Line after last line for current file.
+  ac_more_lines=:
+  ac_sed_cmds=
+  while $ac_more_lines; do
+    if test $ac_beg -gt 1; then
+      sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+    else
+      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+    fi
+    if test ! -s $tmp/subs.frag; then
+      ac_more_lines=false
+    else
+      # The purpose of the label and of the branching condition is to
+      # speed up the sed processing (if there are no `@' at all, there
+      # is no need to browse any of the substitutions).
+      # These are the two extra sed commands mentioned above.
+      (echo ':t
+  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+      if test -z "$ac_sed_cmds"; then
+       ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+      else
+       ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+      fi
+      ac_sed_frag=`expr $ac_sed_frag + 1`
+      ac_beg=$ac_end
+      ac_end=`expr $ac_end + $ac_max_sed_lines`
+    fi
+  done
+  if test -z "$ac_sed_cmds"; then
+    ac_sed_cmds=cat
+  fi
+fi # test -n "$CONFIG_FILES"
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case $ac_file in
+  - | *:- | *:-:* ) # input from stdin
+       cat >$tmp/stdin
+       ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+       ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+       ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  * )   ac_file_in=$ac_file.in ;;
+  esac
+
+  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+  ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$ac_file" : 'X\(//\)[^/]' \| \
+        X"$ac_file" : 'X\(//\)$' \| \
+        X"$ac_file" : 'X\(/\)' \| \
+        .     : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+         /^X\(\/\/\)$/{ s//\1/; q; }
+         /^X\(\/\).*/{ s//\1/; q; }
+         s/.*/./; q'`
+  { if $as_mkdir_p; then
+    mkdir -p "$ac_dir"
+  else
+    as_dir="$ac_dir"
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| \
+        .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+         /^X\(\/\/\)$/{ s//\1/; q; }
+         /^X\(\/\).*/{ s//\1/; q; }
+         s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+  ac_builddir=.
+
+if test "$ac_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+  .)  # No --srcdir option.  We are building in place.
+    ac_srcdir=.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
+
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
+  esac
+
+  if test x"$ac_file" != x-; then
+    { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    rm -f "$ac_file"
+  fi
+  # Let's still pretend it is `configure' which instantiates (i.e., don't
+  # use $as_me), people would be surprised to read:
+  #    /* config.h.  Generated by config.status.  */
+  if test x"$ac_file" = x-; then
+    configure_input=
+  else
+    configure_input="$ac_file.  "
+  fi
+  configure_input=$configure_input"Generated from `echo $ac_file_in |
+                                    sed 's,.*/,,'` by configure."
+
+  # First look for the input files in the build tree, otherwise in the
+  # src tree.
+  ac_file_inputs=`IFS=:
+    for f in $ac_file_in; do
+      case $f in
+      -) echo $tmp/stdin ;;
+      [\\/$]*)
+        # Absolute (can't be DOS-style, as IFS=:)
+        test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+        echo "$f";;
+      *) # Relative
+        if test -f "$f"; then
+          # Build tree
+          echo "$f"
+        elif test -f "$srcdir/$f"; then
+          # Source tree
+          echo "$srcdir/$f"
+        else
+          # /dev/null tree
+          { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+        fi;;
+      esac
+    done` || { (exit 1); exit 1; }
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+  sed "$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s,@configure_input@,$configure_input,;t t
+s,@srcdir@,$ac_srcdir,;t t
+s,@abs_srcdir@,$ac_abs_srcdir,;t t
+s,@top_srcdir@,$ac_top_srcdir,;t t
+s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
+s,@builddir@,$ac_builddir,;t t
+s,@abs_builddir@,$ac_abs_builddir,;t t
+s,@top_builddir@,$ac_top_builddir,;t t
+s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
+s,@INSTALL@,$ac_INSTALL,;t t
+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+  rm -f $tmp/stdin
+  if test x"$ac_file" != x-; then
+    mv $tmp/out $ac_file
+  else
+    cat $tmp/out
+    rm -f $tmp/out
+  fi
+
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_HEADER section.
+#
+
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
+ac_dB='[        ].*$,\1#\2'
+ac_dC=' '
+ac_dD=',;t'
+# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
+ac_uB='$,\1#\2define\3'
+ac_uC=' '
+ac_uD=',;t'
+
+for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case $ac_file in
+  - | *:- | *:-:* ) # input from stdin
+       cat >$tmp/stdin
+       ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+       ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+       ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  * )   ac_file_in=$ac_file.in ;;
+  esac
+
+  test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+
+  # First look for the input files in the build tree, otherwise in the
+  # src tree.
+  ac_file_inputs=`IFS=:
+    for f in $ac_file_in; do
+      case $f in
+      -) echo $tmp/stdin ;;
+      [\\/$]*)
+        # Absolute (can't be DOS-style, as IFS=:)
+        test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+        # Do quote $f, to prevent DOS paths from being IFS'd.
+        echo "$f";;
+      *) # Relative
+        if test -f "$f"; then
+          # Build tree
+          echo "$f"
+        elif test -f "$srcdir/$f"; then
+          # Source tree
+          echo "$srcdir/$f"
+        else
+          # /dev/null tree
+          { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+        fi;;
+      esac
+    done` || { (exit 1); exit 1; }
+  # Remove the trailing spaces.
+  sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
+
+_ACEOF
+
+# Transform confdefs.h into two sed scripts, `conftest.defines' and
+# `conftest.undefs', that substitutes the proper values into
+# config.h.in to produce config.h.  The first handles `#define'
+# templates, and the second `#undef' templates.
+# And first: Protect against being on the right side of a sed subst in
+# config.status.  Protect against being in an unquoted here document
+# in config.status.
+rm -f conftest.defines conftest.undefs
+# Using a here document instead of a string reduces the quoting nightmare.
+# Putting comments in sed scripts is not portable.
+#
+# `end' is used to avoid that the second main sed command (meant for
+# 0-ary CPP macros) applies to n-ary macro definitions.
+# See the Autoconf documentation for `clear'.
+cat >confdef2sed.sed <<\_ACEOF
+s/[\\&,]/\\&/g
+s,[\\$`],\\&,g
+t clear
+: clear
+s,^[    ]*#[    ]*define[       ][      ]*\([^  (][^    (]*\)\(([^)]*)\)[       ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
+t end
+s,^[    ]*#[    ]*define[       ][      ]*\([^  ][^     ]*\)[   ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
+: end
+_ACEOF
+# If some macros were called several times there might be several times
+# the same #defines, which is useless.  Nevertheless, we may not want to
+# sort them, since we want the *last* AC-DEFINE to be honored.
+uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
+sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
+rm -f confdef2sed.sed
+
+# This sed command replaces #undef with comments.  This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+cat >>conftest.undefs <<\_ACEOF
+s,^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
+_ACEOF
+
+# Break up conftest.defines because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo '  # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
+echo '  if grep "^[     ]*#[    ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
+echo '  # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
+echo '  :' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.defines >/dev/null
+do
+  # Write a limited-size here document to $tmp/defines.sed.
+  echo '  cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
+  # Speed up: don't consider the non `#define' lines.
+  echo '/^[     ]*#[    ]*define/!b' >>$CONFIG_STATUS
+  # Work around the forget-to-reset-the-flag bug.
+  echo 't clr' >>$CONFIG_STATUS
+  echo ': clr' >>$CONFIG_STATUS
+  sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
+  echo 'CEOF
+  sed -f $tmp/defines.sed $tmp/in >$tmp/out
+  rm -f $tmp/in
+  mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+  sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
+  rm -f conftest.defines
+  mv conftest.tail conftest.defines
+done
+rm -f conftest.defines
+echo '  fi # grep' >>$CONFIG_STATUS
+echo >>$CONFIG_STATUS
+
+# Break up conftest.undefs because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo '  # Handle all the #undef templates' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.undefs >/dev/null
+do
+  # Write a limited-size here document to $tmp/undefs.sed.
+  echo '  cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
+  # Speed up: don't consider the non `#undef'
+  echo '/^[     ]*#[    ]*undef/!b' >>$CONFIG_STATUS
+  # Work around the forget-to-reset-the-flag bug.
+  echo 't clr' >>$CONFIG_STATUS
+  echo ': clr' >>$CONFIG_STATUS
+  sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
+  echo 'CEOF
+  sed -f $tmp/undefs.sed $tmp/in >$tmp/out
+  rm -f $tmp/in
+  mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+  sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
+  rm -f conftest.undefs
+  mv conftest.tail conftest.undefs
+done
+rm -f conftest.undefs
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+  # Let's still pretend it is `configure' which instantiates (i.e., don't
+  # use $as_me), people would be surprised to read:
+  #    /* config.h.  Generated by config.status.  */
+  if test x"$ac_file" = x-; then
+    echo "/* Generated by configure.  */" >$tmp/config.h
+  else
+    echo "/* $ac_file.  Generated by configure.  */" >$tmp/config.h
+  fi
+  cat $tmp/in >>$tmp/config.h
+  rm -f $tmp/in
+  if test x"$ac_file" != x-; then
+    if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
+      { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$ac_file" : 'X\(//\)[^/]' \| \
+        X"$ac_file" : 'X\(//\)$' \| \
+        X"$ac_file" : 'X\(/\)' \| \
+        .     : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+         /^X\(\/\/\)$/{ s//\1/; q; }
+         /^X\(\/\).*/{ s//\1/; q; }
+         s/.*/./; q'`
+      { if $as_mkdir_p; then
+    mkdir -p "$ac_dir"
+  else
+    as_dir="$ac_dir"
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| \
+        .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+         /^X\(\/\/\)$/{ s//\1/; q; }
+         /^X\(\/\).*/{ s//\1/; q; }
+         s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+      rm -f $ac_file
+      mv $tmp/config.h $ac_file
+    fi
+  else
+    cat $tmp/config.h
+    rm -f $tmp/config.h
+  fi
+# Compute $ac_file's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $ac_file | $ac_file:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null ||
+$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X$ac_file : 'X\(//\)[^/]' \| \
+        X$ac_file : 'X\(//\)$' \| \
+        X$ac_file : 'X\(/\)' \| \
+        .     : '\(.\)' 2>/dev/null ||
+echo X$ac_file |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+         /^X\(\/\/\)$/{ s//\1/; q; }
+         /^X\(\/\).*/{ s//\1/; q; }
+         s/.*/./; q'`/stamp-h$_am_stamp_count
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_COMMANDS section.
+#
+for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
+  ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
+  ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
+  ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
+$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$ac_dest" : 'X\(//\)[^/]' \| \
+        X"$ac_dest" : 'X\(//\)$' \| \
+        X"$ac_dest" : 'X\(/\)' \| \
+        .     : '\(.\)' 2>/dev/null ||
+echo X"$ac_dest" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+         /^X\(\/\/\)$/{ s//\1/; q; }
+         /^X\(\/\).*/{ s//\1/; q; }
+         s/.*/./; q'`
+  { if $as_mkdir_p; then
+    mkdir -p "$ac_dir"
+  else
+    as_dir="$ac_dir"
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| \
+        .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+         /^X\(\/\/\)$/{ s//\1/; q; }
+         /^X\(\/\).*/{ s//\1/; q; }
+         s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+  ac_builddir=.
+
+if test "$ac_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+  .)  # No --srcdir option.  We are building in place.
+    ac_srcdir=.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
+
+
+  { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
+echo "$as_me: executing $ac_dest commands" >&6;}
+  case $ac_dest in
+    depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
+  # Strip MF so we end up with the name of the file.
+  mf=`echo "$mf" | sed -e 's/:.*$//'`
+  # Check whether this is an Automake generated Makefile or not.
+  # We used to match only the files named `Makefile.in', but
+  # some people rename them; so instead we look at the file content.
+  # Grep'ing the first line is not enough: some people post-process
+  # each Makefile.in and add a new line on top of each file to say so.
+  # So let's grep whole file.
+  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+    dirpart=`(dirname "$mf") 2>/dev/null ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$mf" : 'X\(//\)[^/]' \| \
+        X"$mf" : 'X\(//\)$' \| \
+        X"$mf" : 'X\(/\)' \| \
+        .     : '\(.\)' 2>/dev/null ||
+echo X"$mf" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+         /^X\(\/\/\)$/{ s//\1/; q; }
+         /^X\(\/\).*/{ s//\1/; q; }
+         s/.*/./; q'`
+  else
+    continue
+  fi
+  # Extract the definition of DEPDIR, am__include, and am__quote
+  # from the Makefile without running `make'.
+  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+  test -z "$DEPDIR" && continue
+  am__include=`sed -n 's/^am__include = //p' < "$mf"`
+  test -z "am__include" && continue
+  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+  # When using ansi2knr, U may be empty or an underscore; expand it
+  U=`sed -n 's/^U = //p' < "$mf"`
+  # Find all dependency output files, they are included files with
+  # $(DEPDIR) in their names.  We invoke sed twice because it is the
+  # simplest approach to changing $(DEPDIR) to its actual value in the
+  # expansion.
+  for file in `sed -n "
+    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+    # Make sure the directory exists.
+    test -f "$dirpart/$file" && continue
+    fdir=`(dirname "$file") 2>/dev/null ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$file" : 'X\(//\)[^/]' \| \
+        X"$file" : 'X\(//\)$' \| \
+        X"$file" : 'X\(/\)' \| \
+        .     : '\(.\)' 2>/dev/null ||
+echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+         /^X\(\/\/\)$/{ s//\1/; q; }
+         /^X\(\/\).*/{ s//\1/; q; }
+         s/.*/./; q'`
+    { if $as_mkdir_p; then
+    mkdir -p $dirpart/$fdir
+  else
+    as_dir=$dirpart/$fdir
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| \
+        .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+         /^X\(\/\/\)$/{ s//\1/; q; }
+         /^X\(\/\).*/{ s//\1/; q; }
+         s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
+echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+ ;;
+  esac
+done
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || { (exit 1); exit 1; }
+fi
+
+
diff --git a/configure.ac b/configure.ac
new file mode 100644 (file)
index 0000000..9b53e0a
--- /dev/null
@@ -0,0 +1,405 @@
+dnl ****************************************************************************
+dnl Copyright (c) 2001-2004 Michael David Adams.
+dnl All rights reserved.
+dnl
+dnl The complete licensing terms for this software can be found in the file
+dnl named "LICENSE" in this software distribution.
+dnl ****************************************************************************
+
+dnl The package name.
+define(AC_JAS_NAME, jasper)
+
+dnl ************************************************************
+dnl Package version information.
+dnl ************************************************************
+
+dnl The major, minor, and micro version numbers of the package.
+define(AC_JAS_MAJOR_VERSION, 1)
+define(AC_JAS_MINOR_VERSION, 900)
+define(AC_JAS_MICRO_VERSION, 1)
+
+dnl The package version.
+define(AC_JAS_VERSION,
+  AC_JAS_MAJOR_VERSION.AC_JAS_MINOR_VERSION.AC_JAS_MICRO_VERSION)
+
+dnl ************************************************************
+dnl RPM version information.
+dnl ************************************************************
+
+define(AC_JAS_RPM_RELEASE, 1)
+
+dnl ************************************************************
+dnl Dynamically-linked library version information (for Libtool).
+dnl ************************************************************
+
+dnl Guidelines for updating these definitions:
+dnl 1) If the library source code has changed at all since the last update,
+dnl then increment REVISION.
+dnl 2) If any interfaces have been added, removed, or changed since the last
+dnl update, increment CURRENT, and set REVISION to zero.
+dnl 3) If any interfaces have been added since the last public release, then
+dnl increment AGE.
+dnl 4) If any interfaces have been removed since the last public release, then
+dnl set AGE to zero.
+
+dnl The most recent interface number that this library implements.
+define(AC_JAS_LT_CURRENT, 1)
+
+dnl The implementation number of the current interface.
+define(AC_JAS_LT_REVISION, 0)
+
+dnl The difference between the newest and oldest interfaces that this library
+dnl implements.  In other words, the library implements all of the interface
+dnl numbers in the range from current - age to current.
+define(AC_JAS_LT_AGE, 0)
+
+dnl The release number of the library.
+define(AC_JAS_LT_RELEASE, AC_JAS_MAJOR_VERSION.AC_JAS_MINOR_VERSION)
+
+dnl ****************************************************************************
+dnl NOTHING BELOW THIS LINE SHOULD REQUIRE MODIFICATION (IDEALLY :-)
+dnl ****************************************************************************
+
+dnl Initialize autoconf.
+AC_INIT(AC_JAS_NAME, AC_JAS_VERSION)
+AC_PREREQ(2.59)
+AC_CONFIG_SRCDIR(README)
+dnl Note: Avoid the temptation to call the auxiliary directory "aux" because
+dnl Microsoft Windows will barf if you try to use "aux" as a directory name. :-(
+AC_CONFIG_AUX_DIR(acaux)
+
+# Detect the canonical host and target build environment.
+# Note: This precedes automake initialization to avoid warnings.
+AC_CANONICAL_BUILD
+AC_CANONICAL_HOST
+AC_CANONICAL_TARGET
+
+# Initialize automake.
+AM_INIT_AUTOMAKE
+
+# Initialize version information parameters.
+JAS_MAJOR_VERSION=AC_JAS_MAJOR_VERSION
+JAS_MINOR_VERSION=AC_JAS_MINOR_VERSION
+JAS_MICRO_VERSION=AC_JAS_MICRO_VERSION
+JAS_VERSION=AC_JAS_VERSION
+AC_SUBST(JAS_MAJOR_VERSION)
+AC_SUBST(JAS_MINOR_VERSION)
+AC_SUBST(JAS_MICRO_VERSION)
+AC_SUBST(JAS_VERSION)
+AC_DEFINE_UNQUOTED(JAS_VERSION, "$JAS_VERSION")
+JAS_RPM_RELEASE=AC_JAS_RPM_RELEASE
+AC_SUBST(JAS_RPM_RELEASE)
+
+# Initialize version information for libtool.
+LT_RELEASE=AC_JAS_LT_RELEASE
+LT_CURRENT=AC_JAS_LT_CURRENT
+LT_REVISION=AC_JAS_LT_REVISION
+LT_AGE=AC_JAS_LT_AGE
+AC_SUBST(LT_RELEASE)
+AC_SUBST(LT_CURRENT)
+AC_SUBST(LT_REVISION)
+AC_SUBST(LT_AGE)
+
+# Indicate a configure-based build is being used.
+AC_DEFINE(JAS_CONFIGURE)
+
+############################################################
+# Configuration header file.
+############################################################
+
+AH_TEMPLATE([DEBUG_OVERFLOW], [Debugging overflow detection])
+AH_TEMPLATE([JAS_CONFIGURE], [JasPer configure])
+AH_TEMPLATE([JAS_VERSION], [JasPer version])
+AH_TEMPLATE([DEBUG_MEMALLOC], [Debugging memory allocator])
+AH_TEMPLATE([DEBUG], [Extra debugging support])
+AH_TEMPLATE([HAVE_VLA], [Have variable length arrays])
+
+AH_TOP([
+/* Avoid problems due to multiple inclusion. */
+#ifndef JAS_CONFIG_H
+#define JAS_CONFIG_H
+
+/* This preprocessor symbol identifies the version of JasPer. */
+#undef JAS_VERSION
+/* If configure is being used, this symbol will be defined automatically
+  at this point in the configuration header file. */
+
+/* The preprocessor symbol JAS_WIN_MSVC_BUILD should not be defined
+  unless the JasPer software is being built under Microsoft Windows
+  using Microsoft Visual C. */
+#if !defined(JAS_WIN_MSVC_BUILD)
+/* A configure-based build is being used. */
+
+])
+
+AH_BOTTOM([
+#else
+/* A configure-based build is not being used. */
+#include <jasper/jas_config2.h>
+#endif
+
+#endif
+])
+
+############################################################
+# Checks for programs.
+############################################################
+
+AC_PROG_CC
+AC_PROG_INSTALL
+AC_PROG_RANLIB
+# AC_PROG_AWK
+# AC_PROG_CPP
+# AC_PROG_LN_S
+
+AM_DISABLE_SHARED
+AC_PROG_LIBTOOL
+
+AC_PATH_XTRA
+
+AC_MSG_CHECKING(whether variable-length arrays are supported)
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
+       int n; int foo[n];
+]])],[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_VLA)],[AC_MSG_RESULT(no)])
+
+dnl AC_TRY_COMPILE is obsolete
+dnl AC_TRY_COMPILE([], [
+dnl    int n; int foo[n];
+dnl ], [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_VLA)], AC_MSG_RESULT(no))
+
+############################################################
+# Check for the IJG JPEG library.
+############################################################
+
+# Allow the user to explicitly specify whether the JPEG library is present.
+AC_ARG_ENABLE(libjpeg,
+[  --disable-libjpeg    Force the IJG JPEG library to be ignored],
+[
+case "${enableval}" in
+yes)
+       ENABLE_LIBJPEG=yes;;
+no)
+       ENABLE_LIBJPEG=no;;
+*)
+       AC_MSG_ERROR(bad value ${enableval} for --disable-libjpeg)
+       ;;
+esac
+], ENABLE_LIBJPEG=yes)
+
+HAVE_LIBJPEG=no
+if test $ENABLE_LIBJPEG = yes; then
+       # Check for the JPEG library.
+       AC_CHECK_LIB(jpeg, jpeg_destroy, HAVE_LIBJPEG=yes, HAVE_LIBJPEG=no)
+       if test $HAVE_LIBJPEG = yes; then
+               LIBS="$LIBS -ljpeg"
+       fi
+fi
+AM_CONDITIONAL(HAVE_LIBJPEG, test $HAVE_LIBJPEG = yes)
+
+############################################################
+# Check for OpenGL libraries.
+############################################################
+
+AC_ARG_WITH(glut-include-dir,
+[  --with-glut-include-dir=DIR    Set GLUT include directory.],
+[
+       case "$withval" in
+       /*)
+               CFLAGS="$CFLAGS -I$withval"
+               CPPFLAGS="$CPPFLAGS -I$withval";;
+       *)
+               AC_MSG_ERROR(--with-glut-include-dir requires absolute path)
+               ;;
+       esac
+],
+)
+AC_ARG_WITH(glut-lib-dir,
+[  --with-glut-lib-dir=DIR        Set GLUT library directory.],
+[
+       case "$withval" in
+       /*)
+               LIBS="$LIBS -L$withval";;
+       *)
+               AC_MSG_ERROR(--with-glut-lib-dir requires absolute path)
+               ;;
+       esac
+],
+)
+
+AC_ARG_ENABLE(opengl,
+[  --disable-opengl    Disable use of OpenGL. ],
+[
+       case "$enableval" in
+       yes)
+               ENABLE_OPENGL=yes;;
+       no)
+               ENABLE_OPENGL=no;;
+       *)
+               AC_MSG_ERROR(bad value ${enableval} for --disable-libjpeg)
+               ;;
+       esac
+],
+ENABLE_OPENGL=yes)
+
+HAVE_OPENGL=no
+OPENGL_LIBS=""
+if test $ENABLE_OPENGL = yes; then
+       if test $HAVE_OPENGL = no; then
+               TMPLIBS="-lglut -lGL -lGLU $X_PRE_LIBS -lX11 -lXmu -lXi -lXext -lXt $X_EXTRA_LIBS $X_LIBS"
+               AC_CHECK_LIB(glut, glutInit, [HAVE_OPENGL=yes;
+                 OPENGL_LIBS=$TMPLIBS], HAVE_OPENGL=no, $TMPLIBS)
+       fi
+       AC_CHECK_HEADER(GL/glut.h,, [HAVE_OPENGL=no; OPENGL_LIBS="";])
+fi
+
+AM_CONDITIONAL(HAVE_OPENGL, test $HAVE_OPENGL = yes)
+AC_SUBST(OPENGL_LIBS)
+AC_MSG_CHECKING([whether OpenGL libraries and headers were detected])
+AC_MSG_RESULT($HAVE_OPENGL)
+
+############################################################
+# Check for other libraries.
+############################################################
+
+# Check for the math library.
+AC_CHECK_LIB(m, main)
+
+############################################################
+# Check for header files.
+############################################################
+
+AC_HEADER_STDC
+AC_CHECK_HEADERS(fcntl.h limits.h unistd.h stdint.h stdbool.h io.h windows.h sys/types.h sys/time.h stdlib.h stddef.h)
+
+############################################################
+# Check for typedefs, structures, and compiler characteristics.
+############################################################
+
+AC_C_CONST
+AC_C_INLINE
+AC_TYPE_SIZE_T
+dnl AC_CHECK_TYPE(bool, int)
+AC_CHECK_TYPE(uchar, unsigned char)
+AC_CHECK_TYPE(ushort, unsigned short)
+AC_CHECK_TYPE(uint, unsigned int)
+AC_CHECK_TYPE(ulong, unsigned long)
+AC_CHECK_TYPE(longlong, long long)
+AC_CHECK_TYPE(ulonglong, unsigned long long)
+AC_CHECK_TYPE(ssize_t, int)
+AC_CHECK_FUNCS(gettimeofday)
+AC_CHECK_FUNCS(getrusage)
+
+############################################################
+# Checks for library functions.
+############################################################
+
+AC_FUNC_VPRINTF
+
+############################################################
+# Enable/disable special memory allocator for debugging.
+############################################################
+
+AC_ARG_ENABLE(dmalloc,
+[  --enable-dmalloc    use special memory allocator for debugging],
+[
+case "${enableval}" in
+yes)
+       AC_DEFINE(DEBUG_MEMALLOC)
+       ;;
+no)
+       ;;
+*)
+       AC_MSG_ERROR(bad value ${enableval} for --enable-dmalloc)
+       ;;
+esac
+], )
+
+############################################################
+# Enable/disable extra code for debugging.
+############################################################
+
+AC_ARG_ENABLE(debug,
+[  --enable-debug    add extra code for debugging],
+[
+case "${enableval}" in
+yes)
+       debug=yes
+       AC_DEFINE(DEBUG)
+       AC_DEFINE(DEBUG_OVERFLOW)
+       if test "$GCC" = yes; then
+               CFLAGS="-g -O0"
+       fi
+       ;;
+no)
+       debug=no
+       ;;
+*)
+       AC_MSG_ERROR(bad value ${enableval} for --enable-debug)
+       ;;
+esac
+], [debug=no])
+
+if test "$GCC" = yes; then
+       CFLAGS="$CFLAGS"
+       #CFLAGS="$CFLAGS -std=c99"
+       #CFLAGS="$CFLAGS -pedantic"
+       #CFLAGS="$CFLAGS -pedantic-errors"
+       #CFLAGS="$CFLAGS -W -Wall -Wno-long-long -Wformat -Wmissing-prototypes -Wstrict-prototypes"
+fi
+
+############################################################
+# Extra stuff for research purposes.
+############################################################
+
+AC_ARG_ENABLE(special0,
+[  --enable-special0    enable something],
+[
+case "${enableval}" in
+yes)
+       if test "$GCC" = yes; then
+               CFLAGS="-g -O0"
+       fi
+       ;;
+no)
+       ;;
+*)
+       AC_MSG_ERROR(bad value ${enableval} for --enable-special0)
+       ;;
+esac
+], [])
+
+if test -n "$EXTRACFLAGS"; then
+       CFLAGS="$CFLAGS $EXTRACFLAGS"
+fi
+
+############################################################
+# Generate the configuration header file.
+############################################################
+
+AC_CONFIG_HEADERS([src/libjasper/include/jasper/jas_config.h])
+
+############################################################
+# Generate the makefiles.
+############################################################
+
+AC_CONFIG_FILES([
+Makefile
+src/Makefile
+src/appl/Makefile
+src/libjasper/Makefile
+src/libjasper/base/Makefile
+src/libjasper/bmp/Makefile
+src/libjasper/include/Makefile
+src/libjasper/include/jasper/Makefile
+src/libjasper/jp2/Makefile
+src/libjasper/jpc/Makefile
+src/libjasper/jpg/Makefile
+src/libjasper/mif/Makefile
+src/libjasper/pgx/Makefile
+src/libjasper/pnm/Makefile
+src/libjasper/ras/Makefile
+src/msvc/Makefile
+jasper.spec
+])
+AC_OUTPUT
+
diff --git a/data/colorprofiles/README b/data/colorprofiles/README
new file mode 100644 (file)
index 0000000..a9be7b0
--- /dev/null
@@ -0,0 +1,18 @@
+This directory contains a number of ICC color profiles.
+
+Some of the more important profiles include:
+
+sgray.icm
+       JPEG-2000 JP2 standard gray enumerated color space
+       This profile was provided by Scott Houchin of Kodak.
+
+srgb.icm
+       JPEG-2000 JP2 standard RGB (i.e., sRGB) enumerated color space
+       This profile was provided by Scott Houchin of Kodak.
+
+sycc.icm
+       JPEG-2000 JP2 standard YCC enumerated color space
+       This profile was provided by Jack Holm of Hewlett Packard.
+
+A number of other profiles in this directory were provided by Scott
+Houchin of Kodak.
diff --git a/data/colorprofiles/erimm.icm b/data/colorprofiles/erimm.icm
new file mode 100644 (file)
index 0000000..956fa54
Binary files /dev/null and b/data/colorprofiles/erimm.icm differ
diff --git a/data/colorprofiles/esrgb.icm b/data/colorprofiles/esrgb.icm
new file mode 100644 (file)
index 0000000..28f9a0b
Binary files /dev/null and b/data/colorprofiles/esrgb.icm differ
diff --git a/data/colorprofiles/esrgbgrey.icm b/data/colorprofiles/esrgbgrey.icm
new file mode 100644 (file)
index 0000000..92e5fde
Binary files /dev/null and b/data/colorprofiles/esrgbgrey.icm differ
diff --git a/data/colorprofiles/grey.icm b/data/colorprofiles/grey.icm
new file mode 100644 (file)
index 0000000..3ea8aed
Binary files /dev/null and b/data/colorprofiles/grey.icm differ
diff --git a/data/colorprofiles/greyromm.icm b/data/colorprofiles/greyromm.icm
new file mode 100644 (file)
index 0000000..fb85fcb
Binary files /dev/null and b/data/colorprofiles/greyromm.icm differ
diff --git a/data/colorprofiles/romm.icm b/data/colorprofiles/romm.icm
new file mode 100644 (file)
index 0000000..3145cff
Binary files /dev/null and b/data/colorprofiles/romm.icm differ
diff --git a/data/colorprofiles/sgray.icm b/data/colorprofiles/sgray.icm
new file mode 100644 (file)
index 0000000..aa3c808
Binary files /dev/null and b/data/colorprofiles/sgray.icm differ
diff --git a/data/colorprofiles/srgb.icm b/data/colorprofiles/srgb.icm
new file mode 100644 (file)
index 0000000..7f9d18d
Binary files /dev/null and b/data/colorprofiles/srgb.icm differ
diff --git a/data/colorprofiles/sycc.icm b/data/colorprofiles/sycc.icm
new file mode 100644 (file)
index 0000000..30ae7c1
Binary files /dev/null and b/data/colorprofiles/sycc.icm differ
diff --git a/data/images/README b/data/images/README
new file mode 100644 (file)
index 0000000..851b8d6
--- /dev/null
@@ -0,0 +1,11 @@
+This directory contains numerous test images, stored in various formats.
+
+goldenears
+goldenears_gray
+       A picture taken at Golden Ears Provincial Park,
+       located near Maple Ridge, BC, Canada.
+
+stawamuschief
+stawamuschief_gray
+       A picture taken at Stawamus Chief Provincial Park,
+       located close to Squamish, BC, Canada.
diff --git a/data/images/example.mif b/data/images/example.mif
new file mode 100644 (file)
index 0000000..a3da788
--- /dev/null
@@ -0,0 +1,11 @@
+MIF
+component tlx=0 tly=0 sampperx=4 samppery=2 width=32 height=64 prec=8 sgnd=0
+component tlx=0 tly=0 sampperx=2 samppery=4 width=64 height=32 prec=8 sgnd=1
+end
+P5
+32 64
+255
+||||\83\83\83\83\83\8b\8b\8b\83\8b\93\9c\9c£¬¬£¬¬¬¬¬¬££\9c££|||\83\83\83\83\83\83\83\8b\8b\8b\8b\93\9c£¬¬¬¬¬¬¬¬¬¬££££\9c\83|\83|\83\83\83\83\83\8b\8b\8b\8b\8b\93\9c£¬´¬¬´¬¬¬¬¬£££\9c\9c\83\83\83\83\83\83\83\83\83\8b\8b\8b\93\93\9c£¬¬¬¬´´´´´´¬££££\9c\83\83\83\83\83\83\8b\8b\8b\8b\8b\8b\93\93\9c£¬¬¬´´´´´´´¬¬£\9c\9c\9c\83\83\83\83\8b\8b\8b\8b\8b\8b\8b\93\9c\9c£¬¬¬´´´´´»´¬¬¬£\9c\9c\9c\8b\83\83\8b\8b\8b\8b\8b\8b\93\9c\9c££¬¬´´»»»»»»»´´¬¬£\9c\9c\8b\8b\83\8b\8b\8b\8b\93\9c££££¬¬´´»»»»»»´»»»´¬££¬\8b\8b\8b\8b\8b\93\93\9c\9c¬¬¬´´´¬´´´´»»»»»´´´¬¬´¬\8b\8b\8b\8b\93\9c\9c££¬´´´´´¬¬´¬´´´»»´´´´´´´´\8b\8b\93\93\9c\9c££¬¬´´´´¬´¬´¬´´´´´´´´´´´´´\93\8b\93\93\93£¬¬´´¬´´´¬¬´¬´´´´´´»»»´´´´¬\93\93\93\9c££¬´´´»»»»´´´´»»»»»»Ãû»»»´»\93\9c\9c££¬´´»»»»»Ãû»»»»»ÃÃÃÃÃÃÃÃÃÃÃ\9c\9c££¬´´´»»»ÃÃÃÃÃû»ÃÃÃÃÃÃËËËËËÃÃ\9c£££¬¬¬´´´»ÃÃÃÃÃÃûÃÃÃÃÃÃÃÃÃÃÃÃÃ\9c££¬¬¬¬¬´´»»»»»»»»»»»ÃÃÃÃÃÃÃÃÃÃÃ\9c\9c££¬£¬¬¬¬¬¬¬¬¬´´¬´´´»»»»»ÃÃûÃÃ\9c\9c£££££££¬£££££¬¬¬¬¬¬´´»»ÃûÃÃÃÃ\9c\9c\9c£\9c\9c£££££££¬£¬¬¬´»ÃÃÃËËËËËËËËË\9c\9c£££££££££¬¬¬¬¬´»ÃÃËËÒÒÒÒÒÒÒÒÒÒ£££££££££££¬¬¬¬´»»ÃÃÃÃËËËËËËËËËË£££££££££¬¬¬¬¬¬´»»»ÃÃÃÃÃËËËÃÃÃÃ㬣£££¬£¬£¬¬¬¬¬´´»ÃÃÃÃÃÃÃËÃÃÃÃÃ㣣¬¬¬¬¬´¬´´´´´´´´»ÃÃÃÃÃÃÃÃÃÃÃÃˬ¬¬´´´´»»»»»»»»»»»´»»Ã»ÃÃÃÃËËËËË´´´´´´´»»´»»»»»»»»ÃÃÃÃÃÃËËËÃÃËËˬ¬´´´´´´´»Ã´´´ÃûÃÃËËËËËûÃÃÃÃË´´´»´´»»»Ã£|ldds\93ÃÃÃËô£\83lls\83\8b\9c\83[´´´´´»»»\83SSSS[[[|¬Ã¬|dSSS[SSS[S[»»´´´»»\8bKSSS[[[d[[lSS[S[[[[[[[[[\83\8b¬¬£\8bsSSSSSS[[[[[SS[[[[[S[[S[SSSSS[SKKSSSSSSS[[[[[S[[[[S[SSSSSSSSSSSSSSKSSSSS[S[d[S[SS[S[SS[SSSSSSSSKSSSSSKSSS[[[[[[SS[[S[SSSSSKSSKKSKSSSSSSSSSSSSSSSSSSSSSSSKKKKSKSKKSKSSSSSSS[SSSSSSSSSSKKKKKKSKKSSSSSSKKSSSSS[[SSSSSSSKKKKKK;;;KDDKKSSSS[SS[S[SSSSSKKKKDKKDK,,,,,444;;KDKSSSS[SSSSKKKKKKKKKD4,$,,,,$,,44,44;;DDKDKKKKKKKKKDD,,$,$,,,,,,,4,,,,44,44;;;;DDD;;;,$$,$,,,,,,,,,4,4,4,,4,,,444,444$,,,,$$$$$,,,,,,,,$,,,,$,,4,,,,,\e$,,$,,\e$$,,,,,,,,$$,,,,,$44,,,,$,$,$$,\e$\e\e,,$$,,,\e$44;,,$44;;;;;;4444;D4;;;DKKKS[[Sd[[dddllssslddllllsssssssss|||\83\83|\83\83\83|\83||\83|||llssss|sssssssss|\83|\83\83\83||||||||||ssslssssslsssssl||||||||||||||||llllllsslldddllsss||||\83||\83||||\83|slsssllld[lllddlss\83|||||||||||||sld|lld[[[[[ddlsss||s|slsssss|slsd[lldlss[[[[d[ls|[dlll|l[ldS[sd[dl[dd[[[dd[Sdssllssls|llds|ddsdddld[[ld[l[SS[lldl|dl\83|ldSddllssssslsl[[[d[lldd[lssls|slssldslssll[[dlld[l[S[d[S[s||ls|||s||\83|s|[[d[dddlddslldds|\83|||ss|l[l|ssld[[lslllllld[dssslls|||\83ss|sd[lddldddslll[llssslsll\83\83ssss\83\83lsslssdllddddddlld[dllls\83\83|s|\83|\83\83\8b|s|sddlsllsssddddlll|\83ss|s\83||s|sssls[dlsssslslllldddddlsssssslldlll|P5
+64 32
+255
+||||\83\83\83\83\83\8b\8b\8b\83\8b\93\9c\9c£¬¬£¬¬¬¬¬¬££\9c££\9c\9c\93\93\9c\9c\93\93\9c\9c\93\93\93\93\9c\9c\9c\9c££¬¬´¬´´´¬´´»»|||\83\83\83\83\83\83\83\8b\8b\8b\8b\93\9c£¬¬¬¬¬¬¬¬¬¬££££\9c\9c\9c\93\93\9c\93\93\93\9c\9c\93\9c\93\93\9c\9c\9c£¬£¬´´´»»´´´´»´\83|\83|\83\83\83\83\83\8b\8b\8b\8b\8b\93\9c£¬´¬¬´¬¬¬¬¬£££\9c\9c\9c\9c\93\9c\93\93\93\9c\9c\9c\9c\9c££££¬¬¬¬´´»»»»»»»»»´\83\83\83\83\83\83\83\83\83\8b\8b\8b\93\93\9c£¬¬¬¬´´´´´´¬££££\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c££££¬¬´´´»»´»»»»»»»´´\83\83\83\83\83\83\8b\8b\8b\8b\8b\8b\93\93\9c£¬¬¬´´´´´´´¬¬£\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c££¬¬¬¬´´¬´´¬´´´´´´´´´\83\83\83\83\8b\8b\8b\8b\8b\8b\8b\93\9c\9c£¬¬¬´´´´´»´¬¬¬£\9c\9c\9c\9c\9c\9c\9c\9c£££££¬¬¬¬¬´´´´¬¬¬¬¬´´¬´´´´´\8b\83\83\8b\8b\8b\8b\8b\8b\93\9c\9c££¬¬´´»»»»»»»´´¬¬£\9c\9c£££££¬¬¬¬¬¬´´¬¬´¬´¬´¬¬£¬¬¬¬¬¬´´´\8b\8b\83\8b\8b\8b\8b\93\9c££££¬¬´´»»»»»»´»»»´¬££¬¬¬¬¬¬¬¬´´´´´´´´´´¬´´¬¬¬¬¬¬¬´´´´´\8b\8b\8b\8b\8b\93\93\9c\9c¬¬¬´´´¬´´´´»»»»»´´´¬¬´¬¬¬¬¬¬´¬´´¬¬¬¬¬´´¬´´¬´´´´´´´´´´´»\8b\8b\8b\8b\93\9c\9c££¬´´´´´¬¬´¬´´´»»´´´´´´´´´¬´´´´´¬¬¬¬¬¬´¬´´´´´´´´´´»»´»»»»\8b\8b\93\93\9c\9c££¬¬´´´´¬´¬´¬´´´´´´´´´´´´´´´´´¬¬¬¬´´´´´´»»»»´»»»»»»»»»»»»»\93\8b\93\93\93£¬¬´´¬´´´¬¬´¬´´´´´´»»»´´´´¬¬´´´´´´´´´´»»Ãû»Ãûû»ÃÃÃÃÃÃÃÃÃ\93\93\93\9c££¬´´´»»»»´´´´»»»»»»Ãû»»»´»»»»»»»»»»ÃÃÃÃÃËËËÃËÃÃÃÃÃû»ÃÃÃÃÃ\93\9c\9c££¬´´»»»»»Ãû»»»»»ÃÃÃÃÃÃÃÃÃÃÃÃûÃÃÃÃÃÃÃÃËËËËËËËËÃËÃÃÃÃÃÃÃÃÃÃÃ\9c\9c££¬´´´»»»ÃÃÃÃÃû»ÃÃÃÃÃÃËËËËËÃÃÃËÃÃÃÃÃÃÃËËÃËËËËËËÃÃËÃËËËËËËÃÃÃÃ\9c£££¬¬¬´´´»ÃÃÃÃÃÃûÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃËËËÃËËËËËÃÃÃÃÃÃÃ\9c££¬¬¬¬¬´´»»»»»»»»»»»ÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃËÃÃÃËËËËËËÃÃÃÃËÃÃÃÃ\9c\9c££¬£¬¬¬¬¬¬¬¬¬´´¬´´´»»»»»ÃÃûÃÃÃÃÃÃÃÃÃÃÃÃÃËÃËËËËËËËËÃÃÃÃÃû»»ÃÃ\9c\9c£££££££¬£££££¬¬¬¬¬¬´´»»ÃûÃÃÃÃÃËËËËËËËËÃÃËËËËÒËËËÃÃÃÃû»»»»Ã»»\9c\9c\9c£\9c\9c£££££££¬£¬¬¬´»ÃÃÃËËËËËËËËËÒÒÒÒÒÒËËËËÒÒÒÒÒÒËËÃÃÃÃÃÃû»Ã»»»»\9c\9c£££££££££¬¬¬¬¬´»ÃÃËËÒÒÒÒÒÒÒÒÒÒÒÒÒÒËËËËÒÒÒÒÒÒËËËËËËÃËÃÃû»»»»»´£££££££££££¬¬¬¬´»»ÃÃÃÃËËËËËËËËËËËËÃÃÃËËÒÒÒËËÒËËËËÃÃÃÃÃÃÃÃÃÃû»»´£££££££££¬¬¬¬¬¬´»»»ÃÃÃÃÃËËËÃÃÃÃû»ÃÃËËËËËËËËËËÃÃÃÃÃÃËÃÃÃÃÃû»»»´£¬££££¬£¬£¬¬¬¬¬´´»ÃÃÃÃÃÃÃËÃÃÃÃÃÃÃËËËËËËËËËËËËËËÃÃÃÃËËÃÃÃÃû»»»´»£££¬¬¬¬¬´¬´´´´´´´´»ÃÃÃÃÃÃÃÃÃÃÃÃËËÒËÒËËËÃËÃÃÃÃÃû»ÃÃûûû»»´»´´»¬¬¬´´´´»»»»»»»»»»»´»»Ã»ÃÃÃÃËËËËËËËËËËËËÃÃÃÃÃÃÃÃÃÃûÃÃû»»»»»»´´´´´´´´´´»»´»»»»»»»»ÃÃÃÃÃÃËËËÃÃËËËËÃÃû»»Ã»Ã»»Ãû»Ã»»»»»»»»»»»»»´»¬¬´´´´´´´»Ã´´´ÃûÃÃËËËËËûÃÃÃÃË´´»»»Ãû»»»»»»»»»»»»»»»»»»»»»»»»»´´»´´»»»Ã£|ldds\93ÃÃÃËô£\83lls\83\8b\9c\83[[lll\83´Ã»»»»»»»»»»»»»»Ã»»»»»»»»»»´´´´´»»»\83SSSS[[[|¬Ã¬|dSSS[SSS[S[SSSSS[\9cû»»»Ã´´»ÃÃÃû»»»»»»»»Ã»»»»´´´»»\8bKSSS[[[d[[lSS[S[[[[[[[[[S[[[[SS\83»Ãû\8b|s\83\93\8b\9c¬ÃÃû»Ã»»»Ã»»\83\8b¬¬£\8bsSSSSSS[[[[[SS[[[[[S[[S[SSSSSSS[SSd\9c´|l|sldddd|»Ã»»ÃûÃÃû
\ No newline at end of file
diff --git a/data/images/example.mif0 b/data/images/example.mif0
new file mode 100644 (file)
index 0000000..c29ce51
--- /dev/null
@@ -0,0 +1,11 @@
+MIF
+
+# This is an example of a MIF file.
+# Comments begin with a hash symbol (i.e., '#') and proceed to the end of line.
+# The first four characters of a MIF file must be in order: M, I, F, linefeed.
+
+component tlx=0 tly=0 sampperx=4 samppery=2 width=32 height=64 prec=8 sgnd=0 data=goldenears.pgm
+component tlx=0 tly=0 sampperx=2 samppery=4 width=64 height=32 prec=8 sgnd=1 data=goldenears.pgm
+
+# This is the end of the header.
+end
diff --git a/data/images/feep.pnm b/data/images/feep.pnm
new file mode 100644 (file)
index 0000000..e3bdff1
--- /dev/null
@@ -0,0 +1,11 @@
+P1
+# feep.pbm
+24 7
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0
+0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0
+0 1 1 1 0 0 0 1 1 1 0 0 0 1 1 1 0 0 0 1 1 1 1 0
+0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0
+0 1 0 0 0 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 0 0 0 0
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+
diff --git a/data/images/feep2.pnm b/data/images/feep2.pnm
new file mode 100644 (file)
index 0000000..bbd3968
--- /dev/null
@@ -0,0 +1,11 @@
+P1
+# feep.pbm
+24 7
+000000000000000000000000
+011110011110011110011110 # 111111111111111111111111
+010000010000010000010010
+011100011100011100011110
+010000010000010000010000
+010000011110011110010000
+000000000000000000000000
+
diff --git a/data/images/goldenears.bmp b/data/images/goldenears.bmp
new file mode 100644 (file)
index 0000000..95f3c28
Binary files /dev/null and b/data/images/goldenears.bmp differ
diff --git a/data/images/goldenears.jpg b/data/images/goldenears.jpg
new file mode 100644 (file)
index 0000000..7c933a3
Binary files /dev/null and b/data/images/goldenears.jpg differ
diff --git a/data/images/goldenears.pnm b/data/images/goldenears.pnm
new file mode 100644 (file)
index 0000000..112712d
--- /dev/null
@@ -0,0 +1,292 @@
+P6
+128 96
+255
+V\84À\\82¿a\80À`\80Åg~Äc\83Æd\84Çf\84Êe\87Êh\88Êm\89Ën\8aÌp\89Îq\8dÐy\93Ò\7f\98Ò\8b\9cÖ\96¥Ù\9eªØ\9a«Ø\98§Ù\99¤×¡¬Ú¡¬Ú\9c©Ø\9a¨Ø\97¥Ù\8c\9fØ\90 Ø\90\9dØ\93 Û\89¡Û\8a\9dÚ\81\98Û|\98Ûy\96Ü}\96Ü\84\95Ù\7f\97Úw\97Ü\7f\99Û\84\9dÝy\99Üy\97Ýx\96Üy\95Û\81\95ß\83\98Ý\88\9cÞ\88\9fß\90¢ß\95¤Ý\9d§ß\9f¨ß¥®Þ¥®ßª°à¨°à¤¯ß\9c§Þ¦®Þ¬²ß®¶â°·ã­¶á±¹ã³»â±¶â°ºä°¸ä¸ºä²»â³¼å´¼ã²¾ã°·â¨¶à«µá§²â¢±ß¨²ã¤®á¥²ß\9e¬Ý\94¥ß\95¤ß\99ªà\8f¦à\8d¤ß\8e¢ß\87\9eà\84\9dà\89\9cß\87\9aÞ\84\9aà~\9bß\80\9bß\85\99ß\85\9aÝ\84\9aà\84\9cß\8b\9dà\85\9cß\81\9aÝ}\99Ü\81\9aÝ\82\9aÝ\83\98Ý\82\99Ü\85\98Ý\82\99Ý\80\98Ý\81\9aÛ\86\9dÜ\84\9cÞ\87\9aÜ\83\98Ú\82\95Ù~\97Ú}\96Ü|\97Ú|\94Ùz\94Ùz\94Ø|\92Öy\92×z\91×w\92ÕZ\82À]\81Á_\82Âa\82Ãc\82Åc\84Çf\84Çe\86Ég\86Ëi\88Êk\8bÍn\8cÎr\8bÎu\8eÐz\93Ó\87\9cÕ\90¡×\99¦Ø\9e­Ø\9d«Ø\9b¨Ù ªÙ¡­Ù\9cªÚ\9d©Ú\99¨Ù\9b¨Ú\99¤Ù\91£Ù\8f Ú\8b\9fÜ\88\9fÛ\88\9bÛ\80\98Û{\96Û}\94Û}\96Ü~\96Û}\96Ú{\96Ü}\99Û\81\99Ü|\97Ý}\98Ý}\96Ý\7f\97Ý\81\98Þ\86\9bÞ\87\9fÝ\8a ß\92¥à\94¥Ý\9f©ß¢¬Þ¨±ß¨²á®¶á¯·á­µâ«³âª²ß¬´à­µâ¬µá¬´á¬µâªµá¯·á®·á¯·â²¸â¯¸â³ºä²»ä¯¸ã­µâ©¶â©³à¡®à\96¨Þ¥°â¡­á\9b«ß¢¯á£®á\9f¬â\95§ß\8b ß\8a¡à\88 à\85\9dà\85\9dà\88\9cà\84\9bà\84\9aà\83\9aà\84\9bà\83\9cß\83\9cà\87\9aà\84\9cß\85\9cß\82\9aà\83\9aÞ\81\99Ý\80\9aß\82\9aÞ\82\99Þ\80\9aÝ\80\99Þ\83\98Þ\82\99Ý\83\9bÜ\81\9cÝ\82\9aÝ\83\98Ü\80\97Û\7f\97Û~\97Ú~\95Û}\96Û}\95Ú|\95Ú{\95Ø{\94×z\93×x\92×w\92×_\82Â^\82Â\\85Ä_\85Æc\85Çd\86Èg\85Ée\86Êh\88Ëh\89Íi\8aÍm\8cÐr\8fÑu\8fÓ~\96Ô\89 ×\94¤Ø\9d«Ù¥°Ù ¬Ø¢®Ú§²Û¡­Ú\9a¨Ù\9f«Û£«Ú\9c«Ü\99¦Û\8d Ú\8a\9fÛ\87¡Ü\89\9fÛ\87\9dÜ\84\9bÛ\81\97Û\80\99Ü\7f\98Û|\97Ü{\95Ý\7f\97Ü\82\9aÝ\81\98Þ\83\9aÝ\87\9dÞ\8b ß\8e ß\89¡ß\91¥ß\97§ß\9cªß\9eªà ­Þ¨°ß«³à­¶à¯ºâ±ºâµ»á±¹â²ºâ¯·á­¸â®¹âª´á§³à©²à¨²á¦±à©±ß©³àª´áª´ã®¶ã­µáªµâ«µâ ¯á\9b«à\99©ß\94¨á¡¯â ®â\9bªá\9c­á¦²â\9d«á\8a à\8a à\8d\9fà\8b¡â\87\9eá\85\9eá\8b á\88 â\85\9fâ\88\9câ\86\9cá\85\9cà\85\9cá\83\9cá\83\9cà\81\9cà\82\99á\86\99ß\82\9bá\82\9bà\81\9aà\80\9bà\81\99ß\80\9bß\82\9aß\80\9aß\80\99Þ~\99Ý\80\97Ý~\98Ü~\97Ý~\97Ü}\98Ü\82\99Û\84\9bÝ\84\9aÚ\81\9bÚ\7f\9bÚ~\98Ú\80\95Ùx\93Ùx\92Ø`\83Æ`\83Åb\86Åc\85Çc\87Ég\86Éf\87Ìh\87Íi\8aÍj\8bÎk\8bÐl\8dÑo\90Òu\92Ó\82\97Õ\8d\9fÖ\96§Ø\9e¬Ú\9d¬Ù ®Ú¦°Û§°Ù¥±Ü¦³Ý§²Ü¦±Ü\9a¨Û\96¦Û\93¤Ú\8f¢Û\88 Û\85\9cÝ\80\9cÜ\80\9dÝ\81\9aÝ\7f\9aÝ|\98ß~\98Ý~\9aÞ\82\9bÞ\87\9cß\84\9aÞ\83\9bß\88\9fà\89¢ß\8d£ß\94¥ß\96©ß\9d¬à¡®ß§±à¯µà­¶à­·à­¸á¬¸á®·â®·á¯¸â¯¹â¯¹â¯¸á¬¶á¨³á\9f­à£­à¥±á¦²à©´á¬µâ®·ãª±à£°à¤¯à§±á¨²á¦²á¢®á\9b©à¢®â£¯á¢®à¦³á¡°á£¯á\9e«á\9d«â\92§á\91§á\96¨à\94¦â\91§â\8c£â\8a á\88 á\8f¢á\8d£â\86\9eá\85\9cà\81\9dá\82\9fá\83\9eá\85\9dá\85\9cá\84\9dá\83\9cà\82\9cà\82\9cß\82\9bà\82\9aß\81\9bß~\9bß\7f\9aß\7f\9aÞ\7f\99Þ\7f\99Ý\81\99Ý\81\99Ý\82\9bÝ\83\9cÝ\85\9eÝ\83\9aÜ\7f\99Ü\81\99Ú\82\98Ù\80\98Ú\7f\99Ú}\95Ø`\86Æa\87Æd\86Èb\88Éc\8aÊe\89Ìg\8aÌi\8bÍl\8bÎl\8bÐn\8eÑs\8eÒv\93Ôz\95Ö\83\9cÕ\95¥×\98©Ù\9a©Ú\9e­Ú¤±Û©²Ü§³Ü¨³Ü©´Ú¨³Ü¦±Ü\9cªÛ\98¨Ü\8d£Ü\87\9eÜ\83\98Ý~\99Ý\81\9cÜ\81\9bÝ\80\9cÝ\81\9dÞ\7f\9aÞ\82\9aÞ\83\9eÞ\86 ß\85\9fÞ\87\9dÞ\87\9dà\91¤à\93¦Þ\9b©ß\9f¬à\9a«à¢­á¢¯à§±ß ®ß£°á£²à¢°à¤°á¦²á¦²à§³à§µà©³à¦³à¢¯à¥³á§²á¤²à¤³á¤³á©³á©³â©¶â«¶á¯·ã¯·ã¢¯à¥±áª¶â©³á«µä«µâªµä¡­â¨´ãµ¼å¦²ã£¯à¤²â\9d®ã\97§á\98©à\9d«á\98ªá\95¦á\99©â\99ªâ\97¨á\97©á\8f¦á\8c¢à\8a¡â\8a¡â\8d¢â\8a\9fá\85\9dâ\83\9cá\82\9dà\83\9cà\81\9bá\81\9bá\80\9cá\83\9dß\81\9bà\80\9aà\80\9cß\81\9cÞ\80\9cÝ\83\9cÝ\82\9dÝ}\9aÞ\80\9aÝ\81\9aÝ\83\9aÝ\88\9eÝ\8f¡Ý\95¡Û\89\9fÛ\81\9cÜ\80\99Ûb\87Èc\88Çc\8aÈg\89Ìh\8bËg\8cËi\8cÎj\8dÎk\8dÏp\8dÏs\8fÒv\92Õ\7f\98Ö\88\9eÖ\8e£Ø\98¨Ø\9c«Ù¢±Ú¥²Û§´Ü©µÜ¨´Ü¬¶Þ«¶Ü©³Ü£°Ü\9c­Ü\96¨Ý\8c¡Ü\82\9dÝ\81\9bÞ\80\9aÞ\7f\9aÝ\81\9cÞ\84\9eÞ\84\9eß\86 à\8a¢ß\8b¥à\91¥à\8d¤ß\8f¤à\99©ß\9aªß\9c­ß\9c­ß\9f­à£¯à¢°á¦²á¥±à\9d¬ß\9d­á\97«ß\99«ß\9a¬ß\9d°á¡¯à ®à ¯á¢¯á£°á¢±â¢²á¨³á«¶â¯ºä§µá­¸ã±ºäª´âª·ã´½å²¼äªµã¦³ãª´â¦´á®ºâ©¶ä´½æ²»æª·ä¨µâ§³ä£°á§³ã©µä£³ã£±ã¤°â¥°ã¦²ã¥²ã\9e¯â\9d­â\9a«â\98ªá\96¬â\95ªâ\8e¦â\89¢â\8a â\88\9eâ\86\9eá\82\9eâ\84\9eâ\87¢á\8b£á\8f¥â\91¥à\89£ß\8a\9fà\89\9eà\84\9dß\80\9cà\83\9dß\84\9fÝ\89£ß\96¨ß\9fªß\9eªÝ\97ªÞ\95§Ý\90¤Ý\87\9fÛ\7f\99Û}\9aÜc\8bÈf\89Éb\8dËf\8dÌh\8dÍi\8dÏh\8fÐl\8fÑr\91Óy\96Õ\7f\99Ö\82\9c×\8a Ø\95¦Ù\9a«Ù ­Ú§°Û¨´Û¯¹Ý±ºÝ°¸Ü³ºÝ°»Þ®¹Þ®·Þ¬·Þ¥³Ý\9b¬Ü\93¨Ý\8d¥Þ\88\9fÝ\88 Þ\8a£ß\8f£à\93¥à\93§ß\8f§à\95¨Þ\98ªÞ\97ªß\98«à\99¬à\9f¯à¤±á¢³à ®ß\9d­à¢¯à\9d°à\9e°á\9d°à\9f°á\9b¯à\96ªß\94¨à\92§á\97¬à\9a«à\9b­à\9b­à\9e®á£°á¢²â¤³â«¸ä±»ã°»ã®¹ä·Á浿嶾泻䰺ã¼Ãè¹Ã糼崽寺㱻峼學䦳㣱ᡱ⦳㦲⦳䤳㤴⫸导尼孷䦴⦴㦴㨴䧳⡱â\9b®â\98ªâ\9a©â\9b«â\95ªâ\8f¦â\91§â\94©ã\99®á¢±á\9d¬á\99«à\90§à\87¡à\83 á\85\9fá\8c¤à\94©à\9d­à¢°à ±à¢¯Ý\97«Þ\8e¤Þ\84¢Ý\82\9fÝ\80\9cÜ\80\99Û{\98Úd\8cÊf\8bÊg\8cÌi\8dÎj\8fÐm\8fÑp\93Òu\97Ò~\9aÕ\8a¡×\8f¥Ø\94¦Ù\96¨Ø\99ªÙ¡­Ú¥±Ü®·Ý¯¹Ý­¹Ý°¸Ý¯ºÞ±ºà­·Ýª¶Þ¬¹ß«»ß®¶ß£²Þ\9a¬Ý\92§Ý\94¨Þ\98«Þ\95«ß\98«à\98¬à\9a¬à\98¬à\9a«ß\9b¬à\9e¯à¡±á\9f±à ±à¡±á¡²â °ß ±ß¥±á¢°à\9c¬à\9e¯á ®á\9d­à\9c®á\9b¬á\9b¬à\98ªà\9b­á\9f­á©´á¦³â¥´ã§¶â§´á¬¸ã±¼å°¼å®ºã®¼äª¹ä²½å®ºâ²½å¼Ã沽䳼峻åºÂæ¹Á竸㣲â\9f®â\9d°â\98­â\9c®ã§¶äª¸ä¦¶ä«¹æ¯¼æ«ºå¬¹ä«¹ã©¸ä¨·ãª·ã®·ãª¸ä«¶ã©·ã¦·ä©µå¦´ã\9e±â\9f±ä¢²â\9e­á\99­â\9c¯ã\93«â\89¤â\88¥â\89¥á\89¤á\91¨á\8e©á\97«à\98­ß\91¬ß\8dªß\8c¦Þ\86¢ß\81\9eß\80\9eÝ~\9dÝ|\9bÞ\7f\99Ü|\9aÜe\8fÌg\8fÌg\8fÎi\90Ïm\92Ñs\94Òw\9aÖ\7f\9d×\8a Ö\93©Ø\9a­Ú¢®Ù¢²Û¦²Ú¦³Ú¡±Ú¡²Û§´Ü¥´Ü«·Ü­¹Ý¯¸Þ­¶ß®·Ý¬¸Þ©·ßªµÞ¢²ß\9c®Þ\9d¯à °à °ß\9e°à\9d®ß\9b®ß\9c­à\9c¯á\9f¯à\9b¯à\9c¯ß\9c­ß\9a®à\97®à\98¬ß\98­à\9e°á ²â\9f²á\9f°â¡±á ²á ±á\9e¯á\9f±á¢±â¤²â£±á¨µâª·ã¥µâ¨·â¨µâ§´ã­¹ä¯»ä°½æ²½å¨·â±¾å·Âæ´¿æ²¾å¼Äç¶ÀæºÄçÂÈé¸Á簼䬹㤶䤳㠱⡳䨳䪷媻嫸䭺䬺櫸㪼欻筺櫹歺孺䱾殼女㡰ã\9f²ã\9d±ä\9d°â\95¬â\96­â\94¬â\92¬â\8e¦ã\89£â\84£â\84£ä\8a¦â\8d¨á\90ªá\91ªà\8a§â\88¤á\88¢à\7f¢à~¡ß~\9fß\81\9dß\80\9dß~\9dß}\9dÞ~\9dÝ~\9bÝ}\9bÝg\91Íh\91Ïn\90Ñp\92Òt\98Ôz\9eÔ\80\9dÖ\89£Ö\92¨×\98¬Ú\9f±Ú£²Ú¦µÛ¤µÜ£´Û\9a­Ù\9c®Û¡±Ü\9e¯Û¡±Ü¤´Þ§¶Þ«¹Þ©¶Þ«¶Þ§µß¢±Þ\9f²Þ\9f²Þ¡²ß¡²ß¢³ß¡³à\9f±à\9f¯á ±à ±â °á ¯ß\9d­à\9c­á\9b¯à\9a¯â\9b®â\9b®á\9f±â ±â¤²á£²á¡²á¡²â¥³â¦¶â¥µâª¶ãª¶â§µã«¸äª¹ã§¶ã«¸ä©¸ã­ºå¬ºåª¸ä°¼æµÀç¹Äç¸Âæ¹Âç¹ÃæÀÈçÀÈè¼Å賿尽宼峽沾婷䨸嬼櫹嫹媸䫹䩺媺尻尽崿浿æ´Àç´ÀèµÁè³À秸å\9f±â\99­ã\92«ä\93«ã\90«ã\8c¨ä\86¦ä\88¥ä\89¤ä\86¥ä\84¤ä\87£å\89¤å\87¦ä\85¦â\86¦â\83¤â\85¤á\86£á\84¡â\84 â\82¡á\82¡á\81 á\82¡ß\80 ß~¡Ý\7f\9fÞ\80\9eÞ\7f\9dÞ\80\9cÞl\92Îl\92Ïm\93Òt\95Óz\9b×\82¡Ö\8c£×\92©Ø\99®Ù\9f°Ú¡±Ú¢²Ú¤´Ü¢²Ú\9c¯Û\9d®Ú\9e¯Ü\9f²Ü\99­Ü\9e°Þ£³Ý§¶ß§µß£µß§¶à¨·ß¦´ß£²à¢´à ²ß\9e´à¡²à¡²á ²á£±â¡²á\9e°â\9d¯â\9a±á\9d¯á\9d¯á\9d±â\9e±â\9f³â¥³á¦µâ§¸ã«ºã«¸âª¸ä§¸ã­¹ã­¹ãª¹ä«ºä«ºã©¹ä­¼æ¯¼å°»ä¬»ä¬ºå¯»æ¬¸äµÀæµÁ糿æ½Æè¹Äç·Ãç½Æç¹Ãæ¹Â粽峽æµÀç»Ä籾婺氼汾谽籿æ¶Âç¹Âç¸Â糿絿çµÀæµÀç³À絿毾嫺䦷ã\9f³ä\99¯ä\96®ä\9a¯ä\97®ä\90­ã\8cªå\88¨å\89§å\8b§å\88¨ä\88§å\89¦å\87§ä\86§ã\87¦ã\87¥ã\85¤ã\82¤ä\84£ã\88£â\85£ã\83¢â\81£â\83£á\81£á\81¢à\82 ß\80¢ß\80 ß\81 Ý\80\9fÞ\7f\9eÞo\92Òn\93Òo\97Ñs\97Ôy\9cÖ\87£×\93¨×\98¬×\9f±Ú¢´Ù£²Ú¢µÛ¥´Û\9f±Û\9b­Ú\9c¯Ü ¯Ü\9f¯Ü\9f°Ý¥³Þ¨µÞª¶ß¨µÞª·ßª¹á¨¸àª¶ß©¶â¥¶á¢´à\9e²à ±á¡²â£³á ³á¢²â\9f²â\9f±â¡²â¤¶â¦¶â§¶â¨¸âª¹ä®¼ã²¿ä³¿å³¿æ³¿äµÀ峿氽派屽䩺䳿å³Àæ´Àæ³Àå·Â泿æ¹Ãç´Àæ·Áç¿Æè½Æç¼Åç¹Äç¸Åè¾Æè»Ãç½Äç¿Æè½ÆèµÂç³À籾嫻汾豿å¶Àæ¹Ãç¼ÅçºÄæ¾Äæ¼Æç·Äç¶Á精欻奸夶堳ä\99°ä\98­å\9a°æ\9c²å\97®å\91­ä\8eªå\8cªä\8a©å\8c©æ\8aªå\8a¨æ\8a¨å\89¨æ\89¨ä\87¨å\87¨ä\86§ä\87§ä\87§ã\86§ã\86¤å\86¥å\87¤ã\84¦â\82¤ã\85£ã\85£â\82£â\84£á\83¢à\81¢Þ\80¢ß\81 ß\7f Þo\97Òp\97Ów\9bÕ\7f Ö\85¤×\8f©×\9d¯Ù¤´Ú¦¶Û«¸Û­¹Û­¹Ü¯ºÜ­ºÜ©·Ü¦µÜ§·Ü§¶Þ«¸Þ®¹Þ­ºß­¹ß°ºà²»â´½ã´¾ã²½â±»ã­»ãªºá­¸á¬¹áª»ä¬¹ä¨¸ã¨ºäª¹ãª¸ã¬¹ã®»ä°¾å³¾äµÀå¸Âå½Ãæ¼Ææ½Çç¾ÇçÀÈæ¿Ææ¾Æç¼ÅçºÄæ¹Ãç¸ÂåºÃçµÀ対沽å¶Áå¶À汿æ¶Ãç¹Äæ¾Æç¹Äæ´Áæ¸ÄèÁÉèÆËéÂËé¶Ãæ´Àæ´À欽æ³Àç¹Âç¶Âæ¹Âæ¹ÄçºÄç¼Åç¼Ãæ·Ãæ´À汿毾檻妷墵堳å\9f³å\99¯å\91­å\91¬æ\90­å\91«ä\8c«ä\8aªå\8bªå\8bªæ\8c©ç\89«æ\8bªæ\8c©æ\8b©æ\8b¨æ\8a©å\87ªå\88©æ\87©æ\86©ã\88©ã\89¨â\89§ã\88§ã\87§â\85¦â\85§â\87¥â\87¤â\86¤â\84¤â\84£á\84¢à\83£Þ\81¢Þ\7f¡Ýv\9eÕx\9cÕ{\9eÖ\84¤Ö\90§×\98¬Ø\9f³Ú¨·Û®ºÛ¯ºÜ±¾Ý³¿ßµÀàµÂà´À೼߲¼Þ¯½ß±»ß°½ß±¼á´Àâ·ÁäºÂä»ÄåºÃå»ÃäºÃå¹Ãå¸ÃæºÃæºÃå·Âæ¶À浿峿涿å³Àæ³ÀåµÁå¹Âå»Åå½Æç¾ÈèÀÈçÁÊèÂÊèÂÊèÅËéÄÈçÂÉç»ÆåºÅå¸Äæ¹Äç·Âç´Áæ¸Âå¸Âæ¹Äç¼Å糿çµÁç´À籿çµÂçºÇè»Çè¼Åè´Áæ±À箽æ°ÀçºÄç¼Ææ¾Çé¿Çè¿ÈèÀÇè¾Æç¼Æè¹Âç¶Áæ°À謼榸塷ä\9eµå\96²å\93°æ\93®æ\91¬ä\8c¬æ\8c¬ä\8a­å\8b«æ\8a«æ\8a¬å\8c«æ\8b«æ\8c«æ\8c¬ä\8cªå\8a«ç\8d«å\8a¬ä\8a«æ\8a«å\89«ä\89¬ã\8a«å\8bªä\88«ä\88ªä\8a©ã\8a©ä\87©ã\87§ã\87©â\86¨ã\86§á\87¥â\83¥à\82¤Þ\84¦á\87§ã\87©å\86©æz Õ}£Õ\84¥Ö\8c¦×\96¬Ø\9c±Ú ³Ú¢µÚª¹Û­ºÜ±¾ÝµÀà¸Âá¹Ãâ¸Äá´Ââ´À೾߳½â³¿á´Áã·Âã¹Ãä¹ÄäºÅä½Æå¼Ææ½Ææ¼Ææ½Åæ½ÆåºÆæ¼Äå¹ÄçºÄæ¹Ãæ¹Äå¹Äå¹Ãå¸Äæ¼Åç¾Ææ¼Æç»ÅçºÆæ¿Çå¿ÉçÀÈçÄÉæÀÈæÀÇç½Æç¼Æç½Åç¿Çè¾ÈçÀÉèÃÌéÀÉç»ÇçµÃ箿æ±Àç¶Âç¶Ãç´Áè±À诿谿氿æ²Áç·Ãç¼Äç¹ÄçºÅçºÅè·Åç¶Äè´Â粿氿空棷砷æ\9d³å\96¯å\93¯å\90­æ\8d®æ\8d®å\8d­å\8d­æ\8d®ç\8e­æ\8e¬å\8c­æ\8c¬ç\8e¬æ\8c¬æ\8c­ç\8c®è\8d­å\8c­å\8c®ç\8c­å\88¯æ\8d­æ\8c­ä\8a®ä\8c¬ã\8b«å\8b¬å\8a¬ä\89«å\88«ä\8c©ã\8aªã\8aªä\8bªã\8aªã\8aªâ\8b©à\8c±æ\8e²é\87©ã|¢Øt\9aÌ[q\9d|£Õ\81¥Ö\89©×\92ªÙ\95¯Û\98°Ù\99±Ú\9f´Û¤µÛ§¹Û¯¼Üµ¾ß¶Áà¶Ãá·Äá¶Ââ³Àá³ÀᲿá³ÀâµÂã·Âã¸Ãä¹Ãå¸Äå¹ÄåºÄå»ÅçºÆå¹Åå¹Âå·Ãç·Ãæ¶Âç¸Âæ¹Âå·Äæ¹Äå¹Ãæ¹ÅæºÄæ¼ÄæºÅåºÅå»ÄæºÆæ¹Ææ»Æç¾Çç½Èæ¼Èç»Æç¾ÈèÆÉèÆËèÈÌèÃÊè½Çç½Åæ¹ÄçºÆçºÅè½Æè¼Çè²Áæ²Àç±Â誽竼ç²Áç¹Äç¶Ãç´Áç²Á诿竽槼稻椹棷æ\9fµæ\9b²å\97³æ\95°ç\95¯ç\94°æ\93¯æ\93¯æ\93®æ\91¯ç\92®æ\90¯ç\92­ç\92­ç\92®æ\8f®ç\8e¯ç\8d®ç\8f®å\8f®ç\8e®æ\90­æ\90®æ\8b¯æ\8d¯æ\8f­å\8e¯æ\8d®æ\8c®å\8d­å\8c­å\8c­å\8d®ä\8c®ä\8b®ä\91­ä\93®ã\92¯ä\91­ä\8e¬â\8f­á\93°ês\91ÄWt\9cG\\80@Nj;G_7>W|¥Ø\81¥×\89¨Ø\91¬Ù\96¯Ù\97°Ú\99°Ú\9c²Ú¢´Ü£·Ý¦¹Ü§ºÞ©ºÞ¬ºà«½á®¾à­½àª»à®»à°¾á°¾á±¿ã³Àä´Âä¶Âã¶Ãå·Ãå¸Âç¶ÂæµÂå·Âæ¶Áæ¸Áç¶Âæ¶Áå·Âæ¶Âæ¶Âæ·Ãæ·Âç·Áæ¸Ãå¹Ãå¸Åç¸ÅçºÅç»ÆçºÆç»Ææ»Çæ½ÉçÀÉèÁËèÂÊè¿Èè»Æç³Âç¶ÃçºÄç¼Åç¸Äç³Ãè¸Åç³Âæ®Àè·Åè³Âç°À謽è°À窼禺磺硷桷桶å\9f¸æ¥¹æ¢·æ\9b´ä\95±æ\94±ç\95²è\98²æ\95°æ\93°ç\92°ç\92°è\90±è\91°ç\92¯ç\93¯ç\93¯ç\93±æ\91±ç\93°ç\92°æ\91±ç\93±ç\91±æ\92¯ç\92°æ\92°æ\91¯ç\91¯ç\91¯å\8f°æ\91¯ç\91¯ç\91¯ç\90¯ç\90¯æ\92®æ\8f°å\92°ä\8e°å\8f¯ä\8a®ã\89«á\8e±æ\8c°é\s¨2<]/8R.7P4<T;CZ9CYz£×}¥Ø\82¨Ú\88«Ù\8f®Ú\8d«Û\8c«Û\96®Û\97°Ü\97±Ü\96±Ý\96°Ü\94¯Þ\91®ß\8f¯ß\96²ß\9b³à\9b´ß\9f´à\9e¶â ·ã¢¹â¦ºâ­½â°¿ã²Áå³Áå´Àæ´Áç²Âå´ÁæµÂç¸Ãæ¸Äå¸Äæ¸Äæ¹Äå¸Åå¹ÄæºÃç¹ÄæºÄå»Åå¹Æç¼Æç½Çè»Çç½ÉçÃÊçÀÊèÄÊéÁÉç¼Èç¸Æç¶ÂçµÃç·Äè²Áè±Á设笾穾è°Áç°Àè°Áç³Âæ¯À諾稾祼砷ç\9a¶ç\9a´ç\99´æ\97³ç\97´ç\9a´æ\9aµæ\97²æ\95³å\94³æ\94±è\92²ç\92²æ\93°ç\93±ç\92±ç\92±è\92²ç\92±ç\92²ç\94±å\93²è\97±æ\95²ç\94³é\97±ç\96²æ\95²ç\96±ç\95±ç\95²ç\95²æ\92³ç\94²æ\93³æ\92³æ\92²ç\93²ç\94°æ\91±ç\90±æ\8f°æ\8e±å\90°å\8f­ä\8d«á\8d°å\93·ì}\9dÒE\\87-9V2;V/;X+7T0;U5>U4=Tu£Ùv£Ù{¦Ú\7f¨Ú\80¨Ú~§Ú}¦Ü\85§Ý\87ªÝ\86ªÜ\85«ß\86ªß\88«Þ\88ªà\87¬á\8b®à\8e®â\8d®â\8f¯â\91°â\98±â µâ¦¹â¬»ä®¿ä±¿æ²Àå´Áæ·Âæ¹Ãæ¹Äç»Äæ¼Ææ¿Çæ¿ÈçÂÈèÀÉç¾Êè¾Èæ¼Èç¹Æç¹ÆæºÆç¼ÇçÁÉèÃËèÅÌèÊÏéÆÍèÁËèÄÊæ»Æç¶Ãç´Áæ²Âç¯À鬾驾証秽髿笿è®Àè¬À穾覼襻碹碹蠸è\9e¶è\9b·ç\9cµç\9cµç\99¶ç\99¶ç\9aµç\98³ç\96³ç\94´è\93´è\94±è\95±ç\93³ç\96³ç\97³è\98³è\99³è\96³è\94´ç\93´ç\93´æ\96²ç\96³è\95³ç\95³è\96³ç\93µå\95´ç\96³ç\96³æ\93´æ\93´è\94´æ\94´å\94³æ\93³æ\93³ç\94²è\91³ç\91²å\92±æ\91±ç\8f²å\8e¯ä\93²è\95ºî\8b«á^u£6Cf1:T1;Y.7S*6S,5T0;U3<S4<Rz¤Ùx¦Ùy¦Ù{¥Û|¦Ú|§Û~¦Þ~¨Ý}¨Þ\81¨Þ\82ªß\81ªà\82«à\86¬à\88­à\89¯à\8c¯â\94°ã\9dµá¨»â°¿å·Âå½ÅåÂÇæÀÊæÀÈç¾ÉçÁÉçÄËçÆÌèÇÍèÈÎèÈÏéÌÐèÎÒéÏÑéËÐèÉÍèÃËè¿ÊæÁÊçÄËèÉÏéÍÐèÍÒéÍÐèÍÐèÇÎçÂÊè¾Éè½Èç¹Æç·Äç²Ãç°Áè²Àç®À謿è®Àè­À髿褼磻梹桹硹衺衸ç\9e¸é ¹è\9e¹é\9f¸é\9d·é\9b·è\99·è\9a¶è\96¸æ\9aµæ\9b³ç\97´ç\95´è\98³è\96´ç\9c·è ¸ç\99¶ç\97µç\97¶è\97´è\96´è\93µç\93µç\96³æ\94´è\94µè\97³è\97´è\94µç\94¶ç\95µè\95´è\93´ç\92µæ\92µæ\95³ç\93³è\93³ç\93´æ\94´ç\92´æ\93³æ\93±å\90²â\94µç\9a¹î\86¨Úb\81¬>Qw2=Y5=Z2>Z4=W/:V.9U1:T0;S2;R4:Q{¥Ù|¥Ú{§Û~¦Û|§Ý~¨Ý\7f¨Ý\7fªÝ\81ªÝ\81«Þ\87«Þ\8a¬ß\8a®à\8c®á\91¯ß\93²á\9bµâ©¼ä³Áã¸Åå½ÉåÁËæÇÍçÉÏçËÏçËÏçÍÏçÌÑæÍÐæÌÑèÍÑèÍÑçÏÑèÐÓçÎÒèÆÎçÀËæ¾ÊçÂËçÇÍèÎÑèÑÔéÑÔèÐÒèÏÑèÍÐçÉÎèÂËèÃÌéÂÌçÂÊç¿Éç»Æç»ÇçºÆè¸ÅèµÃç°ÀçªÀ訿覼磻裻袹è\9eºè\9f¹è\9d¸è\9d¸é\9c¸è\9c¸ê\9b¹è\9c¶è\9c¶é\9d·ç\9b¸è\9a·ç\9d¸ç ¸ç\9e·ç\98¸è\9c¶ç\98·æ\99¶è\9b·è\9c·è\9b¶è\96·é\99·è\97·ç\95¶è\94¶ç\98µè\96¶ç\94¶ç\96µé\96´è\98´è\96´è\96´é\93·ç\95µç\95´ç\91¸æ\94·æ\95µè\96¶ç\96·å\96·ç\97¶æ\95µä\94´ä\9bºê\9b¾í\91±ád\7f«:In4?\8A\6?[3>W/<W1=U1;U09S1:R0:Q09R27P}§Ú|§Ú|¨Û\7f©Ü}ªÜ\80ªÝ\81ªÝ\80«Ý\81«Þ\83¬ß\85®ß\88¯à\8d¯à\90±â\95³á\9e¶á§¼á¯ÀãµÃå·Ãä·Åä¸Åå¼ÇæÀËæÃÌçÆÍçÇÌæÃÍèÂËçÂÊæÂÌæÂËç¾ÉæºÈæ¹Ææ¸Åæ¹Æå½ÈçÂËéÈÍèÉÏçÇÎæÈÎçÆÍçÆÌæÃÌçÀËç½Èæ¼Èç¸Ææ¶Åç³ÄçµÃç·Äè¶Ãç´Ãç²Âç°Áé®Áê­Àꩿ馽衻顺é\9fºè\9e¸è\9c¹é\9dºé\9c¹é\9c¸é\99¸ç\99·è\9b¹ç\9e¸é\9c·é\98¹ç\9e¸ç\9e¹ç\9c¸è\9b¶è\99¹é\99·ç\9c¶è\9c¹è\9b·é\9a¸é\99·è\96¸è\95·é\97·è\99·è\98·è\98·è\98¶è\98¶ç\94¸ç\95·é\97¶è\98µè\96·ç\97·ç\96¶è\95·æ\97·æ\96¶æ\95¸ç\96µç\97µã\95¶ã\99½ë\9b¾í\83¢ÓYs\9b@Rs3A_=Fc<Eb/;V/9T1:U1;U2:S1;T0:T.9S-:Q19P29P\7f«Ú\7f«Ú\81ªÜ~«Ü\81«Ü\84«Ý\82­Þ\83­ß\85­ß\87®ß\86®à\87¯ß\8b¯á\8e±á\93´â\98¸à¤½â¯À㱿ä²Áä²Áä´ÂåµÃå·Æå»Èç¾Êæ¼Èå·Ææ¶Ãæ·Åå´Ä橾社ç¬Àç´Ãæ¹Ææ¿ÇçÂÊèÄËèÅÌèÄÌèÂÌçÂËç½Êæ¼Èæ»Èè¹Èè·Çç·Äæ²Âæ±ÃèµÄçºÇçºÆç¸ÄçµÄè²Âè±Âè­Áé®Â騿裼颻꠻頺ꢻ飻ꢻé\9c»ê\9c¹è\98¹ç\98¹è\9a·è\98·è\98·è\97¸é\99·é\98¹è\98¹ç\97¹é\98ºé\99¹è\9b¹é\9c¹è\9a¸è\9a¸é\9b¸è\98ºê\9c·è\9b¸è\96¹é\98¸é\98¸é\99¸è\96¹è\97¸é\98·é\99·é\9a¸è\97·é\9a·ç\98¹ç\98·è\99¸æ\97·æ\95¶å\99¹è¡¾î\9d¿í\83¥Ñ\r\9a<Jl7D^;FbDKf9E`4<X/;W-9U.:U0;T0;S07P.7O,8P/7O-7L.8M\81¯Ú\87°Ù\86®Û\83®Ü\85¬Ý\85­Ü\86®Ü\86®Ý\88¯Þ\87°ß\89°à\8a³ß\8b²á\8e³â\8fµâ\94¶â\9d»áª¿ä³Âå·Äå¸Æå¸Æå¸Åæ·Äæ¸Äæ»Èæ¹Çæ¸Äå°Ãç¯Áè±Âç¯Âè²ÃæºÇæ¿Èç¿Êç¿ËèÀËèÁËè¾Ëç¾ËçÁËæÀÊæ½Êç¿Êç¿Êç¼ÈèºÆç´ÄçµÄç¹Æè»ÈçºÉç¶Æç³ÄçµÄç±Ãé¯Âé«Àé§À饾颽é\9f¼é\9e¼é¡»ê ½è ¼ê\9cºé\9aºé\9b¹è\97¹è\9a¹è\98¸è\99¹é\98ºé\98ºè\97¹é\9aºé\9d»è¡¼ê\9e¼è\9bºê\9b»è\99»é\97»è\9b¹è\9cºé\99ºé\9aºé\9aºé\9b¹è\9c¹è\9b¹è\9a¹é\99ºè\99¹é\9a¹é\9c¹è\9a»ç\9b¸é\9a¹è\9bºç\9a¹æ\99·æ\9e¼é¡Âñ\92µàx\97¼Zr\94>Kk;E`@Je@Jf>Gc3=Z1;W3;V/<V/9S.9S,:T,8P-6N18O.7P/7N08N.6M}°Ú\80°Ú\84°Û\87±Û\8a±Ü\8d°Ý\90±Ý\94±Ü\92´ß\91µà\93µà\96¶à\99·á\9a·á\9c¸á\9c¹ã\9dºä\9f¼å¡¿å¯Âå·ÄåµÆåµÅæµÄæ¶Åæ¸Çç¸Çæ·Äæ´ÂæµÃæºÆæ½ÉèÁÌèÅÍèÇÍéÄÎèÂÍçÀËç¼Êæ¹Èæ¹Çç·ÅæµÄæ´ÅèµÄçµÄç°Ãè¨Àé¨Àé¯Áè±Âç¬Àé¬Àè¯Âè±Âè®Âé©Á褾頽é\9d¼ë\9e¼ê\9e»é\9bºé\99¼è\9cºé\9aºé\97»é\9bºé\9c¹ê\98»è\9bºè\9c¹è\99»ê\9aºê\9bºé\9b¼é\9e»ê¢¾é¤¾é§¾ê£¾ê\9e¼ê\9c¼ê\9a»ê\9b¼é\9b¼é\99½é\9a¼é\9b¼é\9a¼é\9a¼ê\9c»é\9cºé\9a¼ê\9b¼é\99¼é\9a»é\9b»é\9b»è\9b»è\9a»è\98¹æ\9c½ê£Âï\90¯Ûj\87ªEZw;Fb9E`>Je>He9Fb;E`2=W,7S/;T2;V/:R/8Q,5P+6P+4M+5N.5L/5L.7M,6M.6K\8f³Û\8c³Û\91´Ú\95·Ú\9d¸Ú¤¹Û£¹Þ¤¼Ý¦½Ý§¼ß§½ßª½ß«¿á­¿â«¿ã¢¼ã\9e»ä\9f½å\9f¼å£¿æ§Àæ¨Àç§Àç±Âæ·Åå·ÇæºÇç»ÇæÀÈæÀËçÄÍçÅÍæÃÍåÂÍçÁÌçÀÌæ¾ÊæºÇæ·Çç·Çæ¶Åç³Äæ²Äç±Âç®ÂèªÃé­Ãç­Ãç´Äè±Ãè«Áé§Âé«Âé«Ãê§Áé£Àê\9e¿é ¾ê\9d¿ê\9e½ê\9a½ê\9a¼é\9a¼é\9a½è\9c»é\9c»ê\9c½ê\9a¼ê\99¼ê\9a¼é\9c¼é\9c½ë\9e¾é\9f½é\9e¾ê¡¾ê£¾é¡¾é¡¾ê\9c¿ë\9d½é\9d½é\9d¾ê\9e½é\9b¾ê\9a¾é\9d½ê\9e¼ë\9d½é\9e¼ê\9c¼ê\9d¼é\9f»ê\9d½ê\9d¼ê\9b¾è\9d¼è\9d¼è\9d½é\9b»è\9c½æ£Æî\95µáh~¡ETq9E`>Hc@Kg9Hf5B`7B`9C`5>X/9S18U1;U2=W-8R+7R,6P-4N*4L)3M+4M)5M,6M+4K,5I\94¸Ù\96¸Ù\9a¶Û\9c¸Ù\9d¹Ú ¸Û\9e¸Ý ¼ß »Þ ¹Þ©¼à«¿â¯Âå¬Â奿㢽㥾䤾å°Ãå³Ææ¯Äæ³Äå¶Æä¸Æä»Çç»Çç»ÈæºÇäºÆä¼Éå¾ÉåÁÌê¾Ëë·Çè³Äç«ÄçªÂç©Áæ¨Âç©Âè¨Âè¨Áé©Âé«Áè®Ãè­Ãè«Áê©Áé©Âè§Áè¦Áê¥Âé¢Áé À颿롿ë Àê\9eÀê\9f¾ê\9d¿è\9c¾é\9d½ê\9c½ê\9d¿é\9c¾é\9d½ê\9e½ë\9c¿ê\9e¾é\9e¾ê\9e½ë\9d¿ê\9e¾ë\9f¾ë Àë¡¿ê ¿ë\9dÀê\9e¾ë\9d¿ì\9cÀë\9e¾ì\9f¾ë ½é\9d¾ë\9e¿ë\9f¾ë\9f¿ê\9f¿é ½ë\9f½ê\9f¾ê\9e¿è ½ê ¾é\9e¿é\9f¾é\9f¿è\9d¼æ£Áê¤Âì\80\9cÃG[|<G`ALf?Kh>Hd:Fb9C_7B^5B_4=Y09U29T19S0:T6=T3:R.7P-7Q,7O*6L,6M,6L.6L.7M06K/5I\8b¶Ú\8d¶Ú\93·Û\99¸Ú\9e¹Û¡ºÜ ºÜ ¸Þ\9d¹Þ§Àæ®Æ堽ؠµÒ¡·×¬Ãå°Æè«Àã±Áã¸Æå½Éä¾Èä¾ËéÀÎë»Íë­Äâ­Áá±Æé­Éí¬Éí²Éí¶Êê\9d·Ô\96²Ô¦Âç¡Ãæ£ÄèªÉï¥Â렾磾ê\9fÀé\9fÀé Áé¢Àè¢Àé\9d¾ç\9c¾è\9e¾é\9d¿é ¿é\9fÀë Àé Áé¡Àê£Àꢿë\9eÀë\9cÀë\9f¿ê\9f¿ê\9f¿ë\9bÀë\9cÀê\9e¿ê\9dÀê\9e¿ê\9f¿ë Àꢿ꠿ê\9f¿ë ¿ê Àë\9f¿ì ¿ë¡Àë¡Àë Áê¢Àë Àë¡Áê¡Àê¢Àë¢Àë¢Áê¢Àé¡¿ë\9fÁë\9fÀë¡Àê\9fÁé Àê Àé Áꢿé¡Àê ¿ç ¾å§Çð\99¸à\o\929Ca8Ec@Lh=Ie:Fc:D`7C_8B^7C^3@[1;U/9T,3P*4P1<R8=T3:P-7N.7O07O-5N/8M/6K07K/7K,4I,4G\9b¹Ú\9e¹Ú¤»Ú¢ºØ¡ºÚ¢»Û¥¼Ü§»Ý­Ãà\8b©Âj\84\9fWm\8bSg\8aRf\8c`x\9c\80\99îÅè¶Çç³Âä¹Éé¶Êæ\9d·Ô\8d¨Ål\89ªVn\92Vm\91]w\9fk\89®u\91µ\86£Æh\87¤I^\83G]\83Vl\8fTn\8fVn\92m\88¯\9bºã¦Çï ¼ç\9f¿è\9fÀé\9eÀé\9f¿ç\9d¾è¡Ãì¡Ãì\9eÀê\9f¿ç\9fÁç¢Àè¥Áç¦Ãç¤Âê¢Áé Àê\9fÀê\9fÀé Àê ¿ë\9fÀë\9fÀé\9eÁè Áê\9fÂé Áé¡Áê¡Áê¡Âê¡Áê£Áê¡Àé¡Áë¢Àë£Áê£Âé¥Áé¤Âê£Ãé¤Ãê¦Âé¤Ãê¦Âê£Äé¢Ãé¤Ãê¥Âé¥Áê¥Ãé¥Âé¤Ãé¤Ãé¥Ãè¡Äé¢Äè¢Áæ¨Æì­Íó\81\99ÁFTt<Fa?Kg<He<Ie:Eb9D^7D`9D_;B^3?Y2=V1<V,5Q+3O*5P2?T:@X29R+5N/7N.8N18N.6K.6J.4I,3I+4I*3G\9eºØ\9dºØ\9e½Ù\9e¼Ù\9cºÙ¢¹ÙªºÜ¬ÆÞi\89\9e=Uz?QxEW}JX\81F[\81I\\83IY\84h{¥\99°Ô¨Çç\93³Ëd~\9bKc\88AX\81AU\7fCX\83FX\84EV\81CV\7fCU~CW~EV~KZ\82GX\80ET}EV{GTzCRwNa\88~\9cƤÉï\9fÁè\9d¾è\9cÀæ¤ÁêªÇê\97³Ö\9c¸Û¤Åê§Éí¨Çì«Èî§Çì¢Âè¡Áè¡Âé\9fÂé\9fÂé\9fÂê¡Âé¢Áé¡Âè¢Âê£Âé¤Áé¡Äè£Âé¢Âé£Âé£Âé£Ãé£Äé¤Âé£Ãé£Äé¢Äê£Äê¥Ãê¦Äê¥Äê¥Äê¥Äê¥Ãê¥Ãê¥Äê¥Äê¦Äë¥Åê¤Äê¤Åê¦Ãé¥Ãé¤Åé¤Äè¢Ãé Áå§Èí\8bªÑYu\96@MiBJcAMi=Jd;Ha<D_;D_=E^;D^:C^1;W07S39S1<U-:T.6Q-7O2:R7>S0:Q,6Q-7O/8L/7M-7L.4J-4J*3H+3G+3H\99Áá\99Áà\94¼Ü\91ºÝ\96¿à\98Ââ\9eÈæh\94ª;MqFTzCW}EX|KY~J[\81M_\86Ra\88DW\7fGZ\87Uq\96D\\81DU\81L]\85FY\85J\\84F[\84G[\84I\\85J\\85J\\84LZ\82LZ\7fEX~FW~HW}HY{JY{I[\7fGX{CTxm\86­¢Âé¦Çî¦Èì¡Ââv\90³hz¥dw¤n\89µ\7f\9bÀp\8d³}\9bÀ\8d®Ô¤Æê¥Äé¡Ãè¢Ãé£Äé¢Äè¤Ãè£Äé¢Äé£Äé¤Äé£Äé£Åé£Åé¢Äê¥Âë¤Åé£Åé¤Äê¤Æê¥Äê¥Åê¦Åê§Åê¦Äë§Äë¦Åë¦Åê§Åë©Äê¨Åê¦Åê¨Ãë¦Äë¥Äê¤Åê¤Åê¦Åé¦Äé¤Äê£Äè Àå±Ïò\87\9eÈ7Fg<F`BKg@Ie?Hc>Hc=F^:E`:D^9C^5@Z0;U,:T,7R17R.7P,7Q+8P1:P19P1:O4<P28Q08N19N1:M/7J+3H+2G(1F+2F/4Hg\87¬s\93·\88®Ó\8a¸Ø|¬Ém\98·U~\9a<Uu@Sx>TwBSyETzEW|GZ\80FY\81G[\81J^\85L\\84GU|FX\80KZ\84J[\84FY\81IX\82HX\81HY\81G[\80FY\81DW}EW|EU{GX|EXzCUwDTwETxGVxHXzIY|FSxRh\8e\80\9fÃ\91ºÚc\83«Si\9bg{©cu¤Zn\9eQe\96Qd\97Re\96Qg\97h\81®\9eÀæ¦Èë£Âè¥Äé¤Åê¥Åé¤Æè¥Åé¤Çè§Åé¦Æé§Æê¦Åé§Åé¦Æé¤Çê¥Æê¥Çê¥Çé§Çé©Åê§Çè§Çê©Åë©Åë¨Çé¨Æê¨Æê©Æê§Çé¦Æê§Åé¥Æé¦Åê¦Äè¦Åé§Äè©ÄèªÂå®Åè³Ëí\93¬ÎIUw=Hb@Lh>Gb;Hb<Fa<E^:F_6D^6A\6AZ3=U0:T2<V.:S/9R.6O/5L17O3:P3;P3;O39M4:N0;N18M07J/7I+3G08K/5H-5G/3F=Sz=SyA[\7fHa\84?Wv<Lm<LoCSt?UwATvESvCSxDVxFW|FY\80IX\7fJ]\81M]\84IY\81EY\80HZ\81HZ\82FX\80FY\80GX\80HY\7fGY\80DV}DV{DV{GUzIWvARtBSuDRtDSuEQtCQtDTvIYyCTvEUxK`\85Wh\98]r¢[l\9fYm\9cUk\99Vk\9cZk\9cYl\9dUk\9aNb\93k\83°¦Çè«Èê¦Äæ¨Æé¦Æé¥Èé§Çè¨ÆéªÆé¨Çè¨Çç©Æé¨Æé§Èç§Æé§Çè©Çê«Æê«ÇèªÇéªÆêªÇéªÇèªÆê©Æé©ÄéªÄéªÅç«Åæ­Åæ®Ææ±Æå³Çå·Èä·Æä³Æå«Àâ¶Éè®Ààl{\9b:Ie<Ia?Ke<Hb;F`:D^9B^<C]9D^9C\6@Y09S3:R/9S3<T3<T1<S.:R1:Q3;P4;Q4:N4;M39N4:M1:L/7J.4H/6J08K07J/5G,4G+2FAVzCUxBTw@RuBQsAUtBTuBRs@StATxATwBTvCVvDVzIX|JX}IY}Rc\85JY\7fFV}J[\81KX~FW}FX}EX\7fEY{GUzGTzIW|FVyERuCStERrESsAQsCQrDQq@Or@QsCRsEUuFWyMXyO`\81Rh\91Ul\9cRg\97Sh\98Uk\99Qf\96Uj\9aQf\96Vj\99Qc\94e~ª Àà­Êê§Äå©Çé©Çè¨ÈçªÆéªÇè­Çç«Æè«Çè«Èé«Èè¯Èè­Çè¯Æè±Æé¯Çç«ÆèªÆèªÆèªÆç«ÄçªÄå­Ãæ±Äå±Ãæ´Åä·Æä¼ÈåÂÊäÄÌäÅÍäÀÌä¹Çá¼Î쨻ÜM\~0<Z;Gb>Ic=Ga:G`8D^8B]9C\9B]9@X9@W3<U/7S-7R+6P1:R0:Q.9P0<Q3;Q4;P1;N28N38M07K/6J.5H06I17L05J/5G,4G,4G,3F(0DCRt@StCUvBRqARo@RpBSrCTsBTtBSu@Uv@SuASuAUwFWyJX|EW|M[\7fI[{DW~HY\7fGW|BVzEVyEU{BUzJVyHV{EUwDRqDQqDQpERoDQnAQnAQqAQrCPrCQpCQpDQpERsFUtJXyJW{N^\86Pg\95Td\94Tf\95Qh\97Qf\95Rg\96Tg\98Uh\97Qc\91^v\9f¡Áà´Ìì­Çä°Èæ¯Éæ­Èç«Èè­Èè¬Èè­Çè«Ææ°Äå°Åæ®Äç®Äå¯Åå¯Åå±Åå¸Èå½Êå¾Ìå¾ÌåÁÌåÁËäÀËä¾Êä¼ÊåºÊå¸ÉåµÈåµÉå³Æã´Èå½Òï\9b±ÏIWv4?\<Ie<F_;E]8D]8B\7B]2@Z8BZ8BZ5@W2<V1:T.7P/9R08P/8P19O2;O5=O2:O08L29M17K08K/6I,7J08K06H.4G+2G,2E,3F+1D-3E-3CBRp@Rp>Pm@OnAPoCPnARpBRq@RqDRsDStBTvDUvDVvETwGWzGVyHW{EVyCVzGX{EUyEUxEUxDTvDUyHUuFTrFSkFPhDNgENgFOiCQjCPjCOjAQmDRnGSmCRoESoETqAQrERqESsCTuP_\84Qf\95Od\92Tg\92Rf\94Qe\92Ng\95Qf\93Sh\95Rf\94^u \99µÖ¶Ðì³Èè²Çå°Èå®Êæ­Éç¬Èç«Çæ­Ãå±Åä´Äå´ÅåµÆä¹Èä¼ÉäÁËäÂÌäÆÎäÆÏåÁÌä½Ëã¸Êå·Èä´Éå´Éå´ÊåµÊæµÊæ³Éã¼Ñë¸Îçy\8c§<Gc8A\<Fb:E_:E^<E[7C\6@[5@X6@X3=W1<S5?W1;U09R.9R08P3:O5;P4;P5<O39N.8M+5J+5J/8J.6K.4I-6I-6I-3F+1D*0D(/C*1C+0C*2D.2D=NlAPlCQl?Pl>PnAPnBQoAPn?QpASpBSr@Qr@SuBSuDUvGXzHXzFXyCUyCVxFUxFTwBVvASwETwCSpERjEQgCNf@NgCMeENfFQgHRjGQh@NgANfAOiHSlFSmCRmCSoCQnDPmCSpERqHTsL^\83Od\90Oc\91Pd\91Sc\91Of\92Od\92Nd\92Qh\96Ne\93Ph\93\87¤Å­Èâ·ÌåµÌç³ÈäµÉæµÊæ´Êå´Êæ´ÊåµËä´Ëå¶Ëç¿ÏåÁÐåÂÑåÀÏå¹ÍåºÍæ¹Ìå³ËæµÌçµËç²Ëä´Èå±Éä°Éå±Çã¼Òí\90£ÂK]y2?[<E`8Fb8A]6A[8C\9C\5@Y5?X5?Y5=W1:T/8S5>U3>T-8Q-7Q19P3:N3;N.8M-7J-5I,3I,5K/7I,4G+3G.4G/5G,4G(0E)0E)0D,2D-2B-0B,/A+1C?Rl>Rm=Qo=Qn@RpCRoBQpBSqDTpCSp@RqCQoCSqBTsDUtGVvFWwEWzJZ}GVvGUuDUv@TtCSrDQmEQeBOe@Kf=Jd=Le@Mf>Ke?KeBNdDNdBLeDMdBOfCOiITkIWoKVsITrEQnAPnERpESqDSpEXxOb\8cPd\91Of\90Pd\91Nc\8fNd\91Lc\90Nh\92Tg\93Qe\92Zp\98h\81¦®Äà¼Ïé²ÉãµËå´Ëæ³Ëå²Êä´Ëæ²Éæ°Êå¯Êå±Êå³Êä»Íå¾Ïç¼ÎäºÉá¸Èà·ÇߺÉáÄÎãÁÌä¿Ëä¾ËàÅÓë\89\99¸5Ed1?Z<Fa;Ea7C]7A[5?[5BY7@[3?[5AX7?W3<U/5P4<S3:P08P1;S0:P.8N18M-4L+4J,5J*3I,4G(2G(1D*2F*1F(1E(1E,3G+3E.5G,5F*1B*1B*1C.1B-2B09@3:@8@K=J]:GY;H[=Mf@OjCUqBTrBSpDUrHXuHWuDVsEXvCWwHXxIXvCSsDTsARtBSpAPh?Kd@Ke@Kc@Jd?Jd=Jd<Id=Jc:Ha<Jc?GbBJdBMgDOhDNcFO`DP_DM[DN`FSjAQnARpJVqGWrIWpIYvK_\85Od\8eMd\8ePc\8cLc\8fMd\8eRc\91Se\92Rg\92Qd\90Nb\8fk}¤µÅÝÀÒè»Êã·Éä·Êã¹È㯽ڸÃÚÄÍàÒÕäÉÏâÊÑã·Æܧ´Ò\94§Ë\87\9dÇ\7f\98Ås\92Ãt\95Å\8b¢É³¿×ÃÈÚµ¾Ú\7f\93¶9Gd:Ga;Ic9E`;C^8B\8B[6A[6A[4@Y5@Z4>X19U.8R(4O0:S18P/7N29O.:M)4J06K,3I*2I(.F'0H'1F(1F,4G.6H18J-3F-3E,4G.5G-1C)/B,1C-2C/5D-3B,0@'-)(-(+/+,/..0/.01/4515;5?H5>J@L_>IU?I[FRgCSjCXqETqM\yEXvCUuFRsERnAOg<Kd=Lc?KbAJc?Jc>Jc?Ib>Ha<Id9Hc<Hb;Ic:H_<EZ8AM5<C27>-2:04;7<<<AE>EMAL^JSjKVrKWsJWrFVrN_\7fQd\8eKc\8eNb\8dNb\8cMc\8fNe\90Rf\90Me\8fSi\93Nb\8e`v\9a¢´Ï¹Ê䬺×\9a®Ñ\93©Ò´½Ö½Äת¸Õ°»×ª´Ð\92¦Ës\8fÃi\89Ág\87Án\8aÂj\8bÄn\89Âg\8bÂg\87Án\8b¿\82\9cÌq\89¹:Ii>F_<Fb9C^:B\6A[4?Z8@Y8@X2>Y4=U2<U2:T5;S2;R-8Q17O28Q/9P.6L+4K,4K*0H'-E&1G(/E,2F*3G-4G,2F/5G+3E+0D07F,3F(.A+1C04D05B,3A+1?,1?.4A283+0.&)+(,***+*.-',*#')*,*,-,231.10-2205516<7;B7<B=DM@HX@K]@I[BL`?JbBMb?LbAMcBNfBJd>Ic;Hc<G_<EX:BO:@J:@J9=C37=/5:45=-3;,4<-4>37>27=6:=<>@;@E>GQAK\ESiGXsFXuL^}Ld\8aKd\8cLa\8bHb\8bJc\8dKc\8fLd\8eMd\8eQg\90Rf\90Uj\92{\92½\91¦Ò\89\9eÍ\82\9eÐ\83 Î\8b¡Îz\96Én\8dÂl\8bÂj\8aÃp\8dÄq\8eÅo\8dÅr\8eÅq\8eÂm\8bÀl\8bÀk\8b¿m\8dÄ^x¨@Nl=F`=Ea7@]9E]:BZ7@Z8C]4=W3;T5>W3<W2:T09R0:R0:Q.:Q6?S3=Q/7M)3K/6J(1H(1G'1G+7K16J47I26H(0D(0D'0C&0C)0C29I17F*2C*0A02@*1?-4?38C.3A37A,0,&+)$%'(++#')')++,.))-)+.(,.+-.+/1,12-/0+-.+/-+./.20.210121433556:@:AE6<B<AK=CN=DQ<BN9>I7<C8;?47:36;57:88;89;26:48=6:>16:37;48=46=27=03=.5=24936<49B;CPBNeHVpN^}Nb\86Oc\8bOc\8bOb\8aIc\8bMd\8dOe\8cNd\8cRf\91Qf\8fSf\90k\84µy\99Év\91¾g\87»e\83¸g\84¸n\87¹q\8d¹n\8b¹k\8a¼l\8a¼f\84´g\82²c\81±c~¯c~¯d~±Tl\96:F`9E\<F`;E`>E^=G^;G^:D]2>Y4AZ8BZ4?U8AV>EX9EY/<T7@S;EV<FV2=R29O08L+4I(3I16I5:L3<L/4I37J/5H+3E*2E'1E(2E+3D/5E6:G4:F06C*0@(-=+2?/4@,1=-2=**,%')#''&**"&)*-.-/0*,0(),(*-*,.*,.()-,/1/31*+./13+-0112,/1*./134,-.,./+,//14012034-0110445824805:038,17.37369.48/1723836903:15:25:47=24=+1<26=59>8<@48=07>9?OGPhQ[zPa\84Rc\88Nc\8cOd\8bPd\89Qe\8cQf\8dQe\8eQg\90Ti\92Xi\92b|®c\80¶c~µa\81¶c\81´b\7f³d\7f²d\82²`{®Um\99Vk\93Zl\93Xm\97[r\9cYt¡Th\8d@Jh6D_;Hb;F`:H`=G]>H^:H^8D[>G_EM`>H]<F[;EZ8CW>JY<GZ>FW>GV9DU8BS:BS2<O09M18L4;M7=N.7I+4H-3G)0D&.B*2G*1E(0D,4E/7D18D4<F.3A(1?*/<*0=+3>*1<%*8%%*&()),*,..(()%((%(*!#("%(&%).//%(+*,.)+-..1-.1,12'),&'*+,-0//++-$(,%&+')-)+/146+/2'*.+/3)14'-5-16-05037+07.2816;).6)/6)/8-09-0936<24;49?,3=)/;6:@GLKGJH8<A7<B59CGPgM]xN_}Mc\88Qd\8bQe\8aPd\8bRd\8bQf\8dQg\8eRh\8dRg\8dTj\91]u¤b|®`~²\{±[|°]z¯\w¨Tk\96Og\8eTf\90Sd\8cQd\8cK`\85CVv;Ic6B]4@Z6@X7BZ2?W5@U5AW8BU;DW<GW:AS*7N2;Q2;N09M5;N2:N2:N-6J-6H,4F%.E)0E*/C&.D&.C%-A(.@#+? (=")=#)<#(>#(<%*>+1A).=+2B#*;$&8$(:)/<)/;&-;$+9")7\e\1e%#')'))(*,#&(%')%)+\e\1d#%%+#&+$),+,,(+-(,/)+..02'+.'*/!$*!#(.-0,-.+-1'*.'+.%)+/32/24-,.().-22'+1138(+0&(/-04,+2688.251287;=6;<(.535836926867:*.4.396;=BAA=?@49=;?>8;DGTmKWsL[zP]\7fPb\85Oc\89Re\89Sg\8aSf\8bPh\8aUl\92Ti\92Vi\91\n\98\r\9f_x¥c\80²Zv¤Xl\97Xm\95Uo\97Wm\97Wm\97Vm\97J_\87GX}CRv>QsEXv@Ut?Qt?Oq=Np>Nq@Nn?Nm?Nn>Nn:Il:Jm=Kl<Kk:Jk8Jl8Jk:Kl8Kl;Jk<Km<Il=Jk:Ll7Jn8Kn:Mm:Mo;Nq;Mo=Oo;Mn<Np?Op>Qp;NnBQs@Np=Mn:Lj:Lj:Li:Kj8Lj9Jh#!#(,(#&$()(##$$#%*+*\19\e\1e" $\19\1e \17\18\1d*())*&##$%%%(**,0*)*(\1f # !$02.33-981,.-,.-'),012875;<;:9;<=>6;?+/959>12;8;A69BFHNEJN=CMAFPCLU;CSBHXJQ^EL\GQaLTeITgIUiLVlN[qMZqRauQ`x^l\8c`p\95^t\97_u\9bby b{¡e}¤c\80¦e~¦d\81¨h\83©h\81ªg\84­k\87¯k\86¬j\87­m\87°h\86­j\87®n\86°l\85±m\85¯l\85®j\85®k\87°l\85²n\86²l\86²i\88±i\88³i\86³i\85²k\84±g\85³i\83²g\82±e\82°c\81¯e\82®a\80­^|ª\y¦\w¤[u¤Ys Us\9eUq\9eXo\9bSo\99Rn\99Om\96Ql\96Ok\94Ni\93Mi\93Ib\89G^~Ie\8dGb\87Fa\87E]\82E[\7fAZ~@Xz@Uu?Rr<Qp=Nl9Ml:Mk9Mj8Lh9Kg6:=4;<2:=08?17>17>7=F;BN/8F3;K4<K5>L?HUBJZCL\DL`NZhSZmMXoLYoZbwU`vP_wZe}Ub|Wh\84[j\86]n\88bs\90ht\93bp\91`q\93[m\8f_r\93av\98_u\98gz\9ee| h{ j~£i\7f¦n\82¨o\86ªl\83«q\84©q\85¬m\85«l\85­p\85¯o\86¯m\88°m\88°q\89²o\8b²o\8d·q\8eµp\8c´q\90·s\8f¸r\8e¹q\8f¹r\91¸t\8fºr\8f¸s\91¹r\90»t\8f¹t\90¹v\92ºu\8f¹s\90ºu\91»t\90ºs\90¸t\90¸u\91»v\91»u\91»w\91»v\94¼v\93¿v\93¿t\94½x\95Àx\95¿x\94¾w\94½u\93½q\94¾q\92¾q\90¼p\8d¹m\89¸f\88³d\86±d\81­^}©^z¥_v£[s\9fWq\9bUo\98Ql\94Oh\8fJf\8bKc\8bJ_\84G]\82E\\7fF^\83DWz<Mi@Us?Ro;Pm:Mi9Li:Hd7Fb3D]4B[4A[6AX5BY2AW4@X3?T3?SKi\89Nj\8cSm\91Ro\96St\97Xt\97Yu\9a[t\99Yv\9d]v\9c[w\9aZv\9d]v\9e]z\9fdz¢c|¤c}¤h\7f¨l\83¬m\84«j\81©n\84¬p\88­m\83§n\82©n\83¨k~¢m\82§l\83§k\80¥k\7f¢m\7f¡n\80¡f\80\9fe~\9em\81¢j\82¡j\81¢l\85¥o\83¥q\89ªw\8c®u\8b¯v\89®p\86«o\84¨k\85©l\85ªj\82¨m\82©r\89¯n\89®o\8c³v\92¸t\92¹w\95¾|\9aÃ~\9cÄ}\9dÄ}\9eÅ~ È\81 È\83¢È\84¦Ë\83¥Ë\84¥Ì\85£Ì\86¤Í\86¥Ì\85¥Í\84¥Í\85£Ë\86¤Ì\84¥Ì\85¦Í\84¥Í\84¤Ë\85£Ì\86¢Ì\81¡É\83¡É\84¡Ì\83¤Ì\85£Ì\84£Ë\82¢Ê\81\9fÇ\7f\9bÅ{\9aÄz\98Àt\95¿q\90½l\8c¹h\8a´f\85³b\81«^}¥[y¢Yu\9eUo\97Sk\94Rk\93Ni\8dJb\87Fa\84K`\86G[\80H]\7fH_\83G[~CYxCXyAUt@Sr=Qm=Ol;Kf=Nk<Kg9F`9Fa5B[4@W5D]5CY4>T1<R1<PVu\9cUt\9cYw\9eYw\9cXx\9d\z\9e]{ ]y\9d\x\9d[w\9b`x\9cax\9fbx\9d`w\9faz ]y\9dd\7f¢i\83¤i}¡o\80¥o\85¦n\82¤k\83£i\7f\9fj|\9cn\82¢i}\9fk}\9ej{\9di~ i|\9diy\97e|\9bh}\9bey\9ao\80¡l\81¡j\7f k\82¥o\84¥n\87¨t\89ªx\8e±u\8c°r\89®n\85©o\88«q\8a¬n\8b¯q\88¯s\8b±p\8a²t\8a´s\90·x\94ºx\97¾y\9a¿y\9b¾{\9aÂ}\9cÄ~\9dÅ\80\9eÆ\82¡Ç\83¢É\81£É\84¤Ë\83¤Ë\82¤Ê\85¦Ì\85¥Í\86¦Í\85¦Ë\85§Ì\88§Ì\89¥Ì\86¢Ì\85¥Ê\86¡Ë\83 Ë\82¢É\82 É\84¡Ê\83¢Ê\85¢Ê\85¥Ë\83 Ê\82\9eÇ\81\9eÅx\9aÁw\96Às\91¸p\8fºj\88´h\85°a\81«^\82©]{¤Wq\97Ws\9bQm\96Pg\8dMb\89Ia\84G^\80I\}?TsBSqCVtARr:Ol<Ok;Kh5Hb6Ib5D`4BY8D^5AZ6CZ5>T1?T.5I,7K,7J*6H-5F-4F)2BXx\9cXv\9cWy\9cVs\99Yy\9c[z\9b[w\9aYx\9a\s\97Zr\95Zs\95\s\97]t\99`y\9e\u\96^r\97h\7f£g\81¡m\80¢i\80\9fh\7f\9fl\82£h~\9en~¡k}\9eo|\9el~ l\81£m\80¢k\82£m\81¢g}\9ee|\9cn\81 k}\9el\7f\9fg~\9ff}\9eg}\9el\82¥p\86¨q\87©t\8c¬o\87©k\83¥bx\98e|\9ed|\9ed|¡l\86«a} k\81¨l\84«l\8a¯s\8fµs\92·v\96¼v\95¼|\97Á~\9fÆ}\9fÅ\80£Æ\84¤Ç\89¨Ë\88©Ï\8b©Í\8a©Î\89«Ð\86¨Ì\89ªÎ\90«Ï\8f­Ð\8b¬Ï\8c©Î\89§Ì\87¦Í\87¨Ë\89¦Ë\87¥Í\87¦Í\89¨Ì\8b¨Í\87¦Ê\8a§Í\86¦Ê\85¤È\82\9bÂz\99½y\97»t\92·p\8e´f\86­a}£[y\9fQm\92Kh\88Kf\86Ne\85G_~C]}>Pl@Rl;Kf=Kf@Qm<Kg6C]8Ib6C\5E\5F_2?S1;O/8L1>P/>T4;Q06I.6G,3C*2B,2B'1A*4F)1C(.<*0>)1>Zp\93Wt\94Up\8fVr\95Vu\93Xp\90]u\96Yv\98Xs\93Vn\8eRg\89Tj\89Nd\82Tl\8aVl\8d\s\97^s\93`t\96h}\9fl\83£g\80\9ek\82£n\82£g|\9dl\81¢p\80¡j~\9fi{\9ek\7f\9fj\7f¡n\81¢m\80¢j|\9fh|\9dj~\9ek\80 i{\9cfy\9cp\82¥p\85¨s\8a¬m\86¨m\83¦t\8b¬l\85¦q\88«r\85¨h|\9fd}\9ef{\9fk\84«o\87­q\8c±s\90·r\90¶p\90¶x\95½z\99À|\9bÂz\99Á|\98À\7f\9eÄ\7f\9dÄ\84¤Ç\88©Ì\85£É\86¤Ê\87¨Ì\86©Ì\8a«Î\89§Ë\8d¨Ë\8a©Í\86¤Ê\83¤Ê\86¦Ë\8b¦Ë\89¥É\88¦Ê\85¢È\84¢È\86¤Ê\81£È\87¦Ê\87¦Ê\84¢Â\82 Äv\8f²x\8e±q\8d¯i\86«`{£[v\97Yu\99Wq\96Kc\84Ga\80H_\7fF[{DVv?RmBRk:Jd=Kg:Id9Ke3@V6G^3AX3AU5@V09J4AU5@V4;N5?T3=S/5G-4D-9H/9I08H+8I*2C,2A(0=(.<)-:Yt\9aWu\96Vt\96[w\9a[w\97Uu\92Vr\91Sm\8bMf\80Lb}Tk\8aQk\8dTl\8aSh\86Rl\8c\s\95bx\9bby\9ck\83¦k~\9ff}\9fj\7f£g\7f\9fi\7f n\83£i}\9dd{\9do\80£l\81¡j|\9ek}\9ek~\9dm\80¢l\7f\9eo\84¥o\83¥j~\9fm\80¡m\82¤m\85¥r\87§s\89¬v\8e±p\87¨r\88«s\8a­o\87©n\87«o\89¬p\86¬o\87¬o\8a®m\86­o\8d²s\8f´p\91·u\92º{\99Àz\9cÀz\9aÀ~\9bÄ~\9fÄ~\9eÄ\80\9fÅ\82\9fÆ~\9dÄ\80¥É\82¤Ê\81¡È\84£È\86¤Ë\88¦Ë\85¤È\86¤Ê\84¤É\87¤É\84¢È\83¡È\86¤É\84¡È\84¢É\84¢È\7f¡Æ~\9fÁ\84\9fÃ\80\9cÂ~\9eÀw\97»|\96¸v\93·n\8a°j\84«h\85ªZv\9aUo\92Ws\95Vv\99Pg\89H`\7fLe\87GZz@Tp=Tp=Pl;Mf;Mf7G`7F[<Hb4@U8F^;D]6E\5D]3?W0:L0:N.7J.9K/=P-9H*3B.9H-3C+3C'/<-4C-4EY}\9dQn\8bTk\8d\}\9fNm\89So\8ePm\84G[vH`|E]yM_{Na\80Oe\82Sf\85]o\91dy\9d\s\92e{\9dj\7f l}\9fdx\99f~\9d`s\92^n\8dbu\95_r\90`r\93du\94ct\95iz\9ag{\98^o\8dbr\92dz\99\l\8an\81¡dy\96gt\94dy\9ak\81¤l\83£f}\9fq\89©m\83¥m\81£n\82¦k\80£e\7f¡k\83§h~¡k\81¤m\86«k\85ªo\88­r\8c±r\91¶t\91¶s\93¹r\92¸w\99¿y\9dÁz\9bÂ\80 Æ\80¤Æ\7f\9fÄ\82¥Ç\7f Å{\9aÁ\7f\9fÆ\84¡È\84£É\82£È\83 Æ\82 Ç\86£È\84¡Æ}\9bÁ~\9cÃ\82 Æ\83£Ç\7f¡Å\80\9fÅ\85¢È\81\9eÄ\84¡Å\81 Åz\96¾w\93ºw\96»p\8f¶m\8fµk\87®a\84ªf\86¬b|¦Ur\96Vn\93Pl\8fLb\84Mi\8aLf\89Ga\80=Tr>QlATo?Ql@Tq:Jd;Ga7G]>Ok:Kh2AY1:N,4E,5E1>Q.;P-8J1<N3@S1;P,2C.:K0;M/8K+3C,4ATv\94Mi\84J_|Us\94Sr\8eTk\8aWo\90\s\98Xu\95H^zK_zM^|Mb\81Md\81O]~Yk\90^t\97e{\9aMazQd\82Zn\8a\r\8f^r\90i~\9b\p\8bO_z^n\8dVj\82HSjO\ydv\94Vf\80[j\88e|\9b^q\8cZj\84[j\82cu\93d|\9aey\97au\95m\86¥b}\9bl~¡m\83¤m\83¤i|\9eh\83¤cz\9eo\86«m\84§j\85¨b| i\86ªq\8d²m\86¬p\8f´r\91¶w\93»v\99¾u\98»|\9eÃ}\9eÅz\9cÂ\80 Ä\81 Á\80\9eÃ}\9fÅ\81\9dÄ~\9dÄ\7f\9fÅ\80\9eÃ~\9aÁ~\9dÃ\81 Æ\7f Å}\9eÂ\80\9fÅ\80 Æ\81\9fÃy\9c¿{\9cÂy\9bÀ~\9dÂ~\9b¿{\98¾v\95¹y\96ºv\93ºq\91¸n\8e´c\82ªe\84­i\86¯d~§Yv\9bQj\8cOh\89Nh\8aSk\90F\}E[wHc\85AVtC]zBXx?Rp<Sm?Ur8F^5BX<Ph?Qm<Lg5D]2=P>Pi<Ur4F_0=Q8I`6CZ5E\1>S-8I,9J/9J-4DJ]{Qh\86Qo\8aIe~Nf\83Qh\85Ma}G]wM`}Nd\83Lg\83J[uEWrNe\84]u\98_x\9bXn\8f_t\95d{\9c`v\94Wj\86`u\94j\7f\9bZm\88[p\8cXh\83cu\92i~\99SbzVe\83bw\95Tc{T_y[l\87Yl\87GYoFQfHTkUg\81Nc|Wk\88n\84 ^r\8ek~\9fn\84¥_x\97dw\98o\88ªf\80¡i\83¨h\83¦e\82¢c~£n\8c±o\8e²m\8a®u\95¹o\90´t\91·v\94·o\92´t\94¹y\94ºw\93¹|\9aÀ{\9b¿\80\9dÅ\81\9dÄ\7f\9dÄ\80 Æ\80\9eÃ\80\9b¿z\99¾\80\9bÃ~\99À\83\9dÃ\82\9cÂ}\9dÂ|\99¾x\96»x\97½s\93¸s\95¹v\94¹p\8f¶t\94ºs\94¸w\95¹t\90·n\8d²k\8a®f\84«e\84¨f\85ª\{\9eTq\93Zu\9bWt\98Nf\8aMe\86Nh\8aMf\88Mf\88E]|@Vs@ToEWu>UrG]}CWx8D_;Md;Mh9Kb;Kg5CY:Jc=Mg3@W2=R6F[5BV/?R7E\3<P.8J*6D+4COj\88Oi\8aQo\90Mm\8aJb|H\xVp\8ePk\85I_~Tp\93Ib\7fBVnFWoM_|Xo\91Un\8dRi\89\o\90f|\9dUh\82Yk\8ar\8a«m\84 [m\89Vf\7fIYqSd\80Wg\80Yk\86_p\8bas\8fbv\92]n\88^j\82Ub{P^wR_vVd\80jy\97`t\8dew\95q\8c¨l\83\9ddz\98Xl\88Te\81by\99`v\92`x\99]w\97\r\91[s\94j\81¦n\84¦m\84¦v\90±t\92´t\90³w\97»v\95·p\91´u\8e³x\95¸w\9a»v\97ºv\9b¿| Ã\80¡Ã}\9bÀ|\9a¾|\99¼~\9b¿{\9cÀ~\9eÃ}\9aÁ{\98¼t\94¸v\93¹v\92·q\90²x\93¶x\9aÀt\95¼u\93·x\99½t\95·v\93¶s\90·p\8e³l\8a®h\86ªd\82¥g\80¤a|¡`}¢]{ _y¡Wp\97Tn\90Wq\96Wn\93Oj\8dMe\89G_}F^|F^|H]~CZvAYuD[zBZy@Tq=Lg?SlAQl<Mg8Ia>Of>Ni:Mf9Ja9Kc;Ng9Ke:Ld>Md6G^5E[Wx\9dVz\9cTx\98Tp\91Xv\95St\90Jd\80Mc}Nb\80Qh\87La~Rk\8aSk\8aPg\84Me\82La\7fXl\8a\s\93cx\97\o\8des\95g}\9cfz\95_o\8abt\92ew\96Ym\86Vi\83bv\92^q\8b_s\90cx\94g{\99m|\9cl}\99kz\98dq\8eVg\81Xk\87^o\8dl~\9eq\87¥k\80\9ed\7f\9caw\98b|\9bj\86¥n\86§o\86¦m\86©i\83¦ay\99e\7f¡u\8f²u\8d°n\86¦k\85¨p\90³v\96ºt\96¸w\97»}\99»x\95¶w\97¹~\9fÂx\9b¾v\96·|\9a½|\99½y\98¸{\96¼z\97ºv\99ºw\99¾}\99½\7f\9eÁz\9a¼q\8b¯r\91³x\96¶t\97¸\8a¤Á\91£¾\84 Â\80\99»{\93¶v\96·m\89¬m\8f°l\8a­i\89«j\8b°i\88®[{\9fYx\9aYw\99Yw\9eVr\95Vq\94Kb\81Mg\88Si\8dOi\88Ok\8bG[zASp=NeF`{Jb\83?Tq?To>Rn=PjH]z>Rn=OgASm8I]:J`:Lb6EZ5EU4DW.8I,7E5CT:Ia2:LVq\93Sq\90Ic{H]wNg\88Vr\91Sn\8bPh\80La~Rk\89I_wDWpH]wSh\85K`xGTlP]|dx\9aj\7f\9eh\80\9e[m\88`t\92e{\98l\7f\9dk\80\9acr\90gz\97j~\9aq\82\9diz\94g{\97k{\96bp\88N^rJYpRbxNZpM^t?M`CRhbu\8f_r\88\o\89i}\9ap\83¡`u\93ev\92`w\93e~\9fl\83¢i\80\9egz\99j\87©j\8c°d\83§az\9cd\83¢q\90´u\94µq\91³o\8d°v\90´v\95·s\93³y\91³v\92´y\96¹{\99»w\98¹z\97ºy\98¼}\99ºv\93´x\96¹|\96»y\96¼}\9c¾}\9a½{\96º\80 Àk\88¯`Wb©\96\8a¡\9b\9et\86¤r\90³q\8e²l\88«k\86©o\8a®i\84¨`\82¥e\84©g\84¨^t\99Ws\93[z\9dXu\97La\81GZvG`}Nh\88Qg\89Jb\81BUnH\uDVo<Me@Rk>Pk5CX@PcFZv7?U5?N5FY?Og>Pi8H^:H[8FY3:H1:H0<K07E3?M9Ka:I^E_vI_zNc}J`yMh\82If~Me\7fSl\88Og\81Pi\88Wt\92Zm\89[o\8aRk\83Wk\88`v\94h{\9cq\84¤dz\98g\7f\9df~\98`w\90gz\95k|\96`p\87O\rfq\8am\7f\95ey\91_v\90Zn\86Uez\j\82`r\8aex\92Xi\7f^m\86[n\89Ue|ct\8fj\81\9df\80\9bh~\98i\80\9dj\83\9fcx\92Xk\88Vj\81Si\81]x\93d|\99\o\8baw\94\t\93_u\94i\81¢p\8a«n\8b­k\89©n\8c©n\86¥l\84£n\8b©t\8d¯{\92µx\9a»x\99¼z\9c¿|\9d¿|\99½{\9dÀ{\9bº{\9a¾| Åv\95¸{\95µ}\9b¼w\95·{\98º|\9c¾_n\8c4(*UH=\90\7fi\9c\97\97\7f\97¹|\99¿x\94·s\8f²m\89«d} [u\96l\89¬h\81¥\u\96\w\97Yu\97Rg\84Zu\92Xq\92Rg\87Ni\8aOg\86Jg\83D[vGYpPf\82K]}BUmBUn?SjH^vDXu;Nf=I]=K^@Ul>Ph9DW5BT5?Q3=N7EX:GY3>P4@N<L`0<MM_yMd~Sp\8eZv\95Xu\8fTr\88Xt\92[t\90Ys\8eWp\8bPg\80Lc}Uk\86_t\8e]u\90]s\90Zr\8bXp\88cv\92k\80\9aj\80\98m\7f\99q\84\9dat\8afx\8fn~\96hw\8eUfvOe|\n\85Vd{VgzYg}[k\81Zm\83as\88^p\83P`uZj\81\n\83Vg}cv\95u\89¦v\8c§dy\92s\89 _s\8aaw\8ek~\98j}\97bw\90bs\8ej\7f\9dq\8a¨s\8a¥w\8d¨\7f\8f­v\8f°u\94³w\92²v\8e®t\8f¬w\94²u\91¯z\97¶{\98·{\97µx\94µv\95¶~\98¹}\97¶w\9c½n\82\9eTXho\8a¦x\93µz\8a©s\86¥u\92²z\9c¿`o\86I99QEAvcV\96\83l\88\86\8aow\8bw\87\9el\8b®q\8b­s\90°a}\99Rm\88Xv\93Y{\98Un\8dNe\80Mf\7fb\81¡Yv\95Og\84Lc\80H_yNf\82Sj\87GYq?ObCRhH\rH]wAVn9FX;J[BWlATjEWn@Rh<L`7HX7DT9DU;HX<GX;IZ6@R),4*17-7@Nn\8aOm\86Kh\7fPj\85Wv\90Zt\8fVq\89Vr\87KczUj\85Xr\8a_u\8ea{\97^y\93\p\8a^s\8cXn\83]t\91n\82\9bo\84\9abx\8ddv\8ff{\92gw\8fp\81\9as\84\9b[p\84_t\8bfv\8bYl\80hz\90ar\86Wi\81_q\88hz\90fv\8bZjyXgzdw\90h}\97r\83\9ah}\92_s\88ez\8fp\85\9at\88\9e\83\98²}\92®v\89¥s\8a¤b{\93Zk\81dy\8ds\87£s\8b«s\90«|\91¬s\8b¥n\8a£y\91®x\93³u\92±x\92¯w\94°y\97µy\96²v\91°w\93µ{\98¶|\98´x\95²k~\99H=;*\1f\1ag~\97v\90®q\88§p\8b©r\8a¦t\8e«r\92²,2A\14\ e
+XKD\97\82m¸©\9c\8e}r\90\90\94p\8e°d\82 s\91¬m\87¤_{\99Xt\8f_v\91_{\97`z\99_{\9dTr\90Vm\88]y\96[u\93Ri\87I`zJ\tBSiBPcFTeBRf=Qd>VjI[sJ\rI\tAVl;M_BSfAOf1<I7FT<K^5DT:GT;FW6?L@K]<I[7DOMe\81Qm\87Ts\89Li~Ph\80Rl\84Rh|Og}Sl\83Uo\8bZv\8dUm\81L]oVh~]r\8a\q\89Wm\85dz\96u\89¢t\8b¢h\80\95cv\8cj~\95o\83\9ao\80\97r\84\9az\89\9f{\88\9eo\7f\91du\88l{\8fhu\8cWdyWezQ[jVfxf}\92Zo\85\q\87fx\91hw\8dcy\8co\84\9al\83\99\80\93¬v\90«g|\97i}\96dw\8ecx\8fj\82\9em\86¡t\8b£s\89£l\81¡o\88¥t\8b¨s\90«u\93­u\91«w\95²u\94³w\93°z\93±v\8f²w\94²{\98µx\97´y\95°v\95²t\82\98aW]\81ri\96\8a\82\87\9a±\80\9a¸z\96´v\93®s\93²u\93°{\96²{\99¶%-8\1f\1a\18cRG¤\91\7f¸©\9a\94\8b\88m\87¥k\8b¦l\89¤r\8f®d|\9cUl\86Rh\7f`y\92_|\98\t\92Mc\80Mc|[t\91Zv\93Xs\91Oj\84Nf{J^v?NaBScLatRk\81J`|9CW9=I<CNBXgL_wGYnAPc8AN=LY?Ob:K[CVf@J]7@K8AM5;E,18Nf{Mf|Vo\88^z\91Ut\8bXs\8d^x\91\x\93^}\91OfyTi}Vh}Scz^s\8bWm\80_q\8bn\81\9cn\83\9aiy\8f_s\89l\7f\97dy\8eo\82\9bn\7f\98i|\90fx\8an~\92jx\8bjw\8chx\8bbr\85eu\8aUhtHWbN]kl\80\96x\8e¥]q}MV_Q\h^m\7fx\8d u\88\9fbx\8d_p\85j|\92m~\93gw\8bgz\8fo\82\98f{\8eft\8an\84\9bm\87 l\85\9dg}\93bx\90h\7f\9cs\8dªo\86¡p\8e¬v\93±{\96²x\95¯v\92«v\95¯{\94³y\98\7f\9f¼x\94²^X_O@;bVW¯\9d\96¡\92\8c\83\94­r\8f¯p\8f­|\97´u\8e°v\90°y\93´m\83\9e%#*5*%lYJ©\99\85н²\86\8d\9ff\88¥n\89¦^v\92b|\95]|\97\t\90`|\97c\80\9eaw\93[q\8cJauL`rTg\81Pd}KXlQcxPf~KawI_xK_wH\rObyPi\7fNbyGUgAM^=JYCVgCWi?Nb9GV6?J02:*.27BHCSc@M]EYiI^rJezNh|\v\8d_~\92]w\8d^u\8d^t\89Wq\87Ys\8aWl\7fZm\81Xp\83Xl\82TdwUdv[n\81WgzYi|]q\83`t\85gy\8ddw\8aev\8dbw\8cdu\8bcs\85^l\7fXfyZn\80^o\81ap\85k}\90fz\8cex\8dm\80\96l}\91ZhvVgsp\83\93r\85\99t\88\9c{\8f£~\90£|\90¥s\8b t\88\99kx\89{\86\99\83\95¦y\8b\9fu\8a\9cy\8b\9e}\90¥\7f\93ªz\93«m\85\9ax\8d¢s\85\9bm\84\99l\82\96a{\8ej\7f\93o\85\9du\8d¨x\91­x\90«v\90ªu\8f¨z\92¯ev\8dQGEPFB`UP\88zw\98\87|paZ\87\88\8fy~\90\8b\7f\81¤©´i\81\9cn\81\9d{\95°CSi\14\f\rB70\8czf¹£\8f±£\9eo\85\9dk\85 Vl\7f[s\85c~\99d\83¢b\82\9ff\83¡g\82 b{\97b}\98]x\92\s\8d\r\8dSj\80]v\91Vk\87OcxQf|N`vPezSk\82Sf}P`xSh~K]mPapHWjEWdJatK]rHWdGYfFVeDSaAQ`AQ^GRbEPaOj~Qn\84Tu\8cSm\80H`oMbrZm\85c\81\97Wn\81Vk\81Xp\83NdvSh|Zp\81Wm}ax\8cn\83\99q\85\9bo\83\98i}\8fcx\86Thvar\86g{\8bfw\89jw\8bhx\89m|\8fq\82\95u\8a\9by\89\9ah{\8e_r\86fs\88ew\86Xm{ex\86v\88\99p\83\94bs\84gu\86kx\8bn~\92h|\90m\80\93s\84\96q\87\98~\92¤\81\94¨v\8c r\87\9as\8c¡d|\90_r\84hy\8cp\87\9dk\87\9ev\8e¦y\92«\7f\9b´v\91¨t\8d£n\86\98i~\90v\90¥u\95­t\92­r\89¢o\84\9cAKXA85PEB]PM\8c|v\8e\80}jXJ\83m]v`Yn]UàÑΨ\9f¤ew\88r\90«N[w\r\v\v"\1d\1cbSFyjZ¼«\96©¡\9fh\80\99e\82\9ak\81\9aj}\98j\87£_z\92Tm\80Qi{Zq\88[r\8b`x\90at\8dXl\83PcwUn\84Sg\80L^pSi~HWkHUeES^FVaJUdFXeI\jLauJWjIZjOezOe{RezR^rJYjCM[29>5=B49>49=KfwPh~Sm\85Us\89Xx\8dWr\87Xo\85Vn\83Th|QexUh}UjzUhx\l|Xj}e}\91as\87`p\85at\87i|\8fg{\8dj}\91i{\8d`t\82hx\8cm|\90i}\8eq\82\96x\86\9av\89\9au\88\9agt\86i|\8d{\8a\9ct\84\96i|\8em\80\93u\85\97k}\8bv\89\9cx\89\9c[o{`o\7ffy\8ajw\88o\81\92r\82\97r\82\97o\82\96s\86\97{\87\96w\87\98h|\8df{\8ej\80\92d|\8ad{\8ep\87\9do\85\9cfz\8fbv\8afz\90hz\8bo\81\91s\89\99m\86\9ar\8a¢j}\90`u\86M\i+%&J@>KB:^PJm^WYKDI>6 \19\193)(wfeÒÃÃÇÁÅTYh518_UDsgTn`N{jZ¬\9c\8b¼¬\9e¦ £dx\8fh\7f\96m\7f\94av\8aUj{R`oL]gPcpQgw[p\83cv\8dXj}Wf|LXjEVbJ^nK`rIYgL]kTn\7fTk\7fQewRjzXp\85L_qFVc>IRARZ;DN379CPWL\nJYhAKWDU`H[jGXhLm\80JfvNcuTn\82PexOarI[eGX`P^mUfwSizSjxXhx`n\7f]q\83gz\8ck|\8fi|\90f|\90dz\8cc{\8b^p\7f_q\80jy\8cds\84h{\8cg{\8ccs\81ew\87jy\8am{\8f\82\8e¢~\91¥\7f\92¦s\83\95j{\8a`q\80r\7f\91{\8a\9ct\83\94iu\84ew\84o~\8ar\87\97k\7f\90k\7f\91q\81\93k{\8ft\87\98v\8a\9ar\81\91l\80\93f|\89`s\81n\82\99o\85\9bm\84\98ct\83gw\81^ox\jt]o{i}\8cs\8a\9br\8d¡p\7f\92ct\82^oyfx\81r\8c\9c;EN"\1c\1a3,,$\1d\e%\1f\1fD98C;7\1e\1a\18\ e\r\ e:2/aRKʹ´Î»¹\91\82y\93\87x\9a\8b\91\7f£\92\80·¤\94Ê»´Ì¹®µ«ªq\82\97_w\8fUdpTdn_q\80cw\88_s\85Xk\7f\r\85Xl\7fTj~Vm\82PdwNarO`sTj~Vj}Qh{K^pJVgJ[kK]oQfxRexN`tHSbIWfGQa@IR;JP?KW<HSFT`?GP9@D=GTRjvQfsPfsQfuTk~Yr\84]{\90\w\88RhwVhyXjwUftRdrXhw`m\7f[l\7fev\8bi\7f\95j\82\9ar\87\9bp\83\96n\81\94m\81\94s\87\99p\84\96h}\8fo\7f\92y\88\99o\82\90lz\8agu\84gs\84hs\85ly\89s}\8f^n{]p~hz\87\gr]et`r\83r\86\9b\7f\90¢r\85\98o\88\99dt\83hx\86ey\85o\83\94v\87\9av\87\99m\81\98n\83\9cn\80\95br\81ft\83g~\8dg~\8bm\83\8fr\89\99y\8e£z\92ªx\94«v\92¨q\89\9ap\87\98k\84\95r\8f£y\90§x\91¨j\82\90\1c\1e \11\v\f\1d\19\18\17\15\12\r
+\v%! \e\16\17
+       \v70-LB>vc[£\86{ßËÄÕþ»®¥´§\9dÁ¯£¨\96\86¯\9e\8eƶ­ÖÈ¿¼´¸o\84\98Tp\85Ugzcx\8ah\7f\97av\8fWo\80Yr\82Zo\83Xm\80Ws\87Um\80UbsS_mWfvPevOcrZn{Un\85Qe~M^qL\pKYjFRaALXCR]CPVCS[FS^BNZ:EN=DL9@H19;6?BYq\81Zp\80Yp\81ShzVn\84\u\88\q\84Ym}Xk|Zp~VfrZjv^lzWjxVixZl~d|\8fcz\8abu\86p\81\93r\86\98j\81\91k{\8cao|gv\86j\7f\89ix\85p\83\95r\84\96kz\8by\8a\9b{\8b\98p\7f\8bes\82ds\83cu\85s\83\96m\80\8fZly[lygy\88cq\82ar\81hz\89g|\8bi~\8bp\7f\8cu\85\92}\8d\9dw\85\98m|\8det\85ev\88q\84\97z\90 v\8c g}\93e{\93m\84\9al\83\98dy\8dcs\85[n{bv\83s\87\97v\8c\9dn\88\9av\89\9cx\8c¥t\90¦\82\9f´L[i\12\ e\r \1e\e\19\16\16\19\14\13\ f\f\f\ e\f\f\ f\f\f,$"0('\1c\16\19O=3§\8e~Ȳ§È°¤¼©¡¸¤¡°¡\99«\9e\90´£\98¼­\9eɸ§Â´®\9d\9a\9diotP`gOcsWq\82az\8day\91Xn\84Vk}Xi~SbsNYgHS^M]kI[iHXdSbn]n\81Vh{WhyO^pGYgHXbK_oRk|[p\84UfzN]oM^qG[iCP]:AH>QZK]pPk\7fSk\80Yr\87Xo\85Yp\86by\8c^s\84Vn~Vl\80Tl}HYdP`nVgtWiz_r\83k|\8dj|\8dk|\8di\80\91s\87\9ap\81\97o\85\97v\87\96r\83\8fj{\89j{\8dl|\89dp~ht\85fv\86p\7f\91u\84\96t\88\99m~\8ehy\8ak~\8ejy\87du\83et\81p\7f\8fv\86\96gu\82iw\86r\82\91s\82\91u\8a\98v\8b\9dv\8a\9ag\7f\8cn\7f\8fu\88\99p\83\92o\80\93t\88\9ct\88\9an|\8dcu\86n~\8eiy\88ar\81gv\85mz\85m|\89p\83\8fr\87\98v\8d\9ex\91¥w\90¦v\8a¡q\86\99l\80\92j~\8d>FL\19\16\10\1a\18\16\13\11\12\12\10\10\10\ e\ e\r
+\f$\1f\1d5,)& \1f\1a\18\19PE=\88oc\99\80\90\84²\99\8dª\9a\8f¯\9f\9b° \9dº¨¢µ©\9d¶¥\99Ç´¨Èº±±¦¡\9c\9a\9a\86\8c\92{\82\8el|\88iy\86ar\7fRdqFV^M]iRetShzL^mDT]GV_NZeNZaP_iTapWjyYk|SamR]hHW_FS^DQ[ES[FPZGOV?MP?KS;CHOk{Rk|Up\82Tr\85Wq\84^t\88Zt\86[t\87Yt\84PhvUft\o}cx\85h}\8fiz\8cf{\8c`u\84ZhwZjydv\89m}\8dq\7f\90k{\8bjx\88jz\85dw\83gr\80q\81\8ds\81\8ekx\88m{\8bdv\81`r\7fj{\86ds|]js^mwZhr_mxhw\84s\85\95o}\8bp\7f\8eo}\88j}\89jz\88jw\86s\85\96w\8a\9cq\84\96t\8c¡s\89\9cp\83\97h~\90o\83\92u\86\92x\8a\99w\8e\9cm~\8abs{hx\85u\8b\9by\8f£z\92©w\8f¦t\8e\9fq\86\99n}\8cdt~dv\7fp\81\8dq\87\92{\92\9eTai\11\r\f\13\12\12\12\11\10\ e\v\f\r
+\f\10\ f\ f\1d70)/*)'$"<3/H;6\JGs^Zwfb\87uq\9d\88\83ª\98\93®\9e\9a¯\9d\97¬\9a\97£\96\92±¡ ²\9e\9a¯ \9a¶§£³£\9e¬\9f\9b­¦£¡\99\9a\8d\8d\8e\81\87\89t{\82qz\83n}\84jz\80bnuSdkRbjM\fQgqRfyM[iO`nO_nM_hTdnVerOX\EPML[`O_iUbmP]cWj{Vn}TkzVk|Ul{\p~\q\80at\82Zlw]r\80cw\84ev\84bq}ar\82bt\80]m{]p|^ozaozew\85w\86\94m}\87dt\82kz\8bs\82\91u\84\92s\83\90w\87\96k\81\8dcs\80iu\81gu\80]mwWeoTaiMX\FW\Udmjw\83s\82\8fp\7f\8dk{\89v\87\93z\87\93iz\86gx\86ev\86ky\8am~\8fjx\89j|\8cj\7f\92k{\8bl{\84n~\87jz\85m~\8cs\8a\9bt\8f£v\8f£w\8d u\8c¡v\8d¢t\8b\9du\8c\9bw\8b\9cv\8c\9fv\91¡{\96¤|\91¤z\8d\9fw\8d£z\90¨HSf\ 2\0\ 2  \a\f\v
+\f\ e\r\f\r\r\r\f
+\f
+       
+\1c\18\182*&!\1a\1a\1a\14\15)$"2)':.,+!"2'&>52K@?ZIF{hd\94\81|\8awr\89wr\95\81\8a\81\9e\86|\9c\8a\82¨\9a\8f°£\99»­¢É½·À°®®¢\99´«¢¿³®¸­ª¯§¥£\99\97¡\97\95\98\94\92\94\94\97\8e\8f\92z{zoutbilPYWQ[`N\fIW_?IK6CA@NUIV`N]jWjzZo}YnzXlvVjvRgwXm\82bv\83ny\85t\84\8eo|\86nz\85o{\87mx\80bq{`oyet\7fh{\88r\81\90v\85\93r\82\8fo\80\8en{\88lv\82m|\8akz\88kw\85dq\81jv\88bx\88ew\87fu\81^lybp}ar|dq~ao~iv\86gu\83fs\84hr\82et\82i{\8fhx\8bj{\8ah|\8cl\7f\90iz\89cu\85hv\87et\86fv\87o|\8bky\84o~\8cl~\8dk\81\8el\83\95n\86\9bo\84\9ap\82\94s\81\91u\84\94u\87\97v\8a\99p\82\91n~\8fr\83\92k{\83kz\83jw\7fx~\82egk?C=# \1e
+\b\f\r\r\ e\f
+\f\ e\r\r\b\a \12\ e\ e\1e\19\17$\1f\1e\14\10\11\14\10\12\13\12\12#\1f\1e<0,F96UH?VK@=72,$&\1f\19\e4,*LAAXMK\85ys\88sm\84ri~rn\91\87\82»³¬ÇÀº«\9c\9e¦\99\97© \9c\9a\8c\89\9c\8f\8c¡\93\8f \93\8c \90\8b\9f\8e\88\9f\8e\84¦\95\86± \93¨\95\8c¢\90\85­\9e\93§\99\90\9c\91\88¥\9d\95¡\9d\9b\9a\99\9b\8c\8b\8bzzwtwvikoTfvUiwSepVfsVjyJcxLbxM\oR_pZh{ap~foyet\82ft\80eq}eu\84ds\80Zfr[hvmv\84p~\8afw\85]mx_kscny`nzal}bo~_jyZgs\kwar~fq~kv\86my\88gu\84co~^l\7fcr\83ap}am|gp\80aq\82cr\85cn~hn{io|hx\89fv\85ex\85hu\83it~`mtes~aq{[lrbmwcp|ev\83n}\8eq\84\92p\7f\8dkz\87k|\8amx\84oy\81ku}OXahx\83q\81\90RNVmcd\87\7f|àÙÐOIJ\ 6\ 5\a\10\ f\11
+\b\v\ 5\ 5\b\e\16\16-"\1f$\1e\1c#\1e\1f\13\11\11
+\a      \ e
+\f\13\10\11\1d\19\1a(\1f\1f5,+B82QEAE855-,H>;:1.;43@65D<:]RP\QNc[Z\8d\84~\9c\90\8d\86vo\85yp\88vqwhb\82wo\91\81z\90\84}\91\81z\8d}q\98\88\9e\8e´ \92\98\83w\95\85s\9f\8cy\9e\89|\99\88\91\86®\9e\93²¡\97¬\99\90£\8f\83ª\9c\8d¡\8f\86TfrQalTesUivScjO`gQakYitWeqXgwZly`o|bt\81\p\80[m}Vhx[kyao~\kwYgtco}dp}cs|dr~iw\84gr~fqzix\87fw\84l{\88r\83\92l|\89ix\87gu\83]lzZiyNTaTQZb^eicjhaf]W`aYb`TWA56?6;SKNSOW^dq^n{\lvbox^msbp{^ks^lscox`ls]nt^nw`lvssy`ho]hjkrykx\81k{\84\13\17\1cUMT\82\7f\81PLK6-+A43]QT\ f\r\10\ f\ e\10
+
+\r\v\b\v\v  \v\16\13\12&"!=204.+%\1f\1e\e\16\16\15\12\10\13\11\11\15\12\13\12\ f\10\1f\e\1a\1d\18\19\1a\15\17-#",%'800=64C98I<9QFDD99C<8NIEbYWcURth`yibn^Vm`Xo^Wq\Sl]R\83na\85od\89uj\93~r\9f\86{\93\7ft\97\88\8b\80\9a\85r\92\7fqxf]\93\84\8f\83\98\85x\8axl\8azr\87xn^s{_t\80bx\84\ox\lt\mxXkt[lu`q}cr\7f_ozbr~aq}]lyar~]ny]o\7fYjx_lyft\80ew\80YenYbnUZcRU_ccoefpcbpww\87qq|jjxehw`dt[gz`n\80IT^\15\14\17:25C;>B;=JDEG<<@57J@BC;=GAAQKIC:9MAGccnfv~`mtdnu`nu_mvfo\7ffw\89o\82\94n~\8fkz\86[XYJ<?cVT\9b\93\8c­£\9d\87\82\86~\84\8d''(\1a\12\14MA>7//#\1d\1e' "\b\a       \r\v\r\v    \f\v      \f\v
+\r\r     \r       \ 6       \b\a
+\e\16\19.((\1f\e\1c\1a\15\18\13\ f\10\10\f\ e\13\ f\11\11\ e\ f\16\12\13\11\r\10\v        \v\10\r\10\16\12\15\18\14\16\1e\1a\1c+%#3)*.%&+%&3..D>>803.),:23<01?54F;:G84I84n_WiXOyf[iXP`QIq^S|g\dRG~na\7fjbjXS\LEaUMq_Vzh`}mdzh`|mfZmx[ozZkt[jr^my\px\mu\nwau\81du\81^q|^mycq~^mwZiscqzbmxdu\82h{\88`kvMQ[E@GE?JGALC;E=6@405$  &\1f%5-2,$'6.34,15/:]dtFTX\13\13\16@;::32D=<A:;:422,-724B<>cWZ_USQIIJB@RHKXYfs~\8es\83\92v\87\95u\84\8fs\81\8eu\84\8fp\82\8du\86\92agp=32VMD\96\8c|¾¯££\90\85B64\1d\16\eA74\11\11\13\ 5\ 5\a\ 4\ 2\ 6\ 3\ 3\ 5\ 4\ 4\b
+\b
+\v\b\f\f   \r\f      \f       \b
+\b\a
+       \b
+
+
+\v\a\ 6
+\v
+\r\f\v\r\f  \v\f      \v\b\a     
+\b
+\v\b
+       \a\v\v     \f\ e\v\ e\v   \f
+\b\v\ e
+\r\f
+\r\12\ e\12\17\13\16\19\13\15\1f\1c\1e($&1+-'$"\16\15\16\1e\19\1a\10\ f\11\1a\17\18\1f\e\e!\1c\1c\1d\15\16.(&80/I<9]PITHD=2.QC=\MEcSLYJE\NFTFBG=9[NEWIBZKF\LG[KDZmwYnxVlvZnzZoyZjuap}dx\84ct\80dv\83dv\83]nw_o|bs\80fx\86ky\87fw\84^mvfu\7f0:6\15\ f\12-'.0,5*'.\1d\e\1d\15\11\12\1c\18\19% !\1e\1d\19\18\17\18('(4-.,&&-')\_pR\_
+
+
+@:@VPM911;55;450**&  -(+J@CF=?G@DF>B<44*!!MLWfp|p{\8a{\88\94~\87\91~\89\92z\87\8fv\83\8b_fh:31YQP\89~\7f©\97\91\97\87zvl``ZP#\1f\1f\f\v\ e\f\v\f\f
+\f
+       \r\v
+\ e\v     \f       \b\v
+       \v       \b
+
+\b
+       \a\v\b\b\v   \b\v
+\b
+\b\b
+\b\a
+
+\b\v\v    \f
+\b
+
+\b\v\v\b
+\f      \v\v\b\f\f\b\v\v\b\v
+       \v\f      \r\f      \v
+       
+
+\a      
+\a
+\v
+\f\13\10\12\19\16\18.''"\1c\1d\14\11\12\10\r\ f\ e\r\10\ f\ e\10\e\16\17\1d\18\18\14\12\12\1a\16\16\18\13\14\1c\17\18)"!(! \1d\19\1a(  4*)A83SIESECD72K<5N@8TF=J?9MA:XgmYisVjtVhqZhwYhq[gq]kyUdmWdm_nyiw\82dr}gs\82eq|_jvZgq]kv\jx@PP"$$\11\11\12\ f\f\f\1d-'#.+'*(%930=>842/=>>A>=DADGKWP[qKU`\12\14\12\10\r\12'!%$\1e"&!!+$&*&('"$.(,=69?88KFJKDF<50;8,FIGfqzrz\7fv~\85x\81\89u\80\87u\80\87~\89\94Wbj\ e
+\f\ 5\ 3\ 6   \ 6
\e C>BcX[aVU&" 
+\a\v\r\v\ e\v \f\f\v\r\v   \v\f\b\f    \b
+\b\b     \b\b\b     \b
+\b\b
+               \v\b\b
+                                       
+       \b
+\v      \f\f      \r\v      \v\v      \v\v      
+\v\b
+\f
+\f\f     \f       \b
+
+       \v\r
+\f\r
+\f\v     \v\f      \v\r\v\f\r\v\v\ e\ e\ f\ f\r\ f\ e\v\r\18\16\15\14\13\14\ e\f\r\12\ f\11\12\ f\ f\15\12\12\15\12\14\16\13\14\e\17\17\1e\1c\e\1e\1c\e \1c\1c0+**&%& \1e\1c\17\16\14\ f\10\1c\16\16\1f5,(:0+G<6XJBH=9>31\isWfoVgq\mvZhqXhp]irYhp\ju_ny_nxit\81gu\82dp|anzdq\7fXfnYfs_iyWdpMU^7@D*03369899?BAHIDDE:AA8FGFJJKRTZX`iT]lUbvJWg\1a\1e\e\15\14\12\16\15\13'$ 1.*40*0,'(&$2+*;22RFGd\[LKD?>2CE9\deo\7f\8aq}\87t~\8as\7f\8at\81\8en{\8ar\80\8eNW\\ 6\ 4\ 5      \b\v\v     \f\b\ 6\b\ 1\0\ 1\0\0\0\ 3\ 3\ 5\v  \r\v
+\f
+       \v               \v\v\b
+\f      \v\f
+\f\v     
+
+\b\v
+       
+\b\b
+\b\ 6
+       \a               \b               \a
+\b\b\v
+\b      \f       \f\v\b
+\v      \v\v      \f
+       \v\f
+\v\r
+\v\r
+\v\v
+\f\f     \f\f\v\f\r
+\f\r\b\v\f\v\v\r       \f\r\v\v\ f\ e\ e\ f\ f\ f\r\v\r\f
+\f\11\ e\10\r\v\r\r\v\f\v
+
+
+\b      \f\v\f\f\b\v\v\a
+\f\v\v\1d\18\17\1f\1a\1a(#"#\1e\1f\19\15\16)!\1f!\18\19\ e      \f       \ 6
+
+\b\v     \b       \12\ f\10\1c\16\18\1d\18\19\1d\17\19Xdo[is]p}`o|_o{^p|\ny\jx`p}[iw_l{WdqSaqbk|nt\83t{\88t}\84qv|xy\81x|\7fptuz~\82qx{ckpT[aQTWSUWOVUNVS\adZcbknsry~pw|nv\7f^eqAHL7:6AA7CC=@C:AD;EF=?@7=@9CE<@A:FFAOSJQVK]a^msyx}\88x\80\8a}\84\92\7f\89\94{\84\8flz\88eu\87RZb#$\1e\19\1c\17\17\18\14\17\18\14\13\15\12\r\f\r              \v       \b\v      \a
+\b\a
+
+\a              \ 6
+\b\a
+
+       \f       \b
+       \b
+
+\b\v
+\b\v\v\b
+\b\ 6     \b\b              \b
+\b\b
+\f      \v\ e\f\f\v\b\v\f
+\v\v
+
+
+       \v
+       \v
+\b\v\v    \v\f      \v\v      \f\v
+\f\r
+\f\f
+\f\r     \v\ e\v\f\ f\ e\ f\13\11\11\11\10\10\r\v\f\r\v\v\v    
+\b\a
+\b\a\b\b\b\b \b
+\v\b
+\v\b
+
+\b
+       \a
+\r      \r\10\f\ e
+\b\v     \a       
+\a      \f
+\v\19\15\16\r  \f\ 6\ 5\b    \a               \ 6\b\ 6\ 4\ 6\ 5\ 4\ 6\ 5\ 3\a\b\ 5   ]r|^r}\lwXgrZiu^iq\kv[jt[hqVaiO_hNYfIYgMVeQVeW\giippoonpptuv|\80~\80\82\81\84\83\81\85\87\88{zynpokqqafj\ch`gogmtiq|gr~dlvfmzemv[aePTOSUOPTLNQERVMTYRX]X\d_ad`^dbY_Y`b`koox}\7f\84\86\8b\83\84\87v{yy\80\86\7f\86\8dx\81\8amw\82mt\82U`h>A<47/+.'%(" !\e\12\10\ e\f
+\f
+\a\v\b\ 6
+       \a
+\b\ 6     \a\ 6
+       \ 5
+\b\ 5             \a
+       \ 6       \ 6\ 5      \b\ 5\b
+\a
+\v      \v
+\b\v
+       \v       \b
+
+\b\v\f
+\f      \b               \b
+
+\b\v\b\ 6
+       \a       \b\a
+\b\a     
+       \v\f      \v\f\b\f\f   \f\r\v\v\ e
+\v\ f\r\ e\11\11\10\18\16\14\1a\17\14\ e\r\r\10\f\f\ f\ e\ e\f        
+\v      
+
+\b
+\b\a             \a\v\b\a
+
+\b      
+       
+\v\b\v
+       
+               \v\v\b\v\r
+\v\v
+\v\b\ 6\b\v\b\v
+\b
+       \a
+       \a
+
+\b      \v
+\v\r     \v\v      
+`flZglWejWbc[cfVbcXac[eh\ej]gnWcjQ^eJVZHQYFR[COWIS_^frjpzjq}sx}rtxnqvnt{mrxoszqw{mv{lrvilonu{mw\7fktylqwot}u|\85kvx\aZ[^W[^U`d]ejdfnhckfdjeegacd_^e_bdejkpmrwuz~uzywyz||~x}}xyyuvxru|klrYZ\EHI<=@*./!$%\1a\19\19\13\12\11\10\10\10\ e\ e\ e\ f\ e\ e\r\v\v\b\a
+       \a
+\a\ 5\a\ 3\ 2\ 5 
+\f\11\11\13\v  
+\b\ 5     
+\a
+       \b
+\b\a             \ 6
+       \a       
+\b
+
+       \v\b\b
+                                       \v               \v\b\a     \b\a
+\v
+\v\v     \v       \b
+
+       \v\f
+\v\v     \v
+\b\v\ e\ e\ e\15\13\13\18\16\14\ e\r\ e\r
+\r\r\v\r   \ 6
+       \b       \b\a      \b\a\b     \b\b\b\a    \b\a              \ 6               \ 6       \v\b\v
+\b
+       \b       \f\b
+\f\v\v\r
+\f\v\b
+
+\b\b\v    
+\v      \f\v\b\v\ e\v\f\r
+
+\v\b     bXX\abZghZcbYba\dcZdf^ff[ef\df]fi\bd\ej_js_hp`lt\hpVcm[eq[aicjsgnvimvlu|lrxmtzorsrwztz{y~\80rwwquzu|\81pw|mqtpuxovzqwvfodmqkqwumvqltnstqputjslirlmrrkrphkihmomrxku|nu|qw|ovzpw~kpuach\]bV\bHIO;>D05=.2:"(/\18\1c\1e\16\17\18\14\13\13\f
+\v
+       \v
+       
+\a\ 4\b\13\10\ f41*\1f\1f\1a\10\10\ e\r\r\ f     \a
+       \ 6
+\a\a\b\b\ 6          \ 6
+       \a
+\b\a
+
+\a\v     \ 6
+       \a
+\b\a             \ 6       \b\a      \a\ 6
+       \a               \b               \ 5
+\v\ 6\v\v   
+\b\a\b\b\a          \a       
+\b      \r\f\f\r\f\r\v\v\f\r\f\f    \b       \b\a      \b\a      \b\a      
+\a
+       \a       \b\a      
+\ 5              \ 6\b\b\a            \b
+       \b
+
+       
+
+       \v       \b\b      \a\b
+\a      
+\b
+
+\b
+\f\b
+\r      \v\f\b\v\r   
+i]Z\ZUKOLUWTX][X]_[bf]hl]hj_fj\eiahkbkpdluensfmrgnrjqtltyktwkppjqrmuvjppjpoovvvy|ty{x\7f\80q{{nvopwvy~\82z\80\82{\82\86{\85\89z\82\86z\80\81vxqw{vz}xw~vw}yx~|wzzmuomqmostryzryxlsqortntvjruqz\83qx\80jt}gp|ZflLV]DKTAHR>GQ7=E49@46<226\1c\1a\1a*" 3/)\12\12\12\10\ f\ f\f\v\fFB5qgO\8e\88oqpe\ 1\0\ 3\a\ 6   \a\ 4\a\a\ 5   \b\ 6              \ 6\v      \ 6
+       \ 5       \a\ 5\b\b\ 4\b\b\ 4        \a\ 4      \a\ 4      \a\ 4\b\ 6\ 4\a\ 6\ 3\a\b\ 4\b\a\ 3  \ 6\ 3      \a\ 4\b\b\a   
+\b
+       \b       \b\b      \b\b\b
+\a      
+\b
+\ e\v\f
+               \b\a              \a       \b\ 6              \b       \v                       \a
+
+                       \ 6\b\b\ 6    \b\a      
+\b      
+       
+\v\b\v    \a       \b\ 6      \a\ 6\b\a\ 6\b  \ 6       \v\b\v\v\b   \v               \f       
+eXUYRM;98FCKTQ]YXd`bj`ej`johnp\85\88\84\98\97\92}~~cikioujtzkqyptynuzs{\80qx{v|\83w\80\84t{{vz~y|\84u{}w{{w{}xz|\81\86\8b{\84\86y~\81z\7f\80{~\80y~\80s{vu{ty~x{}wx\80x|\81{}\80{\7f\81\83u|vntmlmhprqnrqrwzq}\82mu{ow}jswejofmshntaltco{]hwXepTajOXaISZCHNQOT::=\1a\1d\1a&& /-(#$" !"$"\1eIB;[PB\8a|qwns\1d\e\16\19\19\16\15\15\14\10\ e\r\r\v\v\v
+\v\v
+
+\v\v\f\f\v\v\f\v\v\f\f\r\f\v\f\v\v\v\v
+\v\v\f
+\f\v\v\r\v
+\r\r\f\f\v\v\v\a\v\b\ 4\b\ 6\ 3\b\ 6\ 2\b\ 5\ 3\a\a\ 6\b\b\ 6\b\a\ 5\b
+\b
+
+       \v\b\a             \b
+               
+       \b
+\b\b             \a\b\a\ 6\b\b\ 5\b        \a       
+\b      \v               \f\b
+
+\a
+       \b       \b\ 6      \ 6\ 4      \ 5\ 4\b\a\ 4\a\ 6\ 5\a       \a\b
+\b      \b\a\bXOSe][Z^aKU\QVaW]e\flajpMNSRIP\81u{\88\80\82b^bfhijnmjosouzpx{lvyqvzt{\7fv{\7fw}\80w}\80|\82\87vyztwwx|~z\7f\82z\80\83x~\81y}}{\80\82z\81\82|\80\80}\82\83\7f\83\80~\81~~\83\81}\84~y\82||\7fyz}uz~yv{wpuontnlpmopnrxyrz~ox}pw\7fsw|p{\82m|\81mz|q{\83n}\87iu~ns{mt{hnqkps_glT\aLRVNXXLPK:A99=548165.86/DD;GH=FG>AB9==6572.-('(#\1f"\1d\18\19\16\11\13\10\ f\ f\r\10\10\r\10\11\ f\13\11\ f\12\14\10\12\15\ f\15\16\ f\17\18\12\19\1a\13\1c\1e\16!"\19##\18 "\16\1e \18\e\1d\16\16\18\12\ f\ e\f
+\b
+
+\b\v\ 6\ 5\a\ 4\ 2\ 6\ 5\ 2\ 6\ 5\ 3\ 6\ 5\ 3\a\ 6\ 4\a\b\ 5\b
+\a\v     \b       
+       
+\v                              
+
+\b
+\f      
+
+\a
+       \b
+               
+\ 6\ 5\b\ 6\ 5\b\ 6\ 5\b\b\ 5\b   \b       
+       
+       \a       a`\hc\]`_YdiZci\gnS]a;;:*'%\1f\1a\eKBHZY]LBGdakhpuqtyu|\83t|\81uz\7fwz\7fy|\7fz\7f\83y|~ryzz\80\85\80\82\85|~~y}}z}}vyy{|}\7f\83\83}\81\84}\80}}\7f}{~{plm\89\7f~\8a\86\84\86\83\80\85\82\80\7f\80~x~zu|xuwvqvuqsrpspstutvuqtnnurruvtx{u}\83v\81\87t\7f\85u|\82nwxntwotvvzyy\80\7fz\80\81w~~ryvrwyuz|lni_bWY]PX]MU\MWYKX[I]`PZZKRWJOPDEH>BG=CE<EI?AE;680'*#\1d\1e\e\18\19\14\15\15\10\13\13\10\15\12\10\13\14\10\13\15\12\17\17\12\17\18\13\18\1a\15\1d\1e\16  \17#%\19&(\e*- ,/ (+\1e,/!'*\1d "\19\1a\19\16\16\14\13\15\15\14\11\12\12      \b       \ 3\ 1\ 3\ 2\ 1\ 2\ 1\0\ 1\ 4\ 1\ 4\b\ 6          \ 6
+\a\ 4\a\b\ 6\b \a\v
+\a\v\b\ 6
+\b\ 6\v\b\a
+       \a       \v\b
+\f
+
+       \a       fjc^]X[ciVagRT\RT\@AE;97>=;523RLSVUVLIKXX_ggopvzt}\82v{\80v|\7fz\81\83x\7f\80|~\7f|\7f\7fw~~u{z{{\80z~~x|{x|}w}~{}\7fx{yvvyqturuvrvv76:\84rr©\9a\93\9b\8e\89\9a\90\8b\87\81\7f}ywwvsgkajmgnpkmrjjpfjndnriqvrqxypvrosotwwwz}r}}w\7f\82x}\81u}~{\7f}\7f\81\80\80\83\83\7f\84\81\83\86\84\7f\82\7fvxqsvjkoahn[np]oveos`knWknWhkVceR``MXZKRTGQRDSSCQTEQTELMBCE;8<2.2)'("\1f"\1c\e\1c\17\16\16\13\12\15\ f\13\14\10\14\15\10\14\18\12\16\19\13\18\1a\14\1a\e\15\e\1d\16!#\19$%\e%'\1c*+\1f/2!25%59+?E;JPOIPO?FE@MK6>?\e\1f \b\ 6\b\ 5\ 1\ 5         
+\a\a\b\ 3\ 1\ 2\ 2\0\ 1\ 2\0\ 2\ 2\ 1\ 2\ 5\ 2\ 5\ 6\ 4\a\b\a\a       \a
+\b\ 6\b362=>?LT^EIRFJPLNSQSYQSXGHKBADMLLTWWcefknrlpvktwswzu{}t|\80{\80\83v~\80v{}\7f\84\8a}\81\82{\7f\83~\7f\84z\82\85{\82\85vy|{|}\7f\81\84z\82\84y~\83x~\84ow~ent47:rdd\96\86\7f\90\80u\88{t\8e\80~\86zsvmi¢¥\9a\7f\83xkjempimqirvnmskmmipsonvptupwxsx|zw|~wxy{}}{\84\7f\7f\83\81\82\85\83\7f\83~\83\89\86\84\87\84\83\85\81\81\84z\82\84xvufyzi}\80q~\7fo|{g{{gwyest`loXhhScfQ`cO^bM[[IZ]HX\IXVFUVCVYGTVFNQ@MP?KJ<9<113(**# !\1a\19\e\15\18\18\13\15\17\11\16\18\12\18\1a\15\1a\e\16\e\1d\16\1c\1e\15\1d\1e\17\1c\1f\17 $\1a&'\1f),!/0(:;3HKGNUTW]`X^_021\19\1d\17@HBELJ;A@399,//%+*\e\1e\1e\ e\r\ f     \b       \ 5\ 5\ 6\ 6\ 5   ..3FKOSY^SZaUahZae]ckX`fTY_TZ]^adcfghlmkprlppoqrlpojplswyuwzrvtptpqqnsvtwxzvv{|}\83~\80\85wz|yz}ootjhmqntnnrgjockzCMTA6=\8axz\94\85\80\89wsqefNFLc]d¾·¸¬«¤a\\ifld`eebaijfjlj]YYvv}{~\82\83\83\82~\82|\7f\82|\84\84\80\84\85~\87\8a\87\86\89\83\86\89\82\88\89\7f\89\8a\81\88\86|\85\86x\8a\89~\8a\88|\83\83s\84\85w\85\85z\82\82v~\80pxvcrs[su]qpYjkSjkRpqZrrZloXilShiRdeObbNbdO`bM_`LdbNdbNabO]]JWZHMOAAE79;0,/&!#\1d\1a\1c\15\18\1a\13\1a\1a\14\19\1c\15\1a\e\15\1a\e\15\1a\1d\18\1c\1d\17\1e\1e\16 "\18$%\1a%(\e*-\1d./!57+9<.7:(<A1BF;HKBRXUW^^Y`bSZ[GOPHPQ//1\ 4\ 1\ 3^mp[ehZ`aZei\gj_ei^fi^fjcgmbhlfikfliilkmolornorrrwwnwwpwvnusrurptpousstwxuyprtOOScX`\92\8c\8aprlKKJA?<@<7da\\7f~{`dj9<E\e\19\e7),\84oopfb=<@\16\15\185.6£\9e \82{\80UPSTQXPMRNDGOT[]ZcVTYkjo{zu\81~x\86\86\80\8b\89\81\8c\8e\8b\8d\8d\8d\8b\8c\85\8a\8f\87\8f\8e\89\8d\8d\85\8b\8b\81\8a\8a~\86\89z\8a\8b\7f\81\83v}~n\7f\7fo\82\83r\82\82s\80~nx{cvv]uvbqrZvvZtt[qqYpoVur[tt\nmVnmWjnUhkThgPghQcdMddNggRhlWkkUegS^aOY[JTUEFH>:=201''( !#\1c\1d \18\1d\1c\15\1d\1c\16\1c\1c\17\e\e\15\1a\e\15\e\1e\17\1d \1a\1c!\19!$\1a$%\1a%'\1c()\1d(+\1d,0!-0"38,7:3;<5ELHNX[R\_W^b+,0T_\Zbc`gkbiocknajl`hgaeddhgdiginomqpmqpqtrpuwruxrw{ossnplnqpqrsmqslmoopskopTQOBC>:58\8e\80\86\9f\9a\94\82\7fz^^Uqkd\89~~¨ \9b¢\9b\95||v]bV880JBGKKP!\1e\1f\13\11\11.',\7fy~LKOLJPC@F@=BKFJOMQZ[^jkpstr\7f\80}\87\86\80\88\87|\89\89\7f\8b\8b\83\8e\8c\89\8f\8e\89\8f\90\8d\8f\90\8c\91\90\8e\8e\8f\8b\89\89\81\86\86~\84\86\7f\85\85}zzh||k\85\84z~}nwudtwfwzjz|mqrYkmQtsYyy`uv[rqYprVrsXvwZvx[vv\wtYsqXnlUnpWlmUkmUmnXjnXglWilXbeQZ]MY]LRSEHL?@F9>B702)!"\1a\19\e\15\17\18\13\17\18\11\18\19\13\19\1a\15\1a\1c\17\1a\1d\18\e\e\16\1c\1c\17\1e \18 $\19#'\1c%(\1c%(\19&)\e*/"34.>EEGPSOX^AFLTUSU[X]de`dd`hhbjiejicjicigjlkklljmmpppotuoqtkonjoomoppqtpqsmrsquymuvpx{VZ\'%&@<;CA?SJQ\83y\7f\83{{_[Xskisll\8f\82\84\9b\91\93¨\9e\9e£\9b\99\8d\8b\84\`[@@E*()\10\ e\10\11\ e\12MDKfbdROPEADIBGXU[ehmpsw}}\80\84\86\85\89\8b\8a\8d\8d\8e\8d\8f\8e\8c\8e\86\8a\8b\84\8c\8a\82\8a\8a\82\8b\8b\81\8d\8c\84\8f\91\8c\8b\8c\85\87\86{\85\84u\87\85v\87\87z\84\86v\80\83q\80~s\7f}l|{jqraoo]qq\klRjhOhiQrrYttYuv\xx\zz]wz^uw\uuXtsWvsVuv[xz]{}^vz\qv\osYnpXjmYilWdgRbeQ^bO^bO\aQVXICF<22+!#\1e\1d\1f\1a\1c\1e\18\e\1d\17\18\1a\15\1a\1a\15\e\1c\17\e\1e\17\1a\1a\16\17\e\13\1a\1d\15\e\1c\17\e\1d\16\1c!\18\1f#\19!$\18!"\17$%\1a15/AEI;;>RXLW[S]df`ef^ddaddeedddbdgfdjjfjjhknkjjlpslvzmtvquyrswnqtnosmvytuyoptjqx8AB\10\ f\ f\13\11\131,/934 \e\1f956F@?e_W`]Vphc\8c\85{\91\8c\87¤\9f\99«¥¢¥\9f\9bifg@AA\1a\e\16\f\f\v\13\ f\149/4LEJJFJPKMqlnz{~\7f\7f\80\85\87\86\8c\8d\88\8e\8e\88\8c\8f\89\91\93\90\90\92\91\8d\8f\89\8f\91\88\8c\91\88\8d\90\88\8d\8e\87\8c\8b\81\89\8a\7f\88\8b\7f\8d\8b\7f\8b\8a\7f\8c\8az\89\89}\87\89~\82\81p\7f\80nzyevybtu]qnWkjRgfN__GcaJnmTrrVvvZxz_}z]zy[||_|}byx]yz_wv[utZvw[suYsuYptZorYopWmmVijUfhR[^KOTDFG<9:113,),' %\1f"%\1f #\1d\1f#\1d\1c\1e\18\11\13\r\f\ f\f\12\12\ e\11\14\ f\13\15\10\15\15\10\16\19\13\19\1a\14\19\19\13\1a\1c\15\1c\1e\17\1d\1e\17\1f!\1a%&"-.+TZMTXJWZSZ]Z[\X]a^\`[\b`_fdcdeedcddaca^gefgijjjmmmrprxnsxot{qswklokkplpwZbf583\1d\1d\e\15\14\15\13\11\10\10\ f\ e\13\12\10\1f\19\1aKCCVNGJE@eYY\8e\84\80\8d\85\81\85{{lbbULO]YZWXS;95&&!\19\19\18+)'VUXhkjy{y\82\84~\87\8a\83\8c\8c\86\8d\8f\88\90\93\8b\8f\92\8a\90\92\8c\8f\8f\89\8d\90\86\92\91\8a\91\90\88\8d\8f\83\91\90\86\8f\8c\7f\8d\8d\80\8c\8e\83\8e\8c\82\89\89|\8a\88{\87\87y\86\88z}\80kuy_ux]wuaqqWlnTiiRciObcKeeNhkQmnUloVqrWvu[xx]yx^wuZqqXnpTlnSknTlmRmpWmmVlnUjlShmRglTcfQ\aLPR@FI;>A4=@29<128--4+-2*,3*,1*6=1XdS_fX>@5/0(&*$\1e \1a\19\1a\15\18\17\13\16\18\12\16\19\13\17\19\13\18\19\14\19\1a\15\19\e\15\19\1c\14
\ No newline at end of file
diff --git a/data/images/goldenears.ras b/data/images/goldenears.ras
new file mode 100644 (file)
index 0000000..1b1eae8
Binary files /dev/null and b/data/images/goldenears.ras differ
diff --git a/data/images/goldenears_gray.jpg b/data/images/goldenears_gray.jpg
new file mode 100644 (file)
index 0000000..c1af713
Binary files /dev/null and b/data/images/goldenears_gray.jpg differ
diff --git a/data/images/goldenears_gray.pnm b/data/images/goldenears_gray.pnm
new file mode 100644 (file)
index 0000000..f403637
--- /dev/null
@@ -0,0 +1,451 @@
+P5
+128 96
+255
+||||\83\83\83\83\83\8b\8b\8b\83\8b\93\9c\9c£¬¬£¬¬¬¬¬¬££\9c££\9c\9c\93\93\9c\9c\93\93\9c\9c\93\93\93\93\9c\9c\9c\9c££¬¬´¬´´´¬´´»»´»»»»»»»Ã»»»´´´´´´´¬££¬£££\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\93\9c\9c\93\9c\9c\93\9c\9c\9c\9c\9c\9c\93\93\9c\93\93\93\93\93\93\93\93|||\83\83\83\83\83\83\83\8b\8b\8b\8b\93\9c£¬¬¬¬¬¬¬¬¬¬££££\9c\9c\9c\93\93\9c\93\93\93\9c\9c\93\9c\93\93\9c\9c\9c£¬£¬´´´»»´´´´»´´»´»»»»»»»»»»´¬¬´¬¬´´¬££££\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\93\9c\9c\9c\9c\9c\93\9c\93\9c\93\9c\93\93\93\93\93\93\93\83|\83|\83\83\83\83\83\8b\8b\8b\8b\8b\93\9c£¬´¬¬´¬¬¬¬¬£££\9c\9c\9c\9c\93\9c\93\93\93\9c\9c\9c\9c\9c££££¬¬¬¬´´»»»»»»»»»´´´´´´´´´»»´»¬¬¬¬´¬¬¬´¬£££££\9c\9c£\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\93\9c\93\9c\93\9c\93\93\9c\9c\9c\9c\9c\93\93\93\83\83\83\83\83\83\83\83\83\8b\8b\8b\93\93\9c£¬¬¬¬´´´´´´¬££££\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c££££¬¬´´´»»´»»»»»»»´´¬´´´´´»´´´´´´´¬¬´´´´´¬¬££¬£¬£££££\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\93\9c\9c\93\9c\9c\9c\9c\9c\9c\9c\9c\93\9c\93\9c\93\83\83\83\83\83\83\8b\8b\8b\8b\8b\8b\93\93\9c£¬¬¬´´´´´´´¬¬£\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c££¬¬¬¬´´¬´´¬´´´´´´´´´´´´´´´»»»»´´´´»»´´´»´´´¬¬¬¬¬¬¬¬¬¬££££££\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c£££\9c\9c\9c\83\83\83\83\8b\8b\8b\8b\8b\8b\8b\93\9c\9c£¬¬¬´´´´´»´¬¬¬£\9c\9c\9c\9c\9c\9c\9c\9c£££££¬¬¬¬¬´´´´¬¬¬¬¬´´¬´´´´´´»»´»»´»»»»´´´»´Ã»»´´´´´´´´´´´´¬¬¬¬¬£££££\9c\9c£££££\9c\9c\9c\9c\9c\9c£¬¬¬¬£££\93\9c\8b\83\83\8b\8b\8b\8b\8b\8b\93\9c\9c££¬¬´´»»»»»»»´´¬¬£\9c\9c£££££¬¬¬¬¬¬´´¬¬´¬´¬´¬¬£¬¬¬¬¬¬´´´»»»»ÃÃû»Ãû»»»Ã»´´´´´´´´´»»´´´´´´´¬¬¬¬¬££¬¬´¬¬¬£\9c\9c£¬¬´´¬¬££\9c\9c\9c\93\8b\8b\83\8b\8b\8b\8b\93\9c££££¬¬´´»»»»»»´»»»´¬££¬¬¬¬¬¬¬¬´´´´´´´´´´¬´´¬¬¬¬¬¬¬´´´´´»»»»»»»»»Ë»Ã»Ãû´¬¬¬´´»´»»»»»»´»»»»´»´´¬´´¬¬¬¬££££¬£¬¬¬£££\9c\9c\9c\93\9c\9c\8b\8b\8b\8b\8b\93\93\9c\9c¬¬¬´´´¬´´´´»»»»»´´´¬¬´¬¬¬¬¬¬´¬´´¬¬¬¬¬´´¬´´¬´´´´´´´´´´´»»Ã»´ÃÃûËÃÃËû»´´´´´´»´»»»»»»»»»»»´¬´´¬¬¬¬¬£££££££¬££££\9c\9c\9c\9c\9c\9c\9c\9c\9c\8b\8b\8b\8b\93\9c\9c££¬´´´´´¬¬´¬´´´»»´´´´´´´´´¬´´´´´¬¬¬¬¬¬´¬´´´´´´´´´´»»´»»»»»»ÃÃÃÃÃËËû»»Ã»»»»»»»»»»»»Ã»ÃÃÃû´¬¬¬¬£££££££££££££\9c\9c£\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\8b\8b\93\93\9c\9c££¬¬´´´´¬´¬´¬´´´´´´´´´´´´´´´´´¬¬¬¬´´´´´´»»»»´»»»»»»»»»»»»»ÃÃÃËÃÃËÃûÃÃÃû»»ÃÃÃÃÃÃÃÃÃÃû»´´¬¬¬¬¬£££¬££££££££££££££\9c£\9c\9c\9c\9c\9c\9c\9c\93\8b\93\93\93£¬¬´´¬´´´¬¬´¬´´´´´´»»»´´´´¬¬´´´´´´´´´´»»Ãû»Ãûû»ÃÃÃÃÃÃÃÃÃËÃÃÃÃËÃÃËÃÃÃû»ÃÃÃÃÃÃÃÃû»´´´¬¬¬´¬¬¬¬£¬£££¬££¬£££££££££££\9c££££\9c\9c\93\93\93\9c££¬´´´»»»»´´´´»»»»»»Ãû»»»´»»»»»»»»»»ÃÃÃÃÃËËËÃËÃÃÃÃÃû»ÃÃÃÃÃÃÃÃÃËËËÃÃûÃÃÃÃÃÃËÃÃû»»´´´´¬¬¬¬¬£££¬££¬¬££¬£££££££££££££££££\9c\9c\9c\93\9c\9c££¬´´»»»»»Ãû»»»»»ÃÃÃÃÃÃÃÃÃÃÃÃûÃÃÃÃÃÃÃÃËËËËËËËËÃËÃÃÃÃÃÃÃÃÃÃûÃËËÃÃûÃÃÃËËËËÃÃÃÃû´´´´¬¬¬¬££¬£¬¬£¬¬¬£¬¬¬££¬¬£¬££¬£££¬££££££¬£\9c\9c££¬´´´»»»ÃÃÃÃÃû»ÃÃÃÃÃÃËËËËËÃÃÃËÃÃÃÃÃÃÃËËÃËËËËËËÃÃËÃËËËËËËÃÃÃÃÃÃû»ÃÃÃÃÃÃËÃÃÃû»´´´¬¬¬¬¬¬¬¬¬¬¬¬¬£¬¬¬£¬¬¬¬£¬¬££¬£¬£¬£££££¬¬¬\9c\93s\9c£££¬¬¬´´´»ÃÃÃÃÃÃûÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃËËËÃËËËËËÃÃÃÃÃÃÃÃÃû»ÃÃÃÃû»»»»´´´´¬´¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬£¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬\8bs[KD;\9c££¬¬¬¬¬´´»»»»»»»»»»»ÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃËÃÃÃËËËËËËÃÃÃÃËÃÃÃûÃÃûû»´´´´´»´´¬¬¬´¬´¬¬¬¬¬¬¬¬¬´¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬£¬¬s;;4;DD\9c\9c££¬£¬¬¬¬¬¬¬¬¬´´¬´´´»»»»»ÃÃûÃÃÃÃÃÃÃÃÃÃÃÃÃËÃËËËËËËËËÃÃÃÃÃû»»ÃÃÃÃû»»´´´´´´´´´¬´¬´¬¬¬¬¬¬¬´¬¬´¬¬´¬´¬´¬¬´´¬´¬´¬¬¬¬¬¬¬£¬´\9c[;;;;;;;\9c\9c£££££££¬£££££¬¬¬¬¬¬´´»»ÃûÃÃÃÃÃËËËËËËËËÃÃËËËËÒËËËÃÃÃÃû»»»»Ã»»»»»´»´´´´´´´´¬´´´¬¬¬´¬´´¬´¬´´´¬¬´¬´¬´¬´¬´¬¬¬¬´¬¬¬¬¬¬´¬sD;;44;;;;\9c\9c\9c£\9c\9c£££££££¬£¬¬¬´»ÃÃÃËËËËËËËËËÒÒÒÒÒÒËËËËÒÒÒÒÒÒËËÃÃÃÃÃÃû»Ã»»»»´´»´´´´´´´´´´´´¬´¬´´´´´´¬´´¬´¬´´´´´¬´´¬¬´¬¬´¬´´¬¬´´£|S;;;;;;;;;;\9c\9c£££££££££¬¬¬¬¬´»ÃÃËËÒÒÒÒÒÒÒÒÒÒÒÒÒÒËËËËÒÒÒÒÒÒËËËËËËÃËÃÃû»»»»»´´»´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´¬´´´´´´¬´´´´¬´»¬|K;DD;;;;;;;4;£££££££££££¬¬¬¬´»»ÃÃÃÃËËËËËËËËËËËËÃÃÃËËÒÒÒËËÒËËËËÃÃÃÃÃÃÃÃÃÃû»»´»´»´»´´´´´´´´»´´´´´´´´´´´´´´´´´´´¬´´´´¬´´´´¬´´»\9clSDDD;4;;;;;;;;;£££££££££¬¬¬¬¬¬´»»»ÃÃÃÃÃËËËÃÃÃÃû»ÃÃËËËËËËËËËËÃÃÃÃÃÃËÃÃÃÃÃû»»»´»»»»»´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´»»£lKDDKD;;;;;;;4;444£¬££££¬£¬£¬¬¬¬¬´´»ÃÃÃÃÃÃÃËÃÃÃÃÃÃÃËËËËËËËËËËËËËËÃÃÃÃËËÃÃÃÃû»»»´»»´»´´´´´´´´´´»´»»»»»´´´´´´´´´´´´´´´´´´´´´»¬\93lKDKKK;;;;;;;44;44;4£££¬¬¬¬¬´¬´´´´´´´´»ÃÃÃÃÃÃÃÃÃÃÃÃËËÒËÒËËËÃËÃÃÃÃÃû»ÃÃûûû»»´»´´»´´´´´´´´´´´»»»»»»»´´´´´´´´´»´´»´´´´´´´»»¬\83SDDKKDD;;;;;;444444;44¬¬¬´´´´»»»»»»»»»»»´»»Ã»ÃÃÃÃËËËËËËËËËËËËÃÃÃÃÃÃÃÃÃÃûÃÃû»»»»»»´´´´»»»»´»»»»»»»»»»»´»»»»»»»»´»»»»´»»»´»Ã´|SDKKDDDD;;;;;;4444444444´´´´´´´»»´»»»»»»»»ÃÃÃÃÃÃËËËÃÃËËËËÃÃû»»Ã»Ã»»Ãû»Ã»»»»»»»»»»»»»´»»»»´»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»´»»\93[DKKDDDD;;;;;;;;;4444;44;4¬¬´´´´´´´»Ã´´´ÃûÃÃËËËËËûÃÃÃÃË´´»»»Ãû»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»Ã´lDDKKDDDDD;;;44;;;4;;4;4;;44´´»´´»»»Ã£|ldds\93ÃÃÃËô£\83lls\83\8b\9c\83[[lll\83´Ã»»»»»»»»»»»»»»Ã»»»»»»»»»»»»»»Ã»»»»»»»»Ã»»»»Ã»»Ã»»»»»Ã»Ã»»ÃË\93SKKKKDDDDD;;;444;D;44;;444444´´´´´»»»\83SSSS[[[|¬Ã¬|dSSS[SSS[S[SSSSS[\9cû»»»Ã´´»ÃÃÃû»»»»»»»»Ã»»»»»»»»»»»»Ã»»Ãûû»»Ã»ÃûûÃû»Ã£sKKKKDDDDDD;;;;;4;;;;444;444444»»´´´»»\8bKSSS[[[d[[lSS[S[[[[[[[[[S[[[[SS\83»Ãû\8b|s\83\93\8b\9c¬ÃÃû»Ã»»»Ã»»»»»»Ã»Ã»»Ã»»Ã»Ã»Ã»Ã»»»»»Ãû»»»Ë\9cDDKKKKDDDDD;;4;4;4;;;;;4;;444444\83\8b¬¬£\8bsSSSSSS[[[[[SS[[[[[S[[S[SSSSSSS[SSd\9c´|l|sldddd|»Ã»»ÃûÃÃûÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃûûÃË£SKKKDDDDDDD;;;;;444;;;;;;;4444444SSS[SKKSSSSSSS[[[[[S[[[[S[SSSSSSSSSSSKSSSS[lsllllllld\83ÃûÃÃÃÃÃÃÃÃûûÃÃûÃÃÃÃÃÃûÃÃÃÃÃÃËÃûû|KKKDDDDDDD;;;;;;;;;;;;;;;;444;;444SSSSSSSSKSSSSS[S[d[S[SS[S[SS[SSSSSKSSSSSSS[[dlddldlddd|»ÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃû»ÃÃÃÃËËËËËËË»[;DKDDDDDDD;;;44;;;;;;;4;;444;44444,SSSSSKSSSSSKSSS[[[[[[SS[[S[SSSSSSSSSSKKSSSSS[[dddddddlds»ËÃÃËÃÃÃÃÃÃÃÃÃÃÃÃÃËËËËËËËËËËËÃÃÃÃÒ¬[DDDDDDDDDD;;;4;4;;;;;;;4;44444444,44KSSKKSKSSSSSSSSSSSSSSSSSSSSSSSKKKSKKKSSSSSSSSSdddddddddds¬ËÃÃÃÃÃÃÃÃÃÃÃÃËÃËËËËËËËÃÃÃËÃËÃËË\8bDDDDDDDD;;;;;;;;4;;;;;4444444444,,4444KKSKSKKSKSSSSSSS[SSSSSSSSSSKKKKKSSSKKSSSSSKSSSS[dddddddddd\9cÃËËÃÃÃËÃËÃËËËËÒËËËËÃËËËÃÃÃÃË£[DDDD;DDD;;;;;;;;4;;;;4444444444,4,44,4,KSKKSSSSSSKKSSSSS[[SSSSSSSKKKKKKKKKKKKSSSSSSKSSSSddddddddddl|ÃËÃÃÃËÃËÃÃÃËÃËËËËÃÃÃËËËËÒ\9cD;DDDD;D;;DD;4;;;;;4;444444,44444444,,444;;;KDDKKSSSS[SS[S[SSSSSKKKKDKKDKDKDKKSKKSKKSSSSSS[[d[d[dddddd|ÃËËÃÃË»ÃËÚÒÒô£\9c\93\8b\93£»ËÃ\93DDKDDDDDDDD;;;4;;4;;4444,4,444444444,4444,,,,,,444;;KDKSSSS[SSSSKKKKKKKKKDDKKDDD;444;;DKS[S[S[d[dddddddds´Ë»¬£»Ã»»´£\8b\83\83\8b\8b\83\83\83\8b\9c\83KDDDDD;;D;;;;;;4;;;4444,,,444444444,44444444,$,,,,$,,44,44;;DDKDKKKKKKKKKDDD;;;444444;4;;DDKSSS[dd[[[[ddddd\93£\9c\9c\9c£\93\8b\8b\83\8b\8b\8b\8b\8b\8b\8b\83\8bsKDDDDDDD;;;;;;;;;;;;4444444;4,4,,4;44,444444,,$,$,,,,,,,4,,,,44,44;;;;DDD;;;44;4;44;44;444444;DKS[[dddddddddd\83\93\8b\83\83\83\83\8b\8b\83\8b\83|||||lDDDDDDDD;;D;DDD;;DD;;4444;;4;444,444;;44,4444,$$,$,,,,,,,,,4,4,4,,4,,,444,444444444,4444444,44;;4DK[dddd[dddddl|||||||||llllssdKDKDKKKDDKKKDDDKDDDDDD;;4;;4444,44,44;;44,,4,,$,,,,$$$$$,,,,,,,,$,,,,$,,4,,,,,444,44,,,4,44444;KK;;;S[[[ddddddddls|||sssldddd[SKD;DD;;;DDDD4;;;;;;444,44,,,,,,,,$,,4,4,$,,,,,,\e$,,$,,\e$$,,,,,,,,$$,,,,,$44,,,,4,,,,444;;,444;,4;D;;;;S[[[ddddddldllss|sllllll[[SKSSKKKKKKKKKKKKDDKKKKKKKKDKKKKKKKKKSKSKKKKKKDK$,$,$$,\e$\e\e,,$$,,,\e$44;,,$44;;;;,44;;DKDDKDDSKSSSSS[[[[llssss||||||\83\83\83\83\83\83\83\83\83\83\83\83\83\83\83\83\83\83\83\83\83\83\83\83\83|||sssssllllldldddd[[[[[[SSSSKKKKKDK;;4444;D4;;;DKKKS[[Sd[[dddllsssllsss||||||\83\83\83\83\83\83\83\83\83\83\83\8b\8b\8b\8b\8b\8b\8b\8b\8b\8b\8b\8b\8b\8b\8b\8b\8b\8b\8b\8b\8b\8b\8b\8b\8b\8b\93\8b\93\93\93\93\93\93\8b\93\8b\8b\8b\83\83\83||ssslllddd[[[[SKSSKKKDDDDD;DD;;;ddllllsssssssss|||\83\83|\83\83\83|\83||\83|||||||||\83\83\83\8b\8b\8b\83\83|\83\83\83\83\83\8b\8b\8b\93\93\93\9c\9c\9c\9c\9c£££\9c££\9c££\9c£££\9c£\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c\93\93\93\8b\8b\83|||sslldd[[[[[[[SSSSKSDKKDDD;DDD;;llssss|sssssssss|\83|\83\83\83||||||||||||s\83|||\83\83\83\8b\8b\83\83\83\83\8b\83\8b\83\8b\8b\93\93\93\93\93\93\9c\9c\9c\9c\9c\9c£\9c£££\9c£££\9c\9c\9c\9c\9c\9c\9c\9c\9c£\9c\9c\9c\93\93\8b\8b\83\83||sllldd[[[SSSSKKKDDD;DDD;;4444444ssslssssslsssssl||||||||||||||||||||||||\83\83\8b\83\83s|||\83||\83\83\8b\8b\93\93\93\9c\9c\9c\9c££££££££¬££££££££££££££\93\93\93\8b\8b\83|slddd[[KKKKKKDKDDD;;;;;;44444,44,,4llllllsslldddllsss||||\83||\83||||\83||||||s\83\83\8b\83|\8b\83\83\83|||\83\83\8b\8b\8b\8b\93\93\9c\93\93\9c\93\9c£\9c££££££££\9c££££\9c\9c\9c\9c££\9c\9c\8b\8b\8b\83sslld[[SSSSKKDK;D;DD;;D;;;444;44444,,slsssllld[lllddlss\83||||||||||||||||\83|||\83\83\83\8b\83\83\83\83\83\83\83\83\83\83\83\8b\8b\93\93\93\93\93\9c\9c\9c\9c\9c\9c\9c\9c\9c\9c££\9c\9c£\9c\9c\9c\9c\9c\9c\9c\93\9c\93\9c\93\93\8b\83\83\83sllsd[dSSSKKKDDK;DDDD;;;4;;44;44,44sld|lld[[[[[ddlsss||s|slsssss|slssl|sss|||\83\83|\83||\83||\83\83\83\8b\8b\8b\8b\8b\93\93\93\9c\9c\9c\9c\9c\93\9c\9c\9c\9c\9c\9c£\9c\93\93\9c\9c\9c\9c\9c\9c\9c\9c\93\8b\93\8b\8b\83|\83|lll[dd[SKSSSDDDKKD;44;;4;;;4;;;44sd[lldlss[[[[d[ls|[dlll|l[ldS[sdl|llls||s\83s|\83\83|\83s\83\83\83s\83\8b\83\8b\8b\93\93\93\9c\9c\93\9c\9c\9c\93\9c\93\9c\9c\93\93\9c\9c\9c\9c\9c\9c\9c\93\93\9c\93\93\93\93\8b\8b\8b||\83|sdddl[S[SSSSKSDDKKKD;KSD;DDD;4444[dl[dd[[[dd[Sdssllssls|llds|ddsd[llSKSd[l\83s|\83ss\83|\83|||\83\8b\83\93\8b\8b\8b\8b\93\93\8b\93\93\9c\9c\93\9c\9c\9c\93\9c\93\9c\9c\9c\93\93\93\8b\93\93\8b\93\8b\93\8b\8b\83|\83|slslddddd[SSSS[SDKKDKDKKD;DD;D;444ddld[[ld[l[SS[lldl|dl\83|ldSddllsslld[[d|ss\8b|sddssssls|\83\83\8b\8b\8b\93\93\8b\8b\93\93\93\93\9c\9c\93\93\93\93\93\9c\93\93\8b\8b\8b\8b\8b\93\93\8b\93\8b\8b\8b\8b\83\83||||sslllldd[[[[SSSSSKSKKDKKKKDKKKKDDssslsl[[[d[lldd[lssls|slssldslsss|||ldll|\83||s||\83\83\83|s|\8b\8b\83\83\8b\93\8b\93\93\93\93\9c\93\93\93\93\93\93\93\93\93\93\9c\93\8b\8b\93\93££\9c\93\8b\93\83\8b\83\83\83\83ssssllddddd[SK[[SSKK[KKSDKKDDD44DK;ll[[dlld[l[S[d[S[s||ls|||s||\83|s|s[S[[[KSsll|\83sss|\83||\83\83|s|\8b\8b\8b\8b\8b\8b\8b\8b\8b\93\93\93\93\93\93\8b\93\93\93\93\93\93\9c\83[\9c\9c\83\8b\8b\83\83\83\83|\83|slss[S[dddS[SKSKDK[;;DKKDDD;;;4;KD[[d[dddlddslldds|\83|||ss|l[l|ssldllslllds||||\83sllds|lsss|\83\83\83\8b\83|\83\8b\93\93\93\93\93\93\9c\93\93\9c\8b\93\93\93\93\93l,K\83\9c\93\93\93\8b\83|l\83|sssdsldddd[Sd[SSK[SKKKSKD;;;DD;;K;[[lslllllld[dssslls|||\83ss|sd[lddddlsl[llds\83\83s\83ls||ss|\8b\83\8b\93\8b\93\8b\8b\8b\93\8b\93\93\93\8b\93\93\93\93\83[\83\93\8b\83\8b\93l;Kd\83\83|\83\83\8b\8b|lssld[|sd[[ddSKS[[SDKSSSSKDDDDDDD,,4ldddslll[llssslsll\83\83ssss\83\83lsslssdl|sdds|\83|ls\83\83\93\93\83\83sls\83\83\8b\8b\8b\83\8b\93\8b\8b\93\93\93\8b\93\93\93\93|D$|\8b\83\83\8b\8b\8b4
+S\83¬\83\93\8b|\8b\83ssssssllsld[[KKSSKSS[[SKSK;DKDDD;KKDdllddddddlld[dllls\83\83|s|\83|\83\83\8b|s|sdd[d|llsss\83\83\93\8b||ss|\83\8b\83|\83\83\8b\8b\8b\93\93\8b\8b\8b\8b\93\93\93\8b|[s\8b\93\93\93\8b\8b\8b\93\93,\e[\93¬\8b\83\83\83\8bslds|s[dssld[[KS[d[D;DS[[KDDKKSKD;;,ddlsllsssddddlll|\83ss|s\83||s|ssslsdS[|\8blS[l\8b\83sl||s|||s\83\83||s|\8b\83\8b\8b\93\8b\8b\8b\8b\93\9c\8b[D[£\93\93\8b\8b\93\8b\8b\8b|$,[\9cÃ\8b\83\83ss|l||sl[[ddSdd[[[[dd[SKDSSKD;4,;SKS[[dlsssslslllldddddlsssssslldlll|ss||dd|\83\83\8b\8b\8b\83\83s\83\93\83\83\8b\8b\93\8b\83\8b\83||s|\83\8b\8b\8b\8b\8b\8bsKK[|\8bd\8b|\83¬|\83\8bS\14;|££\83|ll|||||s|ssllsddd[ddd[d[[SS[[SSSSKKSKdlld[[l|ldl[dlds|\83||sdsssss|\83\83\8bslssds\83|sss|||\83\83\8b\93\8b\83\8bsls\83\83\8b\8b\93\8b\8b\83|\8b\93\8b\83\83K;DS\83\83[sddÒ£s\8b[
+\eSl¬£||||\83sldllssl[ld[dSSKSSS[[SSddd[SK;;;4[dllsllldddddld|sls|s||ls|||\83\83\83s|\8b\83||\83|\83\83llss|\83\83|\83\83\83|||ss\83\83ssss|\83\83\83|s[$DDSdKD\e,lËÃ[4Sldl\9c´£s||sd[[[dlsldSS[[S[ldddl[SKKD4K[SKS[Sdd[l[[SS[ddddlls|s|ssll|ss|ssss\8b\8b\8b\83sl|\83\83ss|\83||||\83\83||ss\83\83\83ssldl|\83\8b|sls\8bD\e,$$;;\e
+4S»Ã\83\8b\8b\93\93¬»»¬|sddlslllddld[[ddd[S[[d[[SSSKDKDSD;Ddddddlssddddddlls||\83|||\83|||\83||ssss|ll|ddl\83\8b|\83sss\83\83\83|\83|lss|\83\83\8b\8b\8b\8b\83\83|\8b\8b\8b|\e
+\e\14
+$\14
+4Dl\8bÒË´¬´\9c£»Ë´|lds|sllllll[[dd[lld[[SKKSKKSKDDD;;llldlllldlddlddlsss|\83||ls|s\83\83s\8b\8b|sss||ldssls|||\83\8b\83|ls\83\8b\83|s\83|ssls\83\83\83\83\8b\8b\9cS\14\e\14\14
+
+\14$,\14D\93´»¬¬££¬¬»»\9cl[[lssldd[[S[SS[ldd[SS[dld[[SKDK[ddlllsllldS[ddl||||\83||\83||s|lss|\83\83|s|sss|\83ss\83\83\83\83\83||\83||\83\83|s|sls|||\83\8b\8b\8b\83\83||D\14\e\14\14
+
+$,$\14Ds\83\93\9c\9c££¬¬¬»»¬\9c\8b\83|sldS[dd[SS[S[[dld[SSKSSKKDDddlllsllsddls|sssdds|||sssl||ssslsldldls\83||||ss\83\83\83\8b\83||\83\83\83\8b|ss\83\8b\8b\8b\8b\83|ss|\83\8b[
+\14\14
+
+\14$4,$4DKdl|\8b\9c££\9c\9c£££¬¬£¬\9c\8b\83|||sld[[ddS[[[ddSKS[[[dlddllllllssllslllls\83|ss\83\83\83\83|ssslddSSds|||\83\83sss||s|||s|s|\83\8b\8b\8b\8b\8b\83\83\8b\83\8b\8b\8b\8b\8b\8bS\ 5
+
+
+
+
+
+\e,\e\14$,4$,4DKl\83||\83\93\8b\8b\9c£¬Ã´£¬´´¬\9c\9c\93\93\93|slSS[SDDKS[dlldddls|||||sllss|\83\83||s|ssssssslllslsssssss|s|sssssss||||\83|||\83\83\8b||\83s|s|lD$
+
+
+
+
+
+\e$\14\14\14$4;KK4$\e,DS||ss\8b´Ã£\9c£\8b\93\93\93\93\93\93\9c£\9c\93£\9c\93\9c\9c\9c\8b|sldd[dd[[[[dlllslssdds|sdlllllldlllssslllllslsllsssssslllllls|\83|s|sssSs|Sd\83ÚK\ 5\14
+\ 5\14$$\e\14\ 5
+
+\e$4;K;4D44;;SS[\8b\93|||ls\83\8b\83|\8b££\8b\83\93\8b\8b\93££\9c\93\9c\93d[ddd[[ddddlslldllldlllssslsss\83sssldSSddd[[S;;KSdllllldllllllsddss|\14S\83K,4S
+\14
+
+
+\14$4,$\14\14\14\14
+\e\e\e$,4;;;K;;K[[lldddddss|\83\8b\83\8b\8b\8b\83l\83\93\83|\83|llsllldlllllllllldllsdd[Sddd|slldllS\144;;D;;D;DKDDdsllllls|||SD[\93£\83\83$\14D4\e$\ 5
+
+
+
+
+
+\ 5\e,\e\14\14
+\14\14\14
+
+
+\14\14\e,,,,,D4,44;;;;d[l[SdlSss[S[dlslsdlldlldlsslllldslsslSDDD;;4$$4$4,4dK\14;4D;444;[SKDK[||\83\83|\83|\83d4S\8b´\93;\e;\14\ 5\ 5\ 5\ 5
+
+
+
+
+\ 5
+
+\ 5
+
+
+
+
+
+
+\ 5
+
+
+
+
+
+
+\14\14\e,,$\14\e
+\e\e\e\e,4DSK4DSSKSK;SKKSKlldlldlslssllssssls4
+,,$\e\14\14$\e\14,,$,d[
+;S444,$,DDDD4$Kl|\83\83\83\83\83d4S\83\9c\8bs[\e
+
+
+
+
+
+
+
+
+
+\ 5
+
+
+
+\ 5
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+\14\e,\e\14
+
+
+\e\e\14\14\14\e$$\e$,;KK;DDKDDddddddddddlslssddddK$\14
+$,,$4;4;DDK[S\14
+$$$$,$,4;KD;4Kl||\83|\83\83d
+\ 5\ 5\e;[[$
+
+
+
+
+
+
+\ 5
+
+
+
+\ 5
+\ 5
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+\e\14
+\14\14\14\14\14\14\e\e\e,$$\14\14\14$,4DKD4dddldddddllsslllddldS;,44DKDDDKS[[dS\e\14\14$,4,$,4K[K;Dd|||||||S\ 5
+
+
+\ 5\ 5\ 5
+
+
+
+\ 5
+
+
+
+
+
+\ 5\ 5
+
+\ 5
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+\14
+
+\14
+
+
+
+
+
+
+
+\e\e$$\14$\e
+\ 5
+
+
+\14\e\eddllllllldld[ls||s||s|sl[SSSS[[lsssdD;DD;DDD;DDDSS[s|\83\83\8b\83|s[$\e\14\14\14
+
+
+
+\ 5
+\ 5
+
+
+
+
+
+
+\ 5
+
+\ 5
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+\14\14\14
+
+
+\ 5\ 5
+
+
+
+
+
+
+
+\ 5
+
+\14
+\ 5
+\ 5\ 5\ 5\ 5\ 5llldddldd[[[SSS[llls|\83\83\83|lsdddlssllldSSSKSS[ddd[dl|\83\83|\83\83|ss[D4,$$
+
+
+\ 5
+
+\ 5
+\ 5\ 5\ 5\ 5\ 5
+
+
+
+
+
+
+
+
+
+\ 5
+
+\ 5
+
+
+
+
+
+\14\14\14\e
+
+
+
+
+
+\ 5
+\ 5
+
+
+
+
+
+
+
+\ 5
+
+\ 5\ 5
+
+
+
+ddd[d[[dddd[SKSKSdll|sssssssslsssss|s[[[dlldlddddll|s||||ssl[K;,$\e\14
+
+
+
+
+\ 5\ 5\ 5
+\14
+
+
+
+
+\ 5
+
+
+
+
+
+
+
+\ 5
+
+
+
+
+
+
+
+\14\14
+
+
+
+
+
+\ 5
+
+\ 5\ 5\ 5
+
+
+
+
+
+
+
+
+
+
+
+
+
+[dd[[dddddd[dldlddddlllsssss|||s|sssssllsssssslllllsssssssd[[K;44$\e\14\14
+
+
+\ 5\144\e
+
+
+\ 5\ 5\ 5\ 5
+
+
+\ 5\ 5
+\ 5\ 5\ 5
+\ 5\ 5
+
+
+
+
+
+
+
+
+
+
+\ 5
+\ 5
+
+\ 5
+\ 5
+\ 5
+
+
+\ 5
+
+
+
+
+
+
+
+[[KS[[[dddddllllllssslsllss||sss||\83\83\83||||||||sls|ssssls|ssdSKDD;;44\e$4\14
+
+Dd\83l\ 5
+\ 5\ 5
+\ 5\ 5\ 5\ 5\ 5\ 5\ 5\ 5\ 5\ 5\ 5\ 5\ 5\ 5\ 5
+
+\ 5
+\ 5
+
+
+
+
+
+\ 5\ 5
+
+
+\ 5\ 5
+
+
+
+
+
+\ 5
+\ 5
+
+
+
+[S;DS[ddll\8b\93|dlslss|s|||||||||\83\83|||||s||||||sslsss|sssllllldd[SSDS;\e$,$$$DS|s\e\e\14
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+\ 5\ 5\ 5\ 5
+\ 5\ 5
+
+\ 5
+
+
+
+\ 5
+\ 5\ 5
+
+
+\ 5
+\ 5\ 5\ 5\ 5\ 5
+
+\ 5S[[SS[dlKK|\83[lllssss||||\83|s|||||\83|\83\83\83|\83\83\83||||sslss|ss||ss||ssslsd[SSK;;444DDDD;4,,$\e\14
+\14\14\14\14\14\14\e\e\e$$\e\e\e\14
+
+
+\ 5\ 5\ 5\ 5\ 5\ 5\ 5\ 5
+\ 5
+\ 5
+
+\ 5
+
+\ 5\ 5\ 5\ 5\ 5
+\ 5dddddd[;,\eD[Ddss|||||||||\83|||||\83\83|||l\83\83\83\83|||ssssssssss|\83||sss|||||s|ld[[[[[[SSKDDDDD4,\e\e\14\14\14\14\14\14\14\e\e$$$,,,,$\e\e\14\14\14
+\ 5\ 5\ 5\ 5\ 5\ 5\ 5\ 5
+
+\ 5\ 5
+
+
+
+
+l[d[SSD;;4SSK[ls||||||||||||||||ssss;s\9c\93\93\83|sllllllssssss||\83||||\83\83\83\83|slllssllld[[SKSSSKD;4$$\e\14\14\14\14\14\e\e\e\e$$$,,44DKKDK;\e\ 5\ 5
+\ 5\ 5\ 5\ 5\ 5\ 5\ 5\ 5
+\ 54;SKKKSSDDKSdllss|||||\83\83|||\83s|\83|||sl4l\8b\83|\83|l£\83lllsslssss||||\83\83\83\83\83\83\83\83\83ss||||sslddd[[[[SSSSKKK;4,\e\e\14\14\14\e\e\e\e\e\e$$,4;KS[[4\eDK;4,,\e
+\ 5\ 5\ 5,K[[[[d[[[ddlssssls|ssss|s|\83||llslllK;|\8b|lKd»¬[lddll[||\83||\83\83\8b\83\8b\8b\8b\83\83\8b\83\83\83\83\83|slsldllllddd[d[[d[[[SKD;,$\e\e\e\e\e\e\e\e\e\e$,,,4;4;DKS[[[KK,\ 5ld[ddddddddllllsssssssssssK[\8bsKD;d|d;\e4sl;\144\9c|SSKDS[Sl||\83\8b\8b\8b\8b\8b\8b\8b\8b\8b\83\8b\83||\83\83|ssslsssllslllddddddlld[[SD;,$$\e\e\e\e\e\e\e\e\e$$$,,,,4;;KS[[,[[dlllddldlllsss|sllsslssSD4\83\9c\83[l\83£\9c|[4DK\e\14,|KKD;KK[ls\83\83\83\8b\8b\8b\8b\8b\93\8b\8b\83\83\83\83||\83|sss|lllssllsssssllllllldld[[SKDD4\e\e\14\e\14\e\e\e\e\e\e$$$$$,4DK[DS[ddddlddlllssslllssssss[$;DK||[ls\83\93£\9c\8b[D,
+\14DdSDD[ls|\83\8b\8b\8b\8b\8b\8b\8b\8b\8b\93\8b\83\83\83\83\83\83|||slllddlsss|sssssss|sslllddd[[[SD4$\e\e\e\e\e\e\e\e\e\e\e\e\e$$$$4D;S[dddddddldlllssssslsssl;
+\14,4\e4Dd[l\83\8b£££dD\e
+
+4DKKl||\83\8b\8b\8b\93\93\8b\93\8b\93\8b\8b\8b\8b\8b\8b\8b\8b\83\83||sslld[dllss|s||sssssllllllld[SD;4,$$$\e\e\14
+\14\14\14\14\14\e\e\e\e\e$$,SSS[[[[dddddddlllssssllsd;\e\14\14
+\14\eDSK[\8b\8b|dK[S;$\e,Sl|\83\8b\8b\93\93\93\93\8b\8b\93\93\8b\8b\8b\8b\8b\8b\8b\83\83\83|ssslldddddllssssslllllllllldd[SD;;;44444;[d;4$$\e\14\14\14\14\e\e\e\e
\ No newline at end of file
diff --git a/data/images/goldenears_gray.ras b/data/images/goldenears_gray.ras
new file mode 100644 (file)
index 0000000..f12b6c8
Binary files /dev/null and b/data/images/goldenears_gray.ras differ
diff --git a/data/images/small_16x1.pnm b/data/images/small_16x1.pnm
new file mode 100644 (file)
index 0000000..989d815
Binary files /dev/null and b/data/images/small_16x1.pnm differ
diff --git a/data/images/small_1x1.pnm b/data/images/small_1x1.pnm
new file mode 100644 (file)
index 0000000..43a6c4e
--- /dev/null
@@ -0,0 +1,4 @@
+P5
+1 1
+255
\ No newline at end of file
diff --git a/data/images/stawamuschief.pnm b/data/images/stawamuschief.pnm
new file mode 100644 (file)
index 0000000..2b04d6a
--- /dev/null
@@ -0,0 +1,4 @@
+P6
+199 149
+255
+o\99Øm\99Ús\96Ük\9aÜl\9aÝi\9dÞt\9aßt\9dÞv\9cát\9eáv áz¡áy¢áz¤ß}¢â\80¡ã~£ã{¤â~£ä{¥â{¥â\7f¢å\82¢å\82¤æ\88¢å\84¦å\84¤è\82§è\84©æ\87§è\87¨è\8a©é\8c¨é\8b«é\87¬è\8c«é\8b­è\8e¬é\90ªì\90«ì\8f®ë\92¯ê\8f±ë\8d±î\90¯î\94°î\97¯î\90²í\8f²í\91¯î\95®í\93®î\90°î\8e²ð\90¯ð\92°ï\91³í\91±ð\93°ð\92²ï\91´î\92±ï\8f³ï\92±ñ\93±ñ\90²ñ\90²ñ\91°ñ\90°ó\91°ò\92°ñ\90±ô\93±ó\94±ò\93²ò\94±ó\94²ó\97²ó\96³ò\94´ô\96µõ\99·ó\9c¸ô\9b»ô\9d¼ó¥¼ó£½ô¢ºó¢¸ò¡¹ô\9e¹ô\9d¹÷\9e¸õ\9e¹ò\9cºõ\9cºõ ¸õ\9c¹õ\99¸ô\99¸ô\9b¶õ\99·÷\9cº÷\9b»ö\9f¹ô\9c¸ö\9b·õ\97¸ö\9b¶ö\99µõ\98³ö\91´ö\8eµô\94²÷\8fµö\90³õ\91±ö\8f³ø\90²÷\91²ù\91³÷\8f²ø\90²ù\93²ø\94²÷\95²ö\94²÷\95²÷\91´÷\95±ø\91´ø\91¶÷\91µö\91´ø\93³ø\94³ø\95³ù\93³ø\94²ù\96²ü\93³ú\91µø\93µ÷\91µø\94³ù\95³ù\91´ú\94´ù\91¶ø\93´ù\97±ú\93µ÷\95´÷\94´÷\94µ÷\91¶÷\91¶ø\92µø\94³ø\95³ø\93µø\95²ø\95²ø\94´÷\94³ø\93´÷\93´ö\93³ø\8d´ù\92´ö\92³ø\92³÷\92²ú\93±õ\90³õ\95°÷\90²ö\8d³ö\8f²÷\8d³÷\8c³ö\8f¯÷\8e²õ\8a±÷\8f±ô\8d°õ\8d¯÷\8d¯õ\89±ô\8a°õ\8f¯õ\89³ó\87°ô\8b®ô\8e¯ñ\88®ó\88¯ñ\8b¬ð\8e¬ñt\9eÜr\9fÜt\9eÜt\9eßr Ýt¡Ýy\9fÞv¡Þy¢àz¢à}¡á\7f¢ã\7f¤á\80¤â~¥ã\80¦â\84¥ä\83§å\86§å\87¨å\88©å\8aªæ\8d«æ\8a­ç\8b­è\8f®æ\91­ç\8f®ç\90¯è\93®é\91°é\90±é\94°é\95±ê\93²ê\93±ê\91³ê\93²ê\97±ë\97±ì\94³ì\97³ì\98³ë\95´î\93´í\94´í\96³ì\92µì\93´î\94²î\95²ï\94²ï\93³ð\92³ð\96±ð\95³ï\94³ï\92²ñ\93²ò\93³ñ\92³ñ\93³ñ\94²ñ\94³ð\95²ò\93³ò\92´ò\94³ó\95´ò\95³ò\95³ó\92µô\93µô\96³ô\97³ô\96´ô\97´ô\98´ô\98µô\99¶ô\9a·õ\9c¸ô\9d¹ô\9e»õ\9e¿ô¥¿ó¥¾ô¢½ô¡¼ô\9d¼õ\9d»õ\9e¹ô\9a»ö\9b»õ\9bºö\9e¹õ ºõ\9dºõ\9aºö\9d¹ö\9eºõ\9d¼ö¢»õ\9e¼ô\9dºö\9c¹ö\9c·ö\98¶ö\98µ÷\97´ö\95´õ\91µö\8fµõ\91³÷\91´ø\95²ö\92²÷\91³ø\92²ø\93²ø\92³ø\91³ø\91²ø\94²ø\92´÷\95²ø\93³ø\93´ø\90¶÷\92´ø\93´ø\92´ø\92´ø\94´ù\93´ø\92¶ù\93µø\93µ÷\93µù\97³ú\93µú\93µù\94µù\94µø\96³ù\94µù\92µú\95µø\94µø\95µù\92¶ù\94µù\96µ÷\93¶ø\96´ø\92¶ù\90·ø\93¶ù\94¶ø\94µù\94µù\94µø\95´ù\94µø\93µø\95´ø\96³÷\93µø\90¶ø\94´÷\94³ø\94³ø\95²÷\95²ö\92³ø\92´ö\8f´ö\90³ø\92²÷\93²÷\8f³ö\91±÷\8f²ö\8e²ö\8e±ö\90°÷\8f±ö\8e°õ\8c±ö\8e±ö\8f°õ\8c°ô\8c°õ\8d°ò\8f¯ò\8c¯ô\89¯ô\89®ò\8c®òv¥Ûz¢Ýz£Ý|¤Þ{¤ß}¤à}¦Þ}¨ß~¨à\80§à\83§á\84©â\84ªâ\87©ä\85­â\8a¬ä\8cªå\8f«ä\8b®ä\8c­ç\8f®å\8c°å\8f¯è\8e±è\91°è\92°ç\93°ç\91²è\90³é\94±è\94²è\93²è\94±ê\93²ë\95²ê\95²í\93³ì\92´ë\95³ì\93´ë\95´ì\98²ë\96³î\97²î\97³ì\96´í\94´ï\97´í\98³î\95´î\94µî\95¶í\97´ï\94µò\93µò\95´ñ\96´ò\96³ò\98´ó\96·ñ\97µò\95¸ñ\96·ó\97·ò\98·ò\9b¶ó\99¸ò\9b·ò\98¸ô\98¸ó\99¸ó\98¸ô\9d·ó\9b¸ó\9b¹ô\9aºô\9bºô\9bºô\9d¹ô£¸ò¡ºô¢½ô¢¾ó¤¾ô§¾õ¨¿ô£¿ô ¾ô¡¼ô\9e»ô\9f»ö\9e»õ\9eºõ\9bºö\98»õ\9aºõ\9b¹÷\9a¹÷\9b¹ö\9c¹ö\9cºö\9c»ö\9b¹õ\99¸õ\96·ö\98·õ\98´ö\98³ö\96³÷\93´÷\91µö\94²ù\96²÷\91´÷\95²ù\93´÷\90µö\93³ø\97³÷\92µ÷\8f¶ö\93µö\93´÷\94´÷\92¶ø\93¶ø\95´ø\95³ù\92µù\93µù\92µù\93¶ø\98³ø\95µø\8f¸ø\94µù\94¶ø\94¶ù\94¶ù\96µù\96¶ù\94µú\93·ú\99µø\96¶ú\93·ú\94·ù\95¶ù\99µù\94·ù\95·ù\95·ù\95¶ù\97¶ø\94·ù\93·ú\95·ù\95·ù\95¶ù\97µù\93¶ú\93¸ø\95¶ø\99´ø\97µø\96µù\96¶ø\93¶ø\96µù\92¶ù\96´ø\96³ù\94¶÷\91¶÷\91¶ø\91µø\93³ø\95³ù\95²ø\97±÷\92´÷\91³÷\91´÷\8eµö\90³÷\93²÷\8e´ö\8d´õ\90±÷\91°÷\8d²ö\8d²ö\8d°÷\8c±ô\8b±õ\8f®ö\8f°ô\8c®õ\8d¯ôv¤Þz£Ýz¥Þ|¦Ý~¦ß~§à|ªà\7f©á\82ªà\83«à\84«â\87«á\84­â\86­â\87­â\87­ä\89­ä\8a®ã\89¯ä\89¯ä\8b¯å\8e­è\8d®ç\8c°è\8e°è\90°é\91°è\91°é\8f²è\8f²é\91²é\91²é\94°é\93±é\91³ë\94±ì\93²ë\94²í\95²í\96²ë\95³ì\92µî\94´î\97³ï\99²ï\97´î\99´í\98´ð\99´ï\99´ð\98µð\97¶ð\97·ò\98·ñ\9a·ò\9b¸ñ\9c·ñ\9c¸ò\9d¸ò\9d¸ò\9bºò\9c»ñ\9cºó\9b¹ó\9dºñ\9d¹ñ\9dºñ\9c¹ô\9cºô\9eºó\9b»ó\9e¼ó£¹ó¡»ó\9f½ô ½ó¡½ó¡¾ô£¾ô¤¾ô£¿õ¤Áó¥Áó©¿ó«¿ó§¿õ¢¿õ¢¾õ¡¾õ\9f¼õ\9f»õ\9c»ö\9bºö\99»õ\99»õ\9aºö\9d¸ö\99ºõ\9b¸ö\98¸ö\9b·ö\9a¸ö\9c¸÷\98·÷\95¸ö\96¶ö\93¶ö\93¶ö\97³ø\93´÷\90µ÷\91¶÷\91¶÷\94´ø\96²ù\92µø\92µø\93´ù\95´ù\95µ÷\95µ÷\96µø\95µù\94µù\95¶÷\95µù\93¶ø\94¶ø\97´ú\98´ù\98µú\92¸ø\93¸ù\94·ù\95¶ú\95·ù\94·ù\94·ù\95·ù\95·ú\95·ø\96·ù\95¸ù\95·ú\97·ù\9aµù\98¶ø\97·ù\97·ù\95¸ù\98·ø\9a¶ø\97·ù\96¸ú\96¸ú\95¹ù\9a¶ù\97·ú\95¸û\97·ú\96·ú\96·ù\98¶ù\99¶ú\99¶ú\98¶ú\97¶ú\97·ú\96·ù\95·ù\96¶ø\94¶ø\96¶÷\93·ù\95¶ù\96´ù\97´ø\93¶÷\92µù\92¶ø\94µ÷\91·ö\93´÷\93´÷\90´ø\90µø\8eµ÷\90´÷\91´ö\90³ö\8f²ø\8e²÷\8f²ö\90±ö\8f°ö\8d±÷\90±ô\8f±ó\8e°ôp\9fÛo Ün ßo ßq¡ßr¡ßu¡ßv¡áw£áv¥áz£ãz¤âw§ã~¤ä\80¦ã\7f¨ä\7f©å~ªå\84ªã\88©æ\83®å\88¬ç\8a¬ç\8a­å\87°å\8c®ç\8b¯æ\8c¯è\8d¯é\8c±ê\8c²ê\8e³ê\8f³é\90³é\8f³ê\92²ì\95²ì\93³í\93³í\97³ì\95µì\93¶í\94¶ì\95¶í\99µï\97¶ï\98¸í\99·î\98¸ð\98¸ð\98¸ò\9b·ð\9b¹ñ\9cºð\9cºñ\9aºñ\9cºñ\9d»ñ\9eºó\9d»ò\9d¼ñ\9f»ò\9f»ò¡¼ó¡»ó ¼ó¡¼ò\9d¾ó ½ó¢½ó ¾ó£¾ò¢¾ó\9fÀô¡¾õ£¾ô¥¾ô¥¾ô¢Àó£¿ó¥¾ó¢¿ô£½ô¡½ô ¼ô\9c¾ô\9e»ô\9b»õ\9bºö\98ºö\98ºõ\9b¸ö\99¹õ\9a·ö\97¸÷\98¸ö\98¸ö\98·ö\97¸ö\97¸÷\99·ö\98·ö\98·ö\9b¶ö\9a¶õ\97¶ö\96µ÷\94·ø\92¶ø\91·÷\92·÷\93·÷\95µø\94¶ø\93·÷\94¶ø\92·ù\95¶ù\94¶ø\96µù\96¶ù\96¶ø\94¸ø\96¶ø\96¶ù\96¶ø\94·ú\95¸ú\94¸ø\97·÷\99µù\96¸ø\95¸ø\98¶ù\98·ù\9a¶ù\95¸ù\96¸ù\99·ù\95¹ù\97¸ù\99¸ù\9a¸ù\97¸ú\98¸ø\9a¸ù\9a¸ù\98¹ù\98¹ù\98¹ú\96ºù\98¹ù\97¹ù\99·ú\98¸ú\96ºù\98¹ú\98¹ú\99¸ú\96ºú\9a¸ú\99¹ù\97¸ú\9a·ú\99·ú\97¸ú\99¶ù\99·ø\97¸ù\95¹ù\97·ù\98·ø\97·ù\96·ù\94·ù\95·ú\95·ú\94·ø\94·ù\94·ù\93·ø\92¸ö\92·÷\93¶ø\95¶÷\93¶ö\92¶ö\93µ÷\92¶÷\91´÷\90³ø\92³ö\91´÷\92³õ\8f´ô\8cµõ\8f±÷\8d³ö\8b´ól\9cÞl\9dÞj\9fßn\9eÝo\9càk\9eàr\9càs\9càm\9fâk¡âq ãt ãq ãs ãv¢ãv¡äv¡åv¤åz¤ã}£å{¥å|¦ä}§æ}§ç\7f¦ç~©ç\7f¨é\81ªè\7f«é\81­è\84«ê\87ªê\89¬é\87¯è\88®ê\8a®ì\8d¯ë\90­í\8d°í\8e°ì\8e±ì\91°ì\8d²î\8b´ï\91±ï\91³ï\91³ï\94²ï\91´ï\90³ñ\90³ñ\90·ð\96³ò\94´ò\92¶ñ\94µñ\95µó\95¶ñ\96¶ò\94·ò\96¶ò\97¶ó\97¶ô\96·ó\96¹ò\98¸ô\97¹ó\95»ò\96»ó\99¹ó\98»ó\9cºò\9bºô\9b»ö\9eºó\9f»õ\9b¼ô\99¼ô\9c»ô\9d¼ô\9b½ô\9b»ö\9a»ö\9b¼ö\9cºö\9a¼ö\9b½õ\9e»õ\9e»÷\9b½÷\9d½ö ¼ö\9c½ö\9a¼õ\9a¹÷\97º÷\98¹ö\98ºõ\95ºö\94¸ø\97·÷\95¸ö\93¸ø\94¸÷\94¸÷\95¶ù\95¶÷\94¶ø\95¶ù\95·ö\95¶ø\94·ù\96·ù\94·ù\92¹ø\97·÷\98¶÷\97·ø\96¸÷\98¶ú\95¸ø\95¸ø\93¹÷\97·ø\93¹ù\96¹ø\98·ù\98¸ù\95¹÷\98¸ù\99·ú\9a¸ù\98¹ø\99·ù\99¸ù\9a·ù\97¹ù\98ºù\98¹ú\9b¸ù\96»ù\98¹ú\9b¸û\98¹ù\99¹ú\99ºû\98ºú\9a¹ú\99¹ú\9b¸ú\99¹ù\9aºû\99ºú\9a¹ù\9c¸ú\97»ú\99ºú\99¹ú\9b¸ú\9aºù\99ºú\98¹û\99¹ú\97ºú\98ºú\9a¸ú\9a¸ú\99¹ù\98¹ú\99¸ù\9a·ù\9a¸ù\98¸ù\97¹ù\99¸ù\99·ú\96¸ù\96¸ù\98·ù\97¸ù\96·ø\97·ø\94¹ø\96·÷\95¸÷\94¸ö\93¸ö\93¸ö\94¶÷\96µ÷\94µö\95µ÷\8f¶÷\92µõ\91µõ\93³ö\91´ö\8eµõ\8dµök\9bßj\9eßl\9fßr\9dßp\9dàm\9fáo\9fáo àl¡ãr âs¡âv\9fãx\9eãt¡åt¢åv¢åw¢åv¤æv¦åv¦çw¥èz§å|¤èz¦éz¦éy¨ê}¨é}©é~©é\80©ê\7fªé\80ªé\82©ì\84ªë\81­é\81­ë\8a«ì\88«ë\89¬ì\8c«í\89­ï\8a®î\8d¬ð\88±î\8d¯ð\90®ï\8f°ï\8b²ñ\8f±ñ\8f²ð\8e¶ï\8f³ð\8fµñ\8fµñ\90µñ\91´ñ\90³ó\94²ó\91³ò\92³ò\8fµô\90µô\93µó\93´ó\92µô\92µó\92¶ó\92¶ó\91µô\94´ô\91¶õ\90¶õ\95µõ\95¶õ\96¶õ\96·õ\95¸õ\95¹õ\94¹õ\98¸ö\96¹ô\97¹õ\98¹ö\98»ö\9aºö\97¼ô\96½ö\9a»ö\98½õ\9b¼õ\9b»ö\99¼õ\9a¹ö\9a¸ö\95¸ö\95·÷\95·÷\94¸÷\93¸÷\94¸ø\94¸ø\96·÷\95·ø\95¶ù\93¸ø\95¸÷\95¸÷\94¸ö\97¹ö\97·ø\96·ø\98¶ù\97¸ø\9a¶ø\95¹ø\94¸ù\95¹ø\97¹÷\97º÷\97¹ø\98¸ù\97¹ù\95¹ú\98¸ø\97¹ø\96ºù\97¹ù\99¸ù\99¹ù\99ºø\94¼ù\97ºø\98ºú\99¹ú\98ºú\97»ú\9b¸ú\9b¹ù\97¼ú\9aºú\9aºú\98»ú\99»ú\98¼ú\98»ü\99ºû\9aºû\9a¼ù\9aºú\9a»ú\9a»û\9aºû\9a¼ú\99¼û\9bºû\99¼û\9b»û\9b»û\9aºû\9b»ú\9a¼ú\99¼û\9bºú\9aºû\9aºû\9c¹ú\99»ú\98»û\98¼ù\9b¹ú\99¹ú\9b¹ú\99¹ú\9aºú\99ºù\98ºù\95»ú\94¼ø\96»÷\95¼ø\93»ø\98¹ù\97º÷\97¹ø\96¹ø\92º÷\94ºø\99·ø\97¶ø\97¶ö\94·÷\94¶ù\96µ÷\90¸ö\92¶÷\96´÷\95´÷\90µö\90µöl\9dßn\9eàm\9eàm áp án ár\9fâp¢ás¡âr¡ãr¢ãs£âs¤ät¤äv¥åx¥åy¥äx¦æz¥æx¦æu¨éz¨èz§éy¨êxªé~©è~©è\80©é\80ªé\81©ê\81ªë\80¬ê\82«ë\81­é\82«ë\86«í\83­í\82®ì\86­î\86®í\85¯í\86¯í\87®ï\89¯ï\8a®ð\89¯ð\8b°ï\8b°ñ\87±ò\88²ñ\89²ò\8b²ñ\8b³ð\8a³ò\8d²ò\8d³ñ\8c´ò\8c´ò\8e´ó\90³ô\8f´ò\90´ô\8eµô\8d¶ô\8e¶ô\90µö\8e¶ô\8f·ó\90¶ô\92µö\91¶õ\8f¶ö\93µö\92¶ô\92·õ\92·õ\93¶÷\93·õ\90¸õ\8f¸ö\91¸ö\94¶÷\93¸õ\93¸÷\95µ÷\96¶ö\95·÷\95·ö\93¹ö\95¸ö\94¸÷\94¹ö\95·÷\93¸÷\93¹÷\95·ø\95·÷\94¹÷\95¹÷\95¸ø\94¸÷\98¸÷\95¸ø\97¸ø\94º÷\98¸ø\97¸ø\98¸ø\97¹ø\97¹÷\97ºø\98¹ø\98¹÷\98¹÷\97ºø\97¹ù\98ºù\99»ø\99¹ù\9b¸ù\9b¸ù\99¹ù\97ºú\99ºù\9aºù\97»ù\97»ú\97¼ù\99¹ú\9aºù\98»ú\97»ú\99»ú\98»ú\99»û\9b»ú\9a¼ù\99¼ù\98½ù\9dºû\9c»û\9b½ù\9a½ú\9d»û\9d»û\9b¼ú\99¾ú\9b½ù\9c¼ú\9b¼û\99¾ú\99¾ú\9c½ú\9a½ú\9b½ú\97Àù\9c¾ú\9c¾ú\9a¾û\9b½û\9c½ú\9c½ù\9d¼ú\9a½ú\9e»ú\9b¼ú\99¾ú\9a¾ú\9c¼ù\9c¼û\98½û\9b¼ú\9b»ù\9a»ú\9a½ù\97¼ú\98¼ø\99ºú\97»ù\97»ú\96»ù\99ºù\9aºù\97»ù\98ºù\98º÷\94¼÷\97¹ø\97¸ø\96ºö\94¹÷\95¹÷\96·÷\94·ø\93¹ö\91¸÷\95¶÷\92·ö\95´øm\9eán\9fán¡àn¢àp¡áp¢âq¢ât¢ás¢ãu¢ät£åv¤äv¤åu¦äx¦åw¦æx¨åy§æz§æ}§ç|§è|¨é{ªçx¬è|«ê}«é|¬é\80«é\83ªê\80¬ê\83¬ê\81­ê\82®ë\85®ë\83®ì\85­í\84®í\84¯í\87®î\85±î\85°î\87°î\88°ï\89°ð\88°ñ\88±ñ\89±ð\8a±ñ\8a°ó\89³ñ\8b²ò\8d²ò\8e±ó\8c³ó\90²ó\91±ô\8d´ó\8d´ò\8dµô\8fµõ\8e´õ\8f´ô\90µô\92´ö\8f¶ô\8f¶õ\8f¶õ\8f·ô\91¶ö\92·ö\91¶÷\90·÷\91¸õ\93¸õ\94¸ô\93¸ö\91¸ö\92¸ö\94·ö\93¸ö\92¸÷\93¸ö\94¸÷\94·÷\93º÷\93»ö\94¹ø\95¸÷\93º÷\95¹÷\94º÷\94º÷\96¹÷\92»ö\96¸ø\97¸ø\95»ö\95º÷\96º÷\97¸ù\98¸ù\98¹ø\95ºø\97¹ù\96»ø\98ºø\99¹ø\97ºø\97ºù\98»ø\99¹ù\99¹ù\96¼ø\98ºù\9aºù\99»ù\97¼ù\9a»ù\98½ù\98»ù\9aºú\99»ú\99½ù\98½ù\97¼ú\9bºú\9aºú\9a»ú\99¼ú\9c¼ú\9c»ú\9b»ú\9a½ú\9a½ú\9a½ú\9c½ù\9b¾ú\9b¾ù\9c½ú\9c¼ü\9b¾ú\9b¿ø\9b¿ú\99¿û\9d¾ú\9d¾û\9b¾û\9c¾ú\9c¿û\9d½ú\9d¾ú\9e¾û\9c¾ú\9c¾û\9b¿û\9aÀû\9c¾û\9c¿ü\9d¿ú\9b¿ú\9c¾ü\9f¼ü\9c¿û\9aÀú\9c¾û\9c½û\9c¾û\9c¾ú\9d½ú\9c¾ü\9c½û\9c¾ú\9b½ú\99¿ú\99¾ú\99½û\9b¾ú\9b½ú\99½ú\9a¼ú\9a½ù\9a¼ú\98¼ú\99»ú\99»ù\99ºú\97¼ø\97»ù\96»ø\96¾ø\95¼ö\95»ø\94¼ø\97¹ø\97¹÷\96¸÷\96ºö\96¸ö\95¸÷l¡àl¢àn¢âr¢âv¡âr¤âp¤âp¦âr¥ãs¦äv¥äw§äv¦åu¨æ{¦æw¨çy©æz©èz©è|©è|«ç~ªè\80ªé\7fªé\82«é\83ªë\82«ê\82¬ë\80­ë\83®ê\82®ë\84­ë\83¯í\84¯í\82°í\83°î\86¯î\86°í\84±î\88¯ð\8a¯î\88°ï\87²ò\8a²ð\89±ñ\8b±ò\88²ó\8c±ò\8d³ñ\89µò\8d³ñ\8c´ò\8aµó\8cµó\91³ò\8f´ó\8d´ô\8f¶ó\8d¶ô\90µõ\8e·ô\8d·ô\91·ô\8d¹ô\8cºõ\90¹ó\94¶õ\94·õ\91¹ö\93¸ô\90ºô\92¹õ\93¹õ\94·ö\95¸õ\96¸ö\94ºö\93»õ\94¹ö\95ºö\93»ö\95ºö\94º÷\97¸÷\96º÷\98¹÷\95ºø\97º÷\96»÷\97»ö\95º÷\94»ø\97»ö\97»ø\97ºø\99¹ø\98ºø\99¹ù\96¼ø\96¼÷\95½ø\96¼ø\98»ù\98ºù\9aºù\97¼ù\98ºù\98¼ù\98¼ù\9bºù\9b»ú\99¼ú\9a¼ú\9a¼ú\9a¼ú\98¾ø\98¿ø\98½ù\9b»ú\98¿ù\9a½ú\9b½ú\9d½ù\99¾ù\9a½û\9c¼ú\9a¾ú\9b¿ù\9b¾ú\9b¾û\9b½ú\9e½û\9a¿ú\9a¿û\9d½ú\9b¿ú\9d½û\9c¿ü\9c¿ú\9c¾û\9b¿ú\9dÀù\9e¿û\9c¿û\9d¿û\9f¾ü\9bÀû\9eÀú ½û\9d¿ú\9cÁú\9e¿û\9f¾ü\9f¾ü\99Âû\9cÁû\9dÀû\9e¿û\9e¿û\9cÁú\9d¿ü\9d¿ü\9cÀû\98Ãú\9bÁú\9eÀû\9e¿û\9d¿û\9bÀû\9d¿ü\9e¾ú\9cÀù\9e¾û\9e¾ü\9bÀû\9c¾û\9a¿û\9b¿ú\9b¿ú\9a¿ú\99¿û\9a¾ú\9a¿ù\9b½ú\99¾ù\9b»ù\9a¼ù\9a½ø\9a¼ù\9a½ù\97¼ù\98»ú\97¼ù\97»÷\97»ø\96¼÷\95»ø\93¼÷\91¼÷r£ßs¡áq¢ãv¢áu£ár¥ãq§ár§äs§äu§äy¦åz§äv¨æy¨æz¨æ}¨è|©è\7f¨è|«é|¬è}«èz­é\7f¬é\80¬é\81«ê\80­ê\82­ê\83­ë\81¯ê\85®ë\85®ë\86¯ì\84¯í\88¯ï\87¯ï\83±ï\86±ð\89°ð\88±ï\86²ð\8a±ð\88³ð\88´ð\8c²ñ\8c²ñ\8a´ò\8a´ñ\90²ò\8c´ñ\8c¶ñ\90´ó\91´ô\8c¶ó\8c·ó\90µó\8d¶ô\8e¶õ\91µõ\92¶õ\90¸ô\8dºõ\8f¹ô\8fºô\8f¹õ\93·ö\93¹õ\91ºõ\92»ô\91»õ\94¸ö\95¹ö\94»õ\95º÷\95º÷\93»÷\95»ö\95»ö\96»÷\94¼ö\97ºö\95»÷\95»ö\95¼÷\96½ö\97¼÷\96¼÷\97º÷\96½÷\97»ø\96½÷\96¼ù\98½÷\98»ø\97¼ù\96¼ø\97»ø\99»ù\97½ø\97½ø\98½ø\97¾ø\97¾ø\98½ø\98¾ø\98¾ø\98½ù\9b¼ø\9b½ù\98¿ù\9a¾ù\9b½ù\9b¾ù\9d½ù\9c¾ú\9b¾ù\9b¿ù\9b¾ù\99Àø\9a¾ù\9c¾ù\99¿ú\99Àù\9b¿ù\9c¾ù\9d¾ú\99Áú\9c¿ù\9bÀù\9d¿ú\9b¿ü\9bÀú\9d¿û\9bÁù\9bÀú\9d¿û\9bÁø\9cÁú\9dÀü\9d¿û\9dÀü\9aÂû\9cÂú\9fÀú\9cÁú\9dÁû\9eÀû\9eÁû\9eÁù\9eÀû\9dÁû\9eÀû\9dÁû\9cÂú\9fÀü\9eÁû\9bÃù\9eÁû\9eÁû\9dÂû\9fÁû\9dÂù\9cÂù\9fÁû\9dÂù\9dÂú\9cÃù\9cÂú\9fÀü\9dÁû\9eÀû\9dÂù\9cÂù\9dÁù\9dÀû\9dÀû\9dÁù\9bÂø\9cÀú\9d¿û\9d¿û\9d¿ù\9c¿ú\9bÀú\9d¾ú\9b¿ú\9a¿ú\9aÀù\9b¾ù\9b¾ù\9a¾ù\9b¾ú\9a¾ù\97À÷\97¿÷\98½ø\96¾ö\97½ø\94¼ø\95¼øl§áo¦ân¦âr¥ät¥ãs§ãv¦ãt§äw§äx§äy§å{¨å|¨æz©å\7f¨ç\81©ç}ªçz¬ç~¬è\80«è~¬ê}®é\80®ê\80®ê}¯ë\82¯é\82¯ë\80±ë\85¯ë\86®ì\84¯í\85°ì\87°ì\86±í\86±î\86²ï\89²ï\88²ð\89´ï\86´ð\88µð\89µð\8bµï\8aµñ\8b¶ð\8dµñ\8dµñ\8e´ó\8f´ô\8fµó\8c·ô\8e·ó\8e¸ô\90¸ó\8f¸ó\90¸ô\92·õ\91¸õ\91¹ô\8f¹õ\91¹õ\93¹õ\90¼ô\95¹ö\93¹ö\8f½ö\92¼ö\93ºö\94»ö\94»ö\95»÷\96¼ö\94¼÷\92½ö\95¼ö\95¼÷\96»ø\97¼÷\97¼ø\99»ø\95¾ö\95¾ö\98¼÷\99¼÷\97¾÷\97½÷\98¼ù\98½÷\97½ù\97¾ø\97¾÷\98¾ö\98½ù\98¾ø\97¿ø\95Áö\99¿ø\99¾ù\97¿ù\9b½ù\98¿ù\97Àø\9a¿ø\99¿ø\99¾ù\98Àø\9c¿÷\9a¿ø\9a¾ú\9b¿ù\9b¾ù\99Àú\9aÀø\9bÀø\9cÀø\9bÀù\9d¿ú\9c¿ú\9bÀù\9f¾ù\9cÀú\9bÁù\98Âù\9cÀú\9cÀú\99Âú\9cÀû\9e¿û\9eÀú\9aÂú\9cÁú\9dÁú\9eÀú\9eÀú\9eÀû\9eÁù\9cÂû\9bÂû\9dÂù\9eÁú\9bÃú\9cÃù\9eÁû\9fÁü\9fÁû\9fÁü\9fÂü\9eÂû\9dÂü\9eÂû Âü\9cÃú\9cÃú Âü\9fÂû\9cÄú\9fÂü\9fÂü\9fÂû¢Áü\9eÃû\9dÂü\9dÃû\9eÂû\9fÃü\9eÂü\9dÂû\9eÃü\9fÁü\9eÃú\9cÃû Áû\9eÂú\9bÃù\9cÂû\9fÁû\9cÃø\9eÀü Àü\9fÀû\9dÁù\9f¿û\9eÀú\9bÂù\9dÁø\9dÀú\9bÁú\9bÁú\9aÀù\98Àû\9a¿ù\99Àù\98Àù\9a¾ù\9a¿ø\98¿÷\96Àù\9a½ø\99¼øp§ás¦âr§ät§åu§ãu¨âs©äv©åw©æ{¨åx«åx«æ\7f©æ{«ç~ªè\80ªè|¬é|®é}®é~®é\82®é\80¯ë\82¯é\83°ê\81°ë\83°ë\87¯ì\86¯ì\85°î\85°í\85±î\85³í\8a±ï\88²î\85´ï\86³ñ\8d±ð\8b³ð\8a´ð\8c¶ï\8dµð\8c¶ñ\8eµñ\8b¶ò\8b¶ó\8fµó\8d·ò\8d¶ô\8d·ó\8e¸ô\92µô\90·ô\91¸ô\92¹õ\90¹ô\92»ó\92ºô\92¸õ\93ºõ\93»ö\94ºö\96ºõ\94»õ\97¸÷\94¼ö\91¾ö\95¼÷\93½÷\97¼÷\93¾÷\95¾õ\97½÷\96¼÷\96¼ø\97¾ö\96¾ø\97½ù\96¾÷\96¿ö\99½÷\98¾÷\97¾ø\97¿÷\97Àø\97¿ø\97¾ù\9a¾ø\99¾÷\99¿ø\98¿ø\98¾ø\99¿÷\9aÀ÷\99Àø\9a¿ø\97Á÷\9a¿ù\9c¾û\99Àù\9b¿ø\9cÀø\99Àù\99Áø\98Á÷\99Àù\9c¿ù\9bÀø\98Âø\9bÀú\9cÀø\9aÁú\9aÁù\9bÀú\9e¿ú\9bÁù\9dÁû\9cÂø\9fÀú\9cÂø\9cÂø\9bÁø\9bÂù\9dÁú\9dÁù\9fÁù\9fÀû\9dÂù\9eÂú\9cÂù\9dÂú\9dÂú\9fÂù\9eÂù¡Àû\9fÁû Áú Áú Áü Âú\9eÃû\9eÂü\9cÄú\9eÂý\9dÃü\9cÅû\9dÄü\9fÃý\9fÃý\9eÄü\9eÄú\9dÄû\9eÃü\9fÄû¡Âý¡Âý\9eÅü Ãû¡Ãý\9eÄü\9fÃý¡Ãü\9fÄý Âþ Ãý\9eÄû Ãý Ãü Ãü\9fÃû\9fÃü\9eÃý\9cÅû\9eÄú\9fÃû\9cÄû\9eÄù\9eÂû\9dÃú\9fÂû\9dÃú\9fÁû Áû\9fÀû\9eÂú\9bÄ÷\9eÀú\9bÃø\9bÃø\9dÂù\9dÀû\9dÁù\9dÀù\9aÀù\98Âù\97Âø\98Áù\98Àø\9aÀø\99¿øs§ãr§ãs¨ãv§ät©äv©åw¨æwªäw«æ}ªåy«æy¬ç{¬ç|­è}¬è|®é\7f¯è\80¯é\7f®ë\80°ê\82°é\84°é\85°ê\84±ë\86±ê\84±ì\84²í\89±ì\88±í\88³î\89³ï\89³ï\89³ï\8a³ï\87µð\88¶ð\89µð\8aµñ\8eµï\8c¶ð\8c¶ò\8c·ò\8e¶ò\8f·ò\90¶ó\8d¸ó\90·ô\91·ô\92¸ó\92¹ó\93¸õ\96¶ö\93ºô\93»õ\94¹õ\94»õ\92¼õ\94»õ\95»ö\92¼÷\94¾õ\94½õ\95¼÷\97»÷\96»÷\95¾ô\96¾ö\95¾÷\97½÷\98½ö\95Àö\95Àö\9b¼ù\98½ù\97À÷\97Àö\95Á÷\98À÷\99¿ø\99¿÷\9a¿÷\98Àø\97À÷\99¿ø\99Àø\99Áö\99Àö\9aÀ÷\99À÷\9a¿ù\9aÀ÷\99Áø\9aÁø\9bÀø\9aÁ÷\9aÁ÷\99Á÷\98Âø\98Âù\9cÀú\9cÁø\9aÂ÷\9bÁø\9eÀù\9cÁø\9aÂ÷\9bÂ÷\9aÃ÷\9bÃö\9bÂø\9dÂù\9bÃ÷\9dÁú\9dÂù\9fÁù\9dÃ÷\9fÂø\9fÁø\9fÁø\9fÁù\9eÂø\9eÂù\9dÂú\9dÃø\9fÂú¡Âú\9bÄø\9fÂú Âû\9fÂü\9dÃú\9cÄú\9dÃû\9dÃû¡Âü Ãû Ãû¡Ãü\9fÃû\9fÃý Ãü Äú¡Ãû\9dÅú\9eÅú\9fÄü\9fÄü\9eÅü¡Äü Äû\9fÆú Åü\9eÆû\9eÅü Äý Åü Åü¡Äý Åü Åü\9fÅü¡Äý Äý\9fÅý Åü Äý\9dÆü Äü Äü¡Ãý Äû\9eÆú\9fÄü\9eÄü\9fÅú Ãû Äû\9eÅû¡Ãü\9dÄû¡Ãü\9fÃü\9cÄù\9cÃû\9eÃú\9fÃú\9bÄø\9dÃù\9fÁú\9eÂø\9eÂø\9eÂø\9aÂ÷\9bÂø\9aÃ÷\9aÂø\9bÀù\98Âù\96Ãùr©âqªãw©äu©åx¬ãyªä|©å|ªä{¬æ}¬å|«æ}¬ç{®è\7f®ç\80®é|°ê\81¯ê\85¯é\81°ê\81²ê\83±ë\82²ë\84²ì\86²ë\86³ì\89²ì\85³î\89²î\8a´í\87´ï\89µï\8bµî\8bµï\8bµï\8a¶ð\8a·ñ\89¹ñ\8b¸ñ\8c¸ñ\8b¸ò\8e¸ñ\90·ò\8e¹ò\8e¹ó\90¹ó\91ºô\91ºô\90ºô\92¹õ\92ºõ\94»õ\93¼õ\93¼õ\92½ô\93½õ\93½ö\93¾ö\97¼ö\94¾õ\94¾÷\97½÷\94¾ö\94¾ö\97¿õ\99½ö\97¿ö\96Àõ\98¿÷\98¿÷\9a¿ö\98À÷\97Àö\97À÷\97Á÷\9aÀ÷\97Áö\99Á÷\9c¿÷\97Âø\99Áö\9aÁö\98Âö\99Âö\9bÀø\99Á÷\9bÀö\99Áø\9bÁ÷\98Ã÷\97Ãö\9cÁø\9dÁ÷\9aÂ÷\99Âø\99Ãö\9bÂ÷\9bÂ÷\9cÂ÷\9cÂù\9fÁø\9eÂ÷\9cÃ÷\9dÃø\9fÁø\9bÄ÷\9cÂø\9dÂø\9bÄø\9aÅø\9fÂ÷ Áù\9dÂù\9cÃù\9bÄù\9eÂø\9bÄ÷\9dÄù Âú\9fÃú Âú\9eÃø\9eÃù\9fÃù Ãû¡Âü\9fÃú\9eÄû Äú\9eÄù\9fÄù\9eÃú\9dÅú\9fÄû\9fÄú\9fÄû\9fÄü¡Äû¢Ãü\9eÅü¡Ãý¡Äü\9fÆû Äú Æû¢Äý\9eÅý¢Äþ¢Äü¡Åü¢Åü Æü Åþ¡Åþ¡Æý¡Åý¡Åþ\9fÇþ¡Åý Æü¢Åþ\9fÇý¡Åþ¢Æý\9fÆü¡Æý\9fÇý¢Æý\9eÇü\9eÇü¢Åý£Äý¡Åþ Æý\9fÆü¡Åý¡Åü Åü Åû Äü\9eÆû\9eÆú\9eÆú\9eÅû\9fÄû\9fÄú\9eÄú\9cÄù\9cÄø\9fÃú\9eÃù Âù\9dÃù\9aÅø\9cÃø\9bÃø\9bÄ÷\9bÃø\9bÂ÷\98Äös«år¬äs¬äv¬åx¬å|«å|¬å}­å{®æ~­æ~­ç~¯ç\80°ç\81°ç\81°è\7f°é\85°ê\84°é\81²ê\83²ê\87²ë\85³í\8a±ì\86´í\84µí\8b³í\89µî\88µï\89µï\87µñ\89·ï\8c·í\8a·ï\89·ò\8a·ò\8c¸ñ\8d¹ò\8a¹ò\8cºó\90¸ò\8d»ò\93¸ó\92¸ó\8f»ô\91ºô\92»õ\92»ô\8f½ó\92½ô\93¼ö\92¾ö\90¿õ\95½ô\93¿õ\94¾õ\94¿ô\97½õ\95¾õ\93Àõ\94Àõ\98¿ö\96Àõ\95À÷\9a¾÷\96Áõ\97Áö\95Âö\96Âö\98Àö\99Àö\9aÀö\98Â÷\99Âö\99Á÷\98Â÷\9bÁõ\99Áø\9aÁ÷\9aÂö\98Ã÷\9aÂø\98Ãö\99Ã÷\9bÂ÷\9aÂ÷\9eÁø\9cÂ÷\9aÃ÷\9cÃ÷\9cÃ÷\9cÂ÷\9dÂ÷\9fÂ÷\9bÃ÷\9dÄ÷\9dÃ÷\9aÄù\9cÃø\9fÂø\9cÃ÷\9cÃø\9cÄø\9cÃù\9cÃø\9cÄø\9bÅø\9bÄù\9aÅø\9dÃù\9fÃù Âú\9eÃú\9cÄù\9eÄû\9fÃú\9dÄù\9dÄú\9fÃú Äú\9cÅú\9eÄú\9eÅú\9dÆù\9eÄü¡Äü Äû\9dÆù\9fÄú¡Åú\9fÅú\9fÅû\9eÆû\9fÆû¢Äü Åû Åü¢Äü Æû\9fÆü Åü¢Åü\9dÈü\9dÈû\9eÇü¡Æý¢Çû¤Åü¢Æü Çý¡Çü¡Æý Çü¢Çü¤Æý¤Æþ¢Æþ£Æý£Æü¡Çý£Æý¤Æü¥Åü Èý¢Çþ£Çý¡Çý¢Çý\9fÈü¢Çý\9fÈþ¡Çý Æþ¢Æþ¡Æý¡Çý¡Æþ¢Æý¡Æý¢Æý¢Çû Æû¡Åü\9fÅû\9fÇú¡Åú\9fÅû\9eÆû\9fÅú\9fÄû Åú\9eÅù\9fÄú\9eÄù\9eÄù\9eÃù\9fÃø\9cÄø\9cÄø\9dÃøvªäv¬ä{¬ä{­äw®ä|­å{­æ\7f­æ\7f¯å{°è~°é\81°è~²é\7f²é\84±è\84°é\85²ê\81´ê\83´ë\85²ì\88³ë\8b³ë\89µí\8a´î\8c³î\8aµî\8a·î\89·î\8c¶î\8d·ï\8c·ñ\8c¸î\8e¸ï\8e·ò\8b¹ó\8f¸ò\8f¸ó\90¹ò\8e»ó\8fºô\8c»ô\8d¼ô\92¼ó\90½ò\90¾ó\93½ó\92¾ô\94¾õ\92¿ó\93¾ó\92¿ö\94¾ö\96¾õ\95Àõ\97¿ô\97¿õ\94Àõ\94Áõ\95Áô\97Áõ\96Áö\97Áõ\98Áõ\99Àö\9aÀö\9cÀö\99Âö\98Âö\99Âõ\9cÂö\9aÂ÷\99Äö\9cÂö\99Ã÷\9bÃ÷\9aÃö\9eÁ÷\9dÃö\9fÁö\9dÃ÷\9eÂ÷\9dÃö\9dÃ÷\9cÃø\9bÄø\9fÂ÷\9eÃ÷\9eÃø¢Àø\9eÃ÷\9dÃ÷\9eÃ÷\9fÂø¡Â÷\9fÃø\9aÅø\9aÄø\9dÃù\9dÃù\9eÃø\9fÃø\9fÄù\9fÂù\9fÃù\9dÄù\9eÅù\9eÄù¢Âù¡Ãù\9eÅú\9cÆú\9dÅú\9eÅø\9eÅú\9eÅú\9fÅù Ãü¡Åú Åú\9fÅú Äû¡Äú Æú¡Åú¡Åú\9eÆú Åú Åû\9fÆû Æû Æû¢Åû\9fÇü¢Æý¢Æü Çû£Æü¢Æû¡Æü Çü¢Çü¡Çý¢Çü£Çü¢Çü¡Çý¢Çü¡Èü¢Çü£Çü£Çý¦Æý¤Èý£Çþ¦Æý¤Èü¢Éü¤Èþ¦Çý¥Èþ¥Çþ¤Çþ¥Æý¥Æý£Èý£Èý£Èþ£Èþ¤Çþ¢Èý¢Èý¤Èý¦Æý£Èü¢Èü£Çý¢Èü¡Çý¡Çý£Çý¢Æü¢Æü\9fÈü Çû¢Åü\9fÈû Æû£Åû¡Æû\9dÇú\9eÆú Åú\9dÅú¡Äû\9eÅú\9cÅù\9eÅù\9fÄù\9eÄùy¬ãy­äx¯åy°å\7f®äx°æ}°æ}°æ\7f°ç\7f²è~²ê\83°è\83²é}´é\84²ê\86³é\82µê\84µê\88´ë\87µí\86¶í\88¶í\86·î\8aµï\89·ï\88¸ï\89·ð\8a¹î\89¹ð\89¹ñ\8d¹ï\8cºð\8eºð\90¹ò\8fºò\8d¼ó\8f»ó\8d»ó\8e½ô\93»ô\91¼ô\8f½ô\90¿ó\91¾ò\94½ó\92Àò\91¿ô\92¿ö\94¿ö\94¿ô\96¿ó\97¿ó\98¿ô\95Áô\96Áõ\97Áõ\96Âõ\99Áõ\9aÁõ\99Áö\99Áõ\99Áõ\98Ãö\9bÂõ\9fÀõ\9bÂö\9dÂõ\9bÃõ\9bÃö\9bÃ÷\9aÄö\9dÃö\9fÂö\9dÃö\9cÄ÷\9bÄ÷\9dÄö\9fÃö\9fÃö\9dÄ÷\9fÃ÷\9fÄø\9eÄ÷\9eÄø\9fÄø\9dÅ÷\9bÄø\9eÃø\9cÅø\9fÄø Ãù\9dÄù\9fÄø Äø\9eÃø\9eÅù\9dÅø\9dÅø Äù¡Äù\9fÄù\9eÅù\9fÅø£Ãû Åú¡Äù¡Åú\9fÅû\9fÆú¡Åú¡Åú\9fÆû\9fÅú Æú\9fÇú Åú¢Æû¡Çú¢Åú¢Åú¢Æù¢Æú£Åû£Åü¡Æû Çü¢Æü¡Æü\9fÇü¡Çü¢Çü\9eÈü Çü¡Çü¡Èü¡Èü¤Çý£Èü£Çý£Èü¤Éü¢Èý¦Æý¦Çý¥Çü£Èý¢Éý§Çþ¦Çý¥Èý¥Èý¤Éý£Êý§Çþ¨Èþ¥Éþ¦Çþ§Èþ¦Éþ¥Éþ¥Èÿ¤Éþ§Èþ¥Éþ¤Éþ¥Éþ¦Éþ¤Éþ¤Éþ¦Èþ¥Éþ§Èý¥Éþ£Êý£Éý£Éý¦Èý¦Çý¤Èý¡Éý¤Èü¤Èý£Çü¤Çü£Çü£Çü¥Åû¢Æü¢Æü¡Çü£Æû¢Æû Çû¡Æû Æú\9eÅú¢Äú\9fÆù\9fÆúw¯åx°æu³åy²å|±æ|±æ}²æ\7f±è~³è\82²è\80³è\84³ç\82´è\83µé\87³é\88´è\86µë\87µì\87¶ì\88·ì\89·ë\86¸í\88¸î\87¹ï\8a¹ï\8a¹ï\8c¸ï\8f¸ï\8b¹ñ\8bºð\8b¼ï\8cºò\8e»ñ\8f»ñ\8e¼ñ\8f¼ð\8f¼ó\8d¾ó\90¾ò\91¾ò\91¾ò\8f¿ô\93¾ò\95¾ò\93¿ó\94¿ò\97¿ò\95Àó\96¿ô\95Áô\95Áô\94Âô\98Âõ\96Ãô\97Âõ\98Ãô\9aÃô\9aÂõ\98Ãö\98Äö\9aÄö\9bÃõ\9aÄö\97Äõ\99Ãö\9bÄ÷\9eÁ÷\9bÇú\9dÅø\99Äö\9bÅú\9eÄø\9dÄø\9fÂõ\9eÄö\9cÆ÷\9cÆö\9dÄ÷\9fÃ÷\9fÄ÷\9eÄø\9fÄø\9eÅ÷\9eÅø\9eÅø\9fÅ÷\9dÆø\9fÅ÷\9cÇ÷\9dÆú¡Äù\9fÅù\9eÆù¡Åù\9eÆø\9fÆø\9fÇù\9fÅú Æù\9dÇú Æù¢Åú\9fÇù\9fÆú\9fÇú Æû Çù\9fÇú¡Çû¡Æû¡Æü Çû¢Çû¢Æü£Æü¤Æû£Æû£Çú¢Çû£Çû¤Çú£Çû¡Çü¢Çü¡Çû¡Èü¢Èü£Çý¢Èü¡Èü¤Èü¥Çý¥Æý¢Éû¤Éü¦Çý¥Çý¥Èü¥Éü¤Éý§Çü¥Èþ¦Èþ§Çý¥Èþ¦Éþ¤Éþ¤Ëþ¦Éþ§Èþ¦Éþ¥Êþ¦Éþ¦Éþ¦Éþ¦Ëþ§Éþ¦Éþ§Éþ¥Êþ¥Ëþ¨Êÿ¦Ëÿ§Êþ¨Èÿ¦Êÿ¥Ëþ§Ëþ¨Èÿ¦Êÿ¤Ëþ¥Êþ¥Éþ¤Êÿ¥Éÿ¥Éþ¨Èþ¤Éþ¦Éþ¦Éý¤Êþ¥Èþ¥Éþ£Êü£Êü£Èý¥Çý¤Èý£Çü£Èü¢Èû¤Æû¥Æû¡Èü Èû Æú¢Åû¡Æü Æû{¯åz±åz²æ}²æ\80±æ|´æ\81²ç~´ç\82´è\85³è\82µè\85µç\83·ê\85¶ê\86¶ê\86·ë\86·ê\87¸í\87¸ì\88¹ë\8e·ë\8b¸í\8d¸ì\8a»ì\8a»î\8b»ï\8cºî\8e»ï\88½ð\8d»ð\8b½ó\90¼ñ\91»ï\93¼ð\93¾ó\94¾ò\95»ñ\92¿ó\92Àò\92½ð\90Àò\93¿ò\93¿ò\94¾ó\95¿ò\94Àñ\95Àô\99Àó\96Áò\94Áó\96Àô\97Áô\9aÀô\97Ãõ\97Äô\9cÃó\9cÃó\9bÃô\99Äö\9cÃö\9cÄô\9dÃô\9cÅö\9aÈú\9aÉø\9cÆð\9dÊð\92Àã\9a¿àªÆä¡Ãå\9dÆê\98Åò\9eËù\9fÆú\9dÅø\9cÆù\9eÈù\9fÊû\9eÅú\9fÇù\9fÆ÷£Äø\9fÅù\9fÅø\9eÅú\9dÆù\9eÇù£Äø\9fÇù\9fÇù¡Æù£Äû£Åù£Æù¡Çù¡Æú Çû Çû¢Çù£Æù£Æû Èû£Æû£Æú¢Çù¢Çú¡Èû Èû¡Èú¢Èû Éû¤Èû£Çü¤Çû¤Çü¢Èû£Éû£Èû£Èü£Èü£Èü¥Çü¥Èü£Éý£Êý¤Èü¦Èü¢Êý£Êü¥Éü¥Êü¥Éý¦Éý¦Èý¦Éý§Éþ§Èý§Éþ§Éþ¦Êþ¥Ìü¤Ìý¦Êý§Éÿ¦Ëþ§Êþ¦Ìý§Êÿ¨Êÿ§Ëÿ¨Êÿ¦Ëÿ§Ìþ¦Ìý¦Ìþ§Ëÿ¥Ëÿ¨Êþ§Ìþ¦Ìÿ¨Ëÿ§Ëÿ¨Ëÿ©Êÿ§Ëÿ§Ëÿ§Ëÿ¨Ëÿ¨Ìþ¨Ìþ¦Ìþ¨Êÿ¨Êÿ¥Ìÿ¦Ëþ§Êÿ§Êþ§Êþ©Éÿ§Êþ¦Éÿ¤Ëþ¤Êþ¡Ëþ£Ëý¤Êý¤Êü¤Éü£Êý¤Éü¦Èý¤Èý¤Èý¤Èû¢Èü£Çû£Çû¢Çú}±å}²å}³å}´æ\80³å\7f´ç\82´æ\7f¶æ\80·ç\82¶è\81·ê\86¶è\84¸ê\83¸é\87·ë\87¸ë\85¹ì\85ºì\8bºë\8c¹ì\8d¹ë\8cºì\8d»ë\8dºî\8d»î\90ºî\8c¼ð\8e»î\8f¿ó\8bÃõ\86Áì\8e¼ç\95Âï\89¿ë\88»ç\8d»æ\95Ãï\8c¿é\8b¿í\97Çõ\95Åî\9eÇï\9aÉó\97Éô\99Æõ\99Äö\96Å÷\9aÄ÷\9cÇ÷\9cÈø\9aËø\98Êõ\9dÈø\99Èù\9aÅ÷ Ä÷\9bÄó\9bÄô\9bÅô\9dÄõ\9cÆù\99Èö\97Çð\92Àß\92µÍ\8f¨Á\91¥¼²¹Ð½ÁÍ©®Ã\8e\9c±p\88§\86\9c¾{¢Æ\97Ãë¦Éî«Éé£ÃÜ\97¾Ü«Ëé\9bÆî\9fËù Æù¡Èú¡Ë÷¥Êò¢Ëö\9fÊú¡Çû È÷¢Çù¢È÷ Èù¤Çù£Çú¡Èú£Çø£Èù¡Èù¤Çû¤Çû¢Èû¢Èû£Éû¢Èû¤Çú¥Èú¤Éù£Éú¤Éû¤Éû£Éü¤Èû£Êû¢Êü¤Éü¥Éü¦Èû¥Êú¤Êü¤Êû¥Êû¥Êü¥Êý§Éý§Éû§Éý§Éý¦Êý¥Ëü¥Ëü¦Êü§Êû§Êý¦Êþ¤Íü¨Éþ¨Êü¦Ëý¨Ëý¥Ìý¦Ìý©Êþ¦Ìþ§Ìþ¨Ìþ©Ëþ¨Ëÿ©Ëÿ§Ìþ§Ìþ¨Íþ§Ìÿ¨Ìÿ©Ìÿ©Íÿ©ÍþªÌþ©Ìþ©Ìþ©Ìÿ¨Íÿ¥Íÿ§Îÿ©Ìÿ©Íÿ©Íÿ¨Íÿ©Ìÿ©Íþ¨Íþ§Îÿ¨Ìÿ§Íþ¨Ìþ©Íý¨Íÿ¨Ìþ¨ÌþªËþ©Ëþ¨Ìý¥Íþ¨Ëý¦Ìý§Ëþ¦Ëý¤Ëþ¤Ìý¥Ëü¥Êý¥Êý¤Ìû¦Éü¤Êü¦Èü¥Èü¥Èú¢Êø{µä}´å\81´å\7fµæ\81¶å\81¶ç\85µå\83·æ\81¸ç\81¸è\85¸è\89·é\87·ê\87¹é\86ºì\87ºë\89¹í\8a»ì\8b»ì\8dºí\8c»í\8c¼í\8c¼í\8b»í\8b»í\8d»í\8e¿ò\8fÃñ\83ºßw¥¿e\84\9eo\84\9ds\8b¢o\8e¤[v\92fx\99n\89¤t\8e«v\8eªp\8c¤\8b\9fµ\8b ¯v\8e¤\81\98°\95¬Æ\98ºÕ\9a¾Ù\9bÁÝ\88µÓ\82©Æt\9aµr\92­~\9e»\94¸Ú\99Ää\94Áå Ì÷\9dÉ÷\9cÈö\9aÊö\98Éë\91±Í¥¯È\9d¥ºt\80\9f}\85ª\8f\97·\94 ¶\99©¸r\7f {\89©fz¡~\8b«r\81§n\80¦¢©À\98\9f±i|\9fcz£\7f\90¯\94¥É¥½ÞªÈí¥Åä\9d´É\9d¬Á¯¾Ò¨¿Ú¢Æî£Êú¢Èø¡Çù¢Èú£Èù¢Éû\9fÊû¢Éù¢Éù£Éù£Éú¢Êú£Éù£Éû¤Éú£Êû£Êû£Êú¦Éù¦Éû£Êû¦Êû¤Êù¥Éü§Éü©Éý¦Êü¦Ëû¦Êü§Êü¥Êý¦Êý¥Ëü¦Êü§Êü¤Ìú£Ìü¤Ìû§Êý¦Ëý¦Ëü§Ëü¨Êþ©Éþ¨Ëü§Ìý¤Ìü¦Êý¦Ëý¨Êþ§Ëý§Ëü§ÌýªËþ©ÌýªÍý§Îþ©Íþ©Íÿ¨Îþ©Îþ©ÎýªÎý¨Ïþ©ÎþªÍÿªÍÿªÎþªÎÿ¨ÏþªÎý¨Îþ©Îþ©ÎÿªÎÿ©Ïÿ¨Ïÿ©Îÿ©Îþ«Îþ©Ïþ©Îÿ¨Ïÿ©Îþ©ÎÿªÎþ¨Îþ¨Îÿ¨Îþ©ÍþªÌÿ©Íý¨Îý§Íþ§Íþ¦Íþ¦Ìÿ©Ëþ©Ìý¦Ìý¦Ìý§Ìý§Ëý¥Ìú¥Ìü¦Êü¥Ëû£Ëü§Éû£Ëú\80µä\80µå\83µå\81·å\82¸å\85¶æ\87¶ç\83¹è\82ºè\86·è\86¹ê\84¹ê\89¸é\87¹ê\85ºé\8a¹é\8e¹ê\8bºì\8eºì\8eºì\8eºë\8d¼í\91¿ò\91Äó\95Ãõ\8fÆõ\7f¾ád\93­Uq\8b^m\88_c\84ju\93_o\90aj\89\g\88Zh\8cP_\82Uc\86Vg\88K[\7fXf\89R`\81Sb\86gs\93px\93jy\90bs\8biv\8f[l\8bZe\84aj\8dsw\9cq~\9fp~\9d{\8e¦i\82\9di\88¯\8e¾é\90Åæ\86©Á\86\97¯\96\9a¸¦¬À\98\9f²\98\9f¹\92\93´¥§Â\94\9d¹\88\94·\85\8f±bs\9eq}¦]r\9dp\7f©w\81ªt\86¨_s\9caw¨bvªv\85¶ÓÏæÝ×ãÆÈÓ\9b£·\93\96µ\9b ½®³Ä³´Æ«µÍ¤Ãå Ìõ§Íý¤Êý¢È÷£Êø¡Ëù¤Êú¤Êú£Ëù¤Ëù£Ëù£Ëû¦Êû¨Éú¤Ëù¥Ëú¦Ëû¥Ëú§Êû¦Êü£Ìû¤Ìû¥Ëû¤Ìû§Êû¥Ëû¦Ìú¥Ìü¥Ìý¦Ìû¦Ìý¦Ìû¨Ëü©Ëü¦Ìü¦Ìþ¨Ìü©Ëý¥Íý§Ìþ§Íþ¨Ìü§Ìü¨Ìû§Ëý«Îÿ¬Óÿ¦Óÿ«Ñü«Óþ¬ÒÿªÒÿ¨Ïÿ§ÎÿªÎÿ«ÎýªÎý©ÏþªÏþ©Ðþ§ÐþªÏþ¬Íÿ©ÐþªÐþ©Ðÿ¨Ðÿ©Ðÿ¨Ñþ«Ðþ©Ðÿ©ÐÿªÏÿ¨Ñÿ©Ðÿ©Ïÿ¬Ïÿ©Ðÿ¨Ñÿ¨ÑþªÐÿªÐÿ©Ðþ§Ðÿ¨ÐÿªÐÿ§Ñÿ¨Ïÿ©Ïþ¨ÏÿªÏþªÎþªÍÿ¨Ïþ©Îþ¨Ïý¨Íÿ¨Îý¨Íþ§Íý¦Îü¨Íü¨Ìý¦Ìý¨Ëý¤Íû¤Îú¡Íü£Íû\80¶å\81·å\83·æ\84¸å\82¸ç\87·ç\85¸ç\85¹è\85ºé\86¸é\88·ç\8cºì\8d¾î\8d¾î\92Áñ\94Àï\8e¾ï\8d¿ñ\8f¿ð\90Áó\8dÅô\8aÃî\82¹Ûs¥Ãj\9b¸h\95¯Kn\85Uc\81Xe\86Ug\87Yg\89bo\90do\91`l\90_m\8fYj\8bRa\86G[\82EW|GZ\81Xg\8b]h\8bVi\89Yl\8dYh\89S`\80Xh\8bgw\99]l\8e\h\89fp\96\8b\92´\81\8c­mz\9bbk\8d`n\93Vf\8dKk\92\83\9d¸|\89¨v\83¬\95\9c»\8d\96µ|\8aªn\7f\9c\80\8a¨\8e\9aµ\88\94¯\88\96´\8f\9a±Yj\8fjy¦Zo\9fYp\9du\86®_s¢Jd\99it«\99\98ÉËÄåñíøÝÞ㻽ɢ¨À\91\9d½\94¡¿\8f\98·\95\9a¹³·É¹½Î\8f¥À\8c¶Ø\9cÊï¨Ñü¨Ìû¤Êø¦Ëù©Êù§Ëù¨Ëù§Êú§Ëú§Ëú¨Ëû¦Ëû¨Ìù¥Îù¥Ìú©Ëû¥Íü¥Ìü§Íü¨Íû¦Ìû§Ìü©Ìü§ÍüªËü¦Îü¨Íü¨Ìü§ÍýªÌü©Ìý¨Îü¦Îý§Íý¨Îû¦Îü¦Íþ¨Ìþ©Íü©Ðÿ¦ÐÿªÖÿ\9dÈí\80¦Æt\95²\81¡¹\8d¬Â«¿Ó­¾Ñ¶Îã±Ðñ®Ð÷«Ñÿ©Ñÿ«Ðÿ¬Ïÿ©Ðÿ«Ðþ­ÐþªÐÿªÐÿ®Ïÿ«Ñÿ­Ðþ¨ÒÿªÑÿ¬Ðÿ«Ðÿ¬Ñÿ«Ñþ«Ñÿ«Ñÿ¬Ïÿ¬ÐÿªÑÿ¬Ñÿ®Ðÿ©Ñÿ©Ñÿ¬ÐÿªÑÿ©Ñÿ©ÑÿªÑÿ«ÐÿªÐÿ«Ðÿ©ÑÿªÏÿ©Ïÿ©Ðþ¨Ñþ©ÐþªÏþªÏþ©ÏþªÎþ©Îý¨ÎüªÍþ©Íü¦Íý¨Íû©Íü§Íû¥Íü}¹æ\80¹æ\85¹å\87¸ç\86¹ç\84ºç\85¹å\89¸ç\8dºë\8e¾ï\8dÆï~¾âw®Ò|­Íi Áy£É~³ÝwµÜ|¶Ýu­Ðj\9d»X\80\9cE^|N^{\k\8a^g\83P_\82Td\86br\90Qc\82P^\82Wf\88Sf\89N^\80P_\84Na\86H\\84I[|@V|KZ\7fQb\84R`\82K^\7fR`\83Tf\86S`\83Ye\89]l\8cVh\86Se\87Tc\86cn\8fm{\9abp\8cWc\85do\91\80\8e®L`\89Qd\8fx\8e¬h{\9c\82\92«\80\8e«\88\94²du\99er\9a\93\9a¼z\88«r\7f§p\7f§^q\9dLb\92Yn\9fOf\9ax\87­y\87ªv\81°²·ÓáàçùùöæåæÇÆͶ¶Ç±°Å¼¼Ó¸¸Î·´Ë®¯Å±²Ä±²Á£§¾u\87«~\95¸}\9d¾\99ÈíªÑý¥Ëø¨Ëù¨Ìù¨Ìø¨Ëú§Ìù¨Ìù¦Íû©Ëú©Ìû¨ÎùªÎú©Ìû§Íü©Íü¨Íü©Íû¨Íü¨Îü¨Îü§Îü©ÎüªÎý¨Îü¨Îý«ÎüªÏü¨Ïü©ÎüªÎý©Îý¬Íý©Ïü©Îü­Îÿ«Ñü¡Êî§Åß\8c¨À`|\9bcn\93it\99dw\9a}\8a¨\8a\8e©¦§º¶¶Ä·»È¸ÄÓ´Îæ¶Íê°Îï¯Òú¬Óþ«Òÿ­Òþ«ÒþªÒþ®Óþ®Òþ­Òÿ­Òÿ¬ÓþªÒþ¬Òþ®Ñþ­Òÿ«ÒÿªÔÿ¬Óÿ®Òÿ¬Òÿ®Òÿ¯ÒÿªÓÿ¬Òÿ¬Òÿ­Òþ«Óþ®Òÿ¯Òý­Òþ®Ñÿ¬Ñÿ©Òÿ¨Òþ©Óþ«ÑÿªÑÿ¨ÒÿªÐþ­Ïþ­Ïþ©Ðþ¨Ñþ©Ïý«Îü«Îþ¬ÏþªÍü«Ìü¨Íý¨Íü\80»ç\83ºæ\87¹å\86¸å\85¸å\86½è\8cÂî\89Äë{»áp«ÌY\8f©Go\8aSi\87Ti\83H_}O`\80Me\83Jf\86Rk\89Qc\82N_{HWxW_\83hu\98y\84£s\82\9dZm\8bDWyJYyL\|IYzCRwOb\88O`\82QY}Vh\89I[}@TvAWzK\~JX|N_\80N_~O_\80J^\7fPa\82Ud\88[m\8fMa\84HY\7fTa\86^k\8fht\93js\97dq\93_q\91gu\98Wj\8b;T\80Yp\99Uk\94hy¡\7f\88¨{\84£y\85§`m\96\84\8d±\81\91¯v\86«\81\8d³w\84­Fa\93Ui\9f\8e\95½£©Å\89\93´\9e¦ÁÃÊ×°´Â¥«¸°µÂª°¿±µÅ³´Ã»¾É°´¾§¯½\9a ²\85\91ªz\86¤\99 º\8c\97µ\94\9e¾\7f\89±a\7f¨\93¾ã®Ôÿ¨ÑýªÎü«Îü©ÏþªÑþ«Ïþ¨Ñü¨Íü©Íý«Îü«Íú«Íû§ÎûªÎû¨Íü©Íý©Ïý«Îý©Ðû¨Ðý«Ïû­Ïü¨Ñü¨ÐþªÐý«ÎûªÐýªÒÿ«Ðÿ©ÏþªÎþªÏþ¬Óÿ©Íð\9f¶Í§­Á\7f\85 bq\94jx\9fx\86¬s\81¥ct\9adw\9bw\84¤\8e\9a³\97\9c´\96\9b´­¯Ä´´Ä¾¿ËÂÅÑÄÊÛ¿Ïâ·Õï°Öý®Ôÿ¬Öÿ­Ôÿ¯Ôÿ®Ôþ¯Òþ®Õÿ°Öÿ¬Öÿ®Ôÿ®Óþ®Ôþ¬Ôþ«Öþ®Ôÿ®Óÿ¯Óÿ®Ôÿ°Ôÿ®Ôÿ¬Õÿ®Ôÿ¯Ôþ¬Ôÿ®Ôþ¬Ôþ©ÓþªÓþ¬Óÿ¬Ôÿ­Óþ«Óþ«Òþ­Ðý©ÒþªÒþ«ÑþªÑþ©Ðþ­Ðþ°ÔÿªÒü¨Ï÷©ÔýªÒþ©ÍüªÎü\83ºä\82ºå\87ºç\8aÀë\8aÄî{¾ác¤ÀG\7f\97:_{8Ro9JlFUvDXxDWvMZzHZzCStN]|Ra\7fGX|L_~Lb\83\k\8eZk\87Pa}HXtJWwFRu?PtSb\85M_\80=RwCV{G[}ASx>Ux;RwBVzH[}GW|K^\82Pa\81DXzO_\83Wg\8aYj\8b`l\8f]h\8bWl\8dQf\86Pa\85v\80¢t\82\9djx\94]k\89U^~cn\90Wj\8aH[\80Sd\87Zj\90^l\95{\88¤bq\95\89\90³\85\8c­\8d\97¸\83\8f«s}£w\86«\82\8f¬Th\97|\86»ÁÀÒ¹ºÈ²·Ç¯²É¸»ÍÇÆѬª¼\9f£»\86\91¯\88\96°\8a\96®\92\9cµ~\8a¤o\7f\9ct\7f\9el\7f\9fr\82¢\97\9e¶x\89¨i{¡\8e\9a·\89\93¶l\82¦\8d®Ë\9dÅâ¥Îï¡Ëí\9dÉè\9aÄà¢Éè£Ïî¨Ó÷ªÔó¨Ñô¯Óþ§Ïû¨Ñû­Ñú±Òù­Ñù«ÐúªÏý¨Ñý©Òÿ®Óý®Ñú«ÒúªÒù§Ðú¯Öÿ©Óù\9cÊì¢Ïò©Ôú­ÖüªÖû¨Ëì\9f¥¼\83\8a¥v\82 ds\98fw\9adv\98n\7f¡ev\9e^l\95[k\94o\80 \8e\94®\8e\93¬­®Æ²±É­°È\8e\97²ª®¿´¶Ä¸¸ÅÅÆÑÅÐÜÄÕè³Ïë±Öõ±×ø¯×ü±Úÿ³Ôö¬Ëæ«Ðì¯×ô²Ùÿ°×ÿ®×ÿ¬Õþ°Óþ°Õþ°Õý¯Ôþ®Ôþ¯Óý°Óý®Ôý¯Õþ¬Õÿ°Ôÿ­Õþ®×ÿ±Öþ°Óý°Óþ¯Óÿ¯Õÿ±×ÿ³Ùÿ¯Ùÿ®Õÿ­Òþ¯Õÿ®Øÿ¬Ïú\96´Þ\86 Æ\89¡Å\98µÐ¡Ìè¯Úÿ¯Õÿ\8cÂé\89Åí\80Àäp­ËX\8fªCi~5Nk9MkANm@QpATtBSpFUuGZx?Sq@QsDTv>Sq@PqGXwFXvEZyBUwCOsO]\80Tb\82IZ\83]d\8cZg\85?RrGTwAStARtBTwFWy@Qu@RuFWyHWz@SxEX~DUwO`\80hp\92jv\93Wg\88Xh\88Q`\81Se\83CY|Se\88jw\94Ve\85_m\8eks\97t{ hp\93Ud\86Qa\85I[\81IY\7fJ^\86Kb\88\m\8fv\83\9dw\85¡\90\98­\89\90ª\82\8a©x\87§|\88£\n\9aª°ÌÎÏÕ¸½Í\8d\94©\81\8e¦´·È\8a\94¤|\8a¡\82\8c§\94\9b´¢§»\8b\95²\8e\99³jz\98gx\9bbz\9aas\97p}¡\89\93«z\86\9fky\9cdw\96ex\99i{£m}¥k\84¨p\8b­x\90³y\8c­\85\92°y\8e®l\88¨}\98·}\94²]\82ª\95ºÛÌÙíÐ×çÒÙèÏÓßÐÓÞÑÛåÉÙéÀÓæºÑåÁÎÞÍÔâÇÏàÉÒãÌ×媽Ï~\99´{\91²p\8f­\85¢¹\8b¦»v\95®\87\96±y\84¢bv\97\o\95ev\9abr\97^p\93bp\97hs\98[n\94at\99\80\87§w\80 s\81\9f\8e\9c±©®¿\8f\97¯\8f\97³\91\95²\98¢»¦ªÁ¬­Á­®Á³µÅÂÁ˼ÀЫ³Æª»Î\9a´Ë¦°Å¬°Ä¶ºÍ§±ÄºÌضÏåªÔï²Ýþ³Ùÿ±Õþ´×þµÛÿ¶Úÿ¶Üÿ·Ûÿ´Úÿ³×ÿ²Õþ°Õý´×ÿ­ÊóªÑó±Ùÿ´Úÿ±Öü§Ïó Çí\93¶ß\92»á¥Óô­Ùý¦Çì\9cµ×\90¢Ä~\8f·~\8dµ\85\90\84\8f³\89\9d¼\95µÐ\87«Íd£¾Q\8d§;l\82:Tn:LhCQn?Rs?So=Qo>Pp<SqHWuIWtCRqCVuL^}I[yJWwNZwIXtXa\84Ud\82L^~bn\8dZi\87Tc\85>PyVb\85Zl\88@SuCRt>Pu?QvBTw?Ts>QvAQuIY~L_\80FW|Qc\83K`\7fF\{H_~K^~FZ|CWyLZ~Wb\83S`\82Ta\82_i\90\80\89ª{\84¤\99¡¼\9f¥Â\95\9f·v\82¢[m\8fWe\89M\\7fJ[\80Xk\8flt\96_n\8bTf\86nw\93l{\97v\80\9ecn\8ccp\8fcm\8dz\83\9aw\86\9a£¯½¡¬¹Yk\8cn\7f\9fn}\9faq\9bm{\9foy\99x\87¡\8c\94¬\89\92©]p\93ap\99s\80¡\91\97³\97\9f·\83\8d£rz\94is\8eXh\84[j\86\h\8abw\9d\8d\96\85\8d±\82\92¶p~§\81\8b°x\88¯r\81¬{\8a¹as§Fb¡\99 ÉïåéÙÔÚÁÃÏ·ºË´´É\96\9bµ\9d£»¤©¾··É¿¿ÍÆÃÐÄÄж¸Æ\93\9e°j~\9dt\82¦s\87«u\85§m}¢_s\99lx\9fr\7f¡`q\97cr\99`p\97\o\97cs\97lv\9a_q\96`o\93`l\94u\7f w\82¢p|\9egt\99ds\95\8b\96°\8e\97\8d\93´ ¥À\8d\96\8d\98±°¯Â··Í¦¨Á\8a\93¬\8b\94ª¥§½°®Æ§©À¬¯Å\9a¢¼\9a\9f·\90\95¯\91\99«¦ª¹\99¤¶\9a·É\9eÎç°Þþ©Ñõ\98Åâ\9eÊæ\93½Ü\94ÁÞ\98Êç¥Õô®Üþ³Ýÿ±Íò¨²Ø\9c²Ø¥Íí\95¶Ü\8a§Ï\83\9aÇ\83\9cË\87\97Çz\8fÀ\86\9eÅ\8c¢Ä\87\97¼\85\8d·~\8a³}\91\81\8e·x\87±v\86®~\91²u\83ªlz¦4Pl8Lj=Ok>Rq=RqBOo=Nn>Po<Oo;Op@Qq>Po@OoN\}Ve\82IYwFXwN]yO`~Ta\83is\92_n\8aK\|Re\84Qb\83=QtCVyK_|EWvCVvARs9Ot@Sw@Pt?Su?TvARvCVv=QrM^\7fWg\83Pa\80O]~BXyJY\7fQ\\80EUzM_\80S^\7fjw\95]m\8dy\80£\87\91ª\89\95°\97\99°\9c¢»\88\92ª\82\8a£dq\89M]\80Sb\82]j\89fs\8eiv\92nx\9bbr\92L[\7fsw\9a\83\89®{\80£{\80£~\87¤jq\91O\\7fRg\82\m\8bfr\92Zl\8edy\97y\85¢v\84\9aiy\96ct\94o|\97aq\88Vd\84\80\86¤\8f\98¯\88\93«hx\8f[l\85^i\87Rc\81U`\84Sb\85Ob\84Kb\88^r\95t\85¥z\87§\90\99´\89\95³o\83§gz£u\83­Qm£Tr¤ÐÕ෼ǰ´È¶¸ÌÉÆÔÀÀÒ©­É´¶Ï²´Í\93\9c·¤®Á©«¿\88\94¯p\81¡_t\9cev\9efw\9ck\7f¤i|\9feu\9cft\9bct\99ap\96]p\98fs\97es\95^s\97cu\95ju\96`t\96ap\95it\99o{\9aqx\9aiy\9bo}\9fmv\9bky\9a}\8b¨y\85¤\96¤¹£¥¿¢ªÅ®´Ë¬°É\8b\93¶w\80¥\9c\9f»¦ªÁ\8e\98²\8d\98¯\8f\90ª\8c\93­\96\97³¤§Ã\8a\8d¯sx\97mx\97dv\96c\82\9bt\96­g\81¡^s\94\t\95ct\94dw\94l\85¢d\86¡n\93«w\98³\82\9fº\9b°Ë\9c¬Ô\8f£Ë\81\96Ä\80\92Å\85\95Æ\82\95Â\8a\98¾\7f\8a³y\89²~\89³}\8b·\80\94¼\7f\8d¸\86\8dµ\80\8a¯y\89°w\86¯q\80¨x\85¬p\82­FWtEXt;Po?Ro@Nn;Nm<QnAPmAPm9Pp>OpAOoATsH]yBVu?OoKXyVf\82HXxK\{L_zM^zO\}GZ|M^\81DUuAStEUuBSsBPr=Qs<RsATv?Tt?RtDVxDX}Ue\88Xh\88J\|FXzJVxJXzN[~js\98p|\9aEZwIZzWf\84Ug\82IVxJ[|k{\9a~\8c£hp\8ep\7f\9dx\87\9fUg\81M^~Rb\83Vd\84Wg\8aWe\85Tc\86kx\9ct\84¡[e\88qx\99\89\93¯\8d\92®\99\9c·\96\9c·\97\9fºet\92JY\7fXd\89]j\89N_\7fN`\83Sd\85Xh\88oz\97fu\8f]m\8a\j\86Yf\82Wd\82\k\88gr\8eTe\83Ra\82Vc\85\g\86We\87[i\8aWd\87Uf\89Ka\87Vm\96cw\9eh}\9f_w\9eau¡Zn\9a[t\9fSm¡p\83±³¸Ë\8b\96²}\8d®\84\93­\7f\8f§\89\98±\7f\8a¦\8e\9b²\96 µgz l\81£v\87¨du\9dcu\9dcx cx gv\9dgw\9c[r\98as\96ds\97aq\94^q\94`v\97br\96ct\96cs\96bs\95cs\93`r\91t}\9a\83\8a¨x\88¢|\87\9fn}\99\85\8c¨p{\9em~\9e\n\90dn\92du\95t\84¢\8f\9b¯\99¢¹\93 ¶\9d¤»\93\9a´\92\99³z\84 iu\98}\86¤µµÍ­¯Æ §¾\94¢¹§¦¿z| gt\96ex\99ew\96ao\90ao\92dr\93jv\9a\88\8b¨\80\82¢it\94_n\91an\90hs\97fu\94o}\99m\85¢z\87¨\7f\93·r\8b´x\8f¶}\8d´z\8a³\7f\8c´s\88²\83\98¼\88\95ºu\88±\83\91¹\81\89³\81\8e´~\8d´u\84«\87\96´\83\8a±hz¦CTo?Sm>Pm;Om<Ok?Pm?Pm>RqAPq<Rp@TqDUrCTs>QnBSq>TsAUuQe\84Pa\83Rd~DZxDYwARtEWx=PsJX|K\}@SuBUwCVwAVy>SsAUuBUuGUwGZ{Ob\80Pd\84Qe\82MWyEVzO_{HYxKW{Mb\81G]{N`\82co\8eZe\82cn\90Vb\82I[|M\|`p\8dI\\7fI\~M_\7fG^~M]\80ap\91iw\9bo\7f\9d^o\8cRc\86Vi\88Ve\85[l\8dO^\83jt\92fs\90}\88¤\91\98¯\87\94ªz\83¢ip\91Yh\8aRb\83do\94|\80¡}\82\9ex\80\9cr}\97hs\8f\i\86Tc\85Xi\87Xf\84[i\87Vf\84\f\86_j\8cs}\97bm\88Qe\81Td\81`l\88\f\85Qa\85Ka\8aUn\97at\9ePd\95m\80¨ex¡[o\9a`s\9d\7f\93°\8d\9f³t\84¤iz¢^r\9dWl\9c[q\9ehx¡dx av\9fdz¢gx¡dw\9fhw\9eky\9diz fy\9dkv\9ces\96`r\95bq\96cr\95_p\94bs\94ft\96es\96bt\93hv\94fw\96o|\9ciu\95gx\95ct\92cs\90_q\8ecu\92p~\9bds\94hy\98^o\90`n\90_q\94dt\97fr\92eu\92cx\96kz\97er\91x\84\9e\86\91­\7f\82¤´µÉ¨­¿z\88 j{\98dt\93\91\9c³\85\8a¬gp\93cp\90^p\93`r\92gu\92ap\8fgv\93\83\8e¦\9a\9bµ\88\8a«\7f\89§\85\8e®t\80 mz\9apz\9dix\99v{\9apy\9bf}\9dp\86¨~\91¶y\89´p\87°v\8f·\85\93º}\8a²}\8d´\8b\95»\81\8a±\83\92²\7f\87±y\85°\81\90´r}«cw§ESsBSo>So<Sp@Qo?OnBPpARqATpCVo@Sq@RnERrEUu>SrAUt<Pp=PrI]{J`|BUv@StESvCTtBPrJY|P]~CYwEZxEXyDXyHVyCUxHYzO\{Pa\7fJ]|O_\82N\}O[|K]\7fJZ~IZ}H[{ETvHW{Yh\88Vd\84^j\89[i\88J_\80E[~I]\80H[\7fIY\7fM\\7fL]~H[}Ta\82Wd\84Ub\85bn\8cRd\83H]\82L^\82J^\83N^\83M[\81N\\7fN]\81Wg\8aWe\86Vc\81_m\8ap|\99}\83¡z\84¡u\83\9e|\83\9c\88\8c£y\82\9blz\97bq\8bTb\81al\8edv\91Wi\83aj\86cp\8ft|\9aqx\93Zf\81Vf\85[h\89`l\8dbo\90Vc\85Tb\82K\\7fF\\85Uk\94_q\99\p\99_r\9cVm\9b\q\9bNi\98Qi\97dw¢g{¡bv\9dcz¢^u\9f[v\9e\s\9e]t bw¡hx¡fz\9fi}¡m}\9ep\80 hx\9bcu\9bbs\98dt\98fu\96dr\94is\97is\97hs\96gs\95ht\95gv\96ew\94ly\95hv\97bv\95bt\92bt\91ar\90^n\90\l\90Zl\8e^o\8e|\83¢w\7f\9fcu\94n~\99kx\99o~\9bj~\9d`s\98cq\92m}\9a~\8d¦\87\90©s~\99cr\8fYm\8d\83\8d§\8a\92®\8c\96¯~\89¢bs\94ap\90aq\91_o\8des\91ar\91\85\8c©\96\9b¶¦­Æ¦«Å°²È¡¥Ä|\7f¤~\85¤r\7f¢bq\93fu\90my\97ky\99bp\8dq\81\9c\82\94¶x\8dµz\8d·\82\8cµ\88\94¸\93\9f¿{\8b³q\82­v\87¯\80\90´\7f\8b²t\82ªm|¨m\7fªJ_{H\vBUp>Rq=Rm>Qo@RsGZt@VpAQqBRpCSr>RrDVrBSrASsCTqEUrBSqBQrCUuBStGVuATuFXwETsHUuK[yO]}FZzHVwBWwN_\7fL_~Sa\83Sd\81Tc\82Xj\8aTd\83Yk\89Vg\84P`\7fP^\7fL\}GX{P\~J[zFY{I[}J[|FY|H]~K[~K[\81Rb\83R_\7fL]\80O`\85Tc\85M`\80N`\81P_\81M]\7fI]\7fO^\81I\\80L\\82Oa\83N]\81R`\83Xf\85Ue\88]e\88_f\87p|\9aq{\94Wj\86^p\90|\81\9eky\94lz\96Xj\87Pe\81Xh\81cp\8bbm\8chs\8fcr\8dmv\94r\81\9aYg\81S^~Xh\84hw\92dr\93ds\92ft\95P^\80GZ~HZ\81Ka\8bSi\90Yq\9cWn\99Xn\9bRk\9aWo\9eXn\9c\r\9d\u\9eau\9ek{¢av\9b^u\9c_u\9ecw\9few\9ei{ s\82¢q\82¡n\80¢iw\9cgv\9bgt\99dt\98`q\94gu\95ht\96kv\98ku\95lv\95jv\93hs\92gs\93br\94co\8ddr\8fbq\90]n\8e_m\8f\o\8e^m\8f[k\8fZk\8e]m\90\7f\87£z~\9cjw\97]p\91bt\93kx\95fv\95br\94ju\94ip\95nw\9a|\82¢gq\94]m\90Ym\8f]s\91gx\96Zo\8fXl\8aZn\8e`n\8dgs\90\82\87¤\90\94°£§½¨¯Å¶¹Í©ªÆ\93\99µ\97¢¹\8b\97µ\89\95µ\81\87«iq\93_j\8d_s\8e{\87¤gq\96Xh\8b^p\8edu\94o\85¥|\8d´v\85±p\85­\88\98º\87\93·v\89³n\82«i|§v\88°q\82¬i|§dy¦?Ur>Vs;Qp:Pp=LoCUrI^zH[xCTrATq@Ts?Vq@SpARqBUrAUpAVpEUqDUpATq?SqASqESrBSrEVvFUsBRqFTuIYxK\yHYxEWwL[|O\xDYtF^xL[xO_}P`~L_|GZ{IYyHWxLY|EVyHY}J\\7fK\}FY{BZ|H[~IZ}M\~Sb\87fr\8fSd\81Oa~]l\8dgs\91bm\89Qa\7fO]\7fQa\83Oc\81Na\82P`\80Rb\83Tf\86M_\81R_\80\i\8a^k\8cnz\99s\80\99`p\8aXd\82Te\84dp\8dks\8eTh\83Tg\85Vh\86Zl\87en\8ckt\91u\7f\9bao\8a_i\86_i\82Oe}Pb\7fQ_}P^{HWvP^\80Vi\85I[|P`\83GY\80N\\81K_\88Nd\8bXk\93_q\9acv\9d`s\9cWm\9aWl\9aWp\9b_v\9ecy gy\9ecu\99cs\9bft br\9cew\9em} o} gv\9bfv\9bcu\9agu\99fs\94hx\97bw\97ly\99lw\96gv\96et\91jv\94j{\99dr\90dr\8ebn\8ffu\94\89\8f¬dm\8e^k\8d[m\8e]o\8d^n\8ebo\92cq\92_p\90_o\8efq\90dp\91cs\93fv\93`p\91cn\90iu\97\86\8f«\98\9e¸©®È\9c\9e½ir\95_k\8d\l\8fVn\90Wk\90cq\8fbo\90fq\91v\82\9d\96\9b´\93\98®\95\9b¯\91\92©~\87¦\83\8f¨\82\8f§\8e\95¬~\88©m|¡dv\95bo\91eo\90^k\8el{\95\97¡µ\87\8d¯bl\91aq\92gt\94mv\94o\81¤o\87¯\82\91\84\8b´m\7f©h{¨n\81«o\83®k\82¬_z¤_v¥[r¤@Qr;Rp<Op>Sq@RsN\yL\wDVsCWrDXr?Uq>ToFTrFSrCSrCVsBVqCUrBRo>QpAPqBTq@SoAPnARs<NoN[}\h\86O]|IUuM[{L^|BSqCQqBUsEZwFYxHWwIXwHXyJZ{GXxHY{G\yJYwO[yP]xG[xK]zL^zQ`~N]|I^{Rb\83Xe\7fRb~Sg\83Pd\82^j\88ep\8chu\95bo\8eTe\82Te\84Tc\83Sc\83Ud\87Xh\88Uf\85^j\89_i\88^k\88`n\8a[k\86Pd\80Rg\86Vh\86Te\80Yf\82^o\8bYi\85Wf\82Xg\83bs\8d[j\86R`|L^|R`}Ua}N`}M_}K^{HZy\f\88Xc\87Vb\85Vb\85O_\82T`\82IZ}DX\7fSf\88Yh\8cTh\90ew\9c\87\8f°y\83¤Wh\97Ri\97Zt\9bYr\9aa| av\9cdw\9fer\9dhy\9ffx\9cbv\9dcv\9dbw\9cdw\99_s\94bt\98ju\96n{\99hx\98n{\9afw\95bp\92br\90`s\91bv\93cr\91fs\92bq\90lx\94s{\93bl\8cbn\8f]m\8ccm\8e\m\8eap\91ft\94dt\91fs\90gq\93it\95ep\91fo\8eit\94iu\94r}\9baq\91p\85\9a\8a\99­v\81¡cr\93ap\8fam\8f`m\8edo\91it\93t}\97s\7f\9av\81\9cjy\96`q\8eft\8f\85\8a¤oy\98as\8f]l\87u\83\9b\80\8c©my\9bbm\90`j\8c]k\8e]o\90\85\8f¨\85\8d­s\7f\9ahu\92^o\8f`o\8cgu\95cr\97f}\9dk\83¨g}ªo\80¬u\87±q\86­i\81«^w¤bz¤bu£]t¤;Sp;Qn=Sp@Ts=WrBWsAUqBWqCRnAUr@Rp@Tq@VpCTqDTrBRpBOlBQp>Om<QoDRq@Po>NoBSr;Ps?NqSc\82[k\88I[x=RrBRrDSrCTtCTvDVuDVuIWuAXtDWvLXuLZvKYvJWtG[xL\uIYsHWtFXuHXuJWvN[xO^|IYvJZxL\yR^wP\zO^}Tb{Wd\81[i\89]n\8cPa\7fO^\81Pd\83H]\80Wg\89cp\8cL_\81`n\8bZh\82Xg\84Yg\85eq\8cUg\84Ve\81[e\81Ve\81Sc|Vd~Vf\81Re}Q`{Pb}]o\8dP_\7fOa\81Sc\7fHZ{N^\7f\h\87Ya\7fR^\7fQe\86Uc\85Rd\83S`~I[~Ja~E[\81Te\88Se\83Uf\88Vh\8bUj\8f\82\92®¡«Ã\9f£À\80\88¬as\9c_w\9e^r\9b^q\9c]t\9fbs hw\9ef{\9cbw\9bdx\9c_w\95at\94`t\95gt\93_p\95\m\91ct\91aq\90\r\8faq\8f_o\8f]o\8f]n\8d`n\90do\8fbn\8c_p\8dbp\8e`q\91`m\8d]n\8e`o\8d^m\8f]m\8f\o\8ecr\90es\93jw\93ft\90qz\97\83\8eªl{\99mz\98ex\94_s\92]o\90_o\8eam\8e`q\91cr\91`t\91bp\92dr\93[o\90bu\92s~\98lr\91jr\90hu\92ds\8fcr\8eir\8fao\8dbp\8fam\8fbr\91ix\98q{\9cpx\98`r\90`r\91~\8e¨}\89§p{\9bew\94bp\8fn~\9cjs\98fp\91Xk\8a_w\97a| m\82«j|¨bw¤bx¦`w¦g{©bu£^w§@Ro@SpCUqCTnBTo?TnCTm>Rn>Rn@SoASpCTpCSmBTo=Qo=Nk@Ml=Oo>Pn>OoAOm>MmCPp@Pp;JnCRs@QrBQs?PqBTsERqFTw@RsEWrDWsDSqEVpEXsDSrEQpCRqESrDSrFWrEVrDToEVuCVwFVtDVsEWtHVsFWvK\zEWtJYxao\91qx\95Va\80K[}Yg\85ETuJZ}M]~M_\7fK\\80Zi\85N^}L_\81We\82Yg\83gu\91ao\89Xe\7fVe\7fSb~Ub|Wa~`l\8aTc\7fQ`{L[yG]zTb\7fPd|J[xDXxHZzN`~Xd\80Xg\84Yd\86an\92@U}DTxI\{O]}Oa\80L`\7fN`~We\85We\86Qa\84Se\85Wf\86]p\8cu\86\9c\80\8e£\92\9c®\8c\95«i{\9bYo\96\p\99^q\9a_y\9dhu\99`r\94^p\92aq\93cr\93]o\92]p\91`r\91ds\93ft\93as\90co\8f`m\8d`m\8c]j\8bYm\8d\n\8f]n\8e_n\8c_m\8dal\8c^l\8c\n\8cZk\8dXn\8faq\91cp\8f`q\91]m\8e^p\8fiv\94kz\96fy\95ky\94fv\90as\90bp\8fbr\91fs\95dq\93er\8fbs\91ft\93lv\93dt\93Zn\8d\n\8c]p\8faq\91gv\90iv\93cp\8ebq\8e`n\8e[i\8b^p\91n{\9adl\8f_n\8efy\95|\8b§eq\96]o\8d`q\8f^n\8biw\94eu\91ky\96dr\90dp\8eq\81\9c|\89¥t}\9bx~\9fgn\94aq\93k{\9fh|¥f}§dw¨bz¨c{ª^u¦_w£CToFSp?Tm<Rk>Rk?QlCSmBQl?Rn?SnASm?Rk=Pi>Ql9Ml?Mk;Mj;Kk8Kl=LmDQm@RpBTpDQn?RpAUoEUqBSoDSpCTpESnFToEUnEVmCVoFSoCSmERk@Ql<QmCTpHRoDRlBRmESqCRoBRrBSrCUqCSpIYtEUrBTtL]{DVuDSqO_~`r\8fPb\82GWyO`\7fLXwNZyJ\yJ[yN^}Qb~Rc\82Xd\81Wg\83Vf\83We\7fUb{Xb|Yc}M`y\e\83y\81 dt\8eQd\81an\8f[f\89F[{Yf\80L\yMb\80IZxGUxN\zL[zM_\80gp\92Yn\90<TzN`\86Yh\8aGZ~K\{Ud\7fN]}P`\81Ud\82Td\84Sd\84Vh\84Wh\83Ve\81La\7fSi\84es\8caq\8dbr\90ds\92gu\94dt\91ds\91ap\93_q\94bq\93aq\93_r\90fs\92gu\91fw\91bq\8d_p\8e]k\8c[l\8eXk\8cXk\8b^l\8d^m\8d\q\8cgu\90cr\8fhs\94^o\8eZm\89Yl\8b[m\8a^n\8d]p\8d_p\8ebo\8fbr\90ny\91px\95cr\8fcn\8c\80\8d§\8d\90®|~\9d\89\8e«\90\97µjt\97_p\8d_k\8dan\8b_m\8aao\8cv~\9bnv\97es\94ev\94kt\8fv}\9ciw\97o}\99\81\8e«\87\8c°[j\90fz\97\92\96³wz¤Qg\89r\84\9ckx\96bl\8f`k\8d]o\8dcp\8fcs\90\p\8eZk\8dhw\95w\83 qw\9br~\9b\83\91¬\80\89ªsz hs\96iy\9ch|£g}«`v¥Ys¢]t£_u¦ESl>Rj4Pj<Qk>QiBSjDUnERk?Pj@Ok=Pk@RjBQk?Mi7Hf=Mj=Kh8Kl<OnBNh?Nd;Jb7Fa9F`:J`;Kb?Lc<Le@Of?Ng@Mb@La=Ld<Kc=Lf>Oh=Lf;Ke8Mg>NhBPhCRj?OhERkBRl>QnAQmDUoBUqGWsJWqCSpHRsAPqCSr@Sq@SsJ\wEVsDRu@OuDUvM]yGZuHYwIYxOZyL`~Na}Sa}Sd~Ra}M`|Vg\81Vf\7fL]wSb~Uf\7fOazhz\95_s\8eSd\81E[vH\yN_|Rg\82GYwEStVb\81Tb\87hu\97\f\86O_\83Qb\84Va\82[i\84J]zJ\|P_~O^}S`~Q`~S`~R_}Rb|Ue\7f]l\86[l\85Wh\83Qe\83Tc\86Yj\87\l\88_m\89_k\86[l\89_n\8fcr\8cdr\8e`q\8eho\8bbn\8a_n\8bbo\8c\n\8eZm\8c^k\8c\l\8dVi\88Ui\8aTj\8aTf\88Xh\89Yj\8b[n\8b[k\89[h\88]i\88Zl\8aZj\8aWk\89Wl\8a_l\8bdo\90gp\92gv\92\n\8d}\85£}\82£\90\96³\80\87¦lr\90y\83\9bv\7f\9biv\95\m\8d`p\90r|\97\84\8d¬\88\8f¬\8e\94¬\82\8a¥ly\99ku\92\8f\96®ª«Ã\9b\9e»\8d\94²\8a\94¯§¬Âqx\9dO`\82v\83\9a\9a\9c´dl\8f\k\8agt\92m{\99nv\97[l\8edp\8fku\96q|\9cqy\99Uh\8a~\93¨©«É|{¢ju\96{\8a¨w\80¡u\80¢ny\9fes\94dv\9c^s¢Zt¢^u¢_v£=Mg<Og;Oi=Rj=PiAPfARjGTj?Rh<Nh?PiCQl@Oi<Li=Lh;NiAOg@Qf<K_;F[6C[4D\0@[3B]5C]5E^8G]9E^:Ga:Ia:Ha<Jb:Ke:Jc;Kd?Mf=Lh?Og@NgBIfDOh@Oh@Qj>Si@SiAOhARj>TmFVnDWmIUoGUpGUpBNn>Pp>Sq=SmASpETt?Ts<Nu7GpEUvP`zJZvKWsIWuFVvGYwQ_wRb{Q`{I_zG[x\h\84Vd\7fHZuM[vN^xEYtCVsGZuK]yI\wI_zFVvR]|GVx\h\88ap\8dbq\8f[g\87N]\80P_~K[xN[{Ra~I]zM[}N^|Oa{Rc\82_j\85Tc\7fN`~Qc~We\80_h\83Zh\82Xj\84Xi\86Yh\87Wg\86Xf\86Tf\86Xe\84[h\86Vh\84do\8emx\96bl\8aZi\87ak\8a]l\89]k\8d^l\8e\m\8dVh\8bWe\88Qi\89Uh\88Uh\88Ug\89Vf\87Vf\87Wg\89[g\88ds\90\n\8c^m\8bbp\8fan\8b^l\8ceo\8djt\92_q\8fn{\98\99\9e³¦©½·¶Ì\85\89¨\82\89¨w}\9a\87\8f«lu\97]m\8dct\90u\82\9a|\8a¤iu\94Zl\88bs\90]m\8d|\88\9f\87\8f§w\83\9ds\80\9c\96 ¶\9a\9b¹|\81\9f\88\90­\82\89¯ch\92an\8cgt\91cq\90dq\93bo\8fft\91ao\8b\7f\89¡\99 ¹\85\89«x\85£s~\9ekw\96\88\9a±\98 ½\87\8f´qz\9d}\87¨pz\9ev\80\9f_l\90`r\90cu\94bx\9dl}¦r\84­=OhAPgFSf?OfBOfCQdAMbANb<K^<G]9F^>MfGQe>Kc<Lc?L`<I\<I\;G\3D\5AZ6C]6G]4G^:E_9G`9Ia;Ha;Ha=Hb=JeAKd>Me?Le=Mf<Nf?OjGOfBKf@LgBQl@NjDQkBRj@Oh@QjAOg@PjBSlDTmBSkBQjCQjGQmDSnAQo=RqGWxKYx>Qr6Fo?KrKWvH^xATtFSqCWuHZxETsIWuP`yE\wI[wE\xI[vM^yK]wL\vI[wI]xHXvHXwIXxO\zHZu@UwGUuGVzQc~L]|K\|_j\87Sb~L^}GYzXe\80S_|L]zO]zTa\7fVe\81Yh\81Zl\82Qb|Pc\7fUc\81Vd\7fQa}Mc{Ve\7fUe\80Th\83Yg\86Wh\84Yk\87^k\88Zk\88Xh\86]k\88kw\90bm\8cTf\86Xi\8aTe\87Wi\8a]l\8c\q\8d[i\88Ye\88Rg\87Uh\89Xh\87Uf\88Ug\86Sf\88Rj\89Yg\86Zg\87Xg\86[m\87Yl\89_m\89\m\8a^m\8dcs\91er\8dmz\93gq\8fp|\94l~\95p\81\9ax\88¢hv\91ao\8a[j\89Yj\8aao\8b`n\8cYj\88]l\86bn\87\h\87jy\97eq\92\87\8d¬~\84¨|\87¨{\84¦\8b\92ª§­Ã\91\90²\90\94¯«¨Å\84\81¨\f\8a_l\8cai\87\j\88an\8a^o\8c]m\88jv\92{\86¤u\84¢\85\91­\85\8c®s|\9d\86\94¬ ªÅ\85\8a¯nw\9ciw\96o}\9dmy\9c\o\8f]o\8d_q\8e_v\93s\85ª>PhDShDRh@Qe@Nb>J\AM^=L\=GZ:H\;I]?O_AO`?K`CMbGP`>M_7FZ6CY6BY8C\8E^<G]9G\;G^8H`:G_6Fb6F`>F`=Jb@KdAMf?Kc=Ld=MfANgERhAMeFRgEPhEMhETkAQiDNiDQjEPj@PjBOiCRlAQjDUlFSlAQlGVmCUlGUuUa\80Yd\81>Ps4GoARsHZxM^wDYtDStIWwBSqEXxJ]yM]wLYuNZtGYuCXvK\wJYvK]xK[wHZtI[uGUuXg\86it\8fgq\8cK^zCRsHUxWe\82L]zJ`|GZxJYyJZyD\{L\zS`zSb|Ue\7fRd|S`yPayO`|Yf\86Vc\83iq\91Vc\7fUd\81Ud\81QbzG[wJZzTc\7fYk\83_n\88Vf\84Wg\87Zh\87Xf\85Vf\84ar\8f[m\8dTd\85Ud\84Ug\87Td\85Qe\86\k\87Uj\86Sf\88Wg\87Zi\86Sh\86Td\88Xg\88Sh\84Sh\86Wh\8aWh\86Vl\87^n\88]n\89Zl\87bl\8a]n\8c\l\89Zk\87bo\8e]l\8a[m\8cVf\87[k\89_n\8bUi\88Wj\89iu\91p{\99`l\8b\m\89s\7f\93\8b\91«\82\8b¨\8c\93­z\83¥\82\8b©\98\9e¶³¸Î\99\98¸\81\85¥\93\9b±¨©¿\84\87¦|\85¢\98¢¶¡¡¼yz\9bvz\99iu\94gr\8co{\99}\87£\7f\83¥|\84¥ir\95kw\95x\84 \84\8cªu{\9dx\82\9d\88\90¬\82\8a­q} \81\91­{\85ª_l\92Xk\8fVi\8dYj\8cbw\95<Od=SeENbDN^=K_AL_<J\8IZ<G[@K^@J\?K_AK^CM`?M^>K^;I\;DZ8@Y8EZ9F]9G]<F\=E];G^7G`8H`9Hb:Ib9Ja:Ic?Lf@MfBLc@JbAMe?LgCPiBPeCRgDRjCQhAMh@OjANhAThCOh?Ng=Mg9Lg>Ok@OkANjAPmCPj?PkFWoBTmIXtCSsCRtCVrFXvFYtBUtBVu@UrGXwQb~O`yHZtJ[uHWuFZwKZwG[vHYvGZvah\84lq\8dXa|FXsK^{\l\84Wg\81Rc~Ra~EStSd~KayM_wKZxLWxIVvH^zI_|Q`zPa{L`}Yf\82fq\8bgt\8dr{\95\81\89¢fs\91^n\88P_~^k\87Xb\80Ta\7ffs\91\84\8bªdp\8eSa}Tb\7fTa\7fZh\85Qe\83Tf\84Tf\86Vf\87[k\88_i\86^p\8fWe\86Zg\86Th\86Sh\85[g\86Wg\86Si\85Pi\84Sh\85Xi\89Wi\89Vh\86Zk\87Uh\85[i\86^j\88\k\87\m\89]k\87Xh\86]l\89do\8ccp\8d_o\8b[h\86]k\8a_p\8c^n\89`q\8c]n\8a\m\86er\8blv\8fcs\8ddr\8den\8az\87\9c\96\9d³\94\98·\7f\87¬cq\92\8b\99©¹¸Ç\9f¢¹\9e¥¼\83\86¦\87\90¨\8f\94°y\7f t~\99x\80\9a\89\8c§\93\95¯x\7f\9d\83\8e¦´·Êº¼ÎÂÅÓÁ½Ô\91\8e³mw\9bcs\93eu\93\85\8eª\7f\84¢\81\8a§\90\9d·}\84§bi\8cdv\96q|\9fan\92iw\97^i\8dYk\8a@O_>M_DPaBN^>I\:H[>K_?J]AMaAO_;I\AO`COaS^jBQ^:FY9I[;G\7BX2AX4D[7C\:F^:I^8I`7F^9F_6Ha8Ia6H`<Ib=KdBMeBLc9Ic>NeBLf?MfDQgCOfBPh<JdENjCRf>Ng=Lf?Nh=NfCPh?Ng<Pk>Mj>JhAOh>Pj;Mj@QkANgETmHYsFVrCSnGWr@TqAUrCYsEUsJ^zIYtJYuI[vL\vIYtGYsJ[uEWsAUtSc~qx\92\8a\91¥\86\8a¥\80\88¤P_}BQrBUsK\zXg\81?SrGZxHZxDWxH]{N]yO]wJ]xI]yJ]xI[yw\82\9ey\83\9aiq\8b[h\84_j\82Yh\7fQb|P_yZh\85es\89_l\86ht\92p|\96ap\89bo\8as}\9aju\97AV|F^~Na\7fRa\81We\86Xf\87Uc\82^l\89jw\91v\80\9eek\89Uc\82Ob\81[h\85[k\88We\86Rg\85Oh\8aSj\87Rd\84Uh\86Wh\86Wh\85\j\86`i\85Zl\86Yl\88Xh\85^i\85ds\8aeq\8amv\8dgs\8d]i\86[m\8aao\8a\o\8cZn\8bYl\88dp\8afo\89eo\88\k\87^p\89\k\8aRe\84ap\8a\81\89 \80\89£ky\98^n\8bes\8dt\82\9a\86\90¨}\84¡\97¡¹{\84\9e\80\8e¤\82\8c¨o}\97lw\90o{\8d¥§¸\88\90¬\8b\91©\80\85\9e\90\96¨²´Á²¯Ä\80\86£nu\98_q\8fgx\95\7f\89¥}\87¦v\82 \83\91«\84\87¬ny\9dev\96]n\92]l\8cZl\8c[k\8cIObDN_:M[;J[>HZ@I\:J]<K\@L[=GZ;H^@N^;K\HRbGR_:GY7FY9BZ9G\3CY7E[7F_:G_>J]=I_9H_8G`;E]:F];I`9I`8Hb<Jf9Ic2Ib:Mf@Ne>JgALeBNeAMe7IdARg;Nf8HeBLeGQfAPfBRk@Oh@Oi<JgGOk>MiAQj@PkDOhCPkAPlCUlEXlBPj:Ji<KlIZuCVpFUrJZwH[tDXsNazJ\vFZrFXrBXr>Sr@VuIXtGUnL_|\92\94­\92\97±Wf\7fJWvIZwGZvKYuCTrDYyK]yL^zG[xO^xSbyRe|Rd{M]x\g\81nz\90am\84hq\8bqz\95Rd\80L]{J_{L^zP_xQe~Yg\80Qb{G[yEZvJ^|Qd\81Qf\82IY{CU{Rc\81Ud\81Oa\80]e\83Tc\81Xj\89Yg\86u\80\9co{\97Sb\82Qd\84Yh\86We\86[k\88[k\87Uf\86Vj\87Uf\83Tg\84Wj\86Ui\83]k\85`l\86Xk\86Yk\85Vi\85[k\87al\87co\8acn\88^n\88^m\8aXj\88_o\8b_n\8b_n\89^p\8abo\89fr\88\n\88]l\88ao\8cdr\8das\91Wg\87Ud\83Ug\84Ul\87Vi\87Re\87Sg\89Rf\89\l\8a`s\8fYk\89Yk\89[n\86\k\85Ug\83gs\8at\7f\92t~\96js\90z\82\99y\82\9duy\97]m\89cp\8cds\91es\90cm\8bcq\91q~\9blv\96`q\8fs\80\99jt\91]l\89]j\8aUf\8aVi\8cSi\8c@L^<G]EUjW\n]_lIRb6FY?KY9DV:GZ=J[?J^<JYLPbsjqVT_eYid_i@K^:H\<EY8F\8E\<G^8G_5F_7I`8H_<E\:F_;I_8G`7Kd:Ia<Ke<Kd;Ic>Mg@Le<Jc:Kf?Mg?Qe9Mf?KfHQhHTjGPd?Nf?Oi:Lh?Ri@Lh?LiHUl=Nj?Nh@Sl@OjAPiCTkHXnBSn<LjLZsESoKZuN[uEYrJ[tJZrEWqFWsJZwIZuJ[uGXtPZwVb\7fFXuVb~ov\8fUe~MZvFWvIYwJZtAVsI[yJ_zJ_yL\wO_yRbzM_yKc{PazR^xOa|Th\80`n\88\k\85H^zK^{L^{J]xI^yL\zO\xM[yL\{L_zD]yIYyH[zLZyHRuGXySb\80Td\81Yh\82Xf\83Wg\84Yj\87\f\85br\8cmx\93dp\8cRe\84Te\84]i\84Yj\86an\88]k\88Xh\87[k\85^k\85[k\86_l\86\l\87Yl\87Zk\86Zk\88Wj\86\k\85ep\88el\89^n\89Zl\87[i\87]k\8aam\8aen\89Yk\87Zn\87ao\8bVl\88Wk\87]k\86Zj\86Wj\85]j\86Xk\8b]n\89Xm\88Uj\86Wk\87Ti\87Sh\88Xl\8aYl\86_p\89hs\8cz\81\95q|\9av\80¡t|\9e}\89¢\90\93®\91\97²\88\8f«\80\8a§\8a\90®\8f\95³\88\90¯u~ fl\8dy\80\9edk\91\p\8dj}\9a_l\8e`l\88ak\8bdp\8ds{\99bn\92[g\89\j\8bAO`KSba`m^`nRYhX]iTVa<GW8DV<J\<HZ<JZ9DX@L^YYfsiq\8e{\81\80xu:FW;E[8DZ4C\8E\7E]9G^:G_:G_9H`9G_8F^7Ha:Fa8Kc8Ha?Kf;Hc>Id<Kb<Gb?Gb:Kg>NgDRf<Lg=Mh@OgCPhCQhDQiCPiCMhBQk@Qi=MhFTjCQhDPiAQj?SiAQkDTmFWoHUnGWoGYqFXrDToCUpDXrF\tFZsFVq?Ons|\97fq\82EVpXa|KYsO_yFXwDVwCUtFVtI[wKZwP]yP_xQa|P^xJ^xJ^xL[vFWtCVvDVvHYvOXvQ^xQ_wI`xG\wDXvE[zFXwWd\80ak\89Yd}Ra|N_|]h\82Uc|Yh\7fP_{M^}Pa{Rb\83U`\82DQtBTzRb\82`i\82[h\82[i\82^i\86]j\87an\86cp\89gn\88Vj\83\k\86bk\85\m\87\n\88cp\8a\j\87Yg\86bo\89_n\88Zl\87^l\84`n\88`l\86am\86ak\86[m\86bo\86ds\8aaq\8a`m\8aeo\87jp\8bdo\8d_r\8d^k\84^n\87^o\88Zj\88^n\8a]k\86Rj\86Uh\88Xj\87Vh\8a\i\87Yl\87Zj\87Xh\86Zg\89Uj\8aSh\89Vj\89^n\89^s\8ew\84\99w\89\9e\81\84\9d\95\9b¯ÂÇÓ½»Î··Ê¿»Ï\97\9a»\99£¹ÂÂЪ«Å\97\9a¸\82\86¨\92\99\9e¡¿di\8fUg\85Zp\8b^o\8dqz\9bjs\93ku\92jw\99]i\8dZj\89\dpY^iVWbVYc`aklfj][cDMZ9FX:I]8GY5DW7C[BP^BL[>IZIUeRXd;GZ<K_8H[3CY7F]5D[8C\7G^7F_8E_7G`8G_;H`<H_;D_<Hc:Ia;G`<Ld7Jc?Ke@Ng=Kd8Jc=NeCPe@Ld=Mg?Nf@SjARhCRh?OiAOh>Og>GcENiCSi?Ld>Mi>Ql>Pj=Pj>OiEQjDRjETkEXnDVnFTmDSlCWpGWqGWo=VnObvWauHYsXb}EZu@YsBUuIYyFZvKZvM]wK^wN^ySb{N`vM\sQ[tM]xL[uI\xBSrGWwDVuJYwP]xN]wL`xF[wK\yCXx`o\8cr{\95Vb}O]yHYxM]{Ub~J[xYa|[e\80Uf\81H[wYh\84]g\83ESw:RyJ\|Ve\81Se\81Pe\80bn\88Wh\80Wd}Vc}We\7fWh\81_k\84cp\89ep\87bk\85^n\86^p\87_j\85]m\87^p\86\o\88^l\84am\86^m\85`l\86dq\89aq\88Zl\85Yi\83hr\89`n\88ct\8adt\8aZl\87\l\87\p\86^p\89`q\89_n\89`p\89[n\89]n\89]l\89Xj\85Uj\88]h\88Wj\86Wi\87Wm\88Vn\89^n\89[j\87\l\89\l\86\n\88`m\86\l\87bp\8bju\8eu\80\97\7f\8a£\95\9f±··Ç\9e¡º\8a\95±\9e¬Â\9e¦Ã\9a\9f¼\8d\94±\93\9a¶­´É­§Áor\98Zi\8b[p\8c[k\8d[k\8f\j\89Wh\88Vh\8aZg\89R\gTVc\[eieldgp_`k[\hDQ^6FY:GY8F\@K^@I]EM^CN^EO_ERaFR`GSaAP`7CY3@Y5AZ6AY8D\9E\:H]4F^;F^8G[7F];G_8F_8C^5F_9H_9Ib<LeAKe?Lf<Jc9Lf;Nf>Pg?Mf:Mh<MgBPhCOf@Ne:Nh>Le?Jd;Jd?MhFVm=Ke=KhBQl>Qi?Oh=Mh;Mh@OkFTmDUnBRkFUkCToFVpEVmHWnHVmEWmBUnKXoJ[rD[sHZvEXuFYvFZuHYuN_vQ^tFVtJXuWcz[f\81^i\85jr\8e_h\84Zg\83NXxGZxHZvKYwN[xI]wN]xIZwJ]xFWxXe\83Ti\80Rc~s~\9bdp\8cVc~S`zJYwP_|M_yUd\81dq\90jr\94dl\8cNZ\824Kw;LuSa\7fZh\80Vf\80]l\82Vg\81Sc\81Qd\81Wd\7fRe\81\j\83]j\82Wh\82Sd\81Wf\7f\k\84_o\87ap\8c]m\85\l\84]l\83bn\86`o\85[p\89^n\87_q\8aWf\82[h\84_m\86Tf\84Vg\85Sg\84Mc\82Wj\87Uk\88Vh\87]k\89Vg\86Sh\85Wk\88\l\88`m\87_n\87Rg\87Og\86Sg\87Ui\89Zm\89Wl\87[m\87an\89dp\8c`p\8a]o\89er\8bfr\8a^m\88[k\87[m\88ds\8e]o\89`p\89bp\88ap\89m\80\99\8a\98±\93\9f¹\95\9dº\9a\9dº\9b¦À¼¿Ï©©Çck\91\m\89\k\88\k\88^p\8b]o\8cYl\8cXi\8acjuilxoo~gkv^dtYboMWfDM]<GZ:GZ9H\DN]HP]GQ^CN\=N^ETbGN]AJ\FL]?J\6DX,9U1?V3?X3?Z;H_;H^9E\5C\7F_5D\4D]8F`6E_7F`8Gb=Kb9Hb:Kd=Md8Id>Lf>Ng:Jf<Nf>NfDPg@PgBNf?MhBQiFOe@Lg@RiFTj>Jf:LhBRl>Ng>Ok?Qj>Ri<Oi@QjDPi@PiCRl@TmBSmFUnGSlLTlFTkBSlEUn@TmETkIUoFUrDVtI[uIXrG[tI\uKUq@Nmnw\93\95\95®\8b\90©\94\97­{\81\9bYe\83U`|N]xIYuHWvFZyI]zS^vN]xHYyGXuHYv@WvQa}]j\84Pd}Nb~M]wN^~Wb|R`\7ffu\98}\84\9fu{\97cp\91FY\813Lx2Mudk\86dn\81dp\8agr\8dZi\85[e\83Rf\84Xi\85^l\88bj\88Yc\81Uc\82Oc\82Od\82Oa\7fPf\80`n\8deq\8cYj\82`o\89Zi\86er\8c]n\86\m\86_l\85Ud\81am\85Sa\83Md\83Re\82Xe\86Zk\84[i\86Vg\86Te\83Zj\88Rc\85Ti\85Wi\85Vh\84Xm\87Wk\85[k\87\n\89Zl\87Ug\85Wk\87Qf\85Th\86Wi\87Yj\88Yj\89Uk\89\o\89jv\8cks\8afq\8aao\87^k\85[j\88_n\89es\8cu}\97iq\8eXe\80y\86\9e\91\9aµs|\9br\81\9bw\85\9cjy\92^m\8bcj\8bal\89_q\89ao\8aZm\8a^r\8b^m\8abcpfmy^fu`kwFVdHQaOXbNW`BK[9HZ?H\HQaEP^AK\<H\DP]FQ_CPa=K]CM_FRc;GZ/:T/:T3=V-;U/=Y8E]9G^2C\7D^5C[6@\7C_7Fa<G`;Kd<I`;Ib;Me;Ic<Id=Je>Je=Lf;HcCPhGThEQf>KcDOi?RhBRiDPfFRhEPf>Kh<MgAQiBPg@PjBOhHTjDTkANh<KeAPkESlCPjEUlBTnGUoFTmFVnHVnFWoFToDSlAPjCSnFXtIYtFWqGYtK^vLZuJWs^c\84t|\95mx\91^l\82_k\86`l\88GYtGZwEWrNZuQ^xJXxTd~eq\8aQ`}J[vK[yFWwGXuFVvT`~z\80\9b|\86\9fmv\99\84\85£jo\93s\7f\9bu\80\9dq{\9b^k\88Ta\80<Oz5Ltak\87Zg\81lv\8bbj\85P^~N]}Vd\80ks\8d_l\8aXf\83Vc\82Ub\82Kb~N`}M`\7fPb\7fTc\80ak\86Sd\81Xl\85]l\85ep\8aam\88\m\84[j\83Xd\83Ug\83Sh\84Sj\87Yj\85Wi\84Tk\83[f\81[k\83Te\84Rd\86Uf\84Ti\85Rf\83Rb\83Zl\87\m\89bn\88^m\87Yl\85Zk\85Yi\87Wj\87]k\89Uf\85Wj\84Yk\87Xk\85Wn\85Xl\87]l\89^o\89_l\86br\8f`p\8b_j\86ix\92kx\94gp\89kq\8emx\93is\8e\j\86Xg\87Zi\89bq\8ct\7f\9ars\97bl\87er\8bjs\8eam\89^p\89aq\8bORgYaoN\fAN[AMZ7DXITdUZhPWc@LZAK]CK]>I\>K^DPaIRaIO]GQ`EQ`=K];F[:CZ5CY5B[CJ`8BY0>Z5E]9K_8E\3B^4B]5C]:D]7E^6C^>Mf=Me9Fa=Ld:Id:Le8Lf>Mf?Ne8Kf=LfEVlIWl=JcDPgBSj=Ne>OgGUhHUjLTmANh@MfFNiBOgBPgAOhESjERi8Jf=MhDWl@SlFUoESlDTlGTnLXqN\sDWmCVnKVpBRkAPj@SmCTnEToIYrFXoG[sLXtO[yem\87cm\85mv\91do\88JYuR^|FUtXc\80Vd|J[wHXvN^|O^{GYwF\vGYwGZxL^zGXwHUvYd\80v\84\9br\7f\9ap{\95ox\96my\95iv\8fpx\93^l\88o{\9aDW}:MqXc\7fWf~`l\85Wd\83K_\80Ka}Ye\82ns\8fgp\8dVe\84N\|L]|K`~Na~Md\80I[zP\z\h\81Sd~Qh\81Sh\80\j\83^n\86_j\84Vd\81]k\86Wf\83_k\84bm\87]k\86Yk\86Wk\86[k\85]l\84[j\84\j\84Wh\84Vf\85Pf\82Rh\87Nb\83Vg\86Vk\86Xh\84bm\88]p\87Ym\86Yj\85_n\87Ug\83Wi\86Yi\86\k\87an\89co\86\l\84Yk\85`n\8adq\8car\8a_k\88j{\97lz\99_j\87bn\89_i\85\k\88_m\89gq\91ov\96fr\8e}\87\9e\8b\8f­nq\92es\8f\87\93²ns\97am\89]l\87RVjQ]jGUaFO^HR^BN[AH]\`m_fmKU_=I]AN]COaCRcDQ_CQaERcHSa@L^:F^6AY6AX2CY6E[7CY6F^8F]1BY7C[4D[1AZ2BZ1D\9Ha8@\5D^>Og:Ia3B_BKe;Jc7H`;Id=Oi8Me;Id6F`APkLYnDOf=MeDRiALcMVoW_tP\v[d}?OgDPgEMfCOiCRl:JeGPh@Qk:PjBQiJWnDWmCWm@SmFVmCQlIUoLZqIZp?TlDSlCSkCRl>QmARmDTnKWoFUnCTmHUnKYsK[tJ]r|\81\99pz\94Zd\83\82\86\9f[f\81]j\84Pc|CYtG[wH[uJZvHXwI[zB[wH[wM\xVh\82I[yDWwQd\7fOf\80Yl\89}\86¢\85\8d©is\91`j\8agr\90dp\8fRa\83I\yYg\82ep\86gs\8a^i\84O[|Pa}\k\84am\89px\95[h\86H_\7fJ_~S`}Ud~Ld\80J]|am\88Vf\7fYe\80Ye\82Wh\80\j\83dm\86Yg\83Yi\85Xl\87Sj\86Zk\86]g\84Yg\84Rg\85Re\85Tg\84Tg\85Rc\81]l\84Tg\84Re\83Qe\83Pd\86Ob\84Te\87M]\81Sj\84Zn\85Xm\85Xj\85_n\88]o\88\l\85]m\87`o\89\m\88`n\88\o\87\m\86bo\89`n\89_m\8b\o\8d_r\8c_p\8b`m\8a^k\87Xi\86]k\88Xk\8b\n\8bbo\89Zi\85eq\8c\8b\96¬\92\9a´\95\9c¸\80\86©jw\95lv\92et\93Yh\8aHM\=HZCQ`DN_IO_IN[EM^T\iW`kNUaAGZHN]AL\9FY@I[CO_BO_BM]>EZ7AX1@W9F[5BY3@Y0>U/<W8F]7DY6BZ5AY7E^:E\3C\2@\3=Z7A^:Hb9E_6DaDSi=Md:Fa<F`GQpUf}6E^;Kd>HcFPhDShDMdERgESh>McMVp_g\84^j\810B^:Jf:JfDRkFQg?Oi?Ni9Lh8Kg8LfEQjFUkETkCSl?VoAOjKWnESlERmDUoHXpKXoDSkCSnCRnDXoFWmCPiDTnKVnJWoATnDVpI\rP`vR`y`j\7fYczFYtI]xM^wCVtHZwK[uHZwFTuGZxH[xM^y`n\89gn\89\j\86O`~Mb~]m\8au\82\9f\88\94®z\83\99es\8fet\90]i\88Wg\82M^ySd\81`o\86M^wSe~M^|P`~N_|J_}N`~Sb}M`~Tg\81Td\80We\81Qh\81Tg\81cn\87Ue\81Ue\80^n\87\k\84_g\83`i\84Zh\84bl\87Zi\83Qh\82Tj\84Yj\85Yl\85Rd\83Zi\86Vf\82Td\81Tf\83]l\85Wd\83Qd\82Qg\85Qe\84Rd\84Rd\82\i\83_h\82\j\83Xl\84Zi\84[j\87^m\85\j\84Wg\81\k\86]k\86[m\85[m\85]k\87dr\89x\84\9anv\95^i\87Xi\85Sg\84Zi\84`q\8a`s\8cYj\86Wh\88Tj\85Zl\86\o\89ar\8bXk\88^s\8es\80\98\80\8d¦my\99es\91hu\97Sf\875?P7BS5EW=I]EObERaBN\@FZ^csV_kKP]CK\:EY=DY=EZ=GZ:DX:CY6BW4AW7D[<DY6BZ2AX3>W.:U2E\5F[8C\3?Z1B\9G^<I`:D\8D]2B^:Ib?La<KaLWh@K`9Ga:D_^e\84y\83\94>N`DTd>K`DOeCOeCPhGSeCQe?Na6G`Wb\7fz\81\96-<Z+;]3@_:IeFSj?QhCRiAQj9Lh@PlBTlBRkCRjBQk@RjBTlFUmGWoGRiITkT`wHVoAQlDVoFTnEQlBRkFSkHWnIToHXpAXpCWoDYoBUnEXmJYpIXqIXrI\tJZtE[wD[tN[vI[vP]vPaxL]wN_xDYvPa}an\8aXh\83N_zJ\yWh\83fs\8dTbyI[zM_~Vf\83Qe\82J_{IYyG\yEYyRe}P^|J^|Lb~Sc}Qa{Va}O_}Vj\82[g\81]j\84Wf\80Wi\81^n\86`n\86\k\86^o\86hp\8cdn\89]i\82[f\80^i\85ak\87^k\84_m\87gr\8b`j\84iq\8ciq\8fSf\82Td~Xf\81Xi\83Uf\82Sc\81Sc\82Vh\83Xi\84\m\85`n\86el\85^j\83Yj\84]m\86Td\81Ve}fp\89mz\95dm\8dUh\82Wj\83Yj\84[j\86\j\84\k\83[l\88er\8aiw\8f^n\89]p\89`j\86[j\85Xh\86Wj\86_n\87Wl\86]l\85\m\84at\8adp\89Xe\82Zn\88^q\8e\m\88`s\90Wi\885AR5AR6BTHN_PYjLUfZ\m]^m^apV^iLSbEJ]?K\?K\:GZ=HY;FY;EZ2=T9G\6EY.>V0AX0=V8?Y7AX,>X3DZ;F^5D[3C[4C\2CZ?H^>E`:F`;Kc:IaAOeGViLVgCQf3B^ox\93\7f\85\91KTmNWj;D]7Ga<KcCPiM[lbf{U]r<Ic;IfT`w@Nd1A`2<];IeHWn?Sg=Og;Lg?Ng@Ng:IdBVnDTjASkBTjEVmDSlDTk?PjQ]sKZpGVoCRjCSlLZqKWoFVoFXpJWnCRlFVoDToEXrFZrK\rWfwK[qJZpHXrBVqIWrEUqHWrOYrEYtJZvI\sF[tScyQawM]wQb{P`yI\uD]xEYuN]wL^yPc|N`zQ`|Pb|N_zK`}H]yS`}Wf\80L]zK_|Sd}Jc{K`}Ua|EXwUd~O`}Ug\82Te\81Uf\80^l\83Xj\80Zi\81Xf\81\l\86fq\8a\i\83^j\84Se~Zj\83Tb}fr\8bz\80\99ow\93t{\96iq\91Zk\86Zl\85Xf\81]j\86\l\84Zk\84Vj\87Zk\85Wl\85]m\87el\87`l\84[k\84]l\86fq\8as{\92\92\97¬|\81\9eit\8fjr\8e`i\84cp\8bep\8a]j\84it\8e`n\89Wi\84\l\86Yj\85Xl\87`p\89am\85\k\86Zl\85cr\89do\8agv\94gq\8dmy\92qy\92hn\88^l\88Tf\85Sh\85Tj\85Si\85Vi\85.8M=G]U]m``l]_nUZj[\kX_lUXh]`mS]lQXhRXd;HZ4CWBK\CN\<GY1?V?I\:G[5EZ3BY:EZ5BX5BY2>Z1?X6C[;H]6BW4AZ3AZ9C[9D^7D^?Ia4A\@Nc>KaHUiEPf?Oiht\85N[nIWwdp\885D\/=[JWiLViBPdyz\8eov\835F^2@_1>]BPi=Of@OgEQi?NgBSiCPh>Kf@Ri=Kd=HdBTk@SkBOjBQjDRj@Uk=QiAQkMavCYnGWn=PiFSlFWlM`sN^sIYpHUmEXnDXoFUoL[rKZrL\pR_rKZoM]sJXpBVnHUnG[sJYtIWqBTrHZvGYsEXsH^wJYsM]uTbxL]uEWrE\sCWpFXtIZvSewJ[vHXuRaySaxQayRf}Ue~Ue~J_|L]{Ud{Ra|Ob\7fL^zUd\80bk\84Ma|L`|Kb~Rd\80Pa{Pb\7fTf\81Qd|Zh\80eo\86Tg\80Tf\80Ud~]k\84io\8cTa}_q\89q\81\99s\7f\98|\84 gu\91Zg\84^h\82bj\86^i\87\n\85Yo\85Zk\86Xh\82Yj\85\k\85[o\86Xk\85Xi\84]n\87ky\90ky\92\k\84`l\85Xk\85an\87o|\92u\80\97pw\91Vh\84kt\8bov\8f`l\83Wm\85Xj\86Yh\86_q\89Zm\87is\8ein\86eo\8acp\8cix\92\89\92¬\84\86£mv\8dYk\87Uh\87Uf\86Uh\86Wk\89[l\88BJ\CL[HQaTZiW[lTSeV[iSXcUYfT\jW^kSWgaaqUZgDN\EO_OTaDQ`GP_MQ\@J[6AX2@X4@X1<U6@Y2AX2@X2>Y=F]<EY6AZ4B\3B[1@\3B^6F_7D^AI`1A[9E`@I`NWlP]p7EbEQm`j\87N]w+9X4C_FPg;IaW^vjv\87@Nd7B_6EeESlCTkHWlHUi<Me>NgAOi\g\80<Ng8Ie>KeFSj?Pi9Ok@Qk@TkHVj>PiKYnHWlFWoEWm?Ni@OlFWmDXoN\pS\qGVoI[sIYoFUmHZrFYqCSlS^yXdxHZpMWqFVpBVpH[rFUnFYrD[uBVrEWqFWrDYsGYwFXsRbyQd{DYuK\vDTpI\vI^yEZtJZvRbzP^wK_xR_wOaySaxP_wKazKbyUe{RaxL`yQcz_k\82al\82Qd}K]|Oa|Te}Se\80Rb\7fN`}Oc}cq\89io\89Wc~Xf\7fTc~^m\88py\92Uf\80P`~M_{Qg\82w\84\9b\8c\93ªq{\9aow\93y|\97mq\8f`l\89]j\84Xk\82]k\84Yi\83Sj\84\j\83Xm\84Uj\84Uk\85Wg\81Nf\81Ul\85]l\84^n\86bn\86\k\85[k\82ao\89Xg\85cp\88ep\88ao\84_n\86^k\85Xj\86fr\87ar\86^p\8dfp\8c]q\88dp\88cq\8am{\91ox\8fdo\88[m\87Tj\86Vl\87^n\89Zl\87Ui\88>ET?FT>CTKQfSYkRXhNYgP[gOWeOVgR[iS]l[at[aoAK\@I[CHZFPaEO]GMZEO]>IZ8CX;DX9CV4AZ4>T2?W.;U.;V3=W4C[3CZ*>Y4@Z3C\-?Y6B\:F]2B\?Kc<NdKVjNYn7BbUc\7fV_|Q\w:C`9Fd3=[6B]@Lgov\8bXbqAOfCRgM[mM\qITgCPh=Ie9GbANeWc|JXx0Dc9Pi?SkGWlDQi?Sj?Wn>TkCQiP[pEUjO]qPasCTkDTnL[rIYpIXpU_tL[qM^sS[qHXqH\rGXqK^rM]uJYqGXnCWn@VoFWqARoBWrFYsFZsCVoG[uGXtDVoGVtFUrIYsP_yJ\tK[wEUqG\tQd{K_yK]vK^uJZtEYtLYsJXtN`vNaxJ\wQ`vZf|I[vM_xK[vHVsO]vQ`yN_{Qe~N^z^m\85Rf\80Se~Se\81]o\8bcp\89Xf\82Sf\7fPb~K`}O_zUf\80Ug\7fTh\80Nc~^l\85\86\8d \89\8e¥iu\91p|\94an\88cn\8b_n\8bXh\82[g\80\g\81Zh\82[j\82[i\81Vf\81Zk\84\k\83Vj\86Um\86^m\86Yl\83[k\83co\86\k\84Tg\81]j\82[k\83]n\87`p\89_l\83_n\86]k\85[k\84`r\87\o\88`o\88]o\85[k\86Yk\82\m\85`q\89\l\86Vj\85[l\85Zj\83^j\85bm\87Xh\82EKYKP[TYe]fqX]jT[fX\j]ao]bnX[dV^k]gwT]n[bqPXhLReSReUZiNUeJRbBM^JP`KQb:I\9EY0<U3:T4BY0?W'5Q/<X7E]8AZ4B].@Y1B\1B\/@Y0@[0=[=Id5G_Yc|FSi=Jb<MeJVrERl@Jd;Kg6Ea9Ia5FaANeS_qEThDQgCUiJZlARfBQhAQi:Lf@Rh;KdITrHVo<NhBSk@PjEShCTlFTlCPiCNiUas>NeL[pN\pEUl?Mg?OkCSmCOmN]sXftP_sFWnDWnJ]rGYnPasS`rO_tGWq@PjCSpFUoASoGYrEXrDVrBXqEZtHUtEUrK\w>NnGYtO_xI[sM[rEZtDZsOayM`zGWrIZuFUqQ`vT`vN^vR`xI\uEXuCVqK_xFZwJ[xH]xJZvJXuEXuUc{Xh~Ue~\h\81Yh\81Ob}Tb}Qb\7fH_zQb|Nc\80Qc~K\|Vd~Qc}Pa}Wh\83Sh\84Vh\80Rc|R`|Ug\81[i\82[i\85aj\86`l\85_k\85Sb\7fgp\88al\83Sd\80Zj\86Wh\83Ti\80Uh\81Ug\82Qh\82Uk\82Yi\84]j\84[k\83Yj\84\l\85Ym\83Yl\83^m\86^l\86ep\89an\89ao\88\k\83\l\85]o\88]n\87an\85bn\86\m\86fq\87^g\84`m\85\l\86Xj\85Vg\83Zi\87_k\8anu\90@JV@JU@HVNWeR\jX]jdit^aoW[k^fs^aqV^kJTbPXgV[hY_lbet^_obctbftPViV\p[^rLReDJaCJ[,;T2DZ.AY.>W(8S):V1@Z8E]+<W2?[;F_4AZ:G_:H`=Ka>I`Vb}MZtFPfARh;Kc=HaBMe;Jd@Kd7Ha?Mb5C]AOm^g}BQf:MfFSiJUjHRfAOfDTkFTkCPj?PhDWmJWnKSg:IbAPgAQlARl:HeO^wGThM\tWe\7fERnFQj=Jg?Pk>QjBQlGYoLZmJ[sO_rP]pFYoMZpWarUasOZpNZrFUoCSoBVpBTpFUpBVqEVqK\uBVp>Rr@SqK\vDQsO]uRbxI`yFZtEYsFWqM\uDZtIZxL]wO_vZfyWfyRc{R`wHWs<OoK[uK^wFZuL^xJ\uIYtF]xEXvK]wTd|XgzTe{Th\7fVb~Zd}^i\82Yb\7fWc~S`}Oa~Na~Re\7fMa}Qd~Sc\7fO`}Se}Vf\80Rf\82\n\8aYi\86]h\84Te~Mb}Td\80Se\80\h\83\k\84Xg\83Xh\84Wl\83Wj\83Xk\83Zj\84Uh\83Vh\83Yj\82Zk\81\h\7f`l\86Uh\81Vg\81Xj\84Yi\84du\8as}\94cs\8d`o\87em\83\e\7f\i\82]k\82ho\85hp\86Vg\81dm\83_l\82q~\98ks\90hr\8c{\81\96t{\96s}\93\85\89¡2?P3AR7AR=GWGN^IN\GP_CN[<IV>LZIQbKTc>CT?IX=HWHM[OUf\auP[kW]kY\lZcrQ\kORdCLaJQc:DZ6?W.;V2>X'5R,7T*8V5@[7C[4@Y5D^/?\6C]6D\6G`=JbW^ygq\83;D]LRmFRg/=X>Ga?Jc:I`>H`=Lc9F`?JeOXqR^tDRfAMdLVkLWjHUlJUjBRgFRjDQfAMgGVoKZn@PfBRk?Rm=Qh;LeLXpEPf[f~_k\87MYxTa|AOj9MjKXoKXnIVn9KjM\qXcsN\qK[qU_s\gwM[qHSoQ_xRaxDYp@Sn@TlDVoKZrBSo=Om;Ki@UrH[vGZuIWsKZtP]vFZvHZuKZuIXrJ\vL\sFYtH[vPczOcxS`vRbyJ`xDUtM[vYg}Wf{N`wM`vN^wI[wK\wFWuF^wJYuQc{OaxRb{\h\81x~\93s{\90rw\90`l\86N`|Pa}R`{N`~Pe\81Oc\7fSc\80P_{ty\93hp\88Vh\7fRc\80Mb\80Pc~Pe\7fOe\82iu\8dv}\97Vb\81^n\85\n\88cp\8aWj\81Th\80Ym\85Zm\83Zk\84Wh\83[i\81[i\80pz\8dy~\96kq\8eUe\81\h\84Ta\80Qh\82Wj\81Sb|s~\95\8c\8d¤pv\91mu\8elw\8ey|\90\7f\83\98rx\8f\81\82\95\88\8c\9cy\80\96nv\8ct|\8doy\89v~\8cks\85jv\8c9DQ4AQ4BR:CU;DV5?P7BS6BR5@S9CU<GW>IY=GW4@S;CV:CV8CT5AV=K]DKZBJ[FRdBN_FPbEM`CK`BJ^?H[2?X=H[0:T8A[6AY3A[<I`4C\:A\7BZ4A[2?[9F_9IaGSfKWiDRhGRiCJa/:X4E`4D_1C^8Ia9HbFQgCPe<Md=KgCNdANc@OfHRjJ[lHVkKVmEShHUkCNhGYlIXmDUl9LeBQiBQiFTkGVn=GaY`{bh\7fFXrRg\81W`wESiK[oMZpDVmN\r\etO]rIYqESmJYpM]sKUnFXoETnI\tDVo@PkEVpCTpBToDQlAPmCXqGXsCYsAXrHXsEXsG\uGYtEYrH[vKZuKZtOZrJ\vIYrS_uM`xJ[tSayKYuCSpGYtM^wXi\80BQqI^wI^xBYuEYsIYtCUsDTsLayN_{Ob|Qd|lw\8bqw\8ehq\8agu\8cWg\81Sf\7fXd}Sc~Tf\80Pa}Tf\81Wi\85\82\88¢is\8aPb|La|H_|Tg\81Zj\83Yh\86Xi\83Ug\83P\~in\8cPa~\7f\86\99hn\88Vd\80Vh\82Yi\80Yg\82Rf\82[i\83Xj\84Wj\83[l\87_m\86Xh\83Vc\7fVe\82Ye\84]n\83x\7f\97\88\8f¤\98£¶\95\99®\9b\9e¯\86\8c¤y\7f\93w~\90pw\89v\80\8epy\8din\87`q\86Rf\81Vi\80kt\87dp\8cq\7f\986DR5CS8BS7?Q9AQ1?Q4@Q5BS6@R8BT6?S/;O7DW6DV;FW:IX5CT5=Q5@S8HY6EZ.<Q1<R7BX8BW<I\@J^<DW7AY9E\1@Y2<X8D\8D\9F]:Ha>F]<F^2?Y:F_=Kd8E]?NcDQeMTh=GaKPi=H`>MfGQgOVkMVh?LeEOeAMe:Kf8Ke9JdKUhHVj=JeCQhLWlGSkHTkIVlHWnJZnKYnO[lGUiHTjKYnIXpNZvDOhM[q^fyATj@RmW`tU_nESiQZoP[oSVmL\oM\oIUlGVmFXoEWpFWoBTkDWnE[qBUmFUnJZp=QnFSnKZv?SnDWrIWrEXrDWrJ\uCUqL]uQawF[sEXrGWrJ\uK]wK]wHXq]fyLYsH[uBWu;MkOZuK\s[hz\h{S^vM^vG[wM^zR`yHXs=PoKXsS`wSbzJ\uTdyUh}^j\81R`yTf}Ug\7fM`}O_}Xh\80Qb|T_yUc|L]{an\86cq\89Vh\84Q_|Ua}\k\84Sd~Pe\7fSb\7fL\{Zi\88sx\8fRb\7ffr\88sx\8fZe\81Vf\7fXk\83[j\81al\83Zh\84Tg\82Th\81\j\82Yj\80Wh\80Ta|tu\88~\84\92\89\94£\9a ´\91\94°\80\81\97\86\8d\9d\91\99¯ip\8cSi\84^o\86fn\89_k\81[j\83`i\82`l\81_q\8b{\86\9b\83\8b£\80\8c£\85\8b\9f5BR7DS4BR.;O3>N+8K+7L3;M3=N,:N/=P5CT:DV:DU4:Q:AV5BU:EW8BU6DV@K^=K_:CW8?T.9Q/9Q0?V<EY8C[4CY:G^6D\4D]5BZ8D[6@Y4A[7E_/=Y8B\4A]5C]DMb?K^>Lc;F`?LfJVgCOfQXhOYiJSd?Kb;Mf;Ic:Hd=Ng;Kd;MfS]oAJbAQjIVlKUlKWkGVjIXmIXnGWnDQhVcsQ^qJYoMYpS`xSbrT]oT[mCRhLYnHVmT]qMYmN_oARhNZtN`pK[oGVlDUmFUmDYoIXoHVnGWoGVnFQlFToEYpFWpFToZh\80LZsDUoK[vFWrJZuKXrF[sO^vJWo@ToFVrIXsJZsM[vFXtDXtQaxI]vLawE]wJYsG]tMey_kzbkySauGZuJZuHVuCVuBRoFUrR^uUawI]uK_vSaxJZuWby_j\83[h\81[k\81I\zWi\83Uf\81L_}Sc}Rc|Rb~Xh\82Xi\81Xf~Rb}[h\80\f~Xg~Sg\7fRe\7fVd}Wj\84cs\89Ue~Zd\81Zi\82Uh\82Yk\7fYj\82Tm\83Xj\83We\83Wh\82Uh\82Vh\81Zk\84et\88y{\8crx\8arz\8c\88\91\9e\98\9c®\80\84\9atv\88u\7f\92w\83\9adp\88ai\88em\88co\8dqx\94kr\8b~\82\93\81\7f\93\82\83\98\89\8d\9d\89\8a\9dmt\89er\89:DR7DS-?M+:K.;M.<N0=R1@T-8N/9N2<R:ET9DT3?Q5=R8DX1BS4AT6;P1=S?J[?EW9AV5=T+8Q(6R'5N.?V5D[;F\9G[:J_8G]5D[7A[.<V(;V4>Y.=Y(:W5C^3A\APfCQd6E^5C]2A^OYjAL`=Nc2C]@RgIUe=Kb;Ha?Kc>Ne5Ha7HcGUiGQfCQhDTjBRhEQiIVkLWkMXmNVoLUnMYoJ[oN^oJYqXatS^qQ_qQ\nS\oZ_nY_oWbsIZnIYnIUlFSpO]pGSjEQkFVmJWoGVoFXoCXnFVoEWpCTpBVnGVqBSoDWpGYrMZtJYqHYuDVrFZuIZtP]tHZuDUoL^wK`xI^wP]uHYsEYsL\wUcyRczS`wN]uCSqFXt@Qp[j|ks~XewS_uT`tU]t_g|sq\83oo~flzZdxQavZgzXcyO\uUax]j\81_j\84eo\86N^{BXwL[{Sc~Rb}Tf\7fQg\80Lb|Tf\80Qd\81Ob\82Rd~Vf\80[h\82Xi\81Mc\7fNc~Se\81Qb\80Wh\82Zn\83\n\83Zi\81[j\81Sj\83Vl\82Vj\83Vh\82Uf~Ue~\m\83jw\8fq\80\95x}\92\83\89\9e\81\84\98w\7f\8f\84\8c\99qu\89Yg}Qd\7fcq\87\8a\94¦w{\99x~\90ou\8dw\7f\95\84\88\9c\8c\88\99\8f\8d \83\82\97nu\89ft\8bdj\82\k\81=GV<FT6BP4=O9DS/?O0=O0=Q+8O1<Q0<Q2@Q2>R4=Q8BT4@R2<P:@S;CT2?U:D\;F[7BW2=T)8T):T(6P,9R0<V6AZ<J]9F\=Ja<I];F\6B[3?[;E^3C]5F`7F_4?[CPf;G_?McDOc>IeP\o;Ha:Ia5D^EViFSdBOc>Jb@Qg?Ke;Kd;MfEQgDRj?MhITkAOgCPiAQiJXlKXpMYmN^qSZoQ^qR`qSarUbrR_oSctSarM\nYfuYaqS_pLZoM\pHVkDSlBPiGUmDVlIZoEWnLYmKXnCWmCVoBRmCRmAXn@SnEVpBUl=LjFUqN]sFWpEXqFVsEXrGYrLWsHYsM[tM\vIZvHYrFXrH^xQ_wSdxM\tL[sFUpS]wYewUaxclz]gxQau`izihzxn\7fup\81xr\81\7fx\88vt\84bg~`gydkyaf{Y_uSbyJ\vP^zdp\8b^l\87BUvBTvUi\80\j\83Vg\80Ug\7fRh\7f[m\86Oe\7fQe\80Xk\83Xf\82O`\80Q`~Q`\80M`\7fNb~^k\86aq\86[l\84Yj\81[k\81[j\82Zi\81_i\80Rc~Q^~ao\87gu\8bt{\8f}}\8e\80\80\90uy\8bpz\8aqy\8b\i\80w|\8f\90\92¨y\81\9b~\83\95\83\87\99\96\99©w|\95hr\86mw\8apx\89rw\89|\83\92\93\98§\8b\88¤ko\8d^j\82nv\8erz\92/>P6BQ2:M/9L3?O.:M,:L+:P+:O*9M1;O.=O1?R5@S3=R4=S5>P:CR6DT.;P3?U<F[AHZ7BU/9R-8Q,9S1>U-9R5?U>FZ>K]<K^AK`=J_?Pc?J_@La:E[<Ib>Jc?Kb>J`?H`K[k>Nd;FaKYjANd@Qd=NdFTfISdHTg;Ne<Kc;Jd:Lc<Kd>Ke>Of<LeMWlS[nITjARiARgCRhETiLYnLXmHTkEVlR]oN\pVbqWbqVbqQ^pP^rN^rP^pHUmCQhEWoEVnDOiCTnGVmEVmIZnJ[oJWnDUlCWo@QlAQkAPl@QmCTm;OlGVoK]tJ[rEUlFYpDToBQmCTmP[rM[tP_xJZqCUn@QoCTp@UqL]uScxR_vL]sS^sWcwR`tO^tW`qS^schzji~zr\88\84u\87|t\86}x\88\7fy\8b\86\80\93pp\86po\86on\82xr\83qt\87`i~VbxSc\7f_l\89_n\87>Pr?PuVc}Rb\81M`~Oa~Vg\80^n\85Rd~Og\7fRe\7fUf\80Se\80Ud\7fTc~Oa\7fVh\7f]m\84_i\82`j\84[l\83Wm\82Tg\81Yd~Sa|Yh\80jo\83~\84\91\7f\85\95\83\81\91~~\8b\80\80\8drt\85\j\82z\80\91\81\80\93\88\8d¢£¤¼\88\8a¢\95\99­~\7f\91uu\85mu\88ix\8anx\88nx\89`n\83r\82\95\8d\94«u{\97ks\89]i\86\k\86]i\831>M+8J3>P/=M0<O0;N5?R5AT2AQ0:M+8O2<P7AV8DV8CW5CV2>P9BT7@Q2<O;EX;DXBG[1@W.<T/=U3BW0?U3=V5BV=DZ?I]@K`9G]2BZ>La7F]ANbGOd:F]7C\7E`?LdBJ`9Ga<Jb=OgJYiERd@Od@Kb8F_IOdFPe:Jb7Ha=Kc7Ia<MeAMf>Ng5FaJRhQXj=KdARfAOgBNg:IeFPkCSkESj@PgIWkM^sUbqSapQ[lOVmDRjBTkBSjGTjGShFTmGWoCOjESnBQi@OgBNhCSlBQk?PjAQl;Li?Nk@PlEUo>MkGUpZcxJXqFSlLTmEUn7Ii?PmR]sQ_uO]tGYrK\rGVqN\ucgz[`ufn{`jyikzvq\81nm|bezcf{ln\83qn\82tt\87{v\86zv\85\8a\7f\90\88~\8d\80u\88|u\85zu\89\80z\8ett\86fg|ik\7frm\81\7f{\88\80z\89sp\82ov\8d`j\83mu\8aZd\85K\\81O\\7fPc\84GYyZi\80]g\80]h\7fWh\7fPd\7fQc\7fWd\7fWh~Tc~Qe\7fRd\7fWh\81Wg\80Wf~[l\85[m\83Rg\80Sd\7fkw\8c}\83\9a{\7f\90wx\84nw\87sx\8cvu\82sz\85y{\87ot\84q{\88u\7f\8f\8a\8d\98\8b\89\9av|\8cv~\8dq{\8cgs\84`m\84Zl\83[l\81ep\84dn\83^l\82We\81Uf\82Xh\81Yh\80Qb\7fYi\84Pe\813>O/:L):M(9N.=Q*6J/;P2?Q1?O)6N+9P7AS7?R4<P1=Q;DT=HV8DW2?S7AR<FW4=R1:R3BX.<T.;Q)5N,7P8?V2@T0:T8B\9E]2?X5B[8E[8E^>I]=LbCPf>G^9C^>Lc6F]6F^9H_FUjOZkEPe<Jd8Lc3Fb=Nf=Nc:Ld6Jb9Ia5H`:Ja<Jb?LfDQhCSiIWiIRhFRgEUh@Qf?MfBNf@MfIVnETkM\oSaqW`pQ]pEUlLUmKVkHXkFRjNZmDSh9FcDPjBKeGQgT\tPWsU]v_exjg}gg|hfy[[sf_v_bvIVlJRnTbxMXoKUm`fynm\82go\85^bydewdfz^dy]by`cvffy`gz[fwln{poynp{sp~\80v\89\8e\80\91\84}\8fuo\82vq\84tt\83~t\85vt\85rq\84yo}~q\81yp\85vt\88\84\7f\8f\88}\8d\8b\82\91\7f\83\8f|~\8ftn\86yk\82}m~\83v\85\8bx\8b\8ax\8d\8e\86\95\95\90¡\86\87\99jt\8dQb}Xi\80Ia{]m\81Ud{\m\83`l\80Ug\7fVh\81Yc\80Sh\81Vh\80Ud\80Xk\85Wf\82Zn\89^n\87\p\87[i\83ir\87lx\8ay~\8e\80\7f\91vz\8bqv\88|\83\99z~\8fty\87u{\87r}\88{\82\91\82\8a\98|\86\9a|\7f\90{\80\8fly\89Yl\83Ui\80Uk\80Ue\81Tg\82Ud\7fRf\80Vj\82]l\83Yj\80\k\83Xe\7fco\86^p\86Tf\80Sg\82,9L.9L)4J-9N1=O-;M/=O2<P/<P0>S3>S9FX9BU0=Q+:Q0;RADW<EU9EV;DX:EW5DU5?S7BV.<T+:S-:S7F[4CX/AY5CY2@V=E\;H[6G],;V7F`?L`BQd@LbBJbBJb9H_?PeFQePXlOZkEPdIPc;G`?Kb;G_BLcANc:Kd<F`FQgHRgFQgGPd=Ld@Ne:IdS_qP_q=Mf@KdGQiBMe>LeBSk?PiIYoLYoESkN\qUauT]oQ^qK\oT_mV^mPXkSXmX^vdh|ji~oi}sj~xs\89yx\8c\81w\88\89\84\97~x\8dxq\89vs\89rp\81op\85oo\85zs\87op\83gi~sq\82ts\80un\81xp\82vn\7ftk\7fil\80uu\87\7f{\8cvt\8auu\87vs\86xt\88vt\86\81y\88}r\83ws\86\80y\89\83w\88\97\8b\98\87}\8duq\85us\84~t~{u\83\7fu\84\7fv\84\7fz\87~w\88{v\87\80{\89\7f|\89}x\89oq\86ns\87sr\86nk~yr\81wp\83}p\83zq\84tp\84dk}Zdy]j\80SdwSbwSbyO^wH[xMb{Wc|Rd}Ti\7fYj\83`l\84Vh\81Te\81Pc\80Sa\7fVf\82_k\84bk\84[i\83du\8bbs\89Yi\80_p\87]j\83q|\90\8b\95£~\87\99{\81\8f\81\82\8ez\82\8ds|\8aev\8aiv\87dq\85Xj\82Tj\82Wf\82Tl\87Si\81Vg\82Td\82Uh\82Zh\83[m\83cp\83an\83cq\8cbp\8cfv\8d\86\90¡\98\96ª\9a\99­8BN=ET2?P/;P7?Q0>O0=N4?Q2AS3=R,9P6BU7AU5@U4CV/AU8@T7@V9DX@HZ;HW<HX7EZ9FY;G\2@U3@W>Ka:AX8C[;F[5BX>J^EQa?M`;I^8E\0?X2C\5AY0;W4B\1>Y6A`<HdRYnKViCNfLWlTXhV\hNVlW`wRXkY^qabsdcwhgvfdta`sOSkMVl;IbEOjFWmGWp>NiLXmAPg;Ng?Lg?QiJYn=Gd9Gb@TnN[oW`qP\pVevnw\84beyoi}nm\7fik\80qp\81{t\86oj}pm\82zs\88yu\8a{x\8a\86\86\98mm\83lh~qh~lh{lh|kl}gl\7fln\82il\82pp\83uo\81xm\7fxj\81zo\80yo\82uo\85pn\82ss\84vv\89tx\8art\86uv\89xu\86\84|\89\85y\8b~v\87|s\81zu\85\86~\8c~t\86lp\81ty\85|x\83~y\85\80v\81}r\82{t\83yt\85zu\84aiz[fzTbxJ^wJ\tL`wQcxWdxXcz_i}Zg{Qcw\hzTdyN`xO]tL]vN`xM]xM^y\fzOayZfzWc{Qd~XdzVk\83\m\85Uf\80Zl\84_l\85mw\8c^j\86Th\81Vj\83Yg\82Yl\83\m\86gp\83uz\88iu\86kv\85x\7f\8b{\7f\90jp\83Wh\7fTf\81Wi\80Qg~Te\80Ud\7fYh\82Xk\84Rf\84Ug\83Oj\81_n\84bn\86Zk\82`p\84bn\84]l\84`o\86Xi\83l{\91n{\92}\7f\942AQ6CQ8FR3@Q6@R4@Q/8N5>P/<P5;R/9Q2?T4@S0;R4@U4CW9GY7BX:FZ<EX<HZ;GY:DY>FX?K^>I[6DX5CZ5D[4@Y0<V9B\<F]=I_DNc>D[2=X*<X4@[6D\1@Z.=Z7Ea4A^2>]RZkPWgIThS[njgqbclYauuy\90pkwohsgepe^riash`n_\q`_s`br^_uij\7faet_g}X_rceteh{dfx]^u_bxV\rX[q[awbezeexbbuih}gg{qr\86\7f}\8ext\86{r\83np\7flq{mkwhdwjhyg`rkdxtl\81tn\80nj|si\7fvh~uh|rfxkhvekw^hxmp\84qn\82rl~pl\80to\7fsl\7frk}rh|mg{wr\85xv\8asr\84tr\85zu\86\80v\85{r\81yt\84\81x\85\87w\85\8a~\8fxr\82ggxak}rv\84{w\85yv\80djzWbvajzai|WeyG]tJ\tQ`vVbuP`vK[sP_wT`xZeyZgyVbuRcyVf{SdzH\vK\vH\uK`vH\vN`wWbyXcy[i|Re}Te|N_yMb{Wf|Xf~\l\81cq\85\l\83\j\84\l\81Yi\83Uf\82Wh\7f]m\82bq\86r{\8ejt\89hr\86\j\81Vi\81ep\89am\87_m\84`o\87Xk\85Vh\81Rh\83Re\81Vg\82Sf\7fXi\82Ti\84Pb\7fPe\80`n\83_l\82]n\88_r\85an\85Yg\82Nc}Kg\81_i\81(=N/=O7DQ7AQ4>P2<O5?R2;M.<Q0=T4CV9FW9HX3BU6@T=FX?H[5BY4AW6BX<GZ0AW@I];GZ7D[:G]8EZ9D[=I]6A[4AX5F\8H_3A[6C]5@Z8C]4B^-<Y3D^8Ia5C]:HaBOe<GaS[mP^nIXiFUjPYkaaoX^rqz\90jjwgfpeaqjeupduqcui_tdasX\s^c{fm\7flo\7f{y\8dZatbfwkh{lh{dfvX\p[^ukh{gg{jg{abweexehxgfuaavlp\85rk~tq~zv\84zr\7fskwnl|tk|ugzqew{p\84xs\88xo\80yp\83vl\81wk\81qi{ok}qn}kl|oo\81vo\82tj\7fsi\7fzi\7fzl\7fxn\80tm\7fqj\80sk\81\81u\8a\88w\8a}p\84\83o\82\90u\88\89x\89\87u\86tm|cdw\84\7f\8dhn~^jyT`uoo\7fsr}oo{djzQcuWfyN_uP]rN[s`k|cjydjx_kx`k}^fzT`vT`xXgx^gzTcxVf{R`zQc{Td{[i{RawL^wQdzN`yR`vNbyMaxUb{T]xUayYh}Zi\80Sa}Sb~Tj\81Yk\82Zi\7fVd}Tf\80Zj\82Wi\81Zn\85[o\87Pi\82Vn\83^s\8car\8a_n\87[l\85]n\84^n\86Ti\83Td\7fXg\81Vh\81Ug\82Rh\80Tf\80Th\82Oc\81Uf\82\j\83Zk\85Uh\84Sh\83Lf\80Pe\80Mb}Ma~aq\87.;P5BR/;M0;L.9M5BT4FT2@Q3>Q2AR/=P3=Q5DV8FY9EW9FX;IZ=I]CH\CH];EY,<V.?X7BYBL`AK^8F]=H`>K^3@Z@Mc<Nb<H`9E_3E^;J_<G^6@\.=Y.@[3C`9Hb?JcHVj<GbAMgQZlKWiGXmQ]nO\mV]nhr\89clz]_nkexoiyidvhdvfatecv[_vXazoo\84sn~ect^axfg|pn\81gi|fk\7faeyW_sW^q_cu^`tffwnjyddv_asgfykp\83mk~ko|lp\7fut\83\81w\82\83\80\8b~u\86yr\83xq\81\85\80\92\83~\90ym~sr\80gl\7fif{lgyij{gfxtl\80|n\81\81p\83\80o\83\7fm\82\80m\81\80n\80{o\80|o\85xk\83\81n\85\8aw\8a\98z\8b\8cu\87\86t\86\8ay\89\84u\85tk\80V]tI[qYfwSdxTfx\gvahz]hyej{jkzV_tWdw[du_fzbfy_hyij\7fehz_gwel|ZhyWfzUdvTbv\g{[fyQc{Zh}UezTdydl~R_xK\uQ_wQayOazR`xQcvH`xO_wIXrTc|Zm\81Xg\81O_|Oa|Pc~N^yRbzUe|Xj\7fYk\81Rf\83Nb\80Vi\83Wf\80Tg\82Sl\84Rj\82Ti\81Xl\82]k\80Wj\81Ve\81\i\82Zk\84Yh\82^h\83Zj\84Vi\82Yi\81Yi\83Xh\84Zm\86Sh\84Ui\84Qd\81jz\91|\82\9bYi\81\80\90 3<M4?P2?O*7I1<O3AR.>S0>O3?Q+?Q*;R2>R2>S4AU6DX;HY<GW>H[BJ\CI]6D[7G]5F\8B[:F]6D[7F]9H^6A[7G_AQe<Ka;Kb>Kc=J_6D]4Ga.D]-A]7D_DPgESh=LdPVkKWj@PjOYmNZjFViMYmK[mOZkXcw]euX]oZ_qL]nJXmYatZ_sbdw^ex[_znn\81or\82`exhe{gfzchz[_qdl\83_g{Z^q^ezgiy^dtecuxn\7fwl{cduaawlh~vq\84ml{ko}mn{djxagy_fyWbtT]r`dydiymlycfuJYmJZnL\qJ]sL_tQ`thh|rl\7fih}kj{dgyaeybevdezWaxkh~ji|mgzso~vr\81st\7f\cvR`tUdsdkzTcw]gxajy`ly`gw_ew^hycjzdi|YcwScuPbwN^v\ewbhy^dxaj|VewYgzZfyYcvJ[uM[tZbxZbz_l\7fhn\84im\7fUbxJ[tWf}`k\80\d{TczQbzTcyS`wM^v@VtUbyS`vSavTd|Yd{Vb|Sc}Xc\7fZh~Yj|Yh}Ue\7fYf\84We\82_j\83[h\83Ud\80Ui\84]m\84gr\86ds\87gr\86\k\82Vg\82Vf\83Sd\80^k\83Zl\84Sf\81Xj\81Yj\83\k\81Xh\81Vk\85Wn\84Wh\82`o\86{\86\9bjs\8c\91\9b©1<M8CS7BQ4>Q5@Q09N+7K2=O4@R*:O-<S0=S-;Q4@U5@U7BV=JZAL]CM^8CW1AY:E];G]AK_:H[4F^7E\:G\:H\;H`:Kd:Jb6G`7G_:D]7A\9Fd3A_7E_CNgFSj=Ld<MfDPhKVjHQgHSkOZnMWjNXl@PhETjDRjDQdHWlEUk<RgBOf>Oh=NfLUjK^pK[pX_sS_pT]o\_uV\rW^s]`rfj~X^sUYn_ev\aqX^q\asccunfw\duT_uXavcl\7fdfwaexcjyP]qGWqARl>Rn=SlARlFUogl}XauV`tP`uFUpEUp@NmAUq>NkHUoDVnKXoL[q?TlBVnGUnCTkJXnU_qaetejv\dtXcwH]rM`tfnzel{Yezdk|ekyVfxXfwajzaixdjwbk{ck|^gwbj{Wdz_gzck{al|SdwTbuWbxN]sFWqBWuL_{SbxW_uw~\8f\8b\8c£{{\8bYe{SazVc{z}\91nq\87Sav^i}ku\85Xg\80DTrJXukt\8b`i\7fVgy^ezTby`k\7fQ`yP`zit\8ams\87^l\81J]yUb\7fVh\82Uj\84_j\84Zh\84\l\86bt\88gs\89fo\87[o\86Xi\81Vg\82Rc~Zl\84Sd~Rh~Uj\83[k\82^h\80Zk\83Zk\83Yi\82Yj\80Yh\80Td}ds\85nu\8bcq\850>O6AR;FT9FU2AQ,9M+8K7AS5?R2>P1@R+6M*8N2;S8AT;FX:GY9CX>K\9GY9F\=E]4B\>K`@I\8C[7G_<Lb<H^9H^3D^4E_9H_;Lc7H`:Ib?Jb?IeBLdBNe:IdCSkERjBOgU_sRYm@MdIUnGTiHUfARiEOe=Og@RiBRh@MeFNg@Og3Jb7JdDNgGVj<Lf@QiETiGThDPgLWkJZnIXnSYnITiJTjJUjHWn@OhDSkQ^rS]oQ^oLZnIWnFYnL[q@QkEYrIYpFUmL[qM_tR\qRcsXdvnr\85qu\86ou\83]duXbxV`xU_uSavS`tcgwZdu]fwZdvP_tVbsZdsafwdftpov|uzyqyroyfmydmvemyis|elyrs\83wt\83ls~^k{`k}\i}]fxbkzfm}lp{km}hm~ln}am|bm|cm|Tashm|bj|[gwM\sTdz\k\83Qd{M]uYi}t{\90\8a\84\96vy\8eco\84Uc}os\86w{\8e^f~sv\89z}\8ehm\83KZvWa|ov\89ku\88or\88ci\81GZv[h\7fdp\87_g|lt\88\80\81\98cn\8dL^~JWxL]zSa~cl\82`l\84Wg\82Xk\86Pi\83Te\81[k\81dn\84\m\86Wl\84Yl\84Sf\81Ym\83bp\86hr\85z\80\96ry\93`j\81dm\85ry\91hp\89bs\84^l\82dn\85\m\832@O0>P7DS/>P.=O5AR5?Q4?P8?R3@Q,>Q.;O3=Q-<Q3BU7BU6BX7FX7EW:E\?K^AK_>G]DOa>Na8D]6F^<L`9E]3A[6E_<Md@Kb9D^2Hb/B_6A\4C^;Gb?Jc=HcIVhDShGRiSaqO\nIWl9LfERjU_nMZkLWjBQhCSkCRh?Ng>Mf8I`;LfGYlLVl=Kd9JeKSiKTpP\rNZoH[oGXnP\pQ]pFTjKYlLZpNYpKWoUctR]pR[oU_r]asS^pP_tIVnJWmYhxUdwchtacr^gv`kx`l{lm~so\7fyz\89\80\85\96ww\87qm~nu\86fo\80oq\80kk{`esep\7fci|^fw]hwdguafxmozuru\87|{\83z\7fnnynnxvrxww\81mp{msylu\81cn}gmykr{am}fn}ejz_j|gm~nn~hn|Zj}`l~ho~fn|dm~em|hm}\84\7f\8ey\7f\8cclzYdxQ`wM^wEXsEXuP^udl}{\84\94ux\8dkp\85af\80`g}z{\90ls\8arx\8f\81\80\95qt\8cSc{Ve~mq\87pr\86vz\8f`h\8aHXz?RuTg\81nu\8avt\8apv\8fs\81\9b[k\8e;OuM_|_k\81`k\83\k\83Xf\81Pf\82Ul\84Tj\84\p\84bq\85]k\82Vl\83[l\86\j\81cw\89\86\8e sz\8dmu\88cp\86}\83\98y{\97x\83\99mu\8eao\85^k\82Yi\81bo\875AR9@S8DT.:L2;M=ET;HW;JY9BW6?R4?S6AT0;O.>S1?S5AU9HY=K\<HY5BX4BY5AX4?X<E\>I^8E\7B]7E]6H^2B\3B^>Me4E^6B_2C`1Dc2B`1AZ8FeBOhGRgFTgDViJVkS_qR]pO\nAPgFPj_dsNZjASfGTkNZlBNhBOiBSiHRfR]rOZkEMc@HeKVmT]nOWmOWlRZmP^qO[pR[pP^pLZoQarZapT[n[asW^nQ[nO[oU\p\bq^euXaqV`sR]rUatbixonzpkvnm{os\7fsw\83ru~tp\80kn\81iq\84\90\90¤\88\82\92rv\84|~\8b\83\84\94\89\87\95\82w\83ww\88u|\8esw\89su\85np}nr\81nm|xs}|uy{ryjlynt{pt}^cuVaqhr}mt\86tt\87\czWdveo|gn}gm|di|in\80gm\7f[fzPbwUgxal\81in\7fZg{Tdv|{\8c\89\86\98np~do{`j{cn\7fJ\wJ^wVh~Zg~bk\80fs\86lq\85cj\83dm\86ho\86t{\8ehq\89qv\91\86\87\9etx\94aj\86Ud~pv\8cxy\90tz\95x\7f\9dPa\885FoP`z^l\81vx\90qu\92v\80\9ddm\8cSb}Yh\81]n\81en\85tt\87or\84`p\85\l\85`n\83fr\88`m\86hp\86fr\87mr\86jw\86dv\87bs\8b_o\87gw\8dt\81\98ly\92`o\89\m\86`n\84^l\87er\86ev\87fs\88SZfVYdPYgJS_BKW7DS6DT8CV8BT>GZ8EV8EU7?Q5BS2@S@I[?HY2@U:H\3CX*:S/:U2A[2>X0>X2@W0=Y.?[0A\3C]0A]2D_0@\3@_;IfAPj4Ca=KdKRkQ[nFUfKXjHXhGXlQZm[_o[`lJViALfNVkDQhFQfKUkIUl;MgJTkOZnNWjKTjEQh@NeJVmQ^oQ]mNXjV_qZdqMZpO]oO\oM^nK^oUcsflw_gqbfsjjtmo{afvfhthjuno|alybk{agv\fwpq}pqykmxgjxchx]ixSbuQbvUbvcn\82mu\85do\80`i|bj{fn~sv\84qv\86sx\88x}\8e|\7f\8f}\80\91{z\85]fs`iy\ivbixffxtozciw]hwdduVasq{\88\80\7f\92\7f\81\96ks\86U]tdn~gm}gi{agyal}bj}Yfxgo~ip\80em~cl~_j|cj|\88\83\93\81\80\91yx\8ban\80cn\80ov\85Vh{Vg|Vf{Ug~Vb{dh~qv\8ajp\86_l\83ir\8apz\90ip\88mx\93\85\8c£\80\88¤it\95Ve\83am\82y{\94u|\99\86\8a¡Yc\85JZz\l\81]i}lu\86ku\8cnz\91it\89Xh~[o\84_l\81cj\81go\83r|\89fn\85Xh\84cm\87Uf\82Zi\82Ym\85lt\87qv\87tv\8auw\8cms\88dr\89gv\8emz\92lv\8adq\86eq\8agt\88`o\85Wi\83eu\88|\83\99SXhPWdQXeGS^FMYIN[DLYDP\JQ]MUb=IW7EU7EV/?R1@S@F[KQc=K[8H^@Qf9J\4@Z:H_;H`1>X3?X5>Z0?[2?[1B`,B]4D`ENgBPeFRiS[nLSjQYnM\mHViGUgNViS\oQ]mWbnlnreen[crBPfJTkO^oYfsV]lGSiFTkLYmV^oZ`pV]m]cr[brT`nbhrcjuahr`htcisWbsZfu[iq\ir]htdoyhmxcitbjwejwTaq[cu[bsP]qUauK^rDWpJXrOawSawWfx\hwYhvSauXcxYexWhzQ`v^g}_jzdl|dp~cn{am|al~blz_kybj}bl}ho|nw\84{\81\8dmu\84M^rYcuYfxciv]dwYatahyYau\84\88\95\91\90£z}\92rw\8bos\84dm{co|bh|fj|_j|ag}ck{ry\88\85\83\91nr\7fnq~cl}^k\80\81\80\90\83\7f\90~\7f\96rw\8a`l~\h|an\80Xf|Pb|Xh\80Pa}Zf\80mv\8bmu\89fn\84_k\84qu\8evz\90hq\8av\80\99}\83\9er|\97]j\89fr\88nz\94gq\8enu\8dir\87kq\84am\84Zi\81`l\83\k\81Zg}\g}`i\80_m\83Zg\80bl\85ks\87iv\85fp\86jv\89_p\89Yr\86at\89_m\86iu\89nu\8aor\88kp\86nu\8afq\88br\8ciq\8aps\88ho\88hu\8civ\88_p\86ev\8aju\8afs\86MQbMU`NW^LU]IS`HP\GN[BNZDN[ANZ9ET4;O:EW9DV5EX4CV?J]LTeFN_DOcGPe:IaFQa@Oa;E\9D]4D_2D[1@_6E_6IaKVhR\mJXlAOeLWjHTf?Pe=NeBMeMVhEPgT\r]cqWdoZgtXapWdr^hsV]mVds_ju^er[etWcuT`p]gsdkt\do_fsafr[cqZdq]eq]as[`r\fv\et\_q]duVbrYet`guafv[fwU`uZeuUctP_qJYmR\rR]rG[qKXpNZqOauT`wVauUdyYf{TdyScxUdyYcySbwUe{Xg}Vb}Xfx`nzSdzZh|XhyYj|co\80nu\82jw\80go\80iq\81js\81YexWfx]l~gp|jp|dl{^iwVfvfs\85it\86rz\8egm\7f`k\7feq~[hyVe{aj{bm}hr\82io~ln\81yz\86su\80qt\83gr\82hr\82{~\8d||\8fsw\8cuy\8dmt\87Zg|SczO^xTe\7f\l\82_m\80ah~hp\86^l\83gq\87dn\84fq\87is\86ip\86lq\89jq\8bcq\8ahs\88^n\86`o\89dn\83kp\86hp\87cl\85ir\87kt\86pw\8ar{\89v{\87{z\89y{\8dx}\8dqw\88vz\8bvz\8bgu\87rx\88xz\8bnw\8cqy\8cox\8bpu\89ov\8arx\8bsw\89rv\8aot\88vu\89pt\89ux\8ajp\87fp\89gu\89nv\88gs\89ny\8bw}\8bu}\8a=FVFNX=FR?HXMYiDP\8?P=FY6EU8CSAIY9DT:EW<HX3@T9EY@K\AL[ERbHQa;G[@J^>J\7C[8FZ3CY1A[7F_<Kd>Lb<Mb?Lb>Kb<KbFSfHTfFReKXkJ\lOZm]`pW\nNZnS\pR_qZarWbqYapZapMZkQ_o[cqS\pO\oKWmJXpO\qVaq_cp^er[cqWapY^rT_sV_q[etWfuMZnPZqR\rQ[pR_qUauS^tN_sO]pV`tIWpRavZgwOdxM`vFWsO^tN_tKYqL^tGWqP`w?TnHYqVdvK\tN]uWeyNZuT_xRbxOaxQfyRbzK`zZm\82Zk~Yk~[h{^q\81^j|\j|Zgx\fxcn{IWoZex`jzQ^tcexgn|ekwdkyfp\7fox\82hq~lt\81co\7fXewlv~jx\82jw\83ow\84cezfo\81nv\83jq\83z~\8b{\82\8dms\86fp\85cn\80fo\80`l~\j\80Yi\7fPbyZh\80mw\87ir\86qw\88pv\86kt\88gq\85kx\89pz\8bgr\86dp\87gp\87iu\89u{\8dfu\8afs\89mt\88jx\88rz\8akv\8amy\8ax\80\8cw}\8bv~\8aw\82\8c\81\7f\8dx~\88t{\87ox\87pw\88sx\8awz\8bvx\8bvy\8apx\88nv\8aux\8avv\88ou\87qz\8bls\8bku\89js\8akv\8aku\89jw\89s|\8cy}\8ct}\8bq}\8dp|\8dw~\8dqy\8cmz\8bnz\8dW[jGQ^HRd;GXFObFR_4=O?H[GL\NTfU^mX_pBN\=IY?J[=GX<JZDM]AJ\DJ\:HZ4BX4@X8C\3CZ-?W/=Y/>Y4AZ8L`7F]9GaAReLXgIYiALc=MeIViFWjEUgOYmHVjLXlPXmV_rXaoU\oX^nPVkM[pOZoWbrQ[nRZmKSiIUoLXpU_qVarT]nP\pM^oO]pJ[pM]qVcuRatO^sOavVbuL\pHWnJYpKXqQcvP^qM]sHYrP^rVbuP`sJ\sKZsXeyWeval|is\7fv{\84~\7f\87zy\84\87\84\8a{\7f\85\90\8e\8f\84\81\86jl{il|\84}\85tr\80Ycv]k|^gzYbyhs\86cm\80[hz\g{fu\84nx\87qy\86es\82]j{cj|sy\87\81\89\96\8d\93\9c\7f\88\8f\81\80\8a\8e\82\8a\85\81\86~|\81yx\82hqz`mzhkybky`o{fn{en|el}ip}gn{fq\81]k}Xfzep\80ry\87el\81^f{an\7f^l\7f\k}fp\85dp\80fn\7fbr\85s{\8atx\88xx\8aty\89n{\8apy\8ahu\88bu\87ry\8ap{\8cky\8akx\88ny\89mw\8anz\8ap|\8aow\8al|\8co|\8ax\7f\8dr}\8az\82\8c~\83\8e~\85\92\87\88\97\84\87\92\83\87\91\80\85\92\81\82\90vz\8as|\8bu{\8aow\89rz\8auz\89sz\8aqx\8bs{\8cr}\8cqw\8aq|\8dfo\86px\89q|\8cr~\90sz\8ay~\8bpz\8cav\8cdx\8blv\8ajv\87Xk\84Se\84VWkcjwOWf@I\<H\FR`8CT8BVCHYMRd[cqKTa>IYBL[GQ`?IX8DV8AWFL^BI\7DZ4BX-<V/@Y0?Z.@X.?X,A[:JbCMa7G_AOeDPb>Mc?Od;Jb8Ib>MdEThATg;Nd=Of?LgKXo[et\csT[mKWlIUjQ^qJWlUbrTcwVatL^qARlCPlN\qJ\nN\oO]oL\pLZnKWmLWnK[oO]qO^qM`sTbpT`rP`sUcx^iw^kxlqzju\7ftz\84yy\7f\7f~\84\83\82\86\84\85\87\85\7f\85\8b\88\8b\92\92\90\94\93\8f\95\93\8f\9d\99\92\96\94\90\96\95\95\91\93\93my\82\87\8f\93\88\90\93~\8a\90\89\93\95\8a\97\9b\80\93\98\83\96\9a\85\99\9c\81\9c\9d\84\9b\9e\7f\97\9c\81\9d¡\7f\9d¢\83\9f¢\88 ¡\86¢¥\89¦¥\85 ¦\82\9e¡\8a¤£\8b¥¥\8c¦¥\8c¥¦\8b§©\7f\94\99\86\9b\9e\8a\9f£\80\8e\98t\82\8dp\85\90v\8e\96|\8e\97~\8e\99\83\90\9a\8c\90\9c\84\89\95\7f\83\93\84\84\90\8f\90\96\87\87\92s{\89iu\83gn~gq\81\j~al\80eq\80nx\85eq\80it\86ks\83ls\84jp\84^e}iu\85cq\84\j\80bn\83bs\85hq\85^n\86co\86ct\84fv\89hr\86gt\85nv\88ou\87lv\8asw\8anu\89ox\88yy\8ant\87jx\88iu\85ov\88v~\8er|\8dv\80\8c{\81\8f|\82\8ez|\8ayz\88rz\88w\80\8f|\82\8dx~\88o{\8av\7f\8cnx\8ags\89eq\88pz\88sz\88o{\8cft\8bfs\88mw\89jq\86\m\85Ug\82G`|Oi\85_n\8ag|\94s\8c\9e<G\FRfPZlDM`GSc@L[;EU=GXFM\JR[BMZ8DV?EX;FV:EW>GZ6DW2EY0@U/>V2BWCM]BN]6BV1=X4C\3E[9L`@Nb;F]7G_IOdFRb?Ja=Mb6Ib=Mf:K`<JbBMd8Hb>Mg8GcDSkU^oNYlM[oL\oT`oWaqX`qQ]oMZo@Mf>LfT]pfhxhlxekyjnzcivdk}op|tr}uw\81tt}{{\82\82\80\81\86\82\84\7f\80\85\8a\83\8b\8a\88\8b\8b\87\8a\91\8a\89\8e\8a\8d\95\8b\8e\8d\87\8d\85\82\89\8f\89\8a\94\90\8c\90\8f\8c\96\94\8f\8e\8f\8d\8a\94\96\86\8f\93{\8e\94\81\97\9c\80\97\99\84\9a\9a~\9c\9d\81\9c\9d\7f\9e¡~\9d\9f\85¡£\89£¥\8b£¦\8f¤¨\8c¤§\89¢§\89¡§\89¢¤\8b¢©\90£¨\8d£¥\8a£§\8d£¦\8f£§\86 £\80\94\99}\94\9b\80\95\9c|\8e\94q\87\8fx\8b\92v\8a\91q\89\92[l|j}\86z\90\96r\82\8e]o|t\8c\93\83\9c |\92\97y\8b\97\88\9d¢\85\91\98\87\95\9e\8f\9d¤\94\9e¦\98\9fª\93 ©\96\9e§\9d\9c¨\9b\9e¬\9d ¬\9b\9cª\9e\9eª¢¢­\9e\9d§\92\93\9e\88\89\94\85\82\8f\85\87\91~\84\91\81\84\93\85\86\93w\81\90u\81\90\7f\83\91uw\87px\86kt\86lu\86rx\88rw\84jv\86ty\87qt\86rx\8arw\8cox\89jv\87iv\8als\87hv\87nw\8bny\89r|\8an|\8enz\8cnz\8alz\8alz\88ku\86sz\8arz\88nw\85sz\88qy\89jr\85cq\81cp\83fo\84]i\82Zi\82es\86_l\84Yj\85n~\90p\85\96w\8b\9dk\89\99n\90\9cr\8f¢w\95¤\82¢­\87¤±\85¤²GSeBQbHPbOVeSWf?K\CO\ELX>IZAJY9BT8BUAHVIRcJRaGSeBPaEQc:J[1BW9FZQS`CO`7DZ2@V5@X1D[2F]8G_6G\AJa?OeAPd=Ob9Kc;Jc:Ib6F_1A]0>\+@^5F`BLd_^qqpxpryss{pmtrpwwr{moyfhvnn{wq~\86}\87\9d\91\91\9b\90\8a\95\8d\89\94\8d\89\93\90\88\97\90\8b\93\91\8c\94\91\8c\92\90\8a\9b\9a\8f\98\93\8c\93\92\8c\93\92\8a\96\91\8c\96\8f\8a\95\8c\89\90\8a\87\90\85\86wy~jn{||\82w{\81n\7f\86z\8d\90~\97\97~\9a\9d\80\9f¡\82¢£\81¢¤\83¤¦\86¥¤\82¦¤\88¤¢\91¡¥\96¥«\96\9f§\9b£ª¥¨®«¨°¦¨±§§°©¥¯¤¡®\9e¢­\9e\9f«\98\9c©\97\96¦\94\95¢\92\92\9d\8e\8e\9c\89\89\98\8a\8c\98}\82\90oq\7for\81nu\83nq}im|kq}fp}hjwhlzafx`fuekx_dw^hvZ^p]dryy\85yw\80kpxks{kt\7fnx\81r~\88u\87\8dt\87\92v\8a\95|\8d\99\8c\92\9d\95\9f¨\98¢¬ ¥²¤¦°¤¤¯¥£¬\9e\9d¤\96\96\9c\91\92\9a\89\90\99\85\85\91\8b\88\93\8b\8e\97\89\8c\98\9b\9a§¨¤¬\99\99£\8f\91\9b\92\8c\96\8c\87\90\84\89\96\84\84\91\83\83\92\82\84\92\89\87\92}\86\92r|\8erx\8atw\88ov\89pw\89nw\87lw\88jx\89jx\89hv\8agv\8al{\8biw\89t}\8dly\8bkz\8cq\80\8fm}\8egz\8cl\86\94v\8d\9cw\8e\9bv\90\9dt\8f\9e|\98¤~\9b¦\86¤­\87§°\87£¯\81¤®w\9a¨\84¡­z\8b¡p|\92iz\8diz\8dq}\91LYfHR_CHYHQ^FM[DLYFMYFMY7CS7DSOVg`gpBN[MYlKWg9GX?KY<HZ;IZ@L[;DXFOaAN_4@X0>V/<V1?Y2C[9G_;I`9G_9J`;I_2B]0A^0?[/<X6D`FOjZ`voq\81\89\84\89\9a\8e\8e\93\89\8b\98\90\8a\9f\8e\8e \90\8f\9f\94\8f¤\92\90\9f\8d\8b\9a\8c\8a¡\90\91¡\94\92¡\92\90\9b\8e\8a\9a\8d\89\99\8c\87\92\8a\87\91\8a\84\93\8c\82\98\8c\85\8f\8b\82\8e\88\81\8d\87\7f\8a\85|\93\89\83\8e\84\7f\82}w\87\81|\85\80}wvycpw^t|b~\85i\89\91|\9b\9b\83¢¡\85¦¥\85¥¥\81¨¦\85§¦\84¥¤\83£¢\88\9e¢\91\9b¢\97¡§\97 ª\9b\9f§\9e\9c¨ \9b¨ \9c§\92\95\9f\8d\8f\9c\8f\8c\97\88\87\96\87\86\95y}\8cx}\8d~\82\91x|\8bls\83ru\82ls}jm{rr|tu~vu}}x\83w|\83yz\80|x\81sx|yy\82px\81qz\81qu\7fuu}ox\80ov\80mozuu\80xy\81uw\81\80\80\87\82\80\83xx\80z{\84tw\81ss~yv\80ru\80mv\80jt~it}ku\80s|\84n\7f\87t\7f\8av\86\8f\81\97\9c\85¡¥\86¢©\87\9c¥\86\9b¢\86\9c¥\8a ¤\90¡ª\8f\9e¨\8b\92 \8f\9c¦\92¡«\9a¢¯\9c¥°\97¦¯\94\9e­\90¡¯\8a\9dª\8a\9b©\8a\9e«\8b\99§\8e\9b¥\87\9c¨\8b\99§\82\98¢\86\9c¦\88\99¤\82\99¤\86\9b¥}\8d\9a|\88\97\83\94¢\81\8f\9d\86 ©z\84\97x\8b\97\8e¤«\8a¡®\8a¦­\89¦­\85¤®\87¤®\87 «\84\9a¥\87¢­\82\9a§\8c¢¬\85\9b¥\83\96¤w\8b\98m\81\90p{\8eqv\89jp\86gm\84in\84lu\88gt\87gm\81bj\805EP1?N:CP9CQ:EU@KXAIU@NWEO[FOXT]k]dnOWe?HY?G\@M`8HX8BU;HY8FX5?T1?V8DZ>K\2>V.=X0=W0>X6AZ8H^1B[.?Y1A[7GbHOh\`qoq\7f\86\83\8b\93\8c\8e\9c\8e\91\9d\8d\92\9d\91\91\9b\8f\8d\8b\89\8f\95\8d\8b\9b\88\89\9b\8b\8c\9b\8a\8b\96\8c\8a\9d\8d\8d\9e\8b\8a\9f\8f\8f\9f\94\92¡\96\90\9f\92\8c\9f\90\8a\9a\90\8a\9e\8f\88¥\90\8a¢\91\87¢\94\88¡\90\89\9e\8d\85\97\86|\8a\81}\7fy{ruz|\81\80\7f\8d\8cz\94\95}\98\99| ¢\84¤£\86¨£\82©¦\83¥¢\82¤£\85¤\9f\83¢¡\80\9f£\81\95\9b\86\92\9a\8e\96¡\93\96£\92\8f\9c\86\88\94\85\87\93uw\85z{\87p|\86sy\82ns|nr|uy\80{z\80\7f{\81\80\81\86{{\83\82\82\89{~\85|\81\8c\88\89\90\91\8c\91\95\92\96\9f\98\9c\98\98\9d\99\98\9e¢\9b¡ \9c¢¡\9e¡¢\9d\9d§¥£\9f\9b \8f\91\97\98\97\9c\9c\96\9c\9f\9a\9e\83\86\90\81\87\8e®ªª®¤¥\83\81\89lowmq{sz\81nw\7fz|\84rs~tv~vt|uw|nu}ps\7frs|rw\81mq{jn{ko}nq{ot\80qz\84ox\84lv\80jt\7fou\81nz\83my\84mv\84lr\82iy\85m\81\8dn}\8az\84\8fv\82\90v\84\90}\8e\97\7f\8d\9bx\8d\9cs\86\95w\86\93}\91\99\85£ª~\8f\9b\7f\90\9b\84\97\9f}\8e\99s\8a\96{\8b\99r|\8dsz\8cmu\8aiw\88x\8d\97qw\8bs}\8ct\81\91z\8a\9bx\8b\9cu\8e\9cy\90\9e~\8c¡u~\90em\82sz\8fes\86s|\8dqs\88ls\85mo\85ko\83js\85in\84in\82mn\85el\80gm\81dk\7ffo\85^k\82@Q]JVbLYb=GTHO]U[hSWfRZfLXhMZe>GU<HW?N]AM^@K^IUh?PbDNdAK^?Mb8J]4BW2@X4G^3BY.>X.>W2?X.=W1@ZEPe`bu\7f|\87\96\8c\93\9c\91\94\9a\93\96\9b\94\97§\9d\9e£\9b\97¡\98\99\9c\92\94\9e\90\95¨\9d\9f¨\9e\9c\9a\8f\91\9b\8e\90\9b\91\92\9e\92\91\9a\90\8e\99\8f\91\9e\8e\93\9d\8d\90\9a\8f\91\9a\8e\8e\9e\8c\87\9b\88\87\93\85\83\91\7f\7f\8c|\7f\81}}uyz{\82\85z\85\88x\88\87v\8f\91w\93\95v\9b\9d~¤¢\80¥¤\85¥¡\84¤£\82£¢\81£ \83£\9d\81£ \82\9e \82\9b\9d}\99\9cx\92\9a\7f\8f\98\84\8c\98z\87\92w}\88px\83`jxbo|ou~sv\80w\7f\87\82\84\8b\8a\88\8d\98\98\9c \9b\9d®ª©´®­¶¯¬Àº¹Ä¾¾¿¼ºÀ¹¸³©¨¯¢¢³¨ª¼°³Ä¸»ÆÀÁÁ¹¼½±´¾µ¸³©®µ«¬¾²µ«¢¤\9b\94\95«¢¤³¨­¼°³¨\9f££\95\99£\92\95\9c\8b\8a\98\89\87\96\8e\8b\93\8a\89\92\89\8b\94\8d\8b£\93\8e£\94\8d \98\90\9d\93\8b\9c\97\8c\9f\94\89\9a\8f\8b\99\91\8c\93\8d\89\8d\86\84\92\8c\8b\83\82\86\7f\80\87\87\7f\84\85~\81\85~\83}}\85vz\85y|\87z{\88~x\83yy\82rx\84ir\80qu\84rz\89ep\81jo}rx\83su\81rv\84ak}em{v{\82\89\8a\91ª¯³ \9e¦\7f\84\8dvx\82rv\82}\83\8etw\85kt\82kr\80ty\86z\83\90lt\87ov\88dk\7fXg}aq\84z|\8fgr\84jw\86u~\8av~\8av{\8cw{\8cty\89sz\89px\8agn\83fu\87iw\8akr\85is\85ku\84sx\89os\86wx\89wy\89jt\85uz\88LXdKYeAMZCO]MUeIRcOXj[dtOWfVcsNZhHR`GO^BM^CM\FPa@O`BPd?LaSZoHVe>FY4@W-=V2@X/@Y/?X->X@Mfhhy\96\8f\95¤\97\97\9e\91\93\86\89\8e\91\8c\94\9c\95\98\9c\91\96¬\9b\9cª\9f « ¥¤\9c\9c¦\99\9b¬¢¡¢\99\9a\9f\93\97\9e\8f\94\9d\8f\94\98\8a\8c\97\87\89\8e\81\89\86x}wtydkspou||\7f{\82\83{\84\85s\86\8as\8c\90v\92\94y\99\99\9f\82£¤\85¥£\86§¤\85¦£\81§¥\7f¦¥\7f¥¢\85¢¡\80£¡}¢¡}\9d\9e~\97\99~\92\97\81\90\98\88\8d\95\90\8d\94\90\8e\93\92\8f\92su\7fhp{ux\80\83\85\8au{\82nny¤\9b ¨¤¥¥\9b\9a¬\9f\9c²­ªÆ¼¾È¾¿Ã¹»Á³·Ê¾¾ËÀÃÊÁÀļ»Ã»·Í¼Áµ³¶­¬®¡ ±¥¥Æ½ºÄ»»Áµ´ËÀ½ÊÁ½Á¸µÀ··¾³µ»²°Ãº¹Ãº¹©\9d¢\92\8c\8f¨\95\90©\90\89¡\8b\87\98\88\86 \8e\8c\9f\8e\8e\9c\8c\8c¡\92\8e¨\95\8f¨\94\8f­\9e\96 \9c\91¡\99\91£\98\8d\9d\97\8d \9a\8e\9c\96\8a¡\9b\8d\9d\93\8b\97\89\86\8f\86\89\86\81\84\8f\83\88\8c\86\8a\8b\88\8cy}\84x{\88\80\7f\8c\8b\86\8d\86\84\8c{}\8b\83\82\8f\82~\8e|}\8crx\87\80\80\8a\91\86\90\8d\86\8f\8d\86\8f\96\8e\91¡\98\97¥\9c\99¥\9b\97\94\92\98«\9f¡²¢\9cª\9f\99­¢\9eª \9d¤\9b\9a¢\99\98\9d\94\96§\9c\9d«¡ \97\90\91\94\8e\91\93\8b\91\91\88\90 \92\95©\9a\9e\8f\8a\94\82\82\8d¢\98\9b\9f\96\99\9b\94\9c\94\90\9a\8b\8b\99\8e\8f\9b\92\8e\95~~\8cet\85gs\85cs\84cu\87pv\86iq\86jw\89mv\86sv\87ow\84qx\86BN^AJ[BPaNYiPYkHUeT\rao}M[kFQbPYg9EVIRdCN^CK\@JZ8DV7G\<NbDOcIUjEPeHTg;J^2AY,<W?JbYbu\85}\88\93\8a\8d\88\82\89\87\83\89}\84\88\87\8a\90\95\8c\90\98\8e\92\98\8c\92\97\8c\90\90\87\8d\94\89\90\98\8e\93\93\88\8f\94\88\8d\8b\80\87\86\81\87vy\82~|\82\81\81\85z\83\88x\84\8ao\83\89p\8a\8er\90\93x\9a\9a|¡¡{¥¢\7f§¢\83§¤\83§¥\84¦¦\82§£\83¤\9f\87¡ \86¢ \83£¢\85£¡\81¤¢\80¢¡~¡ \84\9c \88\9b\9c\8a\97\9a\90\91\95\90\90\97\93\8b\93\9b\90\95\9c\92\95\91\8c\8f¥  \9c\9a\96\8e\8c\8e£\9a\97¤\9a\94\8f\8a\89\8f\8d\8b\94\91\8d\91\8a\8b\9e\92\90ª \9cÀ¶³ÉÀ»Ç¼ºÅ»»½´¶½³¸¾¶¹É¾ÁÍÆÆȽ¿Ã»¼Æ¾¿ÊÁÁÎÉÆʼµ·Âµµ¶¯³³ª¯ª¢¥¬¤§¨\9f¤¦\9e¤§\9b ²§¦«\9e\9f \97\99zx\7fps}ss}tv\7f\8a\82\89\9b\8e\8a\9a\8a\89\97\8f\90\9c\90\92\99\8c\8d\93\88\89\8a\81\83\8b\83\82\9b\90\8d \90\8f¡\97\8f¤\9d\93\9c\99\8d\9b\98\8c\99\96\90\9c\97\91\9c\95\8c\99\8e\8c\97\89\8d\8a\85\88\82\82\87\80~\87rx\88nu\88jr\85qx\8bky\8ciw\8cmx\8blx\8dix\8ejx\8ciz\8dlz\8cl|\91o|\8fp~\91p~\91v\81\92u\7f\94p~\90y\83\92\81\84\92\80\84\93~\81\8f\80\85\90\86\8a\96\8c\8d\99\99\92\9c\9a\93\9a\99\92\99¦\97\9d¦\99\9d©\9b\9d±\9e¢° ¢±\9f ² ¤µ ¥¯\9e¢µ£¦©\9e¤¬ ¤\88\85\93n{\8f\83\87\93\8e\88\97w~\91\80\80\90rx\8aen\84tz\8as{\8br{\88ty\87uw\88pu\85mu\85;IXDJ^R\nO]kIR_JQ_KUfCN\EPbNUeFTbBMZBL\6EYCPdFPaAO`CQb>IZ?K\BN_DQb>K`>Ne1AYPZpqs~\80~\84{\80\87\80\81\86\7f}\82\81{\84\85~\83\81z\80\81|\80\82}\84\82}\86\88\84\8b\85\85\89~\82\88z\87\8dy\88\8dz\8a\8fy\90\92w\97\98w\9b\9b\9f\80¤£\82¥£\85¦¥\85¨©\86§¥\83©¦\81¨¥\81§¥\83¤¤\83¤£\7f¤£\82££\85¤¤\82¥¦\81§¤\86¤£\82§¥\82¦¥\82 \9e\86\98\9b\8b\9a\9d\8b\95\9a\93\97\9d\93\92\9b\91\8e\96\86\84\8e\7f\82\8b\86\84\8b\93\8d\8b\9b\95\8a\9d\9a\90\9d\98\8b\9e\9a\8c\98\96\8d\9c\98\91¥\9e\9aª§¦³®¬Â¼¼Å½ºÊÀ½ÎÅÃÉÀ¿Àµ´Áµ³º®¯¶®¯´ª®¶«®²©©ª£¡ª\9d\9c§\9c\9d\9e\93\95¯§£®¤\9e£\95\91\9c\93\8b¥\94\8e\9b\90\89\99\8d\88\94\8a\87\89\81~\82\81~\8d\86\83\92\89\8b\86\84\85\8d\88\82\90\8c\87\93\8d\8b\82\81\82\86\88\90\87\87\8f\8d\88\8d\8c\85\87\88\83\89\85\82\8b~y\81\8c\81\84\90\88\87\93\8a\88\99\8c\8a\8d\85\88~~\86\86\82\87\89\84\84\81\81\83\87\84\87\87\82\86\7fz\85\85\7f\86\7f~\87}\80\8dov\88lw\8agv\8bav\89jv\89qx\8buy\8bs~\8bv\80\90\7f\85\90\81\86\93\86\87\94\88\87\95\8b\88\95\8d\8a\93\81\84\92\8a\8a\93|\85\8dv\83\90y\80\8es|\8cw~\8dw}\8cz\80\8enx\87w~\8cy|\89\81\83\8e\84\85\91rx\87rz\87\7f\85\93q{\8cq|\8cs|\8ay\80\8e~\80\91\80\7f\8e|{\89\81\81\8b\83\82\8b\9e\93\99yw\87\88\8b\95\80\81\92cl\81cr\82ju\87iw\89kv\87mx\87lw\88qt\84ho\81xy\85po\80tz\8a{\7f\8bls\85BTeLYiYaqQ[kR\kKYdRXiVasOXhSZlJ[jJW`5BT;H[DSbFO`>IZJSgGPcAL^FM[;HZN]nWpyb\81\87v\8c\91y\8a\8cx\8a\8ew\8e\93}\8f\90z\8e\8ez\8c\92u\8f\93|\94\95~\91\96z\96\99{\98\99z\9b\9ax\9f\9d\7f  \7f¢¢\7f¤¤\82¥£\83¦£\80§¥\81¦£\82¤¤~¥¥\81¥£\85£¡\81¥¤\82£¥\7f¤¤}£¢{ ¡\81¡¡\81¤¤\81¦§\84§¦\84¤¢\82¢¤\83 \9e\8a\9e\9e\83\95\9b\80\8d\96\82\86\8f\81\83\8f|\82\8ds{\88jv\84jq\81qw\80|\82\84\96\8d\87¤\97\8d§\9a\8e§\99\8c\9e\93\87¢\99\8e¨\9d\91§\9d\91¤\99\8f¨\9b\93¯§¢«¤ ¢\97\96§\9a\99ª\9e\9b\9e\97\95¥\9c\99©\9b\94«\9e\92¦\99\91¨\9a\90¥\9a\8d¨ \91®¡\91¬\9c\8d® \8f³¥\91³¥\90¶¦\90³¦\91µ§\92²¢\8f¸§\93µ¥\91¬\9b\8a¬\97\8b¬¢\90¥\9c\8f\95\8c\86\97\8c\8a\91\89\87\87\86\85\8a\87\88\8b\85\88\89\83\86\88\86\8c\86\84\8e\86\86\8d\85\84\8c||\84\7f}\88lu\7fyx\80\85\80\89\8az\82\89\80\86mp{blwimyegufm}mq\80wy\85lt\88gv\8cgw\8deu\8aiw\8alx\8dw{\89\8f\87\92\9c\8f\97¢\97\9b¬\9c\9f¯\9d µ¢¤±\9d ®\9d\9fª\9c \9e\91\97\9a\8c\93\97\8a\8f\88\86\89\85\84\89\88\84\8a~\82\8a\8a\85\8e\82\82\8f\88\83\8b\8e\86\8c\90\8b\91\86\84\8f\8c\8a\90\8d\8d\92\9c\91\92¢\97\93\97\91\91\8d\8a\92\82\82\8cns\84{\81\8b\84\83\90q{\89vx\87nu\85mz\89kx\88mw\86mx\85iw\89l{\88ls\83gr\84nx\87mu\84fp\84cm\81px\85ar\7fbk~cjzqz\83bj}]f|Yi{^j|O`jJXeZ_p^iv<Q_GUbMVdIUfJVfIQaJWdBO_W`nahygp\7fiw\83Zjxo}\88dx\81h\81\88k\85\8ao\8d\91u\94\95w\93\94u\8e\92q\8e\91j\8d\91r\97\98w\9b\9as\9e\9fw\9e\9ez\9f\9dz ¡y¡£x¢¡}¡ z¢¢z££~¢¢\7f¡ }¢¤}¤£\7f¤£\80¥¥\82¥£\80¥¤\81¥£\81¥¦\7f¥¦~¦¢}¥£\82¥£\83¤¤\84¢¡\82£¤\89¤¦\87¢¤\87\9b¡\82\90\96w\84\8cw\80\8bz}\88ty\87is\83_n\7f^j~_izbn{nw|\7f\82\83\98\8e\89¥\97\8e©\98\8b¦\92\89¥\94\89©\95\89¨\95\8c§\95\8cª\97\8d®\96\8d¬\99\8a¬\9e\8b¬\9d\8c«\98\89­\99\8a¬\9c\8e¥\99\8d¦\96\8c§\98\8dª\9a\8b¦\97\89¢\92\88«\9e\90¥\9f\8e¦\9e\8d¬\9e\90¬¡\90¯¢\92®¢\91© \8d§\9c\8b¬¡\8b¤\9c\8c§ \8d¨¢\8e¬\9f\8fª \8bª¡\8d§\9d\8bª\9a\89\9e\90\84\9e\95\8a¨\9f\8f¡\99\8d§\9b\97\95\8f\8f\88\85\85\8b\85\85\85\84\86\81\81\87|}\86~}\84x|\85z{\84}\7f\89wx\84yy\87kq|foxlnwwr\80vv\84pu\84gr\83ct\87hv\8aev\8cdu\89es\86kx\89t{\8d\90\8b\95¦\97\9b¦\99\9f£\97\9fª\99\9f±\99\9d£\91\96\95\89\8b\8b\86\87\88\84\87\8b\86\86\89\8a\89\83\82\88\89\87\88\92\8f\8d\80\81\84\7f\80\84\88\88\89\8a\8a\8a\92\8b\8d\90\8b\8b\92\8f\8d\8e\8c\91\91\8e\95\98\90\90\95\90\8e\98\93\8e\9f\99\95\8e\8b\92\92\8b\96\8d\8c\95{z\87sy\85mw\85hr\83sz\84v\80\8amx\87iw\88lt\87`n\84an\82co\81it\82bp\83cq\83gq\82bm\81^o\84fs\84`p\81`l\80hp\80dp|hq~mv\7fjr\80pu\82CX_AO[ISd_iuM]i\cs]br^jw^nwZkuau|]v~s\8e\93w\90\94|\94\97x\96\98t\97\99y\9a\96v\9b\97v\9c\9by\9c\9aw\9b\9au\98\99v\99\9bw\9a\9av\9b\9et\9e\9ew\9e\9a}\9a\9cy\9d\9dx\9e\9cy\9e\9dz\9e\9e~\9d\9d|  }\9f¤{¡£~¤¢\83¢¢}££}¤¤\7f£¡\7f¢¢\7f¡¡~££\82¤£\82¦§\82¨¨\85¨¨\88¦¥\8c¥¦\85\9b\9b\86\93\9b\86\94\9c\83\8e\92y\81\8bs}\88ku\83bk|ahxXiy]fz]gx`m{qv~\82\7f\81\91\86\83\9d\8d\87¦\93\89§\97\8c¤\98\8c§\9a\8f§\94\8c¨\93\88¦\8d\82£\8f\84¦\91\89ª\8f\88«\92\89¥\93\8b¦\97\8e¬\99\8d®\9c\8e¯\9e\8d¬\97\88­\96\8c°\9d\8e®\9c\87 \8d\85¡\90\8b\98\94\87\97\93\88¦\9c\8e¡\9d\8d\9f\9b\8b¡\9d\8d¦\9d\8b\9f\98\8a \9c\8f\9d\9a\88 \9c\8aª¥\8f¬¤\8f©\9d\88¥\9a\8a£\9c\8c\9d\97\88\9c\98\87 \9a\86¤\96\85 \92\82\9b\93\83\9b\93\83¢\93\85\9c\90\8a\98\90\90\97\8e\8c\87\83\82~y}\80\80\81\84\80\83\85\7f\82wv\80rpz~z\81yy~st\7f||\86\7f\80\88\7f~\86\85\84\8a\89\85\89vy\87`u\88eu\8adt\8bgt\89dt\86is\88~\82\91\8f\8b\95\90\87\90\92\89\93\99\8e\93©\96\94«\97\94\9c\95\93\8c\88\89\87\88\84\8f\91\89\95\93\89\9c\99\8d\96\97\8d\8c\8b\88\94\92\8f\96\92\90\9c\94\90\9c\97\92\9f\9b\94\9d\9a\8d\97\94\8a\93\92\8e\9a\97\91\96\94\8e\9d\98\92\90\8c\8c\88\88\91\81\86\8e|\80\8cps\83}\80\8dwz\88pv\81py\84x\82\89\82\84\8b\87\84\8b~\7f\8er{\8aox\86hr\86fs\86fp\82is\83oy\86hq\82js\83\j\81Yf{[k\80Wf|We{Uczcm\80hu\81gq~go\7fmr\7fej{Uhxi}\88u\88\8am|\85t\88\8cp\84\89u\8d\8eu\8f\90q\91\92n\93\92q\96\97s\95\94p\93\93q\94\95q\93\92q\8f\91s\92\95u\96\95u\96\95y\97\95y\99\99v\9b\9ay\9b\9bu\9d\9dv\9c\9cx\9c\99w\9b\9cv\9d\9ex\9e\9ey\9e\9dx\9f\9dz\9f |\9f\9f\9fz¡£y¢¢|\9f¢~¡¡~¡¡}¥¤{¦¥\81¦¦\83§¥\88¦§\8b¤¤\8a\9f¡\88\9a\9f\86\91\9b\80\8a\94y\82\8by{\89gp~bm{^ixZiyVhxTfwXgvemxst{~|}\8f\81\7f\9a\8b\82 \8f\84¨\91\82¥\92\84£\90\83¤\91\87¥\91\86¢\8f\84£\91\85¥\91\85 \8e\81¥\8e\80§\8d\81¥\8f\82§\91\83©\92\86£\91\85\9a\89\82§\96\8b©\96\89¦\93\83ª\99\8a©\95\86£\92\88©\95\8b£\93\89\94\8c\85¡\95\8d\9f\99\8a\99\99\8a\9c\97\8a¡\9b\8c¥ \8a¤£\8d¢\9e\8e\97\96\86\95\96\85\92\95\84\97\95\84\9a\99\86¡\9a\8a\98\98\84\96\94\81\9c\93\80\96\8f\7f\94\93\81\9c\94\86\9a\91\83\9d\8e\83\9c\92\84£\95\88\9e\8e\8a\91\89\88\93\88\88\91\86\86\8e\86\83\89\80\84\86\81\85\8b\87\89\8b\86\8a\84\81\87\8e\86\89\91\8c\8b\90\8c\8b\99\8e\8a\97\8c\90\98\8c\8e\99\8f\8e\93\8b\8c\87\86\8fny\8acv\8bdv\8a`v\8bav\8c^s\86y{\8b\9a\90\95\9a\8d\93\98\8f\90¦\97\92±\9a\92¨\93\8f\9a\92\8f\95\8e\91\92\95\90\99\95\8f\9b\93\96\9a\8c\93\95\87\8d\8e\8c\96\8b\86\91¡\93\97¢\96\91\9e\98\8f\92\85\86\85\83\84\82\85\85\89\86\89\84\83\88|\7f\87z|\84t|\85s{\85x~\89\85\85\8d\86\84\8a\82}\86ps\81\88\88\8c\96\92\94\82\86\8c\8b\8c\8e\83\86\8e\7f~\89|~\8cao\83fn\81`p\82[h|_l\82Yk|_l\80gk\7fdn\7f^i~hm\7f^i}`l~cp~am}gs\82[j~cp\80Zi{gn}_fxj\8a\89h\88\89g\8c\8cl\8e\90k\8d\8fl\8e\8ck\8f\8dl\90\8fo\90\91n\92\8en\92\91m\94\91n\94\92p\94\94q\96\96s\97\96s\97\95s\99\97r\99\99w\98\97x\99\9bs\9d\9cs\9d\9aw\9c\9dx\9b\9cw\9d\9dz\9c\9bz\9d\9cx\9f\9dy\9f\9ew\9f\9ew\9f\9f\9fz¡ v££~¤¢\83¤¥\84¥¦\89£¦\85\99\9d\87\95\9b\87\94\9a}\89\94}\83\8fpx\85fo\81`m}YhxVcuQduRdvTdvUdxUgxVgybk{wy\82\88\83\83\99\8e\85¦\90\84¥\94\8a¥\92\83§\90\83£\90\82¥\8e\83¦\90\84¦\8f\87\9e\84\8f\84¦\90\85§\8e\86¦\90\85©\90\83ª\8d\81§\8f\81¦\90\84¦\91\86\9c\8c\82\9d\8b\80¢\90\88¥\95\8d¢\92\88\9f\91\88\9e\90\88\95\8a\84\93\88\83\94\90\86\9b\94\8c\99\99\8a\9b\96\84\9c\93\84\9b\98\86\9f\97\86\9e\9b\88\9d\9b\8b\9e\98\89¢\99\8c¢\9e\8f\98\95\88\93\91\84\9c\95\8a\9c\97\88\99\94\86\93\92\84\97\94\88\94\91\87\90\8c\88\87\85\84\80\80\86{\80\87\81\82\8a~\82\8c{\80\8az\82\8cs\81\90p\7f\8ep\83\91u\83\93n\81\92v\83\94~\87\94\8b\89\92\94\8c\92\8e\88\8e\81\83\8b~\82\8d|\82\8fy\7f\8ft|\8emz\8ccz\8a]v\8c`t\8cdu\89bw\86^u\89at\8bap\87\84\87\92¦\9d¢¢\98 §\9e¥¥\9c¤\95\8b\95wq\82ss\83tu\8btx\8d\7f\81\96\84{\94\88w\8b\8ez\8e\98\82\93\95\82\92\87~\8d\9c\8e\98«\97\9a¦\97\9a¨¢¦\99\95¤^fzbm{oq~_fy^m}lu\7fz~\84yy\81\82\80\86\87\82\89v\7f\88s|\86z{\87\l}go~hp\82]l\80eq\81Xe{`j{Uby[i|[j}Zfzeo\80bn}pu}qu\80t{\85vy\85y~\8als\84fq\81fs\82dq\7fan\81]k}dp\81]fwf\8d\8ci\8c\8cj\8d\8dl\8e\8di\90\90j\91\91m\8f\91q\90\92m\92\93m\94\94o\93\92p\94\94p\95\96p\96\94q\96\94t\96\95o\99\94r\98\97t\99\9at\9b\99u\9b\95o\97\94r\9d\9dy\9a\9bv\9b\9cr\9d\9ex\9c\9by\9c\9dy\9e\9ez ¡\81¢ \82¤¢\83¡¢\87\9f\9f\83\9a\9f\84\91\99}\88\93t\80\8dkv\83dl{aiyZdtWbsU`rParRctQbtRbtRauSbtQcvRctUauVbx\gypv\81\8a\84\8a\87\81\84\87\83\84\8b\83\85\91\89\8a\8e\84\84\92\85\82\95\88\82\97\87\80\98\8b\84\94\89\83\8e||\9c\8b\84¡\8f\87¢\8f\88 \91\86 \8f\86£\90\84 \90\84\95\84\7f\9a\8e\88\8d\89\87\93\8e\8a\8d\8c\8d\8f\8a\88\9a\8f\88¢\99\8e¥\9e\8c \9b\89 \9b\87\9f\97\88 \9a\88\9a\95\84\95\92\83\9b\93\88\8d\8a\82\89\89\82\82\86\86~\83\87\7f\82\88{\80\88z\7f\8bx|\89v}\8au}\8au~\8ap}\8apy\86mx\89gy\8aix\8cl|\8bq~\8cv\7f\8cw~\8dw\7f\90y\83\90x\82\8f}\84\90z\86\91y\84\8ey\82\8by\81\8c|\82\8d~\7f\8f}\7f\8fr\80\90l~\90k}\90m{\8ekz\8ehw\8dbw\8cbw\8beu\8abu\8b_s\88]s\8a^t\89bt\89co\85iq\86~\81\92\89\89\99x}\8ez~\8e\81\86\9aww\8c}v\89~}\90lp\85ys\87|t\86\98\82\90­\8c\98«\89\95­\89\8f¡\82\88¦\8a\91¤\87\8f¤\88\95§\8e\9a­\90\9e©\90\9e\8f\81\8d}~\83\81\7f\82\80\80\87lv\82ow\81rz\84ip~is\80es\81iv\82aj}dn~]j~dn}fj|ns\82dm{lx\83p{\84r{\85w\7f\8aux\85v|\88{~\86\85\8c\8c\93\94\91\8e\88\8c\8d\85\89\8b\84\8b\85\85\8eou\85dn~hq\80jr\81co\81`l|`p\7f\k}j\8e\8di\8d\8fi\8f\8em\8e\8fn\8d\8bi\91\8fk\91\93m\91\94o\92\92o\94\91p\93\92o\94\93o\94\95r\96\95q\95\94t\94\95p\97\97r\97\97r\98\97v\9a\9do\93\83ewi~\9c¡|\9b\99~\9e\9e~\9d\9f\81\9c\9e\82\9b\9e\82\97\9e{\8e\97x\82\8fs|\88ip\7f^jzYctU`qO_rP`rS`sRbsQctPduRcuVbuSbuSbtTarRasQauT`sUasP`sPcuXdu`dvpt\84\8b\8a\95\90\8c\94\94\8c\90\94\8d\93\92\8d\91\8e\89\91\8e\86\8e\92\87\8f\8b\89\90\8d\88\8f\91\86\8e\8d\86\8c\8d\88\8b\96\8c\8f\96\8e\8f\98\8e\92\97\8e\91\91\8b\8d\8a\87\8d\88\83\8a\88\87\8e\8c\88\8e\8e\89\8c\9a\92\92\9f\97\92¦\97\8b£\97\8a\98\95\88\8f\8c\84\85\85\82}|\81t{\7fis}fv\80gr\7ffr\83et\85as\85`t\87^s\86_q\87dt\86bu\87ht\85mt\85nx\89y|\8b\84\83\8a\8e\86\89\93\8a\89\99\8b\88 \8e\88¢\90\8a¥\91\88ª\95\8c«\97\89«\9b\8e«\96\8f¨\96\8f©\99\94«\9a\94¦\95\8f¥\94\92\98\8e\93\8b\85\92\86\83\91z\81\93x}\8fnw\8bhu\8bhu\88dt\88_t\88`t\89cs\89_t\8abr\8bct\8bgw\8bs~\8c\98\9a£\93\93\9c¦¡¥®¢­\99\97 \94\8f\96\8c\8a\96\82\83\8c\96\80\8a°\8e\94Á\9a\98»\95\95Á\9d\9d¼\98\9b®\8d\93®\91\99¥\8b\93±\9a¡»¥®³\92\9f\90|\8c\89t\85{m}mny\7f{\84||\83\85\84\87}z\82kq~cm~W`q[etVbvZhw^mynu\7fqt\80ip|mw~pu\80ov\82}\81\88\8d\92\92\8a\8f\90\91\8f\90\8f\92\8f\95\93\93\91\8e\91\8b\8a\8f\92\91\91\94\90\91\92\8c\8d\90\85\8a\89\81\89sw\84qy\86iq\82jt\83jt\84dm\80cl{do\80dk}h\8d\8df\8e\8fi\8f\8fk\8f\8fm\8e\90l\91\90o\91\8fo\91\93q\91\95r\93\92o\93\94k\95\96o\94\94q\94\94t\97\97t\98\97w\9b\9c{\9e\9c{\9c\9f\83\9f\9fl\87eU_Cjpzz\89\92v\80\8amu\81im|ahyTasP\mKXlMWhLVjIWkHYlLYlKYmLYlL[oJ]pJ^rN_qQ_sR_tQbuQ`vSbvVbuRbwRbwTduScuScwSdxWdwWbvWdxcl\7fnt\85kt\83ku\83kv\85lv\87ov\85ou\85mv\88pw\88tx\86u{\8avz\89s{\8at|\88o~\8al|\8au|\89z\80\8d{\82\8ey\81\8cz\7f\8b|\80\8bv\7f\8aw{\85mw\86fs\82ao\82\p\83do\82iq\84ju\86ux\86wz\8a~}\8cmz\8agv\86qz\89y\7f\88\83\84\8a\87\85\89\8b\8b\90\95\8c\8c\99\8f\8f\9d\90\8e \8e\8c¡\91\8b§\95\89¦\95\8b¤\95\8e¢\94\8d\9e\93\90\9f\91\92\99\91\91\96\8f\90\96\8c\90\93\8c\92\95\8b\94\90\88\94\81\81\8f\82\81\91|\80\93t|\8ehw\8egv\8bgw\8bhu\8acv\8a_w\8bdx\8afw\8aav\8b_t\8cbt\8aiu\88ir\87w{\8a\86\85\91\81|\89\84\81\8f\81\7f\8a{u}vw\80kp|^drbfrdiwgktmjq\9f\87\8a²\95\9c°\95\9f­\8e\9a­\8e\97 \86\8f\95\80\8d\88y\7f\9b\8d\90\9a\90\97\91\87\84\8a\84\7f\96\8e\86\8a\87\86\85\83\84||\80\8d\86\8bqqzflylp}kpxrz~yz\81\87\81\85\85\81\87\99\8f\8e¢\95\94¡\98\93\96\94\90\8f\8d\8f\87\86\88\86\86\8a~|\83w{\85z\80\8a\8f\8c\8e\9a\98\93\97\93\92\89\8b\90\83\85\8c{}\87\84\82\89\82~\88}\80\8ax}\88r|\88s{\85lt\84_hybkzco\80ck|bjzf\8c\8eg\8d\8ek\8d\8di\90\8fj\8f\90i\8f\92i\90\90j\91\92j\93\92o\93\94v\96\97v\98\98{\94\96y\95\97p\88\8ex\89\92|\87\8fw\80\8bmx\87cpt>K+26*KRcHWhDReHQeGSeDSgEThHUiDXhGWkFVjHVjIVjGWlHWnJWlIYmIYpKYoFZmG[oL\qM_pN_rOauRdwXk{Tj}Ti{Vi{Xj|Uk|Ui~Xk|Yk~Yi{XgySj{Tg{WfyShySi}Xf{Vi{Xj|Xh}Xh~Xg|Yh|YhzUhyTk}Wj}Sh}Qh}Wi}\l\7f[k~Ym\81]n\81\p\82]p\83ao\86cr\85zx\88|z\89w|\8a||\89|x\89|z\8bq{\8ar}\8d\8a\8d\97\9d\97\9c\9b\93\98\97\8f\95\92\8f\95\97\8d\92\93\8a\92\8b\88\90\8c\88\90\8a\84\8f\85\83\8e\84\84\8f\82\82\8e}\83\91|\82\90v\80\8ex~\8ex{\8dsz\8es{\8dq{\8elz\8egx\8egx\8edx\8ecy\8fbz\8fdz\8eg|\90l{\90n}\91v~\92hz\8dex\8ckx\89nu\84ru\82xy\83jlv`bnU\i`dqbbjijlnmnntrorr{ytrtunns\82\82|\89\8b\82\8b\87\81\96\8d\8e\91\87\8c\84w}\89\81\88\8b\82\83\9c\90\8e§\9a\8f¹¨\94¾¦\96ï\9añ\9f½¨\9a¦\96\91\83z\80`iwfny\83~\81\91\88\8c\97\90\8d«\9e\96²\9f\99¥\94\94\9d\8d\8e \8d\92¤\8d\93²\9e\9b¥\96\96¦\94\94§\99\97¨\9c\98©\9b\97\9b\91\8f\8f\86\8b\7f\82\87\7f\81\87\82\85\8a\93\91\93\8b\89\8f\81\84\8bvw\83ru\82cjyoy\84mu\83bl{iq}bkz^l|dl}bhyaix]lzi\8c\90j\8e\8fk\8f\90k\8e\90m\8e\90t\91\94y\96\98z\96\9a\81\93\98\82\8e\94\86\8d\95nz\81flx`gpPYiM[jGUeKRdBQdCS^HQ7?E?=EVGRcO[aQWdGTgEVgEVgGVjJViLVjKXkFYnGXoIXmHZnH[oH\pK\pOatel|jo~qp}ts~nv\83vv\84rx\85_kx_izYj|[k\80Xk\80Zj~Xo\83Yo\7fVl\7f]m\7ftq\82pp\7fzv\85\81}\86\84~\88\84{\81yw\83\83|\89{t\82\81w\85\86|\87\87~\87\80|\88\89\82\8e\98\88\8dpo~io\80nr\83tx\87lq\80Wgz]h~Wh~Vh}Tj\7fYj}\j~Yj\7f\i\7f[l~Xm\80\l\80]m\82\o\83bq\82hu\84kt\86gr\86gs\87hu\89gt\86is\87gr\86dr\87es\88hr\85gt\87eu\87fv\88ey\8afz\8cfz\8cgy\8bez\8dfz\8dhy\8eey\8eey\8ffy\8fh|\90py\8fr{\90\82\7f\91\89\7f\92\8d~\8d\90\85\91\88\81\8e\8b\82\8c~~\88tv\80hoydhsZanchsllpzwtwtu\86\81~\8b\86\83\88\85\82«\9b\8f± \93´£\94¸¦\95\9d\94\8a\96\8e\83³¦\94µ£\93¨\9b\8e\9e\95\89\98\8f\84\92\8c\81\88\81~zu{\8b\82\80¤\94\90º£\94¿ª\99¼ª\97į\9dÁ¬\9f\9c\8f\8flnzdmxahvuv\80~w\81 \91\8e\97\8b\8a\9d\8c\8d£\92\8f©\96\91\9f\8f\8f\9e\8a\8a©\94\93\9f\8f\8e§\93\90¤\96\93§\9b\97¢\94\93¡\98\94\9c\98\95¤\9c\99\98\92\91\8a\88\8a\86\84\89\8b\87\8f\85\86\8b\87\85\8bz{\85ow\80ov~io\7fhq|dmzfnzcm{Zjx]hx`hwbp~Yq\80UmxRco[fq_frbmz`jvYbpR\kPUfIQ`DOaDNaBPaDTcCTcDTcHUdKWfO]TCM&:@7FJIO[[EN<GP]FUjEVjGWhFXjHWlKWjKXlJYmGYpJZoM[oP[oQ_t^n~\84\81\89\9d\8b\91¡\8a\91¤\87\8e£\8c\95¤\91\9a¢\8e\93\8e\82\8b\8a~\87\93\82\8b\9d\8b\93\97\8d\94\96\90\95\97\8a\90qv\83t{\87y{\86}\80\8e\93\8a\94\9d\8e\95ª\98¡¬\99¢´¢¨¼©§¶¦«\96\8c\93\7fz\89\86\81\8f\8a\84\93\8d\8b\98\8c\89\96\84\80\8f\9d\96£\93\89\99\9d\95¤ \93\9f­\9e¨{}\86TfxWj\7fYh|Xg}Rj~Xi~Xi}Xi~]h\7f\h~Wi\7f]j~]j\80Yk\81Zk\80Xm\80Um\82Xn\83Yn\84Yp\85^p\86]r\87^u\87`w\89dx\8bdy\89dx\8a`x\8cbv\8b`w\8abv\8ccx\8a_y\8daw\8ebw\8bdz\8ed{\8fm{\8e\84\83\92\85~\8f\8c\81\92\90\7f\8b\8c\82\8c\91\87\8d\9b\91\8c\8f\8a\89{\7f\83bhs_drmnteip{vw\83}z\89\82}\96\8c\83\9a\8f\86\96\85\83\8c}~\8c\81\80\83xx\9c\89\85¬\99\8f®\9b\8f¯\9a\8b´\9f\90\9f\92\88£\95\8aµ¢\93«\9b\8e©\97\8b\96\88\83\9d\95\8b \94\8b\97\89\86\8d\81}\8f\86\84¦\96\8e«\98\8e¶¤\95¸§\9b\91\89\89lozkpylrx\89\80\81\81x}\80}}\8f\8a\83\9b\90\88\9a\91\89¦\9a\93º¥\99¸£\98² \97«\99\94¥\96\94¨\94\92¤\97\94\9c\95\93\95\8c\8c\90\84\8a\96\91\8e\9f\95\94\98\8f\8f\9e\98\96\9f\99\96\98\8d\8f\96\8d\90\97\8c\8f\8d\83\89\87\81\88\81}\86oq|lq}iq}hq~an|fr~ekxeo{djwC[hEWeIQ`BR\?R^=O`@L\CM]DO_CP`ERbCScGUaN[SHV^FThDSdDTdETJGQ3?J/IOIBNK@J<@G8ADHGWiEVkDXjGXlHXnKZnH\pKZpO[qJ]qM_sO_qUh|o|\90\97\99£\9e\96\9d¨\98\9c¢\95\9c\9f\95 £\9c¢\94\90\96\97\8d\94\97\8e\96¥\9b¥\9e\94\9b\92\8f\9bª ©¡\95\9e\95\8f\9b\9e\94 \96\8b\97\8a\86\97 \99¨\9d\9a¢\93\8e\9a\92\8d\9c \97¦\90\8d\98\88\86\97\89\87\93w{\8brr\88il\81ek}ai}\fzXezWc{Zc}^e{Wd|Qe|Xj{\g|Wh}Vi~Vi}Yi}[i\7f\j~^i\7f\l\81[n\83^o\84_q\85_r\84ar\86ar\86_u\87bv\88ex\89b|\89fx\8bcy\8bdz\8cbz\8cfz\8ckz\8cs}\8a}\7f\88{\82\88\85\84\89\89\88\89\87\88\86\8a\89\80\8e\8c\85\94\90\8duy\82hq}~\81\89~}\88}}\8c\91\8a\8d\8e\8b\82\90\8f\81\96\93\87\8d\85\84ru|_huvs{\93\8a\83¡\98\8e\9f\95\8e\9e\95\8c\98\8e\88\8a\83\81}{\7fomt\7f}~yuv\81zv\9d\8a\81¡\8f\86§\98\8d¯\9d\91µ¡\91°¢\91°\9d\8e\99\8c\81\93\89\83®\9a\8d¯\9a\8f\9a\88\83\95\87\82¦\96\8c°\96\8d«\96\8c£\97\8b¡\90\86\9c\86\82\95\8a\85\8f\82\81\8e\89\86zz~|y}ss|\98\8d\8cª\98\93«\9b\93¬\9d\92¹¨\9b·¥\97\9d\8a\8b\9d\8c\8a\98\84\85\95\80\85\93\7f\86\88}\85\95\87\8d\96\8e\8e\95\90\90\91\8f\91\8c\80\87\91\83\88\8b\86\8c\93\8c\8c\9b\90\8e\94\8d\8e\94\8e\8e\96\8f\8f\96\8b\8e\93\86\8d\90\83\8b\91\88\8b\82\81\89wu\81qq}jo{fo|hnybivhryinwF\iF[iHWdEVeDTdFSdFRcCRdDRcDRbBSdGR[IQC@H/JTKN_PR[WO]cO]75B\e0:#8>,,0)=E6%+\1e>EPJ]nEYmHZpJ\pK]rM_rIauIbsQ`sS`tMdtOatSd|_r\83\u\85\8a\8d\9d° ©ª ©¤\9b£¥\9b¦¬¡¬²¦®® ¨°¤®®¢«­ §¡\97¡\9f\95 \9b\96¡\91\8b\98\8c\85\91uv\88\8f\8b\99\8b\87\94\88\84\90\86\80\90\83\80\90qu\84R`tXczUdyWdzUg|Wg{\f{Zj}\k}`j~^j\7fZk\80\l\7f_l\80]l\80_m\81\q\83`r\84cr\83et\85ct\88et\87du\88et\8adu\88ds\87_u\85es\87du\87ev\88dw\8bdy\8dkz\89q|\8ay\80\8c\83\82\8c\83\82\8c\80\87\8c\8d\8e\8c\98\90\8b\98\93\89£\9b\88¥\9b\8b\9d\98\89\9f\98\87¦\9e\8a©\9d\89§\9d\92¦¡\9f\92\8b\8d\80}\81wvztsw\87\81\83\9c\90\82\92\90~\8e\8e\7f\98\91\83\9c\92\88\86\82\84pqv~y}\9b\90\8a\92\8c\82\89\86~\88\85\80\88\80~~yy|{{}|z\8e\8b\84\86\81\7f\7fyx\8f\84\81\85yx\9a\89\83¡\8f\87£\93\87©\9a\8e®¢\92¨\98\8c\9b\8f\81\9b\91\86\85z|\81x|\95\8b\85¥\95\8b­\99\8c¬\99\8a£\92\84¡\90\85¡\93\8b¡\95\88¡\90\85\9e\91\89\8d\85\82xwyptyzvznpw|{\84ª\98\96\93\88\88\83z\81\89y\7f\86v|\9e\8c\8c\8e|\82\8c|\82\94\88\8a\99\8b\8e\94~\87¢\93\92\8a\85\88\84\82\87\8c\82\89\87\7f\88\95\86\8a\89\86\86\93\8e\8c\97\8d\90\8b\85\8b\80\7f\87\8b\81\87|z\83x~\85xy\83yw\80zx\82ks\80hr~gs|mqyiozenyCZfDXeJSdCUeDUfFTcITaDTcBSfAUdGVgHV`:D;:C2KT6DN4DO.<E0:E#8D%')\1c.1((0#)/)26<R^jPcqM^qQasMbuMavPctOcuRcuOdwMeuOcvQbwNbxNcyUi~\k\80]m\83av\88gw\89n~\92{\87\96}\83\95v\7f\90w\7f\92x}\90z\80\8fy\7f\8fy}\8fz\80\8fqx\88vw\89lu\89ku\87hp\83el\7f_k~Yl\7fZk}^m\80^l\81`n\7f^n\81]n\82_n\82ap\82co\82fo\82ar\85cq\86bt\86at\87_t\89cr\89cu\88dt\87eu\87hu\88eu\87ev\87fv\86fs\86]p\86_n\84co\84ft\86nw\88v}\89{\80\87}\7f\87\88\82\8a\95\89\8b\9e\90\8e¢\91\8e¥\95\8f\9b\90\89\9b\97\8b\9d\95\88§\98\89¢\97\87\9d\96\88 \9a\8e¤\9e\8c¨\9b\8dª\9a\88¦\9a\95\8f\8b\8b\95\90\87\9f\96\8f\98\94\94\8e\86\8b|v}{z{\94\91\83\9a\97\87\8e\92\83\99\94\85¨\99\8a¤\98\8d\9b\90\85\9e\94\8d\82}\7f\81|\80\82|\80~\7f\80\82}}\8e\87\83\98\91\85~\82~\87\83\80\84|}\84\7f}\82|yhep|y|\89\7f\7f\94\86\81\92\83|\96\8a\80\9f\93\87§\95\8a¤\99\8c\8f\85\82lgsvtwytx\96\8b\84«\9d\8d«\97\8a¥\95\88\9c\94\87£\93\88£\90\87£\91\87¦\91\86¤\90\89\83~}{x{zw|ilv}z~zt|\86~\80\92\87\88\95\84\87\9d\8c\8b\95\84\86\8ay\83\85u\80\84t\82~p\7f\91\81\8a\82x\82tw\81wz\82su\81z|\83|\7f\84yz\82zz\80kr}ps}sv}ow\83qx\80dn|fo~gn|nq}akzes}it|fmvjsxCYiFXfJVfIVeCWgBWfFWfFWeEVhG^kJVVKX[LZHHP6CJ,GO;>L*#*\15!'\1726'+."+,((/'0796A7DJ9KXjK\tJ]qK^rI]sM^rM]sM^tL^rIaqL`sQ_rO^sM`wLbtL`uLcuRawScxQfyOhzSg}Qi\80Ri}Ri|Ui}Vi~Tj|Wh{Wk\7f[k\80_l\7f[m\80Xq\81\q\81_o\82\p\84`o\82]o\84]r\83`p\83bp\82aq\84^q\85_s\83_q\83_r\85]s\86`q\87\s\85fu\86qx\87t|\88w{\87\83~\89\89\83\88\8e\86\8a\91\88\8b~y\82io\81^l\81ks\82\81\7f\84\8c\88\86\91\86\85\93\8a\86\9a\8e\88\9f\8b\85\9e\91\88¥\98\8d¡\91\89\9e\8c\83¡\8f\83\9f\92\8a\9e\90\87\99\90\84\96\92\86¡\99\8c¦\98\89§\96\8a¤\98\8b\9f\97\85¢\95\88 \95\94\9d\93\98\8c\8b\8f\84\80|\91\8b\80\99\96\90\96\92\92\85\83\83\7f\7f\80\86\84\81\8b\87\7f\8e\8f\81\92\90\83\99\90\86\93\88\80¥\9b\90\9f\97\8f\8d\85\87\83\80\83vsw}z}\83{\80\87\81\83\8a\88\83\84\85~\8e\89\84\86\80\7f}|}\93\87\84\83~{mouhmq\86}}\94\84}\93\84~\93\88\80\96\86~\96\85}\97\8a\7f\93\84\81\8b\80\80zsy}w\7f\9d\90\8a\9d\8e\8a\9d\8d\88\9e\93\87\9f\8d\86\9c\8e\85¦\96\89©\98\8a¨\99\90£\92\89\9d\8d\88\8c\7f\81\80|\80\87\7f\82\80t{yx|}vy|v~\85z\7f\8a|\80\89x\7f|rxts{wt|lmymqzgmydmx\nw]ksgrwep{jt\80ju~nw~nt}fs~sy\82lu\80fu~ju~is|nsynpwltxx|~ouyBXhBZhC[hC[fEVhFXiGZkG[lI\jIZQEM6=D7JR5UU9CM.LX49I*>E'7@'$)\1f\1c \e\1d \e!%\1c#*\e/8"6<AHYqI]tM]pN]qI\sP`wR^sK]sM]sL^uK`uL`uQ_sLbrNbuOctOewWeyYh|bk|bozfp}lr~ry\82v{\86z}\89y~\86\80\81\86\83\86\88\81\84\8bu~\87kv\84fr\84ct\84eu\84cr\83cr\84bs\83`s\84as\84gr\84ft\86ft\83ev\85gv\85oy\85sz\86tx\84z{\83\84\83\87\8c\88\88\97\8c\8c\91\89\86\98\8d\86¡\92\88\9b\90\86\96\8f\85\9a\92\8b\91\89\88\86\83\85\8f\85\82\90\86\81\8c\86\82\81{\7f¡\8a\82§\8c\81\9d\8b\83\9d\8f\86\9d\93\8a\9f\95\86\98\85\8e\85¢\93\87\9d\92\87\9f\95\89\9b\95\8a\99\93\88\95\90\85\99\93\84¢\97\89¨\9b\8b\9a\93\85\9c\93\88¡\94\91\9c\92\92\90\8b\8b\84\80|\94\8a\80\92\88\80\96\94\93\9f\9b\9d \9e¢\9f\9c \9e\9b\9d\86\84\82\84\86}\8b\8c\80\97\90\81\94\90\81\94\95\87\94\96\8b\9a\96\90\8d\88\86\8c\85\83\89\83\82\88\83\84{z}{{}\82\7f~|||qsw\85}~\8d\82\7f\8a\82~{|{tuy\8a\81\7f\94\8b\83\94\8a\81\97\89\80\95\87\82\95\88\82\96\86\80\9b\88\82\98\89\85\8a\81\81\89~\7f~v{\8a\82\83\97\88\86\9b\89\85\9a\8a\84\9d\8f\86£\91\89¢\93\8a¢\91\85¡\8f\84\9d\90\89\93\87\87}t\7f\85\7f\85y{|vuxsovlqwgnswwy\8e\88\8a\93\8c\90\82\83\8bfmxfryoszlt}jszqx}qw|gt\7fgr\7fpx\80nw~qw|sv|tz\7ftx}rtzmszju{mtyswzlotfluXboE]jF]iIZkH\lJ\mI^nH`pI_qNhi8I2<I(7A#1;#BL/?M(.;\1c(1\1aAH%7C$#) )+"(/\1f\1f$\1d)//;AD=?NI[sE[pIZoI[pJ\pN]sR]sR_sPcuUix[gx^k~bq\81iv\82n|\88t\82\8ey\85\90\81~\88\8c\82\8e\91\93\99\94\97\99\9a\9a\9b£\9f¢³°¯©¦\9e\87\83|\9e\91\8c\9b\8d\87 \9a\94¤\9b\95°©¥zy\82ko}xt{ws|sw\81qz\81yz\82\81z\85\85~\84\86{\7f\86\7f|\90\84\84\90\88\84\92\89\7f\9a\8b\82¢\91\89\9e\8c\81¡\8f\80 \91\85\97\8b}\96\8d~\90\8c\80\93\93\83\94\92\80\96\8e\84\98\92\85\9b\92\85¡\97\8c \93\84¦\95\89¤\93\85\9d\90\87\8b\80{tov \90\85¥\93\83\9f\93\83¡\8b\7f\9d\8c~\9f\8e\83\9f\94\8a\98\95\8c\93\8f\81\92\93\86\97\94\87\98\91\86\9c\95\89¡\96\85\9f\95\86¥\98\88§\94\87¦\95\88\9c\8d\88 \94\8a¥\96\88\9d\92\89\9d\96\8e¥\9d\99\9b\93\91§\9d\9d© £ª §¬¤¬\9b\94\96\87\85\81\8e\91\8d\94\91\88\9f\94\86¡\9b\8b£\9b\87ª\9a\87®\9b\8d \96\88\91\8f\8b\9b\94\91\9c\92\8e\8e\88\87\88\86\83\8f\87\82\8c\85\81\7f\80\82~|{{}~vu||}}\86\81~\8d\86\7f\89\85\82\92\89\81\8f\86\80\88}{\88}z\8d\80}\9b\8f\86¢\94\88\98\8b\85\9a\8a\85\93\83\84\8c~\82\92\84\86\9e\91\8a\98\8d\89tqwzxy\97\8b\8b\9b\91\8evu{ooy\86\82\88rv\7f\7f\83\82\8d\89\89\84\80\82lpxiquipsgmwkovlryvuymqwt|\80fovlsyjrxkpxluzotxtuynqwmswquygrznrzoqvjszqu}gpybltalqX`nefqJanF\mC^nD_nFaoIcpNfqQjsCYDBP09F!7F#8F"2A $*\17,4\1f&/\e"'\19 '\18!#\1a14#*3\1f9=5/90\ f\12\14/4BPayP`pWgtXjybm}pv\85u\81\8d{\82\8d\84\8d\96\8b\92\98\8d\92\98\8d\8f\94\8a\8d\93\97\94\99\95\92\96\8d\8f\92\8e\8a\8e\99\8e\92£\92\97¬£©Ã¾ÀÿÄÀ¿º¹µ®±¯\95\9a\92\8f\8a\81\8e\82\7f\92\82\7f\9c\89\80\9a\87~\98\81z\9a\84}\9e\8a\81\9a\8a\82\99\8c\84\9b\89~\99\86{\94\80|\8f|w\98\86\8c\8e\8c|\9c\89z\94\83t\99\83{\9b\88v\9c\89v\9c\8c~\9d\8f\80\9b\8f\80\99\90\84\99\93\85\9e\93\84\9c\8b|\9d\8f\82\9d\94\88\98\8f\86\99\8b\81\9f\91\82¢\8e\82¤\8e\82°\9a\8a\8a\7f~sow£\92\83 \91\7f\9a\90\83\9d\95\88\9d\96\8b\97\93\85\94\92\85\98\91\84\99\94\84\99\93\83\9b\93\89\9d\94\87\9e\94\83¡\96\85 \96\87§\95\87 \8f\87\87\84\8d\86\85\8e¦\94\8b¢\93\8b¢\9a\92¤\9d¥£\9c \9a\92\92 \94\90¡\92\8a\94\8b\89\9b\96\9d\98\8f\8d\92\8b\8d~\82\86~{{\8d\83\81¤\97\89§\97\82¨\95\81®\98\85§\96\86\9b\94\85\9c\93\89¥\99\8b¡\9a\8c\9e\95\8a \95\8d\88\87\85\8c\85\82\8a\85\83\82|~z|~vvyzww~{\7f\82\80\80\84}}\8a\82}\8c\84}~{\7f\8c\85\85\87\82\85\8d\86\89\95\8c\89\95\8c\8a\90\8a\88\8f\88\83\99\90\8a\89\82\81nsw[dmtuwpvxgmtblvgmtmotcjnmmpjludlulqwhoxakv\goWgrfhqbbmajs^kskoripupqvruytsxqrvfmvhqvmrthnv_esUfp]kr]ioQ_k_fqfpyfs|\86\90\8f^jxqy\80x\83\87\83\8a\8a\8a\91\8f\92\96\93\98\98\97 ¡\9dlz_5G&DL(8B\1f,4\e\1f(\19\1e!\16%)\18\12\16\10\e\19\e/41\1d#\17&*"AE=EP0KREchjz~\80\84\8a\94\90\94\9d\8c\95\9e\8c\93\9c\8d\8f\9a ¢±\9a¨¸\98©º\9b©º\9d¨»\99§¸\97£³\95¡±\95 ®\91\9f­\8e\9dª\91\9e¦\96\9b¥\9b\9eª\9b¡­­°¾®±¾°³¾¸¹Ä¸¼Å\7f\84\90\80\7f\7f\7f}r\90~r\91\80w\98\87\8cz\96\84v\93\7fy\9e\88\82\9d\88}\98\86{\9f\88|\92\84{\9a\8a\80\9f\8b\80£\90\80£\8f}\9a\87v\98\88{\9c\83w\9d\83u\99\89w\9a\8dx\9b\8d}\9a\8f\7f\9b\8d\80\98\91\82\9a\93\85\9d\8d\80¢\8c\8e\83¢\93\8c \93\8c \8f\84¤\8e\81¦\8e\81¡\8c\7f\9e\8d\82\80tv\82|}¡\99\8c\98\90\82\98\94\88\9c\95\88\9d\95\89\9c\97\88\9c\98\87\98\92\85\99\8e\85\9d\91\84\9b\90\84\9d\93\87\9f\91\87 \94\82\9e\92\83¢\93\8a¢\8f\85\8c\86\8e\8a\8a\99¢\95\94£\9a\91\9f\93\90\9f\94\97®¥«£ £\9e\95\95\9e\97\89\9d\97\89\97\92\8c\9a\95\8f\9c\96\8f\8c\88\8a\8b\88\85\8f\8c\83\93\89\86\90\8d\86\9a\93\88¤\95\8a£\97\89 \98\8a¢\98\89 \94\88\8f\8b\8b\97\90\8e¤\96\92¦\97\8d¢\99\8d \9b\96¥\9e¥\8f\8a\91\87\82\88\83~\81\87\7f\81\8a\81\82vvzpswsu|jpxnrxekrwv}wtzsuz~yz\8a\85\82\88\82\7f\93\8c\89\8b\86\83ttz\81\7f~\83\80\7fsuxZhr]fr[bl{x}ssvWdq[dp_epY]mdfmhkohmrkrxpquaksintkmrhjrhlubhrhkqajpdmuekulowakqdprdot\8d\9d\9b ¦°\97\95\9e\85\88\91\94\97\9e\9a\99¥\92\97\9f\81{\80\9b\99\98\9f \9f¡\9e\9d\9c\9d\9e\9c\9b\9d\9a\9a\9c\9d\9f¡p~o:N/.>\1d1:\1d$,\e&*\1d#'\1a)-\1e"$\1e//--6*&-\16EK,CG:JW+QMJ¡¡¯¢¦«\9e\9e¤\97\9a¢\96\98¤\96\9cª\9c¦·\9dª¾\99ª½\9c§¼\9d¥¹\9a§¼\9e¨½\9fªÁ\9f­À£­Á ®Ã\9f¯Å£°Â£®Ã¥®Ã\9f¯Á\9d¬¾\9e«¾\9d«¿¤¯Âp\7f\8f>I_\84\82\89\87\80|\86}v\88wn\99\82w\9f\88v\9e\89y\9f\85y\9b\83w\9b\86y\9a\8a\80 \8e\80\93\85y\99\88\91\81¥\8d\89x\9b\87y\98\85w\9f\87x\9c\89x\9c\88w\9e\8d\81\9d\92\82\99\8e~\9a\91\82\9b\94\86¡\98\89\9d\91\84\9f\8c\8c\8b\80¦\8f\88¦\92\87©\8f\85\97\81{\86yx\88}y\94\8b\80 \9a\90\9d\98\8f\9b\94\88\99\93\86\99\92\87\9a\91\85\9a\91\85\9a\90\84\9b\93\85\9a\91\85\99\8e\80\9e\93\84\9b\90\88\9c\8e\8b£\92\89¥\94\84¥\95\86§\94\86\85\81\89\8f\89\93\96\88\8d\94\8c\91\9a\8f\8e \91\94¶ª±¸°¶\9c\92\95¥\9e\9c¢¡¤¢\9f ¦\9f¤©¡¨®¥ª¡\99\9d\9f\9b\9c\95\8e\91\8a\88\81\89\86\7f\8a\87\82\95\8f\88\95\90\83\9b\94\86 \96\8c \98\94\9a\92\93\8d\8b\90\95\8e\93\9e\96\91\8f\87\8d\89\82\8e\89\85\8d\8c\84\88\93\8a\8b|x{\8a\82\80\85\7f\7f~~\81\88\85\85\8d\87\87\8c\89\88\8f\87\86xtykry{|}opwjoxknumnyzu~zvvklradk`hqR\h]bkahrnq{fgqafpmjoztzvouvutpss|xxtvywwwrsupruorwptvqyyqxzkprfosktyhlumrwety]lt]ns¤°±´®¿¬¬¹¯±¾\89\85\92tu|sux\85\92\99\8c\94\9d\8f\97\9f\8f\96\9d\91\98\9e\97\98\9b\8f\8f\8f\8c\86\89\8b\8d\8bXiJ->\1e+1\1d(+\e\1c\1e\1505!&,\e48%061.8!28\1f27#;F&IN8{z\82\9c\9d£\8f\94\93\8d\91\94\91\97 \98\96\9a\9b\9fª\9fª¾\9fª¾£­Â ­Â¦®Ä¥¯Ã£¯Ã\9f¯Â¢°Ä§°Â£¬¿\9f¬Á¢¬Á¡¯Ä¡­Ã¢®Ä©²Å§±Ã«·È{\88\925CVhhp\85\7f|\93\88\87\89\85y\8a\80r\97\83v\9e\8a\91\80¢\92\80\9f\8ax\9d\8a|\9d\8d\80\99\86r\9e\8a{\9e\89y\9e\85x\9d\87y\9f\86x\9f\87s\9b\8c{\9d\8dx\9d\89x\9b\87z\9e\89}\9d\88{\9e\8c\7f\9c\91\82\9b\92\87 \93\85 \93\85\9e\8a{\9f\8c\81¥\8f\82¡\8b\8b\81\82vw\83{}\9e\8e\87§\96\88¥\9d\8e\9d\96\87\9d\96\85 \96\88\9e\93\82 \92\82\9f\92\86¡\93\85\9f\92\80\9b\94\84\9b\92\84\9a\92\81\98\8d\81\9a\92\89\92\8b\88\97\8a\88 \91\88\9b\8e\84¥\95\8c\9e\90\8bzy\86\91\86\8d\8f\84\8b\8d\87\8b\9b\8e\93\97\93\99\9d\9b¥ª¤«³®°³®³§¡©\9f\96¡ \96\9a§£¥£ ¥\93\90\97\97\8f\90\97\92\89\8d\8f\80\90\91\7f\92\91\81\96\96\8a\98\95\8d|ux\84}~\9e\8f\8e\8a\82\87\90\85\8a\8f\83\83\92\8a\81\96\89\83\9e\8e\8c\9c\90\89£\97\8e\90\8a\86\8e\86\84\8d\87\82~|{\82}|\7f}}\82|{\8a\82~\80wztsvywxsqvkqykmr]erou}imvbksfqt`luafs_fpXdoUamrpw\88\7f\7f¥\93\8f\96\88\87\83~\7fiounmtllrkptrrwttuwwznoyils\84\89\8b{~\82qtvouvjrvtvwrsunuz`htjwz\96¤ª»½ÅÉÆΪ¤´\99\97¦\95\93\99yy\82x\81\8bz\82\8b{{\86~~\8ay\80\89}}\85|{\81\82\83\8dnxh@M#9D"5;#7?'(1\1d)3\1a",\164? 28!:A'=F(HP+GN-LNFrrugogFP:`gY\80\86\80?H*QFD¡\94\9c©¡\9d\97\8d\8e\98\91\96\94\92\99\9a\94\9e\9b\95\9f¤¨¯¢¤¬\9f\9c¬°«·­¯¸¬°¸§®º¥¬»¤ª¹¦¦¸¬¯¿}\8a\965GYimx\98\91\8e\92\8e\8d£\9e¡ \9d\97\93\8fz\9b\90\80¡\94\85\9e\92\81¢\8f\81\9e\8a\8e\8au\9f\88x\9e\8a|\94\87u\9c\8a\8f\7f£\8ax\9b\87s\9e\88z\9c\86x\91\83y\95\85\7f\9c\8c}\99\8a\8f\81\9f\8d}\9d\8b{\9e\8b\89\8a\8c\8a\81­\96\87\8f\80y\86z\82§\92\89§\95\86 \95\85 \93\85\9e\94\88\9b\93\83¡\94\83 \95\85£\93\82¢\90\85¨\98\88£\95\83 \93\84 \92\85\9b\90\83\95\8d\89\9d\93\8e\9d\97\88 \94\84\9d\8e\85\94\87\89\97\88\87£\94\8e\92\83\86\85{\87\8e\83\8e\8c\80\89\9d\95\9d«£ª\9b\95\9e£\9f§·°·»®·\9f\9b¥¦¢¨±¨®§\9e§\95\92\9e\95\90\90\9c\94\8c\9a\97\8b\93\90\82\97\95\83\91\8b\84\92\8f\8d\94\88\89|y{kpo\83\80|\95\8d\82\9f\96\8a\9f\94\8e\90\89\8a\90\86\8a\8e\81\87\80{\86\83\7f\8d\8e\86\8b\91\88\8d\91\89\8b\8f\8a\8d\95\8c\8c\8f\88\88\8d\87\89\8f\8e\88\9b\90\8c\9e\95\8c\9b\92\87¡\99\8c\91\8b\86\89\87\84\87\85\82{{}pprx\7fyclpelmknpprs\80\7f~uy\84il\83\9d\8d\8b² \98\7fwwtussvxajrfhoontlmqgotkotqnumptgosiorlppkppnoninoainQ[jpuwxyyqwysvytrxggplu|\98\93¢\94\80\93koyhr|ioxmr~gqzjlump{fpw>M2.=\1c.6\1e7=%?L'8D .7\1d1:!1?\1f(*\16\e!\12/5\1e4:!@C+Y`RR[S+3&0:$dfZUa=X\J¤¢ Ä½¸¤\9c\95\9a\8e\87\9e\92\8b¡\93\8a\97\8e\86\9e\8f\88°£ \9f\97\92\94\8a\90¼¬ª¼¯©À´±½°«Â²®°¥\98\86\82\83\84\80\86]dimp{£\9b\98\91\8a\85\9a\8c\8f£\99 «¥ª\9f\99\8f\84\80q\91\87\94\83 \8cy\9d\86v\9d\85\86s\9a\86s\8c{l\9d\89\90\85\97\86s\94\83k\99\84w\96\85|\9b\89\8d\7f¤\8e\80\96\86z\85yv\99\88\8d\8c\8c\8d\8b\8b\91\85\8f}{\82z{¥\90\86¦\94\87\9a\8c\80\9b\92\82 \93\85¡\95\89£\93\83¢\93\80¢\94\85\9d\8d}\9c\8e\83 \90\83¢\93\87¡\91\84¡\92\84\93\86~\99\8d\85\9e\97\88\92\8c\82\96\8d\84\97\8e\80\95\8e\82\9f\90\86\96\87\88\91\84\8e\91\83\8f\8c\81\8c\82{\87\82\80\8d\92\89\96¥\9c£¤ ©¯¨°²©¯ª¥«¬¥¯\96\8c\92\8a\83\7f\8d\87}\9e\92\8c\99\8f\8e\8d\8b\8a\84~\82gkqhnr~|~\89\81~\9c\97\85§ \8b§\9e\8c©\9e\92\9b\8f\8d\80|\86ko\88}}\8d\95\92\94\9b\96\95\97\95\93\98\94\94\97\93\91\99\94\90\9a\95\96\9c\95\98\98\92\94\91\8b\92\86\86\93\81\82\8f\80\81\8e\88\7f\8e\99\8f\92\9d\94\93\94\8c\90\9f\94\97«\9c\9b¦\9a\98¢\94\91 \96\93¥\9a\97©\99\95 \94\96\99\8c\92\85\81\8b£\99\9e©\99\92¬\9c\93\9f\91\8f\95\8d\84wrp]bmjipmpqelncjodknegmcjncjllmpnsqilsjnrfkoYbo]gmhns`jsutuywwqwvqwtrsx\83~\87\90\91\98go|jt~or{mpzls|or{qs\81u\81\89Q_C<H!\1f(\17\18\1a\11(1\1c.8\1c0:\1f(.\1c)/\1a'(\18$(\e$)\1c $\18TRWQZS\1e&\1d,/ ;@*LS0AC/\82\7f\80gghty\8c7DYgm\84\93\92\9a\8d\8d\9a\9d¢¯¥¦­\95\97 \9a\99¤\9f¡«\9d\9d¨  ©£ §¤¢«¡ ©¡¢ª ¢©¢¡§¸´·¦§¢\8b\84\7f\8f\8a\87\8e\85\80\88|{\96\89\8e«\9f\9f\94\8f\8a\85\80u\8e}s\94|v\95~x\99\85}\94\82pSW2[Z>zq`\84ujwqLY^0sqO\83{b\8c\80m\9e\89}\9b\83x\95\7fz\9e\88\8b\8c\8d\8b\91\81¦\8b}\9c\84{\91~z\87{|¢\92\8a \91\85\9f\91}\9f\91\7f\9e\90\7f¢\95\8a§\99\87£\8e\91\81¥\93\81¤\90~\9b\88\81¢\8f\83§\8d\81¢\92\88£\93\86¡\92\84\9f\97\85\9f\91\84\97\8c\84\91\88\82\97\8e\84\9c\8f\82¡\93\83£\98\89\94\89\8c\8f\82\8d\92\8a\91|\81\92vx\8bll{xx\87¥\98¢¤\9e§°¨³§\9e«\95\90\9a\8a\85\8b\87\83\86\8a\85\85\92\8a\88\90\87\83\8b\84\7f\92\89\81\88\85z\96\8f\80\93\8c\83\9b\95\8a¡\94\87\9d\92\88\8e\8c\8fv{\8cuw\88\82\83\8d\9b\94\92¦\9c\97\9f\9b\92¢\9c\91¢\9a\8f\9d\96\8d\9e\97\8c£\99\8e£\9c\91\9b\94\88¦\9b\8d¢\97\8f\9f\97\8d¡\9b\8f\92\8c\8a\88\81\84\92\8b\8b\94\88\89\8c\86\88\87\83\89vu|ut}\89\7f\85\8a\80\88\80{\82ypxpr|\86\80\8a\92\85\8a\8f\8a\8c\97\8c\8e\96\8b\8e¨\9b\9c\99\8b\88~{{opu_bndkqqxumrtlstoorgkmimnhin]ek`gmgknbei`fojkr_dpafn_dm^eojnt{ywwruhjpafqnw\81ms|mr|lr}hmwqx\81sz\86[el?L21;\1c5@!&.\1a,0!59'06" "\17,0!*/\1f$(\e\ e\10\10HFPWZ\FJA,5 ,4%/9\1f.7\1e>@7@C>@GP0<Smv\86¤\98\9e¥\96\9c\9e\92\97¨¡«¬¯¸\9f£¯¡¥±\8a\90\9d\98\97£\9c\9c¦¡ ©¤¢«\9e¢­¦©µ £ª©\9f¥´°¸¨§¦¨¡¢°¬­­«§¤¡\9a¤\9a\99¯ ¥®£¥\8e\8f\83\8d\86x\93\83z\92\80v\98\87x\87}^OR+7;(5=$=B)5:!9C ?H&:C\1fih`\8f\85\86\89\81\83\8d\83\86\9c\86\88\8a\8e\92\7f\9a\83z\81zy\92~y\9e\84\81¯\95\89¡\8d\82\9e\8b\81£\92\84§\93\86¨\94\82£\90\7f¤\93\83\99\87~\94\86\82¨\99\86 \8c|\98\83\90\84¢\8f\83\99\8c\80 \91\89¢\91\89\9f\90\84\97\8c\81\9c\8e\83\9c\8d\83\9c\8d\84 \92\82 \90\7f§\96\89\92\89\8c\89\83\90\8c\82\8f|z\8cvs\84\84}\87\8c\86\90\9d\94\9f\8e\88\96\81~\8cvt\81qpz|uzwos|xx\98\99\85 \96\85\9e\94\82£\9f\88\9a\93\83\93\8a\7f\97\8e\83\9e\91\85\92\89\83xz\86en\88\8d\88\93° \9f§\9f\99\9d\97\8c\9a\95\8a\99\93\87\97\91\81\99\91\82\9e\94\84\99\95\82\9c\98\88\99\94\85\8e\8a~\91\8c\7f\8c\8a\80\8d\89\86\90\8c\89\91\8f\87\8b\84\82\8a\87\80\8f\87\83\8d\84\7f|yzghmgjluvskejkhghkjQ\eS\cjjohjmtqwkmvss{\88\80\7f\87\80\80zvyrrxpruvvsqrprrswursvutvutuskrsmqroqqlrrhpsmoqoutyxswtrggmeiputsvquuttkjqcftahxbgtflxps~jquNXb@HF8?)/5\1e47 +/\e5=&$$\1a+, \1f$\19 (\1e!(\1c"'\1a%,\1c')$05)8A+@M*?L)NQAQ[VLOWS]a5<Q|\80\90\82\84\92tq|sn{\81s\80²¢\9c»±«½´´¹³¦knw~}\90¬ª±¨§¬§\9f¤¢\9b¥§\9d©¨§²¥ §®ª²°¬±°§¬´®¯º²²²¬«®¨¨¦\9e\9c\90\8eyVV@cfElpW\97\8b\9a\81T[5GO)NW-KS)57\1e8@#V_,X_-MW)pka\81\80\8e{y\84\96\85|\9e\86\87\8d|\9d\84z\8fzx\8a|y¦\94\8a¬\91\82«\8e\81ª\8d\80¬\8f\82´\97\89«\94\81§\8d\8d\7f©\8e\8a|\99\82\7f\9f\8c\81£\91\82\93\80x\9b\88\8e\7f\9e\8c\80£\8f\82\9b\8b\81\96\86\81\9e\8c\82\9d\8e\82¢\94\86¡\91\83 \8e\85£\92\87£\92\89\9e\8c\8d\95\85\8c\86\82\8d\92\88\94\86\80\8d~|\87\8c\87\8d{y\85imzjjurpwkq{}z\82\80\80\8b|}\89\8e\89\8b\96\92\84\96\8f\82\9f\99\87\9d\96\84\97\97\87\9e\99\8a¤\99\8b\8f\86\87io\87dn\8a\9e\91\94²£\9c¢\99\93\9c\96\8f\9c\98\8b\95\91\80\9a\94\83\9c\96\84\9a\95\84\95\91\82\93\92\83\8e\8c\7f\8c\87}\92\8d\83\90\8f\83\8a\83{\8a\85}\93\8b\83\8f\8b\86uovsnq{uuqpoklkgkmGO]GP\KP_wup}ztpnrjlmiqpgknhgjlsqv\85\81ptwuzxtppadipqqjmlqsnlonfkn[bfOU]\cfWafZdkbim`hkcejbbggpohomjfikfmglphnqorsonqhmp]kp\in^fqhvw@P7,4\1c3<)AK-5=\1e*4\1c-4$5?\1f3>\e)/\1c38!8@$6@%1; :@-;G).5\1d"&\e%,\17.7\1e,2\1f3;$5>/VVX@AFom{\9d\9d¢smn\89\81\85ptw\7f|\83\9f\92\95\9e\90\96 \93\97®ª§\7f\89\8e\7f\81\96´³¾®³¹­°¹®«³¥\9f¥¤\9b  \9a¡¢\9a¡¥\9d¦ª¡ª±ª¯¹¯·½¶¸y\7fcQZ7>E'6<\1c:F#39\1d[`;]b:GP'@H#2<#=H'T\,NV+Y_,OV'-7\1aJJ8\86xv¢\8c\81¨\89\8f\80§\8e~\98~s}np\9d\8a\85¾¤\97Ĩ\92«\90\82©\8a\80«\8f\85w\9b\85\7f¢\8c\8c\8bz\9f\8b\8c\87\84z\9d\8a\7f\91\81\8d\82¨\91\80£\8a|\9c\85~\9d\87}\9e\8c\8e\82¯\95\8a£\8b\82 \8c\81\9b\8a\80\9b\88\83\94\82\81\8d\81\88\7f{\88zv\85qo|pqxoouimsgjslq~ou\83ls\84sw\8dqy\8cw{\8dxz\8e~}\8b\91\8b\86\93\8d\82\9b\94\85¡\9a\8d\9b\9b\8e¥\9d\91\95\8e\8deo\88jp\8a\8f\84\8a«¡\9c¢\9c\96\9f\9a\8f\9b\96\8c\9a\95\88\92\8f\80\8c\89}\93\8a\80\92\90\83\8c\8c\81\8d\8e\84\8a\84~\8b\89\81\93\90\87\95\8c\85\91\8a\81\97\92\84\99\91\86\88\81}\81}}npnstroqpwwo\84~trqnw{qwwmglk[dg\df_gkY`cagi_dgtyuª¨®\91\89\95~\81\9f uuyYae_caosiY`fHQ^Sdhz\85\8dhfq^dggikdjedto[fgXceYac_ghegj`dhZ^b]agbfj\dm[cl\90\99\9f\91\9b \91\9a \96¢£i}gR_Kitipzqs|tlvlafa~\8b}N`G',\1a,0!)/%),!-6"8B(4<$.5!&+\1f8?+=B229+JOHwxx\8d\86\8e¡£§\9e ¦\8c\88\90\8a\84\8a \9a\9f³®«\9f \9f\99\95\9a\98\94\9c \9a¡·®´\94\96\9b¡ ®¬ª·©ª·¬¯¾®¯º°®¶±®¶¬­´ªª¯¤£« \9c§¡\97£¥\9d©\87\88}CM)AJ)*/\1fHN/:B#6B%8E"DQ&GL)MH(5;!.7\1eIV+4<\1c77#.6\1e\12\18\13\19\1f\16@@/XJDMAAOF@|ob\91\7f\8d\86±\9b\8f½¢\95µ\98\85¬\8a\89\87\86\8a\7f§\8a\7f§\88{\9f\8c\8d\89\8b\8bz\9e\89z\9a\83\8b\82£\8c\84\9a\84|\9d\85\81©\90\8eº¢\99¯\9b\96¢\8d\8e\94\88\87\87\80\81\87~\80wpvifotoslilutp}yr\8b\84x\89\81\81\8d\84\88\93\8d\8d\96\8d\8b\8f\88\84\8e\88\81\91\8a\85\91\8c\89\8a\83\88\89\84\86\85\84\83\89\87\85\8a\8b~\8e\8d\81\90\8b\83\9e\96\8a¨\9e\98nv\88_p\8e\80\80\8e« \9b¥\9c\98\9f\97\90\9d\97\8f\91\8e\88\99\94\8b \98\8f\9b\94\88\94\8e\82\92\93\88\92\92\87\97\8f\87\93\8d\86\98\95\89\90\8b\87\80~y\8c\87\81\8a\83\80yvwtsucfjckklnngjm^gimokxvp\98\8f\85¨\9f\90y|sfwu\8c\8d\8d\7ft{\7f\82~bknq{pqyphkfzzwvrvvx\7f\8c\8b\8cqrl\85\90\85\83\86~Z^`\7f\84\82 ª­\91\99¬\93\98¥\92\9e¥\99 ¤´³¬´¸´\98\9c\9f\9a\97\96\96\92\91¡\9f\95®§\9e  \96\9c \98\98\9b\97sy\80W`ef}\84x|\83y}\85\84\85\8a|\7f\86\8e\8f\98\8e\95\98\86\8a\8f\80\80\83z|\84ou{|v\81¥¡¬\8c\9f\988D>#%\1d\16\18\14\1e$\19(0\1a$-\17'/\1d\1e*\1109$>I/BO<EQ@|x{ltitty®­µ\9a ¢\9a\99\9e§¦°¯°»¶¶½­­µ°²¸´µ»¨¦¬¢\9f¨\9e¡­\9e\9c§\9b\9b§\9f\9c¦£¡«¦£®\9f\9c§ª¥®\9e\95\9d\9d\92\9b\9b\90\97\9d\8e\91\9d\8e\94\96\8d\95\86\8a{QY9DJ*EK.KU+:>\1e;B'GR->J('1\1dIQ.MQ+HP)GU*4B!25!KW0/7\1a\17\e\15\18\1d\17\ e\ f\ e\10\13\12\v\13\r>=>{np\95\86\86\97\8f\8d\97\8d\8a¡\8f\8a¡\8f\87\9a\8a\82\8f\84{\96\85}\9a\8c\86\93\83{\98\84\7f\9a\8b\85\90\7fx\90\82\90\87 \8c\83\97\8a\81\95\8a\84\9c\8d\89\98\8c\8b¥\98\91\96\8e\85xtstpuuoskloekm`dfifgphiwqo}xr\8d\82u\9a\8f\7f\9a\8f\80£\96\83\9d\92\85¤\96\87\9e\92\81\90\8d{\8d\8cz\8f\8e~\87\84yvustru\91\88\80\97\93\89\9b\91\8e\9d\96\8c\96\8e\87\97\92\8a¨\9c\92\89\82\8eer\8cnv\8d\9c\92\94¬¤\9b¢\99\92\91\8f\83\91\95\8a\97\99\8f\9c\96\8b\99\96\8a\99\95\88\9a\98\8b\92\92\8b\98\92\89\9c\93\8b\91\88\82\91\8b\86\8c\84\8a\8b\85\85}sqxsr]afNYeS[`nsojjlY^eJU_]iiouqRZ_\80\84\85¸±µ¶°°¬©²°²µ¾Àæ ©\9d\92\92\88\83\82|\83yejiV`bS[\Y`f\84\8b\91\9d\9e\99\9e\97\97\80yw¯°ªÂÁƬ­¸¨£ª©¨­¨§­·²´»´º¢ ¡¢¡\9d¥¤¡¤¡ ¯¬©¾¾¿³»Æ·»Ç\97\95£w\81\87\94¥ª\89\8e\8d\86\8d\8f\8e\96\9b\86\8d\8f\87\89\8f\87\90\93|\83\88\86\88\8aw\80\83fmsOT\C@PGLU\18\e";A@DNAFQ?>G7R]JQ]NUcRVbSoxn\91\97\92\8b\95\94\89\8e\8f«¬­¼¼¿«¯²¬ª±\9f ¥\98\99¢¢\9fª®¬µ©¨°\9e¡°££®\96\99£\91\95\9e\8f\96\9d\95\93\9c\93\97\9e\87\8e\98\8d\8f\98\8b\8d\9a\90\93\9d\97\9b¨\97\93\9a\94\8e\92\98\93\94\9a\96\96 \9c\9e \9a\9b\91\8b\83fqYYgGRZ7JU,6?#79)9=##'\1718!BL*59"MU/5A!,4\1f36\1f;B'?B0**%\e \1e\14\15\12\12\13\12\14\15\14\13\14\18\1e\1f#\8b\80\8cª\9c£\99\94\9c\9d\95\9c¤\9a¡¨¡§¯¥«³«§¢\99\98\9a\97\9b\9b\95\9c\9e\9c¤\91\8f\97\97\95\9d\97\95\9b\9d\9a¡¨£¦ \9e¢¬®³¸µ¹¾¸½·µ¹©§¢¤\9e\9a¢\9f\9b\9e\9e\9c\9d\9d\99\98\98\91\9b\9c\96\9f\9d\9b\9c\9b\96\9e\9b\97\9c\9c\98\8f\8e\8d\8c\8d\8b\98\93\90\96\95\90\93\93\8f\98\97\8f\91\94\8e\9b\9a\91¡¢\97\8b\8f\8epvwu|v\7f\84}\8f\8e\89\87\85\82\93\90\8d¡\96\91 \9b\94\8d\89\8fko\88{{\88xy\80\90\8d\89\8a\87~\87\85}\8b\89~\93\91\82\97\94\86\9b\99\8c\85\87\7f\89\86\81\9b\97\8c\7f\81\7f~|{\9c\96\91\84\81\82knquvy\9b\94\92\91\8a\85\82\83~wuwafkdgjippfkn^fmnrou{uhlm_hr\82\8e\8b\9b¤¢±®®­ª¯¸»À´³Á\8c\87\91}|{\86\8a\90\9f«µ\90\9b¥\92«©¥´µr\88\95\82\96£\99\9c§\96\92\97adew|{´²°·®·ª ¤³¯®\9f\98\9f\9d\9b\9f¦ ¤\83\81\83¿Ä¿ÑÐÔÈÍÑÅÄÉƶ·Ù¯ ¾\9a\97i`jklwlis\91\99\9e\91\9a\9e\84\8c\91\81\87\8d\81\89\8d\84\84\87\86\87\8b~\83\8a{\81\88ltx^ghO^Y49:.389>ITY]edp\8e\90\98\9b\9d¢\9f\9c \9b\9c¢\96\9c¤\99\9d¨\90\91\9b\98\96¡\93\92\99\9d\96¤©¦¯¦ª¯¡\9c¤\93\92\9a\9b\9c¡\9d\9e¨¦ª³\97\95\9a\85\89\91\8b\8b\90\83\84\89\8d\8d\91\9f\9e¥©«³\9f£¨\96\9a¢\93\96\9e\91\92\9a\87\89\90|\7f\8a\89\8b\98\95\92\9f\98\9b¦\9c\9b§¤¢±\9c\9e¦\9a\9a£\99\9d§\8b\8d\94\81\88\8c\80\86\88fkcSXGLSBRSBRV3#(\13 &\18'0\15(.\18\14\15\ f\e\1a\12BB.30,/..)('\1e%\1c\1c\1f\19\1e\1e\1f'%!\e\1c\17\85sk\9f\84x\99~v\9a\83z\9e\83}\9e\85\7f¡\87\83¦\8c\88¦\8c\86§\8f\8b\9e\89\86¡\8c\8c¢\8f\8d\92\82\84\96\83\7f\9a\87\80\98\86\7f\96\8a\81\97\8a\86\98\8b\84\97\88\85\99\8a\85\9c\8a\84¡\8e\88\9e\90\8e\9b\8c\87¡\8f\8d¢\93\92\9b\90\8b\9c\91\8f\9f\96\95¢\96\93\9e\98\99\9c\97\99£\99\99 \98\99\99\96\97¥\9d\9e°¢§®¡¦«¤¥¨\9f¡¥\9b\9c±¥¦¶ª©±©¨¯£¤¦ ¡¡\99\9c¦\9e\9f¤\9f\9f\96\90\91\8a\85\90\9b\95\94£\9f\9e\9e\9e\9c\9c\9c\9c£§¨¡\9d¢\9d\9b \92\91\97\95\93\95\94\8e\90\99\92\91\9b\93\91\94\8f\8e\94\8f\92\8f\89\8b\80}\84\akV`ju{\84\88\87\8c\80\80\85ty\83imrcflcjnjmqglrzvs~zsahlmu~¯¯´Ú×ÜÅÒÖ¦±¼ª©³\96\90\96\94\96\90ª²²ÊÎѯ±À·»Ç¶¿ÌºÄÓ¤²Ä¬´Ã\8a\92¡¦­µ\85\86\8b\fc¢£\9bÐÆÿ³´ÎÆÅÉÇÊÂÃǺ°»\8c\8a\90\8e\8e\91¨£¬·¶¼ÊÅÉƼÀͬ¡ê¬\89\9dzk]cghnomy~\7f\83\8aw\7f\84|}\87\8d\95\9a\81\84\8a\84\8e\95\82\8c\8f\80\89\8d\82\89\91\8a\94\9c\87\92\97nxzO[]QV]\7f\87\87\80\81\86\91\91\94|\81\87\8f\8c\93\8c\8b\90\89\87\92\8c\8d\93\85\89\91\93\94\9b\8f\93\97\8b\8e\98\90\93\9b\96\97¢\9f\9f§\9a\9c¦\94\93\9f\97\95¡\84\87\91\86\86\8b\7f\81\87\86\86\8c\99\98\9c¥£©\94\93\9b\96\97 \97\95\99\8c\88\8f\90\90\99 \9e£\9f\9a\9b\91\93\94\9d\9e¦¨¦®\9e\9d¦\9c¡§\8d\8f\98\97\99¤\97\9b\9b\89\8f\93\7f\81\8d\89\8a\96\94\95 \93\90\96\91\8c\91\84\88\8b\86\89\8b\86\8a\83nui_kWR[CS\EHP=jr^_hU #\1d\14\15\16\11\11\15\19\e\19\1f$\1d&&)2-+--(\98\88{\9d\87v\97\82t\9a\84t\9a\83t\98\86w\9d\85z\9f\84\88\8e~\97\81y\9d\82\8e\81¡\8d\8c\8d\7f¤\8b\8a\8d{\9e\8b\8a\8aw\9e\88u\9d\8a\8c\8d\8c\7f´\95\86¡\8d\8e\8e\82 \8e\86\9f\8e\85\9d\8d\82\9e\8c\82\97\89\83\95\86\82\94\83\7f\92\81\82\91\82\86\92\84\86\8d\83\84\91\85\87\91\83\86\94\85\85\9b\8a\8e\98\88\8c\91\86\87\8e\86\8b\88\82\8d}}\8bhp\83zz\84§\9d\9a\9e\91\90\8f\85\86 \9a\9c¡\96\9b\90\83\82\92\88\83\90\88|\92\8e{\98\91\7f\99\8e}\93\88\83\85|z~|z\86\82\85\bhSW`_dkbhfutmcefS^aQZ`adgbehW_f_da[^b[^_w}takn\81\84\87¸°²ÅÇÊ­¬²³°µ¨¥¦\9c\9f¢ \97\9f¥¡¤\96\8d\98\81\7f\87©§³¦¤°¿ÅÉ\9c\99¥¥¦± \9f§»¸»°°°££¢°¦­\8a\86\95\94\9b¤¹¼Å¸·Â©©³«¯¸²¸»²·¼±µ¼¹»ÂÉÅÇÀ¹¾Â­¬­\94\91\82\81|mml}\84\8by\7f\84py|xv\83}\84\8c~\82\8c\91\95\9d\92\95\9a\86\8a\90x}\83~\80\8c\86\8b\96\86\91\98\88\8f\97\8e\91\99\83\8c\93tz\81}\81\8av|\83\84\80\8c\81{\84\7f\81\8a\7f\85\8ewz\86\82\83\8e\8e\90\97\8b\8a\92\92\8d\99\98\99 \93\99¢\8b\94\9c}\80\8a\81\87\8e\84\86\8d\8f\8f\96\86\88\8c\8f\91\99\91\96\9d\94\97\9f\95\96\9e\99\99\9f\99\9a¢\94\95\9b\97\94\9c\9c\9b¨§¦°¤©³¥¦±\9f ¬ \9e§\92\92\9c¢¦®\9d\9e¥£¡¦¤¨ª\98\98\9d\9b\9c¡\92\94\9a\98\98\9d\9e\98\9d\99\9e¤\99¢§\98\99£\9f\9f«¦§±¦§°¦©²«­³z\82\8f?FU-4<*,+\1e!\1f!""&&)>@C397.03[[jlo~hoynryrryppxvs{~w{\82v{\80yz|tztp|\83z\81\89~}\8b\7f~\8b~\80\89z\7f\87zv\89~z\8a~~\8f\83\81\8e\83~\90\81\7f\8e\82\7f\8b|\80\82z\7f{w\7f|t}wu}qs\80rq\82lp\80jp\81hn\7fgk\81`k\81\j\80[f|Ue|Uf~]j~Zk{Zey[du_g{^i~_l\83bn\86bm\87\l\87[j\85\n\86\89\85\8c\9e\8f\8e¢\92\87\93\85{\9d\8e\7f¦\96\82\9f\8fz\9d\91\9a\83\9f\9d\83¡\99\84\9c\97\84\99\92\82\98\8e\81\89\86|qqq`ghaeh\83|z\84\7fwghecficfjchlkkn_dgbkflnh`km\97¢ §¥\9d¦¦\9f§«±\87\89\96­°¶ÈÅÊ\9f\9bª©°¹¢£¨\9a\98\9b\8a\84\8c\9c\84\82\8b\7fz\8f\91\95\92\91\99¹¼»Â¿É¦\9a¤{nr\89\8f\90±­¹®ª­¦¥©\91\8e\99\8f\9d¤\8a\8e\98¢¡¬»¼Ç¶»Ã¹¹Ã°´½²¹Ã¯´¿¸¸¾È¿Á¾¶¹¾¶¸¯¨§\8d\8e\8cnt{rvz|\80\85|\81\89|\7f\85vz\82x|\85y|\83{\80\84\7f\86\8b\80\87\8d\81\85\8d\89\8f\97~\88\90w}\83s|\81\85\86\8f\80\84\8c~\8b\90w|\85\83\88\90\7f\85\8b|\7f\86\89\8a\90\8c\96\9c\8c\8e\99\8a\91\9c\87\8b\96\8c\90\9a\90\94\9f\8f\95\9e\89\8a\92\87\8a\94\8b\91\9a\81\84\8f\91\95\9e}\82\8dvt\80|w\82\8c\88\96\9a\9c¢\84\88\94\8a\88\99\92\8f\99\96\96\9f\91\8c\9a\98\98§\90\8f\9c\88\89\96\92\94\9d\9c\9c£\92\94\9e\9b\9eªª¥°£\9e©£\9f££©±\9a ¦¡ ©\9e\9e©\9b\9cª\9d\9e§\94\96\9f\82\82\897:G6:M33H('<\1a\1f-\1e!,Z`k\ejefjV]YEFETRTLLL()&\16\19\1d(-.T[aW\cU\f[_f^djW\dMXeP[hU]kT^oWas\bqV`nWco`hxkr|mt}pu}fmy[cwVaxS_{Pa\7fNc~Pc}Oc{Pc{Nb~Od~Yh~SbzTczOc}Ra|Ne}Te~Wg\80gp{XajQUbgjmemq\gndjpkpw]j~Xl\81Tl}Td\7fVi\82Ug\83]j\82lr\83wy\86\83\80\85\8d\87\85\94\8a\86\98\89\80\9c\90\87\9f\95\8a\9f\96\84¢\99\86¦\9b\8a¤\95\82\9f\92\86¡\99\8f\81|wadhfhl\8f\88\84\98\90\88||ufhg`hidkihmnksmiji[dd©±¸\94\8e\94gf`\9b\9f\9a±°®\9e\9e¢´¸À©¬µµµºÂÁĸ´º\8c\8a\93\89\87\87\9d\9d\95\91\91\90\98\94\92\8c\91\8d\98\99 \94\96\9d\81\88\8bvtztz~§ª¯\98\95¢\9a\98\9d\9d¢¦\88\87\96[X`\8e\8f\96\97\93\9e|r}\9c¤©¼ÀÆ´¸½§§® £§º½Ä¬§²¤¡©ÀÂÉju}x\7f\84{\83\88|\85\8boz\81~\83\89uz\7fy\7f\89\8c\94\9c\83\8c\92\84\89\90\82\83\8b}}\85\7f\83\8d\86\88\8d{\7f\86~~\88\88\89\92\86\8b\94\83\87\91\84\88\92\8b\8e\99\90\91\9c\93\97¢\8b\90\99\80\86\8b|~\87|}\88\81\84\8f\8f\8d\9d\8b\8e\95xy\83rx\82\81\85\8c}\7f\85os|]alss{nnxmk~\82\81\8bnqtPMUtp{\85~\86\84~\86z|\8b\82\87\90\84\85\91¢ ¯\9b\98¥\86\85\90\94\91 \92\8d\98\86\83\8a\8b\8a\96\89\89\95\88\89\95\91\90\9a\90\94\9e\89\8e\96\92\93\9b\8a\89\90\8b\8b\8eCGC06>HPR*13@FIMQSdemilvplt{{\80\80}\81\8e\8c\8bsvtsusnqkovluzw\87\8a\87\81\81\81yzw|{trxus{zy|y|\80|vutrspikl\8a\90\8a\96\9f\8e\97 \8f¢­\91¦±\98³¶\9e¥´\94\8c\98\82t}visw_gs^drXamVbpX^lP^nUeuiiuwy\83|\83\8bnv\81\82\82\8bqu\84_gx^ftepnTkg]ignsspvq^if_dffekZ]b\9e¨¨¯¿¾\8d\9a\9bw\80\88lv\83bn\7fXdyTc{Nc~Sd}Vh\83_m\85jp\82nv\83vy\84~y\82\8a\84\87\92\86\86\99\8f\89ª\9b\95\9e\90\8dvtmdkf`dc~xx\90\8c\8c\8d\86\89sosgnlaggeim[cg{\86\87¾½»¸¯°®±­ÑØÐÏËÍ·­±²³·³¯¹³·Â¯´Å\94\94§¡¢««¨¯§¬­¿º¼¸§ª½ºº¾ÀÁª¯µ¦±³\9a ª\89\94\94\9a\94\9akkt\9d£«\9c\99\9a\9c£¡\95\95\9babn||\80\88|}\8a\90\8dÈËξÀÅÂÈÉÐÐÒ¼½Å¶¹À¸´¿·²Ày\83\86t}\81r}\83sy~y~\85y}\85\82\86\8b\84\8c\92y~\88tv~x}\88v|\84x{\86\89\8b\94\86\8a\91|\87\8b|\85\8d\84\8c\94\85\8c\92\80\88\90\84\8a\93\88\8b\93\80\84\8a}\81\88\85\87\8d\84\88\8f\85\85\8e}{\83qmw}~\85|~\87\8a\8a\95\8c\8c\93\85\88\8fwy}~\86\8cou{jpySX]GFPpo\7f\89\8c\94\_ctq}\89\8b\8euv~igp\80\81\86y\7f\85OM[NK[vx\81utuwsy\9f¡©\9d¡¥\99\99\9b\83\89\8c\84\86\8f|y\82\8c\90\98\93\93\9a\88\87\8b\81\80\86cbb;?GPRdmq|_hmjmvsuzxw~\86\82\86~z\81\8a\8a\94\9d\97\9d \9e¢\9f¢¦\94\91\99\96\93\9d\8f\94\9b\9c\99 ¤\9f©\9b\9f¨\9b\9e¥¤¤©ª¨±¬¦­¢ ©\9d\9a¤\94\95\9a\91\96\99\9a\9a¢\97\98\9f\90\93\96\8e\91\91\8e\94\93\97\98\99£§¢¡¬\9d¡©\9a ¦\9b\95\97\93\99\9a\98§©£\98\9a\94\82\81|\8a\8b\84\8f\8a\83©¥\9cµ¯¬¸­©¶«¨¯§¢©¦¡\99\8f\8b\9a\9e\98§Òѳäç­Úà£ÓÛ}¨µ\97´®\8b¥\9e\83\88\87\9a\97\95½µµÚÖ×ãàã\81\85|\91\99\88ÅÊ´·°¢¢\9f\8f\95\97\81\89\8dp{\86`n\7fVf}QdyN_wO^yS`{Zf}bk\7fjn\81np~\8d\86\87\96\90\8d\87\86\83\92\89\85\85|{}suqpsytt\80zvwutglm\7f\81\7f¢\9a\99\9c\94\93³­±ÐÊؼ¶Ä®¤¯\87\8f¢\88\89\97\9f\97 ÎÇϪª¶¯£«¤\95\9e\9a\95¡±ª´ª\9e\9e»À½ÏÑÕÑÏÖËÍÎÁ»Áª¬²³®±¡\9a\99zo|\93\96\9eÀÃÆ°¦³\95\94\9d¡\9f¤£\9d£\91\92\9d££²©¢²ª£°´¥³°®·º´¼©\9e¦\9b\90\95v\7f\87u~\84\7f\88\8dw\81\86\81\83\8c\7f\83\8c~\85\8aw\7f\81przss}\87\86\8fx\7f\84nrywx\80\82\85\8fz\84\8c{\7f\89\8d\92\9b\8c\92\9c\83\89\90\8c\90\9a\96\9b¤\87\8e\92\82\85\8f\9f ¥\8c\93\96z{\85wy~y{\80\85\82\89\84\84\89\82\82\88||\81\96\98¤ ¥©\95\9a¡\87\8f\95\89\8a\94\8e\98\9cenrNN^ON\><F]Vf\91\8f\9a\84\83\88\85\88\8d\98\9a¢\86\90\8ddfg\87\89\90\89\8c\94\98\9a\9e\84\89\8c|\7f\8c\8a\87\94\98\95¢\95\95¢\8d\91\92|\80\8a\8d\8d\92{{\80\82\7f\89\88\84\90mlu@CG\ f\ e\1dUUguz\80or|\84\86\93\85\81\88~\81\8b|{\86\8f\88\90¡\9f¤ª«± \9d¢\93\94\99\91\92\96\8c\91\99\91\94\9c£\9f¥\92\91\95\96\99¢\97\96 \8e\8c\97\99\98¡\9f\9d¥\97\91\97\9e\9b¡\9b\9d£\88\89\8d\85\84\88\93\8f\96\95\97¡\88\8a\95\8c\8c\93££¨\9d\9f¥  ©\9c\9d¥\9d\9f¦\9e\9c©¥¢±§¤±¢\9f¨ª©²¤§¯§¢®´§±³¢§¬ ¦«\9e£°¡¦¼«¬½´·®ËÙ¦ÂÔ®ÐߣÌÜu\84\95§·»\9b³»©¤§¦\9d\9a\8f\8a\89ËÌ˱­®\89\82v\8f\92\7fåãâàÛÛàÚÙáØÔØÎËÌÿÅÀ»·±¯°®«¢¡ \88\91\94x\81\89]l{L`wI_zI\wJXnNZpTascgurr\7frp|\7f|\7f\84~\83\8b~\83\86~\82\86~\7f\8c\82|\8a\81y\92\8b\87 \92\93\92\87\89\94\93\96tt|\80}zgbd\87\82\80\99\92\95\95\8d\9c\83\7f\87¤\9f\9e¬§¦\86\83\85\99\95\8e¾º¼Â»ÂÆÃÄÐÉÌ\9f\9b­\9b ­­°¸§´¼\7f\80\88\87\92\8d \9e¥³­¶\9a\95\96\97\90\96®©®¥\97¦\8e\82\8e\92\87\92\8d\82\8ewv\84\87\8e\9b¡¤±£©°\8a\82\8es|\83r|\83u~\86v\81\85ov}u{\86\7f\84\8ery\83qv\7fuv\81st\80\81\86\8fw\7f\83wx\81xz\83rz\82\81\81\8a\89\8e\94\7f\88\90\86\8b\91\81\84\8bps||w\81\86\85\8c\8e\88\90\80~\84\82\83\89\88\87\90\8d\93\98\8e\8f\98\8f\91\98|\83\89\8c\89\91\90\90\9d\94\93 \95\93¡\9b\97£\8c\8b\95\85\87\91ahk?LQ$-1_Ya\87\80\86\8b\86\8e\82\85\8d\80\83\92\8b\88\97~{\88xu~kkytu\84st\83ijscgpvz\82fejdan{y}WX^ZXaQNXifoMKPUU[MMMJLNnks|~\87}\7f\85pr}rq|xy\82~\80\85\80y~\91\8d\99\87\88\92\87\88\90\8c\8d\96\93\96\9d\8c\8e\95\92\97\9e¢¢§¢¡¦\9b\9c¢\8f\8e\94\8e\90\95 \9d§­­µ©©¬¢§«£¨¯¥©®\95\98\9d\93\95\9c\8d\8f\95\8c\89\8d\94\93\99¤£ª¸·½¢§­¥¨­\9e\9f§\96\98¡\9c\9b¢\9d\9c¥¤¢ª\99\99¡\94\96 \8f\90\9c\82\83\92\8e\8f\96\99\94\9a\8f\87\8c\8b\7f\87\8f\84\8c\9f\99\9f\90\8c\96~}\8a\9f ¦­®²³³­³­®·²®·®¨¿µ°© \9b¼²¸¢\9d\94^^K¦©\99àØÛÞÔ×ÜÓÖÙÍÒÔÈÉʽ½ÕÃÀÙÅÃ˼¼ÙÌÍÝÓÒ×Î̾·´¢¢¢\90\95\98\80\88\8et\81\85fx~XkyTbsI[lIVlGVkIVlKUnLZpS]p^dyjo\82\81w\85\90|\86\8aw\83\87~\8azs\7fzvx}{y \9b\92\8b\84\84mik_dhW`e ¥£Æ¾º\91\86\82\93\8d\87°«°­®²®³¾\9c£¯§§¬®¨¯ª­³¬°´ËÎР\93¢vy~®²·\9d\97\97\8f\96\95\9b\9c\9d©§£\9a\99\9c\99\9b\9f\8d\93\95\97\9f£­²º¨­»¥¡²jmtlt|o|\84mw}r{\80w\81\87qy\80nsznv|mt\7fsv\7f~\81\8ay}\83su~sx\81vz\84}\7f\8az\81\89\81\82\8b|z\80\84\85\89z|\81z{\82{y\83\83\88\8fuw\80\81\7f\8b\84\84\8f~\86\93wx\82xt\7fuz~xu~\85\85\8c\83\83\8b\84\82\8b\80y\82\91\8d\94\8b\84\8c\8a\87\8e|\82\89otwSVapp\80\7f~\87jhlpmsttvkdipnuxy~sw\80us{sowwv\80ty\81sw}ppsnoskqoooqjjjqvxmlksrvxx{yx|y{\80\80\81\85zy~yz~{|\82zv~}{\84\8b\86\8a\84\81\87\85\82\89\8a\88\8c\91\90\94\97\97\9e\9f\9e¦¡¤­§¨±¡¨¯  ¦\93\94\9a¨¢§\9e\99 ¢¢§¤§­¬°¹¦§²\97\9b§\9a¢©\9a\9e£\95\99\9b \9e¤\9b\9d¡¥¥©¸µ½´µ½ª®µ¢£©\9f\9e£\99\9b£ £§\9f\9e¥¤¤®\97\94 \8f\8e\98\8b\8b\92\89\8e\94\8d\8e\94\87\83\89\8f\88\8f\8d\89\8d\9b\9d£\93\91\98qnr\8d\85\8c \9a¥¥ªµ°¯·Ç¿¿¿³³Ç®²ª¡¦{ur\86\86oinO°­\9c´¬¥¹°®Ì¾Ä­\9e£¼°°Ë¾½Å¹¹½¯´Å·µÇ»ºÌ»¾È·¹È³µÑÂÁÔÇÇÒÈÇÎÃÃÊÂÀ¼¹´²±ª©§\9b\97\9a\8d\90\92\82\87\8dt\81\89jx\81eu}YjzZdw}m~nhygevchwN_wM\sU\nbbuok{}r\7f`_lbfk`ci\88\82\8a\8a\81\87\8b\7f~\9f\95\93¢\9a\98¡\9f¢\8c\8f\97\9a\9b\9a³§¬± ¦´\9d¢\9f\91\98²¬¬¬©¡¸³°®©²²¸½®«±©¦«\9d\9b¡\9b\97\9f\97\98\9d¡\9d¢\8f\90\98\95\9a \9f\9c¢v\80\87v{\84x\83\86q\81\86t\7f\86v}\87rz\83nu\80t{\84nw\7f}\81\8amuw\7f|\86~\89\8emsxmrwegoiltjksxt{sy~y{\80uu{|}\83|~\87z}\84{~\85x\80\88ux\7fpuy\83}\85\89\8b\91\81\80\85\83|\81ww\7f\81\82\89\85\84\8e~\7f\8aokusqykipmjs[chYZffenjfmvt\80stznouvt~\7f}\87tuzrqwuu|\84\84\8b\8e\8e\94\8c\8c\89\8a\8d\8d\93\97\9a\94\98\9d\90\93\99\96\9a\9d\92\9b¡\94\96\9d\8b\91\96\81\89\8f|{\83\85\8a\90\80\7f\86\8a\89\8d\85\87\8c\84\88\8e\84\86\88~\80\82\84\84\87\84\82\88\93\8e\97\9d\9d \9e\9d \94\92\9a\9f\9e¤¢¥©¤¢ª¤©¯¡¤§¦¨«²±µ¦§©¹¸¼±°¶¢¤±«ª²¥§«­¯¸¬®¶¼À𴺱µ½¯²»­­¸®­¹£§±\9b\9d¢\93\96\9c\91\93\9d ¡«\93\8f\9a\8e\89\92\8b\89\90\92\8e\94\92\8d\93\97\93\9a\9a\96\9d\8f\90\96\89\8b\8f\88\89\8f\83\80\87\8f\8e\93\96\95\9a\93\91\91\9a\96\99¥¢§³­³§§°­¬³§¤«§§­\93\9a\8e\8e\94\85¡¥\9d¹·³­¬­©¬«¼¹»µ²±¼¹µÅ½¼\9c\9a¢\8d\8a\92£ «¥¡®£\98¤¦\9c ³©«¯­²¶²¸½´¼½­¶¼®´É¼Áȶ½Æ··Í¿ÔÈÅÏÁ¾ËÀ½Å½¼Ãº¸»·¶¦£¨\99\95\9a¤\9e\9d\95\8e\8d\95\8a\8c\8f}\86\87v\81~nvmgre`kmem\8b{\7f\90uz\8ex}pjuvq}\81u\85il\83vt\88\89{\8a\88\81\8c\95\90\98\9f\8e\98\8dv\82\95\80\87¡\84\84 \85\85®\91\96¹\99\98§\94\93¦¤«\9e\98¤\7fxv\9e¢\9c¯®­®¯¯®²±®³²²´µµ·¸mx}ipv}\80\8b\88\91\94o\80\81Zcjccnfktiistw\80gnvhpudfqimvov\7fhpvllrss}js{lovnu~svyws{\7f\80\87wz\80~\7f\88||\83\83\86\90\88\89\8f\7f\7f\84\83\80\88\87\87\93\8b\8c\97\85\83\8a{{\81zx\81uv\7fxy\85qu{qlsyvzmpsjmrtsznkqkfojjpolsjiorr{\80\84\8e\9c¡¤\8b\8e\91\87\88\91\88\86\90\98\94¢®©³\9d\9d¦\96\97¤\94\95¢\9d\9a¦¤¡«\9c\9c¢\96\9a£\9f¢¨\99 ¤\91\92\99\9d\9a¡\94\96\9d\97\9a \96\9c¢\8d\8e\96\91\8f\99 \9c¤\90\93\97\9a\9c¢£¢© ¢©¢£§\99\99¢«ª²¯³±\9f ¢¦«¶°«·¥¥®ª«´\9f ¬¨§´¤\9d¨\98\99£¢¥²§©²¢ ©  ® ¡±±²Á§¨¶\9f\9f¯ ¦²\99 «\9f\9e¬\9f ¯\96\98£\92\94\9e\8e\8d\99\92\8e\9a\7f\80\89\85\84\8e\87\83\8d\89\89\93\89\86\90\8c\87\91\90\8b\93\8a\88\8f\86\86\8d\87\88\8d\9d\9d£¥¤¯¢¡¯®´¼®°µ­§²¦¦®¥©´\9e¤¯®°¹ª®º¦§³²²¾¡\9e®\9f£­ª­¯­¬µ±­»¹·Á¸·À²³¹®¯µ§¨®\9d\9d¤\8c\8b\91\93\95\9c¡¡«\9d\9d§\98\9a¨\93\92¤\8b\8c\99\8c\8d\98\99\97¡©¤«µ«²µ©±´ª°³¦®¸¦¬½¬¯¼­±¿±³Å¹¿°£¯¡\93\9d\9e\94\9d\9b\86\8f¬\85\84¤\82\7f¡\83\85£\8b\8fª\8b\8d\9f\81\80¦\89\89¤\82\85¨\83\86«\8f\8d\9e\84\85\89u~\8by\84zq\7f\86y\83xv\83\93\88\94\9a\85\8d\94\7f\83\91\87\89§\90\8f¦\89\8a \83\85¬\90\8d¨\88\89\9d\81\81¯\9e¡§£¦\91\91\8f¨¡¦±¨±¥ ¨¯«³°ªµ®ª³\bdXdhackhcicgn\cf^ckehmZcibisX^fhkpentrw~mqxejqonvty\81wz\82~\84\8b|\84\8c\7f\7f\88\81\86\8d\80\85\8cw}\85v{\83t{\82ps~\82\83\8d~\87\90\85\88\8f\86\83\8c\8f\8f\9a\86\8a\8fz|\85v{\86wy\81vv}npwzz\80zy\81\83|\86rswnmunnuhfmxqxzv~\7f{\7f\8c\89\8b\8a\8a\92\95\9b¤\94\93\9b\8a\88\90\85\88\8c|y\7f\82{\87\7f|\83tnu}z\84\92\90\97©¨¨¦¡¢\9d\9c¡\82\7f\85\99\95\9c\98\9a¡\8a\85\90\8d\8c\95\99\9b¢¨ª®\97\97\98|{\80\85\80\89\9f\9e£®²··¹¾°°±­®´½¼¿ÁÀ¾¶¸·\9e¤\9f­³¨®´­¥¬«\9a\9d¦\97\9a£\9c¡ª\98 ª\9b£¬\9a£¬\94\98§\94\96¢\95\99¥\91\96¡\97\96\9e\89\87\8f\87\85\91\92\95\9f\8a\8c\98\86\80\8d\88\88\98\83\82\90\82\88\94\84\86\92\88\89\94\8b\8a\91\86\88\90}|\84\89\83\88\93\8a\91\8a\85\8b\89\84\8e\8f\83\8c\92\8e\93\90\8e\96\93\92\9d\9b\99¥\99\96\9e\9e\9d§¤¢¬£§¯¨©³ ¡«¡\9e¥\98\97¡\8e\8f\9c\89\83\91\90\89\93\90\8f\97\97\94\9a\9e\9f \95\96\9e\8b\8a\96\97\93\9c¤¢¯\9d\9a§ \9d¬\9b\99©±¯·ª­¶\9c¡¨\96\99¤\91\94\9c\87\8b\94\80\83\8a\84\88\8e\8c\8c\92\8d\92\9b\8d\91\9a\97\99¥\8f\89\94\87\8e\93\8d\8b\95\89\86\90\90\90\99\95\92\9e¢\9b¥  ©\8e\88\95\8a\84\8d\85\84\91\8c\86\8e£\94\94\9e\95\94\99\8e\93\91\83\89\95\81\86\9b\88\89\9c\88\87\9f\87\8a\9d\85\89\99\83\88\9c\85\8a\9f\82\86¯\8e\8f¡\85\8a \8d\91£\8f\94£\8b\8f \88\8d¢\8c\8f\9b\84\86\9a\81\85¡\86\87\9d\83\85\9f\85\87\9e\82\83£\8f\8e¡\92\90¯«®ª¬±¦¦ª¡\9a \9f\9d ¢\9e¢\9d\9b¤\97\98¢]hk`hlV_bOQVVX]\ciYcjbfmdflfgoaiodkrot{swzeknglqjpw}\80\85~\81\88xz\84ty~sr|vy\82koyooytx\7f{}\89z\80\86y{\82\80\82\8a\84\85\8c\80\80\8b}|\87sqxqot{\81\85x{~tw}ehrkfomjqoergagzw}ecjb`elhnhfj\80}\89\8a\8e\95\87\86\8d\8e\92\99\81\83\8a~}\86\8a\8a\8ey{\80~}\81\84\85\87\8e\8d\8e\93\93\95\96\92\9c§£«\8d\8a\90\93\8b\92\89\88\8a\8c\89\8d\8e\8d\8c\7f\85\86\80\86\85\99\92\99·³º¤¤§\87\88\87\97\95\99\9f\9d¥¤§¯­¬·º¸Â»¹½ÉÅÊÌÊЯ¬¯³´···º®®¯¨©«\93\92\92\8a\8b\96\94\97¤£§¯¤¥¯\8b\8c\9b\86\8d\9c\94\98¥\97\9cª\95\98§\93\96¡\8b\93\9a\82\83\8c\8c\8b\95\93\94\9b\8d\8e\99\97\9a xy\82flxxz\85xx\85}z\85yq{\80\7f\81\87\81\84\9b\92\9b\8f\90\98\90\90\95\8a\86\8b\8a\85\8c\85\81\8a\8f\8f\96\96\91\9a\97\96 \9a\9d¡¡ ¦ \9f¨¦¦«­­«§¦¢\9f\9e£\94\94\96¢\9e\9e¡¡£§¦©¬«­¯°¶\9a\9d¥\9a\9d¡\9f\9f¡\94\91\9a\91\94\95\95\94\9a\8a\8a\92\98\94\9d©©´±³¼¨¨°¤¡ª¥¨¬©§¬\92\94\96\95\91\99\96\95\9f\98 §\9f¢¨\9a\9c¢¢§¬§¨¯\95\9a \97\9f§\89\8f\97\8c\91\9b\93\97¡\9a\9b¥\9e\9d¤\9c\9b£\92\93\99\98\99\9e¤¦°\97\97¤\8e\8e\94\8e\8a\91\8c\87\92\8c\82\8a\93\8e\96\99\94\9d\99\8f\95\9e\8e\93\94\82\8a\89|\84\8e\80\85\94\83\87\9c\82\88\9e\83\86 \8f\8e\9d\92\90 \9c\97£\99\99«¥¢¯§§\9f\9d\9f§£§°¬­ \9fª\91\97¢\99\9e¦¶ºÀº¸¼­­¯¾·»»´¶­¬­`fmchn^lpZciX^dW^f[_h^dldiqgipdinfjr^enhipglohgrnpxghnhgntw\80ty}oou\84\85\8cv|\80mrysu|uv}y~\84}{\7f\85\87\90nnxjmx`ehjlu\94\9a¢\97\9e z}\81rnudbkeaca[aZVYYX[ccgmhj{yzrpt\83\83\88\85\83\88\81\87\90\97\97\9e\9a\98\9f\95\95\9c\99\9a \96\94\97\8e\8f\93\93\94\95\9a\9c \9c\99¡\96\94\9a\86\83\88\83\84\8a\8d\8b\91\7f\7f\81\8c\87\8e\94\8e\8e\9d\99\9b\97\99\9b\90\94\94\89\86\89\9b\97\9b\87\84\89\99\97\9b\98\97\9d\9d\9d¤¤¥«¤¡¥\97\90\9b¸µÀ¼½Â§¥­§¤¬´°·£ «\8e\89\95\8f\8d\97\92\91\9a\8b\8a\91\91\90\98\9e\9c¦\88\83\8e|~\80\80\82\86\84\82\88\85\85\8e\81\7f\8a\82\85\93\83\87\92\84\89\93\80\83\8e\8c\8d\96\8c\8c\98\88\89\95\82\88\90}\80\86a_jc^g|u}yvx{}\82\80\80\87\85\83\8byu~\98\90\95\90\88\90\84~\85\90\92\95\95\98\99\97\98\9d\9d¡©¨¬¸\9b\9b¨ \9b£¦¨§\99\99\9d\9b\9e¥¦¦±£¡«¡¥¯©¬·¨©³«©µ¡\9f®\9a\9c¦ \9f¨\9f\9d¨ \9e¤\9f\9c£\99\99¤\9c\9b¤\9e\9e¦\9b\9b¢\9d\9b§¨¦²\9e\9b¢¯±·\9c\9c£ª«®¥«­\9b\99\9f\9c\9c¢´®·©¨±¤¡­¡¡¬°±»¨®¹¦¬µ\9e\9eª\98\98 \97\96\99¥ ¥\9f\97£\84\85\8e\91\8e\92\93\92\9c\8a\87\92\92\8d\94\8f\94\98\88\88\8d\86\84\8dwv\7f\86\84\8b\86\85\8e\96\91\98ª¥¨ \99\9b§£¢§¢¡¤\9e\9dª¨§µ²±¯¬¯§ ©¥¡ª²¯µ­«µ\9e ®\9c\9f«¡¡ª¦²º¢²¼°¶Á\8a~\89\97\99 ¸¹Â\91\86\98\8d\8d\9c­ª³LT\Z`hP\]JKSXX]T[_Z^eXbg^hnT`d`aghqwajpcgmosysz\80w~\83uz\82y{\84kiqzz\84wx\7fuw\82uy\85xz\81v{\83tz\83tv\81|w|rtwhihljl\88\8a\8a\8a\8c\92\83\81\8biqzuqwkiqa]eZY]_`avsq\92\97\97\97\9a\95\88\82\84uqy\80~\83\91\8e\95\92\92\9c\9e\9d££ ¡{y\81\80\80\8a\90\8f\97¦¢¬\9e\9c\9f¤£©¤ §¤¤¦\97\94\9b\87\87\8e\81\82\89\8d\8b\91\85\87\89\8f\8d\91\94\93\97\91\8f\97\95\93\9b\98\98\9b ¢¦\96\93\99\9b\99\9c\97\97\9d \9e§\96\97\9e\95\99£¨¨®¬«©³´½´µ¼¤¢¨¤\9f©\9e\9b©\99\99¡\89\8c\8c\8d\8d\93\92\93\99\93\91\97\85\80\86\8f\8a\91}qt\8e\8b\90\8e\90\97\8b\83\8e\9a\92\99\94\93\98\8f\8f\95\88\89\91\88\8b\97\85\84\8f\81\82\8e\8c\8d\94\8a\87\8e\85\82\8a\96\91\9biho\]cys{wtz\81\7f\84\81\84\8b\8a\8b\91\8b\8a\8e\90\8c\93\8d\8a\93\91\8c\94\8f\88\91\8f\8a\96\94\8c\99\85\82\8f\81~\8d\7f~\89\82\7f\89\83\82\91\88\8a\98\9b\98¥\97\95¡\91\8d\9a\94\92\9d\91\92¡\8c\91\9e\8b\8c\99\8d\8d\98\97\97 \90\8e\9b\95\93\9d¡\9f¨\9f¡¨\97\96\9d\9c\95\9e\8c\8e\97\93\98¡¡£­\92\91\9d\9a\99£­ª¹±²ºÂÂÈÇÉÏÌÏѺ½»¯­²§¢«\9c\9c¤\96\99\9f§ª¯º¸¾©©µ\99\98¥\9e\9d¥\9a\9f¥\9d\9f¨\8c\8d\98\94\95\9c\97\97\9d\98\96\9c\93\92\99\99\97\9c\9b\9d¥\92\92\9b\91\90\97\8c\8e\94\93\93\99\93\8f\91\89\8a\8a ¡¦§¥®£\9c¤°­´ª§¬´´¸º·¾¨ ©\8b\88\90vyy¡¡£  §¤¦¨·¹¼£\9a\9c\9a\9a£\8d\8d©uu\8ca\e[\c\92\88\94\99\8b\98smv\81u\80e}z]hldmsZchbglhosnqvejngpxo\80\84jtzmx|ovzwy\83z\81\89uz\80rx\81v|\86\cl]bjijtfiqjjtefnRS[XS_]aegil\8a\89\8e\97\99\9a\8e\92\95\82\84\8c\83~\89zx\80cbjgjm^^aWX]dddojl{z\82}u\81\91\88\97ys\7ftsynjo\83z\80\91\8c\90\83\84\8d\90\8b\96\90\91\95x\7f\82\82\85\89\87\85\89}{\86\94\92 \9d\9a¢\96\94\99\97\95\9e\85\83\87\83\84\87\85\86\88\86\87\8a\95\93\98\95\91\99\9b\99¢\8c\91\97\97\97\9e\9c\9c¤\9b\9a¢\94\94\9a©§®§¥©\98\98\9f¥¥®¢¦©®°µº½Ã©ª±\98\93\9b\94\90\9b\8e\8b\92}x\80\8d\8d\91\9a\9f\99}~\85vn~\87x\82\80wz\87~\81\92\8a\8b~xz\82wyxoqylv\8e\85\8e\92\88\8e\83\80\88\87\87\8d\89\87\8d\83\84\8b\87\85\8b}w\80wu|mhp}{|uw{wrxzx\80\7f}\86\82\7f\89\8a\83\8e\92\8e\99\80}\86|u\7f\87\81\8c|x~yuz{v}\83\81\87~{\81\81}\87\85\8b\90\89\8c\90\8d\8c\93\91\8f\98\91\8e\96\95\91\99\92\95\9c\90\96\9c\97\96\9d\92\94\9b\90\96 \94\93\9d\93\95\9d\90\92\99\9b\98¥  «\9d\9f¢\9a\9a¡¢\9e£\9d\9e¤ \9d©\94\94\9e\8d\8d\93\8a\8a\93\9a\98¥ \9d¯©ªº»µÇ¶±Ã·¶Ä¡\9f°\9b\99¤ \9f©§¥­³¯½¤\9e¨\9c\9f¤©¨®\9f\9b¥\91\8d\97\9a\9b£\98\96\9f\92\90\96\90\8d\93\91\8e\98\92\91\9b\98\95 \98\98¢\94\97¡£¦¯\9f\9f­\9c ¤\8d\95\9a\8d\8e\95\8e\8a\91\9d\93\99³­²±®±´µ¶´³¹º¸½§ ©\9b\96\9c\9f¢¥´º»³¶µ·¸¿«©³\8b\83\92^YgUbkXqxq\85\8cgs\80x}\8c\8a\86\93\85\8c\90]fk`gjW_cX^ecek_ekUY`jlq`jpiq|iqzpt{imt`gmUYaUV]]_d_`fgkoYakXYbW[_[^adkkflorw}\8c\8e\94\8f\91\95zt\83VTa;6BEDL^`chml|wy\7f{zmmrrmnkdlpmu`]ac`bdceabfyv\7f{|\83wr{\82\80\89\83\80\89\8d\8c\94\82\81\85\84\8a\8d\8c\8f\91\86\88\8b\8a\8c\90\88\86\8b\99\98¡ ¡¥\8d\92\93\9f¥§£¦ª\9f¡¢\9f£¤­®±\9e\9f\9f\88\87\8f\87\89\93\93\95\9f\96\9b£¢¤¨\94\93\9b\8c\8d\95\8f\8b\95\94\93\9b\98\98¡¦¨­´²¸­©±«©°\9c\9d\9e\94\91\98°®¯©¦¤\8b\88\91\86\81\8aqpoypo\83xw\91\8b\8c\9e\98\97\92\8d\8f\89\89\89\8a\8a\8a\97\9b\99\89\8a\83\82\80\80\87\80\83\90\87\89\86\82\87wqy\90\8b\92\86\84\8a\88\84\89\85\81\83rppxt}}t{wrvrkt|x|}x}khrnjsrpuvnwvrytnu}x~}\80\84wt{\87\84\87\81\81\85\84\8a\93\8c\8c\94\96\93\9a\90\8e\97\8e\8a\94\8a\8d\95\94\97\9f\9c\9e§\9f\9e¥\96\94\9a\9b\9d  ¦¬¥©°£¢ª\99\9b¤\93\94\9c £¨\98\9c¦\9e¡«§§®\9d\9d¦\94\97\9e\9b\9f£\91\98\9d\97\9d£\92\93\9a\89\89\91\89\88\93\8e\8a\95\89\86\93\89\8a\96\91\8f\97 \9d¥\9c\96\9f\93\90\9b\94\92\9c\97\93\9d\94\92\9e\92\90\98\8c\89\90\92\93\99\9e\9c \9f\9c \9f\9e£\90\90\98\8a\89\8f\8e\8b\93\8e\8d\97\91\8f\99\8e\90\98\94\97\9f\95\93\99\9c\9c¤\97\9a\9e\8c\90\91\87\86\88\98\95\97\96\91\96§¥ª¨ ¨¯¤¬\98\8d\98\8f\8a\92\92\90\95\9e\9b¡¦¢©¶·¹²¬µ\97\8f\9c\8b\8f\91\90\8a\8b\89\8b\90\9e¨¬\9f¢§\8f\99\9c\99\99¢\99\92\9bBHLOPUXa`LXYCDINNTNRXVY\]^`\`fcjp]dhPPVfgnehmx{\80inpY]ceenbai__jdbfbch\_i^_nIJ[KHT@@B+)+:79QNNrho\80}\83qqsccg]Y_cfmb^`\Y[plmhimus|qlpfcgpjpqkrvsx~{\83\84{\82\81{\83\81}\84\90\91\99\87\87\8e\9a\96\9e\97\98 \8b\8c\93\89\85\8c¢\9a¥ºº¾­­´·²¹ÂÀ¸»¼¤§®\9c\9f¢\94\9b\99~\7f\85\8e\8c\93\9d\9c¤\9d\9f©\9b¡¤\99\9c\9c\8e\8c\91\8c\8c\93¦©®\98\9c¢\99\9a¥\9a\96\9e\9e\99¡\99\94 rn{\7fw\87\82{\87kdg}uv£\9e\9e¢\9b\9e\8c\8b\8b\99\9a\9c¡£ª\9b\99\9f\91\90\99\92\95\9d\9d ¨\9d\9c¦\8e\91\97\81\7f\83\85\87\8b\88\88\8ezxy\83\80\86\8f\89\8e\85\86\8d\8d\8e\91}\81\84upp\7fyzw{\7ftqu\82z\80tt|usv\7fxzsqurrwzv|qmumim\88\8a\8f\94\94\9a\8e\8c\94\93\98\9d\92\92\9b\92\91\96\8f\8d\96\90\91\9c\86\89\8f\92\93\99\9d\95\9d \9e¦\94\98\9f\96\99£¥«²¢§±¡£®\9c\9e©£¦° ¢« ¢« ¢«¢¦­\9e\9c«\99\95¢¤§¬¡¦­\94\9a¡\9c\9b¤ \9fª\94\92\9c\8d\8f\94\96\97\9a\9e\9b\9f\9c\9f¢¡¡§¢ §¢¢ª\8f\8d\93\84\82\89\89\8a\8f\88\89\8e\83\89\92\8a\91\97\94\98\9e\94\95\9d\93\92\9d\8b\89\93\8b\8d\92\8f\90\96\84\86\8f\92\94\9a\8c\8d\96\8b\91\98\97\99¡\97\97\9d¢¢§¥¨¯§®¶\99¡¦\9f£  \9a\98\8c\8b\8e\84\84\83\8d\87\89\93\8e\91\8e\90\94\91\97\95\9c\9f \8e\86\8b\9b\99\99ªª¯\9e¢¦\9d¤§£¨¦¥¤¨\95\95\95\9d¡\9d\9d\98\9b\91\8b\8e\7f\81\86>BGHHPX^aT[^TY\RSYbekbfikmrkmsckqirt^dgbemcgmWZdRR[PLUCALBBI=8B32>-.4)+. !%/06SPT[YZnnkacbjfjlimb^dolqjmnfdf\\aa`eqqzxxzhjjYX\ddfa__a^fjflkeikdlztyvrulfr\80|\83\84\7f\86\95\90\99\88\85\89\85\85\89\8f\8c\91\8f\89\92 \9b§¨¥ª³´´»¿º°®´©«¯«­³±³µ\9d\9e \91\91\99\8d\8d\95\95\90\9b¯«·\88\86\94qjstq|\80|\8b|w\80sovqqzskr]Y^gdfrpm\85\84\81\8c\8c\8b\92\90\94\96\95\99\89\86\8d\93\90\95\9e\9e¦¦¦«\9c\9a\9e\98\96\9e¢¢¥££©\9a\9c¡\87\8c\94\80\83\8c\97\9b\9d\99\9b¥\95\97\9e\85\86\8e\89\87\90}\7f\85\86\87\8e\81\84\8c\87\81\87\87\84\8a\84\84\89vw\7f}\83\89w{\81\82\80\85\82\7f\89pqu|uwyvvxvy\87\87\87\8c\8d\94\9c\9a¤\9a\9e¦\8f\91\98\9a\9b¡¤¤ª\98\98\9b\8c\91\9b\8d\92\9c\94\95\97\92\8d\96\9e¢§\9a§\93¤¬ \9f\9f©\9a\96¢\91\93\9c\9f¡¤¥¥¬\9d\9c£\9f\9d¢\9c\9d§\9a\99¥\9e\9f¦\94\94\9a\9b\98¡£¥®\9f\9f¨\91\95\9c\8c\93\9c\97\9e¦\8d\94\9a\9c\9e£¥¥¯¦§²¡¥¬¤£©\94\95\9d\8b\8e\94\8a\89\8c\89\84\8d\89\86\8e\87\8a\90\97\97\9f\99\9d£\93\96\9f\8c\8e\95\99\9d\9f\95\97\9d\8d\8e\95\8f\94\98\8f\94\9c\92\93\9c\8b\8f\9a\8b\8e\98\8d\90\95\9e\9e¦\9f\9f«\9c ¨\9d\9c¤ \9c¥\98\93\9e\9f ©\99\9c \9c\9d\9b\8c\86\88\85\81\85\8c\8b\8d\91\90\96\98\94\9a\8e\8f\94\9c\9e¡­¯±¥¦¦¯ª±°§²¢¡ª±±³¨¡¨\94\97\98\93\8f\8eGSXNV\V^eY]cNQXJOTHEOVX_TXZUWZihmx|~bklQSZeehNPUAEL**0)'.336458244FGG_dc\d__^cmjohgmunwhkohfhhiimorcejifkY\aikollofdjidjlookjjpnlqnpxtw^Y\d`awmmzxyb`_ppo}u{\8c\82\8a\83{\80\85\7f\82\8c\86\8c{|\82\84\7f\86¢\9f£¼¾½®¯°®¯·\92\91\94\94\92\9b\93\90\9c\9a\96¡\9a\99\9d\8e\8e\90\83\85\8cwv\7fhhsa_egcgXY`_^d\83}\80\83\7f\7f\7f~~xxx\8e\90\91\89\8f\8f\87\8b\8f\97\95\9e\8d\8e\9a\84\85\8d\90\8e\91\92\93\97\8f\8f\97\93\94\9b\9a\99¡\99\98 \9d\9d¥°³¹¢¤®\9a\99£\9a\9e¢\95\95 \9c\9b¥\8a\8e\99\80\81\8e\86\80\8b\86\85\8d\8b\8c\94\7f\83\8d~\7f\88\8c\8a\91\83\86\8d\8d\8c\92\86\8d\90ux\81y~\8ay~\88vw}||~\84\80\81\81~\7f\8a\87\8a\93\93\9b\87\83\8c\96\98\9e£¨®¦§« ¡§¥¨²\9e¢«\8e\8f\96\85\85\8e\82\85\8b\8e\93\96\98\9a\9f\98\97\9c ¦¡\9a\99¡\99\94\99\99\99\9c©©® ¡« ¥¨ª­±\9b\9e¢\9c ¥¯°¶¯²¹¤©¬\9f¡§\9b\98¢\9e£§\9f£©§«°¥ª¯\9f\9f¤\99\99¢\94\96\9d\90\92\9b\96\96 \90\92\9c\8d\91\98\84\89\91~}\86\81\80\88\87\8f\95\8c\90\98\95\96\9e\92\8f\96\96\9e£©®¶\9f\9cª\94\95\9d\89\8e\97\8b\92\9a\89\8d\97\88\8c\93\93\97\9f¤ª¬§ª²\9c\9d¦\96\96 \97\99¡\8f\8f\95\93\99\9c\9f¥«\9d ©£¢©\95\98\9d\90\93\96\8e\94\97\8a\8f\93\8b\8c\90\92\96\98\95\92\95\8e\8e\91\92\94\95\8f\90\94\99\9a\9a¤§¥¥¦©©¥«\9f¡¢\97\97\98UY^OW\FNRKKP^cjeqtcnodstkz|kx~pu{aenV[e?EI+'1;7>/36!''KDGb^]TUU[[]\]eZXbopufgmZZ]WX^cdjgfpvszjilfcg^`dfhlbcghhmabeootjkngcgxkr\84~~yxvbZ]xru\98\9a\9a\96\90\92\97\93\95\99\96\8f\94\92\8d\86\7f~}x{\80\7f\82zz\80\80{\7fxswvqu\97\8d\9a\8c\87\91wny\8c\86\8f\9b\9b\98\8f\91\91\89\8e\8e\83\82\8a\95\99\9f\98\9a\9e||\86zw}milpopdcdacf}}\80\87\83\88\89\8b\8c\94\92\96\97\99\9d\91\94\99\97\98\9b\99\9e\9f\8d\91\95}|\81\9c\9d\9e\9e¡¢\97\98\9d\91\94\99\95\96\9f\8f\8f\98\9f£ª¯µ¸¨°º\9d\9f§\96\9c¦\9d\9f©\8a\89\96\8f\90\9b\8a\88\90}\80\87\83\84\88\81\80\87{z\84vx\80\83\85\8d\84\89\92\84\86\92|y\87z|\89urypkqqnrnmppottrx\86\82\87\86\86\8e\82\86\8d\87\8b\8d\9a\99£\92\94¡\98\97¤\92\92\9f\99\97¥\8b\84\90\8a\85\8d\8a\88\8a\9a\9a\9fª®³\9d¥­\94\95\9b\90\91\98\9b §§¨ª\9c\9d§\92\94\9d\9b\9e¤®®¶\9e ©¥«´±¶¼­°¹ª¬¸®±½¥¦²\98\97\9d¢¥©\9f\9f§¨¥®°²¹¬¯º\97\9a¡\9b\9f¥\93\98\9e\99\9a\9b\98\9f¤\90\96\9c\93\95\9a\94\92\9b\8c\8b\92\8e\92\98\95\98\9f\9c¢¦\97\9e¥\95\9b¥\97\9a¦\90\95\9e\8e\92\9a\94\98 \94\96\9e\93\98 \92\97¡\88\8d\94\95\99¡\91\93 \94\98¤\96\98¡\8d\95\9f\91\98\9e\9a¦ª¢¨²\98\97¡\97\98 ¡¨®\9e¤«\92\91\9b|\80\89\94\9b \9e\9f¨\8e\8b\90\93\95\92¢\9e\9f\98\97\98\92\96\96±²±¶µ¹¬§«¿¾Á²¬²Uc`Sa\Zb`fqlv\84\7f\94\9a¡\8a\93\95w\7f\8aw|\87q}\86CQ[$)5\1c\1a'$&*//.BCDNPSTTVTRVYW\TVZVW\Z]bPX\W[aghobhj_ciehn^ahZ\ea_hiilgikikn\acdejlourmwkjonmnfdcqntttq|vw\93\8b\91\96\95\9b\87\85\89\83|\84\9f\9b§¢¢©\8e\94\97\87\8b\90~\81\83\7f\83\8bvy}|y~\7f\85\85pot\82\82\88\8d\98\9a\8b\8e\97\97\97 \9c\9a¡\93\8e\96tr|jiwxr{d]cZY^hdi{{~yuvvuu\85\80\86\80}\87\90\9a¢\86\8e\95¢¥­ §¬\8a\8f\95¨¥¯\9c\9e¢\92\8f\92´²µ\9f¢¨±²¶¡¥¨\87\89\8f\89\89\8e\8a\8a\95\9c\9c«¡£°\91\90\9d\91\95 \82\86\8e\88\8b\92uy\83\80\81\8c\80\86\8cyv}|{\80\89\87\89\84\85\89\87\82\8e\87\89\91{{\81knsmlpwntnlm\80\81\80\7f\81\83ruv|}\80\8f\91\96\91\93\9a\87\88\8d\8f\8f\94\95\98\9d\95\9c¢\83\8a\90\80\86\8b\83\8a\8f\89\8c\8e\91\90\91\94\93\95\90\8d\94\95\96\9c\9f£©\9e¥¬\8f\8f\98\96\98¢\9f\9fª\95\98\9f\97\9c¤\97\99£¢¤­\97\9c£\9a\9b¡¤£¬\9f¤¯\9e ¨\9e\9e¥\94\93\9c ¢£©ª°\9d¡¨\98\9c£\9f\9f¦\96\97¢\90\95\9e\89\8a\94\9e¡¦µ´¸«°µ¢¡¬\92\9a¢\8e\95\9d\91\90\93\98\98\9c¢¨­±¹Â¢§´\90\95\9d\8a\8c\94\8b\95\9a\95\9e¢\99\9c¥\93\95\9b\92\95\99\8d\93\9c\8c\91\99\87\8b\93\84\89\8e ¢§\96\96\9f\88\8f\95\94\9b£\90\93\9f\8f\93\9b\8f\97\9f\8c\8c\97\87\8b\93\90\94\9e\8e\93\9e\8f\93\99\8e\91\98\8c\93\9d\81\88\92\90\97\99\98\92\95\85\82\85\87\8c\8a\95\97\98¡¡¥¢\9e§\9e\9e¤´µ¹\9a\98\99\87\94\8eQ\Z310MIB[\`QU\BEK'%,%'/\13\15\1c\ e\ e\12"&'IIIZZ]]\`TXYWSXbioYbe\_dZ`bjpthpqilpcio`em^cgcemnswdjont\7frw}pqvgjtvv\80ou{mt{qz\82z\7f\85|\81\86\87\8a\93\9a\9f¥\94\99\9c\85\86\90y|\86\88\8a\8f\89\8d\93\7f\89\90\82\8d\95z}\86}\7f\89\89\8e\92yz\80y}\87{\80\86\82\83\8d\88\8a\92\81\82\8awu\7fz}\87vx\81ur}nmxmlrqlp[]a[]`hcefdhurv~~\83ww~\88\88\88uyxz}\82\80\81\8c\96\97\9f\9b\9e¢\9c\9e¢\97\9e\9d\92\95\9a\90\94\9d\9e¡©\9f ¨«®´¢¡­\8b\8e\9a\84\8a\8e\82\85\89\8a\8c\8dz}\85\82\81\86ttytq{zz\81wz\82tsw}~\82\80\7f\88~~\84~\80\82{}\88\81\82\8dsrx\82\82\89\83\81\85\82\7f\81}}\7fzx{\83\88\89\92\9a\9c¤«­\89\8b\8e\8b\8b\92\8f\91\96\95\97\9e\8e\93\99\9d §¡¢§\90\95\9f\98\97¡\9b\9d¤ ¥¨¢§­®³¶¤¨¯\95\94\9b\9b\9d ¡£¬\9c\9a£ ¡¦\93\99\9e\9d¡£\9e£©\8f\92\9c\8d\8e\96§¨°¤¨°\9a\9d¤\83\89\90\94\96\9d\98\98¡\8f\90\9a\89\89\93\90\92\99¢¤§¤§¯¢¢«\9c\9c¤\8f\91\98\92\8f\91\91\98\9c\91\95\9b\9e\9f© ¦¬\9f¡§\8f\95\9c\90\93\9b\8e\8f\96\92\98\9e\9c¡¥\93\90\99\93\92\99\81\88\8f\83\88\8c\89\94\98\94\95\9f\94\95£\94\98¤\9c\9e¥\98\9f¢\98\9a\9e\9c§©\94\9e¥\8c\93\9c\98\96¢\8b\8f\96\81\8c\90\8f\93\99\9b\9e¥\95\9b¥\87\8e\97\8e\8f\96\84\86\8c\81\83\8b\8b\90\9a\89\8f\96\8d\94\9a\93\99\9d\89\92\96\97\9c¡\91\99\9e\8e\94\98\99\9b\9f\8d\90\96\8e\8e\94\8e\8e\90\85\83\89QCPWSZAHH=F@DLHBMKS[\_lmQa_N`_LVT^fiiqsdnqRX^PRZcillopdntjst}}\81orzpu}ryzeei_glopznlrru~w\7f\86nv\7fmu}lpuajr^`kor|sx\81\80\84\8c\80\87\90|\80\87ptyuu\83uw\84\81\83\8atuzqv~\93\96\9d\8e\92\9c\9b\9f¤\90\92\9a\8c\92\99\8c\8b\95\98\9d£v~\82z{\81\82\80\87x}\87x\80\89wy~lllvw}ljqqtt}\80\83tz}z\83\84{}\7f\83\83\89jlo[W[xswtsv\82\86\88¡©ª¬²¯\97£\9d\83\8b\8d§ª¯°®²­­¯¬®°·º¹¢§©\98\9c¡¥¬° ¥©\85\8e\91\86\8c\91\99\9f¢\92\98\9d\93\96 \85\8b\8e\8a\90\93\8d\97\92\86\88\85\8e\8b\8e\8a\8e\91\84\84\86\85\84\88\85\87\82\7f\80\81\94\95\95\80\87\88{\81\85\88\8a\8f\84\81\82yuu\7f~|\9a\99\9b\95\9b\9e\9b¡¦\8b\8f\97\9b\99¥\89\88\8e\87\8c\90\99\9d\9f\9b\9c\9e\96\97\9d\93\94\9d\98\99 \8d\8d\94zx\80\88\8d\92\93\94\9b\9d\9e¦±³¹¢¥©©®±\94\9a\9c\9c ¢¢ª¬°µ½¦ª¬¡§¨¡¥«\97\99¡\98\9f¢¨±´\94\9c£\9b£©¡©ª\92\99\9e\8c\96\99\8b\90\90\8b\91\92\86\8c\8e\90\95\9d\94\99¡\88\8e\97\91\94\99\94\9b \9b¡¥£¦­£¥ª\9b\9b \9f\9f¦\9d\9b£\9c\9c \85\87\90\86\88\90\84\89\8e\8b\8f\95 \9e¢\88\87\88\8e\94\96\8b\8e\92¤©¯\8f\92\9d\89\8c\94\8f\94\9a\89\8e\98\90\94\9d\90\93\9a\95\98¡\90\95 \87\8b\94\84\88\90\8c\92\98\86\8f\96\90\97\9e\86\8f\99\88\8e\97\84\85\8c\7f\81\88\85\88\8f\83\8a\8f\8a\93\98\8a\8f\96\88\89\93\87\8b\96\85\8a\96|~\86\83\8a\91\88\8d\97\8d\8b\96}~\86\84\8b\8e\93\9a¡\96\9b\9f
\ No newline at end of file
diff --git a/data/images/stawamuschief_gray.pnm b/data/images/stawamuschief_gray.pnm
new file mode 100644 (file)
index 0000000..d856042
--- /dev/null
@@ -0,0 +1,4 @@
+P5
+199 149
+255
+\93\93\93\93\93\93\93\9b\9b\9b\9b\9b\9b\9b\9b£\9b£\9b£\9b££££££££££¬¬£¬¬¬¬¬¬¬¬¬¬¬¬´¬¬¬¬¬¬¬¬¬¬¬¬¬´¬¬¬´¬´¬¬¬¬¬´´´¬´¬´´´´´»»»»»»»´»´»»´»´´»´´´»»´´´´´´¬´¬´¬¬´¬´´¬¬´´´¬´¬´¬´¬´¬´´´¬´´´´´´´´´´¬´´´´´´´¬´´´¬¬´´´´´¬´´¬´¬´¬¬¬´¬´¬´¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬\9b\9b\9b\9b\9b\9b\9b\9b\9b£\9b£££\9b£££££££¬£¬¬¬¬¬¬¬¬¬¬¬´¬¬´¬¬´¬´¬´´¬´´´¬´¬´´´´´´¬´´´´¬´´´´´´´´´´´´´´´´»»»»»»»»»´´»´»»»´»»»»»»´´´´´´´¬´´´´¬´¬¬´¬´¬´¬´´´´´´´´´´¬´´´´´´¬´´´´´´´´´´´´´´´´´´´´´¬´¬´¬´´¬´´´¬¬´´¬¬¬¬´´¬¬¬´¬¬¬¬¬¬¬¬\9b\9b\9b\9b\9b\9b££££££££¬¬£¬¬¬¬¬¬¬¬¬¬¬¬´´¬¬´¬´¬´´´´´´´¬´´´´´´¬´´´´´´´´´´´´´´´´´´´´´´´´´»´´»»»»»Ã»»»»»»»´´»´´»´»»´´´´´´´´´¬´¬¬´¬´´´´´´¬´´´´´´´´´´´¬´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´¬´´¬´´´´¬´¬¬´¬´¬´¬¬¬¬¬¬¬¬¬\9b\9b£££\9b££££££¬£¬£¬£¬¬¬¬¬¬¬¬¬¬¬¬´¬´¬¬¬¬´¬¬¬¬´¬´¬´´´´´´´´´´´´´´´»´´»´»´´»»»´»»»»»»»»Ã»»»»»»»»»´»´»´´»´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´»´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´¬´¬´´¬´¬´¬´¬¬\9b\9b\9b\9b\9b\9b\9b\9b\9b\9b\9b££££££££¬£¬¬£¬¬¬¬¬¬¬¬¬¬´¬¬´¬´´´´´´´´´´´´´´´»´´´´»»»´»»»»»»»»»»»»»»»»»»»»»»»»´´´´´»´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´»´´´´´´´´´»´´´»´´»´´»´»´»´´´´»´´´´´´´´´´´´´´´´´´´´´´´¬´¬¬¬¬¬\93\93\93\93\93\9b\9b\93\9b\93\9b\9b\9b\9b\9b\9b\9b\9b\9b£\9b££££££££¬¬£¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬´¬´´´´¬´´´´´´´´´´´´´´´´´´´»´»»»»»»»»»´´»»»»»»»»»»»´»´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´»»´»´´´´´´»´´»»»´´´´»´´»´´»´´»´´´´»»´´´»´´´´´´´´´´´´´´´´´´´´´´´´´´´´\93\93\9b\9b\9b\93\9b\9b\9b\9b\9b\9b\9b\9b\9b\9b\9b\9b£\9b££\9b\9b\9b££££££££¬¬£¬£¬£¬¬£¬¬¬¬¬¬´´¬´´´¬´´¬´¬´´´´´´´´¬´¬´´´´´´´´´´´´´»»»´»»´´´´´´´´»´´´´´´´´´´´´´´´´´´´´´»´»»´´´´»´»´»´´´´»»»´»´»´´»´´»»´»´»»»»»»»´´»´»´»´´´»´»»´»´»´»´´´´´´´´´´´´´´´¬´\93\9b\93\93\9b\9b\93\9b\9b\9b\9b\9b\9b\9b\9b££££\9b££££££££¬£££££££¬¬¬£¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬´¬´¬¬´´¬¬´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´»»´´´»´»´´´´´»»´»»´´´»´´»´»»´´»»»»»»´»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»´´»»»´»´»´»´´´»´´´´´´´´´´´´\9b\93\9b\9b\9b\9b\9b\9b\9b\9b\9b\9b\9b£\9b\9b££££££££££££¬£¬£¬¬££¬£¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬´¬¬¬¬¬´¬´´¬´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´»´´»´»´»´´»´´´´»´´»»»»´»»´´´»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»´»´´´»´´´´´´´´\9b\9b\9b\9b\9b\9b\9b£\9b£\9b£\9b\9b£££££££££££££££¬¬¬£¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬´¬´¬¬´´´´¬´´´´´´´´´´´´´´´´´´´´»´´»´´»´´»»´´»´»´»´»´´´»´»´´»´»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»Ã»»»Ã»»»»»»»»»»»»»»»»»»»»»»»»»´»»»»»»»´´»»´»\9b\9b\9b\9b\9b\9b\9b\9b\9b\9b£££££££££££¬££¬£¬¬£¬¬¬£¬¬¬¬¬¬¬¬¬¬¬´¬¬¬¬¬´´¬´´´¬´´´´´´´´´´´´´´»´´´´´´»´´´´»»´´»´»´»»»´»´´»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»Ã»»»»»»»Ã»»»»Ã»»Ã»Ã»»»Ã»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»´´»\9b\9b\9b\9b\9b\9b£\9b££\9b££££££££¬£££££¬£¬¬£¬£¬¬¬¬¬¬¬¬¬´¬¬´´´¬´´¬´´´´´´´´´´´´´´´´´´´´´´´»»»»´»»´»´»´»»´»»»´»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»Ã»»»Ã»»»Ã»Ã»»Ã»»Ã»Ã»»Ã»»»Ãû»Ã»Ã»Ãûûû»»Ã»»»»»»»»»»»»»»»»»»»»\9b\9b\9b£\9b££££££££££¬£££¬£¬£¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬´´¬´¬¬´´¬´´´´´´´´´´´»´´´´´´»´´»´´´´´»»´»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»Ã»»»Ã»»»»Ã»»Ã»»»»»»»»Ã»»Ã»Ã»»Ã»Ã»»Ã»»Ã»»»»ÃûÃûû»Ã»Ãû»Ã»Ã»»»»»Ã»»»»»»»»»»»»»»»\9b££\9b\9b££££££££££££¬£¬¬£¬¬¬¬¬¬¬¬¬¬¬¬¬´¬¬´¬¬´´´´´´´´´´´´´´´´´´´»»»´´»»»»´»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»Ã»»»»»»»Ã»»»»»»Ã»»»»»Ã»»Ã»Ã»»»»ÃûÃÃÃÃûû»Ã»Ã»Ã»ÃÃÃÃÃûÃÃûûû»Ãûûû»ÃÃÃûûÃû»Ã»»Ãûû»»»»»»»£\9b£\9b££££££££££¬££¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬´¬¬´´¬´¬´´´´´´´´´´´´´´´»»´´´´»´»´»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»Ã»»»»Ã»»Ã»»»»»»Ãûû»»Ã»»Ã»Ãûûû»Ãû»Ã»ÃûûÃÃûûÃÃûÃÃûÃÃûûÃûÃûûû»»Ãû»»»Ã»»»Ã»»»»»Ã»»££££££££££¬£¬¬¬£¬£¬¬¬¬¬¬¬¬¬¬¬¬´´¬´´¬´´´´´´´´´´´´´´´»»»»´´»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»Ã»»»»Ã»Ã»»»Ã»»Ã»»»»Ã»Ã»»ÃûÃûûûÃûÃÃûûûÃûÃÃûÃÃÃÃÃÃÃÃÃÃûÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃû»»Ã»Ã»Ã»£££££££££££¬£¬¬¬¬¬¬¬¬¬¬¬´¬¬´¬¬´´´´´´´´´´´´»´´»´´´´´´´»»»»»»»»»»»»»»»»Ã»»»»»»Ã»»Ã»»»»Ã»»Ã»Ã»»Ã»Ã»»»»»»»Ã»»»»Ã»Ãûû»Ã»Ã»Ã»Ã»Ã»»ÃÃÃÃÃûÃÃÃûÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃû»Ã»Ã»»»»Ã££££¬£¬£¬¬¬£¬¬¬¬¬¬¬¬¬¬´¬´´´¬´´¬´´´´´´´´´´´»´´»»»»»»»»»»»»»»»»»»»»»»»»»»»Ã»Ã»»Ã»»»Ãû»Ã»»»»Ã»»Ã»»ÃÃÃÃÃû»ÃÃûûÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃûÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÊÃÃÃÃÃÃÊÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃûÃÃ㣣¬£¬£¬¬¬¬¬¬¬¬¬¬¬¬¬¬´¬¬´¬¬´´´´´´´´´´´´´´´´»»´»»»»»»»»»»»»»Ã»»»»»»»ÃûÃû»»Ãû»Ãû»»»ÃÃÃÃûÃûûûûÃÃÃÃÃûÃÃÃÃÃûÃÃÃÃÃÃÃÃûÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÊÃÊÊÃÃÊÃÊÃÃÃÃÃÊÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃ㬣¬£¬¬¬¬¬¬¬¬¬¬¬¬´¬´¬´´´´´´´´´´´´´´»´´»´»»»´´»»»»»»»»»»»»»»»Ã»»Ã»»Ã»»Ã»»»Ãû»ÃÃÃÃÃÃÃû»Ã»ÃûÃÃÃÃÃûÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÊÊÃÃÊÃÃÊÊÊÃÃÊÃÊÃÊÃÃÃÃÊÃÊÃÊÃÃÊÊÃÊÃÊÊÊÃÃÊÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃ쬬£¬¬¬¬¬¬¬¬¬¬´¬´¬´¬´´´´´´´´´´´´»´´´»´´»»»Ã»»»»»»»Ã»Ã»»»»»Ã»»Ã»´¬££»Ã´\9b\84\9b\9b»Ãû´Ã»ÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÊÃÊÃÃÊÃÃÃÊÃÃÃÃÊÃÊÃÊÃÊÃÃÊÃÊÃÊÃÊÃÊÃÃÊÊÊÃÊÊÃÃÊÊÊÊÃÊÊÊÃÃÃÊÊÊÃÃÊÊÊÃÃÃÃÊÃÊÃÃÃÃÃÃÃÃÃ죬¬¬¬¬¬¬¬¬¬¬´¬´´´´´´´´´´´´»¬\9b{\84\84\84ss\84\8c\84\84\9b\9b\84\93¬´´»¬£\93\8c\9b´»»ÃÃÃÃì´£\84\84\9b\9b£{\84s\84\84\9b{{\93£»Ã»´¬»»ÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÊÊÃÃÃÃÃÃÃÃÃÃÃÃÊÃÃÊÃÃÃÊÊÃÊÊÃÊÊÊÊÃÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÃÊÊÊÊÊÃÊÃÊÃÊÃÃÃÃÊÃÃ쬬¬¬¬´¬¬¬¬´´¬´´´´´´´´´»»»´\84kkdskkddddd[ddds{ssskdk{\84{\8c{\84´»£\93\9b¬££\93¬\9b\93\8cs\84s\84\84\84sss\84ÓÛÊ£\9b£´´´»ÃÊÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÊÃÃÃÃÃÃÊÃÊÃÊÃÃÃÊÃÊÊÊÊÊÃÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÃÊÊÊÊÃÊÊÃÃÊÃÃÊÃÃÃ쬬¬¬¬¬¬´¬¬´´´´»´´´´´´¬\9b\93\84ddddkkskkkd[T[kkdkddkskks\93\8c{kkdd\9b\84\84\9b\9b\84{\84\9b\93\93\9bk{kk\84sd{\9bÊìÛ»¬\9b\9b\9b\9b»»£¬»ÊÊÃÃÃÃÃÃÊÊÊÃÃÊÃÃÊÃÊÊÃÊÊÊÃÊÃÊÊÊÃÊÊÃÊÃÊÃÊÊÊÊ»£\8c\9b£»»ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÓÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ쬬´¬¬¬´´´»¬££\93\9b££¬£\93s[[kkddsd[dd[[d[[T[dd[dd[dkdddk{kds\8c[d\8c{\93\8c\93ss\9b\84\84{sdkd\84\84\84»ãùìû´Ã»»´´´¬\84\93\9b»ÊÊÃÃÃÊÃÊÊÃÊÊÃÊÃÊÃÃÃÊÊÊÊÊÊÊÊÊÊÃÊÊÊÊÊÊÊû£sss{\84\8c¬»»ÃÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÓÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÃÃʬ¬´¬¬´»´¬\9b\84ddd[[dddd[Tds\84\84kTT[TTd[[d[TT[[[[[[ddkdTdkssskskTkks\84\84\84s\93\93\84\93\84dk\93¬\93£Ê´¬´´´´»´¬£\8c\84£\93\9b\8c{´ÓÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊô¬\84s{\84\84s{\84\9b\9b\9b´´ÃÃÊÊÊÓÓÊÊÓÊÓÊÊÊÊÊÓÊÓÓÊÓÊÊÓÓÓÓÊÊÊÊÓÊÊÓÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊʬ¬´´´¬\93s[LLT[T[TT[dT[dkk[TTTLd[TT[TTLT[T[[Tddkkkkd[\84\84{k[kd[dkk\84s\93\8c\9b\8c{\84\8ck\84û»´»Ê¬£\93\93\93\9b\84{\84{\84£\84{\9b\93{£»ÊÃûÃÃÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÃÊÊÊÊì\84\84sss{skk{\93\93¬´´\93´´»ÊÊÓÊÊÊÓÓÊÃÊÊÓÓÓÊÊÊÊÓÊÓÊÊÊÊÊÊÓÓÊÊÊÊÓÓÓÓÊÊÓÊ´\9b£¬ÃÓÊ´»´\9b\84[LLLLTTT[LTTTL[TTTT[d[ddLTTTTTLTTTT[T[s{dk[dTdsdss{sdd[[[dk\84\84\9b\93\8c\84\84s´Ó»\93\8c»\93\84\8c\9b¬\93\9b{{ss{\93\84{ss{{\84\84\8c\84\93\84\84\93\93{´ÓÓÛÓÓÛÓÓÊÊÓÓÓÓ»\93\8c\84\9b£\93\93\84sssssssks\84\84\84\9b¬\93\9b\93£¬´´´Ãô»¬´´»´ÊÊÊÓÓÓÓÓÓÓÓÓÓÓÓÓÃÊÓÓÓû´´ÊÓ»´£\8c\8c\93\93\9b´£\93{dLLLTLTLTTTTT[T[[Tdd[kddLdkTTLTTLLL[[Td[[[[[T[dddk\84\84£££\84kd[[kskd{{\84ksk\84\84¬¬k{{s{{\84\93\93ks{\9b\9b\84{sddks\9b\93\93\84\8c\84\84\84sd£ìÓû´\9b£¬»ÃÃû\9b{\84\84\84{s{{sssks{skk\84\84{ss\93\9b\93¬\93\9b´»¬\93\93¬´¬´££\93\9b¬£¬ÃÓʻô´»ÊÓÓÊ´¬Ã´£\9b\9b\9b\93\9b\9b\93\93\8c\93\93\84\84\8c\84{LLLTLTLLLLLLL[dTT[[dsk[ddLT[TTTLTLTTTTT[d[[T[[T[[sk\84\93\93\9b£\93\84s[dkss{s[{\84\84\84\84s[dksks\84\84{s{kd\84\9b\93skkdddd[k\84\84\9b\93\84{\84kkÓ»´»Ãô»´\9b¬¬\93\84ss{{{sssskssssssss{{{{{{\84\84££¬´´\93\84\9b¬\93\93\93\93\9b¬\93{ss{\8c{ssss\84\84\84\93\9b¬¬£\93\93\9b\93\9b\8c\8c\8c\8c\93\8c\93\8c\8c\84\84\84\84TTLTLLTLLLLLT[TLTdT[[[[[[TTTTTLLTLTTTdd[T[[[s{T[ddT[{\84s{\84d[ddddds\84d{\93\93£\9b£s[dk[ddd{skkddksdddddkdddks{ssksk\84»\93\8c\93\8c\9b\84\9b\9b{{\84ssssssksssksssssss{\84\84\84{\8c{{kss\84\9b£\9b£\9b\9b\84s\84»´¬\9b¬\84ssskss{\8c\84sssss{\84\84\93\84\8c\8c\8c\8c\84\93\93\84\93\84\93\8c\84\93\8c{TTLLLLLTTLTTTLTTTdddTTTTL[[LTTTTTTT[[dd[T[T[d[[sdkd[[s[[[[[s{{kdddk[ss\84\9b\93\84sddk\84\84\84{skdddkdkk{kddkdddksd{{ks\93\9b\84{sks{ss{{ss{{{{sssskssssss{s{ssks{s{skkssss{s\84\93\84»´\84{s\9b\84sssssks\8c\9b\8c\84\93\84{{s{{{\84\8c\84\84\8c\93\8c\93\93\8c\93\84\84\93{sTLTLLLTTTTTLTTTTLL[[TTTTL[[TTTT[T[[d[[[[[[[[TTkdkk[[[[[[[[dddkd[[[[[[[dddk{\84\84\84\84\8c\84{kdksdks{{ddkksdd[[ksksksdks{s{ssss{{s{{{{ssssssssssss{ssssskkkk\84{s{{{{ss{\84\93{sk\8c\93\93\84sssksk\8c\9b¬¬´¬\84\84{ss{ss{\93\8c\8c\8c\93£\8c\84\84\8c\8c\84{{[[TLTLLTTLLTLTLTTTLTTTTTTTT[[[TT[[dddkdkd[[[T[[T[[T[[[d[[[d[[[[[d[[[[ddddk{{dk\84{skddsksss\84d[dssss[[T[dkkkkkksss{sssss{\84\84{s{sskss{s{sssssskkkkkkkk\84\84sks{sssss\84skks{kkkks\84\93¬´»¬\9b£\9b\93\84sks\84skks\84\84\84\84\9b\93\84\84{\84\84{{TTLLLT[[TTTTLLTTTTTTLLTTTTTT[[TT[[T[[[d[[[TTTT[[[T[[[dsd[kskd[ddd[dd[dkk{{kddssdddkks\84kkkdd[[T[d[[[[[dkssskkkss{sssss{{{ssss{s{{sss{ssks\93kkkkkkssssssssks\93\9b¬£skkkksks\84\9b\9b\9b\93\84\8c\8c\9b\84{sssk{£\8cksss\84\84\93\8c{{{\84\84{ssLLLTL[[TTTTLTTTTTTTLLTTLTL[d[T[[TLTT[TTT[T[[[[[[[[[[[[d[ddksskdddddddkkkkkdddddkkddskd[[d[[[[kddd[d[Tdkds\93\84kksk{ssss{sss{sss{s{sssssssss{kskskksssssssss{s\84\9b\84skkkks{{\84{ks\8c{sk\84\84{kkkk\8c\8c\84sskss{\84{{\84\84\84s{ssTLLTTTTTTTLTTLTTLLLTTLLTLLdkTLLTTTTTTTTT[TT[[TTTT[[[[[[[[[[ddk[[d[dk[kkddsdddddddd[dk[[d[[kd[dddd[[[dddkk\93¬£\84ssssss{{sssssssksskskkksskksskkkkkkssss{\8c{{sskkksssssks\84ssssssksks{{{ss\8c\84{ss{sskss\84{sss{ssLTTTTLTLLLTTTTLLLLLLLLTLLTTLLTTTLTTTTTTTTTTTTTTTTTTTT[TTk{d[dT[[[[k[[ddssddd[dkd[[[dd[T[[dddkTT[[d[[dddddk\84\84\9b\93{kksssskkskkssssskkkkkkkkkkkkkksskks{s{ssksssssssskkkssssskkk{kk{\84skskss{sk\84\84{\84ss{{{{{{ssTTTLLLTLLTTLLLLLLLLLTLTLLTTLTTTTTTTLTTLLTTTLTTTTTTTTT[TL[sdT[[[[[[dddddd[dd[d\84sdkdTd[d[T[[[skTddT[d[[ddddkdddsksssssskssssssskkkkkkkkssskkkkkkkss{{ss\84\93\84\93\93skkkkk\84{sss{{{\8c\8ck{\9b{d\84{kkkkskks\84{\84\93\84{s{{{ssssTLLLLTTTLLLTLLDLLDLLLLDDDLLLLLLLLLLLLDLLLLLTLLLTTTTTTLTTT[TTTT[TTT[[d[dd[dd[dd[ssdT[[dTTddsd[[dk[[[[dd[[[dkkdddkkkkkksskskkkkkkkddkdkkkkkkkkkkksssk\84\84\9b\84s\84\84{ks{\8c\93\93\8c{s\93¬£\93\93¬{d\84\9bkks{{ks{{{d\8c¬\84s\84\84\84{ssssssLLLLLLLTLLLTLLLLLLLDDDDDDDDDDDDDLDDLLLLLLLLLTLTTTTTTTLLTLTTTLLT[[TTTT[dd[Tdd[[[TT[[[[T[Tdksd[d[[d[[[ddkd[dddkkddddddkdk{kkkkkkkkddkddddkkskkskkksk{£¬´\84\84\84\93sks\84\84sksk\84\93\84\84\9b\9b\84\93\8ckssssksk\84£\8c\84{{\9b£\93{\84{\84ksss{\84LLTLTLLLLDDLLLLLLDDD<DDDDDDLDLLLLLLLLLLLTLTLLLLLTTLLTTTLLT[LDLT[TTT[TT[T[[[[[[[[[TT[[TTTd[[kd[Td[[[dddd[ddd[[dddddkkkkk{kdkddkkddddkdddddddkkkkkss{s{{\84\84sskkskkkkd{s\93\84\84\84\93´\93\93¬\84kkkkkkk{\84\84\93\8c{\93¬\8c{{{{kkss\84LTLLLLLLDDDLLLLLLDDDDDDDDDDDDLLLLLLLLTLTLLTTLLTLLTLTTLTTTddLDT[[TTTTT[[[[[T[T[[[[Tdsk[TTd[[TT[[[[ddd[d[kdsddd[T[dkkdddddskdddddkdddddddddkdkkkkkkkdkkkdkkdds{kk{\93\8c\93\84\84£»\9b\84\9b¬\84\84££{{ss{\84\84\84ss\84\8c{\84\93\8c{\93\84kkkksLLLLLLDDLLLLLLLDDD<DDDDDLDDDDLDLLLLLLLLTTLLLLTLLLLLLLLTLTTTTTTTTTTTTd[[[TT[TT[dsdT[kdddTd[[[TT[[[[[dss{\84sk[kdds\8cs[dddddddkkkdkddkddddkkdkdkkkkkdksskkkskskkssssk\84\9b\9b\84s\9b»££\84\93\93\84{\84\8c\93\84\8c»ÃÃÃ\93{ss\93\84\84\9b\84ks{kskkLLLLLDLLLLDLL[LDDDD<DDDLDDDDLDDLLLLLLLLLLLLTLLLLLLLLLLLLLLTTTTTLTTT[T[[[[T[TTd{\93\8c\84[LT[dT[[T[[[[[[[\84\84skkdd[dsks{kk{sT[[[dddks\84kddkkddddddddkkkkdksksskkskkkskskkkdk\84\84{ks\84\93\84£\84\8c\8c{{{¬\93\93\84\93´´\84{ss\84\84\84\93\84{skkkkTLLDDDDLLDLLDTTDDDDDDDDLLDDDDLLDDDDLLLLLLLLLLLTLTLLLLLTLLTLTTLLLTTTT[T[[TTTTT[T[\9b\9bdT[TTTT[[[[[dd[d{ks{d[[[[dd[[[[dd[Tdd[ddkd{{ddddkkddddkdkkkddkkkkkkkkkkkkskkksskddkddddkskkkkds{{s\84\84{kkssks{ss\84skkdddLDT[dTDDDDDLDTkT[dLDDDDDDDLDDDLDDLLDDLLDLLLLLTTLLLLLLLTLLTLLTTTL[T[[T[TTT[T[T[dTdsd[T[[T[[[[[d[dd[[dkk[[[[[[[[[[[T[[TT[ddddkksssddkkkkdkkkkkkkkkkskkkkkkskkkkdkkkkkkkddddkkks\84{\84{\84\93\9b\93\84\93\9b\93{k\84sk{kkks{kkkLTdd[[TDDLDLDL[k{{DDDDDDDLDDDDDDLDLDLLDLDLLDLLTLTLLTLLTLLLTTTTTTTTTTT[TTL{sTdT[TTTT[[[[[[[[[TTTT[[[[[TTTdkdd[kdd[[[ddTTdkkdkkkkkdkkkkskdkkkkkkkkkksskkskskkkkkkddddkkkdkddkkk\84\84\84\9bÊ»»Ã\9b£Ã´£\84\9b£kdkk{ssskkd[[[dd[LDDDDDLLLT[DLDDDDDDDDDDDDDDDDLDLLLDLLLLLLLTLLLDLTLLLLLLTLTTTTLTTTT[[Td[TT[T[[[[d[[[[[[TTT[[[[[[Tk{d[T[d[ddd[kdTT[dddkdddddkkkkkkkkkkkkkksskdsksskkkkkkkkkkkkkkdkkkkkkkkkks{\84\9b»£\93¬¬£\93\9b´¬skkkkkkdk[T[ddd[LDDDLLLLLTLLLD<D<DDLDDDDDDDDDLLLLLLLLLLLTLLLLLLLTLDLLLLLLTTLTTTTTTTTT[T[TT[T[[TTddksdd[[TT[[[[[Tddd{kd[[[[dssk[LL[ddkddddddkdddkkkkkkkkkkkddkddd[kkdkddkkkkddddkkkkskksskkkssksk{\93\9b\9b££Ã¬kkkkkkkdkkskddTLDDDLLLLLTLLLLD4<<<DDDDDDDDDDDLDLLDLLDLLLLLLLTLLTLLTLLLTLLLLTLTTTTTTTLTTTT[T[[TL{\93\93\9b\84dd[[T[[[[[T[T[kd[[[d[s\84{k[LDkksskdddkkddddddkkkkkskkkdkddddkdddkddddkdkkkdddddkkkkssskkkks\84sd\84\9b{{\84skkkskkkkdkdkTT[TLDLTLLDLLLLLTD<4D4<DDDDD<DDLLDDLDDLLLDLTTLLTLLTLLLTLTLTTLLLTLTTTTTTTTTLTTTTT[[[d{skkkT[T[[Tds[[[[TTd\84\84{\84s{\84{kdLLkdsk[[dskddd[[[ddkdkkskkkddddkkddkdddkd[kkkkdkkkkddkdkkkkkskkssss{skdks\84{ksskksTd[LLDT[TLLLDLLTLLLDDDD<LD<DLD<DDDDDLLDLLDLLLLLTTLLTLLTTTLLLLLLTTLLTLTTTTT[TTTLLTTTTTT[[kkss[[Tdd[T[[T[T[[TTd\84{{{{s{k{TLddkd[[dssd[[[[[[[kdddkkkdkdkkkkdkkkkddddddkdkkkdkdkkkkkkkkssk{{kkkkks{s\84\93ss\93{kkT[TLLLL[dTDLLLTLTTLD<D<DDDDDDD<DDD<DLDDLLDDLLDDLTLLTLTd[dLLLLTDTLLTTTTLTTT[TLTTTLLTTTTT[[[\84{d\84dkdTT[[T[T[[d[Tddk\84\8cskskd[dksk[dkk{k[[[dd[kddddkkddkdkdddddd[kdddd[d[dkkdkkkkkkkkkkkkkkkkkkkkkkds\93\9b\9b\84{sskLDLLLLL[dTDLLDLLLLDD<DD<4<DD<DDD<<<DDDDLLDDTdDLDTTLTLLTkkDDLTTLLLLDLTTTTLTTTTTTTLTTTTTTTTT[[dkdT[[T[T[T[[[ksk[[k\84\93\84sskd[dk[d[[[[[d[dddddkddkkkkkkddddkdkdddkddddddkkkkkkkkdkkkkkk\84{kddkssdddkksds{\8c{ssd<DDLLTLDd[TLDDDDDDDDDDD<<4DDD<<DLDDDDLLTLDDd{LTLLLLTLLDd\84<4<DTLTLLLTTLLLTTTTT[TLTTTLTTTTTTTTTTTT[T[T[[[d[[T[kd[[dsd[[dd[[[[d[[dd[ddddkddkkkkskddkkkkskssdddddddddkkkkdkdds{kddkkkkksskkkkdkkkkkskdkkksk<<DL[T[dd[TLLLDDDD<DD<<<DD4DDDDDDLDDDDLTTTDs\84TTDDLL[k[LL[L<<LTLLLLLDTTTTTLTL[[TTTTTTTTTTTTT[d[[TTTTT[TT[[d[[d[[[T[[[[dd[[[dd[[d[[dTd[dddkkddkskkdk[s\84{{skkdkkkdkkkkkkks{\93\84sskkskskkkkkkkkkssss{{skddkdk4L[d[[[[[[[[TD<LLD<LDDDDD<<<DDD<<DDDLDLLTLLs[TkD<TTL{sD<<TLLTLTLLLLLTLLLTTLL[TTLTT[[[TTTT[[[[[[TTT[TTT[TT[T[d[TTTT[d[T[d[ddd[[dd[[dkd[[d[[dddkdddksdk{{\84skdkkkkkdkkkdkksskkdk{{{ds{kkddkkskkss\93\84skdddkkLLT[[T[[[[[[d[LLTLLTL<<<<DD<<LDDDD<DDDLDDLT[DLk[4DTDdsLDDTTTTLLLdLDLTLLLLTLTTTTLLTT[[T[TTTTT[d[[TTTTTTTTTTTTddT[T[[T[[[[[[d[[[d[[dkkd[dddd[dskdddk{d[[d\84\93{{{skkkkddkkddddkkkkkkkdkskkkdskksksk{sskkkkkkDDDT[[TTTT[[ddLDLTLLLLDDDD<<<4<DD4<D4DDDLLT[Ddd[DD<DLsdLL[[TLLDLdTDLLTTLTLT[T[[TT[TT[[[[T[T[[TTTTTTTTTT[TTTTT[[[T[d[[[[T[T[[[[d[[[T[[[d[kdddksdd[[[ddddk\8c\8cs{kkkddddkkdkkdkkkkkkdkkkkkkkkskkkkkkkkdkdkkdLL[d[[[dd[[d[d[TT[TTLLTDD4<D<4DD<DDD<<<<DDdTDLTLLLDDDL[TTTTTLTLLLTTLTLTTTLL[L[[TLLTL[d[TT[T[[[TLTTLTTTT[TT[LT[T[TTd[TTTdd[[[[T[T[[TTTddddd[d[[d[[[ddddddd[dkkkkkdskdkdddddkdkkkkkkkkskkkkkkkkkskkkddkksLDLT[[kd[dd[TT[[ddddT[[TLL4DD444<D4<DDDDLLd[TLLLLDLDLDLdLLTTTLTTLLT[TLLLTL[T[dTTLLLTTT[[[T[d[[[TLTTTTT[TLT[T[d[TTT[T[[[ddd[TL[[[[[[[T[ddddddkdd[[[d[d[[dddkkdd[dddkddkdkkddkddkdddds{skkdkkksdkk{ss\84{{\8c<<DDLLTLDLLTDLDLTd[[[d[TLTD<4<444DD<D<DDDL[kDTT<DLDLLDL[[LLTTTTLTTLTTLTLLLTTdk[[LLTTTL[d[[[d[T[[TTTTTTLLT[[T[[[[[T[[T[d[[d[T[dd[[[[[T[[[[dd{{{k[d[[d[dd{kdd[ddds{dkkkkdkkkddd{{sddddkd{\8c{ss{\84{\84\8c\84s{{{ssD<<DD<D<DDDLD<DDD<LLLTLLLLLDDD4DD<DDDD<<DDTTLTL4DDDDDLLLLLLLTTTTTTLTTTLLLTTDdkTd[T[[T[d[TT[[TTT[TLTTTTLTTTTTT[TTT[[[[T[[[d[TT[dT[[TT[TT[[dds{ssdddddddk\84sd[[dddkd[s[\84sdddddkkdkkddddk\84\8c£\9b£\8c\84{{{{kkdkss{<DDDDD<DDDD4DDDDD<<DD44DDLLDDDD4DDDDLDDDLDLLTDTDLTTTLLLLDLTTLLTTTTTTT[TTTT[L[dTTd[T[[[[[TTTTTTT[TT[LT[LTTTT[T[[[TT[[[[dT[TL[[dd[[[[[TTT[d[ddk[dd[[dd[d[ksd[dkdd[[k{ds{ddkkkdddkkkds\84\93\9b\93\84\8c\9bsdkskdkks\84\8c\84\84DDD4<444<4<DDD<D<DDDLLD<44<DDDDDDDDDDD<D<DLLLDLTL[TTLLDDLDL[LTTTTTTTTTd[T[d[[[TTT[T[L[[TTTTTTTTTTTTTTd[T[T[TT[TTTT[[TTd[[[T[dkk[T[TTTT[d[[[T[kdk[kd[ddddddddddddddkdddddkdkddddks{{{\93\9b\84{{\84kkks{s\84\84\84\93\8cssDD444<<D44<DD<<D<<<<LDD<444DDDDLDDD44<44D<LTDD<[LLDLTLDLLDDTLLTLTTT[TT[[[Td[[[[[[dTTTT[TTTTTTTTTTTTTTT[T[TT[[[T[[[[TT[dd[[TTLksd[d[dsskdddd[dkkk[T[d[dd[dddddkddddddkkkddkddddks{{\84\84{\8csdds\93{{s\84\84\84\93\84sskkDDD<D<<<4<4<<<D<4DDDDDD444444<DDDDDDDDDDD<LDLLL[DDDTLLLLLLLTTLTLLLT[T[[[[dd[d[[dd[[[TTLTTTTTTTTTLTLTTLT[TTTTT[T[[[[T[[[[[T[ddkk[kksss{skdkddd[[kkTTdkdddk[ddd[d[[[kkkdkddkd[ks{{\84{{{k{\93\84\84\84\9b{ss{{\84\9b\84sk{{4D44<44444<<4D<4<DD4<DLD<4<D4DDLLLDLLLDDLLLD[LD[LLLTTTLLDLLLLLT[TTTLT[TTT[[[dd[[[[TLTTLTTTT[TTTLTLLTLT[[TTTTT[[[[TLTT[d[[[d[[[[kks{{{{\84ssssskddkkLLdd[[dkdddddddddkkkkkddddk\84\84\84{\84sk\84\84\93£\8c\9b\84sss{{k{\93{skkd<4D<<<DDD44<DDDD<DD<DDL<<<D<<<DLLD<LDLLDDDLLDLLTTLLDTLDDLDLLLDT[LLLLLLLTLT[d[[TTTTTTTTLTLLLTTLTLLLTLTdTTTTDL[[[T[T[kdkkkssdkkss{{\84\84{{{\84skks{{s{ksd[[dTdkkdd[ddddddddkkdds\84\84{{{s{{s{{\8c\8c{{{skkkskkddkdddd<<44<4<<<4<DD<<DDD<DD<4D<<44D<4DD<DDDDLLDDLDDDT[LLLDLLLDDDDDLLTTTTTLLLLTT[[[[TTTTT[TDTLT[[[dkkk[ddTTd[Tdskddkddddkdkkss{\84\84sss{{ss{ss\84\84\84\84{sss{\84\84\84\93\84sdd[kdkkddddddddkkkdss{\84{s\84\84{{{\84\84\84\84{skdddddddkdkdkkdd4<44<4<<<<<DD<44DDDDDDDD<44DD<D<DLD4DLLLLLDLL[[LLDLDLLLDTTLTLLL[[LLLLLTLT[T[d[[[[[T[[kkkk{{{\84{ssssssskssssssk{{ssss{{{s{{\93\84sss{{{{{{{{{ssssss{sskddddd[[[ddddkddd[dkkksskkk{\93\84\84\84\84{sskkddkdddddkkksss\93\9b\9bDD<4D<4DD<4DD<D<D<DLDDDDD<DLDDDDLLLDD<DD<D<DD[TLT[[Td[[ddkddTTDLTTLTLLLTTLDT[[[dsdkkks{kss{{\84skkkkkksksssssssss{{s{{\84{{{{\84{s{{{{ss{skd[[[[[dddddkd[[[[[[d[ddddkkdkk{kdddkkk{ss{\84kddkddddkdddkkkkkkkk{{{<DD<D<4<4<4DD4<DDDDDDDDDLDD<D<4DDLLD<4<D<<DD<[[T[kdd{kkdddd[dddkddddkddd[[ddddkks{{{sskdkdkssksskkkkdsssksskkk{{sss{ss{{\84skks{skdkkd[[[d[[[dddd[dd[[[[[[ddddd[[ddkkkkkkddks{sskdskkkkdddddddddkkkkkdddk4<DD<<D4<<DDDD<DDD<<DDLDDDDDDD<DD<DDDD<DDDDLD[[TTTd[{kkdkkkdd[dks{ddkkk[dkkkdkkddsss{sskkkks{ssssksskssskssssks{\84s{{\84{sd\84kd[ssskdd[[[kkkkkd[[dddd[[dkd[d[[[[d[[dddddddddkdkkdkskkkkkdddddddd[dkkdddd[[k<D4<4<DD<<<<DDDDDLLLD4<DLLDDL<LLLDDDDD<<DDLTDL[TT[[[sk[kkddddddssdddskkd[[ddkkddksksss{\84{ss\84\84sskkkkdsssssssssss\84\84{{{{s[[ddddddkk[dddddkkdkddddddddddk[[[d[dd[[Tdkd[[d[dddkd[ddddddkkddkkdkkdkddkdkds\84k\8c4<<4<D<<<<4<<<DDDDLDDDDDDDDDDDLLDLLDDD<DLTLTTL[TT[T[dd[d[Tdddddsskkkkdkd[dkddssddkskskkdkd[dkkkTT[[[[kskkkddkdkkksssd[dkddkkkddkkdd[[dkdkdddd[[ddkskd[dkdddd[[Td[[dddddddddddkdddkssskdddkdddkkdkkdk\84s\9b<DD<D44<D4<<4<<DLLLD<DDLDDDDDDDDDDDDD<DLTLLLTLT[TTLTTLTTLTLLT[T[[[d[[dk[[dd[ddkd[dkkdk[TTLLTTkd[[TTLTLTT[[LTTTT[kkdd[[kkdkkddkdkkkdkddkkd[d[TT[d[{\8c\84ddd{s[ksdTTskdddk[[ssk[ddkkkksskkdddkdddkdkdddkdsss<DDD<44D<<D44<DDDDLDDDDLDDDLLDDDDLDDLLLLDTTL[[LTTTTLLLTLLLDLLTLLTTLTTT[TTTTLT[[[[TT[TTTT[[[dds{sddd[d[kddd[dddks{sskkkskssskkddkksskskkkdkkd[dkd[d{\84{kds{d{{k[dssskTdkks\84k[[[[kkddddkkkdkdkks\84{kk{sskkk<<D<<D<<<D<4<<<D<DDDLLDLLDDLDDDLLDDD<DDLLTLTd[TLT[[TLTLLLDLTTLLTT[[[T[[TT[[Td[[[d[[TTddkdddkks{\84{sskskdkkddkdks{{sks{ssskkskkkkkskdkkkkkk\84{kd[[TT[k\84ssdd{s{\84sddss{kTTds{s\84kL[kkkddkkkkkdkks\8c{sk\84{\84skkdkD<D44DDDD<<D44<DDLDD<DDDDDDDD<DLDDDD<<DLTTTT[[[LTd[LT[LLTT[[LLT[TT[[[[[T[d[d[[[[ddd[[dkksks{ssks\93\84s{\84\84{{{{{sskssskssd[sssddkskkskdddkkdd{\84skkk[[ddksskks{s{\84{kds{{\84dD[k{{\84kddkk{skkkskssssssks{{kkkksss[[[TLDDDDDDDDD<LD<DD44<<<<<<<D<D<<DLDLT[TTTT[ddTLTLTTTLT[TTLLT[[[[dT[[[[dkddksdkkskkddsskkkd[ddkskkksss{{{\84{dkkkkskddd{\84\84s[kkkdkkdkskkkk\84\84{kksdddddkssks{s{\8c\84sdk{{\84d[kdss{sdkkkk{skkddkss{{sss{sssskds\84[TTTLLLLTTDDD4<DTLDLL<DL<<D<<D<DLLT[TT[TTT[[dkddLT[d[TTT[d[dd[kkddkdddddkkdkk[dd[d[T[[[ddd[ddd[dkkkkkkkkkkks\84s[ddkddkd\84\93{{skkkkkdk{\84sskk\84\84\84{kdkd[d[dsskks{s{\84{ks{s{sskdkkdkkkdksskskkskssssssssssssksssTTTTTTLLLLD4DDDDLTLLTDTLDDDDDDDT[TLTTLLLTL[ddd[dd[ddddd[dkddddddddddddddkddddd[T[[TT[[dddddddddddddkdkddksssksddkskkkdss{kkkddkksks{ssss{{s{sdd[dkkkskssssssssskkksskss{{{{{{{{{s{{{{{ss{{ssss{sssss{{{DLDDTLDDDDDDDD<DLLLLDLLDDD<DLLLLLLTTLTT[d[[[[dd[dT[d[[TT[ddddd[[[dd[[[[[d[[[dT[dd[T[[T[TdTTd[[d[d[[dd[kkkdkkdddkTdk[kkkksssskdsss{kkss{\84sskkkkddkss{ssss{skss{ssss{ss{{{\84\84{{s{{{{{ss{{s{ssssss{\84{{{{{{{[LTDLT4DLT[[LLLLDLLLDD<DD4<<DDDDTTTLLTTT[TT[[d[[[[[d[[TTT[[[[[[[[d[[[d[T[T[[[T[d[[[ddks{\84{\84{\93\84kk\84sdkddskdkss{skk{\84\93\84\84\84\84{{skkkkkkkkkskdk{kdkkksssk{{{{{ssk{{ss{s{{s{{\84{\84\84\84\84\84\84\84\84{{{{{{{s{{s{s{{{{{{sssskd[kTDLLDDDTdTLLLLDDLLD<4<<<<<DLDLLLLDDLTTLLLTdd[TT[Tdd[[TT[[[[[TTT[[[[d[[dkkss{{\84\84\84\84\84\93\93\93\9b\93\93\93s\8c\8c\84\93\93\8c\93\93\93\93\93\93\93\9b\9b\9b\9b\9b\93\9b\9b\9b\9b£\8c\93\9b\84{\84\84\8c\84\8c\93\84\84\84\93\84{skskks{kssssdskkkkskkssss{ss{{{{ssss{{{\84\84{{{{\84{{{sss{{{sssskd[dk{\84DT[LTLDDLTLDDDDDDD<4DLLD<DDLLDDTTLLDLLDLDLDT[[[[[[d[[LL[kkkkdkss{s{\84\84\84\84\84\84\8c\8c\8c\84\84\84\93\93\93\8c\93\8c\84\93\8c\93\93\93\93\93\9b\9b\9b\9b\9b\9b\9b\9b\9b\9b\9b\9b\9b\9b\9b\93\8c\93\84\84\84\84\84k{\84\84k\84\93\93\84\9b\93\93\9b\9b£\9b\9b\9b££\9b\9b£\9b\93\84\84\84\84\84\84\84{\84{{ss{ss{s{{{sssss{{{{{{ss{{s{{sskkddskk{\84\84\84\84\84\93\9b\9b\9bTLTTTLLLDLDDDTTLLTD<DTLD<DDDDDLLLLLLLD<<<DLdssskssskks{\93\93\93\93\93\93\93\93\93\9b\93\93\93\93\93\8c\8c\84{k{{{\84\93\93\93\9b\9b\9b\9b\9b\9b\9b£\9b£¬¬£¬¬£££\9b\9b\93\93\93\8c\8c\84sssskskkkkdkdkdd{{ksss{\84\84\84\84\93\9b£££££\9b\9b\93\8c\84\8c\93\84\9b¬\9b\93\8c\84\8c\84\84\84\84\84{{{ss{s{{ss{s{s{{{s\84\84\8c\8c\84\93\93\9b\9b\9b\9b\93\9b\84{{s{TTDLLLLLDD[dLTTDLDLLDLL<<4<DDDDLL<<<4DLds\84\93\8c\93\93\93\9b\93\93\93\93\9b\93\93\93\93\8c\84\8c\93\8c\84\84\84\84\84{\84\84skss\84\93\9b\9b\9b\9b\9b\9b\9b\93\9b£\9b£\9b£\9b\93\8c\8c\84\84{{\84{sssssss{{{{{{{{ssssss{s\84\84s{ss{sssss{{{\84\93\9b\9b\9b\93\93\9b\9b\9b\93\9b\9b£££\9b\9b\9b\9b\9b\93\9b\93\93\93\9b\9b\93\93\84\84\93\8c\9b\84\84\9b\9b\9b£\9b\9b\9b\93\9b\93\9b\9b\93\84{{{ssssskkD<DDDLLLLL[dTDDLDDDD<<DL<<<<DD<<<DTds\84\93\93\93\93\93\84\93\8c\93\8c\93\93\93\93\9b\9b\93\93\93\93\93\93\9b\93\8c\84\84{s\84\84\8c\93\93\9b\9b\9b\9b\9b\9b\9b\93\93\93\93\9b\93\84\84{{{{ss{{{\84{\84{\84\84\8c\93\9b\9b\9b\9b\9b£\9b£\9b\93\9b\9b\9b\84\84¬¬\84ks{s{ss{{sss{sksss{ssss{{sss{{\84\84\84\84\84\84\84\84\8c\9b\8c\8c\93\84\84\84{{ss\84{{{\84\84\84\8c\84\84k{s{ssssskkskkkkkLTTDL[T[TTDDLLLTLLLLLD<DD<<D4DTd{\93\93\93\93£\9b\9b\93\93££\93\93\93\93\93\93\93\93\93\93\93\8c\84\84\84{s\84\84\84\84\84\93\9b\9b\9b\9b\9b\9b\9b\9b\93\93\93\8c\84\84\84{skks{{\84\84\9b\9b¬´´»Ã»»¬£¬´»Ã»´»¬¬»£\93£¬´£\9b\9b\8c\8c\93\8c\8c\8c\9b\9b\9b\93\93\93\93\93\8c\84\8c\84{\84\84\84{{{{{{{ss{ks{{{kk{\84¬£\84{s\84{ss{\84s{kds{ss{{{{s{{ssssssss{{s{TTLLTTTdTdTLLLLTLLL[TDD4<D<<Lk\93\9b\93\84\93\9b\93££££\9b¬\9b\9b\93\93\8c\8c\84{sks{\84\84\84\84\84\8c\93\9b\9b\9b\9b\9b\9b\9b\93\9b\93\93\93\8c\8c\8c\93\8c\93ss{\84{k\9b£££¬Ãû´ÃÃÃûû´£¬»»»Ãû»»´»»£\8c\9b\9b\93\8c\93\93\93\93\9b\9b£\9b\9b\9b\9b\9b\93\9b\93\8c\84\84\84\84\8c{{\84\84\84{\84\84{{\84\84\84\84\93\9b\9b£\93££££££\9b\93££\93\93\8c\8c\9b£\8c\84\9b\9b\9b\93\8c\93\93\84ssksssss{s{LLL[TT[k[L[DTLLLDDLLTLTD<4Ld\84\8c\84\84\84\84\8c\93\93\93\84\8c\93\8c\8c\84\84{{\84{\84{\84\84\93\93\9b\9b\9b\9b\9b\9b\9b\9b\9b\9b\9b\9b\9b\93\93\93\93\93\93\8c\93\93\8c£\9b\8c\9b\9b\8c\8c\93\8c\93£»Ã»»´»»ÃÊûÃÃÊô»´¬££££\9b¬£\9b{sss\84\93\8c\93\93\93\84\84\84\93\93\9b\9b\9b\9b\93\9b\93\93\93\84\84\84{ss{ss{{ss{{{{{{\84{{\84\84\84\84\84\84\93\93\9b\93\9b\9b£££££££¬££\84{\84\8c{\84{s{{{{{ssDL[[TTTLLTTLLDLLLLDLLTLLD[s{\84\84{\84\84{{\84\84\84\84\84\84\84\84\84\8c\8c\93\9b\9b\9b\9b\9b\9b\9b\9b\9b\9b\9b\9b\9b\9b\9b\9b\9b\9b\9b\93\93\93\9b\93\93\84\84\84\93\93\9b\9b\9b\93\9b££´»ÃÃÃû»´´¬¬¬££\9b\93¬£\9b\93\93\93\93\8c\84\84\84\8c\84\84\93\93\84\8c\8c\84\84\84\84{\84\84\8c\93\84{\84\84\84\84\84{\84\84\84s{sss{{{\84\84\84\84\84\8c\8c\84\8c\84\84\84{\84{\84{{{\84\84{{\84{{{{\84\84{\84\84\9b{\84\84kkssssssk{s{{sTT[[[TTd[[TTDDTLLTLLLD[k{\84\84\84\84\8c\84\84\84\8c\8c\8c\8c\93\93\93\93\9b\9b\9b\9b\9b\9b\9b\9b\9b\9b\9b\9b\9b\93\93\9b\9b\9b\9b\9b\93\9b\93\8c\84\84\84{sss{\8c\9b\9b\9b\93\9b££\9b\9b¬£\9b\9b£\9b\9b\9b£\9b\9b\9b££\9b£¬£¬£¬£¬¬£\9b£\9b\93\93\8c\84\84\84\84\84\84\84\84{\84s{\84\84\84skkkks{sssss{{\8c\93\9b££££££\93\93\93\84\84\84\84\84\84\84\84\8c\84\8c\93\93\9b\93\84\84s\84\84{{s{ssss{sssssk{kkk{kddd[T[dLTTTTTTLddssk{s{{\84\84\8c\84\84\84\84\93\93\93\93\9b\93\93\93\9b\93\93\9b\93\93\9b\9b\9b\9b\9b\9b\9b\9b\9b\9b\9b\9b\9b\9b\9b\93\84\84{{{skkkks\84\93\9b\9b\93\9b\9b\9b\9b\9b\9b\9b££\9b\9b£\9b\9b\9b\9b\9b\93££\9b£££££\9b£\9b£££££\9b\9b\93\93£\9b\9b\93\84\84\84\84\84{{{\84{{kkks{ssssssss{\93\9b\9b\9b££\93\8c\84\84\84\84\84\84\93\84\84\84\8c\8c\8c\93\8c\93\93\93\93\9b\8c\93\8c{{ss{{ssskkkskkskkskkkkssssTLTd[ddkkksk\84\84\8c\93\8c\93\8c\93\93\93\8c\93\93\93\93\93\93\93\93\93\93\93\93\9b\93\9b\9b\93\9b\9b\9b\93\9b\9b\9b\9b\9b\9b\9b\93\93\93\84{{skkkdkks\84\84\93\9b\9b\9b\9b\9b\9b\93\93\93\93\9b\9b\9b\9b\9b£\9b\9b£\9b\93\93\93\93\9b\9b\9b\9b\9b\9b\9b\9b\9b££\9b\9b\9b\93\9b\9b\9b\93\93\93\93\93\93\93\84{\84\84\84{s{{s{\84\84\84\84{ssssks\84\8c\84\8c\93\9b\9b\9b\84\84\93\93\9b\9b\8c\93\93\93\9b\9b\9b\93\93\93\93\9b\93\84\84\84s\84{s{\84\84\84\84{{sskssssddkdddksskskd{\84{\84{\84\84\8c\8c\8c\8c\84\8c\84\84\84\8c\84\8c\8c\93\93\93\93\8c\93\8c\93\93\93\93\93\93\93\93\93\9b\9b\9b\9b\9b\9b\9b\9b\9b\93\8c\84{{kkdkdddks{\84\8c\93\93\93\93\9b\93\93\93\9b\93\93\93\93\93\9b\93\8c\9b\9b\9b\9b\9b\93\9b\93\93\9b\9b\9b\93\9b\9b£\9b\93\93\93\93\9b\9b\9b\93\93\8c\93\93\93\93\93\9b\93\84\8c\84\84\84\84\84\84\84\8c\8c\8c\93\93\93\93\8c\84{sssss{\93\93\93\9b£\9b\93\93\93\9b\93\93\8c\8c\84\9b\9b\9b\84\84\84\84\84{{{{{\84\84{s\84\93\84\8c\84\84{kkkdkkkkkkskkkksdkkkk\84{\84\84\84\84\84\84\84\84\84\84\8c\8c\8c\8c\8c\8c\8c\93\8c\93\8c\93\93\93\93\93\93\93\93\93\93\93\9b\9b\9b\9b\9b\93\93\93\84\84{kkddddddddk{\84\93\93\9b\93\93\93\93\93\93\8c\93\93\93\93\93\93\93\93\93\93\93\93\9b\93\93\93\8c\8c\93\93\93\93\93\93\9b\9b\9b\93\9b\9b\93\93\93\93\93\93\93\93\8c\84\84{\84\84{\84\84{{\84{{\84\8c\93\84\84\84\84{{{sssssksk\84£\9b£\9b\93ss{{\84\84{\84\8c\84\84\93\9b\9b£\9bkksdks{{\84\84{{{kksksdkdkkdkkss{{\84ssskkkkd\84\84\84\84\84\84\84\84\84\84\8c\8c\8c\84\8c\8c\8c\93\8c\93\8c\8c\93\8c\8c\93\93\93\93\93\9b\9b\9b\9b\93\8c\84\84skkdd[[d[d[dddddds\84\84\84\84\8c\84\84\8c\8c\93\8c\84\93\93\93\93\93\93\93\84\93\8c\93\8c\84\93\9b\9b\9b\9b\9b\9b\93\93\93\84\84\84\84\84\84{{{{{{{{ss{{{{\84\84{\84\84\84\84\84\84\84\84{{{{{ssssskkssks\84\84{\84\84{{{s{{\84\9b\93\93\8c\93\93\93\93\9b\9b\84\84\84\84s{{sskskkkkksks{{{{{\84\8c\93\84\84\84\84sksskkkk\84\84\84\84\84\84\84\84\8c\84\84\8c\84\8c\8c\84\8c\8c\8c\93\84s\93\93\93\93\93\93\93\84\84{kkd[[[[[d[ddd[d[[[[[[dds\8c\8c\93\93\93\8c\8c\8c\84\8c\8c\84\84\93\93\93\93\8c\8c\84\84\84\8c\93\9b\9b\9b\93\8c\84{{sssssskskssss{{\84\84\8c\93\93\93\93\9b\9b\9b\9b\9b\9b\9b\9b\9b\93\84\84\84{sssssksksss{\9b\93££\9b\93\8c\84\84\9b££££\9b\9b\93£¬\9b\84{ss{{\84{sk[dddkssksss\84\93\8c\8c\93\93\8c\84\93\93\93\84\84{{ssskkkk\84\84\84\84\84\84\84\8c\8c\8c\84\84\8c\8c\8c\8c\93\93\93\9b{[k\84{skd[[TTTTT[[[[[[[[[[[ddddd[dddddkssssssss{{{{{{{{{\84\84\84{{\84{sskksss{{{{s{{\84\84\8c\8c\93\93\93\93\9b\9b\9b\93\9b\93\93\93\93\8c\93\84\84\84\84{sssssssssssss{\84\84\84{{{kddkkk\93\9b\9b\9b\9b\8c\84\84\93\93\84\84\93\84\84{\84sksks{\84\84\93\9b\9b\93\8c\84\84{{\84\8c\9b\93\8c\84{\84\84{{{{sdkkkk\84\84\84\84\84\84\84\84\84\84\93\8c\93\8c\84\84\84{skD4TTTTTTTTTTTTTTTTTTTT[[[[[dddddddddkdkddddddddddddddkddddkkkkkkks{{{{{{{{\84\9b\93\93\93\93\8c\8c\8c\84\84\84\84\84\84\84{{{{{{ssssss{{{{{s{ss{kd[ddkkss{sk\84\84\84\93\8c{\84\84\93\9b¬¬´´¬\9b{kk\84\84\93££\9b\93\93\93£\9b\9b\9b££\93\84\84\84\84\93\84\84{sk{skkkkkkkk\84\84\84\84\84\84\93\8c\8c\84\8c{kd[TTTTLLDDT[TTTTTTTTT[T[T[[[kkssss{kkdkkdkkkkss{{\84{{\84{{\84\84{\84\8csks{sdkddkdkkkkkkkkkssssssssssssssss{s{s{sss{{{\84\84\84\84\84\84\84skk[kk{s\84\84\84£££¬\93\93¬¬\9b\93\93\8c\84{\84\9b¬¬¬´´\93kkks{\93\93\93\93\9b\93\8c\9b\93\9b\9b\9b\9b\9b\9b£\93\84\84\84\84\84{{skskkkkdkkkd[ddkkd[TTLLLTTLTT[D<LTLLTTTTTTTTT[[[[k\84\93\93\93\93\9b\93\84\84\84\93\93\93\8cs{{\84\8c\93\9b£¬¬¬\93\84\84\84\8c\8c\84\9b\8c\9b\93£{dddddddddddkkdkkkkkkkksssssssssssssss{\84\84\84\84\84\8c\93\8c\84kdkk{{\84\8c\93\84\84\84{\8c\9b£££\93\9b£\9b\9b\8c\93\93\8c\84\84\9b\9b¬¬\84sss\84{{\8c\93\93\9b¬¬£\9b\9b\9b\9b\93\93\84\93\9b\93\9b\9b\93\8c\93\84\84\84ssskkskkkTTTLLLLLLLTLTTTTTTTLDLLDDDTTTTTT[[[[[[d{\9b\9b\9b\9b\9b£\93\8c\93\9b\93\93£\9b\93\9b\93\84\9b\9b\93\93\9b\8c\84\84{skkkdddddddddddddddkkkkkkkkssss{ssss{{{\84\84\84\84\84\8c\93{s\84\84\84\8c\84\93\93\84sks\8c\9b\9b\93\93\84{k\84{{\93\93\9b££££\93\8c£\9b\8c\8c\9b£\9b\9b\93\8c\8c\84\84{{s\8c\9b££¬¬\93\93\84\84\84\84\8c\93\93\93\84\84\84\8c\93\93\93\93\93\8c\84\8c\84sskkkkskTTTTTLTLTTLTLDL[TTT4444D+D[TT[[[[[[[[[dss\8c£££\9b£¬£¬¬£\9b\9b\9b\8c\84{\93\84\84\84\84s[dddddddkdkkkkkkkssssssssssssssss{\84\84\84\84\8c\93\93\9b\9b\93\9b£\9b££\8c{ss\84\93\93\8c\93\93\84s{\93\8c\84\84\84{{{\84\84{\84{\8c\93\93££\9b\93\93{{\8c\9b\9b\9b\93\93\93\9b\93\93\84{s{k{\9b\84{\84{\93\84\84\8c\93\84\93\84\84\84\84\8c\84\93\93\84\84\84{{{{{sssskkTTTLTTTTLTTT<<LDLD<<$+++4[[[[d[dd[dddd[ddkkss{\84\84{\84{\84\84{\84s{ssskkkkkkkkkkksssksksssssssssskkss{{{\84\84\8c\93\93\9b\93\9b\93\9b\9b\93\9b\9b\9b\9b\9b\8c\93\9b\93\84{{\93\93\93\93\9b\9b\93\93{{\84{{\84\93\84\84{\84{k{\84\84\84\8c\93\9b\9b\84k{s\8c£\9b\9b\93\9b\93\93\9b\93\84{{k{{\84\84\84\93\84\84{{{\84{s{{{{{{ssss{kkkskksksTTTTTTTTT[TTTLDLD$$4+++4<LT[[[[[[[[[[[[[[[[[dddddddddddkkkkkkkkkkkkkskskkkksss{{\84\84\84\84{kks\84\84\84\8c\93\93\93\9b\93\93\93\93\93\93\93\9b\9b\9b\9b\93\9b\9b\9b\8c\84\84\9b\93\84{\84\84\8c\93\93\84\9b\9b\84\84{{\84\84\84\84\8c\84{\8c\84kk\84\84\8c\8c\84\84\8c\84\84s{\93\93\93\93\93\93\9b\9b\9b\93\8c\84{\84s{{{\84\84{ssssskkkksksssss{sssssss{sTTTTTTTTTTLDLTDTD<4$\1c$$$4<T[[[[[[[[[[[[[[[ddkkkks{{{{\84\84\84{ssssssssssssss{{{{\84\84\93\8c\93\93\93\93\93\8c\84\84\84\84{\93\93\93\93\93\93\8c\93\9b\93\93\93\93\93\93\9b\9b\93\93\93\93\8c\84\8c\84\93\9b£\9b\9b\84\84\84\93\93\93\93\9b\84\84\84\84{{\84{s\84\84\84{s\84\8c\8c\8c\8c\8c\8c\8c\8c\84\84{\84\8c\8c\8c\93\93\93\93\93\93\8cs\84{sssk{\84\8c\84kssssssssssss{{sssssskd[T[[T[[[[DD44DD4+D<+++$+<D[TTT[[[[dddkss{{\84\84\84\93\93\9b£¬£\84\93\93\9b\9b¬{kssss{{\84\84\84\84\8c\84\8c\93\93\93\93\8c\8c\84\93\93\93\93\93\9b\93\9b\9b\93\84s\93\93\93\93\93\93\93\93\93\93\93\93\93\9b\93\9b\9b\9b\93\93\9b\93\9b£\93£££¬\93\84\93\93\93\9b\9b\9b\9b\9b\93\93\9b\84\84\84\84\84{{s{\84\84\84\8c\84\84\84\84\93\9b\8c\8c\84\84\84\93\93s{\93\93ss\84s\84\84\84sskkksss{ksskssssssssssskkk[d[T[[[[ddLL<D<4$++$$\1c4+44\134d[dkks{\84\84\93\93\8c\8c\93\93\93\8c\93\9b£Ã»»»´\9b\84\84\84\8c\8c\84\84\93\8c\93\8c\8c\84\84\84\93\93\93\8c\84\8c\8c\8c\93\93\93\93\93\93\8c\93\93\93\8c\93\93\93£\84s\93\93\93\93\9b\93\93\93\93\93\93\93\93\9b\93\9b\93\84\84\9b\93\9b£\9b\93\9b\93\8c\9b\93\8c\84{\84\9b\9b\9b\9b\9b\93\93\9b\9b\93\9b\84\84\84{{{{{\84\84\84\84{\84\84\84\8c\8c\8c\84\93\84sdsskkkkdkkkskkddkddkkksssskkskddkd[dks\8cks\84\84\93\93\93£sDD44$$$\13\1c4$+DLLk{\84\93\93\93\93£¬£¬¬£££\9b\9b\9b\9b\9b\9b£´´´»»\84\84{\84\84\8c\93\84\84\8c\93\84\8c\84\8c\93\93\93\84\8c\84\84\8c\8c\93\93\8c\93\93\93\93\93\93\93\93\93\93\93\93{{\9b\93\93\93\93\93\93\93\93\93\93\93\93\93\93\93\93\84\8c\9b\9b\9b\93¬£\9b\9b\93\93\93\93\84\84\8c\8c\8c\93\9b\9b\9b\9b\93\8c\93\9b\9b\9b\9b£\8c\84\84\84\84ss{ssk{{s{\84\84\8c\84s{\84sddd{sdddddkksskkkkkkkkkkkkkk\9b£\9b\84\9b\9b\9b{\9b£\9b\9b\9b\9b\9b{D44+$$+$+4$DDLL£££\9b\9b\9b£¬¬££¬£¬¬¬¬¬¬¬¬¬¬£¬¬{D\84\84\84{\84\93\93\8c\84\8c\93\93\84\8c\93\93\8c\8c\84\8c\93\8c\93\93\8c\93\93\9b\93\93\93\93\93\9b\93\84{\84\84\9b\9b\93\93\93\93\93\93\93\93\93\93\93\93\93\9b\9b\9b\84\8c\93\93\93\93´´\93£££££¬\9b\9b\93\84\84\84\93\93\93\9b\9b\93\8c\93\9b\8c\84\84\84\8c{\84\84\84\84\84\84\84ss{kssk{{kdk[dkskdkssss{s{ssssssskskskkk¬´¬´\84ss\8c\93\9b\93\93\9b\93\84\8c[4++\1c4+44444<L{\9b\93\93\93\93\9b¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬´´´\84Dk\84\84\84\84\84\93\93\93\8c\93\93\84\93\8c\8c\8c\8c\8c\93\93\8c\8c\8c\8c\93\93\93\93\93\8c\8c\93\93\93{{\93\9b\9b\9b\93\9b\93\93\93\93\93\93\93\93\93\93\8c\93\93\93\9b\93{\84\84\84\93\93\9b£¬¬£\9b\9b££\93\93\93\8c\93\8c\93\93s{\93\84\84\84\8c\8c\93\93\9b\84\84\84{{\84\84\84{s{sskdskkkkddd[s\84\93\8c\84kkkkss{sk\84\84ssssssds\9b»Ê¬\9b\93{\84\84{{\84{{\84sD<44+4$44<DLDLskLd\84DD\9b£\93\93\93\93\93¬£\9b´¬´¬¬¬£¬\84Dk\93\8c£\9b\8c\93\93\93\93\8c\93\93\8c\93\84\8c\93\93\8c\8c\8c\84\84\93\8c\93\93\8c\93\8c\93\93\93\9b\84{\93\9b\93\93\93\93\9b\93\9b\93\9b\9b\93\93\93\93\93\9b\93\93\8c\8c\9b\84\84\84\84\9b£\9b£´´\9b£¬£\93\93\93\9b\8c\93\8c\93\8c{k\84\93\9b\93\8c\84\84{\84\84\8c\8c\8c\93\84\8c\8c\93\9b\93\9b\8c\84\84{s{kkks{{k\93£{sskkskkkkskkskkkk[s{sssks\93\84ksksskskD444D<444$\1c44<[T+4d[[£»\9b\93\93\93\93\93¬\9b\8c´´´´´£\84\84ds\9b\8c\93\9b£\9b\84\84\9b\93\8c\8c\8c\84{\93\9b\84\84\84\84\8c\93\93\84{\84\93\93\8c\93\93\93\93\84{\93\9b\8c\93\93\9b\93\93\93\93\93\93\93\93\9b\84\93\93\8c\8c\8c\93\93\8c\84\8c\84\84\84\8c\9b£¬¬¬¬\93\84\84\9b\93\84\84kk{\84\93£££\93{s\84\93\9b\93\9b\93\93\9b\9b\93\93\84\84\84\84\93\9b\93\9b£\9b\93\9b\9b\9b\9b\93\84\9b\9b£\93\8csdkkkkkkkkkskkkddkks{sss\84\93kssssss{[D$\1c+44+++$$$TT$+<L<\84k{Ds\93\8c££\9b\9b£\9b£££££££´£\84\8c\84\84\8c£\8c\84\84\84\84\8c\84T[s{s[k{\84\93\84\84\93\93\93\93\8c\9b\93\84\84\84\93\93\93\93\93\93\9b\93\93\93\93\8c\93\93\9b\93\93\9b\93\93\84\93\93\93\9b\93\84\8c\84{k{\9b£¬£\93\84\84\84\8c\84\84\8c\84\93\8c\93\9b\93\8c{{\84\93£\9b\9b\9b\93\9b\9b\9b\93\9b\9b\9b\9b\8c\84\8c\8c\84\84ss\84\84{ss\84\84\8c\93\8c£\8c{kdkssskkkkddkddkddddk{skdssssks{dD44++44$++$\13L[D4444<DD<s\9b\9b\93£¬££\93\9b\9b£££¬££´¬£¬¬£\9b£¬\8c\84\84\84\84{L44<4<D<k\8c\84\84\84\8c\8c\93\9b\84{\84\8c\9b\93\93\93\9b\9b\93\93\8c\8c\9b\93\84\93\93\8c\93\93\93\8c\93\8c\93\93\93\9b\8c\84\84\84s\84\84\9b\84\84ss{s{\93\9b\9b£\93\84\93\93\84{k\84££\9b\93\93\93\93\93\93\9b\93\8c\8c\84\84\8c\93\84\84\84\84{kkskkk[[kksks\84\84{sssssssssskssksssskkssskdkdkssTD<44+4$+$$$$++44DDL[L[<\84\84ss{¬´´´k{¬££\9b£¬£¬¬¬´´¬¬\9b\8cTdk\8c\9bTDTL44TTLk\84{\84\8c\93\93\84\84\84\93\9b\93\93\93\9b\9b\93\93\93\8c\84\93\9b\84\8c\93\93\93\8c\84\93\93\93\93\93\93\93\93\84\84\84\84\84\84{kksk{\84{\8c\93\93\9b\93\93\9b\9b\84ss\93£\9b\9b\9b\93\93\93\93\93\93\8c\84\93\93\84\84\8c\8csssskkLTLs{skkkds{sssdskskkdTd[dkdddskkkkkskkkddsL+4D4+444+44<44D+$+4+4<TDk£k\84s{\93\93\9b¬\84\84´´´¬£\9b\9b\9b££¬´»{T<4<4[[LD4DTT[L4L{\93\93\93\93\84s\93¬¬\93\93\93\8c\8c\93\93\93\8c\93\93\8c\8c\84\93\9b\93\8c\8c\93\93\9b\93\93\93\8c\84\84{{ssskks{s{{\84{\84\84\8c\93\9b\9b£\93ks\84£\9b\9b\93\93\93\84\8c\93\84\8c\84\84\93\8c\8c\93\93\84{ssss\84s{skddd[dds¬\8c\84£s[ds[Ld\84kdkkkd[dddd[dddd\93\9b\9b£s[ss{sd\84[++++4<44+<D4L{\84££\84\84\9b¬£\9b\93\9b´\93£¬¬´´´¬¬¬££\9b£\84DD+L<<<LDD44L444\13\1cDLDDs\84\93£¬\9b\93\93\8c\8c\93\93\93\8c\93\8c\93\93\8c\84\93\93\84\8c\93££\93\84\84\84sksks{\84\84\84\93\8c\8c\84\84\8c\84\84\84\84\84\8c\8c\93£{k\84££\9b\9b\8c\93\9b\93\8c\93\93\93\8c\93\8c{\84\84ssdkkkdks\93\9b{s\8cs\84k{sk{s{\84s\8c\84[\84£\9b\9b\9b\9b´´\9b\9b\93\9b¬£\9b\9b{[s{{\84{\93\93\84\84{s{£\9bD$\13$+$+$4DLL{ss¬\9b\9b¬´´¬´´¬££\9b\9b\9b££\9b¬\9b\93\93\93\93\93\84TDLT4<LD+LLLL44L4\1c\1c\ f\13\13<s\84\93\93\93\93\8c\84\8c\93\84\84\8c\84\84\93\93\8c\8c\93\8c\9b\93ssskkddks{\84\93\93\9b\93\9b\93\8c\84\84\84ss\8c\93\93\9b\93\93\9b\84ss\93£\9b\8c\93\9b\93\9b\93\93\93\93\93\8c\8c\84\84{sdT[sk[Tds[\84´´¬´Ã£\93\84\84k[[d\8c\9b\9b{¬Ã¬£¬¬´´££££¬»»»\9b\8c\8c\93\8c\84\93\84\84{kTDL\1c<LLDTTd[s\93\93\8c¬»´¬£\9b£¬¬££\9b\93\93\93\9b\8c\8c\93\93\9b\93\93\93\9b\9b\9b\8ckdTL<44$4D4L4444D+\1c\13\13\13\13\1c\84£\9b\9b\9b£¬¬\9b\9b\9b\9b\93\9b\93\9b££¬´»´¬£\9b\9b\9b\9b\9b\9b\9b\9b\9b\8c\84\93\93\93\93\93\9b£\8cs{\84\8c\84\93\9b\9b\84s{{\8c\84\84\84\93\93\9b\84\84\9b{{\9b\84k{\9b\8c\84sddkkds{kd\84£¬¬»´\84{\84¬\9b£¬\84\93\9b\93d{´´£¬\9b\9b£\84ÃÓÊû»£dkk\9b\9b\8c\84\84\84\84\84\84sd[44<[d\93\9b\9b\9b\9b\9b\93\9b\93\9b¬¬\9b\93\9b£¬\93\84\8c\84\8c£¬£\9b\93\93\84\84\8c\93\9b\9b£\9b\9b\9b\8c\84\84kTTTT$$++\13\1c<+++$$\1c$\1c{\84\84\8c\8c\8c\8c\93\93\93\93\93\93\84\84\8c\8c\93\8c\93\8c\8c\8c\93\93\93\93\9b\93\93\9b\9b\9b\93\9b\9b\9b£¬¬££\9b¬¬¬¬£\9b£\9b\93\84\9b££\9b££\9b\93\93\93\93\93\93\93\84{d[{\84\84{kdkkks{ds´ÛÓ¬¬\93\9b´Ê´»»Ã´´\93¬\84d£Ê»ÊÃô\8c\8c£´Ã»´»\84dks\84{{\93\84\8c\8c\84\84\93\93s[T\84\84\93\84\8c\8c\84\8c\84\93\93\8c\93\93£\9b\93\9b\84\84\84\84\9b£\93\9b\9b\8c\93\9b\9b\93\9b¬\9b£\8c\9b\9b\93\84\8c\93\93\8c\84\84\84sdTTLkd$\13\13\1c$$++\8c\8c\84\84\84\84\8c\8c\8c\93\84\84\93\93\8c\93\93\8c\93\93\93\93\84\8c\93\93\93\9b\93\8c\93\93\93\93\93\8c\84\84\84\84\84\84\84\84\84\93\93\84\84\84\84s{£\93\84\9b\9b\84\84\84\8c\93\8c\8c{{\84dTddsd[[dd[d[[{k\84´Ê¬´£\9b\9b£\93{¬£Ã\9b£\9b»¬£¬\84\9b»»¬¬»´´»Ã»´\9b\84k\84{s{\84\84\9b\93\84{\84\8c\8c\93\93\84s\84{\84{\84\84{\84\93\84\93\9b\93\93\84\84\84\93\84\93\93\93\93\9b\9b\93\93\9b¬¬£££\93£\9b££\9b\9b\93\9b\9b\9b£\9b\9b¬¬¬¬\84D4+\1c$$D44[ssssss{{{{s{\84\84\84{{\84\84\84\84\84\84\84{{sssssskkkkkddkkkddkkkkkkk\84\93\9b\84\93\9b\93\93\9b\9b\9b\93\93\93\84sdd{\84kddkkdkkk\9b££¬\84´Ã\9b´£\9b\84\84\84\93\93»Ã\9bs\8c´¬£\93\9b\8c£»»»´»´»Ã»»¬\8css\84\84{{{{\84\84\84\84\93\84{{\84\84\84{\84\84{\84\93\93\93\84\93\93\93\84\8c\93\84\93\84s{\8c\9b\84\84\93\93\93\9b\93\84\93£\93\9b¬££¬\9b£\9b\9b£\93\844<4+$$ddd[LTL+\1c+[[[[d[[[[[dd[dkssskdd[dd[ddddd[dd[dddkdTkkdkkkkddkdks{{\84\8c\8c\93\93\93\9b\9b\9b\93\9b{dk\84\93{ddkkkkd¬\93d£´\9b´¬´Ã´\8c\84\9b\93\93\93\9b\93\84s{¬\93\9b£\84[\8c\93s£Ã»¬£»¬£Ãs{\84\84{\84{{\93\84\84\84\84\84\84\84\84\8c\8c\84\84\93\93\9b\93\84{\84\84\93\8c{{\84{sdssk\84sTs\84\84{\84\84£\9b\84\93\93\84\84\8c\84\93\93\8c\93\84\8cD4T+DLdkk{{\8cssks{\84{{{s{{\84ssk\8c\9b\9b£¬´¬\93{sddd[[[dk{\84s\84skdkddssddk[£»\93{skdd[dkkss{{\84\84\93\9b\93skd{\8c\84skdkd\84»´´ÓÊ´´´»´\93£¬¬»¬»Ã¬¬£\93\93\9b£\9bd{\84\8cÊÃÃÊ»»»´\84{{s{\84\84\84{{{{{\84\8c\84\84\84\8c\84\8c\8c\84\84\84\84\84{s{\84\84\8c\84{\84ss[Dk\8c[s\84sk\84{LT{ss££\9b\84\84{\93\93\84\84d<Tsdks{\84{\8c\9b££\93\93\93\9b£\9b££¬££\9b\93\93\9b\9b\93\8c\93\9b££££\93\9b£\9b\84\84\84£¬¬¬¬£\93\9bÃÛÊÃ\9b¬\9b\84\9b»Ûã\84\93Ê´£\93\84{kdd[[ddkss\84\93\84\84\84sss{sk\84\9b\93¬Ê»¬\93\84\9bʬ£\9b\9b¬£»ÓÓÊ»¬´\9bs\93ì\93££\93£¬£¬´´£\93{{\84{\84\84\84{ss\84{s{\84\84\84\93\93\84\93\9b\8c\84£\93{{{\84\84\84{\9b£\9b\8c\8c\93kTT<[\93\84\84\9b\8ck\84\8c\9b\84\84\84\9b\93\93\84\93{\84\84kD\13[{s\84\84\84{\84£¬£\93\93\93\93£\93\9b\93\8c\9b£\93\9b\9b\84\84\93\9b\8c\8c£\9b£\9b£\9b£¬\9b¬¬£¬¬££¬´»Ã»ÊÃ\84´¬££\84ʬ\84\93ãÛÛÛÓÃô¬£\93{k[[[[[dkss{\84\84{\84\84\84\8c\93\8c\93s{d\84\93\93\84£¬\84\93»»ÃÊ£\9b¬´\84\8c£¬\93\93¬\9b\84\8c\84s\8c£¬\84{{{{s{\84{s{s\84{{{{\84\8c\84\84\84s{\84\8c\84\84\84\93\93\93\84\84\93\93\93\9b\8c\84kL+[\84\84\84\84\8c{{ksskk{dd{[[LkLTLLk{\84ss{\84{\93\84\84\8c\93\8c\93££\9b\8c\93\9b¬¬£££\9b\93\8c\84\93£»£¬£\93\9b\9b£\9b\9b\93\84\8c\9b\84\84\84\9b\8c\84£¬´¬´´´£´\9b[£ÛÛÓÓÊÃÊÊÃÓÓÓ»£\93\84{sdd[TT[T[[ds{\84{\84s{{\9b\84kd[£Ã\84\8c¬¬´££¬¬´Ê\9b\9b\93\9b¬\9b\9b\93\9b´¬£ks{s{\84sssss\84{{s{\84\84\84{\84{{{\84{\84\84\84{s{{\84\84\84{\8c\84\84\84sTs\84kssds{{sss{sskssksks{{{\84{{{{{\84\84\84\84\93\9b££¬££\93£\9b££´¬\9b£\9b\9b£££»´¬££\9b£££\93\8c\8c\8c\8c\84\8c\8c\9b\93k\84\9b¬¬Ã»´£s\84k¬¬´Ã£´Ã»´»»Ã»»ÊÊÊÊû´¬\9b\93\84{ssddskdk[[[dk{ddd\84\84\84\9b\9b£\8c\9b¬¬£\93¬¬´¬´¬£\9b\9b\93£\93\9b\9b{{\84{{{{s{s\84s\84\84sskkks{{s{{{{\84{s\84\84\84{{\84\84\84sskkd[dkssss\84ss{\84\93\8c\8c\93\9b\93\9b\9b\93\93\84\84\84\84\84\84\84\84\84\84\84\93£\9b\93£££¬£¬´¬´´£¬¬¬¬Ã´´´¬´£\9b\93\93£\93\8c\84\93\93\93\9b\93\8c\8c\84\93\93\93\93£¬¬¬£¬\9b\8c£´¬¬»´»»\9b\8c££\9b\9b¬¬´´´´Ã»»ÃÊÃû»»£\9b£\93\8c\84{skdk\84{\84ks{k{\84\84\93\93{\84\8c\8c\9b£\9b¬\9b{\9b¬¬´´´´ss\84\8c{ddkk{kkkkskkssssss\84{\84{\84\84\84\84\84\8c\84{{{{skskkskkkkks\84\9b\8c\84\84\9b¬\9b\9b\93\9b£\9b\9b£\9b\93\9b\93\9b\9b\8c\93\9b\93\9b£££\9b¬´\9b¬¬£¬£¬£\9b£¬£££´¬\9b£\9b££\9b\93\93\93\84\84\84\8c\84\84\93\84\84\84\9b££´´¬£¬£¬¬¬´££¬¬´´´´¬¬£\8c\93£\9b\9b\93\8c\8c\9b£¬¬¬¬¬´´´»¬\93\9b\8c\93\8c\84\93\93\84\93\8c\8c\9b\8c\84\84s{{\8c\8c\84\8c\9b\93\8c\9b\93\84££\93£¬£¬¬¬dddddddkdd[kksskk{{\84\84{\84\84{{{s\84\84\84\84\93\84{{{ss{{{skkds{{\84\84\9b\93\84\84{{\84s{\93¬£\9b\84\9b\9b\84\8c\9b¬\9b{\84\9b´»´¬»»»£´´¬\9b\9b£\9b££\9b\93\9b\93\9b\84\84\9b\8c\84\8c\84\84\84\84\8c\84{\84\8c\84\84\84\93\93\93\9b\9b\9b£¬¬££\9b\93\84\8c\93\93£\9b\8c\93£\9b£\9b´¬£\9b\93\84\84\84\8c\93\93\9b\8c\8c\8c\84\93\93\9b£\84\84\84\8c\9b\9b\93\84\84\93\8c\93\8c\84\8c\8c\9b\93\93\9b\93\93\93\8c\84\93\84\8c\84\93\9b¬¬£\9b\9b£\9b\9bdd[LTd[ddkdksskkk\84\84{{s{ks{{\84{\84\84\84{ss\84{{dkkkd{ddkk\84\93\84\93\84\84\84{{\84\8c\93\93£\8c\8c\84\8c\8c\84\84\93»£\84\93£¬¬»»Êʬ´´¬¬\93\84\9b££\8c\8c\9b\9b\9b\9b\93\84\8c\93\93\9b{k{{{{\84\84\93\93\93\84\84\84\93\93\93\9b£\9b£¬£\9b\93£££¬´\9b\9b\9b\93\93\93\84\93¬´¬£¬¬\93\93\9b\9b£\9b£¬\93\9b\8c\93\93\9b\9b\9b\93\9b£\93\8c\8c\8c\84\93\9b\93\93\84\84\84\84\84\8c\93\93\9b\9b£¬\9b¬¬£\93\9b»»¬»»¬ddkd[[ddkkkkdkkksdksss\84{sss{{\84skdk\9b\9b{sdd[T[dk{s\84\84\84\93\9b\9b\9b\9b\93\93\9b\9b\93\84\84\8c\84\84\93\9b\9b\93\84\9b\84\9b\9b\9b££\93»»££´£\8c\93\93\8c\93£\84\84\84\84\84\84\84\84\84\84\8c\8c\8c\84\84dd{s{\84\84{\93\84\84\93\9b\9b£¬\9b\9b¬\9b\9b£££¬¬¬£\9b\9b££\9b\9b\9b\9b\9b\9b¬\9b´\9b¬¬\9b\9b´¬££´¬¬£\9b\9b£\9b\84\8c\93\84\8c\93\84\84{\84\84\93¬\9b££\9b¬´¬££´¬£\9b£´¬´\84\9b»\84\8c¬T[[L[[[dd[dkdds{{{{k{{s{{{{{{skk\84\8c\84ksk[[ds\93\9b\84s{\93\93££{\84\93£\9b£££\9b\84\84\8c\84\8c\93\93\93\9b£\93\9b\93£\93\93¬¬´´££\9b\9b\8c\8c\93\93\84\8cs\8c\93\84\93\9b\93\8c\8c\84\84\8c\84\84\93k[s{\84\84\8c\84\93\8c\8c\8c\8c\93\84\84\84\84\84\84\9b\9b\93\93\93\93\8c\8c\93\93\93££\93\9b\93\93£\93\9b¬´ÃÊÊ»¬£\9b\9b¬»¬\9b\9b\9b\9b\93\9b\9b\9b\93\9b\9b\93\93\8c\93\93\84£¬\9b´£´»£\84{£££»\9b\9b\93{[[\8c\93s{sdkddkskk{sss{\84{s{ddkkkdTTdk\84\9b\93\84\84{dk[[dk{{\84{sk{\93\84\8c\93{\84\84\84\93\9b\93\93\84\84\84\84\93\93\9b\93\9b\9b\9b\93¬£\9b¬£¬»¬\93\93\8c{\8c\9b{s{{\84\8c{{ss\84\8c\84\84\84\84\84{{k{ss{\84\84\84\8c{{\84{s{\84{{\84\8c\8c\93\93\93\93\93\9b\93\93\93\9b\93\9b£\9b\9b£\9b£\93\93\84\9b£¬»´»£\9b££´£\9b¬\9b\93\9b\9b\93\93\93\93\9b\9b\93£££\93\8c\84\9b¬´´´»£\9b£»´»¬\84[dk{s\84\84\84dd[[dd[kkksskd[Tddk[[[[kks\8c\8c{[4Ddk{{kkkk[ddd{{s\84\84\8c\84\84\93\84\8c\84\9b£\93££££´£\84\84\93\9b£\93\8c\8c\93\9b¬´¬¬\9b\93¬¬\8c\84ss{\84\9b\8c\84\84\9b\84\84\84\84\84s\93\84\84\84ss{sk{{kkssss{\84s\84\84\84\93\93\93\84\8c\9b\9b£\93\9b£¬£\9b\93£\9b£££\93\9b\93\9b\93\84\84\8c\84\8c\93\9b\9b\93\93\93\93\93\84\93\9b\9b\9b\93\84\8c\8c\93\8c\93\93\9b\9b\93\84\93\93¬£¬\93\84\93\9b¬´¬\93\93\8c\8c££\93\9b\93DTdTDLT[[dddTdk{k[ddddd[[LLD+4Lk\84sd[k[[kkskdkks{{{\84\93\84\9b\9b\8c\84\9b»´´Ã»¬£\9b{\8c\9b££\9b\8c\8c¬\9b\9b\9b\9b\93s{{d{\9b\9b\8c\9b£\9b\93\93£\9b\93\84\84\8c{\84\8c\84\8c\84s{{s{ss{ss{kk\84\9b\8c\93\93\93\93\93\84\93\93£\9b\9b¬££\9b£££££\9b\9b£¬\9b\9b£\93\93\9b\9b££££\8c\84\8c\84\84\93\9b\93\93\8c\8c\93\84\93\93\93\9b\9b££¬££\9b\8c\84\84\93\93\93\9b\84\9b¬££££\93\9b\9b\8c\84DL[[TTddkkksddd[TLDD44++$4L[kddk[kkd[ds{d[ddddkd{sk{\84\93\84\84\8c\8c\9b£´»¬¬¬´\9b\93\93\93¬\84ks{{ssk[ds\84\8c\93\93\84\93\9b¬\9b\9b££\9b\8c\84\9b\9b\9b\84\84{\84\84\84\84\84s\84{\84\84sss{\84\8c\9b£\93\9b¬\9b\93\93\93\93££££\9b\93£¬\9b£\9b\9b£\93\9b££\93\93\9b\93\9b£¬££\93\93\8c\84\84\8c\9b\9b\93\93\9b\9b\8c\93\93\93\93\8c\93\9b££\9b\9b\93£\9b\9b\84\84\8c\93\93\8c\9b´£¬¬£´£\9b\93LT[[TLL[[Tk{kTdTD++444Ldd[kdskdksdd[kkddkkkks[ds{dss\84{\84\84{\84£»´´\93\93\93\9b\9b\8c\84{k[d[[\84\84{{\93\8c\84\9b\8c\84\8c\93\93\93\9b\9b\9b´£\9b\9b\93\9b\93\84\84\84\8c\84\84\8c\84\93\8c{{\84s{\84{\84\9b\84\9b¬££¬£\8c\84\84\93\9b\9b£\9b\93\9b¬££¬\9b£´´££\9b££¬¬\9b\9b\93\93\9b\93\93\84{\84\8c\8c\93\93\9b¬\9b\93\8c\93\8c\84\9b£¬£\93\9b\93\93£££\9b\93\93\8c\84\93\93\8c\93\93\9b££¬£\9b[TLLdkkksssd[D+44$D[T[[[sd[[ddskd[kdkdskds\84{[s\9b\93\93\93\93\84{\84{{ss\93\84s\84\9b\8c\8c\84\93\9b{{ksdd{\84\8c\93\9b\93\9b\9b\93{\9b£\93\93\93\93£´¬£\9b£\84\93\84\84\84\84{s\84\84\84{{skskss\84\84\84\84\9b\93\9b\93\9b\84\84\84\9b¬£\93\93\9b¬\9b\93\9b¬£¬´¬¬´¬\93£\9b£´¬\9b\9b\9b\9b\9b\93\93\93\8c\93\9b£\9b\9b\9b\93\93\9b\93\9b\9b\8c\9b\93\9b\9b\93\9b££\9b\9b££\93\84\9b£\8c\93£\9b\9b´´¬»¬[[[k{\9b\93{{{L+\1c$+DTTTTT[[T[dddkd[dkkkddkskkdss{\8c\93\84\84\9b£\93\84\84\84{{\84s\84\93\8c\9b\9b\93sksd[d{{s\84{\9b\84¬£\8c¬\9b\93´£´£\84\8c\8c££\93\93\84\8c{\84\84{{\84\84\84\84{kksk\84\84s{\93\93\84\93\9b\9b\8c\84\84\8c\93\93\93\93££\93\9b£\9b\9b\9b£\9b\9b£££\9b\93£¬£\9b£\9b\93\8c£´´£\9b\93\93\9b£»¬\93\8c\93\9b\9b\93\93\93\93\84\84£\9b\8c\9b\93\93\9b\8c\8c\93\93\93\93\93\84\93\93\84\84\93£\9b\9b´\9b\8c[4L[TD$+\13\ f$L[[TTkd[[skkkdddsksskk{ss{{\84\84£\9b\84{\8c\8c\84\84{\84\8c{{\84\84\84\84{{{skks[[dds{{\84{{\84\9b\9b\9b\9b\93\93££´£\93\84\84\8c{\84ss{{s{\84{\84{\84s\84\84\84{{\84\9b¬\84\8c\93\9b\93££\93\9b\9b££´¬\93\9b£\9b£\93\9b£\93\8c¬¬\9b\84\9b\9b\93\84\93£¬£\9b\93\93\93\93£££\93\93\93\93£\93\9b\84\84\93\93\93\9b£\9b\9b£\9b\93\9b\8c\84\93\9b\9b\8c\93\84\84\8c\8c\93\9b\93\9b\93\93\9b\93\93\8c\84LTDDLL[d[[TdkkTTkkks{ss{dksks{ssskds{\84\84{s{{\84ss\93\93£\93\93\84\9b{{\84{\84{k{ks{{\84{\84k[ss\84£´\9b\84¬´¬¬»£\9b¬£\8c\8c£\9b\93\84\8c\93\84\8c\8c\84\84\84\84\93\84\84\84\84s{\9b\9b£\93\9b\84\8c\9b\9b\93\93\9b\8c{\8c\93£´£´\9b££´¬££\9b\9b¬\9b£¬\93\93\8c\93\84\93\9b\8c\93\9b\9b££\9b££\9b\84\84\84\8c£\84\93\8c¬\93\8c\93\93\93\93\9b\93\8c\84\93\8c\93\8c\8c\84\84\84\84\93\8c\84\8c\8c\84\8c\8c\8c\84\84\9b\9b
\ No newline at end of file
diff --git a/data/images/test.pnm b/data/images/test.pnm
new file mode 100644 (file)
index 0000000..3552e16
--- /dev/null
@@ -0,0 +1,11 @@
+P2
+8 8
+4095
+0000 1024 2048 3072 3072 2048 1024 0000
+0000 1024 2048 3072 3072 2048 1024 0000
+0000 1024 2048 3072 3072 2048 1024 0000
+0000 1024 2048 3072 3072 2048 1024 0000
+0000 1024 2048 3072 3072 2048 1024 0000
+0000 1024 2048 3072 3072 2048 1024 0000
+0000 1024 2048 3072 3072 2048 1024 0000
+0000 1024 2048 3072 3072 2048 1024 0000
diff --git a/doc/README b/doc/README
new file mode 100644 (file)
index 0000000..ded5edd
--- /dev/null
@@ -0,0 +1,8 @@
+This directory contains documentation related to the JasPer software.
+
+jasper.pdf
+       JasPer Software Reference Manual
+
+jpeg2000.pdf
+       A detailed technical tutorial on the JPEG-2000 standard.
+
diff --git a/doc/jasper.pdf b/doc/jasper.pdf
new file mode 100644 (file)
index 0000000..b34bac8
Binary files /dev/null and b/doc/jasper.pdf differ
diff --git a/doc/jpeg2000.pdf b/doc/jpeg2000.pdf
new file mode 100644 (file)
index 0000000..21a3d90
Binary files /dev/null and b/doc/jpeg2000.pdf differ
diff --git a/jasper.spec b/jasper.spec
new file mode 100644 (file)
index 0000000..2d107cf
--- /dev/null
@@ -0,0 +1,101 @@
+# Note that this is NOT a relocatable package
+%define package_name  jasper
+%define ver           1.900.1
+%define prefix        /usr
+%define datadir       %{prefix}/share
+%define release       1
+
+Summary: JasPer
+Name: %{package_name}
+Version: %{ver}
+Release: %{release}
+Copyright: Modified BSD
+Group: Development/Libraries
+
+# FIXME: 
+Source: http://www.ece.uvic.ca/~mdadams/jasper/software/jasper-1.900.1.tar.gz
+
+BuildRoot: /var/tmp/%{package_name}-%{version}-root
+Requires: libjpeg
+BuildRequires: libjpeg-devel
+URL: http://www.ece.uvic.ca/~mdadams/jasper/
+
+%description 
+JasPer is a collection        
+of software (i.e., a library and application programs) for the coding 
+and manipulation of images.  This software can handle image data in a 
+variety of formats.  One such format supported by JasPer is the JPEG-2000 
+format defined in ISO/IEC 15444-1:2000.
+
+%package devel
+Summary: Include Files and Documentation
+Group: Development/Libraries
+Requires: %{package_name} = %{ver}
+
+%description devel
+JasPer is a collection        
+of software (i.e., a library and application programs) for the coding 
+and manipulation of images.  This software can handle image data in a 
+variety of formats.  One such format supported by JasPer is the JPEG-2000 
+code stream format defined in ISO/IEC 15444-1:2000.
+
+%prep
+%setup
+
+./configure --prefix=/usr --enable-shared
+
+
+# build
+%build
+
+#if [ "$SMP" != "" ]; then
+#  (make "MAKE=make -k -j $SMP"; exit 0)
+#  make
+#else
+  make
+#fi
+
+
+# install
+%install
+rm -rf $RPM_BUILD_ROOT
+
+make prefix=$RPM_BUILD_ROOT%{prefix} install
+
+
+# clean
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+
+# files main package
+%files
+%defattr(-, root, root)
+
+%doc README LICENSE ChangeLog
+
+%{prefix}/bin/*
+%{prefix}/lib/lib*.so.*
+
+# files devel package
+%files devel
+%defattr(-, root, root)
+
+# no API docs yet :(
+# %doc doc/html/*
+
+%{prefix}/include/jasper/*
+%{prefix}/lib/lib*.so
+%{prefix}/lib/lib*.a
+%{prefix}/lib/lib*.la
+
+%changelog
+
+* Fri Oct 25 2002 Alexander D. Karaivanov <adk@medical-insight.com>
+
+  - spec file created
diff --git a/jasper.spec.in b/jasper.spec.in
new file mode 100644 (file)
index 0000000..9c8f642
--- /dev/null
@@ -0,0 +1,101 @@
+# Note that this is NOT a relocatable package
+%define package_name  jasper
+%define ver           @JAS_VERSION@
+%define prefix        /usr
+%define datadir       %{prefix}/share
+%define release       @JAS_RPM_RELEASE@
+
+Summary: JasPer
+Name: %{package_name}
+Version: %{ver}
+Release: %{release}
+Copyright: Modified BSD
+Group: Development/Libraries
+
+# FIXME: 
+Source: http://www.ece.uvic.ca/~mdadams/jasper/software/jasper-@JAS_VERSION@.tar.gz
+
+BuildRoot: /var/tmp/%{package_name}-%{version}-root
+Requires: libjpeg
+BuildRequires: libjpeg-devel
+URL: http://www.ece.uvic.ca/~mdadams/jasper/
+
+%description 
+JasPer is a collection        
+of software (i.e., a library and application programs) for the coding 
+and manipulation of images.  This software can handle image data in a 
+variety of formats.  One such format supported by JasPer is the JPEG-2000 
+format defined in ISO/IEC 15444-1:2000.
+
+%package devel
+Summary: Include Files and Documentation
+Group: Development/Libraries
+Requires: %{package_name} = %{ver}
+
+%description devel
+JasPer is a collection        
+of software (i.e., a library and application programs) for the coding 
+and manipulation of images.  This software can handle image data in a 
+variety of formats.  One such format supported by JasPer is the JPEG-2000 
+code stream format defined in ISO/IEC 15444-1:2000.
+
+%prep
+%setup
+
+./configure --prefix=/usr --enable-shared
+
+
+# build
+%build
+
+#if [ "$SMP" != "" ]; then
+#  (make "MAKE=make -k -j $SMP"; exit 0)
+#  make
+#else
+  make
+#fi
+
+
+# install
+%install
+rm -rf $RPM_BUILD_ROOT
+
+make prefix=$RPM_BUILD_ROOT%{prefix} install
+
+
+# clean
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+
+# files main package
+%files
+%defattr(-, root, root)
+
+%doc README LICENSE ChangeLog
+
+%{prefix}/bin/*
+%{prefix}/lib/lib*.so.*
+
+# files devel package
+%files devel
+%defattr(-, root, root)
+
+# no API docs yet :(
+# %doc doc/html/*
+
+%{prefix}/include/jasper/*
+%{prefix}/lib/lib*.so
+%{prefix}/lib/lib*.a
+%{prefix}/lib/lib*.la
+
+%changelog
+
+* Fri Oct 25 2002 Alexander D. Karaivanov <adk@medical-insight.com>
+
+  - spec file created
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644 (file)
index 0000000..d13b988
--- /dev/null
@@ -0,0 +1,61 @@
+# Copyright (c) 2001-2002 Michael David Adams.
+# All rights reserved. 
+
+# __START_OF_JASPER_LICENSE__
+# 
+# JasPer License Version 2.0
+# 
+# Copyright (c) 2001-2006 Michael David Adams
+# Copyright (c) 1999-2000 Image Power, Inc.
+# Copyright (c) 1999-2000 The University of British Columbia
+# 
+# All rights reserved.
+# 
+# Permission is hereby granted, free of charge, to any person (the
+# "User") obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the
+# following conditions:
+# 
+# 1.  The above copyright notices and this permission notice (which
+# includes the disclaimer below) shall be included in all copies or
+# substantial portions of the Software.
+# 
+# 2.  The name of a copyright holder shall not be used to endorse or
+# promote products derived from the Software without specific prior
+# written permission.
+# 
+# THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+# LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+# THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+# "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+# PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+# EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+# PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+# THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+# EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+# BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+# PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+# GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+# ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+# IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+# SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+# AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+# SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+# THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+# PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+# RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+# EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+# 
+# __END_OF_JASPER_LICENSE__
+
+EXTRA_DIST = README
+
+SUBDIRS = libjasper appl msvc
diff --git a/src/Makefile.in b/src/Makefile.in
new file mode 100644 (file)
index 0000000..0c191e2
--- /dev/null
@@ -0,0 +1,550 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# Copyright (c) 2001-2002 Michael David Adams.
+# All rights reserved. 
+
+# __START_OF_JASPER_LICENSE__
+# 
+# JasPer License Version 2.0
+# 
+# Copyright (c) 2001-2006 Michael David Adams
+# Copyright (c) 1999-2000 Image Power, Inc.
+# Copyright (c) 1999-2000 The University of British Columbia
+# 
+# All rights reserved.
+# 
+# Permission is hereby granted, free of charge, to any person (the
+# "User") obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the
+# following conditions:
+# 
+# 1.  The above copyright notices and this permission notice (which
+# includes the disclaimer below) shall be included in all copies or
+# substantial portions of the Software.
+# 
+# 2.  The name of a copyright holder shall not be used to endorse or
+# promote products derived from the Software without specific prior
+# written permission.
+# 
+# THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+# LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+# THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+# "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+# PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+# EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+# PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+# THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+# EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+# BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+# PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+# GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+# ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+# IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+# SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+# AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+# SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+# THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+# PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+# RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+# EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+# 
+# __END_OF_JASPER_LICENSE__
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = src
+DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/acaux/mkinstalldirs
+CONFIG_HEADER =  \
+       $(top_builddir)/src/libjasper/include/jasper/jas_config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+       html-recursive info-recursive install-data-recursive \
+       install-exec-recursive install-info-recursive \
+       install-recursive installcheck-recursive installdirs-recursive \
+       pdf-recursive ps-recursive uninstall-info-recursive \
+       uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+HAVE_LIBJPEG_FALSE = @HAVE_LIBJPEG_FALSE@
+HAVE_LIBJPEG_TRUE = @HAVE_LIBJPEG_TRUE@
+HAVE_OPENGL_FALSE = @HAVE_OPENGL_FALSE@
+HAVE_OPENGL_TRUE = @HAVE_OPENGL_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAS_MAJOR_VERSION = @JAS_MAJOR_VERSION@
+JAS_MICRO_VERSION = @JAS_MICRO_VERSION@
+JAS_MINOR_VERSION = @JAS_MINOR_VERSION@
+JAS_RPM_RELEASE = @JAS_RPM_RELEASE@
+JAS_VERSION = @JAS_VERSION@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_AGE = @LT_AGE@
+LT_CURRENT = @LT_CURRENT@
+LT_RELEASE = @LT_RELEASE@
+LT_REVISION = @LT_REVISION@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OPENGL_LIBS = @OPENGL_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+EXTRA_DIST = README
+SUBDIRS = libjasper appl msvc
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/Makefile'; \
+       cd $(top_srcdir) && \
+         $(AUTOMAKE) --foreign  src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+
+distclean-libtool:
+       -rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+       @failcom='exit 1'; \
+       for f in x $$MAKEFLAGS; do \
+         case $$f in \
+           *=* | --[!k]*);; \
+           *k*) failcom='fail=yes';; \
+         esac; \
+       done; \
+       dot_seen=no; \
+       target=`echo $@ | sed s/-recursive//`; \
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         echo "Making $$target in $$subdir"; \
+         if test "$$subdir" = "."; then \
+           dot_seen=yes; \
+           local_target="$$target-am"; \
+         else \
+           local_target="$$target"; \
+         fi; \
+         (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+         || eval $$failcom; \
+       done; \
+       if test "$$dot_seen" = "no"; then \
+         $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+       fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+       @failcom='exit 1'; \
+       for f in x $$MAKEFLAGS; do \
+         case $$f in \
+           *=* | --[!k]*);; \
+           *k*) failcom='fail=yes';; \
+         esac; \
+       done; \
+       dot_seen=no; \
+       case "$@" in \
+         distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+         *) list='$(SUBDIRS)' ;; \
+       esac; \
+       rev=''; for subdir in $$list; do \
+         if test "$$subdir" = "."; then :; else \
+           rev="$$subdir $$rev"; \
+         fi; \
+       done; \
+       rev="$$rev ."; \
+       target=`echo $@ | sed s/-recursive//`; \
+       for subdir in $$rev; do \
+         echo "Making $$target in $$subdir"; \
+         if test "$$subdir" = "."; then \
+           local_target="$$target-am"; \
+         else \
+           local_target="$$target"; \
+         fi; \
+         (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+         || eval $$failcom; \
+       done && test -z "$$fail"
+tags-recursive:
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+       done
+ctags-recursive:
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+       done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+         include_option=--etags-include; \
+         empty_fix=.; \
+       else \
+         include_option=--include; \
+         empty_fix=; \
+       fi; \
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         if test "$$subdir" = .; then :; else \
+           test ! -f $$subdir/TAGS || \
+             tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+         fi; \
+       done; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+           $$tags $$unique; \
+       fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       test -z "$(CTAGS_ARGS)$$tags$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$tags $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && cd $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+       list='$(DISTFILES)'; for file in $$list; do \
+         case $$file in \
+           $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+           $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+         esac; \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+         if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+           dir="/$$dir"; \
+           $(mkdir_p) "$(distdir)$$dir"; \
+         else \
+           dir=''; \
+         fi; \
+         if test -d $$d/$$file; then \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+           fi; \
+           cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+         else \
+           test -f $(distdir)/$$file \
+           || cp -p $$d/$$file $(distdir)/$$file \
+           || exit 1; \
+         fi; \
+       done
+       list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+         if test "$$subdir" = .; then :; else \
+           test -d "$(distdir)/$$subdir" \
+           || $(mkdir_p) "$(distdir)/$$subdir" \
+           || exit 1; \
+           distdir=`$(am__cd) $(distdir) && pwd`; \
+           top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+           (cd $$subdir && \
+             $(MAKE) $(AM_MAKEFLAGS) \
+               top_distdir="$$top_distdir" \
+               distdir="$$distdir/$$subdir" \
+               distdir) \
+             || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+         `test -z '$(STRIP)' || \
+           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+       distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+       clean clean-generic clean-libtool clean-recursive ctags \
+       ctags-recursive distclean distclean-generic distclean-libtool \
+       distclean-recursive distclean-tags distdir dvi dvi-am html \
+       html-am info info-am install install-am install-data \
+       install-data-am install-exec install-exec-am install-info \
+       install-info-am install-man install-strip installcheck \
+       installcheck-am installdirs installdirs-am maintainer-clean \
+       maintainer-clean-generic maintainer-clean-recursive \
+       mostlyclean mostlyclean-generic mostlyclean-libtool \
+       mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+       uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/README b/src/README
new file mode 100644 (file)
index 0000000..faf38c3
--- /dev/null
@@ -0,0 +1 @@
+This directory hierarchy contains the source code for JasPer.
diff --git a/src/appl/Makefile.am b/src/appl/Makefile.am
new file mode 100644 (file)
index 0000000..c1f7ff8
--- /dev/null
@@ -0,0 +1,91 @@
+# Copyright (c) 2001-2003 Michael David Adams.
+# All rights reserved. 
+
+# __START_OF_JASPER_LICENSE__
+# 
+# JasPer License Version 2.0
+# 
+# Copyright (c) 2001-2006 Michael David Adams
+# Copyright (c) 1999-2000 Image Power, Inc.
+# Copyright (c) 1999-2000 The University of British Columbia
+# 
+# All rights reserved.
+# 
+# Permission is hereby granted, free of charge, to any person (the
+# "User") obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the
+# following conditions:
+# 
+# 1.  The above copyright notices and this permission notice (which
+# includes the disclaimer below) shall be included in all copies or
+# substantial portions of the Software.
+# 
+# 2.  The name of a copyright holder shall not be used to endorse or
+# promote products derived from the Software without specific prior
+# written permission.
+# 
+# THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+# LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+# THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+# "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+# PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+# EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+# PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+# THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+# EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+# BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+# PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+# GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+# ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+# IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+# SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+# AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+# SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+# THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+# PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+# RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+# EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+# 
+# __END_OF_JASPER_LICENSE__
+
+if HAVE_OPENGL
+BIN_JIV = jiv
+EXTRA_JIV =
+else
+BIN_JIV =
+EXTRA_JIV = jiv
+endif
+
+bin_PROGRAMS = jasper $(BIN_JIV) imgcmp imginfo tmrdemo
+#bin_PROGRAMS = jasper $(BIN_JIV) imgcmp imginfo tmrdemo dummy dummy2
+EXTRA_PROGRAMS = $(EXTRA_JIV) dummy dummy2
+
+jasper_SOURCES = jasper.c
+imgcmp_SOURCES = imgcmp.c
+imginfo_SOURCES = imginfo.c
+dummy_SOURCES = dummy.c
+dummy2_SOURCES = dummy2.c
+tmrdemo_SOURCES = tmrdemo.c
+jiv_SOURCES = jiv.c
+man_MANS = imgcmp.1 imginfo.1 jasper.1 jiv.1
+EXTRA_DIST = $(man_MANS)
+
+INCLUDES = -I$(top_srcdir)/src/libjasper/include
+
+MYLDFLAGS = ../libjasper/libjasper.la
+jasper_LDADD = $(MYLDFLAGS)
+imgcmp_LDADD = $(MYLDFLAGS)
+imginfo_LDADD = $(MYLDFLAGS)
+jiv_LDADD = $(MYLDFLAGS) $(OPENGL_LIBS)
+dummy_LDADD = $(MYLDFLAGS)
+dummy2_LDADD = $(MYLDFLAGS)
+tmrdemo_LDADD = $(MYLDFLAGS)
+
diff --git a/src/appl/Makefile.in b/src/appl/Makefile.in
new file mode 100644 (file)
index 0000000..1798996
--- /dev/null
@@ -0,0 +1,649 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# Copyright (c) 2001-2003 Michael David Adams.
+# All rights reserved. 
+
+# __START_OF_JASPER_LICENSE__
+# 
+# JasPer License Version 2.0
+# 
+# Copyright (c) 2001-2006 Michael David Adams
+# Copyright (c) 1999-2000 Image Power, Inc.
+# Copyright (c) 1999-2000 The University of British Columbia
+# 
+# All rights reserved.
+# 
+# Permission is hereby granted, free of charge, to any person (the
+# "User") obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the
+# following conditions:
+# 
+# 1.  The above copyright notices and this permission notice (which
+# includes the disclaimer below) shall be included in all copies or
+# substantial portions of the Software.
+# 
+# 2.  The name of a copyright holder shall not be used to endorse or
+# promote products derived from the Software without specific prior
+# written permission.
+# 
+# THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+# LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+# THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+# "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+# PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+# EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+# PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+# THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+# EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+# BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+# PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+# GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+# ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+# IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+# SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+# AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+# SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+# THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+# PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+# RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+# EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+# 
+# __END_OF_JASPER_LICENSE__
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+bin_PROGRAMS = jasper$(EXEEXT) $(am__EXEEXT_2) imgcmp$(EXEEXT) \
+       imginfo$(EXEEXT) tmrdemo$(EXEEXT)
+EXTRA_PROGRAMS = $(am__EXEEXT_1) dummy$(EXEEXT) dummy2$(EXEEXT)
+subdir = src/appl
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/acaux/mkinstalldirs
+CONFIG_HEADER =  \
+       $(top_builddir)/src/libjasper/include/jasper/jas_config.h
+CONFIG_CLEAN_FILES =
+@HAVE_OPENGL_FALSE@am__EXEEXT_1 = jiv$(EXEEXT)
+@HAVE_OPENGL_TRUE@am__EXEEXT_2 = jiv$(EXEEXT)
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am_dummy_OBJECTS = dummy.$(OBJEXT)
+dummy_OBJECTS = $(am_dummy_OBJECTS)
+am__DEPENDENCIES_1 = ../libjasper/libjasper.la
+dummy_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_dummy2_OBJECTS = dummy2.$(OBJEXT)
+dummy2_OBJECTS = $(am_dummy2_OBJECTS)
+dummy2_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_imgcmp_OBJECTS = imgcmp.$(OBJEXT)
+imgcmp_OBJECTS = $(am_imgcmp_OBJECTS)
+imgcmp_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_imginfo_OBJECTS = imginfo.$(OBJEXT)
+imginfo_OBJECTS = $(am_imginfo_OBJECTS)
+imginfo_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_jasper_OBJECTS = jasper.$(OBJEXT)
+jasper_OBJECTS = $(am_jasper_OBJECTS)
+jasper_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_jiv_OBJECTS = jiv.$(OBJEXT)
+jiv_OBJECTS = $(am_jiv_OBJECTS)
+am__DEPENDENCIES_2 =
+jiv_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
+am_tmrdemo_OBJECTS = tmrdemo.$(OBJEXT)
+tmrdemo_OBJECTS = $(am_tmrdemo_OBJECTS)
+tmrdemo_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/libjasper/include/jasper
+depcomp = $(SHELL) $(top_srcdir)/acaux/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+       $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(dummy_SOURCES) $(dummy2_SOURCES) $(imgcmp_SOURCES) \
+       $(imginfo_SOURCES) $(jasper_SOURCES) $(jiv_SOURCES) \
+       $(tmrdemo_SOURCES)
+DIST_SOURCES = $(dummy_SOURCES) $(dummy2_SOURCES) $(imgcmp_SOURCES) \
+       $(imginfo_SOURCES) $(jasper_SOURCES) $(jiv_SOURCES) \
+       $(tmrdemo_SOURCES)
+man1dir = $(mandir)/man1
+NROFF = nroff
+MANS = $(man_MANS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+HAVE_LIBJPEG_FALSE = @HAVE_LIBJPEG_FALSE@
+HAVE_LIBJPEG_TRUE = @HAVE_LIBJPEG_TRUE@
+HAVE_OPENGL_FALSE = @HAVE_OPENGL_FALSE@
+HAVE_OPENGL_TRUE = @HAVE_OPENGL_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAS_MAJOR_VERSION = @JAS_MAJOR_VERSION@
+JAS_MICRO_VERSION = @JAS_MICRO_VERSION@
+JAS_MINOR_VERSION = @JAS_MINOR_VERSION@
+JAS_RPM_RELEASE = @JAS_RPM_RELEASE@
+JAS_VERSION = @JAS_VERSION@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_AGE = @LT_AGE@
+LT_CURRENT = @LT_CURRENT@
+LT_RELEASE = @LT_RELEASE@
+LT_REVISION = @LT_REVISION@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OPENGL_LIBS = @OPENGL_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+@HAVE_OPENGL_FALSE@BIN_JIV = 
+@HAVE_OPENGL_TRUE@BIN_JIV = jiv
+@HAVE_OPENGL_FALSE@EXTRA_JIV = jiv
+@HAVE_OPENGL_TRUE@EXTRA_JIV = 
+jasper_SOURCES = jasper.c
+imgcmp_SOURCES = imgcmp.c
+imginfo_SOURCES = imginfo.c
+dummy_SOURCES = dummy.c
+dummy2_SOURCES = dummy2.c
+tmrdemo_SOURCES = tmrdemo.c
+jiv_SOURCES = jiv.c
+man_MANS = imgcmp.1 imginfo.1 jasper.1 jiv.1
+EXTRA_DIST = $(man_MANS)
+INCLUDES = -I$(top_srcdir)/src/libjasper/include
+MYLDFLAGS = ../libjasper/libjasper.la
+jasper_LDADD = $(MYLDFLAGS)
+imgcmp_LDADD = $(MYLDFLAGS)
+imginfo_LDADD = $(MYLDFLAGS)
+jiv_LDADD = $(MYLDFLAGS) $(OPENGL_LIBS)
+dummy_LDADD = $(MYLDFLAGS)
+dummy2_LDADD = $(MYLDFLAGS)
+tmrdemo_LDADD = $(MYLDFLAGS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/appl/Makefile'; \
+       cd $(top_srcdir) && \
+         $(AUTOMAKE) --foreign  src/appl/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-binPROGRAMS: $(bin_PROGRAMS)
+       @$(NORMAL_INSTALL)
+       test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
+       @list='$(bin_PROGRAMS)'; for p in $$list; do \
+         p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+         if test -f $$p \
+            || test -f $$p1 \
+         ; then \
+           f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+          echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+          $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+         else :; fi; \
+       done
+
+uninstall-binPROGRAMS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(bin_PROGRAMS)'; for p in $$list; do \
+         f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+         echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+         rm -f "$(DESTDIR)$(bindir)/$$f"; \
+       done
+
+clean-binPROGRAMS:
+       @list='$(bin_PROGRAMS)'; for p in $$list; do \
+         f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+         echo " rm -f $$p $$f"; \
+         rm -f $$p $$f ; \
+       done
+dummy$(EXEEXT): $(dummy_OBJECTS) $(dummy_DEPENDENCIES) 
+       @rm -f dummy$(EXEEXT)
+       $(LINK) $(dummy_LDFLAGS) $(dummy_OBJECTS) $(dummy_LDADD) $(LIBS)
+dummy2$(EXEEXT): $(dummy2_OBJECTS) $(dummy2_DEPENDENCIES) 
+       @rm -f dummy2$(EXEEXT)
+       $(LINK) $(dummy2_LDFLAGS) $(dummy2_OBJECTS) $(dummy2_LDADD) $(LIBS)
+imgcmp$(EXEEXT): $(imgcmp_OBJECTS) $(imgcmp_DEPENDENCIES) 
+       @rm -f imgcmp$(EXEEXT)
+       $(LINK) $(imgcmp_LDFLAGS) $(imgcmp_OBJECTS) $(imgcmp_LDADD) $(LIBS)
+imginfo$(EXEEXT): $(imginfo_OBJECTS) $(imginfo_DEPENDENCIES) 
+       @rm -f imginfo$(EXEEXT)
+       $(LINK) $(imginfo_LDFLAGS) $(imginfo_OBJECTS) $(imginfo_LDADD) $(LIBS)
+jasper$(EXEEXT): $(jasper_OBJECTS) $(jasper_DEPENDENCIES) 
+       @rm -f jasper$(EXEEXT)
+       $(LINK) $(jasper_LDFLAGS) $(jasper_OBJECTS) $(jasper_LDADD) $(LIBS)
+jiv$(EXEEXT): $(jiv_OBJECTS) $(jiv_DEPENDENCIES) 
+       @rm -f jiv$(EXEEXT)
+       $(LINK) $(jiv_LDFLAGS) $(jiv_OBJECTS) $(jiv_LDADD) $(LIBS)
+tmrdemo$(EXEEXT): $(tmrdemo_OBJECTS) $(tmrdemo_DEPENDENCIES) 
+       @rm -f tmrdemo$(EXEEXT)
+       $(LINK) $(tmrdemo_LDFLAGS) $(tmrdemo_OBJECTS) $(tmrdemo_LDADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dummy.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dummy2.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imgcmp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imginfo.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jasper.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jiv.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tmrdemo.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+
+distclean-libtool:
+       -rm -f libtool
+uninstall-info-am:
+install-man1: $(man1_MANS) $(man_MANS)
+       @$(NORMAL_INSTALL)
+       test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)"
+       @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
+       l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+       for i in $$l2; do \
+         case "$$i" in \
+           *.1*) list="$$list $$i" ;; \
+         esac; \
+       done; \
+       for i in $$list; do \
+         if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
+         else file=$$i; fi; \
+         ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+         case "$$ext" in \
+           1*) ;; \
+           *) ext='1' ;; \
+         esac; \
+         inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+         inst=`echo $$inst | sed -e 's/^.*\///'`; \
+         inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+         echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+         $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \
+       done
+uninstall-man1:
+       @$(NORMAL_UNINSTALL)
+       @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
+       l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+       for i in $$l2; do \
+         case "$$i" in \
+           *.1*) list="$$list $$i" ;; \
+         esac; \
+       done; \
+       for i in $$list; do \
+         ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+         case "$$ext" in \
+           1*) ;; \
+           *) ext='1' ;; \
+         esac; \
+         inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+         inst=`echo $$inst | sed -e 's/^.*\///'`; \
+         inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+         echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \
+         rm -f "$(DESTDIR)$(man1dir)/$$inst"; \
+       done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+           $$tags $$unique; \
+       fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       test -z "$(CTAGS_ARGS)$$tags$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$tags $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && cd $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+       list='$(DISTFILES)'; for file in $$list; do \
+         case $$file in \
+           $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+           $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+         esac; \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+         if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+           dir="/$$dir"; \
+           $(mkdir_p) "$(distdir)$$dir"; \
+         else \
+           dir=''; \
+         fi; \
+         if test -d $$d/$$file; then \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+           fi; \
+           cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+         else \
+           test -f $(distdir)/$$file \
+           || cp -p $$d/$$file $(distdir)/$$file \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS) $(MANS)
+installdirs:
+       for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \
+         test -z "$$dir" || $(mkdir_p) "$$dir"; \
+       done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+         `test -z '$(STRIP)' || \
+           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-man
+
+install-exec-am: install-binPROGRAMS
+
+install-info: install-info-am
+
+install-man: install-man1
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-info-am uninstall-man
+
+uninstall-man: uninstall-man1
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+       clean-generic clean-libtool ctags distclean distclean-compile \
+       distclean-generic distclean-libtool distclean-tags distdir dvi \
+       dvi-am html html-am info info-am install install-am \
+       install-binPROGRAMS install-data install-data-am install-exec \
+       install-exec-am install-info install-info-am install-man \
+       install-man1 install-strip installcheck installcheck-am \
+       installdirs maintainer-clean maintainer-clean-generic \
+       mostlyclean mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+       uninstall-am uninstall-binPROGRAMS uninstall-info-am \
+       uninstall-man uninstall-man1
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/appl/dummy.c b/src/appl/dummy.c
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/src/appl/dummy2.c b/src/appl/dummy2.c
new file mode 100644 (file)
index 0000000..acfd275
--- /dev/null
@@ -0,0 +1,65 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <jasper.h>
+
+#define        FAILED  2
+
+int main(int argc, char **argv)
+{
+       char *refpath;
+       FILE *reffile;
+       char *othpath;
+       FILE *othfile;
+       int c;
+       jas_seq2d_t *x;
+       jas_seq2d_t *y;
+
+       refpath = 0;
+       othpath = 0;
+
+       while ((c = getopt(argc, argv, "f:F:")) != EOF) {
+               switch (c) {
+               case 'f':
+                       refpath = optarg;
+                       break;
+               case 'F':
+                       othpath = optarg;
+                       break;
+               }
+       }
+
+       if (!refpath || !othpath) {
+               fprintf(stderr, "usage: %s -f reffile -F othfile\n", argv[0]);
+               exit(FAILED);
+       }
+
+       if (!(reffile = fopen(refpath, "r"))) {
+               fprintf(stderr, "cannot open %s\n", refpath);
+               exit(FAILED);
+       }
+       if (!(othfile = fopen(othpath, "r"))) {
+               fprintf(stderr, "cannot open %s\n", othpath);
+               exit(FAILED);
+       }
+
+       if (!(x = jas_seq2d_input(reffile))) {
+               fprintf(stderr, "cannot input reference\n");
+               exit(FAILED);
+       }
+       if (!(y = jas_seq2d_input(othfile))) {
+               fprintf(stderr, "cannot input other\n");
+               exit(FAILED);
+       }
+
+       if (!jas_matrix_cmp(x, y)) {
+               fprintf(stderr, "equal\n");
+               exit(0);
+       } else {
+               fprintf(stderr, "not equal\n");
+               exit(1);
+       }
+
+       exit(FAILED);
+
+}
+
diff --git a/src/appl/imgcmp.1 b/src/appl/imgcmp.1
new file mode 100644 (file)
index 0000000..efc65d4
--- /dev/null
@@ -0,0 +1,24 @@
+.TH imgcmp 1 "20 June 2004" "Version 1.701.0" "JasPer Manual"
+
+.SH NAME
+imgcmp \- Image comparison utility
+
+.SH SYNOPSIS
+.B imgcmp
+.RI [ options ]
+
+.SH DESCRIPTION
+The
+.B imgcmp
+command compares two images of the same geometry with respect to a given
+metric.
+Please use the \-\-help command
+line switch and the JasPer Software Reference Manual for more information.
+
+.SH SEE ALSO
+.IR jasper (1)
+
+.SH AUTHOR
+Michael D. Adams <mdadams@ieee.org>
+This manpage was initially written by Roland Stigge <stigge@antcom.de> for
+the Debian Project.
diff --git a/src/appl/imgcmp.c b/src/appl/imgcmp.c
new file mode 100644 (file)
index 0000000..255b581
--- /dev/null
@@ -0,0 +1,576 @@
+/*
+ * Copyright (c) 2001-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Image Comparison Program
+ *
+ * $Id$
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <math.h>
+#include <float.h>
+#include <assert.h>
+
+#include <jasper/jasper.h>
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+typedef enum {
+       OPT_HELP,
+       OPT_VERSION,
+       OPT_VERBOSE,
+       OPT_ORIG,
+       OPT_RECON,
+       OPT_METRIC,
+       OPT_MAXONLY,
+       OPT_MINONLY,
+       OPT_DIFFIMAGE
+} optid_t;
+
+typedef enum {
+       metricid_none = 0,
+       metricid_equal,
+       metricid_psnr,
+       metricid_mse,
+       metricid_rmse,
+       metricid_pae,
+       metricid_mae
+} metricid_t;
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+double getdistortion(jas_matrix_t *orig, jas_matrix_t *recon, int depth, int metric);
+double pae(jas_matrix_t *x, jas_matrix_t *y);
+double msen(jas_matrix_t *x, jas_matrix_t *y, int n);
+double psnr(jas_matrix_t *x, jas_matrix_t *y, int depth);
+jas_image_t *makediffimage(jas_matrix_t *origdata, jas_matrix_t *recondata);
+void usage(void);
+void cmdinfo(void);
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+static jas_taginfo_t metrictab[] = {
+       {metricid_mse, "mse"},
+       {metricid_pae, "pae"},
+       {metricid_rmse, "rmse"},
+       {metricid_psnr, "psnr"},
+       {metricid_mae, "mae"},
+       {metricid_equal, "equal"},
+       {-1, 0}
+};
+
+static jas_opt_t opts[] = {
+       {OPT_HELP, "help", 0},
+       {OPT_VERSION, "version", 0},
+       {OPT_VERBOSE, "verbose", 0},
+       {OPT_ORIG, "f", JAS_OPT_HASARG},
+       {OPT_RECON, "F", JAS_OPT_HASARG},
+       {OPT_METRIC, "m", JAS_OPT_HASARG},
+       {OPT_MAXONLY, "max", 0},
+       {OPT_MINONLY, "min", 0},
+       {OPT_DIFFIMAGE, "d", JAS_OPT_HASARG},
+       {-1, 0, 0}
+};
+
+static char *cmdname = 0;
+
+/******************************************************************************\
+* Main program.
+\******************************************************************************/
+
+int main(int argc, char **argv)
+{
+       char *origpath;
+       char *reconpath;
+       int verbose;
+       char *metricname;
+       int metric;
+
+       int id;
+       jas_image_t *origimage;
+       jas_image_t *reconimage;
+       jas_matrix_t *origdata;
+       jas_matrix_t *recondata;
+       jas_image_t *diffimage;
+       jas_stream_t *diffstream;
+       int width;
+       int height;
+       int depth;
+       int numcomps;
+       double d;
+       double maxdist;
+       double mindist;
+       int compno;
+       jas_stream_t *origstream;
+       jas_stream_t *reconstream;
+       char *diffpath;
+       int maxonly;
+       int minonly;
+       int fmtid;
+
+       verbose = 0;
+       origpath = 0;
+       reconpath = 0;
+       metricname = 0;
+       metric = metricid_none;
+       diffpath = 0;
+       maxonly = 0;
+       minonly = 0;
+
+       if (jas_init()) {
+               abort();
+       }
+
+       cmdname = argv[0];
+
+       /* Parse the command line options. */
+       while ((id = jas_getopt(argc, argv, opts)) >= 0) {
+               switch (id) {
+               case OPT_MAXONLY:
+                       maxonly = 1;
+                       break;
+               case OPT_MINONLY:
+                       minonly = 1;
+                       break;
+               case OPT_METRIC:
+                       metricname = jas_optarg;
+                       break;
+               case OPT_ORIG:
+                       origpath = jas_optarg;
+                       break;
+               case OPT_RECON:
+                       reconpath = jas_optarg;
+                       break;
+               case OPT_VERBOSE:
+                       verbose = 1;
+                       break;
+               case OPT_DIFFIMAGE:
+                       diffpath = jas_optarg;
+                       break;
+               case OPT_VERSION:
+                       printf("%s\n", JAS_VERSION);
+                       exit(EXIT_SUCCESS);
+                       break;
+               case OPT_HELP:
+               default:
+                       usage();
+                       break;
+               }
+       }
+
+       if (verbose) {
+               cmdinfo();
+       }
+
+       /* Ensure that files are given for both the original and reconstructed
+         images. */
+       if (!origpath || !reconpath) {
+               usage();
+       }
+
+       /* If a metric was specified, process it. */
+       if (metricname) {
+               if ((metric = (jas_taginfo_nonull(jas_taginfos_lookup(metrictab,
+                 metricname))->id)) < 0) {
+                       usage();
+               }
+       }
+
+       /* Open the original image file. */
+       if (!(origstream = jas_stream_fopen(origpath, "rb"))) {
+               fprintf(stderr, "cannot open %s\n", origpath);
+               return EXIT_FAILURE;
+       }
+
+       /* Open the reconstructed image file. */
+       if (!(reconstream = jas_stream_fopen(reconpath, "rb"))) {
+               fprintf(stderr, "cannot open %s\n", reconpath);
+               return EXIT_FAILURE;
+       }
+
+       /* Decode the original image. */
+       if (!(origimage = jas_image_decode(origstream, -1, 0))) {
+               fprintf(stderr, "cannot load original image\n");
+               return EXIT_FAILURE;
+       }
+
+       /* Decoder the reconstructed image. */
+       if (!(reconimage = jas_image_decode(reconstream, -1, 0))) {
+               fprintf(stderr, "cannot load reconstructed image\n");
+               return EXIT_FAILURE;
+       }
+
+       /* Close the original image file. */
+       jas_stream_close(origstream);
+
+       /* Close the reconstructed image file. */
+       jas_stream_close(reconstream);
+
+       /* Ensure that both images have the same number of components. */
+       numcomps = jas_image_numcmpts(origimage);
+       if (jas_image_numcmpts(reconimage) != numcomps) {
+               fprintf(stderr, "number of components differ\n");
+               return EXIT_FAILURE;
+       }
+
+       /* Compute the difference for each component. */
+       maxdist = 0;
+       mindist = FLT_MAX;
+       for (compno = 0; compno < numcomps; ++compno) {
+               width = jas_image_cmptwidth(origimage, compno);
+               height = jas_image_cmptheight(origimage, compno);
+               depth = jas_image_cmptprec(origimage, compno);
+               if (jas_image_cmptwidth(reconimage, compno) != width ||
+                jas_image_cmptheight(reconimage, compno) != height) {
+                       fprintf(stderr, "image dimensions differ\n");
+                       return EXIT_FAILURE;
+               }
+               if (jas_image_cmptprec(reconimage, compno) != depth) {
+                       fprintf(stderr, "precisions differ\n");
+                       return EXIT_FAILURE;
+               }
+
+               if (!(origdata = jas_matrix_create(height, width))) {
+                       fprintf(stderr, "internal error\n");
+                       return EXIT_FAILURE;
+               }
+               if (!(recondata = jas_matrix_create(height, width))) {
+                       fprintf(stderr, "internal error\n");
+                       return EXIT_FAILURE;
+               }
+               if (jas_image_readcmpt(origimage, compno, 0, 0, width, height,
+                 origdata)) {
+                       fprintf(stderr, "cannot read component data\n");
+                       return EXIT_FAILURE;
+               }
+               if (jas_image_readcmpt(reconimage, compno, 0, 0, width, height,
+                 recondata)) {
+                       fprintf(stderr, "cannot read component data\n");
+                       return EXIT_FAILURE;
+               }
+
+               if (diffpath) {
+                       if (!(diffstream = jas_stream_fopen(diffpath, "rwb"))) {
+                               fprintf(stderr, "cannot open diff stream\n");
+                               return EXIT_FAILURE;
+                       }
+                       if (!(diffimage = makediffimage(origdata, recondata))) {
+                               fprintf(stderr, "cannot make diff image\n");
+                               return EXIT_FAILURE;
+                       }
+                       fmtid = jas_image_strtofmt("pnm");
+                       if (jas_image_encode(diffimage, diffstream, fmtid, 0)) {
+                               fprintf(stderr, "cannot save\n");
+                               return EXIT_FAILURE;
+                       }
+                       jas_stream_close(diffstream);
+                       jas_image_destroy(diffimage);
+               }
+
+               if (metric != metricid_none) {
+                       d = getdistortion(origdata, recondata, depth, metric);
+                       if (d > maxdist) {
+                               maxdist = d;
+                       }
+                       if (d < mindist) {
+                               mindist = d;
+                       }
+                       if (!maxonly && !minonly) {
+                               if (metric == metricid_pae || metric == metricid_equal) {
+                                       printf("%ld\n", (long) ceil(d));
+                               } else {
+                                       printf("%f\n", d);
+                               }
+                       }
+               }
+               jas_matrix_destroy(origdata);
+               jas_matrix_destroy(recondata);
+       }
+
+       if (metric != metricid_none && (maxonly || minonly)) {
+               if (maxonly) {
+                       d = maxdist;
+               } else if (minonly) {
+                       d = mindist;
+               } else {
+                       abort();
+               }
+               
+               if (metric == metricid_pae || metric == metricid_equal) {
+                       printf("%ld\n", (long) ceil(d));
+               } else {
+                       printf("%f\n", d);
+               }
+       }
+
+       jas_image_destroy(origimage);
+       jas_image_destroy(reconimage);
+       jas_image_clearfmts();
+
+       return EXIT_SUCCESS;
+}
+
+/******************************************************************************\
+* Distortion metric computation functions.
+\******************************************************************************/
+
+double getdistortion(jas_matrix_t *orig, jas_matrix_t *recon, int depth, int metric)
+{
+       double d;
+
+       switch (metric) {
+       case metricid_psnr:
+       default:
+               d = psnr(orig, recon, depth);
+               break;
+       case metricid_mae:
+               d = msen(orig, recon, 1);
+               break;
+       case metricid_mse:
+               d = msen(orig, recon, 2);
+               break;
+       case metricid_rmse:
+               d = sqrt(msen(orig, recon, 2));
+               break;
+       case metricid_pae:
+               d = pae(orig, recon);
+               break;
+       case metricid_equal:
+               d = (pae(orig, recon) == 0) ? 0 : 1;
+               break;
+       }
+       return d;
+}
+
+/* Compute peak absolute error. */
+
+double pae(jas_matrix_t *x, jas_matrix_t *y)
+{
+       double s;
+       double d;
+       int i;
+       int j;
+
+       s = 0.0;
+       for (i = 0; i < jas_matrix_numrows(x); i++) {
+               for (j = 0; j < jas_matrix_numcols(x); j++) {
+                       d = abs(jas_matrix_get(y, i, j) - jas_matrix_get(x, i, j));
+                       if (d > s) {
+                               s = d;
+                       }
+               }
+       }
+
+       return s;
+}
+
+/* Compute either mean-squared error or mean-absolute error. */
+
+double msen(jas_matrix_t *x, jas_matrix_t *y, int n)
+{
+       double s;
+       double d;
+       int i;
+       int j;
+
+       s = 0.0;
+       for (i = 0; i < jas_matrix_numrows(x); i++) {
+               for (j = 0; j < jas_matrix_numcols(x); j++) {
+                       d = jas_matrix_get(y, i, j) - jas_matrix_get(x, i, j);
+                       if (n == 1) {
+                               s += fabs(d);
+                       } else if (n == 2) {
+                               s += d * d;
+                       } else {
+                               abort();
+                       }
+               }
+       }
+
+       return s / ((double) jas_matrix_numrows(x) * jas_matrix_numcols(x));
+}
+
+/* Compute peak signal-to-noise ratio. */
+
+double psnr(jas_matrix_t *x, jas_matrix_t *y, int depth)
+{
+       double m;
+       double p;
+       m = msen(x, y, 2);
+       p = ((1 << depth) - 1);
+       return 20.0 * log10(p / sqrt(m));
+}
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+jas_image_t *makediffimage(jas_matrix_t *origdata, jas_matrix_t *recondata)
+{
+       jas_image_t *diffimage;
+       jas_matrix_t *diffdata[3];
+       int width;
+       int height;
+       int i;
+       int j;
+       int k;
+       jas_image_cmptparm_t compparms[3];
+       jas_seqent_t a;
+       jas_seqent_t b;
+
+       width = jas_matrix_numcols(origdata);
+       height = jas_matrix_numrows(origdata);
+
+       for (i = 0; i < 3; ++i) {
+               compparms[i].tlx = 0;
+               compparms[i].tly = 0;
+               compparms[i].hstep = 1;
+               compparms[i].vstep = 1;
+               compparms[i].width = width;
+               compparms[i].height = height;
+               compparms[i].prec = 8;
+               compparms[i].sgnd = false;
+       }
+       if (!(diffimage = jas_image_create(3, compparms, JAS_CLRSPC_SRGB))) {
+               abort();
+       }
+
+       for (i = 0; i < 3; ++i) {
+               if (!(diffdata[i] = jas_matrix_create(height, width))) {
+                       fprintf(stderr, "internal error\n");
+                       return 0;
+               }
+       }
+
+       for (j = 0; j < height; ++j) {
+               for (k = 0; k < width; ++k) {
+                       a = jas_matrix_get(origdata, j, k);
+                       b = jas_matrix_get(recondata, j, k);
+                       if (a > b) {
+                               jas_matrix_set(diffdata[0], j, k, 255);
+                               jas_matrix_set(diffdata[1], j, k, 0);
+                               jas_matrix_set(diffdata[2], j, k, 0);
+                       } else if (a < b) {
+                               jas_matrix_set(diffdata[0], j, k, 0);
+                               jas_matrix_set(diffdata[1], j, k, 255);
+                               jas_matrix_set(diffdata[2], j, k, 0);
+                       } else {
+                               jas_matrix_set(diffdata[0], j, k, a);
+                               jas_matrix_set(diffdata[1], j, k, a);
+                               jas_matrix_set(diffdata[2], j, k, a);
+                       }
+               }
+       }
+
+       for (i = 0; i < 3; ++i) {
+               if (jas_image_writecmpt(diffimage, i, 0, 0, width, height, diffdata[i])) {
+                       return 0;
+               }
+       }
+
+       return diffimage;
+}
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+void cmdinfo()
+{
+       fprintf(stderr, "Image Comparison Utility (Version %s).\n",
+         JAS_VERSION);
+       fprintf(stderr,
+         "Copyright (c) 2001 Michael David Adams.\n"
+         "All rights reserved.\n"
+         );
+}
+
+void usage()
+{
+       cmdinfo();
+       fprintf(stderr, "usage:\n");
+       fprintf(stderr,"%s ", cmdname);
+       fprintf(stderr,
+         "-f reference_image_file -F other_image_file [-m metric]\n"
+         );
+       fprintf(stderr,
+         "The metric argument may assume one of the following values:\n"
+         "    psnr .... peak signal to noise ratio\n"
+         "    mse ..... mean squared error\n"
+         "    rmse .... root mean squared error\n"
+         "    pae ..... peak absolute error\n"
+         "    mae ..... mean absolute error\n"
+         "    equal ... equality (boolean)\n"
+         );
+       exit(EXIT_FAILURE);
+}
diff --git a/src/appl/imginfo.1 b/src/appl/imginfo.1
new file mode 100644 (file)
index 0000000..34ae656
--- /dev/null
@@ -0,0 +1,23 @@
+.TH imginfo 1 "20 June 2004" "Version 1.701.0" "JasPer Manual"
+
+.SH NAME
+imginfo \- Image information utility
+
+.SH SYNOPSIS
+.B imginfo
+.RI [ options ]
+
+.SH DESCRIPTION
+The
+.B imginfo
+command displays information about an image.
+Please use the \-\-help command
+line switch and the JasPer Software Reference Manual for more information.
+
+.SH SEE ALSO
+.IR jasper (1)
+
+.SH AUTHOR
+Michael D. Adams <mdadams@ieee.org>
+This manpage was initially written by Roland Stigge <stigge@antcom.de> for
+the Debian Project.
diff --git a/src/appl/imginfo.c b/src/appl/imginfo.c
new file mode 100644 (file)
index 0000000..8af19e9
--- /dev/null
@@ -0,0 +1,223 @@
+/*
+ * Copyright (c) 2001-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Image Information Program
+ *
+ * $Id$
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <math.h>
+#include <float.h>
+#include <assert.h>
+
+#include <jasper/jasper.h>
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+typedef enum {
+       OPT_HELP,
+       OPT_VERSION,
+       OPT_VERBOSE,
+       OPT_INFILE
+} optid_t;
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+static void usage(void);
+static void cmdinfo(void);
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+static jas_opt_t opts[] = {
+       {OPT_HELP, "help", 0},
+       {OPT_VERSION, "version", 0},
+       {OPT_VERBOSE, "verbose", 0},
+       {OPT_INFILE, "f", JAS_OPT_HASARG},
+       {-1, 0, 0}
+};
+
+static char *cmdname = 0;
+
+/******************************************************************************\
+* Main program.
+\******************************************************************************/
+
+int main(int argc, char **argv)
+{
+       int fmtid;
+       int id;
+       char *infile;
+       jas_stream_t *instream;
+       jas_image_t *image;
+       int width;
+       int height;
+       int depth;
+       int numcmpts;
+       int verbose;
+       char *fmtname;
+
+       if (jas_init()) {
+               abort();
+       }
+
+       cmdname = argv[0];
+
+       infile = 0;
+       verbose = 0;
+
+       /* Parse the command line options. */
+       while ((id = jas_getopt(argc, argv, opts)) >= 0) {
+               switch (id) {
+               case OPT_VERBOSE:
+                       verbose = 1;
+                       break;
+               case OPT_VERSION:
+                       printf("%s\n", JAS_VERSION);
+                       exit(EXIT_SUCCESS);
+                       break;
+               case OPT_INFILE:
+                       infile = jas_optarg;
+                       break;
+               case OPT_HELP:
+               default:
+                       usage();
+                       break;
+               }
+       }
+
+       /* Open the image file. */
+       if (infile) {
+               /* The image is to be read from a file. */
+               if (!(instream = jas_stream_fopen(infile, "rb"))) {
+                       fprintf(stderr, "cannot open input image file %s\n", infile);
+                       exit(EXIT_FAILURE);
+               }
+       } else {
+               /* The image is to be read from standard input. */
+               if (!(instream = jas_stream_fdopen(0, "rb"))) {
+                       fprintf(stderr, "cannot open standard input\n");
+                       exit(EXIT_FAILURE);
+               }
+       }
+
+       if ((fmtid = jas_image_getfmt(instream)) < 0) {
+               fprintf(stderr, "unknown image format\n");
+       }
+
+       /* Decode the image. */
+       if (!(image = jas_image_decode(instream, fmtid, 0))) {
+               fprintf(stderr, "cannot load image\n");
+               return EXIT_FAILURE;
+       }
+
+       /* Close the image file. */
+       jas_stream_close(instream);
+
+       numcmpts = jas_image_numcmpts(image);
+       width = jas_image_cmptwidth(image, 0);
+       height = jas_image_cmptheight(image, 0);
+       depth = jas_image_cmptprec(image, 0);
+       if (!(fmtname = jas_image_fmttostr(fmtid))) {
+               abort();
+       }
+       printf("%s %d %d %d %d %ld\n", fmtname, numcmpts, width, height, depth, (long) jas_image_rawsize(image));
+
+       jas_image_destroy(image);
+       jas_image_clearfmts();
+
+       return EXIT_SUCCESS;
+}
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+static void cmdinfo()
+{
+       fprintf(stderr, "Image Information Utility (Version %s).\n",
+         JAS_VERSION);
+       fprintf(stderr,
+         "Copyright (c) 2001 Michael David Adams.\n"
+         "All rights reserved.\n"
+         );
+}
+
+static void usage()
+{
+       cmdinfo();
+       fprintf(stderr, "usage:\n");
+       fprintf(stderr,"%s ", cmdname);
+       fprintf(stderr, "[-f image_file]\n");
+       exit(EXIT_FAILURE);
+}
diff --git a/src/appl/jasper.1 b/src/appl/jasper.1
new file mode 100644 (file)
index 0000000..f0f74a1
--- /dev/null
@@ -0,0 +1,19 @@
+.TH jasper 1 "20 June 2004" "Version 1.701.0" "JasPer Manual"
+
+.SH NAME
+jasper \- File format converter specialized in JPEG-2000 encoding
+
+.SH SYNOPSIS
+.B jasper
+.RI [ options ]
+
+.SH DESCRIPTION
+The
+.B jasper
+command converts to and from JPEG-2000 files. Please use the \-\-help command
+line switch and the JasPer Software Reference Manual for more information.
+
+.SH AUTHOR
+Michael D. Adams <mdadams@ieee.org>
+This manpage was initially written by Roland Stigge <stigge@antcom.de> for
+the Debian Project.
diff --git a/src/appl/jasper.c b/src/appl/jasper.c
new file mode 100644 (file)
index 0000000..d99e356
--- /dev/null
@@ -0,0 +1,554 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * JasPer Transcoder Program
+ *
+ * $Id$
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <time.h>
+
+#include <jasper/jasper.h>
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+#define OPTSMAX        4096
+
+/******************************************************************************\
+* Types.
+\******************************************************************************/
+
+/* Encoder command line options. */
+
+typedef struct {
+
+       char *infile;
+       /* The input image file. */
+
+       int infmt;
+       /* The input image file format. */
+
+       char *inopts;
+       char inoptsbuf[OPTSMAX + 1];
+
+       char *outfile;
+       /* The output image file. */
+
+       int outfmt;
+
+       char *outopts;
+       char outoptsbuf[OPTSMAX + 1];
+
+       int verbose;
+       /* Verbose mode. */
+
+       int debug;
+
+       int version;
+
+       int_fast32_t cmptno;
+
+       int srgb;
+
+} cmdopts_t;
+
+/******************************************************************************\
+* Local prototypes.
+\******************************************************************************/
+
+cmdopts_t *cmdopts_parse(int argc, char **argv);
+void cmdopts_destroy(cmdopts_t *cmdopts);
+void cmdusage(void);
+void badusage(void);
+void cmdinfo(void);
+int addopt(char *optstr, int maxlen, char *s);
+
+/******************************************************************************\
+* Global data.
+\******************************************************************************/
+
+char *cmdname = "";
+
+/******************************************************************************\
+* Code.
+\******************************************************************************/
+
+int main(int argc, char **argv)
+{
+       jas_image_t *image;
+       cmdopts_t *cmdopts;
+       jas_stream_t *in;
+       jas_stream_t *out;
+       jas_tmr_t dectmr;
+       jas_tmr_t enctmr;
+       double dectime;
+       double enctime;
+       int_fast16_t numcmpts;
+       int i;
+
+       /* Determine the base name of this command. */
+       if ((cmdname = strrchr(argv[0], '/'))) {
+               ++cmdname;
+       } else {
+               cmdname = argv[0];
+       }
+
+       if (jas_init()) {
+               abort();
+       }
+
+       /* Parse the command line options. */
+       if (!(cmdopts = cmdopts_parse(argc, argv))) {
+               fprintf(stderr, "error: cannot parse command line\n");
+               exit(EXIT_FAILURE);
+       }
+
+       if (cmdopts->version) {
+               printf("%s\n", JAS_VERSION);
+               fprintf(stderr, "libjasper %s\n", jas_getversion());
+               exit(EXIT_SUCCESS);
+       }
+
+       jas_setdbglevel(cmdopts->debug);
+
+       if (cmdopts->verbose) {
+               cmdinfo();
+       }
+
+       /* Open the input image file. */
+       if (cmdopts->infile) {
+               /* The input image is to be read from a file. */
+               if (!(in = jas_stream_fopen(cmdopts->infile, "rb"))) {
+                       fprintf(stderr, "error: cannot open input image file %s\n",
+                         cmdopts->infile);
+                       exit(EXIT_FAILURE);
+               }
+       } else {
+               /* The input image is to be read from standard input. */
+               if (!(in = jas_stream_fdopen(0, "rb"))) {
+                       fprintf(stderr, "error: cannot open standard input\n");
+                       exit(EXIT_FAILURE);
+               }
+       }
+
+       /* Open the output image file. */
+       if (cmdopts->outfile) {
+               /* The output image is to be written to a file. */
+               if (!(out = jas_stream_fopen(cmdopts->outfile, "w+b"))) {
+                       fprintf(stderr, "error: cannot open output image file %s\n",
+                         cmdopts->outfile);
+                       exit(EXIT_FAILURE);
+               }
+       } else {
+               /* The output image is to be written to standard output. */
+               if (!(out = jas_stream_fdopen(1, "w+b"))) {
+                       fprintf(stderr, "error: cannot open standard output\n");
+                       exit(EXIT_FAILURE);
+               }
+       }
+
+       if (cmdopts->infmt < 0) {
+               if ((cmdopts->infmt = jas_image_getfmt(in)) < 0) {
+                       fprintf(stderr, "error: input image has unknown format\n");
+                       exit(EXIT_FAILURE);
+               }
+       }
+
+       /* Get the input image data. */
+       jas_tmr_start(&dectmr);
+       if (!(image = jas_image_decode(in, cmdopts->infmt, cmdopts->inopts))) {
+               fprintf(stderr, "error: cannot load image data\n");
+               exit(EXIT_FAILURE);
+       }
+       jas_tmr_stop(&dectmr);
+       dectime = jas_tmr_get(&dectmr);
+
+       /* If requested, throw away all of the components except one.
+         Why might this be desirable?  It is a hack, really.
+         None of the image formats other than the JPEG-2000 ones support
+         images with two, four, five, or more components.  This hack
+         allows such images to be decoded with the non-JPEG-2000 decoders,
+         one component at a time. */
+       numcmpts = jas_image_numcmpts(image);
+       if (cmdopts->cmptno >= 0 && cmdopts->cmptno < numcmpts) {
+               for (i = numcmpts - 1; i >= 0; --i) {
+                       if (i != cmdopts->cmptno) {
+                               jas_image_delcmpt(image, i);
+                       }
+               }
+       }
+
+       if (cmdopts->srgb) {
+               jas_image_t *newimage;
+               jas_cmprof_t *outprof;
+               jas_eprintf("forcing conversion to sRGB\n");
+               if (!(outprof = jas_cmprof_createfromclrspc(JAS_CLRSPC_SRGB))) {
+                       jas_eprintf("cannot create sRGB profile\n");
+                       exit(EXIT_FAILURE);
+               }
+               if (!(newimage = jas_image_chclrspc(image, outprof, JAS_CMXFORM_INTENT_PER))) {
+                       jas_eprintf("cannot convert to sRGB\n");
+                       exit(EXIT_FAILURE);
+               }
+               jas_image_destroy(image);
+               jas_cmprof_destroy(outprof);
+               image = newimage;
+       }
+
+       /* Generate the output image data. */
+       jas_tmr_start(&enctmr);
+       if (jas_image_encode(image, out, cmdopts->outfmt, cmdopts->outopts)) {
+               fprintf(stderr, "error: cannot encode image\n");
+               exit(EXIT_FAILURE);
+       }
+       jas_stream_flush(out);
+       jas_tmr_stop(&enctmr);
+       enctime = jas_tmr_get(&enctmr);
+
+       if (cmdopts->verbose) {
+               fprintf(stderr, "decoding time = %f\n", dectime);
+               fprintf(stderr, "encoding time = %f\n", enctime);
+       }
+
+       /* If this fails, we don't care. */
+       (void) jas_stream_close(in);
+
+       /* Close the output image stream. */
+       if (jas_stream_close(out)) {
+               fprintf(stderr, "error: cannot close output image file\n");
+               exit(EXIT_FAILURE);
+       }
+
+       cmdopts_destroy(cmdopts);
+       jas_image_destroy(image);
+       jas_image_clearfmts();
+
+       /* Success at last! :-) */
+       return EXIT_SUCCESS;
+}
+
+cmdopts_t *cmdopts_parse(int argc, char **argv)
+{
+
+       typedef enum {
+               CMDOPT_HELP = 0,
+               CMDOPT_VERBOSE,
+               CMDOPT_INFILE,
+               CMDOPT_INFMT,
+               CMDOPT_INOPT,
+               CMDOPT_OUTFILE,
+               CMDOPT_OUTFMT,
+               CMDOPT_OUTOPT,
+               CMDOPT_VERSION,
+               CMDOPT_DEBUG,
+               CMDOPT_CMPTNO,
+               CMDOPT_SRGB
+       } cmdoptid_t;
+
+       static jas_opt_t cmdoptions[] = {
+               {CMDOPT_HELP, "help", 0},
+               {CMDOPT_VERBOSE, "verbose", 0},
+               {CMDOPT_INFILE, "input", JAS_OPT_HASARG},
+               {CMDOPT_INFILE, "f", JAS_OPT_HASARG},
+               {CMDOPT_INFMT, "input-format", JAS_OPT_HASARG},
+               {CMDOPT_INFMT, "t", JAS_OPT_HASARG},
+               {CMDOPT_INOPT, "input-option", JAS_OPT_HASARG},
+               {CMDOPT_INOPT, "o", JAS_OPT_HASARG},
+               {CMDOPT_OUTFILE, "output", JAS_OPT_HASARG},
+               {CMDOPT_OUTFILE, "F", JAS_OPT_HASARG},
+               {CMDOPT_OUTFMT, "output-format", JAS_OPT_HASARG},
+               {CMDOPT_OUTFMT, "T", JAS_OPT_HASARG},
+               {CMDOPT_OUTOPT, "output-option", JAS_OPT_HASARG},
+               {CMDOPT_OUTOPT, "O", JAS_OPT_HASARG},
+               {CMDOPT_VERSION, "version", 0},
+               {CMDOPT_DEBUG, "debug-level", JAS_OPT_HASARG},
+               {CMDOPT_CMPTNO, "cmptno", JAS_OPT_HASARG},
+               {CMDOPT_SRGB, "force-srgb", 0},
+               {CMDOPT_SRGB, "S", 0},
+               {-1, 0, 0}
+       };
+
+       cmdopts_t *cmdopts;
+       int c;
+
+       if (!(cmdopts = malloc(sizeof(cmdopts_t)))) {
+               fprintf(stderr, "error: insufficient memory\n");
+               exit(EXIT_FAILURE);
+       }
+
+       cmdopts->infile = 0;
+       cmdopts->infmt = -1;
+       cmdopts->inopts = 0;
+       cmdopts->inoptsbuf[0] = '\0';
+       cmdopts->outfile = 0;
+       cmdopts->outfmt = -1;
+       cmdopts->outopts = 0;
+       cmdopts->outoptsbuf[0] = '\0';
+       cmdopts->verbose = 0;
+       cmdopts->version = 0;
+       cmdopts->cmptno = -1;
+       cmdopts->debug = 0;
+       cmdopts->srgb = 0;
+
+       while ((c = jas_getopt(argc, argv, cmdoptions)) != EOF) {
+               switch (c) {
+               case CMDOPT_HELP:
+                       cmdusage();
+                       break;
+               case CMDOPT_VERBOSE:
+                       cmdopts->verbose = 1;
+                       break;
+               case CMDOPT_VERSION:
+                       cmdopts->version = 1;
+                       break;
+               case CMDOPT_DEBUG:
+                       cmdopts->debug = atoi(jas_optarg);
+                       break;
+               case CMDOPT_INFILE:
+                       cmdopts->infile = jas_optarg;
+                       break;
+               case CMDOPT_INFMT:
+                       if ((cmdopts->infmt = jas_image_strtofmt(jas_optarg)) < 0) {
+                               fprintf(stderr, "warning: ignoring invalid input format %s\n",
+                                 jas_optarg);
+                               cmdopts->infmt = -1;
+                       }
+                       break;
+               case CMDOPT_INOPT:
+                       addopt(cmdopts->inoptsbuf, OPTSMAX, jas_optarg);
+                       cmdopts->inopts = cmdopts->inoptsbuf;
+                       break;
+               case CMDOPT_OUTFILE:
+                       cmdopts->outfile = jas_optarg;
+                       break;
+               case CMDOPT_OUTFMT:
+                       if ((cmdopts->outfmt = jas_image_strtofmt(jas_optarg)) < 0) {
+                               fprintf(stderr, "error: invalid output format %s\n", jas_optarg);
+                               badusage();
+                       }
+                       break;
+               case CMDOPT_OUTOPT:
+                       addopt(cmdopts->outoptsbuf, OPTSMAX, jas_optarg);
+                       cmdopts->outopts = cmdopts->outoptsbuf;
+                       break;
+               case CMDOPT_CMPTNO:
+                       cmdopts->cmptno = atoi(jas_optarg);
+                       break;
+               case CMDOPT_SRGB:
+                       cmdopts->srgb = 1;
+                       break;
+               default:
+                       badusage();
+                       break;
+               }
+       }
+
+       while (jas_optind < argc) {
+               fprintf(stderr,
+                 "warning: ignoring bogus command line argument %s\n",
+                 argv[jas_optind]);
+               ++jas_optind;
+       }
+
+       if (cmdopts->version) {
+               goto done;
+       }
+
+       if (cmdopts->outfmt < 0 && cmdopts->outfile) {
+               if ((cmdopts->outfmt = jas_image_fmtfromname(cmdopts->outfile)) < 0) {
+                       fprintf(stderr,
+                         "error: cannot guess image format from output file name\n");
+               }
+       }
+
+       if (cmdopts->outfmt < 0) {
+               fprintf(stderr, "error: no output format specified\n");
+               badusage();
+       }
+
+done:
+       return cmdopts;
+}
+
+void cmdopts_destroy(cmdopts_t *cmdopts)
+{
+       free(cmdopts);
+}
+
+int addopt(char *optstr, int maxlen, char *s)
+{
+       int n;
+       int m;
+
+       n = strlen(optstr);
+       m = n + strlen(s) + 1;
+       if (m > maxlen) {
+               return 1;
+       }
+       if (n > 0) {
+               strcat(optstr, "\n");
+       }
+       strcat(optstr, s);
+       return 0;
+}
+
+void cmdinfo()
+{
+       fprintf(stderr, "JasPer Transcoder (Version %s).\n",
+         JAS_VERSION);
+       fprintf(stderr, "%s\n", JAS_COPYRIGHT);
+       fprintf(stderr, "%s\n", JAS_NOTES);
+}
+
+static char *helpinfo[] = {
+"The following options are supported:\n",
+"    --help                  Print this help information and exit.\n",
+"    --version               Print version information and exit.\n",
+"    --verbose               Enable verbose mode.\n",
+"    --debug-level $lev      Set the debug level to $lev.\n",
+"    --input $file           Read the input image from the file named $file\n",
+"                            instead of standard input.\n",
+"    --input-format $fmt     Specify the format of the input image as $fmt.\n",
+"                            (See below for the list of supported formats.)\n",
+"    --input-option $opt     Provide the option $opt to the decoder.\n",
+"    --output $file          Write the output image to the file named $file\n",
+"                            instead of standard output.\n",
+"    --output-format $fmt    Specify the format of the output image as $fmt.\n",
+"                            (See below for the list of supported formats.)\n",
+"    --output-option $opt    Provide the option $opt to the encoder.\n",
+"    --force-srgb            Force conversion to the sRGB color space.\n",
+"Some of the above option names can be abbreviated as follows:\n",
+"    --input = -f, --input-format = -t, --input-option = -o,\n",
+"    --output = -F, --output-format = -T, --output-option = -O\n",
+0
+};
+
+void cmdusage()
+{
+       int fmtid;
+       jas_image_fmtinfo_t *fmtinfo;
+       char *s;
+       int i;
+       cmdinfo();
+       fprintf(stderr, "usage: %s [options]\n", cmdname);
+       for (i = 0, s = helpinfo[i]; s; ++i, s = helpinfo[i]) {
+               fprintf(stderr, "%s", s);
+       }
+       fprintf(stderr, "The following formats are supported:\n");
+       for (fmtid = 0;; ++fmtid) {
+               if (!(fmtinfo = jas_image_lookupfmtbyid(fmtid))) {
+                       break;
+               }
+               fprintf(stderr, "    %-5s    %s\n", fmtinfo->name,
+                 fmtinfo->desc);
+       }
+       exit(EXIT_FAILURE);
+}
+
+void badusage()
+{
+       fprintf(stderr,
+         "For more information on how to use this command, type:\n");
+       fprintf(stderr, "    %s --help\n", cmdname);
+       exit(EXIT_FAILURE);
+}
+
+#if 0
+jas_image_t *converttosrgb(jas_image_t *inimage)
+{
+       jas_image_t *outimage;
+       jas_cmpixmap_t inpixmap;
+       jas_cmpixmap_t outpixmap;
+       jas_cmcmptfmt_t incmptfmts[16];
+       jas_cmcmptfmt_t outcmptfmts[16];
+
+       outprof = jas_cmprof_createfromclrspc(JAS_CLRSPC_SRGB);
+       assert(outprof);
+       xform = jas_cmxform_create(jas_image_cmprof(inimage), outprof, 0, JAS_CMXFORM_FWD, JAS_CMXFORM_INTENT_PER, 0);
+       assert(xform);
+
+       inpixmap.numcmpts = jas_image_numcmpts(oldimage);
+       outpixmap.numcmpts = 3;
+       for (i = 0; i < inpixmap.numcmpts; ++i) {
+               inpixmap.cmptfmts[i] = &incmptfmts[i];
+       }
+       for (i = 0; i < outpixmap.numcmpts; ++i)
+               outpixmap.cmptfmts[i] = &outcmptfmts[i];
+       if (jas_cmxform_apply(xform, &inpixmap, &outpixmap))
+               abort();
+
+       jas_xform_destroy(xform);
+       jas_cmprof_destroy(outprof);
+       return 0;
+}
+#endif
diff --git a/src/appl/jiv.1 b/src/appl/jiv.1
new file mode 100644 (file)
index 0000000..2c067f5
--- /dev/null
@@ -0,0 +1,24 @@
+.TH jiv 1 "20 June 2004" "Version 1.701.0" "JasPer Manual"
+
+.SH NAME
+jiv \- Image display utility
+
+.SH SYNOPSIS
+.B jiv
+.RI [ options ]
+.RI [ file ... ]
+
+.SH DESCRIPTION
+The
+.B jiv
+command displays a JPEG-2000 image on an X display. Use the arrow keys for
+scrolling and < and > for zooming.  Please use the \-\-help command line switch
+and the JasPer Software Reference Manual for more information.
+
+.SH SEE ALSO
+.IR jasper (1)
+
+.SH AUTHOR
+Michael D. Adams <mdadams@ieee.org>
+This manpage was initially written by Roland Stigge <stigge@antcom.de> for
+the Debian Project.
diff --git a/src/appl/jiv.c b/src/appl/jiv.c
new file mode 100644 (file)
index 0000000..a88f4d4
--- /dev/null
@@ -0,0 +1,1086 @@
+/*
+ * Copyright (c) 2002-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/******************************************************************************\
+* Includes
+\******************************************************************************/
+
+#include <jasper/jasper.h>
+#include <GL/glut.h>
+#include <stdlib.h>
+#include <math.h>
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+#define MAXCMPTS       256
+#define BIGPANAMOUNT   0.90
+#define SMALLPANAMOUNT 0.05
+#define        BIGZOOMAMOUNT   2.0
+#define        SMALLZOOMAMOUNT 1.41421356237310
+
+#define        min(x, y)       (((x) < (y)) ? (x) : (y))
+#define        max(x, y)       (((x) > (y)) ? (x) : (y))
+
+typedef struct {
+
+       /* The number of image files to view. */
+       int numfiles;
+
+       /* The names of the image files. */
+       char **filenames;
+
+       /* The title for the window. */
+       char *title;
+
+       /* The time to wait before advancing to the next image (in ms). */
+       int tmout;
+
+       /* Loop indefinitely over all images. */
+       int loop;
+
+       int verbose;
+
+} cmdopts_t;
+
+typedef struct {
+
+       int width;
+
+       int height;
+
+       GLshort *data;
+
+} pixmap_t;
+
+typedef struct {
+
+       /* The index of the current image file. */
+       int filenum;
+
+       /* The image. */
+       jas_image_t *image;
+       jas_image_t *altimage;
+
+       float botleftx;
+       float botlefty;
+       float toprightx;
+       float toprighty;
+
+       int viewportwidth;
+       int viewportheight;
+
+       /* The image for display. */
+       pixmap_t vp;
+
+       /* The active timer ID. */
+       int activetmid;
+
+       /* The next available timer ID. */
+       int nexttmid;
+
+       int monomode;
+
+       int cmptno;
+
+} gs_t;
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+static void displayfunc(void);
+static void reshapefunc(int w, int h);
+static void keyboardfunc(unsigned char key, int x, int y);
+static void specialfunc(int key, int x, int y);
+static void timerfunc(int value);
+
+static void usage(void);
+static void nextimage(void);
+static void previmage(void);
+static void nextcmpt(void);
+static void prevcmpt(void);
+static int loadimage(void);
+static void unloadimage(void);
+static int jas_image_render2(jas_image_t *image, int cmptno, float vtlx, float vtly,
+  float vsx, float vsy, int vw, int vh, GLshort *vdata);
+static int jas_image_render(jas_image_t *image, float vtlx, float vtly,
+  float vsx, float vsy, int vw, int vh, GLshort *vdata);
+
+static void dumpstate(void);
+static int pixmap_resize(pixmap_t *p, int w, int h);
+static void pixmap_clear(pixmap_t *p);
+static void cmdinfo(void);
+
+static void cleanupandexit(int);
+static void init(void);
+
+static void zoom(float sx, float sy);
+static void pan(float dx, float dy);
+static void panzoom(float dx, float dy, float sx, float sy);
+static void render(void);
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+jas_opt_t opts[] = {
+       {'V', "version", 0},
+       {'v', "v", 0},
+       {'h', "help", 0},
+       {'w', "wait", JAS_OPT_HASARG},
+       {'l', "loop", 0},
+       {'t', "title", JAS_OPT_HASARG},
+       {-1, 0, 0}
+};
+
+char *cmdname = 0;
+cmdopts_t cmdopts;
+gs_t gs;
+jas_stream_t *streamin = 0;
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+int main(int argc, char **argv)
+{
+       int c;
+
+       init();
+
+       /* Determine the base name of this command. */
+       if ((cmdname = strrchr(argv[0], '/'))) {
+               ++cmdname;
+       } else {
+               cmdname = argv[0];
+       }
+
+       /* Initialize the JasPer library. */
+       if (jas_init()) {
+               abort();
+       }
+
+       glutInit(&argc, argv);
+       glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE);
+       glutCreateWindow(cmdname);
+       glutReshapeFunc(reshapefunc);
+       glutDisplayFunc(displayfunc);
+       glutSpecialFunc(specialfunc);
+       glutKeyboardFunc(keyboardfunc);
+
+       cmdopts.numfiles = 0;
+       cmdopts.filenames = 0;
+       cmdopts.title = 0;
+       cmdopts.tmout = 0;
+       cmdopts.loop = 0;
+       cmdopts.verbose = 0;
+
+       while ((c = jas_getopt(argc, argv, opts)) != EOF) {
+               switch (c) {
+               case 'w':
+                       cmdopts.tmout = atof(jas_optarg) * 1000;
+                       break;
+               case 'l':
+                       cmdopts.loop = 1;
+                       break;
+               case 't':
+                       cmdopts.title = jas_optarg;
+                       break;
+               case 'v':
+                       cmdopts.verbose = 1;
+                       break;
+               case 'V':
+                       printf("%s\n", JAS_VERSION);
+                       fprintf(stderr, "libjasper %s\n", jas_getversion());
+                       cleanupandexit(EXIT_SUCCESS);
+                       break;
+               default:
+               case 'h':
+                       usage();
+                       break;
+               }
+       }
+
+       if (jas_optind < argc) {
+               /* The images are to be read from one or more explicitly named
+                 files. */
+               cmdopts.numfiles = argc - jas_optind;
+               cmdopts.filenames = &argv[jas_optind];
+       } else {
+               /* The images are to be read from standard input. */
+               static char *null = 0;
+               cmdopts.filenames = &null;
+               cmdopts.numfiles = 1;
+       }
+
+       streamin = jas_stream_fdopen(0, "rb");
+
+       /* Load the next image. */
+       nextimage();
+
+       /* Start the GLUT main event handler loop. */
+       glutMainLoop();
+
+       return EXIT_SUCCESS;
+}
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+static void cmdinfo()
+{
+       fprintf(stderr, "JasPer Image Viewer (Version %s).\n",
+         JAS_VERSION);
+       fprintf(stderr, "Copyright (c) 2002-2003 Michael David Adams.\n"
+         "All rights reserved.\n");
+       fprintf(stderr, "%s\n", JAS_NOTES);
+}
+
+static char *helpinfo[] = {
+"The following options are supported:\n",
+"    --help                  Print this help information and exit.\n",
+"    --version               Print version information and exit.\n",
+"    --loop                  Loop indefinitely through images.\n",
+"    --wait N                Advance to next image after N seconds.\n",
+0
+};
+
+static void usage()
+{
+       char *s;
+       int i;
+       cmdinfo();
+       fprintf(stderr, "usage: %s [options] [file1 file2 ...]\n", cmdname);
+       for (i = 0, s = helpinfo[i]; s; ++i, s = helpinfo[i]) {
+               fprintf(stderr, "%s", s);
+       }
+       cleanupandexit(EXIT_FAILURE);
+}
+
+/******************************************************************************\
+* GLUT Callback Functions
+\******************************************************************************/
+
+/* Display callback function. */
+
+static void displayfunc()
+{
+
+       float w;
+       float h;
+       int regbotleftx;
+       int regbotlefty;
+       int regtoprightx;
+       int regtoprighty;
+       int regtoprightwidth;
+       int regtoprightheight;
+       int regwidth;
+       int regheight;
+       float x;
+       float y;
+       float xx;
+       float yy;
+
+       if (cmdopts.verbose) {
+               fprintf(stderr, "displayfunc()\n");
+       }
+
+       regbotleftx = max(ceil(gs.botleftx), 0);
+       regbotlefty = max(ceil(gs.botlefty), 0);
+       regtoprightx = min(gs.vp.width, floor(gs.toprightx));
+       regtoprighty = min(gs.vp.height, floor(gs.toprighty));
+       regwidth = regtoprightx - regbotleftx;
+       regheight = regtoprighty - regbotlefty;
+       w = gs.toprightx - gs.botleftx;
+       h = gs.toprighty - gs.botlefty;
+       x = (regbotleftx - gs.botleftx) / w;
+       y = (regbotlefty - gs.botlefty) / h;
+       xx = (regtoprightx - gs.botleftx) / w;
+       yy = (regtoprighty - gs.botlefty) / h;
+
+       assert(regwidth > 0);
+       assert(regheight > 0);
+       assert(abs(((double) regheight / regwidth) - ((double) gs.viewportheight / gs.viewportwidth)) < 1e-5);
+
+       glClear(GL_COLOR_BUFFER_BIT);
+       glPixelStorei(GL_UNPACK_ALIGNMENT, sizeof(GLshort));
+       glPixelStorei(GL_UNPACK_ROW_LENGTH, gs.vp.width);
+       glPixelStorei(GL_UNPACK_SKIP_PIXELS, regbotleftx);
+       glPixelStorei(GL_UNPACK_SKIP_ROWS, regbotlefty);
+       glRasterPos2f(x * gs.viewportwidth, y * gs.viewportheight);
+       glPixelZoom((xx - x) * ((double) gs.viewportwidth) / regwidth, (yy - y) * ((double) gs.viewportheight) / regheight);
+       glDrawPixels(regwidth, regheight, GL_RGBA, GL_UNSIGNED_SHORT,
+         gs.vp.data);
+       glFlush();
+       glutSwapBuffers();
+
+}
+
+/* Reshape callback function. */
+
+static void reshapefunc(int w, int h)
+{
+       if (cmdopts.verbose) {
+               fprintf(stderr, "reshapefunc(%d, %d)\n", w, h);
+               dumpstate();
+       }
+
+       glViewport(0, 0, w, h);
+       glMatrixMode(GL_PROJECTION);
+       glLoadIdentity();
+       gluOrtho2D(0, w, 0, h);
+       glMatrixMode(GL_MODELVIEW);
+       glLoadIdentity();
+       glTranslatef(0, 0, 0);
+       glRasterPos2i(0, 0);
+
+       zoom((double) gs.viewportwidth / w, (double) gs.viewportheight / h);
+       gs.viewportwidth = w;
+       gs.viewportheight = h;
+
+}
+
+/* Keyboard callback function. */
+
+static void keyboardfunc(unsigned char key, int x, int y)
+{
+       if (cmdopts.verbose) {
+               fprintf(stderr, "keyboardfunc(%d, %d, %d)\n", key, x, y);
+       }
+
+       switch (key) {
+       case ' ':
+               nextimage();
+               break;
+       case '\b':
+               previmage();
+               break;
+       case '>':
+               zoom(BIGZOOMAMOUNT, BIGZOOMAMOUNT);
+               glutPostRedisplay();
+               break;
+       case '.':
+               zoom(SMALLZOOMAMOUNT, SMALLZOOMAMOUNT);
+               glutPostRedisplay();
+               break;
+       case '<':
+               zoom(1.0 / BIGZOOMAMOUNT, 1.0 / BIGZOOMAMOUNT);
+               glutPostRedisplay();
+               break;
+       case ',':
+               zoom(1.0 / SMALLZOOMAMOUNT, 1.0 / SMALLZOOMAMOUNT);
+               glutPostRedisplay();
+               break;
+       case 'c':
+               nextcmpt();
+               break;
+       case 'C':
+               prevcmpt();
+               break;
+       case 'h':
+               fprintf(stderr, "h             help\n");
+               fprintf(stderr, ">             zoom in (large)\n");
+               fprintf(stderr, ",             zoom in (small)\n");
+               fprintf(stderr, "<             zoom out (large)\n");
+               fprintf(stderr, ".             zoom out (small)\n");
+               fprintf(stderr, "down arrow    pan down\n");
+               fprintf(stderr, "up arrow      pan up\n");
+               fprintf(stderr, "left arrow    pan left\n");
+               fprintf(stderr, "right arrow   pan right\n");
+               fprintf(stderr, "space         next image\n");
+               fprintf(stderr, "backspace     previous image\n");
+               fprintf(stderr, "q             quit\n");
+               break;
+       case 'q':
+               cleanupandexit(EXIT_SUCCESS);
+               break;
+       }
+}
+
+/* Special keyboard callback function. */
+
+static void specialfunc(int key, int x, int y)
+{
+       if (cmdopts.verbose) {
+               fprintf(stderr, "specialfunc(%d, %d, %d)\n", key, x, y);
+       }
+
+       switch (key) {
+       case GLUT_KEY_UP:
+               {
+                       float panamount;
+                       panamount = (glutGetModifiers() & GLUT_ACTIVE_SHIFT) ?
+                         BIGPANAMOUNT : SMALLPANAMOUNT;
+                       pan(0.0, panamount * (gs.toprighty - gs.botlefty));
+                       glutPostRedisplay();
+               }
+               break;
+       case GLUT_KEY_DOWN:
+               {
+                       float panamount;
+                       panamount = (glutGetModifiers() & GLUT_ACTIVE_SHIFT) ?
+                         BIGPANAMOUNT : SMALLPANAMOUNT;
+                       pan(0.0, -panamount * (gs.toprighty - gs.botlefty));
+                       glutPostRedisplay();
+               }
+               break;
+       case GLUT_KEY_LEFT:
+               {
+                       float panamount;
+                       panamount = (glutGetModifiers() & GLUT_ACTIVE_SHIFT) ?
+                         BIGPANAMOUNT : SMALLPANAMOUNT;
+                       pan(-panamount * (gs.toprightx - gs.botleftx), 0.0);
+                       glutPostRedisplay();
+               }
+               break;
+       case GLUT_KEY_RIGHT:
+               {
+                       float panamount;
+                       panamount = (glutGetModifiers() & GLUT_ACTIVE_SHIFT) ?
+                         BIGPANAMOUNT : SMALLPANAMOUNT;
+                       pan(panamount * (gs.toprightx - gs.botleftx), 0.0);
+                       glutPostRedisplay();
+               }
+               break;
+       default:
+               break;
+       }
+}
+
+/* Timer callback function. */
+
+static void timerfunc(int value)
+{
+       if (cmdopts.verbose) {
+               fprintf(stderr, "timerfunc(%d)\n", value);
+       }
+       if (value == gs.activetmid) {
+               nextimage();
+       }
+}
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+static void zoom(float sx, float sy)
+{
+       panzoom(0, 0, sx, sy);
+}
+
+static void pan(float dx, float dy)
+{
+       panzoom(dx, dy, 1.0, 1.0);
+}
+
+static void panzoom(float dx, float dy, float sx, float sy)
+{
+       float w;
+       float h;
+       float cx;
+       float cy;
+       int reginh;
+       int reginv;
+
+       reginh = (gs.botleftx >= 0 && gs.toprightx <= gs.vp.width);
+       reginv = (gs.botlefty >= 0 && gs.toprighty <= gs.vp.height);
+
+       if (cmdopts.verbose) {
+               fprintf(stderr, "start of panzoom\n");
+               dumpstate();
+               fprintf(stderr, "reginh=%d reginv=%d\n", reginh, reginv);
+       }
+
+       if (dx || dy) {
+               gs.botleftx += dx;
+               gs.botlefty += dy;
+               gs.toprightx += dx;
+               gs.toprighty += dy;
+       }
+
+       if (sx != 1.0 || sy != 1.0) {
+               cx = (gs.botleftx + gs.toprightx) / 2.0;
+               cy = (gs.botlefty + gs.toprighty) / 2.0;
+               w = gs.toprightx - gs.botleftx;
+               h = gs.toprighty - gs.botlefty;
+               gs.botleftx = cx - 0.5 * w / sx;
+               gs.botlefty = cy - 0.5 * h / sy;
+               gs.toprightx = cx + 0.5 * w / sx;
+               gs.toprighty = cy + 0.5 * h / sy;
+       }
+
+       if (reginh) {
+               if (gs.botleftx < 0) {
+                       dx = -gs.botleftx;
+                       gs.botleftx += dx;
+                       gs.toprightx += dx;
+               } else if (gs.toprightx > gs.vp.width) {
+                       dx = gs.vp.width - gs.toprightx;
+                       gs.botleftx += dx;
+                       gs.toprightx += dx;
+               }
+       }
+       if (gs.botleftx < 0 || gs.toprightx > gs.vp.width) {
+               float w;
+               w = gs.toprightx - gs.botleftx;
+               gs.botleftx = 0.5 * gs.vp.width - 0.5 * w;
+               gs.toprightx = 0.5 * gs.vp.width + 0.5 * w;
+       }
+
+       if (reginv) {
+               if (gs.botlefty < 0) {
+                       dy = -gs.botlefty;
+                       gs.botlefty += dy;
+                       gs.toprighty += dy;
+               } else if (gs.toprighty > gs.vp.height) {
+                       dy = gs.vp.height - gs.toprighty;
+                       gs.botlefty += dy;
+                       gs.toprighty += dy;
+               }
+       }
+       if (gs.botlefty < 0 || gs.toprighty > gs.vp.height) {
+               float h;
+               h = gs.toprighty - gs.botlefty;
+               gs.botlefty = 0.5 * gs.vp.height - 0.5 * h;
+               gs.toprighty = 0.5 * gs.vp.height + 0.5 * h;
+       }
+
+       if (cmdopts.verbose) {
+               fprintf(stderr, "end of panzoom\n");
+               dumpstate();
+       }
+}
+
+static void nextcmpt()
+{
+       if (gs.monomode) {
+               if (gs.cmptno == jas_image_numcmpts(gs.image) - 1) {
+                       if (gs.altimage) {
+                               gs.monomode = 0;
+                       } else {
+                               gs.cmptno = 0;
+                       }
+               } else {
+                       ++gs.cmptno;
+               }
+       } else {
+               gs.monomode = 1;
+               gs.cmptno = 0;
+       }
+       render();
+       glutPostRedisplay();
+}
+
+static void prevcmpt()
+{
+       if (gs.monomode) {
+               if (!gs.cmptno) {
+                       gs.monomode = 0;
+               } else {
+                       --gs.cmptno;
+               }
+       } else {
+               gs.monomode = 1;
+               gs.cmptno = jas_image_numcmpts(gs.image) - 1;
+       }
+       render();
+       glutPostRedisplay();
+}
+
+static void nextimage()
+{
+       int n;
+       unloadimage();
+       for (n = cmdopts.numfiles; n > 0; --n) {
+               ++gs.filenum;
+               if (gs.filenum >= cmdopts.numfiles) {
+                       if (cmdopts.loop) {
+                               gs.filenum = 0;
+                       } else {
+                               cleanupandexit(EXIT_SUCCESS);
+                       }
+               }
+               if (!loadimage()) {
+                       return;
+               }
+               fprintf(stderr, "cannot load image\n");
+       }
+       cleanupandexit(EXIT_SUCCESS);
+}
+
+static void previmage()
+{
+       int n;
+       unloadimage();
+       for (n = cmdopts.numfiles; n > 0; --n) {
+               --gs.filenum;
+               if (gs.filenum < 0) {
+                       if (cmdopts.loop) {
+                               gs.filenum = cmdopts.numfiles - 1;
+                       } else {
+                               cleanupandexit(EXIT_SUCCESS);
+                       }
+               }
+               if (!loadimage()) {
+                       return;
+               }
+       }
+       cleanupandexit(EXIT_SUCCESS);
+}
+
+static int loadimage()
+{
+       int reshapeflag;
+       jas_stream_t *in;
+       int scrnwidth;
+       int scrnheight;
+       int vh;
+       int vw;
+       char *pathname;
+       jas_cmprof_t *outprof;
+
+       assert(!gs.image);
+       assert(!gs.altimage);
+
+       gs.image = 0;
+       gs.altimage = 0;
+
+       pathname = cmdopts.filenames[gs.filenum];
+
+       if (pathname && pathname[0] != '\0') {
+               if (cmdopts.verbose) {
+                       fprintf(stderr, "opening file %s\n", pathname);
+               }
+               /* The input image is to be read from a file. */
+               if (!(in = jas_stream_fopen(pathname, "rb"))) {
+                       fprintf(stderr, "error: cannot open file %s\n", pathname);
+                       goto error;
+               }
+       } else {
+               /* The input image is to be read from standard input. */
+               in = streamin;
+       }
+
+       if (cmdopts.verbose) {
+               fprintf(stderr, "decoding image\n");
+       }
+
+       /* Get the input image data. */
+       if (!(gs.image = jas_image_decode(in, -1, 0))) {
+               fprintf(stderr, "error: cannot load image data\n");
+               goto error;
+       }
+
+       /* Close the input stream. */
+       if (in != streamin) {
+               jas_stream_close(in);
+       }
+
+       if (cmdopts.verbose) {
+               fprintf(stderr, "creating color profile\n");
+       }
+
+       if (!(outprof = jas_cmprof_createfromclrspc(JAS_CLRSPC_SRGB)))
+               goto error;
+       if (!(gs.altimage = jas_image_chclrspc(gs.image, outprof, JAS_CMXFORM_INTENT_PER)))
+               goto error;
+
+       vw = jas_image_width(gs.image);
+       vh = jas_image_height(gs.image);
+
+       gs.botleftx = jas_image_tlx(gs.image);
+       gs.botlefty = jas_image_tly(gs.image);
+       gs.toprightx = jas_image_brx(gs.image);
+       gs.toprighty = jas_image_bry(gs.image);
+       if (gs.altimage) {
+               gs.monomode = 0;
+       } else {
+               gs.monomode = 1;
+               gs.cmptno = 0;
+       }
+
+
+       if (cmdopts.verbose) {
+               fprintf(stderr, "num of components %d\n", jas_image_numcmpts(gs.image));
+               fprintf(stderr, "dimensions %d %d\n", jas_image_width(gs.image), jas_image_height(gs.image));
+       }
+
+       gs.viewportwidth = vw;
+       gs.viewportheight = vh;
+       pixmap_resize(&gs.vp, vw, vh);
+       if (cmdopts.verbose) {
+               fprintf(stderr, "preparing image for viewing\n");
+       }
+       render();
+       if (cmdopts.verbose) {
+               fprintf(stderr, "done preparing image for viewing\n");
+       }
+
+       if (vw != glutGet(GLUT_WINDOW_WIDTH) ||
+         vh != glutGet(GLUT_WINDOW_HEIGHT)) {
+               glutReshapeWindow(vw, vh);
+       }
+       if (cmdopts.title) {
+               glutSetWindowTitle(cmdopts.title);
+       } else {
+               glutSetWindowTitle((pathname && pathname[0] != '\0') ? pathname :
+                 "stdin");
+       }
+       /* If we reshaped the window, GLUT will automatically invoke both
+         the reshape and display callback (in this order).  Therefore, we
+         only need to explicitly force the display callback to be invoked
+         if the window was not reshaped. */
+       glutPostRedisplay();
+
+       if (cmdopts.tmout != 0) {
+               glutTimerFunc(cmdopts.tmout, timerfunc, gs.nexttmid);
+               gs.activetmid = gs.nexttmid;
+               ++gs.nexttmid;
+       }
+
+       return 0;
+
+error:
+       unloadimage();
+       return -1;
+}
+
+static void unloadimage()
+{
+       if (gs.image) {
+               jas_image_destroy(gs.image);
+               gs.image = 0;
+       }
+       if (gs.altimage) {
+               jas_image_destroy(gs.altimage);
+               gs.altimage = 0;
+       }
+}
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+static void pixmap_clear(pixmap_t *p)
+{
+       memset(p->data, 0, 4 * p->width * p->height * sizeof(GLshort));
+}
+
+static int pixmap_resize(pixmap_t *p, int w, int h)
+{
+       p->width = w;
+       p->height = h;
+       if (!(p->data = realloc(p->data, w * h * 4 * sizeof(GLshort)))) {
+               return -1;
+       }
+       return 0;
+}
+
+static void dumpstate()
+{
+       printf("blx=%f bly=%f trx=%f try=%f\n", gs.botleftx, gs.botlefty, gs.toprightx, gs.toprighty);
+}
+
+#define        vctocc(i, co, cs, vo, vs) \
+  (((vo) + (i) * (vs) - (co)) / (cs))
+
+static int jas_image_render(jas_image_t *image, float vtlx, float vtly,
+  float vsx, float vsy, int vw, int vh, GLshort *vdata)
+{
+       int i;
+       int j;
+       int k;
+       int x;
+       int y;
+       int v[3];
+       GLshort *vdatap;
+       int cmptlut[3];
+       int width;
+       int height;
+       int hs;
+       int vs;
+       int tlx;
+       int tly;
+
+       if ((cmptlut[0] = jas_image_getcmptbytype(image,
+         JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_R))) < 0 ||
+         (cmptlut[1] = jas_image_getcmptbytype(image,
+         JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_G))) < 0 ||
+         (cmptlut[2] = jas_image_getcmptbytype(image,
+         JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_B))) < 0)
+               goto error;
+       width = jas_image_cmptwidth(image, cmptlut[0]);
+       height = jas_image_cmptheight(image, cmptlut[0]);
+       tlx = jas_image_cmpttlx(image, cmptlut[0]);
+       tly = jas_image_cmpttly(image, cmptlut[0]);
+       vs = jas_image_cmptvstep(image, cmptlut[0]);
+       hs = jas_image_cmpthstep(image, cmptlut[0]);
+       for (i = 1; i < 3; ++i) {
+               if (jas_image_cmptwidth(image, cmptlut[i]) != width ||
+                 jas_image_cmptheight(image, cmptlut[i]) != height)
+                       goto error;
+       }
+       for (i = 0; i < vh; ++i) {
+               vdatap = &vdata[(vh - 1 - i) * (4 * vw)];
+               for (j = 0; j < vw; ++j) {
+                       x = vctocc(j, tlx, hs, vtlx, vsx);
+                       y = vctocc(i, tly, vs, vtly, vsy);
+                       if (x >= 0 && x < width && y >= 0 && y < height) {
+                               for (k = 0; k < 3; ++k) {
+                                       v[k] = jas_image_readcmptsample(image, cmptlut[k], x, y);
+                                       v[k] <<= 16 - jas_image_cmptprec(image, cmptlut[k]);
+                                       if (v[k] < 0) {
+                                               v[k] = 0;
+                                       } else if (v[k] > 65535) {
+                                               v[k] = 65535;
+                                       }
+                               }
+                       } else {
+                               v[0] = 0;
+                               v[1] = 0;
+                               v[2] = 0;
+                       }       
+                       *vdatap++ = v[0];
+                       *vdatap++ = v[1];
+                       *vdatap++ = v[2];
+                       *vdatap++ = 0;
+               }
+       }
+       return 0;
+error:
+       return -1;
+}
+
+static int jas_image_render2(jas_image_t *image, int cmptno, float vtlx,
+  float vtly, float vsx, float vsy, int vw, int vh, GLshort *vdata)
+{
+       int i;
+       int j;
+       int x;
+       int y;
+       int v;
+       GLshort *vdatap;
+
+       if (cmptno < 0 || cmptno >= image->numcmpts_) {
+               fprintf(stderr, "bad parameter\n");
+               goto error;
+       }
+       for (i = 0; i < vh; ++i) {
+               vdatap = &vdata[(vh - 1 - i) * (4 * vw)];
+               for (j = 0; j < vw; ++j) {
+                       x = vctocc(j, jas_image_cmpttlx(image, cmptno), jas_image_cmpthstep(image, cmptno), vtlx, vsx);
+                       y = vctocc(i, jas_image_cmpttly(image, cmptno), jas_image_cmptvstep(image, cmptno), vtly, vsy);
+                       v = (x >= 0 && x < jas_image_cmptwidth(image, cmptno) && y >=0 && y < jas_image_cmptheight(image, cmptno)) ? jas_image_readcmptsample(image, cmptno, x, y) : 0;
+                       v <<= 16 - jas_image_cmptprec(image, cmptno);
+                       if (v < 0) {
+                               v = 0;
+                       } else if (v > 65535) {
+                               v = 65535;
+                       }
+                       *vdatap++ = v;
+                       *vdatap++ = v;
+                       *vdatap++ = v;
+                       *vdatap++ = 0;
+               }
+       }
+       return 0;
+error:
+       return -1;
+}
+
+
+static void render()
+{
+       float vtlx;
+       float vtly;
+
+       vtlx = gs.botleftx;
+       vtly = gs.toprighty;
+       if (cmdopts.verbose) {
+//             fprintf(stderr, "vtlx=%f, vtly=%f, vsx=%f, vsy=%f\n",
+//               vtlx, vtly, gs.sx, gs.sy);
+       }
+
+       if (gs.monomode) {
+               if (cmdopts.verbose) {
+                       fprintf(stderr, "component %d\n", gs.cmptno);
+               }
+               jas_image_render2(gs.image, gs.cmptno, 0.0, 0.0,
+                 1.0, 1.0, gs.vp.width, gs.vp.height, gs.vp.data);
+       } else {
+               if (cmdopts.verbose) {
+                       fprintf(stderr, "color\n");
+               }
+               jas_image_render(gs.altimage, 0.0, 0.0, 1.0, 1.0,
+                 gs.vp.width, gs.vp.height, gs.vp.data);
+       }
+
+}
+
+#if 0
+
+#define        vctocc(i, co, cs, vo, vs) \
+  (((vo) + (i) * (vs) - (co)) / (cs))
+
+static void drawview(jas_image_t *image, float vtlx, float vtly,
+  float sx, float sy, pixmap_t *p)
+{
+       int i;
+       int j;
+       int k;
+       int red;
+       int grn;
+       int blu;
+       int lum;
+       GLshort *datap;
+       int x;
+       int y;
+       int *cmptlut;
+       int numcmpts;
+       int v[4];
+       int u[4];
+       int color;
+
+       cmptlut = gs.cmptlut;
+       switch (jas_image_colorspace(gs.image)) {
+       case JAS_IMAGE_CS_RGB:
+       case JAS_IMAGE_CS_YCBCR:
+               color = 1;
+               numcmpts = 3;
+               break;
+       case JAS_IMAGE_CS_GRAY:
+       default:
+               numcmpts = 1;
+               color = 0;
+               break;
+       }
+
+       for (i = 0; i < p->height; ++i) {
+               datap = &p->data[(p->height - 1 - i) * (4 * p->width)];
+               for (j = 0; j < p->width; ++j) {
+                       if (!gs.monomode && color) {
+                               for (k = 0; k < numcmpts; ++k) {
+                                       x = vctocc(j, jas_image_cmpttlx(gs.image, cmptlut[k]), jas_image_cmpthstep(gs.image, cmptlut[k]), vtlx, sx);
+                                       y = vctocc(i, jas_image_cmpttly(gs.image, cmptlut[k]), jas_image_cmptvstep(gs.image, cmptlut[k]), vtly, sy);
+                                       v[k] = (x >= 0 && x < jas_image_cmptwidth(gs.image, cmptlut[k]) && y >=0 && y < jas_image_cmptheight(gs.image, cmptlut[k])) ? jas_matrix_get(gs.cmpts[cmptlut[k]], y, x) : 0;
+                                       v[k] <<= 16 - jas_image_cmptprec(gs.image, cmptlut[k]);
+                               }
+                               switch (jas_image_colorspace(gs.image)) {
+                               case JAS_IMAGE_CS_RGB:
+                                       break;
+                               case JAS_IMAGE_CS_YCBCR:
+                                       u[0] = (1/1.772) * (v[0] + 1.402 * v[2]);
+                                       u[1] = (1/1.772) * (v[0] - 0.34413 * v[1] - 0.71414 * v[2]);
+                                       u[2] = (1/1.772) * (v[0] + 1.772 * v[1]);
+                                       v[0] = u[0];
+                                       v[1] = u[1];
+                                       v[2] = u[2];
+                                       break;
+                               }
+                       } else {
+                               x = vctocc(j, jas_image_cmpttlx(gs.image, gs.cmptno), jas_image_cmpthstep(gs.image, gs.cmptno), vtlx, sx);
+                               y = vctocc(i, jas_image_cmpttly(gs.image, gs.cmptno), jas_image_cmptvstep(gs.image, gs.cmptno), vtly, sy);
+                               v[0] = (x >= 0 && x < jas_image_cmptwidth(gs.image, gs.cmptno) && y >=0 && y < jas_image_cmptheight(gs.image, gs.cmptno)) ? jas_matrix_get(gs.cmpts[gs.cmptno], y, x) : 0;
+                               v[0] <<= 16 - jas_image_cmptprec(gs.image, gs.cmptno);
+                               v[1] = v[0];
+                               v[2] = v[0];
+                               v[3] = 0;
+                       }
+
+for (k = 0; k < 3; ++k) {
+       if (v[k] < 0) {
+               v[k] = 0;
+       } else if (v[k] > 65535) {
+               v[k] = 65535;
+       }
+}
+
+                       *datap++ = v[0];
+                       *datap++ = v[1];
+                       *datap++ = v[2];
+                       *datap++ = 0;
+               }
+       }
+}
+
+#endif
+
+static void cleanupandexit(int status)
+{
+       unloadimage();
+       exit(status);
+}
+
+static void init()
+{
+       gs.filenum = -1;
+       gs.image = 0;
+       gs.altimage = 0;
+       gs.nexttmid = 0;
+       gs.vp.width = 0;
+       gs.vp.height = 0;
+       gs.vp.data = 0;
+       gs.viewportwidth = -1;
+       gs.viewportheight = -1;
+}
diff --git a/src/appl/tmrdemo.c b/src/appl/tmrdemo.c
new file mode 100644 (file)
index 0000000..ec9d984
--- /dev/null
@@ -0,0 +1,52 @@
+#include <jasper/jasper.h>
+
+int main(int argc, char **argv)
+{
+       int i;
+       jas_tmr_t tmr;
+       jas_tmr_t dummytmr;
+       double t;
+       int numiters;
+
+       if (argc < 2) {
+               fprintf(stderr, "bad usage :P\n");
+               exit(1);
+       }
+
+       numiters = atoi(argv[1]);
+
+       jas_tmr_start(&tmr);
+       for (i = numiters; i > 0; --i) {
+               jas_tmr_start(&dummytmr);
+       }
+       jas_tmr_stop(&tmr);
+       t = jas_tmr_get(&tmr);
+       t /= numiters;
+       printf("jas_tmr_start %.3f us\n", t * 1e6);
+
+       jas_tmr_start(&tmr);
+       for (i = numiters; i > 0; --i) {
+               jas_tmr_stop(&dummytmr);
+       }
+       jas_tmr_stop(&tmr);
+       t = jas_tmr_get(&tmr);
+       t /= numiters;
+       printf("jas_tmr_stop  %.3f us\n", t * 1e6);
+
+       t = 0;
+       for (i = numiters; i > 0; --i) {
+               jas_tmr_start(&tmr);
+               jas_tmr_stop(&tmr);
+               t += jas_tmr_get(&tmr);
+       }
+       t /= numiters;
+       printf("zero time %.3f us\n", t * 1e6);
+
+       jas_tmr_start(&tmr);
+       sleep(1);
+       jas_tmr_stop(&tmr);
+       t = jas_tmr_get(&tmr);
+       printf("time delay %.8f s\n", t);
+
+       exit(0);
+}
diff --git a/src/libjasper/Makefile.am b/src/libjasper/Makefile.am
new file mode 100644 (file)
index 0000000..5023a3b
--- /dev/null
@@ -0,0 +1,89 @@
+# Copyright (c) 2001-2002 Michael David Adams.
+# All rights reserved. 
+
+# __START_OF_JASPER_LICENSE__
+# 
+# JasPer License Version 2.0
+# 
+# Copyright (c) 2001-2006 Michael David Adams
+# Copyright (c) 1999-2000 Image Power, Inc.
+# Copyright (c) 1999-2000 The University of British Columbia
+# 
+# All rights reserved.
+# 
+# Permission is hereby granted, free of charge, to any person (the
+# "User") obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the
+# following conditions:
+# 
+# 1.  The above copyright notices and this permission notice (which
+# includes the disclaimer below) shall be included in all copies or
+# substantial portions of the Software.
+# 
+# 2.  The name of a copyright holder shall not be used to endorse or
+# promote products derived from the Software without specific prior
+# written permission.
+# 
+# THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+# LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+# THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+# "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+# PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+# EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+# PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+# THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+# EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+# BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+# PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+# GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+# ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+# IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+# SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+# AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+# SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+# THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+# PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+# RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+# EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+# 
+# __END_OF_JASPER_LICENSE__
+
+EXTRA_DIST = README
+
+SUBDIRS = \
+       include \
+       base \
+       bmp \
+       jp2 \
+       jpc \
+       jpg \
+       mif \
+       pgx \
+       pnm \
+       ras
+
+lib_LTLIBRARIES = libjasper.la
+libjasper_la_SOURCES = dummy.c
+libjasper_la_LIBADD = \
+       base/libbase.la \
+       bmp/libbmp.la \
+       jp2/libjp2.la \
+       jpc/libjpc.la \
+       jpg/libjpg.la \
+       mif/libmif.la \
+       pgx/libpgx.la \
+       pnm/libpnm.la \
+       ras/libras.la
+
+# -release $(LT_RELEASE)
+libjasper_la_LDFLAGS = \
+       -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
+
diff --git a/src/libjasper/Makefile.in b/src/libjasper/Makefile.in
new file mode 100644 (file)
index 0000000..89f66ab
--- /dev/null
@@ -0,0 +1,673 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# Copyright (c) 2001-2002 Michael David Adams.
+# All rights reserved. 
+
+# __START_OF_JASPER_LICENSE__
+# 
+# JasPer License Version 2.0
+# 
+# Copyright (c) 2001-2006 Michael David Adams
+# Copyright (c) 1999-2000 Image Power, Inc.
+# Copyright (c) 1999-2000 The University of British Columbia
+# 
+# All rights reserved.
+# 
+# Permission is hereby granted, free of charge, to any person (the
+# "User") obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the
+# following conditions:
+# 
+# 1.  The above copyright notices and this permission notice (which
+# includes the disclaimer below) shall be included in all copies or
+# substantial portions of the Software.
+# 
+# 2.  The name of a copyright holder shall not be used to endorse or
+# promote products derived from the Software without specific prior
+# written permission.
+# 
+# THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+# LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+# THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+# "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+# PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+# EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+# PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+# THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+# EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+# BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+# PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+# GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+# ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+# IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+# SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+# AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+# SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+# THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+# PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+# RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+# EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+# 
+# __END_OF_JASPER_LICENSE__
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = src/libjasper
+DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/acaux/mkinstalldirs
+CONFIG_HEADER =  \
+       $(top_builddir)/src/libjasper/include/jasper/jas_config.h
+CONFIG_CLEAN_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(libdir)"
+libLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(lib_LTLIBRARIES)
+libjasper_la_DEPENDENCIES = base/libbase.la bmp/libbmp.la \
+       jp2/libjp2.la jpc/libjpc.la jpg/libjpg.la mif/libmif.la \
+       pgx/libpgx.la pnm/libpnm.la ras/libras.la
+am_libjasper_la_OBJECTS = dummy.lo
+libjasper_la_OBJECTS = $(am_libjasper_la_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/libjasper/include/jasper
+depcomp = $(SHELL) $(top_srcdir)/acaux/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+       $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libjasper_la_SOURCES)
+DIST_SOURCES = $(libjasper_la_SOURCES)
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+       html-recursive info-recursive install-data-recursive \
+       install-exec-recursive install-info-recursive \
+       install-recursive installcheck-recursive installdirs-recursive \
+       pdf-recursive ps-recursive uninstall-info-recursive \
+       uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+HAVE_LIBJPEG_FALSE = @HAVE_LIBJPEG_FALSE@
+HAVE_LIBJPEG_TRUE = @HAVE_LIBJPEG_TRUE@
+HAVE_OPENGL_FALSE = @HAVE_OPENGL_FALSE@
+HAVE_OPENGL_TRUE = @HAVE_OPENGL_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAS_MAJOR_VERSION = @JAS_MAJOR_VERSION@
+JAS_MICRO_VERSION = @JAS_MICRO_VERSION@
+JAS_MINOR_VERSION = @JAS_MINOR_VERSION@
+JAS_RPM_RELEASE = @JAS_RPM_RELEASE@
+JAS_VERSION = @JAS_VERSION@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_AGE = @LT_AGE@
+LT_CURRENT = @LT_CURRENT@
+LT_RELEASE = @LT_RELEASE@
+LT_REVISION = @LT_REVISION@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OPENGL_LIBS = @OPENGL_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+EXTRA_DIST = README
+SUBDIRS = \
+       include \
+       base \
+       bmp \
+       jp2 \
+       jpc \
+       jpg \
+       mif \
+       pgx \
+       pnm \
+       ras
+
+lib_LTLIBRARIES = libjasper.la
+libjasper_la_SOURCES = dummy.c
+libjasper_la_LIBADD = \
+       base/libbase.la \
+       bmp/libbmp.la \
+       jp2/libjp2.la \
+       jpc/libjpc.la \
+       jpg/libjpg.la \
+       mif/libmif.la \
+       pgx/libpgx.la \
+       pnm/libpnm.la \
+       ras/libras.la
+
+
+# -release $(LT_RELEASE)
+libjasper_la_LDFLAGS = \
+       -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
+
+all: all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/libjasper/Makefile'; \
+       cd $(top_srcdir) && \
+         $(AUTOMAKE) --foreign  src/libjasper/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+       @$(NORMAL_INSTALL)
+       test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
+       @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+         if test -f $$p; then \
+           f=$(am__strip_dir) \
+           echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
+           $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
+         else :; fi; \
+       done
+
+uninstall-libLTLIBRARIES:
+       @$(NORMAL_UNINSTALL)
+       @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+         p=$(am__strip_dir) \
+         echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
+         $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
+       done
+
+clean-libLTLIBRARIES:
+       -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+       @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+         test "$$dir" != "$$p" || dir=.; \
+         echo "rm -f \"$${dir}/so_locations\""; \
+         rm -f "$${dir}/so_locations"; \
+       done
+libjasper.la: $(libjasper_la_OBJECTS) $(libjasper_la_DEPENDENCIES) 
+       $(LINK) -rpath $(libdir) $(libjasper_la_LDFLAGS) $(libjasper_la_OBJECTS) $(libjasper_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dummy.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+
+distclean-libtool:
+       -rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+       @failcom='exit 1'; \
+       for f in x $$MAKEFLAGS; do \
+         case $$f in \
+           *=* | --[!k]*);; \
+           *k*) failcom='fail=yes';; \
+         esac; \
+       done; \
+       dot_seen=no; \
+       target=`echo $@ | sed s/-recursive//`; \
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         echo "Making $$target in $$subdir"; \
+         if test "$$subdir" = "."; then \
+           dot_seen=yes; \
+           local_target="$$target-am"; \
+         else \
+           local_target="$$target"; \
+         fi; \
+         (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+         || eval $$failcom; \
+       done; \
+       if test "$$dot_seen" = "no"; then \
+         $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+       fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+       @failcom='exit 1'; \
+       for f in x $$MAKEFLAGS; do \
+         case $$f in \
+           *=* | --[!k]*);; \
+           *k*) failcom='fail=yes';; \
+         esac; \
+       done; \
+       dot_seen=no; \
+       case "$@" in \
+         distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+         *) list='$(SUBDIRS)' ;; \
+       esac; \
+       rev=''; for subdir in $$list; do \
+         if test "$$subdir" = "."; then :; else \
+           rev="$$subdir $$rev"; \
+         fi; \
+       done; \
+       rev="$$rev ."; \
+       target=`echo $@ | sed s/-recursive//`; \
+       for subdir in $$rev; do \
+         echo "Making $$target in $$subdir"; \
+         if test "$$subdir" = "."; then \
+           local_target="$$target-am"; \
+         else \
+           local_target="$$target"; \
+         fi; \
+         (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+         || eval $$failcom; \
+       done && test -z "$$fail"
+tags-recursive:
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+       done
+ctags-recursive:
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+       done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+         include_option=--etags-include; \
+         empty_fix=.; \
+       else \
+         include_option=--include; \
+         empty_fix=; \
+       fi; \
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         if test "$$subdir" = .; then :; else \
+           test ! -f $$subdir/TAGS || \
+             tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+         fi; \
+       done; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+           $$tags $$unique; \
+       fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       test -z "$(CTAGS_ARGS)$$tags$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$tags $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && cd $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+       list='$(DISTFILES)'; for file in $$list; do \
+         case $$file in \
+           $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+           $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+         esac; \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+         if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+           dir="/$$dir"; \
+           $(mkdir_p) "$(distdir)$$dir"; \
+         else \
+           dir=''; \
+         fi; \
+         if test -d $$d/$$file; then \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+           fi; \
+           cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+         else \
+           test -f $(distdir)/$$file \
+           || cp -p $$d/$$file $(distdir)/$$file \
+           || exit 1; \
+         fi; \
+       done
+       list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+         if test "$$subdir" = .; then :; else \
+           test -d "$(distdir)/$$subdir" \
+           || $(mkdir_p) "$(distdir)/$$subdir" \
+           || exit 1; \
+           distdir=`$(am__cd) $(distdir) && pwd`; \
+           top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+           (cd $$subdir && \
+             $(MAKE) $(AM_MAKEFLAGS) \
+               top_distdir="$$top_distdir" \
+               distdir="$$distdir/$$subdir" \
+               distdir) \
+             || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(LTLIBRARIES)
+installdirs: installdirs-recursive
+installdirs-am:
+       for dir in "$(DESTDIR)$(libdir)"; do \
+         test -z "$$dir" || $(mkdir_p) "$$dir"; \
+       done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+         `test -z '$(STRIP)' || \
+           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
+       mostlyclean-am
+
+distclean: distclean-recursive
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-libtool distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-libLTLIBRARIES
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+       clean clean-generic clean-libLTLIBRARIES clean-libtool \
+       clean-recursive ctags ctags-recursive distclean \
+       distclean-compile distclean-generic distclean-libtool \
+       distclean-recursive distclean-tags distdir dvi dvi-am html \
+       html-am info info-am install install-am install-data \
+       install-data-am install-exec install-exec-am install-info \
+       install-info-am install-libLTLIBRARIES install-man \
+       install-strip installcheck installcheck-am installdirs \
+       installdirs-am maintainer-clean maintainer-clean-generic \
+       maintainer-clean-recursive mostlyclean mostlyclean-compile \
+       mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \
+       pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
+       uninstall-info-am uninstall-libLTLIBRARIES
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/libjasper/README b/src/libjasper/README
new file mode 100644 (file)
index 0000000..4b79616
--- /dev/null
@@ -0,0 +1,2 @@
+This directory hierarchy contains the source code for the JasPer library
+(i.e., libjasper).
diff --git a/src/libjasper/base/Makefile.am b/src/libjasper/base/Makefile.am
new file mode 100644 (file)
index 0000000..8bdb67b
--- /dev/null
@@ -0,0 +1,76 @@
+# Copyright (c) 2001-2003 Michael David Adams.
+# All rights reserved. 
+
+# __START_OF_JASPER_LICENSE__
+# 
+# JasPer License Version 2.0
+# 
+# Copyright (c) 2001-2006 Michael David Adams
+# Copyright (c) 1999-2000 Image Power, Inc.
+# Copyright (c) 1999-2000 The University of British Columbia
+# 
+# All rights reserved.
+# 
+# Permission is hereby granted, free of charge, to any person (the
+# "User") obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the
+# following conditions:
+# 
+# 1.  The above copyright notices and this permission notice (which
+# includes the disclaimer below) shall be included in all copies or
+# substantial portions of the Software.
+# 
+# 2.  The name of a copyright holder shall not be used to endorse or
+# promote products derived from the Software without specific prior
+# written permission.
+# 
+# THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+# LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+# THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+# "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+# PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+# EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+# PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+# THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+# EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+# BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+# PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+# GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+# ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+# IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+# SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+# AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+# SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+# THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+# PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+# RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+# EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+# 
+# __END_OF_JASPER_LICENSE__
+
+noinst_LTLIBRARIES = libbase.la
+libbase_la_SOURCES = \
+       jas_cm.c \
+       jas_debug.c \
+       jas_getopt.c  \
+       jas_image.c \
+       jas_icc.c \
+       jas_iccdata.c \
+       jas_init.c \
+       jas_malloc.c \
+       jas_seq.c \
+       jas_stream.c \
+       jas_string.c \
+       jas_tmr.c \
+       jas_tvp.c \
+       jas_version.c
+
+INCLUDES = -I$(top_srcdir)/src/libjasper/include
diff --git a/src/libjasper/base/Makefile.in b/src/libjasper/base/Makefile.in
new file mode 100644 (file)
index 0000000..abb299d
--- /dev/null
@@ -0,0 +1,533 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# Copyright (c) 2001-2003 Michael David Adams.
+# All rights reserved. 
+
+# __START_OF_JASPER_LICENSE__
+# 
+# JasPer License Version 2.0
+# 
+# Copyright (c) 2001-2006 Michael David Adams
+# Copyright (c) 1999-2000 Image Power, Inc.
+# Copyright (c) 1999-2000 The University of British Columbia
+# 
+# All rights reserved.
+# 
+# Permission is hereby granted, free of charge, to any person (the
+# "User") obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the
+# following conditions:
+# 
+# 1.  The above copyright notices and this permission notice (which
+# includes the disclaimer below) shall be included in all copies or
+# substantial portions of the Software.
+# 
+# 2.  The name of a copyright holder shall not be used to endorse or
+# promote products derived from the Software without specific prior
+# written permission.
+# 
+# THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+# LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+# THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+# "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+# PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+# EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+# PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+# THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+# EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+# BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+# PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+# GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+# ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+# IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+# SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+# AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+# SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+# THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+# PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+# RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+# EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+# 
+# __END_OF_JASPER_LICENSE__
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = src/libjasper/base
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/acaux/mkinstalldirs
+CONFIG_HEADER =  \
+       $(top_builddir)/src/libjasper/include/jasper/jas_config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libbase_la_LIBADD =
+am_libbase_la_OBJECTS = jas_cm.lo jas_debug.lo jas_getopt.lo \
+       jas_image.lo jas_icc.lo jas_iccdata.lo jas_init.lo \
+       jas_malloc.lo jas_seq.lo jas_stream.lo jas_string.lo \
+       jas_tmr.lo jas_tvp.lo jas_version.lo
+libbase_la_OBJECTS = $(am_libbase_la_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/libjasper/include/jasper
+depcomp = $(SHELL) $(top_srcdir)/acaux/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+       $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libbase_la_SOURCES)
+DIST_SOURCES = $(libbase_la_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+HAVE_LIBJPEG_FALSE = @HAVE_LIBJPEG_FALSE@
+HAVE_LIBJPEG_TRUE = @HAVE_LIBJPEG_TRUE@
+HAVE_OPENGL_FALSE = @HAVE_OPENGL_FALSE@
+HAVE_OPENGL_TRUE = @HAVE_OPENGL_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAS_MAJOR_VERSION = @JAS_MAJOR_VERSION@
+JAS_MICRO_VERSION = @JAS_MICRO_VERSION@
+JAS_MINOR_VERSION = @JAS_MINOR_VERSION@
+JAS_RPM_RELEASE = @JAS_RPM_RELEASE@
+JAS_VERSION = @JAS_VERSION@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_AGE = @LT_AGE@
+LT_CURRENT = @LT_CURRENT@
+LT_RELEASE = @LT_RELEASE@
+LT_REVISION = @LT_REVISION@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OPENGL_LIBS = @OPENGL_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+noinst_LTLIBRARIES = libbase.la
+libbase_la_SOURCES = \
+       jas_cm.c \
+       jas_debug.c \
+       jas_getopt.c  \
+       jas_image.c \
+       jas_icc.c \
+       jas_iccdata.c \
+       jas_init.c \
+       jas_malloc.c \
+       jas_seq.c \
+       jas_stream.c \
+       jas_string.c \
+       jas_tmr.c \
+       jas_tvp.c \
+       jas_version.c
+
+INCLUDES = -I$(top_srcdir)/src/libjasper/include
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/libjasper/base/Makefile'; \
+       cd $(top_srcdir) && \
+         $(AUTOMAKE) --foreign  src/libjasper/base/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+       -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+       @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+         test "$$dir" != "$$p" || dir=.; \
+         echo "rm -f \"$${dir}/so_locations\""; \
+         rm -f "$${dir}/so_locations"; \
+       done
+libbase.la: $(libbase_la_OBJECTS) $(libbase_la_DEPENDENCIES) 
+       $(LINK)  $(libbase_la_LDFLAGS) $(libbase_la_OBJECTS) $(libbase_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jas_cm.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jas_debug.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jas_getopt.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jas_icc.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jas_iccdata.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jas_image.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jas_init.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jas_malloc.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jas_seq.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jas_stream.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jas_string.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jas_tmr.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jas_tvp.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jas_version.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+
+distclean-libtool:
+       -rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+           $$tags $$unique; \
+       fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       test -z "$(CTAGS_ARGS)$$tags$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$tags $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && cd $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+       list='$(DISTFILES)'; for file in $$list; do \
+         case $$file in \
+           $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+           $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+         esac; \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+         if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+           dir="/$$dir"; \
+           $(mkdir_p) "$(distdir)$$dir"; \
+         else \
+           dir=''; \
+         fi; \
+         if test -d $$d/$$file; then \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+           fi; \
+           cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+         else \
+           test -f $(distdir)/$$file \
+           || cp -p $$d/$$file $(distdir)/$$file \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+         `test -z '$(STRIP)' || \
+           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+       mostlyclean-am
+
+distclean: distclean-am
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+       clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+       distclean-compile distclean-generic distclean-libtool \
+       distclean-tags distdir dvi dvi-am html html-am info info-am \
+       install install-am install-data install-data-am install-exec \
+       install-exec-am install-info install-info-am install-man \
+       install-strip installcheck installcheck-am installdirs \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+       pdf pdf-am ps ps-am tags uninstall uninstall-am \
+       uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/libjasper/base/jas_cm.c b/src/libjasper/base/jas_cm.c
new file mode 100644 (file)
index 0000000..77514dd
--- /dev/null
@@ -0,0 +1,1282 @@
+/*
+ * Copyright (c) 2002-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Color Management
+ *
+ * $Id$
+ */
+
+#include <jasper/jas_config.h>
+#include <math.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <jasper/jas_cm.h>
+#include <jasper/jas_icc.h>
+#include <jasper/jas_init.h>
+#include <jasper/jas_stream.h>
+#include <jasper/jas_malloc.h>
+#include <jasper/jas_math.h>
+
+static jas_cmprof_t *jas_cmprof_create(void);
+static void jas_cmshapmatlut_cleanup(jas_cmshapmatlut_t *);
+static jas_cmreal_t jas_cmshapmatlut_lookup(jas_cmshapmatlut_t *lut, jas_cmreal_t x);
+
+static void jas_cmpxform_destroy(jas_cmpxform_t *pxform);
+static jas_cmpxform_t *jas_cmpxform_copy(jas_cmpxform_t *pxform);
+
+static void jas_cmshapmat_destroy(jas_cmpxform_t *pxform);
+static int jas_cmshapmat_apply(jas_cmpxform_t *pxform, jas_cmreal_t *in,
+  jas_cmreal_t *out, int cnt);
+
+static int jas_cmputint(long **bufptr, int sgnd, int prec, long val);
+static int jas_cmgetint(long **bufptr, int sgnd, int prec, long *val);
+static int jas_cmpxformseq_append(jas_cmpxformseq_t *pxformseq,
+  jas_cmpxformseq_t *othpxformseq);
+static int jas_cmpxformseq_appendcnvt(jas_cmpxformseq_t *pxformseq,
+  int, int);
+static int jas_cmpxformseq_resize(jas_cmpxformseq_t *pxformseq, int n);
+
+static int mono(jas_iccprof_t *prof, int op, jas_cmpxformseq_t **pxformseq);
+static int triclr(jas_iccprof_t *prof, int op, jas_cmpxformseq_t **retpxformseq);
+
+static void jas_cmpxformseq_destroy(jas_cmpxformseq_t *pxformseq);
+static int jas_cmpxformseq_delete(jas_cmpxformseq_t *pxformseq, int i);
+static jas_cmpxformseq_t *jas_cmpxformseq_create(void);
+static jas_cmpxformseq_t *jas_cmpxformseq_copy(jas_cmpxformseq_t *pxformseq);
+static int jas_cmshapmat_invmat(jas_cmreal_t out[3][4], jas_cmreal_t in[3][4]);
+static int jas_cmpxformseq_insertpxform(jas_cmpxformseq_t *pxformseq,
+  int i, jas_cmpxform_t *pxform);
+
+#define        SEQFWD(intent)  (intent)
+#define        SEQREV(intent)  (4 + (intent))
+#define        SEQSIM(intent)  (8 + (intent))
+#define        SEQGAM          12
+
+#define fwdpxformseq(prof, intent) \
+  (((prof)->pxformseqs[SEQFWD(intent)]) ? \
+  ((prof)->pxformseqs[SEQFWD(intent)]) : \
+  ((prof)->pxformseqs[SEQFWD(0)]))
+
+#define revpxformseq(prof, intent) \
+  (((prof)->pxformseqs[SEQREV(intent)]) ? \
+  ((prof)->pxformseqs[SEQREV(intent)]) : \
+  ((prof)->pxformseqs[SEQREV(0)]))
+
+#define simpxformseq(prof, intent) \
+  (((prof)->pxformseqs[SEQSIM(intent)]) ? \
+  ((prof)->pxformseqs[SEQSIM(intent)]) : \
+  ((prof)->pxformseqs[SEQSIM(0)]))
+
+#define gampxformseq(prof)     ((prof)->pxformseqs[SEQGAM])
+
+static int icctoclrspc(int iccclrspc, int refflag);
+static jas_cmpxform_t *jas_cmpxform_create0(void);
+static jas_cmpxform_t *jas_cmpxform_createshapmat(void);
+static void jas_cmshapmatlut_init(jas_cmshapmatlut_t *lut);
+static int jas_cmshapmatlut_set(jas_cmshapmatlut_t *lut, jas_icccurv_t *curv);
+
+static jas_cmpxformops_t shapmat_ops = {jas_cmshapmat_destroy, jas_cmshapmat_apply, 0};
+static jas_cmprof_t *jas_cmprof_createsycc(void);
+
+/******************************************************************************\
+* Color profile class.
+\******************************************************************************/
+
+jas_cmprof_t *jas_cmprof_createfromclrspc(int clrspc)
+{
+       jas_iccprof_t *iccprof;
+       jas_cmprof_t *prof;
+
+       iccprof = 0;
+       prof = 0;
+       switch (clrspc) {
+       case JAS_CLRSPC_SYCBCR:
+               if (!(prof = jas_cmprof_createsycc()))
+                       goto error;
+               break;
+       default:
+               if (!(iccprof = jas_iccprof_createfromclrspc(clrspc)))
+                       goto error;
+               if (!(prof = jas_cmprof_createfromiccprof(iccprof)))
+                       goto error;
+               jas_iccprof_destroy(iccprof);
+               iccprof = 0;
+               if (!jas_clrspc_isgeneric(clrspc))
+                       prof->clrspc = clrspc;
+               break;
+       }
+       return prof;
+error:
+       if (iccprof)
+               jas_iccprof_destroy(iccprof);
+       return 0;
+}
+
+static jas_cmprof_t *jas_cmprof_createsycc()
+{
+       jas_cmprof_t *prof;
+       jas_cmpxform_t *fwdpxform;
+       jas_cmpxform_t *revpxform;
+       jas_cmshapmat_t *fwdshapmat;
+       jas_cmshapmat_t *revshapmat;
+       int i;
+       int j;
+
+       if (!(prof = jas_cmprof_createfromclrspc(JAS_CLRSPC_SRGB)))
+               goto error;
+       prof->clrspc = JAS_CLRSPC_SYCBCR;
+       assert(prof->numchans == 3 && prof->numrefchans == 3);
+       assert(prof->refclrspc == JAS_CLRSPC_CIEXYZ);
+       if (!(fwdpxform = jas_cmpxform_createshapmat()))
+               goto error;
+       fwdpxform->numinchans = 3;
+       fwdpxform->numoutchans = 3;
+       fwdshapmat = &fwdpxform->data.shapmat;
+       fwdshapmat->mono = 0;
+       fwdshapmat->order = 0;
+       fwdshapmat->useluts = 0;
+       fwdshapmat->usemat = 1;
+       fwdshapmat->mat[0][0] = 1.0;
+       fwdshapmat->mat[0][1] = 0.0;
+       fwdshapmat->mat[0][2] = 1.402;
+       fwdshapmat->mat[1][0] = 1.0;
+       fwdshapmat->mat[1][1] = -0.34413;
+       fwdshapmat->mat[1][2] = -0.71414;
+       fwdshapmat->mat[2][0] = 1.0;
+       fwdshapmat->mat[2][1] = 1.772;
+       fwdshapmat->mat[2][2] = 0.0;
+       fwdshapmat->mat[0][3] = -0.5 * (1.402);
+       fwdshapmat->mat[1][3] = -0.5 * (-0.34413 - 0.71414);
+       fwdshapmat->mat[2][3] = -0.5 * (1.772);
+       if (!(revpxform = jas_cmpxform_createshapmat()))
+               goto error;
+       revpxform->numinchans = 3;
+       revpxform->numoutchans = 3;
+       revshapmat = &revpxform->data.shapmat;
+       revshapmat->mono = 0;
+       revshapmat->order = 1;
+       revshapmat->useluts = 0;
+       revshapmat->usemat = 1;
+       jas_cmshapmat_invmat(revshapmat->mat, fwdshapmat->mat);
+
+       for (i = 0; i < JAS_CMXFORM_NUMINTENTS; ++i) {
+               j = SEQFWD(i);
+               if (prof->pxformseqs[j]) {
+                       if (jas_cmpxformseq_insertpxform(prof->pxformseqs[j], 0,
+                         fwdpxform))
+                               goto error;
+               }
+               j = SEQREV(i);
+               if (prof->pxformseqs[j]) {
+                       if (jas_cmpxformseq_insertpxform(prof->pxformseqs[j],
+                         -1, revpxform))
+                               goto error;
+               }
+       }
+
+       jas_cmpxform_destroy(fwdpxform);
+       jas_cmpxform_destroy(revpxform);
+       return prof;
+error:
+       return 0;
+}
+
+jas_cmprof_t *jas_cmprof_createfromiccprof(jas_iccprof_t *iccprof)
+{
+       jas_cmprof_t *prof;
+       jas_icchdr_t icchdr;
+       jas_cmpxformseq_t *fwdpxformseq;
+       jas_cmpxformseq_t *revpxformseq;
+
+       prof = 0;
+       fwdpxformseq = 0;
+       revpxformseq = 0;
+
+       if (!(prof = jas_cmprof_create()))
+               goto error;
+       jas_iccprof_gethdr(iccprof, &icchdr);
+       if (!(prof->iccprof = jas_iccprof_copy(iccprof)))
+               goto error;
+       prof->clrspc = icctoclrspc(icchdr.colorspc, 0);
+       prof->refclrspc = icctoclrspc(icchdr.refcolorspc, 1);
+       prof->numchans = jas_clrspc_numchans(prof->clrspc);
+       prof->numrefchans = jas_clrspc_numchans(prof->refclrspc);
+
+       if (prof->numchans == 1) {
+               if (mono(prof->iccprof, 0, &fwdpxformseq))
+                       goto error;
+               if (mono(prof->iccprof, 1, &revpxformseq))
+                       goto error;
+       } else if (prof->numchans == 3) {
+               if (triclr(prof->iccprof, 0, &fwdpxformseq))
+                       goto error;
+               if (triclr(prof->iccprof, 1, &revpxformseq))
+                       goto error;
+       }
+       prof->pxformseqs[SEQFWD(0)] = fwdpxformseq;
+       prof->pxformseqs[SEQREV(0)] = revpxformseq;
+
+#if 0
+       if (prof->numchans > 1) {
+               lut(prof->iccprof, 0, PER, &pxformseq);
+               pxformseqs_set(prof, SEQFWD(PER), pxformseq);
+               lut(prof->iccprof, 1, PER, &pxformseq);
+               pxformseqs_set(prof, SEQREV(PER), pxformseq);
+               lut(prof->iccprof, 0, CLR, &pxformseq);
+               pxformseqs_set(prof, SEQREV(CLR), pxformseq);
+               lut(prof->iccprof, 1, CLR, &pxformseq);
+               pxformseqs_set(prof, SEQREV(CLR), pxformseq);
+               lut(prof->iccprof, 0, SAT, &pxformseq);
+               pxformseqs_set(prof, SEQREV(SAT), pxformseq);
+               lut(prof->iccprof, 1, SAT, &pxformseq);
+               pxformseqs_set(prof, SEQREV(SAT), pxformseq);
+       }
+#endif
+
+       return prof;
+
+error:
+       if (fwdpxformseq) {
+               jas_cmpxformseq_destroy(fwdpxformseq);
+       }
+       if (revpxformseq) {
+               jas_cmpxformseq_destroy(revpxformseq);
+       }
+       if (prof) {
+               jas_cmprof_destroy(prof);
+       }
+
+       return 0;
+}
+
+static jas_cmprof_t *jas_cmprof_create()
+{
+       int i;
+       jas_cmprof_t *prof;
+       if (!(prof = jas_malloc(sizeof(jas_cmprof_t))))
+               return 0;
+       memset(prof, 0, sizeof(jas_cmprof_t));
+       prof->iccprof = 0;
+       for (i = 0; i < JAS_CMPROF_NUMPXFORMSEQS; ++i)
+               prof->pxformseqs[i] = 0;
+       return prof;
+}
+
+void jas_cmprof_destroy(jas_cmprof_t *prof)
+{ 
+       int i;
+       for (i = 0; i < JAS_CMPROF_NUMPXFORMSEQS; ++i) {
+               if (prof->pxformseqs[i]) {
+                       jas_cmpxformseq_destroy(prof->pxformseqs[i]);
+                       prof->pxformseqs[i] = 0;
+               }
+       }
+       if (prof->iccprof)
+               jas_iccprof_destroy(prof->iccprof);
+       jas_free(prof);
+}
+
+jas_cmprof_t *jas_cmprof_copy(jas_cmprof_t *prof)
+{
+       jas_cmprof_t *newprof;
+       int i;
+
+       if (!(newprof = jas_cmprof_create()))
+               goto error;
+       newprof->clrspc = prof->clrspc;
+       newprof->numchans = prof->numchans;
+       newprof->refclrspc = prof->refclrspc;
+       newprof->numrefchans = prof->numrefchans;
+       newprof->iccprof = jas_iccprof_copy(prof->iccprof);
+       for (i = 0; i < JAS_CMPROF_NUMPXFORMSEQS; ++i) {
+               if (prof->pxformseqs[i]) {
+                       if (!(newprof->pxformseqs[i] = jas_cmpxformseq_copy(prof->pxformseqs[i])))
+                               goto error;
+               }
+       }
+       return newprof;
+error:
+       return 0;
+}
+
+/******************************************************************************\
+* Transform class.
+\******************************************************************************/
+
+jas_cmxform_t *jas_cmxform_create(jas_cmprof_t *inprof, jas_cmprof_t *outprof,
+  jas_cmprof_t *prfprof, int op, int intent, int optimize)
+{
+       jas_cmxform_t *xform;
+       jas_cmpxformseq_t *inpxformseq;
+       jas_cmpxformseq_t *outpxformseq;
+       jas_cmpxformseq_t *altoutpxformseq;
+       jas_cmpxformseq_t *prfpxformseq;
+       int prfintent;
+
+       /* Avoid compiler warnings about unused parameters. */
+       optimize = 0;
+
+       prfintent = intent;
+
+       if (!(xform = jas_malloc(sizeof(jas_cmxform_t))))
+               goto error;
+       if (!(xform->pxformseq = jas_cmpxformseq_create()))
+               goto error;
+
+       switch (op) {
+       case JAS_CMXFORM_OP_FWD:
+               inpxformseq = fwdpxformseq(inprof, intent);
+               outpxformseq = revpxformseq(outprof, intent);
+               if (!inpxformseq || !outpxformseq)
+                       goto error;
+               if (jas_cmpxformseq_append(xform->pxformseq, inpxformseq) ||
+                 jas_cmpxformseq_appendcnvt(xform->pxformseq,
+                 inprof->refclrspc, outprof->refclrspc) ||
+                 jas_cmpxformseq_append(xform->pxformseq, outpxformseq))
+                       goto error;
+               xform->numinchans = jas_clrspc_numchans(inprof->clrspc);
+               xform->numoutchans = jas_clrspc_numchans(outprof->clrspc);
+               break;
+       case JAS_CMXFORM_OP_REV:
+               outpxformseq = fwdpxformseq(outprof, intent);
+               inpxformseq = revpxformseq(inprof, intent);
+               if (!outpxformseq || !inpxformseq)
+                       goto error;
+               if (jas_cmpxformseq_append(xform->pxformseq, outpxformseq) ||
+                 jas_cmpxformseq_appendcnvt(xform->pxformseq,
+                 outprof->refclrspc, inprof->refclrspc) ||
+                 jas_cmpxformseq_append(xform->pxformseq, inpxformseq))
+                       goto error;
+               xform->numinchans = jas_clrspc_numchans(outprof->clrspc);
+               xform->numoutchans = jas_clrspc_numchans(inprof->clrspc);
+               break;
+       case JAS_CMXFORM_OP_PROOF:
+               assert(prfprof);
+               inpxformseq = fwdpxformseq(inprof, intent);
+               prfpxformseq = fwdpxformseq(prfprof, prfintent);
+               if (!inpxformseq || !prfpxformseq)
+                       goto error;
+               outpxformseq = simpxformseq(outprof, intent);
+               altoutpxformseq = 0;
+               if (!outpxformseq) {
+                       outpxformseq = revpxformseq(outprof, intent);
+                       altoutpxformseq = fwdpxformseq(outprof, intent);
+                       if (!outpxformseq || !altoutpxformseq)
+                               goto error;
+               }
+               if (jas_cmpxformseq_append(xform->pxformseq, inpxformseq) ||
+                 jas_cmpxformseq_appendcnvt(xform->pxformseq,
+                 inprof->refclrspc, outprof->refclrspc))
+                       goto error;
+               if (altoutpxformseq) {
+                       if (jas_cmpxformseq_append(xform->pxformseq, outpxformseq) ||
+                         jas_cmpxformseq_append(xform->pxformseq, altoutpxformseq))
+                               goto error;
+               } else {
+                       if (jas_cmpxformseq_append(xform->pxformseq, outpxformseq))
+                               goto error;
+               }
+               if (jas_cmpxformseq_appendcnvt(xform->pxformseq,
+                 outprof->refclrspc, inprof->refclrspc) ||
+                 jas_cmpxformseq_append(xform->pxformseq, prfpxformseq))
+                       goto error;
+               xform->numinchans = jas_clrspc_numchans(inprof->clrspc);
+               xform->numoutchans = jas_clrspc_numchans(prfprof->clrspc);
+               break;
+       case JAS_CMXFORM_OP_GAMUT:
+               inpxformseq = fwdpxformseq(inprof, intent);
+               outpxformseq = gampxformseq(outprof);
+               if (!inpxformseq || !outpxformseq)
+                       goto error;
+               if (jas_cmpxformseq_append(xform->pxformseq, inpxformseq) ||
+                 jas_cmpxformseq_appendcnvt(xform->pxformseq,
+                 inprof->refclrspc, outprof->refclrspc) ||
+                 jas_cmpxformseq_append(xform->pxformseq, outpxformseq))
+                       goto error;
+               xform->numinchans = jas_clrspc_numchans(inprof->clrspc);
+               xform->numoutchans = 1;
+               break;
+       }
+       return xform;
+error:
+       return 0;
+}
+
+#define        APPLYBUFSIZ     2048
+int jas_cmxform_apply(jas_cmxform_t *xform, jas_cmpixmap_t *in, jas_cmpixmap_t *out)
+{
+       jas_cmcmptfmt_t *fmt;
+       jas_cmreal_t buf[2][APPLYBUFSIZ];
+       jas_cmpxformseq_t *pxformseq;
+       int i;
+       int j;
+       int width;
+       int height;
+       int total;
+       int n;
+       jas_cmreal_t *inbuf;
+       jas_cmreal_t *outbuf;
+       jas_cmpxform_t *pxform;
+       long *dataptr;
+       int maxchans;
+       int bufmax;
+       int m;
+       int bias;
+       jas_cmreal_t scale;
+       long v;
+       jas_cmreal_t *bufptr;
+
+       if (xform->numinchans > in->numcmpts || xform->numoutchans > out->numcmpts)
+               goto error;
+
+       fmt = &in->cmptfmts[0];
+       width = fmt->width;
+       height = fmt->height;
+       for (i = 1; i < xform->numinchans; ++i) {
+               fmt = &in->cmptfmts[i];
+               if (fmt->width != width || fmt->height != height) {
+                       goto error;
+               }
+       }
+       for (i = 0; i < xform->numoutchans; ++i) {
+               fmt = &out->cmptfmts[i];
+               if (fmt->width != width || fmt->height != height) {
+                       goto error;
+               }
+       }
+
+       maxchans = 0;
+       pxformseq = xform->pxformseq;
+       for (i = 0; i < pxformseq->numpxforms; ++i) {
+               pxform = pxformseq->pxforms[i];
+               if (pxform->numinchans > maxchans) {
+                       maxchans = pxform->numinchans;
+               }
+               if (pxform->numoutchans > maxchans) {
+                       maxchans = pxform->numoutchans;
+               }
+       }
+       bufmax = APPLYBUFSIZ / maxchans;
+       assert(bufmax > 0);
+
+       total = width * height;
+       n = 0;
+       while (n < total) {
+
+               inbuf = &buf[0][0];
+               m = JAS_MIN(total - n, bufmax);
+
+               for (i = 0; i < xform->numinchans; ++i) {
+                       fmt = &in->cmptfmts[i];
+                       scale = (double)((1 << fmt->prec) - 1);
+                       bias = fmt->sgnd ? (1 << (fmt->prec - 1)) : 0;
+                       dataptr = &fmt->buf[n];
+                       bufptr = &inbuf[i];
+                       for (j = 0; j < m; ++j) {
+                               if (jas_cmgetint(&dataptr, fmt->sgnd, fmt->prec, &v))
+                                       goto error;
+                               *bufptr = (v - bias) / scale;
+                               bufptr += xform->numinchans;
+                       }
+               }
+
+               inbuf = &buf[0][0];
+               outbuf = inbuf;
+               for (i = 0; i < pxformseq->numpxforms; ++i) {
+                       pxform = pxformseq->pxforms[i];
+                       if (pxform->numoutchans > pxform->numinchans) {
+                               outbuf = (inbuf == &buf[0][0]) ? &buf[1][0] : &buf[0][0];
+                       } else {
+                               outbuf = inbuf;
+                       }
+                       if ((*pxform->ops->apply)(pxform, inbuf, outbuf, m))
+                               goto error;
+                       inbuf = outbuf;
+               }
+
+               for (i = 0; i < xform->numoutchans; ++i) {
+                       fmt = &out->cmptfmts[i];
+                       scale = (double)((1 << fmt->prec) - 1);
+                       bias = fmt->sgnd ? (1 << (fmt->prec - 1)) : 0;
+                       bufptr = &outbuf[i];
+                       dataptr = &fmt->buf[n];
+                       for (j = 0; j < m; ++j) {
+                               v = (*bufptr) * scale + bias;
+                               bufptr += xform->numoutchans;
+                               if (jas_cmputint(&dataptr, fmt->sgnd, fmt->prec, v))
+                                       goto error;
+                       }
+               }
+       
+               n += m;
+       }
+       
+       return 0;
+error:
+       return -1;
+}
+
+void jas_cmxform_destroy(jas_cmxform_t *xform)
+{
+       if (xform->pxformseq)
+               jas_cmpxformseq_destroy(xform->pxformseq);
+       jas_free(xform);
+}
+
+/******************************************************************************\
+* Primitive transform sequence class.
+\******************************************************************************/
+
+static jas_cmpxformseq_t *jas_cmpxformseq_create()
+{
+       jas_cmpxformseq_t *pxformseq;
+       pxformseq = 0;
+       if (!(pxformseq = jas_malloc(sizeof(jas_cmpxformseq_t))))
+               goto error;
+       pxformseq->pxforms = 0;
+       pxformseq->numpxforms = 0;
+       pxformseq->maxpxforms = 0;
+       if (jas_cmpxformseq_resize(pxformseq, 16))
+               goto error;
+       return pxformseq;
+error:
+       if (pxformseq)
+               jas_cmpxformseq_destroy(pxformseq);
+       return 0;
+}
+
+static jas_cmpxformseq_t *jas_cmpxformseq_copy(jas_cmpxformseq_t *pxformseq)
+{
+       jas_cmpxformseq_t *newpxformseq;
+
+       if (!(newpxformseq = jas_cmpxformseq_create()))
+               goto error;
+       if (jas_cmpxformseq_append(newpxformseq, pxformseq))
+               goto error;
+       return newpxformseq;
+error:
+       return 0;
+}
+
+static void jas_cmpxformseq_destroy(jas_cmpxformseq_t *pxformseq)
+{
+       while (pxformseq->numpxforms > 0)
+               jas_cmpxformseq_delete(pxformseq, pxformseq->numpxforms - 1);
+       if (pxformseq->pxforms)
+               jas_free(pxformseq->pxforms);
+       jas_free(pxformseq);
+}
+
+static int jas_cmpxformseq_delete(jas_cmpxformseq_t *pxformseq, int i)
+{
+       assert(i >= 0 && i < pxformseq->numpxforms);
+       if (i != pxformseq->numpxforms - 1)
+               abort();
+       jas_cmpxform_destroy(pxformseq->pxforms[i]);
+       pxformseq->pxforms[i] = 0;
+       --pxformseq->numpxforms;
+       return 0;
+}
+
+static int jas_cmpxformseq_appendcnvt(jas_cmpxformseq_t *pxformseq,
+  int dstclrspc, int srcclrspc)
+{
+       if (dstclrspc == srcclrspc)
+               return 0;
+       abort();
+       /* Avoid compiler warnings about unused parameters. */
+       pxformseq = 0;
+       return -1;
+}
+
+static int jas_cmpxformseq_insertpxform(jas_cmpxformseq_t *pxformseq,
+  int i, jas_cmpxform_t *pxform)
+{
+       jas_cmpxform_t *tmppxform;
+       int n;
+       if (i < 0)
+               i = pxformseq->numpxforms;
+       assert(i >= 0 && i <= pxformseq->numpxforms);
+       if (pxformseq->numpxforms >= pxformseq->maxpxforms) {
+               if (jas_cmpxformseq_resize(pxformseq, pxformseq->numpxforms +
+                 16))
+                       goto error;
+       }
+       assert(pxformseq->numpxforms < pxformseq->maxpxforms);
+       if (!(tmppxform = jas_cmpxform_copy(pxform)))
+               goto error;
+       n = pxformseq->numpxforms - i;
+       if (n > 0) {
+               memmove(&pxformseq->pxforms[i + 1], &pxformseq->pxforms[i],
+                 n * sizeof(jas_cmpxform_t *));
+       }
+       pxformseq->pxforms[i] = tmppxform;
+       ++pxformseq->numpxforms;
+       return 0;
+error:
+       return -1;
+}
+
+static int jas_cmpxformseq_append(jas_cmpxformseq_t *pxformseq,
+  jas_cmpxformseq_t *othpxformseq)
+{
+       int n;
+       int i;
+       jas_cmpxform_t *pxform;
+       jas_cmpxform_t *othpxform;
+       n = pxformseq->numpxforms + othpxformseq->numpxforms;
+       if (n > pxformseq->maxpxforms) {
+               if (jas_cmpxformseq_resize(pxformseq, n))
+                       goto error;
+       }
+       for (i = 0; i < othpxformseq->numpxforms; ++i) {
+               othpxform = othpxformseq->pxforms[i];
+               if (!(pxform = jas_cmpxform_copy(othpxform)))
+                       goto error;
+               pxformseq->pxforms[pxformseq->numpxforms] = pxform;
+               ++pxformseq->numpxforms;
+       }
+       return 0;
+error:
+       return -1;
+}
+
+static int jas_cmpxformseq_resize(jas_cmpxformseq_t *pxformseq, int n)
+{
+       jas_cmpxform_t **p;
+       assert(n >= pxformseq->numpxforms);
+       p = (!pxformseq->pxforms) ? jas_malloc(n * sizeof(jas_cmpxform_t *)) :
+         jas_realloc(pxformseq->pxforms, n * sizeof(jas_cmpxform_t *));
+       if (!p) {
+               return -1;
+       }
+       pxformseq->pxforms = p;
+       pxformseq->maxpxforms = n;
+       return 0;
+}
+
+/******************************************************************************\
+* Primitive transform class.
+\******************************************************************************/
+
+static jas_cmpxform_t *jas_cmpxform_create0()
+{
+       jas_cmpxform_t *pxform;
+       if (!(pxform = jas_malloc(sizeof(jas_cmpxform_t))))
+               return 0;
+       memset(pxform, 0, sizeof(jas_cmpxform_t));
+       pxform->refcnt = 0;
+       pxform->ops = 0;
+       return pxform;
+}
+
+static void jas_cmpxform_destroy(jas_cmpxform_t *pxform)
+{
+       if (--pxform->refcnt <= 0) {
+               (*pxform->ops->destroy)(pxform);
+               jas_free(pxform);
+       }
+}
+
+static jas_cmpxform_t *jas_cmpxform_copy(jas_cmpxform_t *pxform)
+{
+       ++pxform->refcnt;
+       return pxform;
+}
+
+/******************************************************************************\
+* Shaper matrix class.
+\******************************************************************************/
+
+static jas_cmpxform_t *jas_cmpxform_createshapmat()
+{
+       int i;
+       int j;
+       jas_cmpxform_t *pxform;
+       jas_cmshapmat_t *shapmat;
+       if (!(pxform = jas_cmpxform_create0()))
+               return 0;
+       pxform->ops = &shapmat_ops;
+       shapmat = &pxform->data.shapmat;
+       shapmat->mono = 0;
+       shapmat->order = 0;
+       shapmat->useluts = 0;
+       shapmat->usemat = 0;
+       for (i = 0; i < 3; ++i)
+               jas_cmshapmatlut_init(&shapmat->luts[i]);
+       for (i = 0; i < 3; ++i) {
+               for (j = 0; j < 4; ++j)
+                       shapmat->mat[i][j] = 0.0;
+       }
+       ++pxform->refcnt;
+       return pxform;
+}
+
+static void jas_cmshapmat_destroy(jas_cmpxform_t *pxform)
+{
+       jas_cmshapmat_t *shapmat = &pxform->data.shapmat;
+       int i;
+       for (i = 0; i < 3; ++i)
+               jas_cmshapmatlut_cleanup(&shapmat->luts[i]);
+}
+
+static int jas_cmshapmat_apply(jas_cmpxform_t *pxform, jas_cmreal_t *in,
+  jas_cmreal_t *out, int cnt)
+{
+       jas_cmshapmat_t *shapmat = &pxform->data.shapmat;
+       jas_cmreal_t *src;
+       jas_cmreal_t *dst;
+       jas_cmreal_t a0;
+       jas_cmreal_t a1;
+       jas_cmreal_t a2;
+       jas_cmreal_t b0;
+       jas_cmreal_t b1;
+       jas_cmreal_t b2;
+       src = in;
+       dst = out;
+       if (!shapmat->mono) {
+               while (--cnt >= 0) {
+                       a0 = *src++;
+                       a1 = *src++;
+                       a2 = *src++;
+                       if (!shapmat->order && shapmat->useluts) {
+                               a0 = jas_cmshapmatlut_lookup(&shapmat->luts[0], a0);
+                               a1 = jas_cmshapmatlut_lookup(&shapmat->luts[1], a1);
+                               a2 = jas_cmshapmatlut_lookup(&shapmat->luts[2], a2);
+                       }
+                       if (shapmat->usemat) {
+                               b0 = shapmat->mat[0][0] * a0
+                                 + shapmat->mat[0][1] * a1
+                                 + shapmat->mat[0][2] * a2
+                                 + shapmat->mat[0][3];
+                               b1 = shapmat->mat[1][0] * a0
+                                 + shapmat->mat[1][1] * a1
+                                 + shapmat->mat[1][2] * a2
+                                 + shapmat->mat[1][3];
+                               b2 = shapmat->mat[2][0] * a0
+                                 + shapmat->mat[2][1] * a1
+                                 + shapmat->mat[2][2] * a2
+                                 + shapmat->mat[2][3];
+                               a0 = b0;
+                               a1 = b1;
+                               a2 = b2;
+                       }
+                       if (shapmat->order && shapmat->useluts) {
+                               a0 = jas_cmshapmatlut_lookup(&shapmat->luts[0], a0);
+                               a1 = jas_cmshapmatlut_lookup(&shapmat->luts[1], a1);
+                               a2 = jas_cmshapmatlut_lookup(&shapmat->luts[2], a2);
+                       }
+                       *dst++ = a0;
+                       *dst++ = a1;
+                       *dst++ = a2;
+               }
+       } else {
+               if (!shapmat->order) {
+                       while (--cnt >= 0) {
+                               a0 = *src++;
+                               if (shapmat->useluts)
+                                       a0 = jas_cmshapmatlut_lookup(&shapmat->luts[0], a0);
+                               a2 = a0 * shapmat->mat[2][0];
+                               a1 = a0 * shapmat->mat[1][0];
+                               a0 = a0 * shapmat->mat[0][0];
+                               *dst++ = a0;
+                               *dst++ = a1;
+                               *dst++ = a2;
+                       }
+               } else {
+assert(0);
+                       while (--cnt >= 0) {
+                               a0 = *src++;
+                               src++;
+                               src++;
+                               a0 = a0 * shapmat->mat[0][0];
+                               if (shapmat->useluts)
+                                       a0 = jas_cmshapmatlut_lookup(&shapmat->luts[0], a0);
+                               *dst++ = a0;
+                       }
+               }
+       }
+
+       return 0;
+}
+
+static void jas_cmshapmatlut_init(jas_cmshapmatlut_t *lut)
+{
+       lut->data = 0;
+       lut->size = 0;
+}
+
+static void jas_cmshapmatlut_cleanup(jas_cmshapmatlut_t *lut)
+{
+       if (lut->data) {
+               jas_free(lut->data);
+               lut->data = 0;
+       }
+       lut->size = 0;
+}
+
+static double gammafn(double x, double gamma)
+{
+       if (x == 0.0)
+               return 0.0;
+       return pow(x, gamma);
+}
+
+static int jas_cmshapmatlut_set(jas_cmshapmatlut_t *lut, jas_icccurv_t *curv)
+{
+       jas_cmreal_t gamma;
+       int i;
+       gamma = 0;
+       jas_cmshapmatlut_cleanup(lut);
+       if (curv->numents == 0) {
+               lut->size = 2;
+               if (!(lut->data = jas_malloc(lut->size * sizeof(jas_cmreal_t))))
+                       goto error;
+               lut->data[0] = 0.0;
+               lut->data[1] = 1.0;
+       } else if (curv->numents == 1) {
+               lut->size = 256;
+               if (!(lut->data = jas_malloc(lut->size * sizeof(jas_cmreal_t))))
+                       goto error;
+               gamma = curv->ents[0] / 256.0;
+               for (i = 0; i < lut->size; ++i) {
+                       lut->data[i] = gammafn(i / (double) (lut->size - 1), gamma);
+               }
+       } else {
+               lut->size = curv->numents;
+               if (!(lut->data = jas_malloc(lut->size * sizeof(jas_cmreal_t))))
+                       goto error;
+               for (i = 0; i < lut->size; ++i) {
+                       lut->data[i] = curv->ents[i] / 65535.0;
+               }
+       }
+       return 0;
+error:
+       return -1;
+}
+
+static jas_cmreal_t jas_cmshapmatlut_lookup(jas_cmshapmatlut_t *lut, jas_cmreal_t x)
+{
+       jas_cmreal_t t;
+       int lo;
+       int hi;
+       t = x * (lut->size - 1);
+       lo = floor(t);
+       if (lo < 0)
+               return lut->data[0];
+       hi = ceil(t);
+       if (hi >= lut->size)
+               return lut->data[lut->size - 1];
+       return lut->data[lo] + (t - lo) * (lut->data[hi] - lut->data[lo]);
+}
+
+static int jas_cmshapmatlut_invert(jas_cmshapmatlut_t *invlut,
+  jas_cmshapmatlut_t *lut, int n)
+{
+       int i;
+       int j;
+       int k;
+       jas_cmreal_t ax;
+       jas_cmreal_t ay;
+       jas_cmreal_t bx;
+       jas_cmreal_t by;
+       jas_cmreal_t sx;
+       jas_cmreal_t sy;
+       assert(n >= 2);
+       if (invlut->data) {
+               jas_free(invlut->data);
+               invlut->data = 0;
+       }
+       /* The sample values should be nondecreasing. */
+       for (i = 1; i < lut->size; ++i) {
+               if (lut->data[i - 1] > lut->data[i]) {
+                       assert(0);
+                       return -1;
+               }
+       }
+       if (!(invlut->data = jas_malloc(n * sizeof(jas_cmreal_t))))
+               return -1;
+       invlut->size = n;
+       for (i = 0; i < invlut->size; ++i) {
+               sy = ((double) i) / (invlut->size - 1);
+               sx = 1.0;
+               for (j = 0; j < lut->size; ++j) {
+                       ay = lut->data[j];
+                       if (sy == ay) {
+                               for (k = j + 1; k < lut->size; ++k) {
+                                       by = lut->data[k];
+                                       if (by != sy)
+                                               break;
+#if 0
+assert(0);
+#endif
+                               }
+                               if (k < lut->size) {
+                                       --k;
+                                       ax = ((double) j) / (lut->size - 1);
+                                       bx = ((double) k) / (lut->size - 1);
+                                       sx = (ax + bx) / 2.0;
+                               }
+                               break;
+                       }
+                       if (j < lut->size - 1) {
+                               by = lut->data[j + 1];
+                               if (sy > ay && sy < by) {
+                                       ax = ((double) j) / (lut->size - 1);
+                                       bx = ((double) j + 1) / (lut->size - 1);
+                                       sx = ax +
+                                         (sy - ay) / (by - ay) * (bx - ax);
+                                       break;
+                               }
+                       }
+               }
+               invlut->data[i] = sx;
+       }
+#if 0
+for (i=0;i<lut->size;++i)
+       jas_eprintf("lut[%d]=%f ", i, lut->data[i]);
+for (i=0;i<invlut->size;++i)
+       jas_eprintf("invlut[%d]=%f ", i, invlut->data[i]);
+#endif
+       return 0;
+}
+
+static int jas_cmshapmat_invmat(jas_cmreal_t out[3][4], jas_cmreal_t in[3][4])
+{
+       jas_cmreal_t d;
+       d = in[0][0] * (in[1][1] * in[2][2] - in[1][2] * in[2][1])
+         - in[0][1] * (in[1][0] * in[2][2] - in[1][2] * in[2][0])
+         + in[0][2] * (in[1][0] * in[2][1] - in[1][1] * in[2][0]);
+#if 0
+jas_eprintf("delta=%f\n", d);
+#endif
+       if (JAS_ABS(d) < 1e-6)
+               return -1;
+       out[0][0] = (in[1][1] * in[2][2] - in[1][2] * in[2][1]) / d;
+       out[1][0] = -(in[1][0] * in[2][2] - in[1][2] * in[2][0]) / d;
+       out[2][0] = (in[1][0] * in[2][1] - in[1][1] * in[2][0]) / d;
+       out[0][1] = -(in[0][1] * in[2][2] - in[0][2] * in[2][1]) / d;
+       out[1][1] = (in[0][0] * in[2][2] - in[0][2] * in[2][0]) / d;
+       out[2][1] = -(in[0][0] * in[2][1] - in[0][1] * in[2][0]) / d;
+       out[0][2] = (in[0][1] * in[1][2] - in[0][2] * in[1][1]) / d;
+       out[1][2] = -(in[0][0] * in[1][2] - in[1][0] * in[0][2]) / d;
+       out[2][2] = (in[0][0] * in[1][1] - in[0][1] * in[1][0]) / d;
+       out[0][3] = -in[0][3];
+       out[1][3] = -in[1][3];
+       out[2][3] = -in[2][3];
+#if 0
+jas_eprintf("[ %f %f %f %f ]\n[ %f %f %f %f ]\n[ %f %f %f %f ]\n",
+in[0][0], in[0][1], in[0][2], in[0][3],
+in[1][0], in[1][1], in[1][2], in[1][3],
+in[2][0], in[2][1], in[2][2], in[2][3]);
+jas_eprintf("[ %f %f %f %f ]\n[ %f %f %f %f ]\n[ %f %f %f %f ]\n",
+out[0][0], out[0][1], out[0][2], out[0][3],
+out[1][0], out[1][1], out[1][2], out[1][3],
+out[2][0], out[2][1], out[2][2], out[2][3]);
+#endif
+       return 0;
+}
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+static int icctoclrspc(int iccclrspc, int refflag)
+{
+       if (refflag) {
+               switch (iccclrspc) {
+               case JAS_ICC_COLORSPC_XYZ:
+                       return JAS_CLRSPC_CIEXYZ;
+               case JAS_ICC_COLORSPC_LAB:
+                       return JAS_CLRSPC_CIELAB;
+               default:
+                       abort();
+                       break;
+               }
+       } else {
+               switch (iccclrspc) {
+               case JAS_ICC_COLORSPC_YCBCR:
+                       return JAS_CLRSPC_GENYCBCR;
+               case JAS_ICC_COLORSPC_RGB:
+                       return JAS_CLRSPC_GENRGB;
+               case JAS_ICC_COLORSPC_GRAY:
+                       return JAS_CLRSPC_GENGRAY;
+               default:
+                       abort();
+                       break;
+               }
+       }
+}
+
+static int mono(jas_iccprof_t *iccprof, int op, jas_cmpxformseq_t **retpxformseq)
+{
+       jas_iccattrval_t *graytrc;
+       jas_cmshapmat_t *shapmat;
+       jas_cmpxform_t *pxform;
+       jas_cmpxformseq_t *pxformseq;
+       jas_cmshapmatlut_t lut;
+
+       jas_cmshapmatlut_init(&lut);
+       if (!(graytrc = jas_iccprof_getattr(iccprof, JAS_ICC_TAG_GRYTRC)) ||
+         graytrc->type != JAS_ICC_TYPE_CURV)
+               goto error;
+       if (!(pxform = jas_cmpxform_createshapmat()))
+               goto error;
+       shapmat = &pxform->data.shapmat;
+       if (!(pxformseq = jas_cmpxformseq_create()))
+               goto error;
+       if (jas_cmpxformseq_insertpxform(pxformseq, -1, pxform))
+               goto error;
+
+       pxform->numinchans = 1;
+       pxform->numoutchans = 3;
+
+       shapmat->mono = 1;
+       shapmat->useluts = 1;
+       shapmat->usemat = 1;
+       if (!op) {
+               shapmat->order = 0;
+               shapmat->mat[0][0] = 0.9642;
+               shapmat->mat[1][0] = 1.0;
+               shapmat->mat[2][0] = 0.8249;
+               if (jas_cmshapmatlut_set(&shapmat->luts[0], &graytrc->data.curv))
+                       goto error;
+       } else {
+               shapmat->order = 1;
+               shapmat->mat[0][0] = 1.0 / 0.9642;
+               shapmat->mat[1][0] = 1.0;
+               shapmat->mat[2][0] = 1.0 / 0.8249;
+               jas_cmshapmatlut_init(&lut);
+               if (jas_cmshapmatlut_set(&lut, &graytrc->data.curv))
+                       goto error;
+               if (jas_cmshapmatlut_invert(&shapmat->luts[0], &lut, lut.size))
+                       goto error;
+               jas_cmshapmatlut_cleanup(&lut);
+       }
+       jas_iccattrval_destroy(graytrc);
+       jas_cmpxform_destroy(pxform);
+       *retpxformseq = pxformseq;
+       return 0;
+error:
+       return -1;
+}
+
+static int triclr(jas_iccprof_t *iccprof, int op, jas_cmpxformseq_t **retpxformseq)
+{
+       int i;
+       jas_iccattrval_t *trcs[3];
+       jas_iccattrval_t *cols[3];
+       jas_cmshapmat_t *shapmat;
+       jas_cmpxform_t *pxform;
+       jas_cmpxformseq_t *pxformseq;
+       jas_cmreal_t mat[3][4];
+       jas_cmshapmatlut_t lut;
+
+       pxform = 0;
+       pxformseq = 0;
+       for (i = 0; i < 3; ++i) {
+               trcs[i] = 0;
+               cols[i] = 0;
+       }
+       jas_cmshapmatlut_init(&lut);
+
+       if (!(trcs[0] = jas_iccprof_getattr(iccprof, JAS_ICC_TAG_REDTRC)) ||
+         !(trcs[1] = jas_iccprof_getattr(iccprof, JAS_ICC_TAG_GRNTRC)) ||
+         !(trcs[2] = jas_iccprof_getattr(iccprof, JAS_ICC_TAG_BLUTRC)) ||
+         !(cols[0] = jas_iccprof_getattr(iccprof, JAS_ICC_TAG_REDMATCOL)) ||
+         !(cols[1] = jas_iccprof_getattr(iccprof, JAS_ICC_TAG_GRNMATCOL)) ||
+         !(cols[2] = jas_iccprof_getattr(iccprof, JAS_ICC_TAG_BLUMATCOL)))
+               goto error;
+       for (i = 0; i < 3; ++i) {
+               if (trcs[i]->type != JAS_ICC_TYPE_CURV ||
+                 cols[i]->type != JAS_ICC_TYPE_XYZ)
+                       goto error;
+       }
+       if (!(pxform = jas_cmpxform_createshapmat()))
+               goto error;
+       pxform->numinchans = 3;
+       pxform->numoutchans = 3;
+       shapmat = &pxform->data.shapmat;
+       if (!(pxformseq = jas_cmpxformseq_create()))
+               goto error;
+       if (jas_cmpxformseq_insertpxform(pxformseq, -1, pxform))
+               goto error;
+       shapmat->mono = 0;
+       shapmat->useluts = 1;
+       shapmat->usemat = 1;
+       if (!op) {
+               shapmat->order = 0;
+               for (i = 0; i < 3; ++i) {
+                       shapmat->mat[0][i] = cols[i]->data.xyz.x / 65536.0;
+                       shapmat->mat[1][i] = cols[i]->data.xyz.y / 65536.0;
+                       shapmat->mat[2][i] = cols[i]->data.xyz.z / 65536.0;
+               }
+               for (i = 0; i < 3; ++i)
+                       shapmat->mat[i][3] = 0.0;
+               for (i = 0; i < 3; ++i) {
+                       if (jas_cmshapmatlut_set(&shapmat->luts[i], &trcs[i]->data.curv))
+                               goto error;
+               }
+       } else {
+               shapmat->order = 1;
+               for (i = 0; i < 3; ++i) {
+                       mat[0][i] = cols[i]->data.xyz.x / 65536.0;
+                       mat[1][i] = cols[i]->data.xyz.y / 65536.0;
+                       mat[2][i] = cols[i]->data.xyz.z / 65536.0;
+               }
+               for (i = 0; i < 3; ++i)
+                       mat[i][3] = 0.0;
+               if (jas_cmshapmat_invmat(shapmat->mat, mat))
+                       goto error;
+               for (i = 0; i < 3; ++i) {
+                       jas_cmshapmatlut_init(&lut);
+                       if (jas_cmshapmatlut_set(&lut, &trcs[i]->data.curv))
+                               goto error;
+                       if (jas_cmshapmatlut_invert(&shapmat->luts[i], &lut, lut.size))
+                               goto error;
+                       jas_cmshapmatlut_cleanup(&lut);
+               }
+       }
+       for (i = 0; i < 3; ++i) {
+               jas_iccattrval_destroy(trcs[i]);
+               jas_iccattrval_destroy(cols[i]);
+       }
+       jas_cmpxform_destroy(pxform);
+       *retpxformseq = pxformseq;
+       return 0;
+
+error:
+
+       for (i = 0; i < 3; ++i) {
+               if (trcs[i]) {
+                       jas_iccattrval_destroy(trcs[i]);
+               }
+               if (cols[i]) {
+                       jas_iccattrval_destroy(cols[i]);
+               }
+       }
+       if (pxformseq) {
+               jas_cmpxformseq_destroy(pxformseq);
+       }
+       if (pxform) {
+               jas_cmpxform_destroy(pxform);
+       }
+
+       return -1;
+}
+
+static int jas_cmgetint(long **bufptr, int sgnd, int prec, long *val)
+{
+       long v;
+       int m;
+       v = **bufptr;
+       if (sgnd) {
+               m = (1 << (prec - 1));
+               if (v < -m || v >= m)
+                       return -1;
+       } else {
+               if (v < 0 || v >= (1 << prec))
+                       return -1;
+       }
+       ++(*bufptr);
+       *val = v;
+       return 0;
+}
+
+static int jas_cmputint(long **bufptr, int sgnd, int prec, long val)
+{
+       int m;
+       if (sgnd) {
+               m = (1 << (prec - 1));
+               if (val < -m || val >= m)
+                       return -1;
+       } else {
+               if (val < 0 || val >= (1 << prec))
+                       return -1;
+       }
+       **bufptr = val;
+       ++(*bufptr);
+       return 0;
+}
+
+int jas_clrspc_numchans(int clrspc)
+{
+       switch (jas_clrspc_fam(clrspc)) {
+       case JAS_CLRSPC_FAM_XYZ:
+       case JAS_CLRSPC_FAM_LAB:
+       case JAS_CLRSPC_FAM_RGB:
+       case JAS_CLRSPC_FAM_YCBCR:
+               return 3;
+               break;
+       case JAS_CLRSPC_FAM_GRAY:
+               return 1;
+               break;
+       default:
+               abort();
+               break;
+       }
+}
+
+jas_iccprof_t *jas_iccprof_createfromcmprof(jas_cmprof_t *prof)
+{
+       return jas_iccprof_copy(prof->iccprof);
+}
diff --git a/src/libjasper/base/jas_debug.c b/src/libjasper/base/jas_debug.c
new file mode 100644 (file)
index 0000000..8a762d5
--- /dev/null
@@ -0,0 +1,137 @@
+/*
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <stdarg.h>
+#include <stdio.h>
+
+#include "jasper/jas_types.h"
+#include "jasper/jas_debug.h"
+
+/******************************************************************************\
+* Local data.
+\******************************************************************************/
+
+static int jas_dbglevel = 0;
+/* The debug level. */
+
+/******************************************************************************\
+* Code for getting/setting the debug level.
+\******************************************************************************/
+
+/* Set the library debug level. */
+int jas_setdbglevel(int dbglevel)
+{
+       int olddbglevel;
+
+       /* Save the old debug level. */
+       olddbglevel = jas_dbglevel;
+
+       /* Change the debug level. */
+       jas_dbglevel = dbglevel;
+
+       /* Return the old debug level. */
+       return olddbglevel;
+}
+
+/* Get the library debug level. */
+int jas_getdbglevel()
+{
+       return jas_dbglevel;
+}
+
+/******************************************************************************\
+* Code.
+\******************************************************************************/
+
+/* Perform formatted output to standard error. */
+int jas_eprintf(const char *fmt, ...)
+{
+       int ret;
+       va_list ap;
+
+       va_start(ap, fmt);
+       ret = vfprintf(stderr, fmt, ap);
+       va_end(ap);
+       return ret;
+}
+
+/* Dump memory to a stream. */
+int jas_memdump(FILE *out, void *data, size_t len)
+{
+       size_t i;
+       size_t j;
+       uchar *dp;
+       dp = data;
+       for (i = 0; i < len; i += 16) {
+               fprintf(out, "%04x:", i);
+               for (j = 0; j < 16; ++j) {
+                       if (i + j < len) {
+                               fprintf(out, " %02x", dp[i + j]);
+                       }
+               }
+               fprintf(out, "\n");
+       }
+       return 0;
+}
diff --git a/src/libjasper/base/jas_getopt.c b/src/libjasper/base/jas_getopt.c
new file mode 100644 (file)
index 0000000..2a3dfe5
--- /dev/null
@@ -0,0 +1,168 @@
+/*
+ * Copyright (c) 1999-2000, Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved. 
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Command Line Option Parsing Library
+ *
+ * $Id$
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <stdio.h>
+#include <string.h>
+
+#include "jasper/jas_getopt.h"
+#include "jasper/jas_math.h"
+
+/******************************************************************************\
+* Global data.
+\******************************************************************************/
+
+int jas_optind = 0;
+int jas_opterr = 1;
+char *jas_optarg = 0;
+
+/******************************************************************************\
+* Code.
+\******************************************************************************/
+
+static jas_opt_t *jas_optlookup(jas_opt_t *opts, char *name)
+{
+       jas_opt_t *opt;
+
+       for (opt = opts; opt->id >= 0 && opt->name; ++opt) {
+               if (!strcmp(opt->name, name)) {
+                       return opt;
+               }
+       }
+       return 0;
+}
+
+int jas_getopt(int argc, char **argv, jas_opt_t *opts)
+{
+       char *cp;
+       int id;
+       int hasarg;
+       jas_opt_t *opt;
+       char *s;
+
+       if (!jas_optind) {
+               jas_optind = JAS_MIN(1, argc);
+       }
+       while (jas_optind < argc) {
+               s = cp = argv[jas_optind];
+               if (*cp == '-') {
+                       /* We are processing an option. */
+                       ++jas_optind;
+                       if (*++cp == '-') {
+                               /* We are processing a long option. */
+                               ++cp;
+                               if (*cp == '\0') {
+                                       /* This is the end of the options. */
+                                       return JAS_GETOPT_EOF;
+                               }
+                               if (!(opt = jas_optlookup(opts, cp))) {
+                                       if (jas_opterr) {
+                                               jas_eprintf("unknown long option %s\n", s);
+                                       }
+                                       return JAS_GETOPT_ERR;
+                               }
+                               hasarg = (opt->flags & JAS_OPT_HASARG) != 0;
+                               id = opt->id;
+                       } else {
+                               /* We are processing a short option. */
+                               if (strlen(cp) != 1 ||
+                                 !(opt = jas_optlookup(opts, cp))) {
+                                       if (jas_opterr) {
+                                               jas_eprintf("unknown short option %s\n", s);
+                                       }
+                                       return JAS_GETOPT_ERR;
+                               }
+                               hasarg = (opt->flags & JAS_OPT_HASARG) != 0;
+                               id = opt->id;
+                       }
+                       if (hasarg) {
+                               /* The option has an argument. */
+                               if (jas_optind >= argc) {
+                                       if (jas_opterr) {
+                                               jas_eprintf("missing argument for option %s\n", s);
+                                       }
+                                       return JAS_GETOPT_ERR;
+                               }
+                               jas_optarg = argv[jas_optind];
+                               ++jas_optind;
+                       } else {
+                               /* The option does not have an argument. */
+                               jas_optarg = 0;
+                       }
+                       return id;
+               } else {
+                       /* We are not processing an option. */
+                       return JAS_GETOPT_EOF;
+               }
+       }
+       return JAS_GETOPT_EOF;
+}
diff --git a/src/libjasper/base/jas_icc.c b/src/libjasper/base/jas_icc.c
new file mode 100644 (file)
index 0000000..e5a0a2e
--- /dev/null
@@ -0,0 +1,1722 @@
+/*
+ * Copyright (c) 2002-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+#include <assert.h>
+#include <jasper/jas_config.h>
+#include <jasper/jas_types.h>
+#include <jasper/jas_malloc.h>
+#include <jasper/jas_debug.h>
+#include <jasper/jas_icc.h>
+#include <jasper/jas_cm.h>
+#include <jasper/jas_stream.h>
+#include <jasper/jas_string.h>
+
+#include <stdlib.h>
+#include <ctype.h>
+
+#define        jas_iccputuint8(out, val)       jas_iccputuint(out, 1, val)
+#define        jas_iccputuint16(out, val)      jas_iccputuint(out, 2, val)
+#define        jas_iccputsint32(out, val)      jas_iccputsint(out, 4, val)
+#define        jas_iccputuint32(out, val)      jas_iccputuint(out, 4, val)
+#define        jas_iccputuint64(out, val)      jas_iccputuint(out, 8, val)
+
+static jas_iccattrval_t *jas_iccattrval_create0(void);
+
+static int jas_iccgetuint(jas_stream_t *in, int n, ulonglong *val);
+static int jas_iccgetuint8(jas_stream_t *in, jas_iccuint8_t *val);
+static int jas_iccgetuint16(jas_stream_t *in, jas_iccuint16_t *val);
+static int jas_iccgetsint32(jas_stream_t *in, jas_iccsint32_t *val);
+static int jas_iccgetuint32(jas_stream_t *in, jas_iccuint32_t *val);
+static int jas_iccgetuint64(jas_stream_t *in, jas_iccuint64_t *val);
+static int jas_iccputuint(jas_stream_t *out, int n, ulonglong val);
+static int jas_iccputsint(jas_stream_t *out, int n, longlong val);
+static jas_iccprof_t *jas_iccprof_create(void);
+static int jas_iccprof_readhdr(jas_stream_t *in, jas_icchdr_t *hdr);
+static int jas_iccprof_writehdr(jas_stream_t *out, jas_icchdr_t *hdr);
+static int jas_iccprof_gettagtab(jas_stream_t *in, jas_icctagtab_t *tagtab);
+static void jas_iccprof_sorttagtab(jas_icctagtab_t *tagtab);
+static int jas_iccattrtab_lookup(jas_iccattrtab_t *attrtab, jas_iccuint32_t name);
+static jas_iccattrtab_t *jas_iccattrtab_copy(jas_iccattrtab_t *attrtab);
+static jas_iccattrvalinfo_t *jas_iccattrvalinfo_lookup(jas_iccsig_t name);
+static int jas_iccgettime(jas_stream_t *in, jas_icctime_t *time);
+static int jas_iccgetxyz(jas_stream_t *in, jas_iccxyz_t *xyz);
+static int jas_icctagtabent_cmp(const void *src, const void *dst);
+
+static void jas_icccurv_destroy(jas_iccattrval_t *attrval);
+static int jas_icccurv_copy(jas_iccattrval_t *attrval,
+  jas_iccattrval_t *othattrval);
+static int jas_icccurv_input(jas_iccattrval_t *attrval, jas_stream_t *in,
+  int cnt);
+static int jas_icccurv_getsize(jas_iccattrval_t *attrval);
+static int jas_icccurv_output(jas_iccattrval_t *attrval, jas_stream_t *out);
+static void jas_icccurv_dump(jas_iccattrval_t *attrval, FILE *out);
+
+static void jas_icctxtdesc_destroy(jas_iccattrval_t *attrval);
+static int jas_icctxtdesc_copy(jas_iccattrval_t *attrval,
+  jas_iccattrval_t *othattrval);
+static int jas_icctxtdesc_input(jas_iccattrval_t *attrval, jas_stream_t *in,
+  int cnt);
+static int jas_icctxtdesc_getsize(jas_iccattrval_t *attrval);
+static int jas_icctxtdesc_output(jas_iccattrval_t *attrval, jas_stream_t *out);
+static void jas_icctxtdesc_dump(jas_iccattrval_t *attrval, FILE *out);
+
+static void jas_icctxt_destroy(jas_iccattrval_t *attrval);
+static int jas_icctxt_copy(jas_iccattrval_t *attrval,
+  jas_iccattrval_t *othattrval);
+static int jas_icctxt_input(jas_iccattrval_t *attrval, jas_stream_t *in,
+  int cnt);
+static int jas_icctxt_getsize(jas_iccattrval_t *attrval);
+static int jas_icctxt_output(jas_iccattrval_t *attrval, jas_stream_t *out);
+static void jas_icctxt_dump(jas_iccattrval_t *attrval, FILE *out);
+
+static int jas_iccxyz_input(jas_iccattrval_t *attrval, jas_stream_t *in,
+  int cnt);
+static int jas_iccxyz_getsize(jas_iccattrval_t *attrval);
+static int jas_iccxyz_output(jas_iccattrval_t *attrval, jas_stream_t *out);
+static void jas_iccxyz_dump(jas_iccattrval_t *attrval, FILE *out);
+
+static jas_iccattrtab_t *jas_iccattrtab_create(void);
+static void jas_iccattrtab_destroy(jas_iccattrtab_t *tab);
+static int jas_iccattrtab_resize(jas_iccattrtab_t *tab, int maxents);
+static int jas_iccattrtab_add(jas_iccattrtab_t *attrtab, int i,
+  jas_iccuint32_t name, jas_iccattrval_t *val);
+static int jas_iccattrtab_replace(jas_iccattrtab_t *attrtab, int i,
+  jas_iccuint32_t name, jas_iccattrval_t *val);
+static void jas_iccattrtab_delete(jas_iccattrtab_t *attrtab, int i);
+static long jas_iccpadtomult(long x, long y);
+static int jas_iccattrtab_get(jas_iccattrtab_t *attrtab, int i,
+  jas_iccattrname_t *name, jas_iccattrval_t **val);
+static int jas_iccprof_puttagtab(jas_stream_t *out, jas_icctagtab_t *tagtab);
+
+static void jas_icclut16_destroy(jas_iccattrval_t *attrval);
+static int jas_icclut16_copy(jas_iccattrval_t *attrval,
+  jas_iccattrval_t *othattrval);
+static int jas_icclut16_input(jas_iccattrval_t *attrval, jas_stream_t *in,
+  int cnt);
+static int jas_icclut16_getsize(jas_iccattrval_t *attrval);
+static int jas_icclut16_output(jas_iccattrval_t *attrval, jas_stream_t *out);
+static void jas_icclut16_dump(jas_iccattrval_t *attrval, FILE *out);
+
+static void jas_icclut8_destroy(jas_iccattrval_t *attrval);
+static int jas_icclut8_copy(jas_iccattrval_t *attrval,
+  jas_iccattrval_t *othattrval);
+static int jas_icclut8_input(jas_iccattrval_t *attrval, jas_stream_t *in,
+  int cnt);
+static int jas_icclut8_getsize(jas_iccattrval_t *attrval);
+static int jas_icclut8_output(jas_iccattrval_t *attrval, jas_stream_t *out);
+static void jas_icclut8_dump(jas_iccattrval_t *attrval, FILE *out);
+
+static int jas_iccputtime(jas_stream_t *out, jas_icctime_t *ctime);
+static int jas_iccputxyz(jas_stream_t *out, jas_iccxyz_t *xyz);
+
+static long jas_iccpowi(int x, int n);
+
+static char *jas_iccsigtostr(int sig, char *buf);
+
+
+jas_iccattrvalinfo_t jas_iccattrvalinfos[] = {
+       {JAS_ICC_TYPE_CURV, {jas_icccurv_destroy, jas_icccurv_copy,
+         jas_icccurv_input, jas_icccurv_output, jas_icccurv_getsize,
+         jas_icccurv_dump}},
+       {JAS_ICC_TYPE_XYZ, {0, 0, jas_iccxyz_input, jas_iccxyz_output,
+         jas_iccxyz_getsize, jas_iccxyz_dump}},
+       {JAS_ICC_TYPE_TXTDESC, {jas_icctxtdesc_destroy,
+         jas_icctxtdesc_copy, jas_icctxtdesc_input, jas_icctxtdesc_output,
+         jas_icctxtdesc_getsize, jas_icctxtdesc_dump}},
+       {JAS_ICC_TYPE_TXT, {jas_icctxt_destroy, jas_icctxt_copy,
+         jas_icctxt_input, jas_icctxt_output, jas_icctxt_getsize,
+         jas_icctxt_dump}},
+       {JAS_ICC_TYPE_LUT8, {jas_icclut8_destroy, jas_icclut8_copy,
+         jas_icclut8_input, jas_icclut8_output, jas_icclut8_getsize,
+         jas_icclut8_dump}},
+       {JAS_ICC_TYPE_LUT16, {jas_icclut16_destroy, jas_icclut16_copy,
+         jas_icclut16_input, jas_icclut16_output, jas_icclut16_getsize,
+         jas_icclut16_dump}},
+       {0, {0, 0, 0, 0, 0, 0}}
+};
+
+typedef struct {
+       jas_iccuint32_t tag;
+       char *name;
+} jas_icctaginfo_t;
+
+/******************************************************************************\
+* profile class
+\******************************************************************************/
+
+static jas_iccprof_t *jas_iccprof_create()
+{
+       jas_iccprof_t *prof;
+       prof = 0;
+       if (!(prof = jas_malloc(sizeof(jas_iccprof_t)))) {
+               goto error;
+       }
+       if (!(prof->attrtab = jas_iccattrtab_create()))
+               goto error;
+       memset(&prof->hdr, 0, sizeof(jas_icchdr_t));
+       prof->tagtab.numents = 0;
+       prof->tagtab.ents = 0;
+       return prof;
+error:
+       if (prof)
+               jas_iccprof_destroy(prof);
+       return 0;
+}
+
+jas_iccprof_t *jas_iccprof_copy(jas_iccprof_t *prof)
+{
+       jas_iccprof_t *newprof;
+       newprof = 0;
+       if (!(newprof = jas_iccprof_create()))
+               goto error;
+       newprof->hdr = prof->hdr;
+       newprof->tagtab.numents = 0;
+       newprof->tagtab.ents = 0;
+       assert(newprof->attrtab);
+       jas_iccattrtab_destroy(newprof->attrtab);
+       if (!(newprof->attrtab = jas_iccattrtab_copy(prof->attrtab)))
+               goto error;
+       return newprof;
+error:
+       if (newprof)
+               jas_iccprof_destroy(newprof);
+       return 0;
+}
+
+void jas_iccprof_destroy(jas_iccprof_t *prof)
+{
+       if (prof->attrtab)
+               jas_iccattrtab_destroy(prof->attrtab);
+       if (prof->tagtab.ents)
+               jas_free(prof->tagtab.ents);
+       jas_free(prof);
+}
+
+void jas_iccprof_dump(jas_iccprof_t *prof, FILE *out)
+{
+       jas_iccattrtab_dump(prof->attrtab, out);
+}
+
+jas_iccprof_t *jas_iccprof_load(jas_stream_t *in)
+{
+       jas_iccprof_t *prof;
+       int numtags;
+       long curoff;
+       long reloff;
+       long prevoff;
+       jas_iccsig_t type;
+       jas_iccattrval_t *attrval;
+       jas_iccattrval_t *prevattrval;
+       jas_icctagtabent_t *tagtabent;
+       jas_iccattrvalinfo_t *attrvalinfo;
+       int i;
+       int len;
+
+       prof = 0;
+       attrval = 0;
+
+       if (!(prof = jas_iccprof_create())) {
+               goto error;
+       }
+
+       if (jas_iccprof_readhdr(in, &prof->hdr)) {
+               jas_eprintf("cannot get header\n");
+               goto error;
+       }
+       if (jas_iccprof_gettagtab(in, &prof->tagtab)) {
+               jas_eprintf("cannot get tab table\n");
+               goto error;
+       }
+       jas_iccprof_sorttagtab(&prof->tagtab);
+
+       numtags = prof->tagtab.numents;
+       curoff = JAS_ICC_HDRLEN + 4 + 12 * numtags;
+       prevoff = 0;
+       prevattrval = 0;
+       for (i = 0; i < numtags; ++i) {
+               tagtabent = &prof->tagtab.ents[i];
+               if (tagtabent->off == JAS_CAST(jas_iccuint32_t, prevoff)) {
+                       if (prevattrval) {
+                               if (!(attrval = jas_iccattrval_clone(prevattrval)))
+                                       goto error;
+                               if (jas_iccprof_setattr(prof, tagtabent->tag, attrval))
+                                       goto error;
+                               jas_iccattrval_destroy(attrval);
+                       } else {
+#if 0
+                               jas_eprintf("warning: skipping unknown tag type\n");
+#endif
+                       }
+                       continue;
+               }
+               reloff = tagtabent->off - curoff;
+               if (reloff > 0) {
+                       if (jas_stream_gobble(in, reloff) != reloff)
+                               goto error;
+                       curoff += reloff;
+               } else if (reloff < 0) {
+                       /* This should never happen since we read the tagged
+                       element data in a single pass. */
+                       abort();
+               }
+               prevoff = curoff;
+               if (jas_iccgetuint32(in, &type)) {
+                       goto error;
+               }
+               if (jas_stream_gobble(in, 4) != 4) {
+                       goto error;
+               }
+               curoff += 8;
+               if (!(attrvalinfo = jas_iccattrvalinfo_lookup(type))) {
+#if 0
+                       jas_eprintf("warning: skipping unknown tag type\n");
+#endif
+                       prevattrval = 0;
+                       continue;
+               }
+               if (!(attrval = jas_iccattrval_create(type))) {
+                       goto error;
+               }
+               len = tagtabent->len - 8;
+               if ((*attrval->ops->input)(attrval, in, len)) {
+                       goto error;
+               }
+               curoff += len;
+               if (jas_iccprof_setattr(prof, tagtabent->tag, attrval)) {
+                       goto error;
+               }
+               prevattrval = attrval; /* This is correct, but slimey. */
+               jas_iccattrval_destroy(attrval);
+               attrval = 0;
+       }
+
+       return prof;
+
+error:
+       if (prof)
+               jas_iccprof_destroy(prof);
+       if (attrval)
+               jas_iccattrval_destroy(attrval);
+       return 0;
+}
+
+int jas_iccprof_save(jas_iccprof_t *prof, jas_stream_t *out)
+{
+       long curoff;
+       long reloff;
+       long newoff;
+       int i;
+       int j;
+       jas_icctagtabent_t *tagtabent;
+       jas_icctagtabent_t *sharedtagtabent;
+       jas_icctagtabent_t *tmptagtabent;
+       jas_iccuint32_t attrname;
+       jas_iccattrval_t *attrval;
+       jas_icctagtab_t *tagtab;
+
+       tagtab = &prof->tagtab;
+       if (!(tagtab->ents = jas_malloc(prof->attrtab->numattrs *
+         sizeof(jas_icctagtabent_t))))
+               goto error;
+       tagtab->numents = prof->attrtab->numattrs;
+       curoff = JAS_ICC_HDRLEN + 4 + 12 * tagtab->numents;
+       for (i = 0; i < JAS_CAST(int, tagtab->numents); ++i) {
+               tagtabent = &tagtab->ents[i];
+               if (jas_iccattrtab_get(prof->attrtab, i, &attrname, &attrval))
+                       goto error;
+               assert(attrval->ops->output);
+               tagtabent->tag = attrname;
+               tagtabent->data = &attrval->data;
+               sharedtagtabent = 0;
+               for (j = 0; j < i; ++j) {
+                       tmptagtabent = &tagtab->ents[j];
+                       if (tagtabent->data == tmptagtabent->data) {
+                               sharedtagtabent = tmptagtabent;
+                               break;
+                       }
+               }
+               if (sharedtagtabent) {
+                       tagtabent->off = sharedtagtabent->off;
+                       tagtabent->len = sharedtagtabent->len;
+                       tagtabent->first = sharedtagtabent;
+               } else {
+                       tagtabent->off = curoff;
+                       tagtabent->len = (*attrval->ops->getsize)(attrval) + 8;
+                       tagtabent->first = 0;
+                       if (i < JAS_CAST(int, tagtab->numents - 1)) {
+                               curoff = jas_iccpadtomult(curoff + tagtabent->len, 4);
+                       } else {
+                               curoff += tagtabent->len;
+                       }
+               }
+               jas_iccattrval_destroy(attrval);
+       }
+       prof->hdr.size = curoff;
+       if (jas_iccprof_writehdr(out, &prof->hdr))
+               goto error;
+       if (jas_iccprof_puttagtab(out, &prof->tagtab))
+               goto error;
+       curoff = JAS_ICC_HDRLEN + 4 + 12 * tagtab->numents;
+       for (i = 0; i < JAS_CAST(int, tagtab->numents);) {
+               tagtabent = &tagtab->ents[i];
+               assert(curoff == JAS_CAST(long, tagtabent->off));
+               if (jas_iccattrtab_get(prof->attrtab, i, &attrname, &attrval))
+                       goto error;
+               if (jas_iccputuint32(out, attrval->type) || jas_stream_pad(out,
+                 4, 0) != 4)
+                       goto error;
+               if ((*attrval->ops->output)(attrval, out))
+                       goto error;
+               jas_iccattrval_destroy(attrval);
+               curoff += tagtabent->len;
+               ++i;
+               while (i < JAS_CAST(int, tagtab->numents) &&
+                 tagtab->ents[i].first)
+                       ++i;
+               newoff = (i < JAS_CAST(int, tagtab->numents)) ?
+                 tagtab->ents[i].off : prof->hdr.size;
+               reloff = newoff - curoff;
+               assert(reloff >= 0);
+               if (reloff > 0) {
+                       if (jas_stream_pad(out, reloff, 0) != reloff)
+                               goto error;
+                       curoff += reloff;
+               }
+       }       
+       return 0;
+error:
+       /* XXX - need to free some resources here */
+       return -1;
+}
+
+static int jas_iccprof_writehdr(jas_stream_t *out, jas_icchdr_t *hdr)
+{
+       if (jas_iccputuint32(out, hdr->size) ||
+         jas_iccputuint32(out, hdr->cmmtype) ||
+         jas_iccputuint32(out, hdr->version) ||
+         jas_iccputuint32(out, hdr->clas) ||
+         jas_iccputuint32(out, hdr->colorspc) ||
+         jas_iccputuint32(out, hdr->refcolorspc) ||
+         jas_iccputtime(out, &hdr->ctime) ||
+         jas_iccputuint32(out, hdr->magic) ||
+         jas_iccputuint32(out, hdr->platform) ||
+         jas_iccputuint32(out, hdr->flags) ||
+         jas_iccputuint32(out, hdr->maker) ||
+         jas_iccputuint32(out, hdr->model) ||
+         jas_iccputuint64(out, hdr->attr) ||
+         jas_iccputuint32(out, hdr->intent) ||
+         jas_iccputxyz(out, &hdr->illum) ||
+         jas_iccputuint32(out, hdr->creator) ||
+         jas_stream_pad(out, 44, 0) != 44)
+               return -1;
+       return 0;
+}
+
+static int jas_iccprof_puttagtab(jas_stream_t *out, jas_icctagtab_t *tagtab)
+{
+       int i;
+       jas_icctagtabent_t *tagtabent;
+       if (jas_iccputuint32(out, tagtab->numents))
+               goto error;
+       for (i = 0; i < JAS_CAST(int, tagtab->numents); ++i) {
+               tagtabent = &tagtab->ents[i];
+               if (jas_iccputuint32(out, tagtabent->tag) ||
+                 jas_iccputuint32(out, tagtabent->off) ||
+                 jas_iccputuint32(out, tagtabent->len))
+                       goto error;
+       }
+       return 0;
+error:
+       return -1;
+}
+
+static int jas_iccprof_readhdr(jas_stream_t *in, jas_icchdr_t *hdr)
+{
+       if (jas_iccgetuint32(in, &hdr->size) ||
+         jas_iccgetuint32(in, &hdr->cmmtype) ||
+         jas_iccgetuint32(in, &hdr->version) ||
+         jas_iccgetuint32(in, &hdr->clas) ||
+         jas_iccgetuint32(in, &hdr->colorspc) ||
+         jas_iccgetuint32(in, &hdr->refcolorspc) ||
+         jas_iccgettime(in, &hdr->ctime) ||
+         jas_iccgetuint32(in, &hdr->magic) ||
+         jas_iccgetuint32(in, &hdr->platform) ||
+         jas_iccgetuint32(in, &hdr->flags) ||
+         jas_iccgetuint32(in, &hdr->maker) ||
+         jas_iccgetuint32(in, &hdr->model) ||
+         jas_iccgetuint64(in, &hdr->attr) ||
+         jas_iccgetuint32(in, &hdr->intent) ||
+         jas_iccgetxyz(in, &hdr->illum) ||
+         jas_iccgetuint32(in, &hdr->creator) ||
+         jas_stream_gobble(in, 44) != 44)
+               return -1;
+       return 0;
+}
+
+static int jas_iccprof_gettagtab(jas_stream_t *in, jas_icctagtab_t *tagtab)
+{
+       int i;
+       jas_icctagtabent_t *tagtabent;
+
+       if (tagtab->ents) {
+               jas_free(tagtab->ents);
+               tagtab->ents = 0;
+       }
+       if (jas_iccgetuint32(in, &tagtab->numents))
+               goto error;
+       if (!(tagtab->ents = jas_malloc(tagtab->numents *
+         sizeof(jas_icctagtabent_t))))
+               goto error;
+       tagtabent = tagtab->ents;
+       for (i = 0; i < JAS_CAST(long, tagtab->numents); ++i) {
+               if (jas_iccgetuint32(in, &tagtabent->tag) ||
+               jas_iccgetuint32(in, &tagtabent->off) ||
+               jas_iccgetuint32(in, &tagtabent->len))
+                       goto error;
+               ++tagtabent;
+       }
+       return 0;
+error:
+       if (tagtab->ents) {
+               jas_free(tagtab->ents);
+               tagtab->ents = 0;
+       }
+       return -1;
+}
+
+jas_iccattrval_t *jas_iccprof_getattr(jas_iccprof_t *prof,
+  jas_iccattrname_t name)
+{
+       int i;
+       jas_iccattrval_t *attrval;
+       if ((i = jas_iccattrtab_lookup(prof->attrtab, name)) < 0)
+               goto error;
+       if (!(attrval = jas_iccattrval_clone(prof->attrtab->attrs[i].val)))
+               goto error;
+       return attrval;
+error:
+       return 0;
+}
+
+int jas_iccprof_setattr(jas_iccprof_t *prof, jas_iccattrname_t name,
+  jas_iccattrval_t *val)
+{
+       int i;
+       if ((i = jas_iccattrtab_lookup(prof->attrtab, name)) >= 0) {
+               if (val) {
+                       if (jas_iccattrtab_replace(prof->attrtab, i, name, val))
+                               goto error;
+               } else {
+                       jas_iccattrtab_delete(prof->attrtab, i);
+               }
+       } else {
+               if (val) {
+                       if (jas_iccattrtab_add(prof->attrtab, -1, name, val))
+                               goto error;
+               } else {
+                       /* NOP */
+               }
+       }
+       return 0;
+error:
+       return -1;
+}
+
+int jas_iccprof_gethdr(jas_iccprof_t *prof, jas_icchdr_t *hdr)
+{
+       *hdr = prof->hdr;
+       return 0;
+}
+
+int jas_iccprof_sethdr(jas_iccprof_t *prof, jas_icchdr_t *hdr)
+{
+       prof->hdr = *hdr;
+       return 0;
+}
+
+static void jas_iccprof_sorttagtab(jas_icctagtab_t *tagtab)
+{
+       qsort(tagtab->ents, tagtab->numents, sizeof(jas_icctagtabent_t),
+         jas_icctagtabent_cmp);
+}
+
+static int jas_icctagtabent_cmp(const void *src, const void *dst)
+{
+       jas_icctagtabent_t *srctagtabent = JAS_CAST(jas_icctagtabent_t *, src);
+       jas_icctagtabent_t *dsttagtabent = JAS_CAST(jas_icctagtabent_t *, dst);
+       if (srctagtabent->off > dsttagtabent->off) {
+               return 1;
+       } else if (srctagtabent->off < dsttagtabent->off) {
+               return -1;
+       }
+       return 0;
+}
+
+static jas_iccattrvalinfo_t *jas_iccattrvalinfo_lookup(jas_iccsig_t type)
+{
+       jas_iccattrvalinfo_t *info;
+       info = jas_iccattrvalinfos;
+       for (info = jas_iccattrvalinfos; info->type; ++info) {
+               if (info->type == type) {
+                       return info;
+               }
+       }
+       return 0;
+}
+
+static int jas_iccgettime(jas_stream_t *in, jas_icctime_t *time)
+{
+       if (jas_iccgetuint16(in, &time->year) ||
+         jas_iccgetuint16(in, &time->month) ||
+         jas_iccgetuint16(in, &time->day) ||
+         jas_iccgetuint16(in, &time->hour) ||
+         jas_iccgetuint16(in, &time->min) ||
+         jas_iccgetuint16(in, &time->sec)) {
+               return -1;
+       }
+       return 0;
+}
+
+static int jas_iccgetxyz(jas_stream_t *in, jas_iccxyz_t *xyz)
+{
+       if (jas_iccgetsint32(in, &xyz->x) ||
+         jas_iccgetsint32(in, &xyz->y) ||
+         jas_iccgetsint32(in, &xyz->z)) {
+               return -1;
+       }
+       return 0;
+}
+
+static int jas_iccputtime(jas_stream_t *out, jas_icctime_t *time)
+{
+       jas_iccputuint16(out, time->year);
+       jas_iccputuint16(out, time->month);
+       jas_iccputuint16(out, time->day);
+       jas_iccputuint16(out, time->hour);
+       jas_iccputuint16(out, time->min);
+       jas_iccputuint16(out, time->sec);
+       return 0;
+}
+
+static int jas_iccputxyz(jas_stream_t *out, jas_iccxyz_t *xyz)
+{
+       jas_iccputuint32(out, xyz->x);
+       jas_iccputuint32(out, xyz->y);
+       jas_iccputuint32(out, xyz->z);
+       return 0;
+}
+
+/******************************************************************************\
+* attribute table class
+\******************************************************************************/
+
+static jas_iccattrtab_t *jas_iccattrtab_create()
+{
+       jas_iccattrtab_t *tab;
+       tab = 0;
+       if (!(tab = jas_malloc(sizeof(jas_iccattrtab_t))))
+               goto error;
+       tab->maxattrs = 0;
+       tab->numattrs = 0;
+       tab->attrs = 0;
+       if (jas_iccattrtab_resize(tab, 32))
+               goto error;
+       return tab;
+error:
+       if (tab)
+               jas_iccattrtab_destroy(tab);
+       return 0;
+}
+
+static jas_iccattrtab_t *jas_iccattrtab_copy(jas_iccattrtab_t *attrtab)
+{
+       jas_iccattrtab_t *newattrtab;
+       int i;
+       if (!(newattrtab = jas_iccattrtab_create()))
+               goto error;
+       for (i = 0; i < attrtab->numattrs; ++i) {
+               if (jas_iccattrtab_add(newattrtab, i, attrtab->attrs[i].name,
+                 attrtab->attrs[i].val))
+                       goto error;
+       }
+       return newattrtab;
+error:
+       return 0;
+}
+
+static void jas_iccattrtab_destroy(jas_iccattrtab_t *tab)
+{
+       if (tab->attrs) {
+               while (tab->numattrs > 0) {
+                       jas_iccattrtab_delete(tab, 0);
+               }
+               jas_free(tab->attrs);
+       }
+       jas_free(tab);
+}
+
+void jas_iccattrtab_dump(jas_iccattrtab_t *attrtab, FILE *out)
+{
+       int i;
+       jas_iccattr_t *attr;
+       jas_iccattrval_t *attrval;
+       jas_iccattrvalinfo_t *info;
+       char buf[16];
+       fprintf(out, "numattrs=%d\n", attrtab->numattrs);
+       fprintf(out, "---\n");
+       for (i = 0; i < attrtab->numattrs; ++i) {
+               attr = &attrtab->attrs[i];
+               attrval = attr->val;
+               info = jas_iccattrvalinfo_lookup(attrval->type);
+               if (!info) abort();
+               fprintf(out, "attrno=%d; attrname=\"%s\"(0x%08x); attrtype=\"%s\"(0x%08x)\n",
+                 i,
+                 jas_iccsigtostr(attr->name, &buf[0]),
+                 attr->name,
+                 jas_iccsigtostr(attrval->type, &buf[8]),
+                 attrval->type
+                 );
+               jas_iccattrval_dump(attrval, out);
+               fprintf(out, "---\n");
+       }
+}
+
+static int jas_iccattrtab_resize(jas_iccattrtab_t *tab, int maxents)
+{
+       jas_iccattr_t *newattrs;
+       assert(maxents >= tab->numattrs);
+       newattrs = tab->attrs ? jas_realloc(tab->attrs, maxents *
+         sizeof(jas_iccattr_t)) : jas_malloc(maxents * sizeof(jas_iccattr_t));
+       if (!newattrs)
+               return -1;
+       tab->attrs = newattrs;
+       tab->maxattrs = maxents;
+       return 0;
+}
+
+static int jas_iccattrtab_add(jas_iccattrtab_t *attrtab, int i,
+  jas_iccuint32_t name, jas_iccattrval_t *val)
+{
+       int n;
+       jas_iccattr_t *attr;
+       jas_iccattrval_t *tmpattrval;
+       tmpattrval = 0;
+       if (i < 0) {
+               i = attrtab->numattrs;
+       }
+       assert(i >= 0 && i <= attrtab->numattrs);
+       if (attrtab->numattrs >= attrtab->maxattrs) {
+               if (jas_iccattrtab_resize(attrtab, attrtab->numattrs + 32)) {
+                       goto error;
+               }
+       }
+       if (!(tmpattrval = jas_iccattrval_clone(val)))
+               goto error;
+       n = attrtab->numattrs - i;
+       if (n > 0)
+               memmove(&attrtab->attrs[i + 1], &attrtab->attrs[i],
+                 n * sizeof(jas_iccattr_t));
+       attr = &attrtab->attrs[i];
+       attr->name = name;
+       attr->val = tmpattrval;
+       ++attrtab->numattrs;
+       return 0;
+error:
+       if (tmpattrval)
+               jas_iccattrval_destroy(tmpattrval);
+       return -1;
+}
+
+static int jas_iccattrtab_replace(jas_iccattrtab_t *attrtab, int i,
+  jas_iccuint32_t name, jas_iccattrval_t *val)
+{
+       jas_iccattrval_t *newval;
+       jas_iccattr_t *attr;
+       if (!(newval = jas_iccattrval_clone(val)))
+               goto error;
+       attr = &attrtab->attrs[i];
+       jas_iccattrval_destroy(attr->val);
+       attr->name = name;
+       attr->val = newval;
+       return 0;
+error:
+       return -1;
+}
+
+static void jas_iccattrtab_delete(jas_iccattrtab_t *attrtab, int i)
+{
+       int n;
+       jas_iccattrval_destroy(attrtab->attrs[i].val);
+       if ((n = attrtab->numattrs - i - 1) > 0)
+               memmove(&attrtab->attrs[i], &attrtab->attrs[i + 1],
+                 n * sizeof(jas_iccattr_t));
+       --attrtab->numattrs;
+}
+
+static int jas_iccattrtab_get(jas_iccattrtab_t *attrtab, int i,
+  jas_iccattrname_t *name, jas_iccattrval_t **val)
+{
+       jas_iccattr_t *attr;
+       if (i < 0 || i >= attrtab->numattrs)
+               goto error;
+       attr = &attrtab->attrs[i];
+       *name = attr->name;
+       if (!(*val = jas_iccattrval_clone(attr->val)))
+               goto error;
+       return 0;
+error:
+       return -1;
+}
+
+static int jas_iccattrtab_lookup(jas_iccattrtab_t *attrtab,
+  jas_iccuint32_t name)
+{
+       int i;
+       jas_iccattr_t *attr;
+       for (i = 0; i < attrtab->numattrs; ++i) {
+               attr = &attrtab->attrs[i];
+               if (attr->name == name)
+                       return i;
+       }
+       return -1;
+}
+
+/******************************************************************************\
+* attribute value class
+\******************************************************************************/
+
+jas_iccattrval_t *jas_iccattrval_create(jas_iccuint32_t type)
+{
+       jas_iccattrval_t *attrval;
+       jas_iccattrvalinfo_t *info;
+
+       if (!(info = jas_iccattrvalinfo_lookup(type)))
+               goto error;
+       if (!(attrval = jas_iccattrval_create0()))
+               goto error;
+       attrval->ops = &info->ops;
+       attrval->type = type;
+       ++attrval->refcnt;
+       memset(&attrval->data, 0, sizeof(attrval->data));
+       return attrval;
+error:
+       return 0;
+}
+
+jas_iccattrval_t *jas_iccattrval_clone(jas_iccattrval_t *attrval)
+{
+       ++attrval->refcnt;
+       return attrval;
+}
+
+void jas_iccattrval_destroy(jas_iccattrval_t *attrval)
+{
+#if 0
+jas_eprintf("refcnt=%d\n", attrval->refcnt);
+#endif
+       if (--attrval->refcnt <= 0) {
+               if (attrval->ops->destroy)
+                       (*attrval->ops->destroy)(attrval);
+               jas_free(attrval);
+       }
+}
+
+void jas_iccattrval_dump(jas_iccattrval_t *attrval, FILE *out)
+{
+       char buf[8];
+       jas_iccsigtostr(attrval->type, buf);
+       fprintf(out, "refcnt = %d; type = 0x%08x %s\n", attrval->refcnt,
+         attrval->type, jas_iccsigtostr(attrval->type, &buf[0]));
+       if (attrval->ops->dump) {
+               (*attrval->ops->dump)(attrval, out);
+       }
+}
+
+int jas_iccattrval_allowmodify(jas_iccattrval_t **attrvalx)
+{
+       jas_iccattrval_t *newattrval;
+       jas_iccattrval_t *attrval = *attrvalx;
+       newattrval = 0;
+       if (attrval->refcnt > 1) {
+               if (!(newattrval = jas_iccattrval_create0()))
+                       goto error;
+               newattrval->ops = attrval->ops;
+               newattrval->type = attrval->type;
+               ++newattrval->refcnt;
+               if (newattrval->ops->copy) {
+                       if ((*newattrval->ops->copy)(newattrval, attrval))
+                               goto error;
+               } else {
+                       memcpy(&newattrval->data, &attrval->data,
+                         sizeof(newattrval->data));
+               }
+               *attrvalx = newattrval;
+       }
+       return 0;
+error:
+       if (newattrval) {
+               jas_free(newattrval);
+       }
+       return -1;
+}
+
+static jas_iccattrval_t *jas_iccattrval_create0()
+{
+       jas_iccattrval_t *attrval;
+       if (!(attrval = jas_malloc(sizeof(jas_iccattrval_t))))
+               return 0;
+       memset(attrval, 0, sizeof(jas_iccattrval_t));
+       attrval->refcnt = 0;
+       attrval->ops = 0;
+       attrval->type = 0;
+       return attrval;
+}
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+static int jas_iccxyz_input(jas_iccattrval_t *attrval, jas_stream_t *in,
+  int len)
+{
+       if (len != 4 * 3) abort();
+       return jas_iccgetxyz(in, &attrval->data.xyz);
+}
+
+static int jas_iccxyz_output(jas_iccattrval_t *attrval, jas_stream_t *out)
+{
+       jas_iccxyz_t *xyz = &attrval->data.xyz;
+       if (jas_iccputuint32(out, xyz->x) ||
+         jas_iccputuint32(out, xyz->y) ||
+         jas_iccputuint32(out, xyz->z))
+               return -1;
+       return 0;
+}
+
+static int jas_iccxyz_getsize(jas_iccattrval_t *attrval)
+{
+       /* Avoid compiler warnings about unused parameters. */
+       attrval = 0;
+
+       return 12;
+}
+
+static void jas_iccxyz_dump(jas_iccattrval_t *attrval, FILE *out)
+{
+       jas_iccxyz_t *xyz = &attrval->data.xyz;
+       fprintf(out, "(%f, %f, %f)\n", xyz->x / 65536.0, xyz->y / 65536.0, xyz->z / 65536.0);
+}
+
+/******************************************************************************\
+* attribute table class
+\******************************************************************************/
+
+static void jas_icccurv_destroy(jas_iccattrval_t *attrval)
+{
+       jas_icccurv_t *curv = &attrval->data.curv;
+       if (curv->ents)
+               jas_free(curv->ents);
+}
+
+static int jas_icccurv_copy(jas_iccattrval_t *attrval,
+  jas_iccattrval_t *othattrval)
+{
+       /* Avoid compiler warnings about unused parameters. */
+       attrval = 0;
+       othattrval = 0;
+
+       /* Not yet implemented. */
+       abort();
+       return -1;
+}
+
+static int jas_icccurv_input(jas_iccattrval_t *attrval, jas_stream_t *in,
+  int cnt)
+{
+       jas_icccurv_t *curv = &attrval->data.curv;
+       unsigned int i;
+
+       curv->numents = 0;
+       curv->ents = 0;
+
+       if (jas_iccgetuint32(in, &curv->numents))
+               goto error;
+       if (!(curv->ents = jas_malloc(curv->numents * sizeof(jas_iccuint16_t))))
+               goto error;
+       for (i = 0; i < curv->numents; ++i) {
+               if (jas_iccgetuint16(in, &curv->ents[i]))
+                       goto error;
+       }
+
+       if (JAS_CAST(int, 4 + 2 * curv->numents) != cnt)
+               goto error;
+       return 0;
+
+error:
+       jas_icccurv_destroy(attrval);
+       return -1;
+}
+
+static int jas_icccurv_getsize(jas_iccattrval_t *attrval)
+{
+       jas_icccurv_t *curv = &attrval->data.curv;
+       return 4 + 2 * curv->numents;
+}
+
+static int jas_icccurv_output(jas_iccattrval_t *attrval, jas_stream_t *out)
+{
+       jas_icccurv_t *curv = &attrval->data.curv;
+       unsigned int i;
+
+       if (jas_iccputuint32(out, curv->numents))
+               goto error;
+       for (i = 0; i < curv->numents; ++i) {
+               if (jas_iccputuint16(out, curv->ents[i]))
+                       goto error;
+       }
+       return 0;
+error:
+       return -1;
+}
+
+static void jas_icccurv_dump(jas_iccattrval_t *attrval, FILE *out)
+{
+       int i;
+       jas_icccurv_t *curv = &attrval->data.curv;
+       fprintf(out, "number of entires = %d\n", curv->numents);
+       if (curv->numents == 1) {
+               fprintf(out, "gamma = %f\n", curv->ents[0] / 256.0);
+       } else {
+               for (i = 0; i < JAS_CAST(int, curv->numents); ++i) {
+                       if (i < 3 || i >= JAS_CAST(int, curv->numents) - 3) {
+                               fprintf(out, "entry[%d] = %f\n", i, curv->ents[i] / 65535.0);
+                       }
+               }
+       }
+}
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+static void jas_icctxtdesc_destroy(jas_iccattrval_t *attrval)
+{
+       jas_icctxtdesc_t *txtdesc = &attrval->data.txtdesc;
+       if (txtdesc->ascdata)
+               jas_free(txtdesc->ascdata);
+       if (txtdesc->ucdata)
+               jas_free(txtdesc->ucdata);
+}
+
+static int jas_icctxtdesc_copy(jas_iccattrval_t *attrval,
+  jas_iccattrval_t *othattrval)
+{
+       jas_icctxtdesc_t *txtdesc = &attrval->data.txtdesc;
+
+       /* Avoid compiler warnings about unused parameters. */
+       attrval = 0;
+       othattrval = 0;
+       txtdesc = 0;
+
+       /* Not yet implemented. */
+       abort();
+       return -1;
+}
+
+static int jas_icctxtdesc_input(jas_iccattrval_t *attrval, jas_stream_t *in,
+  int cnt)
+{
+       int n;
+       int c;
+       jas_icctxtdesc_t *txtdesc = &attrval->data.txtdesc;
+       txtdesc->ascdata = 0;
+       txtdesc->ucdata = 0;
+       if (jas_iccgetuint32(in, &txtdesc->asclen))
+               goto error;
+       if (!(txtdesc->ascdata = jas_malloc(txtdesc->asclen)))
+               goto error;
+       if (jas_stream_read(in, txtdesc->ascdata, txtdesc->asclen) !=
+         JAS_CAST(int, txtdesc->asclen))
+               goto error;
+       txtdesc->ascdata[txtdesc->asclen - 1] = '\0';
+       if (jas_iccgetuint32(in, &txtdesc->uclangcode) ||
+         jas_iccgetuint32(in, &txtdesc->uclen))
+               goto error;
+       if (!(txtdesc->ucdata = jas_malloc(txtdesc->uclen * 2)))
+               goto error;
+       if (jas_stream_read(in, txtdesc->ucdata, txtdesc->uclen * 2) !=
+         JAS_CAST(int, txtdesc->uclen * 2))
+               goto error;
+       if (jas_iccgetuint16(in, &txtdesc->sccode))
+               goto error;
+       if ((c = jas_stream_getc(in)) == EOF)
+               goto error;
+       txtdesc->maclen = c;
+       if (jas_stream_read(in, txtdesc->macdata, 67) != 67)
+               goto error;
+       txtdesc->asclen = strlen(txtdesc->ascdata) + 1;
+#define WORKAROUND_BAD_PROFILES
+#ifdef WORKAROUND_BAD_PROFILES
+       n = txtdesc->asclen + txtdesc->uclen * 2 + 15 + 67;
+       if (n > cnt) {
+               return -1;
+       }
+       if (n < cnt) {
+               if (jas_stream_gobble(in, cnt - n) != cnt - n)
+                       goto error;
+       }
+#else
+       if (txtdesc->asclen + txtdesc->uclen * 2 + 15 + 67 != cnt)
+               return -1;
+#endif
+       return 0;
+error:
+       jas_icctxtdesc_destroy(attrval);
+       return -1;
+}
+
+static int jas_icctxtdesc_getsize(jas_iccattrval_t *attrval)
+{
+       jas_icctxtdesc_t *txtdesc = &attrval->data.txtdesc;
+       return strlen(txtdesc->ascdata) + 1 + txtdesc->uclen * 2 + 15 + 67;
+}
+
+static int jas_icctxtdesc_output(jas_iccattrval_t *attrval, jas_stream_t *out)
+{
+       jas_icctxtdesc_t *txtdesc = &attrval->data.txtdesc;
+       if (jas_iccputuint32(out, txtdesc->asclen) ||
+         jas_stream_puts(out, txtdesc->ascdata) ||
+         jas_stream_putc(out, 0) == EOF ||
+         jas_iccputuint32(out, txtdesc->uclangcode) ||
+         jas_iccputuint32(out, txtdesc->uclen) ||
+         jas_stream_write(out, txtdesc->ucdata, txtdesc->uclen * 2) != JAS_CAST(int, txtdesc->uclen * 2) ||
+         jas_iccputuint16(out, txtdesc->sccode) ||
+         jas_stream_putc(out, txtdesc->maclen) == EOF)
+               goto error;
+       if (txtdesc->maclen > 0) {
+               if (jas_stream_write(out, txtdesc->macdata, 67) != 67)
+                       goto error;
+       } else {
+               if (jas_stream_pad(out, 67, 0) != 67)
+                       goto error;
+       }
+       return 0;
+error:
+       return -1;
+}
+
+static void jas_icctxtdesc_dump(jas_iccattrval_t *attrval, FILE *out)
+{
+       jas_icctxtdesc_t *txtdesc = &attrval->data.txtdesc;
+       fprintf(out, "ascii = \"%s\"\n", txtdesc->ascdata);
+       fprintf(out, "uclangcode = %d; uclen = %d\n", txtdesc->uclangcode,
+         txtdesc->uclen);
+       fprintf(out, "sccode = %d\n", txtdesc->sccode);
+       fprintf(out, "maclen = %d\n", txtdesc->maclen);
+}
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+static void jas_icctxt_destroy(jas_iccattrval_t *attrval)
+{
+       jas_icctxt_t *txt = &attrval->data.txt;
+       if (txt->string)
+               jas_free(txt->string);
+}
+
+static int jas_icctxt_copy(jas_iccattrval_t *attrval,
+  jas_iccattrval_t *othattrval)
+{
+       jas_icctxt_t *txt = &attrval->data.txt;
+       jas_icctxt_t *othtxt = &othattrval->data.txt;
+       if (!(txt->string = jas_strdup(othtxt->string)))
+               return -1;
+       return 0;
+}
+
+static int jas_icctxt_input(jas_iccattrval_t *attrval, jas_stream_t *in,
+  int cnt)
+{
+       jas_icctxt_t *txt = &attrval->data.txt;
+       txt->string = 0;
+       if (!(txt->string = jas_malloc(cnt)))
+               goto error;
+       if (jas_stream_read(in, txt->string, cnt) != cnt)
+               goto error;
+       txt->string[cnt - 1] = '\0';
+       if (JAS_CAST(int, strlen(txt->string)) + 1 != cnt)
+               goto error;
+       return 0;
+error:
+       if (txt->string)
+               jas_free(txt->string);
+       return -1;
+}
+
+static int jas_icctxt_getsize(jas_iccattrval_t *attrval)
+{
+       jas_icctxt_t *txt = &attrval->data.txt;
+       return strlen(txt->string) + 1;
+}
+
+static int jas_icctxt_output(jas_iccattrval_t *attrval, jas_stream_t *out)
+{
+       jas_icctxt_t *txt = &attrval->data.txt;
+       if (jas_stream_puts(out, txt->string) ||
+         jas_stream_putc(out, 0) == EOF)
+               return -1;
+       return 0;
+}
+
+static void jas_icctxt_dump(jas_iccattrval_t *attrval, FILE *out)
+{
+       jas_icctxt_t *txt = &attrval->data.txt;
+       fprintf(out, "string = \"%s\"\n", txt->string);
+}
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+static void jas_icclut8_destroy(jas_iccattrval_t *attrval)
+{
+       jas_icclut8_t *lut8 = &attrval->data.lut8;
+       if (lut8->clut)
+               jas_free(lut8->clut);
+       if (lut8->intabs)
+               jas_free(lut8->intabs);
+       if (lut8->intabsbuf)
+               jas_free(lut8->intabsbuf);
+       if (lut8->outtabs)
+               jas_free(lut8->outtabs);
+       if (lut8->outtabsbuf)
+               jas_free(lut8->outtabsbuf);
+}
+
+static int jas_icclut8_copy(jas_iccattrval_t *attrval,
+  jas_iccattrval_t *othattrval)
+{
+       jas_icclut8_t *lut8 = &attrval->data.lut8;
+       /* Avoid compiler warnings about unused parameters. */
+       attrval = 0;
+       othattrval = 0;
+       lut8 = 0;
+       abort();
+       return -1;
+}
+
+static int jas_icclut8_input(jas_iccattrval_t *attrval, jas_stream_t *in,
+  int cnt)
+{
+       int i;
+       int j;
+       int clutsize;
+       jas_icclut8_t *lut8 = &attrval->data.lut8;
+       lut8->clut = 0;
+       lut8->intabs = 0;
+       lut8->intabsbuf = 0;
+       lut8->outtabs = 0;
+       lut8->outtabsbuf = 0;
+       if (jas_iccgetuint8(in, &lut8->numinchans) ||
+         jas_iccgetuint8(in, &lut8->numoutchans) ||
+         jas_iccgetuint8(in, &lut8->clutlen) ||
+         jas_stream_getc(in) == EOF)
+               goto error;
+       for (i = 0; i < 3; ++i) {
+               for (j = 0; j < 3; ++j) {
+                       if (jas_iccgetsint32(in, &lut8->e[i][j]))
+                               goto error;
+               }
+       }
+       if (jas_iccgetuint16(in, &lut8->numintabents) ||
+         jas_iccgetuint16(in, &lut8->numouttabents))
+               goto error;
+       clutsize = jas_iccpowi(lut8->clutlen, lut8->numinchans) * lut8->numoutchans;
+       if (!(lut8->clut = jas_malloc(clutsize * sizeof(jas_iccuint8_t))) ||
+         !(lut8->intabsbuf = jas_malloc(lut8->numinchans *
+         lut8->numintabents * sizeof(jas_iccuint8_t))) ||
+         !(lut8->intabs = jas_malloc(lut8->numinchans *
+         sizeof(jas_iccuint8_t *))))
+               goto error;
+       for (i = 0; i < lut8->numinchans; ++i)
+               lut8->intabs[i] = &lut8->intabsbuf[i * lut8->numintabents];
+       if (!(lut8->outtabsbuf = jas_malloc(lut8->numoutchans *
+         lut8->numouttabents * sizeof(jas_iccuint8_t))) ||
+         !(lut8->outtabs = jas_malloc(lut8->numoutchans *
+         sizeof(jas_iccuint8_t *))))
+               goto error;
+       for (i = 0; i < lut8->numoutchans; ++i)
+               lut8->outtabs[i] = &lut8->outtabsbuf[i * lut8->numouttabents];
+       for (i = 0; i < lut8->numinchans; ++i) {
+               for (j = 0; j < JAS_CAST(int, lut8->numintabents); ++j) {
+                       if (jas_iccgetuint8(in, &lut8->intabs[i][j]))
+                               goto error;
+               }
+       }
+       for (i = 0; i < lut8->numoutchans; ++i) {
+               for (j = 0; j < JAS_CAST(int, lut8->numouttabents); ++j) {
+                       if (jas_iccgetuint8(in, &lut8->outtabs[i][j]))
+                               goto error;
+               }
+       }
+       for (i = 0; i < clutsize; ++i) {
+               if (jas_iccgetuint8(in, &lut8->clut[i]))
+                       goto error;
+       }
+       if (JAS_CAST(int, 44 + lut8->numinchans * lut8->numintabents +
+         lut8->numoutchans * lut8->numouttabents +
+         jas_iccpowi(lut8->clutlen, lut8->numinchans) * lut8->numoutchans) !=
+         cnt)
+               goto error;
+       return 0;
+error:
+       jas_icclut8_destroy(attrval);
+       return -1;
+}
+
+static int jas_icclut8_getsize(jas_iccattrval_t *attrval)
+{
+       jas_icclut8_t *lut8 = &attrval->data.lut8;
+       return 44 + lut8->numinchans * lut8->numintabents +
+         lut8->numoutchans * lut8->numouttabents +
+         jas_iccpowi(lut8->clutlen, lut8->numinchans) * lut8->numoutchans;
+}
+
+static int jas_icclut8_output(jas_iccattrval_t *attrval, jas_stream_t *out)
+{
+       jas_icclut8_t *lut8 = &attrval->data.lut8;
+       int i;
+       int j;
+       int n;
+       lut8->clut = 0;
+       lut8->intabs = 0;
+       lut8->intabsbuf = 0;
+       lut8->outtabs = 0;
+       lut8->outtabsbuf = 0;
+       if (jas_stream_putc(out, lut8->numinchans) == EOF ||
+         jas_stream_putc(out, lut8->numoutchans) == EOF ||
+         jas_stream_putc(out, lut8->clutlen) == EOF ||
+         jas_stream_putc(out, 0) == EOF)
+               goto error;
+       for (i = 0; i < 3; ++i) {
+               for (j = 0; j < 3; ++j) {
+                       if (jas_iccputsint32(out, lut8->e[i][j]))
+                               goto error;
+               }
+       }
+       if (jas_iccputuint16(out, lut8->numintabents) ||
+         jas_iccputuint16(out, lut8->numouttabents))
+               goto error;
+       n = lut8->numinchans * lut8->numintabents;
+       for (i = 0; i < n; ++i) {
+               if (jas_iccputuint8(out, lut8->intabsbuf[i]))
+                       goto error;
+       }
+       n = lut8->numoutchans * lut8->numouttabents;
+       for (i = 0; i < n; ++i) {
+               if (jas_iccputuint8(out, lut8->outtabsbuf[i]))
+                       goto error;
+       }
+       n = jas_iccpowi(lut8->clutlen, lut8->numinchans) * lut8->numoutchans;
+       for (i = 0; i < n; ++i) {
+               if (jas_iccputuint8(out, lut8->clut[i]))
+                       goto error;
+       }
+       return 0;
+error:
+       return -1;
+}
+
+static void jas_icclut8_dump(jas_iccattrval_t *attrval, FILE *out)
+{
+       jas_icclut8_t *lut8 = &attrval->data.lut8;
+       int i;
+       int j;
+       fprintf(out, "numinchans=%d, numoutchans=%d, clutlen=%d\n",
+         lut8->numinchans, lut8->numoutchans, lut8->clutlen);
+       for (i = 0; i < 3; ++i) {
+               for (j = 0; j < 3; ++j) {
+                       fprintf(out, "e[%d][%d]=%f ", i, j, lut8->e[i][j] / 65536.0);
+               }
+               fprintf(out, "\n");
+       }
+       fprintf(out, "numintabents=%d, numouttabents=%d\n",
+         lut8->numintabents, lut8->numouttabents);
+}
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+static void jas_icclut16_destroy(jas_iccattrval_t *attrval)
+{
+       jas_icclut16_t *lut16 = &attrval->data.lut16;
+       if (lut16->clut)
+               jas_free(lut16->clut);
+       if (lut16->intabs)
+               jas_free(lut16->intabs);
+       if (lut16->intabsbuf)
+               jas_free(lut16->intabsbuf);
+       if (lut16->outtabs)
+               jas_free(lut16->outtabs);
+       if (lut16->outtabsbuf)
+               jas_free(lut16->outtabsbuf);
+}
+
+static int jas_icclut16_copy(jas_iccattrval_t *attrval,
+  jas_iccattrval_t *othattrval)
+{
+       /* Avoid compiler warnings about unused parameters. */
+       attrval = 0;
+       othattrval = 0;
+       /* Not yet implemented. */
+       abort();
+       return -1;
+}
+
+static int jas_icclut16_input(jas_iccattrval_t *attrval, jas_stream_t *in,
+  int cnt)
+{
+       int i;
+       int j;
+       int clutsize;
+       jas_icclut16_t *lut16 = &attrval->data.lut16;
+       lut16->clut = 0;
+       lut16->intabs = 0;
+       lut16->intabsbuf = 0;
+       lut16->outtabs = 0;
+       lut16->outtabsbuf = 0;
+       if (jas_iccgetuint8(in, &lut16->numinchans) ||
+         jas_iccgetuint8(in, &lut16->numoutchans) ||
+         jas_iccgetuint8(in, &lut16->clutlen) ||
+         jas_stream_getc(in) == EOF)
+               goto error;
+       for (i = 0; i < 3; ++i) {
+               for (j = 0; j < 3; ++j) {
+                       if (jas_iccgetsint32(in, &lut16->e[i][j]))
+                               goto error;
+               }
+       }
+       if (jas_iccgetuint16(in, &lut16->numintabents) ||
+         jas_iccgetuint16(in, &lut16->numouttabents))
+               goto error;
+       clutsize = jas_iccpowi(lut16->clutlen, lut16->numinchans) * lut16->numoutchans;
+       if (!(lut16->clut = jas_malloc(clutsize * sizeof(jas_iccuint16_t))) ||
+         !(lut16->intabsbuf = jas_malloc(lut16->numinchans *
+         lut16->numintabents * sizeof(jas_iccuint16_t))) ||
+         !(lut16->intabs = jas_malloc(lut16->numinchans *
+         sizeof(jas_iccuint16_t *))))
+               goto error;
+       for (i = 0; i < lut16->numinchans; ++i)
+               lut16->intabs[i] = &lut16->intabsbuf[i * lut16->numintabents];
+       if (!(lut16->outtabsbuf = jas_malloc(lut16->numoutchans *
+         lut16->numouttabents * sizeof(jas_iccuint16_t))) ||
+         !(lut16->outtabs = jas_malloc(lut16->numoutchans *
+         sizeof(jas_iccuint16_t *))))
+               goto error;
+       for (i = 0; i < lut16->numoutchans; ++i)
+               lut16->outtabs[i] = &lut16->outtabsbuf[i * lut16->numouttabents];
+       for (i = 0; i < lut16->numinchans; ++i) {
+               for (j = 0; j < JAS_CAST(int, lut16->numintabents); ++j) {
+                       if (jas_iccgetuint16(in, &lut16->intabs[i][j]))
+                               goto error;
+               }
+       }
+       for (i = 0; i < lut16->numoutchans; ++i) {
+               for (j = 0; j < JAS_CAST(int, lut16->numouttabents); ++j) {
+                       if (jas_iccgetuint16(in, &lut16->outtabs[i][j]))
+                               goto error;
+               }
+       }
+       for (i = 0; i < clutsize; ++i) {
+               if (jas_iccgetuint16(in, &lut16->clut[i]))
+                       goto error;
+       }
+       if (JAS_CAST(int, 44 + 2 * (lut16->numinchans * lut16->numintabents +
+          lut16->numoutchans * lut16->numouttabents +
+          jas_iccpowi(lut16->clutlen, lut16->numinchans) *
+         lut16->numoutchans)) != cnt)
+               goto error;
+       return 0;
+error:
+       jas_icclut16_destroy(attrval);
+       return -1;
+}
+
+static int jas_icclut16_getsize(jas_iccattrval_t *attrval)
+{
+       jas_icclut16_t *lut16 = &attrval->data.lut16;
+       return 44 + 2 * (lut16->numinchans * lut16->numintabents +
+         lut16->numoutchans * lut16->numouttabents +
+         jas_iccpowi(lut16->clutlen, lut16->numinchans) * lut16->numoutchans);
+}
+
+static int jas_icclut16_output(jas_iccattrval_t *attrval, jas_stream_t *out)
+{
+       jas_icclut16_t *lut16 = &attrval->data.lut16;
+       int i;
+       int j;
+       int n;
+       if (jas_stream_putc(out, lut16->numinchans) == EOF ||
+         jas_stream_putc(out, lut16->numoutchans) == EOF ||
+         jas_stream_putc(out, lut16->clutlen) == EOF ||
+         jas_stream_putc(out, 0) == EOF)
+               goto error;
+       for (i = 0; i < 3; ++i) {
+               for (j = 0; j < 3; ++j) {
+                       if (jas_iccputsint32(out, lut16->e[i][j]))
+                               goto error;
+               }
+       }
+       if (jas_iccputuint16(out, lut16->numintabents) ||
+         jas_iccputuint16(out, lut16->numouttabents))
+               goto error;
+       n = lut16->numinchans * lut16->numintabents;
+       for (i = 0; i < n; ++i) {
+               if (jas_iccputuint16(out, lut16->intabsbuf[i]))
+                       goto error;
+       }
+       n = lut16->numoutchans * lut16->numouttabents;
+       for (i = 0; i < n; ++i) {
+               if (jas_iccputuint16(out, lut16->outtabsbuf[i]))
+                       goto error;
+       }
+       n = jas_iccpowi(lut16->clutlen, lut16->numinchans) * lut16->numoutchans;
+       for (i = 0; i < n; ++i) {
+               if (jas_iccputuint16(out, lut16->clut[i]))
+                       goto error;
+       }
+       return 0;
+error:
+       return -1;
+}
+
+static void jas_icclut16_dump(jas_iccattrval_t *attrval, FILE *out)
+{
+       jas_icclut16_t *lut16 = &attrval->data.lut16;
+       int i;
+       int j;
+       fprintf(out, "numinchans=%d, numoutchans=%d, clutlen=%d\n",
+         lut16->numinchans, lut16->numoutchans, lut16->clutlen);
+       for (i = 0; i < 3; ++i) {
+               for (j = 0; j < 3; ++j) {
+                       fprintf(out, "e[%d][%d]=%f ", i, j, lut16->e[i][j] / 65536.0);
+               }
+               fprintf(out, "\n");
+       }
+       fprintf(out, "numintabents=%d, numouttabents=%d\n",
+         lut16->numintabents, lut16->numouttabents);
+}
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+static int jas_iccgetuint(jas_stream_t *in, int n, ulonglong *val)
+{
+       int i;
+       int c;
+       ulonglong v;
+       v = 0;
+       for (i = n; i > 0; --i) {
+               if ((c = jas_stream_getc(in)) == EOF)
+                       return -1;
+               v = (v << 8) | c;
+       }
+       *val = v;
+       return 0;
+}
+
+static int jas_iccgetuint8(jas_stream_t *in, jas_iccuint8_t *val)
+{
+       int c;
+       if ((c = jas_stream_getc(in)) == EOF)
+               return -1;
+       *val = c;
+       return 0;
+}
+
+static int jas_iccgetuint16(jas_stream_t *in, jas_iccuint16_t *val)
+{
+       ulonglong tmp;
+       if (jas_iccgetuint(in, 2, &tmp))
+               return -1;
+       *val = tmp;
+       return 0;
+}
+
+static int jas_iccgetsint32(jas_stream_t *in, jas_iccsint32_t *val)
+{
+       ulonglong tmp;
+       if (jas_iccgetuint(in, 4, &tmp))
+               return -1;
+       *val = (tmp & 0x80000000) ? (-JAS_CAST(longlong, (((~tmp) &
+         0x7fffffff) + 1))) : JAS_CAST(longlong, tmp);
+       return 0;
+}
+
+static int jas_iccgetuint32(jas_stream_t *in, jas_iccuint32_t *val)
+{
+       ulonglong tmp;
+       if (jas_iccgetuint(in, 4, &tmp))
+               return -1;
+       *val = tmp;
+       return 0;
+}
+
+static int jas_iccgetuint64(jas_stream_t *in, jas_iccuint64_t *val)
+{
+       ulonglong tmp;
+       if (jas_iccgetuint(in, 8, &tmp))
+               return -1;
+       *val = tmp;
+       return 0;
+}
+
+static int jas_iccputuint(jas_stream_t *out, int n, ulonglong val)
+{
+       int i;
+       int c;
+       for (i = n; i > 0; --i) {
+               c = (val >> (8 * (i - 1))) & 0xff;
+               if (jas_stream_putc(out, c) == EOF)
+                       return -1;
+       }
+       return 0;
+}
+
+static int jas_iccputsint(jas_stream_t *out, int n, longlong val)
+{
+       ulonglong tmp;
+       tmp = (val < 0) ? (abort(), 0) : val;
+       return jas_iccputuint(out, n, tmp);
+}
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+static char *jas_iccsigtostr(int sig, char *buf)
+{
+       int n;
+       int c;
+       char *bufptr;
+       bufptr = buf;
+       for (n = 4; n > 0; --n) {
+               c = (sig >> 24) & 0xff;
+               if (isalpha(c) || isdigit(c)) {
+                       *bufptr++ = c;
+               }
+               sig <<= 8;
+       }
+       *bufptr = '\0';
+       return buf;
+}
+
+static long jas_iccpadtomult(long x, long y)
+{
+       return ((x + y - 1) / y) * y;
+}
+
+static long jas_iccpowi(int x, int n)
+{
+       long y;
+       y = 1;
+       while (--n >= 0)
+               y *= x;
+       return y;
+}
+
+
+jas_iccprof_t *jas_iccprof_createfrombuf(uchar *buf, int len)
+{
+       jas_stream_t *in;
+       jas_iccprof_t *prof;
+       if (!(in = jas_stream_memopen(JAS_CAST(char *, buf), len)))
+               goto error;
+       if (!(prof = jas_iccprof_load(in)))
+               goto error;
+       jas_stream_close(in);
+       return prof;
+error:
+       return 0;
+}
+
+jas_iccprof_t *jas_iccprof_createfromclrspc(int clrspc)
+{
+       jas_iccprof_t *prof;
+       switch (clrspc) {
+       case JAS_CLRSPC_SRGB:
+               prof = jas_iccprof_createfrombuf(jas_iccprofdata_srgb,
+                 jas_iccprofdata_srgblen);
+               break;
+       case JAS_CLRSPC_SGRAY:
+               prof = jas_iccprof_createfrombuf(jas_iccprofdata_sgray,
+                 jas_iccprofdata_sgraylen);
+               break;
+       default:
+               prof = 0;
+               break;
+       }
+       return prof;
+}
diff --git a/src/libjasper/base/jas_iccdata.c b/src/libjasper/base/jas_iccdata.c
new file mode 100644 (file)
index 0000000..bf68bf0
--- /dev/null
@@ -0,0 +1,517 @@
+/*
+ * Copyright (c) 2002-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+#include <jasper/jas_config.h>
+#include <jasper/jas_types.h>
+
+uchar jas_iccprofdata_srgb[] =
+{
+       0x00, 0x00, 0x0c, 0x48, 0x4c, 0x69, 0x6e, 0x6f,
+       0x02, 0x10, 0x00, 0x00, 0x6d, 0x6e, 0x74, 0x72,
+       0x52, 0x47, 0x42, 0x20, 0x58, 0x59, 0x5a, 0x20,
+       0x07, 0xce, 0x00, 0x02, 0x00, 0x09, 0x00, 0x06,
+       0x00, 0x31, 0x00, 0x00, 0x61, 0x63, 0x73, 0x70,
+       0x4d, 0x53, 0x46, 0x54, 0x00, 0x00, 0x00, 0x00,
+       0x49, 0x45, 0x43, 0x20, 0x73, 0x52, 0x47, 0x42,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0xd6,
+       0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xd3, 0x2d,
+       0x48, 0x50, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x11, 0x63, 0x70, 0x72, 0x74,
+       0x00, 0x00, 0x01, 0x50, 0x00, 0x00, 0x00, 0x33,
+       0x64, 0x65, 0x73, 0x63, 0x00, 0x00, 0x01, 0x84,
+       0x00, 0x00, 0x00, 0x6c, 0x77, 0x74, 0x70, 0x74,
+       0x00, 0x00, 0x01, 0xf0, 0x00, 0x00, 0x00, 0x14,
+       0x62, 0x6b, 0x70, 0x74, 0x00, 0x00, 0x02, 0x04,
+       0x00, 0x00, 0x00, 0x14, 0x72, 0x58, 0x59, 0x5a,
+       0x00, 0x00, 0x02, 0x18, 0x00, 0x00, 0x00, 0x14,
+       0x67, 0x58, 0x59, 0x5a, 0x00, 0x00, 0x02, 0x2c,
+       0x00, 0x00, 0x00, 0x14, 0x62, 0x58, 0x59, 0x5a,
+       0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x14,
+       0x64, 0x6d, 0x6e, 0x64, 0x00, 0x00, 0x02, 0x54,
+       0x00, 0x00, 0x00, 0x70, 0x64, 0x6d, 0x64, 0x64,
+       0x00, 0x00, 0x02, 0xc4, 0x00, 0x00, 0x00, 0x88,
+       0x76, 0x75, 0x65, 0x64, 0x00, 0x00, 0x03, 0x4c,
+       0x00, 0x00, 0x00, 0x86, 0x76, 0x69, 0x65, 0x77,
+       0x00, 0x00, 0x03, 0xd4, 0x00, 0x00, 0x00, 0x24,
+       0x6c, 0x75, 0x6d, 0x69, 0x00, 0x00, 0x03, 0xf8,
+       0x00, 0x00, 0x00, 0x14, 0x6d, 0x65, 0x61, 0x73,
+       0x00, 0x00, 0x04, 0x0c, 0x00, 0x00, 0x00, 0x24,
+       0x74, 0x65, 0x63, 0x68, 0x00, 0x00, 0x04, 0x30,
+       0x00, 0x00, 0x00, 0x0c, 0x72, 0x54, 0x52, 0x43,
+       0x00, 0x00, 0x04, 0x3c, 0x00, 0x00, 0x08, 0x0c,
+       0x67, 0x54, 0x52, 0x43, 0x00, 0x00, 0x04, 0x3c,
+       0x00, 0x00, 0x08, 0x0c, 0x62, 0x54, 0x52, 0x43,
+       0x00, 0x00, 0x04, 0x3c, 0x00, 0x00, 0x08, 0x0c,
+       0x74, 0x65, 0x78, 0x74, 0x00, 0x00, 0x00, 0x00,
+       0x43, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68,
+       0x74, 0x20, 0x28, 0x63, 0x29, 0x20, 0x31, 0x39,
+       0x39, 0x38, 0x20, 0x48, 0x65, 0x77, 0x6c, 0x65,
+       0x74, 0x74, 0x2d, 0x50, 0x61, 0x63, 0x6b, 0x61,
+       0x72, 0x64, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x61,
+       0x6e, 0x79, 0x00, 0x00, 0x64, 0x65, 0x73, 0x63,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12,
+       0x73, 0x52, 0x47, 0x42, 0x20, 0x49, 0x45, 0x43,
+       0x36, 0x31, 0x39, 0x36, 0x36, 0x2d, 0x32, 0x2e,
+       0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x12, 0x73, 0x52, 0x47,
+       0x42, 0x20, 0x49, 0x45, 0x43, 0x36, 0x31, 0x39,
+       0x36, 0x36, 0x2d, 0x32, 0x2e, 0x31, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x58, 0x59, 0x5a, 0x20, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0xf3, 0x51, 0x00, 0x01, 0x00, 0x00,
+       0x00, 0x01, 0x16, 0xcc, 0x58, 0x59, 0x5a, 0x20,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x58, 0x59, 0x5a, 0x20, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x6f, 0xa2, 0x00, 0x00, 0x38, 0xf5,
+       0x00, 0x00, 0x03, 0x90, 0x58, 0x59, 0x5a, 0x20,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x62, 0x99,
+       0x00, 0x00, 0xb7, 0x85, 0x00, 0x00, 0x18, 0xda,
+       0x58, 0x59, 0x5a, 0x20, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x24, 0xa0, 0x00, 0x00, 0x0f, 0x84,
+       0x00, 0x00, 0xb6, 0xcf, 0x64, 0x65, 0x73, 0x63,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16,
+       0x49, 0x45, 0x43, 0x20, 0x68, 0x74, 0x74, 0x70,
+       0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x69,
+       0x65, 0x63, 0x2e, 0x63, 0x68, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x16, 0x49, 0x45, 0x43, 0x20, 0x68, 0x74, 0x74,
+       0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e,
+       0x69, 0x65, 0x63, 0x2e, 0x63, 0x68, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x64, 0x65, 0x73, 0x63,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2e,
+       0x49, 0x45, 0x43, 0x20, 0x36, 0x31, 0x39, 0x36,
+       0x36, 0x2d, 0x32, 0x2e, 0x31, 0x20, 0x44, 0x65,
+       0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x52, 0x47,
+       0x42, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x75, 0x72,
+       0x20, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x2d,
+       0x20, 0x73, 0x52, 0x47, 0x42, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x2e, 0x49, 0x45, 0x43, 0x20, 0x36, 0x31, 0x39,
+       0x36, 0x36, 0x2d, 0x32, 0x2e, 0x31, 0x20, 0x44,
+       0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x52,
+       0x47, 0x42, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x75,
+       0x72, 0x20, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20,
+       0x2d, 0x20, 0x73, 0x52, 0x47, 0x42, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x64, 0x65, 0x73, 0x63,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c,
+       0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63,
+       0x65, 0x20, 0x56, 0x69, 0x65, 0x77, 0x69, 0x6e,
+       0x67, 0x20, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74,
+       0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x49,
+       0x45, 0x43, 0x36, 0x31, 0x39, 0x36, 0x36, 0x2d,
+       0x32, 0x2e, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x52,
+       0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65,
+       0x20, 0x56, 0x69, 0x65, 0x77, 0x69, 0x6e, 0x67,
+       0x20, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69,
+       0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x49, 0x45,
+       0x43, 0x36, 0x31, 0x39, 0x36, 0x36, 0x2d, 0x32,
+       0x2e, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x76, 0x69, 0x65, 0x77,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0xa4, 0xfe,
+       0x00, 0x14, 0x5f, 0x2e, 0x00, 0x10, 0xcf, 0x14,
+       0x00, 0x03, 0xed, 0xcc, 0x00, 0x04, 0x13, 0x0b,
+       0x00, 0x03, 0x5c, 0x9e, 0x00, 0x00, 0x00, 0x01,
+       0x58, 0x59, 0x5a, 0x20, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x4c, 0x09, 0x56, 0x00, 0x50, 0x00, 0x00,
+       0x00, 0x57, 0x1f, 0xe7, 0x6d, 0x65, 0x61, 0x73,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x02, 0x8f, 0x00, 0x00, 0x00, 0x02,
+       0x73, 0x69, 0x67, 0x20, 0x00, 0x00, 0x00, 0x00,
+       0x43, 0x52, 0x54, 0x20, 0x63, 0x75, 0x72, 0x76,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00,
+       0x00, 0x00, 0x00, 0x05, 0x00, 0x0a, 0x00, 0x0f,
+       0x00, 0x14, 0x00, 0x19, 0x00, 0x1e, 0x00, 0x23,
+       0x00, 0x28, 0x00, 0x2d, 0x00, 0x32, 0x00, 0x37,
+       0x00, 0x3b, 0x00, 0x40, 0x00, 0x45, 0x00, 0x4a,
+       0x00, 0x4f, 0x00, 0x54, 0x00, 0x59, 0x00, 0x5e,
+       0x00, 0x63, 0x00, 0x68, 0x00, 0x6d, 0x00, 0x72,
+       0x00, 0x77, 0x00, 0x7c, 0x00, 0x81, 0x00, 0x86,
+       0x00, 0x8b, 0x00, 0x90, 0x00, 0x95, 0x00, 0x9a,
+       0x00, 0x9f, 0x00, 0xa4, 0x00, 0xa9, 0x00, 0xae,
+       0x00, 0xb2, 0x00, 0xb7, 0x00, 0xbc, 0x00, 0xc1,
+       0x00, 0xc6, 0x00, 0xcb, 0x00, 0xd0, 0x00, 0xd5,
+       0x00, 0xdb, 0x00, 0xe0, 0x00, 0xe5, 0x00, 0xeb,
+       0x00, 0xf0, 0x00, 0xf6, 0x00, 0xfb, 0x01, 0x01,
+       0x01, 0x07, 0x01, 0x0d, 0x01, 0x13, 0x01, 0x19,
+       0x01, 0x1f, 0x01, 0x25, 0x01, 0x2b, 0x01, 0x32,
+       0x01, 0x38, 0x01, 0x3e, 0x01, 0x45, 0x01, 0x4c,
+       0x01, 0x52, 0x01, 0x59, 0x01, 0x60, 0x01, 0x67,
+       0x01, 0x6e, 0x01, 0x75, 0x01, 0x7c, 0x01, 0x83,
+       0x01, 0x8b, 0x01, 0x92, 0x01, 0x9a, 0x01, 0xa1,
+       0x01, 0xa9, 0x01, 0xb1, 0x01, 0xb9, 0x01, 0xc1,
+       0x01, 0xc9, 0x01, 0xd1, 0x01, 0xd9, 0x01, 0xe1,
+       0x01, 0xe9, 0x01, 0xf2, 0x01, 0xfa, 0x02, 0x03,
+       0x02, 0x0c, 0x02, 0x14, 0x02, 0x1d, 0x02, 0x26,
+       0x02, 0x2f, 0x02, 0x38, 0x02, 0x41, 0x02, 0x4b,
+       0x02, 0x54, 0x02, 0x5d, 0x02, 0x67, 0x02, 0x71,
+       0x02, 0x7a, 0x02, 0x84, 0x02, 0x8e, 0x02, 0x98,
+       0x02, 0xa2, 0x02, 0xac, 0x02, 0xb6, 0x02, 0xc1,
+       0x02, 0xcb, 0x02, 0xd5, 0x02, 0xe0, 0x02, 0xeb,
+       0x02, 0xf5, 0x03, 0x00, 0x03, 0x0b, 0x03, 0x16,
+       0x03, 0x21, 0x03, 0x2d, 0x03, 0x38, 0x03, 0x43,
+       0x03, 0x4f, 0x03, 0x5a, 0x03, 0x66, 0x03, 0x72,
+       0x03, 0x7e, 0x03, 0x8a, 0x03, 0x96, 0x03, 0xa2,
+       0x03, 0xae, 0x03, 0xba, 0x03, 0xc7, 0x03, 0xd3,
+       0x03, 0xe0, 0x03, 0xec, 0x03, 0xf9, 0x04, 0x06,
+       0x04, 0x13, 0x04, 0x20, 0x04, 0x2d, 0x04, 0x3b,
+       0x04, 0x48, 0x04, 0x55, 0x04, 0x63, 0x04, 0x71,
+       0x04, 0x7e, 0x04, 0x8c, 0x04, 0x9a, 0x04, 0xa8,
+       0x04, 0xb6, 0x04, 0xc4, 0x04, 0xd3, 0x04, 0xe1,
+       0x04, 0xf0, 0x04, 0xfe, 0x05, 0x0d, 0x05, 0x1c,
+       0x05, 0x2b, 0x05, 0x3a, 0x05, 0x49, 0x05, 0x58,
+       0x05, 0x67, 0x05, 0x77, 0x05, 0x86, 0x05, 0x96,
+       0x05, 0xa6, 0x05, 0xb5, 0x05, 0xc5, 0x05, 0xd5,
+       0x05, 0xe5, 0x05, 0xf6, 0x06, 0x06, 0x06, 0x16,
+       0x06, 0x27, 0x06, 0x37, 0x06, 0x48, 0x06, 0x59,
+       0x06, 0x6a, 0x06, 0x7b, 0x06, 0x8c, 0x06, 0x9d,
+       0x06, 0xaf, 0x06, 0xc0, 0x06, 0xd1, 0x06, 0xe3,
+       0x06, 0xf5, 0x07, 0x07, 0x07, 0x19, 0x07, 0x2b,
+       0x07, 0x3d, 0x07, 0x4f, 0x07, 0x61, 0x07, 0x74,
+       0x07, 0x86, 0x07, 0x99, 0x07, 0xac, 0x07, 0xbf,
+       0x07, 0xd2, 0x07, 0xe5, 0x07, 0xf8, 0x08, 0x0b,
+       0x08, 0x1f, 0x08, 0x32, 0x08, 0x46, 0x08, 0x5a,
+       0x08, 0x6e, 0x08, 0x82, 0x08, 0x96, 0x08, 0xaa,
+       0x08, 0xbe, 0x08, 0xd2, 0x08, 0xe7, 0x08, 0xfb,
+       0x09, 0x10, 0x09, 0x25, 0x09, 0x3a, 0x09, 0x4f,
+       0x09, 0x64, 0x09, 0x79, 0x09, 0x8f, 0x09, 0xa4,
+       0x09, 0xba, 0x09, 0xcf, 0x09, 0xe5, 0x09, 0xfb,
+       0x0a, 0x11, 0x0a, 0x27, 0x0a, 0x3d, 0x0a, 0x54,
+       0x0a, 0x6a, 0x0a, 0x81, 0x0a, 0x98, 0x0a, 0xae,
+       0x0a, 0xc5, 0x0a, 0xdc, 0x0a, 0xf3, 0x0b, 0x0b,
+       0x0b, 0x22, 0x0b, 0x39, 0x0b, 0x51, 0x0b, 0x69,
+       0x0b, 0x80, 0x0b, 0x98, 0x0b, 0xb0, 0x0b, 0xc8,
+       0x0b, 0xe1, 0x0b, 0xf9, 0x0c, 0x12, 0x0c, 0x2a,
+       0x0c, 0x43, 0x0c, 0x5c, 0x0c, 0x75, 0x0c, 0x8e,
+       0x0c, 0xa7, 0x0c, 0xc0, 0x0c, 0xd9, 0x0c, 0xf3,
+       0x0d, 0x0d, 0x0d, 0x26, 0x0d, 0x40, 0x0d, 0x5a,
+       0x0d, 0x74, 0x0d, 0x8e, 0x0d, 0xa9, 0x0d, 0xc3,
+       0x0d, 0xde, 0x0d, 0xf8, 0x0e, 0x13, 0x0e, 0x2e,
+       0x0e, 0x49, 0x0e, 0x64, 0x0e, 0x7f, 0x0e, 0x9b,
+       0x0e, 0xb6, 0x0e, 0xd2, 0x0e, 0xee, 0x0f, 0x09,
+       0x0f, 0x25, 0x0f, 0x41, 0x0f, 0x5e, 0x0f, 0x7a,
+       0x0f, 0x96, 0x0f, 0xb3, 0x0f, 0xcf, 0x0f, 0xec,
+       0x10, 0x09, 0x10, 0x26, 0x10, 0x43, 0x10, 0x61,
+       0x10, 0x7e, 0x10, 0x9b, 0x10, 0xb9, 0x10, 0xd7,
+       0x10, 0xf5, 0x11, 0x13, 0x11, 0x31, 0x11, 0x4f,
+       0x11, 0x6d, 0x11, 0x8c, 0x11, 0xaa, 0x11, 0xc9,
+       0x11, 0xe8, 0x12, 0x07, 0x12, 0x26, 0x12, 0x45,
+       0x12, 0x64, 0x12, 0x84, 0x12, 0xa3, 0x12, 0xc3,
+       0x12, 0xe3, 0x13, 0x03, 0x13, 0x23, 0x13, 0x43,
+       0x13, 0x63, 0x13, 0x83, 0x13, 0xa4, 0x13, 0xc5,
+       0x13, 0xe5, 0x14, 0x06, 0x14, 0x27, 0x14, 0x49,
+       0x14, 0x6a, 0x14, 0x8b, 0x14, 0xad, 0x14, 0xce,
+       0x14, 0xf0, 0x15, 0x12, 0x15, 0x34, 0x15, 0x56,
+       0x15, 0x78, 0x15, 0x9b, 0x15, 0xbd, 0x15, 0xe0,
+       0x16, 0x03, 0x16, 0x26, 0x16, 0x49, 0x16, 0x6c,
+       0x16, 0x8f, 0x16, 0xb2, 0x16, 0xd6, 0x16, 0xfa,
+       0x17, 0x1d, 0x17, 0x41, 0x17, 0x65, 0x17, 0x89,
+       0x17, 0xae, 0x17, 0xd2, 0x17, 0xf7, 0x18, 0x1b,
+       0x18, 0x40, 0x18, 0x65, 0x18, 0x8a, 0x18, 0xaf,
+       0x18, 0xd5, 0x18, 0xfa, 0x19, 0x20, 0x19, 0x45,
+       0x19, 0x6b, 0x19, 0x91, 0x19, 0xb7, 0x19, 0xdd,
+       0x1a, 0x04, 0x1a, 0x2a, 0x1a, 0x51, 0x1a, 0x77,
+       0x1a, 0x9e, 0x1a, 0xc5, 0x1a, 0xec, 0x1b, 0x14,
+       0x1b, 0x3b, 0x1b, 0x63, 0x1b, 0x8a, 0x1b, 0xb2,
+       0x1b, 0xda, 0x1c, 0x02, 0x1c, 0x2a, 0x1c, 0x52,
+       0x1c, 0x7b, 0x1c, 0xa3, 0x1c, 0xcc, 0x1c, 0xf5,
+       0x1d, 0x1e, 0x1d, 0x47, 0x1d, 0x70, 0x1d, 0x99,
+       0x1d, 0xc3, 0x1d, 0xec, 0x1e, 0x16, 0x1e, 0x40,
+       0x1e, 0x6a, 0x1e, 0x94, 0x1e, 0xbe, 0x1e, 0xe9,
+       0x1f, 0x13, 0x1f, 0x3e, 0x1f, 0x69, 0x1f, 0x94,
+       0x1f, 0xbf, 0x1f, 0xea, 0x20, 0x15, 0x20, 0x41,
+       0x20, 0x6c, 0x20, 0x98, 0x20, 0xc4, 0x20, 0xf0,
+       0x21, 0x1c, 0x21, 0x48, 0x21, 0x75, 0x21, 0xa1,
+       0x21, 0xce, 0x21, 0xfb, 0x22, 0x27, 0x22, 0x55,
+       0x22, 0x82, 0x22, 0xaf, 0x22, 0xdd, 0x23, 0x0a,
+       0x23, 0x38, 0x23, 0x66, 0x23, 0x94, 0x23, 0xc2,
+       0x23, 0xf0, 0x24, 0x1f, 0x24, 0x4d, 0x24, 0x7c,
+       0x24, 0xab, 0x24, 0xda, 0x25, 0x09, 0x25, 0x38,
+       0x25, 0x68, 0x25, 0x97, 0x25, 0xc7, 0x25, 0xf7,
+       0x26, 0x27, 0x26, 0x57, 0x26, 0x87, 0x26, 0xb7,
+       0x26, 0xe8, 0x27, 0x18, 0x27, 0x49, 0x27, 0x7a,
+       0x27, 0xab, 0x27, 0xdc, 0x28, 0x0d, 0x28, 0x3f,
+       0x28, 0x71, 0x28, 0xa2, 0x28, 0xd4, 0x29, 0x06,
+       0x29, 0x38, 0x29, 0x6b, 0x29, 0x9d, 0x29, 0xd0,
+       0x2a, 0x02, 0x2a, 0x35, 0x2a, 0x68, 0x2a, 0x9b,
+       0x2a, 0xcf, 0x2b, 0x02, 0x2b, 0x36, 0x2b, 0x69,
+       0x2b, 0x9d, 0x2b, 0xd1, 0x2c, 0x05, 0x2c, 0x39,
+       0x2c, 0x6e, 0x2c, 0xa2, 0x2c, 0xd7, 0x2d, 0x0c,
+       0x2d, 0x41, 0x2d, 0x76, 0x2d, 0xab, 0x2d, 0xe1,
+       0x2e, 0x16, 0x2e, 0x4c, 0x2e, 0x82, 0x2e, 0xb7,
+       0x2e, 0xee, 0x2f, 0x24, 0x2f, 0x5a, 0x2f, 0x91,
+       0x2f, 0xc7, 0x2f, 0xfe, 0x30, 0x35, 0x30, 0x6c,
+       0x30, 0xa4, 0x30, 0xdb, 0x31, 0x12, 0x31, 0x4a,
+       0x31, 0x82, 0x31, 0xba, 0x31, 0xf2, 0x32, 0x2a,
+       0x32, 0x63, 0x32, 0x9b, 0x32, 0xd4, 0x33, 0x0d,
+       0x33, 0x46, 0x33, 0x7f, 0x33, 0xb8, 0x33, 0xf1,
+       0x34, 0x2b, 0x34, 0x65, 0x34, 0x9e, 0x34, 0xd8,
+       0x35, 0x13, 0x35, 0x4d, 0x35, 0x87, 0x35, 0xc2,
+       0x35, 0xfd, 0x36, 0x37, 0x36, 0x72, 0x36, 0xae,
+       0x36, 0xe9, 0x37, 0x24, 0x37, 0x60, 0x37, 0x9c,
+       0x37, 0xd7, 0x38, 0x14, 0x38, 0x50, 0x38, 0x8c,
+       0x38, 0xc8, 0x39, 0x05, 0x39, 0x42, 0x39, 0x7f,
+       0x39, 0xbc, 0x39, 0xf9, 0x3a, 0x36, 0x3a, 0x74,
+       0x3a, 0xb2, 0x3a, 0xef, 0x3b, 0x2d, 0x3b, 0x6b,
+       0x3b, 0xaa, 0x3b, 0xe8, 0x3c, 0x27, 0x3c, 0x65,
+       0x3c, 0xa4, 0x3c, 0xe3, 0x3d, 0x22, 0x3d, 0x61,
+       0x3d, 0xa1, 0x3d, 0xe0, 0x3e, 0x20, 0x3e, 0x60,
+       0x3e, 0xa0, 0x3e, 0xe0, 0x3f, 0x21, 0x3f, 0x61,
+       0x3f, 0xa2, 0x3f, 0xe2, 0x40, 0x23, 0x40, 0x64,
+       0x40, 0xa6, 0x40, 0xe7, 0x41, 0x29, 0x41, 0x6a,
+       0x41, 0xac, 0x41, 0xee, 0x42, 0x30, 0x42, 0x72,
+       0x42, 0xb5, 0x42, 0xf7, 0x43, 0x3a, 0x43, 0x7d,
+       0x43, 0xc0, 0x44, 0x03, 0x44, 0x47, 0x44, 0x8a,
+       0x44, 0xce, 0x45, 0x12, 0x45, 0x55, 0x45, 0x9a,
+       0x45, 0xde, 0x46, 0x22, 0x46, 0x67, 0x46, 0xab,
+       0x46, 0xf0, 0x47, 0x35, 0x47, 0x7b, 0x47, 0xc0,
+       0x48, 0x05, 0x48, 0x4b, 0x48, 0x91, 0x48, 0xd7,
+       0x49, 0x1d, 0x49, 0x63, 0x49, 0xa9, 0x49, 0xf0,
+       0x4a, 0x37, 0x4a, 0x7d, 0x4a, 0xc4, 0x4b, 0x0c,
+       0x4b, 0x53, 0x4b, 0x9a, 0x4b, 0xe2, 0x4c, 0x2a,
+       0x4c, 0x72, 0x4c, 0xba, 0x4d, 0x02, 0x4d, 0x4a,
+       0x4d, 0x93, 0x4d, 0xdc, 0x4e, 0x25, 0x4e, 0x6e,
+       0x4e, 0xb7, 0x4f, 0x00, 0x4f, 0x49, 0x4f, 0x93,
+       0x4f, 0xdd, 0x50, 0x27, 0x50, 0x71, 0x50, 0xbb,
+       0x51, 0x06, 0x51, 0x50, 0x51, 0x9b, 0x51, 0xe6,
+       0x52, 0x31, 0x52, 0x7c, 0x52, 0xc7, 0x53, 0x13,
+       0x53, 0x5f, 0x53, 0xaa, 0x53, 0xf6, 0x54, 0x42,
+       0x54, 0x8f, 0x54, 0xdb, 0x55, 0x28, 0x55, 0x75,
+       0x55, 0xc2, 0x56, 0x0f, 0x56, 0x5c, 0x56, 0xa9,
+       0x56, 0xf7, 0x57, 0x44, 0x57, 0x92, 0x57, 0xe0,
+       0x58, 0x2f, 0x58, 0x7d, 0x58, 0xcb, 0x59, 0x1a,
+       0x59, 0x69, 0x59, 0xb8, 0x5a, 0x07, 0x5a, 0x56,
+       0x5a, 0xa6, 0x5a, 0xf5, 0x5b, 0x45, 0x5b, 0x95,
+       0x5b, 0xe5, 0x5c, 0x35, 0x5c, 0x86, 0x5c, 0xd6,
+       0x5d, 0x27, 0x5d, 0x78, 0x5d, 0xc9, 0x5e, 0x1a,
+       0x5e, 0x6c, 0x5e, 0xbd, 0x5f, 0x0f, 0x5f, 0x61,
+       0x5f, 0xb3, 0x60, 0x05, 0x60, 0x57, 0x60, 0xaa,
+       0x60, 0xfc, 0x61, 0x4f, 0x61, 0xa2, 0x61, 0xf5,
+       0x62, 0x49, 0x62, 0x9c, 0x62, 0xf0, 0x63, 0x43,
+       0x63, 0x97, 0x63, 0xeb, 0x64, 0x40, 0x64, 0x94,
+       0x64, 0xe9, 0x65, 0x3d, 0x65, 0x92, 0x65, 0xe7,
+       0x66, 0x3d, 0x66, 0x92, 0x66, 0xe8, 0x67, 0x3d,
+       0x67, 0x93, 0x67, 0xe9, 0x68, 0x3f, 0x68, 0x96,
+       0x68, 0xec, 0x69, 0x43, 0x69, 0x9a, 0x69, 0xf1,
+       0x6a, 0x48, 0x6a, 0x9f, 0x6a, 0xf7, 0x6b, 0x4f,
+       0x6b, 0xa7, 0x6b, 0xff, 0x6c, 0x57, 0x6c, 0xaf,
+       0x6d, 0x08, 0x6d, 0x60, 0x6d, 0xb9, 0x6e, 0x12,
+       0x6e, 0x6b, 0x6e, 0xc4, 0x6f, 0x1e, 0x6f, 0x78,
+       0x6f, 0xd1, 0x70, 0x2b, 0x70, 0x86, 0x70, 0xe0,
+       0x71, 0x3a, 0x71, 0x95, 0x71, 0xf0, 0x72, 0x4b,
+       0x72, 0xa6, 0x73, 0x01, 0x73, 0x5d, 0x73, 0xb8,
+       0x74, 0x14, 0x74, 0x70, 0x74, 0xcc, 0x75, 0x28,
+       0x75, 0x85, 0x75, 0xe1, 0x76, 0x3e, 0x76, 0x9b,
+       0x76, 0xf8, 0x77, 0x56, 0x77, 0xb3, 0x78, 0x11,
+       0x78, 0x6e, 0x78, 0xcc, 0x79, 0x2a, 0x79, 0x89,
+       0x79, 0xe7, 0x7a, 0x46, 0x7a, 0xa5, 0x7b, 0x04,
+       0x7b, 0x63, 0x7b, 0xc2, 0x7c, 0x21, 0x7c, 0x81,
+       0x7c, 0xe1, 0x7d, 0x41, 0x7d, 0xa1, 0x7e, 0x01,
+       0x7e, 0x62, 0x7e, 0xc2, 0x7f, 0x23, 0x7f, 0x84,
+       0x7f, 0xe5, 0x80, 0x47, 0x80, 0xa8, 0x81, 0x0a,
+       0x81, 0x6b, 0x81, 0xcd, 0x82, 0x30, 0x82, 0x92,
+       0x82, 0xf4, 0x83, 0x57, 0x83, 0xba, 0x84, 0x1d,
+       0x84, 0x80, 0x84, 0xe3, 0x85, 0x47, 0x85, 0xab,
+       0x86, 0x0e, 0x86, 0x72, 0x86, 0xd7, 0x87, 0x3b,
+       0x87, 0x9f, 0x88, 0x04, 0x88, 0x69, 0x88, 0xce,
+       0x89, 0x33, 0x89, 0x99, 0x89, 0xfe, 0x8a, 0x64,
+       0x8a, 0xca, 0x8b, 0x30, 0x8b, 0x96, 0x8b, 0xfc,
+       0x8c, 0x63, 0x8c, 0xca, 0x8d, 0x31, 0x8d, 0x98,
+       0x8d, 0xff, 0x8e, 0x66, 0x8e, 0xce, 0x8f, 0x36,
+       0x8f, 0x9e, 0x90, 0x06, 0x90, 0x6e, 0x90, 0xd6,
+       0x91, 0x3f, 0x91, 0xa8, 0x92, 0x11, 0x92, 0x7a,
+       0x92, 0xe3, 0x93, 0x4d, 0x93, 0xb6, 0x94, 0x20,
+       0x94, 0x8a, 0x94, 0xf4, 0x95, 0x5f, 0x95, 0xc9,
+       0x96, 0x34, 0x96, 0x9f, 0x97, 0x0a, 0x97, 0x75,
+       0x97, 0xe0, 0x98, 0x4c, 0x98, 0xb8, 0x99, 0x24,
+       0x99, 0x90, 0x99, 0xfc, 0x9a, 0x68, 0x9a, 0xd5,
+       0x9b, 0x42, 0x9b, 0xaf, 0x9c, 0x1c, 0x9c, 0x89,
+       0x9c, 0xf7, 0x9d, 0x64, 0x9d, 0xd2, 0x9e, 0x40,
+       0x9e, 0xae, 0x9f, 0x1d, 0x9f, 0x8b, 0x9f, 0xfa,
+       0xa0, 0x69, 0xa0, 0xd8, 0xa1, 0x47, 0xa1, 0xb6,
+       0xa2, 0x26, 0xa2, 0x96, 0xa3, 0x06, 0xa3, 0x76,
+       0xa3, 0xe6, 0xa4, 0x56, 0xa4, 0xc7, 0xa5, 0x38,
+       0xa5, 0xa9, 0xa6, 0x1a, 0xa6, 0x8b, 0xa6, 0xfd,
+       0xa7, 0x6e, 0xa7, 0xe0, 0xa8, 0x52, 0xa8, 0xc4,
+       0xa9, 0x37, 0xa9, 0xa9, 0xaa, 0x1c, 0xaa, 0x8f,
+       0xab, 0x02, 0xab, 0x75, 0xab, 0xe9, 0xac, 0x5c,
+       0xac, 0xd0, 0xad, 0x44, 0xad, 0xb8, 0xae, 0x2d,
+       0xae, 0xa1, 0xaf, 0x16, 0xaf, 0x8b, 0xb0, 0x00,
+       0xb0, 0x75, 0xb0, 0xea, 0xb1, 0x60, 0xb1, 0xd6,
+       0xb2, 0x4b, 0xb2, 0xc2, 0xb3, 0x38, 0xb3, 0xae,
+       0xb4, 0x25, 0xb4, 0x9c, 0xb5, 0x13, 0xb5, 0x8a,
+       0xb6, 0x01, 0xb6, 0x79, 0xb6, 0xf0, 0xb7, 0x68,
+       0xb7, 0xe0, 0xb8, 0x59, 0xb8, 0xd1, 0xb9, 0x4a,
+       0xb9, 0xc2, 0xba, 0x3b, 0xba, 0xb5, 0xbb, 0x2e,
+       0xbb, 0xa7, 0xbc, 0x21, 0xbc, 0x9b, 0xbd, 0x15,
+       0xbd, 0x8f, 0xbe, 0x0a, 0xbe, 0x84, 0xbe, 0xff,
+       0xbf, 0x7a, 0xbf, 0xf5, 0xc0, 0x70, 0xc0, 0xec,
+       0xc1, 0x67, 0xc1, 0xe3, 0xc2, 0x5f, 0xc2, 0xdb,
+       0xc3, 0x58, 0xc3, 0xd4, 0xc4, 0x51, 0xc4, 0xce,
+       0xc5, 0x4b, 0xc5, 0xc8, 0xc6, 0x46, 0xc6, 0xc3,
+       0xc7, 0x41, 0xc7, 0xbf, 0xc8, 0x3d, 0xc8, 0xbc,
+       0xc9, 0x3a, 0xc9, 0xb9, 0xca, 0x38, 0xca, 0xb7,
+       0xcb, 0x36, 0xcb, 0xb6, 0xcc, 0x35, 0xcc, 0xb5,
+       0xcd, 0x35, 0xcd, 0xb5, 0xce, 0x36, 0xce, 0xb6,
+       0xcf, 0x37, 0xcf, 0xb8, 0xd0, 0x39, 0xd0, 0xba,
+       0xd1, 0x3c, 0xd1, 0xbe, 0xd2, 0x3f, 0xd2, 0xc1,
+       0xd3, 0x44, 0xd3, 0xc6, 0xd4, 0x49, 0xd4, 0xcb,
+       0xd5, 0x4e, 0xd5, 0xd1, 0xd6, 0x55, 0xd6, 0xd8,
+       0xd7, 0x5c, 0xd7, 0xe0, 0xd8, 0x64, 0xd8, 0xe8,
+       0xd9, 0x6c, 0xd9, 0xf1, 0xda, 0x76, 0xda, 0xfb,
+       0xdb, 0x80, 0xdc, 0x05, 0xdc, 0x8a, 0xdd, 0x10,
+       0xdd, 0x96, 0xde, 0x1c, 0xde, 0xa2, 0xdf, 0x29,
+       0xdf, 0xaf, 0xe0, 0x36, 0xe0, 0xbd, 0xe1, 0x44,
+       0xe1, 0xcc, 0xe2, 0x53, 0xe2, 0xdb, 0xe3, 0x63,
+       0xe3, 0xeb, 0xe4, 0x73, 0xe4, 0xfc, 0xe5, 0x84,
+       0xe6, 0x0d, 0xe6, 0x96, 0xe7, 0x1f, 0xe7, 0xa9,
+       0xe8, 0x32, 0xe8, 0xbc, 0xe9, 0x46, 0xe9, 0xd0,
+       0xea, 0x5b, 0xea, 0xe5, 0xeb, 0x70, 0xeb, 0xfb,
+       0xec, 0x86, 0xed, 0x11, 0xed, 0x9c, 0xee, 0x28,
+       0xee, 0xb4, 0xef, 0x40, 0xef, 0xcc, 0xf0, 0x58,
+       0xf0, 0xe5, 0xf1, 0x72, 0xf1, 0xff, 0xf2, 0x8c,
+       0xf3, 0x19, 0xf3, 0xa7, 0xf4, 0x34, 0xf4, 0xc2,
+       0xf5, 0x50, 0xf5, 0xde, 0xf6, 0x6d, 0xf6, 0xfb,
+       0xf7, 0x8a, 0xf8, 0x19, 0xf8, 0xa8, 0xf9, 0x38,
+       0xf9, 0xc7, 0xfa, 0x57, 0xfa, 0xe7, 0xfb, 0x77,
+       0xfc, 0x07, 0xfc, 0x98, 0xfd, 0x29, 0xfd, 0xba,
+       0xfe, 0x4b, 0xfe, 0xdc, 0xff, 0x6d, 0xff, 0xff
+};
+
+int jas_iccprofdata_srgblen = sizeof(jas_iccprofdata_srgb);
+
+uchar jas_iccprofdata_sgray[] = {
+       0x00, 0x00, 0x01, 0x8a, 0x00, 0x00, 0x00, 0x00,
+       0x02, 0x20, 0x00, 0x00, 0x73, 0x63, 0x6e, 0x72,
+       0x47, 0x52, 0x41, 0x59, 0x58, 0x59, 0x5a, 0x20,
+       0x07, 0xd3, 0x00, 0x01, 0x00, 0x1f, 0x00, 0x0d,
+       0x00, 0x35, 0x00, 0x21, 0x61, 0x63, 0x73, 0x70,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+       0x4b, 0x4f, 0x44, 0x41, 0x73, 0x47, 0x72, 0x79,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0xd6,
+       0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xd3, 0x2d,
+       0x4a, 0x50, 0x45, 0x47, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x04, 0x64, 0x65, 0x73, 0x63,
+       0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0x86,
+       0x63, 0x70, 0x72, 0x74, 0x00, 0x00, 0x01, 0x3c,
+       0x00, 0x00, 0x00, 0x2b, 0x77, 0x74, 0x70, 0x74,
+       0x00, 0x00, 0x01, 0x68, 0x00, 0x00, 0x00, 0x14,
+       0x6b, 0x54, 0x52, 0x43, 0x00, 0x00, 0x01, 0x7c,
+       0x00, 0x00, 0x00, 0x0e, 0x64, 0x65, 0x73, 0x63,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c,
+       0x52, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74,
+       0x65, 0x64, 0x20, 0x49, 0x43, 0x43, 0x20, 0x70,
+       0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x64,
+       0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x69, 0x6e,
+       0x67, 0x20, 0x73, 0x52, 0x47, 0x42, 0x2d, 0x67,
+       0x72, 0x65, 0x79, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x74, 0x65, 0x78, 0x74,
+       0x00, 0x00, 0x00, 0x00, 0x43, 0x6f, 0x70, 0x79,
+       0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x32, 0x30,
+       0x30, 0x33, 0x20, 0x73, 0x52, 0x47, 0x42, 0x2d,
+       0x67, 0x72, 0x65, 0x79, 0x20, 0x52, 0x65, 0x66,
+       0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x00, 0x00,
+       0x58, 0x59, 0x5a, 0x20, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0xf3, 0x54, 0x00, 0x01, 0x00, 0x00,
+       0x00, 0x01, 0x16, 0xcf, 0x63, 0x75, 0x72, 0x76,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+       0x01, 0xcd
+};
+
+int jas_iccprofdata_sgraylen = sizeof(jas_iccprofdata_sgray);
diff --git a/src/libjasper/base/jas_image.c b/src/libjasper/base/jas_image.c
new file mode 100644 (file)
index 0000000..876debb
--- /dev/null
@@ -0,0 +1,1445 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Image Library
+ *
+ * $Id$
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "jasper/jas_math.h"
+#include "jasper/jas_image.h"
+#include "jasper/jas_malloc.h"
+#include "jasper/jas_string.h"
+
+/******************************************************************************\
+* Types.
+\******************************************************************************/
+
+#define        FLOORDIV(x, y) ((x) / (y))
+
+/******************************************************************************\
+* Local prototypes.
+\******************************************************************************/
+
+static jas_image_cmpt_t *jas_image_cmpt_create0(void);
+static void jas_image_cmpt_destroy(jas_image_cmpt_t *cmpt);
+static jas_image_cmpt_t *jas_image_cmpt_create(uint_fast32_t tlx, uint_fast32_t tly,
+  uint_fast32_t hstep, uint_fast32_t vstep, uint_fast32_t width, uint_fast32_t
+  height, uint_fast16_t depth, bool sgnd, uint_fast32_t inmem);
+static void jas_image_setbbox(jas_image_t *image);
+static jas_image_cmpt_t *jas_image_cmpt_copy(jas_image_cmpt_t *cmpt);
+static int jas_image_growcmpts(jas_image_t *image, int maxcmpts);
+static uint_fast32_t inttobits(jas_seqent_t v, int prec, bool sgnd);
+static jas_seqent_t bitstoint(uint_fast32_t v, int prec, bool sgnd);
+static int putint(jas_stream_t *out, int sgnd, int prec, long val);
+static int getint(jas_stream_t *in, int sgnd, int prec, long *val);
+static void jas_image_calcbbox2(jas_image_t *image, jas_image_coord_t *tlx,
+  jas_image_coord_t *tly, jas_image_coord_t *brx, jas_image_coord_t *bry);
+static long uptomult(long x, long y);
+static long downtomult(long x, long y);
+static long convert(long val, int oldsgnd, int oldprec, int newsgnd,
+  int newprec);
+static void jas_image_calcbbox2(jas_image_t *image, jas_image_coord_t *tlx,
+  jas_image_coord_t *tly, jas_image_coord_t *brx, jas_image_coord_t *bry);
+
+/******************************************************************************\
+* Global data.
+\******************************************************************************/
+
+static int jas_image_numfmts = 0;
+static jas_image_fmtinfo_t jas_image_fmtinfos[JAS_IMAGE_MAXFMTS];
+
+/******************************************************************************\
+* Create and destroy operations.
+\******************************************************************************/
+
+jas_image_t *jas_image_create(int numcmpts, jas_image_cmptparm_t *cmptparms,
+  int clrspc)
+{
+       jas_image_t *image;
+       uint_fast32_t rawsize;
+       uint_fast32_t inmem;
+       int cmptno;
+       jas_image_cmptparm_t *cmptparm;
+
+       if (!(image = jas_image_create0())) {
+               return 0;
+       }
+
+       image->clrspc_ = clrspc;
+       image->maxcmpts_ = numcmpts;
+       image->inmem_ = true;
+
+       /* Allocate memory for the per-component information. */
+       if (!(image->cmpts_ = jas_malloc(image->maxcmpts_ *
+         sizeof(jas_image_cmpt_t *)))) {
+               jas_image_destroy(image);
+               return 0;
+       }
+       /* Initialize in case of failure. */
+       for (cmptno = 0; cmptno < image->maxcmpts_; ++cmptno) {
+               image->cmpts_[cmptno] = 0;
+       }
+
+       /* Compute the approximate raw size of the image. */
+       rawsize = 0;
+       for (cmptno = 0, cmptparm = cmptparms; cmptno < numcmpts; ++cmptno,
+         ++cmptparm) {
+               rawsize += cmptparm->width * cmptparm->height *
+                 (cmptparm->prec + 7) / 8;
+       }
+       /* Decide whether to buffer the image data in memory, based on the
+         raw size of the image. */
+       inmem = (rawsize < JAS_IMAGE_INMEMTHRESH);
+
+       /* Create the individual image components. */
+       for (cmptno = 0, cmptparm = cmptparms; cmptno < numcmpts; ++cmptno,
+         ++cmptparm) {
+               if (!(image->cmpts_[cmptno] = jas_image_cmpt_create(cmptparm->tlx,
+                 cmptparm->tly, cmptparm->hstep, cmptparm->vstep,
+                 cmptparm->width, cmptparm->height, cmptparm->prec,
+                 cmptparm->sgnd, inmem))) {
+                       jas_image_destroy(image);
+                       return 0;
+               }
+               ++image->numcmpts_;
+       }
+
+       /* Determine the bounding box for all of the components on the
+         reference grid (i.e., the image area) */
+       jas_image_setbbox(image);
+
+       return image;
+}
+
+jas_image_t *jas_image_create0()
+{
+       jas_image_t *image;
+
+       if (!(image = jas_malloc(sizeof(jas_image_t)))) {
+               return 0;
+       }
+
+       image->tlx_ = 0;
+       image->tly_ = 0;
+       image->brx_ = 0;
+       image->bry_ = 0;
+       image->clrspc_ = JAS_CLRSPC_UNKNOWN;
+       image->numcmpts_ = 0;
+       image->maxcmpts_ = 0;
+       image->cmpts_ = 0;
+       image->inmem_ = true;
+       image->cmprof_ = 0;
+
+       return image;
+}
+
+jas_image_t *jas_image_copy(jas_image_t *image)
+{
+       jas_image_t *newimage;
+       int cmptno;
+
+       newimage = jas_image_create0();
+       if (jas_image_growcmpts(newimage, image->numcmpts_)) {
+               goto error;
+       }
+       for (cmptno = 0; cmptno < image->numcmpts_; ++cmptno) {
+               if (!(newimage->cmpts_[cmptno] = jas_image_cmpt_copy(image->cmpts_[cmptno]))) {
+                       goto error;
+               }
+               ++newimage->numcmpts_;
+       }
+
+       jas_image_setbbox(newimage);
+
+       if (image->cmprof_) {
+               if (!(newimage->cmprof_ = jas_cmprof_copy(image->cmprof_)))
+                       goto error;
+       }
+
+       return newimage;
+error:
+       if (newimage) {
+               jas_image_destroy(newimage);
+       }
+       return 0;
+}
+
+static jas_image_cmpt_t *jas_image_cmpt_create0()
+{
+       jas_image_cmpt_t *cmpt;
+       if (!(cmpt = jas_malloc(sizeof(jas_image_cmpt_t)))) {
+               return 0;
+       }
+       memset(cmpt, 0, sizeof(jas_image_cmpt_t));
+       cmpt->type_ = JAS_IMAGE_CT_UNKNOWN;
+       return cmpt;
+}
+
+static jas_image_cmpt_t *jas_image_cmpt_copy(jas_image_cmpt_t *cmpt)
+{
+       jas_image_cmpt_t *newcmpt;
+
+       if (!(newcmpt = jas_image_cmpt_create0())) {
+               return 0;
+       }
+       newcmpt->tlx_ = cmpt->tlx_;
+       newcmpt->tly_ = cmpt->tly_;
+       newcmpt->hstep_ = cmpt->hstep_;
+       newcmpt->vstep_ = cmpt->vstep_;
+       newcmpt->width_ = cmpt->width_;
+       newcmpt->height_ = cmpt->height_;
+       newcmpt->prec_ = cmpt->prec_;
+       newcmpt->sgnd_ = cmpt->sgnd_;
+       newcmpt->cps_ = cmpt->cps_;
+       newcmpt->type_ = cmpt->type_;
+       if (!(newcmpt->stream_ = jas_stream_memopen(0, 0))) {
+               return 0;
+       }
+       if (jas_stream_seek(cmpt->stream_, 0, SEEK_SET)) {
+               return 0;
+       }
+       if (jas_stream_copy(newcmpt->stream_, cmpt->stream_, -1)) {
+               return 0;
+       }
+       if (jas_stream_seek(newcmpt->stream_, 0, SEEK_SET)) {
+               return 0;
+       }
+       return newcmpt;
+}
+
+void jas_image_destroy(jas_image_t *image)
+{
+       int i;
+
+       if (image->cmpts_) {
+               for (i = 0; i < image->numcmpts_; ++i) {
+                       jas_image_cmpt_destroy(image->cmpts_[i]);
+                       image->cmpts_[i] = 0;
+               }
+               jas_free(image->cmpts_);
+       }
+       if (image->cmprof_)
+               jas_cmprof_destroy(image->cmprof_);
+       jas_free(image);
+}
+
+static jas_image_cmpt_t *jas_image_cmpt_create(uint_fast32_t tlx, uint_fast32_t tly,
+  uint_fast32_t hstep, uint_fast32_t vstep, uint_fast32_t width, uint_fast32_t
+  height, uint_fast16_t depth, bool sgnd, uint_fast32_t inmem)
+{
+       jas_image_cmpt_t *cmpt;
+       long size;
+
+       if (!(cmpt = jas_malloc(sizeof(jas_image_cmpt_t)))) {
+               return 0;
+       }
+
+       cmpt->type_ = JAS_IMAGE_CT_UNKNOWN;
+       cmpt->tlx_ = tlx;
+       cmpt->tly_ = tly;
+       cmpt->hstep_ = hstep;
+       cmpt->vstep_ = vstep;
+       cmpt->width_ = width;
+       cmpt->height_ = height;
+       cmpt->prec_ = depth;
+       cmpt->sgnd_ = sgnd;
+       cmpt->stream_ = 0;
+       cmpt->cps_ = (depth + 7) / 8;
+
+       size = cmpt->width_ * cmpt->height_ * cmpt->cps_;
+       cmpt->stream_ = (inmem) ? jas_stream_memopen(0, size) : jas_stream_tmpfile();
+       if (!cmpt->stream_) {
+               jas_image_cmpt_destroy(cmpt);
+               return 0;
+       }
+
+       /* Zero the component data.  This isn't necessary, but it is
+       convenient for debugging purposes. */
+       if (jas_stream_seek(cmpt->stream_, size - 1, SEEK_SET) < 0 ||
+         jas_stream_putc(cmpt->stream_, 0) == EOF ||
+         jas_stream_seek(cmpt->stream_, 0, SEEK_SET) < 0) {
+               jas_image_cmpt_destroy(cmpt);
+               return 0;
+       }
+
+       return cmpt;
+}
+
+static void jas_image_cmpt_destroy(jas_image_cmpt_t *cmpt)
+{
+       if (cmpt->stream_) {
+               jas_stream_close(cmpt->stream_);
+       }
+       jas_free(cmpt);
+}
+
+/******************************************************************************\
+* Load and save operations.
+\******************************************************************************/
+
+jas_image_t *jas_image_decode(jas_stream_t *in, int fmt, char *optstr)
+{
+       jas_image_fmtinfo_t *fmtinfo;
+       jas_image_t *image;
+
+       image = 0;
+
+       /* If possible, try to determine the format of the input data. */
+       if (fmt < 0) {
+               if ((fmt = jas_image_getfmt(in)) < 0)
+                       goto error;
+       }
+
+       /* Is it possible to decode an image represented in this format? */
+       if (!(fmtinfo = jas_image_lookupfmtbyid(fmt)))
+               goto error;
+       if (!fmtinfo->ops.decode)
+               goto error;
+
+       /* Decode the image. */
+       if (!(image = (*fmtinfo->ops.decode)(in, optstr)))
+               goto error;
+
+       /* Create a color profile if needed. */
+       if (!jas_clrspc_isunknown(image->clrspc_) &&
+         !jas_clrspc_isgeneric(image->clrspc_) && !image->cmprof_) {
+               if (!(image->cmprof_ =
+                 jas_cmprof_createfromclrspc(jas_image_clrspc(image))))
+                       goto error;
+       }
+
+       return image;
+error:
+       if (image)
+               jas_image_destroy(image);
+       return 0;
+}
+
+int jas_image_encode(jas_image_t *image, jas_stream_t *out, int fmt, char *optstr)
+{
+       jas_image_fmtinfo_t *fmtinfo;
+       if (!(fmtinfo = jas_image_lookupfmtbyid(fmt))) {
+               return -1;
+       }
+       return (fmtinfo->ops.encode) ? (*fmtinfo->ops.encode)(image, out,
+         optstr) : (-1);
+}
+
+/******************************************************************************\
+* Component read and write operations.
+\******************************************************************************/
+
+int jas_image_readcmpt(jas_image_t *image, int cmptno, jas_image_coord_t x,
+  jas_image_coord_t y, jas_image_coord_t width, jas_image_coord_t height,
+  jas_matrix_t *data)
+{
+       jas_image_cmpt_t *cmpt;
+       jas_image_coord_t i;
+       jas_image_coord_t j;
+       int k;
+       jas_seqent_t v;
+       int c;
+       jas_seqent_t *dr;
+       jas_seqent_t *d;
+       int drs;
+
+       if (cmptno < 0 || cmptno >= image->numcmpts_) {
+               return -1;
+       }
+
+       cmpt = image->cmpts_[cmptno];
+       if (x >= cmpt->width_ || y >= cmpt->height_ ||
+         x + width > cmpt->width_ ||
+         y + height > cmpt->height_) {
+               return -1;
+       }
+
+       if (jas_matrix_numrows(data) != height || jas_matrix_numcols(data) != width) {
+               if (jas_matrix_resize(data, height, width)) {
+                       return -1;
+               }
+       }
+
+       dr = jas_matrix_getref(data, 0, 0);
+       drs = jas_matrix_rowstep(data);
+       for (i = 0; i < height; ++i, dr += drs) {
+               d = dr;
+               if (jas_stream_seek(cmpt->stream_, (cmpt->width_ * (y + i) + x)
+                 * cmpt->cps_, SEEK_SET) < 0) {
+                       return -1;
+               }
+               for (j = width; j > 0; --j, ++d) {
+                       v = 0;
+                       for (k = cmpt->cps_; k > 0; --k) {
+                               if ((c = jas_stream_getc(cmpt->stream_)) == EOF) {
+                                       return -1;
+                               }
+                               v = (v << 8) | (c & 0xff);
+                       }
+                       *d = bitstoint(v, cmpt->prec_, cmpt->sgnd_);
+               }
+       }
+
+       return 0;
+}
+
+int jas_image_writecmpt(jas_image_t *image, int cmptno, jas_image_coord_t x, jas_image_coord_t y, jas_image_coord_t width,
+  jas_image_coord_t height, jas_matrix_t *data)
+{
+       jas_image_cmpt_t *cmpt;
+       jas_image_coord_t i;
+       jas_image_coord_t j;
+       jas_seqent_t *d;
+       jas_seqent_t *dr;
+       int drs;
+       jas_seqent_t v;
+       int k;
+       int c;
+
+       if (cmptno < 0 || cmptno >= image->numcmpts_) {
+               return -1;
+       }
+
+       cmpt = image->cmpts_[cmptno];
+       if (x >= cmpt->width_ || y >= cmpt->height_ ||
+         x + width > cmpt->width_ ||
+         y + height > cmpt->height_) {
+               return -1;
+       }
+
+       if (jas_matrix_numrows(data) != height || jas_matrix_numcols(data) != width) {
+               return -1;
+       }
+
+       dr = jas_matrix_getref(data, 0, 0);
+       drs = jas_matrix_rowstep(data);
+       for (i = 0; i < height; ++i, dr += drs) {
+               d = dr;
+               if (jas_stream_seek(cmpt->stream_, (cmpt->width_ * (y + i) + x)
+                 * cmpt->cps_, SEEK_SET) < 0) {
+                       return -1;
+               }
+               for (j = width; j > 0; --j, ++d) {
+                       v = inttobits(*d, cmpt->prec_, cmpt->sgnd_);
+                       for (k = cmpt->cps_; k > 0; --k) {
+                               c = (v >> (8 * (cmpt->cps_ - 1))) & 0xff;
+                               if (jas_stream_putc(cmpt->stream_,
+                                 (unsigned char) c) == EOF) {
+                                       return -1;
+                               }
+                               v <<= 8;
+                       }
+               }
+       }
+
+       return 0;
+}
+
+/******************************************************************************\
+* File format operations.
+\******************************************************************************/
+
+void jas_image_clearfmts()
+{
+       int i;
+       jas_image_fmtinfo_t *fmtinfo;
+       for (i = 0; i < jas_image_numfmts; ++i) {
+               fmtinfo = &jas_image_fmtinfos[i];
+               if (fmtinfo->name) {
+                       jas_free(fmtinfo->name);
+                       fmtinfo->name = 0;
+               }
+               if (fmtinfo->ext) {
+                       jas_free(fmtinfo->ext);
+                       fmtinfo->ext = 0;
+               }
+               if (fmtinfo->desc) {
+                       jas_free(fmtinfo->desc);
+                       fmtinfo->desc = 0;
+               }
+       }
+       jas_image_numfmts = 0;
+}
+
+int jas_image_addfmt(int id, char *name, char *ext, char *desc,
+  jas_image_fmtops_t *ops)
+{
+       jas_image_fmtinfo_t *fmtinfo;
+       assert(id >= 0 && name && ext && ops);
+       if (jas_image_numfmts >= JAS_IMAGE_MAXFMTS) {
+               return -1;
+       }
+       fmtinfo = &jas_image_fmtinfos[jas_image_numfmts];
+       fmtinfo->id = id;
+       if (!(fmtinfo->name = jas_strdup(name))) {
+               return -1;
+       }
+       if (!(fmtinfo->ext = jas_strdup(ext))) {
+               jas_free(fmtinfo->name);
+               return -1;
+       }
+       if (!(fmtinfo->desc = jas_strdup(desc))) {
+               jas_free(fmtinfo->name);
+               jas_free(fmtinfo->ext);
+               return -1;
+       }
+       fmtinfo->ops = *ops;
+       ++jas_image_numfmts;
+       return 0;
+}
+
+int jas_image_strtofmt(char *name)
+{
+       jas_image_fmtinfo_t *fmtinfo;
+       if (!(fmtinfo = jas_image_lookupfmtbyname(name))) {
+               return -1;
+       }
+       return fmtinfo->id;
+}
+
+char *jas_image_fmttostr(int fmt)
+{
+       jas_image_fmtinfo_t *fmtinfo;
+       if (!(fmtinfo = jas_image_lookupfmtbyid(fmt))) {
+               return 0;
+       }
+       return fmtinfo->name;
+}
+
+int jas_image_getfmt(jas_stream_t *in)
+{
+       jas_image_fmtinfo_t *fmtinfo;
+       int found;
+       int i;
+
+       /* Check for data in each of the supported formats. */
+       found = 0;
+       for (i = 0, fmtinfo = jas_image_fmtinfos; i < jas_image_numfmts; ++i,
+         ++fmtinfo) {
+               if (fmtinfo->ops.validate) {
+                       /* Is the input data valid for this format? */
+                       if (!(*fmtinfo->ops.validate)(in)) {
+                               found = 1;
+                               break;
+                       }
+               }
+       }
+       return found ? fmtinfo->id : (-1);
+}
+
+int jas_image_fmtfromname(char *name)
+{
+       int i;
+       char *ext;
+       jas_image_fmtinfo_t *fmtinfo;
+       /* Get the file name extension. */
+       if (!(ext = strrchr(name, '.'))) {
+               return -1;
+       }
+       ++ext;
+       /* Try to find a format that uses this extension. */    
+       for (i = 0, fmtinfo = jas_image_fmtinfos; i < jas_image_numfmts; ++i,
+         ++fmtinfo) {
+               /* Do we have a match? */
+               if (!strcmp(ext, fmtinfo->ext)) {
+                       return fmtinfo->id;
+               }
+       }
+       return -1;
+}
+
+/******************************************************************************\
+* Miscellaneous operations.
+\******************************************************************************/
+
+uint_fast32_t jas_image_rawsize(jas_image_t *image)
+{
+       uint_fast32_t rawsize;
+       int cmptno;
+       jas_image_cmpt_t *cmpt;
+
+       rawsize = 0;
+       for (cmptno = 0; cmptno < image->numcmpts_; ++cmptno) {
+               cmpt = image->cmpts_[cmptno];
+               rawsize += (cmpt->width_ * cmpt->height_ * cmpt->prec_ +
+                 7) / 8;
+       }
+       return rawsize;
+}
+
+void jas_image_delcmpt(jas_image_t *image, int cmptno)
+{
+       if (cmptno >= image->numcmpts_) {
+               return;
+       }
+       jas_image_cmpt_destroy(image->cmpts_[cmptno]);
+       if (cmptno < image->numcmpts_) {
+               memmove(&image->cmpts_[cmptno], &image->cmpts_[cmptno + 1],
+                 (image->numcmpts_ - 1 - cmptno) * sizeof(jas_image_cmpt_t *));
+       }
+       --image->numcmpts_;
+
+       jas_image_setbbox(image);
+}
+
+int jas_image_addcmpt(jas_image_t *image, int cmptno,
+  jas_image_cmptparm_t *cmptparm)
+{
+       jas_image_cmpt_t *newcmpt;
+       if (cmptno < 0)
+               cmptno = image->numcmpts_;
+       assert(cmptno >= 0 && cmptno <= image->numcmpts_);
+       if (image->numcmpts_ >= image->maxcmpts_) {
+               if (jas_image_growcmpts(image, image->maxcmpts_ + 128)) {
+                       return -1;
+               }
+       }
+       if (!(newcmpt = jas_image_cmpt_create(cmptparm->tlx,
+         cmptparm->tly, cmptparm->hstep, cmptparm->vstep,
+         cmptparm->width, cmptparm->height, cmptparm->prec,
+         cmptparm->sgnd, 1))) {
+               return -1;
+       }
+       if (cmptno < image->numcmpts_) {
+               memmove(&image->cmpts_[cmptno + 1], &image->cmpts_[cmptno],
+                 (image->numcmpts_ - cmptno) * sizeof(jas_image_cmpt_t *));
+       }
+       image->cmpts_[cmptno] = newcmpt;
+       ++image->numcmpts_;
+
+       jas_image_setbbox(image);
+
+       return 0;
+}
+
+jas_image_fmtinfo_t *jas_image_lookupfmtbyid(int id)
+{
+       int i;
+       jas_image_fmtinfo_t *fmtinfo;
+
+       for (i = 0, fmtinfo = jas_image_fmtinfos; i < jas_image_numfmts; ++i, ++fmtinfo) {
+               if (fmtinfo->id == id) {
+                       return fmtinfo;
+               }
+       }
+       return 0;
+}
+
+jas_image_fmtinfo_t *jas_image_lookupfmtbyname(const char *name)
+{
+       int i;
+       jas_image_fmtinfo_t *fmtinfo;
+
+       for (i = 0, fmtinfo = jas_image_fmtinfos; i < jas_image_numfmts; ++i, ++fmtinfo) {
+               if (!strcmp(fmtinfo->name, name)) {
+                       return fmtinfo;
+               }
+       }
+       return 0;
+}
+
+
+
+
+
+static uint_fast32_t inttobits(jas_seqent_t v, int prec, bool sgnd)
+{
+       uint_fast32_t ret;
+       ret = ((sgnd && v < 0) ? ((1 << prec) + v) : v) & JAS_ONES(prec);
+       return ret;
+}
+
+static jas_seqent_t bitstoint(uint_fast32_t v, int prec, bool sgnd)
+{
+       jas_seqent_t ret;
+       v &= JAS_ONES(prec);
+       ret = (sgnd && (v & (1 << (prec - 1)))) ? (v - (1 << prec)) : v;
+       return ret;
+}
+
+static void jas_image_setbbox(jas_image_t *image)
+{
+       jas_image_cmpt_t *cmpt;
+       int cmptno;
+       int_fast32_t x;
+       int_fast32_t y;
+
+       if (image->numcmpts_ > 0) {
+               /* Determine the bounding box for all of the components on the
+                 reference grid (i.e., the image area) */
+               cmpt = image->cmpts_[0];
+               image->tlx_ = cmpt->tlx_;
+               image->tly_ = cmpt->tly_;
+               image->brx_ = cmpt->tlx_ + cmpt->hstep_ * (cmpt->width_ - 1) + 1;
+               image->bry_ = cmpt->tly_ + cmpt->vstep_ * (cmpt->height_ - 1) + 1;
+               for (cmptno = 1; cmptno < image->numcmpts_; ++cmptno) {
+                       cmpt = image->cmpts_[cmptno];
+                       if (image->tlx_ > cmpt->tlx_) {
+                               image->tlx_ = cmpt->tlx_;
+                       }
+                       if (image->tly_ > cmpt->tly_) {
+                               image->tly_ = cmpt->tly_;
+                       }
+                       x = cmpt->tlx_ + cmpt->hstep_ * (cmpt->width_ - 1) + 1;
+                       if (image->brx_ < x) {
+                               image->brx_ = x;
+                       }
+                       y = cmpt->tly_ + cmpt->vstep_ * (cmpt->height_ - 1) + 1;
+                       if (image->bry_ < y) {
+                               image->bry_ = y;
+                       }
+               }
+       } else {
+               image->tlx_ = 0;
+               image->tly_ = 0;
+               image->brx_ = 0;
+               image->bry_ = 0;
+       }
+}
+
+static int jas_image_growcmpts(jas_image_t *image, int maxcmpts)
+{
+       jas_image_cmpt_t **newcmpts;
+       int cmptno;
+
+       newcmpts = (!image->cmpts_) ? jas_malloc(maxcmpts * sizeof(jas_image_cmpt_t *)) :
+         jas_realloc(image->cmpts_, maxcmpts * sizeof(jas_image_cmpt_t *));
+       if (!newcmpts) {
+               return -1;
+       }
+       image->cmpts_ = newcmpts;
+       image->maxcmpts_ = maxcmpts;
+       for (cmptno = image->numcmpts_; cmptno < image->maxcmpts_; ++cmptno) {
+               image->cmpts_[cmptno] = 0;
+       }
+       return 0;
+}
+
+int jas_image_copycmpt(jas_image_t *dstimage, int dstcmptno, jas_image_t *srcimage,
+  int srccmptno)
+{
+       jas_image_cmpt_t *newcmpt;
+       if (dstimage->numcmpts_ >= dstimage->maxcmpts_) {
+               if (jas_image_growcmpts(dstimage, dstimage->maxcmpts_ + 128)) {
+                       return -1;
+               }
+       }
+       if (!(newcmpt = jas_image_cmpt_copy(srcimage->cmpts_[srccmptno]))) {
+               return -1;
+       }
+       if (dstcmptno < dstimage->numcmpts_) {
+               memmove(&dstimage->cmpts_[dstcmptno + 1], &dstimage->cmpts_[dstcmptno],
+                 (dstimage->numcmpts_ - dstcmptno) * sizeof(jas_image_cmpt_t *));
+       }
+       dstimage->cmpts_[dstcmptno] = newcmpt;
+       ++dstimage->numcmpts_;
+
+       jas_image_setbbox(dstimage);
+       return 0;
+}
+
+void jas_image_dump(jas_image_t *image, FILE *out)
+{
+       long buf[1024];
+       int cmptno;
+       int n;
+       int i;
+       int width;
+       int height;
+       jas_image_cmpt_t *cmpt;
+       for (cmptno = 0; cmptno < image->numcmpts_; ++cmptno) {
+               cmpt = image->cmpts_[cmptno];
+               fprintf(out, "prec=%d, sgnd=%d, cmpttype=%d\n", cmpt->prec_,
+                 cmpt->sgnd_, cmpt->type_);
+               width = jas_image_cmptwidth(image, cmptno);
+               height = jas_image_cmptheight(image, cmptno);
+               n = JAS_MIN(16, width);
+               if (jas_image_readcmpt2(image, cmptno, 0, 0, n, 1, buf)) {
+                       abort();
+               }
+               for (i = 0; i < n; ++i) {
+                       fprintf(out, " f(%d,%d)=%ld", i, 0, buf[i]);
+               }
+               fprintf(out, "\n");
+               if (jas_image_readcmpt2(image, cmptno, width - n, height - 1, n, 1, buf)) {
+                       abort();
+               }
+               for (i = 0; i < n; ++i) {
+                       fprintf(out, " f(%d,%d)=%ld", width - n + i, height - 1, buf[i]);
+               }
+               fprintf(out, "\n");
+       }
+}
+
+int jas_image_depalettize(jas_image_t *image, int cmptno, int numlutents,
+  int_fast32_t *lutents, int dtype, int newcmptno)
+{
+       jas_image_cmptparm_t cmptparms;
+       int_fast32_t v;
+       int i;
+       int j;
+       jas_image_cmpt_t *cmpt;
+
+       cmpt = image->cmpts_[cmptno];
+       cmptparms.tlx = cmpt->tlx_;
+       cmptparms.tly = cmpt->tly_;
+       cmptparms.hstep = cmpt->hstep_;
+       cmptparms.vstep = cmpt->vstep_;
+       cmptparms.width = cmpt->width_;
+       cmptparms.height = cmpt->height_;
+       cmptparms.prec = JAS_IMAGE_CDT_GETPREC(dtype);
+       cmptparms.sgnd = JAS_IMAGE_CDT_GETSGND(dtype);
+
+       if (jas_image_addcmpt(image, newcmptno, &cmptparms)) {
+               return -1;
+       }
+       if (newcmptno <= cmptno) {
+               ++cmptno;
+               cmpt = image->cmpts_[cmptno];
+       }
+
+       for (j = 0; j < cmpt->height_; ++j) {
+               for (i = 0; i < cmpt->width_; ++i) {
+                       v = jas_image_readcmptsample(image, cmptno, i, j);
+                       if (v < 0) {
+                               v = 0;
+                       } else if (v >= numlutents) {
+                               v = numlutents - 1;
+                       }
+                       jas_image_writecmptsample(image, newcmptno, i, j,
+                         lutents[v]);
+               }
+       }
+       return 0;
+}
+
+int jas_image_readcmptsample(jas_image_t *image, int cmptno, int x, int y)
+{
+       jas_image_cmpt_t *cmpt;
+       uint_fast32_t v;
+       int k;
+       int c;
+
+       cmpt = image->cmpts_[cmptno];
+
+       if (jas_stream_seek(cmpt->stream_, (cmpt->width_ * y + x) * cmpt->cps_,
+         SEEK_SET) < 0) {
+               return -1;
+       }
+       v = 0;
+       for (k = cmpt->cps_; k > 0; --k) {
+               if ((c = jas_stream_getc(cmpt->stream_)) == EOF) {
+                       return -1;
+               }
+               v = (v << 8) | (c & 0xff);
+       }
+       return bitstoint(v, cmpt->prec_, cmpt->sgnd_);
+}
+
+void jas_image_writecmptsample(jas_image_t *image, int cmptno, int x, int y,
+  int_fast32_t v)
+{
+       jas_image_cmpt_t *cmpt;
+       uint_fast32_t t;
+       int k;
+       int c;
+
+       cmpt = image->cmpts_[cmptno];
+
+       if (jas_stream_seek(cmpt->stream_, (cmpt->width_ * y + x) * cmpt->cps_,
+         SEEK_SET) < 0) {
+               return;
+       }
+       t = inttobits(v, cmpt->prec_, cmpt->sgnd_);
+       for (k = cmpt->cps_; k > 0; --k) {
+               c = (t >> (8 * (cmpt->cps_ - 1))) & 0xff;
+               if (jas_stream_putc(cmpt->stream_, (unsigned char) c) == EOF) {
+                       return;
+               }
+               t <<= 8;
+       }
+}
+
+int jas_image_getcmptbytype(jas_image_t *image, int ctype)
+{
+       int cmptno;
+
+       for (cmptno = 0; cmptno < image->numcmpts_; ++cmptno) {
+               if (image->cmpts_[cmptno]->type_ == ctype) {
+                       return cmptno;
+               }
+       }
+       return -1;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+/***********************************************/
+/***********************************************/
+/***********************************************/
+/***********************************************/
+
+int jas_image_readcmpt2(jas_image_t *image, int cmptno, jas_image_coord_t x,
+  jas_image_coord_t y, jas_image_coord_t width, jas_image_coord_t height,
+  long *buf)
+{
+       jas_image_cmpt_t *cmpt;
+       jas_image_coord_t i;
+       jas_image_coord_t j;
+       long v;
+       long *bufptr;
+
+       if (cmptno < 0 || cmptno >= image->numcmpts_)
+               goto error;
+       cmpt = image->cmpts_[cmptno];
+       if (x < 0 || x >= cmpt->width_ || y < 0 || y >= cmpt->height_ ||
+         width < 0 || height < 0 || x + width > cmpt->width_ ||
+         y + height > cmpt->height_)
+               goto error;
+
+       bufptr = buf;
+       for (i = 0; i < height; ++i) {
+               if (jas_stream_seek(cmpt->stream_, (cmpt->width_ * (y + i) + x)
+                 * cmpt->cps_, SEEK_SET) < 0)
+                       goto error;
+               for (j = 0; j < width; ++j) {
+                       if (getint(cmpt->stream_, cmpt->sgnd_, cmpt->prec_, &v))
+                               goto error;
+                       *bufptr++ = v;
+               }
+       }
+
+       return 0;
+error:
+       return -1;
+}
+
+int jas_image_writecmpt2(jas_image_t *image, int cmptno, jas_image_coord_t x,
+  jas_image_coord_t y, jas_image_coord_t width, jas_image_coord_t height,
+  long *buf)
+{
+       jas_image_cmpt_t *cmpt;
+       jas_image_coord_t i;
+       jas_image_coord_t j;
+       long v;
+       long *bufptr;
+
+       if (cmptno < 0 || cmptno >= image->numcmpts_)
+               goto error;
+       cmpt = image->cmpts_[cmptno];
+       if (x < 0 || x >= cmpt->width_ || y < 0 || y >= cmpt->height_ ||
+         width < 0 || height < 0 || x + width > cmpt->width_ ||
+         y + height > cmpt->height_)
+               goto error;
+
+       bufptr = buf;
+       for (i = 0; i < height; ++i) {
+               if (jas_stream_seek(cmpt->stream_, (cmpt->width_ * (y + i) + x)
+                 * cmpt->cps_, SEEK_SET) < 0)
+                       goto error;
+               for (j = 0; j < width; ++j) {
+                       v = *bufptr++;
+                       if (putint(cmpt->stream_, cmpt->sgnd_, cmpt->prec_, v))
+                               goto error;
+               }
+       }
+
+       return 0;
+error:
+       return -1;
+}
+
+int jas_image_sampcmpt(jas_image_t *image, int cmptno, int newcmptno,
+  jas_image_coord_t ho, jas_image_coord_t vo, jas_image_coord_t hs,
+  jas_image_coord_t vs, int sgnd, int prec)
+{
+       jas_image_cmpt_t *oldcmpt;
+       jas_image_cmpt_t *newcmpt;
+       int width;
+       int height;
+       jas_image_coord_t tlx;
+       jas_image_coord_t tly;
+       jas_image_coord_t brx;
+       jas_image_coord_t bry;
+       int i;
+       int j;
+       jas_image_cmptparm_t cmptparm;
+       jas_image_coord_t ax;
+       jas_image_coord_t ay;
+       jas_image_coord_t bx;
+       jas_image_coord_t by;
+       jas_image_coord_t d0;
+       jas_image_coord_t d1;
+       jas_image_coord_t d2;
+       jas_image_coord_t d3;
+       jas_image_coord_t oldx;
+       jas_image_coord_t oldy;
+       jas_image_coord_t x;
+       jas_image_coord_t y;
+       long v;
+       jas_image_coord_t cmptbrx;
+       jas_image_coord_t cmptbry;
+
+       assert(cmptno >= 0 && cmptno < image->numcmpts_);
+       oldcmpt = image->cmpts_[cmptno];
+       assert(oldcmpt->tlx_ == 0 && oldcmpt->tly_ == 0);
+       jas_image_calcbbox2(image, &tlx, &tly, &brx, &bry);
+       width = FLOORDIV(brx - ho + hs, hs);
+       height = FLOORDIV(bry - vo + vs, vs);
+       cmptparm.tlx = ho;
+       cmptparm.tly = vo;
+       cmptparm.hstep = hs;
+       cmptparm.vstep = vs;
+       cmptparm.width = width;
+       cmptparm.height = height;
+       cmptparm.prec = prec;
+       cmptparm.sgnd = sgnd;
+       if (jas_image_addcmpt(image, newcmptno, &cmptparm))
+               goto error;
+cmptbrx = oldcmpt->tlx_ + (oldcmpt->width_ - 1) * oldcmpt->hstep_;
+cmptbry = oldcmpt->tly_ + (oldcmpt->height_ - 1) * oldcmpt->vstep_;
+       newcmpt = image->cmpts_[newcmptno];
+       jas_stream_rewind(newcmpt->stream_);
+       for (i = 0; i < height; ++i) {
+               y = newcmpt->tly_ + newcmpt->vstep_ * i;
+               for (j = 0; j < width; ++j) {
+                       x = newcmpt->tlx_ + newcmpt->hstep_ * j;
+                       ax = downtomult(x - oldcmpt->tlx_, oldcmpt->hstep_) + oldcmpt->tlx_;
+                       ay = downtomult(y - oldcmpt->tly_, oldcmpt->vstep_) + oldcmpt->tly_;
+                       bx = uptomult(x - oldcmpt->tlx_, oldcmpt->hstep_) + oldcmpt->tlx_;
+                       if (bx > cmptbrx)
+                               bx = cmptbrx;
+                       by = uptomult(y - oldcmpt->tly_, oldcmpt->vstep_) + oldcmpt->tly_;
+                       if (by > cmptbry)
+                               by = cmptbry;
+                       d0 = (ax - x) * (ax - x) + (ay - y) * (ay - y);
+                       d1 = (bx - x) * (bx - x) + (ay - y) * (ay - y);
+                       d2 = (bx - x) * (bx - x) + (by - y) * (by - y);
+                       d3 = (ax - x) * (ax - x) + (by - y) * (by - y);
+                       if (d0 <= d1 && d0 <= d2 && d0 <= d3) {
+                               oldx = (ax - oldcmpt->tlx_) / oldcmpt->hstep_;
+                               oldy = (ay - oldcmpt->tly_) / oldcmpt->vstep_;
+                       } else if (d1 <= d0 && d1 <= d2 && d1 <= d3) {
+                               oldx = (bx - oldcmpt->tlx_) / oldcmpt->hstep_;
+                               oldy = (ay - oldcmpt->tly_) / oldcmpt->vstep_;
+                       } else if (d2 <= d0 && d2 <= d1 && d1 <= d3) {
+                               oldx = (bx - oldcmpt->tlx_) / oldcmpt->hstep_;
+                               oldy = (by - oldcmpt->tly_) / oldcmpt->vstep_;
+                       } else {
+                               oldx = (ax - oldcmpt->tlx_) / oldcmpt->hstep_;
+                               oldy = (by - oldcmpt->tly_) / oldcmpt->vstep_;
+                       }
+                       assert(oldx >= 0 && oldx < oldcmpt->width_ &&
+                         oldy >= 0 && oldy < oldcmpt->height_);
+                       if (jas_stream_seek(oldcmpt->stream_, oldcmpt->cps_ *
+                         (oldy * oldcmpt->width_ + oldx), SEEK_SET) < 0)
+                               goto error;
+                       if (getint(oldcmpt->stream_, oldcmpt->sgnd_,
+                         oldcmpt->prec_, &v))
+                               goto error;
+                       if (newcmpt->prec_ != oldcmpt->prec_ ||
+                         newcmpt->sgnd_ != oldcmpt->sgnd_) {
+                               v = convert(v, oldcmpt->sgnd_, oldcmpt->prec_,
+                                 newcmpt->sgnd_, newcmpt->prec_);
+                       }
+                       if (putint(newcmpt->stream_, newcmpt->sgnd_,
+                         newcmpt->prec_, v))
+                               goto error;
+               }
+       }
+       return 0;
+error:
+       return -1;
+}
+
+int jas_image_ishomosamp(jas_image_t *image)
+{
+       jas_image_coord_t hstep;
+       jas_image_coord_t vstep;
+       int result;
+       int i;
+       hstep = jas_image_cmpthstep(image, 0);
+       vstep = jas_image_cmptvstep(image, 0);
+       result = 1;
+       for (i = 0; i < image->numcmpts_; ++i) {
+               if (jas_image_cmpthstep(image, i) != hstep ||
+                 jas_image_cmptvstep(image, i) != vstep) {
+                       result = 0;
+                       break;
+               }
+       }
+       return result;
+}
+
+/* Note: This function defines a bounding box differently. */
+static void jas_image_calcbbox2(jas_image_t *image, jas_image_coord_t *tlx,
+  jas_image_coord_t *tly, jas_image_coord_t *brx, jas_image_coord_t *bry)
+{
+       jas_image_cmpt_t *cmpt;
+       jas_image_coord_t tmptlx;
+       jas_image_coord_t tmptly;
+       jas_image_coord_t tmpbrx;
+       jas_image_coord_t tmpbry;
+       jas_image_coord_t t;
+       int i;
+       if (image->numcmpts_ > 0) {
+               cmpt = image->cmpts_[0];
+               tmptlx = cmpt->tlx_;
+               tmptly = cmpt->tly_;
+               tmpbrx = cmpt->tlx_ + cmpt->hstep_ * (cmpt->width_ - 1);
+               tmpbry = cmpt->tly_ + cmpt->vstep_ * (cmpt->height_ - 1);
+               for (i = 0; i < image->numcmpts_; ++i) {
+                       cmpt = image->cmpts_[i];
+                       if (cmpt->tlx_ < tmptlx)
+                               tmptlx = cmpt->tlx_;
+                       if (cmpt->tly_ < tmptly)
+                               tmptly = cmpt->tly_;
+                       t = cmpt->tlx_ + cmpt->hstep_ * (cmpt->width_ - 1);
+                       if (t > tmpbrx)
+                               tmpbrx = t;
+                       t = cmpt->tly_ + cmpt->vstep_ * (cmpt->height_ - 1);
+                       if (t > tmpbry)
+                               tmpbry = t;
+               }
+       } else {
+               tmptlx = 0;
+               tmptly = 0;
+               tmpbrx = -1;
+               tmpbry = -1;
+       }
+       *tlx = tmptlx;
+       *tly = tmptly;
+       *brx = tmpbrx;
+       *bry = tmpbry;
+}
+
+
+
+static int getint(jas_stream_t *in, int sgnd, int prec, long *val)
+{
+       long v;
+       int n;
+       int c;
+       n = (prec + 7) / 8;
+       v = 0;
+       while (--n >= 0) {
+               if ((c = jas_stream_getc(in)) == EOF)
+                       return -1;
+               v = (v << 8) | c;
+       }
+       v &= ((1 << prec) - 1);
+       if (sgnd) {
+               /* XXX - Do something here. */
+               abort();
+       } else {
+               *val = v;
+       }
+       return 0;
+}
+
+static int putint(jas_stream_t *out, int sgnd, int prec, long val)
+{
+       int n;
+       int c;
+       if (sgnd) {
+               /* XXX - Do something here. */
+               abort();
+       }
+       val &= (1 << prec) - 1;
+       n = (prec + 7) / 8;
+       while (--n >= 0) {
+               c = (val >> (n * 8)) & 0xff;
+               if (jas_stream_putc(out, c) != c)
+                       return -1;
+       }
+       return 0;
+}
+
+static long convert(long val, int oldsgnd, int oldprec, int newsgnd,
+  int newprec)
+{
+       if (newsgnd != oldsgnd) {
+       }
+       if (newprec != oldprec) {
+               if (newprec > oldprec) {
+                       val <<= newprec - oldprec;
+               } else if (oldprec > newprec) {
+                       val >>= oldprec - newprec;
+               }
+       }
+       return val;
+}
+
+static long downtomult(long x, long y)
+{
+       assert(x >= 0);
+       return (x / y) * y;
+}
+
+static long uptomult(long x, long y)
+{
+       assert(x >= 0);
+       return ((x + y - 1) / y) * y;
+}
+
+jas_image_t *jas_image_chclrspc(jas_image_t *image, jas_cmprof_t *outprof,
+  int intent)
+{
+       jas_image_t *inimage;
+       int minhstep;
+       int minvstep;
+       int i;
+       int j;
+       int k;
+       int n;
+       int hstep;
+       int vstep;
+       int numinauxchans;
+       int numoutauxchans;
+       int numinclrchans;
+       int numoutclrchans;
+       int prec;
+       jas_image_t *outimage;
+       int cmpttype;
+       int numoutchans;
+       jas_cmprof_t *inprof;
+       jas_cmprof_t *tmpprof;
+       jas_image_cmptparm_t cmptparm;
+       int width;
+       int height;
+       jas_cmxform_t *xform;
+       jas_cmpixmap_t inpixmap;
+       jas_cmpixmap_t outpixmap;
+       jas_cmcmptfmt_t *incmptfmts;
+       jas_cmcmptfmt_t *outcmptfmts;
+
+#if 0
+jas_eprintf("IMAGE\n");
+jas_image_dump(image, stderr);
+#endif
+
+       if (!(inimage = jas_image_copy(image)))
+               goto error;
+       image = 0;
+
+       if (!jas_image_ishomosamp(inimage)) {
+               minhstep = jas_image_cmpthstep(inimage, 0);
+               minvstep = jas_image_cmptvstep(inimage, 0);
+               for (i = 1; i < jas_image_numcmpts(inimage); ++i) {
+                       hstep = jas_image_cmpthstep(inimage, i);
+                       vstep = jas_image_cmptvstep(inimage, i);
+                       if (hstep < minhstep)
+                               minhstep = hstep;
+                       if (vstep < minvstep)
+                               minvstep = vstep;
+               }
+               n = jas_image_numcmpts(inimage);
+               for (i = 0; i < n; ++i) {
+                       cmpttype = jas_image_cmpttype(inimage, i);
+                       if (jas_image_sampcmpt(inimage, i, i + 1, 0, 0, minhstep, minvstep, jas_image_cmptsgnd(inimage, i), jas_image_cmptprec(inimage, i)))
+                               goto error;
+                       jas_image_setcmpttype(inimage, i + 1, cmpttype);
+                       jas_image_delcmpt(inimage, i);
+               }
+       }
+
+       width = jas_image_cmptwidth(inimage, 0);
+       height = jas_image_cmptheight(inimage, 0);
+       hstep = jas_image_cmpthstep(inimage, 0);
+       vstep = jas_image_cmptvstep(inimage, 0);
+
+       inprof = jas_image_cmprof(inimage);
+       assert(inprof);
+       numinclrchans = jas_clrspc_numchans(jas_cmprof_clrspc(inprof));
+       numinauxchans = jas_image_numcmpts(inimage) - numinclrchans;
+       numoutclrchans = jas_clrspc_numchans(jas_cmprof_clrspc(outprof));
+       numoutauxchans = 0;
+       numoutchans = numoutclrchans + numoutauxchans;
+       prec = 8;
+
+       if (!(outimage = jas_image_create0()))
+               goto error;
+
+       /* Create a component for each of the colorants. */
+       for (i = 0; i < numoutclrchans; ++i) {
+               cmptparm.tlx = 0;
+               cmptparm.tly = 0;
+               cmptparm.hstep = hstep;
+               cmptparm.vstep = vstep;
+               cmptparm.width = width;
+               cmptparm.height = height;
+               cmptparm.prec = prec;
+               cmptparm.sgnd = 0;
+               if (jas_image_addcmpt(outimage, -1, &cmptparm))
+                       goto error;
+               jas_image_setcmpttype(outimage, i, JAS_IMAGE_CT_COLOR(i));
+       }
+#if 0
+       /* Copy the auxiliary components without modification. */
+       for (i = 0; i < jas_image_numcmpts(inimage); ++i) {
+               if (!ISCOLOR(jas_image_cmpttype(inimage, i))) {
+                       jas_image_copycmpt(outimage, -1, inimage, i);
+/* XXX - need to specify laydown of component on ref. grid */
+               }
+       }
+#endif
+
+       if (!(tmpprof = jas_cmprof_copy(outprof)))
+               goto error;
+       assert(!jas_image_cmprof(outimage));
+       jas_image_setcmprof(outimage, tmpprof);
+       tmpprof = 0;
+       jas_image_setclrspc(outimage, jas_cmprof_clrspc(outprof));
+
+       if (!(xform = jas_cmxform_create(inprof, outprof, 0, JAS_CMXFORM_OP_FWD, intent, 0)))
+               goto error;
+
+       inpixmap.numcmpts = numinclrchans;
+       incmptfmts = malloc(numinclrchans * sizeof(jas_cmcmptfmt_t));
+       assert(incmptfmts);
+       inpixmap.cmptfmts = incmptfmts;
+       for (i = 0; i < numinclrchans; ++i) {
+               j = jas_image_getcmptbytype(inimage, JAS_IMAGE_CT_COLOR(i));
+               assert(j >= 0);
+               if (!(incmptfmts[i].buf = malloc(width * sizeof(long))))
+                       goto error;
+               incmptfmts[i].prec = jas_image_cmptprec(inimage, j);
+               incmptfmts[i].sgnd = jas_image_cmptsgnd(inimage, j);
+               incmptfmts[i].width = width;
+               incmptfmts[i].height = 1;
+       }
+
+       outpixmap.numcmpts = numoutclrchans;
+       outcmptfmts = malloc(numoutclrchans * sizeof(jas_cmcmptfmt_t));
+       assert(outcmptfmts);
+       outpixmap.cmptfmts = outcmptfmts;
+
+       for (i = 0; i < numoutclrchans; ++i) {
+               j = jas_image_getcmptbytype(outimage, JAS_IMAGE_CT_COLOR(i));
+               assert(j >= 0);
+               if (!(outcmptfmts[i].buf = malloc(width * sizeof(long))))
+                       goto error;
+               outcmptfmts[i].prec = jas_image_cmptprec(outimage, j);
+               outcmptfmts[i].sgnd = jas_image_cmptsgnd(outimage, j);
+               outcmptfmts[i].width = width;
+               outcmptfmts[i].height = 1;
+       }
+
+       for (i = 0; i < height; ++i) {
+               for (j = 0; j < numinclrchans; ++j) {
+                       k = jas_image_getcmptbytype(inimage, JAS_IMAGE_CT_COLOR(j));
+                       if (jas_image_readcmpt2(inimage, k, 0, i, width, 1, incmptfmts[j].buf))
+                               goto error;
+               }
+               jas_cmxform_apply(xform, &inpixmap, &outpixmap);
+               for (j = 0; j < numoutclrchans; ++j) {
+                       k = jas_image_getcmptbytype(outimage, JAS_IMAGE_CT_COLOR(j));
+                       if (jas_image_writecmpt2(outimage, k, 0, i, width, 1, outcmptfmts[j].buf))
+                               goto error;
+               }
+       }
+
+       for (i = 0; i < numoutclrchans; ++i)
+               jas_free(outcmptfmts[i].buf);
+       jas_free(outcmptfmts);
+       for (i = 0; i < numinclrchans; ++i)
+               jas_free(incmptfmts[i].buf);
+       jas_free(incmptfmts);
+       jas_cmxform_destroy(xform);
+       jas_image_destroy(inimage);
+
+#if 0
+jas_eprintf("INIMAGE\n");
+jas_image_dump(inimage, stderr);
+jas_eprintf("OUTIMAGE\n");
+jas_image_dump(outimage, stderr);
+#endif
+       return outimage;
+error:
+       return 0;
+}
diff --git a/src/libjasper/base/jas_init.c b/src/libjasper/base/jas_init.c
new file mode 100644 (file)
index 0000000..898616b
--- /dev/null
@@ -0,0 +1,162 @@
+/*
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include "jasper/jas_types.h"
+#include "jasper/jas_image.h"
+#include "jasper/jas_init.h"
+
+/******************************************************************************\
+* Code.
+\******************************************************************************/
+
+/* Initialize the image format table. */
+int jas_init()
+{
+       jas_image_fmtops_t fmtops;
+       int fmtid;
+
+       fmtid = 0;
+
+#if !defined(EXCLUDE_MIF_SUPPORT)
+       fmtops.decode = mif_decode;
+       fmtops.encode = mif_encode;
+       fmtops.validate = mif_validate;
+       jas_image_addfmt(fmtid, "mif", "mif", "My Image Format (MIF)", &fmtops);
+       ++fmtid;
+#endif
+
+#if !defined(EXCLUDE_PNM_SUPPORT)
+       fmtops.decode = pnm_decode;
+       fmtops.encode = pnm_encode;
+       fmtops.validate = pnm_validate;
+       jas_image_addfmt(fmtid, "pnm", "pnm", "Portable Graymap/Pixmap (PNM)",
+         &fmtops);
+       jas_image_addfmt(fmtid, "pnm", "pgm", "Portable Graymap/Pixmap (PNM)",
+         &fmtops);
+       jas_image_addfmt(fmtid, "pnm", "ppm", "Portable Graymap/Pixmap (PNM)",
+         &fmtops);
+       ++fmtid;
+#endif
+
+#if !defined(EXCLUDE_BMP_SUPPORT)
+       fmtops.decode = bmp_decode;
+       fmtops.encode = bmp_encode;
+       fmtops.validate = bmp_validate;
+       jas_image_addfmt(fmtid, "bmp", "bmp", "Microsoft Bitmap (BMP)", &fmtops);
+       ++fmtid;
+#endif
+
+#if !defined(EXCLUDE_RAS_SUPPORT)
+       fmtops.decode = ras_decode;
+       fmtops.encode = ras_encode;
+       fmtops.validate = ras_validate;
+       jas_image_addfmt(fmtid, "ras", "ras", "Sun Rasterfile (RAS)", &fmtops);
+       ++fmtid;
+#endif
+
+#if !defined(EXCLUDE_JP2_SUPPORT)
+       fmtops.decode = jp2_decode;
+       fmtops.encode = jp2_encode;
+       fmtops.validate = jp2_validate;
+       jas_image_addfmt(fmtid, "jp2", "jp2",
+         "JPEG-2000 JP2 File Format Syntax (ISO/IEC 15444-1)", &fmtops);
+       ++fmtid;
+       fmtops.decode = jpc_decode;
+       fmtops.encode = jpc_encode;
+       fmtops.validate = jpc_validate;
+       jas_image_addfmt(fmtid, "jpc", "jpc",
+         "JPEG-2000 Code Stream Syntax (ISO/IEC 15444-1)", &fmtops);
+       ++fmtid;
+#endif
+
+#if !defined(EXCLUDE_JPG_SUPPORT)
+       fmtops.decode = jpg_decode;
+       fmtops.encode = jpg_encode;
+       fmtops.validate = jpg_validate;
+       jas_image_addfmt(fmtid, "jpg", "jpg", "JPEG (ISO/IEC 10918-1)", &fmtops);
+       ++fmtid;
+#endif
+
+#if !defined(EXCLUDE_PGX_SUPPORT)
+       fmtops.decode = pgx_decode;
+       fmtops.encode = pgx_encode;
+       fmtops.validate = pgx_validate;
+       jas_image_addfmt(fmtid, "pgx", "pgx", "JPEG-2000 VM Format (PGX)", &fmtops);
+       ++fmtid;
+#endif
+
+       /* We must not register the JasPer library exit handler until after
+       at least one memory allocation is performed.  This is desirable
+       as it ensures that the JasPer exit handler is called before the
+       debug memory allocator exit handler. */
+       atexit(jas_cleanup);
+
+       return 0;
+}
+
+void jas_cleanup()
+{
+       jas_image_clearfmts();
+}
diff --git a/src/libjasper/base/jas_malloc.c b/src/libjasper/base/jas_malloc.c
new file mode 100644 (file)
index 0000000..13f7bc8
--- /dev/null
@@ -0,0 +1,131 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Memory Allocator
+ *
+ * $Id$
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+
+/* We need the prototype for memset. */
+#include <string.h>
+
+#include "jasper/jas_malloc.h"
+
+/******************************************************************************\
+* Code.
+\******************************************************************************/
+
+#if defined(DEBUG_MEMALLOC)
+#include "../../../local/src/memalloc.c"
+#endif
+
+#if !defined(DEBUG_MEMALLOC)
+
+#define MEMALLOC_ALIGNMENT     32
+#define MEMALLOC_ALIGN2
+#undef MEMALLOC_ALIGN2
+
+void *jas_malloc(size_t size)
+{
+#if defined(MEMALLOC_ALIGN2)
+       void *ptr;
+abort();
+       if (posix_memalign(&ptr, MEMALLOC_ALIGNMENT, size)) {
+               return 0;
+       }
+       return ptr;
+#endif
+       return malloc(size);
+}
+
+void jas_free(void *ptr)
+{
+       free(ptr);
+}
+
+void *jas_realloc(void *ptr, size_t size)
+{
+       return realloc(ptr, size);
+}
+
+void *jas_calloc(size_t nmemb, size_t size)
+{
+       void *ptr;
+       size_t n;
+       n = nmemb * size;
+       if (!(ptr = jas_malloc(n * sizeof(char)))) {
+               return 0;
+       }
+       memset(ptr, 0, n);
+       return ptr;
+}
+
+#endif
diff --git a/src/libjasper/base/jas_seq.c b/src/libjasper/base/jas_seq.c
new file mode 100644 (file)
index 0000000..16e1778
--- /dev/null
@@ -0,0 +1,454 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Sequence/Matrix Library
+ *
+ * $Id$
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <stdlib.h>
+#include <assert.h>
+#include <math.h>
+
+#include "jasper/jas_seq.h"
+#include "jasper/jas_malloc.h"
+#include "jasper/jas_math.h"
+
+/******************************************************************************\
+* Constructors and destructors.
+\******************************************************************************/
+
+jas_matrix_t *jas_seq2d_create(int xstart, int ystart, int xend, int yend)
+{
+       jas_matrix_t *matrix;
+       assert(xstart <= xend && ystart <= yend);
+       if (!(matrix = jas_matrix_create(yend - ystart, xend - xstart))) {
+               return 0;
+       }
+       matrix->xstart_ = xstart;
+       matrix->ystart_ = ystart;
+       matrix->xend_ = xend;
+       matrix->yend_ = yend;
+       return matrix;
+}
+
+jas_matrix_t *jas_matrix_create(int numrows, int numcols)
+{
+       jas_matrix_t *matrix;
+       int i;
+
+       if (!(matrix = jas_malloc(sizeof(jas_matrix_t)))) {
+               return 0;
+       }
+       matrix->flags_ = 0;
+       matrix->numrows_ = numrows;
+       matrix->numcols_ = numcols;
+       matrix->rows_ = 0;
+       matrix->maxrows_ = numrows;
+       matrix->data_ = 0;
+       matrix->datasize_ = numrows * numcols;
+
+       if (matrix->maxrows_ > 0) {
+               if (!(matrix->rows_ = jas_malloc(matrix->maxrows_ *
+                 sizeof(jas_seqent_t *)))) {
+                       jas_matrix_destroy(matrix);
+                       return 0;
+               }
+       }
+
+       if (matrix->datasize_ > 0) {
+               if (!(matrix->data_ = jas_malloc(matrix->datasize_ *
+                 sizeof(jas_seqent_t)))) {
+                       jas_matrix_destroy(matrix);
+                       return 0;
+               }
+       }
+
+       for (i = 0; i < numrows; ++i) {
+               matrix->rows_[i] = &matrix->data_[i * matrix->numcols_];
+       }
+
+       for (i = 0; i < matrix->datasize_; ++i) {
+               matrix->data_[i] = 0;
+       }
+
+       matrix->xstart_ = 0;
+       matrix->ystart_ = 0;
+       matrix->xend_ = matrix->numcols_;
+       matrix->yend_ = matrix->numrows_;
+
+       return matrix;
+}
+
+void jas_matrix_destroy(jas_matrix_t *matrix)
+{
+       if (matrix->data_) {
+               assert(!(matrix->flags_ & JAS_MATRIX_REF));
+               jas_free(matrix->data_);
+               matrix->data_ = 0;
+       }
+       if (matrix->rows_) {
+               jas_free(matrix->rows_);
+               matrix->rows_ = 0;
+       }
+       jas_free(matrix);
+}
+
+jas_seq2d_t *jas_seq2d_copy(jas_seq2d_t *x)
+{
+       jas_matrix_t *y;
+       int i;
+       int j;
+       y = jas_seq2d_create(jas_seq2d_xstart(x), jas_seq2d_ystart(x), jas_seq2d_xend(x),
+         jas_seq2d_yend(x));
+       assert(y);
+       for (i = 0; i < x->numrows_; ++i) {
+               for (j = 0; j < x->numcols_; ++j) {
+                       *jas_matrix_getref(y, i, j) = jas_matrix_get(x, i, j);
+               }
+       }
+       return y;
+}
+
+jas_matrix_t *jas_matrix_copy(jas_matrix_t *x)
+{
+       jas_matrix_t *y;
+       int i;
+       int j;
+       y = jas_matrix_create(x->numrows_, x->numcols_);
+       for (i = 0; i < x->numrows_; ++i) {
+               for (j = 0; j < x->numcols_; ++j) {
+                       *jas_matrix_getref(y, i, j) = jas_matrix_get(x, i, j);
+               }
+       }
+       return y;
+}
+
+/******************************************************************************\
+* Bind operations.
+\******************************************************************************/
+
+void jas_seq2d_bindsub(jas_matrix_t *s, jas_matrix_t *s1, int xstart, int ystart,
+  int xend, int yend)
+{
+       jas_matrix_bindsub(s, s1, ystart - s1->ystart_, xstart - s1->xstart_,
+         yend - s1->ystart_ - 1, xend - s1->xstart_ - 1);
+}
+
+void jas_matrix_bindsub(jas_matrix_t *mat0, jas_matrix_t *mat1, int r0, int c0,
+  int r1, int c1)
+{
+       int i;
+
+       if (mat0->data_) {
+               if (!(mat0->flags_ & JAS_MATRIX_REF)) {
+                       jas_free(mat0->data_);
+               }
+               mat0->data_ = 0;
+               mat0->datasize_ = 0;
+       }
+       if (mat0->rows_) {
+               jas_free(mat0->rows_);
+               mat0->rows_ = 0;
+       }
+       mat0->flags_ |= JAS_MATRIX_REF;
+       mat0->numrows_ = r1 - r0 + 1;
+       mat0->numcols_ = c1 - c0 + 1;
+       mat0->maxrows_ = mat0->numrows_;
+       mat0->rows_ = jas_malloc(mat0->maxrows_ * sizeof(jas_seqent_t *));
+       for (i = 0; i < mat0->numrows_; ++i) {
+               mat0->rows_[i] = mat1->rows_[r0 + i] + c0;
+       }
+
+       mat0->xstart_ = mat1->xstart_ + c0;
+       mat0->ystart_ = mat1->ystart_ + r0;
+       mat0->xend_ = mat0->xstart_ + mat0->numcols_;
+       mat0->yend_ = mat0->ystart_ + mat0->numrows_;
+}
+
+/******************************************************************************\
+* Arithmetic operations.
+\******************************************************************************/
+
+int jas_matrix_cmp(jas_matrix_t *mat0, jas_matrix_t *mat1)
+{
+       int i;
+       int j;
+
+       if (mat0->numrows_ != mat1->numrows_ || mat0->numcols_ !=
+         mat1->numcols_) {
+               return 1;
+       }
+       for (i = 0; i < mat0->numrows_; i++) {
+               for (j = 0; j < mat0->numcols_; j++) {
+                       if (jas_matrix_get(mat0, i, j) != jas_matrix_get(mat1, i, j)) {
+                               return 1;
+                       }
+               }
+       }
+       return 0;
+}
+
+void jas_matrix_divpow2(jas_matrix_t *matrix, int n)
+{
+       int i;
+       int j;
+       jas_seqent_t *rowstart;
+       int rowstep;
+       jas_seqent_t *data;
+
+       rowstep = jas_matrix_rowstep(matrix);
+       for (i = matrix->numrows_, rowstart = matrix->rows_[0]; i > 0; --i,
+         rowstart += rowstep) {
+               for (j = matrix->numcols_, data = rowstart; j > 0; --j,
+                 ++data) {
+                       *data = (*data >= 0) ? ((*data) >> n) :
+                         (-((-(*data)) >> n));
+               }
+       }
+}
+
+void jas_matrix_clip(jas_matrix_t *matrix, jas_seqent_t minval, jas_seqent_t maxval)
+{
+       int i;
+       int j;
+       jas_seqent_t v;
+       jas_seqent_t *rowstart;
+       jas_seqent_t *data;
+       int rowstep;
+
+       rowstep = jas_matrix_rowstep(matrix);
+       for (i = matrix->numrows_, rowstart = matrix->rows_[0]; i > 0; --i,
+         rowstart += rowstep) {
+               data = rowstart;
+               for (j = matrix->numcols_, data = rowstart; j > 0; --j,
+                 ++data) {
+                       v = *data;
+                       if (v < minval) {
+                               *data = minval;
+                       } else if (v > maxval) {
+                               *data = maxval;
+                       }
+               }
+       }
+}
+
+void jas_matrix_asr(jas_matrix_t *matrix, int n)
+{
+       int i;
+       int j;
+       jas_seqent_t *rowstart;
+       int rowstep;
+       jas_seqent_t *data;
+
+       assert(n >= 0);
+       rowstep = jas_matrix_rowstep(matrix);
+       for (i = matrix->numrows_, rowstart = matrix->rows_[0]; i > 0; --i,
+         rowstart += rowstep) {
+               for (j = matrix->numcols_, data = rowstart; j > 0; --j,
+                 ++data) {
+                       *data >>= n;
+               }
+       }
+}
+
+void jas_matrix_asl(jas_matrix_t *matrix, int n)
+{
+       int i;
+       int j;
+       jas_seqent_t *rowstart;
+       int rowstep;
+       jas_seqent_t *data;
+
+       rowstep = jas_matrix_rowstep(matrix);
+       for (i = matrix->numrows_, rowstart = matrix->rows_[0]; i > 0; --i,
+         rowstart += rowstep) {
+               for (j = matrix->numcols_, data = rowstart; j > 0; --j,
+                 ++data) {
+                       *data <<= n;
+               }
+       }
+}
+
+/******************************************************************************\
+* Code.
+\******************************************************************************/
+
+int jas_matrix_resize(jas_matrix_t *matrix, int numrows, int numcols)
+{
+       int size;
+       int i;
+
+       size = numrows * numcols;
+       if (size > matrix->datasize_ || numrows > matrix->maxrows_) {
+               return -1;
+       }
+
+       matrix->numrows_ = numrows;
+       matrix->numcols_ = numcols;
+
+       for (i = 0; i < numrows; ++i) {
+               matrix->rows_[i] = &matrix->data_[numcols * i];
+       }
+
+       return 0;
+}
+
+void jas_matrix_setall(jas_matrix_t *matrix, jas_seqent_t val)
+{
+       int i;
+       int j;
+       jas_seqent_t *rowstart;
+       int rowstep;
+       jas_seqent_t *data;
+
+       rowstep = jas_matrix_rowstep(matrix);
+       for (i = matrix->numrows_, rowstart = matrix->rows_[0]; i > 0; --i,
+         rowstart += rowstep) {
+               for (j = matrix->numcols_, data = rowstart; j > 0; --j,
+                 ++data) {
+                       *data = val;
+               }
+       }
+}
+
+jas_matrix_t *jas_seq2d_input(FILE *in)
+{
+       jas_matrix_t *matrix;
+       int i;
+       int j;
+       long x;
+       int numrows;
+       int numcols;
+       int xoff;
+       int yoff;
+
+       if (fscanf(in, "%d %d", &xoff, &yoff) != 2)
+               return 0;
+       if (fscanf(in, "%d %d", &numcols, &numrows) != 2)
+               return 0;
+       if (!(matrix = jas_seq2d_create(xoff, yoff, xoff + numcols, yoff + numrows)))
+               return 0;
+
+       if (jas_matrix_numrows(matrix) != numrows || jas_matrix_numcols(matrix) != numcols) {
+               abort();
+       }
+
+       /* Get matrix data. */
+       for (i = 0; i < jas_matrix_numrows(matrix); i++) {
+               for (j = 0; j < jas_matrix_numcols(matrix); j++) {
+                       if (fscanf(in, "%ld", &x) != 1) {
+                               jas_matrix_destroy(matrix);
+                               return 0;
+                       }
+                       jas_matrix_set(matrix, i, j, JAS_CAST(jas_seqent_t, x));
+               }
+       }
+
+       return matrix;
+}
+
+int jas_seq2d_output(jas_matrix_t *matrix, FILE *out)
+{
+#define MAXLINELEN     80
+       int i;
+       int j;
+       jas_seqent_t x;
+       char buf[MAXLINELEN + 1];
+       char sbuf[MAXLINELEN + 1];
+       int n;
+
+       fprintf(out, "%d %d\n", jas_seq2d_xstart(matrix),
+         jas_seq2d_ystart(matrix));
+       fprintf(out, "%d %d\n", jas_matrix_numcols(matrix),
+         jas_matrix_numrows(matrix));
+
+       buf[0] = '\0';
+       for (i = 0; i < jas_matrix_numrows(matrix); ++i) {
+               for (j = 0; j < jas_matrix_numcols(matrix); ++j) {
+                       x = jas_matrix_get(matrix, i, j);
+                       sprintf(sbuf, "%s%4ld", (strlen(buf) > 0) ? " " : "",
+                         JAS_CAST(long, x));
+                       n = strlen(buf);
+                       if (n + strlen(sbuf) > MAXLINELEN) {
+                               fputs(buf, out);
+                               fputs("\n", out);
+                               buf[0] = '\0';
+                       }
+                       strcat(buf, sbuf);
+                       if (j == jas_matrix_numcols(matrix) - 1) {
+                               fputs(buf, out);
+                               fputs("\n", out);
+                               buf[0] = '\0';
+                       }
+               }
+       }
+       fputs(buf, out);
+
+       return 0;
+}
diff --git a/src/libjasper/base/jas_stream.c b/src/libjasper/base/jas_stream.c
new file mode 100644 (file)
index 0000000..9a88556
--- /dev/null
@@ -0,0 +1,1150 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * I/O Stream Library
+ *
+ * $Id$
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <assert.h>
+#if defined(HAVE_FCNTL_H)
+#include <fcntl.h>
+#endif
+#include <stdlib.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <ctype.h>
+#if defined(HAVE_UNISTD_H)
+#include <unistd.h>
+#endif
+#if defined(WIN32) || defined(HAVE_IO_H)
+#include <io.h>
+#endif
+
+#include "jasper/jas_types.h"
+#include "jasper/jas_stream.h"
+#include "jasper/jas_malloc.h"
+#include "jasper/jas_math.h"
+
+/******************************************************************************\
+* Local function prototypes.
+\******************************************************************************/
+
+static int jas_strtoopenmode(const char *s);
+static void jas_stream_destroy(jas_stream_t *stream);
+static jas_stream_t *jas_stream_create(void);
+static void jas_stream_initbuf(jas_stream_t *stream, int bufmode, char *buf,
+  int bufsize);
+
+static int mem_read(jas_stream_obj_t *obj, char *buf, int cnt);
+static int mem_write(jas_stream_obj_t *obj, char *buf, int cnt);
+static long mem_seek(jas_stream_obj_t *obj, long offset, int origin);
+static int mem_close(jas_stream_obj_t *obj);
+
+static int sfile_read(jas_stream_obj_t *obj, char *buf, int cnt);
+static int sfile_write(jas_stream_obj_t *obj, char *buf, int cnt);
+static long sfile_seek(jas_stream_obj_t *obj, long offset, int origin);
+static int sfile_close(jas_stream_obj_t *obj);
+
+static int file_read(jas_stream_obj_t *obj, char *buf, int cnt);
+static int file_write(jas_stream_obj_t *obj, char *buf, int cnt);
+static long file_seek(jas_stream_obj_t *obj, long offset, int origin);
+static int file_close(jas_stream_obj_t *obj);
+
+/******************************************************************************\
+* Local data.
+\******************************************************************************/
+
+static jas_stream_ops_t jas_stream_fileops = {
+       file_read,
+       file_write,
+       file_seek,
+       file_close
+};
+
+static jas_stream_ops_t jas_stream_sfileops = {
+       sfile_read,
+       sfile_write,
+       sfile_seek,
+       sfile_close
+};
+
+static jas_stream_ops_t jas_stream_memops = {
+       mem_read,
+       mem_write,
+       mem_seek,
+       mem_close
+};
+
+/******************************************************************************\
+* Code for opening and closing streams.
+\******************************************************************************/
+
+static jas_stream_t *jas_stream_create()
+{
+       jas_stream_t *stream;
+
+       if (!(stream = jas_malloc(sizeof(jas_stream_t)))) {
+               return 0;
+       }
+       stream->openmode_ = 0;
+       stream->bufmode_ = 0;
+       stream->flags_ = 0;
+       stream->bufbase_ = 0;
+       stream->bufstart_ = 0;
+       stream->bufsize_ = 0;
+       stream->ptr_ = 0;
+       stream->cnt_ = 0;
+       stream->ops_ = 0;
+       stream->obj_ = 0;
+       stream->rwcnt_ = 0;
+       stream->rwlimit_ = -1;
+
+       return stream;
+}
+
+jas_stream_t *jas_stream_memopen(char *buf, int bufsize)
+{
+       jas_stream_t *stream;
+       jas_stream_memobj_t *obj;
+
+       if (!(stream = jas_stream_create())) {
+               return 0;
+       }
+
+       /* A stream associated with a memory buffer is always opened
+       for both reading and writing in binary mode. */
+       stream->openmode_ = JAS_STREAM_READ | JAS_STREAM_WRITE | JAS_STREAM_BINARY;
+
+       /* Since the stream data is already resident in memory, buffering
+       is not necessary. */
+       /* But... It still may be faster to use buffering anyways. */
+       jas_stream_initbuf(stream, JAS_STREAM_FULLBUF, 0, 0);
+
+       /* Select the operations for a memory stream. */
+       stream->ops_ = &jas_stream_memops;
+
+       /* Allocate memory for the underlying memory stream object. */
+       if (!(obj = jas_malloc(sizeof(jas_stream_memobj_t)))) {
+               jas_stream_destroy(stream);
+               return 0;
+       }
+       stream->obj_ = (void *) obj;
+
+       /* Initialize a few important members of the memory stream object. */
+       obj->myalloc_ = 0;
+       obj->buf_ = 0;
+
+       /* If the buffer size specified is nonpositive, then the buffer
+       is allocated internally and automatically grown as needed. */
+       if (bufsize <= 0) {
+               obj->bufsize_ = 1024;
+               obj->growable_ = 1;
+       } else {
+               obj->bufsize_ = bufsize;
+               obj->growable_ = 0;
+       }
+       if (buf) {
+               obj->buf_ = (unsigned char *) buf;
+       } else {
+               obj->buf_ = jas_malloc(obj->bufsize_ * sizeof(char));
+               obj->myalloc_ = 1;
+       }
+       if (!obj->buf_) {
+               jas_stream_close(stream);
+               return 0;
+       }
+
+       if (bufsize > 0 && buf) {
+               /* If a buffer was supplied by the caller and its length is positive,
+                 make the associated buffer data appear in the stream initially. */
+               obj->len_ = bufsize;
+       } else {
+               /* The stream is initially empty. */
+               obj->len_ = 0;
+       }
+       obj->pos_ = 0;
+       
+       return stream;
+}
+
+jas_stream_t *jas_stream_fopen(const char *filename, const char *mode)
+{
+       jas_stream_t *stream;
+       jas_stream_fileobj_t *obj;
+       int openflags;
+
+       /* Allocate a stream object. */
+       if (!(stream = jas_stream_create())) {
+               return 0;
+       }
+
+       /* Parse the mode string. */
+       stream->openmode_ = jas_strtoopenmode(mode);
+
+       /* Determine the correct flags to use for opening the file. */
+       if ((stream->openmode_ & JAS_STREAM_READ) &&
+         (stream->openmode_ & JAS_STREAM_WRITE)) {
+               openflags = O_RDWR;
+       } else if (stream->openmode_ & JAS_STREAM_READ) {
+               openflags = O_RDONLY;
+       } else if (stream->openmode_ & JAS_STREAM_WRITE) {
+               openflags = O_WRONLY;
+       } else {
+               openflags = 0;
+       }
+       if (stream->openmode_ & JAS_STREAM_APPEND) {
+               openflags |= O_APPEND;
+       }
+       if (stream->openmode_ & JAS_STREAM_BINARY) {
+               openflags |= O_BINARY;
+       }
+       if (stream->openmode_ & JAS_STREAM_CREATE) {
+               openflags |= O_CREAT | O_TRUNC;
+       }
+
+       /* Allocate space for the underlying file stream object. */
+       if (!(obj = jas_malloc(sizeof(jas_stream_fileobj_t)))) {
+               jas_stream_destroy(stream);
+               return 0;
+       }
+       obj->fd = -1;
+       obj->flags = 0;
+       obj->pathname[0] = '\0';
+       stream->obj_ = (void *) obj;
+
+       /* Select the operations for a file stream object. */
+       stream->ops_ = &jas_stream_fileops;
+
+       /* Open the underlying file. */
+       if ((obj->fd = open(filename, openflags, JAS_STREAM_PERMS)) < 0) {
+               jas_stream_destroy(stream);
+               return 0;
+       }
+
+       /* By default, use full buffering for this type of stream. */
+       jas_stream_initbuf(stream, JAS_STREAM_FULLBUF, 0, 0);
+
+       return stream;
+}
+
+jas_stream_t *jas_stream_freopen(const char *path, const char *mode, FILE *fp)
+{
+       jas_stream_t *stream;
+       int openflags;
+
+       /* Eliminate compiler warning about unused variable. */
+       path = 0;
+
+       /* Allocate a stream object. */
+       if (!(stream = jas_stream_create())) {
+               return 0;
+       }
+
+       /* Parse the mode string. */
+       stream->openmode_ = jas_strtoopenmode(mode);
+
+       /* Determine the correct flags to use for opening the file. */
+       if ((stream->openmode_ & JAS_STREAM_READ) &&
+         (stream->openmode_ & JAS_STREAM_WRITE)) {
+               openflags = O_RDWR;
+       } else if (stream->openmode_ & JAS_STREAM_READ) {
+               openflags = O_RDONLY;
+       } else if (stream->openmode_ & JAS_STREAM_WRITE) {
+               openflags = O_WRONLY;
+       } else {
+               openflags = 0;
+       }
+       if (stream->openmode_ & JAS_STREAM_APPEND) {
+               openflags |= O_APPEND;
+       }
+       if (stream->openmode_ & JAS_STREAM_BINARY) {
+               openflags |= O_BINARY;
+       }
+       if (stream->openmode_ & JAS_STREAM_CREATE) {
+               openflags |= O_CREAT | O_TRUNC;
+       }
+
+       stream->obj_ = JAS_CAST(void *, fp);
+
+       /* Select the operations for a file stream object. */
+       stream->ops_ = &jas_stream_sfileops;
+
+       /* By default, use full buffering for this type of stream. */
+       jas_stream_initbuf(stream, JAS_STREAM_FULLBUF, 0, 0);
+
+       return stream;
+}
+
+jas_stream_t *jas_stream_tmpfile()
+{
+       jas_stream_t *stream;
+       jas_stream_fileobj_t *obj;
+
+       if (!(stream = jas_stream_create())) {
+               return 0;
+       }
+
+       /* A temporary file stream is always opened for both reading and
+       writing in binary mode. */
+       stream->openmode_ = JAS_STREAM_READ | JAS_STREAM_WRITE | JAS_STREAM_BINARY;
+
+       /* Allocate memory for the underlying temporary file object. */
+       if (!(obj = jas_malloc(sizeof(jas_stream_fileobj_t)))) {
+               jas_stream_destroy(stream);
+               return 0;
+       }
+       obj->fd = -1;
+       obj->flags = 0;
+       obj->pathname[0] = '\0';
+       stream->obj_ = obj;
+
+       /* Choose a file name. */
+       tmpnam(obj->pathname);
+
+       /* Open the underlying file. */
+       if ((obj->fd = open(obj->pathname, O_CREAT | O_EXCL | O_RDWR | O_TRUNC | O_BINARY,
+         JAS_STREAM_PERMS)) < 0) {
+               jas_stream_destroy(stream);
+               return 0;
+       }
+
+       /* Unlink the file so that it will disappear if the program
+       terminates abnormally. */
+       /* Under UNIX, one can unlink an open file and continue to do I/O
+       on it.  Not all operating systems support this functionality, however.
+       For example, under Microsoft Windows the unlink operation will fail,
+       since the file is open. */
+       if (unlink(obj->pathname)) {
+               /* We will try unlinking the file again after it is closed. */
+               obj->flags |= JAS_STREAM_FILEOBJ_DELONCLOSE;
+       }
+
+       /* Use full buffering. */
+       jas_stream_initbuf(stream, JAS_STREAM_FULLBUF, 0, 0);
+
+       stream->ops_ = &jas_stream_fileops;
+
+       return stream;
+}
+
+jas_stream_t *jas_stream_fdopen(int fd, const char *mode)
+{
+       jas_stream_t *stream;
+       jas_stream_fileobj_t *obj;
+
+       /* Allocate a stream object. */
+       if (!(stream = jas_stream_create())) {
+               return 0;
+       }
+
+       /* Parse the mode string. */
+       stream->openmode_ = jas_strtoopenmode(mode);
+
+#if defined(WIN32)
+       /* Argh!!!  Someone ought to banish text mode (i.e., O_TEXT) to the
+         greatest depths of purgatory! */
+       /* Ensure that the file descriptor is in binary mode, if the caller
+         has specified the binary mode flag.  Arguably, the caller ought to
+         take care of this, but text mode is a ugly wart anyways, so we save
+         the caller some grief by handling this within the stream library. */
+       /* This ugliness is mainly for the benefit of those who run the
+         JasPer software under Windows from shells that insist on opening
+         files in text mode.  For example, in the Cygwin environment,
+         shells often open files in text mode when I/O redirection is
+         used.  Grr... */
+       if (stream->openmode_ & JAS_STREAM_BINARY) {
+               setmode(fd, O_BINARY);
+       }
+#endif
+
+       /* Allocate space for the underlying file stream object. */
+       if (!(obj = jas_malloc(sizeof(jas_stream_fileobj_t)))) {
+               jas_stream_destroy(stream);
+               return 0;
+       }
+       obj->fd = fd;
+       obj->flags = 0;
+       obj->pathname[0] = '\0';
+       stream->obj_ = (void *) obj;
+
+       /* Do not close the underlying file descriptor when the stream is
+       closed. */
+       obj->flags |= JAS_STREAM_FILEOBJ_NOCLOSE;
+
+       /* By default, use full buffering for this type of stream. */
+       jas_stream_initbuf(stream, JAS_STREAM_FULLBUF, 0, 0);
+
+       /* Select the operations for a file stream object. */
+       stream->ops_ = &jas_stream_fileops;
+
+       return stream;
+}
+
+static void jas_stream_destroy(jas_stream_t *stream)
+{
+       /* If the memory for the buffer was allocated with malloc, free
+       this memory. */
+       if ((stream->bufmode_ & JAS_STREAM_FREEBUF) && stream->bufbase_) {
+               jas_free(stream->bufbase_);
+               stream->bufbase_ = 0;
+       }
+       jas_free(stream);
+}
+
+int jas_stream_close(jas_stream_t *stream)
+{
+       /* Flush buffer if necessary. */
+       jas_stream_flush(stream);
+
+       /* Close the underlying stream object. */
+       (*stream->ops_->close_)(stream->obj_);
+
+       jas_stream_destroy(stream);
+
+       return 0;
+}
+
+/******************************************************************************\
+* Code for reading and writing streams.
+\******************************************************************************/
+
+int jas_stream_getc_func(jas_stream_t *stream)
+{
+       assert(stream->ptr_ - stream->bufbase_ <= stream->bufsize_ +
+         JAS_STREAM_MAXPUTBACK);
+       return jas_stream_getc_macro(stream);
+}
+
+int jas_stream_putc_func(jas_stream_t *stream, int c)
+{
+       assert(stream->ptr_ - stream->bufstart_ <= stream->bufsize_);
+       return jas_stream_putc_macro(stream, c);
+}
+
+int jas_stream_ungetc(jas_stream_t *stream, int c)
+{
+       if (!stream->ptr_ || stream->ptr_ == stream->bufbase_) {
+               return -1;
+       }
+
+       /* Reset the EOF indicator (since we now have at least one character
+         to read). */
+       stream->flags_ &= ~JAS_STREAM_EOF;
+
+       --stream->rwcnt_;
+       --stream->ptr_;
+       ++stream->cnt_;
+       *stream->ptr_ = c;
+       return 0;
+}
+
+int jas_stream_read(jas_stream_t *stream, void *buf, int cnt)
+{
+       int n;
+       int c;
+       char *bufptr;
+
+       bufptr = buf;
+
+       n = 0;
+       while (n < cnt) {
+               if ((c = jas_stream_getc(stream)) == EOF) {
+                       return n;
+               }
+               *bufptr++ = c;
+               ++n;
+       }
+
+       return n;
+}
+
+int jas_stream_write(jas_stream_t *stream, const void *buf, int cnt)
+{
+       int n;
+       const char *bufptr;
+
+       bufptr = buf;
+
+       n = 0;
+       while (n < cnt) {
+               if (jas_stream_putc(stream, *bufptr) == EOF) {
+                       return n;
+               }
+               ++bufptr;
+               ++n;
+       }
+
+       return n;
+}
+
+/* Note: This function uses a fixed size buffer.  Therefore, it cannot
+  handle invocations that will produce more output than can be held
+  by the buffer. */
+int jas_stream_printf(jas_stream_t *stream, const char *fmt, ...)
+{
+       va_list ap;
+       char buf[4096];
+       int ret;
+
+       va_start(ap, fmt);
+       ret = vsprintf(buf, fmt, ap);
+       jas_stream_puts(stream, buf);
+       va_end(ap);
+       return ret;
+}
+
+int jas_stream_puts(jas_stream_t *stream, const char *s)
+{
+       while (*s != '\0') {
+               if (jas_stream_putc_macro(stream, *s) == EOF) {
+                       return -1;
+               }
+               ++s;
+       }
+       return 0;
+}
+
+char *jas_stream_gets(jas_stream_t *stream, char *buf, int bufsize)
+{
+       int c;
+       char *bufptr;
+       assert(bufsize > 0);
+
+       bufptr = buf;
+       while (bufsize > 1) {
+               if ((c = jas_stream_getc(stream)) == EOF) {
+                       break;
+               }
+               *bufptr++ = c;
+               --bufsize;
+               if (c == '\n') {
+                       break;
+               }
+       }
+       *bufptr = '\0';
+       return buf;
+}
+
+int jas_stream_gobble(jas_stream_t *stream, int n)
+{
+       int m;
+       m = n;
+       for (m = n; m > 0; --m) {
+               if (jas_stream_getc(stream) == EOF) {
+                       return n - m;
+               }
+       }
+       return n;
+}
+
+int jas_stream_pad(jas_stream_t *stream, int n, int c)
+{
+       int m;
+       m = n;
+       for (m = n; m > 0; --m) {
+               if (jas_stream_putc(stream, c) == EOF)
+                       return n - m;
+       }
+       return n;
+}
+
+/******************************************************************************\
+* Code for getting and setting the stream position.
+\******************************************************************************/
+
+int jas_stream_isseekable(jas_stream_t *stream)
+{
+       if (stream->ops_ == &jas_stream_memops) {
+               return 1;
+       } else if (stream->ops_ == &jas_stream_fileops) {
+               if ((*stream->ops_->seek_)(stream->obj_, 0, SEEK_CUR) < 0) {
+                       return 0;
+               }
+               return 1;
+       } else {
+               return 0;
+       }
+}
+
+int jas_stream_rewind(jas_stream_t *stream)
+{
+       return jas_stream_seek(stream, 0, SEEK_SET);
+}
+
+long jas_stream_seek(jas_stream_t *stream, long offset, int origin)
+{
+       long newpos;
+
+       /* The buffer cannot be in use for both reading and writing. */
+       assert(!((stream->bufmode_ & JAS_STREAM_RDBUF) && (stream->bufmode_ &
+         JAS_STREAM_WRBUF)));
+
+       /* Reset the EOF indicator (since we may not be at the EOF anymore). */
+       stream->flags_ &= ~JAS_STREAM_EOF;
+
+       if (stream->bufmode_ & JAS_STREAM_RDBUF) {
+               if (origin == SEEK_CUR) {
+                       offset -= stream->cnt_;
+               }
+       } else if (stream->bufmode_ & JAS_STREAM_WRBUF) {
+               if (jas_stream_flush(stream)) {
+                       return -1;
+               }
+       }
+       stream->cnt_ = 0;
+       stream->ptr_ = stream->bufstart_;
+       stream->bufmode_ &= ~(JAS_STREAM_RDBUF | JAS_STREAM_WRBUF);
+
+       if ((newpos = (*stream->ops_->seek_)(stream->obj_, offset, origin))
+         < 0) {
+               return -1;
+       }
+
+       return newpos;
+}
+
+long jas_stream_tell(jas_stream_t *stream)
+{
+       int adjust;
+       int offset;
+
+       if (stream->bufmode_ & JAS_STREAM_RDBUF) {
+               adjust = -stream->cnt_;
+       } else if (stream->bufmode_ & JAS_STREAM_WRBUF) {
+               adjust = stream->ptr_ - stream->bufstart_;
+       } else {
+               adjust = 0;
+       }
+
+       if ((offset = (*stream->ops_->seek_)(stream->obj_, 0, SEEK_CUR)) < 0) {
+               return -1;
+       }
+
+       return offset + adjust;
+}
+
+/******************************************************************************\
+* Buffer initialization code.
+\******************************************************************************/
+
+static void jas_stream_initbuf(jas_stream_t *stream, int bufmode, char *buf,
+  int bufsize)
+{
+       /* If this function is being called, the buffer should not have been
+         initialized yet. */
+       assert(!stream->bufbase_);
+
+       if (bufmode != JAS_STREAM_UNBUF) {
+               /* The full- or line-buffered mode is being employed. */
+               if (!buf) {
+                       /* The caller has not specified a buffer to employ, so allocate
+                         one. */
+                       if ((stream->bufbase_ = jas_malloc(JAS_STREAM_BUFSIZE +
+                         JAS_STREAM_MAXPUTBACK))) {
+                               stream->bufmode_ |= JAS_STREAM_FREEBUF;
+                               stream->bufsize_ = JAS_STREAM_BUFSIZE;
+                       } else {
+                               /* The buffer allocation has failed.  Resort to unbuffered
+                                 operation. */
+                               stream->bufbase_ = stream->tinybuf_;
+                               stream->bufsize_ = 1;
+                       }
+               } else {
+                       /* The caller has specified a buffer to employ. */
+                       /* The buffer must be large enough to accommodate maximum
+                         putback. */
+                       assert(bufsize > JAS_STREAM_MAXPUTBACK);
+                       stream->bufbase_ = JAS_CAST(uchar *, buf);
+                       stream->bufsize_ = bufsize - JAS_STREAM_MAXPUTBACK;
+               }
+       } else {
+               /* The unbuffered mode is being employed. */
+               /* A buffer should not have been supplied by the caller. */
+               assert(!buf);
+               /* Use a trivial one-character buffer. */
+               stream->bufbase_ = stream->tinybuf_;
+               stream->bufsize_ = 1;
+       }
+       stream->bufstart_ = &stream->bufbase_[JAS_STREAM_MAXPUTBACK];
+       stream->ptr_ = stream->bufstart_;
+       stream->cnt_ = 0;
+       stream->bufmode_ |= bufmode & JAS_STREAM_BUFMODEMASK;
+}
+
+/******************************************************************************\
+* Buffer filling and flushing code.
+\******************************************************************************/
+
+int jas_stream_flush(jas_stream_t *stream)
+{
+       if (stream->bufmode_ & JAS_STREAM_RDBUF) {
+               return 0;
+       }
+       return jas_stream_flushbuf(stream, EOF);
+}
+
+int jas_stream_fillbuf(jas_stream_t *stream, int getflag)
+{
+       int c;
+
+       /* The stream must not be in an error or EOF state. */
+       if ((stream->flags_ & (JAS_STREAM_ERRMASK)) != 0) {
+               return EOF;
+       }
+
+       /* The stream must be open for reading. */
+       if ((stream->openmode_ & JAS_STREAM_READ) == 0) {
+               return EOF;
+       }
+
+       /* Make a half-hearted attempt to confirm that the buffer is not
+       currently being used for writing.  This check is not intended
+       to be foolproof! */
+       assert((stream->bufmode_ & JAS_STREAM_WRBUF) == 0);
+
+       assert(stream->ptr_ - stream->bufstart_ <= stream->bufsize_);
+
+       /* Mark the buffer as being used for reading. */
+       stream->bufmode_ |= JAS_STREAM_RDBUF;
+
+       /* Read new data into the buffer. */
+       stream->ptr_ = stream->bufstart_;
+       if ((stream->cnt_ = (*stream->ops_->read_)(stream->obj_,
+         (char *) stream->bufstart_, stream->bufsize_)) <= 0) {
+               if (stream->cnt_ < 0) {
+                       stream->flags_ |= JAS_STREAM_ERR;
+               } else {
+                       stream->flags_ |= JAS_STREAM_EOF;
+               }
+               stream->cnt_ = 0;
+               return EOF;
+       }
+
+       assert(stream->cnt_ > 0);
+       /* Get or peek at the first character in the buffer. */
+       c = (getflag) ? jas_stream_getc2(stream) : (*stream->ptr_);
+
+       return c;
+}
+
+int jas_stream_flushbuf(jas_stream_t *stream, int c)
+{
+       int len;
+       int n;
+
+       /* The stream should not be in an error or EOF state. */
+       if ((stream->flags_ & (JAS_STREAM_ERRMASK)) != 0) {
+               return EOF;
+       }
+
+       /* The stream must be open for writing. */
+       if ((stream->openmode_ & (JAS_STREAM_WRITE | JAS_STREAM_APPEND)) == 0) {
+               return EOF;
+       }
+
+       /* The buffer should not currently be in use for reading. */
+       assert(!(stream->bufmode_ & JAS_STREAM_RDBUF));
+
+       /* Note: Do not use the quantity stream->cnt to determine the number
+       of characters in the buffer!  Depending on how this function was
+       called, the stream->cnt value may be "off-by-one". */
+       len = stream->ptr_ - stream->bufstart_;
+       if (len > 0) {
+               n = (*stream->ops_->write_)(stream->obj_, (char *)
+                 stream->bufstart_, len);
+               if (n != len) {
+                       stream->flags_ |= JAS_STREAM_ERR;
+                       return EOF;
+               }
+       }
+       stream->cnt_ = stream->bufsize_;
+       stream->ptr_ = stream->bufstart_;
+
+       stream->bufmode_ |= JAS_STREAM_WRBUF;
+
+       if (c != EOF) {
+               assert(stream->cnt_ > 0);
+               return jas_stream_putc2(stream, c);
+       }
+
+       return 0;
+}
+
+/******************************************************************************\
+* Miscellaneous code.
+\******************************************************************************/
+
+static int jas_strtoopenmode(const char *s)
+{
+       int openmode = 0;
+       while (*s != '\0') {
+               switch (*s) {
+               case 'r':
+                       openmode |= JAS_STREAM_READ;
+                       break;
+               case 'w':
+                       openmode |= JAS_STREAM_WRITE | JAS_STREAM_CREATE;
+                       break;
+               case 'b':
+                       openmode |= JAS_STREAM_BINARY;
+                       break;
+               case 'a':
+                       openmode |= JAS_STREAM_APPEND;
+                       break;
+               case '+':
+                       openmode |= JAS_STREAM_READ | JAS_STREAM_WRITE;
+                       break;
+               default:
+                       break;
+               }
+               ++s;
+       }
+       return openmode;
+}
+
+int jas_stream_copy(jas_stream_t *out, jas_stream_t *in, int n)
+{
+       int all;
+       int c;
+       int m;
+
+       all = (n < 0) ? 1 : 0;
+
+       m = n;
+       while (all || m > 0) {
+               if ((c = jas_stream_getc_macro(in)) == EOF) {
+                       /* The next character of input could not be read. */
+                       /* Return with an error if an I/O error occured
+                         (not including EOF) or if an explicit copy count
+                         was specified. */
+                       return (!all || jas_stream_error(in)) ? (-1) : 0;
+               }
+               if (jas_stream_putc_macro(out, c) == EOF) {
+                       return -1;
+               }
+               --m;
+       }
+       return 0;
+}
+
+long jas_stream_setrwcount(jas_stream_t *stream, long rwcnt)
+{
+       int old;
+
+       old = stream->rwcnt_;
+       stream->rwcnt_ = rwcnt;
+       return old;
+}
+
+int jas_stream_display(jas_stream_t *stream, FILE *fp, int n)
+{
+       unsigned char buf[16];
+       int i;
+       int j;
+       int m;
+       int c;
+       int display;
+       int cnt;
+
+       cnt = n - (n % 16);
+       display = 1;
+
+       for (i = 0; i < n; i += 16) {
+               if (n > 16 && i > 0) {
+                       display = (i >= cnt) ? 1 : 0;
+               }
+               if (display) {
+                       fprintf(fp, "%08x:", i);
+               }
+               m = JAS_MIN(n - i, 16);
+               for (j = 0; j < m; ++j) {
+                       if ((c = jas_stream_getc(stream)) == EOF) {
+                               abort();
+                               return -1;
+                       }
+                       buf[j] = c;
+               }
+               if (display) {
+                       for (j = 0; j < m; ++j) {
+                               fprintf(fp, " %02x", buf[j]);
+                       }
+                       fputc(' ', fp);
+                       for (; j < 16; ++j) {
+                               fprintf(fp, "   ");
+                       }
+                       for (j = 0; j < m; ++j) {
+                               if (isprint(buf[j])) {
+                                       fputc(buf[j], fp);
+                               } else {
+                                       fputc(' ', fp);
+                               }
+                       }
+                       fprintf(fp, "\n");
+               }
+
+
+       }
+       return 0;
+}
+
+long jas_stream_length(jas_stream_t *stream)
+{
+       long oldpos;
+       long pos;
+       if ((oldpos = jas_stream_tell(stream)) < 0) {
+               return -1;
+       }
+       if (jas_stream_seek(stream, 0, SEEK_END) < 0) {
+               return -1;
+       }
+       if ((pos = jas_stream_tell(stream)) < 0) {
+               return -1;
+       }
+       if (jas_stream_seek(stream, oldpos, SEEK_SET) < 0) {
+               return -1;
+       }
+       return pos;
+}
+
+/******************************************************************************\
+* Memory stream object.
+\******************************************************************************/
+
+static int mem_read(jas_stream_obj_t *obj, char *buf, int cnt)
+{
+       int n;
+       jas_stream_memobj_t *m = (jas_stream_memobj_t *)obj;
+       n = m->len_ - m->pos_;
+       cnt = JAS_MIN(n, cnt);
+       memcpy(buf, &m->buf_[m->pos_], cnt);
+       m->pos_ += cnt;
+       return cnt;
+}
+
+static int mem_resize(jas_stream_memobj_t *m, int bufsize)
+{
+       unsigned char *buf;
+
+       assert(m->buf_);
+       if (!(buf = jas_realloc(m->buf_, bufsize * sizeof(unsigned char)))) {
+               return -1;
+       }
+       m->buf_ = buf;
+       m->bufsize_ = bufsize;
+       return 0;
+}
+
+static int mem_write(jas_stream_obj_t *obj, char *buf, int cnt)
+{
+       int n;
+       int ret;
+       jas_stream_memobj_t *m = (jas_stream_memobj_t *)obj;
+       long newbufsize;
+       long newpos;
+
+       newpos = m->pos_ + cnt;
+       if (newpos > m->bufsize_ && m->growable_) {
+               newbufsize = m->bufsize_;
+               while (newbufsize < newpos) {
+                       newbufsize <<= 1;
+                       assert(newbufsize >= 0);
+               }
+               if (mem_resize(m, newbufsize)) {
+                       return -1;
+               }
+       }
+       if (m->pos_ > m->len_) {
+               /* The current position is beyond the end of the file, so
+                 pad the file to the current position with zeros. */
+               n = JAS_MIN(m->pos_, m->bufsize_) - m->len_;
+               if (n > 0) {
+                       memset(&m->buf_[m->len_], 0, n);
+                       m->len_ += n;
+               }
+               if (m->pos_ != m->len_) {
+                       /* The buffer is not big enough. */
+                       return 0;
+               }
+       }
+       n = m->bufsize_ - m->pos_;
+       ret = JAS_MIN(n, cnt);
+       if (ret > 0) {
+               memcpy(&m->buf_[m->pos_], buf, ret);
+               m->pos_ += ret;
+       }
+       if (m->pos_ > m->len_) {
+               m->len_ = m->pos_;
+       }
+assert(ret == cnt);
+       return ret;
+}
+
+static long mem_seek(jas_stream_obj_t *obj, long offset, int origin)
+{
+       jas_stream_memobj_t *m = (jas_stream_memobj_t *)obj;
+       long newpos;
+
+       switch (origin) {
+       case SEEK_SET:
+               newpos = offset;
+               break;
+       case SEEK_END:
+               newpos = m->len_ - offset;
+               break;
+       case SEEK_CUR:
+               newpos = m->pos_ + offset;
+               break;
+       default:
+               abort();
+               break;
+       }
+       if (newpos < 0) {
+               return -1;
+       }
+       m->pos_ = newpos;
+
+       return m->pos_;
+}
+
+static int mem_close(jas_stream_obj_t *obj)
+{
+       jas_stream_memobj_t *m = (jas_stream_memobj_t *)obj;
+       if (m->myalloc_ && m->buf_) {
+               jas_free(m->buf_);
+               m->buf_ = 0;
+       }
+       jas_free(obj);
+       return 0;
+}
+
+/******************************************************************************\
+* File stream object.
+\******************************************************************************/
+
+static int file_read(jas_stream_obj_t *obj, char *buf, int cnt)
+{
+       jas_stream_fileobj_t *fileobj = JAS_CAST(jas_stream_fileobj_t *, obj);
+       return read(fileobj->fd, buf, cnt);
+}
+
+static int file_write(jas_stream_obj_t *obj, char *buf, int cnt)
+{
+       jas_stream_fileobj_t *fileobj = JAS_CAST(jas_stream_fileobj_t *, obj);
+       return write(fileobj->fd, buf, cnt);
+}
+
+static long file_seek(jas_stream_obj_t *obj, long offset, int origin)
+{
+       jas_stream_fileobj_t *fileobj = JAS_CAST(jas_stream_fileobj_t *, obj);
+       return lseek(fileobj->fd, offset, origin);
+}
+
+static int file_close(jas_stream_obj_t *obj)
+{
+       jas_stream_fileobj_t *fileobj = JAS_CAST(jas_stream_fileobj_t *, obj);
+       int ret;
+       ret = close(fileobj->fd);
+       if (fileobj->flags & JAS_STREAM_FILEOBJ_DELONCLOSE) {
+               unlink(fileobj->pathname);
+       }
+       jas_free(fileobj);
+       return ret;
+}
+
+/******************************************************************************\
+* Stdio file stream object.
+\******************************************************************************/
+
+static int sfile_read(jas_stream_obj_t *obj, char *buf, int cnt)
+{
+       FILE *fp;
+       fp = JAS_CAST(FILE *, obj);
+       return fread(buf, 1, cnt, fp);
+}
+
+static int sfile_write(jas_stream_obj_t *obj, char *buf, int cnt)
+{
+       FILE *fp;
+       fp = JAS_CAST(FILE *, obj);
+       return fwrite(buf, 1, cnt, fp);
+}
+
+static long sfile_seek(jas_stream_obj_t *obj, long offset, int origin)
+{
+       FILE *fp;
+       fp = JAS_CAST(FILE *, obj);
+       return fseek(fp, offset, origin);
+}
+
+static int sfile_close(jas_stream_obj_t *obj)
+{
+       FILE *fp;
+       fp = JAS_CAST(FILE *, obj);
+       return fclose(fp);
+}
diff --git a/src/libjasper/base/jas_string.c b/src/libjasper/base/jas_string.c
new file mode 100644 (file)
index 0000000..f3306b9
--- /dev/null
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * String Library
+ *
+ * $Id$
+ */
+
+/******************************************************************************\
+* Includes
+\******************************************************************************/
+
+#include <string.h>
+
+#include "jasper/jas_malloc.h"
+#include "jasper/jas_string.h"
+
+/******************************************************************************\
+* Miscellaneous Functions
+\******************************************************************************/
+
+/* This function is equivalent to the popular but non-standard (and
+  not-always-available) strdup function. */
+
+char *jas_strdup(const char *s)
+{
+       int n;
+       char *p;
+       n = strlen(s) + 1;
+       if (!(p = jas_malloc(n * sizeof(char)))) {
+               return 0;
+       }
+       strcpy(p, s);
+       return p;
+}
diff --git a/src/libjasper/base/jas_tmr.c b/src/libjasper/base/jas_tmr.c
new file mode 100644 (file)
index 0000000..babb9fd
--- /dev/null
@@ -0,0 +1,149 @@
+/*
+ * Copyright (c) 2004 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Timing Routines
+ *
+ * $Id$
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+
+#include "jasper/jas_tmr.h"
+
+/******************************************************************************\
+* Code.
+\******************************************************************************/
+
+#if defined(HAVE_GETTIMEOFDAY)
+
+void jas_tmr_start(jas_tmr_t *tmr)
+{
+       if (gettimeofday(&tmr->start, 0)) {
+               abort();
+       }
+}
+
+void jas_tmr_stop(jas_tmr_t *tmr)
+{
+       if (gettimeofday(&tmr->stop, 0)) {
+               abort();
+       }
+}
+
+double jas_tmr_get(jas_tmr_t *tmr)
+{
+       double t0;
+       double t1;
+       t0 = ((double) tmr->start.tv_sec) + ((double) tmr->start.tv_usec) / 1e6;
+       t1 = ((double) tmr->stop.tv_sec) + ((double) tmr->stop.tv_usec) / 1e6;
+       return t1 - t0;
+}
+
+#elif defined(HAVE_GETRUSAGE)
+
+void jas_tmr_start(jas_tmr_t *tmr)
+{
+       if (getrusage(RUSAGE_SELF, &tmr->start) < 0) {
+               abort();
+       }
+}
+
+void jas_tmr_stop(jas_tmr_t *tmr)
+{
+       if (getrusage(RUSAGE_SELF, &tmr->stop) < 0) {
+               abort();
+       }
+}
+
+double jas_tmr_get(jas_tmr_t *tmr)
+{
+       double t;
+       t = ((tmr->stop.ru_utime.tv_sec * 1e6 + tmr->stop.ru_utime.tv_usec) -
+         (tmr->start.ru_utime.tv_sec * 1e6 + tmr->start.ru_utime.tv_usec)) / 1e6;
+       t += ((tmr->stop.ru_stime.tv_sec * 1e6 + tmr->stop.ru_stime.tv_usec) -
+         (tmr->start.ru_stime.tv_sec * 1e6 + tmr->start.ru_stime.tv_usec)) / 1e6;
+       return t;
+}
+
+#else
+
+void jas_tmr_start(jas_tmr_t *tmr)
+{
+}
+
+void jas_tmr_stop(jas_tmr_t *tmr)
+{
+}
+
+double jas_tmr_get(jas_tmr_t *tmr)
+{
+       return 0.0;
+}
+
+#endif
+
diff --git a/src/libjasper/base/jas_tvp.c b/src/libjasper/base/jas_tvp.c
new file mode 100644 (file)
index 0000000..c005acf
--- /dev/null
@@ -0,0 +1,237 @@
+/*
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Tag-Value Parser Library
+ *
+ * $Id$
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <assert.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <stdlib.h>
+
+#include "jasper/jas_malloc.h"
+#include "jasper/jas_string.h"
+#include "jasper/jas_tvp.h"
+
+/******************************************************************************\
+* Macros.
+\******************************************************************************/
+
+/* Is the specified character valid for a tag name? */
+#define        JAS_TVP_ISTAG(x) \
+       (isalpha(x) || (x) == '_' || isdigit(x))
+
+/******************************************************************************\
+* Code for creating and destroying a tag-value parser.
+\******************************************************************************/
+
+jas_tvparser_t *jas_tvparser_create(const char *s)
+{
+       jas_tvparser_t *tvp;
+       if (!(tvp = jas_malloc(sizeof(jas_tvparser_t)))) {
+               return 0;
+       }
+       if (!(tvp->buf = jas_strdup(s))) {
+               jas_tvparser_destroy(tvp);
+               return 0;
+       }
+       tvp->pos = tvp->buf;
+       tvp->tag = 0;
+       tvp->val = 0;
+       return tvp;
+}
+
+void jas_tvparser_destroy(jas_tvparser_t *tvp)
+{
+       if (tvp->buf) {
+               jas_free(tvp->buf);
+       }
+       jas_free(tvp);
+}
+
+/******************************************************************************\
+* Main parsing code.
+\******************************************************************************/
+
+/* Get the next tag-value pair. */
+int jas_tvparser_next(jas_tvparser_t *tvp)
+{
+       char *p;
+       char *tag;
+       char *val;
+
+       /* Skip any leading whitespace. */
+       p = tvp->pos;
+       while (*p != '\0' && isspace(*p)) {
+               ++p;
+       }
+
+       /* Has the end of the input data been reached? */
+       if (*p == '\0') {
+               /* No more tags are present. */
+               tvp->pos = p;
+               return 1;
+       }
+
+       /* Does the tag name begin with a valid character? */
+       if (!JAS_TVP_ISTAG(*p)) {
+               return -1;
+       }
+
+       /* Remember where the tag name begins. */
+       tag = p;
+
+       /* Find the end of the tag name. */
+       while (*p != '\0' && JAS_TVP_ISTAG(*p)) {
+               ++p;
+       }
+
+       /* Has the end of the input data been reached? */
+       if (*p == '\0') {
+               /* The value field is empty. */
+               tvp->tag = tag;
+               tvp->val = "";
+               tvp->pos = p;
+               return 0;
+       }
+
+       /* Is a value field not present? */
+       if (*p != '=') {
+               if (*p != '\0' && !isspace(*p)) {
+                       return -1;
+               }
+               *p++ = '\0';
+               tvp->tag = tag;
+               tvp->val = "";
+               tvp->pos = p;
+               return 0;
+       }
+
+       *p++ = '\0';
+
+       val = p;
+       while (*p != '\0' && !isspace(*p)) {
+               ++p;
+       }
+
+       if (*p != '\0') {
+               *p++ = '\0';
+       }
+
+       tvp->pos = p;
+       tvp->tag = tag;
+       tvp->val = val;
+
+       return 0;
+}
+
+/******************************************************************************\
+* Code for querying the current tag/value.
+\******************************************************************************/
+
+/* Get the current tag. */
+char *jas_tvparser_gettag(jas_tvparser_t *tvp)
+{
+       return tvp->tag;
+}
+
+/* Get the current value. */
+char *jas_tvparser_getval(jas_tvparser_t *tvp)
+{
+       return tvp->val;
+}
+
+/******************************************************************************\
+* Miscellaneous code.
+\******************************************************************************/
+
+/* Lookup a tag by name. */
+jas_taginfo_t *jas_taginfos_lookup(jas_taginfo_t *taginfos, const char *name)
+{
+       jas_taginfo_t *taginfo;
+       taginfo = taginfos;
+       while (taginfo->id >= 0) {
+               if (!strcmp(taginfo->name, name)) {
+                       return taginfo;
+               }
+               ++taginfo;
+       }
+       return 0;
+}
+
+/* This function is simply for convenience. */
+/* One can avoid testing for the special case of a null pointer, by
+  using this function.   This function never returns a null pointer.  */
+jas_taginfo_t *jas_taginfo_nonull(jas_taginfo_t *taginfo)
+{
+       static jas_taginfo_t invalidtaginfo = {
+               -1, 0
+       };
+       
+       return taginfo ? taginfo : &invalidtaginfo;
+}
diff --git a/src/libjasper/base/jas_version.c b/src/libjasper/base/jas_version.c
new file mode 100644 (file)
index 0000000..f56f253
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+#include "jasper/jas_version.h"
+
+const char *jas_getversion()
+{
+       return JAS_VERSION;
+}
diff --git a/src/libjasper/bmp/Makefile.am b/src/libjasper/bmp/Makefile.am
new file mode 100644 (file)
index 0000000..d70855a
--- /dev/null
@@ -0,0 +1,67 @@
+# Copyright (c) 2001-2002 Michael David Adams.
+# All rights reserved. 
+
+# __START_OF_JASPER_LICENSE__
+# 
+# JasPer License Version 2.0
+# 
+# Copyright (c) 2001-2006 Michael David Adams
+# Copyright (c) 1999-2000 Image Power, Inc.
+# Copyright (c) 1999-2000 The University of British Columbia
+# 
+# All rights reserved.
+# 
+# Permission is hereby granted, free of charge, to any person (the
+# "User") obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the
+# following conditions:
+# 
+# 1.  The above copyright notices and this permission notice (which
+# includes the disclaimer below) shall be included in all copies or
+# substantial portions of the Software.
+# 
+# 2.  The name of a copyright holder shall not be used to endorse or
+# promote products derived from the Software without specific prior
+# written permission.
+# 
+# THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+# LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+# THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+# "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+# PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+# EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+# PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+# THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+# EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+# BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+# PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+# GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+# ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+# IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+# SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+# AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+# SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+# THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+# PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+# RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+# EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+# 
+# __END_OF_JASPER_LICENSE__
+
+noinst_LTLIBRARIES = libbmp.la
+libbmp_la_SOURCES = \
+       bmp_cod.h \
+       bmp_enc.h \
+       bmp_cod.c \
+       bmp_dec.c \
+       bmp_enc.c
+
+INCLUDES = -I$(top_srcdir)/src/libjasper/include
diff --git a/src/libjasper/bmp/Makefile.in b/src/libjasper/bmp/Makefile.in
new file mode 100644 (file)
index 0000000..a8297a6
--- /dev/null
@@ -0,0 +1,510 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# Copyright (c) 2001-2002 Michael David Adams.
+# All rights reserved. 
+
+# __START_OF_JASPER_LICENSE__
+# 
+# JasPer License Version 2.0
+# 
+# Copyright (c) 2001-2006 Michael David Adams
+# Copyright (c) 1999-2000 Image Power, Inc.
+# Copyright (c) 1999-2000 The University of British Columbia
+# 
+# All rights reserved.
+# 
+# Permission is hereby granted, free of charge, to any person (the
+# "User") obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the
+# following conditions:
+# 
+# 1.  The above copyright notices and this permission notice (which
+# includes the disclaimer below) shall be included in all copies or
+# substantial portions of the Software.
+# 
+# 2.  The name of a copyright holder shall not be used to endorse or
+# promote products derived from the Software without specific prior
+# written permission.
+# 
+# THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+# LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+# THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+# "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+# PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+# EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+# PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+# THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+# EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+# BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+# PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+# GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+# ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+# IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+# SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+# AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+# SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+# THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+# PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+# RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+# EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+# 
+# __END_OF_JASPER_LICENSE__
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = src/libjasper/bmp
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/acaux/mkinstalldirs
+CONFIG_HEADER =  \
+       $(top_builddir)/src/libjasper/include/jasper/jas_config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libbmp_la_LIBADD =
+am_libbmp_la_OBJECTS = bmp_cod.lo bmp_dec.lo bmp_enc.lo
+libbmp_la_OBJECTS = $(am_libbmp_la_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/libjasper/include/jasper
+depcomp = $(SHELL) $(top_srcdir)/acaux/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+       $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libbmp_la_SOURCES)
+DIST_SOURCES = $(libbmp_la_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+HAVE_LIBJPEG_FALSE = @HAVE_LIBJPEG_FALSE@
+HAVE_LIBJPEG_TRUE = @HAVE_LIBJPEG_TRUE@
+HAVE_OPENGL_FALSE = @HAVE_OPENGL_FALSE@
+HAVE_OPENGL_TRUE = @HAVE_OPENGL_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAS_MAJOR_VERSION = @JAS_MAJOR_VERSION@
+JAS_MICRO_VERSION = @JAS_MICRO_VERSION@
+JAS_MINOR_VERSION = @JAS_MINOR_VERSION@
+JAS_RPM_RELEASE = @JAS_RPM_RELEASE@
+JAS_VERSION = @JAS_VERSION@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_AGE = @LT_AGE@
+LT_CURRENT = @LT_CURRENT@
+LT_RELEASE = @LT_RELEASE@
+LT_REVISION = @LT_REVISION@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OPENGL_LIBS = @OPENGL_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+noinst_LTLIBRARIES = libbmp.la
+libbmp_la_SOURCES = \
+       bmp_cod.h \
+       bmp_enc.h \
+       bmp_cod.c \
+       bmp_dec.c \
+       bmp_enc.c
+
+INCLUDES = -I$(top_srcdir)/src/libjasper/include
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/libjasper/bmp/Makefile'; \
+       cd $(top_srcdir) && \
+         $(AUTOMAKE) --foreign  src/libjasper/bmp/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+       -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+       @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+         test "$$dir" != "$$p" || dir=.; \
+         echo "rm -f \"$${dir}/so_locations\""; \
+         rm -f "$${dir}/so_locations"; \
+       done
+libbmp.la: $(libbmp_la_OBJECTS) $(libbmp_la_DEPENDENCIES) 
+       $(LINK)  $(libbmp_la_LDFLAGS) $(libbmp_la_OBJECTS) $(libbmp_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bmp_cod.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bmp_dec.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bmp_enc.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+
+distclean-libtool:
+       -rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+           $$tags $$unique; \
+       fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       test -z "$(CTAGS_ARGS)$$tags$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$tags $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && cd $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+       list='$(DISTFILES)'; for file in $$list; do \
+         case $$file in \
+           $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+           $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+         esac; \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+         if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+           dir="/$$dir"; \
+           $(mkdir_p) "$(distdir)$$dir"; \
+         else \
+           dir=''; \
+         fi; \
+         if test -d $$d/$$file; then \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+           fi; \
+           cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+         else \
+           test -f $(distdir)/$$file \
+           || cp -p $$d/$$file $(distdir)/$$file \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+         `test -z '$(STRIP)' || \
+           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+       mostlyclean-am
+
+distclean: distclean-am
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+       clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+       distclean-compile distclean-generic distclean-libtool \
+       distclean-tags distdir dvi dvi-am html html-am info info-am \
+       install install-am install-data install-data-am install-exec \
+       install-exec-am install-info install-info-am install-man \
+       install-strip installcheck installcheck-am installdirs \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+       pdf pdf-am ps ps-am tags uninstall uninstall-am \
+       uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/libjasper/bmp/bmp_cod.c b/src/libjasper/bmp/bmp_cod.c
new file mode 100644 (file)
index 0000000..4e84ecc
--- /dev/null
@@ -0,0 +1,135 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Windows Bitmap File Library
+ *
+ * $Id$
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <assert.h>
+
+#include "jasper/jas_types.h"
+#include "jasper/jas_image.h"
+#include "jasper/jas_malloc.h"
+
+#include "bmp_cod.h"
+
+/******************************************************************************\
+* Constructors and destructors.
+\******************************************************************************/
+
+bmp_info_t *bmp_info_create()
+{
+       bmp_info_t *info;
+       if (!(info = jas_malloc(sizeof(bmp_info_t)))) {
+               return 0;
+       }
+       info->palents = 0;
+       return info;
+}
+
+void bmp_info_destroy(bmp_info_t *info)
+{
+       if (info->palents) {
+               jas_free(info->palents);
+       }
+       jas_free(info);
+}
+
+/******************************************************************************\
+* Miscellaneous functions.
+\******************************************************************************/
+
+int bmp_isgrayscalepal(bmp_palent_t *palents, int numpalents)
+{
+       bmp_palent_t *palent;
+       int i;
+
+       for (i = numpalents, palent = palents; i > 0; --i, ++palent) {
+               if (palent->red != palent->grn || palent->red != palent->blu) {
+                       return 0;
+               }
+       }
+       return 1;
+}
+
+int bmp_numcmpts(bmp_info_t *info)
+{
+       int numcmpts;
+
+       if (info->depth == 24) {
+               numcmpts = 3;
+       } else if (info->depth == 8) {
+               numcmpts = bmp_isgrayscalepal(info->palents, info->numcolors) ?
+                 1 : 3;
+       } else {
+               numcmpts = 0;
+               abort();
+       }
+       return numcmpts;
+}
diff --git a/src/libjasper/bmp/bmp_cod.h b/src/libjasper/bmp/bmp_cod.h
new file mode 100644 (file)
index 0000000..beaaf30
--- /dev/null
@@ -0,0 +1,215 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Windows Bitmap File Library
+ *
+ * $Id$
+ */
+
+#ifndef BMP_COD_H
+#define BMP_COD_H
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include "jasper/jas_types.h"
+
+/******************************************************************************\
+* Constants and macros.
+\******************************************************************************/
+
+#define        BMP_MAGIC       0x4d42
+/* The signature for a BMP file. */
+
+#define        BMP_HDRLEN      14
+/* The nominal header length. */
+
+#define BMP_INFOLEN    40
+/* The nominal info length. */
+
+#define BMP_PALLEN(info)       ((info)->numcolors * 4)
+/* The length of the palette. */
+
+#define        BMP_HASPAL(info)        ((info)->numcolors > 0)
+/* Is this a palettized image? */
+
+/* Encoding types. */
+#define        BMP_ENC_RGB             0 /* No special encoding. */
+#define        BMP_ENC_RLE8    1 /* Run length encoding. */
+#define        BMP_ENC_RLE4    2 /* Run length encoding. */
+
+/******************************************************************************\
+* Types.
+\******************************************************************************/
+
+/* BMP header. */
+typedef struct {
+
+       int_fast16_t magic;
+       /* The signature (a.k.a. the magic number). */
+
+       int_fast32_t siz;
+       /* The size of the file in 32-bit words. */
+
+       int_fast16_t reserved1;
+       /* Ask Bill Gates what this is all about. */
+
+       int_fast16_t reserved2;
+       /* Ditto. */
+
+       int_fast32_t off;
+       /* The offset of the bitmap data from the bitmap file header in bytes. */
+
+} bmp_hdr_t;
+
+/* Palette entry. */
+typedef struct {
+
+       int_fast16_t red;
+       /* The red component. */
+
+       int_fast16_t grn;
+       /* The green component. */
+
+       int_fast16_t blu;
+       /* The blue component. */
+
+       int_fast16_t res;
+       /* Reserved. */
+
+} bmp_palent_t;
+
+/* BMP info. */
+typedef struct {
+
+       int_fast32_t len;
+       /* The length of the bitmap information header in bytes. */
+
+       int_fast32_t width;
+       /* The width of the bitmap in pixels. */
+
+       int_fast32_t height;
+       /* The height of the bitmap in pixels. */
+
+       int_fast8_t topdown;
+       /* The bitmap data is specified in top-down order. */
+
+       int_fast16_t numplanes;
+       /* The number of planes.  This must be set to a value of one. */
+
+       int_fast16_t depth;
+       /* The number of bits per pixel. */
+
+       int_fast32_t enctype;
+       /* The type of compression used. */
+
+       int_fast32_t siz;
+       /* The size of the image in bytes. */
+
+       int_fast32_t hres;
+       /* The horizontal resolution in pixels/metre. */
+
+       int_fast32_t vres;
+       /* The vertical resolution in pixels/metre. */
+
+       int_fast32_t numcolors;
+       /* The number of color indices used by the bitmap. */
+
+       int_fast32_t mincolors;
+       /* The number of color indices important for displaying the bitmap. */
+
+       bmp_palent_t *palents;
+       /* The colors should be listed in order of importance. */
+
+} bmp_info_t;
+
+/******************************************************************************\
+* Functions and macros.
+\******************************************************************************/
+
+#define        bmp_issupported(hdr, info) \
+       ((hdr)->magic == BMP_MAGIC && !(hdr)->reserved1 && \
+         !(hdr)->reserved2 && (info)->numplanes == 1 && \
+         ((info)->depth == 8 || (info)->depth == 24) && \
+         (info)->enctype == BMP_ENC_RGB)
+/* Is this type of BMP file supported? */
+
+#define        bmp_haspal(info) \
+       ((info)->depth == 8)
+/* Is there a palette? */
+
+int bmp_numcmpts(bmp_info_t *info);
+/* Get the number of components. */
+
+bmp_info_t *bmp_info_create(void);
+/* Create BMP information. */
+
+void bmp_info_destroy(bmp_info_t *info);
+/* Destroy BMP information. */
+
+int bmp_isgrayscalepal(bmp_palent_t *palents, int numpalents);
+/* Does the specified palette correspond to a grayscale image? */
+
+#endif
diff --git a/src/libjasper/bmp/bmp_dec.c b/src/libjasper/bmp/bmp_dec.c
new file mode 100644 (file)
index 0000000..4cb0df3
--- /dev/null
@@ -0,0 +1,463 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Windows Bitmap File Library
+ *
+ * $Id$
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <assert.h>
+
+#include "jasper/jas_types.h"
+#include "jasper/jas_stream.h"
+#include "jasper/jas_image.h"
+#include "jasper/jas_malloc.h"
+
+#include "bmp_cod.h"
+
+/******************************************************************************\
+* Local prototypes.
+\******************************************************************************/
+
+static int bmp_gethdr(jas_stream_t *in, bmp_hdr_t *hdr);
+static bmp_info_t *bmp_getinfo(jas_stream_t *in);
+static int bmp_getdata(jas_stream_t *in, bmp_info_t *info, jas_image_t *image);
+static int bmp_getint16(jas_stream_t *in, int_fast16_t *val);
+static int bmp_getint32(jas_stream_t *in, int_fast32_t *val);
+static int bmp_gobble(jas_stream_t *in, long n);
+
+/******************************************************************************\
+* Interface functions.
+\******************************************************************************/
+
+jas_image_t *bmp_decode(jas_stream_t *in, char *optstr)
+{
+       jas_image_t *image;
+       bmp_hdr_t hdr;
+       bmp_info_t *info;
+       uint_fast16_t cmptno;
+       jas_image_cmptparm_t cmptparms[3];
+       jas_image_cmptparm_t *cmptparm;
+       uint_fast16_t numcmpts;
+       long n;
+
+       if (optstr) {
+               jas_eprintf("warning: ignoring BMP decoder options\n");
+       }
+
+       jas_eprintf(
+         "THE BMP FORMAT IS NOT FULLY SUPPORTED!\n"
+         "THAT IS, THE JASPER SOFTWARE CANNOT DECODE ALL TYPES OF BMP DATA.\n"
+         "IF YOU HAVE ANY PROBLEMS, PLEASE TRY CONVERTING YOUR IMAGE DATA\n"
+         "TO THE PNM FORMAT, AND USING THIS FORMAT INSTEAD.\n"
+         );
+
+       /* Read the bitmap header. */
+       if (bmp_gethdr(in, &hdr)) {
+               jas_eprintf("cannot get header\n");
+               return 0;
+       }
+
+       /* Read the bitmap information. */
+       if (!(info = bmp_getinfo(in))) {
+               jas_eprintf("cannot get info\n");
+               return 0;
+       }
+
+       /* Ensure that we support this type of BMP file. */
+       if (!bmp_issupported(&hdr, info)) {
+               jas_eprintf("error: unsupported BMP encoding\n");
+               bmp_info_destroy(info);
+               return 0;
+       }
+
+       /* Skip over any useless data between the end of the palette
+         and start of the bitmap data. */
+       if ((n = hdr.off - (BMP_HDRLEN + BMP_INFOLEN + BMP_PALLEN(info))) < 0) {
+               jas_eprintf("error: possibly bad bitmap offset?\n");
+               return 0;
+       }
+       if (n > 0) {
+               jas_eprintf("skipping unknown data in BMP file\n");
+               if (bmp_gobble(in, n)) {
+                       bmp_info_destroy(info);
+                       return 0;
+               }
+       }
+
+       /* Get the number of components. */
+       numcmpts = bmp_numcmpts(info);
+
+       for (cmptno = 0, cmptparm = cmptparms; cmptno < numcmpts; ++cmptno,
+         ++cmptparm) {
+               cmptparm->tlx = 0;
+               cmptparm->tly = 0;
+               cmptparm->hstep = 1;
+               cmptparm->vstep = 1;
+               cmptparm->width = info->width;
+               cmptparm->height = info->height;
+               cmptparm->prec = 8;
+               cmptparm->sgnd = false;
+       }
+
+       /* Create image object. */
+       if (!(image = jas_image_create(numcmpts, cmptparms,
+         JAS_CLRSPC_UNKNOWN))) {
+               bmp_info_destroy(info);
+               return 0;
+       }
+
+       if (numcmpts == 3) {
+               jas_image_setclrspc(image, JAS_CLRSPC_SRGB);
+               jas_image_setcmpttype(image, 0,
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_R));
+               jas_image_setcmpttype(image, 1,
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_G));
+               jas_image_setcmpttype(image, 2,
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_B));
+       } else {
+               jas_image_setclrspc(image, JAS_CLRSPC_SGRAY);
+               jas_image_setcmpttype(image, 0,
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_GRAY_Y));
+       }
+
+       /* Read the bitmap data. */
+       if (bmp_getdata(in, info, image)) {
+               bmp_info_destroy(info);
+               jas_image_destroy(image);
+               return 0;
+       }
+
+       bmp_info_destroy(info);
+
+       return image;
+}
+
+int bmp_validate(jas_stream_t *in)
+{
+       int n;
+       int i;
+       uchar buf[2];
+
+       assert(JAS_STREAM_MAXPUTBACK >= 2);
+
+       /* Read the first two characters that constitute the signature. */
+       if ((n = jas_stream_read(in, (char *) buf, 2)) < 0) {
+               return -1;
+       }
+       /* Put the characters read back onto the stream. */
+       for (i = n - 1; i >= 0; --i) {
+               if (jas_stream_ungetc(in, buf[i]) == EOF) {
+                       return -1;
+               }
+       }
+       /* Did we read enough characters? */
+       if (n < 2) {
+               return -1;
+       }
+       /* Is the signature correct for the BMP format? */
+       if (buf[0] == (BMP_MAGIC & 0xff) && buf[1] == (BMP_MAGIC >> 8)) {
+               return 0;
+       }
+       return -1;
+}
+
+/******************************************************************************\
+* Code for aggregate types.
+\******************************************************************************/
+
+static int bmp_gethdr(jas_stream_t *in, bmp_hdr_t *hdr)
+{
+       if (bmp_getint16(in, &hdr->magic) || hdr->magic != BMP_MAGIC ||
+         bmp_getint32(in, &hdr->siz) || bmp_getint16(in, &hdr->reserved1) ||
+         bmp_getint16(in, &hdr->reserved2) || bmp_getint32(in, &hdr->off)) {
+               return -1;
+       }
+       return 0;
+}
+
+static bmp_info_t *bmp_getinfo(jas_stream_t *in)
+{
+       bmp_info_t *info;
+       int i;
+       bmp_palent_t *palent;
+
+       if (!(info = bmp_info_create())) {
+               return 0;
+       }
+
+       if (bmp_getint32(in, &info->len) || info->len != 40 ||
+         bmp_getint32(in, &info->width) || bmp_getint32(in, &info->height) ||
+         bmp_getint16(in, &info->numplanes) ||
+         bmp_getint16(in, &info->depth) || bmp_getint32(in, &info->enctype) ||
+         bmp_getint32(in, &info->siz) ||
+         bmp_getint32(in, &info->hres) || bmp_getint32(in, &info->vres) ||
+         bmp_getint32(in, &info->numcolors) ||
+         bmp_getint32(in, &info->mincolors)) {
+               bmp_info_destroy(info);
+               return 0;
+       }
+
+       if (info->height < 0) {
+               info->topdown = 1;
+               info->height = -info->height;
+       } else {
+               info->topdown = 0;
+       }
+
+       if (info->width <= 0 || info->height <= 0 || info->numplanes <= 0 ||
+         info->depth <= 0  || info->numcolors < 0 || info->mincolors < 0) {
+               bmp_info_destroy(info);
+               return 0;
+       }
+
+       if (info->enctype != BMP_ENC_RGB) {
+               jas_eprintf("unsupported BMP encoding\n");
+               bmp_info_destroy(info);
+               return 0;
+       }
+
+       if (info->numcolors > 0) {
+               if (!(info->palents = jas_malloc(info->numcolors *
+                 sizeof(bmp_palent_t)))) {
+                       bmp_info_destroy(info);
+                       return 0;
+               }
+       } else {
+               info->palents = 0;
+       }
+
+       for (i = 0; i < info->numcolors; ++i) {
+               palent = &info->palents[i];
+               if ((palent->blu = jas_stream_getc(in)) == EOF ||
+                 (palent->grn = jas_stream_getc(in)) == EOF ||
+                 (palent->red = jas_stream_getc(in)) == EOF ||
+                 (palent->res = jas_stream_getc(in)) == EOF) {
+                       bmp_info_destroy(info);
+                       return 0;
+               }
+       }
+
+       return info;
+}
+
+static int bmp_getdata(jas_stream_t *in, bmp_info_t *info, jas_image_t *image)
+{
+       int i;
+       int j;
+       int y;
+       jas_matrix_t *cmpts[3];
+       int numpad;
+       int red;
+       int grn;
+       int blu;
+       int ret;
+       int numcmpts;
+       int cmptno;
+       int ind;
+       bmp_palent_t *palent;
+       int mxind;
+       int haspal;
+
+       assert(info->depth == 8 || info->depth == 24);
+       assert(info->enctype == BMP_ENC_RGB);
+
+       numcmpts = bmp_numcmpts(info);
+       haspal = bmp_haspal(info);
+
+       ret = 0;
+       for (i = 0; i < numcmpts; ++i) {
+               cmpts[i] = 0;
+       }
+
+       /* Create temporary matrices to hold component data. */
+       for (i = 0; i < numcmpts; ++i) {
+               if (!(cmpts[i] = jas_matrix_create(1, info->width))) {
+                       ret = -1;
+                       goto bmp_getdata_done;
+               }
+       }
+
+       /* Calculate number of padding bytes per row of image data. */
+       numpad = (numcmpts * info->width) % 4;
+       if (numpad) {
+               numpad = 4 - numpad;
+       }
+
+       mxind = (1 << info->depth) - 1;
+       for (i = 0; i < info->height; ++i) {
+               for (j = 0; j < info->width; ++j) {
+                       if (haspal) {
+                               if ((ind = jas_stream_getc(in)) == EOF) {
+                                       ret = -1;
+                                       goto bmp_getdata_done;
+                               }
+                               if (ind > mxind) {
+                                       ret = -1;
+                                       goto bmp_getdata_done;
+                               }
+                               if (ind < info->numcolors) {
+                                       palent = &info->palents[ind];
+                                       red = palent->red;
+                                       grn = palent->grn;
+                                       blu = palent->blu;
+                               } else {
+                                       red = ind;
+                                       grn = ind;
+                                       blu = ind;
+                               }
+                       } else {
+                               if ((blu = jas_stream_getc(in)) == EOF ||
+                                 (grn = jas_stream_getc(in)) == EOF ||
+                                 (red = jas_stream_getc(in)) == EOF) {
+                                       ret = -1;
+                                       goto bmp_getdata_done;
+                               }
+                       }
+                       if (numcmpts == 3) {
+                               jas_matrix_setv(cmpts[0], j, red);
+                               jas_matrix_setv(cmpts[1], j, grn);
+                               jas_matrix_setv(cmpts[2], j, blu);
+                       } else {
+                               jas_matrix_setv(cmpts[0], j, red);
+                       }
+               }
+               for (j = numpad; j > 0; --j) {
+                               if (jas_stream_getc(in) == EOF) {
+                                       ret = -1;
+                                       goto bmp_getdata_done;
+                               }
+               }
+               for (cmptno = 0; cmptno < numcmpts; ++cmptno) {
+                       y = info->topdown ? i : (info->height - 1 - i);
+                       if (jas_image_writecmpt(image, cmptno, 0, y, info->width,
+                         1, cmpts[cmptno])) {
+                               ret = -1;
+                               goto bmp_getdata_done;
+                       }
+               }
+       }
+
+bmp_getdata_done:
+       /* Destroy the temporary matrices. */
+       for (i = 0; i < numcmpts; ++i) {
+               if (cmpts[i]) {
+                       jas_matrix_destroy(cmpts[i]);
+               }
+       }
+
+       return ret;
+}
+
+/******************************************************************************\
+* Code for primitive types.
+\******************************************************************************/
+
+static int bmp_getint16(jas_stream_t *in, int_fast16_t *val)
+{
+       int lo;
+       int hi;
+       if ((lo = jas_stream_getc(in)) == EOF || (hi = jas_stream_getc(in)) == EOF) {
+               return -1;
+       }
+       if (val) {
+               *val = (hi << 8) | lo;
+       }
+       return 0;
+}
+
+static int bmp_getint32(jas_stream_t *in, int_fast32_t *val)
+{
+       int n;
+       uint_fast32_t v;
+       int c;
+       for (n = 4, v = 0;;) {
+               if ((c = jas_stream_getc(in)) == EOF) {
+                       return -1;
+               }
+               v |= (c << 24);
+               if (--n <= 0) {
+                       break;
+               }
+               v >>= 8;
+       }
+       if (val) {
+               *val = v;
+       }
+       return 0;
+}
+
+static int bmp_gobble(jas_stream_t *in, long n)
+{
+       while (--n >= 0) {
+               if (jas_stream_getc(in) == EOF) {
+                       return -1;
+               }
+       }
+       return 0;
+}
diff --git a/src/libjasper/bmp/bmp_enc.c b/src/libjasper/bmp/bmp_enc.c
new file mode 100644 (file)
index 0000000..26c658c
--- /dev/null
@@ -0,0 +1,395 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Windows Bitmap File Library
+ *
+ * $Id$
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <assert.h>
+
+#include "jasper/jas_types.h"
+#include "jasper/jas_stream.h"
+#include "jasper/jas_image.h"
+#include "jasper/jas_debug.h"
+
+#include "bmp_enc.h"
+#include "bmp_cod.h"
+
+/******************************************************************************\
+* Local prototypes.
+\******************************************************************************/
+
+static int bmp_puthdr(jas_stream_t *out, bmp_hdr_t *hdr);
+static int bmp_putinfo(jas_stream_t *out, bmp_info_t *info);
+static int bmp_putdata(jas_stream_t *out, bmp_info_t *info, jas_image_t *image, int *cmpts);
+static int bmp_putint16(jas_stream_t *in, int_fast16_t val);
+static int bmp_putint32(jas_stream_t *out, int_fast32_t val);
+
+/******************************************************************************\
+* Interface functions.
+\******************************************************************************/
+
+int bmp_encode(jas_image_t *image, jas_stream_t *out, char *optstr)
+{
+       jas_image_coord_t width;
+       jas_image_coord_t height;
+       int depth;
+       int cmptno;
+       bmp_hdr_t hdr;
+       bmp_info_t *info;
+       int_fast32_t datalen;
+       int numpad;
+       bmp_enc_t encbuf;
+       bmp_enc_t *enc = &encbuf;
+       jas_clrspc_t clrspc;
+
+       if (optstr) {
+               jas_eprintf("warning: ignoring BMP encoder options\n");
+       }
+
+       clrspc = jas_image_clrspc(image);
+       switch (jas_clrspc_fam(clrspc)) {
+       case JAS_CLRSPC_FAM_RGB:
+               if (clrspc != JAS_CLRSPC_SRGB)
+                       jas_eprintf("warning: inaccurate color\n");
+               break;
+       case JAS_CLRSPC_FAM_GRAY:
+               if (clrspc != JAS_CLRSPC_SGRAY)
+                       jas_eprintf("warning: inaccurate color\n");
+               break;
+       default:
+               jas_eprintf("error: BMP format does not support color space\n");
+               return -1;
+               break;
+       }
+
+       switch (jas_clrspc_fam(clrspc)) {
+       case JAS_CLRSPC_FAM_RGB:
+               enc->numcmpts = 3;
+               if ((enc->cmpts[0] = jas_image_getcmptbytype(image,
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_R))) < 0 ||
+                 (enc->cmpts[1] = jas_image_getcmptbytype(image,
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_G))) < 0 ||
+                 (enc->cmpts[2] = jas_image_getcmptbytype(image,
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_B))) < 0) {
+                       jas_eprintf("error: missing color component\n");
+                       return -1;
+               }
+               break;
+       case JAS_CLRSPC_FAM_GRAY:
+               enc->numcmpts = 1;
+               if ((enc->cmpts[0] = jas_image_getcmptbytype(image,
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_GRAY_Y))) < 0) {
+                       jas_eprintf("error: missing color component\n");
+                       return -1;
+               }
+               break;
+       default:
+               abort();
+               break;
+       }
+
+       width = jas_image_cmptwidth(image, enc->cmpts[0]);
+       height = jas_image_cmptheight(image, enc->cmpts[0]);
+       depth = jas_image_cmptprec(image, enc->cmpts[0]);
+
+       /* Check to ensure that the image to be saved can actually be represented
+         using the BMP format. */
+       for (cmptno = 0; cmptno < enc->numcmpts; ++cmptno) {
+               if (jas_image_cmptwidth(image, enc->cmpts[cmptno]) != width ||
+                 jas_image_cmptheight(image, enc->cmpts[cmptno]) != height ||
+                 jas_image_cmptprec(image, enc->cmpts[cmptno]) != depth ||
+                 jas_image_cmptsgnd(image, enc->cmpts[cmptno]) != false ||
+                 jas_image_cmpttlx(image, enc->cmpts[cmptno]) != 0 ||
+                 jas_image_cmpttly(image, enc->cmpts[cmptno]) != 0) {
+                       jas_eprintf("The BMP format cannot be used to represent an image with this geometry.\n");
+                       return -1;
+               }
+       }
+
+       /* The component depths must be 1, 4, or 8. */
+       if (depth != 1 && depth != 4 && depth != 8) {
+               return -1;
+       }
+
+       numpad = (width * enc->numcmpts) % 4;
+       if (numpad) {
+               numpad = 4 - numpad;
+       }
+       datalen = (enc->numcmpts * width + numpad) * height;
+
+       if (!(info = bmp_info_create())) {
+               return -1;
+       }
+       info->len = BMP_INFOLEN;
+       info->width = width;
+       info->height = height;
+       info->numplanes = 1;
+       info->depth = enc->numcmpts * depth;
+       info->enctype = BMP_ENC_RGB;
+       info->siz = datalen;
+       info->hres = 0;
+       info->vres = 0;
+       info->numcolors = (enc->numcmpts == 1) ? 256 : 0;
+       info->mincolors = 0;
+
+       hdr.magic = BMP_MAGIC;
+       hdr.siz = BMP_HDRLEN + BMP_INFOLEN + 0 + datalen;
+       hdr.off = BMP_HDRLEN + BMP_INFOLEN + BMP_PALLEN(info);
+
+       /* Write the bitmap header. */
+       if (bmp_puthdr(out, &hdr)) {
+               return -1;
+       }
+
+       /* Write the bitmap information. */
+       if (bmp_putinfo(out, info)) {
+               return -1;
+       }
+
+       /* Write the bitmap data. */
+       if (bmp_putdata(out, info, image, enc->cmpts)) {
+               return -1;
+       }
+
+       bmp_info_destroy(info);
+
+       return 0;
+}
+
+/******************************************************************************\
+* Code for aggregate types.
+\******************************************************************************/
+
+static int bmp_puthdr(jas_stream_t *out, bmp_hdr_t *hdr)
+{
+       assert(hdr->magic == BMP_MAGIC);
+       if (bmp_putint16(out, hdr->magic) || bmp_putint32(out, hdr->siz) ||
+         bmp_putint32(out, 0) || bmp_putint32(out, hdr->off)) {
+               return -1;
+       }
+       return 0;
+}
+
+static int bmp_putinfo(jas_stream_t *out, bmp_info_t *info)
+{
+       int i;
+
+       info->len = 40;
+       if (bmp_putint32(out, info->len) ||
+         bmp_putint32(out, info->width) ||
+         bmp_putint32(out, info->height) ||
+         bmp_putint16(out, info->numplanes) ||
+         bmp_putint16(out, info->depth) ||
+         bmp_putint32(out, info->enctype) ||
+         bmp_putint32(out, info->siz) ||
+         bmp_putint32(out, info->hres) ||
+         bmp_putint32(out, info->vres) ||
+         bmp_putint32(out, info->numcolors) ||
+         bmp_putint32(out, info->mincolors)) {
+               return -1;
+       }
+
+       for (i = 0; i < info->numcolors; ++i)
+       {
+               if (jas_stream_putc(out, i) == EOF ||
+                 jas_stream_putc(out, i) == EOF ||
+                 jas_stream_putc(out, i) == EOF ||
+                 jas_stream_putc(out, 0) == EOF)
+               {
+                       return -1;
+               }
+       }
+
+       return 0;
+}
+
+static int bmp_putdata(jas_stream_t *out, bmp_info_t *info, jas_image_t *image,
+  int *cmpts)
+{
+       int i;
+       int j;
+       jas_matrix_t *bufs[3];
+       int numpad;
+       unsigned char red;
+       unsigned char grn;
+       unsigned char blu;
+       int ret;
+       int numcmpts;
+       int v;
+       int cmptno;
+
+       numcmpts = (info->depth == 24) ? 3:1;
+
+       /* We do not support palettized images. */
+       if (BMP_HASPAL(info) && numcmpts == 3) {
+               jas_eprintf("no palettized image support for BMP format\n");
+               return -1;
+       }
+
+       ret = 0;
+       for (i = 0; i < numcmpts; ++i) {
+               bufs[i] = 0;
+       }
+
+       /* Create temporary matrices to hold component data. */
+       for (i = 0; i < numcmpts; ++i) {
+               if (!(bufs[i] = jas_matrix_create(1, info->width))) {
+                       ret = -1;
+                       goto bmp_putdata_done;
+               }
+       }
+
+       /* Calculate number of padding bytes per row of image data. */
+       numpad = (numcmpts * info->width) % 4;
+       if (numpad) {
+               numpad = 4 - numpad;
+       }
+
+       /* Put the image data. */
+       for (i = info->height - 1; i >= 0; --i) {
+               for (cmptno = 0; cmptno < numcmpts; ++cmptno) {
+                       if (jas_image_readcmpt(image, cmptno, 0, i, info->width,
+                         1, bufs[cmpts[cmptno]])) {
+                               ret = -1;
+                               goto bmp_putdata_done;
+                       }
+               }
+               for (j = 0; j < info->width; ++j) {
+                       if (numcmpts == 3) {
+                               red = (jas_matrix_getv(bufs[0], j));
+                               grn = (jas_matrix_getv(bufs[1], j));
+                               blu = (jas_matrix_getv(bufs[2], j));
+                               if (jas_stream_putc(out, blu) == EOF ||
+                                 jas_stream_putc(out, grn) == EOF ||
+                                 jas_stream_putc(out, red) == EOF) {
+                                       ret = -1;
+                                       goto bmp_putdata_done;
+                               }
+                       } else if (numcmpts == 1) {
+                               v = (jas_matrix_getv(bufs[cmpts[0]], j));
+                               if (jas_stream_putc(out, v) == EOF) {
+                                       ret = -1;
+                                       goto bmp_putdata_done;
+                               }
+                       } else {
+                               abort();
+                       }
+               }
+               for (j = numpad; j > 0; --j) {
+                       if (jas_stream_putc(out, 0) == EOF) {
+                               ret = -1;
+                               goto bmp_putdata_done;
+                       }
+               }
+       }
+
+bmp_putdata_done:
+       /* Destroy the temporary matrices. */
+       for (i = 0; i < numcmpts; ++i) {
+               if (bufs[i]) {
+                       jas_matrix_destroy(bufs[i]);
+               }
+       }
+
+       return ret;
+}
+
+/******************************************************************************\
+* Code for primitive types.
+\******************************************************************************/
+
+static int bmp_putint16(jas_stream_t *in, int_fast16_t val)
+{
+       if (jas_stream_putc(in, val & 0xff) == EOF || jas_stream_putc(in, (val >> 8) &
+         0xff) == EOF) {
+               return -1;
+       }
+       return 0;
+}
+
+static int bmp_putint32(jas_stream_t *out, int_fast32_t val)
+{
+       int n;
+       int_fast32_t v;
+
+       /* This code needs to be changed if we want to handle negative values. */
+       assert(val >= 0);
+       v = val;
+       for (n = 4;;) {
+               if (jas_stream_putc(out, v & 0xff) == EOF) {
+                       return -1;
+               }
+               if (--n <= 0) {
+                       break;
+               }
+               v >>= 8;
+       }
+       return 0;
+}
diff --git a/src/libjasper/bmp/bmp_enc.h b/src/libjasper/bmp/bmp_enc.h
new file mode 100644 (file)
index 0000000..f37e504
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+#ifndef BMP_ENC_H
+#define BMP_ENC_H
+
+typedef struct {
+
+       int numcmpts;
+       int cmpts[4];
+
+} bmp_enc_t;
+
+#endif
diff --git a/src/libjasper/dummy.c b/src/libjasper/dummy.c
new file mode 100644 (file)
index 0000000..9344920
--- /dev/null
@@ -0,0 +1,3 @@
+/* This source file only exists to keep libtool happy. */
+
+char jas_dummy;
diff --git a/src/libjasper/include/Makefile.am b/src/libjasper/include/Makefile.am
new file mode 100644 (file)
index 0000000..bdca0c9
--- /dev/null
@@ -0,0 +1,59 @@
+# Copyright (c) 2001-2002 Michael David Adams.
+# All rights reserved.
+
+# __START_OF_JASPER_LICENSE__
+# 
+# JasPer License Version 2.0
+# 
+# Copyright (c) 2001-2006 Michael David Adams
+# Copyright (c) 1999-2000 Image Power, Inc.
+# Copyright (c) 1999-2000 The University of British Columbia
+# 
+# All rights reserved.
+# 
+# Permission is hereby granted, free of charge, to any person (the
+# "User") obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the
+# following conditions:
+# 
+# 1.  The above copyright notices and this permission notice (which
+# includes the disclaimer below) shall be included in all copies or
+# substantial portions of the Software.
+# 
+# 2.  The name of a copyright holder shall not be used to endorse or
+# promote products derived from the Software without specific prior
+# written permission.
+# 
+# THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+# LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+# THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+# "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+# PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+# EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+# PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+# THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+# EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+# BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+# PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+# GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+# ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+# IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+# SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+# AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+# SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+# THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+# PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+# RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+# EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+# 
+# __END_OF_JASPER_LICENSE__
+
+SUBDIRS = jasper
diff --git a/src/libjasper/include/Makefile.in b/src/libjasper/include/Makefile.in
new file mode 100644 (file)
index 0000000..4c860a0
--- /dev/null
@@ -0,0 +1,549 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# Copyright (c) 2001-2002 Michael David Adams.
+# All rights reserved.
+
+# __START_OF_JASPER_LICENSE__
+# 
+# JasPer License Version 2.0
+# 
+# Copyright (c) 2001-2006 Michael David Adams
+# Copyright (c) 1999-2000 Image Power, Inc.
+# Copyright (c) 1999-2000 The University of British Columbia
+# 
+# All rights reserved.
+# 
+# Permission is hereby granted, free of charge, to any person (the
+# "User") obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the
+# following conditions:
+# 
+# 1.  The above copyright notices and this permission notice (which
+# includes the disclaimer below) shall be included in all copies or
+# substantial portions of the Software.
+# 
+# 2.  The name of a copyright holder shall not be used to endorse or
+# promote products derived from the Software without specific prior
+# written permission.
+# 
+# THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+# LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+# THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+# "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+# PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+# EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+# PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+# THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+# EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+# BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+# PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+# GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+# ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+# IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+# SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+# AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+# SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+# THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+# PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+# RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+# EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+# 
+# __END_OF_JASPER_LICENSE__
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = src/libjasper/include
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/acaux/mkinstalldirs
+CONFIG_HEADER =  \
+       $(top_builddir)/src/libjasper/include/jasper/jas_config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+       html-recursive info-recursive install-data-recursive \
+       install-exec-recursive install-info-recursive \
+       install-recursive installcheck-recursive installdirs-recursive \
+       pdf-recursive ps-recursive uninstall-info-recursive \
+       uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+HAVE_LIBJPEG_FALSE = @HAVE_LIBJPEG_FALSE@
+HAVE_LIBJPEG_TRUE = @HAVE_LIBJPEG_TRUE@
+HAVE_OPENGL_FALSE = @HAVE_OPENGL_FALSE@
+HAVE_OPENGL_TRUE = @HAVE_OPENGL_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAS_MAJOR_VERSION = @JAS_MAJOR_VERSION@
+JAS_MICRO_VERSION = @JAS_MICRO_VERSION@
+JAS_MINOR_VERSION = @JAS_MINOR_VERSION@
+JAS_RPM_RELEASE = @JAS_RPM_RELEASE@
+JAS_VERSION = @JAS_VERSION@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_AGE = @LT_AGE@
+LT_CURRENT = @LT_CURRENT@
+LT_RELEASE = @LT_RELEASE@
+LT_REVISION = @LT_REVISION@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OPENGL_LIBS = @OPENGL_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = jasper
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/libjasper/include/Makefile'; \
+       cd $(top_srcdir) && \
+         $(AUTOMAKE) --foreign  src/libjasper/include/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+
+distclean-libtool:
+       -rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+       @failcom='exit 1'; \
+       for f in x $$MAKEFLAGS; do \
+         case $$f in \
+           *=* | --[!k]*);; \
+           *k*) failcom='fail=yes';; \
+         esac; \
+       done; \
+       dot_seen=no; \
+       target=`echo $@ | sed s/-recursive//`; \
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         echo "Making $$target in $$subdir"; \
+         if test "$$subdir" = "."; then \
+           dot_seen=yes; \
+           local_target="$$target-am"; \
+         else \
+           local_target="$$target"; \
+         fi; \
+         (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+         || eval $$failcom; \
+       done; \
+       if test "$$dot_seen" = "no"; then \
+         $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+       fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+       @failcom='exit 1'; \
+       for f in x $$MAKEFLAGS; do \
+         case $$f in \
+           *=* | --[!k]*);; \
+           *k*) failcom='fail=yes';; \
+         esac; \
+       done; \
+       dot_seen=no; \
+       case "$@" in \
+         distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+         *) list='$(SUBDIRS)' ;; \
+       esac; \
+       rev=''; for subdir in $$list; do \
+         if test "$$subdir" = "."; then :; else \
+           rev="$$subdir $$rev"; \
+         fi; \
+       done; \
+       rev="$$rev ."; \
+       target=`echo $@ | sed s/-recursive//`; \
+       for subdir in $$rev; do \
+         echo "Making $$target in $$subdir"; \
+         if test "$$subdir" = "."; then \
+           local_target="$$target-am"; \
+         else \
+           local_target="$$target"; \
+         fi; \
+         (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+         || eval $$failcom; \
+       done && test -z "$$fail"
+tags-recursive:
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+       done
+ctags-recursive:
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+       done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+         include_option=--etags-include; \
+         empty_fix=.; \
+       else \
+         include_option=--include; \
+         empty_fix=; \
+       fi; \
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         if test "$$subdir" = .; then :; else \
+           test ! -f $$subdir/TAGS || \
+             tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+         fi; \
+       done; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+           $$tags $$unique; \
+       fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       test -z "$(CTAGS_ARGS)$$tags$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$tags $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && cd $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+       list='$(DISTFILES)'; for file in $$list; do \
+         case $$file in \
+           $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+           $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+         esac; \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+         if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+           dir="/$$dir"; \
+           $(mkdir_p) "$(distdir)$$dir"; \
+         else \
+           dir=''; \
+         fi; \
+         if test -d $$d/$$file; then \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+           fi; \
+           cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+         else \
+           test -f $(distdir)/$$file \
+           || cp -p $$d/$$file $(distdir)/$$file \
+           || exit 1; \
+         fi; \
+       done
+       list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+         if test "$$subdir" = .; then :; else \
+           test -d "$(distdir)/$$subdir" \
+           || $(mkdir_p) "$(distdir)/$$subdir" \
+           || exit 1; \
+           distdir=`$(am__cd) $(distdir) && pwd`; \
+           top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+           (cd $$subdir && \
+             $(MAKE) $(AM_MAKEFLAGS) \
+               top_distdir="$$top_distdir" \
+               distdir="$$distdir/$$subdir" \
+               distdir) \
+             || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+         `test -z '$(STRIP)' || \
+           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+       distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+       clean clean-generic clean-libtool clean-recursive ctags \
+       ctags-recursive distclean distclean-generic distclean-libtool \
+       distclean-recursive distclean-tags distdir dvi dvi-am html \
+       html-am info info-am install install-am install-data \
+       install-data-am install-exec install-exec-am install-info \
+       install-info-am install-man install-strip installcheck \
+       installcheck-am installdirs installdirs-am maintainer-clean \
+       maintainer-clean-generic maintainer-clean-recursive \
+       mostlyclean mostlyclean-generic mostlyclean-libtool \
+       mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+       uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/libjasper/include/jasper/Makefile.am b/src/libjasper/include/jasper/Makefile.am
new file mode 100644 (file)
index 0000000..1e490ff
--- /dev/null
@@ -0,0 +1,80 @@
+# Copyright (c) 2001-2003 Michael David Adams.
+# All rights reserved.
+
+# __START_OF_JASPER_LICENSE__
+# 
+# JasPer License Version 2.0
+# 
+# Copyright (c) 2001-2006 Michael David Adams
+# Copyright (c) 1999-2000 Image Power, Inc.
+# Copyright (c) 1999-2000 The University of British Columbia
+# 
+# All rights reserved.
+# 
+# Permission is hereby granted, free of charge, to any person (the
+# "User") obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the
+# following conditions:
+# 
+# 1.  The above copyright notices and this permission notice (which
+# includes the disclaimer below) shall be included in all copies or
+# substantial portions of the Software.
+# 
+# 2.  The name of a copyright holder shall not be used to endorse or
+# promote products derived from the Software without specific prior
+# written permission.
+# 
+# THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+# LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+# THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+# "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+# PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+# EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+# PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+# THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+# EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+# BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+# PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+# GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+# ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+# IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+# SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+# AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+# SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+# THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+# PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+# RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+# EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+# 
+# __END_OF_JASPER_LICENSE__
+
+libjasperincludedir = $(includedir)/jasper
+
+libjasperinclude_HEADERS = \
+       jasper.h \
+       jas_config.h \
+       jas_config2.h \
+       jas_cm.h \
+       jas_fix.h \
+       jas_debug.h \
+       jas_getopt.h \
+       jas_icc.h \
+       jas_image.h \
+       jas_init.h \
+       jas_malloc.h \
+       jas_math.h \
+       jas_seq.h \
+       jas_stream.h \
+       jas_string.h \
+       jas_tmr.h \
+       jas_tvp.h \
+       jas_types.h \
+       jas_version.h
diff --git a/src/libjasper/include/jasper/Makefile.in b/src/libjasper/include/jasper/Makefile.in
new file mode 100644 (file)
index 0000000..c165de6
--- /dev/null
@@ -0,0 +1,508 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# Copyright (c) 2001-2003 Michael David Adams.
+# All rights reserved.
+
+# __START_OF_JASPER_LICENSE__
+# 
+# JasPer License Version 2.0
+# 
+# Copyright (c) 2001-2006 Michael David Adams
+# Copyright (c) 1999-2000 Image Power, Inc.
+# Copyright (c) 1999-2000 The University of British Columbia
+# 
+# All rights reserved.
+# 
+# Permission is hereby granted, free of charge, to any person (the
+# "User") obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the
+# following conditions:
+# 
+# 1.  The above copyright notices and this permission notice (which
+# includes the disclaimer below) shall be included in all copies or
+# substantial portions of the Software.
+# 
+# 2.  The name of a copyright holder shall not be used to endorse or
+# promote products derived from the Software without specific prior
+# written permission.
+# 
+# THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+# LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+# THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+# "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+# PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+# EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+# PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+# THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+# EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+# BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+# PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+# GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+# ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+# IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+# SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+# AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+# SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+# THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+# PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+# RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+# EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+# 
+# __END_OF_JASPER_LICENSE__
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = src/libjasper/include/jasper
+DIST_COMMON = $(libjasperinclude_HEADERS) $(srcdir)/Makefile.am \
+       $(srcdir)/Makefile.in $(srcdir)/jas_config.h.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/acaux/mkinstalldirs
+CONFIG_HEADER = jas_config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(libjasperincludedir)"
+libjasperincludeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(libjasperinclude_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+HAVE_LIBJPEG_FALSE = @HAVE_LIBJPEG_FALSE@
+HAVE_LIBJPEG_TRUE = @HAVE_LIBJPEG_TRUE@
+HAVE_OPENGL_FALSE = @HAVE_OPENGL_FALSE@
+HAVE_OPENGL_TRUE = @HAVE_OPENGL_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAS_MAJOR_VERSION = @JAS_MAJOR_VERSION@
+JAS_MICRO_VERSION = @JAS_MICRO_VERSION@
+JAS_MINOR_VERSION = @JAS_MINOR_VERSION@
+JAS_RPM_RELEASE = @JAS_RPM_RELEASE@
+JAS_VERSION = @JAS_VERSION@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_AGE = @LT_AGE@
+LT_CURRENT = @LT_CURRENT@
+LT_RELEASE = @LT_RELEASE@
+LT_REVISION = @LT_REVISION@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OPENGL_LIBS = @OPENGL_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+libjasperincludedir = $(includedir)/jasper
+libjasperinclude_HEADERS = \
+       jasper.h \
+       jas_config.h \
+       jas_config2.h \
+       jas_cm.h \
+       jas_fix.h \
+       jas_debug.h \
+       jas_getopt.h \
+       jas_icc.h \
+       jas_image.h \
+       jas_init.h \
+       jas_malloc.h \
+       jas_math.h \
+       jas_seq.h \
+       jas_stream.h \
+       jas_string.h \
+       jas_tmr.h \
+       jas_tvp.h \
+       jas_types.h \
+       jas_version.h
+
+all: jas_config.h
+       $(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/libjasper/include/jasper/Makefile'; \
+       cd $(top_srcdir) && \
+         $(AUTOMAKE) --foreign  src/libjasper/include/jasper/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+jas_config.h: stamp-h1
+       @if test ! -f $@; then \
+         rm -f stamp-h1; \
+         $(MAKE) stamp-h1; \
+       else :; fi
+
+stamp-h1: $(srcdir)/jas_config.h.in $(top_builddir)/config.status
+       @rm -f stamp-h1
+       cd $(top_builddir) && $(SHELL) ./config.status src/libjasper/include/jasper/jas_config.h
+$(srcdir)/jas_config.h.in:  $(am__configure_deps) 
+       cd $(top_srcdir) && $(AUTOHEADER)
+       rm -f stamp-h1
+       touch $@
+
+distclean-hdr:
+       -rm -f jas_config.h stamp-h1
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+
+distclean-libtool:
+       -rm -f libtool
+uninstall-info-am:
+install-libjasperincludeHEADERS: $(libjasperinclude_HEADERS)
+       @$(NORMAL_INSTALL)
+       test -z "$(libjasperincludedir)" || $(mkdir_p) "$(DESTDIR)$(libjasperincludedir)"
+       @list='$(libjasperinclude_HEADERS)'; for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         f=$(am__strip_dir) \
+         echo " $(libjasperincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(libjasperincludedir)/$$f'"; \
+         $(libjasperincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(libjasperincludedir)/$$f"; \
+       done
+
+uninstall-libjasperincludeHEADERS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(libjasperinclude_HEADERS)'; for p in $$list; do \
+         f=$(am__strip_dir) \
+         echo " rm -f '$(DESTDIR)$(libjasperincludedir)/$$f'"; \
+         rm -f "$(DESTDIR)$(libjasperincludedir)/$$f"; \
+       done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES) jas_config.h.in $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS) jas_config.h.in $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+           $$tags $$unique; \
+       fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES) jas_config.h.in $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS) jas_config.h.in $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       test -z "$(CTAGS_ARGS)$$tags$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$tags $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && cd $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+       list='$(DISTFILES)'; for file in $$list; do \
+         case $$file in \
+           $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+           $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+         esac; \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+         if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+           dir="/$$dir"; \
+           $(mkdir_p) "$(distdir)$$dir"; \
+         else \
+           dir=''; \
+         fi; \
+         if test -d $$d/$$file; then \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+           fi; \
+           cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+         else \
+           test -f $(distdir)/$$file \
+           || cp -p $$d/$$file $(distdir)/$$file \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS) jas_config.h
+installdirs:
+       for dir in "$(DESTDIR)$(libjasperincludedir)"; do \
+         test -z "$$dir" || $(mkdir_p) "$$dir"; \
+       done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+         `test -z '$(STRIP)' || \
+           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-hdr \
+       distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-libjasperincludeHEADERS
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-libjasperincludeHEADERS
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+       clean-libtool ctags distclean distclean-generic distclean-hdr \
+       distclean-libtool distclean-tags distdir dvi dvi-am html \
+       html-am info info-am install install-am install-data \
+       install-data-am install-exec install-exec-am install-info \
+       install-info-am install-libjasperincludeHEADERS install-man \
+       install-strip installcheck installcheck-am installdirs \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+       tags uninstall uninstall-am uninstall-info-am \
+       uninstall-libjasperincludeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/libjasper/include/jasper/jas_cm.h b/src/libjasper/include/jasper/jas_cm.h
new file mode 100644 (file)
index 0000000..d5cd22e
--- /dev/null
@@ -0,0 +1,266 @@
+/*
+ * Copyright (c) 2002-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Color Management
+ *
+ * $Id$
+ */
+
+#ifndef JAS_CM_H
+#define JAS_CM_H
+
+#include <jasper/jas_config.h>
+#include <jasper/jas_icc.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef int jas_clrspc_t;
+
+/* transform operations */
+#define        JAS_CMXFORM_OP_FWD      0
+#define        JAS_CMXFORM_OP_REV      1
+#define        JAS_CMXFORM_OP_PROOF    2
+#define        JAS_CMXFORM_OP_GAMUT    3
+
+/* rendering intents */
+#define        JAS_CMXFORM_INTENT_PER          0
+#define        JAS_CMXFORM_INTENT_RELCLR       1
+#define        JAS_CMXFORM_INTENT_ABSCLR       2
+#define        JAS_CMXFORM_INTENT_SAT          3
+#define        JAS_CMXFORM_NUMINTENTS          4
+
+#define        JAS_CMXFORM_OPTM_SPEED  0
+#define JAS_CMXFORM_OPTM_SIZE  1
+#define        JAS_CMXFORM_OPTM_ACC    2
+
+
+#define        jas_clrspc_create(fam, mbr)     (((fam) << 8) | (mbr))
+#define        jas_clrspc_fam(clrspc)  ((clrspc) >> 8)
+#define        jas_clrspc_mbr(clrspc)  ((clrspc) & 0xff)
+#define        jas_clrspc_isgeneric(clrspc)    (!jas_clrspc_mbr(clrspc))
+#define        jas_clrspc_isunknown(clrspc)    ((clrspc) & JAS_CLRSPC_UNKNOWNMASK)
+
+#define        JAS_CLRSPC_UNKNOWNMASK  0x4000
+
+/* color space families */
+#define        JAS_CLRSPC_FAM_UNKNOWN  0
+#define        JAS_CLRSPC_FAM_XYZ      1
+#define        JAS_CLRSPC_FAM_LAB      2
+#define        JAS_CLRSPC_FAM_GRAY     3
+#define        JAS_CLRSPC_FAM_RGB      4
+#define        JAS_CLRSPC_FAM_YCBCR    5
+
+/* specific color spaces */
+#define        JAS_CLRSPC_UNKNOWN      JAS_CLRSPC_UNKNOWNMASK
+#define        JAS_CLRSPC_CIEXYZ       jas_clrspc_create(JAS_CLRSPC_FAM_XYZ, 1)
+#define        JAS_CLRSPC_CIELAB       jas_clrspc_create(JAS_CLRSPC_FAM_LAB, 1)
+#define        JAS_CLRSPC_SGRAY        jas_clrspc_create(JAS_CLRSPC_FAM_GRAY, 1)
+#define        JAS_CLRSPC_SRGB         jas_clrspc_create(JAS_CLRSPC_FAM_RGB, 1)
+#define        JAS_CLRSPC_SYCBCR       jas_clrspc_create(JAS_CLRSPC_FAM_YCBCR, 1)
+
+/* generic color spaces */
+#define        JAS_CLRSPC_GENRGB       jas_clrspc_create(JAS_CLRSPC_FAM_RGB, 0)
+#define        JAS_CLRSPC_GENGRAY      jas_clrspc_create(JAS_CLRSPC_FAM_GRAY, 0)
+#define        JAS_CLRSPC_GENYCBCR     jas_clrspc_create(JAS_CLRSPC_FAM_YCBCR, 0)
+
+#define        JAS_CLRSPC_CHANIND_YCBCR_Y      0
+#define        JAS_CLRSPC_CHANIND_YCBCR_CB     1
+#define        JAS_CLRSPC_CHANIND_YCBCR_CR     2
+
+#define        JAS_CLRSPC_CHANIND_RGB_R        0
+#define        JAS_CLRSPC_CHANIND_RGB_G        1
+#define        JAS_CLRSPC_CHANIND_RGB_B        2
+
+#define        JAS_CLRSPC_CHANIND_GRAY_Y       0
+
+typedef double jas_cmreal_t;
+
+struct jas_cmpxform_s;
+
+typedef struct {
+       long *buf;
+       int prec;
+       int sgnd;
+       int width;
+       int height;
+} jas_cmcmptfmt_t;
+
+typedef struct {
+       int numcmpts;
+       jas_cmcmptfmt_t *cmptfmts;
+} jas_cmpixmap_t;
+
+typedef struct {
+       void (*destroy)(struct jas_cmpxform_s *pxform);
+       int (*apply)(struct jas_cmpxform_s *pxform, jas_cmreal_t *in, jas_cmreal_t *out, int cnt);
+       void (*dump)(struct jas_cmpxform_s *pxform);
+} jas_cmpxformops_t;
+
+typedef struct {
+       jas_cmreal_t *data;
+       int size;
+} jas_cmshapmatlut_t;
+
+typedef struct {
+       int mono;
+       int order;
+       int useluts;
+       int usemat;
+       jas_cmshapmatlut_t luts[3];
+       jas_cmreal_t mat[3][4];
+} jas_cmshapmat_t;
+
+typedef struct {
+       int order;
+} jas_cmshaplut_t;
+
+typedef struct {
+       int inclrspc;
+       int outclrspc;
+} jas_cmclrspcconv_t;
+
+#define        jas_align_t     double
+
+typedef struct jas_cmpxform_s {
+       int refcnt;
+       jas_cmpxformops_t *ops;
+       int numinchans;
+       int numoutchans;
+       union {
+               jas_align_t dummy;
+               jas_cmshapmat_t shapmat;
+               jas_cmshaplut_t shaplut;
+               jas_cmclrspcconv_t clrspcconv;
+       } data;
+} jas_cmpxform_t;
+
+typedef struct {
+       int numpxforms;
+       int maxpxforms;
+       jas_cmpxform_t **pxforms;
+} jas_cmpxformseq_t;
+
+typedef struct {
+       int numinchans;
+       int numoutchans;
+       jas_cmpxformseq_t *pxformseq;
+} jas_cmxform_t;
+
+#define        JAS_CMPROF_TYPE_DEV     1
+#define        JAS_CMPROF_TYPE_CLRSPC  2
+
+#define        JAS_CMPROF_NUMPXFORMSEQS        13
+
+typedef struct {
+       int clrspc;
+       int numchans;
+       int refclrspc;
+       int numrefchans;
+       jas_iccprof_t *iccprof;
+       jas_cmpxformseq_t *pxformseqs[JAS_CMPROF_NUMPXFORMSEQS];
+} jas_cmprof_t;
+
+/* Create a profile. */
+
+/* Destroy a profile. */
+void jas_cmprof_destroy(jas_cmprof_t *prof);
+
+#if 0
+typedef int_fast32_t jas_cmattrname_t;
+typedef int_fast32_t jas_cmattrval_t;
+typedef int_fast32_t jas_cmattrtype_t;
+/* Load a profile. */
+int jas_cmprof_load(jas_cmprof_t *prof, jas_stream_t *in, int fmt);
+/* Save a profile. */
+int jas_cmprof_save(jas_cmprof_t *prof, jas_stream_t *out, int fmt);
+/* Set an attribute of a profile. */
+int jas_cm_prof_setattr(jas_cm_prof_t *prof, jas_cm_attrname_t name, void *val);
+/* Get an attribute of a profile. */
+void *jas_cm_prof_getattr(jas_cm_prof_t *prof, jas_cm_attrname_t name);
+#endif
+
+jas_cmxform_t *jas_cmxform_create(jas_cmprof_t *inprof, jas_cmprof_t *outprof,
+  jas_cmprof_t *proofprof, int op, int intent, int optimize);
+
+void jas_cmxform_destroy(jas_cmxform_t *xform);
+
+/* Apply a transform to data. */
+int jas_cmxform_apply(jas_cmxform_t *xform, jas_cmpixmap_t *in,
+  jas_cmpixmap_t *out);
+
+int jas_cxform_optimize(jas_cmxform_t *xform, int optimize);
+
+int jas_clrspc_numchans(int clrspc);
+jas_cmprof_t *jas_cmprof_createfromiccprof(jas_iccprof_t *iccprof);
+jas_cmprof_t *jas_cmprof_createfromclrspc(int clrspc);
+jas_iccprof_t *jas_iccprof_createfromcmprof(jas_cmprof_t *prof);
+
+#define        jas_cmprof_clrspc(prof) ((prof)->clrspc)
+jas_cmprof_t *jas_cmprof_copy(jas_cmprof_t *prof);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/libjasper/include/jasper/jas_config.h b/src/libjasper/include/jasper/jas_config.h
new file mode 100644 (file)
index 0000000..987fb81
--- /dev/null
@@ -0,0 +1,173 @@
+/* src/libjasper/include/jasper/jas_config.h.  Generated by configure.  */
+/* src/libjasper/include/jasper/jas_config.h.in.  Generated from configure.ac by autoheader.  */
+
+
+/* Avoid problems due to multiple inclusion. */
+#ifndef JAS_CONFIG_H
+#define JAS_CONFIG_H
+
+/* This preprocessor symbol identifies the version of JasPer. */
+#define        JAS_VERSION "1.900.1"
+/* If configure is being used, this symbol will be defined automatically
+  at this point in the configuration header file. */
+
+/* The preprocessor symbol JAS_WIN_MSVC_BUILD should not be defined
+  unless the JasPer software is being built under Microsoft Windows
+  using Microsoft Visual C. */
+#if !defined(JAS_WIN_MSVC_BUILD)
+/* A configure-based build is being used. */
+
+
+
+/* Extra debugging support */
+/* #undef DEBUG */
+
+/* Debugging memory allocator */
+/* #undef DEBUG_MEMALLOC */
+
+/* Debugging overflow detection */
+/* #undef DEBUG_OVERFLOW */
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define HAVE_DLFCN_H 1
+
+/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
+/* #undef HAVE_DOPRNT */
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#define HAVE_FCNTL_H 1
+
+/* Define to 1 if you have the `getrusage' function. */
+#define HAVE_GETRUSAGE 1
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#define HAVE_GETTIMEOFDAY 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the <io.h> header file. */
+/* #undef HAVE_IO_H */
+
+/* Define to 1 if you have the `m' library (-lm). */
+#define HAVE_LIBM 1
+
+/* Define to 1 if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the <stdbool.h> header file. */
+#define HAVE_STDBOOL_H 1
+
+/* Define to 1 if you have the <stddef.h> header file. */
+#define HAVE_STDDEF_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#define HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Have variable length arrays */
+#define HAVE_VLA 1
+
+/* Define to 1 if you have the `vprintf' function. */
+#define HAVE_VPRINTF 1
+
+/* Define to 1 if you have the <windows.h> header file. */
+/* #undef HAVE_WINDOWS_H */
+
+/* JasPer configure */
+#define JAS_CONFIGURE 1
+
+/* JasPer version */
+#define JAS_VERSION "1.900.1"
+
+/* Name of package */
+#define PACKAGE "jasper"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT ""
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "jasper"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "jasper 1.900.1"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "jasper"
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "1.900.1"
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Version number of package */
+#define VERSION "1.900.1"
+
+/* Define to 1 if the X Window System is missing or not being used. */
+/* #undef X_DISPLAY_MISSING */
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+   calls it, or to nothing if 'inline' is not supported under any name.  */
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+
+/* Define to `long long' if <sys/types.h> does not define. */
+#define longlong long long
+
+/* Define to `unsigned' if <sys/types.h> does not define. */
+/* #undef size_t */
+
+/* Define to `int' if <sys/types.h> does not define. */
+/* #undef ssize_t */
+
+/* Define to `unsigned char' if <sys/types.h> does not define. */
+#define uchar unsigned char
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+/* #undef uint */
+
+/* Define to `unsigned long' if <sys/types.h> does not define. */
+/* #undef ulong */
+
+/* Define to `unsigned long long' if <sys/types.h> does not define. */
+#define ulonglong unsigned long long
+
+/* Define to `unsigned short' if <sys/types.h> does not define. */
+/* #undef ushort */
+
+
+#else
+/* A configure-based build is not being used. */
+#include <jasper/jas_config2.h>
+#endif
+
+#endif
+
diff --git a/src/libjasper/include/jasper/jas_config.h.in b/src/libjasper/include/jasper/jas_config.h.in
new file mode 100644 (file)
index 0000000..a7375de
--- /dev/null
@@ -0,0 +1,172 @@
+/* src/libjasper/include/jasper/jas_config.h.in.  Generated from configure.ac by autoheader.  */
+
+
+/* Avoid problems due to multiple inclusion. */
+#ifndef JAS_CONFIG_H
+#define JAS_CONFIG_H
+
+/* This preprocessor symbol identifies the version of JasPer. */
+#undef JAS_VERSION
+/* If configure is being used, this symbol will be defined automatically
+  at this point in the configuration header file. */
+
+/* The preprocessor symbol JAS_WIN_MSVC_BUILD should not be defined
+  unless the JasPer software is being built under Microsoft Windows
+  using Microsoft Visual C. */
+#if !defined(JAS_WIN_MSVC_BUILD)
+/* A configure-based build is being used. */
+
+
+
+/* Extra debugging support */
+#undef DEBUG
+
+/* Debugging memory allocator */
+#undef DEBUG_MEMALLOC
+
+/* Debugging overflow detection */
+#undef DEBUG_OVERFLOW
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
+#undef HAVE_DOPRNT
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define to 1 if you have the `getrusage' function. */
+#undef HAVE_GETRUSAGE
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#undef HAVE_GETTIMEOFDAY
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <io.h> header file. */
+#undef HAVE_IO_H
+
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
+/* Define to 1 if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <stdbool.h> header file. */
+#undef HAVE_STDBOOL_H
+
+/* Define to 1 if you have the <stddef.h> header file. */
+#undef HAVE_STDDEF_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Have variable length arrays */
+#undef HAVE_VLA
+
+/* Define to 1 if you have the `vprintf' function. */
+#undef HAVE_VPRINTF
+
+/* Define to 1 if you have the <windows.h> header file. */
+#undef HAVE_WINDOWS_H
+
+/* JasPer configure */
+#undef JAS_CONFIGURE
+
+/* JasPer version */
+#undef JAS_VERSION
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
+
+/* Define to 1 if the X Window System is missing or not being used. */
+#undef X_DISPLAY_MISSING
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+   calls it, or to nothing if 'inline' is not supported under any name.  */
+#ifndef __cplusplus
+#undef inline
+#endif
+
+/* Define to `long long' if <sys/types.h> does not define. */
+#undef longlong
+
+/* Define to `unsigned' if <sys/types.h> does not define. */
+#undef size_t
+
+/* Define to `int' if <sys/types.h> does not define. */
+#undef ssize_t
+
+/* Define to `unsigned char' if <sys/types.h> does not define. */
+#undef uchar
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+#undef uint
+
+/* Define to `unsigned long' if <sys/types.h> does not define. */
+#undef ulong
+
+/* Define to `unsigned long long' if <sys/types.h> does not define. */
+#undef ulonglong
+
+/* Define to `unsigned short' if <sys/types.h> does not define. */
+#undef ushort
+
+
+#else
+/* A configure-based build is not being used. */
+#include <jasper/jas_config2.h>
+#endif
+
+#endif
+
diff --git a/src/libjasper/include/jasper/jas_config2.h b/src/libjasper/include/jasper/jas_config2.h
new file mode 100644 (file)
index 0000000..78e8b91
--- /dev/null
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2002-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+#ifndef JAS_CONFIG2_H
+#define        JAS_CONFIG2_H
+
+/*
+ * Configuration for Microsoft Windows and Microsoft Visual C.
+ *
+ * We are not using a configure-based build.
+ * Try to compensate for this here, by specifying the preprocessor symbols
+ * normally defined by configure.
+ */
+
+#define        uchar           unsigned char
+#define        ushort          unsigned short
+#define        uint            unsigned int
+#define        ulong           unsigned long
+#define        longlong        long long
+#define        ulonglong       unsigned long long
+/*#define      ssize_t         int*/
+
+#define        HAVE_FCNTL_H            1
+#define        HAVE_LIMITS_H           1
+#define        HAVE_IO_H               1
+#define        HAVE_WINDOWS_H          1
+#define        HAVE_SYS_TYPES_H        1
+#define        HAVE_STDLIB_H           1
+#define        HAVE_STDDEF_H           1
+
+#endif
diff --git a/src/libjasper/include/jasper/jas_debug.h b/src/libjasper/include/jasper/jas_debug.h
new file mode 100644 (file)
index 0000000..014614b
--- /dev/null
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Debugging-Related Code
+ *
+ * $Id$
+ */
+
+#ifndef JAS_DEBUG_H
+#define JAS_DEBUG_H
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <stdio.h>
+
+#include <jasper/jas_config.h>
+#include "jasper/jas_types.h"
+#include "jasper/jas_debug.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/******************************************************************************\
+* Macros and functions.
+\******************************************************************************/
+
+/* Output debugging information to standard error provided that the debug
+  level is set sufficiently high. */
+#if defined(DEBUG)
+#define        JAS_DBGLOG(n, x) \
+       ((jas_getdbglevel() >= (n)) ? (jas_eprintf x) : 0)
+#else
+#define        JAS_DBGLOG(n, x)
+#endif
+
+/* Get the library debug level. */
+int jas_getdbglevel(void);
+
+/* Set the library debug level. */
+int jas_setdbglevel(int dbglevel);
+
+/* Perform formatted output to standard error. */
+int jas_eprintf(const char *fmt, ...);
+
+/* Dump memory to a stream. */
+int jas_memdump(FILE *out, void *data, size_t len);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/libjasper/include/jasper/jas_fix.h b/src/libjasper/include/jasper/jas_fix.h
new file mode 100644 (file)
index 0000000..f91ce25
--- /dev/null
@@ -0,0 +1,358 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Fixed-Point Number Class
+ *
+ * $Id$
+ */
+
+#ifndef JAS_FIX_H
+#define JAS_FIX_H
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+
+#include <jasper/jas_config.h>
+#include <jasper/jas_types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/******************************************************************************\
+* Constants.
+\******************************************************************************/
+
+/* The representation of the value zero. */
+#define        JAS_FIX_ZERO(fix_t, fracbits) \
+       JAS_CAST(fix_t, 0)
+
+/* The representation of the value one. */
+#define        JAS_FIX_ONE(fix_t, fracbits) \
+       (JAS_CAST(fix_t, 1) << (fracbits))
+
+/* The representation of the value one half. */
+#define        JAS_FIX_HALF(fix_t, fracbits) \
+       (JAS_CAST(fix_t, 1) << ((fracbits) - 1))
+
+/******************************************************************************\
+* Conversion operations.
+\******************************************************************************/
+
+/* Convert an int to a fixed-point number. */
+#define JAS_INTTOFIX(fix_t, fracbits, x) \
+       JAS_CAST(fix_t, (x) << (fracbits))
+
+/* Convert a fixed-point number to an int. */
+#define JAS_FIXTOINT(fix_t, fracbits, x) \
+       JAS_CAST(int, (x) >> (fracbits))
+
+/* Convert a fixed-point number to a double. */
+#define JAS_FIXTODBL(fix_t, fracbits, x) \
+       (JAS_CAST(double, x) / (JAS_CAST(fix_t, 1) << (fracbits)))
+
+/* Convert a double to a fixed-point number. */
+#define JAS_DBLTOFIX(fix_t, fracbits, x) \
+       JAS_CAST(fix_t, ((x) * JAS_CAST(double, JAS_CAST(fix_t, 1) << (fracbits))))
+
+/******************************************************************************\
+* Basic arithmetic operations.
+* All other arithmetic operations are synthesized from these basic operations.
+* There are three macros for each type of arithmetic operation.
+* One macro always performs overflow/underflow checking, one never performs
+* overflow/underflow checking, and one is generic with its behavior
+* depending on compile-time flags.
+* Only the generic macros should be invoked directly by application code.
+\******************************************************************************/
+
+/* Calculate the sum of two fixed-point numbers. */
+#if !defined(DEBUG_OVERFLOW)
+#define JAS_FIX_ADD                    JAS_FIX_ADD_FAST
+#else
+#define JAS_FIX_ADD                    JAS_FIX_ADD_OFLOW
+#endif
+
+/* Calculate the sum of two fixed-point numbers without overflow checking. */
+#define        JAS_FIX_ADD_FAST(fix_t, fracbits, x, y) ((x) + (y))
+
+/* Calculate the sum of two fixed-point numbers with overflow checking. */
+#define        JAS_FIX_ADD_OFLOW(fix_t, fracbits, x, y) \
+       ((x) >= 0) ? \
+         (((y) >= 0) ? ((x) + (y) >= 0 || JAS_FIX_OFLOW(), (x) + (y)) : \
+         ((x) + (y))) : \
+         (((y) >= 0) ? ((x) + (y)) : ((x) + (y) < 0 || JAS_FIX_OFLOW(), \
+         (x) + (y)))
+
+/* Calculate the product of two fixed-point numbers. */
+#if !defined(DEBUG_OVERFLOW)
+#define JAS_FIX_MUL                    JAS_FIX_MUL_FAST
+#else
+#define JAS_FIX_MUL                    JAS_FIX_MUL_OFLOW
+#endif
+
+/* Calculate the product of two fixed-point numbers without overflow
+  checking. */
+#define        JAS_FIX_MUL_FAST(fix_t, fracbits, bigfix_t, x, y) \
+       JAS_CAST(fix_t, (JAS_CAST(bigfix_t, x) * JAS_CAST(bigfix_t, y)) >> \
+         (fracbits))
+
+/* Calculate the product of two fixed-point numbers with overflow
+  checking. */
+#define JAS_FIX_MUL_OFLOW(fix_t, fracbits, bigfix_t, x, y) \
+       ((JAS_CAST(bigfix_t, x) * JAS_CAST(bigfix_t, y) >> (fracbits)) == \
+         JAS_CAST(fix_t, (JAS_CAST(bigfix_t, x) * JAS_CAST(bigfix_t, y) >> \
+         (fracbits))) ? \
+         JAS_CAST(fix_t, (JAS_CAST(bigfix_t, x) * JAS_CAST(bigfix_t, y) >> \
+         (fracbits))) : JAS_FIX_OFLOW())
+
+/* Calculate the product of a fixed-point number and an int. */
+#if !defined(DEBUG_OVERFLOW)
+#define        JAS_FIX_MULBYINT        JAS_FIX_MULBYINT_FAST
+#else
+#define        JAS_FIX_MULBYINT        JAS_FIX_MULBYINT_OFLOW
+#endif
+
+/* Calculate the product of a fixed-point number and an int without overflow
+  checking. */
+#define        JAS_FIX_MULBYINT_FAST(fix_t, fracbits, x, y) \
+       JAS_CAST(fix_t, ((x) * (y)))
+
+/* Calculate the product of a fixed-point number and an int with overflow
+  checking. */
+#define        JAS_FIX_MULBYINT_OFLOW(fix_t, fracbits, x, y) \
+       JAS_FIX_MULBYINT_FAST(fix_t, fracbits, x, y)
+
+/* Calculate the quotient of two fixed-point numbers. */
+#if !defined(DEBUG_OVERFLOW)
+#define JAS_FIX_DIV                    JAS_FIX_DIV_FAST
+#else
+#define JAS_FIX_DIV                    JAS_FIX_DIV_UFLOW
+#endif
+
+/* Calculate the quotient of two fixed-point numbers without underflow
+  checking. */
+#define        JAS_FIX_DIV_FAST(fix_t, fracbits, bigfix_t, x, y) \
+       JAS_CAST(fix_t, (JAS_CAST(bigfix_t, x) << (fracbits)) / (y))
+
+/* Calculate the quotient of two fixed-point numbers with underflow
+  checking. */
+#define JAS_FIX_DIV_UFLOW(fix_t, fracbits, bigfix_t, x, y) \
+       JAS_FIX_DIV_FAST(fix_t, fracbits, bigfix_t, x, y)
+
+/* Negate a fixed-point number. */
+#if !defined(DEBUG_OVERFLOW)
+#define        JAS_FIX_NEG                     JAS_FIX_NEG_FAST
+#else
+#define        JAS_FIX_NEG                     JAS_FIX_NEG_OFLOW
+#endif
+
+/* Negate a fixed-point number without overflow checking. */
+#define        JAS_FIX_NEG_FAST(fix_t, fracbits, x) \
+       (-(x))
+
+/* Negate a fixed-point number with overflow checking. */
+/* Yes, overflow is actually possible for two's complement representations,
+  although highly unlikely to occur. */
+#define        JAS_FIX_NEG_OFLOW(fix_t, fracbits, x) \
+       (((x) < 0) ? (-(x) > 0 || JAS_FIX_OFLOW(), -(x)) : (-(x)))
+
+/* Perform an arithmetic shift left of a fixed-point number. */
+#if !defined(DEBUG_OVERFLOW)
+#define        JAS_FIX_ASL                     JAS_FIX_ASL_FAST
+#else
+#define        JAS_FIX_ASL                     JAS_FIX_ASL_OFLOW
+#endif
+
+/* Perform an arithmetic shift left of a fixed-point number without overflow
+  checking. */
+#define        JAS_FIX_ASL_FAST(fix_t, fracbits, x, n) \
+       ((x) << (n))
+
+/* Perform an arithmetic shift left of a fixed-point number with overflow
+  checking. */
+#define        JAS_FIX_ASL_OFLOW(fix_t, fracbits, x, n) \
+       ((((x) << (n)) >> (n)) == (x) || JAS_FIX_OFLOW(), (x) << (n))
+
+/* Perform an arithmetic shift right of a fixed-point number. */
+#if !defined(DEBUG_OVERFLOW)
+#define        JAS_FIX_ASR                     JAS_FIX_ASR_FAST
+#else
+#define        JAS_FIX_ASR                     JAS_FIX_ASR_UFLOW
+#endif
+
+/* Perform an arithmetic shift right of a fixed-point number without underflow
+  checking. */
+#define        JAS_FIX_ASR_FAST(fix_t, fracbits, x, n) \
+       ((x) >> (n))
+
+/* Perform an arithmetic shift right of a fixed-point number with underflow
+  checking. */
+#define        JAS_FIX_ASR_UFLOW(fix_t, fracbits, x, n) \
+       JAS_FIX_ASR_FAST(fix_t, fracbits, x, n)
+
+/******************************************************************************\
+* Other basic arithmetic operations.
+\******************************************************************************/
+
+/* Calculate the difference between two fixed-point numbers. */
+#define JAS_FIX_SUB(fix_t, fracbits, x, y) \
+       JAS_FIX_ADD(fix_t, fracbits, x, JAS_FIX_NEG(fix_t, fracbits, y))
+
+/* Add one fixed-point number to another. */
+#define JAS_FIX_PLUSEQ(fix_t, fracbits, x, y) \
+       ((x) = JAS_FIX_ADD(fix_t, fracbits, x, y))
+
+/* Subtract one fixed-point number from another. */
+#define JAS_FIX_MINUSEQ(fix_t, fracbits, x, y) \
+       ((x) = JAS_FIX_SUB(fix_t, fracbits, x, y))
+
+/* Multiply one fixed-point number by another. */
+#define        JAS_FIX_MULEQ(fix_t, fracbits, bigfix_t, x, y) \
+       ((x) = JAS_FIX_MUL(fix_t, fracbits, bigfix_t, x, y))
+
+/******************************************************************************\
+* Miscellaneous operations.
+\******************************************************************************/
+
+/* Calculate the absolute value of a fixed-point number. */
+#define        JAS_FIX_ABS(fix_t, fracbits, x) \
+       (((x) >= 0) ? (x) : (JAS_FIX_NEG(fix_t, fracbits, x)))
+
+/* Is a fixed-point number an integer? */
+#define        JAS_FIX_ISINT(fix_t, fracbits, x) \
+       (JAS_FIX_FLOOR(fix_t, fracbits, x) == (x))
+
+/* Get the sign of a fixed-point number. */
+#define JAS_FIX_SGN(fix_t, fracbits, x) \
+       ((x) >= 0 ? 1 : (-1))
+
+/******************************************************************************\
+* Relational operations.
+\******************************************************************************/
+
+/* Compare two fixed-point numbers. */
+#define JAS_FIX_CMP(fix_t, fracbits, x, y) \
+       ((x) > (y) ? 1 : (((x) == (y)) ? 0 : (-1)))
+
+/* Less than. */
+#define        JAS_FIX_LT(fix_t, fracbits, x, y) \
+       ((x) < (y))
+
+/* Less than or equal. */
+#define        JAS_FIX_LTE(fix_t, fracbits, x, y) \
+       ((x) <= (y))
+
+/* Greater than. */
+#define        JAS_FIX_GT(fix_t, fracbits, x, y) \
+       ((x) > (y))
+
+/* Greater than or equal. */
+#define        JAS_FIX_GTE(fix_t, fracbits, x, y) \
+       ((x) >= (y))
+
+/******************************************************************************\
+* Rounding functions.
+\******************************************************************************/
+
+/* Round a fixed-point number to the nearest integer. */
+#define        JAS_FIX_ROUND(fix_t, fracbits, x) \
+       (((x) < 0) ? JAS_FIX_FLOOR(fix_t, fracbits, JAS_FIX_ADD(fix_t, fracbits, \
+         (x), JAS_FIX_HALF(fix_t, fracbits))) : \
+         JAS_FIX_NEG(fix_t, fracbits, JAS_FIX_FLOOR(fix_t, fracbits, \
+         JAS_FIX_ADD(fix_t, fracbits, (-(x)), JAS_FIX_HALF(fix_t, fracbits)))))
+
+/* Round a fixed-point number to the nearest integer in the direction of
+  negative infinity (i.e., the floor function). */
+#define        JAS_FIX_FLOOR(fix_t, fracbits, x) \
+       ((x) & (~((JAS_CAST(fix_t, 1) << (fracbits)) - 1)))
+
+/* Round a fixed-point number to the nearest integer in the direction
+  of zero. */
+#define JAS_FIX_TRUNC(fix_t, fracbits, x) \
+       (((x) >= 0) ? JAS_FIX_FLOOR(fix_t, fracbits, x) : \
+         JAS_FIX_CEIL(fix_t, fracbits, x))
+
+/******************************************************************************\
+* The below macros are for internal library use only.  Do not invoke them
+* directly in application code.
+\******************************************************************************/
+
+/* Handle overflow. */
+#define        JAS_FIX_OFLOW() \
+       jas_eprintf("overflow error: file %s, line %d\n", __FILE__, __LINE__)
+
+/* Handle underflow. */
+#define        JAS_FIX_UFLOW() \
+       jas_eprintf("underflow error: file %s, line %d\n", __FILE__, __LINE__)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/libjasper/include/jasper/jas_getopt.h b/src/libjasper/include/jasper/jas_getopt.h
new file mode 100644 (file)
index 0000000..3c7b205
--- /dev/null
@@ -0,0 +1,131 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Command Line Option Parsing Code
+ *
+ * $Id$
+ */
+
+#ifndef JAS_GETOPT_H
+#define JAS_GETOPT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <jasper/jas_config.h>
+
+/******************************************************************************\
+* Constants.
+\******************************************************************************/
+
+#define        JAS_GETOPT_EOF  (-1)
+#define        JAS_GETOPT_ERR  '?'
+
+/* option flags. */
+#define        JAS_OPT_HASARG  0x01    /* option has argument */
+
+/******************************************************************************\
+* Types.
+\******************************************************************************/
+
+/* Command line option type. */
+typedef struct {
+
+       int id;
+       /* The unique identifier for this option. */
+
+       char *name;
+       /* The name of this option. */
+
+       int flags;
+       /* option flags. */
+
+} jas_opt_t;
+
+/******************************************************************************\
+* External data.
+\******************************************************************************/
+
+/* The current option index. */
+extern int jas_optind;
+
+/* The current option argument. */
+extern char *jas_optarg;
+
+/* The debug level. */
+extern int jas_opterr;
+
+/******************************************************************************\
+* Prototypes.
+\******************************************************************************/
+
+/* Get the next option. */
+int jas_getopt(int argc, char **argv, jas_opt_t *opts);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/libjasper/include/jasper/jas_icc.h b/src/libjasper/include/jasper/jas_icc.h
new file mode 100644 (file)
index 0000000..616a572
--- /dev/null
@@ -0,0 +1,407 @@
+/*
+ * Copyright (c) 2002-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+#ifndef JAS_ICC_H
+#define        JAS_ICC_H
+
+#include <jasper/jas_config.h>
+#include <jasper/jas_types.h>
+#include <jasper/jas_stream.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Profile file signature. */
+#define        JAS_ICC_MAGIC           0x61637370
+
+#define        JAS_ICC_HDRLEN  128
+
+/* Profile/device class signatures. */
+#define        JAS_ICC_CLAS_IN 0x73636e72 /* input device */
+#define        JAS_ICC_CLAS_DPY        0x6d6e7472 /* display device */
+#define        JAS_ICC_CLAS_OUT        0x70727472 /* output device */
+#define        JAS_ICC_CLAS_LNK        0x6c696e6b /* device link */
+#define        JAS_ICC_CLAS_CNV        0x73706163 /* color space conversion */
+#define        JAS_ICC_CLAS_ABS        0x61627374 /* abstract */
+#define        JAS_ICC_CLAS_NAM        0x6e6d636c /* named color */
+
+/* Color space signatures. */
+#define        JAS_ICC_COLORSPC_XYZ    0x58595a20 /* XYZ */
+#define        JAS_ICC_COLORSPC_LAB    0x4c616220 /* LAB */
+#define        JAS_ICC_COLORSPC_LUV    0x4c757620 /* LUV */
+#define        JAS_ICC_COLORSPC_YCBCR  0x59436272 /* YCbCr */
+#define        JAS_ICC_COLORSPC_YXY    0x59787920 /* Yxy */
+#define        JAS_ICC_COLORSPC_RGB    0x52474220 /* RGB */
+#define        JAS_ICC_COLORSPC_GRAY   0x47524159 /* Gray */
+#define        JAS_ICC_COLORSPC_HSV    0x48535620 /* HSV */
+#define        JAS_ICC_COLORSPC_HLS    0x484c5320 /* HLS */
+#define        JAS_ICC_COLORSPC_CMYK   0x434d594b /* CMYK */
+#define        JAS_ICC_COLORSPC_CMY    0x434d5920 /* CMY */
+#define        JAS_ICC_COLORSPC_2      0x32434c52 /* 2 channel color */
+#define        JAS_ICC_COLORSPC_3      0x33434c52 /* 3 channel color */
+#define        JAS_ICC_COLORSPC_4      0x34434c52 /* 4 channel color */
+#define        JAS_ICC_COLORSPC_5      0x35434c52 /* 5 channel color */
+#define        JAS_ICC_COLORSPC_6      0x36434c52 /* 6 channel color */
+#define        JAS_ICC_COLORSPC_7      0x37434c52 /* 7 channel color */
+#define        JAS_ICC_COLORSPC_8      0x38434c52 /* 8 channel color */
+#define        JAS_ICC_COLORSPC_9      0x39434c52 /* 9 channel color */
+#define        JAS_ICC_COLORSPC_10     0x41434c52 /* 10 channel color */
+#define        JAS_ICC_COLORSPC_11     0x42434c52 /* 11 channel color */
+#define        JAS_ICC_COLORSPC_12     0x43434c52 /* 12 channel color */
+#define        JAS_ICC_COLORSPC_13     0x44434c52 /* 13 channel color */
+#define        JAS_ICC_COLORSPC_14     0x45434c52 /* 14 channel color */
+#define        JAS_ICC_COLORSPC_15     0x46434c52 /* 15 channel color */
+
+/* Profile connection color space (PCS) signatures. */
+#define        JAS_ICC_REFCOLORSPC_XYZ         0x58595a20 /* CIE XYZ */
+#define        JAS_ICC_REFCOLORSPC_LAB         0x4c616220 /* CIE Lab */
+
+/* Primary platform signatures. */
+#define        JAS_ICC_PLATFORM_APPL   0x4150504c /* Apple Computer */
+#define        JAS_ICC_PLATFORM_MSFT   0x4d534654 /* Microsoft */
+#define        JAS_ICC_PLATFORM_SGI    0x53474920 /* Silicon Graphics */
+#define        JAS_ICC_PLATFORM_SUNW   0x53554e57 /* Sun Microsystems */
+#define        JAS_ICC_PLATFORM_TGNT   0x54474e54 /* Taligent */
+
+/* Profile flags. */
+#define        JAS_ICC_FLAGS_EMBED     0x01 /* embedded */
+#define        JAS_ICC_FLAGS_NOSEP     0x02 /* no separate use */
+
+/* Attributes. */
+#define        JAS_ICC_ATTR_TRANS      0x01 /* transparent */
+#define        JAS_ICC_ATTR_MATTE      0x02 /* matte */
+
+/* Rendering intents. */
+#define        JAS_ICC_INTENT_PER      0 /* perceptual */
+#define        JAS_ICC_INTENT_REL      1 /* relative colorimetric */
+#define        JAS_ICC_INTENT_SAT      2 /* saturation */
+#define        JAS_ICC_INTENT_ABS      3 /* absolute colorimetric */
+
+/* Tag signatures. */
+#define        JAS_ICC_TAG_ATOB0               0x41324230 /* */
+#define        JAS_ICC_TAG_ATOB1               0x41324231 /* */
+#define        JAS_ICC_TAG_ATOB2               0x41324232 /* */
+#define        JAS_ICC_TAG_BLUMATCOL           0x6258595a /* */
+#define        JAS_ICC_TAG_BLUTRC              0x62545243 /* */
+#define        JAS_ICC_TAG_BTOA0               0x42324130 /* */
+#define        JAS_ICC_TAG_BTOA1               0x42324131 /* */
+#define        JAS_ICC_TAG_BTOA2               0x42324132 /* */
+#define        JAS_ICC_TAG_CALTIME             0x63616c74 /* */
+#define        JAS_ICC_TAG_CHARTARGET          0x74617267 /* */
+#define        JAS_ICC_TAG_CPYRT               0x63707274 /* */
+#define        JAS_ICC_TAG_CRDINFO             0x63726469 /* */
+#define        JAS_ICC_TAG_DEVMAKERDESC        0x646d6e64 /* */
+#define        JAS_ICC_TAG_DEVMODELDESC        0x646d6464 /* */
+#define        JAS_ICC_TAG_DEVSET              0x64657673 /* */
+#define        JAS_ICC_TAG_GAMUT               0x67616d74 /* */
+#define        JAS_ICC_TAG_GRYTRC              0x6b545243 /* */
+#define        JAS_ICC_TAG_GRNMATCOL           0x6758595a /* */
+#define        JAS_ICC_TAG_GRNTRC              0x67545243 /* */
+#define        JAS_ICC_TAG_LUM                 0x6c756d69 /* */
+#define        JAS_ICC_TAG_MEASURE             0x6d656173 /* */
+#define        JAS_ICC_TAG_MEDIABLKPT          0x626b7074 /* */
+#define        JAS_ICC_TAG_MEDIAWHIPT          0x77747074 /* */
+#define        JAS_ICC_TAG_NAMCOLR             0x6e636f6c /* */
+#define        JAS_ICC_TAG_NAMCOLR2            0x6e636c32 /* */
+#define        JAS_ICC_TAG_OUTRESP             0x72657370 /* */
+#define        JAS_ICC_TAG_PREVIEW0            0x70726530 /* */
+#define        JAS_ICC_TAG_PREVIEW1            0x70726531 /* */
+#define        JAS_ICC_TAG_PREVIEW2            0x70726532 /* */
+#define        JAS_ICC_TAG_PROFDESC            0x64657363 /* */
+#define        JAS_ICC_TAG_PROFSEQDESC         0x70736571 /* */
+#define        JAS_ICC_TAG_PSDCRD0             0x70736430 /* */
+#define        JAS_ICC_TAG_PSCRDD1             0x70736431 /* */
+#define        JAS_ICC_TAG_PSCRDD2             0x70736432 /* */
+#define        JAS_ICC_TAG_PSCRDD3             0x70736433 /* */
+#define        JAS_ICC_TAG_PS2CSA              0x70733273 /* */
+#define        JAS_ICC_TAG_PS2RENINTENT        0x70733269 /* */
+#define        JAS_ICC_TAG_REDMATCOL           0x7258595a /* */
+#define        JAS_ICC_TAG_REDTRC              0x72545243 /* */
+#define        JAS_ICC_TAG_SCRNGDES            0x73637264 /* */
+#define        JAS_ICC_TAG_SCRNG               0x7363726e /* */
+#define        JAS_ICC_TAG_TECH                0x74656368 /* */
+#define        JAS_ICC_TAG_UCRBG               0x62666420 /* */
+#define        JAS_ICC_TAG_VIEWCONDDESC        0x76756564 /* */
+#define        JAS_ICC_TAG_VIEWCOND            0x76696577 /* */
+
+/* Type signatures. */
+#define        JAS_ICC_TYPE_CRDINFO            0x63726469 /* CRD information */
+#define        JAS_ICC_TYPE_CURV               0x63757276 /* curve */
+#define        JAS_ICC_TYPE_DATA               0x64617461 /* data */
+#define        JAS_ICC_TYPE_TIME               0x6474696d /* date/time */
+#define        JAS_ICC_TYPE_DEVSET             0x64657673 /* device settings */
+#define        JAS_ICC_TYPE_LUT16              0x6d667432 /* */
+#define        JAS_ICC_TYPE_LUT8               0x6d667431 /* */
+#define        JAS_ICC_TYPE_MEASURE            0x6d656173 /* */
+#define        JAS_ICC_TYPE_NAMCOLR            0x6e636f6c /* */
+#define        JAS_ICC_TYPE_NAMCOLR2           0x6e636c32 /* */
+#define        JAS_ICC_TYPE_PROFSEQDESC        0x70736571 /* profile sequence description */
+#define        JAS_ICC_TYPE_RESPCURVSET16      0x72637332 /* response curve set 16 */
+#define        JAS_ICC_TYPE_SF32               0x73663332 /* signed 32-bit fixed-point */
+#define        JAS_ICC_TYPE_SCRNG              0x7363726e /* screening */
+#define        JAS_ICC_TYPE_SIG                0x73696720 /* signature */
+#define        JAS_ICC_TYPE_TXTDESC            0x64657363 /* text description */
+#define        JAS_ICC_TYPE_TXT                0x74657874 /* text */
+#define        JAS_ICC_TYPE_UF32               0x75663332 /* unsigned 32-bit fixed-point */
+#define        JAS_ICC_TYPE_UCRBG              0x62666420 /* */
+#define        JAS_ICC_TYPE_UI16               0x75693136 /* */
+#define        JAS_ICC_TYPE_UI32               0x75693332 /* */
+#define        JAS_ICC_TYPE_UI8                0x75693038 /* */
+#define        JAS_ICC_TYPE_UI64               0x75693634 /* */
+#define        JAS_ICC_TYPE_VIEWCOND           0x76696577 /* */
+#define        JAS_ICC_TYPE_XYZ                0x58595a20 /* XYZ */
+
+typedef uint_fast8_t jas_iccuint8_t;
+typedef uint_fast16_t jas_iccuint16_t;
+typedef uint_fast32_t jas_iccuint32_t;
+typedef int_fast32_t jas_iccsint32_t;
+typedef int_fast32_t jas_iccs15fixed16_t;
+typedef uint_fast32_t jas_iccu16fixed16_t;
+typedef uint_fast64_t jas_iccuint64_t;
+typedef uint_fast32_t jas_iccsig_t;
+
+typedef jas_iccsig_t jas_icctagsig_t;
+typedef jas_iccsig_t jas_icctagtype_t;
+typedef jas_iccsig_t jas_iccattrname_t;
+
+/* Date/time type. */
+typedef struct {
+       jas_iccuint16_t year;
+       jas_iccuint16_t month;
+       jas_iccuint16_t day;
+       jas_iccuint16_t hour;
+       jas_iccuint16_t min;
+       jas_iccuint16_t sec;
+} jas_icctime_t;
+
+/* XYZ type. */
+typedef struct {
+       jas_iccs15fixed16_t x;
+       jas_iccs15fixed16_t y;
+       jas_iccs15fixed16_t z;
+} jas_iccxyz_t;
+
+/* Curve type. */
+typedef struct {
+       jas_iccuint32_t numents;
+       jas_iccuint16_t *ents;
+} jas_icccurv_t;
+
+/* Text description type. */
+typedef struct {
+       jas_iccuint32_t asclen;
+       char *ascdata; /* ASCII invariant description */
+       jas_iccuint32_t uclangcode; /* Unicode language code */
+       jas_iccuint32_t uclen; /* Unicode localizable description count */
+       uchar *ucdata; /* Unicode localizable description */
+       jas_iccuint16_t sccode; /* ScriptCode code */
+       jas_iccuint8_t maclen; /* Localizable Macintosh description count */
+       uchar macdata[69]; /* Localizable Macintosh description */
+} jas_icctxtdesc_t;
+
+/* Text type. */
+typedef struct {
+       char *string;   /* ASCII character string */
+} jas_icctxt_t;
+
+typedef struct {
+       jas_iccuint8_t numinchans;
+       jas_iccuint8_t numoutchans;
+       jas_iccsint32_t e[3][3];
+       jas_iccuint8_t clutlen;
+       jas_iccuint8_t *clut;
+       jas_iccuint16_t numintabents;
+       jas_iccuint8_t **intabs;
+       jas_iccuint8_t *intabsbuf;
+       jas_iccuint16_t numouttabents;
+       jas_iccuint8_t **outtabs;
+       jas_iccuint8_t *outtabsbuf;
+} jas_icclut8_t;
+
+typedef struct {
+       jas_iccuint8_t numinchans;
+       jas_iccuint8_t numoutchans;
+       jas_iccsint32_t e[3][3];
+       jas_iccuint8_t clutlen;
+       jas_iccuint16_t *clut;
+       jas_iccuint16_t numintabents;
+       jas_iccuint16_t **intabs;
+       jas_iccuint16_t *intabsbuf;
+       jas_iccuint16_t numouttabents;
+       jas_iccuint16_t **outtabs;
+       jas_iccuint16_t *outtabsbuf;
+} jas_icclut16_t;
+
+struct jas_iccattrval_s;
+
+typedef struct {
+       void (*destroy)(struct jas_iccattrval_s *);
+       int (*copy)(struct jas_iccattrval_s *, struct jas_iccattrval_s *);
+       int (*input)(struct jas_iccattrval_s *, jas_stream_t *, int);
+       int (*output)(struct jas_iccattrval_s *, jas_stream_t *);
+       int (*getsize)(struct jas_iccattrval_s *);
+       void (*dump)(struct jas_iccattrval_s *, FILE *);
+} jas_iccattrvalops_t;
+
+/* Attribute value type (type and value information). */
+typedef struct jas_iccattrval_s {
+       int refcnt; /* reference count */
+       jas_iccsig_t type; /* type */
+       jas_iccattrvalops_t *ops; /* type-dependent operations */
+       union {
+               jas_iccxyz_t xyz;
+               jas_icccurv_t curv;
+               jas_icctxtdesc_t txtdesc;
+               jas_icctxt_t txt;
+               jas_icclut8_t lut8;
+               jas_icclut16_t lut16;
+       } data; /* value */
+} jas_iccattrval_t;
+
+/* Header type. */
+typedef struct {
+       jas_iccuint32_t size; /* profile size */
+       jas_iccsig_t cmmtype; /* CMM type signature */
+       jas_iccuint32_t version; /* profile version */
+       jas_iccsig_t clas; /* profile/device class signature */
+       jas_iccsig_t colorspc; /* color space of data */
+       jas_iccsig_t refcolorspc; /* profile connection space */
+       jas_icctime_t ctime; /* creation time */
+       jas_iccsig_t magic; /* profile file signature */
+       jas_iccsig_t platform; /* primary platform */
+       jas_iccuint32_t flags; /* profile flags */
+       jas_iccsig_t maker; /* device manufacturer signature */
+       jas_iccsig_t model; /* device model signature */
+       jas_iccuint64_t attr; /* device setup attributes */
+       jas_iccsig_t intent; /* rendering intent */
+       jas_iccxyz_t illum; /* illuminant */
+       jas_iccsig_t creator; /* profile creator signature */
+} jas_icchdr_t;
+
+typedef struct {
+       jas_iccsig_t name;
+       jas_iccattrval_t *val;
+} jas_iccattr_t;
+
+typedef struct {
+       int numattrs;
+       int maxattrs;
+       jas_iccattr_t *attrs;
+} jas_iccattrtab_t;
+
+typedef struct jas_icctagtabent_s {
+       jas_iccuint32_t tag;
+       jas_iccuint32_t off;
+       jas_iccuint32_t len;
+       void *data;
+       struct jas_icctagtabent_s *first;
+} jas_icctagtabent_t;
+
+typedef struct {
+       jas_iccuint32_t numents;
+       jas_icctagtabent_t *ents;
+} jas_icctagtab_t;
+
+/* ICC profile type. */
+typedef struct {
+       jas_icchdr_t hdr;
+       jas_icctagtab_t tagtab;
+       jas_iccattrtab_t *attrtab;
+} jas_iccprof_t;
+
+typedef struct {
+       jas_iccuint32_t type;
+       jas_iccattrvalops_t ops;
+} jas_iccattrvalinfo_t;
+
+jas_iccprof_t *jas_iccprof_load(jas_stream_t *in);
+int jas_iccprof_save(jas_iccprof_t *prof, jas_stream_t *out);
+void jas_iccprof_destroy(jas_iccprof_t *prof);
+jas_iccattrval_t *jas_iccprof_getattr(jas_iccprof_t *prof,
+  jas_iccattrname_t name);
+int jas_iccprof_setattr(jas_iccprof_t *prof, jas_iccattrname_t name,
+  jas_iccattrval_t *val);
+void jas_iccprof_dump(jas_iccprof_t *prof, FILE *out);
+jas_iccprof_t *jas_iccprof_copy(jas_iccprof_t *prof);
+int jas_iccprof_gethdr(jas_iccprof_t *prof, jas_icchdr_t *hdr);
+int jas_iccprof_sethdr(jas_iccprof_t *prof, jas_icchdr_t *hdr);
+
+void jas_iccattrval_destroy(jas_iccattrval_t *attrval);
+void jas_iccattrval_dump(jas_iccattrval_t *attrval, FILE *out);
+int jas_iccattrval_allowmodify(jas_iccattrval_t **attrval);
+jas_iccattrval_t *jas_iccattrval_clone(jas_iccattrval_t *attrval);
+jas_iccattrval_t *jas_iccattrval_create(jas_iccuint32_t type);
+
+void jas_iccattrtab_dump(jas_iccattrtab_t *attrtab, FILE *out);
+
+extern uchar jas_iccprofdata_srgb[];
+extern int jas_iccprofdata_srgblen;
+extern uchar jas_iccprofdata_sgray[];
+extern int jas_iccprofdata_sgraylen;
+jas_iccprof_t *jas_iccprof_createfrombuf(uchar *buf, int len);
+jas_iccprof_t *jas_iccprof_createfromclrspc(int clrspc);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/libjasper/include/jasper/jas_image.h b/src/libjasper/include/jasper/jas_image.h
new file mode 100644 (file)
index 0000000..3ccb749
--- /dev/null
@@ -0,0 +1,564 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Image Class
+ *
+ * $Id$
+ */
+
+#ifndef JAS_IMAGE_H
+#define JAS_IMAGE_H
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <jasper/jas_config.h>
+#include <jasper/jas_stream.h>
+#include <jasper/jas_seq.h>
+#include <jasper/jas_cm.h>
+#include <stdio.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/******************************************************************************\
+* Constants.
+\******************************************************************************/
+
+/*
+ * Miscellaneous constants.
+ */
+
+/* The threshold at which image data is no longer stored in memory. */
+#define JAS_IMAGE_INMEMTHRESH  (16 * 1024 * 1024)
+
+/*
+ * Component types
+ */
+
+#define        JAS_IMAGE_CT_UNKNOWN    0x10000
+#define        JAS_IMAGE_CT_COLOR(n)   ((n) & 0x7fff)
+#define        JAS_IMAGE_CT_OPACITY    0x08000
+
+#define        JAS_IMAGE_CT_RGB_R      0
+#define        JAS_IMAGE_CT_RGB_G      1
+#define        JAS_IMAGE_CT_RGB_B      2
+
+#define        JAS_IMAGE_CT_YCBCR_Y    0
+#define        JAS_IMAGE_CT_YCBCR_CB   1
+#define        JAS_IMAGE_CT_YCBCR_CR   2
+
+#define        JAS_IMAGE_CT_GRAY_Y     0
+
+/******************************************************************************\
+* Simple types.
+\******************************************************************************/
+
+/* Image coordinate. */
+typedef int_fast32_t jas_image_coord_t;
+
+/* Color space (e.g., RGB, YCbCr). */
+typedef int_fast16_t jas_image_colorspc_t;
+
+/* Component type (e.g., color, opacity). */
+typedef int_fast32_t jas_image_cmpttype_t;
+
+/* Component sample data format (e.g., real/integer, signedness, precision). */
+typedef int_fast16_t jas_image_smpltype_t;
+
+/******************************************************************************\
+* Image class and supporting classes.
+\******************************************************************************/
+
+/* Image component class. */
+
+typedef struct {
+
+       jas_image_coord_t tlx_;
+       /* The x-coordinate of the top-left corner of the component. */
+
+       jas_image_coord_t tly_;
+       /* The y-coordinate of the top-left corner of the component. */
+
+       jas_image_coord_t hstep_;
+       /* The horizontal sampling period in units of the reference grid. */
+
+       jas_image_coord_t vstep_;
+       /* The vertical sampling period in units of the reference grid. */
+
+       jas_image_coord_t width_;
+       /* The component width in samples. */
+
+       jas_image_coord_t height_;
+       /* The component height in samples. */
+
+#ifdef FIX_ME
+       int smpltype_;
+#else
+       int prec_;
+       /* The precision of the sample data (i.e., the number of bits per
+       sample).  If the samples are signed values, this quantity
+       includes the sign bit. */
+
+       int sgnd_;
+       /* The signedness of the sample data. */
+#endif
+
+       jas_stream_t *stream_;
+       /* The stream containing the component data. */
+
+       int cps_;
+       /* The number of characters per sample in the stream. */
+
+       jas_image_cmpttype_t type_;
+       /* The type of component (e.g., opacity, red, green, blue, luma). */
+
+} jas_image_cmpt_t;
+
+/* Image class. */
+
+typedef struct {
+
+       jas_image_coord_t tlx_;
+       /* The x-coordinate of the top-left corner of the image bounding box. */
+
+       jas_image_coord_t tly_;
+       /* The y-coordinate of the top-left corner of the image bounding box. */
+
+       jas_image_coord_t brx_;
+       /* The x-coordinate of the bottom-right corner of the image bounding
+         box (plus one). */
+
+       jas_image_coord_t bry_;
+       /* The y-coordinate of the bottom-right corner of the image bounding
+         box (plus one). */
+
+       int numcmpts_;
+       /* The number of components. */
+
+       int maxcmpts_;
+       /* The maximum number of components that this image can have (i.e., the
+         allocated size of the components array). */
+
+       jas_image_cmpt_t **cmpts_;
+       /* Per-component information. */
+
+       jas_clrspc_t clrspc_;
+
+       jas_cmprof_t *cmprof_;
+
+       bool inmem_;
+
+} jas_image_t;
+
+/* Component parameters class. */
+/* This data type exists solely/mainly for the purposes of the
+  jas_image_create function. */
+
+typedef struct {
+
+       jas_image_coord_t tlx;
+       /* The x-coordinate of the top-left corner of the component. */
+
+       jas_image_coord_t tly;
+       /* The y-coordinate of the top-left corner of the component. */
+
+       jas_image_coord_t hstep;
+       /* The horizontal sampling period in units of the reference grid. */
+
+       jas_image_coord_t vstep;
+       /* The vertical sampling period in units of the reference grid. */
+
+       jas_image_coord_t width;
+       /* The width of the component in samples. */
+
+       jas_image_coord_t height;
+       /* The height of the component in samples. */
+
+#ifdef FIX_ME
+       int smpltype;
+#else
+       int prec;
+       /* The precision of the component sample data. */
+
+       int sgnd;
+       /* The signedness of the component sample data. */
+#endif
+
+} jas_image_cmptparm_t;
+
+/******************************************************************************\
+* File format related classes.
+\******************************************************************************/
+
+#define        JAS_IMAGE_MAXFMTS       32
+/* The maximum number of image data formats supported. */
+
+/* Image format-dependent operations. */
+
+typedef struct {
+
+       jas_image_t *(*decode)(jas_stream_t *in, char *opts);
+       /* Decode image data from a stream. */
+
+       int (*encode)(jas_image_t *image, jas_stream_t *out, char *opts);
+       /* Encode image data to a stream. */
+
+       int (*validate)(jas_stream_t *in);
+       /* Determine if stream data is in a particular format. */
+
+} jas_image_fmtops_t;
+
+/* Image format information. */
+
+typedef struct {
+
+       int id;
+       /* The ID for this format. */
+
+       char *name;
+       /* The name by which this format is identified. */
+
+       char *ext;
+       /* The file name extension associated with this format. */
+
+       char *desc;
+       /* A brief description of the format. */
+
+       jas_image_fmtops_t ops;
+       /* The operations for this format. */
+
+} jas_image_fmtinfo_t;
+
+/******************************************************************************\
+* Image operations.
+\******************************************************************************/
+
+/* Create an image. */
+jas_image_t *jas_image_create(int numcmpts,
+  jas_image_cmptparm_t *cmptparms, jas_clrspc_t clrspc);
+
+/* Create an "empty" image. */
+jas_image_t *jas_image_create0(void);
+
+/* Clone an image. */
+jas_image_t *jas_image_copy(jas_image_t *image);
+
+/* Deallocate any resources associated with an image. */
+void jas_image_destroy(jas_image_t *image);
+
+/* Get the width of the image in units of the image reference grid. */
+#define jas_image_width(image) \
+       ((image)->brx_ - (image)->tlx_)
+
+/* Get the height of the image in units of the image reference grid. */
+#define        jas_image_height(image) \
+       ((image)->bry_ - (image)->tly_)
+
+/* Get the x-coordinate of the top-left corner of the image bounding box
+  on the reference grid. */
+#define jas_image_tlx(image) \
+       ((image)->tlx_)
+
+/* Get the y-coordinate of the top-left corner of the image bounding box
+  on the reference grid. */
+#define jas_image_tly(image) \
+       ((image)->tly_)
+
+/* Get the x-coordinate of the bottom-right corner of the image bounding box
+  on the reference grid (plus one). */
+#define jas_image_brx(image) \
+       ((image)->brx_)
+
+/* Get the y-coordinate of the bottom-right corner of the image bounding box
+  on the reference grid (plus one). */
+#define jas_image_bry(image) \
+       ((image)->bry_)
+
+/* Get the number of image components. */
+#define        jas_image_numcmpts(image) \
+       ((image)->numcmpts_)
+
+/* Get the color model used by the image. */
+#define        jas_image_clrspc(image) \
+       ((image)->clrspc_)
+
+/* Set the color model for an image. */
+#define jas_image_setclrspc(image, clrspc) \
+       ((image)->clrspc_ = (clrspc))
+
+#define jas_image_cmpttype(image, cmptno) \
+       ((image)->cmpts_[(cmptno)]->type_)
+#define jas_image_setcmpttype(image, cmptno, type) \
+       ((image)->cmpts_[(cmptno)]->type_ = (type))
+
+/* Get the width of a component. */
+#define        jas_image_cmptwidth(image, cmptno) \
+       ((image)->cmpts_[cmptno]->width_)
+
+/* Get the height of a component. */
+#define        jas_image_cmptheight(image, cmptno) \
+       ((image)->cmpts_[cmptno]->height_)
+
+/* Get the signedness of the sample data for a component. */
+#define        jas_image_cmptsgnd(image, cmptno) \
+       ((image)->cmpts_[cmptno]->sgnd_)
+
+/* Get the precision of the sample data for a component. */
+#define        jas_image_cmptprec(image, cmptno) \
+       ((image)->cmpts_[cmptno]->prec_)
+
+/* Get the horizontal subsampling factor for a component. */
+#define        jas_image_cmpthstep(image, cmptno) \
+       ((image)->cmpts_[cmptno]->hstep_)
+
+/* Get the vertical subsampling factor for a component. */
+#define        jas_image_cmptvstep(image, cmptno) \
+       ((image)->cmpts_[cmptno]->vstep_)
+
+/* Get the x-coordinate of the top-left corner of a component. */
+#define        jas_image_cmpttlx(image, cmptno) \
+       ((image)->cmpts_[cmptno]->tlx_)
+
+/* Get the y-coordinate of the top-left corner of a component. */
+#define        jas_image_cmpttly(image, cmptno) \
+       ((image)->cmpts_[cmptno]->tly_)
+
+/* Get the x-coordinate of the bottom-right corner of a component
+  (plus "one"). */
+#define        jas_image_cmptbrx(image, cmptno) \
+       ((image)->cmpts_[cmptno]->tlx_ + (image)->cmpts_[cmptno]->width_ * \
+         (image)->cmpts_[cmptno]->hstep_)
+
+/* Get the y-coordinate of the bottom-right corner of a component
+  (plus "one"). */
+#define        jas_image_cmptbry(image, cmptno) \
+       ((image)->cmpts_[cmptno]->tly_ + (image)->cmpts_[cmptno]->height_ * \
+         (image)->cmpts_[cmptno]->vstep_)
+
+/* Get the raw size of an image (i.e., the nominal size of the image without
+  any compression. */
+uint_fast32_t jas_image_rawsize(jas_image_t *image);
+
+/* Create an image from a stream in some specified format. */
+jas_image_t *jas_image_decode(jas_stream_t *in, int fmt, char *optstr);
+
+/* Write an image to a stream in a specified format. */
+int jas_image_encode(jas_image_t *image, jas_stream_t *out, int fmt,
+  char *optstr);
+
+/* Read a rectangular region of an image component. */
+/* The position and size of the rectangular region to be read is specified
+relative to the component's coordinate system. */
+int jas_image_readcmpt(jas_image_t *image, int cmptno,
+  jas_image_coord_t x, jas_image_coord_t y, jas_image_coord_t width, jas_image_coord_t height,
+  jas_matrix_t *data);
+
+/* Write a rectangular region of an image component. */
+int jas_image_writecmpt(jas_image_t *image, int cmptno,
+  jas_image_coord_t x, jas_image_coord_t y, jas_image_coord_t width, jas_image_coord_t height,
+  jas_matrix_t *data);
+
+/* Delete a component from an image. */
+void jas_image_delcmpt(jas_image_t *image, int cmptno);
+
+/* Add a component to an image. */
+int jas_image_addcmpt(jas_image_t *image, int cmptno,
+  jas_image_cmptparm_t *cmptparm);
+
+/* Copy a component from one image to another. */
+int jas_image_copycmpt(jas_image_t *dstimage, int dstcmptno,
+  jas_image_t *srcimage, int srccmptno);
+
+#define        JAS_IMAGE_CDT_GETSGND(dtype) (((dtype) >> 7) & 1)
+#define        JAS_IMAGE_CDT_SETSGND(dtype) (((dtype) & 1) << 7)
+#define        JAS_IMAGE_CDT_GETPREC(dtype) ((dtype) & 0x7f)
+#define        JAS_IMAGE_CDT_SETPREC(dtype) ((dtype) & 0x7f)
+
+#define        jas_image_cmptdtype(image, cmptno) \
+       (JAS_IMAGE_CDT_SETSGND((image)->cmpts_[cmptno]->sgnd_) | JAS_IMAGE_CDT_SETPREC((image)->cmpts_[cmptno]->prec_))
+
+int jas_image_depalettize(jas_image_t *image, int cmptno, int numlutents,
+  int_fast32_t *lutents, int dtype, int newcmptno);
+
+int jas_image_readcmptsample(jas_image_t *image, int cmptno, int x, int y);
+void jas_image_writecmptsample(jas_image_t *image, int cmptno, int x, int y,
+  int_fast32_t v);
+
+int jas_image_getcmptbytype(jas_image_t *image, int ctype);
+
+/******************************************************************************\
+* Image format-related operations.
+\******************************************************************************/
+
+/* Clear the table of image formats. */
+void jas_image_clearfmts(void);
+
+/* Add entry to table of image formats. */
+int jas_image_addfmt(int id, char *name, char *ext, char *desc,
+  jas_image_fmtops_t *ops);
+
+/* Get the ID for the image format with the specified name. */
+int jas_image_strtofmt(char *s);
+
+/* Get the name of the image format with the specified ID. */
+char *jas_image_fmttostr(int fmt);
+
+/* Lookup image format information by the format ID. */
+jas_image_fmtinfo_t *jas_image_lookupfmtbyid(int id);
+
+/* Lookup image format information by the format name. */
+jas_image_fmtinfo_t *jas_image_lookupfmtbyname(const char *name);
+
+/* Guess the format of an image file based on its name. */
+int jas_image_fmtfromname(char *filename);
+
+/* Get the format of image data in a stream. */
+int jas_image_getfmt(jas_stream_t *in);
+
+
+#define        jas_image_cmprof(image) ((image)->cmprof_)
+int jas_image_ishomosamp(jas_image_t *image);
+int jas_image_sampcmpt(jas_image_t *image, int cmptno, int newcmptno,
+  jas_image_coord_t ho, jas_image_coord_t vo, jas_image_coord_t hs,
+  jas_image_coord_t vs, int sgnd, int prec);
+int jas_image_writecmpt2(jas_image_t *image, int cmptno, jas_image_coord_t x,
+  jas_image_coord_t y, jas_image_coord_t width, jas_image_coord_t height,
+  long *buf);
+int jas_image_readcmpt2(jas_image_t *image, int cmptno, jas_image_coord_t x,
+  jas_image_coord_t y, jas_image_coord_t width, jas_image_coord_t height,
+  long *buf);
+
+#define        jas_image_setcmprof(image, cmprof) ((image)->cmprof_ = cmprof)
+jas_image_t *jas_image_chclrspc(jas_image_t *image, jas_cmprof_t *outprof,
+  int intent);
+void jas_image_dump(jas_image_t *image, FILE *out);
+
+/******************************************************************************\
+* Image format-dependent operations.
+\******************************************************************************/
+
+#if !defined(EXCLUDE_JPG_SUPPORT)
+/* Format-dependent operations for JPG support. */
+jas_image_t *jpg_decode(jas_stream_t *in, char *optstr);
+int jpg_encode(jas_image_t *image, jas_stream_t *out, char *optstr);
+int jpg_validate(jas_stream_t *in);
+#endif
+
+#if !defined(EXCLUDE_MIF_SUPPORT)
+/* Format-dependent operations for MIF support. */
+jas_image_t *mif_decode(jas_stream_t *in, char *optstr);
+int mif_encode(jas_image_t *image, jas_stream_t *out, char *optstr);
+int mif_validate(jas_stream_t *in);
+#endif
+
+#if !defined(EXCLUDE_PNM_SUPPORT)
+/* Format-dependent operations for PNM support. */
+jas_image_t *pnm_decode(jas_stream_t *in, char *optstr);
+int pnm_encode(jas_image_t *image, jas_stream_t *out, char *optstr);
+int pnm_validate(jas_stream_t *in);
+#endif
+
+#if !defined(EXCLUDE_RAS_SUPPORT)
+/* Format-dependent operations for Sun Rasterfile support. */
+jas_image_t *ras_decode(jas_stream_t *in, char *optstr);
+int ras_encode(jas_image_t *image, jas_stream_t *out, char *optstr);
+int ras_validate(jas_stream_t *in);
+#endif
+
+#if !defined(EXCLUDE_BMP_SUPPORT)
+/* Format-dependent operations for BMP support. */
+jas_image_t *bmp_decode(jas_stream_t *in, char *optstr);
+int bmp_encode(jas_image_t *image, jas_stream_t *out, char *optstr);
+int bmp_validate(jas_stream_t *in);
+#endif
+
+#if !defined(EXCLUDE_JP2_SUPPORT)
+/* Format-dependent operations for JP2 support. */
+jas_image_t *jp2_decode(jas_stream_t *in, char *optstr);
+int jp2_encode(jas_image_t *image, jas_stream_t *out, char *optstr);
+int jp2_validate(jas_stream_t *in);
+#endif
+
+#if !defined(EXCLUDE_JPC_SUPPORT)
+/* Format-dependent operations for JPEG-2000 code stream support. */
+jas_image_t *jpc_decode(jas_stream_t *in, char *optstr);
+int jpc_encode(jas_image_t *image, jas_stream_t *out, char *optstr);
+int jpc_validate(jas_stream_t *in);
+#endif
+
+#if !defined(EXCLUDE_PGX_SUPPORT)
+/* Format-dependent operations for PGX support. */
+jas_image_t *pgx_decode(jas_stream_t *in, char *optstr);
+int pgx_encode(jas_image_t *image, jas_stream_t *out, char *optstr);
+int pgx_validate(jas_stream_t *in);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/libjasper/include/jasper/jas_init.h b/src/libjasper/include/jasper/jas_init.h
new file mode 100644 (file)
index 0000000..10301e9
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+#ifndef JAS_INIT_H
+#define JAS_INIT_H
+
+#include <jasper/jas_config.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/******************************************************************************\
+* Functions.
+\******************************************************************************/
+
+int jas_init(void);
+
+void jas_cleanup(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/libjasper/include/jasper/jas_malloc.h b/src/libjasper/include/jasper/jas_malloc.h
new file mode 100644 (file)
index 0000000..f2a8f8b
--- /dev/null
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Memory Allocator
+ *
+ * $Id$
+ */
+
+#ifndef JAS_MALLOC_H
+#define JAS_MALLOC_H
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <jasper/jas_config.h>
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/******************************************************************************\
+* Hack follows...
+\******************************************************************************/
+
+#if defined(DEBUG_MEMALLOC)
+/* This is somewhat of a hack, but it's a useful hack. :-) */
+/* Use my own custom memory allocator for debugging. */
+#include "../../../../local/src/memalloc.h"
+#define jas_malloc     MEMALLOC
+#define        jas_free        MEMFREE
+#define        jas_realloc     MEMREALLOC
+#define        jas_calloc      MEMCALLOC
+#endif
+
+/******************************************************************************\
+* Functions.
+\******************************************************************************/
+
+#if !defined(DEBUG_MEMALLOC)
+
+/* Allocate memory. */
+void *jas_malloc(size_t size);
+
+/* Free memory. */
+void jas_free(void *ptr);
+
+/* Resize a block of allocated memory. */
+void *jas_realloc(void *ptr, size_t size);
+
+/* Allocate a block of memory and initialize the contents to zero. */
+void *jas_calloc(size_t nmemb, size_t size);
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/libjasper/include/jasper/jas_math.h b/src/libjasper/include/jasper/jas_math.h
new file mode 100644 (file)
index 0000000..fc8010f
--- /dev/null
@@ -0,0 +1,117 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Math-Related Code
+ *
+ * $Id$
+ */
+
+#ifndef        JAS_MATH_H
+#define        JAS_MATH_H
+
+/******************************************************************************\
+* Includes
+\******************************************************************************/
+
+#include <jasper/jas_config.h>
+
+#include       <assert.h>
+#include       <stdio.h>
+#include       <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/******************************************************************************\
+* Macros
+\******************************************************************************/
+
+/* Compute the absolute value. */
+#define        JAS_ABS(x) \
+       (((x) >= 0) ? (x) : (-(x)))
+
+/* Compute the minimum of two values. */
+#define        JAS_MIN(x, y) \
+       (((x) < (y)) ? (x) : (y))
+
+/* Compute the maximum of two values. */
+#define        JAS_MAX(x, y) \
+       (((x) > (y)) ? (x) : (y))
+
+/* Compute the remainder from division (where division is defined such
+  that the remainder is always nonnegative). */
+#define        JAS_MOD(x, y) \
+       (((x) < 0) ? (((-x) % (y)) ? ((y) - ((-(x)) % (y))) : (0)) : ((x) % (y)))
+
+/* Compute the integer with the specified number of least significant bits
+  set to one. */
+#define        JAS_ONES(n) \
+  ((1 << (n)) - 1)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/libjasper/include/jasper/jas_seq.h b/src/libjasper/include/jasper/jas_seq.h
new file mode 100644 (file)
index 0000000..91fe31e
--- /dev/null
@@ -0,0 +1,301 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Sequence/Matrix Library
+ *
+ * $Id$
+ */
+
+#ifndef JAS_SEQ_H
+#define JAS_SEQ_H
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <jasper/jas_config.h>
+
+#include <jasper/jas_stream.h>
+#include <jasper/jas_types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/******************************************************************************\
+* Constants.
+\******************************************************************************/
+
+/* This matrix is a reference to another matrix. */
+#define JAS_MATRIX_REF 0x0001
+
+/******************************************************************************\
+* Types.
+\******************************************************************************/
+
+/* An element in a sequence. */
+typedef int_fast32_t jas_seqent_t;
+
+/* An element in a matrix. */
+typedef int_fast32_t jas_matent_t;
+
+/* Matrix. */
+
+typedef struct {
+
+       /* Additional state information. */
+       int flags_;
+
+       /* The starting horizontal index. */
+       int_fast32_t xstart_;
+
+       /* The starting vertical index. */
+       int_fast32_t ystart_;
+
+       /* The ending horizontal index. */
+       int_fast32_t xend_;
+
+       /* The ending vertical index. */
+       int_fast32_t yend_;
+
+       /* The number of rows in the matrix. */
+       int_fast32_t numrows_;
+
+       /* The number of columns in the matrix. */
+       int_fast32_t numcols_;
+
+       /* Pointers to the start of each row. */
+       jas_seqent_t **rows_;
+
+       /* The allocated size of the rows array. */
+       int_fast32_t maxrows_;
+
+       /* The matrix data buffer. */
+       jas_seqent_t *data_;
+
+       /* The allocated size of the data array. */
+       int_fast32_t datasize_;
+
+} jas_matrix_t;
+
+typedef jas_matrix_t jas_seq2d_t;
+typedef jas_matrix_t jas_seq_t;
+
+/******************************************************************************\
+* Functions/macros for matrix class.
+\******************************************************************************/
+
+/* Get the number of rows. */
+#define jas_matrix_numrows(matrix) \
+       ((matrix)->numrows_)
+
+/* Get the number of columns. */
+#define jas_matrix_numcols(matrix) \
+       ((matrix)->numcols_)
+
+/* Get a matrix element. */
+#define jas_matrix_get(matrix, i, j) \
+       ((matrix)->rows_[i][j])
+
+/* Set a matrix element. */
+#define jas_matrix_set(matrix, i, j, v) \
+       ((matrix)->rows_[i][j] = (v))
+
+/* Get an element from a matrix that is known to be a row or column vector. */
+#define jas_matrix_getv(matrix, i) \
+       (((matrix)->numrows_ == 1) ? ((matrix)->rows_[0][i]) : \
+         ((matrix)->rows_[i][0]))
+
+/* Set an element in a matrix that is known to be a row or column vector. */
+#define jas_matrix_setv(matrix, i, v) \
+       (((matrix)->numrows_ == 1) ? ((matrix)->rows_[0][i] = (v)) : \
+         ((matrix)->rows_[i][0] = (v)))
+
+/* Get the address of an element in a matrix. */
+#define        jas_matrix_getref(matrix, i, j) \
+       (&(matrix)->rows_[i][j])
+
+#define        jas_matrix_getvref(matrix, i) \
+       (((matrix)->numrows_ > 1) ? jas_matrix_getref(matrix, i, 0) : jas_matrix_getref(matrix, 0, i))
+
+#define jas_matrix_length(matrix) \
+       (max((matrix)->numrows_, (matrix)->numcols_))
+
+/* Create a matrix with the specified dimensions. */
+jas_matrix_t *jas_matrix_create(int numrows, int numcols);
+
+/* Destroy a matrix. */
+void jas_matrix_destroy(jas_matrix_t *matrix);
+
+/* Resize a matrix.  The previous contents of the matrix are lost. */
+int jas_matrix_resize(jas_matrix_t *matrix, int numrows, int numcols);
+
+int jas_matrix_output(jas_matrix_t *matrix, FILE *out);
+
+/* Create a matrix that references part of another matrix. */
+void jas_matrix_bindsub(jas_matrix_t *mat0, jas_matrix_t *mat1, int r0, int c0,
+  int r1, int c1);
+
+/* Create a matrix that is a reference to a row of another matrix. */
+#define jas_matrix_bindrow(mat0, mat1, r) \
+  (jas_matrix_bindsub((mat0), (mat1), (r), 0, (r), (mat1)->numcols_ - 1))
+
+/* Create a matrix that is a reference to a column of another matrix. */
+#define jas_matrix_bindcol(mat0, mat1, c) \
+  (jas_matrix_bindsub((mat0), (mat1), 0, (c), (mat1)->numrows_ - 1, (c)))
+
+/* Clip the values of matrix elements to the specified range. */
+void jas_matrix_clip(jas_matrix_t *matrix, jas_seqent_t minval,
+  jas_seqent_t maxval);
+
+/* Arithmetic shift left of all elements in a matrix. */
+void jas_matrix_asl(jas_matrix_t *matrix, int n);
+
+/* Arithmetic shift right of all elements in a matrix. */
+void jas_matrix_asr(jas_matrix_t *matrix, int n);
+
+/* Almost-but-not-quite arithmetic shift right of all elements in a matrix. */
+void jas_matrix_divpow2(jas_matrix_t *matrix, int n);
+
+/* Set all elements of a matrix to the specified value. */
+void jas_matrix_setall(jas_matrix_t *matrix, jas_seqent_t val);
+
+/* The spacing between rows of a matrix. */
+#define        jas_matrix_rowstep(matrix) \
+       (((matrix)->numrows_ > 1) ? ((matrix)->rows_[1] - (matrix)->rows_[0]) : (0))
+
+/* The spacing between columns of a matrix. */
+#define        jas_matrix_step(matrix) \
+       (((matrix)->numrows_ > 1) ? (jas_matrix_rowstep(matrix)) : (1))
+
+/* Compare two matrices for equality. */
+int jas_matrix_cmp(jas_matrix_t *mat0, jas_matrix_t *mat1);
+
+jas_matrix_t *jas_matrix_copy(jas_matrix_t *x);
+
+jas_matrix_t *jas_matrix_input(FILE *);
+
+/******************************************************************************\
+* Functions/macros for 2-D sequence class.
+\******************************************************************************/
+
+jas_seq2d_t *jas_seq2d_copy(jas_seq2d_t *x);
+
+jas_matrix_t *jas_seq2d_create(int xstart, int ystart, int xend, int yend);
+
+#define        jas_seq2d_destroy(s) \
+       jas_matrix_destroy(s)
+
+#define        jas_seq2d_xstart(s) \
+       ((s)->xstart_)
+#define        jas_seq2d_ystart(s) \
+       ((s)->ystart_)
+#define        jas_seq2d_xend(s) \
+       ((s)->xend_)
+#define        jas_seq2d_yend(s) \
+       ((s)->yend_)
+#define        jas_seq2d_getref(s, x, y) \
+       (jas_matrix_getref(s, (y) - (s)->ystart_, (x) - (s)->xstart_))
+#define        jas_seq2d_get(s, x, y) \
+       (jas_matrix_get(s, (y) - (s)->ystart_, (x) - (s)->xstart_))
+#define        jas_seq2d_rowstep(s) \
+       jas_matrix_rowstep(s)
+#define        jas_seq2d_width(s) \
+       ((s)->xend_ - (s)->xstart_)
+#define        jas_seq2d_height(s) \
+       ((s)->yend_ - (s)->ystart_)
+#define        jas_seq2d_setshift(s, x, y) \
+       ((s)->xstart_ = (x), (s)->ystart_ = (y), \
+         (s)->xend_ = (s)->xstart_ + (s)->numcols_, \
+         (s)->yend_ = (s)->ystart_ + (s)->numrows_)
+
+void jas_seq2d_bindsub(jas_matrix_t *s, jas_matrix_t *s1, int xstart,
+  int ystart, int xend, int yend);
+
+/******************************************************************************\
+* Functions/macros for 1-D sequence class.
+\******************************************************************************/
+
+#define        jas_seq_create(start, end) \
+       (jas_seq2d_create(start, 0, end, 1))
+
+#define        jas_seq_destroy(seq) \
+       (jas_seq2d_destroy(seq))
+
+#define jas_seq_set(seq, i, v) \
+       ((seq)->rows_[0][(i) - (seq)->xstart_] = (v))
+#define        jas_seq_getref(seq, i) \
+       (&(seq)->rows_[0][(i) - (seq)->xstart_])
+#define        jas_seq_get(seq, i) \
+       ((seq)->rows_[0][(i) - (seq)->xstart_])
+#define        jas_seq_start(seq) \
+       ((seq)->xstart_)
+#define        jas_seq_end(seq) \
+       ((seq)->xend_)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/libjasper/include/jasper/jas_stream.h b/src/libjasper/include/jasper/jas_stream.h
new file mode 100644 (file)
index 0000000..651bea9
--- /dev/null
@@ -0,0 +1,464 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * I/O Stream Class
+ *
+ * $Id$
+ */
+
+#ifndef JAS_STREAM_H
+#define JAS_STREAM_H
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <jasper/jas_config.h>
+
+#include <stdio.h>
+#if defined(HAVE_FCNTL_H)
+#include <fcntl.h>
+#endif
+#include <string.h>
+#if defined(HAVE_UNISTD_H)
+#include <unistd.h>
+#endif
+#include <jasper/jas_types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/******************************************************************************\
+* Constants.
+\******************************************************************************/
+
+/* On most UNIX systems, we probably need to define O_BINARY ourselves. */
+#ifndef O_BINARY
+#define O_BINARY       0
+#endif
+
+/*
+ * Stream open flags.
+ */
+
+/* The stream was opened for reading. */
+#define JAS_STREAM_READ        0x0001
+/* The stream was opened for writing. */
+#define JAS_STREAM_WRITE       0x0002
+/* The stream was opened for appending. */
+#define JAS_STREAM_APPEND      0x0004
+/* The stream was opened in binary mode. */
+#define JAS_STREAM_BINARY      0x0008
+/* The stream should be created/truncated. */
+#define JAS_STREAM_CREATE      0x0010
+
+
+/*
+ * Stream buffering flags.
+ */
+
+/* The stream is unbuffered. */
+#define JAS_STREAM_UNBUF       0x0000
+/* The stream is line buffered. */
+#define JAS_STREAM_LINEBUF     0x0001
+/* The stream is fully buffered. */
+#define JAS_STREAM_FULLBUF     0x0002
+/* The buffering mode mask. */
+#define        JAS_STREAM_BUFMODEMASK  0x000f
+
+/* The memory associated with the buffer needs to be deallocated when the
+  stream is destroyed. */
+#define JAS_STREAM_FREEBUF     0x0008
+/* The buffer is currently being used for reading. */
+#define JAS_STREAM_RDBUF       0x0010
+/* The buffer is currently being used for writing. */
+#define JAS_STREAM_WRBUF       0x0020
+
+/*
+ * Stream error flags.
+ */
+
+/* The end-of-file has been encountered (on reading). */
+#define JAS_STREAM_EOF 0x0001
+/* An I/O error has been encountered on the stream. */
+#define JAS_STREAM_ERR 0x0002
+/* The read/write limit has been exceeded. */
+#define        JAS_STREAM_RWLIMIT      0x0004
+/* The error mask. */
+#define JAS_STREAM_ERRMASK \
+       (JAS_STREAM_EOF | JAS_STREAM_ERR | JAS_STREAM_RWLIMIT)
+
+/*
+ * Other miscellaneous constants.
+ */
+
+/* The default buffer size (for fully-buffered operation). */
+#define JAS_STREAM_BUFSIZE     8192
+/* The default permission mask for file creation. */
+#define JAS_STREAM_PERMS       0666
+
+/* The maximum number of characters that can always be put back on a stream. */
+#define        JAS_STREAM_MAXPUTBACK   16
+
+/******************************************************************************\
+* Types.
+\******************************************************************************/
+
+/*
+ * Generic file object.
+ */
+
+typedef void jas_stream_obj_t;
+
+/*
+ * Generic file object operations.
+ */
+
+typedef struct {
+
+       /* Read characters from a file object. */
+       int (*read_)(jas_stream_obj_t *obj, char *buf, int cnt);
+
+       /* Write characters to a file object. */
+       int (*write_)(jas_stream_obj_t *obj, char *buf, int cnt);
+
+       /* Set the position for a file object. */
+       long (*seek_)(jas_stream_obj_t *obj, long offset, int origin);
+
+       /* Close a file object. */
+       int (*close_)(jas_stream_obj_t *obj);
+
+} jas_stream_ops_t;
+
+/*
+ * Stream object.
+ */
+
+typedef struct {
+
+       /* The mode in which the stream was opened. */
+       int openmode_;
+
+       /* The buffering mode. */
+       int bufmode_;
+
+       /* The stream status. */
+       int flags_;
+
+       /* The start of the buffer area to use for reading/writing. */
+       uchar *bufbase_;
+
+       /* The start of the buffer area excluding the extra initial space for
+         character putback. */
+       uchar *bufstart_;
+
+       /* The buffer size. */
+       int bufsize_;
+
+       /* The current position in the buffer. */
+       uchar *ptr_;
+
+       /* The number of characters that must be read/written before
+       the buffer needs to be filled/flushed. */
+       int cnt_;
+
+       /* A trivial buffer to be used for unbuffered operation. */
+       uchar tinybuf_[JAS_STREAM_MAXPUTBACK + 1];
+
+       /* The operations for the underlying stream file object. */
+       jas_stream_ops_t *ops_;
+
+       /* The underlying stream file object. */
+       jas_stream_obj_t *obj_;
+
+       /* The number of characters read/written. */
+       long rwcnt_;
+
+       /* The maximum number of characters that may be read/written. */
+       long rwlimit_;
+
+} jas_stream_t;
+
+/*
+ * Regular file object.
+ */
+
+/*
+ * File descriptor file object.
+ */
+typedef struct {
+       int fd;
+       int flags;
+       char pathname[L_tmpnam + 1];
+} jas_stream_fileobj_t;
+
+#define        JAS_STREAM_FILEOBJ_DELONCLOSE   0x01
+#define JAS_STREAM_FILEOBJ_NOCLOSE     0x02
+
+/*
+ * Memory file object.
+ */
+
+typedef struct {
+
+       /* The data associated with this file. */
+       uchar *buf_;
+
+       /* The allocated size of the buffer for holding file data. */
+       int bufsize_;
+
+       /* The length of the file. */
+       int_fast32_t len_;
+
+       /* The seek position. */
+       int_fast32_t pos_;
+
+       /* Is the buffer growable? */
+       int growable_;
+
+       /* Was the buffer allocated internally? */
+       int myalloc_;
+
+} jas_stream_memobj_t;
+
+/******************************************************************************\
+* Macros/functions for opening and closing streams.
+\******************************************************************************/
+
+/* Open a file as a stream. */
+jas_stream_t *jas_stream_fopen(const char *filename, const char *mode);
+
+/* Open a memory buffer as a stream. */
+jas_stream_t *jas_stream_memopen(char *buf, int bufsize);
+
+/* Open a file descriptor as a stream. */
+jas_stream_t *jas_stream_fdopen(int fd, const char *mode);
+
+/* Open a stdio stream as a stream. */
+jas_stream_t *jas_stream_freopen(const char *path, const char *mode, FILE *fp);
+
+/* Open a temporary file as a stream. */
+jas_stream_t *jas_stream_tmpfile(void);
+
+/* Close a stream. */
+int jas_stream_close(jas_stream_t *stream);
+
+/******************************************************************************\
+* Macros/functions for getting/setting the stream state.
+\******************************************************************************/
+
+/* Get the EOF indicator for a stream. */
+#define jas_stream_eof(stream) \
+       (((stream)->flags_ & JAS_STREAM_EOF) != 0)
+
+/* Get the error indicator for a stream. */
+#define jas_stream_error(stream) \
+       (((stream)->flags_ & JAS_STREAM_ERR) != 0)
+
+/* Clear the error indicator for a stream. */
+#define jas_stream_clearerr(stream) \
+       ((stream)->flags_ &= ~(JAS_STREAM_ERR | JAS_STREAM_EOF))
+
+/* Get the read/write limit for a stream. */
+#define        jas_stream_getrwlimit(stream) \
+       (((const jas_stream_t *)(stream))->rwlimit_)
+
+/* Set the read/write limit for a stream. */
+int jas_stream_setrwlimit(jas_stream_t *stream, long rwlimit);
+
+/* Get the read/write count for a stream. */
+#define        jas_stream_getrwcount(stream) \
+       (((const jas_stream_t *)(stream))->rwcnt_)
+
+/* Set the read/write count for a stream. */
+long jas_stream_setrwcount(jas_stream_t *stream, long rwcnt);
+
+/******************************************************************************\
+* Macros/functions for I/O.
+\******************************************************************************/
+
+/* Read a character from a stream. */
+#if defined(DEBUG)
+#define        jas_stream_getc(stream) jas_stream_getc_func(stream)
+#else
+#define jas_stream_getc(stream)        jas_stream_getc_macro(stream)
+#endif
+
+/* Write a character to a stream. */
+#if defined(DEBUG)
+#define jas_stream_putc(stream, c)     jas_stream_putc_func(stream, c)
+#else
+#define jas_stream_putc(stream, c)     jas_stream_putc_macro(stream, c)
+#endif
+
+/* Read characters from a stream into a buffer. */
+int jas_stream_read(jas_stream_t *stream, void *buf, int cnt);
+
+/* Write characters from a buffer to a stream. */
+int jas_stream_write(jas_stream_t *stream, const void *buf, int cnt);
+
+/* Write formatted output to a stream. */
+int jas_stream_printf(jas_stream_t *stream, const char *fmt, ...);
+
+/* Write a string to a stream. */
+int jas_stream_puts(jas_stream_t *stream, const char *s);
+
+/* Read a line of input from a stream. */
+char *jas_stream_gets(jas_stream_t *stream, char *buf, int bufsize);
+
+/* Look at the next character to be read from a stream without actually
+  removing it from the stream. */
+#define        jas_stream_peekc(stream) \
+       (((stream)->cnt_ <= 0) ? jas_stream_fillbuf(stream, 0) : \
+         ((int)(*(stream)->ptr_)))
+
+/* Put a character back on a stream. */
+int jas_stream_ungetc(jas_stream_t *stream, int c);
+
+/******************************************************************************\
+* Macros/functions for getting/setting the stream position.
+\******************************************************************************/
+
+/* Is it possible to seek on this stream? */
+int jas_stream_isseekable(jas_stream_t *stream);
+
+/* Set the current position within the stream. */
+long jas_stream_seek(jas_stream_t *stream, long offset, int origin);
+
+/* Get the current position within the stream. */
+long jas_stream_tell(jas_stream_t *stream);
+
+/* Seek to the beginning of a stream. */
+int jas_stream_rewind(jas_stream_t *stream);
+
+/******************************************************************************\
+* Macros/functions for flushing.
+\******************************************************************************/
+
+/* Flush any pending output to a stream. */
+int jas_stream_flush(jas_stream_t *stream);
+
+/******************************************************************************\
+* Miscellaneous macros/functions.
+\******************************************************************************/
+
+/* Copy data from one stream to another. */
+int jas_stream_copy(jas_stream_t *dst, jas_stream_t *src, int n);
+
+/* Display stream contents (for debugging purposes). */
+int jas_stream_display(jas_stream_t *stream, FILE *fp, int n);
+
+/* Consume (i.e., discard) characters from stream. */
+int jas_stream_gobble(jas_stream_t *stream, int n);
+
+/* Write a character multiple times to a stream. */
+int jas_stream_pad(jas_stream_t *stream, int n, int c);
+
+/* Get the size of the file associated with the specified stream.
+  The specified stream must be seekable. */
+long jas_stream_length(jas_stream_t *stream);
+
+/******************************************************************************\
+* Internal functions.
+\******************************************************************************/
+
+/* The following functions are for internal use only!  If you call them
+directly, you will die a horrible, miserable, and painful death! */
+
+/* Read a character from a stream. */
+#define jas_stream_getc_macro(stream) \
+       ((!((stream)->flags_ & (JAS_STREAM_ERR | JAS_STREAM_EOF | \
+         JAS_STREAM_RWLIMIT))) ? \
+         (((stream)->rwlimit_ >= 0 && (stream)->rwcnt_ >= (stream)->rwlimit_) ? \
+         (stream->flags_ |= JAS_STREAM_RWLIMIT, EOF) : \
+         jas_stream_getc2(stream)) : EOF)
+#define jas_stream_getc2(stream) \
+       ((--(stream)->cnt_ < 0) ? jas_stream_fillbuf(stream, 1) : \
+         (++(stream)->rwcnt_, (int)(*(stream)->ptr_++)))
+
+/* Write a character to a stream. */
+#define jas_stream_putc_macro(stream, c) \
+       ((!((stream)->flags_ & (JAS_STREAM_ERR | JAS_STREAM_EOF | \
+         JAS_STREAM_RWLIMIT))) ? \
+         (((stream)->rwlimit_ >= 0 && (stream)->rwcnt_ >= (stream)->rwlimit_) ? \
+         (stream->flags_ |= JAS_STREAM_RWLIMIT, EOF) : \
+         jas_stream_putc2(stream, c)) : EOF)
+#define jas_stream_putc2(stream, c) \
+       (((stream)->bufmode_ |= JAS_STREAM_WRBUF, --(stream)->cnt_ < 0) ? \
+         jas_stream_flushbuf((stream), (uchar)(c)) : \
+         (++(stream)->rwcnt_, (int)(*(stream)->ptr_++ = (c))))
+
+/* These prototypes need to be here for the sake of the stream_getc and
+stream_putc macros. */
+int jas_stream_fillbuf(jas_stream_t *stream, int getflag);
+int jas_stream_flushbuf(jas_stream_t *stream, int c);
+int jas_stream_getc_func(jas_stream_t *stream);
+int jas_stream_putc_func(jas_stream_t *stream, int c);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/libjasper/include/jasper/jas_string.h b/src/libjasper/include/jasper/jas_string.h
new file mode 100644 (file)
index 0000000..f217da2
--- /dev/null
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * String Library
+ *
+ * $Id$
+ */
+
+#ifndef        JAS_STRING_H
+#define        JAS_STRING_H
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <jasper/jas_config.h>
+#include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/******************************************************************************\
+* Functions.
+\******************************************************************************/
+
+/* Copy a string (a la strdup). */
+char *jas_strdup(const char *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/libjasper/include/jasper/jas_tmr.h b/src/libjasper/include/jasper/jas_tmr.h
new file mode 100644 (file)
index 0000000..837f2bf
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2004 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+#ifndef JAS_TMR_H
+#define JAS_TMR_H
+
+#include<time.h>
+#include <jasper/jas_config.h>
+#if defined(HAVE_SYS_TIME_H)
+#include <sys/time.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if defined(HAVE_GETTIMEOFDAY)
+
+typedef struct {
+       struct timeval start;
+       struct timeval stop;
+} jas_tmr_t;
+
+#elif defined(HAVE_GETRUSAGE)
+
+typedef struct {
+       struct rusage start;
+       struct rusage stop;
+} jas_tmr_t;
+
+#else
+
+typedef int jas_tmr_t;
+
+#endif
+
+void jas_tmr_start(jas_tmr_t *tmr);
+void jas_tmr_stop(jas_tmr_t *tmr);
+double jas_tmr_get(jas_tmr_t *tmr);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/libjasper/include/jasper/jas_tvp.h b/src/libjasper/include/jasper/jas_tvp.h
new file mode 100644 (file)
index 0000000..ae4f933
--- /dev/null
@@ -0,0 +1,151 @@
+/*
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Tag/Value Parser
+ *
+ * $Id$
+ */
+
+#ifndef JAS_TVP_H
+#define JAS_TVP_H
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <jasper/jas_config.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/******************************************************************************\
+* Types.
+\******************************************************************************/
+
+/* Tag information type. */
+
+typedef struct {
+
+       int id;
+       /* The ID for the tag. */
+
+       char *name;
+       /* The name of the tag. */
+
+} jas_taginfo_t;
+
+/* Tag-value parser type. */
+
+typedef struct {
+
+       char *buf;
+       /* The parsing buffer. */
+
+       char *tag;
+       /* The current tag name. */
+
+       char *val;
+       /* The current value. */
+
+       char *pos;
+       /* The current position in the parsing buffer. */
+
+} jas_tvparser_t;
+
+/******************************************************************************\
+* Tag information functions.
+\******************************************************************************/
+
+/* Lookup a tag by name. */
+jas_taginfo_t *jas_taginfos_lookup(jas_taginfo_t *taginfos, const char *name);
+
+/* This function returns a pointer to the specified taginfo object if it
+  exists (i.e., the pointer is nonnull); otherwise, a pointer to a dummy
+  object is returned.  This is useful in some situations to avoid checking
+  for a null pointer. */
+jas_taginfo_t *jas_taginfo_nonull(jas_taginfo_t *taginfo);
+
+/******************************************************************************\
+* Tag-value parser functions.
+\******************************************************************************/
+
+/* Create a tag-value parser for the specified string. */
+jas_tvparser_t *jas_tvparser_create(const char *s);
+
+/* Destroy a tag-value parser. */
+void jas_tvparser_destroy(jas_tvparser_t *tvparser);
+
+/* Get the next tag-value pair. */
+int jas_tvparser_next(jas_tvparser_t *tvparser);
+
+/* Get the tag name for the current tag-value pair. */
+char *jas_tvparser_gettag(jas_tvparser_t *tvparser);
+
+/* Get the value for the current tag-value pair. */
+char *jas_tvparser_getval(jas_tvparser_t *tvparser);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/libjasper/include/jasper/jas_types.h b/src/libjasper/include/jasper/jas_types.h
new file mode 100644 (file)
index 0000000..1acef11
--- /dev/null
@@ -0,0 +1,228 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Primitive Types
+ *
+ * $Id$
+ */
+
+#ifndef JAS_TYPES_H
+#define JAS_TYPES_H
+
+#include <jasper/jas_config.h>
+
+#if !defined(JAS_CONFIGURE)
+
+#if defined(WIN32) || defined(HAVE_WINDOWS_H)
+/*
+   We are dealing with Microsoft Windows and most likely Microsoft
+   Visual C (MSVC).  (Heaven help us.)  Sadly, MSVC does not correctly
+   define some of the standard types specified in ISO/IEC 9899:1999.
+   In particular, it does not define the "long long" and "unsigned long
+   long" types.  So, we work around this problem by using the "INT64"
+   and "UINT64" types that are defined in the header file "windows.h".
+ */
+#include <windows.h>
+#undef longlong
+#define        longlong        INT64
+#undef ulonglong
+#define        ulonglong       UINT64
+#endif
+
+#endif
+
+#if defined(HAVE_STDLIB_H)
+#undef false
+#undef true
+#include <stdlib.h>
+#endif
+#if defined(HAVE_STDDEF_H)
+#include <stddef.h>
+#endif
+#if defined(HAVE_SYS_TYPES_H)
+#include <sys/types.h>
+#endif
+
+#ifndef __cplusplus
+#if defined(HAVE_STDBOOL_H)
+/*
+ * The C language implementation does correctly provide the standard header
+ * file "stdbool.h".
+ */
+#include <stdbool.h>
+#else
+
+/*
+ * The C language implementation does not provide the standard header file
+ * "stdbool.h" as required by ISO/IEC 9899:1999.  Try to compensate for this
+ * braindamage below.
+ */
+#if !defined(bool)
+#define        bool    int
+#endif
+#if !defined(true)
+#define true   1
+#endif
+#if !defined(false)
+#define        false   0
+#endif
+#endif
+
+#endif
+
+#if defined(HAVE_STDINT_H)
+/*
+ * The C language implementation does correctly provide the standard header
+ * file "stdint.h".
+ */
+#include <stdint.h>
+#else
+/*
+ * The C language implementation does not provide the standard header file
+ * "stdint.h" as required by ISO/IEC 9899:1999.  Try to compensate for this
+ * braindamage below.
+ */
+#include <limits.h>
+/**********/
+#if !defined(INT_FAST8_MIN)
+typedef signed char int_fast8_t;
+#define INT_FAST8_MIN  (-127)
+#define INT_FAST8_MAX  128
+#endif
+/**********/
+#if !defined(UINT_FAST8_MAX)
+typedef unsigned char uint_fast8_t;
+#define UINT_FAST8_MAX 255
+#endif
+/**********/
+#if !defined(INT_FAST16_MIN)
+typedef short int_fast16_t;
+#define INT_FAST16_MIN SHRT_MIN
+#define INT_FAST16_MAX SHRT_MAX
+#endif
+/**********/
+#if !defined(UINT_FAST16_MAX)
+typedef unsigned short uint_fast16_t;
+#define UINT_FAST16_MAX        USHRT_MAX
+#endif
+/**********/
+#if !defined(INT_FAST32_MIN)
+typedef int int_fast32_t;
+#define INT_FAST32_MIN INT_MIN
+#define INT_FAST32_MAX INT_MAX
+#endif
+/**********/
+#if !defined(UINT_FAST32_MAX)
+typedef unsigned int uint_fast32_t;
+#define UINT_FAST32_MAX        UINT_MAX
+#endif
+/**********/
+#if !defined(INT_FAST64_MIN)
+typedef longlong int_fast64_t;
+#define INT_FAST64_MIN LLONG_MIN
+#define INT_FAST64_MAX LLONG_MAX
+#endif
+/**********/
+#if !defined(UINT_FAST64_MAX)
+typedef ulonglong uint_fast64_t;
+#define UINT_FAST64_MAX        ULLONG_MAX
+#endif
+/**********/
+#endif
+
+/* Hopefully, these macro definitions will fix more problems than they cause. */
+#if !defined(uchar)
+#define uchar unsigned char
+#endif
+#if !defined(ushort)
+#define ushort unsigned short
+#endif
+#if !defined(uint)
+#define uint unsigned int
+#endif
+#if !defined(ulong)
+#define ulong unsigned long
+#endif
+#if !defined(longlong)
+#define longlong long long
+#endif
+#if !defined(ulonglong)
+#define ulonglong unsigned long long
+#endif
+
+/* The below macro is intended to be used for type casts.  By using this
+  macro, type casts can be easily located in the source code with
+  tools like "grep". */
+#define        JAS_CAST(t, e) \
+       ((t) (e))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/libjasper/include/jasper/jas_version.h b/src/libjasper/include/jasper/jas_version.h
new file mode 100644 (file)
index 0000000..14da7a0
--- /dev/null
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * $Id$
+ */
+
+#ifndef JAS_VERSION_H
+#define JAS_VERSION_H
+
+#include <jasper/jas_config.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/******************************************************************************\
+* Constants and types.
+\******************************************************************************/
+
+#if !defined(JAS_VERSION)
+/* The version information below should match that specified in
+  the "configure.in" file! */
+#define        JAS_VERSION             "unknown"
+#endif
+
+#define        JAS_COPYRIGHT \
+       "Copyright (c) 2001-2006 Michael David Adams.\n" \
+       "Copyright (c) 1999-2000 Image Power, Inc. and the University of\n" \
+       "  British Columbia.\n" \
+       "All rights reserved.\n"
+
+#define        JAS_NOTES \
+       "For more information about this software, please visit the following\n" \
+       "web sites/pages:\n" \
+       "    http://www.ece.uvic.ca/~mdadams/jasper\n" \
+       "    http://www.jpeg.org/software\n" \
+       "To be added to the (moderated) JasPer software announcements\n" \
+       "mailing list, send an email to:\n" \
+       "    jasper-announce-subscribe@yahoogroups.com\n" \
+       "To be added to the (unmoderated) JasPer software discussion\n" \
+       "mailing list, send an email to:\n" \
+       "    jasper-discussion-subscribe@yahoogroups.com\n" \
+       "Please send any bug reports to:\n" \
+       "    mdadams@ieee.org\n"
+
+/******************************************************************************\
+* Functions.
+\******************************************************************************/
+
+const char *jas_getversion(void);
+/* Get the version information for the JasPer library. */
+/* Note:  Since libjasper can be built as a shared library, the version
+  returned by this function may not necessarily correspond to JAS_VERSION. */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/libjasper/include/jasper/jasper.h b/src/libjasper/include/jasper/jasper.h
new file mode 100644 (file)
index 0000000..eb74ba0
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2001-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+#ifndef JAS_JASPER_H
+#define JAS_JASPER_H
+
+#include <jasper/jas_config.h>
+#include <jasper/jas_types.h>
+#include <jasper/jas_version.h>
+
+#include <jasper/jas_init.h>
+#include <jasper/jas_cm.h>
+#include <jasper/jas_icc.h>
+#include <jasper/jas_fix.h>
+#include <jasper/jas_debug.h>
+#include <jasper/jas_getopt.h>
+#include <jasper/jas_image.h>
+#include <jasper/jas_icc.h>
+#include <jasper/jas_math.h>
+#include <jasper/jas_malloc.h>
+#include <jasper/jas_seq.h>
+#include <jasper/jas_stream.h>
+#include <jasper/jas_string.h>
+#include <jasper/jas_tmr.h>
+#include <jasper/jas_tvp.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/libjasper/jp2/Makefile.am b/src/libjasper/jp2/Makefile.am
new file mode 100644 (file)
index 0000000..4887961
--- /dev/null
@@ -0,0 +1,67 @@
+# Copyright (c) 2001-2002 Michael David Adams.
+# All rights reserved. 
+
+# __START_OF_JASPER_LICENSE__
+# 
+# JasPer License Version 2.0
+# 
+# Copyright (c) 2001-2006 Michael David Adams
+# Copyright (c) 1999-2000 Image Power, Inc.
+# Copyright (c) 1999-2000 The University of British Columbia
+# 
+# All rights reserved.
+# 
+# Permission is hereby granted, free of charge, to any person (the
+# "User") obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the
+# following conditions:
+# 
+# 1.  The above copyright notices and this permission notice (which
+# includes the disclaimer below) shall be included in all copies or
+# substantial portions of the Software.
+# 
+# 2.  The name of a copyright holder shall not be used to endorse or
+# promote products derived from the Software without specific prior
+# written permission.
+# 
+# THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+# LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+# THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+# "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+# PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+# EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+# PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+# THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+# EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+# BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+# PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+# GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+# ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+# IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+# SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+# AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+# SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+# THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+# PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+# RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+# EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+# 
+# __END_OF_JASPER_LICENSE__
+
+noinst_LTLIBRARIES = libjp2.la
+libjp2_la_SOURCES = \
+       jp2_cod.h \
+       jp2_dec.h \
+       jp2_cod.c \
+       jp2_dec.c \
+       jp2_enc.c
+
+INCLUDES = -I$(top_srcdir)/src/libjasper/include
diff --git a/src/libjasper/jp2/Makefile.in b/src/libjasper/jp2/Makefile.in
new file mode 100644 (file)
index 0000000..fec1638
--- /dev/null
@@ -0,0 +1,510 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# Copyright (c) 2001-2002 Michael David Adams.
+# All rights reserved. 
+
+# __START_OF_JASPER_LICENSE__
+# 
+# JasPer License Version 2.0
+# 
+# Copyright (c) 2001-2006 Michael David Adams
+# Copyright (c) 1999-2000 Image Power, Inc.
+# Copyright (c) 1999-2000 The University of British Columbia
+# 
+# All rights reserved.
+# 
+# Permission is hereby granted, free of charge, to any person (the
+# "User") obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the
+# following conditions:
+# 
+# 1.  The above copyright notices and this permission notice (which
+# includes the disclaimer below) shall be included in all copies or
+# substantial portions of the Software.
+# 
+# 2.  The name of a copyright holder shall not be used to endorse or
+# promote products derived from the Software without specific prior
+# written permission.
+# 
+# THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+# LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+# THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+# "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+# PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+# EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+# PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+# THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+# EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+# BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+# PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+# GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+# ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+# IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+# SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+# AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+# SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+# THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+# PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+# RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+# EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+# 
+# __END_OF_JASPER_LICENSE__
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = src/libjasper/jp2
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/acaux/mkinstalldirs
+CONFIG_HEADER =  \
+       $(top_builddir)/src/libjasper/include/jasper/jas_config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libjp2_la_LIBADD =
+am_libjp2_la_OBJECTS = jp2_cod.lo jp2_dec.lo jp2_enc.lo
+libjp2_la_OBJECTS = $(am_libjp2_la_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/libjasper/include/jasper
+depcomp = $(SHELL) $(top_srcdir)/acaux/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+       $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libjp2_la_SOURCES)
+DIST_SOURCES = $(libjp2_la_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+HAVE_LIBJPEG_FALSE = @HAVE_LIBJPEG_FALSE@
+HAVE_LIBJPEG_TRUE = @HAVE_LIBJPEG_TRUE@
+HAVE_OPENGL_FALSE = @HAVE_OPENGL_FALSE@
+HAVE_OPENGL_TRUE = @HAVE_OPENGL_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAS_MAJOR_VERSION = @JAS_MAJOR_VERSION@
+JAS_MICRO_VERSION = @JAS_MICRO_VERSION@
+JAS_MINOR_VERSION = @JAS_MINOR_VERSION@
+JAS_RPM_RELEASE = @JAS_RPM_RELEASE@
+JAS_VERSION = @JAS_VERSION@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_AGE = @LT_AGE@
+LT_CURRENT = @LT_CURRENT@
+LT_RELEASE = @LT_RELEASE@
+LT_REVISION = @LT_REVISION@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OPENGL_LIBS = @OPENGL_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+noinst_LTLIBRARIES = libjp2.la
+libjp2_la_SOURCES = \
+       jp2_cod.h \
+       jp2_dec.h \
+       jp2_cod.c \
+       jp2_dec.c \
+       jp2_enc.c
+
+INCLUDES = -I$(top_srcdir)/src/libjasper/include
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/libjasper/jp2/Makefile'; \
+       cd $(top_srcdir) && \
+         $(AUTOMAKE) --foreign  src/libjasper/jp2/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+       -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+       @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+         test "$$dir" != "$$p" || dir=.; \
+         echo "rm -f \"$${dir}/so_locations\""; \
+         rm -f "$${dir}/so_locations"; \
+       done
+libjp2.la: $(libjp2_la_OBJECTS) $(libjp2_la_DEPENDENCIES) 
+       $(LINK)  $(libjp2_la_LDFLAGS) $(libjp2_la_OBJECTS) $(libjp2_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jp2_cod.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jp2_dec.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jp2_enc.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+
+distclean-libtool:
+       -rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+           $$tags $$unique; \
+       fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       test -z "$(CTAGS_ARGS)$$tags$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$tags $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && cd $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+       list='$(DISTFILES)'; for file in $$list; do \
+         case $$file in \
+           $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+           $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+         esac; \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+         if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+           dir="/$$dir"; \
+           $(mkdir_p) "$(distdir)$$dir"; \
+         else \
+           dir=''; \
+         fi; \
+         if test -d $$d/$$file; then \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+           fi; \
+           cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+         else \
+           test -f $(distdir)/$$file \
+           || cp -p $$d/$$file $(distdir)/$$file \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+         `test -z '$(STRIP)' || \
+           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+       mostlyclean-am
+
+distclean: distclean-am
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+       clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+       distclean-compile distclean-generic distclean-libtool \
+       distclean-tags distdir dvi dvi-am html html-am info info-am \
+       install install-am install-data install-data-am install-exec \
+       install-exec-am install-info install-info-am install-man \
+       install-strip installcheck installcheck-am installdirs \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+       pdf pdf-am ps ps-am tags uninstall uninstall-am \
+       uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/libjasper/jp2/jp2_cod.c b/src/libjasper/jp2/jp2_cod.c
new file mode 100644 (file)
index 0000000..83cecb1
--- /dev/null
@@ -0,0 +1,921 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * JP2 Library
+ *
+ * $Id$
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <assert.h>
+#include <stdlib.h>
+
+#include "jasper/jas_stream.h"
+#include "jasper/jas_malloc.h"
+#include "jasper/jas_debug.h"
+
+#include "jp2_cod.h"
+
+/******************************************************************************\
+* Function prototypes.
+\******************************************************************************/
+
+#define        ONES(n) ((1 << (n)) - 1)
+
+jp2_boxinfo_t *jp2_boxinfolookup(int type);
+
+static int jp2_getuint8(jas_stream_t *in, uint_fast8_t *val);
+static int jp2_getuint16(jas_stream_t *in, uint_fast16_t *val);
+static int jp2_getuint32(jas_stream_t *in, uint_fast32_t *val);
+static int jp2_getuint64(jas_stream_t *in, uint_fast64_t *val);
+static int jp2_putuint8(jas_stream_t *out, uint_fast8_t val);
+static int jp2_putuint16(jas_stream_t *out, uint_fast16_t val);
+static int jp2_putuint32(jas_stream_t *out, uint_fast32_t val);
+static int jp2_putuint64(jas_stream_t *out, uint_fast64_t val);
+
+static int jp2_getint(jas_stream_t *in, int s, int n, int_fast32_t *val);
+
+jp2_box_t *jp2_box_get(jas_stream_t *in);
+void jp2_box_dump(jp2_box_t *box, FILE *out);
+
+static int jp2_jp_getdata(jp2_box_t *box, jas_stream_t *in);
+static int jp2_jp_putdata(jp2_box_t *box, jas_stream_t *out);
+static int jp2_ftyp_getdata(jp2_box_t *box, jas_stream_t *in);
+static int jp2_ftyp_putdata(jp2_box_t *box, jas_stream_t *out);
+static int jp2_ihdr_getdata(jp2_box_t *box, jas_stream_t *in);
+static int jp2_ihdr_putdata(jp2_box_t *box, jas_stream_t *out);
+static void jp2_bpcc_destroy(jp2_box_t *box);
+static int jp2_bpcc_getdata(jp2_box_t *box, jas_stream_t *in);
+static int jp2_bpcc_putdata(jp2_box_t *box, jas_stream_t *out);
+static int jp2_colr_getdata(jp2_box_t *box, jas_stream_t *in);
+static int jp2_colr_putdata(jp2_box_t *box, jas_stream_t *out);
+static void jp2_colr_dumpdata(jp2_box_t *box, FILE *out);
+static void jp2_colr_destroy(jp2_box_t *box);
+static void jp2_cdef_destroy(jp2_box_t *box);
+static int jp2_cdef_getdata(jp2_box_t *box, jas_stream_t *in);
+static int jp2_cdef_putdata(jp2_box_t *box, jas_stream_t *out);
+static void jp2_cdef_dumpdata(jp2_box_t *box, FILE *out);
+static void jp2_cmap_destroy(jp2_box_t *box);
+static int jp2_cmap_getdata(jp2_box_t *box, jas_stream_t *in);
+static int jp2_cmap_putdata(jp2_box_t *box, jas_stream_t *out);
+static void jp2_cmap_dumpdata(jp2_box_t *box, FILE *out);
+static void jp2_pclr_destroy(jp2_box_t *box);
+static int jp2_pclr_getdata(jp2_box_t *box, jas_stream_t *in);
+static int jp2_pclr_putdata(jp2_box_t *box, jas_stream_t *out);
+static void jp2_pclr_dumpdata(jp2_box_t *box, FILE *out);
+
+/******************************************************************************\
+* Local data.
+\******************************************************************************/
+
+jp2_boxinfo_t jp2_boxinfos[] = {
+       {JP2_BOX_JP, "JP", 0,
+         {0, 0, jp2_jp_getdata, jp2_jp_putdata, 0}},
+       {JP2_BOX_FTYP, "FTYP", 0,
+         {0, 0, jp2_ftyp_getdata, jp2_ftyp_putdata, 0}},
+       {JP2_BOX_JP2H, "JP2H", JP2_BOX_SUPER,
+         {0, 0, 0, 0, 0}},
+       {JP2_BOX_IHDR, "IHDR", 0,
+         {0, 0, jp2_ihdr_getdata, jp2_ihdr_putdata, 0}},
+       {JP2_BOX_BPCC, "BPCC", 0,
+         {0, jp2_bpcc_destroy, jp2_bpcc_getdata, jp2_bpcc_putdata, 0}},
+       {JP2_BOX_COLR, "COLR", 0,
+         {0, jp2_colr_destroy, jp2_colr_getdata, jp2_colr_putdata, jp2_colr_dumpdata}},
+       {JP2_BOX_PCLR, "PCLR", 0,
+         {0, jp2_pclr_destroy, jp2_pclr_getdata, jp2_pclr_putdata, jp2_pclr_dumpdata}},
+       {JP2_BOX_CMAP, "CMAP", 0,
+         {0, jp2_cmap_destroy, jp2_cmap_getdata, jp2_cmap_putdata, jp2_cmap_dumpdata}},
+       {JP2_BOX_CDEF, "CDEF", 0,
+         {0, jp2_cdef_destroy, jp2_cdef_getdata, jp2_cdef_putdata, jp2_cdef_dumpdata}},
+       {JP2_BOX_RES, "RES", JP2_BOX_SUPER,
+         {0, 0, 0, 0, 0}},
+       {JP2_BOX_RESC, "RESC", 0,
+         {0, 0, 0, 0, 0}},
+       {JP2_BOX_RESD, "RESD", 0,
+         {0, 0, 0, 0, 0}},
+       {JP2_BOX_JP2C, "JP2C", JP2_BOX_NODATA,
+         {0, 0, 0, 0, 0}},
+       {JP2_BOX_JP2I, "JP2I", 0,
+         {0, 0, 0, 0, 0}},
+       {JP2_BOX_XML, "XML", 0,
+         {0, 0, 0, 0, 0}},
+       {JP2_BOX_UUID, "UUID", 0,
+         {0, 0, 0, 0, 0}},
+       {JP2_BOX_UINF, "UINF", JP2_BOX_SUPER,
+         {0, 0, 0, 0, 0}},
+       {JP2_BOX_ULST, "ULST", 0,
+         {0, 0, 0, 0, 0}},
+       {JP2_BOX_URL, "URL", 0,
+         {0, 0, 0, 0, 0}},
+       {0, 0, 0, {0, 0, 0, 0, 0}},
+};
+
+jp2_boxinfo_t jp2_boxinfo_unk = {
+       0, "Unknown", 0, {0, 0, 0, 0, 0}
+};
+
+/******************************************************************************\
+* Box constructor.
+\******************************************************************************/
+
+jp2_box_t *jp2_box_create(int type)
+{
+       jp2_box_t *box;
+       jp2_boxinfo_t *boxinfo;
+
+       if (!(box = jas_malloc(sizeof(jp2_box_t)))) {
+               return 0;
+       }
+       memset(box, 0, sizeof(jp2_box_t));
+       box->type = type;
+       box->len = 0;
+       if (!(boxinfo = jp2_boxinfolookup(type))) {
+               return 0;
+       }
+       box->info = boxinfo;
+       box->ops = &boxinfo->ops;
+       return box;
+}
+
+/******************************************************************************\
+* Box destructor.
+\******************************************************************************/
+
+void jp2_box_destroy(jp2_box_t *box)
+{
+       if (box->ops->destroy) {
+               (*box->ops->destroy)(box);
+       }
+       jas_free(box);
+}
+
+static void jp2_bpcc_destroy(jp2_box_t *box)
+{
+       jp2_bpcc_t *bpcc = &box->data.bpcc;
+       if (bpcc->bpcs) {
+               jas_free(bpcc->bpcs);
+               bpcc->bpcs = 0;
+       }
+}
+
+static void jp2_cdef_destroy(jp2_box_t *box)
+{
+       jp2_cdef_t *cdef = &box->data.cdef;
+       if (cdef->ents) {
+               jas_free(cdef->ents);
+               cdef->ents = 0;
+       }
+}
+
+/******************************************************************************\
+* Box input.
+\******************************************************************************/
+
+jp2_box_t *jp2_box_get(jas_stream_t *in)
+{
+       jp2_box_t *box;
+       jp2_boxinfo_t *boxinfo;
+       jas_stream_t *tmpstream;
+       uint_fast32_t len;
+       uint_fast64_t extlen;
+       bool dataflag;
+
+       box = 0;
+       tmpstream = 0;
+
+       if (!(box = jas_malloc(sizeof(jp2_box_t)))) {
+               goto error;
+       }
+       box->ops = &jp2_boxinfo_unk.ops;
+       if (jp2_getuint32(in, &len) || jp2_getuint32(in, &box->type)) {
+               goto error;
+       }
+       boxinfo = jp2_boxinfolookup(box->type);
+       box->info = boxinfo;
+       box->ops = &boxinfo->ops;
+       box->len = len;
+       if (box->len == 1) {
+               if (jp2_getuint64(in, &extlen)) {
+                       goto error;
+               }
+               if (extlen > 0xffffffffUL) {
+                       jas_eprintf("warning: cannot handle large 64-bit box length\n");
+                       extlen = 0xffffffffUL;
+               }
+               box->len = extlen;
+               box->datalen = extlen - JP2_BOX_HDRLEN(true);
+       } else {
+               box->datalen = box->len - JP2_BOX_HDRLEN(false);
+       }
+       if (box->len != 0 && box->len < 8) {
+               goto error;
+       }
+
+       dataflag = !(box->info->flags & (JP2_BOX_SUPER | JP2_BOX_NODATA));
+
+       if (dataflag) {
+               if (!(tmpstream = jas_stream_memopen(0, 0))) {
+                       goto error;
+               }
+               if (jas_stream_copy(tmpstream, in, box->datalen)) {
+                       jas_eprintf("cannot copy box data\n");
+                       goto error;
+               }
+               jas_stream_rewind(tmpstream);
+
+               if (box->ops->getdata) {
+                       if ((*box->ops->getdata)(box, tmpstream)) {
+                               jas_eprintf("cannot parse box data\n");
+                               goto error;
+                       }
+               }
+               jas_stream_close(tmpstream);
+       }
+
+       if (jas_getdbglevel() >= 1) {
+               jp2_box_dump(box, stderr);
+       }
+
+       return box;
+       abort();
+
+error:
+       if (box) {
+               jp2_box_destroy(box);
+       }
+       if (tmpstream) {
+               jas_stream_close(tmpstream);
+       }
+       return 0;
+}
+
+void jp2_box_dump(jp2_box_t *box, FILE *out)
+{
+       jp2_boxinfo_t *boxinfo;
+       boxinfo = jp2_boxinfolookup(box->type);
+       assert(boxinfo);
+
+       fprintf(out, "JP2 box: ");
+       fprintf(out, "type=%c%s%c (0x%08x); length=%d\n", '"', boxinfo->name,
+         '"', box->type, box->len);
+       if (box->ops->dumpdata) {
+               (*box->ops->dumpdata)(box, out);
+       }
+}
+
+static int jp2_jp_getdata(jp2_box_t *box, jas_stream_t *in)
+{
+       jp2_jp_t *jp = &box->data.jp;
+       if (jp2_getuint32(in, &jp->magic)) {
+               return -1;
+       }
+       return 0;
+}
+
+static int jp2_ftyp_getdata(jp2_box_t *box, jas_stream_t *in)
+{
+       jp2_ftyp_t *ftyp = &box->data.ftyp;
+       unsigned int i;
+       if (jp2_getuint32(in, &ftyp->majver) || jp2_getuint32(in, &ftyp->minver)) {
+               return -1;
+       }
+       ftyp->numcompatcodes = (box->datalen - 8) / 4;
+       if (ftyp->numcompatcodes > JP2_FTYP_MAXCOMPATCODES) {
+               return -1;
+       }
+       for (i = 0; i < ftyp->numcompatcodes; ++i) {
+               if (jp2_getuint32(in, &ftyp->compatcodes[i])) {
+                       return -1;
+               }
+       }
+       return 0;
+}
+
+static int jp2_ihdr_getdata(jp2_box_t *box, jas_stream_t *in)
+{
+       jp2_ihdr_t *ihdr = &box->data.ihdr;
+       if (jp2_getuint32(in, &ihdr->height) || jp2_getuint32(in, &ihdr->width) ||
+         jp2_getuint16(in, &ihdr->numcmpts) || jp2_getuint8(in, &ihdr->bpc) ||
+         jp2_getuint8(in, &ihdr->comptype) || jp2_getuint8(in, &ihdr->csunk) ||
+         jp2_getuint8(in, &ihdr->ipr)) {
+               return -1;
+       }
+       return 0;
+}
+
+static int jp2_bpcc_getdata(jp2_box_t *box, jas_stream_t *in)
+{
+       jp2_bpcc_t *bpcc = &box->data.bpcc;
+       unsigned int i;
+       bpcc->numcmpts = box->datalen;
+       if (!(bpcc->bpcs = jas_malloc(bpcc->numcmpts * sizeof(uint_fast8_t)))) {
+               return -1;
+       }
+       for (i = 0; i < bpcc->numcmpts; ++i) {
+               if (jp2_getuint8(in, &bpcc->bpcs[i])) {
+                       return -1;
+               }
+       }
+       return 0;
+}
+
+static void jp2_colr_dumpdata(jp2_box_t *box, FILE *out)
+{
+       jp2_colr_t *colr = &box->data.colr;
+       fprintf(out, "method=%d; pri=%d; approx=%d\n", (int)colr->method, (int)colr->pri, (int)colr->approx);
+       switch (colr->method) {
+       case JP2_COLR_ENUM:
+               fprintf(out, "csid=%d\n", (int)colr->csid);
+               break;
+       case JP2_COLR_ICC:
+               jas_memdump(out, colr->iccp, colr->iccplen);
+               break;
+       }
+}
+
+static int jp2_colr_getdata(jp2_box_t *box, jas_stream_t *in)
+{
+       jp2_colr_t *colr = &box->data.colr;
+       colr->csid = 0;
+       colr->iccp = 0;
+       colr->iccplen = 0;
+
+       if (jp2_getuint8(in, &colr->method) || jp2_getuint8(in, &colr->pri) ||
+         jp2_getuint8(in, &colr->approx)) {
+               return -1;
+       }
+       switch (colr->method) {
+       case JP2_COLR_ENUM:
+               if (jp2_getuint32(in, &colr->csid)) {
+                       return -1;
+               }
+               break;
+       case JP2_COLR_ICC:
+               colr->iccplen = box->datalen - 3;
+               if (!(colr->iccp = jas_malloc(colr->iccplen * sizeof(uint_fast8_t)))) {
+                       return -1;
+               }
+               if (jas_stream_read(in, colr->iccp, colr->iccplen) != colr->iccplen) {
+                       return -1;
+               }
+               break;
+       }
+       return 0;
+}
+
+static void jp2_cdef_dumpdata(jp2_box_t *box, FILE *out)
+{
+       jp2_cdef_t *cdef = &box->data.cdef;
+       unsigned int i;
+       for (i = 0; i < cdef->numchans; ++i) {
+               fprintf(out, "channo=%d; type=%d; assoc=%d\n",
+                 cdef->ents[i].channo, cdef->ents[i].type, cdef->ents[i].assoc);
+       }
+}
+
+static void jp2_colr_destroy(jp2_box_t *box)
+{
+       jp2_colr_t *colr = &box->data.colr;
+       if (colr->iccp) {
+               jas_free(colr->iccp);
+       }
+}
+
+static int jp2_cdef_getdata(jp2_box_t *box, jas_stream_t *in)
+{
+       jp2_cdef_t *cdef = &box->data.cdef;
+       jp2_cdefchan_t *chan;
+       unsigned int channo;
+       if (jp2_getuint16(in, &cdef->numchans)) {
+               return -1;
+       }
+       if (!(cdef->ents = jas_malloc(cdef->numchans * sizeof(jp2_cdefchan_t)))) {
+               return -1;
+       }
+       for (channo = 0; channo < cdef->numchans; ++channo) {
+               chan = &cdef->ents[channo];
+               if (jp2_getuint16(in, &chan->channo) || jp2_getuint16(in, &chan->type) ||
+                 jp2_getuint16(in, &chan->assoc)) {
+                       return -1;
+               }
+       }
+       return 0;
+}
+
+/******************************************************************************\
+* Box output.
+\******************************************************************************/
+
+int jp2_box_put(jp2_box_t *box, jas_stream_t *out)
+{
+       jas_stream_t *tmpstream;
+       bool extlen;
+       bool dataflag;
+
+       tmpstream = 0;
+
+       dataflag = !(box->info->flags & (JP2_BOX_SUPER | JP2_BOX_NODATA));
+
+       if (dataflag) {
+               tmpstream = jas_stream_memopen(0, 0);
+               if (box->ops->putdata) {
+                       if ((*box->ops->putdata)(box, tmpstream)) {
+                               goto error;
+                       }
+               }
+               box->len = jas_stream_tell(tmpstream) + JP2_BOX_HDRLEN(false);
+               jas_stream_rewind(tmpstream);
+       }
+       extlen = (box->len >= (((uint_fast64_t)1) << 32)) != 0;
+       if (jp2_putuint32(out, extlen ? 1 : box->len)) {
+               goto error;
+       }
+       if (jp2_putuint32(out, box->type)) {
+               goto error;
+       }
+       if (extlen) {
+               if (jp2_putuint64(out, box->len)) {
+                       goto error;
+               }
+       }
+
+       if (dataflag) {
+               if (jas_stream_copy(out, tmpstream, box->len - JP2_BOX_HDRLEN(false))) {
+                       goto error;
+               }
+               jas_stream_close(tmpstream);
+       }
+
+       return 0;
+       abort();
+
+error:
+
+       if (tmpstream) {
+               jas_stream_close(tmpstream);
+       }
+       return -1;
+}
+
+static int jp2_jp_putdata(jp2_box_t *box, jas_stream_t *out)
+{
+       jp2_jp_t *jp = &box->data.jp;
+       if (jp2_putuint32(out, jp->magic)) {
+               return -1;
+       }
+       return 0;
+}
+
+static int jp2_ftyp_putdata(jp2_box_t *box, jas_stream_t *out)
+{
+       jp2_ftyp_t *ftyp = &box->data.ftyp;
+       unsigned int i;
+       if (jp2_putuint32(out, ftyp->majver) || jp2_putuint32(out, ftyp->minver)) {
+               return -1;
+       }
+       for (i = 0; i < ftyp->numcompatcodes; ++i) {
+               if (jp2_putuint32(out, ftyp->compatcodes[i])) {
+                       return -1;
+               }
+       }
+       return 0;
+}
+
+static int jp2_ihdr_putdata(jp2_box_t *box, jas_stream_t *out)
+{
+       jp2_ihdr_t *ihdr = &box->data.ihdr;
+       if (jp2_putuint32(out, ihdr->height) || jp2_putuint32(out, ihdr->width) ||
+         jp2_putuint16(out, ihdr->numcmpts) || jp2_putuint8(out, ihdr->bpc) ||
+         jp2_putuint8(out, ihdr->comptype) || jp2_putuint8(out, ihdr->csunk) ||
+         jp2_putuint8(out, ihdr->ipr)) {
+               return -1;
+       }
+       return 0;
+}
+
+static int jp2_bpcc_putdata(jp2_box_t *box, jas_stream_t *out)
+{
+       jp2_bpcc_t *bpcc = &box->data.bpcc;
+       unsigned int i;
+       for (i = 0; i < bpcc->numcmpts; ++i) {
+               if (jp2_putuint8(out, bpcc->bpcs[i])) {
+                       return -1;
+               }
+       }
+       return 0;
+}
+
+static int jp2_colr_putdata(jp2_box_t *box, jas_stream_t *out)
+{
+       jp2_colr_t *colr = &box->data.colr;
+       if (jp2_putuint8(out, colr->method) || jp2_putuint8(out, colr->pri) ||
+         jp2_putuint8(out, colr->approx)) {
+               return -1;
+       }
+       switch (colr->method) {
+       case JP2_COLR_ENUM:
+               if (jp2_putuint32(out, colr->csid)) {
+                       return -1;
+               }
+               break;
+       case JP2_COLR_ICC:
+               if (jas_stream_write(out, colr->iccp,
+                 JAS_CAST(int, colr->iccplen)) != JAS_CAST(int, colr->iccplen))
+                       return -1;
+               break;
+       }
+       return 0;
+}
+
+static int jp2_cdef_putdata(jp2_box_t *box, jas_stream_t *out)
+{
+       jp2_cdef_t *cdef = &box->data.cdef;
+       unsigned int i;
+       jp2_cdefchan_t *ent;
+
+       if (jp2_putuint16(out, cdef->numchans)) {
+               return -1;
+       }
+
+       for (i = 0; i < cdef->numchans; ++i) {
+               ent = &cdef->ents[i];
+               if (jp2_putuint16(out, ent->channo) ||
+                 jp2_putuint16(out, ent->type) ||
+                 jp2_putuint16(out, ent->assoc)) {
+                       return -1;
+               }
+       }
+       return 0;
+}
+
+/******************************************************************************\
+* Input operations for primitive types.
+\******************************************************************************/
+
+static int jp2_getuint8(jas_stream_t *in, uint_fast8_t *val)
+{
+       int c;
+       if ((c = jas_stream_getc(in)) == EOF) {
+               return -1;
+       }
+       if (val) {
+               *val = c;
+       }
+       return 0;
+}
+
+static int jp2_getuint16(jas_stream_t *in, uint_fast16_t *val)
+{
+       uint_fast16_t v;
+       int c;
+       if ((c = jas_stream_getc(in)) == EOF) {
+               return -1;
+       }
+       v = c;
+       if ((c = jas_stream_getc(in)) == EOF) {
+               return -1;
+       }
+       v = (v << 8) | c;
+       if (val) {
+               *val = v;
+       }
+       return 0;
+}
+
+static int jp2_getuint32(jas_stream_t *in, uint_fast32_t *val)
+{
+       uint_fast32_t v;
+       int c;
+       if ((c = jas_stream_getc(in)) == EOF) {
+               return -1;
+       }
+       v = c;
+       if ((c = jas_stream_getc(in)) == EOF) {
+               return -1;
+       }
+       v = (v << 8) | c;
+       if ((c = jas_stream_getc(in)) == EOF) {
+               return -1;
+       }
+       v = (v << 8) | c;
+       if ((c = jas_stream_getc(in)) == EOF) {
+               return -1;
+       }
+       v = (v << 8) | c;
+       if (val) {
+               *val = v;
+       }
+       return 0;
+}
+
+static int jp2_getuint64(jas_stream_t *in, uint_fast64_t *val)
+{
+       uint_fast64_t tmpval;
+       int i;
+       int c;
+
+       tmpval = 0;
+       for (i = 0; i < 8; ++i) {
+               tmpval <<= 8;
+               if ((c = jas_stream_getc(in)) == EOF) {
+                       return -1;
+               }
+               tmpval |= (c & 0xff);
+       }
+       *val = tmpval;
+
+       return 0;
+}
+
+/******************************************************************************\
+* Output operations for primitive types.
+\******************************************************************************/
+
+static int jp2_putuint8(jas_stream_t *out, uint_fast8_t val)
+{
+       if (jas_stream_putc(out, val & 0xff) == EOF) {
+               return -1;
+       }
+       return 0;
+}
+
+static int jp2_putuint16(jas_stream_t *out, uint_fast16_t val)
+{
+       if (jas_stream_putc(out, (val >> 8) & 0xff) == EOF ||
+         jas_stream_putc(out, val & 0xff) == EOF) {
+               return -1;
+       }
+       return 0;
+}
+
+static int jp2_putuint32(jas_stream_t *out, uint_fast32_t val)
+{
+       if (jas_stream_putc(out, (val >> 24) & 0xff) == EOF ||
+         jas_stream_putc(out, (val >> 16) & 0xff) == EOF ||
+         jas_stream_putc(out, (val >> 8) & 0xff) == EOF ||
+         jas_stream_putc(out, val & 0xff) == EOF) {
+               return -1;
+       }
+       return 0;
+}
+
+static int jp2_putuint64(jas_stream_t *out, uint_fast64_t val)
+{
+       if (jp2_putuint32(out, (val >> 32) & 0xffffffffUL) ||
+         jp2_putuint32(out, val & 0xffffffffUL)) {
+               return -1;
+       }
+       return 0;
+}
+
+/******************************************************************************\
+* Miscellaneous code.
+\******************************************************************************/
+
+jp2_boxinfo_t *jp2_boxinfolookup(int type)
+{
+       jp2_boxinfo_t *boxinfo;
+       for (boxinfo = jp2_boxinfos; boxinfo->name; ++boxinfo) {
+               if (boxinfo->type == type) {
+                       return boxinfo;
+               }
+       }
+       return &jp2_boxinfo_unk;
+}
+
+
+
+
+
+static void jp2_cmap_destroy(jp2_box_t *box)
+{
+       jp2_cmap_t *cmap = &box->data.cmap;
+       if (cmap->ents) {
+               jas_free(cmap->ents);
+       }
+}
+
+static int jp2_cmap_getdata(jp2_box_t *box, jas_stream_t *in)
+{
+       jp2_cmap_t *cmap = &box->data.cmap;
+       jp2_cmapent_t *ent;
+       unsigned int i;
+
+       cmap->numchans = (box->datalen) / 4;
+       if (!(cmap->ents = jas_malloc(cmap->numchans * sizeof(jp2_cmapent_t)))) {
+               return -1;
+       }
+       for (i = 0; i < cmap->numchans; ++i) {
+               ent = &cmap->ents[i];
+               if (jp2_getuint16(in, &ent->cmptno) ||
+                 jp2_getuint8(in, &ent->map) ||
+                 jp2_getuint8(in, &ent->pcol)) {
+                       return -1;
+               }
+       }
+       
+       return 0;
+}
+
+static int jp2_cmap_putdata(jp2_box_t *box, jas_stream_t *out)
+{
+       /* Eliminate compiler warning about unused variables. */
+       box = 0;
+       out = 0;
+
+       return -1;
+}
+
+static void jp2_cmap_dumpdata(jp2_box_t *box, FILE *out)
+{
+       jp2_cmap_t *cmap = &box->data.cmap;
+       unsigned int i;
+       jp2_cmapent_t *ent;
+       fprintf(out, "numchans = %d\n", (int) cmap->numchans);
+       for (i = 0; i < cmap->numchans; ++i) {
+               ent = &cmap->ents[i];
+               fprintf(out, "cmptno=%d; map=%d; pcol=%d\n",
+                 (int) ent->cmptno, (int) ent->map, (int) ent->pcol);
+       }
+}
+
+static void jp2_pclr_destroy(jp2_box_t *box)
+{
+       jp2_pclr_t *pclr = &box->data.pclr;
+       if (pclr->lutdata) {
+               jas_free(pclr->lutdata);
+       }
+       if (pclr->bpc)
+               jas_free(pclr->bpc);
+}
+
+static int jp2_pclr_getdata(jp2_box_t *box, jas_stream_t *in)
+{
+       jp2_pclr_t *pclr = &box->data.pclr;
+       int lutsize;
+       unsigned int i;
+       unsigned int j;
+       int_fast32_t x;
+
+       pclr->lutdata = 0;
+
+       if (jp2_getuint16(in, &pclr->numlutents) ||
+         jp2_getuint8(in, &pclr->numchans)) {
+               return -1;
+       }
+       lutsize = pclr->numlutents * pclr->numchans;
+       if (!(pclr->lutdata = jas_malloc(lutsize * sizeof(int_fast32_t)))) {
+               return -1;
+       }
+       if (!(pclr->bpc = jas_malloc(pclr->numchans * sizeof(uint_fast8_t)))) {
+               return -1;
+       }
+       for (i = 0; i < pclr->numchans; ++i) {
+               if (jp2_getuint8(in, &pclr->bpc[i])) {
+                       return -1;
+               }
+       }
+       for (i = 0; i < pclr->numlutents; ++i) {
+               for (j = 0; j < pclr->numchans; ++j) {
+                       if (jp2_getint(in, (pclr->bpc[j] & 0x80) != 0,
+                         (pclr->bpc[j] & 0x7f) + 1, &x)) {
+                               return -1;
+                       }
+                       pclr->lutdata[i * pclr->numchans + j] = x;
+               }
+       }
+       return 0;
+}
+
+static int jp2_pclr_putdata(jp2_box_t *box, jas_stream_t *out)
+{
+#if 0
+       jp2_pclr_t *pclr = &box->data.pclr;
+#endif
+/* Eliminate warning about unused variable. */
+box = 0;
+out = 0;
+       return -1;
+}
+
+static void jp2_pclr_dumpdata(jp2_box_t *box, FILE *out)
+{
+       jp2_pclr_t *pclr = &box->data.pclr;
+       unsigned int i;
+       int j;
+       fprintf(out, "numents=%d; numchans=%d\n", (int) pclr->numlutents,
+         (int) pclr->numchans);
+       for (i = 0; i < pclr->numlutents; ++i) {
+               for (j = 0; j < pclr->numchans; ++j) {
+                       fprintf(out, "LUT[%d][%d]=%d\n", i, j, pclr->lutdata[i * pclr->numchans + j]);
+               }
+       }
+}
+
+static int jp2_getint(jas_stream_t *in, int s, int n, int_fast32_t *val)
+{
+       int c;
+       int i;
+       uint_fast32_t v;
+       int m;
+
+       m = (n + 7) / 8;
+
+       v = 0;
+       for (i = 0; i < m; ++i) {
+               if ((c = jas_stream_getc(in)) == EOF) {
+                       return -1;
+               }
+               v = (v << 8) | c;
+       }
+       v &= ONES(n);
+       if (s) {
+               int sb;
+               sb = v & (1 << (8 * m - 1));
+               *val = ((~v) + 1) & ONES(8 * m);
+               if (sb) {
+                       *val = -*val;
+               }
+       } else {
+               *val = v;
+       }
+
+       return 0;
+}
+
+jp2_cdefchan_t *jp2_cdef_lookup(jp2_cdef_t *cdef, int channo)
+{
+       unsigned int i;
+       jp2_cdefchan_t *cdefent;
+       for (i = 0; i < cdef->numchans; ++i) {
+               cdefent = &cdef->ents[i];
+               if (cdefent->channo == JAS_CAST(unsigned int, channo)) {
+                       return cdefent;
+               }
+       }
+       return 0;
+}
diff --git a/src/libjasper/jp2/jp2_cod.h b/src/libjasper/jp2/jp2_cod.h
new file mode 100644 (file)
index 0000000..70e1ffb
--- /dev/null
@@ -0,0 +1,304 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * JP2 Library
+ *
+ * $Id$
+ */
+
+#ifndef JP2_COD_H
+#define JP2_COD_H
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include "jasper/jas_types.h"
+
+/******************************************************************************\
+* Macros.
+\******************************************************************************/
+
+#define        JP2_SPTOBPC(s, p) \
+       ((((p) - 1) & 0x7f) | (((s) & 1) << 7))
+
+/******************************************************************************\
+* Box class.
+\******************************************************************************/
+
+#define        JP2_BOX_HDRLEN(ext) ((ext) ? 16 : 8)
+
+/* Box types. */
+#define        JP2_BOX_JP              0x6a502020      /* Signature */
+#define JP2_BOX_FTYP   0x66747970      /* File Type */
+#define        JP2_BOX_JP2H    0x6a703268      /* JP2 Header */
+#define        JP2_BOX_IHDR    0x69686472      /* Image Header */
+#define        JP2_BOX_BPCC    0x62706363      /* Bits Per Component */
+#define        JP2_BOX_COLR    0x636f6c72      /* Color Specification */
+#define        JP2_BOX_PCLR    0x70636c72      /* Palette */
+#define        JP2_BOX_CMAP    0x636d6170      /* Component Mapping */
+#define        JP2_BOX_CDEF    0x63646566      /* Channel Definition */
+#define        JP2_BOX_RES             0x72657320      /* Resolution */
+#define        JP2_BOX_RESC    0x72657363      /* Capture Resolution */
+#define        JP2_BOX_RESD    0x72657364      /* Default Display Resolution */
+#define        JP2_BOX_JP2C    0x6a703263      /* Contiguous Code Stream */
+#define        JP2_BOX_JP2I    0x6a703269      /* Intellectual Property */
+#define        JP2_BOX_XML             0x786d6c20      /* XML */
+#define        JP2_BOX_UUID    0x75756964      /* UUID */
+#define        JP2_BOX_UINF    0x75696e66      /* UUID Info */
+#define        JP2_BOX_ULST    0x75637374      /* UUID List */
+#define        JP2_BOX_URL             0x75726c20      /* URL */
+
+#define        JP2_BOX_SUPER   0x01
+#define        JP2_BOX_NODATA  0x02
+
+/* JP box data. */
+
+#define        JP2_JP_MAGIC    0x0d0a870a
+#define        JP2_JP_LEN              12
+
+typedef struct {
+       uint_fast32_t magic;
+} jp2_jp_t;
+
+/* FTYP box data. */
+
+#define        JP2_FTYP_MAXCOMPATCODES 32
+#define        JP2_FTYP_MAJVER         0x6a703220
+#define        JP2_FTYP_MINVER         0
+#define        JP2_FTYP_COMPATCODE             JP2_FTYP_MAJVER
+
+typedef struct {
+       uint_fast32_t majver;
+       uint_fast32_t minver;
+       uint_fast32_t numcompatcodes;
+       uint_fast32_t compatcodes[JP2_FTYP_MAXCOMPATCODES];
+} jp2_ftyp_t;
+
+/* IHDR box data. */
+
+#define        JP2_IHDR_COMPTYPE       7
+#define        JP2_IHDR_BPCNULL        255
+
+typedef struct {
+       uint_fast32_t width;
+       uint_fast32_t height;
+       uint_fast16_t numcmpts;
+       uint_fast8_t bpc;
+       uint_fast8_t comptype;
+       uint_fast8_t csunk;
+       uint_fast8_t ipr;
+} jp2_ihdr_t;
+
+/* BPCC box data. */
+
+typedef struct {
+       uint_fast16_t numcmpts;
+       uint_fast8_t *bpcs;
+} jp2_bpcc_t;
+
+/* COLR box data. */
+
+#define        JP2_COLR_ENUM   1
+#define        JP2_COLR_ICC    2
+#define        JP2_COLR_PRI    0
+
+#define        JP2_COLR_SRGB   16
+#define        JP2_COLR_SGRAY  17
+#define        JP2_COLR_SYCC   18
+
+typedef struct {
+       uint_fast8_t method;
+       uint_fast8_t pri;
+       uint_fast8_t approx;
+       uint_fast32_t csid;
+       uint_fast8_t *iccp;
+       int iccplen;
+       /* XXX - Someday we ought to add ICC profile data here. */
+} jp2_colr_t;
+
+/* PCLR box data. */
+
+typedef struct {
+       uint_fast16_t numlutents;
+       uint_fast8_t numchans;
+       int_fast32_t *lutdata;
+       uint_fast8_t *bpc;
+} jp2_pclr_t;
+
+/* CDEF box per-channel data. */
+
+#define JP2_CDEF_RGB_R 1
+#define JP2_CDEF_RGB_G 2
+#define JP2_CDEF_RGB_B 3
+
+#define JP2_CDEF_YCBCR_Y       1
+#define JP2_CDEF_YCBCR_CB      2
+#define JP2_CDEF_YCBCR_CR      3
+
+#define        JP2_CDEF_GRAY_Y 1
+
+#define        JP2_CDEF_TYPE_COLOR     0
+#define        JP2_CDEF_TYPE_OPACITY   1
+#define        JP2_CDEF_TYPE_UNSPEC    65535
+#define        JP2_CDEF_ASOC_ALL       0
+#define        JP2_CDEF_ASOC_NONE      65535
+
+typedef struct {
+       uint_fast16_t channo;
+       uint_fast16_t type;
+       uint_fast16_t assoc;
+} jp2_cdefchan_t;
+
+/* CDEF box data. */
+
+typedef struct {
+       uint_fast16_t numchans;
+       jp2_cdefchan_t *ents;
+} jp2_cdef_t;
+
+typedef struct {
+       uint_fast16_t cmptno;
+       uint_fast8_t map;
+       uint_fast8_t pcol;
+} jp2_cmapent_t;
+
+typedef struct {
+       uint_fast16_t numchans;
+       jp2_cmapent_t *ents;
+} jp2_cmap_t;
+
+#define        JP2_CMAP_DIRECT         0
+#define        JP2_CMAP_PALETTE        1
+
+/* Generic box. */
+
+struct jp2_boxops_s;
+typedef struct {
+
+       struct jp2_boxops_s *ops;
+       struct jp2_boxinfo_s *info;
+
+       uint_fast32_t type;
+
+       /* The length of the box including the (variable-length) header. */
+       uint_fast32_t len;
+
+       /* The length of the box data. */
+       uint_fast32_t datalen;
+
+       union {
+               jp2_jp_t jp;
+               jp2_ftyp_t ftyp;
+               jp2_ihdr_t ihdr;
+               jp2_bpcc_t bpcc;
+               jp2_colr_t colr;
+               jp2_pclr_t pclr;
+               jp2_cdef_t cdef;
+               jp2_cmap_t cmap;
+       } data;
+
+} jp2_box_t;
+
+typedef struct jp2_boxops_s {
+       void (*init)(jp2_box_t *box);
+       void (*destroy)(jp2_box_t *box);
+       int (*getdata)(jp2_box_t *box, jas_stream_t *in);
+       int (*putdata)(jp2_box_t *box, jas_stream_t *out);
+       void (*dumpdata)(jp2_box_t *box, FILE *out);
+} jp2_boxops_t;
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+typedef struct jp2_boxinfo_s {
+       int type;
+       char *name;
+       int flags;
+       jp2_boxops_t ops;
+} jp2_boxinfo_t;
+
+/******************************************************************************\
+* Box class.
+\******************************************************************************/
+
+jp2_box_t *jp2_box_create(int type);
+void jp2_box_destroy(jp2_box_t *box);
+jp2_box_t *jp2_box_get(jas_stream_t *in);
+int jp2_box_put(jp2_box_t *box, jas_stream_t *out);
+
+#define JP2_DTYPETOBPC(dtype) \
+  ((JAS_IMAGE_CDT_GETSGND(dtype) << 7) | (JAS_IMAGE_CDT_GETPREC(dtype) - 1))
+#define        JP2_BPCTODTYPE(bpc) \
+  (JAS_IMAGE_CDT_SETSGND(bpc >> 7) | JAS_IMAGE_CDT_SETPREC((bpc & 0x7f) + 1))
+
+#define ICC_CS_RGB     0x52474220
+#define ICC_CS_YCBCR   0x59436272
+#define ICC_CS_GRAY    0x47524159
+
+jp2_cdefchan_t *jp2_cdef_lookup(jp2_cdef_t *cdef, int channo);
+
+
+#endif
diff --git a/src/libjasper/jp2/jp2_dec.c b/src/libjasper/jp2/jp2_dec.c
new file mode 100644 (file)
index 0000000..65772de
--- /dev/null
@@ -0,0 +1,603 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * JP2 Library
+ *
+ * $Id$
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include "jasper/jas_image.h"
+#include "jasper/jas_stream.h"
+#include "jasper/jas_math.h"
+#include "jasper/jas_debug.h"
+#include "jasper/jas_malloc.h"
+#include "jasper/jas_version.h"
+
+#include "jp2_cod.h"
+#include "jp2_dec.h"
+
+#define        JP2_VALIDATELEN (JAS_MIN(JP2_JP_LEN + 16, JAS_STREAM_MAXPUTBACK))
+
+static jp2_dec_t *jp2_dec_create(void);
+static void jp2_dec_destroy(jp2_dec_t *dec);
+static int jp2_getcs(jp2_colr_t *colr);
+static int fromiccpcs(int cs);
+static int jp2_getct(int colorspace, int type, int assoc);
+
+/******************************************************************************\
+* Functions.
+\******************************************************************************/
+
+jas_image_t *jp2_decode(jas_stream_t *in, char *optstr)
+{
+       jp2_box_t *box;
+       int found;
+       jas_image_t *image;
+       jp2_dec_t *dec;
+       bool samedtype;
+       int dtype;
+       unsigned int i;
+       jp2_cmap_t *cmapd;
+       jp2_pclr_t *pclrd;
+       jp2_cdef_t *cdefd;
+       unsigned int channo;
+       int newcmptno;
+       int_fast32_t *lutents;
+#if 0
+       jp2_cdefchan_t *cdefent;
+       int cmptno;
+#endif
+       jp2_cmapent_t *cmapent;
+       jas_icchdr_t icchdr;
+       jas_iccprof_t *iccprof;
+
+       dec = 0;
+       box = 0;
+       image = 0;
+
+       if (!(dec = jp2_dec_create())) {
+               goto error;
+       }
+
+       /* Get the first box.  This should be a JP box. */
+       if (!(box = jp2_box_get(in))) {
+               jas_eprintf("error: cannot get box\n");
+               goto error;
+       }
+       if (box->type != JP2_BOX_JP) {
+               jas_eprintf("error: expecting signature box\n");
+               goto error;
+       }
+       if (box->data.jp.magic != JP2_JP_MAGIC) {
+               jas_eprintf("incorrect magic number\n");
+               goto error;
+       }
+       jp2_box_destroy(box);
+       box = 0;
+
+       /* Get the second box.  This should be a FTYP box. */
+       if (!(box = jp2_box_get(in))) {
+               goto error;
+       }
+       if (box->type != JP2_BOX_FTYP) {
+               jas_eprintf("expecting file type box\n");
+               goto error;
+       }
+       jp2_box_destroy(box);
+       box = 0;
+
+       /* Get more boxes... */
+       found = 0;
+       while ((box = jp2_box_get(in))) {
+               if (jas_getdbglevel() >= 1) {
+                       jas_eprintf("box type %s\n", box->info->name);
+               }
+               switch (box->type) {
+               case JP2_BOX_JP2C:
+                       found = 1;
+                       break;
+               case JP2_BOX_IHDR:
+                       if (!dec->ihdr) {
+                               dec->ihdr = box;
+                               box = 0;
+                       }
+                       break;
+               case JP2_BOX_BPCC:
+                       if (!dec->bpcc) {
+                               dec->bpcc = box;
+                               box = 0;
+                       }
+                       break;
+               case JP2_BOX_CDEF:
+                       if (!dec->cdef) {
+                               dec->cdef = box;
+                               box = 0;
+                       }
+                       break;
+               case JP2_BOX_PCLR:
+                       if (!dec->pclr) {
+                               dec->pclr = box;
+                               box = 0;
+                       }
+                       break;
+               case JP2_BOX_CMAP:
+                       if (!dec->cmap) {
+                               dec->cmap = box;
+                               box = 0;
+                       }
+                       break;
+               case JP2_BOX_COLR:
+                       if (!dec->colr) {
+                               dec->colr = box;
+                               box = 0;
+                       }
+                       break;
+               }
+               if (box) {
+                       jp2_box_destroy(box);
+                       box = 0;
+               }
+               if (found) {
+                       break;
+               }
+       }
+
+       if (!found) {
+               jas_eprintf("error: no code stream found\n");
+               goto error;
+       }
+
+       if (!(dec->image = jpc_decode(in, optstr))) {
+               jas_eprintf("error: cannot decode code stream\n");
+               goto error;
+       }
+
+       /* An IHDR box must be present. */
+       if (!dec->ihdr) {
+               jas_eprintf("error: missing IHDR box\n");
+               goto error;
+       }
+
+       /* Does the number of components indicated in the IHDR box match
+         the value specified in the code stream? */
+       if (dec->ihdr->data.ihdr.numcmpts != JAS_CAST(uint, jas_image_numcmpts(dec->image))) {
+               jas_eprintf("warning: number of components mismatch\n");
+       }
+
+       /* At least one component must be present. */
+       if (!jas_image_numcmpts(dec->image)) {
+               jas_eprintf("error: no components\n");
+               goto error;
+       }
+
+       /* Determine if all components have the same data type. */
+       samedtype = true;
+       dtype = jas_image_cmptdtype(dec->image, 0);
+       for (i = 1; i < JAS_CAST(uint, jas_image_numcmpts(dec->image)); ++i) {
+               if (jas_image_cmptdtype(dec->image, i) != dtype) {
+                       samedtype = false;
+                       break;
+               }
+       }
+
+       /* Is the component data type indicated in the IHDR box consistent
+         with the data in the code stream? */
+       if ((samedtype && dec->ihdr->data.ihdr.bpc != JP2_DTYPETOBPC(dtype)) ||
+         (!samedtype && dec->ihdr->data.ihdr.bpc != JP2_IHDR_BPCNULL)) {
+               jas_eprintf("warning: component data type mismatch\n");
+       }
+
+       /* Is the compression type supported? */
+       if (dec->ihdr->data.ihdr.comptype != JP2_IHDR_COMPTYPE) {
+               jas_eprintf("error: unsupported compression type\n");
+               goto error;
+       }
+
+       if (dec->bpcc) {
+               /* Is the number of components indicated in the BPCC box
+                 consistent with the code stream data? */
+               if (dec->bpcc->data.bpcc.numcmpts != JAS_CAST(uint, jas_image_numcmpts(
+                 dec->image))) {
+                       jas_eprintf("warning: number of components mismatch\n");
+               }
+               /* Is the component data type information indicated in the BPCC
+                 box consistent with the code stream data? */
+               if (!samedtype) {
+                       for (i = 0; i < JAS_CAST(uint, jas_image_numcmpts(dec->image)); ++i) {
+                               if (jas_image_cmptdtype(dec->image, i) != JP2_BPCTODTYPE(dec->bpcc->data.bpcc.bpcs[i])) {
+                                       jas_eprintf("warning: component data type mismatch\n");
+                               }
+                       }
+               } else {
+                       jas_eprintf("warning: superfluous BPCC box\n");
+               }
+       }
+
+       /* A COLR box must be present. */
+       if (!dec->colr) {
+               jas_eprintf("error: no COLR box\n");
+               goto error;
+       }
+
+       switch (dec->colr->data.colr.method) {
+       case JP2_COLR_ENUM:
+               jas_image_setclrspc(dec->image, jp2_getcs(&dec->colr->data.colr));
+               break;
+       case JP2_COLR_ICC:
+               iccprof = jas_iccprof_createfrombuf(dec->colr->data.colr.iccp,
+                 dec->colr->data.colr.iccplen);
+               assert(iccprof);
+               jas_iccprof_gethdr(iccprof, &icchdr);
+               jas_eprintf("ICC Profile CS %08x\n", icchdr.colorspc);
+               jas_image_setclrspc(dec->image, fromiccpcs(icchdr.colorspc));
+               dec->image->cmprof_ = jas_cmprof_createfromiccprof(iccprof);
+               assert(dec->image->cmprof_);
+               jas_iccprof_destroy(iccprof);
+               break;
+       }
+
+       /* If a CMAP box is present, a PCLR box must also be present. */
+       if (dec->cmap && !dec->pclr) {
+               jas_eprintf("warning: missing PCLR box or superfluous CMAP box\n");
+               jp2_box_destroy(dec->cmap);
+               dec->cmap = 0;
+       }
+
+       /* If a CMAP box is not present, a PCLR box must not be present. */
+       if (!dec->cmap && dec->pclr) {
+               jas_eprintf("warning: missing CMAP box or superfluous PCLR box\n");
+               jp2_box_destroy(dec->pclr);
+               dec->pclr = 0;
+       }
+
+       /* Determine the number of channels (which is essentially the number
+         of components after any palette mappings have been applied). */
+       dec->numchans = dec->cmap ? dec->cmap->data.cmap.numchans : JAS_CAST(uint, jas_image_numcmpts(dec->image));
+
+       /* Perform a basic sanity check on the CMAP box if present. */
+       if (dec->cmap) {
+               for (i = 0; i < dec->numchans; ++i) {
+                       /* Is the component number reasonable? */
+                       if (dec->cmap->data.cmap.ents[i].cmptno >= JAS_CAST(uint, jas_image_numcmpts(dec->image))) {
+                               jas_eprintf("error: invalid component number in CMAP box\n");
+                               goto error;
+                       }
+                       /* Is the LUT index reasonable? */
+                       if (dec->cmap->data.cmap.ents[i].pcol >= dec->pclr->data.pclr.numchans) {
+                               jas_eprintf("error: invalid CMAP LUT index\n");
+                               goto error;
+                       }
+               }
+       }
+
+       /* Allocate space for the channel-number to component-number LUT. */
+       if (!(dec->chantocmptlut = jas_malloc(dec->numchans * sizeof(uint_fast16_t)))) {
+               jas_eprintf("error: no memory\n");
+               goto error;
+       }
+
+       if (!dec->cmap) {
+               for (i = 0; i < dec->numchans; ++i) {
+                       dec->chantocmptlut[i] = i;
+               }
+       } else {
+               cmapd = &dec->cmap->data.cmap;
+               pclrd = &dec->pclr->data.pclr;
+               cdefd = &dec->cdef->data.cdef;
+               for (channo = 0; channo < cmapd->numchans; ++channo) {
+                       cmapent = &cmapd->ents[channo];
+                       if (cmapent->map == JP2_CMAP_DIRECT) {
+                               dec->chantocmptlut[channo] = channo;
+                       } else if (cmapent->map == JP2_CMAP_PALETTE) {
+                               lutents = jas_malloc(pclrd->numlutents * sizeof(int_fast32_t));
+                               for (i = 0; i < pclrd->numlutents; ++i) {
+                                       lutents[i] = pclrd->lutdata[cmapent->pcol + i * pclrd->numchans];
+                               }
+                               newcmptno = jas_image_numcmpts(dec->image);
+                               jas_image_depalettize(dec->image, cmapent->cmptno, pclrd->numlutents, lutents, JP2_BPCTODTYPE(pclrd->bpc[cmapent->pcol]), newcmptno);
+                               dec->chantocmptlut[channo] = newcmptno;
+                               jas_free(lutents);
+#if 0
+                               if (dec->cdef) {
+                                       cdefent = jp2_cdef_lookup(cdefd, channo);
+                                       if (!cdefent) {
+                                               abort();
+                                       }
+                               jas_image_setcmpttype(dec->image, newcmptno, jp2_getct(jas_image_clrspc(dec->image), cdefent->type, cdefent->assoc));
+                               } else {
+                               jas_image_setcmpttype(dec->image, newcmptno, jp2_getct(jas_image_clrspc(dec->image), 0, channo + 1));
+                               }
+#endif
+                       }
+               }
+       }
+
+       /* Mark all components as being of unknown type. */
+
+       for (i = 0; i < JAS_CAST(uint, jas_image_numcmpts(dec->image)); ++i) {
+               jas_image_setcmpttype(dec->image, i, JAS_IMAGE_CT_UNKNOWN);
+       }
+
+       /* Determine the type of each component. */
+       if (dec->cdef) {
+               for (i = 0; i < dec->numchans; ++i) {
+                       jas_image_setcmpttype(dec->image,
+                         dec->chantocmptlut[dec->cdef->data.cdef.ents[i].channo],
+                         jp2_getct(jas_image_clrspc(dec->image),
+                         dec->cdef->data.cdef.ents[i].type, dec->cdef->data.cdef.ents[i].assoc));
+               }
+       } else {
+               for (i = 0; i < dec->numchans; ++i) {
+                       jas_image_setcmpttype(dec->image, dec->chantocmptlut[i],
+                         jp2_getct(jas_image_clrspc(dec->image), 0, i + 1));
+               }
+       }
+
+       /* Delete any components that are not of interest. */
+       for (i = jas_image_numcmpts(dec->image); i > 0; --i) {
+               if (jas_image_cmpttype(dec->image, i - 1) == JAS_IMAGE_CT_UNKNOWN) {
+                       jas_image_delcmpt(dec->image, i - 1);
+               }
+       }
+
+       /* Ensure that some components survived. */
+       if (!jas_image_numcmpts(dec->image)) {
+               jas_eprintf("error: no components\n");
+               goto error;
+       }
+#if 0
+jas_eprintf("no of components is %d\n", jas_image_numcmpts(dec->image));
+#endif
+
+       /* Prevent the image from being destroyed later. */
+       image = dec->image;
+       dec->image = 0;
+
+       jp2_dec_destroy(dec);
+
+       return image;
+
+error:
+       if (box) {
+               jp2_box_destroy(box);
+       }
+       if (dec) {
+               jp2_dec_destroy(dec);
+       }
+       return 0;
+}
+
+int jp2_validate(jas_stream_t *in)
+{
+       char buf[JP2_VALIDATELEN];
+       int i;
+       int n;
+#if 0
+       jas_stream_t *tmpstream;
+       jp2_box_t *box;
+#endif
+
+       assert(JAS_STREAM_MAXPUTBACK >= JP2_VALIDATELEN);
+
+       /* Read the validation data (i.e., the data used for detecting
+         the format). */
+       if ((n = jas_stream_read(in, buf, JP2_VALIDATELEN)) < 0) {
+               return -1;
+       }
+
+       /* Put the validation data back onto the stream, so that the
+         stream position will not be changed. */
+       for (i = n - 1; i >= 0; --i) {
+               if (jas_stream_ungetc(in, buf[i]) == EOF) {
+                       return -1;
+               }
+       }
+
+       /* Did we read enough data? */
+       if (n < JP2_VALIDATELEN) {
+               return -1;
+       }
+
+       /* Is the box type correct? */
+       if (((buf[4] << 24) | (buf[5] << 16) | (buf[6] << 8) | buf[7]) !=
+         JP2_BOX_JP)
+       {
+               return -1;
+       }
+
+       return 0;
+}
+
+static jp2_dec_t *jp2_dec_create(void)
+{
+       jp2_dec_t *dec;
+
+       if (!(dec = jas_malloc(sizeof(jp2_dec_t)))) {
+               return 0;
+       }
+       dec->ihdr = 0;
+       dec->bpcc = 0;
+       dec->cdef = 0;
+       dec->pclr = 0;
+       dec->image = 0;
+       dec->chantocmptlut = 0;
+       dec->cmap = 0;
+       dec->colr = 0;
+       return dec;
+}
+
+static void jp2_dec_destroy(jp2_dec_t *dec)
+{
+       if (dec->ihdr) {
+               jp2_box_destroy(dec->ihdr);
+       }
+       if (dec->bpcc) {
+               jp2_box_destroy(dec->bpcc);
+       }
+       if (dec->cdef) {
+               jp2_box_destroy(dec->cdef);
+       }
+       if (dec->pclr) {
+               jp2_box_destroy(dec->pclr);
+       }
+       if (dec->image) {
+               jas_image_destroy(dec->image);
+       }
+       if (dec->cmap) {
+               jp2_box_destroy(dec->cmap);
+       }
+       if (dec->colr) {
+               jp2_box_destroy(dec->colr);
+       }
+       if (dec->chantocmptlut) {
+               jas_free(dec->chantocmptlut);
+       }
+       jas_free(dec);
+}
+
+static int jp2_getct(int colorspace, int type, int assoc)
+{
+       if (type == 1 && assoc == 0) {
+               return JAS_IMAGE_CT_OPACITY;
+       }
+       if (type == 0 && assoc >= 1 && assoc <= 65534) {
+               switch (colorspace) {
+               case JAS_CLRSPC_FAM_RGB:
+                       switch (assoc) {
+                       case JP2_CDEF_RGB_R:
+                               return JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_R);
+                               break;
+                       case JP2_CDEF_RGB_G:
+                               return JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_G);
+                               break;
+                       case JP2_CDEF_RGB_B:
+                               return JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_B);
+                               break;
+                       }
+                       break;
+               case JAS_CLRSPC_FAM_YCBCR:
+                       switch (assoc) {
+                       case JP2_CDEF_YCBCR_Y:
+                               return JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_YCBCR_Y);
+                               break;
+                       case JP2_CDEF_YCBCR_CB:
+                               return JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_YCBCR_CB);
+                               break;
+                       case JP2_CDEF_YCBCR_CR:
+                               return JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_YCBCR_CR);
+                               break;
+                       }
+                       break;
+               case JAS_CLRSPC_FAM_GRAY:
+                       switch (assoc) {
+                       case JP2_CDEF_GRAY_Y:
+                               return JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_GRAY_Y);
+                               break;
+                       }
+                       break;
+               default:
+                       return JAS_IMAGE_CT_COLOR(assoc - 1);
+                       break;
+               }
+       }
+       return JAS_IMAGE_CT_UNKNOWN;
+}
+
+static int jp2_getcs(jp2_colr_t *colr)
+{
+       if (colr->method == JP2_COLR_ENUM) {
+               switch (colr->csid) {
+               case JP2_COLR_SRGB:
+                       return JAS_CLRSPC_SRGB;
+                       break;
+               case JP2_COLR_SYCC:
+                       return JAS_CLRSPC_SYCBCR;
+                       break;
+               case JP2_COLR_SGRAY:
+                       return JAS_CLRSPC_SGRAY;
+                       break;
+               }
+       }
+       return JAS_CLRSPC_UNKNOWN;
+}
+
+static int fromiccpcs(int cs)
+{
+       switch (cs) {
+       case ICC_CS_RGB:
+               return JAS_CLRSPC_GENRGB;
+               break;
+       case ICC_CS_YCBCR:
+               return JAS_CLRSPC_GENYCBCR;
+               break;
+       case ICC_CS_GRAY:
+               return JAS_CLRSPC_GENGRAY;
+               break;
+       }
+       return JAS_CLRSPC_UNKNOWN;
+}
diff --git a/src/libjasper/jp2/jp2_dec.h b/src/libjasper/jp2/jp2_dec.h
new file mode 100644 (file)
index 0000000..1cb95a2
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+#ifndef JP2_DEC_H
+#define JP2_DEC_H
+
+#include "jasper/jas_image.h"
+#include "jasper/jas_stream.h"
+#include "jp2_cod.h"
+
+typedef struct {
+
+       jp2_box_t *pclr;
+       jp2_box_t *cdef;
+       jp2_box_t *ihdr;
+       jp2_box_t *bpcc;
+       jp2_box_t *cmap;
+       jp2_box_t *colr;
+       jas_image_t *image;
+       uint_fast16_t numchans;
+       uint_fast16_t *chantocmptlut;
+
+} jp2_dec_t;
+
+#endif
diff --git a/src/libjasper/jp2/jp2_enc.c b/src/libjasper/jp2/jp2_enc.c
new file mode 100644 (file)
index 0000000..9e1e1fc
--- /dev/null
@@ -0,0 +1,436 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * JP2 Library
+ *
+ * $Id$
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <assert.h>
+#include "jasper/jas_malloc.h"
+#include "jasper/jas_image.h"
+#include "jasper/jas_stream.h"
+#include "jasper/jas_cm.h"
+#include "jasper/jas_icc.h"
+#include "jp2_cod.h"
+
+static uint_fast32_t jp2_gettypeasoc(int colorspace, int ctype);
+static int clrspctojp2(jas_clrspc_t clrspc);
+
+/******************************************************************************\
+* Functions.
+\******************************************************************************/
+
+int jp2_encode(jas_image_t *image, jas_stream_t *out, char *optstr)
+{
+       jp2_box_t *box;
+       jp2_ftyp_t *ftyp;
+       jp2_ihdr_t *ihdr;
+       jas_stream_t *tmpstream;
+       int allcmptssame;
+       jp2_bpcc_t *bpcc;
+       long len;
+       uint_fast16_t cmptno;
+       jp2_colr_t *colr;
+       char buf[4096];
+       uint_fast32_t overhead;
+       jp2_cdefchan_t *cdefchanent;
+       jp2_cdef_t *cdef;
+       int i;
+       uint_fast32_t typeasoc;
+jas_iccprof_t *iccprof;
+jas_stream_t *iccstream;
+int pos;
+int needcdef;
+int prec;
+int sgnd;
+
+       box = 0;
+       tmpstream = 0;
+
+       allcmptssame = 1;
+       sgnd = jas_image_cmptsgnd(image, 0);
+       prec = jas_image_cmptprec(image, 0);
+       for (i = 1; i < jas_image_numcmpts(image); ++i) {
+               if (jas_image_cmptsgnd(image, i) != sgnd ||
+                 jas_image_cmptprec(image, i) != prec) {
+                       allcmptssame = 0;
+                       break;
+               }
+       }
+
+       /* Output the signature box. */
+
+       if (!(box = jp2_box_create(JP2_BOX_JP))) {
+               goto error;
+       }
+       box->data.jp.magic = JP2_JP_MAGIC;
+       if (jp2_box_put(box, out)) {
+               goto error;
+       }
+       jp2_box_destroy(box);
+       box = 0;
+
+       /* Output the file type box. */
+
+       if (!(box = jp2_box_create(JP2_BOX_FTYP))) {
+               goto error;
+       }
+       ftyp = &box->data.ftyp;
+       ftyp->majver = JP2_FTYP_MAJVER;
+       ftyp->minver = JP2_FTYP_MINVER;
+       ftyp->numcompatcodes = 1;
+       ftyp->compatcodes[0] = JP2_FTYP_COMPATCODE;
+       if (jp2_box_put(box, out)) {
+               goto error;
+       }
+       jp2_box_destroy(box);
+       box = 0;
+
+       /*
+        * Generate the data portion of the JP2 header box.
+        * We cannot simply output the header for this box
+        * since we do not yet know the correct value for the length
+        * field.
+        */
+
+       if (!(tmpstream = jas_stream_memopen(0, 0))) {
+               goto error;
+       }
+
+       /* Generate image header box. */
+
+       if (!(box = jp2_box_create(JP2_BOX_IHDR))) {
+               goto error;
+       }
+       ihdr = &box->data.ihdr;
+       ihdr->width = jas_image_width(image);
+       ihdr->height = jas_image_height(image);
+       ihdr->numcmpts = jas_image_numcmpts(image);
+       ihdr->bpc = allcmptssame ? JP2_SPTOBPC(jas_image_cmptsgnd(image, 0),
+         jas_image_cmptprec(image, 0)) : JP2_IHDR_BPCNULL;
+       ihdr->comptype = JP2_IHDR_COMPTYPE;
+       ihdr->csunk = 0;
+       ihdr->ipr = 0;
+       if (jp2_box_put(box, tmpstream)) {
+               goto error;
+       }
+       jp2_box_destroy(box);
+       box = 0;
+
+       /* Generate bits per component box. */
+
+       if (!allcmptssame) {
+               if (!(box = jp2_box_create(JP2_BOX_BPCC))) {
+                       goto error;
+               }
+               bpcc = &box->data.bpcc;
+               bpcc->numcmpts = jas_image_numcmpts(image);
+               if (!(bpcc->bpcs = jas_malloc(bpcc->numcmpts *
+                 sizeof(uint_fast8_t)))) {
+                       goto error;
+               }
+               for (cmptno = 0; cmptno < bpcc->numcmpts; ++cmptno) {
+                       bpcc->bpcs[cmptno] = JP2_SPTOBPC(jas_image_cmptsgnd(image,
+                         cmptno), jas_image_cmptprec(image, cmptno));
+               }
+               if (jp2_box_put(box, tmpstream)) {
+                       goto error;
+               }
+               jp2_box_destroy(box);
+               box = 0;
+       }
+
+       /* Generate color specification box. */
+
+       if (!(box = jp2_box_create(JP2_BOX_COLR))) {
+               goto error;
+       }
+       colr = &box->data.colr;
+       switch (jas_image_clrspc(image)) {
+       case JAS_CLRSPC_SRGB:
+       case JAS_CLRSPC_SYCBCR:
+       case JAS_CLRSPC_SGRAY:
+               colr->method = JP2_COLR_ENUM;
+               colr->csid = clrspctojp2(jas_image_clrspc(image));
+               colr->pri = JP2_COLR_PRI;
+               colr->approx = 0;
+               break;
+       default:
+               colr->method = JP2_COLR_ICC;
+               colr->pri = JP2_COLR_PRI;
+               colr->approx = 0;
+               iccprof = jas_iccprof_createfromcmprof(jas_image_cmprof(image));
+               assert(iccprof);
+               iccstream = jas_stream_memopen(0, 0);
+               assert(iccstream);
+               if (jas_iccprof_save(iccprof, iccstream))
+                       abort();
+               if ((pos = jas_stream_tell(iccstream)) < 0)
+                       abort();
+               colr->iccplen = pos;
+               colr->iccp = jas_malloc(pos);
+               assert(colr->iccp);
+               jas_stream_rewind(iccstream);
+               if (jas_stream_read(iccstream, colr->iccp, colr->iccplen) != colr->iccplen)
+                       abort();
+               jas_stream_close(iccstream);
+               jas_iccprof_destroy(iccprof);
+               break;
+       }
+       if (jp2_box_put(box, tmpstream)) {
+               goto error;
+       }
+       jp2_box_destroy(box);
+       box = 0;
+
+       needcdef = 1;
+       switch (jas_clrspc_fam(jas_image_clrspc(image))) {
+       case JAS_CLRSPC_FAM_RGB:
+               if (jas_image_cmpttype(image, 0) ==
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_R) &&
+                 jas_image_cmpttype(image, 1) ==
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_G) &&
+                 jas_image_cmpttype(image, 2) ==
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_B))
+                       needcdef = 0;
+               break;
+       case JAS_CLRSPC_FAM_YCBCR:
+               if (jas_image_cmpttype(image, 0) ==
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_YCBCR_Y) &&
+                 jas_image_cmpttype(image, 1) ==
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_YCBCR_CB) &&
+                 jas_image_cmpttype(image, 2) ==
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_YCBCR_CR))
+                       needcdef = 0;
+               break;
+       case JAS_CLRSPC_FAM_GRAY:
+               if (jas_image_cmpttype(image, 0) ==
+                 JAS_IMAGE_CT_COLOR(JAS_IMAGE_CT_GRAY_Y))
+                       needcdef = 0;
+               break;
+       default:
+               abort();
+               break;
+       }
+
+       if (needcdef) {
+               if (!(box = jp2_box_create(JP2_BOX_CDEF))) {
+                       goto error;
+               }
+               cdef = &box->data.cdef;
+               cdef->numchans = jas_image_numcmpts(image);
+               cdef->ents = jas_malloc(cdef->numchans * sizeof(jp2_cdefchan_t));
+               for (i = 0; i < jas_image_numcmpts(image); ++i) {
+                       cdefchanent = &cdef->ents[i];
+                       cdefchanent->channo = i;
+                       typeasoc = jp2_gettypeasoc(jas_image_clrspc(image), jas_image_cmpttype(image, i));
+                       cdefchanent->type = typeasoc >> 16;
+                       cdefchanent->assoc = typeasoc & 0x7fff;
+               }
+               if (jp2_box_put(box, tmpstream)) {
+                       goto error;
+               }
+               jp2_box_destroy(box);
+               box = 0;
+       }
+
+       /* Determine the total length of the JP2 header box. */
+
+       len = jas_stream_tell(tmpstream);
+       jas_stream_rewind(tmpstream);
+
+       /*
+        * Output the JP2 header box and all of the boxes which it contains.
+        */
+
+       if (!(box = jp2_box_create(JP2_BOX_JP2H))) {
+               goto error;
+       }
+       box->len = len + JP2_BOX_HDRLEN(false);
+       if (jp2_box_put(box, out)) {
+               goto error;
+       }
+       jp2_box_destroy(box);
+       box = 0;
+
+       if (jas_stream_copy(out, tmpstream, len)) {
+               goto error;
+       }
+
+       jas_stream_close(tmpstream);
+       tmpstream = 0;
+
+       /*
+        * Output the contiguous code stream box.
+        */
+
+       if (!(box = jp2_box_create(JP2_BOX_JP2C))) {
+               goto error;
+       }
+       box->len = 0;
+       if (jp2_box_put(box, out)) {
+               goto error;
+       }
+       jp2_box_destroy(box);
+       box = 0;
+
+       /* Output the JPEG-2000 code stream. */
+
+       overhead = jas_stream_getrwcount(out);
+       sprintf(buf, "%s\n_jp2overhead=%lu\n", (optstr ? optstr : ""),
+         (unsigned long) overhead);
+
+       if (jpc_encode(image, out, buf)) {
+               goto error;
+       }
+
+       return 0;
+       abort();
+
+error:
+
+       if (box) {
+               jp2_box_destroy(box);
+       }
+       if (tmpstream) {
+               jas_stream_close(tmpstream);
+       }
+       return -1;
+}
+
+static uint_fast32_t jp2_gettypeasoc(int colorspace, int ctype)
+{
+       int type;
+       int asoc;
+
+       if (ctype & JAS_IMAGE_CT_OPACITY) {
+               type = JP2_CDEF_TYPE_OPACITY;
+               asoc = JP2_CDEF_ASOC_ALL;
+               goto done;
+       }
+
+       type = JP2_CDEF_TYPE_UNSPEC;
+       asoc = JP2_CDEF_ASOC_NONE;
+       switch (jas_clrspc_fam(colorspace)) {
+       case JAS_CLRSPC_FAM_RGB:
+               switch (JAS_IMAGE_CT_COLOR(ctype)) {
+               case JAS_IMAGE_CT_RGB_R:
+                       type = JP2_CDEF_TYPE_COLOR;
+                       asoc = JP2_CDEF_RGB_R;
+                       break;
+               case JAS_IMAGE_CT_RGB_G:
+                       type = JP2_CDEF_TYPE_COLOR;
+                       asoc = JP2_CDEF_RGB_G;
+                       break;
+               case JAS_IMAGE_CT_RGB_B:
+                       type = JP2_CDEF_TYPE_COLOR;
+                       asoc = JP2_CDEF_RGB_B;
+                       break;
+               }
+               break;
+       case JAS_CLRSPC_FAM_YCBCR:
+               switch (JAS_IMAGE_CT_COLOR(ctype)) {
+               case JAS_IMAGE_CT_YCBCR_Y:
+                       type = JP2_CDEF_TYPE_COLOR;
+                       asoc = JP2_CDEF_YCBCR_Y;
+                       break;
+               case JAS_IMAGE_CT_YCBCR_CB:
+                       type = JP2_CDEF_TYPE_COLOR;
+                       asoc = JP2_CDEF_YCBCR_CB;
+                       break;
+               case JAS_IMAGE_CT_YCBCR_CR:
+                       type = JP2_CDEF_TYPE_COLOR;
+                       asoc = JP2_CDEF_YCBCR_CR;
+                       break;
+               }
+               break;
+       case JAS_CLRSPC_FAM_GRAY:
+               type = JP2_CDEF_TYPE_COLOR;
+               asoc = JP2_CDEF_GRAY_Y;
+               break;
+       }
+
+done:
+       return (type << 16) | asoc;
+}
+
+static int clrspctojp2(jas_clrspc_t clrspc)
+{
+       switch (clrspc) {
+       case JAS_CLRSPC_SRGB:
+               return JP2_COLR_SRGB;
+       case JAS_CLRSPC_SYCBCR:
+               return JP2_COLR_SYCC;
+       case JAS_CLRSPC_SGRAY:
+               return JP2_COLR_SGRAY;
+       default:
+               abort();
+               break;
+       }
+}
diff --git a/src/libjasper/jpc/Makefile.am b/src/libjasper/jpc/Makefile.am
new file mode 100644 (file)
index 0000000..41a9bbf
--- /dev/null
@@ -0,0 +1,105 @@
+# Copyright (c) 2001-2002 Michael David Adams.
+# All rights reserved. 
+
+# __START_OF_JASPER_LICENSE__
+# 
+# JasPer License Version 2.0
+# 
+# Copyright (c) 2001-2006 Michael David Adams
+# Copyright (c) 1999-2000 Image Power, Inc.
+# Copyright (c) 1999-2000 The University of British Columbia
+# 
+# All rights reserved.
+# 
+# Permission is hereby granted, free of charge, to any person (the
+# "User") obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the
+# following conditions:
+# 
+# 1.  The above copyright notices and this permission notice (which
+# includes the disclaimer below) shall be included in all copies or
+# substantial portions of the Software.
+# 
+# 2.  The name of a copyright holder shall not be used to endorse or
+# promote products derived from the Software without specific prior
+# written permission.
+# 
+# THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+# LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+# THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+# "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+# PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+# EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+# PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+# THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+# EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+# BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+# PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+# GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+# ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+# IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+# SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+# AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+# SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+# THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+# PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+# RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+# EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+# 
+# __END_OF_JASPER_LICENSE__
+
+# AM_CFLAGS = -funroll-loops
+
+noinst_LTLIBRARIES = libjpc.la
+libjpc_la_SOURCES = \
+       jpc_bs.h \
+       jpc_cod.h \
+       jpc_cs.h \
+       jpc_dec.h \
+       jpc_enc.h \
+       jpc_fix.h \
+       jpc_flt.h \
+       jpc_math.h \
+       jpc_mct.h \
+       jpc_mqcod.h \
+       jpc_mqdec.h \
+       jpc_mqenc.h \
+       jpc_qmfb.h \
+       jpc_tagtree.h \
+       jpc_t1cod.h \
+       jpc_t1dec.h \
+       jpc_t1enc.h \
+       jpc_tsfb.h \
+       jpc_t2cod.h \
+       jpc_t2dec.h \
+       jpc_t2enc.h \
+       jpc_util.h \
+       jpc_bs.c \
+       jpc_cs.c \
+       jpc_dec.c \
+       jpc_enc.c \
+       jpc_math.c \
+       jpc_mct.c \
+       jpc_mqcod.c \
+       jpc_mqdec.c \
+       jpc_mqenc.c \
+       jpc_qmfb.c \
+       jpc_tagtree.c \
+       jpc_t1cod.c \
+       jpc_t1dec.c \
+       jpc_t1enc.c \
+       jpc_tsfb.c \
+       jpc_t2cod.c \
+       jpc_t2dec.c \
+       jpc_t2enc.c \
+       jpc_util.c
+
+INCLUDES = -I$(top_srcdir)/src/libjasper/include
diff --git a/src/libjasper/jpc/Makefile.in b/src/libjasper/jpc/Makefile.in
new file mode 100644 (file)
index 0000000..b628494
--- /dev/null
@@ -0,0 +1,568 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# Copyright (c) 2001-2002 Michael David Adams.
+# All rights reserved. 
+
+# __START_OF_JASPER_LICENSE__
+# 
+# JasPer License Version 2.0
+# 
+# Copyright (c) 2001-2006 Michael David Adams
+# Copyright (c) 1999-2000 Image Power, Inc.
+# Copyright (c) 1999-2000 The University of British Columbia
+# 
+# All rights reserved.
+# 
+# Permission is hereby granted, free of charge, to any person (the
+# "User") obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the
+# following conditions:
+# 
+# 1.  The above copyright notices and this permission notice (which
+# includes the disclaimer below) shall be included in all copies or
+# substantial portions of the Software.
+# 
+# 2.  The name of a copyright holder shall not be used to endorse or
+# promote products derived from the Software without specific prior
+# written permission.
+# 
+# THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+# LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+# THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+# "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+# PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+# EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+# PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+# THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+# EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+# BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+# PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+# GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+# ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+# IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+# SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+# AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+# SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+# THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+# PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+# RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+# EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+# 
+# __END_OF_JASPER_LICENSE__
+
+# AM_CFLAGS = -funroll-loops
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = src/libjasper/jpc
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/acaux/mkinstalldirs
+CONFIG_HEADER =  \
+       $(top_builddir)/src/libjasper/include/jasper/jas_config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libjpc_la_LIBADD =
+am_libjpc_la_OBJECTS = jpc_bs.lo jpc_cs.lo jpc_dec.lo jpc_enc.lo \
+       jpc_math.lo jpc_mct.lo jpc_mqcod.lo jpc_mqdec.lo jpc_mqenc.lo \
+       jpc_qmfb.lo jpc_tagtree.lo jpc_t1cod.lo jpc_t1dec.lo \
+       jpc_t1enc.lo jpc_tsfb.lo jpc_t2cod.lo jpc_t2dec.lo \
+       jpc_t2enc.lo jpc_util.lo
+libjpc_la_OBJECTS = $(am_libjpc_la_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/libjasper/include/jasper
+depcomp = $(SHELL) $(top_srcdir)/acaux/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+       $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libjpc_la_SOURCES)
+DIST_SOURCES = $(libjpc_la_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+HAVE_LIBJPEG_FALSE = @HAVE_LIBJPEG_FALSE@
+HAVE_LIBJPEG_TRUE = @HAVE_LIBJPEG_TRUE@
+HAVE_OPENGL_FALSE = @HAVE_OPENGL_FALSE@
+HAVE_OPENGL_TRUE = @HAVE_OPENGL_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAS_MAJOR_VERSION = @JAS_MAJOR_VERSION@
+JAS_MICRO_VERSION = @JAS_MICRO_VERSION@
+JAS_MINOR_VERSION = @JAS_MINOR_VERSION@
+JAS_RPM_RELEASE = @JAS_RPM_RELEASE@
+JAS_VERSION = @JAS_VERSION@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_AGE = @LT_AGE@
+LT_CURRENT = @LT_CURRENT@
+LT_RELEASE = @LT_RELEASE@
+LT_REVISION = @LT_REVISION@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OPENGL_LIBS = @OPENGL_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+noinst_LTLIBRARIES = libjpc.la
+libjpc_la_SOURCES = \
+       jpc_bs.h \
+       jpc_cod.h \
+       jpc_cs.h \
+       jpc_dec.h \
+       jpc_enc.h \
+       jpc_fix.h \
+       jpc_flt.h \
+       jpc_math.h \
+       jpc_mct.h \
+       jpc_mqcod.h \
+       jpc_mqdec.h \
+       jpc_mqenc.h \
+       jpc_qmfb.h \
+       jpc_tagtree.h \
+       jpc_t1cod.h \
+       jpc_t1dec.h \
+       jpc_t1enc.h \
+       jpc_tsfb.h \
+       jpc_t2cod.h \
+       jpc_t2dec.h \
+       jpc_t2enc.h \
+       jpc_util.h \
+       jpc_bs.c \
+       jpc_cs.c \
+       jpc_dec.c \
+       jpc_enc.c \
+       jpc_math.c \
+       jpc_mct.c \
+       jpc_mqcod.c \
+       jpc_mqdec.c \
+       jpc_mqenc.c \
+       jpc_qmfb.c \
+       jpc_tagtree.c \
+       jpc_t1cod.c \
+       jpc_t1dec.c \
+       jpc_t1enc.c \
+       jpc_tsfb.c \
+       jpc_t2cod.c \
+       jpc_t2dec.c \
+       jpc_t2enc.c \
+       jpc_util.c
+
+INCLUDES = -I$(top_srcdir)/src/libjasper/include
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/libjasper/jpc/Makefile'; \
+       cd $(top_srcdir) && \
+         $(AUTOMAKE) --foreign  src/libjasper/jpc/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+       -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+       @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+         test "$$dir" != "$$p" || dir=.; \
+         echo "rm -f \"$${dir}/so_locations\""; \
+         rm -f "$${dir}/so_locations"; \
+       done
+libjpc.la: $(libjpc_la_OBJECTS) $(libjpc_la_DEPENDENCIES) 
+       $(LINK)  $(libjpc_la_LDFLAGS) $(libjpc_la_OBJECTS) $(libjpc_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpc_bs.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpc_cs.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpc_dec.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpc_enc.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpc_math.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpc_mct.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpc_mqcod.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpc_mqdec.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpc_mqenc.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpc_qmfb.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpc_t1cod.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpc_t1dec.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpc_t1enc.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpc_t2cod.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpc_t2dec.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpc_t2enc.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpc_tagtree.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpc_tsfb.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpc_util.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+
+distclean-libtool:
+       -rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+           $$tags $$unique; \
+       fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       test -z "$(CTAGS_ARGS)$$tags$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$tags $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && cd $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+       list='$(DISTFILES)'; for file in $$list; do \
+         case $$file in \
+           $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+           $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+         esac; \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+         if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+           dir="/$$dir"; \
+           $(mkdir_p) "$(distdir)$$dir"; \
+         else \
+           dir=''; \
+         fi; \
+         if test -d $$d/$$file; then \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+           fi; \
+           cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+         else \
+           test -f $(distdir)/$$file \
+           || cp -p $$d/$$file $(distdir)/$$file \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+         `test -z '$(STRIP)' || \
+           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+       mostlyclean-am
+
+distclean: distclean-am
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+       clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+       distclean-compile distclean-generic distclean-libtool \
+       distclean-tags distdir dvi dvi-am html html-am info info-am \
+       install install-am install-data install-data-am install-exec \
+       install-exec-am install-info install-info-am install-man \
+       install-strip installcheck installcheck-am installdirs \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+       pdf pdf-am ps ps-am tags uninstall uninstall-am \
+       uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/libjasper/jpc/jpc_bs.c b/src/libjasper/jpc/jpc_bs.c
new file mode 100644 (file)
index 0000000..c3dd466
--- /dev/null
@@ -0,0 +1,440 @@
+/*
+ * Copyright (c) 1999-2000, Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Bit Stream Class
+ *
+ * $Id$
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <assert.h>
+#include <stdlib.h>
+#include <stdarg.h>
+
+#include "jasper/jas_malloc.h"
+#include "jasper/jas_math.h"
+#include "jasper/jas_debug.h"
+
+#include "jpc_bs.h"
+
+/******************************************************************************\
+* Local function prototypes.
+\******************************************************************************/
+
+static jpc_bitstream_t *jpc_bitstream_alloc(void);
+
+/******************************************************************************\
+* Code for opening and closing bit streams.
+\******************************************************************************/
+
+/* Open a bit stream from a stream. */
+jpc_bitstream_t *jpc_bitstream_sopen(jas_stream_t *stream, char *mode)
+{
+       jpc_bitstream_t *bitstream;
+
+       /* Ensure that the open mode is valid. */
+#if 1
+/* This causes a string literal too long error (with c99 pedantic mode). */
+       assert(!strcmp(mode, "r") || !strcmp(mode, "w") || !strcmp(mode, "r+")
+         || !strcmp(mode, "w+"));
+#endif
+
+       if (!(bitstream = jpc_bitstream_alloc())) {
+               return 0;
+       }
+
+       /* By default, do not close the underlying (character) stream, upon
+         the close of the bit stream. */
+       bitstream->flags_ = JPC_BITSTREAM_NOCLOSE;
+
+       bitstream->stream_ = stream;
+       bitstream->openmode_ = (mode[0] == 'w') ? JPC_BITSTREAM_WRITE :
+         JPC_BITSTREAM_READ;
+
+       /* Mark the data buffer as empty. */
+       bitstream->cnt_ = (bitstream->openmode_ == JPC_BITSTREAM_READ) ? 0 : 8;
+       bitstream->buf_ = 0;
+
+       return bitstream;
+}
+
+/* Close a bit stream. */
+int jpc_bitstream_close(jpc_bitstream_t *bitstream)
+{
+       int ret = 0;
+
+       /* Align to the next byte boundary while considering the effects of
+         bit stuffing. */
+       if (jpc_bitstream_align(bitstream)) {
+               ret = -1;
+       }
+
+       /* If necessary, close the underlying (character) stream. */
+       if (!(bitstream->flags_ & JPC_BITSTREAM_NOCLOSE) && bitstream->stream_) {
+               if (jas_stream_close(bitstream->stream_)) {
+                       ret = -1;
+               }
+               bitstream->stream_ = 0;
+       }
+
+       jas_free(bitstream);
+       return ret;
+}
+
+/* Allocate a new bit stream. */
+static jpc_bitstream_t *jpc_bitstream_alloc()
+{
+       jpc_bitstream_t *bitstream;
+
+       /* Allocate memory for the new bit stream object. */
+       if (!(bitstream = jas_malloc(sizeof(jpc_bitstream_t)))) {
+               return 0;
+       }
+       /* Initialize all of the data members. */
+       bitstream->stream_ = 0;
+       bitstream->cnt_ = 0;
+       bitstream->flags_ = 0;
+       bitstream->openmode_ = 0;
+
+       return bitstream;
+}
+
+/******************************************************************************\
+* Code for reading/writing from/to bit streams.
+\******************************************************************************/
+
+/* Get a bit from a bit stream. */
+int jpc_bitstream_getbit_func(jpc_bitstream_t *bitstream)
+{
+       int ret;
+       JAS_DBGLOG(1000, ("jpc_bitstream_getbit_func(%p)\n", bitstream));
+       ret = jpc_bitstream_getbit_macro(bitstream);
+       JAS_DBGLOG(1000, ("jpc_bitstream_getbit_func -> %d\n", ret));
+       return ret;
+}
+
+/* Put a bit to a bit stream. */
+int jpc_bitstream_putbit_func(jpc_bitstream_t *bitstream, int b)
+{
+       int ret;
+       JAS_DBGLOG(1000, ("jpc_bitstream_putbit_func(%p, %d)\n", bitstream, b));
+       ret = jpc_bitstream_putbit_macro(bitstream, b);
+       JAS_DBGLOG(1000, ("jpc_bitstream_putbit_func() -> %d\n", ret));
+       return ret;
+}
+
+/* Get one or more bits from a bit stream. */
+long jpc_bitstream_getbits(jpc_bitstream_t *bitstream, int n)
+{
+       long v;
+       int u;
+
+       /* We can reliably get at most 31 bits since ISO/IEC 9899 only
+         guarantees that a long can represent values up to 2^31-1. */
+       assert(n >= 0 && n < 32);
+
+       /* Get the number of bits requested from the specified bit stream. */
+       v = 0;
+       while (--n >= 0) {
+               if ((u = jpc_bitstream_getbit(bitstream)) < 0) {
+                       return -1;
+               }
+               v = (v << 1) | u;
+       }
+       return v;
+}
+
+/* Put one or more bits to a bit stream. */
+int jpc_bitstream_putbits(jpc_bitstream_t *bitstream, int n, long v)
+{
+       int m;
+
+       /* We can reliably put at most 31 bits since ISO/IEC 9899 only
+         guarantees that a long can represent values up to 2^31-1. */
+       assert(n >= 0 && n < 32);
+       /* Ensure that only the bits to be output are nonzero. */
+       assert(!(v & (~JAS_ONES(n))));
+
+       /* Put the desired number of bits to the specified bit stream. */
+       m = n - 1;
+       while (--n >= 0) {
+               if (jpc_bitstream_putbit(bitstream, (v >> m) & 1) == EOF) {
+                       return EOF;
+               }
+               v <<= 1;
+       }
+       return 0;
+}
+
+/******************************************************************************\
+* Code for buffer filling and flushing.
+\******************************************************************************/
+
+/* Fill the buffer for a bit stream. */
+int jpc_bitstream_fillbuf(jpc_bitstream_t *bitstream)
+{
+       int c;
+       /* Note: The count has already been decremented by the caller. */
+       assert(bitstream->openmode_ & JPC_BITSTREAM_READ);
+       assert(bitstream->cnt_ <= 0);
+
+       if (bitstream->flags_ & JPC_BITSTREAM_ERR) {
+               bitstream->cnt_ = 0;
+               return -1;
+       }
+
+       if (bitstream->flags_ & JPC_BITSTREAM_EOF) {
+               bitstream->buf_ = 0x7f;
+               bitstream->cnt_ = 7;
+               return 1;
+       }
+
+       bitstream->buf_ = (bitstream->buf_ << 8) & 0xffff;
+       if ((c = jas_stream_getc((bitstream)->stream_)) == EOF) {
+               bitstream->flags_ |= JPC_BITSTREAM_EOF;
+               return 1;
+       }
+       bitstream->cnt_ = (bitstream->buf_ == 0xff00) ? 6 : 7;
+       bitstream->buf_ |= c & ((1 << (bitstream->cnt_ + 1)) - 1);
+       return (bitstream->buf_ >> bitstream->cnt_) & 1;
+}
+
+
+/******************************************************************************\
+* Code related to flushing.
+\******************************************************************************/
+
+/* Does the bit stream need to be aligned to a byte boundary (considering
+  the effects of bit stuffing)? */
+int jpc_bitstream_needalign(jpc_bitstream_t *bitstream)
+{
+       if (bitstream->openmode_ & JPC_BITSTREAM_READ) {
+               /* The bit stream is open for reading. */
+               /* If there are any bits buffered for reading, or the
+                 previous byte forced a stuffed bit, alignment is
+                 required. */
+               if ((bitstream->cnt_ < 8 && bitstream->cnt_ > 0) ||
+                 ((bitstream->buf_ >> 8) & 0xff) == 0xff) {
+                       return 1;
+               }
+       } else if (bitstream->openmode_ & JPC_BITSTREAM_WRITE) {
+               /* The bit stream is open for writing. */
+               /* If there are any bits buffered for writing, or the
+                 previous byte forced a stuffed bit, alignment is
+                 required. */
+               if ((bitstream->cnt_ < 8 && bitstream->cnt_ >= 0) ||
+                 ((bitstream->buf_ >> 8) & 0xff) == 0xff) {
+                       return 1;
+               }
+       } else {
+               /* This should not happen.  Famous last words, eh? :-) */
+               assert(0);
+               return -1;
+       }
+       return 0;
+}
+
+/* How many additional bytes would be output if we align the bit stream? */
+int jpc_bitstream_pending(jpc_bitstream_t *bitstream)
+{
+       if (bitstream->openmode_ & JPC_BITSTREAM_WRITE) {
+               /* The bit stream is being used for writing. */
+#if 1
+               /* XXX - Is this really correct?  Check someday... */
+               if (bitstream->cnt_ < 8) {
+                       return 1;
+               }
+#else
+               if (bitstream->cnt_ < 8) {
+                       if (((bitstream->buf_ >> 8) & 0xff) == 0xff) {
+                               return 2;
+                       }
+                       return 1;
+               }
+#endif
+               return 0;
+       } else {
+               /* This operation should not be invoked on a bit stream that
+                 is being used for reading. */
+               return -1;
+       }
+}
+
+/* Align the bit stream to a byte boundary. */
+int jpc_bitstream_align(jpc_bitstream_t *bitstream)
+{
+       int ret;
+       if (bitstream->openmode_ & JPC_BITSTREAM_READ) {
+               ret = jpc_bitstream_inalign(bitstream, 0, 0);
+       } else if (bitstream->openmode_ & JPC_BITSTREAM_WRITE) {
+               ret = jpc_bitstream_outalign(bitstream, 0);
+       } else {
+               abort();
+       }
+       return ret;
+}
+
+/* Align a bit stream in the input case. */
+int jpc_bitstream_inalign(jpc_bitstream_t *bitstream, int fillmask,
+  int filldata)
+{
+       int n;
+       int v;
+       int u;
+       int numfill;
+       int m;
+
+       numfill = 7;
+       m = 0;
+       v = 0;
+       if (bitstream->cnt_ > 0) {
+               n = bitstream->cnt_;
+       } else if (!bitstream->cnt_) {
+               n = ((bitstream->buf_ & 0xff) == 0xff) ? 7 : 0;
+       } else {
+               n = 0;
+       }
+       if (n > 0) {
+               if ((u = jpc_bitstream_getbits(bitstream, n)) < 0) {
+                       return -1;
+               }
+               m += n;
+               v = (v << n) | u;
+       }
+       if ((bitstream->buf_ & 0xff) == 0xff) {
+               if ((u = jpc_bitstream_getbits(bitstream, 7)) < 0) {
+                       return -1;
+               }
+               v = (v << 7) | u;
+               m += 7;
+       }
+       if (m > numfill) {
+               v >>= m - numfill;
+       } else {
+               filldata >>= numfill - m;
+               fillmask >>= numfill - m;
+       }
+       if (((~(v ^ filldata)) & fillmask) != fillmask) {
+               /* The actual fill pattern does not match the expected one. */
+               return 1;
+       }
+
+       return 0;
+}
+
+/* Align a bit stream in the output case. */
+int jpc_bitstream_outalign(jpc_bitstream_t *bitstream, int filldata)
+{
+       int n;
+       int v;
+
+       /* Ensure that this bit stream is open for writing. */
+       assert(bitstream->openmode_ & JPC_BITSTREAM_WRITE);
+
+       /* Ensure that the first bit of fill data is zero. */
+       /* Note: The first bit of fill data must be zero.  If this were not
+         the case, the fill data itself could cause further bit stuffing to
+         be required (which would cause numerous complications). */
+       assert(!(filldata & (~0x3f)));
+
+       if (!bitstream->cnt_) {
+               if ((bitstream->buf_ & 0xff) == 0xff) {
+                       n = 7;
+                       v = filldata;
+               } else {
+                       n = 0;
+                       v = 0;
+               }
+       } else if (bitstream->cnt_ > 0 && bitstream->cnt_ < 8) {
+               n = bitstream->cnt_;
+               v = filldata >> (7 - n);
+       } else {
+               n = 0;
+               v = 0;
+               return 0;
+       }
+
+       /* Write the appropriate fill data to the bit stream. */
+       if (n > 0) {
+               if (jpc_bitstream_putbits(bitstream, n, v)) {
+                       return -1;
+               }
+       }
+       if (bitstream->cnt_ < 8) {
+               assert(bitstream->cnt_ >= 0 && bitstream->cnt_ < 8);
+               assert((bitstream->buf_ & 0xff) != 0xff);
+               /* Force the pending byte of output to be written to the
+                 underlying (character) stream. */
+               if (jas_stream_putc(bitstream->stream_, bitstream->buf_ & 0xff) == EOF) {
+                       return -1;
+               }
+               bitstream->cnt_ = 8;
+               bitstream->buf_ = (bitstream->buf_ << 8) & 0xffff;
+       }
+
+       return 0;
+}
diff --git a/src/libjasper/jpc/jpc_bs.h b/src/libjasper/jpc/jpc_bs.h
new file mode 100644 (file)
index 0000000..3cebafa
--- /dev/null
@@ -0,0 +1,231 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Bit Stream Class
+ *
+ * $Id$
+ */
+
+#ifndef JPC_BS_H
+#define JPC_BS_H
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <stdio.h>
+
+#include "jasper/jas_types.h"
+#include "jasper/jas_stream.h"
+
+/******************************************************************************\
+* Constants.
+\******************************************************************************/
+
+/*
+ * Bit stream open mode flags.
+ */
+
+/* Bit stream open for reading. */
+#define        JPC_BITSTREAM_READ      0x01
+/* Bit stream open for writing. */
+#define        JPC_BITSTREAM_WRITE     0x02
+
+/*
+ * Bit stream flags.
+ */
+
+/* Do not close underlying character stream. */
+#define        JPC_BITSTREAM_NOCLOSE   0x01
+/* End of file has been reached while reading. */
+#define        JPC_BITSTREAM_EOF       0x02
+/* An I/O error has occured. */
+#define        JPC_BITSTREAM_ERR       0x04
+
+/******************************************************************************\
+* Types.
+\******************************************************************************/
+
+/* Bit stream class. */
+
+typedef struct {
+
+       /* Some miscellaneous flags. */
+       int flags_;
+
+       /* The input/output buffer. */
+       uint_fast16_t buf_;
+
+       /* The number of bits remaining in the byte being read/written. */
+       int cnt_;
+
+       /* The underlying stream associated with this bit stream. */
+       jas_stream_t *stream_;
+
+       /* The mode in which this bit stream was opened. */
+       int openmode_;
+
+} jpc_bitstream_t;
+
+/******************************************************************************\
+* Functions/macros for opening and closing bit streams..
+\******************************************************************************/
+
+/* Open a stream as a bit stream. */
+jpc_bitstream_t *jpc_bitstream_sopen(jas_stream_t *stream, char *mode);
+
+/* Close a bit stream. */
+int jpc_bitstream_close(jpc_bitstream_t *bitstream);
+
+/******************************************************************************\
+* Functions/macros for reading from and writing to bit streams..
+\******************************************************************************/
+
+/* Read a bit from a bit stream. */
+#if defined(DEBUG)
+#define        jpc_bitstream_getbit(bitstream) \
+       jpc_bitstream_getbit_func(bitstream)
+#else
+#define jpc_bitstream_getbit(bitstream) \
+       jpc_bitstream_getbit_macro(bitstream)
+#endif
+
+/* Write a bit to a bit stream. */
+#if defined(DEBUG)
+#define        jpc_bitstream_putbit(bitstream, v) \
+       jpc_bitstream_putbit_func(bitstream, v)
+#else
+#define        jpc_bitstream_putbit(bitstream, v) \
+       jpc_bitstream_putbit_macro(bitstream, v)
+#endif
+
+/* Read one or more bits from a bit stream. */
+long jpc_bitstream_getbits(jpc_bitstream_t *bitstream, int n);
+
+/* Write one or more bits to a bit stream. */
+int jpc_bitstream_putbits(jpc_bitstream_t *bitstream, int n, long v);
+
+/******************************************************************************\
+* Functions/macros for flushing and aligning bit streams.
+\******************************************************************************/
+
+/* Align the current position within the bit stream to the next byte
+  boundary. */
+int jpc_bitstream_align(jpc_bitstream_t *bitstream);
+
+/* Align the current position in the bit stream with the next byte boundary,
+  ensuring that certain bits consumed in the process match a particular
+  pattern. */
+int jpc_bitstream_inalign(jpc_bitstream_t *bitstream, int fillmask,
+  int filldata);
+
+/* Align the current position in the bit stream with the next byte boundary,
+  writing bits from the specified pattern (if necessary) in the process. */
+int jpc_bitstream_outalign(jpc_bitstream_t *bitstream, int filldata);
+
+/* Check if a bit stream needs alignment. */
+int jpc_bitstream_needalign(jpc_bitstream_t *bitstream);
+
+/* How many additional bytes would be output if the bit stream was aligned? */
+int jpc_bitstream_pending(jpc_bitstream_t *bitstream);
+
+/******************************************************************************\
+* Functions/macros for querying state information for bit streams.
+\******************************************************************************/
+
+/* Has EOF been encountered on a bit stream? */
+#define jpc_bitstream_eof(bitstream) \
+       ((bitstream)->flags_ & JPC_BITSTREAM_EOF)
+
+/******************************************************************************\
+* Internals.
+\******************************************************************************/
+
+/* DO NOT DIRECTLY INVOKE ANY OF THE MACROS OR FUNCTIONS BELOW.  THEY ARE
+  FOR INTERNAL USE ONLY. */
+
+int jpc_bitstream_getbit_func(jpc_bitstream_t *bitstream);
+
+int jpc_bitstream_putbit_func(jpc_bitstream_t *bitstream, int v);
+
+int jpc_bitstream_fillbuf(jpc_bitstream_t *bitstream);
+
+#define        jpc_bitstream_getbit_macro(bitstream) \
+       (assert((bitstream)->openmode_ & JPC_BITSTREAM_READ), \
+         (--(bitstream)->cnt_ >= 0) ? \
+         ((int)(((bitstream)->buf_ >> (bitstream)->cnt_) & 1)) : \
+         jpc_bitstream_fillbuf(bitstream))
+
+#define jpc_bitstream_putbit_macro(bitstream, bit) \
+       (assert((bitstream)->openmode_ & JPC_BITSTREAM_WRITE), \
+         (--(bitstream)->cnt_ < 0) ? \
+         ((bitstream)->buf_ = ((bitstream)->buf_ << 8) & 0xffff, \
+         (bitstream)->cnt_ = ((bitstream)->buf_ == 0xff00) ? 6 : 7, \
+         (bitstream)->buf_ |= ((bit) & 1) << (bitstream)->cnt_, \
+         (jas_stream_putc((bitstream)->stream_, (bitstream)->buf_ >> 8) == EOF) \
+         ? (EOF) : ((bit) & 1)) : \
+         ((bitstream)->buf_ |= ((bit) & 1) << (bitstream)->cnt_, \
+         (bit) & 1))
+
+#endif
diff --git a/src/libjasper/jpc/jpc_cod.h b/src/libjasper/jpc/jpc_cod.h
new file mode 100644 (file)
index 0000000..32e1124
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * $Id$
+ */
+
+#ifndef JPC_COD_H
+#define JPC_COD_H
+
+/******************************************************************************\
+* Constants.
+\******************************************************************************/
+
+/* The nominal word size used by this implementation. */
+#define        JPC_PREC        32
+
+#endif
diff --git a/src/libjasper/jpc/jpc_cs.c b/src/libjasper/jpc/jpc_cs.c
new file mode 100644 (file)
index 0000000..f076571
--- /dev/null
@@ -0,0 +1,1644 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * JPEG-2000 Code Stream Library
+ *
+ * $Id$
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <stdlib.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "jasper/jas_malloc.h"
+#include "jasper/jas_debug.h"
+
+#include "jpc_cs.h"
+
+/******************************************************************************\
+* Types.
+\******************************************************************************/
+
+/* Marker segment table entry. */
+typedef struct {
+       int id;
+       char *name;
+       jpc_msops_t ops;
+} jpc_mstabent_t;
+
+/******************************************************************************\
+* Local prototypes.
+\******************************************************************************/
+
+static jpc_mstabent_t *jpc_mstab_lookup(int id);
+
+static int jpc_poc_dumpparms(jpc_ms_t *ms, FILE *out);
+static int jpc_poc_putparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *out);
+static int jpc_poc_getparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *in);
+static void jpc_poc_destroyparms(jpc_ms_t *ms);
+
+static int jpc_unk_getparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *in);
+static int jpc_sot_getparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *in);
+static int jpc_siz_getparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *in);
+static int jpc_cod_getparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *in);
+static int jpc_coc_getparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *in);
+static int jpc_qcd_getparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *in);
+static int jpc_qcc_getparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *in);
+static int jpc_rgn_getparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *in);
+static int jpc_sop_getparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *in);
+static int jpc_ppm_getparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *in);
+static int jpc_ppt_getparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *in);
+static int jpc_crg_getparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *in);
+static int jpc_com_getparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *in);
+
+static int jpc_sot_putparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *out);
+static int jpc_siz_putparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *out);
+static int jpc_cod_putparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *out);
+static int jpc_coc_putparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *out);
+static int jpc_qcd_putparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *out);
+static int jpc_qcc_putparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *out);
+static int jpc_rgn_putparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *out);
+static int jpc_unk_putparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *out);
+static int jpc_sop_putparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *out);
+static int jpc_ppm_putparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *out);
+static int jpc_ppt_putparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *out);
+static int jpc_crg_putparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *out);
+static int jpc_com_putparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *out);
+
+static int jpc_sot_dumpparms(jpc_ms_t *ms, FILE *out);
+static int jpc_siz_dumpparms(jpc_ms_t *ms, FILE *out);
+static int jpc_cod_dumpparms(jpc_ms_t *ms, FILE *out);
+static int jpc_coc_dumpparms(jpc_ms_t *ms, FILE *out);
+static int jpc_qcd_dumpparms(jpc_ms_t *ms, FILE *out);
+static int jpc_qcc_dumpparms(jpc_ms_t *ms, FILE *out);
+static int jpc_rgn_dumpparms(jpc_ms_t *ms, FILE *out);
+static int jpc_unk_dumpparms(jpc_ms_t *ms, FILE *out);
+static int jpc_sop_dumpparms(jpc_ms_t *ms, FILE *out);
+static int jpc_ppm_dumpparms(jpc_ms_t *ms, FILE *out);
+static int jpc_ppt_dumpparms(jpc_ms_t *ms, FILE *out);
+static int jpc_crg_dumpparms(jpc_ms_t *ms, FILE *out);
+static int jpc_com_dumpparms(jpc_ms_t *ms, FILE *out);
+
+static void jpc_siz_destroyparms(jpc_ms_t *ms);
+static void jpc_qcd_destroyparms(jpc_ms_t *ms);
+static void jpc_qcc_destroyparms(jpc_ms_t *ms);
+static void jpc_cod_destroyparms(jpc_ms_t *ms);
+static void jpc_coc_destroyparms(jpc_ms_t *ms);
+static void jpc_unk_destroyparms(jpc_ms_t *ms);
+static void jpc_ppm_destroyparms(jpc_ms_t *ms);
+static void jpc_ppt_destroyparms(jpc_ms_t *ms);
+static void jpc_crg_destroyparms(jpc_ms_t *ms);
+static void jpc_com_destroyparms(jpc_ms_t *ms);
+
+static void jpc_qcx_destroycompparms(jpc_qcxcp_t *compparms);
+static int jpc_qcx_getcompparms(jpc_qcxcp_t *compparms, jpc_cstate_t *cstate,
+  jas_stream_t *in, uint_fast16_t len);
+static int jpc_qcx_putcompparms(jpc_qcxcp_t *compparms, jpc_cstate_t *cstate,
+  jas_stream_t *out);
+static void jpc_cox_destroycompparms(jpc_coxcp_t *compparms);
+static int jpc_cox_getcompparms(jpc_ms_t *ms, jpc_cstate_t *cstate,
+  jas_stream_t *in, int prtflag, jpc_coxcp_t *compparms);
+static int jpc_cox_putcompparms(jpc_ms_t *ms, jpc_cstate_t *cstate,
+  jas_stream_t *out, int prtflag, jpc_coxcp_t *compparms);
+
+/******************************************************************************\
+* Global data.
+\******************************************************************************/
+
+static jpc_mstabent_t jpc_mstab[] = {
+       {JPC_MS_SOC, "SOC", {0, 0, 0, 0}},
+       {JPC_MS_SOT, "SOT", {0, jpc_sot_getparms, jpc_sot_putparms,
+         jpc_sot_dumpparms}},
+       {JPC_MS_SOD, "SOD", {0, 0, 0, 0}},
+       {JPC_MS_EOC, "EOC", {0, 0, 0, 0}},
+       {JPC_MS_SIZ, "SIZ", {jpc_siz_destroyparms, jpc_siz_getparms,
+         jpc_siz_putparms, jpc_siz_dumpparms}},
+       {JPC_MS_COD, "COD", {jpc_cod_destroyparms, jpc_cod_getparms,
+         jpc_cod_putparms, jpc_cod_dumpparms}},
+       {JPC_MS_COC, "COC", {jpc_coc_destroyparms, jpc_coc_getparms,
+         jpc_coc_putparms, jpc_coc_dumpparms}},
+       {JPC_MS_RGN, "RGN", {0, jpc_rgn_getparms, jpc_rgn_putparms,
+         jpc_rgn_dumpparms}},
+       {JPC_MS_QCD, "QCD", {jpc_qcd_destroyparms, jpc_qcd_getparms,
+         jpc_qcd_putparms, jpc_qcd_dumpparms}},
+       {JPC_MS_QCC, "QCC", {jpc_qcc_destroyparms, jpc_qcc_getparms,
+         jpc_qcc_putparms, jpc_qcc_dumpparms}},
+       {JPC_MS_POC, "POC", {jpc_poc_destroyparms, jpc_poc_getparms,
+         jpc_poc_putparms, jpc_poc_dumpparms}},
+       {JPC_MS_TLM, "TLM", {0, jpc_unk_getparms, jpc_unk_putparms, 0}},
+       {JPC_MS_PLM, "PLM", {0, jpc_unk_getparms, jpc_unk_putparms, 0}},
+       {JPC_MS_PPM, "PPM", {jpc_ppm_destroyparms, jpc_ppm_getparms,
+         jpc_ppm_putparms, jpc_ppm_dumpparms}},
+       {JPC_MS_PPT, "PPT", {jpc_ppt_destroyparms, jpc_ppt_getparms,
+         jpc_ppt_putparms, jpc_ppt_dumpparms}},
+       {JPC_MS_SOP, "SOP", {0, jpc_sop_getparms, jpc_sop_putparms,
+         jpc_sop_dumpparms}},
+       {JPC_MS_EPH, "EPH", {0, 0, 0, 0}},
+       {JPC_MS_CRG, "CRG", {0, jpc_crg_getparms, jpc_crg_putparms,
+         jpc_crg_dumpparms}},
+       {JPC_MS_COM, "COM", {jpc_com_destroyparms, jpc_com_getparms,
+         jpc_com_putparms, jpc_com_dumpparms}},
+       {-1, "UNKNOWN",  {jpc_unk_destroyparms, jpc_unk_getparms,
+         jpc_unk_putparms, jpc_unk_dumpparms}}
+};
+
+/******************************************************************************\
+* Code stream manipulation functions.
+\******************************************************************************/
+
+/* Create a code stream state object. */
+jpc_cstate_t *jpc_cstate_create()
+{
+       jpc_cstate_t *cstate;
+       if (!(cstate = jas_malloc(sizeof(jpc_cstate_t)))) {
+               return 0;
+       }
+       cstate->numcomps = 0;
+       return cstate;
+}
+
+/* Destroy a code stream state object. */
+void jpc_cstate_destroy(jpc_cstate_t *cstate)
+{
+       jas_free(cstate);
+}
+
+/* Read a marker segment from a stream. */
+jpc_ms_t *jpc_getms(jas_stream_t *in, jpc_cstate_t *cstate)
+{
+       jpc_ms_t *ms;
+       jpc_mstabent_t *mstabent;
+       jas_stream_t *tmpstream;
+
+       if (!(ms = jpc_ms_create(0))) {
+               return 0;
+       }
+
+       /* Get the marker type. */
+       if (jpc_getuint16(in, &ms->id) || ms->id < JPC_MS_MIN ||
+         ms->id > JPC_MS_MAX) {
+               jpc_ms_destroy(ms);
+               return 0;
+       }
+
+       mstabent = jpc_mstab_lookup(ms->id);
+       ms->ops = &mstabent->ops;
+
+       /* Get the marker segment length and parameters if present. */
+       /* Note: It is tacitly assumed that a marker segment cannot have
+         parameters unless it has a length field.  That is, there cannot
+         be a parameters field without a length field and vice versa. */
+       if (JPC_MS_HASPARMS(ms->id)) {
+               /* Get the length of the marker segment. */
+               if (jpc_getuint16(in, &ms->len) || ms->len < 3) {
+                       jpc_ms_destroy(ms);
+                       return 0;
+               }
+               /* Calculate the length of the marker segment parameters. */
+               ms->len -= 2;
+               /* Create and prepare a temporary memory stream from which to
+                 read the marker segment parameters. */
+               /* Note: This approach provides a simple way of ensuring that
+                 we never read beyond the end of the marker segment (even if
+                 the marker segment length is errantly set too small). */
+               if (!(tmpstream = jas_stream_memopen(0, 0))) {
+                       jpc_ms_destroy(ms);
+                       return 0;
+               }
+               if (jas_stream_copy(tmpstream, in, ms->len) ||
+                 jas_stream_seek(tmpstream, 0, SEEK_SET) < 0) {
+                       jas_stream_close(tmpstream);
+                       jpc_ms_destroy(ms);
+                       return 0;
+               }
+               /* Get the marker segment parameters. */
+               if ((*ms->ops->getparms)(ms, cstate, tmpstream)) {
+                       ms->ops = 0;
+                       jpc_ms_destroy(ms);
+                       jas_stream_close(tmpstream);
+                       return 0;
+               }
+
+               if (jas_getdbglevel() > 0) {
+                       jpc_ms_dump(ms, stderr);
+               }
+
+               if (JAS_CAST(ulong, jas_stream_tell(tmpstream)) != ms->len) {
+                       jas_eprintf("warning: trailing garbage in marker segment (%ld bytes)\n",
+                         ms->len - jas_stream_tell(tmpstream));
+               }
+
+               /* Close the temporary stream. */
+               jas_stream_close(tmpstream);
+
+       } else {
+               /* There are no marker segment parameters. */
+               ms->len = 0;
+
+               if (jas_getdbglevel() > 0) {
+                       jpc_ms_dump(ms, stderr);
+               }
+       }
+
+       /* Update the code stream state information based on the type of
+         marker segment read. */
+       /* Note: This is a bit of a hack, but I'm not going to define another
+         type of virtual function for this one special case. */
+       if (ms->id == JPC_MS_SIZ) {
+               cstate->numcomps = ms->parms.siz.numcomps;
+       }
+
+       return ms;
+}
+
+/* Write a marker segment to a stream. */
+int jpc_putms(jas_stream_t *out, jpc_cstate_t *cstate, jpc_ms_t *ms)
+{
+       jas_stream_t *tmpstream;
+       int len;
+
+       /* Output the marker segment type. */
+       if (jpc_putuint16(out, ms->id)) {
+               return -1;
+       }
+
+       /* Output the marker segment length and parameters if necessary. */
+       if (ms->ops->putparms) {
+               /* Create a temporary stream in which to buffer the
+                 parameter data. */
+               if (!(tmpstream = jas_stream_memopen(0, 0))) {
+                       return -1;
+               }
+               if ((*ms->ops->putparms)(ms, cstate, tmpstream)) {
+                       jas_stream_close(tmpstream);
+                       return -1;
+               }
+               /* Get the number of bytes of parameter data written. */
+               if ((len = jas_stream_tell(tmpstream)) < 0) {
+                       jas_stream_close(tmpstream);
+                       return -1;
+               }
+               ms->len = len;
+               /* Write the marker segment length and parameter data to
+                 the output stream. */
+               if (jas_stream_seek(tmpstream, 0, SEEK_SET) < 0 ||
+                 jpc_putuint16(out, ms->len + 2) ||
+                 jas_stream_copy(out, tmpstream, ms->len) < 0) {
+                       jas_stream_close(tmpstream);
+                       return -1;
+               }
+               /* Close the temporary stream. */
+               jas_stream_close(tmpstream);
+       }
+
+       /* This is a bit of a hack, but I'm not going to define another
+         type of virtual function for this one special case. */
+       if (ms->id == JPC_MS_SIZ) {
+               cstate->numcomps = ms->parms.siz.numcomps;
+       }
+
+       if (jas_getdbglevel() > 0) {
+               jpc_ms_dump(ms, stderr);
+       }
+
+       return 0;
+}
+
+/******************************************************************************\
+* Marker segment operations.
+\******************************************************************************/
+
+/* Create a marker segment of the specified type. */
+jpc_ms_t *jpc_ms_create(int type)
+{
+       jpc_ms_t *ms;
+       jpc_mstabent_t *mstabent;
+
+       if (!(ms = jas_malloc(sizeof(jpc_ms_t)))) {
+               return 0;
+       }
+       ms->id = type;
+       ms->len = 0;
+       mstabent = jpc_mstab_lookup(ms->id);
+       ms->ops = &mstabent->ops;
+       memset(&ms->parms, 0, sizeof(jpc_msparms_t));
+       return ms;
+}
+
+/* Destroy a marker segment. */
+void jpc_ms_destroy(jpc_ms_t *ms)
+{
+       if (ms->ops && ms->ops->destroyparms) {
+               (*ms->ops->destroyparms)(ms);
+       }
+       jas_free(ms);
+}
+
+/* Dump a marker segment to a stream for debugging. */
+void jpc_ms_dump(jpc_ms_t *ms, FILE *out)
+{
+       jpc_mstabent_t *mstabent;
+       mstabent = jpc_mstab_lookup(ms->id);
+       fprintf(out, "type = 0x%04x (%s);", ms->id, mstabent->name);
+       if (JPC_MS_HASPARMS(ms->id)) {
+               fprintf(out, " len = %d;", ms->len + 2);
+               if (ms->ops->dumpparms) {
+                       (*ms->ops->dumpparms)(ms, out);
+               } else {
+                       fprintf(out, "\n");
+               }
+       } else {
+               fprintf(out, "\n");
+       }
+}
+
+/******************************************************************************\
+* SOT marker segment operations.
+\******************************************************************************/
+
+static int jpc_sot_getparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *in)
+{
+       jpc_sot_t *sot = &ms->parms.sot;
+
+       /* Eliminate compiler warning about unused variables. */
+       cstate = 0;
+
+       if (jpc_getuint16(in, &sot->tileno) ||
+         jpc_getuint32(in, &sot->len) ||
+         jpc_getuint8(in, &sot->partno) ||
+         jpc_getuint8(in, &sot->numparts)) {
+               return -1;
+       }
+       if (jas_stream_eof(in)) {
+               return -1;
+       }
+       return 0;
+}
+
+static int jpc_sot_putparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *out)
+{
+       jpc_sot_t *sot = &ms->parms.sot;
+
+       /* Eliminate compiler warning about unused variables. */
+       cstate = 0;
+
+       if (jpc_putuint16(out, sot->tileno) ||
+         jpc_putuint32(out, sot->len) ||
+         jpc_putuint8(out, sot->partno) ||
+         jpc_putuint8(out, sot->numparts)) {
+               return -1;
+       }
+       return 0;
+}
+
+static int jpc_sot_dumpparms(jpc_ms_t *ms, FILE *out)
+{
+       jpc_sot_t *sot = &ms->parms.sot;
+       fprintf(out, "tileno = %d; len = %d; partno = %d; numparts = %d\n",
+         sot->tileno, sot->len, sot->partno, sot->numparts);
+       return 0;
+}
+
+/******************************************************************************\
+* SIZ marker segment operations.
+\******************************************************************************/
+
+static void jpc_siz_destroyparms(jpc_ms_t *ms)
+{
+       jpc_siz_t *siz = &ms->parms.siz;
+       if (siz->comps) {
+               jas_free(siz->comps);
+       }
+}
+
+static int jpc_siz_getparms(jpc_ms_t *ms, jpc_cstate_t *cstate,
+  jas_stream_t *in)
+{
+       jpc_siz_t *siz = &ms->parms.siz;
+       unsigned int i;
+       uint_fast8_t tmp;
+
+       /* Eliminate compiler warning about unused variables. */
+       cstate = 0;
+
+       if (jpc_getuint16(in, &siz->caps) ||
+         jpc_getuint32(in, &siz->width) ||
+         jpc_getuint32(in, &siz->height) ||
+         jpc_getuint32(in, &siz->xoff) ||
+         jpc_getuint32(in, &siz->yoff) ||
+         jpc_getuint32(in, &siz->tilewidth) ||
+         jpc_getuint32(in, &siz->tileheight) ||
+         jpc_getuint32(in, &siz->tilexoff) ||
+         jpc_getuint32(in, &siz->tileyoff) ||
+         jpc_getuint16(in, &siz->numcomps)) {
+               return -1;
+       }
+       if (!siz->width || !siz->height || !siz->tilewidth ||
+         !siz->tileheight || !siz->numcomps) {
+               return -1;
+       }
+       if (!(siz->comps = jas_malloc(siz->numcomps * sizeof(jpc_sizcomp_t)))) {
+               return -1;
+       }
+       for (i = 0; i < siz->numcomps; ++i) {
+               if (jpc_getuint8(in, &tmp) ||
+                 jpc_getuint8(in, &siz->comps[i].hsamp) ||
+                 jpc_getuint8(in, &siz->comps[i].vsamp)) {
+                       jas_free(siz->comps);
+                       return -1;
+               }
+               siz->comps[i].sgnd = (tmp >> 7) & 1;
+               siz->comps[i].prec = (tmp & 0x7f) + 1;
+       }
+       if (jas_stream_eof(in)) {
+               jas_free(siz->comps);
+               return -1;
+       }
+       return 0;
+}
+
+static int jpc_siz_putparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *out)
+{
+       jpc_siz_t *siz = &ms->parms.siz;
+       unsigned int i;
+
+       /* Eliminate compiler warning about unused variables. */
+       cstate = 0;
+
+       assert(siz->width && siz->height && siz->tilewidth &&
+         siz->tileheight && siz->numcomps);
+       if (jpc_putuint16(out, siz->caps) ||
+         jpc_putuint32(out, siz->width) ||
+         jpc_putuint32(out, siz->height) ||
+         jpc_putuint32(out, siz->xoff) ||
+         jpc_putuint32(out, siz->yoff) ||
+         jpc_putuint32(out, siz->tilewidth) ||
+         jpc_putuint32(out, siz->tileheight) ||
+         jpc_putuint32(out, siz->tilexoff) ||
+         jpc_putuint32(out, siz->tileyoff) ||
+         jpc_putuint16(out, siz->numcomps)) {
+               return -1;
+       }
+       for (i = 0; i < siz->numcomps; ++i) {
+               if (jpc_putuint8(out, ((siz->comps[i].sgnd & 1) << 7) |
+                 ((siz->comps[i].prec - 1) & 0x7f)) ||
+                 jpc_putuint8(out, siz->comps[i].hsamp) ||
+                 jpc_putuint8(out, siz->comps[i].vsamp)) {
+                       return -1;
+               }
+       }
+       return 0;
+}
+
+static int jpc_siz_dumpparms(jpc_ms_t *ms, FILE *out)
+{
+       jpc_siz_t *siz = &ms->parms.siz;
+       unsigned int i;
+       fprintf(out, "caps = 0x%02x;\n", siz->caps);
+       fprintf(out, "width = %d; height = %d; xoff = %d; yoff = %d;\n",
+         siz->width, siz->height, siz->xoff, siz->yoff);
+       fprintf(out, "tilewidth = %d; tileheight = %d; tilexoff = %d; "
+         "tileyoff = %d;\n", siz->tilewidth, siz->tileheight, siz->tilexoff,
+         siz->tileyoff);
+       for (i = 0; i < siz->numcomps; ++i) {
+               fprintf(out, "prec[%d] = %d; sgnd[%d] = %d; hsamp[%d] = %d; "
+                 "vsamp[%d] = %d\n", i, siz->comps[i].prec, i,
+                 siz->comps[i].sgnd, i, siz->comps[i].hsamp, i,
+                 siz->comps[i].vsamp);
+       }
+       return 0;
+}
+
+/******************************************************************************\
+* COD marker segment operations.
+\******************************************************************************/
+
+static void jpc_cod_destroyparms(jpc_ms_t *ms)
+{
+       jpc_cod_t *cod = &ms->parms.cod;
+       jpc_cox_destroycompparms(&cod->compparms);
+}
+
+static int jpc_cod_getparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *in)
+{
+       jpc_cod_t *cod = &ms->parms.cod;
+       if (jpc_getuint8(in, &cod->csty)) {
+               return -1;
+       }
+       if (jpc_getuint8(in, &cod->prg) ||
+         jpc_getuint16(in, &cod->numlyrs) ||
+         jpc_getuint8(in, &cod->mctrans)) {
+               return -1;
+       }
+       if (jpc_cox_getcompparms(ms, cstate, in,
+         (cod->csty & JPC_COX_PRT) != 0, &cod->compparms)) {
+               return -1;
+       }
+       if (jas_stream_eof(in)) {
+               jpc_cod_destroyparms(ms);
+               return -1;
+       }
+       return 0;
+}
+
+static int jpc_cod_putparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *out)
+{
+       jpc_cod_t *cod = &ms->parms.cod;
+       assert(cod->numlyrs > 0 && cod->compparms.numdlvls <= 32);
+       assert(cod->compparms.numdlvls == cod->compparms.numrlvls - 1);
+       if (jpc_putuint8(out, cod->compparms.csty) ||
+         jpc_putuint8(out, cod->prg) ||
+         jpc_putuint16(out, cod->numlyrs) ||
+         jpc_putuint8(out, cod->mctrans)) {
+               return -1;
+       }
+       if (jpc_cox_putcompparms(ms, cstate, out,
+         (cod->csty & JPC_COX_PRT) != 0, &cod->compparms)) {
+               return -1;
+       }
+       return 0;
+}
+
+static int jpc_cod_dumpparms(jpc_ms_t *ms, FILE *out)
+{
+       jpc_cod_t *cod = &ms->parms.cod;
+       int i;
+       fprintf(out, "csty = 0x%02x;\n", cod->compparms.csty);
+       fprintf(out, "numdlvls = %d; qmfbid = %d; mctrans = %d\n",
+         cod->compparms.numdlvls, cod->compparms.qmfbid, cod->mctrans);
+       fprintf(out, "prg = %d; numlyrs = %d;\n",
+         cod->prg, cod->numlyrs);
+       fprintf(out, "cblkwidthval = %d; cblkheightval = %d; "
+         "cblksty = 0x%02x;\n", cod->compparms.cblkwidthval, cod->compparms.cblkheightval,
+         cod->compparms.cblksty);
+       if (cod->csty & JPC_COX_PRT) {
+               for (i = 0; i < cod->compparms.numrlvls; ++i) {
+                       jas_eprintf("prcwidth[%d] = %d, prcheight[%d] = %d\n",
+                         i, cod->compparms.rlvls[i].parwidthval,
+                         i, cod->compparms.rlvls[i].parheightval);
+               }
+       }
+       return 0;
+}
+
+/******************************************************************************\
+* COC marker segment operations.
+\******************************************************************************/
+
+static void jpc_coc_destroyparms(jpc_ms_t *ms)
+{
+       jpc_coc_t *coc = &ms->parms.coc;
+       jpc_cox_destroycompparms(&coc->compparms);
+}
+
+static int jpc_coc_getparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *in)
+{
+       jpc_coc_t *coc = &ms->parms.coc;
+       uint_fast8_t tmp;
+       if (cstate->numcomps <= 256) {
+               if (jpc_getuint8(in, &tmp)) {
+                       return -1;
+               }
+               coc->compno = tmp;
+       } else {
+               if (jpc_getuint16(in, &coc->compno)) {
+                       return -1;
+               }
+       }
+       if (jpc_getuint8(in, &coc->compparms.csty)) {
+               return -1;
+       }
+       if (jpc_cox_getcompparms(ms, cstate, in,
+         (coc->compparms.csty & JPC_COX_PRT) != 0, &coc->compparms)) {
+               return -1;
+       }
+       if (jas_stream_eof(in)) {
+               return -1;
+       }
+       return 0;
+}
+
+static int jpc_coc_putparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *out)
+{
+       jpc_coc_t *coc = &ms->parms.coc;
+       assert(coc->compparms.numdlvls <= 32);
+       if (cstate->numcomps <= 256) {
+               if (jpc_putuint8(out, coc->compno)) {
+                       return -1;
+               }
+       } else {
+               if (jpc_putuint16(out, coc->compno)) {
+                       return -1;
+               }
+       }
+       if (jpc_putuint8(out, coc->compparms.csty)) {
+               return -1;
+       }
+       if (jpc_cox_putcompparms(ms, cstate, out,
+         (coc->compparms.csty & JPC_COX_PRT) != 0, &coc->compparms)) {
+               return -1;
+       }
+       return 0;
+}
+
+static int jpc_coc_dumpparms(jpc_ms_t *ms, FILE *out)
+{
+       jpc_coc_t *coc = &ms->parms.coc;
+       fprintf(out, "compno = %d; csty = 0x%02x; numdlvls = %d;\n",
+         coc->compno, coc->compparms.csty, coc->compparms.numdlvls);
+       fprintf(out, "cblkwidthval = %d; cblkheightval = %d; "
+         "cblksty = 0x%02x; qmfbid = %d;\n", coc->compparms.cblkwidthval,
+         coc->compparms.cblkheightval, coc->compparms.cblksty, coc->compparms.qmfbid);
+       return 0;
+}
+/******************************************************************************\
+* COD/COC marker segment operation helper functions.
+\******************************************************************************/
+
+static void jpc_cox_destroycompparms(jpc_coxcp_t *compparms)
+{
+       /* Eliminate compiler warning about unused variables. */
+       compparms = 0;
+}
+
+static int jpc_cox_getcompparms(jpc_ms_t *ms, jpc_cstate_t *cstate,
+  jas_stream_t *in, int prtflag, jpc_coxcp_t *compparms)
+{
+       uint_fast8_t tmp;
+       int i;
+
+       /* Eliminate compiler warning about unused variables. */
+       ms = 0;
+       cstate = 0;
+
+       if (jpc_getuint8(in, &compparms->numdlvls) ||
+         jpc_getuint8(in, &compparms->cblkwidthval) ||
+         jpc_getuint8(in, &compparms->cblkheightval) ||
+         jpc_getuint8(in, &compparms->cblksty) ||
+         jpc_getuint8(in, &compparms->qmfbid)) {
+               return -1;
+       }
+       compparms->numrlvls = compparms->numdlvls + 1;
+       if (prtflag) {
+               for (i = 0; i < compparms->numrlvls; ++i) {
+                       if (jpc_getuint8(in, &tmp)) {
+                               jpc_cox_destroycompparms(compparms);
+                               return -1;
+                       }
+                       compparms->rlvls[i].parwidthval = tmp & 0xf;
+                       compparms->rlvls[i].parheightval = (tmp >> 4) & 0xf;
+               }
+/* Sigh.  This bit should be in the same field in both COC and COD mrk segs. */
+compparms->csty |= JPC_COX_PRT;
+       } else {
+       }
+       if (jas_stream_eof(in)) {
+               jpc_cox_destroycompparms(compparms);
+               return -1;
+       }
+       return 0;
+}
+
+static int jpc_cox_putcompparms(jpc_ms_t *ms, jpc_cstate_t *cstate,
+  jas_stream_t *out, int prtflag, jpc_coxcp_t *compparms)
+{
+       int i;
+       assert(compparms->numdlvls <= 32);
+
+       /* Eliminate compiler warning about unused variables. */
+       ms = 0;
+       cstate = 0;
+
+       if (jpc_putuint8(out, compparms->numdlvls) ||
+         jpc_putuint8(out, compparms->cblkwidthval) ||
+         jpc_putuint8(out, compparms->cblkheightval) ||
+         jpc_putuint8(out, compparms->cblksty) ||
+         jpc_putuint8(out, compparms->qmfbid)) {
+               return -1;
+       }
+       if (prtflag) {
+               for (i = 0; i < compparms->numrlvls; ++i) {
+                       if (jpc_putuint8(out,
+                         ((compparms->rlvls[i].parheightval & 0xf) << 4) |
+                         (compparms->rlvls[i].parwidthval & 0xf))) {
+                               return -1;
+                       }
+               }
+       }
+       return 0;
+}
+
+/******************************************************************************\
+* RGN marker segment operations.
+\******************************************************************************/
+
+static int jpc_rgn_getparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *in)
+{
+       jpc_rgn_t *rgn = &ms->parms.rgn;
+       uint_fast8_t tmp;
+       if (cstate->numcomps <= 256) {
+               if (jpc_getuint8(in, &tmp)) {
+                       return -1;
+               }
+               rgn->compno = tmp;
+       } else {
+               if (jpc_getuint16(in, &rgn->compno)) {
+                       return -1;
+               }
+       }
+       if (jpc_getuint8(in, &rgn->roisty) ||
+         jpc_getuint8(in, &rgn->roishift)) {
+               return -1;
+       }
+       return 0;
+}
+
+static int jpc_rgn_putparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *out)
+{
+       jpc_rgn_t *rgn = &ms->parms.rgn;
+       if (cstate->numcomps <= 256) {
+               if (jpc_putuint8(out, rgn->compno)) {
+                       return -1;
+               }
+       } else {
+               if (jpc_putuint16(out, rgn->compno)) {
+                       return -1;
+               }
+       }
+       if (jpc_putuint8(out, rgn->roisty) ||
+         jpc_putuint8(out, rgn->roishift)) {
+               return -1;
+       }
+       return 0;
+}
+
+static int jpc_rgn_dumpparms(jpc_ms_t *ms, FILE *out)
+{
+       jpc_rgn_t *rgn = &ms->parms.rgn;
+       fprintf(out, "compno = %d; roisty = %d; roishift = %d\n",
+         rgn->compno, rgn->roisty, rgn->roishift);
+       return 0;
+}
+
+/******************************************************************************\
+* QCD marker segment operations.
+\******************************************************************************/
+
+static void jpc_qcd_destroyparms(jpc_ms_t *ms)
+{
+       jpc_qcd_t *qcd = &ms->parms.qcd;
+       jpc_qcx_destroycompparms(&qcd->compparms);
+}
+
+static int jpc_qcd_getparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *in)
+{
+       jpc_qcxcp_t *compparms = &ms->parms.qcd.compparms;
+       return jpc_qcx_getcompparms(compparms, cstate, in, ms->len);
+}
+
+static int jpc_qcd_putparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *out)
+{
+       jpc_qcxcp_t *compparms = &ms->parms.qcd.compparms;
+       return jpc_qcx_putcompparms(compparms, cstate, out);
+}
+
+static int jpc_qcd_dumpparms(jpc_ms_t *ms, FILE *out)
+{
+       jpc_qcd_t *qcd = &ms->parms.qcd;
+       int i;
+       fprintf(out, "qntsty = %d; numguard = %d; numstepsizes = %d\n",
+         (int) qcd->compparms.qntsty, qcd->compparms.numguard, qcd->compparms.numstepsizes);
+       for (i = 0; i < qcd->compparms.numstepsizes; ++i) {
+               fprintf(out, "expn[%d] = 0x%04x; mant[%d] = 0x%04x;\n",
+                 i, (unsigned) JPC_QCX_GETEXPN(qcd->compparms.stepsizes[i]),
+                 i, (unsigned) JPC_QCX_GETMANT(qcd->compparms.stepsizes[i]));
+       }
+       return 0;
+}
+
+/******************************************************************************\
+* QCC marker segment operations.
+\******************************************************************************/
+
+static void jpc_qcc_destroyparms(jpc_ms_t *ms)
+{
+       jpc_qcc_t *qcc = &ms->parms.qcc;
+       jpc_qcx_destroycompparms(&qcc->compparms);
+}
+
+static int jpc_qcc_getparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *in)
+{
+       jpc_qcc_t *qcc = &ms->parms.qcc;
+       uint_fast8_t tmp;
+       int len;
+       len = ms->len;
+       if (cstate->numcomps <= 256) {
+               jpc_getuint8(in, &tmp);
+               qcc->compno = tmp;
+               --len;
+       } else {
+               jpc_getuint16(in, &qcc->compno);
+               len -= 2;
+       }
+       if (jpc_qcx_getcompparms(&qcc->compparms, cstate, in, len)) {
+               return -1;
+       }
+       if (jas_stream_eof(in)) {
+               jpc_qcc_destroyparms(ms);
+               return -1;
+       }
+       return 0;
+}
+
+static int jpc_qcc_putparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *out)
+{
+       jpc_qcc_t *qcc = &ms->parms.qcc;
+       if (cstate->numcomps <= 256) {
+               jpc_putuint8(out, qcc->compno);
+       } else {
+               jpc_putuint16(out, qcc->compno);
+       }
+       if (jpc_qcx_putcompparms(&qcc->compparms, cstate, out)) {
+               return -1;
+       }
+       return 0;
+}
+
+static int jpc_qcc_dumpparms(jpc_ms_t *ms, FILE *out)
+{
+       jpc_qcc_t *qcc = &ms->parms.qcc;
+       int i;
+       fprintf(out, "compno = %d; qntsty = %d; numguard = %d; "
+         "numstepsizes = %d\n", qcc->compno, qcc->compparms.qntsty, qcc->compparms.numguard,
+         qcc->compparms.numstepsizes);
+       for (i = 0; i < qcc->compparms.numstepsizes; ++i) {
+               fprintf(out, "expn[%d] = 0x%04x; mant[%d] = 0x%04x;\n",
+                 i, (unsigned) JPC_QCX_GETEXPN(qcc->compparms.stepsizes[i]),
+                 i, (unsigned) JPC_QCX_GETMANT(qcc->compparms.stepsizes[i]));
+       }
+       return 0;
+}
+
+/******************************************************************************\
+* QCD/QCC marker segment helper functions.
+\******************************************************************************/
+
+static void jpc_qcx_destroycompparms(jpc_qcxcp_t *compparms)
+{
+       if (compparms->stepsizes) {
+               jas_free(compparms->stepsizes);
+       }
+}
+
+static int jpc_qcx_getcompparms(jpc_qcxcp_t *compparms, jpc_cstate_t *cstate,
+  jas_stream_t *in, uint_fast16_t len)
+{
+       uint_fast8_t tmp;
+       int n;
+       int i;
+
+       /* Eliminate compiler warning about unused variables. */
+       cstate = 0;
+
+       n = 0;
+       jpc_getuint8(in, &tmp);
+       ++n;
+       compparms->qntsty = tmp & 0x1f;
+       compparms->numguard = (tmp >> 5) & 7;
+       switch (compparms->qntsty) {
+       case JPC_QCX_SIQNT:
+               compparms->numstepsizes = 1;
+               break;
+       case JPC_QCX_NOQNT:
+               compparms->numstepsizes = (len - n);
+               break;
+       case JPC_QCX_SEQNT:
+               /* XXX - this is a hack */
+               compparms->numstepsizes = (len - n) / 2;
+               break;
+       }
+       if (compparms->numstepsizes > 0) {
+               compparms->stepsizes = jas_malloc(compparms->numstepsizes *
+                 sizeof(uint_fast16_t));
+               assert(compparms->stepsizes);
+               for (i = 0; i < compparms->numstepsizes; ++i) {
+                       if (compparms->qntsty == JPC_QCX_NOQNT) {
+                               jpc_getuint8(in, &tmp);
+                               compparms->stepsizes[i] = JPC_QCX_EXPN(tmp >> 3);
+                       } else {
+                               jpc_getuint16(in, &compparms->stepsizes[i]);
+                       }
+               }
+       } else {
+               compparms->stepsizes = 0;
+       }
+       if (jas_stream_error(in) || jas_stream_eof(in)) {
+               jpc_qcx_destroycompparms(compparms);
+               return -1;
+       }
+       return 0;
+}
+
+static int jpc_qcx_putcompparms(jpc_qcxcp_t *compparms, jpc_cstate_t *cstate,
+  jas_stream_t *out)
+{
+       int i;
+
+       /* Eliminate compiler warning about unused variables. */
+       cstate = 0;
+
+       jpc_putuint8(out, ((compparms->numguard & 7) << 5) | compparms->qntsty);
+       for (i = 0; i < compparms->numstepsizes; ++i) {
+               if (compparms->qntsty == JPC_QCX_NOQNT) {
+                       jpc_putuint8(out, JPC_QCX_GETEXPN(
+                         compparms->stepsizes[i]) << 3);
+               } else {
+                       jpc_putuint16(out, compparms->stepsizes[i]);
+               }
+       }
+       return 0;
+}
+
+/******************************************************************************\
+* SOP marker segment operations.
+\******************************************************************************/
+
+static int jpc_sop_getparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *in)
+{
+       jpc_sop_t *sop = &ms->parms.sop;
+
+       /* Eliminate compiler warning about unused variable. */
+       cstate = 0;
+
+       if (jpc_getuint16(in, &sop->seqno)) {
+               return -1;
+       }
+       return 0;
+}
+
+static int jpc_sop_putparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *out)
+{
+       jpc_sop_t *sop = &ms->parms.sop;
+
+       /* Eliminate compiler warning about unused variable. */
+       cstate = 0;
+
+       if (jpc_putuint16(out, sop->seqno)) {
+               return -1;
+       }
+       return 0;
+}
+
+static int jpc_sop_dumpparms(jpc_ms_t *ms, FILE *out)
+{
+       jpc_sop_t *sop = &ms->parms.sop;
+       fprintf(out, "seqno = %d;\n", sop->seqno);
+       return 0;
+}
+
+/******************************************************************************\
+* PPM marker segment operations.
+\******************************************************************************/
+
+static void jpc_ppm_destroyparms(jpc_ms_t *ms)
+{
+       jpc_ppm_t *ppm = &ms->parms.ppm;
+       if (ppm->data) {
+               jas_free(ppm->data);
+       }
+}
+
+static int jpc_ppm_getparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *in)
+{
+       jpc_ppm_t *ppm = &ms->parms.ppm;
+
+       /* Eliminate compiler warning about unused variables. */
+       cstate = 0;
+
+       ppm->data = 0;
+
+       if (ms->len < 1) {
+               goto error;
+       }
+       if (jpc_getuint8(in, &ppm->ind)) {
+               goto error;
+       }
+
+       ppm->len = ms->len - 1;
+       if (ppm->len > 0) {
+               if (!(ppm->data = jas_malloc(ppm->len * sizeof(unsigned char)))) {
+                       goto error;
+               }
+               if (JAS_CAST(uint, jas_stream_read(in, ppm->data, ppm->len)) != ppm->len) {
+                       goto error;
+               }
+       } else {
+               ppm->data = 0;
+       }
+       return 0;
+
+error:
+       jpc_ppm_destroyparms(ms);
+       return -1;
+}
+
+static int jpc_ppm_putparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *out)
+{
+       jpc_ppm_t *ppm = &ms->parms.ppm;
+
+       /* Eliminate compiler warning about unused variables. */
+       cstate = 0;
+
+       if (JAS_CAST(uint, jas_stream_write(out, (char *) ppm->data, ppm->len)) != ppm->len) {
+               return -1;
+       }
+       return 0;
+}
+
+static int jpc_ppm_dumpparms(jpc_ms_t *ms, FILE *out)
+{
+       jpc_ppm_t *ppm = &ms->parms.ppm;
+       fprintf(out, "ind=%d; len = %d;\n", ppm->ind, ppm->len);
+       if (ppm->len > 0) {
+               fprintf(out, "data =\n");
+               jas_memdump(out, ppm->data, ppm->len);
+       }
+       return 0;
+}
+
+/******************************************************************************\
+* PPT marker segment operations.
+\******************************************************************************/
+
+static void jpc_ppt_destroyparms(jpc_ms_t *ms)
+{
+       jpc_ppt_t *ppt = &ms->parms.ppt;
+       if (ppt->data) {
+               jas_free(ppt->data);
+       }
+}
+
+static int jpc_ppt_getparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *in)
+{
+       jpc_ppt_t *ppt = &ms->parms.ppt;
+
+       /* Eliminate compiler warning about unused variables. */
+       cstate = 0;
+
+       ppt->data = 0;
+
+       if (ms->len < 1) {
+               goto error;
+       }
+       if (jpc_getuint8(in, &ppt->ind)) {
+               goto error;
+       }
+       ppt->len = ms->len - 1;
+       if (ppt->len > 0) {
+               if (!(ppt->data = jas_malloc(ppt->len * sizeof(unsigned char)))) {
+                       goto error;
+               }
+               if (jas_stream_read(in, (char *) ppt->data, ppt->len) != JAS_CAST(int, ppt->len)) {
+                       goto error;
+               }
+       } else {
+               ppt->data = 0;
+       }
+       return 0;
+
+error:
+       jpc_ppt_destroyparms(ms);
+       return -1;
+}
+
+static int jpc_ppt_putparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *out)
+{
+       jpc_ppt_t *ppt = &ms->parms.ppt;
+
+       /* Eliminate compiler warning about unused variable. */
+       cstate = 0;
+
+       if (jpc_putuint8(out, ppt->ind)) {
+               return -1;
+       }
+       if (jas_stream_write(out, (char *) ppt->data, ppt->len) != JAS_CAST(int, ppt->len)) {
+               return -1;
+       }
+       return 0;
+}
+
+static int jpc_ppt_dumpparms(jpc_ms_t *ms, FILE *out)
+{
+       jpc_ppt_t *ppt = &ms->parms.ppt;
+       fprintf(out, "ind=%d; len = %d;\n", ppt->ind, ppt->len);
+       if (ppt->len > 0) {
+               fprintf(out, "data =\n");
+               jas_memdump(out, ppt->data, ppt->len);
+       }
+       return 0;
+}
+
+/******************************************************************************\
+* POC marker segment operations.
+\******************************************************************************/
+
+static void jpc_poc_destroyparms(jpc_ms_t *ms)
+{
+       jpc_poc_t *poc = &ms->parms.poc;
+       if (poc->pchgs) {
+               jas_free(poc->pchgs);
+       }
+}
+
+static int jpc_poc_getparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *in)
+{
+       jpc_poc_t *poc = &ms->parms.poc;
+       jpc_pocpchg_t *pchg;
+       int pchgno;
+       uint_fast8_t tmp;
+       poc->numpchgs = (cstate->numcomps > 256) ? (ms->len / 9) :
+         (ms->len / 7);
+       if (!(poc->pchgs = jas_malloc(poc->numpchgs * sizeof(jpc_pocpchg_t)))) {
+               goto error;
+       }
+       for (pchgno = 0, pchg = poc->pchgs; pchgno < poc->numpchgs; ++pchgno,
+         ++pchg) {
+               if (jpc_getuint8(in, &pchg->rlvlnostart)) {
+                       goto error;
+               }
+               if (cstate->numcomps > 256) {
+                       if (jpc_getuint16(in, &pchg->compnostart)) {
+                               goto error;
+                       }
+               } else {
+                       if (jpc_getuint8(in, &tmp)) {
+                               goto error;
+                       };
+                       pchg->compnostart = tmp;
+               }
+               if (jpc_getuint16(in, &pchg->lyrnoend) ||
+                 jpc_getuint8(in, &pchg->rlvlnoend)) {
+                       goto error;
+               }
+               if (cstate->numcomps > 256) {
+                       if (jpc_getuint16(in, &pchg->compnoend)) {
+                               goto error;
+                       }
+               } else {
+                       if (jpc_getuint8(in, &tmp)) {
+                               goto error;
+                       }
+                       pchg->compnoend = tmp;
+               }
+               if (jpc_getuint8(in, &pchg->prgord)) {
+                       goto error;
+               }
+               if (pchg->rlvlnostart > pchg->rlvlnoend ||
+                 pchg->compnostart > pchg->compnoend) {
+                       goto error;
+               }
+       }
+       return 0;
+
+error:
+       jpc_poc_destroyparms(ms);
+       return -1;
+}
+
+static int jpc_poc_putparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *out)
+{
+       jpc_poc_t *poc = &ms->parms.poc;
+       jpc_pocpchg_t *pchg;
+       int pchgno;
+       for (pchgno = 0, pchg = poc->pchgs; pchgno < poc->numpchgs; ++pchgno,
+         ++pchg) {
+               if (jpc_putuint8(out, pchg->rlvlnostart) ||
+                 ((cstate->numcomps > 256) ?
+                 jpc_putuint16(out, pchg->compnostart) :
+                 jpc_putuint8(out, pchg->compnostart)) ||
+                 jpc_putuint16(out, pchg->lyrnoend) ||
+                 jpc_putuint8(out, pchg->rlvlnoend) ||
+                 ((cstate->numcomps > 256) ?
+                 jpc_putuint16(out, pchg->compnoend) :
+                 jpc_putuint8(out, pchg->compnoend)) ||
+                 jpc_putuint8(out, pchg->prgord)) {
+                       return -1;
+               }
+       }
+       return 0;
+}
+
+static int jpc_poc_dumpparms(jpc_ms_t *ms, FILE *out)
+{
+       jpc_poc_t *poc = &ms->parms.poc;
+       jpc_pocpchg_t *pchg;
+       int pchgno;
+       for (pchgno = 0, pchg = poc->pchgs; pchgno < poc->numpchgs;
+         ++pchgno, ++pchg) {
+               fprintf(out, "po[%d] = %d; ", pchgno, pchg->prgord);
+               fprintf(out, "cs[%d] = %d; ce[%d] = %d; ",
+                 pchgno, pchg->compnostart, pchgno, pchg->compnoend);
+               fprintf(out, "rs[%d] = %d; re[%d] = %d; ",
+                 pchgno, pchg->rlvlnostart, pchgno, pchg->rlvlnoend);
+               fprintf(out, "le[%d] = %d\n", pchgno, pchg->lyrnoend);
+       }
+       return 0;
+}
+
+/******************************************************************************\
+* CRG marker segment operations.
+\******************************************************************************/
+
+static void jpc_crg_destroyparms(jpc_ms_t *ms)
+{
+       jpc_crg_t *crg = &ms->parms.crg;
+       if (crg->comps) {
+               jas_free(crg->comps);
+       }
+}
+
+static int jpc_crg_getparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *in)
+{
+       jpc_crg_t *crg = &ms->parms.crg;
+       jpc_crgcomp_t *comp;
+       uint_fast16_t compno;
+       crg->numcomps = cstate->numcomps;
+       if (!(crg->comps = jas_malloc(cstate->numcomps * sizeof(uint_fast16_t)))) {
+               return -1;
+       }
+       for (compno = 0, comp = crg->comps; compno < cstate->numcomps;
+         ++compno, ++comp) {
+               if (jpc_getuint16(in, &comp->hoff) ||
+                 jpc_getuint16(in, &comp->voff)) {
+                       jpc_crg_destroyparms(ms);
+                       return -1;
+               }
+       }
+       return 0;
+}
+
+static int jpc_crg_putparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *out)
+{
+       jpc_crg_t *crg = &ms->parms.crg;
+       int compno;
+       jpc_crgcomp_t *comp;
+
+       /* Eliminate compiler warning about unused variables. */
+       cstate = 0;
+
+       for (compno = 0, comp = crg->comps; compno < crg->numcomps; ++compno,
+         ++comp) {
+               if (jpc_putuint16(out, comp->hoff) ||
+                 jpc_putuint16(out, comp->voff)) {
+                       return -1;
+               }
+       }
+       return 0;
+}
+
+static int jpc_crg_dumpparms(jpc_ms_t *ms, FILE *out)
+{
+       jpc_crg_t *crg = &ms->parms.crg;
+       int compno;
+       jpc_crgcomp_t *comp;
+       for (compno = 0, comp = crg->comps; compno < crg->numcomps; ++compno,
+         ++comp) {
+               fprintf(out, "hoff[%d] = %d; voff[%d] = %d\n", compno,
+                 comp->hoff, compno, comp->voff);
+       }
+       return 0;
+}
+
+/******************************************************************************\
+* Operations for COM marker segment.
+\******************************************************************************/
+
+static void jpc_com_destroyparms(jpc_ms_t *ms)
+{
+       jpc_com_t *com = &ms->parms.com;
+       if (com->data) {
+               jas_free(com->data);
+       }
+}
+
+static int jpc_com_getparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *in)
+{
+       jpc_com_t *com = &ms->parms.com;
+
+       /* Eliminate compiler warning about unused variables. */
+       cstate = 0;
+
+       if (jpc_getuint16(in, &com->regid)) {
+               return -1;
+       }
+       com->len = ms->len - 2;
+       if (com->len > 0) {
+               if (!(com->data = jas_malloc(com->len))) {
+                       return -1;
+               }
+               if (jas_stream_read(in, com->data, com->len) != JAS_CAST(int, com->len)) {
+                       return -1;
+               }
+       } else {
+               com->data = 0;
+       }
+       return 0;
+}
+
+static int jpc_com_putparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *out)
+{
+       jpc_com_t *com = &ms->parms.com;
+
+       /* Eliminate compiler warning about unused variables. */
+       cstate = 0;
+
+       if (jpc_putuint16(out, com->regid)) {
+               return -1;
+       }
+       if (jas_stream_write(out, com->data, com->len) != JAS_CAST(int, com->len)) {
+               return -1;
+       }
+       return 0;
+}
+
+static int jpc_com_dumpparms(jpc_ms_t *ms, FILE *out)
+{
+       jpc_com_t *com = &ms->parms.com;
+       unsigned int i;
+       int printable;
+       fprintf(out, "regid = %d;\n", com->regid);
+       printable = 1;
+       for (i = 0; i < com->len; ++i) {
+               if (!isprint(com->data[i])) {
+                       printable = 0;
+                       break;
+               }
+       }
+       if (printable) {
+               fprintf(out, "data = ");
+               fwrite(com->data, sizeof(char), com->len, out);
+               fprintf(out, "\n");
+       }
+       return 0;
+}
+
+/******************************************************************************\
+* Operations for unknown types of marker segments.
+\******************************************************************************/
+
+static void jpc_unk_destroyparms(jpc_ms_t *ms)
+{
+       jpc_unk_t *unk = &ms->parms.unk;
+       if (unk->data) {
+               jas_free(unk->data);
+       }
+}
+
+static int jpc_unk_getparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *in)
+{
+       jpc_unk_t *unk = &ms->parms.unk;
+
+       /* Eliminate compiler warning about unused variables. */
+       cstate = 0;
+
+       if (ms->len > 0) {
+               if (!(unk->data = jas_malloc(ms->len * sizeof(unsigned char)))) {
+                       return -1;
+               }
+               if (jas_stream_read(in, (char *) unk->data, ms->len) != JAS_CAST(int, ms->len)) {
+                       jas_free(unk->data);
+                       return -1;
+               }
+               unk->len = ms->len;
+       } else {
+               unk->data = 0;
+               unk->len = 0;
+       }
+       return 0;
+}
+
+static int jpc_unk_putparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *out)
+{
+       /* Eliminate compiler warning about unused variables. */
+       cstate = 0;
+       ms = 0;
+       out = 0;
+
+       /* If this function is called, we are trying to write an unsupported
+         type of marker segment.  Return with an error indication.  */
+       return -1;
+}
+
+static int jpc_unk_dumpparms(jpc_ms_t *ms, FILE *out)
+{
+       unsigned int i;
+       jpc_unk_t *unk = &ms->parms.unk;
+       for (i = 0; i < unk->len; ++i) {
+               fprintf(out, "%02x ", unk->data[i]);
+       }
+       return 0;
+}
+
+/******************************************************************************\
+* Primitive I/O operations.
+\******************************************************************************/
+
+int jpc_getuint8(jas_stream_t *in, uint_fast8_t *val)
+{
+       int c;
+       if ((c = jas_stream_getc(in)) == EOF) {
+               return -1;
+       }
+       if (val) {
+               *val = c;
+       }
+       return 0;
+}
+
+int jpc_putuint8(jas_stream_t *out, uint_fast8_t val)
+{
+       if (jas_stream_putc(out, val & 0xff) == EOF) {
+               return -1;
+       }
+       return 0;
+}
+
+int jpc_getuint16(jas_stream_t *in, uint_fast16_t *val)
+{
+       uint_fast16_t v;
+       int c;
+       if ((c = jas_stream_getc(in)) == EOF) {
+               return -1;
+       }
+       v = c;
+       if ((c = jas_stream_getc(in)) == EOF) {
+               return -1;
+       }
+       v = (v << 8) | c;
+       if (val) {
+               *val = v;
+       }
+       return 0;
+}
+
+int jpc_putuint16(jas_stream_t *out, uint_fast16_t val)
+{
+       if (jas_stream_putc(out, (val >> 8) & 0xff) == EOF ||
+         jas_stream_putc(out, val & 0xff) == EOF) {
+               return -1;
+       }
+       return 0;
+}
+
+int jpc_getuint32(jas_stream_t *in, uint_fast32_t *val)
+{
+       uint_fast32_t v;
+       int c;
+       if ((c = jas_stream_getc(in)) == EOF) {
+               return -1;
+       }
+       v = c;
+       if ((c = jas_stream_getc(in)) == EOF) {
+               return -1;
+       }
+       v = (v << 8) | c;
+       if ((c = jas_stream_getc(in)) == EOF) {
+               return -1;
+       }
+       v = (v << 8) | c;
+       if ((c = jas_stream_getc(in)) == EOF) {
+               return -1;
+       }
+       v = (v << 8) | c;
+       if (val) {
+               *val = v;
+       }
+       return 0;
+}
+
+int jpc_putuint32(jas_stream_t *out, uint_fast32_t val)
+{
+       if (jas_stream_putc(out, (val >> 24) & 0xff) == EOF ||
+         jas_stream_putc(out, (val >> 16) & 0xff) == EOF ||
+         jas_stream_putc(out, (val >> 8) & 0xff) == EOF ||
+         jas_stream_putc(out, val & 0xff) == EOF) {
+               return -1;
+       }
+       return 0;
+}
+
+/******************************************************************************\
+* Miscellany
+\******************************************************************************/
+
+static jpc_mstabent_t *jpc_mstab_lookup(int id)
+{
+       jpc_mstabent_t *mstabent;
+       for (mstabent = jpc_mstab;; ++mstabent) {
+               if (mstabent->id == id || mstabent->id < 0) {
+                       return mstabent;
+               }
+       }
+       assert(0);
+       return 0;
+}
+
+int jpc_validate(jas_stream_t *in)
+{
+       int n;
+       int i;
+       unsigned char buf[2];
+
+       assert(JAS_STREAM_MAXPUTBACK >= 2);
+
+       if ((n = jas_stream_read(in, (char *) buf, 2)) < 0) {
+               return -1;
+       }
+       for (i = n - 1; i >= 0; --i) {
+               if (jas_stream_ungetc(in, buf[i]) == EOF) {
+                       return -1;
+               }
+       }
+       if (n < 2) {
+               return -1;
+       }
+       if (buf[0] == (JPC_MS_SOC >> 8) && buf[1] == (JPC_MS_SOC & 0xff)) {
+               return 0;
+       }
+       return -1;
+}
+
+int jpc_getdata(jas_stream_t *in, jas_stream_t *out, long len)
+{
+       return jas_stream_copy(out, in, len);
+}
+
+int jpc_putdata(jas_stream_t *out, jas_stream_t *in, long len)
+{
+       return jas_stream_copy(out, in, len);
+}
diff --git a/src/libjasper/jpc/jpc_cs.h b/src/libjasper/jpc/jpc_cs.h
new file mode 100644 (file)
index 0000000..311986f
--- /dev/null
@@ -0,0 +1,763 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * JPEG-2000 Code Stream Library
+ *
+ * $Id$
+ */
+
+#ifndef JPC_CS_H
+#define JPC_CS_H
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include "jasper/jas_image.h"
+#include "jasper/jas_stream.h"
+
+#include "jpc_cod.h"
+
+/******************************************************************************\
+* Constants and Types.
+\******************************************************************************/
+
+/* The maximum number of resolution levels. */
+#define        JPC_MAXRLVLS    33
+
+/* The maximum number of bands. */
+#define        JPC_MAXBANDS    (3 * JPC_MAXRLVLS + 1)
+
+/* The maximum number of layers. */
+#define JPC_MAXLYRS    16384
+
+/**************************************\
+* Code stream.
+\**************************************/
+
+/*
+ * Code stream states.
+ */
+
+/* Initial. */
+#define        JPC_CS_INIT     0
+/* Main header. */
+#define        JPC_CS_MHDR     1
+/* Tile-part header. */
+#define        JPC_CS_THDR     2
+/* Main trailer. */
+#define        JPC_CS_MTLR     3
+/* Tile-part data. */
+#define        JPC_CS_TDATA    4
+
+/*
+ * Unfortunately, the code stream syntax was not designed in such a way that
+ * any given marker segment can be correctly decoded without additional state
+ * derived from previously decoded marker segments.
+ * For example, a RGN/COC/QCC marker segment cannot be decoded unless the
+ * number of components is known.
+ */
+
+/*
+ * Code stream state information.
+ */
+
+typedef struct {
+
+       /* The number of components. */
+       uint_fast16_t numcomps;
+
+} jpc_cstate_t;
+
+/**************************************\
+* SOT marker segment parameters.
+\**************************************/
+
+typedef struct {
+
+       /* The tile number. */
+       uint_fast16_t tileno;
+
+       /* The combined length of the marker segment and its auxilary data
+         (i.e., packet data). */
+       uint_fast32_t len;
+
+       /* The tile-part instance. */
+       uint_fast8_t partno;
+
+       /* The number of tile-parts. */
+       uint_fast8_t numparts;
+
+} jpc_sot_t;
+
+/**************************************\
+* SIZ marker segment parameters.
+\**************************************/
+
+/* Per component information. */
+
+typedef struct {
+
+       /* The precision of the samples. */
+       uint_fast8_t prec;
+
+       /* The signedness of the samples. */
+       uint_fast8_t sgnd;
+
+       /* The horizontal separation of samples with respect to the reference
+         grid. */
+       uint_fast8_t hsamp;
+
+       /* The vertical separation of samples with respect to the reference
+         grid. */
+       uint_fast8_t vsamp;
+
+} jpc_sizcomp_t;
+
+/* SIZ marker segment parameters. */
+
+typedef struct {
+
+       /* The code stream capabilities. */
+       uint_fast16_t caps;
+
+       /* The width of the image in units of the reference grid. */
+       uint_fast32_t width;
+
+       /* The height of the image in units of the reference grid. */
+       uint_fast32_t height;
+
+       /* The horizontal offset from the origin of the reference grid to the
+         left side of the image area. */
+       uint_fast32_t xoff;
+
+       /* The vertical offset from the origin of the reference grid to the
+         top side of the image area. */
+       uint_fast32_t yoff;
+
+       /* The nominal width of a tile in units of the reference grid. */
+       uint_fast32_t tilewidth;
+
+       /* The nominal height of a tile in units of the reference grid. */
+       uint_fast32_t tileheight;
+
+       /* The horizontal offset from the origin of the reference grid to the
+         left side of the first tile. */
+       uint_fast32_t tilexoff;
+
+       /* The vertical offset from the origin of the reference grid to the
+         top side of the first tile. */
+       uint_fast32_t tileyoff;
+
+       /* The number of components. */
+       uint_fast16_t numcomps;
+
+       /* The per-component information. */
+       jpc_sizcomp_t *comps;
+
+} jpc_siz_t;
+
+/**************************************\
+* COD marker segment parameters.
+\**************************************/
+
+/*
+ * Coding style constants.
+ */
+
+/* Precincts may be used. */
+#define        JPC_COX_PRT     0x01
+/* SOP marker segments may be used. */
+#define        JPC_COD_SOP     0x02
+/* EPH marker segments may be used. */
+#define        JPC_COD_EPH     0x04
+
+/*
+ * Progression order constants.
+ */
+
+/* Layer-resolution-component-precinct progressive
+  (i.e., progressive by fidelity). */
+#define        JPC_COD_LRCPPRG 0
+/* Resolution-layer-component-precinct progressive
+  (i.e., progressive by resolution). */
+#define        JPC_COD_RLCPPRG 1
+/* Resolution-precinct-component-layer progressive. */
+#define        JPC_COD_RPCLPRG 2
+/* Precinct-component-resolution-layer progressive. */
+#define        JPC_COD_PCRLPRG 3
+/* Component-position-resolution-layer progressive. */
+#define        JPC_COD_CPRLPRG 4
+
+/*
+ * Code block style constants.
+ */
+
+#define        JPC_COX_LAZY    0x01 /* Selective arithmetic coding bypass. */
+#define        JPC_COX_RESET   0x02 /* Reset context probabilities. */
+#define        JPC_COX_TERMALL 0x04 /* Terminate all coding passes. */
+#define        JPC_COX_VSC             0x08 /* Vertical stripe causal context formation. */
+#define        JPC_COX_PTERM   0x10 /* Predictable termination. */
+#define        JPC_COX_SEGSYM  0x20 /* Use segmentation symbols. */
+
+/* Transform constants. */
+#define        JPC_COX_INS     0x00 /* Irreversible 9/7. */
+#define        JPC_COX_RFT     0x01 /* Reversible 5/3. */
+
+/* Multicomponent transform constants. */
+#define        JPC_COD_NOMCT   0x00 /* No multicomponent transform. */
+#define        JPC_COD_MCT             0x01 /* Multicomponent transform. */
+
+/* Get the code block size value from the code block size exponent. */
+#define        JPC_COX_CBLKSIZEEXPN(x)         ((x) - 2)
+/* Get the code block size exponent from the code block size value. */
+#define        JPC_COX_GETCBLKSIZEEXPN(x)      ((x) + 2)
+
+/* Per resolution-level information. */
+
+typedef struct {
+
+       /* The packet partition width. */
+       uint_fast8_t parwidthval;
+
+       /* The packet partition height. */
+       uint_fast8_t parheightval;
+
+} jpc_coxrlvl_t;
+
+/* Per component information. */
+
+typedef struct {
+
+       /* The coding style. */
+       uint_fast8_t csty;
+
+       /* The number of decomposition levels. */
+       uint_fast8_t numdlvls;
+
+       /* The nominal code block width specifier. */
+       uint_fast8_t cblkwidthval;
+
+       /* The nominal code block height specifier. */
+       uint_fast8_t cblkheightval;
+
+       /* The style of coding passes. */
+       uint_fast8_t cblksty;
+
+       /* The QMFB employed. */
+       uint_fast8_t qmfbid;
+
+       /* The number of resolution levels. */
+       int numrlvls;
+
+       /* The per-resolution-level information. */
+       jpc_coxrlvl_t rlvls[JPC_MAXRLVLS];
+
+} jpc_coxcp_t;
+
+/* COD marker segment parameters. */
+
+typedef struct {
+
+       /* The general coding style. */
+       uint_fast8_t csty;
+
+       /* The progression order. */
+       uint_fast8_t prg;
+
+       /* The number of layers. */
+       uint_fast16_t numlyrs;
+
+       /* The multicomponent transform. */
+       uint_fast8_t mctrans;
+
+       /* Component-related parameters. */
+       jpc_coxcp_t compparms;
+
+} jpc_cod_t;
+
+/* COC marker segment parameters. */
+
+typedef struct {
+
+       /* The component number. */
+       uint_fast16_t compno;
+
+       /* Component-related parameters. */
+       jpc_coxcp_t compparms;
+
+} jpc_coc_t;
+
+/**************************************\
+* RGN marker segment parameters.
+\**************************************/
+
+/* The maxshift ROI style. */
+#define        JPC_RGN_MAXSHIFT        0x00
+
+typedef struct {
+
+       /* The component to which the marker applies. */
+       uint_fast16_t compno;
+
+       /* The ROI style. */
+       uint_fast8_t roisty;
+
+       /* The ROI shift value. */
+       uint_fast8_t roishift;
+
+} jpc_rgn_t;
+
+/**************************************\
+* QCD/QCC marker segment parameters.
+\**************************************/
+
+/*
+ * Quantization style constants.
+ */
+
+#define        JPC_QCX_NOQNT   0 /* No quantization. */
+#define        JPC_QCX_SIQNT   1 /* Scalar quantization, implicit. */
+#define        JPC_QCX_SEQNT   2 /* Scalar quantization, explicit. */
+
+/*
+ * Stepsize manipulation macros.
+ */
+
+#define        JPC_QCX_GETEXPN(x)      ((x) >> 11)
+#define        JPC_QCX_GETMANT(x)      ((x) & 0x07ff)
+#define        JPC_QCX_EXPN(x)         (assert(!((x) & (~0x1f))), (((x) & 0x1f) << 11))
+#define        JPC_QCX_MANT(x)         (assert(!((x) & (~0x7ff))), ((x) & 0x7ff))
+
+/* Per component information. */
+
+typedef struct {
+
+       /* The quantization style. */
+       uint_fast8_t qntsty;
+
+       /* The number of step sizes. */
+       int numstepsizes;
+
+       /* The step sizes. */
+       uint_fast16_t *stepsizes;
+
+       /* The number of guard bits. */
+       uint_fast8_t numguard;
+
+} jpc_qcxcp_t;
+
+/* QCC marker segment parameters. */
+
+typedef struct {
+
+       /* The component associated with this marker segment. */
+       uint_fast16_t compno;
+
+       /* The parameters. */
+       jpc_qcxcp_t compparms;
+
+} jpc_qcc_t;
+
+/* QCD marker segment parameters. */
+
+typedef struct {
+
+       /* The parameters. */
+       jpc_qcxcp_t compparms;
+
+} jpc_qcd_t;
+
+/**************************************\
+* POD marker segment parameters.
+\**************************************/
+
+typedef struct {
+
+       /* The progression order. */
+       uint_fast8_t prgord;
+
+       /* The lower bound (inclusive) on the resolution level for the
+         progression order volume. */
+       uint_fast8_t rlvlnostart;
+
+       /* The upper bound (exclusive) on the resolution level for the
+         progression order volume. */
+       uint_fast8_t rlvlnoend;
+
+       /* The lower bound (inclusive) on the component for the progression
+         order volume. */
+       uint_fast16_t compnostart;
+
+       /* The upper bound (exclusive) on the component for the progression
+         order volume. */
+       uint_fast16_t compnoend;
+
+       /* The upper bound (exclusive) on the layer for the progression
+         order volume. */
+       uint_fast16_t lyrnoend;
+
+} jpc_pocpchg_t;
+
+/* An alias for the above type. */
+typedef jpc_pocpchg_t jpc_pchg_t;
+
+/* POC marker segment parameters. */
+
+typedef struct {
+
+       /* The number of progression order changes. */
+       int numpchgs;
+
+       /* The per-progression-order-change information. */
+       jpc_pocpchg_t *pchgs;
+
+} jpc_poc_t;
+
+/**************************************\
+* PPM/PPT marker segment parameters.
+\**************************************/
+
+/* PPM marker segment parameters. */
+
+typedef struct {
+
+       /* The index. */
+       uint_fast8_t ind;
+
+       /* The length. */
+       uint_fast16_t len;
+
+       /* The data. */
+       uchar *data;
+
+} jpc_ppm_t;
+
+/* PPT marker segment parameters. */
+
+typedef struct {
+
+       /* The index. */
+       uint_fast8_t ind;
+
+       /* The length. */
+       uint_fast32_t len;
+
+       /* The data. */
+       unsigned char *data;
+
+} jpc_ppt_t;
+
+/**************************************\
+* COM marker segment parameters.
+\**************************************/
+
+/*
+ * Registration IDs.
+ */
+
+#define        JPC_COM_BIN             0x00
+#define        JPC_COM_LATIN   0x01
+
+typedef struct {
+
+       /* The registration ID. */
+       uint_fast16_t regid;
+
+       /* The length of the data in bytes. */
+       uint_fast16_t len;
+
+       /* The data. */
+       uchar *data;
+
+} jpc_com_t;
+
+/**************************************\
+* SOP marker segment parameters.
+\**************************************/
+
+typedef struct {
+
+       /* The sequence number. */
+       uint_fast16_t seqno;
+
+} jpc_sop_t;
+
+/**************************************\
+* CRG marker segment parameters.
+\**************************************/
+
+/* Per component information. */
+
+typedef struct {
+
+       /* The horizontal offset. */
+       uint_fast16_t hoff;
+
+       /* The vertical offset. */
+       uint_fast16_t voff;
+
+} jpc_crgcomp_t;
+
+typedef struct {
+
+       /* The number of components. */
+       int numcomps;
+
+       /* Per component information. */
+       jpc_crgcomp_t *comps;
+
+} jpc_crg_t;
+
+/**************************************\
+* Marker segment parameters for unknown marker type.
+\**************************************/
+
+typedef struct {
+
+       /* The data. */
+       uchar *data;
+
+       /* The length. */
+       uint_fast16_t len;
+
+} jpc_unk_t;
+
+/**************************************\
+* Generic marker segment parameters.
+\**************************************/
+
+typedef union {
+       int soc;        /* unused */
+       jpc_sot_t sot;
+       int sod;        /* unused */
+       int eoc;        /* unused */
+       jpc_siz_t siz;
+       jpc_cod_t cod;
+       jpc_coc_t coc;
+       jpc_rgn_t rgn;
+       jpc_qcd_t qcd;
+       jpc_qcc_t qcc;
+       jpc_poc_t poc;
+       /* jpc_plm_t plm; */
+       /* jpc_plt_t plt; */
+       jpc_ppm_t ppm;
+       jpc_ppt_t ppt;
+       jpc_sop_t sop;
+       int eph;        /* unused */
+       jpc_com_t com;
+       jpc_crg_t crg;
+       jpc_unk_t unk;
+} jpc_msparms_t;
+
+/**************************************\
+* Marker segment.
+\**************************************/
+
+/* Marker segment IDs. */
+
+/* The smallest valid marker value. */
+#define        JPC_MS_MIN      0xff00
+
+/* The largest valid marker value. */
+#define        JPC_MS_MAX      0xffff
+
+/* The minimum marker value that cannot occur within packet data. */
+#define        JPC_MS_INMIN    0xff80
+/* The maximum marker value that cannot occur within packet data. */
+#define        JPC_MS_INMAX    0xffff
+
+/* Delimiting marker segments. */
+#define        JPC_MS_SOC      0xff4f /* Start of code stream (SOC). */
+#define        JPC_MS_SOT      0xff90 /* Start of tile-part (SOT). */
+#define        JPC_MS_SOD      0xff93 /* Start of data (SOD). */
+#define        JPC_MS_EOC      0xffd9 /* End of code stream (EOC). */
+
+/* Fixed information marker segments. */
+#define        JPC_MS_SIZ      0xff51 /* Image and tile size (SIZ). */
+
+/* Functional marker segments. */
+#define        JPC_MS_COD      0xff52 /* Coding style default (COD). */
+#define JPC_MS_COC     0xff53 /* Coding style component (COC). */
+#define        JPC_MS_RGN      0xff5e /* Region of interest (RGN). */
+#define JPC_MS_QCD     0xff5c /* Quantization default (QCD). */
+#define JPC_MS_QCC     0xff5d /* Quantization component (QCC). */
+#define JPC_MS_POC     0xff5f /* Progression order default (POC). */
+
+/* Pointer marker segments. */
+#define        JPC_MS_TLM      0xff55 /* Tile-part lengths, main header (TLM). */
+#define        JPC_MS_PLM      0xff57 /* Packet length, main header (PLM). */
+#define        JPC_MS_PLT      0xff58 /* Packet length, tile-part header (PLT). */
+#define        JPC_MS_PPM      0xff60 /* Packed packet headers, main header (PPM). */
+#define        JPC_MS_PPT      0xff61 /* Packet packet headers, tile-part header (PPT). */
+
+/* In bit stream marker segments. */
+#define        JPC_MS_SOP      0xff91  /* Start of packet (SOP). */
+#define        JPC_MS_EPH      0xff92  /* End of packet header (EPH). */
+
+/* Informational marker segments. */
+#define        JPC_MS_CRG      0xff63 /* Component registration (CRG). */
+#define JPC_MS_COM     0xff64 /* Comment (COM). */
+
+/* Forward declaration. */
+struct jpc_msops_s;
+
+/* Generic marker segment class. */
+
+typedef struct {
+
+       /* The type of marker segment. */
+       uint_fast16_t id;
+
+       /* The length of the marker segment. */
+       uint_fast16_t len;
+
+       /* The starting offset within the stream. */
+       uint_fast32_t off;
+
+       /* The parameters of the marker segment. */
+       jpc_msparms_t parms;
+
+       /* The marker segment operations. */
+       struct jpc_msops_s *ops;
+
+} jpc_ms_t;
+
+/* Marker segment operations (which depend on the marker segment type). */
+
+typedef struct jpc_msops_s {
+
+       /* Destroy the marker segment parameters. */
+       void (*destroyparms)(jpc_ms_t *ms);
+
+       /* Get the marker segment parameters from a stream. */
+       int (*getparms)(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *in);
+
+       /* Put the marker segment parameters to a stream. */
+       int (*putparms)(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *out);
+
+       /* Dump the marker segment parameters (for debugging). */
+       int (*dumpparms)(jpc_ms_t *ms, FILE *out);
+
+} jpc_msops_t;
+
+/******************************************************************************\
+* Macros/Functions.
+\******************************************************************************/
+
+/* Create a code-stream state object. */
+jpc_cstate_t *jpc_cstate_create(void);
+
+/* Destroy a code-stream state object. */
+void jpc_cstate_destroy(jpc_cstate_t *cstate);
+
+/* Create a marker segment. */
+jpc_ms_t *jpc_ms_create(int type);
+
+/* Destroy a marker segment. */
+void jpc_ms_destroy(jpc_ms_t *ms);
+
+/* Does a marker segment have parameters? */
+#define        JPC_MS_HASPARMS(x) \
+       (!((x) == JPC_MS_SOC || (x) == JPC_MS_SOD || (x) == JPC_MS_EOC || \
+         (x) == JPC_MS_EPH || ((x) >= 0xff30 && (x) <= 0xff3f)))
+
+/* Get the marker segment type. */
+#define        jpc_ms_gettype(ms) \
+       ((ms)->id)
+
+/* Read a marker segment from a stream. */
+jpc_ms_t *jpc_getms(jas_stream_t *in, jpc_cstate_t *cstate);
+
+/* Write a marker segment to a stream. */
+int jpc_putms(jas_stream_t *out, jpc_cstate_t *cstate, jpc_ms_t *ms);
+
+/* Copy code stream data from one stream to another. */
+int jpc_getdata(jas_stream_t *in, jas_stream_t *out, long n);
+
+/* Copy code stream data from one stream to another. */
+int jpc_putdata(jas_stream_t *out, jas_stream_t *in, long n);
+
+/* Dump a marker segment (for debugging). */
+void jpc_ms_dump(jpc_ms_t *ms, FILE *out);
+
+/* Read a 8-bit unsigned integer from a stream. */
+int jpc_getuint8(jas_stream_t *in, uint_fast8_t *val);
+
+/* Read a 16-bit unsigned integer from a stream. */
+int jpc_getuint16(jas_stream_t *in, uint_fast16_t *val);
+
+/* Read a 32-bit unsigned integer from a stream. */
+int jpc_getuint32(jas_stream_t *in, uint_fast32_t *val);
+
+/* Write a 8-bit unsigned integer to a stream. */
+int jpc_putuint8(jas_stream_t *out, uint_fast8_t val);
+
+/* Write a 16-bit unsigned integer to a stream. */
+int jpc_putuint16(jas_stream_t *out, uint_fast16_t val);
+
+/* Write a 32-bit unsigned integer to a stream. */
+int jpc_putuint32(jas_stream_t *out, uint_fast32_t val);
+
+#endif
diff --git a/src/libjasper/jpc/jpc_dec.c b/src/libjasper/jpc/jpc_dec.c
new file mode 100644 (file)
index 0000000..fa72a0e
--- /dev/null
@@ -0,0 +1,2305 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * $Id$
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+
+#include "jasper/jas_types.h"
+#include "jasper/jas_math.h"
+#include "jasper/jas_tvp.h"
+#include "jasper/jas_malloc.h"
+#include "jasper/jas_debug.h"
+
+#include "jpc_fix.h"
+#include "jpc_dec.h"
+#include "jpc_cs.h"
+#include "jpc_mct.h"
+#include "jpc_t2dec.h"
+#include "jpc_t1dec.h"
+#include "jpc_math.h"
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+#define        JPC_MHSOC       0x0001
+  /* In the main header, expecting a SOC marker segment. */
+#define        JPC_MHSIZ       0x0002
+  /* In the main header, expecting a SIZ marker segment. */
+#define        JPC_MH          0x0004
+  /* In the main header, expecting "other" marker segments. */
+#define        JPC_TPHSOT      0x0008
+  /* In a tile-part header, expecting a SOT marker segment. */
+#define        JPC_TPH         0x0010
+  /* In a tile-part header, expecting "other" marker segments. */
+#define        JPC_MT          0x0020
+  /* In the main trailer. */
+
+typedef struct {
+
+       uint_fast16_t id;
+       /* The marker segment type. */
+
+       int validstates;
+       /* The states in which this type of marker segment can be
+         validly encountered. */
+
+       int (*action)(jpc_dec_t *dec, jpc_ms_t *ms);
+       /* The action to take upon encountering this type of marker segment. */
+
+} jpc_dec_mstabent_t;
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+/* COD/COC parameters have been specified. */
+#define        JPC_CSET        0x0001
+/* QCD/QCC parameters have been specified. */
+#define        JPC_QSET        0x0002
+/* COD/COC parameters set from a COC marker segment. */
+#define        JPC_COC 0x0004
+/* QCD/QCC parameters set from a QCC marker segment. */
+#define        JPC_QCC 0x0008
+
+/******************************************************************************\
+* Local function prototypes.
+\******************************************************************************/
+
+static int jpc_dec_dump(jpc_dec_t *dec, FILE *out);
+
+jpc_ppxstab_t *jpc_ppxstab_create(void);
+void jpc_ppxstab_destroy(jpc_ppxstab_t *tab);
+int jpc_ppxstab_grow(jpc_ppxstab_t *tab, int maxents);
+int jpc_ppxstab_insert(jpc_ppxstab_t *tab, jpc_ppxstabent_t *ent);
+jpc_streamlist_t *jpc_ppmstabtostreams(jpc_ppxstab_t *tab);
+int jpc_pptstabwrite(jas_stream_t *out, jpc_ppxstab_t *tab);
+jpc_ppxstabent_t *jpc_ppxstabent_create(void);
+void jpc_ppxstabent_destroy(jpc_ppxstabent_t *ent);
+
+int jpc_streamlist_numstreams(jpc_streamlist_t *streamlist);
+jpc_streamlist_t *jpc_streamlist_create(void);
+int jpc_streamlist_insert(jpc_streamlist_t *streamlist, int streamno,
+  jas_stream_t *stream);
+jas_stream_t *jpc_streamlist_remove(jpc_streamlist_t *streamlist, int streamno);
+void jpc_streamlist_destroy(jpc_streamlist_t *streamlist);
+jas_stream_t *jpc_streamlist_get(jpc_streamlist_t *streamlist, int streamno);
+
+static void jpc_dec_cp_resetflags(jpc_dec_cp_t *cp);
+static jpc_dec_cp_t *jpc_dec_cp_create(uint_fast16_t numcomps);
+static int jpc_dec_cp_isvalid(jpc_dec_cp_t *cp);
+static jpc_dec_cp_t *jpc_dec_cp_copy(jpc_dec_cp_t *cp);
+static int jpc_dec_cp_setfromcod(jpc_dec_cp_t *cp, jpc_cod_t *cod);
+static int jpc_dec_cp_setfromcoc(jpc_dec_cp_t *cp, jpc_coc_t *coc);
+static int jpc_dec_cp_setfromcox(jpc_dec_cp_t *cp, jpc_dec_ccp_t *ccp,
+  jpc_coxcp_t *compparms, int flags);
+static int jpc_dec_cp_setfromqcd(jpc_dec_cp_t *cp, jpc_qcd_t *qcd);
+static int jpc_dec_cp_setfromqcc(jpc_dec_cp_t *cp, jpc_qcc_t *qcc);
+static int jpc_dec_cp_setfromqcx(jpc_dec_cp_t *cp, jpc_dec_ccp_t *ccp,
+  jpc_qcxcp_t *compparms, int flags);
+static int jpc_dec_cp_setfromrgn(jpc_dec_cp_t *cp, jpc_rgn_t *rgn);
+static int jpc_dec_cp_prepare(jpc_dec_cp_t *cp);
+static void jpc_dec_cp_destroy(jpc_dec_cp_t *cp);
+static int jpc_dec_cp_setfrompoc(jpc_dec_cp_t *cp, jpc_poc_t *poc, int reset);
+static int jpc_pi_addpchgfrompoc(jpc_pi_t *pi, jpc_poc_t *poc);
+
+static int jpc_dec_decode(jpc_dec_t *dec);
+static jpc_dec_t *jpc_dec_create(jpc_dec_importopts_t *impopts, jas_stream_t *in);
+static void jpc_dec_destroy(jpc_dec_t *dec);
+static void jpc_dequantize(jas_matrix_t *x, jpc_fix_t absstepsize);
+static void jpc_undo_roi(jas_matrix_t *x, int roishift, int bgshift, int numbps);
+static jpc_fix_t jpc_calcabsstepsize(int stepsize, int numbits);
+static int jpc_dec_tiledecode(jpc_dec_t *dec, jpc_dec_tile_t *tile);
+static int jpc_dec_tileinit(jpc_dec_t *dec, jpc_dec_tile_t *tile);
+static int jpc_dec_tilefini(jpc_dec_t *dec, jpc_dec_tile_t *tile);
+static int jpc_dec_process_soc(jpc_dec_t *dec, jpc_ms_t *ms);
+static int jpc_dec_process_sot(jpc_dec_t *dec, jpc_ms_t *ms);
+static int jpc_dec_process_sod(jpc_dec_t *dec, jpc_ms_t *ms);
+static int jpc_dec_process_eoc(jpc_dec_t *dec, jpc_ms_t *ms);
+static int jpc_dec_process_siz(jpc_dec_t *dec, jpc_ms_t *ms);
+static int jpc_dec_process_cod(jpc_dec_t *dec, jpc_ms_t *ms);
+static int jpc_dec_process_coc(jpc_dec_t *dec, jpc_ms_t *ms);
+static int jpc_dec_process_rgn(jpc_dec_t *dec, jpc_ms_t *ms);
+static int jpc_dec_process_qcd(jpc_dec_t *dec, jpc_ms_t *ms);
+static int jpc_dec_process_qcc(jpc_dec_t *dec, jpc_ms_t *ms);
+static int jpc_dec_process_poc(jpc_dec_t *dec, jpc_ms_t *ms);
+static int jpc_dec_process_ppm(jpc_dec_t *dec, jpc_ms_t *ms);
+static int jpc_dec_process_ppt(jpc_dec_t *dec, jpc_ms_t *ms);
+static int jpc_dec_process_com(jpc_dec_t *dec, jpc_ms_t *ms);
+static int jpc_dec_process_unk(jpc_dec_t *dec, jpc_ms_t *ms);
+static int jpc_dec_process_crg(jpc_dec_t *dec, jpc_ms_t *ms);
+static int jpc_dec_parseopts(char *optstr, jpc_dec_importopts_t *opts);
+
+static jpc_dec_mstabent_t *jpc_dec_mstab_lookup(uint_fast16_t id);
+
+/******************************************************************************\
+* Global data.
+\******************************************************************************/
+
+jpc_dec_mstabent_t jpc_dec_mstab[] = {
+       {JPC_MS_SOC, JPC_MHSOC, jpc_dec_process_soc},
+       {JPC_MS_SOT, JPC_MH | JPC_TPHSOT, jpc_dec_process_sot},
+       {JPC_MS_SOD, JPC_TPH, jpc_dec_process_sod},
+       {JPC_MS_EOC, JPC_TPHSOT, jpc_dec_process_eoc},
+       {JPC_MS_SIZ, JPC_MHSIZ, jpc_dec_process_siz},
+       {JPC_MS_COD, JPC_MH | JPC_TPH, jpc_dec_process_cod},
+       {JPC_MS_COC, JPC_MH | JPC_TPH, jpc_dec_process_coc},
+       {JPC_MS_RGN, JPC_MH | JPC_TPH, jpc_dec_process_rgn},
+       {JPC_MS_QCD, JPC_MH | JPC_TPH, jpc_dec_process_qcd},
+       {JPC_MS_QCC, JPC_MH | JPC_TPH, jpc_dec_process_qcc},
+       {JPC_MS_POC, JPC_MH | JPC_TPH, jpc_dec_process_poc},
+       {JPC_MS_TLM, JPC_MH, 0},
+       {JPC_MS_PLM, JPC_MH, 0},
+       {JPC_MS_PLT, JPC_TPH, 0},
+       {JPC_MS_PPM, JPC_MH, jpc_dec_process_ppm},
+       {JPC_MS_PPT, JPC_TPH, jpc_dec_process_ppt},
+       {JPC_MS_SOP, 0, 0},
+       {JPC_MS_CRG, JPC_MH, jpc_dec_process_crg},
+       {JPC_MS_COM, JPC_MH | JPC_TPH, jpc_dec_process_com},
+       {0, JPC_MH | JPC_TPH, jpc_dec_process_unk}
+};
+
+/******************************************************************************\
+* The main entry point for the JPEG-2000 decoder.
+\******************************************************************************/
+
+jas_image_t *jpc_decode(jas_stream_t *in, char *optstr)
+{
+       jpc_dec_importopts_t opts;
+       jpc_dec_t *dec;
+       jas_image_t *image;
+
+       dec = 0;
+
+       if (jpc_dec_parseopts(optstr, &opts)) {
+               goto error;
+       }
+
+       jpc_initluts();
+
+       if (!(dec = jpc_dec_create(&opts, in))) {
+               goto error;
+       }
+
+       /* Do most of the work. */
+       if (jpc_dec_decode(dec)) {
+               goto error;
+       }
+
+       if (jas_image_numcmpts(dec->image) >= 3) {
+               jas_image_setclrspc(dec->image, JAS_CLRSPC_SRGB);
+               jas_image_setcmpttype(dec->image, 0,
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_R));
+               jas_image_setcmpttype(dec->image, 1,
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_G));
+               jas_image_setcmpttype(dec->image, 2,
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_B));
+       } else {
+               jas_image_setclrspc(dec->image, JAS_CLRSPC_SGRAY);
+               jas_image_setcmpttype(dec->image, 0,
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_GRAY_Y));
+       }
+
+       /* Save the return value. */
+       image = dec->image;
+
+       /* Stop the image from being discarded. */
+       dec->image = 0;
+
+       /* Destroy decoder. */
+       jpc_dec_destroy(dec);
+
+       return image;
+
+error:
+       if (dec) {
+               jpc_dec_destroy(dec);
+       }
+       return 0;
+}
+
+typedef enum {
+       OPT_MAXLYRS,
+       OPT_MAXPKTS,
+       OPT_DEBUG
+} optid_t;
+
+jas_taginfo_t decopts[] = {
+       {OPT_MAXLYRS, "maxlyrs"},
+       {OPT_MAXPKTS, "maxpkts"},
+       {OPT_DEBUG, "debug"},
+       {-1, 0}
+};
+
+static int jpc_dec_parseopts(char *optstr, jpc_dec_importopts_t *opts)
+{
+       jas_tvparser_t *tvp;
+
+       opts->debug = 0;
+       opts->maxlyrs = JPC_MAXLYRS;
+       opts->maxpkts = -1;
+
+       if (!(tvp = jas_tvparser_create(optstr ? optstr : ""))) {
+               return -1;
+       }
+
+       while (!jas_tvparser_next(tvp)) {
+               switch (jas_taginfo_nonull(jas_taginfos_lookup(decopts,
+                 jas_tvparser_gettag(tvp)))->id) {
+               case OPT_MAXLYRS:
+                       opts->maxlyrs = atoi(jas_tvparser_getval(tvp));
+                       break;
+               case OPT_DEBUG:
+                       opts->debug = atoi(jas_tvparser_getval(tvp));
+                       break;
+               case OPT_MAXPKTS:
+                       opts->maxpkts = atoi(jas_tvparser_getval(tvp));
+                       break;
+               default:
+                       jas_eprintf("warning: ignoring invalid option %s\n",
+                         jas_tvparser_gettag(tvp));
+                       break;
+               }
+       }
+
+       jas_tvparser_destroy(tvp);
+
+       return 0;
+}
+
+/******************************************************************************\
+* Code for table-driven code stream decoder.
+\******************************************************************************/
+
+static jpc_dec_mstabent_t *jpc_dec_mstab_lookup(uint_fast16_t id)
+{
+       jpc_dec_mstabent_t *mstabent;
+       for (mstabent = jpc_dec_mstab; mstabent->id != 0; ++mstabent) {
+               if (mstabent->id == id) {
+                       break;
+               }
+       }
+       return mstabent;
+}
+
+static int jpc_dec_decode(jpc_dec_t *dec)
+{
+       jpc_ms_t *ms;
+       jpc_dec_mstabent_t *mstabent;
+       int ret;
+       jpc_cstate_t *cstate;
+
+       if (!(cstate = jpc_cstate_create())) {
+               return -1;
+       }
+       dec->cstate = cstate;
+
+       /* Initially, we should expect to encounter a SOC marker segment. */
+       dec->state = JPC_MHSOC;
+
+       for (;;) {
+
+               /* Get the next marker segment in the code stream. */
+               if (!(ms = jpc_getms(dec->in, cstate))) {
+                       jas_eprintf("cannot get marker segment\n");
+                       return -1;
+               }
+
+               mstabent = jpc_dec_mstab_lookup(ms->id);
+               assert(mstabent);
+
+               /* Ensure that this type of marker segment is permitted
+                 at this point in the code stream. */
+               if (!(dec->state & mstabent->validstates)) {
+                       jas_eprintf("unexpected marker segment type\n");
+                       jpc_ms_destroy(ms);
+                       return -1;
+               }
+
+               /* Process the marker segment. */
+               if (mstabent->action) {
+                       ret = (*mstabent->action)(dec, ms);
+               } else {
+                       /* No explicit action is required. */
+                       ret = 0;
+               }
+
+               /* Destroy the marker segment. */
+               jpc_ms_destroy(ms);
+
+               if (ret < 0) {
+                       return -1;
+               } else if (ret > 0) {
+                       break;
+               }
+
+       }
+
+       return 0;
+}
+
+static int jpc_dec_process_crg(jpc_dec_t *dec, jpc_ms_t *ms)
+{
+       int cmptno;
+       jpc_dec_cmpt_t *cmpt;
+       jpc_crg_t *crg;
+
+       crg = &ms->parms.crg;
+       for (cmptno = 0, cmpt = dec->cmpts; cmptno < dec->numcomps; ++cmptno,
+         ++cmpt) {
+               /* Ignore the information in the CRG marker segment for now.
+                 This information serves no useful purpose for decoding anyhow.
+                 Some other parts of the code need to be changed if these lines
+                 are uncommented.
+               cmpt->hsubstep = crg->comps[cmptno].hoff;
+               cmpt->vsubstep = crg->comps[cmptno].voff;
+               */
+       }
+       return 0;
+}
+
+static int jpc_dec_process_soc(jpc_dec_t *dec, jpc_ms_t *ms)
+{
+       /* Eliminate warnings about unused variables. */
+       ms = 0;
+
+       /* We should expect to encounter a SIZ marker segment next. */
+       dec->state = JPC_MHSIZ;
+
+       return 0;
+}
+
+static int jpc_dec_process_sot(jpc_dec_t *dec, jpc_ms_t *ms)
+{
+       jpc_dec_tile_t *tile;
+       jpc_sot_t *sot = &ms->parms.sot;
+       jas_image_cmptparm_t *compinfos;
+       jas_image_cmptparm_t *compinfo;
+       jpc_dec_cmpt_t *cmpt;
+       int cmptno;
+
+       if (dec->state == JPC_MH) {
+
+               compinfos = jas_malloc(dec->numcomps * sizeof(jas_image_cmptparm_t));
+               assert(compinfos);
+               for (cmptno = 0, cmpt = dec->cmpts, compinfo = compinfos;
+                 cmptno < dec->numcomps; ++cmptno, ++cmpt, ++compinfo) {
+                       compinfo->tlx = 0;
+                       compinfo->tly = 0;
+                       compinfo->prec = cmpt->prec;
+                       compinfo->sgnd = cmpt->sgnd;
+                       compinfo->width = cmpt->width;
+                       compinfo->height = cmpt->height;
+                       compinfo->hstep = cmpt->hstep;
+                       compinfo->vstep = cmpt->vstep;
+               }
+
+               if (!(dec->image = jas_image_create(dec->numcomps, compinfos,
+                 JAS_CLRSPC_UNKNOWN))) {
+                       return -1;
+               }
+               jas_free(compinfos);
+
+               /* Is the packet header information stored in PPM marker segments in
+                 the main header? */
+               if (dec->ppmstab) {
+                       /* Convert the PPM marker segment data into a collection of streams
+                         (one stream per tile-part). */
+                       if (!(dec->pkthdrstreams = jpc_ppmstabtostreams(dec->ppmstab))) {
+                               abort();
+                       }
+                       jpc_ppxstab_destroy(dec->ppmstab);
+                       dec->ppmstab = 0;
+               }
+       }
+
+       if (sot->len > 0) {
+               dec->curtileendoff = jas_stream_getrwcount(dec->in) - ms->len -
+                 4 + sot->len;
+       } else {
+               dec->curtileendoff = 0;
+       }
+
+       if (JAS_CAST(int, sot->tileno) > dec->numtiles) {
+               jas_eprintf("invalid tile number in SOT marker segment\n");
+               return -1;
+       }
+       /* Set the current tile. */
+       dec->curtile = &dec->tiles[sot->tileno];
+       tile = dec->curtile;
+       /* Ensure that this is the expected part number. */
+       if (sot->partno != tile->partno) {
+               return -1;
+       }
+       if (tile->numparts > 0 && sot->partno >= tile->numparts) {
+               return -1;
+       }
+       if (!tile->numparts && sot->numparts > 0) {
+               tile->numparts = sot->numparts;
+       }
+
+       tile->pptstab = 0;
+
+       switch (tile->state) {
+       case JPC_TILE_INIT:
+               /* This is the first tile-part for this tile. */
+               tile->state = JPC_TILE_ACTIVE;
+               assert(!tile->cp);
+               if (!(tile->cp = jpc_dec_cp_copy(dec->cp))) {
+                       return -1;
+               }
+               jpc_dec_cp_resetflags(dec->cp);
+               break;
+       default:
+               if (sot->numparts == sot->partno - 1) {
+                       tile->state = JPC_TILE_ACTIVELAST;
+               }
+               break;
+       }
+
+       /* Note: We do not increment the expected tile-part number until
+         all processing for this tile-part is complete. */
+
+       /* We should expect to encounter other tile-part header marker
+         segments next. */
+       dec->state = JPC_TPH;
+
+       return 0;
+}
+
+static int jpc_dec_process_sod(jpc_dec_t *dec, jpc_ms_t *ms)
+{
+       jpc_dec_tile_t *tile;
+       int pos;
+
+       /* Eliminate compiler warnings about unused variables. */
+       ms = 0;
+
+       if (!(tile = dec->curtile)) {
+               return -1;
+       }
+
+       if (!tile->partno) {
+               if (!jpc_dec_cp_isvalid(tile->cp)) {
+                       return -1;
+               }
+               jpc_dec_cp_prepare(tile->cp);
+               if (jpc_dec_tileinit(dec, tile)) {
+                       return -1;
+               }
+       }
+
+       /* Are packet headers stored in the main header or tile-part header? */
+       if (dec->pkthdrstreams) {
+               /* Get the stream containing the packet header data for this
+                 tile-part. */
+               if (!(tile->pkthdrstream = jpc_streamlist_remove(dec->pkthdrstreams, 0))) {
+                       return -1;
+               }
+       }
+
+       if (tile->pptstab) {
+               if (!tile->pkthdrstream) {
+                       if (!(tile->pkthdrstream = jas_stream_memopen(0, 0))) {
+                               return -1;
+                       }
+               }
+               pos = jas_stream_tell(tile->pkthdrstream);
+               jas_stream_seek(tile->pkthdrstream, 0, SEEK_END);
+               if (jpc_pptstabwrite(tile->pkthdrstream, tile->pptstab)) {
+                       return -1;
+               }
+               jas_stream_seek(tile->pkthdrstream, pos, SEEK_SET);
+               jpc_ppxstab_destroy(tile->pptstab);
+               tile->pptstab = 0;
+       }
+
+       if (jas_getdbglevel() >= 10) {
+               jpc_dec_dump(dec, stderr);
+       }
+
+       if (jpc_dec_decodepkts(dec, (tile->pkthdrstream) ? tile->pkthdrstream :
+         dec->in, dec->in)) {
+               jas_eprintf("jpc_dec_decodepkts failed\n");
+               return -1;
+       }
+
+       /* Gobble any unconsumed tile data. */
+       if (dec->curtileendoff > 0) {
+               long curoff;
+               uint_fast32_t n;
+               curoff = jas_stream_getrwcount(dec->in);
+               if (curoff < dec->curtileendoff) {
+                       n = dec->curtileendoff - curoff;
+                       jas_eprintf("warning: ignoring trailing garbage (%lu bytes)\n",
+                         (unsigned long) n);
+
+                       while (n-- > 0) {
+                               if (jas_stream_getc(dec->in) == EOF) {
+                                       jas_eprintf("read error\n");
+                                       return -1;
+                               }
+                       }
+               } else if (curoff > dec->curtileendoff) {
+                       jas_eprintf("warning: not enough tile data (%lu bytes)\n",
+                         (unsigned long) curoff - dec->curtileendoff);
+               }
+
+       }
+
+       if (tile->numparts > 0 && tile->partno == tile->numparts - 1) {
+               if (jpc_dec_tiledecode(dec, tile)) {
+                       return -1;
+               }
+               jpc_dec_tilefini(dec, tile);
+       }
+
+       dec->curtile = 0;
+
+       /* Increment the expected tile-part number. */
+       ++tile->partno;
+
+       /* We should expect to encounter a SOT marker segment next. */
+       dec->state = JPC_TPHSOT;
+
+       return 0;
+}
+
+static int jpc_dec_tileinit(jpc_dec_t *dec, jpc_dec_tile_t *tile)
+{
+       jpc_dec_tcomp_t *tcomp;
+       int compno;
+       int rlvlno;
+       jpc_dec_rlvl_t *rlvl;
+       jpc_dec_band_t *band;
+       jpc_dec_prc_t *prc;
+       int bndno;
+       jpc_tsfb_band_t *bnd;
+       int bandno;
+       jpc_dec_ccp_t *ccp;
+       int prccnt;
+       jpc_dec_cblk_t *cblk;
+       int cblkcnt;
+       uint_fast32_t tlprcxstart;
+       uint_fast32_t tlprcystart;
+       uint_fast32_t brprcxend;
+       uint_fast32_t brprcyend;
+       uint_fast32_t tlcbgxstart;
+       uint_fast32_t tlcbgystart;
+       uint_fast32_t brcbgxend;
+       uint_fast32_t brcbgyend;
+       uint_fast32_t cbgxstart;
+       uint_fast32_t cbgystart;
+       uint_fast32_t cbgxend;
+       uint_fast32_t cbgyend;
+       uint_fast32_t tlcblkxstart;
+       uint_fast32_t tlcblkystart;
+       uint_fast32_t brcblkxend;
+       uint_fast32_t brcblkyend;
+       uint_fast32_t cblkxstart;
+       uint_fast32_t cblkystart;
+       uint_fast32_t cblkxend;
+       uint_fast32_t cblkyend;
+       uint_fast32_t tmpxstart;
+       uint_fast32_t tmpystart;
+       uint_fast32_t tmpxend;
+       uint_fast32_t tmpyend;
+       jpc_dec_cp_t *cp;
+       jpc_tsfb_band_t bnds[64];
+       jpc_pchg_t *pchg;
+       int pchgno;
+       jpc_dec_cmpt_t *cmpt;
+
+       cp = tile->cp;
+       tile->realmode = 0;
+       if (cp->mctid == JPC_MCT_ICT) {
+               tile->realmode = 1;
+       }
+
+       for (compno = 0, tcomp = tile->tcomps, cmpt = dec->cmpts; compno <
+         dec->numcomps; ++compno, ++tcomp, ++cmpt) {
+               ccp = &tile->cp->ccps[compno];
+               if (ccp->qmfbid == JPC_COX_INS) {
+                       tile->realmode = 1;
+               }
+               tcomp->numrlvls = ccp->numrlvls;
+               if (!(tcomp->rlvls = jas_malloc(tcomp->numrlvls *
+                 sizeof(jpc_dec_rlvl_t)))) {
+                       return -1;
+               }
+               if (!(tcomp->data = jas_seq2d_create(JPC_CEILDIV(tile->xstart,
+                 cmpt->hstep), JPC_CEILDIV(tile->ystart, cmpt->vstep),
+                 JPC_CEILDIV(tile->xend, cmpt->hstep), JPC_CEILDIV(tile->yend,
+                 cmpt->vstep)))) {
+                       return -1;
+               }
+               if (!(tcomp->tsfb = jpc_cod_gettsfb(ccp->qmfbid,
+                 tcomp->numrlvls - 1))) {
+                       return -1;
+               }
+{
+       jpc_tsfb_getbands(tcomp->tsfb, jas_seq2d_xstart(tcomp->data), jas_seq2d_ystart(tcomp->data), jas_seq2d_xend(tcomp->data), jas_seq2d_yend(tcomp->data), bnds);
+}
+               for (rlvlno = 0, rlvl = tcomp->rlvls; rlvlno < tcomp->numrlvls;
+                 ++rlvlno, ++rlvl) {
+rlvl->bands = 0;
+                       rlvl->xstart = JPC_CEILDIVPOW2(tcomp->xstart,
+                         tcomp->numrlvls - 1 - rlvlno);
+                       rlvl->ystart = JPC_CEILDIVPOW2(tcomp->ystart,
+                         tcomp->numrlvls - 1 - rlvlno);
+                       rlvl->xend = JPC_CEILDIVPOW2(tcomp->xend,
+                         tcomp->numrlvls - 1 - rlvlno);
+                       rlvl->yend = JPC_CEILDIVPOW2(tcomp->yend,
+                         tcomp->numrlvls - 1 - rlvlno);
+                       rlvl->prcwidthexpn = ccp->prcwidthexpns[rlvlno];
+                       rlvl->prcheightexpn = ccp->prcheightexpns[rlvlno];
+                       tlprcxstart = JPC_FLOORDIVPOW2(rlvl->xstart,
+                         rlvl->prcwidthexpn) << rlvl->prcwidthexpn;
+                       tlprcystart = JPC_FLOORDIVPOW2(rlvl->ystart,
+                         rlvl->prcheightexpn) << rlvl->prcheightexpn;
+                       brprcxend = JPC_CEILDIVPOW2(rlvl->xend,
+                         rlvl->prcwidthexpn) << rlvl->prcwidthexpn;
+                       brprcyend = JPC_CEILDIVPOW2(rlvl->yend,
+                         rlvl->prcheightexpn) << rlvl->prcheightexpn;
+                       rlvl->numhprcs = (brprcxend - tlprcxstart) >>
+                         rlvl->prcwidthexpn;
+                       rlvl->numvprcs = (brprcyend - tlprcystart) >>
+                         rlvl->prcheightexpn;
+                       rlvl->numprcs = rlvl->numhprcs * rlvl->numvprcs;
+
+                       if (rlvl->xstart >= rlvl->xend || rlvl->ystart >= rlvl->yend) {
+                               rlvl->bands = 0;
+                               rlvl->numprcs = 0;
+                               rlvl->numhprcs = 0;
+                               rlvl->numvprcs = 0;
+                               continue;
+                       }       
+                       if (!rlvlno) {
+                               tlcbgxstart = tlprcxstart;
+                               tlcbgystart = tlprcystart;
+                               brcbgxend = brprcxend;
+                               brcbgyend = brprcyend;
+                               rlvl->cbgwidthexpn = rlvl->prcwidthexpn;
+                               rlvl->cbgheightexpn = rlvl->prcheightexpn;
+                       } else {
+                               tlcbgxstart = JPC_CEILDIVPOW2(tlprcxstart, 1);
+                               tlcbgystart = JPC_CEILDIVPOW2(tlprcystart, 1);
+                               brcbgxend = JPC_CEILDIVPOW2(brprcxend, 1);
+                               brcbgyend = JPC_CEILDIVPOW2(brprcyend, 1);
+                               rlvl->cbgwidthexpn = rlvl->prcwidthexpn - 1;
+                               rlvl->cbgheightexpn = rlvl->prcheightexpn - 1;
+                       }
+                       rlvl->cblkwidthexpn = JAS_MIN(ccp->cblkwidthexpn,
+                         rlvl->cbgwidthexpn);
+                       rlvl->cblkheightexpn = JAS_MIN(ccp->cblkheightexpn,
+                         rlvl->cbgheightexpn);
+
+                       rlvl->numbands = (!rlvlno) ? 1 : 3;
+                       if (!(rlvl->bands = jas_malloc(rlvl->numbands *
+                         sizeof(jpc_dec_band_t)))) {
+                               return -1;
+                       }
+                       for (bandno = 0, band = rlvl->bands;
+                         bandno < rlvl->numbands; ++bandno, ++band) {
+                               bndno = (!rlvlno) ? 0 : (3 * (rlvlno - 1) +
+                                 bandno + 1);
+                               bnd = &bnds[bndno];
+
+                               band->orient = bnd->orient;
+                               band->stepsize = ccp->stepsizes[bndno];
+                               band->analgain = JPC_NOMINALGAIN(ccp->qmfbid,
+                                 tcomp->numrlvls - 1, rlvlno, band->orient);
+                               band->absstepsize = jpc_calcabsstepsize(band->stepsize,
+                                 cmpt->prec + band->analgain);
+                               band->numbps = ccp->numguardbits +
+                                 JPC_QCX_GETEXPN(band->stepsize) - 1;
+                               band->roishift = (ccp->roishift + band->numbps >= JPC_PREC) ?
+                                 (JPC_PREC - 1 - band->numbps) : ccp->roishift;
+                               band->data = 0;
+                               band->prcs = 0;
+                               if (bnd->xstart == bnd->xend || bnd->ystart == bnd->yend) {
+                                       continue;
+                               }
+                               if (!(band->data = jas_seq2d_create(0, 0, 0, 0))) {
+                                       return -1;
+                               }
+                               jas_seq2d_bindsub(band->data, tcomp->data, bnd->locxstart, bnd->locystart, bnd->locxend, bnd->locyend);
+                               jas_seq2d_setshift(band->data, bnd->xstart, bnd->ystart);
+
+                               assert(rlvl->numprcs);
+
+                               if (!(band->prcs = jas_malloc(rlvl->numprcs * sizeof(jpc_dec_prc_t)))) {
+                                       return -1;
+                               }
+
+/************************************************/
+       cbgxstart = tlcbgxstart;
+       cbgystart = tlcbgystart;
+       for (prccnt = rlvl->numprcs, prc = band->prcs;
+         prccnt > 0; --prccnt, ++prc) {
+               cbgxend = cbgxstart + (1 << rlvl->cbgwidthexpn);
+               cbgyend = cbgystart + (1 << rlvl->cbgheightexpn);
+               prc->xstart = JAS_MAX(cbgxstart, JAS_CAST(uint_fast32_t, jas_seq2d_xstart(band->data)));
+               prc->ystart = JAS_MAX(cbgystart, JAS_CAST(uint_fast32_t, jas_seq2d_ystart(band->data)));
+               prc->xend = JAS_MIN(cbgxend, JAS_CAST(uint_fast32_t, jas_seq2d_xend(band->data)));
+               prc->yend = JAS_MIN(cbgyend, JAS_CAST(uint_fast32_t, jas_seq2d_yend(band->data)));
+               if (prc->xend > prc->xstart && prc->yend > prc->ystart) {
+                       tlcblkxstart = JPC_FLOORDIVPOW2(prc->xstart,
+                         rlvl->cblkwidthexpn) << rlvl->cblkwidthexpn;
+                       tlcblkystart = JPC_FLOORDIVPOW2(prc->ystart,
+                         rlvl->cblkheightexpn) << rlvl->cblkheightexpn;
+                       brcblkxend = JPC_CEILDIVPOW2(prc->xend,
+                         rlvl->cblkwidthexpn) << rlvl->cblkwidthexpn;
+                       brcblkyend = JPC_CEILDIVPOW2(prc->yend,
+                         rlvl->cblkheightexpn) << rlvl->cblkheightexpn;
+                       prc->numhcblks = (brcblkxend - tlcblkxstart) >>
+                         rlvl->cblkwidthexpn;
+                       prc->numvcblks = (brcblkyend - tlcblkystart) >>
+                         rlvl->cblkheightexpn;
+                       prc->numcblks = prc->numhcblks * prc->numvcblks;
+                       assert(prc->numcblks > 0);
+
+                       if (!(prc->incltagtree = jpc_tagtree_create(prc->numhcblks, prc->numvcblks))) {
+                               return -1;
+                       }
+                       if (!(prc->numimsbstagtree = jpc_tagtree_create(prc->numhcblks, prc->numvcblks))) {
+                               return -1;
+                       }
+                       if (!(prc->cblks = jas_malloc(prc->numcblks * sizeof(jpc_dec_cblk_t)))) {
+                               return -1;
+                       }
+
+                       cblkxstart = cbgxstart;
+                       cblkystart = cbgystart;
+                       for (cblkcnt = prc->numcblks, cblk = prc->cblks; cblkcnt > 0;) {
+                               cblkxend = cblkxstart + (1 << rlvl->cblkwidthexpn);
+                               cblkyend = cblkystart + (1 << rlvl->cblkheightexpn);
+                               tmpxstart = JAS_MAX(cblkxstart, prc->xstart);
+                               tmpystart = JAS_MAX(cblkystart, prc->ystart);
+                               tmpxend = JAS_MIN(cblkxend, prc->xend);
+                               tmpyend = JAS_MIN(cblkyend, prc->yend);
+                               if (tmpxend > tmpxstart && tmpyend > tmpystart) {
+                                       cblk->firstpassno = -1;
+                                       cblk->mqdec = 0;
+                                       cblk->nulldec = 0;
+                                       cblk->flags = 0;
+                                       cblk->numpasses = 0;
+                                       cblk->segs.head = 0;
+                                       cblk->segs.tail = 0;
+                                       cblk->curseg = 0;
+                                       cblk->numimsbs = 0;
+                                       cblk->numlenbits = 3;
+                                       cblk->flags = 0;
+                                       if (!(cblk->data = jas_seq2d_create(0, 0, 0, 0))) {
+                                               return -1;
+                                       }
+                                       jas_seq2d_bindsub(cblk->data, band->data, tmpxstart, tmpystart, tmpxend, tmpyend);
+                                       ++cblk;
+                                       --cblkcnt;
+                               }
+                               cblkxstart += 1 << rlvl->cblkwidthexpn;
+                               if (cblkxstart >= cbgxend) {
+                                       cblkxstart = cbgxstart;
+                                       cblkystart += 1 << rlvl->cblkheightexpn;
+                               }
+                       }
+
+               } else {
+                       prc->cblks = 0;
+                       prc->incltagtree = 0;
+                       prc->numimsbstagtree = 0;
+               }
+               cbgxstart += 1 << rlvl->cbgwidthexpn;
+               if (cbgxstart >= brcbgxend) {
+                       cbgxstart = tlcbgxstart;
+                       cbgystart += 1 << rlvl->cbgheightexpn;
+               }
+
+       }
+/********************************************/
+                       }
+               }
+       }
+
+if (!(tile->pi = jpc_dec_pi_create(dec, tile)))
+{
+       return -1;
+}
+
+       for (pchgno = 0; pchgno < jpc_pchglist_numpchgs(tile->cp->pchglist);
+         ++pchgno) {
+               pchg = jpc_pchg_copy(jpc_pchglist_get(tile->cp->pchglist, pchgno));
+               assert(pchg);
+               jpc_pi_addpchg(tile->pi, pchg);
+       }
+       jpc_pi_init(tile->pi);
+
+       return 0;
+}
+
+static int jpc_dec_tilefini(jpc_dec_t *dec, jpc_dec_tile_t *tile)
+{
+       jpc_dec_tcomp_t *tcomp;
+       int compno;
+       int bandno;
+       int rlvlno;
+       jpc_dec_band_t *band;
+       jpc_dec_rlvl_t *rlvl;
+       int prcno;
+       jpc_dec_prc_t *prc;
+       jpc_dec_seg_t *seg;
+       jpc_dec_cblk_t *cblk;
+       int cblkno;
+
+if (tile->tcomps) {
+
+       for (compno = 0, tcomp = tile->tcomps; compno < dec->numcomps;
+         ++compno, ++tcomp) {
+               for (rlvlno = 0, rlvl = tcomp->rlvls; rlvlno < tcomp->numrlvls;
+                 ++rlvlno, ++rlvl) {
+if (!rlvl->bands) {
+       continue;
+}
+                       for (bandno = 0, band = rlvl->bands; bandno < rlvl->numbands; ++bandno, ++band) {
+if (band->prcs) {
+                               for (prcno = 0, prc = band->prcs; prcno <
+                                 rlvl->numprcs; ++prcno, ++prc) {
+if (!prc->cblks) {
+       continue;
+}
+                                       for (cblkno = 0, cblk = prc->cblks; cblkno < prc->numcblks; ++cblkno, ++cblk) {
+
+       while (cblk->segs.head) {
+               seg = cblk->segs.head;
+               jpc_seglist_remove(&cblk->segs, seg);
+               jpc_seg_destroy(seg);
+       }
+       jas_matrix_destroy(cblk->data);
+       if (cblk->mqdec) {
+               jpc_mqdec_destroy(cblk->mqdec);
+       }
+       if (cblk->nulldec) {
+               jpc_bitstream_close(cblk->nulldec);
+       }
+       if (cblk->flags) {
+               jas_matrix_destroy(cblk->flags);
+       }
+                                       }
+                                       if (prc->incltagtree) {
+                                               jpc_tagtree_destroy(prc->incltagtree);
+                                       }
+                                       if (prc->numimsbstagtree) {
+                                               jpc_tagtree_destroy(prc->numimsbstagtree);
+                                       }
+                                       if (prc->cblks) {
+                                               jas_free(prc->cblks);
+                                       }
+                               }
+}
+                               if (band->data) {
+                                       jas_matrix_destroy(band->data);
+                               }
+                               if (band->prcs) {
+                                       jas_free(band->prcs);
+                               }
+                       }
+                       if (rlvl->bands) {
+                               jas_free(rlvl->bands);
+                       }
+               }
+               if (tcomp->rlvls) {
+                       jas_free(tcomp->rlvls);
+               }
+               if (tcomp->data) {
+                       jas_matrix_destroy(tcomp->data);
+               }
+               if (tcomp->tsfb) {
+                       jpc_tsfb_destroy(tcomp->tsfb);
+               }
+       }
+}
+       if (tile->cp) {
+               jpc_dec_cp_destroy(tile->cp);
+               tile->cp = 0;
+       }
+       if (tile->tcomps) {
+               jas_free(tile->tcomps);
+               tile->tcomps = 0;
+       }
+       if (tile->pi) {
+               jpc_pi_destroy(tile->pi);
+               tile->pi = 0;
+       }
+       if (tile->pkthdrstream) {
+               jas_stream_close(tile->pkthdrstream);
+               tile->pkthdrstream = 0;
+       }
+       if (tile->pptstab) {
+               jpc_ppxstab_destroy(tile->pptstab);
+               tile->pptstab = 0;
+       }
+
+       tile->state = JPC_TILE_DONE;
+
+       return 0;
+}
+
+static int jpc_dec_tiledecode(jpc_dec_t *dec, jpc_dec_tile_t *tile)
+{
+       int i;
+       int j;
+       jpc_dec_tcomp_t *tcomp;
+       jpc_dec_rlvl_t *rlvl;
+       jpc_dec_band_t *band;
+       int compno;
+       int rlvlno;
+       int bandno;
+       int adjust;
+       int v;
+       jpc_dec_ccp_t *ccp;
+       jpc_dec_cmpt_t *cmpt;
+
+       if (jpc_dec_decodecblks(dec, tile)) {
+               jas_eprintf("jpc_dec_decodecblks failed\n");
+               return -1;
+       }
+
+       /* Perform dequantization. */
+       for (compno = 0, tcomp = tile->tcomps; compno < dec->numcomps;
+         ++compno, ++tcomp) {
+               ccp = &tile->cp->ccps[compno];
+               for (rlvlno = 0, rlvl = tcomp->rlvls; rlvlno < tcomp->numrlvls;
+                 ++rlvlno, ++rlvl) {
+                       if (!rlvl->bands) {
+                               continue;
+                       }
+                       for (bandno = 0, band = rlvl->bands;
+                         bandno < rlvl->numbands; ++bandno, ++band) {
+                               if (!band->data) {
+                                       continue;
+                               }
+                               jpc_undo_roi(band->data, band->roishift, ccp->roishift -
+                                 band->roishift, band->numbps);
+                               if (tile->realmode) {
+                                       jas_matrix_asl(band->data, JPC_FIX_FRACBITS);
+                                       jpc_dequantize(band->data, band->absstepsize);
+                               }
+
+                       }
+               }
+       }
+
+       /* Apply an inverse wavelet transform if necessary. */
+       for (compno = 0, tcomp = tile->tcomps; compno < dec->numcomps;
+         ++compno, ++tcomp) {
+               ccp = &tile->cp->ccps[compno];
+               jpc_tsfb_synthesize(tcomp->tsfb, tcomp->data);
+       }
+
+
+       /* Apply an inverse intercomponent transform if necessary. */
+       switch (tile->cp->mctid) {
+       case JPC_MCT_RCT:
+               assert(dec->numcomps == 3);
+               jpc_irct(tile->tcomps[0].data, tile->tcomps[1].data,
+                 tile->tcomps[2].data);
+               break;
+       case JPC_MCT_ICT:
+               assert(dec->numcomps == 3);
+               jpc_iict(tile->tcomps[0].data, tile->tcomps[1].data,
+                 tile->tcomps[2].data);
+               break;
+       }
+
+       /* Perform rounding and convert to integer values. */
+       if (tile->realmode) {
+               for (compno = 0, tcomp = tile->tcomps; compno < dec->numcomps;
+                 ++compno, ++tcomp) {
+                       for (i = 0; i < jas_matrix_numrows(tcomp->data); ++i) {
+                               for (j = 0; j < jas_matrix_numcols(tcomp->data); ++j) {
+                                       v = jas_matrix_get(tcomp->data, i, j);
+                                       v = jpc_fix_round(v);
+                                       jas_matrix_set(tcomp->data, i, j, jpc_fixtoint(v));
+                               }
+                       }
+               }
+       }
+
+       /* Perform level shift. */
+       for (compno = 0, tcomp = tile->tcomps, cmpt = dec->cmpts; compno <
+         dec->numcomps; ++compno, ++tcomp, ++cmpt) {
+               adjust = cmpt->sgnd ? 0 : (1 << (cmpt->prec - 1));
+               for (i = 0; i < jas_matrix_numrows(tcomp->data); ++i) {
+                       for (j = 0; j < jas_matrix_numcols(tcomp->data); ++j) {
+                               *jas_matrix_getref(tcomp->data, i, j) += adjust;
+                       }
+               }
+       }
+
+       /* Perform clipping. */
+       for (compno = 0, tcomp = tile->tcomps, cmpt = dec->cmpts; compno <
+         dec->numcomps; ++compno, ++tcomp, ++cmpt) {
+               jpc_fix_t mn;
+               jpc_fix_t mx;
+               mn = cmpt->sgnd ? (-(1 << (cmpt->prec - 1))) : (0);
+               mx = cmpt->sgnd ? ((1 << (cmpt->prec - 1)) - 1) : ((1 <<
+                 cmpt->prec) - 1);
+               jas_matrix_clip(tcomp->data, mn, mx);
+       }
+
+       /* XXX need to free tsfb struct */
+
+       /* Write the data for each component of the image. */
+       for (compno = 0, tcomp = tile->tcomps, cmpt = dec->cmpts; compno <
+         dec->numcomps; ++compno, ++tcomp, ++cmpt) {
+               if (jas_image_writecmpt(dec->image, compno, tcomp->xstart -
+                 JPC_CEILDIV(dec->xstart, cmpt->hstep), tcomp->ystart -
+                 JPC_CEILDIV(dec->ystart, cmpt->vstep), jas_matrix_numcols(
+                 tcomp->data), jas_matrix_numrows(tcomp->data), tcomp->data)) {
+                       jas_eprintf("write component failed\n");
+                       return -4;
+               }
+       }
+
+       return 0;
+}
+
+static int jpc_dec_process_eoc(jpc_dec_t *dec, jpc_ms_t *ms)
+{
+       int tileno;
+       jpc_dec_tile_t *tile;
+
+       /* Eliminate compiler warnings about unused variables. */
+       ms = 0;
+
+       for (tileno = 0, tile = dec->tiles; tileno < dec->numtiles; ++tileno,
+         ++tile) {
+               if (tile->state == JPC_TILE_ACTIVE) {
+                       if (jpc_dec_tiledecode(dec, tile)) {
+                               return -1;
+                       }
+               }
+               jpc_dec_tilefini(dec, tile);
+       }
+
+       /* We are done processing the code stream. */
+       dec->state = JPC_MT;
+
+       return 1;
+}
+
+static int jpc_dec_process_siz(jpc_dec_t *dec, jpc_ms_t *ms)
+{
+       jpc_siz_t *siz = &ms->parms.siz;
+       int compno;
+       int tileno;
+       jpc_dec_tile_t *tile;
+       jpc_dec_tcomp_t *tcomp;
+       int htileno;
+       int vtileno;
+       jpc_dec_cmpt_t *cmpt;
+
+       dec->xstart = siz->xoff;
+       dec->ystart = siz->yoff;
+       dec->xend = siz->width;
+       dec->yend = siz->height;
+       dec->tilewidth = siz->tilewidth;
+       dec->tileheight = siz->tileheight;
+       dec->tilexoff = siz->tilexoff;
+       dec->tileyoff = siz->tileyoff;
+       dec->numcomps = siz->numcomps;
+       if (!(dec->cp = jpc_dec_cp_create(dec->numcomps))) {
+               return -1;
+       }
+
+       if (!(dec->cmpts = jas_malloc(dec->numcomps * sizeof(jpc_dec_cmpt_t)))) {
+               return -1;
+       }
+
+       for (compno = 0, cmpt = dec->cmpts; compno < dec->numcomps; ++compno,
+         ++cmpt) {
+               cmpt->prec = siz->comps[compno].prec;
+               cmpt->sgnd = siz->comps[compno].sgnd;
+               cmpt->hstep = siz->comps[compno].hsamp;
+               cmpt->vstep = siz->comps[compno].vsamp;
+               cmpt->width = JPC_CEILDIV(dec->xend, cmpt->hstep) -
+                 JPC_CEILDIV(dec->xstart, cmpt->hstep);
+               cmpt->height = JPC_CEILDIV(dec->yend, cmpt->vstep) -
+                 JPC_CEILDIV(dec->ystart, cmpt->vstep);
+               cmpt->hsubstep = 0;
+               cmpt->vsubstep = 0;
+       }
+
+       dec->image = 0;
+
+       dec->numhtiles = JPC_CEILDIV(dec->xend - dec->tilexoff, dec->tilewidth);
+       dec->numvtiles = JPC_CEILDIV(dec->yend - dec->tileyoff, dec->tileheight);
+       dec->numtiles = dec->numhtiles * dec->numvtiles;
+       if (!(dec->tiles = jas_malloc(dec->numtiles * sizeof(jpc_dec_tile_t)))) {
+               return -1;
+       }
+
+       for (tileno = 0, tile = dec->tiles; tileno < dec->numtiles; ++tileno,
+         ++tile) {
+               htileno = tileno % dec->numhtiles;
+               vtileno = tileno / dec->numhtiles;
+               tile->realmode = 0;
+               tile->state = JPC_TILE_INIT;
+               tile->xstart = JAS_MAX(dec->tilexoff + htileno * dec->tilewidth,
+                 dec->xstart);
+               tile->ystart = JAS_MAX(dec->tileyoff + vtileno * dec->tileheight,
+                 dec->ystart);
+               tile->xend = JAS_MIN(dec->tilexoff + (htileno + 1) *
+                 dec->tilewidth, dec->xend);
+               tile->yend = JAS_MIN(dec->tileyoff + (vtileno + 1) *
+                 dec->tileheight, dec->yend);
+               tile->numparts = 0;
+               tile->partno = 0;
+               tile->pkthdrstream = 0;
+               tile->pkthdrstreampos = 0;
+               tile->pptstab = 0;
+               tile->cp = 0;
+               if (!(tile->tcomps = jas_malloc(dec->numcomps *
+                 sizeof(jpc_dec_tcomp_t)))) {
+                       return -1;
+               }
+               for (compno = 0, cmpt = dec->cmpts, tcomp = tile->tcomps;
+                 compno < dec->numcomps; ++compno, ++cmpt, ++tcomp) {
+                       tcomp->rlvls = 0;
+                       tcomp->data = 0;
+                       tcomp->xstart = JPC_CEILDIV(tile->xstart, cmpt->hstep);
+                       tcomp->ystart = JPC_CEILDIV(tile->ystart, cmpt->vstep);
+                       tcomp->xend = JPC_CEILDIV(tile->xend, cmpt->hstep);
+                       tcomp->yend = JPC_CEILDIV(tile->yend, cmpt->vstep);
+                       tcomp->tsfb = 0;
+               }
+       }
+
+       dec->pkthdrstreams = 0;
+
+       /* We should expect to encounter other main header marker segments
+         or an SOT marker segment next. */
+       dec->state = JPC_MH;
+
+       return 0;
+}
+
+static int jpc_dec_process_cod(jpc_dec_t *dec, jpc_ms_t *ms)
+{
+       jpc_cod_t *cod = &ms->parms.cod;
+       jpc_dec_tile_t *tile;
+
+       switch (dec->state) {
+       case JPC_MH:
+               jpc_dec_cp_setfromcod(dec->cp, cod);
+               break;
+       case JPC_TPH:
+               if (!(tile = dec->curtile)) {
+                       return -1;
+               }
+               if (tile->partno != 0) {
+                       return -1;
+               }
+               jpc_dec_cp_setfromcod(tile->cp, cod);
+               break;
+       }
+       return 0;
+}
+
+static int jpc_dec_process_coc(jpc_dec_t *dec, jpc_ms_t *ms)
+{
+       jpc_coc_t *coc = &ms->parms.coc;
+       jpc_dec_tile_t *tile;
+
+       if (JAS_CAST(int, coc->compno) > dec->numcomps) {
+               jas_eprintf("invalid component number in COC marker segment\n");
+               return -1;
+       }
+       switch (dec->state) {
+       case JPC_MH:
+               jpc_dec_cp_setfromcoc(dec->cp, coc);
+               break;
+       case JPC_TPH:
+               if (!(tile = dec->curtile)) {
+                       return -1;
+               }
+               if (tile->partno > 0) {
+                       return -1;
+               }
+               jpc_dec_cp_setfromcoc(tile->cp, coc);
+               break;
+       }
+       return 0;
+}
+
+static int jpc_dec_process_rgn(jpc_dec_t *dec, jpc_ms_t *ms)
+{
+       jpc_rgn_t *rgn = &ms->parms.rgn;
+       jpc_dec_tile_t *tile;
+
+       if (JAS_CAST(int, rgn->compno) > dec->numcomps) {
+               jas_eprintf("invalid component number in RGN marker segment\n");
+               return -1;
+       }
+       switch (dec->state) {
+       case JPC_MH:
+               jpc_dec_cp_setfromrgn(dec->cp, rgn);
+               break;
+       case JPC_TPH:
+               if (!(tile = dec->curtile)) {
+                       return -1;
+               }
+               if (tile->partno > 0) {
+                       return -1;
+               }
+               jpc_dec_cp_setfromrgn(tile->cp, rgn);
+               break;
+       }
+
+       return 0;
+}
+
+static int jpc_dec_process_qcd(jpc_dec_t *dec, jpc_ms_t *ms)
+{
+       jpc_qcd_t *qcd = &ms->parms.qcd;
+       jpc_dec_tile_t *tile;
+
+       switch (dec->state) {
+       case JPC_MH:
+               jpc_dec_cp_setfromqcd(dec->cp, qcd);
+               break;
+       case JPC_TPH:
+               if (!(tile = dec->curtile)) {
+                       return -1;
+               }
+               if (tile->partno > 0) {
+                       return -1;
+               }
+               jpc_dec_cp_setfromqcd(tile->cp, qcd);
+               break;
+       }
+       return 0;
+}
+
+static int jpc_dec_process_qcc(jpc_dec_t *dec, jpc_ms_t *ms)
+{
+       jpc_qcc_t *qcc = &ms->parms.qcc;
+       jpc_dec_tile_t *tile;
+
+       if (JAS_CAST(int, qcc->compno) > dec->numcomps) {
+               jas_eprintf("invalid component number in QCC marker segment\n");
+               return -1;
+       }
+       switch (dec->state) {
+       case JPC_MH:
+               jpc_dec_cp_setfromqcc(dec->cp, qcc);
+               break;
+       case JPC_TPH:
+               if (!(tile = dec->curtile)) {
+                       return -1;
+               }
+               if (tile->partno > 0) {
+                       return -1;
+               }
+               jpc_dec_cp_setfromqcc(tile->cp, qcc);
+               break;
+       }
+       return 0;
+}
+
+static int jpc_dec_process_poc(jpc_dec_t *dec, jpc_ms_t *ms)
+{
+       jpc_poc_t *poc = &ms->parms.poc;
+       jpc_dec_tile_t *tile;
+       switch (dec->state) {
+       case JPC_MH:
+               if (jpc_dec_cp_setfrompoc(dec->cp, poc, 1)) {
+                       return -1;
+               }
+               break;
+       case JPC_TPH:
+               if (!(tile = dec->curtile)) {
+                       return -1;
+               }
+               if (!tile->partno) {
+                       if (jpc_dec_cp_setfrompoc(tile->cp, poc, (!tile->partno))) {
+                               return -1;
+                       }
+               } else {
+                       jpc_pi_addpchgfrompoc(tile->pi, poc);
+               }
+               break;
+       }
+       return 0;
+}
+
+static int jpc_dec_process_ppm(jpc_dec_t *dec, jpc_ms_t *ms)
+{
+       jpc_ppm_t *ppm = &ms->parms.ppm;
+       jpc_ppxstabent_t *ppmstabent;
+
+       if (!dec->ppmstab) {
+               if (!(dec->ppmstab = jpc_ppxstab_create())) {
+                       return -1;
+               }
+       }
+
+       if (!(ppmstabent = jpc_ppxstabent_create())) {
+               return -1;
+       }
+       ppmstabent->ind = ppm->ind;
+       ppmstabent->data = ppm->data;
+       ppm->data = 0;
+       ppmstabent->len = ppm->len;
+       if (jpc_ppxstab_insert(dec->ppmstab, ppmstabent)) {
+               return -1;
+       }
+       return 0;
+}
+
+static int jpc_dec_process_ppt(jpc_dec_t *dec, jpc_ms_t *ms)
+{
+       jpc_ppt_t *ppt = &ms->parms.ppt;
+       jpc_dec_tile_t *tile;
+       jpc_ppxstabent_t *pptstabent;
+
+       tile = dec->curtile;
+       if (!tile->pptstab) {
+               if (!(tile->pptstab = jpc_ppxstab_create())) {
+                       return -1;
+               }
+       }
+       if (!(pptstabent = jpc_ppxstabent_create())) {
+               return -1;
+       }
+       pptstabent->ind = ppt->ind;
+       pptstabent->data = ppt->data;
+       ppt->data = 0;
+       pptstabent->len = ppt->len;
+       if (jpc_ppxstab_insert(tile->pptstab, pptstabent)) {
+               return -1;
+       }
+       return 0;
+}
+
+static int jpc_dec_process_com(jpc_dec_t *dec, jpc_ms_t *ms)
+{
+       /* Eliminate compiler warnings about unused variables. */
+       dec = 0;
+       ms = 0;
+
+       return 0;
+}
+
+static int jpc_dec_process_unk(jpc_dec_t *dec, jpc_ms_t *ms)
+{
+       /* Eliminate compiler warnings about unused variables. */
+       dec = 0;
+
+       jas_eprintf("warning: ignoring unknown marker segment\n");
+       jpc_ms_dump(ms, stderr);
+       return 0;
+}
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+static jpc_dec_cp_t *jpc_dec_cp_create(uint_fast16_t numcomps)
+{
+       jpc_dec_cp_t *cp;
+       jpc_dec_ccp_t *ccp;
+       int compno;
+
+       if (!(cp = jas_malloc(sizeof(jpc_dec_cp_t)))) {
+               return 0;
+       }
+       cp->flags = 0;
+       cp->numcomps = numcomps;
+       cp->prgord = 0;
+       cp->numlyrs = 0;
+       cp->mctid = 0;
+       cp->csty = 0;
+       if (!(cp->ccps = jas_malloc(cp->numcomps * sizeof(jpc_dec_ccp_t)))) {
+               return 0;
+       }
+       if (!(cp->pchglist = jpc_pchglist_create())) {
+               jas_free(cp->ccps);
+               return 0;
+       }
+       for (compno = 0, ccp = cp->ccps; compno < cp->numcomps;
+         ++compno, ++ccp) {
+               ccp->flags = 0;
+               ccp->numrlvls = 0;
+               ccp->cblkwidthexpn = 0;
+               ccp->cblkheightexpn = 0;
+               ccp->qmfbid = 0;
+               ccp->numstepsizes = 0;
+               ccp->numguardbits = 0;
+               ccp->roishift = 0;
+               ccp->cblkctx = 0;
+       }
+       return cp;
+}
+
+static jpc_dec_cp_t *jpc_dec_cp_copy(jpc_dec_cp_t *cp)
+{
+       jpc_dec_cp_t *newcp;
+       jpc_dec_ccp_t *newccp;
+       jpc_dec_ccp_t *ccp;
+       int compno;
+
+       if (!(newcp = jpc_dec_cp_create(cp->numcomps))) {
+               return 0;
+       }
+       newcp->flags = cp->flags;
+       newcp->prgord = cp->prgord;
+       newcp->numlyrs = cp->numlyrs;
+       newcp->mctid = cp->mctid;
+       newcp->csty = cp->csty;
+       jpc_pchglist_destroy(newcp->pchglist);
+       newcp->pchglist = 0;
+       if (!(newcp->pchglist = jpc_pchglist_copy(cp->pchglist))) {
+               jas_free(newcp);
+               return 0;
+       }
+       for (compno = 0, newccp = newcp->ccps, ccp = cp->ccps;
+         compno < cp->numcomps;
+         ++compno, ++newccp, ++ccp) {
+               *newccp = *ccp;
+       }
+       return newcp;
+}
+
+static void jpc_dec_cp_resetflags(jpc_dec_cp_t *cp)
+{
+       int compno;
+       jpc_dec_ccp_t *ccp;
+       cp->flags &= (JPC_CSET | JPC_QSET);
+       for (compno = 0, ccp = cp->ccps; compno < cp->numcomps;
+         ++compno, ++ccp) {
+               ccp->flags = 0;
+       }
+}
+
+static void jpc_dec_cp_destroy(jpc_dec_cp_t *cp)
+{
+       if (cp->ccps) {
+               jas_free(cp->ccps);
+       }
+       if (cp->pchglist) {
+               jpc_pchglist_destroy(cp->pchglist);
+       }
+       jas_free(cp);
+}
+
+static int jpc_dec_cp_isvalid(jpc_dec_cp_t *cp)
+{
+       uint_fast16_t compcnt;
+       jpc_dec_ccp_t *ccp;
+
+       if (!(cp->flags & JPC_CSET) || !(cp->flags & JPC_QSET)) {
+               return 0;
+       }
+       for (compcnt = cp->numcomps, ccp = cp->ccps; compcnt > 0; --compcnt,
+         ++ccp) {
+               /* Is there enough step sizes for the number of bands? */
+               if ((ccp->qsty != JPC_QCX_SIQNT && JAS_CAST(int, ccp->numstepsizes) < 3 *
+                 ccp->numrlvls - 2) || (ccp->qsty == JPC_QCX_SIQNT &&
+                 ccp->numstepsizes != 1)) {
+                       return 0;
+               }
+       }
+       return 1;
+}
+
+static void calcstepsizes(uint_fast16_t refstepsize, int numrlvls,
+  uint_fast16_t *stepsizes)
+{
+       int bandno;
+       int numbands;
+       uint_fast16_t expn;
+       uint_fast16_t mant;
+       expn = JPC_QCX_GETEXPN(refstepsize);
+       mant = JPC_QCX_GETMANT(refstepsize);
+       numbands = 3 * numrlvls - 2;
+       for (bandno = 0; bandno < numbands; ++bandno) {
+               stepsizes[bandno] = JPC_QCX_MANT(mant) | JPC_QCX_EXPN(expn +
+                 (numrlvls - 1) - (numrlvls - 1 - ((bandno > 0) ? ((bandno + 2) / 3) : (0))));
+       }
+}
+
+static int jpc_dec_cp_prepare(jpc_dec_cp_t *cp)
+{
+       jpc_dec_ccp_t *ccp;
+       int compno;
+       int i;
+       for (compno = 0, ccp = cp->ccps; compno < cp->numcomps;
+         ++compno, ++ccp) {
+               if (!(ccp->csty & JPC_COX_PRT)) {
+                       for (i = 0; i < JPC_MAXRLVLS; ++i) {
+                               ccp->prcwidthexpns[i] = 15;
+                               ccp->prcheightexpns[i] = 15;
+                       }
+               }
+               if (ccp->qsty == JPC_QCX_SIQNT) {
+                       calcstepsizes(ccp->stepsizes[0], ccp->numrlvls, ccp->stepsizes);
+               }
+       }
+       return 0;
+}
+
+static int jpc_dec_cp_setfromcod(jpc_dec_cp_t *cp, jpc_cod_t *cod)
+{
+       jpc_dec_ccp_t *ccp;
+       int compno;
+       cp->flags |= JPC_CSET;
+       cp->prgord = cod->prg;
+       if (cod->mctrans) {
+               cp->mctid = (cod->compparms.qmfbid == JPC_COX_INS) ? (JPC_MCT_ICT) : (JPC_MCT_RCT);
+       } else {
+               cp->mctid = JPC_MCT_NONE;
+       }
+       cp->numlyrs = cod->numlyrs;
+       cp->csty = cod->csty & (JPC_COD_SOP | JPC_COD_EPH);
+       for (compno = 0, ccp = cp->ccps; compno < cp->numcomps;
+         ++compno, ++ccp) {
+               jpc_dec_cp_setfromcox(cp, ccp, &cod->compparms, 0);
+       }
+       cp->flags |= JPC_CSET;
+       return 0;
+}
+
+static int jpc_dec_cp_setfromcoc(jpc_dec_cp_t *cp, jpc_coc_t *coc)
+{
+       jpc_dec_cp_setfromcox(cp, &cp->ccps[coc->compno], &coc->compparms, JPC_COC);
+       return 0;
+}
+
+static int jpc_dec_cp_setfromcox(jpc_dec_cp_t *cp, jpc_dec_ccp_t *ccp,
+  jpc_coxcp_t *compparms, int flags)
+{
+       int rlvlno;
+
+       /* Eliminate compiler warnings about unused variables. */
+       cp = 0;
+
+       if ((flags & JPC_COC) || !(ccp->flags & JPC_COC)) {
+               ccp->numrlvls = compparms->numdlvls + 1;
+               ccp->cblkwidthexpn = JPC_COX_GETCBLKSIZEEXPN(
+                 compparms->cblkwidthval);
+               ccp->cblkheightexpn = JPC_COX_GETCBLKSIZEEXPN(
+                 compparms->cblkheightval);
+               ccp->qmfbid = compparms->qmfbid;
+               ccp->cblkctx = compparms->cblksty;
+               ccp->csty = compparms->csty & JPC_COX_PRT;
+               for (rlvlno = 0; rlvlno < compparms->numrlvls; ++rlvlno) {
+                       ccp->prcwidthexpns[rlvlno] =
+                         compparms->rlvls[rlvlno].parwidthval;
+                       ccp->prcheightexpns[rlvlno] =
+                         compparms->rlvls[rlvlno].parheightval;
+               }
+               ccp->flags |= flags | JPC_CSET;
+       }
+       return 0;
+}
+
+static int jpc_dec_cp_setfromqcd(jpc_dec_cp_t *cp, jpc_qcd_t *qcd)
+{
+       int compno;
+       jpc_dec_ccp_t *ccp;
+       for (compno = 0, ccp = cp->ccps; compno < cp->numcomps;
+         ++compno, ++ccp) {
+               jpc_dec_cp_setfromqcx(cp, ccp, &qcd->compparms, 0);
+       }
+       cp->flags |= JPC_QSET;
+       return 0;
+}
+
+static int jpc_dec_cp_setfromqcc(jpc_dec_cp_t *cp, jpc_qcc_t *qcc)
+{
+       return jpc_dec_cp_setfromqcx(cp, &cp->ccps[qcc->compno], &qcc->compparms, JPC_QCC);
+}
+
+static int jpc_dec_cp_setfromqcx(jpc_dec_cp_t *cp, jpc_dec_ccp_t *ccp,
+  jpc_qcxcp_t *compparms, int flags)
+{
+       int bandno;
+
+       /* Eliminate compiler warnings about unused variables. */
+       cp = 0;
+
+       if ((flags & JPC_QCC) || !(ccp->flags & JPC_QCC)) {
+               ccp->flags |= flags | JPC_QSET;
+               for (bandno = 0; bandno < compparms->numstepsizes; ++bandno) {
+                       ccp->stepsizes[bandno] = compparms->stepsizes[bandno];
+               }
+               ccp->numstepsizes = compparms->numstepsizes;
+               ccp->numguardbits = compparms->numguard;
+               ccp->qsty = compparms->qntsty;
+       }
+       return 0;
+}
+
+static int jpc_dec_cp_setfromrgn(jpc_dec_cp_t *cp, jpc_rgn_t *rgn)
+{
+       jpc_dec_ccp_t *ccp;
+       ccp = &cp->ccps[rgn->compno];
+       ccp->roishift = rgn->roishift;
+       return 0;
+}
+
+static int jpc_pi_addpchgfrompoc(jpc_pi_t *pi, jpc_poc_t *poc)
+{
+       int pchgno;
+       jpc_pchg_t *pchg;
+       for (pchgno = 0; pchgno < poc->numpchgs; ++pchgno) {
+               if (!(pchg = jpc_pchg_copy(&poc->pchgs[pchgno]))) {
+                       return -1;
+               }
+               if (jpc_pchglist_insert(pi->pchglist, -1, pchg)) {
+                       return -1;
+               }
+       }
+       return 0;
+}
+
+static int jpc_dec_cp_setfrompoc(jpc_dec_cp_t *cp, jpc_poc_t *poc, int reset)
+{
+       int pchgno;
+       jpc_pchg_t *pchg;
+       if (reset) {
+               while (jpc_pchglist_numpchgs(cp->pchglist) > 0) {
+                       pchg = jpc_pchglist_remove(cp->pchglist, 0);
+                       jpc_pchg_destroy(pchg);
+               }
+       }
+       for (pchgno = 0; pchgno < poc->numpchgs; ++pchgno) {
+               if (!(pchg = jpc_pchg_copy(&poc->pchgs[pchgno]))) {
+                       return -1;
+               }
+               if (jpc_pchglist_insert(cp->pchglist, -1, pchg)) {
+                       return -1;
+               }
+       }
+       return 0;
+}
+
+static jpc_fix_t jpc_calcabsstepsize(int stepsize, int numbits)
+{
+       jpc_fix_t absstepsize;
+       int n;
+
+       absstepsize = jpc_inttofix(1);
+       n = JPC_FIX_FRACBITS - 11;
+       absstepsize |= (n >= 0) ? (JPC_QCX_GETMANT(stepsize) << n) :
+         (JPC_QCX_GETMANT(stepsize) >> (-n));
+       n = numbits - JPC_QCX_GETEXPN(stepsize);
+       absstepsize = (n >= 0) ? (absstepsize << n) : (absstepsize >> (-n));
+       return absstepsize;
+}
+
+static void jpc_dequantize(jas_matrix_t *x, jpc_fix_t absstepsize)
+{
+       int i;
+       int j;
+       int t;
+
+       assert(absstepsize >= 0);
+       if (absstepsize == jpc_inttofix(1)) {
+               return;
+       }
+
+       for (i = 0; i < jas_matrix_numrows(x); ++i) {
+               for (j = 0; j < jas_matrix_numcols(x); ++j) {
+                       t = jas_matrix_get(x, i, j);
+                       if (t) {
+                               t = jpc_fix_mul(t, absstepsize);
+                       } else {
+                               t = 0;
+                       }
+                       jas_matrix_set(x, i, j, t);
+               }
+       }
+
+}
+
+static void jpc_undo_roi(jas_matrix_t *x, int roishift, int bgshift, int numbps)
+{
+       int i;
+       int j;
+       int thresh;
+       jpc_fix_t val;
+       jpc_fix_t mag;
+       bool warn;
+       uint_fast32_t mask;
+
+       if (roishift == 0 && bgshift == 0) {
+               return;
+       }
+       thresh = 1 << roishift;
+
+       warn = false;
+       for (i = 0; i < jas_matrix_numrows(x); ++i) {
+               for (j = 0; j < jas_matrix_numcols(x); ++j) {
+                       val = jas_matrix_get(x, i, j);
+                       mag = JAS_ABS(val);
+                       if (mag >= thresh) {
+                               /* We are dealing with ROI data. */
+                               mag >>= roishift;
+                               val = (val < 0) ? (-mag) : mag;
+                               jas_matrix_set(x, i, j, val);
+                       } else {
+                               /* We are dealing with non-ROI (i.e., background) data. */
+                               mag <<= bgshift;
+                               mask = (1 << numbps) - 1;
+                               /* Perform a basic sanity check on the sample value. */
+                               /* Some implementations write garbage in the unused
+                                 most-significant bit planes introduced by ROI shifting.
+                                 Here we ensure that any such bits are masked off. */
+                               if (mag & (~mask)) {
+                                       if (!warn) {
+                                               jas_eprintf("warning: possibly corrupt code stream\n");
+                                               warn = true;
+                                       }
+                                       mag &= mask;
+                               }
+                               val = (val < 0) ? (-mag) : mag;
+                               jas_matrix_set(x, i, j, val);
+                       }
+               }
+       }
+}
+
+static jpc_dec_t *jpc_dec_create(jpc_dec_importopts_t *impopts, jas_stream_t *in)
+{
+       jpc_dec_t *dec;
+
+       if (!(dec = jas_malloc(sizeof(jpc_dec_t)))) {
+               return 0;
+       }
+
+       dec->image = 0;
+       dec->xstart = 0;
+       dec->ystart = 0;
+       dec->xend = 0;
+       dec->yend = 0;
+       dec->tilewidth = 0;
+       dec->tileheight = 0;
+       dec->tilexoff = 0;
+       dec->tileyoff = 0;
+       dec->numhtiles = 0;
+       dec->numvtiles = 0;
+       dec->numtiles = 0;
+       dec->tiles = 0;
+       dec->curtile = 0;
+       dec->numcomps = 0;
+       dec->in = in;
+       dec->cp = 0;
+       dec->maxlyrs = impopts->maxlyrs;
+       dec->maxpkts = impopts->maxpkts;
+dec->numpkts = 0;
+       dec->ppmseqno = 0;
+       dec->state = 0;
+       dec->cmpts = 0;
+       dec->pkthdrstreams = 0;
+       dec->ppmstab = 0;
+       dec->curtileendoff = 0;
+
+       return dec;
+}
+
+static void jpc_dec_destroy(jpc_dec_t *dec)
+{
+       if (dec->cstate) {
+               jpc_cstate_destroy(dec->cstate);
+       }
+       if (dec->pkthdrstreams) {
+               jpc_streamlist_destroy(dec->pkthdrstreams);
+       }
+       if (dec->image) {
+               jas_image_destroy(dec->image);
+       }
+
+       if (dec->cp) {
+               jpc_dec_cp_destroy(dec->cp);
+       }
+
+       if (dec->cmpts) {
+               jas_free(dec->cmpts);
+       }
+
+       if (dec->tiles) {
+               jas_free(dec->tiles);
+       }
+
+       jas_free(dec);
+}
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+void jpc_seglist_insert(jpc_dec_seglist_t *list, jpc_dec_seg_t *ins, jpc_dec_seg_t *node)
+{
+       jpc_dec_seg_t *prev;
+       jpc_dec_seg_t *next;
+
+       prev = ins;
+       node->prev = prev;
+       next = prev ? (prev->next) : 0;
+       node->prev = prev;
+       node->next = next;
+       if (prev) {
+               prev->next = node;
+       } else {
+               list->head = node;
+       }
+       if (next) {
+               next->prev = node;
+       } else {
+               list->tail = node;
+       }
+}
+
+void jpc_seglist_remove(jpc_dec_seglist_t *list, jpc_dec_seg_t *seg)
+{
+       jpc_dec_seg_t *prev;
+       jpc_dec_seg_t *next;
+
+       prev = seg->prev;
+       next = seg->next;
+       if (prev) {
+               prev->next = next;
+       } else {
+               list->head = next;
+       }
+       if (next) {
+               next->prev = prev;
+       } else {
+               list->tail = prev;
+       }
+       seg->prev = 0;
+       seg->next = 0;
+}
+
+jpc_dec_seg_t *jpc_seg_alloc()
+{
+       jpc_dec_seg_t *seg;
+
+       if (!(seg = jas_malloc(sizeof(jpc_dec_seg_t)))) {
+               return 0;
+       }
+       seg->prev = 0;
+       seg->next = 0;
+       seg->passno = -1;
+       seg->numpasses = 0;
+       seg->maxpasses = 0;
+       seg->type = JPC_SEG_INVALID;
+       seg->stream = 0;
+       seg->cnt = 0;
+       seg->complete = 0;
+       seg->lyrno = -1;
+       return seg;
+}
+
+void jpc_seg_destroy(jpc_dec_seg_t *seg)
+{
+       if (seg->stream) {
+               jas_stream_close(seg->stream);
+       }
+       jas_free(seg);
+}
+
+static int jpc_dec_dump(jpc_dec_t *dec, FILE *out)
+{
+       jpc_dec_tile_t *tile;
+       int tileno;
+       jpc_dec_tcomp_t *tcomp;
+       int compno;
+       jpc_dec_rlvl_t *rlvl;
+       int rlvlno;
+       jpc_dec_band_t *band;
+       int bandno;
+       jpc_dec_prc_t *prc;
+       int prcno;
+       jpc_dec_cblk_t *cblk;
+       int cblkno;
+
+       for (tileno = 0, tile = dec->tiles; tileno < dec->numtiles;
+         ++tileno, ++tile) {
+               for (compno = 0, tcomp = tile->tcomps; compno < dec->numcomps;
+                 ++compno, ++tcomp) {
+                       for (rlvlno = 0, rlvl = tcomp->rlvls; rlvlno <
+                         tcomp->numrlvls; ++rlvlno, ++rlvl) {
+fprintf(out, "RESOLUTION LEVEL %d\n", rlvlno);
+fprintf(out, "xs =%d, ys = %d, xe = %d, ye = %d, w = %d, h = %d\n",
+  rlvl->xstart, rlvl->ystart, rlvl->xend, rlvl->yend, rlvl->xend -
+  rlvl->xstart, rlvl->yend - rlvl->ystart);
+                               for (bandno = 0, band = rlvl->bands;
+                                 bandno < rlvl->numbands; ++bandno, ++band) {
+fprintf(out, "BAND %d\n", bandno);
+fprintf(out, "xs =%d, ys = %d, xe = %d, ye = %d, w = %d, h = %d\n",
+  jas_seq2d_xstart(band->data), jas_seq2d_ystart(band->data), jas_seq2d_xend(band->data),
+  jas_seq2d_yend(band->data), jas_seq2d_xend(band->data) - jas_seq2d_xstart(band->data),
+  jas_seq2d_yend(band->data) - jas_seq2d_ystart(band->data));
+                                       for (prcno = 0, prc = band->prcs;
+                                         prcno < rlvl->numprcs; ++prcno,
+                                         ++prc) {
+fprintf(out, "CODE BLOCK GROUP %d\n", prcno);
+fprintf(out, "xs =%d, ys = %d, xe = %d, ye = %d, w = %d, h = %d\n",
+  prc->xstart, prc->ystart, prc->xend, prc->yend, prc->xend -
+  prc->xstart, prc->yend - prc->ystart);
+                                               for (cblkno = 0, cblk =
+                                                 prc->cblks; cblkno <
+                                                 prc->numcblks; ++cblkno,
+                                                 ++cblk) {
+fprintf(out, "CODE BLOCK %d\n", cblkno);
+fprintf(out, "xs =%d, ys = %d, xe = %d, ye = %d, w = %d, h = %d\n",
+  jas_seq2d_xstart(cblk->data), jas_seq2d_ystart(cblk->data), jas_seq2d_xend(cblk->data),
+  jas_seq2d_yend(cblk->data), jas_seq2d_xend(cblk->data) - jas_seq2d_xstart(cblk->data),
+  jas_seq2d_yend(cblk->data) - jas_seq2d_ystart(cblk->data));
+                                               }
+                                       }
+                               }
+                       }
+               }
+       }
+
+       return 0;
+}
+
+jpc_streamlist_t *jpc_streamlist_create()
+{
+       jpc_streamlist_t *streamlist;
+       int i;
+
+       if (!(streamlist = jas_malloc(sizeof(jpc_streamlist_t)))) {
+               return 0;
+       }
+       streamlist->numstreams = 0;
+       streamlist->maxstreams = 100;
+       if (!(streamlist->streams = jas_malloc(streamlist->maxstreams *
+         sizeof(jas_stream_t *)))) {
+               jas_free(streamlist);
+               return 0;
+       }
+       for (i = 0; i < streamlist->maxstreams; ++i) {
+               streamlist->streams[i] = 0;
+       }
+       return streamlist;
+}
+
+int jpc_streamlist_insert(jpc_streamlist_t *streamlist, int streamno,
+  jas_stream_t *stream)
+{
+       jas_stream_t **newstreams;
+       int newmaxstreams;
+       int i;
+       /* Grow the array of streams if necessary. */
+       if (streamlist->numstreams >= streamlist->maxstreams) {
+               newmaxstreams = streamlist->maxstreams + 1024;
+               if (!(newstreams = jas_realloc(streamlist->streams,
+                 (newmaxstreams + 1024) * sizeof(jas_stream_t *)))) {
+                       return -1;
+               }
+               for (i = streamlist->numstreams; i < streamlist->maxstreams; ++i) {
+                       streamlist->streams[i] = 0;
+               }
+               streamlist->maxstreams = newmaxstreams;
+               streamlist->streams = newstreams;
+       }
+       if (streamno != streamlist->numstreams) {
+               /* Can only handle insertion at start of list. */
+               return -1;
+       }
+       streamlist->streams[streamno] = stream;
+       ++streamlist->numstreams;
+       return 0;
+}
+
+jas_stream_t *jpc_streamlist_remove(jpc_streamlist_t *streamlist, int streamno)
+{
+       jas_stream_t *stream;
+       int i;
+       if (streamno >= streamlist->numstreams) {
+               abort();
+       }
+       stream = streamlist->streams[streamno];
+       for (i = streamno + 1; i < streamlist->numstreams; ++i) {
+               streamlist->streams[i - 1] = streamlist->streams[i];
+       }
+       --streamlist->numstreams;
+       return stream;
+}
+
+void jpc_streamlist_destroy(jpc_streamlist_t *streamlist)
+{
+       int streamno;
+       if (streamlist->streams) {
+               for (streamno = 0; streamno < streamlist->numstreams;
+                 ++streamno) {
+                       jas_stream_close(streamlist->streams[streamno]);
+               }
+               jas_free(streamlist->streams);
+       }
+       jas_free(streamlist);
+}
+
+jas_stream_t *jpc_streamlist_get(jpc_streamlist_t *streamlist, int streamno)
+{
+       assert(streamno < streamlist->numstreams);
+       return streamlist->streams[streamno];
+}
+
+int jpc_streamlist_numstreams(jpc_streamlist_t *streamlist)
+{
+       return streamlist->numstreams;
+}
+
+jpc_ppxstab_t *jpc_ppxstab_create()
+{
+       jpc_ppxstab_t *tab;
+
+       if (!(tab = jas_malloc(sizeof(jpc_ppxstab_t)))) {
+               return 0;
+       }
+       tab->numents = 0;
+       tab->maxents = 0;
+       tab->ents = 0;
+       return tab;
+}
+
+void jpc_ppxstab_destroy(jpc_ppxstab_t *tab)
+{
+       int i;
+       for (i = 0; i < tab->numents; ++i) {
+               jpc_ppxstabent_destroy(tab->ents[i]);
+       }
+       if (tab->ents) {
+               jas_free(tab->ents);
+       }
+       jas_free(tab);
+}
+
+int jpc_ppxstab_grow(jpc_ppxstab_t *tab, int maxents)
+{
+       jpc_ppxstabent_t **newents;
+       if (tab->maxents < maxents) {
+               newents = (tab->ents) ? jas_realloc(tab->ents, maxents *
+                 sizeof(jpc_ppxstabent_t *)) : jas_malloc(maxents * sizeof(jpc_ppxstabent_t *));
+               if (!newents) {
+                       return -1;
+               }
+               tab->ents = newents;
+               tab->maxents = maxents;
+       }
+       return 0;
+}
+
+int jpc_ppxstab_insert(jpc_ppxstab_t *tab, jpc_ppxstabent_t *ent)
+{
+       int inspt;
+       int i;
+
+       for (i = 0; i < tab->numents; ++i) {
+               if (tab->ents[i]->ind > ent->ind) {
+                       break;
+               }
+       }
+       inspt = i;
+
+       if (tab->numents >= tab->maxents) {
+               if (jpc_ppxstab_grow(tab, tab->maxents + 128)) {
+                       return -1;
+               }
+       }
+
+       for (i = tab->numents; i > inspt; --i) {
+               tab->ents[i] = tab->ents[i - 1];
+       }
+       tab->ents[i] = ent;
+       ++tab->numents;
+
+       return 0;
+}
+
+jpc_streamlist_t *jpc_ppmstabtostreams(jpc_ppxstab_t *tab)
+{
+       jpc_streamlist_t *streams;
+       uchar *dataptr;
+       uint_fast32_t datacnt;
+       uint_fast32_t tpcnt;
+       jpc_ppxstabent_t *ent;
+       int entno;
+       jas_stream_t *stream;
+       int n;
+
+       if (!(streams = jpc_streamlist_create())) {
+               goto error;
+       }
+
+       if (!tab->numents) {
+               return streams;
+       }
+
+       entno = 0;
+       ent = tab->ents[entno];
+       dataptr = ent->data;
+       datacnt = ent->len;
+       for (;;) {
+
+               /* Get the length of the packet header data for the current
+                 tile-part. */
+               if (datacnt < 4) {
+                       goto error;
+               }
+               if (!(stream = jas_stream_memopen(0, 0))) {
+                       goto error;
+               }
+               if (jpc_streamlist_insert(streams, jpc_streamlist_numstreams(streams),
+                 stream)) {
+                       goto error;
+               }
+               tpcnt = (dataptr[0] << 24) | (dataptr[1] << 16) | (dataptr[2] << 8)
+                 | dataptr[3];
+               datacnt -= 4;
+               dataptr += 4;
+
+               /* Get the packet header data for the current tile-part. */
+               while (tpcnt) {
+                       if (!datacnt) {
+                               if (++entno >= tab->numents) {
+                                       goto error;
+                               }
+                               ent = tab->ents[entno];
+                               dataptr = ent->data;
+                               datacnt = ent->len;
+                       }
+                       n = JAS_MIN(tpcnt, datacnt);
+                       if (jas_stream_write(stream, dataptr, n) != n) {
+                               goto error;
+                       }
+                       tpcnt -= n;
+                       dataptr += n;
+                       datacnt -= n;
+               }
+               jas_stream_rewind(stream);
+               if (!datacnt) {
+                       if (++entno >= tab->numents) {
+                               break;
+                       }
+                       ent = tab->ents[entno];
+                       dataptr = ent->data;
+                       datacnt = ent->len;
+               }
+       }
+
+       return streams;
+
+error:
+       jpc_streamlist_destroy(streams);
+       return 0;
+}
+
+int jpc_pptstabwrite(jas_stream_t *out, jpc_ppxstab_t *tab)
+{
+       int i;
+       jpc_ppxstabent_t *ent;
+       for (i = 0; i < tab->numents; ++i) {
+               ent = tab->ents[i];
+               if (jas_stream_write(out, ent->data, ent->len) != JAS_CAST(int, ent->len)) {
+                       return -1;
+               }
+       }
+       return 0;
+}
+
+jpc_ppxstabent_t *jpc_ppxstabent_create()
+{
+       jpc_ppxstabent_t *ent;
+       if (!(ent = jas_malloc(sizeof(jpc_ppxstabent_t)))) {
+               return 0;
+       }
+       ent->data = 0;
+       ent->len = 0;
+       ent->ind = 0;
+       return ent;
+}
+
+void jpc_ppxstabent_destroy(jpc_ppxstabent_t *ent)
+{
+       if (ent->data) {
+               jas_free(ent->data);
+       }
+       jas_free(ent);
+}
diff --git a/src/libjasper/jpc/jpc_dec.h b/src/libjasper/jpc/jpc_dec.h
new file mode 100644 (file)
index 0000000..2af98ca
--- /dev/null
@@ -0,0 +1,696 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * JPEG-2000 Decoder
+ *
+ * $Id$
+ */
+
+#ifndef JPC_DEC_H
+#define JPC_DEC_H
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include "jasper/jas_stream.h"
+
+#include "jpc_tsfb.h"
+#include "jpc_bs.h"
+#include "jpc_tagtree.h"
+#include "jpc_cs.h"
+#include "jpc_cod.h"
+#include "jpc_mqdec.h"
+#include "jpc_t2cod.h"
+
+/******************************************************************************\
+* Below are some ugly warts necessary to support packed packet headers.
+\******************************************************************************/
+
+/* PPM/PPT marker segment table entry. */
+
+typedef struct {
+
+       /* The index for this entry. */
+       uint_fast16_t ind;
+
+       /* The data length. */
+       uint_fast32_t len;
+
+       /* The data. */
+       uchar *data;
+
+} jpc_ppxstabent_t;
+
+/* PPM/PPT marker segment table. */
+
+typedef struct {
+
+       /* The number of entries. */
+       int numents;
+
+       /* The maximum number of entries (i.e., the allocated size of the array
+         below). */
+       int maxents;
+
+       /* The table entries. */
+       jpc_ppxstabent_t **ents;
+
+} jpc_ppxstab_t;
+
+/* Stream list class. */
+
+typedef struct {
+
+       /* The number of streams in this list. */
+       int numstreams;
+
+       /* The maximum number of streams that can be accomodated without
+         growing the streams array. */
+       int maxstreams;
+
+       /* The streams. */
+       jas_stream_t **streams;
+
+} jpc_streamlist_t;
+
+/******************************************************************************\
+* Coding parameters class.
+\******************************************************************************/
+
+/* Per-component coding parameters. */
+
+typedef struct {
+
+       /* How were various coding parameters set? */
+       int flags;
+
+       /* Per-component coding style parameters (e.g., explicit precinct sizes) */
+       uint_fast8_t csty;
+
+       /* The number of resolution levels. */
+       uint_fast8_t numrlvls;
+
+       /* The code block width exponent. */
+       uint_fast8_t cblkwidthexpn;
+
+       /* The code block height exponent. */
+       uint_fast8_t cblkheightexpn;
+
+       /* The QMFB ID. */
+       uint_fast8_t qmfbid;
+
+       /* The quantization style. */
+       uint_fast8_t qsty;
+
+       /* The number of quantizer step sizes. */
+       uint_fast16_t numstepsizes;
+
+       /* The step sizes. */
+       uint_fast16_t stepsizes[3 * JPC_MAXRLVLS + 1];
+
+       /* The number of guard bits. */
+       uint_fast8_t numguardbits;
+
+       /* The ROI shift value. */
+       uint_fast8_t roishift;
+
+       /* The code block parameters. */
+       uint_fast8_t cblkctx;
+
+       /* The precinct width exponents. */
+       uint_fast8_t prcwidthexpns[JPC_MAXRLVLS];
+
+       /* The precinct height exponents. */
+       uint_fast8_t prcheightexpns[JPC_MAXRLVLS];
+
+} jpc_dec_ccp_t;
+
+/* Coding paramters. */
+
+typedef struct {
+
+       /* How were these coding parameters set? */
+       int flags;
+
+       /* Progression change list. */
+       jpc_pchglist_t *pchglist;
+
+       /* Progression order. */
+       uint_fast8_t prgord;
+
+       /* The number of layers. */
+       uint_fast16_t numlyrs;
+
+       /* The MCT ID. */
+       uint_fast8_t mctid;
+
+       /* The coding style parameters (e.g., SOP, EPH). */
+       uint_fast8_t csty;
+
+       /* The number of components. */
+       int numcomps;
+
+       /* The per-component coding parameters. */
+       jpc_dec_ccp_t *ccps;
+
+} jpc_dec_cp_t;
+
+/******************************************************************************\
+* Decoder class.
+\******************************************************************************/
+
+/* Decoder per-segment state information. */
+
+typedef struct jpc_dec_seg_s {
+
+       /* The next segment in the list. */
+       struct jpc_dec_seg_s *next;
+
+       /* The previous segment in the list. */
+       struct jpc_dec_seg_s *prev;
+
+       /* The starting pass number for this segment. */
+       int passno;
+
+       /* The number of passes in this segment. */
+       int numpasses;
+
+       /* The maximum number of passes in this segment. */
+       int maxpasses;
+
+       /* The type of data in this segment (i.e., MQ or raw). */
+       int type;
+
+       /* A stream containing the data for this segment. */
+       jas_stream_t *stream;
+
+       /* The number of bytes destined for this segment from the packet
+         currently being decoded. */
+       int cnt;
+
+       /* A flag indicating if this segment has been terminated. */
+       int complete;
+
+       /* The layer number to which this segment belongs. */
+       /* If the segment spans multiple layers, then the largest layer number
+         spanned by the segment is used. */
+       int lyrno;
+
+} jpc_dec_seg_t;
+
+/* Decoder segment list. */
+
+typedef struct {
+
+       /* The first entry in the list. */
+       jpc_dec_seg_t *head;
+
+       /* The last entry in the list. */
+       jpc_dec_seg_t *tail;
+
+} jpc_dec_seglist_t;
+
+/* Decoder per-code-block state information. */
+
+typedef struct {
+
+       /* The number of passes. */
+       int numpasses;
+
+       /* A list of segments that still need to be decoded. */
+       jpc_dec_seglist_t segs;
+
+       /* The first incomplete/partial segment. */
+       jpc_dec_seg_t *curseg;
+
+       /* The number of leading insignificant bit planes for this code block. */
+       int numimsbs;
+
+       /* The number of bits used to encode pass data lengths. */
+       int numlenbits;
+
+       /* The first pass number containing data for this code block. */
+       int firstpassno;
+
+       /* The MQ decoder. */
+       jpc_mqdec_t *mqdec;
+
+       /* The raw bit stream decoder. */
+       jpc_bitstream_t *nulldec;
+
+       /* The per-sample state information for this code block. */
+       jas_matrix_t *flags;
+
+       /* The sample data associated with this code block. */
+       jas_matrix_t *data;
+
+} jpc_dec_cblk_t;
+
+/* Decoder per-code-block-group state information. */
+
+typedef struct {
+
+       /* The x-coordinate of the top-left corner of the precinct. */
+       uint_fast32_t xstart;
+
+       /* The y-coordinate of the top-left corner of the precinct. */
+       uint_fast32_t ystart;
+
+       /* The x-coordinate of the bottom-right corner of the precinct
+         (plus one). */
+       uint_fast32_t xend;
+
+       /* The y-coordinate of the bottom-right corner of the precinct
+         (plus one). */
+       uint_fast32_t yend;
+
+       /* The number of code blocks spanning this precinct in the horizontal
+         direction. */
+       int numhcblks;
+
+       /* The number of code blocks spanning this precinct in the vertical
+         direction. */
+       int numvcblks;
+
+       /* The total number of code blocks in this precinct. */
+       int numcblks;
+
+       /* The per code block information. */
+       jpc_dec_cblk_t *cblks;
+
+       /* The inclusion tag tree. */
+       jpc_tagtree_t *incltagtree;
+
+       /* The insignificant MSBs tag tree. */
+       jpc_tagtree_t *numimsbstagtree;
+
+} jpc_dec_prc_t;
+
+/* Decoder per-band state information. */
+
+typedef struct {
+
+       /* The per-code-block-group state information. */
+       jpc_dec_prc_t *prcs;
+
+       /* The sample data associated with this band. */
+       jas_matrix_t *data;
+
+       /* The orientation of this band (i.e., LL, LH, HL, or HH). */
+       int orient;
+
+       /* The encoded quantizer step size. */
+       int stepsize;
+
+       /* The absolute quantizer step size. */
+       jpc_fix_t absstepsize;
+
+       /* The number of bit planes for this band. */
+       int numbps;
+
+       /* The analysis gain associated with this band. */
+       int analgain;
+
+       /* The ROI shift value for this band. */
+       int roishift;
+
+} jpc_dec_band_t;
+
+/* Decoder per-resolution-level state information. */
+
+typedef struct {
+
+       /* The number of bands associated with this resolution level. */
+       int numbands;
+
+       /* The per-band information. */
+       jpc_dec_band_t *bands;
+
+       /* The x-coordinate of the top-left corner of the tile-component
+         at this resolution. */
+       uint_fast32_t xstart;
+
+       /* The y-coordinate of the top-left corner of the tile-component
+         at this resolution. */
+       uint_fast32_t ystart;
+
+       /* The x-coordinate of the bottom-right corner of the tile-component
+         at this resolution (plus one). */
+       uint_fast32_t xend;
+
+       /* The y-coordinate of the bottom-right corner of the tile-component
+         at this resolution (plus one). */
+       uint_fast32_t yend;
+
+       /* The exponent value for the nominal precinct width measured
+         relative to the associated LL band. */
+       int prcwidthexpn;
+
+       /* The exponent value for the nominal precinct height measured
+         relative to the associated LL band. */
+       int prcheightexpn;
+
+       /* The number of precincts in the horizontal direction. */
+       int numhprcs;
+
+       /* The number of precincts in the vertical direction. */
+       int numvprcs;
+
+       /* The total number of precincts. */
+       int numprcs;
+
+       /* The exponent value for the nominal code block group width.
+         This quantity is associated with the next lower resolution level
+         (assuming that there is one). */
+       int cbgwidthexpn;
+
+       /* The exponent value for the nominal code block group height
+         This quantity is associated with the next lower resolution level
+         (assuming that there is one). */
+       int cbgheightexpn;
+
+       /* The exponent value for the code block width. */
+       uint_fast16_t cblkwidthexpn;
+
+       /* The exponent value for the code block height. */
+       uint_fast16_t cblkheightexpn;
+
+} jpc_dec_rlvl_t;
+
+/* Decoder per-tile-component state information. */
+
+typedef struct {
+
+       /* The x-coordinate of the top-left corner of the tile-component
+         in the coordinate system of the tile-component. */
+       uint_fast32_t xstart;
+
+       /* The y-coordinate of the top-left corner of the tile-component
+         in the coordinate system of the tile-component. */
+       uint_fast32_t ystart;
+
+       /* The x-coordinate of the bottom-right corner of the tile-component
+         in the coordinate system of the tile-component (plus one). */
+       uint_fast32_t xend;
+
+       /* The y-coordinate of the bottom-right corner of the tile-component
+         in the coordinate system of the tile-component (plus one). */
+       uint_fast32_t yend;
+
+       /* The component data for the current tile. */
+       jas_matrix_t *data;
+
+       /* The number of resolution levels. */
+       int numrlvls;
+
+       /* The per resolution level information. */
+       jpc_dec_rlvl_t *rlvls;
+
+       /* The TSFB. */
+       jpc_tsfb_t *tsfb;
+
+} jpc_dec_tcomp_t;
+
+/*
+ * Tile states.
+ */
+
+#define        JPC_TILE_INIT   0
+#define        JPC_TILE_ACTIVE 1
+#define        JPC_TILE_ACTIVELAST     2
+#define        JPC_TILE_DONE   3
+
+/* Decoder per-tile state information. */
+
+typedef struct {
+
+       /* The processing state for this tile. */
+       int state;
+
+       /* The x-coordinate of the top-left corner of the tile on the reference
+         grid. */
+       uint_fast32_t xstart;
+
+       /* The y-coordinate of the top-left corner of the tile on the reference
+         grid. */
+       uint_fast32_t ystart;
+
+       /* The x-coordinate of the bottom-right corner of the tile on the
+         reference grid (plus one). */
+       uint_fast32_t xend;
+
+       /* The y-coordinate of the bottom-right corner of the tile on the
+         reference grid (plus one). */
+       uint_fast32_t yend;
+
+       /* The packed packet header data for this tile. */
+       jpc_ppxstab_t *pptstab;
+
+       /* A stream containing the packed packet header data for this tile. */
+       jas_stream_t *pkthdrstream;
+
+       /* The current position within the packed packet header stream. */
+       long pkthdrstreampos;
+
+       /* The coding parameters for this tile. */
+       jpc_dec_cp_t *cp;
+
+       /* The per tile-component information. */
+       jpc_dec_tcomp_t *tcomps;
+
+       /* The next expected tile-part number. */
+       int partno;
+
+       /* The number of tile-parts. */
+       int numparts;
+
+       /* The coding mode. */
+       int realmode;
+
+       /* The packet iterator for this tile. */
+       jpc_pi_t *pi;
+
+} jpc_dec_tile_t;
+
+/* Decoder per-component state information. */
+
+typedef struct {
+
+       /* The horizontal sampling period. */
+       uint_fast32_t hstep;
+
+       /* The vertical sampling period. */
+       uint_fast32_t vstep;
+
+       /* The number of samples in the horizontal direction. */
+       uint_fast32_t width;
+
+       /* The number of samples in the vertical direction. */
+       uint_fast32_t height;
+
+       /* The precision of the sample data. */
+       uint_fast16_t prec;
+
+       /* The signedness of the sample data. */
+       bool sgnd;
+
+       /* The sample alignment horizontal offset. */
+       uint_fast32_t hsubstep;
+       
+       /* The sample alignment vertical offset. */
+       uint_fast32_t vsubstep;
+
+} jpc_dec_cmpt_t;
+
+/* Decoder state information. */
+
+typedef struct {
+
+       /* The decoded image. */
+       jas_image_t *image;
+
+       /* The x-coordinate of the top-left corner of the image area on
+         the reference grid. */
+       uint_fast32_t xstart;
+
+       /* The y-coordinate of the top-left corner of the image area on
+         the reference grid. */
+       uint_fast32_t ystart;
+
+       /* The x-coordinate of the bottom-right corner of the image area on
+         the reference grid (plus one). */
+       uint_fast32_t xend;
+
+       /* The y-coordinate of the bottom-right corner of the image area on
+         the reference grid (plus one). */
+       uint_fast32_t yend;
+
+       /* The nominal tile width in units of the image reference grid. */
+       uint_fast32_t tilewidth;
+
+       /* The nominal tile height in units of the image reference grid. */
+       uint_fast32_t tileheight;
+
+       /* The horizontal offset from the origin of the reference grid to the
+         left side of the first tile. */
+       uint_fast32_t tilexoff;
+
+       /* The vertical offset from the origin of the reference grid to the
+         top side of the first tile. */
+       uint_fast32_t tileyoff;
+
+       /* The number of tiles spanning the image area in the vertical
+         direction. */
+       int numhtiles;
+
+       /* The number of tiles spanning the image area in the horizontal
+         direction. */
+       int numvtiles;
+
+       /* The total number of tiles. */
+       int numtiles;
+
+       /* The per-tile information. */
+       jpc_dec_tile_t *tiles;
+
+       /* The tile currently being processed. */
+       jpc_dec_tile_t *curtile;
+
+       /* The number of components. */
+       int numcomps;
+
+       /* The stream containing the input JPEG-2000 code stream data. */
+       jas_stream_t *in;
+
+       /* The default coding parameters for all tiles. */
+       jpc_dec_cp_t *cp;
+
+       /* The maximum number of layers that may be decoded. */
+       int maxlyrs;
+
+       /* The maximum number of packets that may be decoded. */
+       int maxpkts;
+
+       /* The number of packets decoded so far in the processing of the entire
+         code stream. */
+       int numpkts;
+
+       /* The next expected PPM marker segment sequence number. */
+       int ppmseqno;
+
+       /* The current state for code stream processing. */
+       int state;
+
+       /* The per-component information. */
+       jpc_dec_cmpt_t *cmpts;
+
+       /* The information from PPM marker segments. */
+       jpc_ppxstab_t *ppmstab;
+
+       /* A list of streams containing packet header data from PPM marker
+         segments. */
+       jpc_streamlist_t *pkthdrstreams;
+
+       /* The expected ending offset for a tile-part. */
+       long curtileendoff;
+
+       /* This is required by the tier-2 decoder. */
+       jpc_cstate_t *cstate;
+
+} jpc_dec_t;
+
+/* Decoder options. */
+
+typedef struct {
+
+       /* The debug level for the decoder. */
+       int debug;
+
+       /* The maximum number of layers to decode. */
+       int maxlyrs;
+
+       /* The maximum number of packets to decode. */
+       int maxpkts;
+
+} jpc_dec_importopts_t;
+
+/******************************************************************************\
+* Functions.
+\******************************************************************************/
+
+/* Create a decoder segment object. */
+jpc_dec_seg_t *jpc_seg_alloc(void);
+
+/* Destroy a decoder segment object. */
+void jpc_seg_destroy(jpc_dec_seg_t *seg);
+
+/* Remove a segment from a segment list. */
+void jpc_seglist_remove(jpc_dec_seglist_t *list, jpc_dec_seg_t *node);
+
+/* Insert a segment into a segment list. */
+void jpc_seglist_insert(jpc_dec_seglist_t *list, jpc_dec_seg_t *ins,
+  jpc_dec_seg_t *node);
+
+#endif
diff --git a/src/libjasper/jpc/jpc_enc.c b/src/libjasper/jpc/jpc_enc.c
new file mode 100644 (file)
index 0000000..bbe1ef2
--- /dev/null
@@ -0,0 +1,2620 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * $Id$
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <math.h>
+#include <float.h>
+
+#include "jasper/jas_types.h"
+#include "jasper/jas_string.h"
+#include "jasper/jas_malloc.h"
+#include "jasper/jas_image.h"
+#include "jasper/jas_fix.h"
+#include "jasper/jas_tvp.h"
+#include "jasper/jas_version.h"
+#include "jasper/jas_math.h"
+#include "jasper/jas_debug.h"
+
+#include "jpc_flt.h"
+#include "jpc_fix.h"
+#include "jpc_tagtree.h"
+#include "jpc_enc.h"
+#include "jpc_cs.h"
+#include "jpc_mct.h"
+#include "jpc_tsfb.h"
+#include "jpc_qmfb.h"
+#include "jpc_t1enc.h"
+#include "jpc_t2enc.h"
+#include "jpc_cod.h"
+#include "jpc_math.h"
+#include "jpc_util.h"
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+#define JPC_POW2(n) \
+       (1 << (n))
+
+#define JPC_FLOORTOMULTPOW2(x, n) \
+  (((n) > 0) ? ((x) & (~((1 << n) - 1))) : (x))
+/* Round to the nearest multiple of the specified power of two in the
+  direction of negative infinity. */
+
+#define        JPC_CEILTOMULTPOW2(x, n) \
+  (((n) > 0) ? JPC_FLOORTOMULTPOW2(((x) + (1 << (n)) - 1), n) : (x))
+/* Round to the nearest multiple of the specified power of two in the
+  direction of positive infinity. */
+
+#define        JPC_POW2(n)     \
+  (1 << (n))
+
+jpc_enc_tile_t *jpc_enc_tile_create(jpc_enc_cp_t *cp, jas_image_t *image, int tileno);
+void jpc_enc_tile_destroy(jpc_enc_tile_t *tile);
+
+static jpc_enc_tcmpt_t *tcmpt_create(jpc_enc_tcmpt_t *tcmpt, jpc_enc_cp_t *cp,
+  jas_image_t *image, jpc_enc_tile_t *tile);
+static void tcmpt_destroy(jpc_enc_tcmpt_t *tcmpt);
+static jpc_enc_rlvl_t *rlvl_create(jpc_enc_rlvl_t *rlvl, jpc_enc_cp_t *cp,
+  jpc_enc_tcmpt_t *tcmpt, jpc_tsfb_band_t *bandinfos);
+static void rlvl_destroy(jpc_enc_rlvl_t *rlvl);
+static jpc_enc_band_t *band_create(jpc_enc_band_t *band, jpc_enc_cp_t *cp,
+  jpc_enc_rlvl_t *rlvl, jpc_tsfb_band_t *bandinfos);
+static void band_destroy(jpc_enc_band_t *bands);
+static jpc_enc_prc_t *prc_create(jpc_enc_prc_t *prc, jpc_enc_cp_t *cp,
+  jpc_enc_band_t *band);
+static void prc_destroy(jpc_enc_prc_t *prcs);
+static jpc_enc_cblk_t *cblk_create(jpc_enc_cblk_t *cblk, jpc_enc_cp_t *cp,
+  jpc_enc_prc_t *prc);
+static void cblk_destroy(jpc_enc_cblk_t *cblks);
+int ratestrtosize(char *s, uint_fast32_t rawsize, uint_fast32_t *size);
+static void pass_destroy(jpc_enc_pass_t *pass);
+void jpc_enc_dump(jpc_enc_t *enc);
+
+/******************************************************************************\
+* Local prototypes.
+\******************************************************************************/
+
+int dump_passes(jpc_enc_pass_t *passes, int numpasses, jpc_enc_cblk_t *cblk);
+void calcrdslopes(jpc_enc_cblk_t *cblk);
+void dump_layeringinfo(jpc_enc_t *enc);
+static int jpc_calcssexp(jpc_fix_t stepsize);
+static int jpc_calcssmant(jpc_fix_t stepsize);
+void jpc_quantize(jas_matrix_t *data, jpc_fix_t stepsize);
+static int jpc_enc_encodemainhdr(jpc_enc_t *enc);
+static int jpc_enc_encodemainbody(jpc_enc_t *enc);
+int jpc_enc_encodetiledata(jpc_enc_t *enc);
+jpc_enc_t *jpc_enc_create(jpc_enc_cp_t *cp, jas_stream_t *out, jas_image_t *image);
+void jpc_enc_destroy(jpc_enc_t *enc);
+static int jpc_enc_encodemainhdr(jpc_enc_t *enc);
+static int jpc_enc_encodemainbody(jpc_enc_t *enc);
+int jpc_enc_encodetiledata(jpc_enc_t *enc);
+int rateallocate(jpc_enc_t *enc, int numlyrs, uint_fast32_t *cumlens);
+int setins(int numvalues, jpc_flt_t *values, jpc_flt_t value);
+static jpc_enc_cp_t *cp_create(char *optstr, jas_image_t *image);
+void jpc_enc_cp_destroy(jpc_enc_cp_t *cp);
+static uint_fast32_t jpc_abstorelstepsize(jpc_fix_t absdelta, int scaleexpn);
+
+static uint_fast32_t jpc_abstorelstepsize(jpc_fix_t absdelta, int scaleexpn)
+{
+       int p;
+       uint_fast32_t mant;
+       uint_fast32_t expn;
+       int n;
+
+       if (absdelta < 0) {
+               abort();
+       }
+
+       p = jpc_firstone(absdelta) - JPC_FIX_FRACBITS;
+       n = 11 - jpc_firstone(absdelta);
+       mant = ((n < 0) ? (absdelta >> (-n)) : (absdelta << n)) & 0x7ff;
+       expn = scaleexpn - p;
+       if (scaleexpn < p) {
+               abort();
+       }
+       return JPC_QCX_EXPN(expn) | JPC_QCX_MANT(mant);
+}
+
+typedef enum {
+       OPT_DEBUG,
+       OPT_IMGAREAOFFX,
+       OPT_IMGAREAOFFY,
+       OPT_TILEGRDOFFX,
+       OPT_TILEGRDOFFY,
+       OPT_TILEWIDTH,
+       OPT_TILEHEIGHT,
+       OPT_PRCWIDTH,
+       OPT_PRCHEIGHT,
+       OPT_CBLKWIDTH,
+       OPT_CBLKHEIGHT,
+       OPT_MODE,
+       OPT_PRG,
+       OPT_NOMCT,
+       OPT_MAXRLVLS,
+       OPT_SOP,
+       OPT_EPH,
+       OPT_LAZY,
+       OPT_TERMALL,
+       OPT_SEGSYM,
+       OPT_VCAUSAL,
+       OPT_RESET,
+       OPT_PTERM,
+       OPT_NUMGBITS,
+       OPT_RATE,
+       OPT_ILYRRATES,
+       OPT_JP2OVERHEAD
+} optid_t;
+
+jas_taginfo_t encopts[] = {
+       {OPT_DEBUG, "debug"},
+       {OPT_IMGAREAOFFX, "imgareatlx"},
+       {OPT_IMGAREAOFFY, "imgareatly"},
+       {OPT_TILEGRDOFFX, "tilegrdtlx"},
+       {OPT_TILEGRDOFFY, "tilegrdtly"},
+       {OPT_TILEWIDTH, "tilewidth"},
+       {OPT_TILEHEIGHT, "tileheight"},
+       {OPT_PRCWIDTH, "prcwidth"},
+       {OPT_PRCHEIGHT, "prcheight"},
+       {OPT_CBLKWIDTH, "cblkwidth"},
+       {OPT_CBLKHEIGHT, "cblkheight"},
+       {OPT_MODE, "mode"},
+       {OPT_PRG, "prg"},
+       {OPT_NOMCT, "nomct"},
+       {OPT_MAXRLVLS, "numrlvls"},
+       {OPT_SOP, "sop"},
+       {OPT_EPH, "eph"},
+       {OPT_LAZY, "lazy"},
+       {OPT_TERMALL, "termall"},
+       {OPT_SEGSYM, "segsym"},
+       {OPT_VCAUSAL, "vcausal"},
+       {OPT_PTERM, "pterm"},
+       {OPT_RESET, "resetprob"},
+       {OPT_NUMGBITS, "numgbits"},
+       {OPT_RATE, "rate"},
+       {OPT_ILYRRATES, "ilyrrates"},
+       {OPT_JP2OVERHEAD, "_jp2overhead"},
+       {-1, 0}
+};
+
+typedef enum {
+       PO_L = 0,
+       PO_R
+} poid_t;
+
+
+jas_taginfo_t prgordtab[] = {
+       {JPC_COD_LRCPPRG, "lrcp"},
+       {JPC_COD_RLCPPRG, "rlcp"},
+       {JPC_COD_RPCLPRG, "rpcl"},
+       {JPC_COD_PCRLPRG, "pcrl"},
+       {JPC_COD_CPRLPRG, "cprl"},
+       {-1, 0}
+};
+
+typedef enum {
+       MODE_INT,
+       MODE_REAL
+} modeid_t;
+
+jas_taginfo_t modetab[] = {
+       {MODE_INT, "int"},
+       {MODE_REAL, "real"},
+       {-1, 0}
+};
+
+/******************************************************************************\
+* The main encoder entry point.
+\******************************************************************************/
+
+int jpc_encode(jas_image_t *image, jas_stream_t *out, char *optstr)
+{
+       jpc_enc_t *enc;
+       jpc_enc_cp_t *cp;
+
+       enc = 0;
+       cp = 0;
+
+       jpc_initluts();
+
+       if (!(cp = cp_create(optstr, image))) {
+               jas_eprintf("invalid JP encoder options\n");
+               goto error;
+       }
+
+       if (!(enc = jpc_enc_create(cp, out, image))) {
+               goto error;
+       }
+       cp = 0;
+
+       /* Encode the main header. */
+       if (jpc_enc_encodemainhdr(enc)) {
+               goto error;
+       }
+
+       /* Encode the main body.  This constitutes most of the encoding work. */
+       if (jpc_enc_encodemainbody(enc)) {
+               goto error;
+       }
+
+       /* Write EOC marker segment. */
+       if (!(enc->mrk = jpc_ms_create(JPC_MS_EOC))) {
+               goto error;
+       }
+       if (jpc_putms(enc->out, enc->cstate, enc->mrk)) {
+               jas_eprintf("cannot write EOI marker\n");
+               goto error;
+       }
+       jpc_ms_destroy(enc->mrk);
+       enc->mrk = 0;
+
+       if (jas_stream_flush(enc->out)) {
+               goto error;
+       }
+
+       jpc_enc_destroy(enc);
+
+       return 0;
+
+error:
+       if (cp) {
+               jpc_enc_cp_destroy(cp);
+       }
+       if (enc) {
+               jpc_enc_destroy(enc);
+       }
+       return -1;
+}
+
+/******************************************************************************\
+* Option parsing code.
+\******************************************************************************/
+
+static jpc_enc_cp_t *cp_create(char *optstr, jas_image_t *image)
+{
+       jpc_enc_cp_t *cp;
+       jas_tvparser_t *tvp;
+       int ret;
+       int numilyrrates;
+       double *ilyrrates;
+       int i;
+       int tagid;
+       jpc_enc_tcp_t *tcp;
+       jpc_enc_tccp_t *tccp;
+       jpc_enc_ccp_t *ccp;
+       int cmptno;
+       uint_fast16_t rlvlno;
+       uint_fast16_t prcwidthexpn;
+       uint_fast16_t prcheightexpn;
+       bool enablemct;
+       uint_fast32_t jp2overhead;
+       uint_fast16_t lyrno;
+       uint_fast32_t hsteplcm;
+       uint_fast32_t vsteplcm;
+       bool mctvalid;
+
+       tvp = 0;
+       cp = 0;
+       ilyrrates = 0;
+       numilyrrates = 0;
+
+       if (!(cp = jas_malloc(sizeof(jpc_enc_cp_t)))) {
+               goto error;
+       }
+
+       prcwidthexpn = 15;
+       prcheightexpn = 15;
+       enablemct = true;
+       jp2overhead = 0;
+
+       cp->ccps = 0;
+       cp->debug = 0;
+       cp->imgareatlx = UINT_FAST32_MAX;
+       cp->imgareatly = UINT_FAST32_MAX;
+       cp->refgrdwidth = 0;
+       cp->refgrdheight = 0;
+       cp->tilegrdoffx = UINT_FAST32_MAX;
+       cp->tilegrdoffy = UINT_FAST32_MAX;
+       cp->tilewidth = 0;
+       cp->tileheight = 0;
+       cp->numcmpts = jas_image_numcmpts(image);
+
+       hsteplcm = 1;
+       vsteplcm = 1;
+       for (cmptno = 0; cmptno < jas_image_numcmpts(image); ++cmptno) {
+               if (jas_image_cmptbrx(image, cmptno) + jas_image_cmpthstep(image, cmptno) <=
+                 jas_image_brx(image) || jas_image_cmptbry(image, cmptno) +
+                 jas_image_cmptvstep(image, cmptno) <= jas_image_bry(image)) {
+                       jas_eprintf("unsupported image type\n");
+                       goto error;
+               }
+               /* Note: We ought to be calculating the LCMs here.  Fix some day. */
+               hsteplcm *= jas_image_cmpthstep(image, cmptno);
+               vsteplcm *= jas_image_cmptvstep(image, cmptno);
+       }
+
+       if (!(cp->ccps = jas_malloc(cp->numcmpts * sizeof(jpc_enc_ccp_t)))) {
+               goto error;
+       }
+       for (cmptno = 0, ccp = cp->ccps; cmptno < JAS_CAST(int, cp->numcmpts); ++cmptno,
+         ++ccp) {
+               ccp->sampgrdstepx = jas_image_cmpthstep(image, cmptno);
+               ccp->sampgrdstepy = jas_image_cmptvstep(image, cmptno);
+               /* XXX - this isn't quite correct for more general image */
+               ccp->sampgrdsubstepx = 0;
+               ccp->sampgrdsubstepx = 0;
+               ccp->prec = jas_image_cmptprec(image, cmptno);
+               ccp->sgnd = jas_image_cmptsgnd(image, cmptno);
+               ccp->numstepsizes = 0;
+               memset(ccp->stepsizes, 0, sizeof(ccp->stepsizes));
+       }
+
+       cp->rawsize = jas_image_rawsize(image);
+       cp->totalsize = UINT_FAST32_MAX;
+
+       tcp = &cp->tcp;
+       tcp->csty = 0;
+       tcp->intmode = true;
+       tcp->prg = JPC_COD_LRCPPRG;
+       tcp->numlyrs = 1;
+       tcp->ilyrrates = 0;
+
+       tccp = &cp->tccp;
+       tccp->csty = 0;
+       tccp->maxrlvls = 6;
+       tccp->cblkwidthexpn = 6;
+       tccp->cblkheightexpn = 6;
+       tccp->cblksty = 0;
+       tccp->numgbits = 2;
+
+       if (!(tvp = jas_tvparser_create(optstr ? optstr : ""))) {
+               goto error;
+       }
+
+       while (!(ret = jas_tvparser_next(tvp))) {
+               switch (jas_taginfo_nonull(jas_taginfos_lookup(encopts,
+                 jas_tvparser_gettag(tvp)))->id) {
+               case OPT_DEBUG:
+                       cp->debug = atoi(jas_tvparser_getval(tvp));
+                       break;
+               case OPT_IMGAREAOFFX:
+                       cp->imgareatlx = atoi(jas_tvparser_getval(tvp));
+                       break;
+               case OPT_IMGAREAOFFY:
+                       cp->imgareatly = atoi(jas_tvparser_getval(tvp));
+                       break;
+               case OPT_TILEGRDOFFX:
+                       cp->tilegrdoffx = atoi(jas_tvparser_getval(tvp));
+                       break;
+               case OPT_TILEGRDOFFY:
+                       cp->tilegrdoffy = atoi(jas_tvparser_getval(tvp));
+                       break;
+               case OPT_TILEWIDTH:
+                       cp->tilewidth = atoi(jas_tvparser_getval(tvp));
+                       break;
+               case OPT_TILEHEIGHT:
+                       cp->tileheight = atoi(jas_tvparser_getval(tvp));
+                       break;
+               case OPT_PRCWIDTH:
+                       prcwidthexpn = jpc_floorlog2(atoi(jas_tvparser_getval(tvp)));
+                       break;
+               case OPT_PRCHEIGHT:
+                       prcheightexpn = jpc_floorlog2(atoi(jas_tvparser_getval(tvp)));
+                       break;
+               case OPT_CBLKWIDTH:
+                       tccp->cblkwidthexpn =
+                         jpc_floorlog2(atoi(jas_tvparser_getval(tvp)));
+                       break;
+               case OPT_CBLKHEIGHT:
+                       tccp->cblkheightexpn =
+                         jpc_floorlog2(atoi(jas_tvparser_getval(tvp)));
+                       break;
+               case OPT_MODE:
+                       if ((tagid = jas_taginfo_nonull(jas_taginfos_lookup(modetab,
+                         jas_tvparser_getval(tvp)))->id) < 0) {
+                               jas_eprintf("ignoring invalid mode %s\n",
+                                 jas_tvparser_getval(tvp));
+                       } else {
+                               tcp->intmode = (tagid == MODE_INT);
+                       }
+                       break;
+               case OPT_PRG:
+                       if ((tagid = jas_taginfo_nonull(jas_taginfos_lookup(prgordtab,
+                         jas_tvparser_getval(tvp)))->id) < 0) {
+                               jas_eprintf("ignoring invalid progression order %s\n",
+                                 jas_tvparser_getval(tvp));
+                       } else {
+                               tcp->prg = tagid;
+                       }
+                       break;
+               case OPT_NOMCT:
+                       enablemct = false;
+                       break;
+               case OPT_MAXRLVLS:
+                       tccp->maxrlvls = atoi(jas_tvparser_getval(tvp));
+                       break;
+               case OPT_SOP:
+                       cp->tcp.csty |= JPC_COD_SOP;
+                       break;
+               case OPT_EPH:
+                       cp->tcp.csty |= JPC_COD_EPH;
+                       break;
+               case OPT_LAZY:
+                       tccp->cblksty |= JPC_COX_LAZY;
+                       break;
+               case OPT_TERMALL:
+                       tccp->cblksty |= JPC_COX_TERMALL;
+                       break;
+               case OPT_SEGSYM:
+                       tccp->cblksty |= JPC_COX_SEGSYM;
+                       break;
+               case OPT_VCAUSAL:
+                       tccp->cblksty |= JPC_COX_VSC;
+                       break;
+               case OPT_RESET:
+                       tccp->cblksty |= JPC_COX_RESET;
+                       break;
+               case OPT_PTERM:
+                       tccp->cblksty |= JPC_COX_PTERM;
+                       break;
+               case OPT_NUMGBITS:
+                       cp->tccp.numgbits = atoi(jas_tvparser_getval(tvp));
+                       break;
+               case OPT_RATE:
+                       if (ratestrtosize(jas_tvparser_getval(tvp), cp->rawsize,
+                         &cp->totalsize)) {
+                               jas_eprintf("ignoring bad rate specifier %s\n",
+                                 jas_tvparser_getval(tvp));
+                       }
+                       break;
+               case OPT_ILYRRATES:
+                       if (jpc_atoaf(jas_tvparser_getval(tvp), &numilyrrates,
+                         &ilyrrates)) {
+                               jas_eprintf("warning: invalid intermediate layer rates specifier ignored (%s)\n",
+                                 jas_tvparser_getval(tvp));
+                       }
+                       break;
+
+               case OPT_JP2OVERHEAD:
+                       jp2overhead = atoi(jas_tvparser_getval(tvp));
+                       break;
+               default:
+                       jas_eprintf("warning: ignoring invalid option %s\n",
+                        jas_tvparser_gettag(tvp));
+                       break;
+               }
+       }
+
+       jas_tvparser_destroy(tvp);
+       tvp = 0;
+
+       if (cp->totalsize != UINT_FAST32_MAX) {
+               cp->totalsize = (cp->totalsize > jp2overhead) ?
+                 (cp->totalsize - jp2overhead) : 0;
+       }
+
+       if (cp->imgareatlx == UINT_FAST32_MAX) {
+               cp->imgareatlx = 0;
+       } else {
+               if (hsteplcm != 1) {
+                       jas_eprintf("warning: overriding imgareatlx value\n");
+               }
+               cp->imgareatlx *= hsteplcm;
+       }
+       if (cp->imgareatly == UINT_FAST32_MAX) {
+               cp->imgareatly = 0;
+       } else {
+               if (vsteplcm != 1) {
+                       jas_eprintf("warning: overriding imgareatly value\n");
+               }
+               cp->imgareatly *= vsteplcm;
+       }
+       cp->refgrdwidth = cp->imgareatlx + jas_image_width(image);
+       cp->refgrdheight = cp->imgareatly + jas_image_height(image);
+       if (cp->tilegrdoffx == UINT_FAST32_MAX) {
+               cp->tilegrdoffx = cp->imgareatlx;
+       }
+       if (cp->tilegrdoffy == UINT_FAST32_MAX) {
+               cp->tilegrdoffy = cp->imgareatly;
+       }
+       if (!cp->tilewidth) {
+               cp->tilewidth = cp->refgrdwidth - cp->tilegrdoffx;
+       }
+       if (!cp->tileheight) {
+               cp->tileheight = cp->refgrdheight - cp->tilegrdoffy;
+       }
+
+       if (cp->numcmpts == 3) {
+               mctvalid = true;
+               for (cmptno = 0; cmptno < jas_image_numcmpts(image); ++cmptno) {
+                       if (jas_image_cmptprec(image, cmptno) != jas_image_cmptprec(image, 0) ||
+                         jas_image_cmptsgnd(image, cmptno) != jas_image_cmptsgnd(image, 0) ||
+                         jas_image_cmptwidth(image, cmptno) != jas_image_cmptwidth(image, 0) ||
+                         jas_image_cmptheight(image, cmptno) != jas_image_cmptheight(image, 0)) {
+                               mctvalid = false;
+                       }
+               }
+       } else {
+               mctvalid = false;
+       }
+       if (mctvalid && enablemct && jas_clrspc_fam(jas_image_clrspc(image)) != JAS_CLRSPC_FAM_RGB) {
+               jas_eprintf("warning: color space apparently not RGB\n");
+       }
+       if (mctvalid && enablemct && jas_clrspc_fam(jas_image_clrspc(image)) == JAS_CLRSPC_FAM_RGB) {
+               tcp->mctid = (tcp->intmode) ? (JPC_MCT_RCT) : (JPC_MCT_ICT);
+       } else {
+               tcp->mctid = JPC_MCT_NONE;
+       }
+       tccp->qmfbid = (tcp->intmode) ? (JPC_COX_RFT) : (JPC_COX_INS);
+
+       for (rlvlno = 0; rlvlno < tccp->maxrlvls; ++rlvlno) {
+               tccp->prcwidthexpns[rlvlno] = prcwidthexpn;
+               tccp->prcheightexpns[rlvlno] = prcheightexpn;
+       }
+       if (prcwidthexpn != 15 || prcheightexpn != 15) {
+               tccp->csty |= JPC_COX_PRT;
+       }
+
+       /* Ensure that the tile width and height is valid. */
+       if (!cp->tilewidth) {
+               jas_eprintf("invalid tile width %lu\n", (unsigned long)
+                 cp->tilewidth);
+               goto error;
+       }
+       if (!cp->tileheight) {
+               jas_eprintf("invalid tile height %lu\n", (unsigned long)
+                 cp->tileheight);
+               goto error;
+       }
+
+       /* Ensure that the tile grid offset is valid. */
+       if (cp->tilegrdoffx > cp->imgareatlx ||
+         cp->tilegrdoffy > cp->imgareatly ||
+         cp->tilegrdoffx + cp->tilewidth < cp->imgareatlx ||
+         cp->tilegrdoffy + cp->tileheight < cp->imgareatly) {
+               jas_eprintf("invalid tile grid offset (%lu, %lu)\n",
+                 (unsigned long) cp->tilegrdoffx, (unsigned long)
+                 cp->tilegrdoffy);
+               goto error;
+       }
+
+       cp->numhtiles = JPC_CEILDIV(cp->refgrdwidth - cp->tilegrdoffx,
+         cp->tilewidth);
+       cp->numvtiles = JPC_CEILDIV(cp->refgrdheight - cp->tilegrdoffy,
+         cp->tileheight);
+       cp->numtiles = cp->numhtiles * cp->numvtiles;
+
+       if (ilyrrates && numilyrrates > 0) {
+               tcp->numlyrs = numilyrrates + 1;
+               if (!(tcp->ilyrrates = jas_malloc((tcp->numlyrs - 1) *
+                 sizeof(jpc_fix_t)))) {
+                       goto error;
+               }
+               for (i = 0; i < JAS_CAST(int, tcp->numlyrs - 1); ++i) {
+                       tcp->ilyrrates[i] = jpc_dbltofix(ilyrrates[i]);
+               }
+       }
+
+       /* Ensure that the integer mode is used in the case of lossless
+         coding. */
+       if (cp->totalsize == UINT_FAST32_MAX && (!cp->tcp.intmode)) {
+               jas_eprintf("cannot use real mode for lossless coding\n");
+               goto error;
+       }
+
+       /* Ensure that the precinct width is valid. */
+       if (prcwidthexpn > 15) {
+               jas_eprintf("invalid precinct width\n");
+               goto error;
+       }
+
+       /* Ensure that the precinct height is valid. */
+       if (prcheightexpn > 15) {
+               jas_eprintf("invalid precinct height\n");
+               goto error;
+       }
+
+       /* Ensure that the code block width is valid. */
+       if (cp->tccp.cblkwidthexpn < 2 || cp->tccp.cblkwidthexpn > 12) {
+               jas_eprintf("invalid code block width %d\n",
+                 JPC_POW2(cp->tccp.cblkwidthexpn));
+               goto error;
+       }
+
+       /* Ensure that the code block height is valid. */
+       if (cp->tccp.cblkheightexpn < 2 || cp->tccp.cblkheightexpn > 12) {
+               jas_eprintf("invalid code block height %d\n",
+                 JPC_POW2(cp->tccp.cblkheightexpn));
+               goto error;
+       }
+
+       /* Ensure that the code block size is not too large. */
+       if (cp->tccp.cblkwidthexpn + cp->tccp.cblkheightexpn > 12) {
+               jas_eprintf("code block size too large\n");
+               goto error;
+       }
+
+       /* Ensure that the number of layers is valid. */
+       if (cp->tcp.numlyrs > 16384) {
+               jas_eprintf("too many layers\n");
+               goto error;
+       }
+
+       /* There must be at least one resolution level. */
+       if (cp->tccp.maxrlvls < 1) {
+               jas_eprintf("must be at least one resolution level\n");
+               goto error;
+       }
+
+       /* Ensure that the number of guard bits is valid. */
+       if (cp->tccp.numgbits > 8) {
+               jas_eprintf("invalid number of guard bits\n");
+               goto error;
+       }
+
+       /* Ensure that the rate is within the legal range. */
+       if (cp->totalsize != UINT_FAST32_MAX && cp->totalsize > cp->rawsize) {
+               jas_eprintf("warning: specified rate is unreasonably large (%lu > %lu)\n", (unsigned long) cp->totalsize, (unsigned long) cp->rawsize);
+       }
+
+       /* Ensure that the intermediate layer rates are valid. */
+       if (tcp->numlyrs > 1) {
+               /* The intermediate layers rates must increase monotonically. */
+               for (lyrno = 0; lyrno + 2 < tcp->numlyrs; ++lyrno) {
+                       if (tcp->ilyrrates[lyrno] >= tcp->ilyrrates[lyrno + 1]) {
+                               jas_eprintf("intermediate layer rates must increase monotonically\n");
+                               goto error;
+                       }
+               }
+               /* The intermediate layer rates must be less than the overall rate. */
+               if (cp->totalsize != UINT_FAST32_MAX) {
+                       for (lyrno = 0; lyrno < tcp->numlyrs - 1; ++lyrno) {
+                               if (jpc_fixtodbl(tcp->ilyrrates[lyrno]) > ((double) cp->totalsize)
+                                 / cp->rawsize) {
+                                       jas_eprintf("warning: intermediate layer rates must be less than overall rate\n");
+                                       goto error;
+                               }
+                       }
+               }
+       }
+
+       if (ilyrrates) {
+               jas_free(ilyrrates);
+       }
+
+       return cp;
+
+error:
+
+       if (ilyrrates) {
+               jas_free(ilyrrates);
+       }
+       if (tvp) {
+               jas_tvparser_destroy(tvp);
+       }
+       if (cp) {
+               jpc_enc_cp_destroy(cp);
+       }
+       return 0;
+}
+
+void jpc_enc_cp_destroy(jpc_enc_cp_t *cp)
+{
+       if (cp->ccps) {
+               if (cp->tcp.ilyrrates) {
+                       jas_free(cp->tcp.ilyrrates);
+               }
+               jas_free(cp->ccps);
+       }
+       jas_free(cp);
+}
+
+int ratestrtosize(char *s, uint_fast32_t rawsize, uint_fast32_t *size)
+{
+       char *cp;
+       jpc_flt_t f;
+
+       /* Note: This function must not modify output size on failure. */
+       if ((cp = strchr(s, 'B'))) {
+               *size = atoi(s);
+       } else {
+               f = atof(s);
+               if (f < 0) {
+                       *size = 0;
+               } else if (f > 1.0) {
+                       *size = rawsize + 1;
+               } else {
+                       *size = f * rawsize;
+               }
+       }
+       return 0;
+}
+
+/******************************************************************************\
+* Encoder constructor and destructor.
+\******************************************************************************/
+
+jpc_enc_t *jpc_enc_create(jpc_enc_cp_t *cp, jas_stream_t *out, jas_image_t *image)
+{
+       jpc_enc_t *enc;
+
+       enc = 0;
+
+       if (!(enc = jas_malloc(sizeof(jpc_enc_t)))) {
+               goto error;
+       }
+
+       enc->image = image;
+       enc->out = out;
+       enc->cp = cp;
+       enc->cstate = 0;
+       enc->tmpstream = 0;
+       enc->mrk = 0;
+       enc->curtile = 0;
+
+       if (!(enc->cstate = jpc_cstate_create())) {
+               goto error;
+       }
+       enc->len = 0;
+       enc->mainbodysize = 0;
+
+       return enc;
+
+error:
+
+       if (enc) {
+               jpc_enc_destroy(enc);
+       }
+       return 0;
+}
+
+void jpc_enc_destroy(jpc_enc_t *enc)
+{
+       /* The image object (i.e., enc->image) and output stream object
+       (i.e., enc->out) are created outside of the encoder.
+       Therefore, they must not be destroyed here. */
+
+       if (enc->curtile) {
+               jpc_enc_tile_destroy(enc->curtile);
+       }
+       if (enc->cp) {
+               jpc_enc_cp_destroy(enc->cp);
+       }
+       if (enc->cstate) {
+               jpc_cstate_destroy(enc->cstate);
+       }
+       if (enc->tmpstream) {
+               jas_stream_close(enc->tmpstream);
+       }
+
+       jas_free(enc);
+}
+
+/******************************************************************************\
+* Code.
+\******************************************************************************/
+
+static int jpc_calcssmant(jpc_fix_t stepsize)
+{
+       int n;
+       int e;
+       int m;
+
+       n = jpc_firstone(stepsize);
+       e = n - JPC_FIX_FRACBITS;
+       if (n >= 11) {
+               m = (stepsize >> (n - 11)) & 0x7ff;
+       } else {
+               m = (stepsize & ((1 << n) - 1)) << (11 - n);
+       }
+       return m;
+}
+
+static int jpc_calcssexp(jpc_fix_t stepsize)
+{
+       return jpc_firstone(stepsize) - JPC_FIX_FRACBITS;
+}
+
+static int jpc_enc_encodemainhdr(jpc_enc_t *enc)
+{
+       jpc_siz_t *siz;
+       jpc_cod_t *cod;
+       jpc_qcd_t *qcd;
+       int i;
+long startoff;
+long mainhdrlen;
+       jpc_enc_cp_t *cp;
+       jpc_qcc_t *qcc;
+       jpc_enc_tccp_t *tccp;
+       uint_fast16_t cmptno;
+       jpc_tsfb_band_t bandinfos[JPC_MAXBANDS];
+       jpc_fix_t mctsynweight;
+       jpc_enc_tcp_t *tcp;
+       jpc_tsfb_t *tsfb;
+       jpc_tsfb_band_t *bandinfo;
+       uint_fast16_t numbands;
+       uint_fast16_t bandno;
+       uint_fast16_t rlvlno;
+       uint_fast16_t analgain;
+       jpc_fix_t absstepsize;
+       char buf[1024];
+       jpc_com_t *com;
+
+       cp = enc->cp;
+
+startoff = jas_stream_getrwcount(enc->out);
+
+       /* Write SOC marker segment. */
+       if (!(enc->mrk = jpc_ms_create(JPC_MS_SOC))) {
+               return -1;
+       }
+       if (jpc_putms(enc->out, enc->cstate, enc->mrk)) {
+               jas_eprintf("cannot write SOC marker\n");
+               return -1;
+       }
+       jpc_ms_destroy(enc->mrk);
+       enc->mrk = 0;
+
+       /* Write SIZ marker segment. */
+       if (!(enc->mrk = jpc_ms_create(JPC_MS_SIZ))) {
+               return -1;
+       }
+       siz = &enc->mrk->parms.siz;
+       siz->caps = 0;
+       siz->xoff = cp->imgareatlx;
+       siz->yoff = cp->imgareatly;
+       siz->width = cp->refgrdwidth;
+       siz->height = cp->refgrdheight;
+       siz->tilexoff = cp->tilegrdoffx;
+       siz->tileyoff = cp->tilegrdoffy;
+       siz->tilewidth = cp->tilewidth;
+       siz->tileheight = cp->tileheight;
+       siz->numcomps = cp->numcmpts;
+       siz->comps = jas_malloc(siz->numcomps * sizeof(jpc_sizcomp_t));
+       assert(siz->comps);
+       for (i = 0; i < JAS_CAST(int, cp->numcmpts); ++i) {
+               siz->comps[i].prec = cp->ccps[i].prec;
+               siz->comps[i].sgnd = cp->ccps[i].sgnd;
+               siz->comps[i].hsamp = cp->ccps[i].sampgrdstepx;
+               siz->comps[i].vsamp = cp->ccps[i].sampgrdstepy;
+       }
+       if (jpc_putms(enc->out, enc->cstate, enc->mrk)) {
+               jas_eprintf("cannot write SIZ marker\n");
+               return -1;
+       }
+       jpc_ms_destroy(enc->mrk);
+       enc->mrk = 0;
+
+       if (!(enc->mrk = jpc_ms_create(JPC_MS_COM))) {
+               return -1;
+       }
+       sprintf(buf, "Creator: JasPer Version %s", jas_getversion());
+       com = &enc->mrk->parms.com;
+       com->len = strlen(buf);
+       com->regid = JPC_COM_LATIN;
+       if (!(com->data = JAS_CAST(uchar *, jas_strdup(buf)))) {
+               abort();
+       }
+       if (jpc_putms(enc->out, enc->cstate, enc->mrk)) {
+               jas_eprintf("cannot write COM marker\n");
+               return -1;
+       }
+       jpc_ms_destroy(enc->mrk);
+       enc->mrk = 0;
+
+#if 0
+       if (!(enc->mrk = jpc_ms_create(JPC_MS_CRG))) {
+               return -1;
+       }
+       crg = &enc->mrk->parms.crg;
+       crg->comps = jas_malloc(crg->numcomps * sizeof(jpc_crgcomp_t));
+       if (jpc_putms(enc->out, enc->cstate, enc->mrk)) {
+               jas_eprintf("cannot write CRG marker\n");
+               return -1;
+       }
+       jpc_ms_destroy(enc->mrk);
+       enc->mrk = 0;
+#endif
+
+       tcp = &cp->tcp;
+       tccp = &cp->tccp;
+       for (cmptno = 0; cmptno < cp->numcmpts; ++cmptno) {
+               tsfb = jpc_cod_gettsfb(tccp->qmfbid, tccp->maxrlvls - 1);
+               jpc_tsfb_getbands(tsfb, 0, 0, 1 << tccp->maxrlvls, 1 << tccp->maxrlvls,
+                 bandinfos);
+               jpc_tsfb_destroy(tsfb);
+               mctsynweight = jpc_mct_getsynweight(tcp->mctid, cmptno);
+               numbands = 3 * tccp->maxrlvls - 2;
+               for (bandno = 0, bandinfo = bandinfos; bandno < numbands;
+                 ++bandno, ++bandinfo) {
+                       rlvlno = (bandno) ? ((bandno - 1) / 3 + 1) : 0;
+                       analgain = JPC_NOMINALGAIN(tccp->qmfbid, tccp->maxrlvls,
+                         rlvlno, bandinfo->orient);
+                       if (!tcp->intmode) {
+                               absstepsize = jpc_fix_div(jpc_inttofix(1 <<
+                                 (analgain + 1)), bandinfo->synenergywt);
+                       } else {
+                               absstepsize = jpc_inttofix(1);
+                       }       
+                       cp->ccps[cmptno].stepsizes[bandno] =
+                         jpc_abstorelstepsize(absstepsize,
+                         cp->ccps[cmptno].prec + analgain);
+               }
+               cp->ccps[cmptno].numstepsizes = numbands;
+       }
+
+       if (!(enc->mrk = jpc_ms_create(JPC_MS_COD))) {
+               return -1;
+       }
+       cod = &enc->mrk->parms.cod;
+       cod->csty = cp->tccp.csty | cp->tcp.csty;
+       cod->compparms.csty = cp->tccp.csty | cp->tcp.csty;
+       cod->compparms.numdlvls = cp->tccp.maxrlvls - 1;
+       cod->compparms.numrlvls = cp->tccp.maxrlvls;
+       cod->prg = cp->tcp.prg;
+       cod->numlyrs = cp->tcp.numlyrs;
+       cod->compparms.cblkwidthval = JPC_COX_CBLKSIZEEXPN(cp->tccp.cblkwidthexpn);
+       cod->compparms.cblkheightval = JPC_COX_CBLKSIZEEXPN(cp->tccp.cblkheightexpn);
+       cod->compparms.cblksty = cp->tccp.cblksty;
+       cod->compparms.qmfbid = cp->tccp.qmfbid;
+       cod->mctrans = (cp->tcp.mctid != JPC_MCT_NONE);
+       if (tccp->csty & JPC_COX_PRT) {
+               for (rlvlno = 0; rlvlno < tccp->maxrlvls; ++rlvlno) {
+                       cod->compparms.rlvls[rlvlno].parwidthval = tccp->prcwidthexpns[rlvlno];
+                       cod->compparms.rlvls[rlvlno].parheightval = tccp->prcheightexpns[rlvlno];
+               }
+       }
+       if (jpc_putms(enc->out, enc->cstate, enc->mrk)) {
+               jas_eprintf("cannot write COD marker\n");
+               return -1;
+       }
+       jpc_ms_destroy(enc->mrk);
+       enc->mrk = 0;
+
+       if (!(enc->mrk = jpc_ms_create(JPC_MS_QCD))) {
+               return -1;
+       }
+       qcd = &enc->mrk->parms.qcd;
+       qcd->compparms.qntsty = (tccp->qmfbid == JPC_COX_INS) ?
+         JPC_QCX_SEQNT : JPC_QCX_NOQNT;
+       qcd->compparms.numstepsizes = cp->ccps[0].numstepsizes;
+       qcd->compparms.numguard = cp->tccp.numgbits;
+       qcd->compparms.stepsizes = cp->ccps[0].stepsizes;
+       if (jpc_putms(enc->out, enc->cstate, enc->mrk)) {
+               return -1;
+       }
+       /* We do not want the step size array to be freed! */
+       qcd->compparms.stepsizes = 0;
+       jpc_ms_destroy(enc->mrk);
+       enc->mrk = 0;
+
+       tccp = &cp->tccp;
+       for (cmptno = 1; cmptno < cp->numcmpts; ++cmptno) {
+               if (!(enc->mrk = jpc_ms_create(JPC_MS_QCC))) {
+                       return -1;
+               }
+               qcc = &enc->mrk->parms.qcc;
+               qcc->compno = cmptno;
+               qcc->compparms.qntsty = (tccp->qmfbid == JPC_COX_INS) ?
+                 JPC_QCX_SEQNT : JPC_QCX_NOQNT;
+               qcc->compparms.numstepsizes = cp->ccps[cmptno].numstepsizes;
+               qcc->compparms.numguard = cp->tccp.numgbits;
+               qcc->compparms.stepsizes = cp->ccps[cmptno].stepsizes;
+               if (jpc_putms(enc->out, enc->cstate, enc->mrk)) {
+                       return -1;
+               }
+               /* We do not want the step size array to be freed! */
+               qcc->compparms.stepsizes = 0;
+               jpc_ms_destroy(enc->mrk);
+               enc->mrk = 0;
+       }
+
+#define MAINTLRLEN     2
+       mainhdrlen = jas_stream_getrwcount(enc->out) - startoff;
+       enc->len += mainhdrlen;
+       if (enc->cp->totalsize != UINT_FAST32_MAX) {
+               uint_fast32_t overhead;
+               overhead = mainhdrlen + MAINTLRLEN;
+               enc->mainbodysize = (enc->cp->totalsize >= overhead) ?
+                 (enc->cp->totalsize - overhead) : 0;
+       } else {
+               enc->mainbodysize = UINT_FAST32_MAX;
+       }
+
+       return 0;
+}
+
+static int jpc_enc_encodemainbody(jpc_enc_t *enc)
+{
+       int tileno;
+       int tilex;
+       int tiley;
+       int i;
+       jpc_sot_t *sot;
+       jpc_enc_tcmpt_t *comp;
+       jpc_enc_tcmpt_t *endcomps;
+       jpc_enc_band_t *band;
+       jpc_enc_band_t *endbands;
+       jpc_enc_rlvl_t *lvl;
+       int rlvlno;
+       jpc_qcc_t *qcc;
+       jpc_cod_t *cod;
+       int adjust;
+       int j;
+       int absbandno;
+       long numbytes;
+       long tilehdrlen;
+       long tilelen;
+       jpc_enc_tile_t *tile;
+       jpc_enc_cp_t *cp;
+       double rho;
+       int lyrno;
+       int cmptno;
+       int samestepsizes;
+       jpc_enc_ccp_t *ccps;
+       jpc_enc_tccp_t *tccp;
+int bandno;
+uint_fast32_t x;
+uint_fast32_t y;
+int mingbits;
+int actualnumbps;
+jpc_fix_t mxmag;
+jpc_fix_t mag;
+int numgbits;
+
+       cp = enc->cp;
+
+       /* Avoid compile warnings. */
+       numbytes = 0;
+
+       for (tileno = 0; tileno < JAS_CAST(int, cp->numtiles); ++tileno) {
+               tilex = tileno % cp->numhtiles;
+               tiley = tileno / cp->numhtiles;
+
+               if (!(enc->curtile = jpc_enc_tile_create(enc->cp, enc->image, tileno))) {
+                       abort();
+               }
+
+               tile = enc->curtile;
+
+               if (jas_getdbglevel() >= 10) {
+                       jpc_enc_dump(enc);
+               }
+
+               endcomps = &tile->tcmpts[tile->numtcmpts];
+               for (cmptno = 0, comp = tile->tcmpts; cmptno < tile->numtcmpts; ++cmptno, ++comp) {
+                       if (!cp->ccps[cmptno].sgnd) {
+                               adjust = 1 << (cp->ccps[cmptno].prec - 1);
+                               for (i = 0; i < jas_matrix_numrows(comp->data); ++i) {
+                                       for (j = 0; j < jas_matrix_numcols(comp->data); ++j) {
+                                               *jas_matrix_getref(comp->data, i, j) -= adjust;
+                                       }
+                               }
+                       }
+               }
+
+               if (!tile->intmode) {
+                               endcomps = &tile->tcmpts[tile->numtcmpts];
+                               for (comp = tile->tcmpts; comp != endcomps; ++comp) {
+                                       jas_matrix_asl(comp->data, JPC_FIX_FRACBITS);
+                               }
+               }
+
+               switch (tile->mctid) {
+               case JPC_MCT_RCT:
+assert(jas_image_numcmpts(enc->image) == 3);
+                       jpc_rct(tile->tcmpts[0].data, tile->tcmpts[1].data,
+                         tile->tcmpts[2].data);
+                       break;
+               case JPC_MCT_ICT:
+assert(jas_image_numcmpts(enc->image) == 3);
+                       jpc_ict(tile->tcmpts[0].data, tile->tcmpts[1].data,
+                         tile->tcmpts[2].data);
+                       break;
+               default:
+                       break;
+               }
+
+               for (i = 0; i < jas_image_numcmpts(enc->image); ++i) {
+                       comp = &tile->tcmpts[i];
+                       jpc_tsfb_analyze(comp->tsfb, comp->data);
+
+               }
+
+
+               endcomps = &tile->tcmpts[tile->numtcmpts];
+               for (cmptno = 0, comp = tile->tcmpts; comp != endcomps; ++cmptno, ++comp) {
+                       mingbits = 0;
+                       absbandno = 0;
+                       /* All bands must have a corresponding quantizer step size,
+                         even if they contain no samples and are never coded. */
+                       /* Some bands may not be hit by the loop below, so we must
+                         initialize all of the step sizes to a sane value. */
+                       memset(comp->stepsizes, 0, sizeof(comp->stepsizes));
+                       for (rlvlno = 0, lvl = comp->rlvls; rlvlno < comp->numrlvls; ++rlvlno, ++lvl) {
+                               if (!lvl->bands) {
+                                       absbandno += rlvlno ? 3 : 1;
+                                       continue;
+                               }
+                               endbands = &lvl->bands[lvl->numbands];
+                               for (band = lvl->bands; band != endbands; ++band) {
+                                       if (!band->data) {
+                                               ++absbandno;
+                                               continue;
+                                       }
+                                       actualnumbps = 0;
+                                       mxmag = 0;
+                                       for (y = 0; y < JAS_CAST(uint_fast32_t, jas_matrix_numrows(band->data)); ++y) {
+                                               for (x = 0; x < JAS_CAST(uint_fast32_t, jas_matrix_numcols(band->data)); ++x) {
+                                                       mag = abs(jas_matrix_get(band->data, y, x));
+                                                       if (mag > mxmag) {
+                                                               mxmag = mag;
+                                                       }
+                                               }
+                                       }
+                                       if (tile->intmode) {
+                                               actualnumbps = jpc_firstone(mxmag) + 1;
+                                       } else {
+                                               actualnumbps = jpc_firstone(mxmag) + 1 - JPC_FIX_FRACBITS;
+                                       }
+                                       numgbits = actualnumbps - (cp->ccps[cmptno].prec - 1 +
+                                         band->analgain);
+#if 0
+jas_eprintf("%d %d mag=%d actual=%d numgbits=%d\n", cp->ccps[cmptno].prec, band->analgain, mxmag, actualnumbps, numgbits);
+#endif
+                                       if (numgbits > mingbits) {
+                                               mingbits = numgbits;
+                                       }
+                                       if (!tile->intmode) {
+                                               band->absstepsize = jpc_fix_div(jpc_inttofix(1
+                                                 << (band->analgain + 1)),
+                                                 band->synweight);
+                                       } else {
+                                               band->absstepsize = jpc_inttofix(1);
+                                       }
+                                       band->stepsize = jpc_abstorelstepsize(
+                                         band->absstepsize, cp->ccps[cmptno].prec +
+                                         band->analgain);
+                                       band->numbps = cp->tccp.numgbits +
+                                         JPC_QCX_GETEXPN(band->stepsize) - 1;
+
+                                       if ((!tile->intmode) && band->data) {
+                                               jpc_quantize(band->data, band->absstepsize);
+                                       }
+
+                                       comp->stepsizes[absbandno] = band->stepsize;
+                                       ++absbandno;
+                               }
+                       }
+
+                       assert(JPC_FIX_FRACBITS >= JPC_NUMEXTRABITS);
+                       if (!tile->intmode) {
+                               jas_matrix_divpow2(comp->data, JPC_FIX_FRACBITS - JPC_NUMEXTRABITS);
+                       } else {
+                               jas_matrix_asl(comp->data, JPC_NUMEXTRABITS);
+                       }
+
+#if 0
+jas_eprintf("mingbits %d\n", mingbits);
+#endif
+                       if (mingbits > cp->tccp.numgbits) {
+                               jas_eprintf("error: too few guard bits (need at least %d)\n",
+                                 mingbits);
+                               return -1;
+                       }
+               }
+
+               if (!(enc->tmpstream = jas_stream_memopen(0, 0))) {
+                       jas_eprintf("cannot open tmp file\n");
+                       return -1;
+               }
+
+               /* Write the tile header. */
+               if (!(enc->mrk = jpc_ms_create(JPC_MS_SOT))) {
+                       return -1;
+               }
+               sot = &enc->mrk->parms.sot;
+               sot->len = 0;
+               sot->tileno = tileno;
+               sot->partno = 0;
+               sot->numparts = 1;
+               if (jpc_putms(enc->tmpstream, enc->cstate, enc->mrk)) {
+                       jas_eprintf("cannot write SOT marker\n");
+                       return -1;
+               }
+               jpc_ms_destroy(enc->mrk);
+               enc->mrk = 0;
+
+/************************************************************************/
+/************************************************************************/
+/************************************************************************/
+
+               tccp = &cp->tccp;
+               for (cmptno = 0; cmptno < JAS_CAST(int, cp->numcmpts); ++cmptno) {
+                       comp = &tile->tcmpts[cmptno];
+                       if (comp->numrlvls != tccp->maxrlvls) {
+                               if (!(enc->mrk = jpc_ms_create(JPC_MS_COD))) {
+                                       return -1;
+                               }
+/* XXX = this is not really correct. we are using comp #0's precint sizes
+and other characteristics */
+                               comp = &tile->tcmpts[0];
+                               cod = &enc->mrk->parms.cod;
+                               cod->compparms.csty = 0;
+                               cod->compparms.numdlvls = comp->numrlvls - 1;
+                               cod->prg = tile->prg;
+                               cod->numlyrs = tile->numlyrs;
+                               cod->compparms.cblkwidthval = JPC_COX_CBLKSIZEEXPN(comp->cblkwidthexpn);
+                               cod->compparms.cblkheightval = JPC_COX_CBLKSIZEEXPN(comp->cblkheightexpn);
+                               cod->compparms.cblksty = comp->cblksty;
+                               cod->compparms.qmfbid = comp->qmfbid;
+                               cod->mctrans = (tile->mctid != JPC_MCT_NONE);
+                               for (i = 0; i < comp->numrlvls; ++i) {
+                                       cod->compparms.rlvls[i].parwidthval = comp->rlvls[i].prcwidthexpn;
+                                       cod->compparms.rlvls[i].parheightval = comp->rlvls[i].prcheightexpn;
+                               }
+                               if (jpc_putms(enc->tmpstream, enc->cstate, enc->mrk)) {
+                                       return -1;
+                               }
+                               jpc_ms_destroy(enc->mrk);
+                               enc->mrk = 0;
+                       }
+               }
+
+               for (cmptno = 0, comp = tile->tcmpts; cmptno < JAS_CAST(int, cp->numcmpts); ++cmptno, ++comp) {
+                       ccps = &cp->ccps[cmptno];
+                       if (JAS_CAST(int, ccps->numstepsizes) == comp->numstepsizes) {
+                               samestepsizes = 1;
+                               for (bandno = 0; bandno < JAS_CAST(int, ccps->numstepsizes); ++bandno) {
+                                       if (ccps->stepsizes[bandno] != comp->stepsizes[bandno]) {
+                                               samestepsizes = 0;
+                                               break;
+                                       }
+                               }
+                       } else {
+                               samestepsizes = 0;
+                       }
+                       if (!samestepsizes) {
+                               if (!(enc->mrk = jpc_ms_create(JPC_MS_QCC))) {
+                                       return -1;
+                               }
+                               qcc = &enc->mrk->parms.qcc;
+                               qcc->compno = cmptno;
+                               qcc->compparms.numguard = cp->tccp.numgbits;
+                               qcc->compparms.qntsty = (comp->qmfbid == JPC_COX_INS) ?
+                                 JPC_QCX_SEQNT : JPC_QCX_NOQNT;
+                               qcc->compparms.numstepsizes = comp->numstepsizes;
+                               qcc->compparms.stepsizes = comp->stepsizes;
+                               if (jpc_putms(enc->tmpstream, enc->cstate, enc->mrk)) {
+                                       return -1;
+                               }
+                               qcc->compparms.stepsizes = 0;
+                               jpc_ms_destroy(enc->mrk);
+                               enc->mrk = 0;
+                       }
+               }
+
+               /* Write a SOD marker to indicate the end of the tile header. */
+               if (!(enc->mrk = jpc_ms_create(JPC_MS_SOD))) {
+                       return -1;
+               }
+               if (jpc_putms(enc->tmpstream, enc->cstate, enc->mrk)) {
+                       jas_eprintf("cannot write SOD marker\n");
+                       return -1;
+               }
+               jpc_ms_destroy(enc->mrk);
+               enc->mrk = 0;
+tilehdrlen = jas_stream_getrwcount(enc->tmpstream);
+
+/************************************************************************/
+/************************************************************************/
+/************************************************************************/
+
+if (jpc_enc_enccblks(enc)) {
+       abort();
+       return -1;
+}
+
+               cp = enc->cp;
+               rho = (double) (tile->brx - tile->tlx) * (tile->bry - tile->tly) /
+                 ((cp->refgrdwidth - cp->imgareatlx) * (cp->refgrdheight -
+                 cp->imgareatly));
+               tile->rawsize = cp->rawsize * rho;
+
+               for (lyrno = 0; lyrno < tile->numlyrs - 1; ++lyrno) {
+                       tile->lyrsizes[lyrno] = tile->rawsize * jpc_fixtodbl(
+                         cp->tcp.ilyrrates[lyrno]);
+               }
+               tile->lyrsizes[tile->numlyrs - 1] = (cp->totalsize != UINT_FAST32_MAX) ?
+                 (rho * enc->mainbodysize) : UINT_FAST32_MAX;
+               for (lyrno = 0; lyrno < tile->numlyrs; ++lyrno) {
+                       if (tile->lyrsizes[lyrno] != UINT_FAST32_MAX) {
+                               if (tilehdrlen <= JAS_CAST(long, tile->lyrsizes[lyrno])) {
+                                       tile->lyrsizes[lyrno] -= tilehdrlen;
+                               } else {
+                                       tile->lyrsizes[lyrno] = 0;
+                               }
+                       }
+               }
+
+               if (rateallocate(enc, tile->numlyrs, tile->lyrsizes)) {
+                       return -1;
+               }
+
+#if 0
+jas_eprintf("ENCODE TILE DATA\n");
+#endif
+               if (jpc_enc_encodetiledata(enc)) {
+                       jas_eprintf("dotile failed\n");
+                       return -1;
+               }
+
+/************************************************************************/
+/************************************************************************/
+/************************************************************************/
+
+/************************************************************************/
+/************************************************************************/
+/************************************************************************/
+
+               tilelen = jas_stream_tell(enc->tmpstream);
+
+               if (jas_stream_seek(enc->tmpstream, 6, SEEK_SET) < 0) {
+                       return -1;
+               }
+               jpc_putuint32(enc->tmpstream, tilelen);
+
+               if (jas_stream_seek(enc->tmpstream, 0, SEEK_SET) < 0) {
+                       return -1;
+               }
+               if (jpc_putdata(enc->out, enc->tmpstream, -1)) {
+                       return -1;
+               }
+               enc->len += tilelen;
+
+               jas_stream_close(enc->tmpstream);
+               enc->tmpstream = 0;
+
+               jpc_enc_tile_destroy(enc->curtile);
+               enc->curtile = 0;
+
+       }
+
+       return 0;
+}
+
+int jpc_enc_encodetiledata(jpc_enc_t *enc)
+{
+assert(enc->tmpstream);
+       if (jpc_enc_encpkts(enc, enc->tmpstream)) {
+               return -1;
+       }
+       return 0;
+}
+
+int dump_passes(jpc_enc_pass_t *passes, int numpasses, jpc_enc_cblk_t *cblk)
+{
+       jpc_enc_pass_t *pass;
+       int i;
+       jas_stream_memobj_t *smo;
+
+       smo = cblk->stream->obj_;
+
+       pass = passes;
+       for (i = 0; i < numpasses; ++i) {
+               jas_eprintf("start=%d end=%d type=%d term=%d lyrno=%d firstchar=%02x size=%ld pos=%ld\n",
+                 (int)pass->start, (int)pass->end, (int)pass->type, (int)pass->term, (int)pass->lyrno,
+                 smo->buf_[pass->start], (long)smo->len_, (long)smo->pos_);
+#if 0
+               jas_memdump(stderr, &smo->buf_[pass->start], pass->end - pass->start);
+#endif
+               ++pass;
+       }
+       return 0;
+}
+
+void jpc_quantize(jas_matrix_t *data, jpc_fix_t stepsize)
+{
+       int i;
+       int j;
+       jpc_fix_t t;
+
+       if (stepsize == jpc_inttofix(1)) {
+               return;
+       }
+
+       for (i = 0; i < jas_matrix_numrows(data); ++i) {
+               for (j = 0; j < jas_matrix_numcols(data); ++j) {
+                       t = jas_matrix_get(data, i, j);
+
+{
+       if (t < 0) {
+               t = jpc_fix_neg(jpc_fix_div(jpc_fix_neg(t), stepsize));
+       } else {
+               t = jpc_fix_div(t, stepsize);
+       }
+}
+
+                       jas_matrix_set(data, i, j, t);
+               }
+       }
+}
+
+void calcrdslopes(jpc_enc_cblk_t *cblk)
+{
+       jpc_enc_pass_t *endpasses;
+       jpc_enc_pass_t *pass0;
+       jpc_enc_pass_t *pass1;
+       jpc_enc_pass_t *pass2;
+       jpc_flt_t slope0;
+       jpc_flt_t slope;
+       jpc_flt_t dd;
+       long dr;
+
+       endpasses = &cblk->passes[cblk->numpasses];
+       pass2 = cblk->passes;
+       slope0 = 0;
+       while (pass2 != endpasses) {
+               pass0 = 0;
+               for (pass1 = cblk->passes; pass1 != endpasses; ++pass1) {
+                       dd = pass1->cumwmsedec;
+                       dr = pass1->end;
+                       if (pass0) {
+                               dd -= pass0->cumwmsedec;
+                               dr -= pass0->end;
+                       }
+                       if (dd <= 0) {
+                               pass1->rdslope = JPC_BADRDSLOPE;
+                               if (pass1 >= pass2) {
+                                       pass2 = &pass1[1];
+                               }
+                               continue;
+                       }
+                       if (pass1 < pass2 && pass1->rdslope <= 0) {
+                               continue;
+                       }
+                       if (!dr) {
+                               assert(pass0);
+                               pass0->rdslope = 0;
+                               break;
+                       }
+                       slope = dd / dr;
+                       if (pass0 && slope >= slope0) {
+                               pass0->rdslope = 0;
+                               break;
+                       }
+                       pass1->rdslope = slope;
+                       if (pass1 >= pass2) {
+                               pass2 = &pass1[1];
+                       }
+                       pass0 = pass1;
+                       slope0 = slope;
+               }
+       }
+
+#if 0
+       for (pass0 = cblk->passes; pass0 != endpasses; ++pass0) {
+if (pass0->rdslope > 0.0) {
+               jas_eprintf("pass %02d nmsedec=%lf dec=%lf end=%d %lf\n", pass0 - cblk->passes,
+                 fixtodbl(pass0->nmsedec), pass0->wmsedec, pass0->end, pass0->rdslope);
+}
+       }
+#endif
+}
+
+void dump_layeringinfo(jpc_enc_t *enc)
+{
+
+       jpc_enc_tcmpt_t *tcmpt;
+       int tcmptno;
+       jpc_enc_rlvl_t *rlvl;
+       int rlvlno;
+       jpc_enc_band_t *band;
+       int bandno;
+       jpc_enc_prc_t *prc;
+       int prcno;
+       jpc_enc_cblk_t *cblk;
+       int cblkno;
+       jpc_enc_pass_t *pass;
+       int passno;
+       int lyrno;
+       jpc_enc_tile_t *tile;
+
+       tile = enc->curtile;
+
+       for (lyrno = 0; lyrno < tile->numlyrs; ++lyrno) {
+               jas_eprintf("lyrno = %02d\n", lyrno);
+               for (tcmptno = 0, tcmpt = tile->tcmpts; tcmptno < tile->numtcmpts;
+                 ++tcmptno, ++tcmpt) {
+                       for (rlvlno = 0, rlvl = tcmpt->rlvls; rlvlno < tcmpt->numrlvls;
+                         ++rlvlno, ++rlvl) {
+                               if (!rlvl->bands) {
+                                       continue;
+                               }
+                               for (bandno = 0, band = rlvl->bands; bandno < rlvl->numbands;
+                                 ++bandno, ++band) {
+                                       if (!band->data) {
+                                               continue;
+                                       }
+                                       for (prcno = 0, prc = band->prcs; prcno < rlvl->numprcs;
+                                         ++prcno, ++prc) {
+                                               if (!prc->cblks) {
+                                                       continue;
+                                               }
+                                               for (cblkno = 0, cblk = prc->cblks; cblkno <
+                                                 prc->numcblks; ++cblkno, ++cblk) {
+                                                       for (passno = 0, pass = cblk->passes; passno <
+                                                         cblk->numpasses && pass->lyrno == lyrno;
+                                                         ++passno, ++pass) {
+                                                               jas_eprintf("lyrno=%02d cmptno=%02d rlvlno=%02d bandno=%02d prcno=%02d cblkno=%03d passno=%03d\n", lyrno, tcmptno, rlvlno, bandno, prcno, cblkno, passno);
+                                                       }
+                                               }
+                                       }
+                               }
+                       }
+               }
+       }
+}
+
+int rateallocate(jpc_enc_t *enc, int numlyrs, uint_fast32_t *cumlens)
+{
+       jpc_flt_t lo;
+       jpc_flt_t hi;
+       jas_stream_t *out;
+       long cumlen;
+       int lyrno;
+       jpc_flt_t thresh;
+       jpc_flt_t goodthresh;
+       int success;
+       long pos;
+       long oldpos;
+       int numiters;
+
+       jpc_enc_tcmpt_t *comp;
+       jpc_enc_tcmpt_t *endcomps;
+       jpc_enc_rlvl_t *lvl;
+       jpc_enc_rlvl_t *endlvls;
+       jpc_enc_band_t *band;
+       jpc_enc_band_t *endbands;
+       jpc_enc_cblk_t *cblk;
+       jpc_enc_cblk_t *endcblks;
+       jpc_enc_pass_t *pass;
+       jpc_enc_pass_t *endpasses;
+       jpc_enc_pass_t *pass1;
+       jpc_flt_t mxrdslope;
+       jpc_flt_t mnrdslope;
+       jpc_enc_tile_t *tile;
+       jpc_enc_prc_t *prc;
+       int prcno;
+
+       tile = enc->curtile;
+
+       for (lyrno = 1; lyrno < numlyrs - 1; ++lyrno) {
+               if (cumlens[lyrno - 1] > cumlens[lyrno]) {
+                       abort();
+               }
+       }
+
+       if (!(out = jas_stream_memopen(0, 0))) {
+               return -1;
+       }
+
+
+       /* Find minimum and maximum R-D slope values. */
+       mnrdslope = DBL_MAX;
+       mxrdslope = 0;
+       endcomps = &tile->tcmpts[tile->numtcmpts];
+       for (comp = tile->tcmpts; comp != endcomps; ++comp) {
+               endlvls = &comp->rlvls[comp->numrlvls];
+               for (lvl = comp->rlvls; lvl != endlvls; ++lvl) {
+                       if (!lvl->bands) {
+                               continue;
+                       }
+                       endbands = &lvl->bands[lvl->numbands];
+                       for (band = lvl->bands; band != endbands; ++band) {
+                               if (!band->data) {
+                                       continue;
+                               }
+                               for (prcno = 0, prc = band->prcs; prcno < lvl->numprcs; ++prcno, ++prc) {
+                                       if (!prc->cblks) {
+                                               continue;
+                                       }
+                                       endcblks = &prc->cblks[prc->numcblks];
+                                       for (cblk = prc->cblks; cblk != endcblks; ++cblk) {
+                                               calcrdslopes(cblk);
+                                               endpasses = &cblk->passes[cblk->numpasses];
+                                               for (pass = cblk->passes; pass != endpasses; ++pass) {
+                                                       if (pass->rdslope > 0) {
+                                                               if (pass->rdslope < mnrdslope) {
+                                                                       mnrdslope = pass->rdslope;
+                                                               }
+                                                               if (pass->rdslope > mxrdslope) {
+                                                                       mxrdslope = pass->rdslope;
+                                                               }
+                                                       }
+                                               }
+                                       }
+                               }
+                       }
+               }
+       }
+if (jas_getdbglevel()) {
+       jas_eprintf("min rdslope = %f max rdslope = %f\n", mnrdslope, mxrdslope);
+}
+
+       jpc_init_t2state(enc, 1);
+
+       for (lyrno = 0; lyrno < numlyrs; ++lyrno) {
+
+               lo = mnrdslope;
+               hi = mxrdslope;
+
+               success = 0;
+               goodthresh = 0;
+               numiters = 0;
+
+               do {
+
+                       cumlen = cumlens[lyrno];
+                       if (cumlen == UINT_FAST32_MAX) {
+                               /* Only the last layer can be free of a rate
+                                 constraint (e.g., for lossless coding). */
+                               assert(lyrno == numlyrs - 1);
+                               goodthresh = -1;
+                               success = 1;
+                               break;
+                       }
+
+                       thresh = (lo + hi) / 2;
+
+                       /* Save the tier 2 coding state. */
+                       jpc_save_t2state(enc);
+                       oldpos = jas_stream_tell(out);
+                       assert(oldpos >= 0);
+
+                       /* Assign all passes with R-D slopes greater than or
+                         equal to the current threshold to this layer. */
+                       endcomps = &tile->tcmpts[tile->numtcmpts];
+                       for (comp = tile->tcmpts; comp != endcomps; ++comp) {
+                               endlvls = &comp->rlvls[comp->numrlvls];
+                               for (lvl = comp->rlvls; lvl != endlvls; ++lvl) {
+                                       if (!lvl->bands) {
+                                               continue;
+                                       }
+                                       endbands = &lvl->bands[lvl->numbands];
+                                       for (band = lvl->bands; band != endbands; ++band) {
+                                               if (!band->data) {
+                                                       continue;
+                                               }
+                                               for (prcno = 0, prc = band->prcs; prcno < lvl->numprcs; ++prcno, ++prc) {
+                                                       if (!prc->cblks) {
+                                                               continue;
+                                                       }
+                                                       endcblks = &prc->cblks[prc->numcblks];
+                                                       for (cblk = prc->cblks; cblk != endcblks; ++cblk) {
+                                                               if (cblk->curpass) {
+                                                                       endpasses = &cblk->passes[cblk->numpasses];
+                                                                       pass1 = cblk->curpass;
+                                                                       for (pass = cblk->curpass; pass != endpasses; ++pass) {
+                                                                               if (pass->rdslope >= thresh) {
+                                                                                       pass1 = &pass[1];
+                                                                               }
+                                                                       }
+                                                                       for (pass = cblk->curpass; pass != pass1; ++pass) {
+                                                                               pass->lyrno = lyrno;
+                                                                       }
+                                                                       for (; pass != endpasses; ++pass) {
+                                                                               pass->lyrno = -1;
+                                                                       }
+                                                               }
+                                                       }
+                                               }
+                                       }
+                               }
+                       }
+
+                       /* Perform tier 2 coding. */
+                       endcomps = &tile->tcmpts[tile->numtcmpts];
+                       for (comp = tile->tcmpts; comp != endcomps; ++comp) {
+                               endlvls = &comp->rlvls[comp->numrlvls];
+                               for (lvl = comp->rlvls; lvl != endlvls; ++lvl) {
+                                       if (!lvl->bands) {
+                                               continue;
+                                       }
+                                       for (prcno = 0; prcno < lvl->numprcs; ++prcno) {
+                                               if (jpc_enc_encpkt(enc, out, comp - tile->tcmpts, lvl - comp->rlvls, prcno, lyrno)) {
+                                                       return -1;
+                                               }
+                                       }
+                               }
+                       }
+
+                       pos = jas_stream_tell(out);
+
+                       /* Check the rate constraint. */
+                       assert(pos >= 0);
+                       if (pos > cumlen) {
+                               /* The rate is too high. */
+                               lo = thresh;
+                       } else if (pos <= cumlen) {
+                               /* The rate is low enough, so try higher. */
+                               hi = thresh;
+                               if (!success || thresh < goodthresh) {
+                                       goodthresh = thresh;
+                                       success = 1;
+                               }
+                       }
+
+                       /* Save the tier 2 coding state. */
+                       jpc_restore_t2state(enc);
+                       if (jas_stream_seek(out, oldpos, SEEK_SET) < 0) {
+                               abort();
+                       }
+
+if (jas_getdbglevel()) {
+jas_eprintf("maxlen=%08ld actuallen=%08ld thresh=%f\n", cumlen, pos, thresh);
+}
+
+                       ++numiters;
+               } while (lo < hi - 1e-3 && numiters < 32);
+
+               if (!success) {
+                       jas_eprintf("warning: empty layer generated\n");
+               }
+
+if (jas_getdbglevel()) {
+jas_eprintf("success %d goodthresh %f\n", success, goodthresh);
+}
+
+               /* Assign all passes with R-D slopes greater than or
+                 equal to the selected threshold to this layer. */
+               endcomps = &tile->tcmpts[tile->numtcmpts];
+               for (comp = tile->tcmpts; comp != endcomps; ++comp) {
+                       endlvls = &comp->rlvls[comp->numrlvls];
+                       for (lvl = comp->rlvls; lvl != endlvls; ++lvl) {
+if (!lvl->bands) {
+       continue;
+}
+                               endbands = &lvl->bands[lvl->numbands];
+                               for (band = lvl->bands; band != endbands; ++band) {
+                                       if (!band->data) {
+                                               continue;
+                                       }
+                                       for (prcno = 0, prc = band->prcs; prcno < lvl->numprcs; ++prcno, ++prc) {
+                                               if (!prc->cblks) {
+                                                       continue;
+                                               }
+                                               endcblks = &prc->cblks[prc->numcblks];
+                                               for (cblk = prc->cblks; cblk != endcblks; ++cblk) {
+                                                       if (cblk->curpass) {
+                                                               endpasses = &cblk->passes[cblk->numpasses];
+                                                               pass1 = cblk->curpass;
+                                                               if (success) {
+                                                                       for (pass = cblk->curpass; pass != endpasses; ++pass) {
+                                                                               if (pass->rdslope >= goodthresh) {
+                                                                                       pass1 = &pass[1];
+                                                                               }
+                                                                       }
+                                                               }
+                                                               for (pass = cblk->curpass; pass != pass1; ++pass) {
+                                                                       pass->lyrno = lyrno;
+                                                               }
+                                                               for (; pass != endpasses; ++pass) {
+                                                                       pass->lyrno = -1;
+                                                               }
+                                                       }
+                                               }
+                                       }
+                               }
+                       }
+               }
+
+               /* Perform tier 2 coding. */
+               endcomps = &tile->tcmpts[tile->numtcmpts];
+               for (comp = tile->tcmpts; comp != endcomps; ++comp) {
+                       endlvls = &comp->rlvls[comp->numrlvls];
+                       for (lvl = comp->rlvls; lvl != endlvls; ++lvl) {
+                               if (!lvl->bands) {
+                                       continue;
+                               }
+                               for (prcno = 0; prcno < lvl->numprcs; ++prcno) {
+                                       if (jpc_enc_encpkt(enc, out, comp - tile->tcmpts, lvl - comp->rlvls, prcno, lyrno)) {
+                                               return -1;
+                                       }
+                               }
+                       }
+               }
+       }
+
+       if (jas_getdbglevel() >= 5) {
+               dump_layeringinfo(enc);
+       }
+
+       jas_stream_close(out);
+
+       JAS_DBGLOG(10, ("done doing rateallocation\n"));
+#if 0
+jas_eprintf("DONE RATE ALLOCATE\n");
+#endif
+
+       return 0;
+}
+
+/******************************************************************************\
+* Tile constructors and destructors.
+\******************************************************************************/
+
+jpc_enc_tile_t *jpc_enc_tile_create(jpc_enc_cp_t *cp, jas_image_t *image, int tileno)
+{
+       jpc_enc_tile_t *tile;
+       uint_fast32_t htileno;
+       uint_fast32_t vtileno;
+       uint_fast16_t lyrno;
+       uint_fast16_t cmptno;
+       jpc_enc_tcmpt_t *tcmpt;
+
+       if (!(tile = jas_malloc(sizeof(jpc_enc_tile_t)))) {
+               goto error;
+       }
+
+       /* Initialize a few members used in error recovery. */
+       tile->tcmpts = 0;
+       tile->lyrsizes = 0;
+       tile->numtcmpts = cp->numcmpts;
+       tile->pi = 0;
+
+       tile->tileno = tileno;
+       htileno = tileno % cp->numhtiles;
+       vtileno = tileno / cp->numhtiles;
+
+       /* Calculate the coordinates of the top-left and bottom-right
+         corners of the tile. */
+       tile->tlx = JAS_MAX(cp->tilegrdoffx + htileno * cp->tilewidth,
+         cp->imgareatlx);
+       tile->tly = JAS_MAX(cp->tilegrdoffy + vtileno * cp->tileheight,
+         cp->imgareatly);
+       tile->brx = JAS_MIN(cp->tilegrdoffx + (htileno + 1) * cp->tilewidth,
+         cp->refgrdwidth);
+       tile->bry = JAS_MIN(cp->tilegrdoffy + (vtileno + 1) * cp->tileheight,
+         cp->refgrdheight);
+
+       /* Initialize some tile coding parameters. */
+       tile->intmode = cp->tcp.intmode;
+       tile->csty = cp->tcp.csty;
+       tile->prg = cp->tcp.prg;
+       tile->mctid = cp->tcp.mctid;
+
+       tile->numlyrs = cp->tcp.numlyrs;
+       if (!(tile->lyrsizes = jas_malloc(tile->numlyrs *
+         sizeof(uint_fast32_t)))) {
+               goto error;
+       }
+       for (lyrno = 0; lyrno < tile->numlyrs; ++lyrno) {
+               tile->lyrsizes[lyrno] = 0;
+       }
+
+       /* Allocate an array for the per-tile-component information. */
+       if (!(tile->tcmpts = jas_malloc(cp->numcmpts * sizeof(jpc_enc_tcmpt_t)))) {
+               goto error;
+       }
+       /* Initialize a few members critical for error recovery. */
+       for (cmptno = 0, tcmpt = tile->tcmpts; cmptno < cp->numcmpts;
+         ++cmptno, ++tcmpt) {
+               tcmpt->rlvls = 0;
+               tcmpt->tsfb = 0;
+               tcmpt->data = 0;
+       }
+       /* Initialize the per-tile-component information. */
+       for (cmptno = 0, tcmpt = tile->tcmpts; cmptno < cp->numcmpts;
+         ++cmptno, ++tcmpt) {
+               if (!tcmpt_create(tcmpt, cp, image, tile)) {
+                       goto error;
+               }
+       }
+
+       /* Initialize the synthesis weights for the MCT. */
+       switch (tile->mctid) {
+       case JPC_MCT_RCT:
+               tile->tcmpts[0].synweight = jpc_dbltofix(sqrt(3.0));
+               tile->tcmpts[1].synweight = jpc_dbltofix(sqrt(0.6875));
+               tile->tcmpts[2].synweight = jpc_dbltofix(sqrt(0.6875));
+               break;
+       case JPC_MCT_ICT:
+               tile->tcmpts[0].synweight = jpc_dbltofix(sqrt(3.0000));
+               tile->tcmpts[1].synweight = jpc_dbltofix(sqrt(3.2584));
+               tile->tcmpts[2].synweight = jpc_dbltofix(sqrt(2.4755));
+               break;
+       default:
+       case JPC_MCT_NONE:
+               for (cmptno = 0, tcmpt = tile->tcmpts; cmptno < cp->numcmpts;
+                 ++cmptno, ++tcmpt) {
+                       tcmpt->synweight = JPC_FIX_ONE;
+               }
+               break;
+       }
+
+       if (!(tile->pi = jpc_enc_pi_create(cp, tile))) {
+               goto error;
+       }
+
+       return tile;
+
+error:
+
+       if (tile) {
+               jpc_enc_tile_destroy(tile);
+       }
+       return 0;
+}
+
+void jpc_enc_tile_destroy(jpc_enc_tile_t *tile)
+{
+       jpc_enc_tcmpt_t *tcmpt;
+       uint_fast16_t cmptno;
+
+       if (tile->tcmpts) {
+               for (cmptno = 0, tcmpt = tile->tcmpts; cmptno <
+                 tile->numtcmpts; ++cmptno, ++tcmpt) {
+                       tcmpt_destroy(tcmpt);
+               }
+               jas_free(tile->tcmpts);
+       }
+       if (tile->lyrsizes) {
+               jas_free(tile->lyrsizes);
+       }
+       if (tile->pi) {
+               jpc_pi_destroy(tile->pi);
+       }
+       jas_free(tile);
+}
+
+static jpc_enc_tcmpt_t *tcmpt_create(jpc_enc_tcmpt_t *tcmpt, jpc_enc_cp_t *cp,
+  jas_image_t *image, jpc_enc_tile_t *tile)
+{
+       uint_fast16_t cmptno;
+       uint_fast16_t rlvlno;
+       jpc_enc_rlvl_t *rlvl;
+       uint_fast32_t tlx;
+       uint_fast32_t tly;
+       uint_fast32_t brx;
+       uint_fast32_t bry;
+       uint_fast32_t cmpttlx;
+       uint_fast32_t cmpttly;
+       jpc_enc_ccp_t *ccp;
+       jpc_tsfb_band_t bandinfos[JPC_MAXBANDS];
+
+       tcmpt->tile = tile;
+       tcmpt->tsfb = 0;
+       tcmpt->data = 0;
+       tcmpt->rlvls = 0;
+
+       /* Deduce the component number. */
+       cmptno = tcmpt - tile->tcmpts;
+
+       ccp = &cp->ccps[cmptno];
+
+       /* Compute the coordinates of the top-left and bottom-right
+         corners of this tile-component. */
+       tlx = JPC_CEILDIV(tile->tlx, ccp->sampgrdstepx);
+       tly = JPC_CEILDIV(tile->tly, ccp->sampgrdstepy);
+       brx = JPC_CEILDIV(tile->brx, ccp->sampgrdstepx);
+       bry = JPC_CEILDIV(tile->bry, ccp->sampgrdstepy);
+
+       /* Create a sequence to hold the tile-component sample data. */
+       if (!(tcmpt->data = jas_seq2d_create(tlx, tly, brx, bry))) {
+               goto error;
+       }
+
+       /* Get the image data associated with this tile-component. */
+       cmpttlx = JPC_CEILDIV(cp->imgareatlx, ccp->sampgrdstepx);
+       cmpttly = JPC_CEILDIV(cp->imgareatly, ccp->sampgrdstepy);
+       if (jas_image_readcmpt(image, cmptno, tlx - cmpttlx, tly - cmpttly,
+         brx - tlx, bry - tly, tcmpt->data)) {
+               goto error;
+       }
+
+       tcmpt->synweight = 0;
+       tcmpt->qmfbid = cp->tccp.qmfbid;
+       tcmpt->numrlvls = cp->tccp.maxrlvls;
+       tcmpt->numbands = 3 * tcmpt->numrlvls - 2;
+       if (!(tcmpt->tsfb = jpc_cod_gettsfb(tcmpt->qmfbid, tcmpt->numrlvls - 1))) {
+               goto error;
+       }
+
+       for (rlvlno = 0; rlvlno < tcmpt->numrlvls; ++rlvlno) {
+               tcmpt->prcwidthexpns[rlvlno] = cp->tccp.prcwidthexpns[rlvlno];
+               tcmpt->prcheightexpns[rlvlno] = cp->tccp.prcheightexpns[rlvlno];
+       }
+       tcmpt->cblkwidthexpn = cp->tccp.cblkwidthexpn;
+       tcmpt->cblkheightexpn = cp->tccp.cblkheightexpn;
+       tcmpt->cblksty = cp->tccp.cblksty;
+       tcmpt->csty = cp->tccp.csty;
+
+       tcmpt->numstepsizes = tcmpt->numbands;
+       assert(tcmpt->numstepsizes <= JPC_MAXBANDS);
+       memset(tcmpt->stepsizes, 0, sizeof(tcmpt->numstepsizes *
+         sizeof(uint_fast16_t)));
+
+       /* Retrieve information about the various bands. */
+       jpc_tsfb_getbands(tcmpt->tsfb, jas_seq2d_xstart(tcmpt->data),
+         jas_seq2d_ystart(tcmpt->data), jas_seq2d_xend(tcmpt->data),
+         jas_seq2d_yend(tcmpt->data), bandinfos);
+
+       if (!(tcmpt->rlvls = jas_malloc(tcmpt->numrlvls * sizeof(jpc_enc_rlvl_t)))) {
+               goto error;
+       }
+       for (rlvlno = 0, rlvl = tcmpt->rlvls; rlvlno < tcmpt->numrlvls;
+         ++rlvlno, ++rlvl) {
+               rlvl->bands = 0;
+               rlvl->tcmpt = tcmpt;
+       }
+       for (rlvlno = 0, rlvl = tcmpt->rlvls; rlvlno < tcmpt->numrlvls;
+         ++rlvlno, ++rlvl) {
+               if (!rlvl_create(rlvl, cp, tcmpt, bandinfos)) {
+                       goto error;
+               }
+       }
+
+       return tcmpt;
+
+error:
+
+       tcmpt_destroy(tcmpt);
+       return 0;
+
+}
+
+static void tcmpt_destroy(jpc_enc_tcmpt_t *tcmpt)
+{
+       jpc_enc_rlvl_t *rlvl;
+       uint_fast16_t rlvlno;
+
+       if (tcmpt->rlvls) {
+               for (rlvlno = 0, rlvl = tcmpt->rlvls; rlvlno < tcmpt->numrlvls;
+                 ++rlvlno, ++rlvl) {
+                       rlvl_destroy(rlvl);
+               }
+               jas_free(tcmpt->rlvls);
+       }
+
+       if (tcmpt->data) {
+               jas_seq2d_destroy(tcmpt->data);
+       }
+       if (tcmpt->tsfb) {
+               jpc_tsfb_destroy(tcmpt->tsfb);
+       }
+}
+
+static jpc_enc_rlvl_t *rlvl_create(jpc_enc_rlvl_t *rlvl, jpc_enc_cp_t *cp,
+  jpc_enc_tcmpt_t *tcmpt, jpc_tsfb_band_t *bandinfos)
+{
+       uint_fast16_t rlvlno;
+       uint_fast32_t tlprctlx;
+       uint_fast32_t tlprctly;
+       uint_fast32_t brprcbrx;
+       uint_fast32_t brprcbry;
+       uint_fast16_t bandno;
+       jpc_enc_band_t *band;
+
+       /* Deduce the resolution level. */
+       rlvlno = rlvl - tcmpt->rlvls;
+
+       /* Initialize members required for error recovery. */
+       rlvl->bands = 0;
+       rlvl->tcmpt = tcmpt;
+
+       /* Compute the coordinates of the top-left and bottom-right
+         corners of the tile-component at this resolution. */
+       rlvl->tlx = JPC_CEILDIVPOW2(jas_seq2d_xstart(tcmpt->data), tcmpt->numrlvls -
+         1 - rlvlno);
+       rlvl->tly = JPC_CEILDIVPOW2(jas_seq2d_ystart(tcmpt->data), tcmpt->numrlvls -
+         1 - rlvlno);
+       rlvl->brx = JPC_CEILDIVPOW2(jas_seq2d_xend(tcmpt->data), tcmpt->numrlvls -
+         1 - rlvlno);
+       rlvl->bry = JPC_CEILDIVPOW2(jas_seq2d_yend(tcmpt->data), tcmpt->numrlvls -
+         1 - rlvlno);
+
+       if (rlvl->tlx >= rlvl->brx || rlvl->tly >= rlvl->bry) {
+               rlvl->numhprcs = 0;
+               rlvl->numvprcs = 0;
+               rlvl->numprcs = 0;
+               return rlvl;
+       }
+
+       rlvl->numbands = (!rlvlno) ? 1 : 3;
+       rlvl->prcwidthexpn = cp->tccp.prcwidthexpns[rlvlno];
+       rlvl->prcheightexpn = cp->tccp.prcheightexpns[rlvlno];
+       if (!rlvlno) {
+               rlvl->cbgwidthexpn = rlvl->prcwidthexpn;
+               rlvl->cbgheightexpn = rlvl->prcheightexpn;
+       } else {
+               rlvl->cbgwidthexpn = rlvl->prcwidthexpn - 1;
+               rlvl->cbgheightexpn = rlvl->prcheightexpn - 1;
+       }
+       rlvl->cblkwidthexpn = JAS_MIN(cp->tccp.cblkwidthexpn, rlvl->cbgwidthexpn);
+       rlvl->cblkheightexpn = JAS_MIN(cp->tccp.cblkheightexpn, rlvl->cbgheightexpn);
+
+       /* Compute the number of precincts. */
+       tlprctlx = JPC_FLOORTOMULTPOW2(rlvl->tlx, rlvl->prcwidthexpn);
+       tlprctly = JPC_FLOORTOMULTPOW2(rlvl->tly, rlvl->prcheightexpn);
+       brprcbrx = JPC_CEILTOMULTPOW2(rlvl->brx, rlvl->prcwidthexpn);
+       brprcbry = JPC_CEILTOMULTPOW2(rlvl->bry, rlvl->prcheightexpn);
+       rlvl->numhprcs = JPC_FLOORDIVPOW2(brprcbrx - tlprctlx, rlvl->prcwidthexpn);
+       rlvl->numvprcs = JPC_FLOORDIVPOW2(brprcbry - tlprctly, rlvl->prcheightexpn);
+       rlvl->numprcs = rlvl->numhprcs * rlvl->numvprcs;
+
+       if (!(rlvl->bands = jas_malloc(rlvl->numbands * sizeof(jpc_enc_band_t)))) {
+               goto error;
+       }
+       for (bandno = 0, band = rlvl->bands; bandno < rlvl->numbands;
+         ++bandno, ++band) {
+               band->prcs = 0;
+               band->data = 0;
+               band->rlvl = rlvl;
+       }
+       for (bandno = 0, band = rlvl->bands; bandno < rlvl->numbands;
+         ++bandno, ++band) {
+               if (!band_create(band, cp, rlvl, bandinfos)) {
+                       goto error;
+               }
+       }
+
+       return rlvl;
+error:
+
+       rlvl_destroy(rlvl);
+       return 0;
+}
+
+static void rlvl_destroy(jpc_enc_rlvl_t *rlvl)
+{
+       jpc_enc_band_t *band;
+       uint_fast16_t bandno;
+
+       if (rlvl->bands) {
+               for (bandno = 0, band = rlvl->bands; bandno < rlvl->numbands;
+                 ++bandno, ++band) {
+                       band_destroy(band);
+               }
+               jas_free(rlvl->bands);
+       }
+}
+
+static jpc_enc_band_t *band_create(jpc_enc_band_t *band, jpc_enc_cp_t *cp,
+  jpc_enc_rlvl_t *rlvl, jpc_tsfb_band_t *bandinfos)
+{
+       uint_fast16_t bandno;
+       uint_fast16_t gblbandno;
+       uint_fast16_t rlvlno;
+       jpc_tsfb_band_t *bandinfo;
+       jpc_enc_tcmpt_t *tcmpt;
+       uint_fast32_t prcno;
+       jpc_enc_prc_t *prc;
+
+       tcmpt = rlvl->tcmpt;
+       band->data = 0;
+       band->prcs = 0;
+       band->rlvl = rlvl;
+
+       /* Deduce the resolution level and band number. */
+       rlvlno = rlvl - rlvl->tcmpt->rlvls;
+       bandno = band - rlvl->bands;
+       gblbandno = (!rlvlno) ? 0 : (3 * (rlvlno - 1) + bandno + 1);
+
+       bandinfo = &bandinfos[gblbandno];
+
+if (bandinfo->xstart != bandinfo->xend && bandinfo->ystart != bandinfo->yend) {
+       if (!(band->data = jas_seq2d_create(0, 0, 0, 0))) {
+               goto error;
+       }
+       jas_seq2d_bindsub(band->data, tcmpt->data, bandinfo->locxstart,
+         bandinfo->locystart, bandinfo->locxend, bandinfo->locyend);
+       jas_seq2d_setshift(band->data, bandinfo->xstart, bandinfo->ystart);
+}
+       band->orient = bandinfo->orient;
+       band->analgain = JPC_NOMINALGAIN(cp->tccp.qmfbid, tcmpt->numrlvls, rlvlno,
+         band->orient);
+       band->numbps = 0;
+       band->absstepsize = 0;
+       band->stepsize = 0;
+       band->synweight = bandinfo->synenergywt;
+
+if (band->data) {
+       if (!(band->prcs = jas_malloc(rlvl->numprcs * sizeof(jpc_enc_prc_t)))) {
+               goto error;
+       }
+       for (prcno = 0, prc = band->prcs; prcno < rlvl->numprcs; ++prcno,
+         ++prc) {
+               prc->cblks = 0;
+               prc->incltree = 0;
+               prc->nlibtree = 0;
+               prc->savincltree = 0;
+               prc->savnlibtree = 0;
+               prc->band = band;
+       }
+       for (prcno = 0, prc = band->prcs; prcno < rlvl->numprcs; ++prcno,
+         ++prc) {
+               if (!prc_create(prc, cp, band)) {
+                       goto error;
+               }
+       }
+}
+
+       return band;
+
+error:
+       band_destroy(band);
+       return 0;
+}
+
+static void band_destroy(jpc_enc_band_t *band)
+{
+       jpc_enc_prc_t *prc;
+       jpc_enc_rlvl_t *rlvl;
+       uint_fast32_t prcno;
+
+       if (band->prcs) {
+               rlvl = band->rlvl;
+               for (prcno = 0, prc = band->prcs; prcno < rlvl->numprcs;
+                 ++prcno, ++prc) {
+                       prc_destroy(prc);
+               }
+               jas_free(band->prcs);
+       }
+       if (band->data) {
+               jas_seq2d_destroy(band->data);
+       }
+}
+
+static jpc_enc_prc_t *prc_create(jpc_enc_prc_t *prc, jpc_enc_cp_t *cp, jpc_enc_band_t *band)
+{
+       uint_fast32_t prcno;
+       uint_fast32_t prcxind;
+       uint_fast32_t prcyind;
+       uint_fast32_t cbgtlx;
+       uint_fast32_t cbgtly;
+       uint_fast32_t tlprctlx;
+       uint_fast32_t tlprctly;
+       uint_fast32_t tlcbgtlx;
+       uint_fast32_t tlcbgtly;
+       uint_fast16_t rlvlno;
+       jpc_enc_rlvl_t *rlvl;
+       uint_fast32_t tlcblktlx;
+       uint_fast32_t tlcblktly;
+       uint_fast32_t brcblkbrx;
+       uint_fast32_t brcblkbry;
+       uint_fast32_t cblkno;
+       jpc_enc_cblk_t *cblk;
+       jpc_enc_tcmpt_t *tcmpt;
+
+       prc->cblks = 0;
+       prc->incltree = 0;
+       prc->savincltree = 0;
+       prc->nlibtree = 0;
+       prc->savnlibtree = 0;
+
+       rlvl = band->rlvl;
+       tcmpt = rlvl->tcmpt;
+rlvlno = rlvl - tcmpt->rlvls;
+       prcno = prc - band->prcs;
+       prcxind = prcno % rlvl->numhprcs;
+       prcyind = prcno / rlvl->numhprcs;
+       prc->band = band;
+
+tlprctlx = JPC_FLOORTOMULTPOW2(rlvl->tlx, rlvl->prcwidthexpn);
+tlprctly = JPC_FLOORTOMULTPOW2(rlvl->tly, rlvl->prcheightexpn);
+if (!rlvlno) {
+       tlcbgtlx = tlprctlx;
+       tlcbgtly = tlprctly;
+} else {
+       tlcbgtlx = JPC_CEILDIVPOW2(tlprctlx, 1);
+       tlcbgtly = JPC_CEILDIVPOW2(tlprctly, 1);
+}
+
+       /* Compute the coordinates of the top-left and bottom-right
+         corners of the precinct. */
+       cbgtlx = tlcbgtlx + (prcxind << rlvl->cbgwidthexpn);
+       cbgtly = tlcbgtly + (prcyind << rlvl->cbgheightexpn);
+       prc->tlx = JAS_MAX(jas_seq2d_xstart(band->data), cbgtlx);
+       prc->tly = JAS_MAX(jas_seq2d_ystart(band->data), cbgtly);
+       prc->brx = JAS_MIN(jas_seq2d_xend(band->data), cbgtlx +
+         (1 << rlvl->cbgwidthexpn));
+       prc->bry = JAS_MIN(jas_seq2d_yend(band->data), cbgtly +
+         (1 << rlvl->cbgheightexpn));
+
+       if (prc->tlx < prc->brx && prc->tly < prc->bry) {
+               /* The precinct contains at least one code block. */
+
+               tlcblktlx = JPC_FLOORTOMULTPOW2(prc->tlx, rlvl->cblkwidthexpn);
+               tlcblktly = JPC_FLOORTOMULTPOW2(prc->tly, rlvl->cblkheightexpn);
+               brcblkbrx = JPC_CEILTOMULTPOW2(prc->brx, rlvl->cblkwidthexpn);
+               brcblkbry = JPC_CEILTOMULTPOW2(prc->bry, rlvl->cblkheightexpn);
+               prc->numhcblks = JPC_FLOORDIVPOW2(brcblkbrx - tlcblktlx,
+                 rlvl->cblkwidthexpn);
+               prc->numvcblks = JPC_FLOORDIVPOW2(brcblkbry - tlcblktly,
+                 rlvl->cblkheightexpn);
+               prc->numcblks = prc->numhcblks * prc->numvcblks;
+
+               if (!(prc->incltree = jpc_tagtree_create(prc->numhcblks,
+                 prc->numvcblks))) {
+                       goto error;
+               }
+               if (!(prc->nlibtree = jpc_tagtree_create(prc->numhcblks,
+                 prc->numvcblks))) {
+                       goto error;
+               }
+               if (!(prc->savincltree = jpc_tagtree_create(prc->numhcblks,
+                 prc->numvcblks))) {
+                       goto error;
+               }
+               if (!(prc->savnlibtree = jpc_tagtree_create(prc->numhcblks,
+                 prc->numvcblks))) {
+                       goto error;
+               }
+
+               if (!(prc->cblks = jas_malloc(prc->numcblks * sizeof(jpc_enc_cblk_t)))) {
+                       goto error;
+               }
+               for (cblkno = 0, cblk = prc->cblks; cblkno < prc->numcblks;
+                 ++cblkno, ++cblk) {
+                       cblk->passes = 0;
+                       cblk->stream = 0;
+                       cblk->mqenc = 0;
+                       cblk->data = 0;
+                       cblk->flags = 0;
+                       cblk->prc = prc;
+               }
+               for (cblkno = 0, cblk = prc->cblks; cblkno < prc->numcblks;
+                 ++cblkno, ++cblk) {
+                       if (!cblk_create(cblk, cp, prc)) {
+                               goto error;
+                       }
+               }
+       } else {
+               /* The precinct does not contain any code blocks. */
+               prc->tlx = prc->brx;
+               prc->tly = prc->bry;
+               prc->numcblks = 0;
+               prc->numhcblks = 0;
+               prc->numvcblks = 0;
+               prc->cblks = 0;
+               prc->incltree = 0;
+               prc->nlibtree = 0;
+               prc->savincltree = 0;
+               prc->savnlibtree = 0;
+       }
+
+       return prc;
+
+error:
+       prc_destroy(prc);
+       return 0;
+}
+
+static void prc_destroy(jpc_enc_prc_t *prc)
+{
+       jpc_enc_cblk_t *cblk;
+       uint_fast32_t cblkno;
+
+       if (prc->cblks) {
+               for (cblkno = 0, cblk = prc->cblks; cblkno < prc->numcblks;
+                 ++cblkno, ++cblk) {
+                       cblk_destroy(cblk);
+               }
+               jas_free(prc->cblks);
+       }
+       if (prc->incltree) {
+               jpc_tagtree_destroy(prc->incltree);
+       }
+       if (prc->nlibtree) {
+               jpc_tagtree_destroy(prc->nlibtree);
+       }
+       if (prc->savincltree) {
+               jpc_tagtree_destroy(prc->savincltree);
+       }
+       if (prc->savnlibtree) {
+               jpc_tagtree_destroy(prc->savnlibtree);
+       }
+}
+
+static jpc_enc_cblk_t *cblk_create(jpc_enc_cblk_t *cblk, jpc_enc_cp_t *cp, jpc_enc_prc_t *prc)
+{
+       jpc_enc_band_t *band;
+       uint_fast32_t cblktlx;
+       uint_fast32_t cblktly;
+       uint_fast32_t cblkbrx;
+       uint_fast32_t cblkbry;
+       jpc_enc_rlvl_t *rlvl;
+       uint_fast32_t cblkxind;
+       uint_fast32_t cblkyind;
+       uint_fast32_t cblkno;
+       uint_fast32_t tlcblktlx;
+       uint_fast32_t tlcblktly;
+
+       cblkno = cblk - prc->cblks;
+       cblkxind = cblkno % prc->numhcblks;
+       cblkyind = cblkno / prc->numhcblks;
+       rlvl = prc->band->rlvl;
+       cblk->prc = prc;
+
+       cblk->numpasses = 0;
+       cblk->passes = 0;
+       cblk->numencpasses = 0;
+       cblk->numimsbs = 0;
+       cblk->numlenbits = 0;
+       cblk->stream = 0;
+       cblk->mqenc = 0;
+       cblk->flags = 0;
+       cblk->numbps = 0;
+       cblk->curpass = 0;
+       cblk->data = 0;
+       cblk->savedcurpass = 0;
+       cblk->savednumlenbits = 0;
+       cblk->savednumencpasses = 0;
+
+       band = prc->band;
+       tlcblktlx = JPC_FLOORTOMULTPOW2(prc->tlx, rlvl->cblkwidthexpn);
+       tlcblktly = JPC_FLOORTOMULTPOW2(prc->tly, rlvl->cblkheightexpn);
+       cblktlx = JAS_MAX(tlcblktlx + (cblkxind << rlvl->cblkwidthexpn), prc->tlx);
+       cblktly = JAS_MAX(tlcblktly + (cblkyind << rlvl->cblkheightexpn), prc->tly);
+       cblkbrx = JAS_MIN(tlcblktlx + ((cblkxind + 1) << rlvl->cblkwidthexpn),
+         prc->brx);
+       cblkbry = JAS_MIN(tlcblktly + ((cblkyind + 1) << rlvl->cblkheightexpn),
+         prc->bry);
+
+       assert(cblktlx < cblkbrx && cblktly < cblkbry);
+       if (!(cblk->data = jas_seq2d_create(0, 0, 0, 0))) {
+               goto error;
+       }
+       jas_seq2d_bindsub(cblk->data, band->data, cblktlx, cblktly, cblkbrx, cblkbry);
+
+       return cblk;
+
+error:
+       cblk_destroy(cblk);
+       return 0;
+}
+
+static void cblk_destroy(jpc_enc_cblk_t *cblk)
+{
+       uint_fast16_t passno;
+       jpc_enc_pass_t *pass;
+       if (cblk->passes) {
+               for (passno = 0, pass = cblk->passes; passno < cblk->numpasses;
+                 ++passno, ++pass) {
+                       pass_destroy(pass);
+               }
+               jas_free(cblk->passes);
+       }
+       if (cblk->stream) {
+               jas_stream_close(cblk->stream);
+       }
+       if (cblk->mqenc) {
+               jpc_mqenc_destroy(cblk->mqenc);
+       }
+       if (cblk->data) {
+               jas_seq2d_destroy(cblk->data);
+       }
+       if (cblk->flags) {
+               jas_seq2d_destroy(cblk->flags);
+       }
+}
+
+static void pass_destroy(jpc_enc_pass_t *pass)
+{
+       /* XXX - need to free resources here */
+}
+
+void jpc_enc_dump(jpc_enc_t *enc)
+{
+       jpc_enc_tile_t *tile;
+       jpc_enc_tcmpt_t *tcmpt;
+       jpc_enc_rlvl_t *rlvl;
+       jpc_enc_band_t *band;
+       jpc_enc_prc_t *prc;
+       jpc_enc_cblk_t *cblk;
+       uint_fast16_t cmptno;
+       uint_fast16_t rlvlno;
+       uint_fast16_t bandno;
+       uint_fast32_t prcno;
+       uint_fast32_t cblkno;
+
+       tile = enc->curtile;
+
+       for (cmptno = 0, tcmpt = tile->tcmpts; cmptno < tile->numtcmpts; ++cmptno,
+         ++tcmpt) {
+               jas_eprintf("  tcmpt %5d %5d %5d %5d\n", jas_seq2d_xstart(tcmpt->data), jas_seq2d_ystart(tcmpt->data), jas_seq2d_xend(tcmpt->data), jas_seq2d_yend(tcmpt->data));
+               for (rlvlno = 0, rlvl = tcmpt->rlvls; rlvlno < tcmpt->numrlvls;
+                 ++rlvlno, ++rlvl) {
+                       jas_eprintf("    rlvl %5d %5d %5d %5d\n", rlvl->tlx, rlvl->tly, rlvl->brx, rlvl->bry);
+                       for (bandno = 0, band = rlvl->bands; bandno < rlvl->numbands;
+                         ++bandno, ++band) {
+                               if (!band->data) {
+                                       continue;
+                               }
+                               jas_eprintf("      band %5d %5d %5d %5d\n", jas_seq2d_xstart(band->data), jas_seq2d_ystart(band->data), jas_seq2d_xend(band->data), jas_seq2d_yend(band->data));
+                               for (prcno = 0, prc = band->prcs; prcno < rlvl->numprcs;
+                                 ++prcno, ++prc) {
+                                       jas_eprintf("        prc %5d %5d %5d %5d (%5d %5d)\n", prc->tlx, prc->tly, prc->brx, prc->bry, prc->brx - prc->tlx, prc->bry - prc->tly);
+                                       if (!prc->cblks) {
+                                               continue;
+                                       }
+                                       for (cblkno = 0, cblk = prc->cblks; cblkno < prc->numcblks;
+                                         ++cblkno, ++cblk) {
+                                               jas_eprintf("         cblk %5d %5d %5d %5d\n", jas_seq2d_xstart(cblk->data), jas_seq2d_ystart(cblk->data), jas_seq2d_xend(cblk->data), jas_seq2d_yend(cblk->data));
+                                       }
+                               }
+                       }
+               }
+       }
+}
diff --git a/src/libjasper/jpc/jpc_enc.h b/src/libjasper/jpc/jpc_enc.h
new file mode 100644 (file)
index 0000000..ce427fe
--- /dev/null
@@ -0,0 +1,646 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * $Id$
+ */
+
+#ifndef JPC_ENC_H
+#define JPC_ENC_H
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include "jasper/jas_seq.h"
+
+#include "jpc_t2cod.h"
+#include "jpc_mqenc.h"
+#include "jpc_cod.h"
+#include "jpc_tagtree.h"
+#include "jpc_cs.h"
+#include "jpc_flt.h"
+#include "jpc_tsfb.h"
+
+/******************************************************************************\
+* Constants.
+\******************************************************************************/
+
+/* The number of bits used in various lookup tables. */
+#define        JPC_NUMEXTRABITS        JPC_NMSEDEC_FRACBITS
+
+/* An invalid R-D slope value. */
+#define        JPC_BADRDSLOPE  (-1)
+
+/******************************************************************************\
+* Coding parameters types.
+\******************************************************************************/
+
+/* Per-component coding paramters. */
+
+typedef struct {
+
+       /* The horizontal sampling period. */
+       uint_fast8_t sampgrdstepx;
+
+       /* The vertical sampling period. */
+       uint_fast8_t sampgrdstepy;
+
+       /* The sample alignment horizontal offset. */
+       uint_fast8_t sampgrdsubstepx;
+
+       /* The sample alignment vertical offset. */
+       uint_fast8_t sampgrdsubstepy;
+
+       /* The precision of the samples. */
+       uint_fast8_t prec;
+
+       /* The signedness of the samples. */
+       bool sgnd;
+
+       /* The number of step sizes. */
+       uint_fast16_t numstepsizes;
+
+       /* The quantizer step sizes. */
+       uint_fast16_t stepsizes[JPC_MAXBANDS];
+
+} jpc_enc_ccp_t;
+
+/* Per-tile coding parameters. */
+
+typedef struct {
+
+       /* The coding mode. */
+       bool intmode;
+
+       /* The coding style (i.e., SOP, EPH). */
+       uint_fast8_t csty;
+
+       /* The progression order. */
+       uint_fast8_t prg;
+
+       /* The multicomponent transform. */
+       uint_fast8_t mctid;
+
+       /* The number of layers. */
+       uint_fast16_t numlyrs;
+
+       /* The normalized bit rates associated with the various
+         intermediate layers. */
+       jpc_fix_t *ilyrrates;
+
+} jpc_enc_tcp_t;
+
+/* Per tile-component coding parameters. */
+
+typedef struct {
+
+       /* The coding style (i.e., explicit precinct sizes). */
+       uint_fast8_t csty;
+
+       /* The maximum number of resolution levels allowed. */
+       uint_fast8_t maxrlvls;
+
+       /* The exponent for the nominal code block width. */
+       uint_fast16_t cblkwidthexpn;
+
+       /* The exponent for the nominal code block height. */
+       uint_fast16_t cblkheightexpn;
+
+       /* The code block style parameters (e.g., lazy, terminate all,
+         segmentation symbols, causal, reset probability models). */
+       uint_fast8_t cblksty;
+
+       /* The QMFB. */
+       uint_fast8_t qmfbid;
+
+       /* The precinct width values. */
+       uint_fast16_t prcwidthexpns[JPC_MAXRLVLS];
+
+       /* The precinct height values. */
+       uint_fast16_t prcheightexpns[JPC_MAXRLVLS];
+
+       /* The number of guard bits. */
+       uint_fast8_t numgbits;
+
+} jpc_enc_tccp_t;
+
+/* Coding parameters. */
+
+typedef struct {
+
+       /* The debug level. */
+       int debug;
+
+       /* The horizontal offset from the origin of the reference grid to the
+         left edge of the image area. */
+       uint_fast32_t imgareatlx;
+
+       /* The vertical offset from the origin of the reference grid to the
+         top edge of the image area. */
+       uint_fast32_t imgareatly;
+
+       /* The horizontal offset from the origin of the reference grid to the
+         right edge of the image area (plus one). */
+       uint_fast32_t refgrdwidth;
+
+       /* The vertical offset from the origin of the reference grid to the
+         bottom edge of the image area (plus one). */
+       uint_fast32_t refgrdheight;
+
+       /* The horizontal offset from the origin of the tile grid to the
+         origin of the reference grid. */
+       uint_fast32_t tilegrdoffx;
+
+       /* The vertical offset from the origin of the tile grid to the
+         origin of the reference grid. */
+       uint_fast32_t tilegrdoffy;
+
+       /* The nominal tile width in units of the image reference grid. */
+       uint_fast32_t tilewidth;
+
+       /* The nominal tile height in units of the image reference grid. */
+       uint_fast32_t tileheight;
+
+       /* The number of tiles spanning the image area in the horizontal
+         direction. */
+       uint_fast32_t numhtiles;
+
+       /* The number of tiles spanning the image area in the vertical
+         direction. */
+       uint_fast32_t numvtiles;
+
+       /* The number of tiles. */
+       uint_fast32_t numtiles;
+
+       /* The number of components. */
+       uint_fast16_t numcmpts;
+
+       /* The per-component coding parameters. */
+       jpc_enc_ccp_t *ccps;
+
+       /* The per-tile coding parameters. */
+       jpc_enc_tcp_t tcp;
+
+       /* The per-tile-component coding parameters. */
+       jpc_enc_tccp_t tccp;
+
+       /* The target code stream length in bytes. */
+       uint_fast32_t totalsize;
+
+       /* The raw (i.e., uncompressed) size of the image in bytes. */
+       uint_fast32_t rawsize;
+
+} jpc_enc_cp_t;
+
+/******************************************************************************\
+* Encoder class.
+\******************************************************************************/
+
+/* Encoder per-coding-pass state information. */
+
+typedef struct {
+
+       /* The starting offset for this pass. */
+       int start;
+
+       /* The ending offset for this pass. */
+       int end;
+
+       /* The type of data in this pass (i.e., MQ or raw). */
+       int type;
+
+       /* Flag indicating that this pass is terminated. */
+       int term;
+
+       /* The entropy coder state after coding this pass. */
+       jpc_mqencstate_t mqencstate;
+
+       /* The layer to which this pass has been assigned. */
+       int lyrno;
+
+       /* The R-D slope for this pass. */
+       jpc_flt_t rdslope;
+
+       /* The weighted MSE reduction associated with this pass. */
+       jpc_flt_t wmsedec;
+
+       /* The cumulative weighted MSE reduction. */
+       jpc_flt_t cumwmsedec;
+
+       /* The normalized MSE reduction. */
+       long nmsedec;
+
+} jpc_enc_pass_t;
+
+/* Encoder per-code-block state information. */
+
+typedef struct {
+
+       /* The number of passes. */
+       int numpasses;
+
+       /* The per-pass information. */
+       jpc_enc_pass_t *passes;
+
+       /* The number of passes encoded so far. */
+       int numencpasses;
+
+       /* The number of insignificant MSBs. */
+       int numimsbs;
+
+       /* The number of bits used to encode pass data lengths. */
+       int numlenbits;
+
+       /* The byte stream for this code block. */
+       jas_stream_t *stream;
+
+       /* The entropy encoder. */
+       jpc_mqenc_t *mqenc;
+
+       /* The data for this code block. */
+       jas_matrix_t *data;
+
+       /* The state for this code block. */
+       jas_matrix_t *flags;
+
+       /* The number of bit planes required for this code block. */
+       int numbps;
+
+       /* The next pass to be encoded. */
+       jpc_enc_pass_t *curpass;
+
+       /* The per-code-block-group state information. */
+       struct jpc_enc_prc_s *prc;
+
+       /* The saved current pass. */
+       /* This is used by the rate control code. */
+       jpc_enc_pass_t *savedcurpass;
+
+       /* The saved length indicator size. */
+       /* This is used by the rate control code. */
+       int savednumlenbits;
+
+       /* The saved number of encoded passes. */
+       /* This is used by the rate control code. */
+       int savednumencpasses;
+
+} jpc_enc_cblk_t;
+
+/* Encoder per-code-block-group state information. */
+
+typedef struct jpc_enc_prc_s {
+
+       /* The x-coordinate of the top-left corner of the precinct. */
+       uint_fast32_t tlx;
+
+       /* The y-coordinate of the top-left corner of the precinct. */
+       uint_fast32_t tly;
+
+       /* The x-coordinate of the bottom-right corner of the precinct
+         (plus one). */
+       uint_fast32_t brx;
+
+       /* The y-coordinate of the bottom-right corner of the precinct
+         (plus one). */
+       uint_fast32_t bry;
+
+       /* The number of code blocks spanning the precinct in the horizontal
+       direction. */
+       int numhcblks;
+
+       /* The number of code blocks spanning the precinct in the vertical
+       direction. */
+       int numvcblks;
+
+       /* The total number of code blocks. */
+       int numcblks;
+
+       /* The per-code-block information. */
+       jpc_enc_cblk_t *cblks;
+
+       /* The inclusion tag tree. */
+       jpc_tagtree_t *incltree;
+
+       /* The insignifcant MSBs tag tree. */
+       jpc_tagtree_t *nlibtree;
+
+       /* The per-band information. */
+       struct jpc_enc_band_s *band;
+
+       /* The saved inclusion tag tree. */
+       /* This is used by rate control. */
+       jpc_tagtree_t *savincltree;
+
+       /* The saved leading-insignificant-bit-planes tag tree. */
+       /* This is used by rate control. */
+       jpc_tagtree_t *savnlibtree;
+
+} jpc_enc_prc_t;
+
+/* Encoder per-band state information. */
+
+typedef struct jpc_enc_band_s {
+
+       /* The per precinct information. */
+       jpc_enc_prc_t *prcs;
+
+       /* The coefficient data for this band. */
+       jas_matrix_t *data;
+
+       /* The orientation of this band (i.e., LL, LH, HL, or HH). */
+       int orient;
+
+       /* The number of bit planes associated with this band. */
+       int numbps;
+
+       /* The quantizer step size. */
+       jpc_fix_t absstepsize;
+
+       /* The encoded quantizer step size. */
+       int stepsize;
+
+       /* The L2 norm of the synthesis basis functions associated with
+         this band.  (The MCT is not considered in this value.) */
+       jpc_fix_t synweight;
+
+       /* The analysis gain for this band. */
+       int analgain;
+
+       /* The per-resolution-level information. */
+       struct jpc_enc_rlvl_s *rlvl;
+
+} jpc_enc_band_t;
+
+/* Encoder per-resolution-level state information. */
+
+typedef struct jpc_enc_rlvl_s {
+
+       /* The x-coordinate of the top-left corner of the tile-component
+         at this resolution. */
+       uint_fast32_t tlx;
+
+       /* The y-coordinate of the top-left corner of the tile-component
+         at this resolution. */
+       uint_fast32_t tly;
+
+       /* The x-coordinate of the bottom-right corner of the tile-component
+         at this resolution (plus one). */
+       uint_fast32_t brx;
+
+       /* The y-coordinate of the bottom-right corner of the tile-component
+         at this resolution (plus one). */
+       uint_fast32_t bry;
+
+       /* The exponent value for the nominal precinct width measured
+         relative to the associated LL band. */
+       int prcwidthexpn;
+
+       /* The exponent value for the nominal precinct height measured
+         relative to the associated LL band. */
+       int prcheightexpn;
+
+       /* The number of precincts spanning the resolution level in the
+         horizontal direction. */
+       int numhprcs;
+
+       /* The number of precincts spanning the resolution level in the
+         vertical direction. */
+       int numvprcs;
+
+       /* The total number of precincts. */
+       int numprcs;
+
+       /* The exponent value for the nominal code block group width.
+         This quantity is associated with the next lower resolution level
+         (assuming that there is one). */
+       int cbgwidthexpn;
+
+       /* The exponent value for the nominal code block group height.
+         This quantity is associated with the next lower resolution level
+         (assuming that there is one). */
+       int cbgheightexpn;
+
+       /* The exponent value for the code block width. */
+       uint_fast16_t cblkwidthexpn;
+
+       /* The exponent value for the code block height. */
+       uint_fast16_t cblkheightexpn;
+
+       /* The number of bands associated with this resolution level. */
+       int numbands;
+
+       /* The per-band information. */
+       jpc_enc_band_t *bands;
+
+       /* The parent tile-component. */
+       struct jpc_enc_tcmpt_s *tcmpt;
+
+} jpc_enc_rlvl_t;
+
+/* Encoder per-tile-component state information. */
+
+typedef struct jpc_enc_tcmpt_s {
+
+       /* The number of resolution levels. */
+       int numrlvls;
+
+       /* The per-resolution-level information. */
+       jpc_enc_rlvl_t *rlvls;
+
+       /* The tile-component data. */
+       jas_matrix_t *data;
+
+       /* The QMFB. */
+       int qmfbid;
+
+       /* The number of bands. */
+       int numbands;
+
+       /* The TSFB. */
+       jpc_tsfb_t *tsfb;
+
+       /* The synthesis energy weight (for the MCT). */
+       jpc_fix_t synweight;
+
+       /* The precinct width exponents. */
+       int prcwidthexpns[JPC_MAXRLVLS];
+
+       /* The precinct height exponents. */
+       int prcheightexpns[JPC_MAXRLVLS];
+
+       /* The code block width exponent. */
+       int cblkwidthexpn;
+
+       /* The code block height exponent. */
+       int cblkheightexpn;
+
+       /* Coding style (i.e., explicit precinct sizes). */
+       int csty;
+
+       /* Code block style. */
+       int cblksty;
+
+       /* The number of quantizer step sizes. */
+       int numstepsizes;
+
+       /* The encoded quantizer step sizes. */
+       uint_fast16_t stepsizes[JPC_MAXBANDS];
+
+       /* The parent tile. */
+       struct jpc_enc_tile_s *tile;
+
+} jpc_enc_tcmpt_t;
+
+/* Encoder per-tile state information. */
+
+typedef struct jpc_enc_tile_s {
+
+       /* The tile number. */
+       uint_fast32_t tileno;
+
+       /* The x-coordinate of the top-left corner of the tile measured with
+         respect to the reference grid. */
+       uint_fast32_t tlx;
+
+       /* The y-coordinate of the top-left corner of the tile measured with
+         respect to the reference grid. */
+       uint_fast32_t tly;
+
+       /* The x-coordinate of the bottom-right corner of the tile measured
+         with respect to the reference grid (plus one). */
+       uint_fast32_t brx;
+
+       /* The y-coordinate of the bottom-right corner of the tile measured
+         with respect to the reference grid (plus one). */
+       uint_fast32_t bry;
+
+       /* The coding style. */
+       uint_fast8_t csty;
+
+       /* The progression order. */
+       uint_fast8_t prg;
+
+       /* The number of layers. */
+       int numlyrs;
+
+       /* The MCT to employ (if any). */
+       uint_fast8_t mctid;
+
+       /* The packet iterator (used to determine the order of packet
+         generation). */
+       jpc_pi_t *pi;
+
+       /* The coding mode (i.e., integer or real). */
+       bool intmode;
+
+       /* The number of bytes to allocate to the various layers. */
+       uint_fast32_t *lyrsizes;
+
+       /* The number of tile-components. */
+       int numtcmpts;
+
+       /* The per tile-component information. */
+       jpc_enc_tcmpt_t *tcmpts;
+
+       /* The raw (i.e., uncompressed) size of this tile. */
+       uint_fast32_t rawsize;
+
+} jpc_enc_tile_t;
+
+/* Encoder class. */
+
+typedef struct jpc_enc_s {
+
+       /* The image being encoded. */
+       jas_image_t *image;
+
+       /* The output stream. */
+       jas_stream_t *out;
+
+       /* The coding parameters. */
+       jpc_enc_cp_t *cp;
+
+       /* The tile currently being processed. */
+       jpc_enc_tile_t *curtile;
+
+       /* The code stream state. */
+       jpc_cstate_t *cstate;
+
+       /* The number of bytes output so far. */
+       uint_fast32_t len;
+
+       /* The number of bytes available for the main body of the code stream. */
+       /* This is used for rate allocation purposes. */
+       uint_fast32_t mainbodysize;
+
+       /* The marker segment currently being processed. */
+       /* This member is a convenience for making cleanup easier. */
+       jpc_ms_t *mrk;
+
+       /* The stream used to temporarily hold tile-part data. */
+       jas_stream_t *tmpstream;
+
+} jpc_enc_t;
+
+#endif
diff --git a/src/libjasper/jpc/jpc_fix.h b/src/libjasper/jpc/jpc_fix.h
new file mode 100644 (file)
index 0000000..34f8d80
--- /dev/null
@@ -0,0 +1,144 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Fixed-Point Number Class
+ *
+ * $Id$
+ */
+
+#ifndef JPC_FIX_H
+#define JPC_FIX_H
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include "jasper/jas_types.h"
+#include "jasper/jas_fix.h"
+
+/******************************************************************************\
+* Basic parameters of the fixed-point type.
+\******************************************************************************/
+
+/* The integral type used to represent a fixed-point number.  This
+  type must be capable of representing values from -(2^31) to 2^31-1
+  (inclusive). */
+typedef int_fast32_t jpc_fix_t;
+
+/* The integral type used to respresent higher-precision intermediate results.
+  This type should be capable of representing values from -(2^63) to 2^63-1
+  (inclusive). */
+typedef int_fast64_t jpc_fix_big_t;
+
+/* The number of bits used for the fractional part of a fixed-point number. */
+#define JPC_FIX_FRACBITS       13
+
+/******************************************************************************\
+* Instantiations of the generic fixed-point number macros for the
+* parameters given above.  (Too bad C does not support templates, eh?)
+* The purpose of these macros is self-evident if one examines the
+* corresponding macros in the jasper/jas_fix.h header file.
+\******************************************************************************/
+
+#define        JPC_FIX_ZERO    JAS_FIX_ZERO(jpc_fix_t, JPC_FIX_FRACBITS)
+#define        JPC_FIX_ONE             JAS_FIX_ONE(jpc_fix_t, JPC_FIX_FRACBITS)
+#define        JPC_FIX_HALF    JAS_FIX_HALF(jpc_fix_t, JPC_FIX_FRACBITS)
+
+#define jpc_inttofix(x)        JAS_INTTOFIX(jpc_fix_t, JPC_FIX_FRACBITS, x)
+#define jpc_fixtoint(x)        JAS_FIXTOINT(jpc_fix_t, JPC_FIX_FRACBITS, x)
+#define jpc_fixtodbl(x)        JAS_FIXTODBL(jpc_fix_t, JPC_FIX_FRACBITS, x)
+#define jpc_dbltofix(x)        JAS_DBLTOFIX(jpc_fix_t, JPC_FIX_FRACBITS, x)
+
+#define        jpc_fix_add(x, y)       JAS_FIX_ADD(jpc_fix_t, JPC_FIX_FRACBITS, x, y)
+#define        jpc_fix_sub(x, y)       JAS_FIX_SUB(jpc_fix_t, JPC_FIX_FRACBITS, x, y)
+#define        jpc_fix_mul(x, y) \
+       JAS_FIX_MUL(jpc_fix_t, JPC_FIX_FRACBITS, jpc_fix_big_t, x, y)
+#define        jpc_fix_mulbyint(x, y) \
+       JAS_FIX_MULBYINT(jpc_fix_t, JPC_FIX_FRACBITS, x, y)
+#define        jpc_fix_div(x, y) \
+       JAS_FIX_DIV(jpc_fix_t, JPC_FIX_FRACBITS, jpc_fix_big_t, x, y)
+#define        jpc_fix_neg(x)          JAS_FIX_NEG(jpc_fix_t, JPC_FIX_FRACBITS, x)
+#define        jpc_fix_asl(x, n)       JAS_FIX_ASL(jpc_fix_t, JPC_FIX_FRACBITS, x, n)
+#define        jpc_fix_asr(x, n)       JAS_FIX_ASR(jpc_fix_t, JPC_FIX_FRACBITS, x, n)
+
+#define jpc_fix_pluseq(x, y)   JAS_FIX_PLUSEQ(jpc_fix_t, JPC_FIX_FRACBITS, x, y)
+#define jpc_fix_minuseq(x, y)  JAS_FIX_MINUSEQ(jpc_fix_t, JPC_FIX_FRACBITS, x, y)
+#define        jpc_fix_muleq(x, y)     \
+       JAS_FIX_MULEQ(jpc_fix_t, JPC_FIX_FRACBITS, jpc_fix_big_t, x, y)
+
+#define        jpc_fix_abs(x)          JAS_FIX_ABS(jpc_fix_t, JPC_FIX_FRACBITS, x)
+#define        jpc_fix_isint(x)        JAS_FIX_ISINT(jpc_fix_t, JPC_FIX_FRACBITS, x)
+#define jpc_fix_sgn(x)         JAS_FIX_SGN(jpc_fix_t, JPC_FIX_FRACBITS, x)
+#define        jpc_fix_round(x)        JAS_FIX_ROUND(jpc_fix_t, JPC_FIX_FRACBITS, x)
+#define        jpc_fix_floor(x)        JAS_FIX_FLOOR(jpc_fix_t, JPC_FIX_FRACBITS, x)
+#define jpc_fix_trunc(x)       JAS_FIX_TRUNC(jpc_fix_t, JPC_FIX_FRACBITS, x)
+
+/******************************************************************************\
+* Extra macros for convenience.
+\******************************************************************************/
+
+/* Compute the sum of three fixed-point numbers. */
+#define jpc_fix_add3(x, y, z)  jpc_fix_add(jpc_fix_add(x, y), z)
+
+#endif
diff --git a/src/libjasper/jpc/jpc_flt.h b/src/libjasper/jpc/jpc_flt.h
new file mode 100644 (file)
index 0000000..119465f
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Floating-Point Class
+ *
+ * $Id$
+ */
+
+#ifndef JPC_FLT_H
+#define JPC_FLT_H
+
+#include <float.h>
+
+/* The code ought to be modified so this type is not used at all. */
+/* Very few places in the code rely on floating-point arithmetic, aside
+  from conversions in printf's. */
+typedef double jpc_flt_t;
+
+#endif
diff --git a/src/libjasper/jpc/jpc_math.c b/src/libjasper/jpc/jpc_math.c
new file mode 100644 (file)
index 0000000..2b70844
--- /dev/null
@@ -0,0 +1,121 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Math Library
+ *
+ * $Id$
+ */
+
+/******************************************************************************\
+* Includes
+\******************************************************************************/
+
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+#include <math.h>
+#include <stdlib.h>
+#include <stdarg.h>
+
+#include "jpc_math.h"
+
+/******************************************************************************\
+* Miscellaneous Functions
+\******************************************************************************/
+
+/* Calculate the integer quantity floor(log2(x)), where x is a positive
+  integer. */
+int jpc_floorlog2(int x)
+{
+       int y;
+
+       /* The argument must be positive. */
+       assert(x > 0);
+
+       y = 0;
+       while (x > 1) {
+               x >>= 1;
+               ++y;
+       }
+       return y;
+}
+
+/* Calculate the bit position of the first leading one in a nonnegative
+  integer. */
+/* This function is the basically the same as ceillog2(x), except that the
+  allowable range for x is slightly different. */
+int jpc_firstone(int x)
+{
+       int n;
+
+       /* The argument must be nonnegative. */
+       assert(x >= 0);
+
+       n = -1;
+       while (x > 0) {
+               x >>= 1;
+               ++n;
+       }
+       return n;
+}
diff --git a/src/libjasper/jpc/jpc_math.h b/src/libjasper/jpc/jpc_math.h
new file mode 100644 (file)
index 0000000..e8e0978
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+#ifndef        JPC_MATH_H
+#define        JPC_MATH_H
+
+/******************************************************************************\
+* Includes
+\******************************************************************************/
+
+#include       <assert.h>
+
+/******************************************************************************\
+* Macros
+\******************************************************************************/
+
+/* Compute the floor of the quotient of two integers. */
+#define        JPC_FLOORDIV(x, y)      ((x) / (y))
+
+/* Compute the ceiling of the quotient of two integers. */
+#define        JPC_CEILDIV(x, y)       (((x) + (y) - 1) / (y))
+
+/* Compute the floor of (x / 2^y). */
+#define        JPC_FLOORDIVPOW2(x, y)  ((x) >> (y))
+
+/* Compute the ceiling of (x / 2^y). */
+#define        JPC_CEILDIVPOW2(x, y)   (((x) + (1 << (y)) - 1) >> (y))
+
+/******************************************************************************\
+* Functions.
+\******************************************************************************/
+
+/* Calculate the bit position of the first leading one in a nonnegative
+  integer. */
+int jpc_firstone(int x);
+
+/* Calculate the integer quantity floor(log2(x)), where x is a positive
+  integer. */
+int jpc_floorlog2(int x);
+
+#endif
diff --git a/src/libjasper/jpc/jpc_mct.c b/src/libjasper/jpc/jpc_mct.c
new file mode 100644 (file)
index 0000000..2545022
--- /dev/null
@@ -0,0 +1,291 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Multicomponent Transform Code
+ *
+ * $Id$
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <assert.h>
+
+#include "jasper/jas_seq.h"
+
+#include "jpc_fix.h"
+#include "jpc_mct.h"
+
+/******************************************************************************\
+* Code.
+\******************************************************************************/
+
+/* Compute the forward RCT. */
+
+void jpc_rct(jas_matrix_t *c0, jas_matrix_t *c1, jas_matrix_t *c2)
+{
+       int numrows;
+       int numcols;
+       int i;
+       int j;
+       jpc_fix_t *c0p;
+       jpc_fix_t *c1p;
+       jpc_fix_t *c2p;
+
+       numrows = jas_matrix_numrows(c0);
+       numcols = jas_matrix_numcols(c0);
+
+       /* All three matrices must have the same dimensions. */
+       assert(jas_matrix_numrows(c1) == numrows && jas_matrix_numcols(c1) == numcols
+         && jas_matrix_numrows(c2) == numrows && jas_matrix_numcols(c2) == numcols);
+
+       for (i = 0; i < numrows; i++) {
+               c0p = jas_matrix_getref(c0, i, 0);
+               c1p = jas_matrix_getref(c1, i, 0);
+               c2p = jas_matrix_getref(c2, i, 0);
+               for (j = numcols; j > 0; --j) {
+                       int r;
+                       int g;
+                       int b;
+                       int y;
+                       int u;
+                       int v;
+                       r = *c0p;
+                       g = *c1p;
+                       b = *c2p;
+                       y = (r + (g << 1) + b) >> 2;
+                       u = b - g;
+                       v = r - g;
+                       *c0p++ = y;
+                       *c1p++ = u;
+                       *c2p++ = v;
+               }
+       }
+}
+
+/* Compute the inverse RCT. */
+
+void jpc_irct(jas_matrix_t *c0, jas_matrix_t *c1, jas_matrix_t *c2)
+{
+       int numrows;
+       int numcols;
+       int i;
+       int j;
+       jpc_fix_t *c0p;
+       jpc_fix_t *c1p;
+       jpc_fix_t *c2p;
+
+       numrows = jas_matrix_numrows(c0);
+       numcols = jas_matrix_numcols(c0);
+
+       /* All three matrices must have the same dimensions. */
+       assert(jas_matrix_numrows(c1) == numrows && jas_matrix_numcols(c1) == numcols
+         && jas_matrix_numrows(c2) == numrows && jas_matrix_numcols(c2) == numcols);
+
+       for (i = 0; i < numrows; i++) {
+               c0p = jas_matrix_getref(c0, i, 0);
+               c1p = jas_matrix_getref(c1, i, 0);
+               c2p = jas_matrix_getref(c2, i, 0);
+               for (j = numcols; j > 0; --j) {
+                       int r;
+                       int g;
+                       int b;
+                       int y;
+                       int u;
+                       int v;
+                       y = *c0p;
+                       u = *c1p;
+                       v = *c2p;
+                       g = y - ((u + v) >> 2);
+                       r = v + g;
+                       b = u + g;
+                       *c0p++ = r;
+                       *c1p++ = g;
+                       *c2p++ = b;
+               }
+       }
+}
+
+void jpc_ict(jas_matrix_t *c0, jas_matrix_t *c1, jas_matrix_t *c2)
+{
+       int numrows;
+       int numcols;
+       int i;
+       int j;
+       jpc_fix_t r;
+       jpc_fix_t g;
+       jpc_fix_t b;
+       jpc_fix_t y;
+       jpc_fix_t u;
+       jpc_fix_t v;
+       jpc_fix_t *c0p;
+       jpc_fix_t *c1p;
+       jpc_fix_t *c2p;
+
+       numrows = jas_matrix_numrows(c0);
+       assert(jas_matrix_numrows(c1) == numrows && jas_matrix_numrows(c2) == numrows);
+       numcols = jas_matrix_numcols(c0);
+       assert(jas_matrix_numcols(c1) == numcols && jas_matrix_numcols(c2) == numcols);
+       for (i = 0; i < numrows; ++i) {
+               c0p = jas_matrix_getref(c0, i, 0);
+               c1p = jas_matrix_getref(c1, i, 0);
+               c2p = jas_matrix_getref(c2, i, 0);
+               for (j = numcols; j > 0; --j) {
+                       r = *c0p;
+                       g = *c1p;
+                       b = *c2p;
+                       y = jpc_fix_add3(jpc_fix_mul(jpc_dbltofix(0.299), r), jpc_fix_mul(jpc_dbltofix(0.587), g),
+                         jpc_fix_mul(jpc_dbltofix(0.114), b));
+                       u = jpc_fix_add3(jpc_fix_mul(jpc_dbltofix(-0.16875), r), jpc_fix_mul(jpc_dbltofix(-0.33126), g),
+                         jpc_fix_mul(jpc_dbltofix(0.5), b));
+                       v = jpc_fix_add3(jpc_fix_mul(jpc_dbltofix(0.5), r), jpc_fix_mul(jpc_dbltofix(-0.41869), g),
+                         jpc_fix_mul(jpc_dbltofix(-0.08131), b));
+                       *c0p++ = y;
+                       *c1p++ = u;
+                       *c2p++ = v;
+               }
+       }
+}
+
+void jpc_iict(jas_matrix_t *c0, jas_matrix_t *c1, jas_matrix_t *c2)
+{
+       int numrows;
+       int numcols;
+       int i;
+       int j;
+       jpc_fix_t r;
+       jpc_fix_t g;
+       jpc_fix_t b;
+       jpc_fix_t y;
+       jpc_fix_t u;
+       jpc_fix_t v;
+       jpc_fix_t *c0p;
+       jpc_fix_t *c1p;
+       jpc_fix_t *c2p;
+
+       numrows = jas_matrix_numrows(c0);
+       assert(jas_matrix_numrows(c1) == numrows && jas_matrix_numrows(c2) == numrows);
+       numcols = jas_matrix_numcols(c0);
+       assert(jas_matrix_numcols(c1) == numcols && jas_matrix_numcols(c2) == numcols);
+       for (i = 0; i < numrows; ++i) {
+               c0p = jas_matrix_getref(c0, i, 0);
+               c1p = jas_matrix_getref(c1, i, 0);
+               c2p = jas_matrix_getref(c2, i, 0);
+               for (j = numcols; j > 0; --j) {
+                       y = *c0p;
+                       u = *c1p;
+                       v = *c2p;
+                       r = jpc_fix_add(y, jpc_fix_mul(jpc_dbltofix(1.402), v));
+                       g = jpc_fix_add3(y, jpc_fix_mul(jpc_dbltofix(-0.34413), u),
+                         jpc_fix_mul(jpc_dbltofix(-0.71414), v));
+                       b = jpc_fix_add(y, jpc_fix_mul(jpc_dbltofix(1.772), u));
+                       *c0p++ = r;
+                       *c1p++ = g;
+                       *c2p++ = b;
+               }
+       }
+}
+
+jpc_fix_t jpc_mct_getsynweight(int mctid, int cmptno)
+{
+       jpc_fix_t synweight;
+
+       synweight = JPC_FIX_ONE;
+       switch (mctid) {
+       case JPC_MCT_RCT:
+               switch (cmptno) {
+               case 0:
+                       synweight = jpc_dbltofix(sqrt(3.0));
+                       break;
+               case 1:
+                       synweight = jpc_dbltofix(sqrt(0.6875));
+                       break;
+               case 2:
+                       synweight = jpc_dbltofix(sqrt(0.6875));
+                       break;
+               }
+               break;
+       case JPC_MCT_ICT:
+               switch (cmptno) {
+               case 0:
+                       synweight = jpc_dbltofix(sqrt(3.0000));
+                       break;
+               case 1:
+                       synweight = jpc_dbltofix(sqrt(3.2584));
+                       break;
+               case 2:
+                       synweight = jpc_dbltofix(sqrt(2.4755));
+                       break;
+               }
+               break;
+#if 0
+       default:
+               synweight = JPC_FIX_ONE;
+               break;
+#endif
+       }
+
+       return synweight;
+}
diff --git a/src/libjasper/jpc/jpc_mct.h b/src/libjasper/jpc/jpc_mct.h
new file mode 100644 (file)
index 0000000..8a564e9
--- /dev/null
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Multicomponent Transform Code
+ *
+ * $Id$
+ */
+
+#ifndef JPC_MCT_H
+#define JPC_MCT_H
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include "jasper/jas_seq.h"
+#include "jasper/jas_fix.h"
+
+/******************************************************************************\
+* Constants.
+\******************************************************************************/
+
+/*
+ * Multicomponent transform IDs.
+ */
+
+#define JPC_MCT_NONE   0
+#define JPC_MCT_ICT            1
+#define JPC_MCT_RCT            2
+
+/******************************************************************************\
+* Functions.
+\******************************************************************************/
+
+/* Calculate the forward RCT. */
+void jpc_rct(jas_matrix_t *c0, jas_matrix_t *c1, jas_matrix_t *c2);
+
+/* Calculate the inverse RCT. */
+void jpc_irct(jas_matrix_t *c0, jas_matrix_t *c1, jas_matrix_t *c2);
+
+/* Calculate the forward ICT. */
+void jpc_ict(jas_matrix_t *c0, jas_matrix_t *c1, jas_matrix_t *c2);
+
+/* Calculate the inverse ICT. */
+void jpc_iict(jas_matrix_t *c0, jas_matrix_t *c1, jas_matrix_t *c2);
+
+/* Get the synthesis weight associated with a particular component. */
+jpc_fix_t jpc_mct_getsynweight(int mctid, int cmptno);
+
+#endif
diff --git a/src/libjasper/jpc/jpc_mqcod.c b/src/libjasper/jpc/jpc_mqcod.c
new file mode 100644 (file)
index 0000000..ed56f8d
--- /dev/null
@@ -0,0 +1,179 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * MQ Arithmetic Coder
+ *
+ * $Id$
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include "jasper/jas_malloc.h"
+
+#include "jpc_mqcod.h"
+
+/******************************************************************************\
+* Data.
+\******************************************************************************/
+
+/* MQ coder per-state information. */
+
+jpc_mqstate_t jpc_mqstates[47 * 2] = {
+       {0x5601, 0, &jpc_mqstates[ 2], &jpc_mqstates[ 3]},
+       {0x5601, 1, &jpc_mqstates[ 3], &jpc_mqstates[ 2]},
+       {0x3401, 0, &jpc_mqstates[ 4], &jpc_mqstates[12]},
+       {0x3401, 1, &jpc_mqstates[ 5], &jpc_mqstates[13]},
+       {0x1801, 0, &jpc_mqstates[ 6], &jpc_mqstates[18]},
+       {0x1801, 1, &jpc_mqstates[ 7], &jpc_mqstates[19]},
+       {0x0ac1, 0, &jpc_mqstates[ 8], &jpc_mqstates[24]},
+       {0x0ac1, 1, &jpc_mqstates[ 9], &jpc_mqstates[25]},
+       {0x0521, 0, &jpc_mqstates[10], &jpc_mqstates[58]},
+       {0x0521, 1, &jpc_mqstates[11], &jpc_mqstates[59]},
+       {0x0221, 0, &jpc_mqstates[76], &jpc_mqstates[66]},
+       {0x0221, 1, &jpc_mqstates[77], &jpc_mqstates[67]},
+       {0x5601, 0, &jpc_mqstates[14], &jpc_mqstates[13]},
+       {0x5601, 1, &jpc_mqstates[15], &jpc_mqstates[12]},
+       {0x5401, 0, &jpc_mqstates[16], &jpc_mqstates[28]},
+       {0x5401, 1, &jpc_mqstates[17], &jpc_mqstates[29]},
+       {0x4801, 0, &jpc_mqstates[18], &jpc_mqstates[28]},
+       {0x4801, 1, &jpc_mqstates[19], &jpc_mqstates[29]},
+       {0x3801, 0, &jpc_mqstates[20], &jpc_mqstates[28]},
+       {0x3801, 1, &jpc_mqstates[21], &jpc_mqstates[29]},
+       {0x3001, 0, &jpc_mqstates[22], &jpc_mqstates[34]},
+       {0x3001, 1, &jpc_mqstates[23], &jpc_mqstates[35]},
+       {0x2401, 0, &jpc_mqstates[24], &jpc_mqstates[36]},
+       {0x2401, 1, &jpc_mqstates[25], &jpc_mqstates[37]},
+       {0x1c01, 0, &jpc_mqstates[26], &jpc_mqstates[40]},
+       {0x1c01, 1, &jpc_mqstates[27], &jpc_mqstates[41]},
+       {0x1601, 0, &jpc_mqstates[58], &jpc_mqstates[42]},
+       {0x1601, 1, &jpc_mqstates[59], &jpc_mqstates[43]},
+       {0x5601, 0, &jpc_mqstates[30], &jpc_mqstates[29]},
+       {0x5601, 1, &jpc_mqstates[31], &jpc_mqstates[28]},
+       {0x5401, 0, &jpc_mqstates[32], &jpc_mqstates[28]},
+       {0x5401, 1, &jpc_mqstates[33], &jpc_mqstates[29]},
+       {0x5101, 0, &jpc_mqstates[34], &jpc_mqstates[30]},
+       {0x5101, 1, &jpc_mqstates[35], &jpc_mqstates[31]},
+       {0x4801, 0, &jpc_mqstates[36], &jpc_mqstates[32]},
+       {0x4801, 1, &jpc_mqstates[37], &jpc_mqstates[33]},
+       {0x3801, 0, &jpc_mqstates[38], &jpc_mqstates[34]},
+       {0x3801, 1, &jpc_mqstates[39], &jpc_mqstates[35]},
+       {0x3401, 0, &jpc_mqstates[40], &jpc_mqstates[36]},
+       {0x3401, 1, &jpc_mqstates[41], &jpc_mqstates[37]},
+       {0x3001, 0, &jpc_mqstates[42], &jpc_mqstates[38]},
+       {0x3001, 1, &jpc_mqstates[43], &jpc_mqstates[39]},
+       {0x2801, 0, &jpc_mqstates[44], &jpc_mqstates[38]},
+       {0x2801, 1, &jpc_mqstates[45], &jpc_mqstates[39]},
+       {0x2401, 0, &jpc_mqstates[46], &jpc_mqstates[40]},
+       {0x2401, 1, &jpc_mqstates[47], &jpc_mqstates[41]},
+       {0x2201, 0, &jpc_mqstates[48], &jpc_mqstates[42]},
+       {0x2201, 1, &jpc_mqstates[49], &jpc_mqstates[43]},
+       {0x1c01, 0, &jpc_mqstates[50], &jpc_mqstates[44]},
+       {0x1c01, 1, &jpc_mqstates[51], &jpc_mqstates[45]},
+       {0x1801, 0, &jpc_mqstates[52], &jpc_mqstates[46]},
+       {0x1801, 1, &jpc_mqstates[53], &jpc_mqstates[47]},
+       {0x1601, 0, &jpc_mqstates[54], &jpc_mqstates[48]},
+       {0x1601, 1, &jpc_mqstates[55], &jpc_mqstates[49]},
+       {0x1401, 0, &jpc_mqstates[56], &jpc_mqstates[50]},
+       {0x1401, 1, &jpc_mqstates[57], &jpc_mqstates[51]},
+       {0x1201, 0, &jpc_mqstates[58], &jpc_mqstates[52]},
+       {0x1201, 1, &jpc_mqstates[59], &jpc_mqstates[53]},
+       {0x1101, 0, &jpc_mqstates[60], &jpc_mqstates[54]},
+       {0x1101, 1, &jpc_mqstates[61], &jpc_mqstates[55]},
+       {0x0ac1, 0, &jpc_mqstates[62], &jpc_mqstates[56]},
+       {0x0ac1, 1, &jpc_mqstates[63], &jpc_mqstates[57]},
+       {0x09c1, 0, &jpc_mqstates[64], &jpc_mqstates[58]},
+       {0x09c1, 1, &jpc_mqstates[65], &jpc_mqstates[59]},
+       {0x08a1, 0, &jpc_mqstates[66], &jpc_mqstates[60]},
+       {0x08a1, 1, &jpc_mqstates[67], &jpc_mqstates[61]},
+       {0x0521, 0, &jpc_mqstates[68], &jpc_mqstates[62]},
+       {0x0521, 1, &jpc_mqstates[69], &jpc_mqstates[63]},
+       {0x0441, 0, &jpc_mqstates[70], &jpc_mqstates[64]},
+       {0x0441, 1, &jpc_mqstates[71], &jpc_mqstates[65]},
+       {0x02a1, 0, &jpc_mqstates[72], &jpc_mqstates[66]},
+       {0x02a1, 1, &jpc_mqstates[73], &jpc_mqstates[67]},
+       {0x0221, 0, &jpc_mqstates[74], &jpc_mqstates[68]},
+       {0x0221, 1, &jpc_mqstates[75], &jpc_mqstates[69]},
+       {0x0141, 0, &jpc_mqstates[76], &jpc_mqstates[70]},
+       {0x0141, 1, &jpc_mqstates[77], &jpc_mqstates[71]},
+       {0x0111, 0, &jpc_mqstates[78], &jpc_mqstates[72]},
+       {0x0111, 1, &jpc_mqstates[79], &jpc_mqstates[73]},
+       {0x0085, 0, &jpc_mqstates[80], &jpc_mqstates[74]},
+       {0x0085, 1, &jpc_mqstates[81], &jpc_mqstates[75]},
+       {0x0049, 0, &jpc_mqstates[82], &jpc_mqstates[76]},
+       {0x0049, 1, &jpc_mqstates[83], &jpc_mqstates[77]},
+       {0x0025, 0, &jpc_mqstates[84], &jpc_mqstates[78]},
+       {0x0025, 1, &jpc_mqstates[85], &jpc_mqstates[79]},
+       {0x0015, 0, &jpc_mqstates[86], &jpc_mqstates[80]},
+       {0x0015, 1, &jpc_mqstates[87], &jpc_mqstates[81]},
+       {0x0009, 0, &jpc_mqstates[88], &jpc_mqstates[82]},
+       {0x0009, 1, &jpc_mqstates[89], &jpc_mqstates[83]},
+       {0x0005, 0, &jpc_mqstates[90], &jpc_mqstates[84]},
+       {0x0005, 1, &jpc_mqstates[91], &jpc_mqstates[85]},
+       {0x0001, 0, &jpc_mqstates[90], &jpc_mqstates[86]},
+       {0x0001, 1, &jpc_mqstates[91], &jpc_mqstates[87]},
+       {0x5601, 0, &jpc_mqstates[92], &jpc_mqstates[92]},
+       {0x5601, 1, &jpc_mqstates[93], &jpc_mqstates[93]},
+};
diff --git a/src/libjasper/jpc/jpc_mqcod.h b/src/libjasper/jpc/jpc_mqcod.h
new file mode 100644 (file)
index 0000000..eb44353
--- /dev/null
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * MQ Arithmetic Coder
+ *
+ * $Id$
+ */
+
+#ifndef JPC_MQCOD_H
+#define JPC_MQCOD_H
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include "jasper/jas_types.h"
+
+/******************************************************************************\
+* Types.
+\******************************************************************************/
+
+/*
+ * MQ coder context information.
+ */
+
+typedef struct {
+
+       /* The most probable symbol (MPS). */
+       int mps;
+
+       /* The state index. */
+       int_fast16_t ind;
+
+} jpc_mqctx_t;
+
+/*
+ * MQ coder state table entry.
+ */
+
+typedef struct jpc_mqstate_s {
+
+       /* The Qe value. */
+       uint_fast16_t qeval;
+
+       /* The MPS. */
+       int mps;
+
+       /* The NMPS state. */
+       struct jpc_mqstate_s *nmps;
+
+       /* The NLPS state. */
+       struct jpc_mqstate_s *nlps;
+
+} jpc_mqstate_t;
+
+/******************************************************************************\
+* Data.
+\******************************************************************************/
+
+/* The state table for the MQ coder. */
+extern jpc_mqstate_t jpc_mqstates[];
+
+#endif
diff --git a/src/libjasper/jpc/jpc_mqdec.c b/src/libjasper/jpc/jpc_mqdec.c
new file mode 100644 (file)
index 0000000..4cc2f46
--- /dev/null
@@ -0,0 +1,306 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * MQ Arithmetic Decoder
+ *
+ * $Id$
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <assert.h>
+#include <stdlib.h>
+#include <stdarg.h>
+
+#include "jasper/jas_types.h"
+#include "jasper/jas_malloc.h"
+#include "jasper/jas_math.h"
+#include "jasper/jas_debug.h"
+
+#include "jpc_mqdec.h"
+
+/******************************************************************************\
+* Local macros.
+\******************************************************************************/
+
+#if defined(DEBUG)
+#define        MQDEC_CALL(n, x) \
+       ((jas_getdbglevel() >= (n)) ? ((void)(x)) : ((void)0))
+#else
+#define        MQDEC_CALL(n, x)
+#endif
+
+/******************************************************************************\
+* Local function prototypes.
+\******************************************************************************/
+
+static void jpc_mqdec_bytein(jpc_mqdec_t *mqdec);
+
+/******************************************************************************\
+* Code for creation and destruction of a MQ decoder.
+\******************************************************************************/
+
+/* Create a MQ decoder. */
+jpc_mqdec_t *jpc_mqdec_create(int maxctxs, jas_stream_t *in)
+{
+       jpc_mqdec_t *mqdec;
+
+       /* There must be at least one context. */
+       assert(maxctxs > 0);
+
+       /* Allocate memory for the MQ decoder. */
+       if (!(mqdec = jas_malloc(sizeof(jpc_mqdec_t)))) {
+               goto error;
+       }
+       mqdec->in = in;
+       mqdec->maxctxs = maxctxs;
+       /* Allocate memory for the per-context state information. */
+       if (!(mqdec->ctxs = jas_malloc(mqdec->maxctxs * sizeof(jpc_mqstate_t *)))) {
+               goto error;
+       }
+       /* Set the current context to the first context. */
+       mqdec->curctx = mqdec->ctxs;
+
+       /* If an input stream has been associated with the MQ decoder,
+         initialize the decoder state from the stream. */
+       if (mqdec->in) {
+               jpc_mqdec_init(mqdec);
+       }
+       /* Initialize the per-context state information. */
+       jpc_mqdec_setctxs(mqdec, 0, 0);
+
+       return mqdec;
+
+error:
+       /* Oops...  Something has gone wrong. */
+       if (mqdec) {
+               jpc_mqdec_destroy(mqdec);
+       }
+       return 0;
+}
+
+/* Destroy a MQ decoder. */
+void jpc_mqdec_destroy(jpc_mqdec_t *mqdec)
+{
+       if (mqdec->ctxs) {
+               jas_free(mqdec->ctxs);
+       }
+       jas_free(mqdec);
+}
+
+/******************************************************************************\
+* Code for initialization of a MQ decoder.
+\******************************************************************************/
+
+/* Initialize the state of a MQ decoder. */
+
+void jpc_mqdec_init(jpc_mqdec_t *mqdec)
+{
+       int c;
+
+       mqdec->eof = 0;
+       mqdec->creg = 0;
+       /* Get the next byte from the input stream. */
+       if ((c = jas_stream_getc(mqdec->in)) == EOF) {
+               /* We have encountered an I/O error or EOF. */
+               c = 0xff;
+               mqdec->eof = 1;
+       }
+       mqdec->inbuffer = c;
+       mqdec->creg += mqdec->inbuffer << 16;
+       jpc_mqdec_bytein(mqdec);
+       mqdec->creg <<= 7;
+       mqdec->ctreg -= 7;
+       mqdec->areg = 0x8000;
+}
+
+/* Set the input stream for a MQ decoder. */
+
+void jpc_mqdec_setinput(jpc_mqdec_t *mqdec, jas_stream_t *in)
+{
+       mqdec->in = in;
+}
+
+/* Initialize one or more contexts. */
+
+void jpc_mqdec_setctxs(jpc_mqdec_t *mqdec, int numctxs, jpc_mqctx_t *ctxs)
+{
+       jpc_mqstate_t **ctx;
+       int n;
+
+       ctx = mqdec->ctxs;
+       n = JAS_MIN(mqdec->maxctxs, numctxs);
+       while (--n >= 0) {
+               *ctx = &jpc_mqstates[2 * ctxs->ind + ctxs->mps];
+               ++ctx;
+               ++ctxs;
+       }
+       n = mqdec->maxctxs - numctxs;
+       while (--n >= 0) {
+               *ctx = &jpc_mqstates[0];
+               ++ctx;
+       }
+}
+
+/* Initialize a context. */
+
+void jpc_mqdec_setctx(jpc_mqdec_t *mqdec, int ctxno, jpc_mqctx_t *ctx)
+{
+       jpc_mqstate_t **ctxi;
+       ctxi = &mqdec->ctxs[ctxno];
+       *ctxi = &jpc_mqstates[2 * ctx->ind + ctx->mps];
+}
+
+/******************************************************************************\
+* Code for decoding a bit.
+\******************************************************************************/
+
+/* Decode a bit. */
+
+int jpc_mqdec_getbit_func(register jpc_mqdec_t *mqdec)
+{
+       int bit;
+       JAS_DBGLOG(100, ("jpc_mqdec_getbit_func(%p)\n", mqdec));
+       MQDEC_CALL(100, jpc_mqdec_dump(mqdec, stderr));
+       bit = jpc_mqdec_getbit_macro(mqdec);
+       MQDEC_CALL(100, jpc_mqdec_dump(mqdec, stderr));
+       JAS_DBGLOG(100, ("ctx = %d, decoded %d\n", mqdec->curctx -
+         mqdec->ctxs, bit));
+       return bit;
+}
+
+/* Apply MPS_EXCHANGE algorithm (with RENORMD). */
+int jpc_mqdec_mpsexchrenormd(register jpc_mqdec_t *mqdec)
+{
+       int ret;
+       register jpc_mqstate_t *state = *mqdec->curctx;
+       jpc_mqdec_mpsexchange(mqdec->areg, state->qeval, mqdec->curctx, ret);
+       jpc_mqdec_renormd(mqdec->areg, mqdec->creg, mqdec->ctreg, mqdec->in,
+         mqdec->eof, mqdec->inbuffer);
+       return ret;
+}
+
+/* Apply LPS_EXCHANGE algorithm (with RENORMD). */
+int jpc_mqdec_lpsexchrenormd(register jpc_mqdec_t *mqdec)
+{
+       int ret;
+       register jpc_mqstate_t *state = *mqdec->curctx;
+       jpc_mqdec_lpsexchange(mqdec->areg, state->qeval, mqdec->curctx, ret);
+       jpc_mqdec_renormd(mqdec->areg, mqdec->creg, mqdec->ctreg, mqdec->in,
+         mqdec->eof, mqdec->inbuffer);
+       return ret;
+}
+
+/******************************************************************************\
+* Support code.
+\******************************************************************************/
+
+/* Apply the BYTEIN algorithm. */
+static void jpc_mqdec_bytein(jpc_mqdec_t *mqdec)
+{
+       int c;
+       unsigned char prevbuf;
+
+       if (!mqdec->eof) {
+               if ((c = jas_stream_getc(mqdec->in)) == EOF) {
+                       mqdec->eof = 1;
+                       c = 0xff;
+               }
+               prevbuf = mqdec->inbuffer;
+               mqdec->inbuffer = c;
+               if (prevbuf == 0xff) {
+                       if (c > 0x8f) {
+                               mqdec->creg += 0xff00;
+                               mqdec->ctreg = 8;
+                       } else {
+                               mqdec->creg += c << 9;
+                               mqdec->ctreg = 7;
+                       }
+               } else {
+                       mqdec->creg += c << 8;
+                       mqdec->ctreg = 8;
+               }
+       } else {
+               mqdec->creg += 0xff00;
+               mqdec->ctreg = 8;
+       }
+}
+
+/******************************************************************************\
+* Code for debugging.
+\******************************************************************************/
+
+/* Dump a MQ decoder to a stream for debugging. */
+
+void jpc_mqdec_dump(jpc_mqdec_t *mqdec, FILE *out)
+{
+       fprintf(out, "MQDEC A = %08lx, C = %08lx, CT=%08lx, ",
+         (unsigned long) mqdec->areg, (unsigned long) mqdec->creg,
+         (unsigned long) mqdec->ctreg);
+       fprintf(out, "CTX = %d, ", mqdec->curctx - mqdec->ctxs);
+       fprintf(out, "IND %d, MPS %d, QEVAL %x\n", *mqdec->curctx -
+         jpc_mqstates, (*mqdec->curctx)->mps, (*mqdec->curctx)->qeval);
+}
diff --git a/src/libjasper/jpc/jpc_mqdec.h b/src/libjasper/jpc/jpc_mqdec.h
new file mode 100644 (file)
index 0000000..05bf735
--- /dev/null
@@ -0,0 +1,271 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * MQ Arithmetic Decoder
+ *
+ * $Id$
+ */
+
+#ifndef JPC_MQDEC_H
+#define JPC_MQDEC_H
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include "jasper/jas_types.h"
+#include "jasper/jas_stream.h"
+
+#include "jpc_mqcod.h"
+
+/******************************************************************************\
+* Types.
+\******************************************************************************/
+
+/* MQ arithmetic decoder. */
+
+typedef struct {
+
+       /* The C register. */
+       uint_fast32_t creg;
+
+       /* The A register. */
+       uint_fast32_t areg;
+
+       /* The CT register. */
+       uint_fast32_t ctreg;
+
+       /* The current context. */
+       jpc_mqstate_t **curctx;
+
+       /* The per-context information. */
+       jpc_mqstate_t **ctxs;
+
+       /* The maximum number of contexts. */
+       int maxctxs;
+
+       /* The stream from which to read data. */
+       jas_stream_t *in;
+
+       /* The last character read. */
+       uchar inbuffer;
+
+       /* The EOF indicator. */
+       int eof;
+
+} jpc_mqdec_t;
+
+/******************************************************************************\
+* Functions/macros for construction and destruction.
+\******************************************************************************/
+
+/* Create a MQ decoder. */
+jpc_mqdec_t *jpc_mqdec_create(int maxctxs, jas_stream_t *in);
+
+/* Destroy a MQ decoder. */
+void jpc_mqdec_destroy(jpc_mqdec_t *dec);
+
+/******************************************************************************\
+* Functions/macros for initialization.
+\******************************************************************************/
+
+/* Set the input stream associated with a MQ decoder. */
+void jpc_mqdec_setinput(jpc_mqdec_t *dec, jas_stream_t *in);
+
+/* Initialize a MQ decoder. */
+void jpc_mqdec_init(jpc_mqdec_t *dec);
+
+/******************************************************************************\
+* Functions/macros for manipulating contexts.
+\******************************************************************************/
+
+/* Set the current context for a MQ decoder. */
+#define        jpc_mqdec_setcurctx(dec, ctxno) \
+       ((mqdec)->curctx = &(mqdec)->ctxs[ctxno]);
+
+/* Set the state information for a particular context of a MQ decoder. */
+void jpc_mqdec_setctx(jpc_mqdec_t *dec, int ctxno, jpc_mqctx_t *ctx);
+
+/* Set the state information for all contexts of a MQ decoder. */
+void jpc_mqdec_setctxs(jpc_mqdec_t *dec, int numctxs, jpc_mqctx_t *ctxs);
+
+/******************************************************************************\
+* Functions/macros for decoding bits.
+\******************************************************************************/
+
+/* Decode a symbol. */
+#if !defined(DEBUG)
+#define        jpc_mqdec_getbit(dec) \
+       jpc_mqdec_getbit_macro(dec)
+#else
+#define        jpc_mqdec_getbit(dec) \
+       jpc_mqdec_getbit_func(dec)
+#endif
+
+/* Decode a symbol (assuming an unskewed probability distribution). */
+#if !defined(DEBUG)
+#define        jpc_mqdec_getbitnoskew(dec) \
+       jpc_mqdec_getbit_macro(dec)
+#else
+#define        jpc_mqdec_getbitnoskew(dec) \
+       jpc_mqdec_getbit_func(dec)
+#endif
+
+/******************************************************************************\
+* Functions/macros for debugging.
+\******************************************************************************/
+
+/* Dump the MQ decoder state for debugging. */
+void jpc_mqdec_dump(jpc_mqdec_t *dec, FILE *out);
+
+/******************************************************************************\
+* EVERYTHING BELOW THIS POINT IS IMPLEMENTATION SPECIFIC AND NOT PART OF THE
+* APPLICATION INTERFACE.  DO NOT RELY ON ANY OF THE INTERNAL FUNCTIONS/MACROS
+* GIVEN BELOW.
+\******************************************************************************/
+
+#define        jpc_mqdec_getbit_macro(dec) \
+       ((((dec)->areg -= (*(dec)->curctx)->qeval), \
+         (dec)->creg >> 16 >= (*(dec)->curctx)->qeval) ? \
+         ((((dec)->creg -= (*(dec)->curctx)->qeval << 16), \
+         (dec)->areg & 0x8000) ?  (*(dec)->curctx)->mps : \
+         jpc_mqdec_mpsexchrenormd(dec)) : \
+         jpc_mqdec_lpsexchrenormd(dec))
+
+#define        jpc_mqdec_mpsexchange(areg, delta, curctx, bit) \
+{ \
+       if ((areg) < (delta)) { \
+               register jpc_mqstate_t *state = *(curctx); \
+               /* LPS decoded. */ \
+               (bit) = state->mps ^ 1; \
+               *(curctx) = state->nlps; \
+       } else { \
+               register jpc_mqstate_t *state = *(curctx); \
+               /* MPS decoded. */ \
+               (bit) = state->mps; \
+               *(curctx) = state->nmps; \
+       } \
+}
+
+#define        jpc_mqdec_lpsexchange(areg, delta, curctx, bit) \
+{ \
+       if ((areg) >= (delta)) { \
+               register jpc_mqstate_t *state = *(curctx); \
+               (areg) = (delta); \
+               (bit) = state->mps ^ 1; \
+               *(curctx) = state->nlps; \
+       } else { \
+               register jpc_mqstate_t *state = *(curctx); \
+               (areg) = (delta); \
+               (bit) = state->mps; \
+               *(curctx) = state->nmps; \
+       } \
+}
+
+#define        jpc_mqdec_renormd(areg, creg, ctreg, in, eof, inbuf) \
+{ \
+       do { \
+               if (!(ctreg)) { \
+                       jpc_mqdec_bytein2(creg, ctreg, in, eof, inbuf); \
+               } \
+               (areg) <<= 1; \
+               (creg) <<= 1; \
+               --(ctreg); \
+       } while (!((areg) & 0x8000)); \
+}
+
+#define        jpc_mqdec_bytein2(creg, ctreg, in, eof, inbuf) \
+{ \
+       int c; \
+       unsigned char prevbuf; \
+       if (!(eof)) { \
+               if ((c = jas_stream_getc(in)) == EOF) { \
+                       (eof) = 1; \
+                       c = 0xff; \
+               } \
+               prevbuf = (inbuf); \
+               (inbuf) = c; \
+               if (prevbuf == 0xff) { \
+                       if (c > 0x8f) { \
+                               (creg) += 0xff00; \
+                               (ctreg) = 8; \
+                       } else { \
+                               (creg) += c << 9; \
+                               (ctreg) = 7; \
+                       } \
+               } else { \
+                       (creg) += c << 8; \
+                       (ctreg) = 8; \
+               } \
+       } else { \
+               (creg) += 0xff00; \
+               (ctreg) = 8; \
+       } \
+}
+
+int jpc_mqdec_getbit_func(jpc_mqdec_t *dec);
+int jpc_mqdec_mpsexchrenormd(jpc_mqdec_t *dec);
+int jpc_mqdec_lpsexchrenormd(jpc_mqdec_t *dec);
+
+#endif
diff --git a/src/libjasper/jpc/jpc_mqenc.c b/src/libjasper/jpc/jpc_mqenc.c
new file mode 100644 (file)
index 0000000..758b361
--- /dev/null
@@ -0,0 +1,392 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * MQ Arithmetic Encoder
+ *
+ * $Id$
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <assert.h>
+#include <stdlib.h>
+
+#include "jasper/jas_stream.h"
+#include "jasper/jas_malloc.h"
+#include "jasper/jas_math.h"
+#include "jasper/jas_debug.h"
+
+#include "jpc_mqenc.h"
+
+/******************************************************************************\
+* Macros
+\******************************************************************************/
+
+#if defined(DEBUG)
+#define        JPC_MQENC_CALL(n, x) \
+       ((jas_getdbglevel() >= (n)) ? ((void)(x)) : ((void)0))
+#else
+#define        JPC_MQENC_CALL(n, x)
+#endif
+
+#define        jpc_mqenc_codemps9(areg, creg, ctreg, curctx, enc) \
+{ \
+       jpc_mqstate_t *state = *(curctx); \
+       (areg) -= state->qeval; \
+       if (!((areg) & 0x8000)) { \
+               if ((areg) < state->qeval) { \
+                       (areg) = state->qeval; \
+               } else { \
+                       (creg) += state->qeval; \
+               } \
+               *(curctx) = state->nmps; \
+               jpc_mqenc_renorme((areg), (creg), (ctreg), (enc)); \
+       } else { \
+               (creg) += state->qeval; \
+       } \
+}
+
+#define        jpc_mqenc_codelps2(areg, creg, ctreg, curctx, enc) \
+{ \
+       jpc_mqstate_t *state = *(curctx); \
+       (areg) -= state->qeval; \
+       if ((areg) < state->qeval) { \
+               (creg) += state->qeval; \
+       } else { \
+               (areg) = state->qeval; \
+       } \
+       *(curctx) = state->nlps; \
+       jpc_mqenc_renorme((areg), (creg), (ctreg), (enc)); \
+}
+
+#define        jpc_mqenc_renorme(areg, creg, ctreg, enc) \
+{ \
+       do { \
+               (areg) <<= 1; \
+               (creg) <<= 1; \
+               if (!--(ctreg)) { \
+                       jpc_mqenc_byteout((areg), (creg), (ctreg), (enc)); \
+               } \
+       } while (!((areg) & 0x8000)); \
+}
+
+#define        jpc_mqenc_byteout(areg, creg, ctreg, enc) \
+{ \
+       if ((enc)->outbuf != 0xff) { \
+               if ((creg) & 0x8000000) { \
+                       if (++((enc)->outbuf) == 0xff) { \
+                               (creg) &= 0x7ffffff; \
+                               jpc_mqenc_byteout2(enc); \
+                               enc->outbuf = ((creg) >> 20) & 0xff; \
+                               (creg) &= 0xfffff; \
+                               (ctreg) = 7; \
+                       } else { \
+                               jpc_mqenc_byteout2(enc); \
+                               enc->outbuf = ((creg) >> 19) & 0xff; \
+                               (creg) &= 0x7ffff; \
+                               (ctreg) = 8; \
+                       } \
+               } else { \
+                       jpc_mqenc_byteout2(enc); \
+                       (enc)->outbuf = ((creg) >> 19) & 0xff; \
+                       (creg) &= 0x7ffff; \
+                       (ctreg) = 8; \
+               } \
+       } else { \
+               jpc_mqenc_byteout2(enc); \
+               (enc)->outbuf = ((creg) >> 20) & 0xff; \
+               (creg) &= 0xfffff; \
+               (ctreg) = 7; \
+       } \
+}
+
+#define        jpc_mqenc_byteout2(enc) \
+{ \
+       if (enc->outbuf >= 0) { \
+               if (jas_stream_putc(enc->out, (unsigned char)enc->outbuf) == EOF) { \
+                       enc->err |= 1; \
+               } \
+       } \
+       enc->lastbyte = enc->outbuf; \
+}
+
+/******************************************************************************\
+* Local function protoypes.
+\******************************************************************************/
+
+static void jpc_mqenc_setbits(jpc_mqenc_t *mqenc);
+
+/******************************************************************************\
+* Code for creation and destruction of encoder.
+\******************************************************************************/
+
+/* Create a MQ encoder. */
+
+jpc_mqenc_t *jpc_mqenc_create(int maxctxs, jas_stream_t *out)
+{
+       jpc_mqenc_t *mqenc;
+
+       /* Allocate memory for the MQ encoder. */
+       if (!(mqenc = jas_malloc(sizeof(jpc_mqenc_t)))) {
+               goto error;
+       }
+       mqenc->out = out;
+       mqenc->maxctxs = maxctxs;
+
+       /* Allocate memory for the per-context state information. */
+       if (!(mqenc->ctxs = jas_malloc(mqenc->maxctxs * sizeof(jpc_mqstate_t *)))) {
+               goto error;
+       }
+
+       /* Set the current context to the first one. */
+       mqenc->curctx = mqenc->ctxs;
+
+       jpc_mqenc_init(mqenc);
+
+       /* Initialize the per-context state information to something sane. */
+       jpc_mqenc_setctxs(mqenc, 0, 0);
+
+       return mqenc;
+
+error:
+       if (mqenc) {
+               jpc_mqenc_destroy(mqenc);
+       }
+       return 0;
+}
+
+/* Destroy a MQ encoder. */
+
+void jpc_mqenc_destroy(jpc_mqenc_t *mqenc)
+{
+       if (mqenc->ctxs) {
+               jas_free(mqenc->ctxs);
+       }
+       jas_free(mqenc);
+}
+
+/******************************************************************************\
+* State initialization code.
+\******************************************************************************/
+
+/* Initialize the coding state of a MQ encoder. */
+
+void jpc_mqenc_init(jpc_mqenc_t *mqenc)
+{
+       mqenc->areg = 0x8000;
+       mqenc->outbuf = -1;
+       mqenc->creg = 0;
+       mqenc->ctreg = 12;
+       mqenc->lastbyte = -1;
+       mqenc->err = 0;
+}
+
+/* Initialize one or more contexts. */
+
+void jpc_mqenc_setctxs(jpc_mqenc_t *mqenc, int numctxs, jpc_mqctx_t *ctxs)
+{
+       jpc_mqstate_t **ctx;
+       int n;
+
+       ctx = mqenc->ctxs;
+       n = JAS_MIN(mqenc->maxctxs, numctxs);
+       while (--n >= 0) {
+               *ctx = &jpc_mqstates[2 * ctxs->ind + ctxs->mps];
+               ++ctx;
+               ++ctxs;
+       }
+       n = mqenc->maxctxs - numctxs;
+       while (--n >= 0) {
+               *ctx = &jpc_mqstates[0];
+               ++ctx;
+       }
+
+}
+
+/* Get the coding state for a MQ encoder. */
+
+void jpc_mqenc_getstate(jpc_mqenc_t *mqenc, jpc_mqencstate_t *state)
+{
+       state->areg = mqenc->areg;
+       state->creg = mqenc->creg;
+       state->ctreg = mqenc->ctreg;
+       state->lastbyte = mqenc->lastbyte;
+}
+
+/******************************************************************************\
+* Code for coding symbols.
+\******************************************************************************/
+
+/* Encode a bit. */
+
+int jpc_mqenc_putbit_func(jpc_mqenc_t *mqenc, int bit)
+{
+       const jpc_mqstate_t *state;
+       JAS_DBGLOG(100, ("jpc_mqenc_putbit(%p, %d)\n", mqenc, bit));
+       JPC_MQENC_CALL(100, jpc_mqenc_dump(mqenc, stderr));
+
+       state = *(mqenc->curctx);
+
+       if (state->mps == bit) {
+               /* Apply the CODEMPS algorithm as defined in the standard. */
+               mqenc->areg -= state->qeval;
+               if (!(mqenc->areg & 0x8000)) {
+                       jpc_mqenc_codemps2(mqenc);
+               } else {
+                       mqenc->creg += state->qeval;
+               }
+       } else {
+               /* Apply the CODELPS algorithm as defined in the standard. */
+               jpc_mqenc_codelps2(mqenc->areg, mqenc->creg, mqenc->ctreg, mqenc->curctx, mqenc);
+       }
+
+       return jpc_mqenc_error(mqenc) ? (-1) : 0;
+}
+
+int jpc_mqenc_codemps2(jpc_mqenc_t *mqenc)
+{
+       /* Note: This function only performs part of the work associated with
+       the CODEMPS algorithm from the standard.  Some of the work is also
+       performed by the caller. */
+
+       jpc_mqstate_t *state = *(mqenc->curctx);
+       if (mqenc->areg < state->qeval) {
+               mqenc->areg = state->qeval;
+       } else {
+               mqenc->creg += state->qeval;
+       }
+       *mqenc->curctx = state->nmps;
+       jpc_mqenc_renorme(mqenc->areg, mqenc->creg, mqenc->ctreg, mqenc);
+       return jpc_mqenc_error(mqenc) ? (-1) : 0;
+}
+
+int jpc_mqenc_codelps(jpc_mqenc_t *mqenc)
+{
+       jpc_mqenc_codelps2(mqenc->areg, mqenc->creg, mqenc->ctreg, mqenc->curctx, mqenc);
+       return jpc_mqenc_error(mqenc) ? (-1) : 0;
+}
+
+/******************************************************************************\
+* Miscellaneous code.
+\******************************************************************************/
+
+/* Terminate the code word. */
+
+int jpc_mqenc_flush(jpc_mqenc_t *mqenc, int termmode)
+{
+       int_fast16_t k;
+
+       switch (termmode) {
+       case JPC_MQENC_PTERM:
+               k = 11 - mqenc->ctreg + 1;
+               while (k > 0) {
+                       mqenc->creg <<= mqenc->ctreg;
+                       mqenc->ctreg = 0;
+                       jpc_mqenc_byteout(mqenc->areg, mqenc->creg, mqenc->ctreg,
+                         mqenc);
+                       k -= mqenc->ctreg;
+               }
+               if (mqenc->outbuf != 0xff) {
+                       jpc_mqenc_byteout(mqenc->areg, mqenc->creg, mqenc->ctreg, mqenc);
+               }
+               break;
+       case JPC_MQENC_DEFTERM:
+               jpc_mqenc_setbits(mqenc);
+               mqenc->creg <<= mqenc->ctreg;
+               jpc_mqenc_byteout(mqenc->areg, mqenc->creg, mqenc->ctreg, mqenc);
+               mqenc->creg <<= mqenc->ctreg;
+               jpc_mqenc_byteout(mqenc->areg, mqenc->creg, mqenc->ctreg, mqenc);
+               if (mqenc->outbuf != 0xff) {
+                       jpc_mqenc_byteout(mqenc->areg, mqenc->creg, mqenc->ctreg, mqenc);
+               }
+               break;
+       default:
+               abort();
+               break;
+       }
+       return 0;
+}
+
+static void jpc_mqenc_setbits(jpc_mqenc_t *mqenc)
+{
+       uint_fast32_t tmp = mqenc->creg + mqenc->areg;
+       mqenc->creg |= 0xffff;
+       if (mqenc->creg >= tmp) {
+               mqenc->creg -= 0x8000;
+       }
+}
+
+/* Dump a MQ encoder to a stream for debugging. */
+
+int jpc_mqenc_dump(jpc_mqenc_t *mqenc, FILE *out)
+{
+       fprintf(out, "AREG = %08x, CREG = %08x, CTREG = %d\n",
+         mqenc->areg, mqenc->creg, mqenc->ctreg);
+       fprintf(out, "IND = %02d, MPS = %d, QEVAL = %04x\n",
+         *mqenc->curctx - jpc_mqstates, (*mqenc->curctx)->mps,
+         (*mqenc->curctx)->qeval);
+       return 0;
+}
diff --git a/src/libjasper/jpc/jpc_mqenc.h b/src/libjasper/jpc/jpc_mqenc.h
new file mode 100644 (file)
index 0000000..dff1190
--- /dev/null
@@ -0,0 +1,236 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * MQ Arithmetic Encoder
+ *
+ * $Id$
+ */
+
+#ifndef JPC_MQENC_H
+#define JPC_MQENC_H
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include "jasper/jas_types.h"
+#include "jasper/jas_stream.h"
+
+#include "jpc_mqcod.h"
+
+/******************************************************************************\
+* Constants.
+\******************************************************************************/
+
+/*
+ * Termination modes.
+ */
+
+#define        JPC_MQENC_DEFTERM       0       /* default termination */
+#define        JPC_MQENC_PTERM         1       /* predictable termination */
+
+/******************************************************************************\
+* Types.
+\******************************************************************************/
+
+/* MQ arithmetic encoder class. */
+
+typedef struct {
+
+       /* The C register. */
+       uint_fast32_t creg;
+
+       /* The A register. */
+       uint_fast32_t areg;
+
+       /* The CT register. */
+       uint_fast32_t ctreg;
+
+       /* The maximum number of contexts. */
+       int maxctxs;
+
+       /* The per-context information. */
+       jpc_mqstate_t **ctxs;
+
+       /* The current context. */
+       jpc_mqstate_t **curctx;
+
+       /* The stream for encoder output. */
+       jas_stream_t *out;
+
+       /* The byte buffer (i.e., the B variable in the standard). */
+       int_fast16_t outbuf;
+
+       /* The last byte output. */
+       int_fast16_t lastbyte;
+
+       /* The error indicator. */
+       int err;
+       
+} jpc_mqenc_t;
+
+/* MQ arithmetic encoder state information. */
+
+typedef struct {
+
+       /* The A register. */
+       unsigned areg;
+
+       /* The C register. */
+       unsigned creg;
+
+       /* The CT register. */
+       unsigned ctreg;
+
+       /* The last byte output by the encoder. */
+       int lastbyte;
+
+} jpc_mqencstate_t;
+
+/******************************************************************************\
+* Functions/macros for construction and destruction.
+\******************************************************************************/
+
+/* Create a MQ encoder. */
+jpc_mqenc_t *jpc_mqenc_create(int maxctxs, jas_stream_t *out);
+
+/* Destroy a MQ encoder. */
+void jpc_mqenc_destroy(jpc_mqenc_t *enc);
+
+/******************************************************************************\
+* Functions/macros for initialization.
+\******************************************************************************/
+
+/* Initialize a MQ encoder. */
+void jpc_mqenc_init(jpc_mqenc_t *enc);
+
+/******************************************************************************\
+* Functions/macros for context manipulation.
+\******************************************************************************/
+
+/* Set the current context. */
+#define        jpc_mqenc_setcurctx(enc, ctxno) \
+        ((enc)->curctx = &(enc)->ctxs[ctxno]);
+
+/* Set the state information for a particular context. */
+void jpc_mqenc_setctx(jpc_mqenc_t *enc, int ctxno, jpc_mqctx_t *ctx);
+
+/* Set the state information for multiple contexts. */
+void jpc_mqenc_setctxs(jpc_mqenc_t *enc, int numctxs, jpc_mqctx_t *ctxs);
+
+/******************************************************************************\
+* Miscellaneous functions/macros.
+\******************************************************************************/
+
+/* Get the error state of a MQ encoder. */
+#define        jpc_mqenc_error(enc) \
+       ((enc)->err)
+
+/* Get the current encoder state. */
+void jpc_mqenc_getstate(jpc_mqenc_t *enc, jpc_mqencstate_t *state);
+
+/* Terminate the code. */
+int jpc_mqenc_flush(jpc_mqenc_t *enc, int termmode);
+
+/******************************************************************************\
+* Functions/macros for encoding bits.
+\******************************************************************************/
+
+/* Encode a bit. */
+#if !defined(DEBUG)
+#define        jpc_mqenc_putbit(enc, bit)      jpc_mqenc_putbit_macro(enc, bit)
+#else
+#define        jpc_mqenc_putbit(enc, bit)      jpc_mqenc_putbit_func(enc, bit)
+#endif
+
+/******************************************************************************\
+* Functions/macros for debugging.
+\******************************************************************************/
+
+int jpc_mqenc_dump(jpc_mqenc_t *mqenc, FILE *out);
+
+/******************************************************************************\
+* Implementation-specific details.
+\******************************************************************************/
+
+/* Note: This macro is included only to satisfy the needs of
+  the mqenc_putbit macro. */
+#define        jpc_mqenc_putbit_macro(enc, bit) \
+       (((*((enc)->curctx))->mps == (bit)) ? \
+         (((enc)->areg -= (*(enc)->curctx)->qeval), \
+         ((!((enc)->areg & 0x8000)) ? (jpc_mqenc_codemps2(enc)) : \
+         ((enc)->creg += (*(enc)->curctx)->qeval))) : \
+         jpc_mqenc_codelps(enc))
+
+/* Note: These function prototypes are included only to satisfy the
+  needs of the mqenc_putbit_macro macro.  Do not call any of these
+  functions directly. */
+int jpc_mqenc_codemps2(jpc_mqenc_t *enc);
+int jpc_mqenc_codelps(jpc_mqenc_t *enc);
+
+/* Note: This function prototype is included only to satisfy the needs of
+  the mqenc_putbit macro. */
+int jpc_mqenc_putbit_func(jpc_mqenc_t *enc, int bit);
+
+#endif
diff --git a/src/libjasper/jpc/jpc_qmfb.c b/src/libjasper/jpc/jpc_qmfb.c
new file mode 100644 (file)
index 0000000..00d406d
--- /dev/null
@@ -0,0 +1,3144 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Quadrature Mirror-Image Filter Bank (QMFB) Library
+ *
+ * $Id$
+ */
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+#undef WT_LENONE /* This is not needed due to normalization. */
+#define WT_DOSCALE
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <assert.h>
+#include "jasper/jas_fix.h"
+#include "jasper/jas_malloc.h"
+#include "jasper/jas_math.h"
+
+#include "jpc_qmfb.h"
+#include "jpc_tsfb.h"
+#include "jpc_math.h"
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+#define QMFB_SPLITBUFSIZE      4096
+#define        QMFB_JOINBUFSIZE        4096
+
+int jpc_ft_analyze(jpc_fix_t *a, int xstart, int ystart, int width, int height,
+  int stride);
+int jpc_ft_synthesize(int *a, int xstart, int ystart, int width, int height,
+  int stride);
+
+int jpc_ns_analyze(jpc_fix_t *a, int xstart, int ystart, int width, int height,
+  int stride);
+int jpc_ns_synthesize(jpc_fix_t *a, int xstart, int ystart, int width,
+  int height, int stride);
+
+void jpc_ft_fwdlift_row(jpc_fix_t *a, int numcols, int parity);
+void jpc_ft_fwdlift_col(jpc_fix_t *a, int numrows, int stride,
+  int parity);
+void jpc_ft_fwdlift_colgrp(jpc_fix_t *a, int numrows, int stride,
+  int parity);
+void jpc_ft_fwdlift_colres(jpc_fix_t *a, int numrows, int numcols,
+  int stride, int parity);
+
+void jpc_ft_invlift_row(jpc_fix_t *a, int numcols, int parity);
+void jpc_ft_invlift_col(jpc_fix_t *a, int numrows, int stride,
+  int parity);
+void jpc_ft_invlift_colgrp(jpc_fix_t *a, int numrows, int stride,
+  int parity);
+void jpc_ft_invlift_colres(jpc_fix_t *a, int numrows, int numcols,
+  int stride, int parity);
+
+void jpc_ns_fwdlift_row(jpc_fix_t *a, int numcols, int parity);
+void jpc_ns_fwdlift_colgrp(jpc_fix_t *a, int numrows, int stride, int parity);
+void jpc_ns_fwdlift_colres(jpc_fix_t *a, int numrows, int numcols, int stride,
+  int parity);
+void jpc_ns_invlift_row(jpc_fix_t *a, int numcols, int parity);
+void jpc_ns_invlift_colgrp(jpc_fix_t *a, int numrows, int stride, int parity);
+void jpc_ns_invlift_colres(jpc_fix_t *a, int numrows, int numcols, int stride,
+  int parity);
+
+void jpc_qmfb_split_row(jpc_fix_t *a, int numcols, int parity);
+void jpc_qmfb_split_col(jpc_fix_t *a, int numrows, int stride, int parity);
+void jpc_qmfb_split_colgrp(jpc_fix_t *a, int numrows, int stride, int parity);
+void jpc_qmfb_split_colres(jpc_fix_t *a, int numrows, int numcols, int stride,
+  int parity);
+
+void jpc_qmfb_join_row(jpc_fix_t *a, int numcols, int parity);
+void jpc_qmfb_join_col(jpc_fix_t *a, int numrows, int stride, int parity);
+void jpc_qmfb_join_colgrp(jpc_fix_t *a, int numrows, int stride, int parity);
+void jpc_qmfb_join_colres(jpc_fix_t *a, int numrows, int numcols, int stride,
+  int parity);
+
+double jpc_ft_lpenergywts[32] = {
+       1.2247448713915889,
+       1.6583123951776999,
+       2.3184046238739260,
+       3.2691742076555053,
+       4.6199296531440819,
+       6.5323713152269596,
+       9.2377452606141937,
+       13.0639951297449581,
+       18.4752262333915667,
+       26.1278968190610392,
+       36.9504194305524791,
+       52.2557819580462777,
+       73.9008347315741645,
+       104.5115624560829133,
+       147.8016689469569656,
+       209.0231247296646018,
+       295.6033378293900000,
+       418.0462494347059419,
+       591.2066756503630813,
+       836.0924988714708661,
+       /* approximations */
+       836.0924988714708661,
+       836.0924988714708661,
+       836.0924988714708661,
+       836.0924988714708661,
+       836.0924988714708661,
+       836.0924988714708661,
+       836.0924988714708661,
+       836.0924988714708661,
+       836.0924988714708661,
+       836.0924988714708661,
+       836.0924988714708661,
+       836.0924988714708661
+};
+
+double jpc_ft_hpenergywts[32] = {
+       0.8477912478906585,
+       0.9601432184835760,
+       1.2593401049756179,
+       1.7444107171191079,
+       2.4538713036750726,
+       3.4656517695088755,
+       4.8995276398597856,
+       6.9283970402160842,
+       9.7980274940131444,
+       13.8564306871112652,
+       19.5959265076535587,
+       27.7128159494245487,
+       39.1918369552045860,
+       55.4256262207444053,
+       78.3836719028959124,
+       110.8512517317256822,
+       156.7673435548526868,
+       221.7025033739244293,
+       313.5346870787551552,
+       443.4050067351659550,
+       /* approximations */
+       443.4050067351659550,
+       443.4050067351659550,
+       443.4050067351659550,
+       443.4050067351659550,
+       443.4050067351659550,
+       443.4050067351659550,
+       443.4050067351659550,
+       443.4050067351659550,
+       443.4050067351659550,
+       443.4050067351659550,
+       443.4050067351659550,
+       443.4050067351659550
+};
+
+double jpc_ns_lpenergywts[32] = {
+       1.4021081679297411,
+       2.0303718560817923,
+       2.9011625562785555,
+       4.1152851751758002,
+       5.8245108637728071,
+       8.2387599345725171,
+       11.6519546479210838,
+       16.4785606470644375,
+       23.3042776444606794,
+       32.9572515613740435,
+       46.6086013487782793,
+       65.9145194076860861,
+       93.2172084551803977,
+       131.8290408510004283,
+       186.4344176300625691,
+       263.6580819564562148,
+       372.8688353500955373,
+       527.3161639447193920,
+       745.7376707114038936,
+       1054.6323278917823245,
+       /* approximations follow */
+       1054.6323278917823245,
+       1054.6323278917823245,
+       1054.6323278917823245,
+       1054.6323278917823245,
+       1054.6323278917823245,
+       1054.6323278917823245,
+       1054.6323278917823245,
+       1054.6323278917823245,
+       1054.6323278917823245,
+       1054.6323278917823245,
+       1054.6323278917823245,
+       1054.6323278917823245
+};
+
+double jpc_ns_hpenergywts[32] = {
+       1.4425227650161456,
+       1.9669426082455688,
+       2.8839248082788891,
+       4.1475208393432981,
+       5.8946497530677817,
+       8.3471789178590949,
+       11.8086046551047463,
+       16.7012780415647804,
+       23.6196657032246620,
+       33.4034255108592362,
+       47.2396388881632632,
+       66.8069597416714061,
+       94.4793162154500692,
+       133.6139330736999113,
+       188.9586372358249378,
+       267.2278678461869390,
+       377.9172750722391356,
+       534.4557359047058753,
+       755.8345502191498326,
+       1068.9114718353569060,
+       /* approximations follow */
+       1068.9114718353569060,
+       1068.9114718353569060,
+       1068.9114718353569060,
+       1068.9114718353569060,
+       1068.9114718353569060,
+       1068.9114718353569060,
+       1068.9114718353569060,
+       1068.9114718353569060,
+       1068.9114718353569060,
+       1068.9114718353569060,
+       1068.9114718353569060
+};
+
+jpc_qmfb2d_t jpc_ft_qmfb2d = {
+       jpc_ft_analyze,
+       jpc_ft_synthesize,
+       jpc_ft_lpenergywts,
+       jpc_ft_hpenergywts
+};
+
+jpc_qmfb2d_t jpc_ns_qmfb2d = {
+       jpc_ns_analyze,
+       jpc_ns_synthesize,
+       jpc_ns_lpenergywts,
+       jpc_ns_hpenergywts
+};
+
+/******************************************************************************\
+* generic
+\******************************************************************************/
+
+void jpc_qmfb_split_row(jpc_fix_t *a, int numcols, int parity)
+{
+
+       int bufsize = JPC_CEILDIVPOW2(numcols, 1);
+#if !defined(HAVE_VLA)
+       jpc_fix_t splitbuf[QMFB_SPLITBUFSIZE];
+#else
+       jpc_fix_t splitbuf[bufsize];
+#endif
+       jpc_fix_t *buf = splitbuf;
+       register jpc_fix_t *srcptr;
+       register jpc_fix_t *dstptr;
+       register int n;
+       register int m;
+       int hstartcol;
+
+#if !defined(HAVE_VLA)
+       /* Get a buffer. */
+       if (bufsize > QMFB_SPLITBUFSIZE) {
+               if (!(buf = jas_malloc(bufsize * sizeof(jpc_fix_t)))) {
+                       /* We have no choice but to commit suicide in this case. */
+                       abort();
+               }
+       }
+#endif
+
+       if (numcols >= 2) {
+               hstartcol = (numcols + 1 - parity) >> 1;
+               m = (parity) ? hstartcol : (numcols - hstartcol);
+               /* Save the samples destined for the highpass channel. */
+               n = m;
+               dstptr = buf;
+               srcptr = &a[1 - parity];
+               while (n-- > 0) {
+                       *dstptr = *srcptr;
+                       ++dstptr;
+                       srcptr += 2;
+               }
+               /* Copy the appropriate samples into the lowpass channel. */
+               dstptr = &a[1 - parity];
+               srcptr = &a[2 - parity];
+               n = numcols - m - (!parity);
+               while (n-- > 0) {
+                       *dstptr = *srcptr;
+                       ++dstptr;
+                       srcptr += 2;
+               }
+               /* Copy the saved samples into the highpass channel. */
+               dstptr = &a[hstartcol];
+               srcptr = buf;
+               n = m;
+               while (n-- > 0) {
+                       *dstptr = *srcptr;
+                       ++dstptr;
+                       ++srcptr;
+               }
+       }
+
+#if !defined(HAVE_VLA)
+       /* If the split buffer was allocated on the heap, free this memory. */
+       if (buf != splitbuf) {
+               jas_free(buf);
+       }
+#endif
+
+}
+
+void jpc_qmfb_split_col(jpc_fix_t *a, int numrows, int stride,
+  int parity)
+{
+
+       int bufsize = JPC_CEILDIVPOW2(numrows, 1);
+#if !defined(HAVE_VLA)
+       jpc_fix_t splitbuf[QMFB_SPLITBUFSIZE];
+#else
+       jpc_fix_t splitbuf[bufsize];
+#endif
+       jpc_fix_t *buf = splitbuf;
+       register jpc_fix_t *srcptr;
+       register jpc_fix_t *dstptr;
+       register int n;
+       register int m;
+       int hstartcol;
+
+#if !defined(HAVE_VLA)
+       /* Get a buffer. */
+       if (bufsize > QMFB_SPLITBUFSIZE) {
+               if (!(buf = jas_malloc(bufsize * sizeof(jpc_fix_t)))) {
+                       /* We have no choice but to commit suicide in this case. */
+                       abort();
+               }
+       }
+#endif
+
+       if (numrows >= 2) {
+               hstartcol = (numrows + 1 - parity) >> 1;
+               m = (parity) ? hstartcol : (numrows - hstartcol);
+               /* Save the samples destined for the highpass channel. */
+               n = m;
+               dstptr = buf;
+               srcptr = &a[(1 - parity) * stride];
+               while (n-- > 0) {
+                       *dstptr = *srcptr;
+                       ++dstptr;
+                       srcptr += stride << 1;
+               }
+               /* Copy the appropriate samples into the lowpass channel. */
+               dstptr = &a[(1 - parity) * stride];
+               srcptr = &a[(2 - parity) * stride];
+               n = numrows - m - (!parity);
+               while (n-- > 0) {
+                       *dstptr = *srcptr;
+                       dstptr += stride;
+                       srcptr += stride << 1;
+               }
+               /* Copy the saved samples into the highpass channel. */
+               dstptr = &a[hstartcol * stride];
+               srcptr = buf;
+               n = m;
+               while (n-- > 0) {
+                       *dstptr = *srcptr;
+                       dstptr += stride;
+                       ++srcptr;
+               }
+       }
+
+#if !defined(HAVE_VLA)
+       /* If the split buffer was allocated on the heap, free this memory. */
+       if (buf != splitbuf) {
+               jas_free(buf);
+       }
+#endif
+
+}
+
+void jpc_qmfb_split_colgrp(jpc_fix_t *a, int numrows, int stride,
+  int parity)
+{
+
+       int bufsize = JPC_CEILDIVPOW2(numrows, 1);
+#if !defined(HAVE_VLA)
+       jpc_fix_t splitbuf[QMFB_SPLITBUFSIZE * JPC_QMFB_COLGRPSIZE];
+#else
+       jpc_fix_t splitbuf[bufsize * JPC_QMFB_COLGRPSIZE];
+#endif
+       jpc_fix_t *buf = splitbuf;
+       jpc_fix_t *srcptr;
+       jpc_fix_t *dstptr;
+       register jpc_fix_t *srcptr2;
+       register jpc_fix_t *dstptr2;
+       register int n;
+       register int i;
+       int m;
+       int hstartcol;
+
+#if !defined(HAVE_VLA)
+       /* Get a buffer. */
+       if (bufsize > QMFB_SPLITBUFSIZE) {
+               if (!(buf = jas_malloc(bufsize * sizeof(jpc_fix_t)))) {
+                       /* We have no choice but to commit suicide in this case. */
+                       abort();
+               }
+       }
+#endif
+
+       if (numrows >= 2) {
+               hstartcol = (numrows + 1 - parity) >> 1;
+               m = (parity) ? hstartcol : (numrows - hstartcol);
+               /* Save the samples destined for the highpass channel. */
+               n = m;
+               dstptr = buf;
+               srcptr = &a[(1 - parity) * stride];
+               while (n-- > 0) {
+                       dstptr2 = dstptr;
+                       srcptr2 = srcptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               *dstptr2 = *srcptr2;
+                               ++dstptr2;
+                               ++srcptr2;
+                       }
+                       dstptr += JPC_QMFB_COLGRPSIZE;
+                       srcptr += stride << 1;
+               }
+               /* Copy the appropriate samples into the lowpass channel. */
+               dstptr = &a[(1 - parity) * stride];
+               srcptr = &a[(2 - parity) * stride];
+               n = numrows - m - (!parity);
+               while (n-- > 0) {
+                       dstptr2 = dstptr;
+                       srcptr2 = srcptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               *dstptr2 = *srcptr2;
+                               ++dstptr2;
+                               ++srcptr2;
+                       }
+                       dstptr += stride;
+                       srcptr += stride << 1;
+               }
+               /* Copy the saved samples into the highpass channel. */
+               dstptr = &a[hstartcol * stride];
+               srcptr = buf;
+               n = m;
+               while (n-- > 0) {
+                       dstptr2 = dstptr;
+                       srcptr2 = srcptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               *dstptr2 = *srcptr2;
+                               ++dstptr2;
+                               ++srcptr2;
+                       }
+                       dstptr += stride;
+                       srcptr += JPC_QMFB_COLGRPSIZE;
+               }
+       }
+
+#if !defined(HAVE_VLA)
+       /* If the split buffer was allocated on the heap, free this memory. */
+       if (buf != splitbuf) {
+               jas_free(buf);
+       }
+#endif
+
+}
+
+void jpc_qmfb_split_colres(jpc_fix_t *a, int numrows, int numcols,
+  int stride, int parity)
+{
+
+       int bufsize = JPC_CEILDIVPOW2(numrows, 1);
+#if !defined(HAVE_VLA)
+       jpc_fix_t splitbuf[QMFB_SPLITBUFSIZE * JPC_QMFB_COLGRPSIZE];
+#else
+       jpc_fix_t splitbuf[bufsize * numcols];
+#endif
+       jpc_fix_t *buf = splitbuf;
+       jpc_fix_t *srcptr;
+       jpc_fix_t *dstptr;
+       register jpc_fix_t *srcptr2;
+       register jpc_fix_t *dstptr2;
+       register int n;
+       register int i;
+       int m;
+       int hstartcol;
+
+#if !defined(HAVE_VLA)
+       /* Get a buffer. */
+       if (bufsize > QMFB_SPLITBUFSIZE) {
+               if (!(buf = jas_malloc(bufsize * sizeof(jpc_fix_t)))) {
+                       /* We have no choice but to commit suicide in this case. */
+                       abort();
+               }
+       }
+#endif
+
+       if (numrows >= 2) {
+               hstartcol = (numrows + 1 - parity) >> 1;
+               m = (parity) ? hstartcol : (numrows - hstartcol);
+               /* Save the samples destined for the highpass channel. */
+               n = m;
+               dstptr = buf;
+               srcptr = &a[(1 - parity) * stride];
+               while (n-- > 0) {
+                       dstptr2 = dstptr;
+                       srcptr2 = srcptr;
+                       for (i = 0; i < numcols; ++i) {
+                               *dstptr2 = *srcptr2;
+                               ++dstptr2;
+                               ++srcptr2;
+                       }
+                       dstptr += numcols;
+                       srcptr += stride << 1;
+               }
+               /* Copy the appropriate samples into the lowpass channel. */
+               dstptr = &a[(1 - parity) * stride];
+               srcptr = &a[(2 - parity) * stride];
+               n = numrows - m - (!parity);
+               while (n-- > 0) {
+                       dstptr2 = dstptr;
+                       srcptr2 = srcptr;
+                       for (i = 0; i < numcols; ++i) {
+                               *dstptr2 = *srcptr2;
+                               ++dstptr2;
+                               ++srcptr2;
+                       }
+                       dstptr += stride;
+                       srcptr += stride << 1;
+               }
+               /* Copy the saved samples into the highpass channel. */
+               dstptr = &a[hstartcol * stride];
+               srcptr = buf;
+               n = m;
+               while (n-- > 0) {
+                       dstptr2 = dstptr;
+                       srcptr2 = srcptr;
+                       for (i = 0; i < numcols; ++i) {
+                               *dstptr2 = *srcptr2;
+                               ++dstptr2;
+                               ++srcptr2;
+                       }
+                       dstptr += stride;
+                       srcptr += numcols;
+               }
+       }
+
+#if !defined(HAVE_VLA)
+       /* If the split buffer was allocated on the heap, free this memory. */
+       if (buf != splitbuf) {
+               jas_free(buf);
+       }
+#endif
+
+}
+
+void jpc_qmfb_join_row(jpc_fix_t *a, int numcols, int parity)
+{
+
+       int bufsize = JPC_CEILDIVPOW2(numcols, 1);
+#if !defined(HAVE_VLA)
+       jpc_fix_t joinbuf[QMFB_JOINBUFSIZE];
+#else
+       jpc_fix_t joinbuf[bufsize];
+#endif
+       jpc_fix_t *buf = joinbuf;
+       register jpc_fix_t *srcptr;
+       register jpc_fix_t *dstptr;
+       register int n;
+       int hstartcol;
+
+#if !defined(HAVE_VLA)
+       /* Allocate memory for the join buffer from the heap. */
+       if (bufsize > QMFB_JOINBUFSIZE) {
+               if (!(buf = jas_malloc(bufsize * sizeof(jpc_fix_t)))) {
+                       /* We have no choice but to commit suicide. */
+                       abort();
+               }
+       }
+#endif
+
+       hstartcol = (numcols + 1 - parity) >> 1;
+
+       /* Save the samples from the lowpass channel. */
+       n = hstartcol;
+       srcptr = &a[0];
+       dstptr = buf;
+       while (n-- > 0) {
+               *dstptr = *srcptr;
+               ++srcptr;
+               ++dstptr;
+       }
+       /* Copy the samples from the highpass channel into place. */
+       srcptr = &a[hstartcol];
+       dstptr = &a[1 - parity];
+       n = numcols - hstartcol;
+       while (n-- > 0) {
+               *dstptr = *srcptr;
+               dstptr += 2;
+               ++srcptr;
+       }
+       /* Copy the samples from the lowpass channel into place. */
+       srcptr = buf;
+       dstptr = &a[parity];
+       n = hstartcol;
+       while (n-- > 0) {
+               *dstptr = *srcptr;
+               dstptr += 2;
+               ++srcptr;
+       }
+
+#if !defined(HAVE_VLA)
+       /* If the join buffer was allocated on the heap, free this memory. */
+       if (buf != joinbuf) {
+               jas_free(buf);
+       }
+#endif
+
+}
+
+void jpc_qmfb_join_col(jpc_fix_t *a, int numrows, int stride,
+  int parity)
+{
+
+       int bufsize = JPC_CEILDIVPOW2(numrows, 1);
+#if !defined(HAVE_VLA)
+       jpc_fix_t joinbuf[QMFB_JOINBUFSIZE];
+#else
+       jpc_fix_t joinbuf[bufsize];
+#endif
+       jpc_fix_t *buf = joinbuf;
+       register jpc_fix_t *srcptr;
+       register jpc_fix_t *dstptr;
+       register int n;
+       int hstartcol;
+
+#if !defined(HAVE_VLA)
+       /* Allocate memory for the join buffer from the heap. */
+       if (bufsize > QMFB_JOINBUFSIZE) {
+               if (!(buf = jas_malloc(bufsize * sizeof(jpc_fix_t)))) {
+                       /* We have no choice but to commit suicide. */
+                       abort();
+               }
+       }
+#endif
+
+       hstartcol = (numrows + 1 - parity) >> 1;
+
+       /* Save the samples from the lowpass channel. */
+       n = hstartcol;
+       srcptr = &a[0];
+       dstptr = buf;
+       while (n-- > 0) {
+               *dstptr = *srcptr;
+               srcptr += stride;
+               ++dstptr;
+       }
+       /* Copy the samples from the highpass channel into place. */
+       srcptr = &a[hstartcol * stride];
+       dstptr = &a[(1 - parity) * stride];
+       n = numrows - hstartcol;
+       while (n-- > 0) {
+               *dstptr = *srcptr;
+               dstptr += 2 * stride;
+               srcptr += stride;
+       }
+       /* Copy the samples from the lowpass channel into place. */
+       srcptr = buf;
+       dstptr = &a[parity * stride];
+       n = hstartcol;
+       while (n-- > 0) {
+               *dstptr = *srcptr;
+               dstptr += 2 * stride;
+               ++srcptr;
+       }
+
+#if !defined(HAVE_VLA)
+       /* If the join buffer was allocated on the heap, free this memory. */
+       if (buf != joinbuf) {
+               jas_free(buf);
+       }
+#endif
+
+}
+
+void jpc_qmfb_join_colgrp(jpc_fix_t *a, int numrows, int stride,
+  int parity)
+{
+
+       int bufsize = JPC_CEILDIVPOW2(numrows, 1);
+#if !defined(HAVE_VLA)
+       jpc_fix_t joinbuf[QMFB_JOINBUFSIZE * JPC_QMFB_COLGRPSIZE];
+#else
+       jpc_fix_t joinbuf[bufsize * JPC_QMFB_COLGRPSIZE];
+#endif
+       jpc_fix_t *buf = joinbuf;
+       jpc_fix_t *srcptr;
+       jpc_fix_t *dstptr;
+       register jpc_fix_t *srcptr2;
+       register jpc_fix_t *dstptr2;
+       register int n;
+       register int i;
+       int hstartcol;
+
+#if !defined(HAVE_VLA)
+       /* Allocate memory for the join buffer from the heap. */
+       if (bufsize > QMFB_JOINBUFSIZE) {
+               if (!(buf = jas_malloc(bufsize * JPC_QMFB_COLGRPSIZE * sizeof(jpc_fix_t)))) {
+                       /* We have no choice but to commit suicide. */
+                       abort();
+               }
+       }
+#endif
+
+       hstartcol = (numrows + 1 - parity) >> 1;
+
+       /* Save the samples from the lowpass channel. */
+       n = hstartcol;
+       srcptr = &a[0];
+       dstptr = buf;
+       while (n-- > 0) {
+               dstptr2 = dstptr;
+               srcptr2 = srcptr;
+               for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                       *dstptr2 = *srcptr2;
+                       ++dstptr2;
+                       ++srcptr2;
+               }
+               srcptr += stride;
+               dstptr += JPC_QMFB_COLGRPSIZE;
+       }
+       /* Copy the samples from the highpass channel into place. */
+       srcptr = &a[hstartcol * stride];
+       dstptr = &a[(1 - parity) * stride];
+       n = numrows - hstartcol;
+       while (n-- > 0) {
+               dstptr2 = dstptr;
+               srcptr2 = srcptr;
+               for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                       *dstptr2 = *srcptr2;
+                       ++dstptr2;
+                       ++srcptr2;
+               }
+               dstptr += 2 * stride;
+               srcptr += stride;
+       }
+       /* Copy the samples from the lowpass channel into place. */
+       srcptr = buf;
+       dstptr = &a[parity * stride];
+       n = hstartcol;
+       while (n-- > 0) {
+               dstptr2 = dstptr;
+               srcptr2 = srcptr;
+               for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                       *dstptr2 = *srcptr2;
+                       ++dstptr2;
+                       ++srcptr2;
+               }
+               dstptr += 2 * stride;
+               srcptr += JPC_QMFB_COLGRPSIZE;
+       }
+
+#if !defined(HAVE_VLA)
+       /* If the join buffer was allocated on the heap, free this memory. */
+       if (buf != joinbuf) {
+               jas_free(buf);
+       }
+#endif
+
+}
+
+void jpc_qmfb_join_colres(jpc_fix_t *a, int numrows, int numcols,
+  int stride, int parity)
+{
+
+       int bufsize = JPC_CEILDIVPOW2(numrows, 1);
+#if !defined(HAVE_VLA)
+       jpc_fix_t joinbuf[QMFB_JOINBUFSIZE * JPC_QMFB_COLGRPSIZE];
+#else
+       jpc_fix_t joinbuf[bufsize * numcols];
+#endif
+       jpc_fix_t *buf = joinbuf;
+       jpc_fix_t *srcptr;
+       jpc_fix_t *dstptr;
+       register jpc_fix_t *srcptr2;
+       register jpc_fix_t *dstptr2;
+       register int n;
+       register int i;
+       int hstartcol;
+
+#if !defined(HAVE_VLA)
+       /* Allocate memory for the join buffer from the heap. */
+       if (bufsize > QMFB_JOINBUFSIZE) {
+               if (!(buf = jas_malloc(bufsize * numcols * sizeof(jpc_fix_t)))) {
+                       /* We have no choice but to commit suicide. */
+                       abort();
+               }
+       }
+#endif
+
+       hstartcol = (numrows + 1 - parity) >> 1;
+
+       /* Save the samples from the lowpass channel. */
+       n = hstartcol;
+       srcptr = &a[0];
+       dstptr = buf;
+       while (n-- > 0) {
+               dstptr2 = dstptr;
+               srcptr2 = srcptr;
+               for (i = 0; i < numcols; ++i) {
+                       *dstptr2 = *srcptr2;
+                       ++dstptr2;
+                       ++srcptr2;
+               }
+               srcptr += stride;
+               dstptr += numcols;
+       }
+       /* Copy the samples from the highpass channel into place. */
+       srcptr = &a[hstartcol * stride];
+       dstptr = &a[(1 - parity) * stride];
+       n = numrows - hstartcol;
+       while (n-- > 0) {
+               dstptr2 = dstptr;
+               srcptr2 = srcptr;
+               for (i = 0; i < numcols; ++i) {
+                       *dstptr2 = *srcptr2;
+                       ++dstptr2;
+                       ++srcptr2;
+               }
+               dstptr += 2 * stride;
+               srcptr += stride;
+       }
+       /* Copy the samples from the lowpass channel into place. */
+       srcptr = buf;
+       dstptr = &a[parity * stride];
+       n = hstartcol;
+       while (n-- > 0) {
+               dstptr2 = dstptr;
+               srcptr2 = srcptr;
+               for (i = 0; i < numcols; ++i) {
+                       *dstptr2 = *srcptr2;
+                       ++dstptr2;
+                       ++srcptr2;
+               }
+               dstptr += 2 * stride;
+               srcptr += numcols;
+       }
+
+#if !defined(HAVE_VLA)
+       /* If the join buffer was allocated on the heap, free this memory. */
+       if (buf != joinbuf) {
+               jas_free(buf);
+       }
+#endif
+
+}
+
+/******************************************************************************\
+* 5/3 transform
+\******************************************************************************/
+
+void jpc_ft_fwdlift_row(jpc_fix_t *a, int numcols, int parity)
+{
+
+       register jpc_fix_t *lptr;
+       register jpc_fix_t *hptr;
+       register int n;
+       int llen;
+
+       llen = (numcols + 1 - parity) >> 1;
+
+       if (numcols > 1) {
+
+               /* Apply the first lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen];
+               if (parity) {
+                       hptr[0] -= lptr[0];
+                       ++hptr;
+               }
+               n = numcols - llen - parity - (parity == (numcols & 1));
+               while (n-- > 0) {
+                       hptr[0] -= (lptr[0] + lptr[1]) >> 1;
+                       ++hptr;
+                       ++lptr;
+               }
+               if (parity == (numcols & 1)) {
+                       hptr[0] -= lptr[0];
+               }
+
+               /* Apply the second lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen];
+               if (!parity) {
+                       lptr[0] += (hptr[0] + 1) >> 1;
+                       ++lptr;
+               }
+               n = llen - (!parity) - (parity != (numcols & 1));
+               while (n-- > 0) {
+                       lptr[0] += (hptr[0] + hptr[1] + 2) >> 2;
+                       ++lptr;
+                       ++hptr;
+               }
+               if (parity != (numcols & 1)) {
+                       lptr[0] += (hptr[0] + 1) >> 1;
+               }
+
+       } else {
+
+               if (parity) {
+                       lptr = &a[0];
+                       lptr[0] <<= 1;
+               }
+
+       }
+
+}
+
+void jpc_ft_fwdlift_col(jpc_fix_t *a, int numrows, int stride, int parity)
+{
+
+       jpc_fix_t *lptr;
+       jpc_fix_t *hptr;
+#if 0
+       register jpc_fix_t *lptr2;
+       register jpc_fix_t *hptr2;
+       register int i;
+#endif
+       register int n;
+       int llen;
+
+       llen = (numrows + 1 - parity) >> 1;
+
+       if (numrows > 1) {
+
+               /* Apply the first lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen * stride];
+               if (parity) {
+                       hptr[0] -= lptr[0];
+                       hptr += stride;
+               }
+               n = numrows - llen - parity - (parity == (numrows & 1));
+               while (n-- > 0) {
+                       hptr[0] -= (lptr[0] + lptr[stride]) >> 1;
+                       hptr += stride;
+                       lptr += stride;
+               }
+               if (parity == (numrows & 1)) {
+                       hptr[0] -= lptr[0];
+               }
+
+               /* Apply the second lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen * stride];
+               if (!parity) {
+                       lptr[0] += (hptr[0] + 1) >> 1;
+                       lptr += stride;
+               }
+               n = llen - (!parity) - (parity != (numrows & 1));
+               while (n-- > 0) {
+                       lptr[0] += (hptr[0] + hptr[stride] + 2) >> 2;
+                       lptr += stride;
+                       hptr += stride;
+               }
+               if (parity != (numrows & 1)) {
+                       lptr[0] += (hptr[0] + 1) >> 1;
+               }
+
+       } else {
+
+               if (parity) {
+                       lptr = &a[0];
+                       lptr[0] <<= 1;
+               }
+
+       }
+
+}
+
+void jpc_ft_fwdlift_colgrp(jpc_fix_t *a, int numrows, int stride, int parity)
+{
+
+       jpc_fix_t *lptr;
+       jpc_fix_t *hptr;
+       register jpc_fix_t *lptr2;
+       register jpc_fix_t *hptr2;
+       register int n;
+       register int i;
+       int llen;
+
+       llen = (numrows + 1 - parity) >> 1;
+
+       if (numrows > 1) {
+
+               /* Apply the first lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen * stride];
+               if (parity) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               hptr2[0] -= lptr2[0];
+                               ++hptr2;
+                               ++lptr2;
+                       }
+                       hptr += stride;
+               }
+               n = numrows - llen - parity - (parity == (numrows & 1));
+               while (n-- > 0) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               hptr2[0] -= (lptr2[0] + lptr2[stride]) >> 1;
+                               ++lptr2;
+                               ++hptr2;
+                       }
+                       hptr += stride;
+                       lptr += stride;
+               }
+               if (parity == (numrows & 1)) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               hptr2[0] -= lptr2[0];
+                               ++lptr2;
+                               ++hptr2;
+                       }
+               }
+
+               /* Apply the second lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen * stride];
+               if (!parity) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               lptr2[0] += (hptr2[0] + 1) >> 1;
+                               ++lptr2;
+                               ++hptr2;
+                       }
+                       lptr += stride;
+               }
+               n = llen - (!parity) - (parity != (numrows & 1));
+               while (n-- > 0) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               lptr2[0] += (hptr2[0] + hptr2[stride] + 2) >> 2;
+                               ++lptr2;
+                               ++hptr2;
+                       }
+                       lptr += stride;
+                       hptr += stride;
+               }
+               if (parity != (numrows & 1)) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               lptr2[0] += (hptr2[0] + 1) >> 1;
+                               ++lptr2;
+                               ++hptr2;
+                       }
+               }
+
+       } else {
+
+               if (parity) {
+                       lptr2 = &a[0];
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               lptr2[0] <<= 1;
+                               ++lptr2;
+                       }
+               }
+
+       }
+
+}
+
+void jpc_ft_fwdlift_colres(jpc_fix_t *a, int numrows, int numcols, int stride,
+  int parity)
+{
+
+       jpc_fix_t *lptr;
+       jpc_fix_t *hptr;
+       register jpc_fix_t *lptr2;
+       register jpc_fix_t *hptr2;
+       register int n;
+       register int i;
+       int llen;
+
+       llen = (numrows + 1 - parity) >> 1;
+
+       if (numrows > 1) {
+
+               /* Apply the first lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen * stride];
+               if (parity) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < numcols; ++i) {
+                               hptr2[0] -= lptr2[0];
+                               ++hptr2;
+                               ++lptr2;
+                       }
+                       hptr += stride;
+               }
+               n = numrows - llen - parity - (parity == (numrows & 1));
+               while (n-- > 0) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < numcols; ++i) {
+                               hptr2[0] -= (lptr2[0] + lptr2[stride]) >> 1;
+                               ++lptr2;
+                               ++hptr2;
+                       }
+                       hptr += stride;
+                       lptr += stride;
+               }
+               if (parity == (numrows & 1)) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < numcols; ++i) {
+                               hptr2[0] -= lptr2[0];
+                               ++lptr2;
+                               ++hptr2;
+                       }
+               }
+
+               /* Apply the second lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen * stride];
+               if (!parity) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < numcols; ++i) {
+                               lptr2[0] += (hptr2[0] + 1) >> 1;
+                               ++lptr2;
+                               ++hptr2;
+                       }
+                       lptr += stride;
+               }
+               n = llen - (!parity) - (parity != (numrows & 1));
+               while (n-- > 0) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < numcols; ++i) {
+                               lptr2[0] += (hptr2[0] + hptr2[stride] + 2) >> 2;
+                               ++lptr2;
+                               ++hptr2;
+                       }
+                       lptr += stride;
+                       hptr += stride;
+               }
+               if (parity != (numrows & 1)) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < numcols; ++i) {
+                               lptr2[0] += (hptr2[0] + 1) >> 1;
+                               ++lptr2;
+                               ++hptr2;
+                       }
+               }
+
+       } else {
+
+               if (parity) {
+                       lptr2 = &a[0];
+                       for (i = 0; i < numcols; ++i) {
+                               lptr2[0] <<= 1;
+                               ++lptr2;
+                       }
+               }
+
+       }
+
+}
+
+void jpc_ft_invlift_row(jpc_fix_t *a, int numcols, int parity)
+{
+
+       register jpc_fix_t *lptr;
+       register jpc_fix_t *hptr;
+       register int n;
+       int llen;
+
+       llen = (numcols + 1 - parity) >> 1;
+
+       if (numcols > 1) {
+
+               /* Apply the first lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen];
+               if (!parity) {
+                       lptr[0] -= (hptr[0] + 1) >> 1;
+                       ++lptr;
+               }
+               n = llen - (!parity) - (parity != (numcols & 1));
+               while (n-- > 0) {
+                       lptr[0] -= (hptr[0] + hptr[1] + 2) >> 2;
+                       ++lptr;
+                       ++hptr;
+               }
+               if (parity != (numcols & 1)) {
+                       lptr[0] -= (hptr[0] + 1) >> 1;
+               }
+
+               /* Apply the second lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen];
+               if (parity) {
+                       hptr[0] += lptr[0];
+                       ++hptr;
+               }
+               n = numcols - llen - parity - (parity == (numcols & 1));
+               while (n-- > 0) {
+                       hptr[0] += (lptr[0] + lptr[1]) >> 1;
+                       ++hptr;
+                       ++lptr;
+               }
+               if (parity == (numcols & 1)) {
+                       hptr[0] += lptr[0];
+               }
+
+       } else {
+
+               if (parity) {
+                       lptr = &a[0];
+                       lptr[0] >>= 1;
+               }
+
+       }
+
+}
+
+void jpc_ft_invlift_col(jpc_fix_t *a, int numrows, int stride, int parity)
+{
+
+       jpc_fix_t *lptr;
+       jpc_fix_t *hptr;
+#if 0
+       register jpc_fix_t *lptr2;
+       register jpc_fix_t *hptr2;
+       register int i;
+#endif
+       register int n;
+       int llen;
+
+       llen = (numrows + 1 - parity) >> 1;
+
+       if (numrows > 1) {
+
+               /* Apply the first lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen * stride];
+               if (!parity) {
+                       lptr[0] -= (hptr[0] + 1) >> 1;
+                       lptr += stride;
+               }
+               n = llen - (!parity) - (parity != (numrows & 1));
+               while (n-- > 0) {
+                       lptr[0] -= (hptr[0] + hptr[stride] + 2) >> 2;
+                       lptr += stride;
+                       hptr += stride;
+               }
+               if (parity != (numrows & 1)) {
+                       lptr[0] -= (hptr[0] + 1) >> 1;
+               }
+
+               /* Apply the second lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen * stride];
+               if (parity) {
+                       hptr[0] += lptr[0];
+                       hptr += stride;
+               }
+               n = numrows - llen - parity - (parity == (numrows & 1));
+               while (n-- > 0) {
+                       hptr[0] += (lptr[0] + lptr[stride]) >> 1;
+                       hptr += stride;
+                       lptr += stride;
+               }
+               if (parity == (numrows & 1)) {
+                       hptr[0] += lptr[0];
+               }
+
+       } else {
+
+               if (parity) {
+                       lptr = &a[0];
+                       lptr[0] >>= 1;
+               }
+
+       }
+
+}
+
+void jpc_ft_invlift_colgrp(jpc_fix_t *a, int numrows, int stride, int parity)
+{
+
+       jpc_fix_t *lptr;
+       jpc_fix_t *hptr;
+       register jpc_fix_t *lptr2;
+       register jpc_fix_t *hptr2;
+       register int n;
+       register int i;
+       int llen;
+
+       llen = (numrows + 1 - parity) >> 1;
+
+       if (numrows > 1) {
+
+               /* Apply the first lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen * stride];
+               if (!parity) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               lptr2[0] -= (hptr2[0] + 1) >> 1;
+                               ++lptr2;
+                               ++hptr2;
+                       }
+                       lptr += stride;
+               }
+               n = llen - (!parity) - (parity != (numrows & 1));
+               while (n-- > 0) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               lptr2[0] -= (hptr2[0] + hptr2[stride] + 2) >> 2;
+                               ++lptr2;
+                               ++hptr2;
+                       }
+                       lptr += stride;
+                       hptr += stride;
+               }
+               if (parity != (numrows & 1)) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               lptr2[0] -= (hptr2[0] + 1) >> 1;
+                               ++lptr2;
+                               ++hptr2;
+                       }
+               }
+
+               /* Apply the second lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen * stride];
+               if (parity) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               hptr2[0] += lptr2[0];
+                               ++hptr2;
+                               ++lptr2;
+                       }
+                       hptr += stride;
+               }
+               n = numrows - llen - parity - (parity == (numrows & 1));
+               while (n-- > 0) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               hptr2[0] += (lptr2[0] + lptr2[stride]) >> 1;
+                               ++lptr2;
+                               ++hptr2;
+                       }
+                       hptr += stride;
+                       lptr += stride;
+               }
+               if (parity == (numrows & 1)) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               hptr2[0] += lptr2[0];
+                               ++lptr2;
+                               ++hptr2;
+                       }
+               }
+
+       } else {
+
+               if (parity) {
+                       lptr2 = &a[0];
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               lptr2[0] >>= 1;
+                               ++lptr2;
+                       }
+               }
+
+       }
+
+}
+
+void jpc_ft_invlift_colres(jpc_fix_t *a, int numrows, int numcols, int stride,
+  int parity)
+{
+
+       jpc_fix_t *lptr;
+       jpc_fix_t *hptr;
+       register jpc_fix_t *lptr2;
+       register jpc_fix_t *hptr2;
+       register int n;
+       register int i;
+       int llen;
+
+       llen = (numrows + 1 - parity) >> 1;
+
+       if (numrows > 1) {
+
+               /* Apply the first lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen * stride];
+               if (!parity) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < numcols; ++i) {
+                               lptr2[0] -= (hptr2[0] + 1) >> 1;
+                               ++lptr2;
+                               ++hptr2;
+                       }
+                       lptr += stride;
+               }
+               n = llen - (!parity) - (parity != (numrows & 1));
+               while (n-- > 0) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < numcols; ++i) {
+                               lptr2[0] -= (hptr2[0] + hptr2[stride] + 2) >> 2;
+                               ++lptr2;
+                               ++hptr2;
+                       }
+                       lptr += stride;
+                       hptr += stride;
+               }
+               if (parity != (numrows & 1)) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < numcols; ++i) {
+                               lptr2[0] -= (hptr2[0] + 1) >> 1;
+                               ++lptr2;
+                               ++hptr2;
+                       }
+               }
+
+               /* Apply the second lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen * stride];
+               if (parity) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < numcols; ++i) {
+                               hptr2[0] += lptr2[0];
+                               ++hptr2;
+                               ++lptr2;
+                       }
+                       hptr += stride;
+               }
+               n = numrows - llen - parity - (parity == (numrows & 1));
+               while (n-- > 0) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < numcols; ++i) {
+                               hptr2[0] += (lptr2[0] + lptr2[stride]) >> 1;
+                               ++lptr2;
+                               ++hptr2;
+                       }
+                       hptr += stride;
+                       lptr += stride;
+               }
+               if (parity == (numrows & 1)) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < numcols; ++i) {
+                               hptr2[0] += lptr2[0];
+                               ++lptr2;
+                               ++hptr2;
+                       }
+               }
+
+       } else {
+
+               if (parity) {
+                       lptr2 = &a[0];
+                       for (i = 0; i < numcols; ++i) {
+                               lptr2[0] >>= 1;
+                               ++lptr2;
+                       }
+               }
+
+       }
+
+}
+
+int jpc_ft_analyze(jpc_fix_t *a, int xstart, int ystart, int width, int height,
+  int stride)
+{
+       int numrows = height;
+       int numcols = width;
+       int rowparity = ystart & 1;
+       int colparity = xstart & 1;
+       int i;
+       jpc_fix_t *startptr;
+       int maxcols;
+
+       maxcols = (numcols / JPC_QMFB_COLGRPSIZE) * JPC_QMFB_COLGRPSIZE;
+       startptr = &a[0];
+       for (i = 0; i < maxcols; i += JPC_QMFB_COLGRPSIZE) {
+               jpc_qmfb_split_colgrp(startptr, numrows, stride, rowparity);
+               jpc_ft_fwdlift_colgrp(startptr, numrows, stride, rowparity);
+               startptr += JPC_QMFB_COLGRPSIZE;
+       }
+       if (maxcols < numcols) {
+               jpc_qmfb_split_colres(startptr, numrows, numcols - maxcols, stride,
+                 rowparity);
+               jpc_ft_fwdlift_colres(startptr, numrows, numcols - maxcols, stride,
+                 rowparity);
+       }
+
+       startptr = &a[0];
+       for (i = 0; i < numrows; ++i) {
+               jpc_qmfb_split_row(startptr, numcols, colparity);
+               jpc_ft_fwdlift_row(startptr, numcols, colparity);
+               startptr += stride;
+       }
+
+       return 0;
+
+}
+
+int jpc_ft_synthesize(int *a, int xstart, int ystart, int width, int height,
+  int stride)
+{
+       int numrows = height;
+       int numcols = width;
+       int rowparity = ystart & 1;
+       int colparity = xstart & 1;
+
+       int maxcols;
+       jpc_fix_t *startptr;
+       int i;
+
+       startptr = &a[0];
+       for (i = 0; i < numrows; ++i) {
+               jpc_ft_invlift_row(startptr, numcols, colparity);
+               jpc_qmfb_join_row(startptr, numcols, colparity);
+               startptr += stride;
+       }
+
+       maxcols = (numcols / JPC_QMFB_COLGRPSIZE) * JPC_QMFB_COLGRPSIZE;
+       startptr = &a[0];
+       for (i = 0; i < maxcols; i += JPC_QMFB_COLGRPSIZE) {
+               jpc_ft_invlift_colgrp(startptr, numrows, stride, rowparity);
+               jpc_qmfb_join_colgrp(startptr, numrows, stride, rowparity);
+               startptr += JPC_QMFB_COLGRPSIZE;
+       }
+       if (maxcols < numcols) {
+               jpc_ft_invlift_colres(startptr, numrows, numcols - maxcols, stride,
+                 rowparity);
+               jpc_qmfb_join_colres(startptr, numrows, numcols - maxcols, stride,
+                 rowparity);
+       }
+
+       return 0;
+
+}
+
+/******************************************************************************\
+* 9/7 transform
+\******************************************************************************/
+
+#define ALPHA (-1.586134342059924)
+#define BETA (-0.052980118572961)
+#define GAMMA (0.882911075530934)
+#define DELTA (0.443506852043971)
+#define LGAIN (1.0 / 1.23017410558578)
+#define HGAIN (1.0 / 1.62578613134411)
+
+void jpc_ns_fwdlift_row(jpc_fix_t *a, int numcols, int parity)
+{
+
+       register jpc_fix_t *lptr;
+       register jpc_fix_t *hptr;
+       register int n;
+       int llen;
+
+       llen = (numcols + 1 - parity) >> 1;
+
+       if (numcols > 1) {
+
+               /* Apply the first lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen];
+               if (parity) {
+                       jpc_fix_pluseq(hptr[0], jpc_fix_mul(jpc_dbltofix(2.0 * ALPHA),
+                         lptr[0]));
+                       ++hptr;
+               }
+               n = numcols - llen - parity - (parity == (numcols & 1));
+               while (n-- > 0) {
+                       jpc_fix_pluseq(hptr[0], jpc_fix_mul(jpc_dbltofix(ALPHA),
+                         jpc_fix_add(lptr[0], lptr[1])));
+                       ++hptr;
+                       ++lptr;
+               }
+               if (parity == (numcols & 1)) {
+                       jpc_fix_pluseq(hptr[0], jpc_fix_mul(jpc_dbltofix(2.0 * ALPHA),
+                         lptr[0]));
+               }
+
+               /* Apply the second lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen];
+               if (!parity) {
+                       jpc_fix_pluseq(lptr[0], jpc_fix_mul(jpc_dbltofix(2.0 * BETA),
+                         hptr[0]));
+                       ++lptr;
+               }
+               n = llen - (!parity) - (parity != (numcols & 1));
+               while (n-- > 0) {
+                       jpc_fix_pluseq(lptr[0], jpc_fix_mul(jpc_dbltofix(BETA),
+                         jpc_fix_add(hptr[0], hptr[1])));
+                       ++lptr;
+                       ++hptr;
+               }
+               if (parity != (numcols & 1)) {
+                       jpc_fix_pluseq(lptr[0], jpc_fix_mul(jpc_dbltofix(2.0 * BETA),
+                         hptr[0]));
+               }
+
+               /* Apply the third lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen];
+               if (parity) {
+                       jpc_fix_pluseq(hptr[0], jpc_fix_mul(jpc_dbltofix(2.0 * GAMMA),
+                         lptr[0]));
+                       ++hptr;
+               }
+               n = numcols - llen - parity - (parity == (numcols & 1));
+               while (n-- > 0) {
+                       jpc_fix_pluseq(hptr[0], jpc_fix_mul(jpc_dbltofix(GAMMA),
+                         jpc_fix_add(lptr[0], lptr[1])));
+                       ++hptr;
+                       ++lptr;
+               }
+               if (parity == (numcols & 1)) {
+                       jpc_fix_pluseq(hptr[0], jpc_fix_mul(jpc_dbltofix(2.0 * GAMMA),
+                         lptr[0]));
+               }
+
+               /* Apply the fourth lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen];
+               if (!parity) {
+                       jpc_fix_pluseq(lptr[0], jpc_fix_mul(jpc_dbltofix(2.0 * DELTA),
+                         hptr[0]));
+                       ++lptr;
+               }
+               n = llen - (!parity) - (parity != (numcols & 1));
+               while (n-- > 0) {
+                       jpc_fix_pluseq(lptr[0], jpc_fix_mul(jpc_dbltofix(DELTA),
+                         jpc_fix_add(hptr[0], hptr[1])));
+                       ++lptr;
+                       ++hptr;
+               }
+               if (parity != (numcols & 1)) {
+                       jpc_fix_pluseq(lptr[0], jpc_fix_mul(jpc_dbltofix(2.0 * DELTA),
+                         hptr[0]));
+               }
+
+               /* Apply the scaling step. */
+#if defined(WT_DOSCALE)
+               lptr = &a[0];
+               n = llen;
+               while (n-- > 0) {
+                       lptr[0] = jpc_fix_mul(lptr[0], jpc_dbltofix(LGAIN));
+                       ++lptr;
+               }
+               hptr = &a[llen];
+               n = numcols - llen;
+               while (n-- > 0) {
+                       hptr[0] = jpc_fix_mul(hptr[0], jpc_dbltofix(HGAIN));
+                       ++hptr;
+               }
+#endif
+
+       } else {
+
+#if defined(WT_LENONE)
+               if (parity) {
+                       lptr = &a[0];
+                       lptr[0] <<= 1;
+               }
+#endif
+
+       }
+
+}
+
+void jpc_ns_fwdlift_colgrp(jpc_fix_t *a, int numrows, int stride,
+  int parity)
+{
+
+       jpc_fix_t *lptr;
+       jpc_fix_t *hptr;
+       register jpc_fix_t *lptr2;
+       register jpc_fix_t *hptr2;
+       register int n;
+       register int i;
+       int llen;
+
+       llen = (numrows + 1 - parity) >> 1;
+
+       if (numrows > 1) {
+
+               /* Apply the first lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen * stride];
+               if (parity) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               jpc_fix_pluseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * ALPHA),
+                                 lptr2[0]));
+                               ++hptr2;
+                               ++lptr2;
+                       }
+                       hptr += stride;
+               }
+               n = numrows - llen - parity - (parity == (numrows & 1));
+               while (n-- > 0) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               jpc_fix_pluseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(ALPHA),
+                                 jpc_fix_add(lptr2[0], lptr2[stride])));
+                               ++lptr2;
+                               ++hptr2;
+                       }
+                       hptr += stride;
+                       lptr += stride;
+               }
+               if (parity == (numrows & 1)) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               jpc_fix_pluseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * ALPHA),
+                                 lptr2[0]));
+                               ++lptr2;
+                               ++hptr2;
+                       }
+               }
+
+               /* Apply the second lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen * stride];
+               if (!parity) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               jpc_fix_pluseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * BETA),
+                                 hptr2[0]));
+                               ++lptr2;
+                               ++hptr2;
+                       }
+                       lptr += stride;
+               }
+               n = llen - (!parity) - (parity != (numrows & 1));
+               while (n-- > 0) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               jpc_fix_pluseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(BETA),
+                                 jpc_fix_add(hptr2[0], hptr2[stride])));
+                               ++lptr2;
+                               ++hptr2;
+                       }
+                       lptr += stride;
+                       hptr += stride;
+               }
+               if (parity != (numrows & 1)) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               jpc_fix_pluseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * BETA),
+                                 hptr2[0]));
+                               ++lptr2;
+                               ++hptr2;
+                       }
+               }
+
+               /* Apply the third lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen * stride];
+               if (parity) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               jpc_fix_pluseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * GAMMA),
+                                 lptr2[0]));
+                               ++hptr2;
+                               ++lptr2;
+                       }
+                       hptr += stride;
+               }
+               n = numrows - llen - parity - (parity == (numrows & 1));
+               while (n-- > 0) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               jpc_fix_pluseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(GAMMA),
+                                 jpc_fix_add(lptr2[0], lptr2[stride])));
+                               ++lptr2;
+                               ++hptr2;
+                       }
+                       hptr += stride;
+                       lptr += stride;
+               }
+               if (parity == (numrows & 1)) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               jpc_fix_pluseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * GAMMA),
+                                 lptr2[0]));
+                               ++lptr2;
+                               ++hptr2;
+                       }
+               }
+
+               /* Apply the fourth lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen * stride];
+               if (!parity) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               jpc_fix_pluseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * DELTA),
+                                 hptr2[0]));
+                               ++lptr2;
+                               ++hptr2;
+                       }
+                       lptr += stride;
+               }
+               n = llen - (!parity) - (parity != (numrows & 1));
+               while (n-- > 0) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               jpc_fix_pluseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(DELTA),
+                                 jpc_fix_add(hptr2[0], hptr2[stride])));
+                               ++lptr2;
+                               ++hptr2;
+                       }
+                       lptr += stride;
+                       hptr += stride;
+               }
+               if (parity != (numrows & 1)) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               jpc_fix_pluseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * DELTA),
+                                 hptr2[0]));
+                               ++lptr2;
+                               ++hptr2;
+                       }
+               }
+
+               /* Apply the scaling step. */
+#if defined(WT_DOSCALE)
+               lptr = &a[0];
+               n = llen;
+               while (n-- > 0) {
+                       lptr2 = lptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               lptr2[0] = jpc_fix_mul(lptr2[0], jpc_dbltofix(LGAIN));
+                               ++lptr2;
+                       }
+                       lptr += stride;
+               }
+               hptr = &a[llen * stride];
+               n = numrows - llen;
+               while (n-- > 0) {
+                       hptr2 = hptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               hptr2[0] = jpc_fix_mul(hptr2[0], jpc_dbltofix(HGAIN));
+                               ++hptr2;
+                       }
+                       hptr += stride;
+               }
+#endif
+
+       } else {
+
+#if defined(WT_LENONE)
+               if (parity) {
+                       lptr2 = &a[0];
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               lptr2[0] <<= 1;
+                               ++lptr2;
+                       }
+               }
+#endif
+
+       }
+
+}
+
+void jpc_ns_fwdlift_colres(jpc_fix_t *a, int numrows, int numcols,
+  int stride, int parity)
+{
+
+       jpc_fix_t *lptr;
+       jpc_fix_t *hptr;
+       register jpc_fix_t *lptr2;
+       register jpc_fix_t *hptr2;
+       register int n;
+       register int i;
+       int llen;
+
+       llen = (numrows + 1 - parity) >> 1;
+
+       if (numrows > 1) {
+
+               /* Apply the first lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen * stride];
+               if (parity) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < numcols; ++i) {
+                               jpc_fix_pluseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * ALPHA),
+                                 lptr2[0]));
+                               ++hptr2;
+                               ++lptr2;
+                       }
+                       hptr += stride;
+               }
+               n = numrows - llen - parity - (parity == (numrows & 1));
+               while (n-- > 0) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < numcols; ++i) {
+                               jpc_fix_pluseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(ALPHA),
+                                 jpc_fix_add(lptr2[0], lptr2[stride])));
+                               ++lptr2;
+                               ++hptr2;
+                       }
+                       hptr += stride;
+                       lptr += stride;
+               }
+               if (parity == (numrows & 1)) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < numcols; ++i) {
+                               jpc_fix_pluseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * ALPHA),
+                                 lptr2[0]));
+                               ++lptr2;
+                               ++hptr2;
+                       }
+               }
+
+               /* Apply the second lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen * stride];
+               if (!parity) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < numcols; ++i) {
+                               jpc_fix_pluseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * BETA),
+                                 hptr2[0]));
+                               ++lptr2;
+                               ++hptr2;
+                       }
+                       lptr += stride;
+               }
+               n = llen - (!parity) - (parity != (numrows & 1));
+               while (n-- > 0) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < numcols; ++i) {
+                               jpc_fix_pluseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(BETA),
+                                 jpc_fix_add(hptr2[0], hptr2[stride])));
+                               ++lptr2;
+                               ++hptr2;
+                       }
+                       lptr += stride;
+                       hptr += stride;
+               }
+               if (parity != (numrows & 1)) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < numcols; ++i) {
+                               jpc_fix_pluseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * BETA),
+                                 hptr2[0]));
+                               ++lptr2;
+                               ++hptr2;
+                       }
+               }
+
+               /* Apply the third lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen * stride];
+               if (parity) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < numcols; ++i) {
+                               jpc_fix_pluseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * GAMMA),
+                                 lptr2[0]));
+                               ++hptr2;
+                               ++lptr2;
+                       }
+                       hptr += stride;
+               }
+               n = numrows - llen - parity - (parity == (numrows & 1));
+               while (n-- > 0) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < numcols; ++i) {
+                               jpc_fix_pluseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(GAMMA),
+                                 jpc_fix_add(lptr2[0], lptr2[stride])));
+                               ++lptr2;
+                               ++hptr2;
+                       }
+                       hptr += stride;
+                       lptr += stride;
+               }
+               if (parity == (numrows & 1)) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < numcols; ++i) {
+                               jpc_fix_pluseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * GAMMA),
+                                 lptr2[0]));
+                               ++lptr2;
+                               ++hptr2;
+                       }
+               }
+
+               /* Apply the fourth lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen * stride];
+               if (!parity) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < numcols; ++i) {
+                               jpc_fix_pluseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * DELTA),
+                                 hptr2[0]));
+                               ++lptr2;
+                               ++hptr2;
+                       }
+                       lptr += stride;
+               }
+               n = llen - (!parity) - (parity != (numrows & 1));
+               while (n-- > 0) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < numcols; ++i) {
+                               jpc_fix_pluseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(DELTA),
+                                 jpc_fix_add(hptr2[0], hptr2[stride])));
+                               ++lptr2;
+                               ++hptr2;
+                       }
+                       lptr += stride;
+                       hptr += stride;
+               }
+               if (parity != (numrows & 1)) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < numcols; ++i) {
+                               jpc_fix_pluseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * DELTA),
+                                 hptr2[0]));
+                               ++lptr2;
+                               ++hptr2;
+                       }
+               }
+
+               /* Apply the scaling step. */
+#if defined(WT_DOSCALE)
+               lptr = &a[0];
+               n = llen;
+               while (n-- > 0) {
+                       lptr2 = lptr;
+                       for (i = 0; i < numcols; ++i) {
+                               lptr2[0] = jpc_fix_mul(lptr2[0], jpc_dbltofix(LGAIN));
+                               ++lptr2;
+                       }
+                       lptr += stride;
+               }
+               hptr = &a[llen * stride];
+               n = numrows - llen;
+               while (n-- > 0) {
+                       hptr2 = hptr;
+                       for (i = 0; i < numcols; ++i) {
+                               hptr2[0] = jpc_fix_mul(hptr2[0], jpc_dbltofix(HGAIN));
+                               ++hptr2;
+                       }
+                       hptr += stride;
+               }
+#endif
+
+       } else {
+
+#if defined(WT_LENONE)
+               if (parity) {
+                       lptr2 = &a[0];
+                       for (i = 0; i < numcols; ++i) {
+                               lptr2[0] <<= 1;
+                               ++lptr2;
+                       }
+               }
+#endif
+
+       }
+
+}
+
+void jpc_ns_fwdlift_col(jpc_fix_t *a, int numrows, int stride,
+  int parity)
+{
+
+       jpc_fix_t *lptr;
+       jpc_fix_t *hptr;
+       register jpc_fix_t *lptr2;
+       register jpc_fix_t *hptr2;
+       register int n;
+       int llen;
+
+       llen = (numrows + 1 - parity) >> 1;
+
+       if (numrows > 1) {
+
+               /* Apply the first lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen * stride];
+               if (parity) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       jpc_fix_pluseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * ALPHA),
+                         lptr2[0]));
+                       ++hptr2;
+                       ++lptr2;
+                       hptr += stride;
+               }
+               n = numrows - llen - parity - (parity == (numrows & 1));
+               while (n-- > 0) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       jpc_fix_pluseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(ALPHA),
+                         jpc_fix_add(lptr2[0], lptr2[stride])));
+                       ++lptr2;
+                       ++hptr2;
+                       hptr += stride;
+                       lptr += stride;
+               }
+               if (parity == (numrows & 1)) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       jpc_fix_pluseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * ALPHA),
+                         lptr2[0]));
+                       ++lptr2;
+                       ++hptr2;
+               }
+
+               /* Apply the second lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen * stride];
+               if (!parity) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       jpc_fix_pluseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * BETA),
+                         hptr2[0]));
+                       ++lptr2;
+                       ++hptr2;
+                       lptr += stride;
+               }
+               n = llen - (!parity) - (parity != (numrows & 1));
+               while (n-- > 0) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       jpc_fix_pluseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(BETA),
+                         jpc_fix_add(hptr2[0], hptr2[stride])));
+                       ++lptr2;
+                       ++hptr2;
+                       lptr += stride;
+                       hptr += stride;
+               }
+               if (parity != (numrows & 1)) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       jpc_fix_pluseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * BETA),
+                         hptr2[0]));
+                       ++lptr2;
+                       ++hptr2;
+               }
+
+               /* Apply the third lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen * stride];
+               if (parity) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       jpc_fix_pluseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * GAMMA),
+                         lptr2[0]));
+                       ++hptr2;
+                       ++lptr2;
+                       hptr += stride;
+               }
+               n = numrows - llen - parity - (parity == (numrows & 1));
+               while (n-- > 0) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       jpc_fix_pluseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(GAMMA),
+                         jpc_fix_add(lptr2[0], lptr2[stride])));
+                       ++lptr2;
+                       ++hptr2;
+                       hptr += stride;
+                       lptr += stride;
+               }
+               if (parity == (numrows & 1)) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       jpc_fix_pluseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * GAMMA),
+                         lptr2[0]));
+                       ++lptr2;
+                       ++hptr2;
+               }
+
+               /* Apply the fourth lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen * stride];
+               if (!parity) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       jpc_fix_pluseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * DELTA),
+                         hptr2[0]));
+                       ++lptr2;
+                       ++hptr2;
+                       lptr += stride;
+               }
+               n = llen - (!parity) - (parity != (numrows & 1));
+               while (n-- > 0) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       jpc_fix_pluseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(DELTA),
+                         jpc_fix_add(hptr2[0], hptr2[stride])));
+                       ++lptr2;
+                       ++hptr2;
+                       lptr += stride;
+                       hptr += stride;
+               }
+               if (parity != (numrows & 1)) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       jpc_fix_pluseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * DELTA),
+                         hptr2[0]));
+                       ++lptr2;
+                       ++hptr2;
+               }
+
+               /* Apply the scaling step. */
+#if defined(WT_DOSCALE)
+               lptr = &a[0];
+               n = llen;
+               while (n-- > 0) {
+                       lptr2 = lptr;
+                       lptr2[0] = jpc_fix_mul(lptr2[0], jpc_dbltofix(LGAIN));
+                       ++lptr2;
+                       lptr += stride;
+               }
+               hptr = &a[llen * stride];
+               n = numrows - llen;
+               while (n-- > 0) {
+                       hptr2 = hptr;
+                       hptr2[0] = jpc_fix_mul(hptr2[0], jpc_dbltofix(HGAIN));
+                       ++hptr2;
+                       hptr += stride;
+               }
+#endif
+
+       } else {
+
+#if defined(WT_LENONE)
+               if (parity) {
+                       lptr2 = &a[0];
+                       lptr2[0] <<= 1;
+                       ++lptr2;
+               }
+#endif
+
+       }
+
+}
+
+void jpc_ns_invlift_row(jpc_fix_t *a, int numcols, int parity)
+{
+
+       register jpc_fix_t *lptr;
+       register jpc_fix_t *hptr;
+       register int n;
+       int llen;
+
+       llen = (numcols + 1 - parity) >> 1;
+
+       if (numcols > 1) {
+
+               /* Apply the scaling step. */
+#if defined(WT_DOSCALE)
+               lptr = &a[0];
+               n = llen;
+               while (n-- > 0) {
+                       lptr[0] = jpc_fix_mul(lptr[0], jpc_dbltofix(1.0 / LGAIN));
+                       ++lptr;
+               }
+               hptr = &a[llen];
+               n = numcols - llen;
+               while (n-- > 0) {
+                       hptr[0] = jpc_fix_mul(hptr[0], jpc_dbltofix(1.0 / HGAIN));
+                       ++hptr;
+               }
+#endif
+
+               /* Apply the first lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen];
+               if (!parity) {
+                       jpc_fix_minuseq(lptr[0], jpc_fix_mul(jpc_dbltofix(2.0 * DELTA),
+                         hptr[0]));
+                       ++lptr;
+               }
+               n = llen - (!parity) - (parity != (numcols & 1));
+               while (n-- > 0) {
+                       jpc_fix_minuseq(lptr[0], jpc_fix_mul(jpc_dbltofix(DELTA),
+                         jpc_fix_add(hptr[0], hptr[1])));
+                       ++lptr;
+                       ++hptr;
+               }
+               if (parity != (numcols & 1)) {
+                       jpc_fix_minuseq(lptr[0], jpc_fix_mul(jpc_dbltofix(2.0 * DELTA),
+                         hptr[0]));
+               }
+
+               /* Apply the second lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen];
+               if (parity) {
+                       jpc_fix_minuseq(hptr[0], jpc_fix_mul(jpc_dbltofix(2.0 * GAMMA),
+                         lptr[0]));
+                       ++hptr;
+               }
+               n = numcols - llen - parity - (parity == (numcols & 1));
+               while (n-- > 0) {
+                       jpc_fix_minuseq(hptr[0], jpc_fix_mul(jpc_dbltofix(GAMMA),
+                         jpc_fix_add(lptr[0], lptr[1])));
+                       ++hptr;
+                       ++lptr;
+               }
+               if (parity == (numcols & 1)) {
+                       jpc_fix_minuseq(hptr[0], jpc_fix_mul(jpc_dbltofix(2.0 * GAMMA),
+                         lptr[0]));
+               }
+
+               /* Apply the third lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen];
+               if (!parity) {
+                       jpc_fix_minuseq(lptr[0], jpc_fix_mul(jpc_dbltofix(2.0 * BETA),
+                         hptr[0]));
+                       ++lptr;
+               }
+               n = llen - (!parity) - (parity != (numcols & 1));
+               while (n-- > 0) {
+                       jpc_fix_minuseq(lptr[0], jpc_fix_mul(jpc_dbltofix(BETA),
+                         jpc_fix_add(hptr[0], hptr[1])));
+                       ++lptr;
+                       ++hptr;
+               }
+               if (parity != (numcols & 1)) {
+                       jpc_fix_minuseq(lptr[0], jpc_fix_mul(jpc_dbltofix(2.0 * BETA),
+                         hptr[0]));
+               }
+
+               /* Apply the fourth lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen];
+               if (parity) {
+                       jpc_fix_minuseq(hptr[0], jpc_fix_mul(jpc_dbltofix(2.0 * ALPHA),
+                         lptr[0]));
+                       ++hptr;
+               }
+               n = numcols - llen - parity - (parity == (numcols & 1));
+               while (n-- > 0) {
+                       jpc_fix_minuseq(hptr[0], jpc_fix_mul(jpc_dbltofix(ALPHA),
+                         jpc_fix_add(lptr[0], lptr[1])));
+                       ++hptr;
+                       ++lptr;
+               }
+               if (parity == (numcols & 1)) {
+                       jpc_fix_minuseq(hptr[0], jpc_fix_mul(jpc_dbltofix(2.0 * ALPHA),
+                         lptr[0]));
+               }
+
+       } else {
+
+#if defined(WT_LENONE)
+               if (parity) {
+                       lptr = &a[0];
+                       lptr[0] >>= 1;
+               }
+#endif
+
+       }
+
+}
+
+void jpc_ns_invlift_colgrp(jpc_fix_t *a, int numrows, int stride,
+  int parity)
+{
+
+       jpc_fix_t *lptr;
+       jpc_fix_t *hptr;
+       register jpc_fix_t *lptr2;
+       register jpc_fix_t *hptr2;
+       register int n;
+       register int i;
+       int llen;
+
+       llen = (numrows + 1 - parity) >> 1;
+
+       if (numrows > 1) {
+
+               /* Apply the scaling step. */
+#if defined(WT_DOSCALE)
+               lptr = &a[0];
+               n = llen;
+               while (n-- > 0) {
+                       lptr2 = lptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               lptr2[0] = jpc_fix_mul(lptr2[0], jpc_dbltofix(1.0 / LGAIN));
+                               ++lptr2;
+                       }
+                       lptr += stride;
+               }
+               hptr = &a[llen * stride];
+               n = numrows - llen;
+               while (n-- > 0) {
+                       hptr2 = hptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               hptr2[0] = jpc_fix_mul(hptr2[0], jpc_dbltofix(1.0 / HGAIN));
+                               ++hptr2;
+                       }
+                       hptr += stride;
+               }
+#endif
+
+               /* Apply the first lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen * stride];
+               if (!parity) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               jpc_fix_minuseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 *
+                                 DELTA), hptr2[0]));
+                               ++lptr2;
+                               ++hptr2;
+                       }
+                       lptr += stride;
+               }
+               n = llen - (!parity) - (parity != (numrows & 1));
+               while (n-- > 0) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               jpc_fix_minuseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(DELTA),
+                                 jpc_fix_add(hptr2[0], hptr2[stride])));
+                               ++lptr2;
+                               ++hptr2;
+                       }
+                       lptr += stride;
+                       hptr += stride;
+               }
+               if (parity != (numrows & 1)) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               jpc_fix_minuseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 *
+                                 DELTA), hptr2[0]));
+                               ++lptr2;
+                               ++hptr2;
+                       }
+               }
+
+               /* Apply the second lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen * stride];
+               if (parity) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               jpc_fix_minuseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 *
+                                 GAMMA), lptr2[0]));
+                               ++hptr2;
+                               ++lptr2;
+                       }
+                       hptr += stride;
+               }
+               n = numrows - llen - parity - (parity == (numrows & 1));
+               while (n-- > 0) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               jpc_fix_minuseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(GAMMA),
+                                 jpc_fix_add(lptr2[0], lptr2[stride])));
+                               ++lptr2;
+                               ++hptr2;
+                       }
+                       hptr += stride;
+                       lptr += stride;
+               }
+               if (parity == (numrows & 1)) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               jpc_fix_minuseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 *
+                                 GAMMA), lptr2[0]));
+                               ++lptr2;
+                               ++hptr2;
+                       }
+               }
+
+               /* Apply the third lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen * stride];
+               if (!parity) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               jpc_fix_minuseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * BETA),
+                                 hptr2[0]));
+                               ++lptr2;
+                               ++hptr2;
+                       }
+                       lptr += stride;
+               }
+               n = llen - (!parity) - (parity != (numrows & 1));
+               while (n-- > 0) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               jpc_fix_minuseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(BETA),
+                                 jpc_fix_add(hptr2[0], hptr2[stride])));
+                               ++lptr2;
+                               ++hptr2;
+                       }
+                       lptr += stride;
+                       hptr += stride;
+               }
+               if (parity != (numrows & 1)) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               jpc_fix_minuseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * BETA),
+                                 hptr2[0]));
+                               ++lptr2;
+                               ++hptr2;
+                       }
+               }
+
+               /* Apply the fourth lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen * stride];
+               if (parity) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               jpc_fix_minuseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 *
+                                 ALPHA), lptr2[0]));
+                               ++hptr2;
+                               ++lptr2;
+                       }
+                       hptr += stride;
+               }
+               n = numrows - llen - parity - (parity == (numrows & 1));
+               while (n-- > 0) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               jpc_fix_minuseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(ALPHA),
+                                 jpc_fix_add(lptr2[0], lptr2[stride])));
+                               ++lptr2;
+                               ++hptr2;
+                       }
+                       hptr += stride;
+                       lptr += stride;
+               }
+               if (parity == (numrows & 1)) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               jpc_fix_minuseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 *
+                                 ALPHA), lptr2[0]));
+                               ++lptr2;
+                               ++hptr2;
+                       }
+               }
+
+       } else {
+
+#if defined(WT_LENONE)
+               if (parity) {
+                       lptr2 = &a[0];
+                       for (i = 0; i < JPC_QMFB_COLGRPSIZE; ++i) {
+                               lptr2[0] >>= 1;
+                               ++lptr2;
+                       }
+               }
+#endif
+
+       }
+
+}
+
+void jpc_ns_invlift_colres(jpc_fix_t *a, int numrows, int numcols,
+  int stride, int parity)
+{
+
+       jpc_fix_t *lptr;
+       jpc_fix_t *hptr;
+       register jpc_fix_t *lptr2;
+       register jpc_fix_t *hptr2;
+       register int n;
+       register int i;
+       int llen;
+
+       llen = (numrows + 1 - parity) >> 1;
+
+       if (numrows > 1) {
+
+               /* Apply the scaling step. */
+#if defined(WT_DOSCALE)
+               lptr = &a[0];
+               n = llen;
+               while (n-- > 0) {
+                       lptr2 = lptr;
+                       for (i = 0; i < numcols; ++i) {
+                               lptr2[0] = jpc_fix_mul(lptr2[0], jpc_dbltofix(1.0 / LGAIN));
+                               ++lptr2;
+                       }
+                       lptr += stride;
+               }
+               hptr = &a[llen * stride];
+               n = numrows - llen;
+               while (n-- > 0) {
+                       hptr2 = hptr;
+                       for (i = 0; i < numcols; ++i) {
+                               hptr2[0] = jpc_fix_mul(hptr2[0], jpc_dbltofix(1.0 / HGAIN));
+                               ++hptr2;
+                       }
+                       hptr += stride;
+               }
+#endif
+
+               /* Apply the first lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen * stride];
+               if (!parity) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < numcols; ++i) {
+                               jpc_fix_minuseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 *
+                                 DELTA), hptr2[0]));
+                               ++lptr2;
+                               ++hptr2;
+                       }
+                       lptr += stride;
+               }
+               n = llen - (!parity) - (parity != (numrows & 1));
+               while (n-- > 0) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < numcols; ++i) {
+                               jpc_fix_minuseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(DELTA),
+                                 jpc_fix_add(hptr2[0], hptr2[stride])));
+                               ++lptr2;
+                               ++hptr2;
+                       }
+                       lptr += stride;
+                       hptr += stride;
+               }
+               if (parity != (numrows & 1)) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < numcols; ++i) {
+                               jpc_fix_minuseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 *
+                                 DELTA), hptr2[0]));
+                               ++lptr2;
+                               ++hptr2;
+                       }
+               }
+
+               /* Apply the second lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen * stride];
+               if (parity) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < numcols; ++i) {
+                               jpc_fix_minuseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 *
+                                 GAMMA), lptr2[0]));
+                               ++hptr2;
+                               ++lptr2;
+                       }
+                       hptr += stride;
+               }
+               n = numrows - llen - parity - (parity == (numrows & 1));
+               while (n-- > 0) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < numcols; ++i) {
+                               jpc_fix_minuseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(GAMMA),
+                                 jpc_fix_add(lptr2[0], lptr2[stride])));
+                               ++lptr2;
+                               ++hptr2;
+                       }
+                       hptr += stride;
+                       lptr += stride;
+               }
+               if (parity == (numrows & 1)) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < numcols; ++i) {
+                               jpc_fix_minuseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 *
+                                 GAMMA), lptr2[0]));
+                               ++lptr2;
+                               ++hptr2;
+                       }
+               }
+
+               /* Apply the third lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen * stride];
+               if (!parity) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < numcols; ++i) {
+                               jpc_fix_minuseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * BETA),
+                                 hptr2[0]));
+                               ++lptr2;
+                               ++hptr2;
+                       }
+                       lptr += stride;
+               }
+               n = llen - (!parity) - (parity != (numrows & 1));
+               while (n-- > 0) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < numcols; ++i) {
+                               jpc_fix_minuseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(BETA),
+                                 jpc_fix_add(hptr2[0], hptr2[stride])));
+                               ++lptr2;
+                               ++hptr2;
+                       }
+                       lptr += stride;
+                       hptr += stride;
+               }
+               if (parity != (numrows & 1)) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < numcols; ++i) {
+                               jpc_fix_minuseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * BETA),
+                                 hptr2[0]));
+                               ++lptr2;
+                               ++hptr2;
+                       }
+               }
+
+               /* Apply the fourth lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen * stride];
+               if (parity) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < numcols; ++i) {
+                               jpc_fix_minuseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 *
+                                 ALPHA), lptr2[0]));
+                               ++hptr2;
+                               ++lptr2;
+                       }
+                       hptr += stride;
+               }
+               n = numrows - llen - parity - (parity == (numrows & 1));
+               while (n-- > 0) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < numcols; ++i) {
+                               jpc_fix_minuseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(ALPHA),
+                                 jpc_fix_add(lptr2[0], lptr2[stride])));
+                               ++lptr2;
+                               ++hptr2;
+                       }
+                       hptr += stride;
+                       lptr += stride;
+               }
+               if (parity == (numrows & 1)) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       for (i = 0; i < numcols; ++i) {
+                               jpc_fix_minuseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 *
+                                 ALPHA), lptr2[0]));
+                               ++lptr2;
+                               ++hptr2;
+                       }
+               }
+
+       } else {
+
+#if defined(WT_LENONE)
+               if (parity) {
+                       lptr2 = &a[0];
+                       for (i = 0; i < numcols; ++i) {
+                               lptr2[0] >>= 1;
+                               ++lptr2;
+                       }
+               }
+#endif
+
+       }
+
+}
+
+void jpc_ns_invlift_col(jpc_fix_t *a, int numrows, int stride,
+  int parity)
+{
+
+       jpc_fix_t *lptr;
+       jpc_fix_t *hptr;
+       register jpc_fix_t *lptr2;
+       register jpc_fix_t *hptr2;
+       register int n;
+       int llen;
+
+       llen = (numrows + 1 - parity) >> 1;
+
+       if (numrows > 1) {
+
+               /* Apply the scaling step. */
+#if defined(WT_DOSCALE)
+               lptr = &a[0];
+               n = llen;
+               while (n-- > 0) {
+                       lptr2 = lptr;
+                       lptr2[0] = jpc_fix_mul(lptr2[0], jpc_dbltofix(1.0 / LGAIN));
+                       ++lptr2;
+                       lptr += stride;
+               }
+               hptr = &a[llen * stride];
+               n = numrows - llen;
+               while (n-- > 0) {
+                       hptr2 = hptr;
+                       hptr2[0] = jpc_fix_mul(hptr2[0], jpc_dbltofix(1.0 / HGAIN));
+                       ++hptr2;
+                       hptr += stride;
+               }
+#endif
+
+               /* Apply the first lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen * stride];
+               if (!parity) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       jpc_fix_minuseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 *
+                         DELTA), hptr2[0]));
+                       ++lptr2;
+                       ++hptr2;
+                       lptr += stride;
+               }
+               n = llen - (!parity) - (parity != (numrows & 1));
+               while (n-- > 0) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       jpc_fix_minuseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(DELTA),
+                         jpc_fix_add(hptr2[0], hptr2[stride])));
+                       ++lptr2;
+                       ++hptr2;
+                       lptr += stride;
+                       hptr += stride;
+               }
+               if (parity != (numrows & 1)) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       jpc_fix_minuseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 *
+                         DELTA), hptr2[0]));
+                       ++lptr2;
+                       ++hptr2;
+               }
+
+               /* Apply the second lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen * stride];
+               if (parity) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       jpc_fix_minuseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 *
+                         GAMMA), lptr2[0]));
+                       ++hptr2;
+                       ++lptr2;
+                       hptr += stride;
+               }
+               n = numrows - llen - parity - (parity == (numrows & 1));
+               while (n-- > 0) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       jpc_fix_minuseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(GAMMA),
+                         jpc_fix_add(lptr2[0], lptr2[stride])));
+                       ++lptr2;
+                       ++hptr2;
+                       hptr += stride;
+                       lptr += stride;
+               }
+               if (parity == (numrows & 1)) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       jpc_fix_minuseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 *
+                         GAMMA), lptr2[0]));
+                       ++lptr2;
+                       ++hptr2;
+               }
+
+               /* Apply the third lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen * stride];
+               if (!parity) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       jpc_fix_minuseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * BETA),
+                         hptr2[0]));
+                       ++lptr2;
+                       ++hptr2;
+                       lptr += stride;
+               }
+               n = llen - (!parity) - (parity != (numrows & 1));
+               while (n-- > 0) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       jpc_fix_minuseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(BETA),
+                         jpc_fix_add(hptr2[0], hptr2[stride])));
+                       ++lptr2;
+                       ++hptr2;
+                       lptr += stride;
+                       hptr += stride;
+               }
+               if (parity != (numrows & 1)) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       jpc_fix_minuseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * BETA),
+                         hptr2[0]));
+                       ++lptr2;
+                       ++hptr2;
+               }
+
+               /* Apply the fourth lifting step. */
+               lptr = &a[0];
+               hptr = &a[llen * stride];
+               if (parity) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       jpc_fix_minuseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 *
+                         ALPHA), lptr2[0]));
+                       ++hptr2;
+                       ++lptr2;
+                       hptr += stride;
+               }
+               n = numrows - llen - parity - (parity == (numrows & 1));
+               while (n-- > 0) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       jpc_fix_minuseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(ALPHA),
+                         jpc_fix_add(lptr2[0], lptr2[stride])));
+                       ++lptr2;
+                       ++hptr2;
+                       hptr += stride;
+                       lptr += stride;
+               }
+               if (parity == (numrows & 1)) {
+                       lptr2 = lptr;
+                       hptr2 = hptr;
+                       jpc_fix_minuseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 *
+                         ALPHA), lptr2[0]));
+                       ++lptr2;
+                       ++hptr2;
+               }
+
+       } else {
+
+#if defined(WT_LENONE)
+               if (parity) {
+                       lptr2 = &a[0];
+                       lptr2[0] >>= 1;
+                       ++lptr2;
+               }
+#endif
+
+       }
+
+}
+
+int jpc_ns_analyze(jpc_fix_t *a, int xstart, int ystart, int width, int height,
+  int stride)
+{
+
+       int numrows = height;
+       int numcols = width;
+       int rowparity = ystart & 1;
+       int colparity = xstart & 1;
+       int i;
+       jpc_fix_t *startptr;
+       int maxcols;
+
+       maxcols = (numcols / JPC_QMFB_COLGRPSIZE) * JPC_QMFB_COLGRPSIZE;
+       startptr = &a[0];
+       for (i = 0; i < maxcols; i += JPC_QMFB_COLGRPSIZE) {
+               jpc_qmfb_split_colgrp(startptr, numrows, stride, rowparity);
+               jpc_ns_fwdlift_colgrp(startptr, numrows, stride, rowparity);
+               startptr += JPC_QMFB_COLGRPSIZE;
+       }
+       if (maxcols < numcols) {
+               jpc_qmfb_split_colres(startptr, numrows, numcols - maxcols, stride,
+                 rowparity);
+               jpc_ns_fwdlift_colres(startptr, numrows, numcols - maxcols, stride,
+                 rowparity);
+       }
+
+       startptr = &a[0];
+       for (i = 0; i < numrows; ++i) {
+               jpc_qmfb_split_row(startptr, numcols, colparity);
+               jpc_ns_fwdlift_row(startptr, numcols, colparity);
+               startptr += stride;
+       }
+
+       return 0;
+
+}
+
+int jpc_ns_synthesize(jpc_fix_t *a, int xstart, int ystart, int width,
+  int height, int stride)
+{
+
+       int numrows = height;
+       int numcols = width;
+       int rowparity = ystart & 1;
+       int colparity = xstart & 1;
+       int maxcols;
+       jpc_fix_t *startptr;
+       int i;
+
+       startptr = &a[0];
+       for (i = 0; i < numrows; ++i) {
+               jpc_ns_invlift_row(startptr, numcols, colparity);
+               jpc_qmfb_join_row(startptr, numcols, colparity);
+               startptr += stride;
+       }
+
+       maxcols = (numcols / JPC_QMFB_COLGRPSIZE) * JPC_QMFB_COLGRPSIZE;
+       startptr = &a[0];
+       for (i = 0; i < maxcols; i += JPC_QMFB_COLGRPSIZE) {
+               jpc_ns_invlift_colgrp(startptr, numrows, stride, rowparity);
+               jpc_qmfb_join_colgrp(startptr, numrows, stride, rowparity);
+               startptr += JPC_QMFB_COLGRPSIZE;
+       }
+       if (maxcols < numcols) {
+               jpc_ns_invlift_colres(startptr, numrows, numcols - maxcols, stride,
+                 rowparity);
+               jpc_qmfb_join_colres(startptr, numrows, numcols - maxcols, stride,
+                 rowparity);
+       }
+
+       return 0;
+
+}
+
diff --git a/src/libjasper/jpc/jpc_qmfb.h b/src/libjasper/jpc/jpc_qmfb.h
new file mode 100644 (file)
index 0000000..75611fe
--- /dev/null
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2004 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Quadrature Mirror-Image Filter Bank (QMFB) Routines
+ *
+ * $Id$
+ */
+
+#ifndef JPC_QMFB_H
+#define JPC_QMFB_H
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include "jasper/jas_seq.h"
+
+/******************************************************************************\
+* Constants.
+\******************************************************************************/
+
+/* QMFB IDs. */
+#define        JPC_QMFB1D_FT   1       /* 5/3 */
+#define        JPC_QMFB1D_NS   2       /* 9/7 */
+
+/******************************************************************************\
+* Types.
+\******************************************************************************/
+
+/******************************************************************************\
+* Functions.
+\******************************************************************************/
+
+#if !defined(JPC_QMFB_COLGRPSIZE)
+/* The number of columns to group together during the vertical processing
+stage of the wavelet transform. */
+/* The default value for this parameter is probably not optimal for
+any particular platform.  Hopefully, it is not too unreasonable, however. */
+#define JPC_QMFB_COLGRPSIZE    16
+#endif
+
+typedef struct {
+       int (*analyze)(int *, int, int, int, int, int);
+       int (*synthesize)(int *, int, int, int, int, int);
+       double *lpenergywts;
+       double *hpenergywts;
+} jpc_qmfb2d_t;
+
+extern jpc_qmfb2d_t jpc_ft_qmfb2d;
+extern jpc_qmfb2d_t jpc_ns_qmfb2d;
+
+#endif
diff --git a/src/libjasper/jpc/jpc_t1cod.c b/src/libjasper/jpc/jpc_t1cod.c
new file mode 100644 (file)
index 0000000..f75516a
--- /dev/null
@@ -0,0 +1,497 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * $Id$
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <math.h>
+
+#include "jasper/jas_types.h"
+#include "jasper/jas_math.h"
+
+#include "jpc_bs.h"
+#include "jpc_dec.h"
+#include "jpc_cs.h"
+#include "jpc_mqcod.h"
+#include "jpc_t1cod.h"
+#include "jpc_tsfb.h"
+
+double jpc_pow2i(int n);
+
+/******************************************************************************\
+* Global data.
+\******************************************************************************/
+
+int jpc_zcctxnolut[4 * 256];
+int jpc_spblut[256];
+int jpc_scctxnolut[256];
+int jpc_magctxnolut[4096];
+
+jpc_fix_t jpc_signmsedec[1 << JPC_NMSEDEC_BITS];
+jpc_fix_t jpc_refnmsedec[1 << JPC_NMSEDEC_BITS];
+jpc_fix_t jpc_signmsedec0[1 << JPC_NMSEDEC_BITS];
+jpc_fix_t jpc_refnmsedec0[1 << JPC_NMSEDEC_BITS];
+
+jpc_mqctx_t jpc_mqctxs[JPC_NUMCTXS];
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+void jpc_initmqctxs(void);
+
+/******************************************************************************\
+* Code.
+\******************************************************************************/
+
+int JPC_PASSTYPE(int passno)
+{
+       int passtype;
+       switch (passno % 3) {
+       case 0:
+               passtype = JPC_CLNPASS;
+               break;
+       case 1:
+               passtype = JPC_SIGPASS;
+               break;
+       case 2:
+               passtype = JPC_REFPASS;
+               break;
+       default:
+               passtype = -1;
+               assert(0);
+               break;
+       }
+       return passtype;
+}
+
+int JPC_NOMINALGAIN(int qmfbid, int numlvls, int lvlno, int orient)
+{
+       /* Avoid compiler warnings about unused parameters. */
+       numlvls = 0;
+
+if (qmfbid == JPC_COX_INS) {
+       return 0;
+}
+       assert(qmfbid == JPC_COX_RFT);
+       if (lvlno == 0) {
+               assert(orient == JPC_TSFB_LL);
+               return 0;
+       } else {
+               switch (orient) {
+               case JPC_TSFB_LH:
+               case JPC_TSFB_HL:
+                       return 1;
+                       break;
+               case JPC_TSFB_HH:
+                       return 2;
+                       break;
+               }
+       }
+       abort();
+}
+
+/******************************************************************************\
+* Coding pass related functions.
+\******************************************************************************/
+
+int JPC_SEGTYPE(int passno, int firstpassno, int bypass)
+{
+       int passtype;
+       if (bypass) {
+               passtype = JPC_PASSTYPE(passno);
+               if (passtype == JPC_CLNPASS) {
+                       return JPC_SEG_MQ;
+               }
+               return ((passno < firstpassno + 10) ? JPC_SEG_MQ : JPC_SEG_RAW);
+       } else {
+               return JPC_SEG_MQ;
+       }
+}
+
+int JPC_SEGPASSCNT(int passno, int firstpassno, int numpasses, int bypass, int termall)
+{
+       int ret;
+       int passtype;
+
+       if (termall) {
+               ret = 1;
+       } else if (bypass) {
+               if (passno < firstpassno + 10) {
+                       ret = 10 - (passno - firstpassno);
+               } else {
+                       passtype = JPC_PASSTYPE(passno);
+                       switch (passtype) {
+                       case JPC_SIGPASS:
+                               ret = 2;
+                               break;
+                       case JPC_REFPASS:
+                               ret = 1;
+                               break;
+                       case JPC_CLNPASS:
+                               ret = 1;
+                               break;
+                       default:
+                               ret = -1;
+                               assert(0);
+                               break;
+                       }
+               }
+       } else {
+               ret = JPC_PREC * 3 - 2;
+       }
+       ret = JAS_MIN(ret, numpasses - passno);
+       return ret;
+}
+
+int JPC_ISTERMINATED(int passno, int firstpassno, int numpasses, int termall,
+  int lazy)
+{
+       int ret;
+       int n;
+       if (passno - firstpassno == numpasses - 1) {
+               ret = 1;
+       } else {
+               n = JPC_SEGPASSCNT(passno, firstpassno, numpasses, lazy, termall);
+               ret = (n <= 1) ? 1 : 0;
+       }
+
+       return ret;
+}
+
+/******************************************************************************\
+* Lookup table code.
+\******************************************************************************/
+
+void jpc_initluts()
+{
+       int i;
+       int orient;
+       int refine;
+       float u;
+       float v;
+       float t;
+
+/* XXX - hack */
+jpc_initmqctxs();
+
+       for (orient = 0; orient < 4; ++orient) {
+               for (i = 0; i < 256; ++i) {
+                       jpc_zcctxnolut[(orient << 8) | i] = jpc_getzcctxno(i, orient);
+               }
+       }
+
+       for (i = 0; i < 256; ++i) {
+               jpc_spblut[i] = jpc_getspb(i << 4);
+       }
+
+       for (i = 0; i < 256; ++i) {
+               jpc_scctxnolut[i] = jpc_getscctxno(i << 4);
+       }
+
+       for (refine = 0; refine < 2; ++refine) {
+               for (i = 0; i < 2048; ++i) {
+                       jpc_magctxnolut[(refine << 11) + i] = jpc_getmagctxno((refine ? JPC_REFINE : 0) | i);
+               }
+       }
+
+       for (i = 0; i < (1 << JPC_NMSEDEC_BITS); ++i) {
+               t = i * jpc_pow2i(-JPC_NMSEDEC_FRACBITS);
+               u = t;
+               v = t - 1.5;
+               jpc_signmsedec[i] = jpc_dbltofix(floor((u * u - v * v) * jpc_pow2i(JPC_NMSEDEC_FRACBITS) + 0.5) / jpc_pow2i(JPC_NMSEDEC_FRACBITS));
+/* XXX - this calc is not correct */
+               jpc_signmsedec0[i] = jpc_dbltofix(floor((u * u) * jpc_pow2i(JPC_NMSEDEC_FRACBITS) + 0.5) / jpc_pow2i(JPC_NMSEDEC_FRACBITS));
+               u = t - 1.0;
+               if (i & (1 << (JPC_NMSEDEC_BITS - 1))) {
+                       v = t - 1.5;
+               } else {
+                       v = t - 0.5;
+               }
+               jpc_refnmsedec[i] = jpc_dbltofix(floor((u * u - v * v) * jpc_pow2i(JPC_NMSEDEC_FRACBITS) + 0.5) / jpc_pow2i(JPC_NMSEDEC_FRACBITS));
+/* XXX - this calc is not correct */
+               jpc_refnmsedec0[i] = jpc_dbltofix(floor((u * u) * jpc_pow2i(JPC_NMSEDEC_FRACBITS) + 0.5) / jpc_pow2i(JPC_NMSEDEC_FRACBITS));
+       }
+}
+
+jpc_fix_t jpc_getsignmsedec_func(jpc_fix_t x, int bitpos)
+{
+       jpc_fix_t y;
+       assert(!(x & (~JAS_ONES(bitpos + 1))));
+       y = jpc_getsignmsedec_macro(x, bitpos);
+       return y;
+}
+
+int jpc_getzcctxno(int f, int orient)
+{
+       int h;
+       int v;
+       int d;
+       int n;
+       int t;
+       int hv;
+
+       /* Avoid compiler warning. */
+       n = 0;
+
+       h = ((f & JPC_WSIG) != 0) + ((f & JPC_ESIG) != 0);
+       v = ((f & JPC_NSIG) != 0) + ((f & JPC_SSIG) != 0);
+       d = ((f & JPC_NWSIG) != 0) + ((f & JPC_NESIG) != 0) + ((f & JPC_SESIG) != 0) + ((f & JPC_SWSIG) != 0);
+       switch (orient) {
+       case JPC_TSFB_HL:
+               t = h;
+               h = v;
+               v = t;
+       case JPC_TSFB_LL:
+       case JPC_TSFB_LH:
+               if (!h) {
+                       if (!v) {
+                               if (!d) {
+                                       n = 0;
+                               } else if (d == 1) {
+                                       n = 1;
+                               } else {
+                                       n = 2;
+                               }
+                       } else if (v == 1) {
+                               n = 3;
+                       } else {
+                               n = 4;
+                       }
+               } else if (h == 1) {
+                       if (!v) {
+                               if (!d) {
+                                       n = 5;
+                               } else {
+                                       n = 6;
+                               }
+                       } else {
+                               n = 7;
+                       }
+               } else {
+                       n = 8;
+               }
+               break;
+       case JPC_TSFB_HH:
+               hv = h + v;
+               if (!d) {
+                       if (!hv) {
+                               n = 0;
+                       } else if (hv == 1) {
+                               n = 1;
+                       } else {
+                               n = 2;
+                       }
+               } else if (d == 1) {
+                       if (!hv) {
+                               n = 3;
+                       } else if (hv == 1) {
+                               n = 4;
+                       } else {
+                               n = 5;
+                       }
+               } else if (d == 2) {
+                       if (!hv) {
+                               n = 6;
+                       } else {
+                               n = 7;
+                       }
+               } else {
+                       n = 8;
+               }
+               break;
+       }
+       assert(n < JPC_NUMZCCTXS);
+       return JPC_ZCCTXNO + n;
+}
+
+int jpc_getspb(int f)
+{
+       int hc;
+       int vc;
+       int n;
+
+       hc = JAS_MIN(((f & (JPC_ESIG | JPC_ESGN)) == JPC_ESIG) + ((f & (JPC_WSIG | JPC_WSGN)) == JPC_WSIG), 1) -
+         JAS_MIN(((f & (JPC_ESIG | JPC_ESGN)) == (JPC_ESIG | JPC_ESGN)) + ((f & (JPC_WSIG | JPC_WSGN)) == (JPC_WSIG | JPC_WSGN)), 1);
+       vc = JAS_MIN(((f & (JPC_NSIG | JPC_NSGN)) == JPC_NSIG) + ((f & (JPC_SSIG | JPC_SSGN)) == JPC_SSIG), 1) -
+         JAS_MIN(((f & (JPC_NSIG | JPC_NSGN)) == (JPC_NSIG | JPC_NSGN)) + ((f & (JPC_SSIG | JPC_SSGN)) == (JPC_SSIG | JPC_SSGN)), 1);
+       if (!hc && !vc) {
+               n = 0;
+       } else {
+               n = (!(hc > 0 || (!hc && vc > 0)));
+       }
+       return n;
+}
+
+int jpc_getscctxno(int f)
+{
+       int hc;
+       int vc;
+       int n;
+
+       /* Avoid compiler warning. */
+       n = 0;
+
+       hc = JAS_MIN(((f & (JPC_ESIG | JPC_ESGN)) == JPC_ESIG) + ((f & (JPC_WSIG | JPC_WSGN)) == JPC_WSIG),
+         1) - JAS_MIN(((f & (JPC_ESIG | JPC_ESGN)) == (JPC_ESIG | JPC_ESGN)) +
+         ((f & (JPC_WSIG | JPC_WSGN)) == (JPC_WSIG | JPC_WSGN)), 1);
+       vc = JAS_MIN(((f & (JPC_NSIG | JPC_NSGN)) == JPC_NSIG) + ((f & (JPC_SSIG | JPC_SSGN)) == JPC_SSIG),
+         1) - JAS_MIN(((f & (JPC_NSIG | JPC_NSGN)) == (JPC_NSIG | JPC_NSGN)) +
+         ((f & (JPC_SSIG | JPC_SSGN)) == (JPC_SSIG | JPC_SSGN)), 1);
+       assert(hc >= -1 && hc <= 1 && vc >= -1 && vc <= 1);
+       if (hc < 0) {
+               hc = -hc;
+               vc = -vc;
+       }
+       if (!hc) {
+               if (vc == -1) {
+                       n = 1;
+               } else if (!vc) {
+                       n = 0;
+               } else {
+                       n = 1;
+               }
+       } else if (hc == 1) {
+               if (vc == -1) {
+                       n = 2;
+               } else if (!vc) {
+                       n = 3;
+               } else {
+                       n = 4;
+               }
+       }
+       assert(n < JPC_NUMSCCTXS);
+       return JPC_SCCTXNO + n;
+}
+
+int jpc_getmagctxno(int f)
+{
+       int n;
+
+       if (!(f & JPC_REFINE)) {
+               n = (f & (JPC_OTHSIGMSK)) ? 1 : 0;
+       } else {
+               n = 2;
+       }
+
+       assert(n < JPC_NUMMAGCTXS);
+       return JPC_MAGCTXNO + n;
+}
+
+void jpc_initctxs(jpc_mqctx_t *ctxs)
+{
+       jpc_mqctx_t *ctx;
+       int i;
+
+       ctx = ctxs;
+       for (i = 0; i < JPC_NUMCTXS; ++i) {
+               ctx->mps = 0;
+               switch (i) {
+               case JPC_UCTXNO:
+                       ctx->ind = 46;
+                       break;
+               case JPC_ZCCTXNO:
+                       ctx->ind = 4;
+                       break;
+               case JPC_AGGCTXNO:
+                       ctx->ind = 3;
+                       break;
+               default:
+                       ctx->ind = 0;
+                       break;
+               }
+               ++ctx;
+       }
+}
+
+void jpc_initmqctxs()
+{
+       jpc_initctxs(jpc_mqctxs);
+}
+
+/* Calculate the real quantity exp2(n), where x is an integer. */
+double jpc_pow2i(int n)
+{
+       double x;
+       double a;
+
+       x = 1.0;
+       if (n < 0) {
+               a = 0.5;
+               n = -n;
+       } else {
+               a = 2.0;
+       }
+       while (--n >= 0) {
+               x *= a;
+       }
+       return x;
+}
diff --git a/src/libjasper/jpc/jpc_t1cod.h b/src/libjasper/jpc/jpc_t1cod.h
new file mode 100644 (file)
index 0000000..2edf73d
--- /dev/null
@@ -0,0 +1,295 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * $Id$
+ */
+
+#ifndef JPC_T1COD_H
+#define JPC_T1COD_H
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include "jasper/jas_fix.h"
+#include "jasper/jas_math.h"
+
+#include "jpc_mqcod.h"
+#include "jpc_tsfb.h"
+
+/******************************************************************************\
+* Constants.
+\******************************************************************************/
+
+/* The number of bits used to index into various lookup tables. */
+#define JPC_NMSEDEC_BITS       7
+#define JPC_NMSEDEC_FRACBITS   (JPC_NMSEDEC_BITS - 1)
+
+/*
+ * Segment types.
+ */
+
+/* Invalid. */
+#define JPC_SEG_INVALID        0
+/* MQ. */
+#define JPC_SEG_MQ             1
+/* Raw. */
+#define JPC_SEG_RAW            2
+
+/* The nominal word size. */
+#define        JPC_PREC        32
+
+/* Tier-1 coding pass types. */
+#define        JPC_SIGPASS     0       /* significance */
+#define        JPC_REFPASS     1       /* refinement */
+#define        JPC_CLNPASS     2       /* cleanup */
+
+/*
+ * Per-sample state information for tier-1 coding.
+ */
+
+/* The northeast neighbour has been found to be significant. */
+#define        JPC_NESIG       0x0001
+/* The southeast neighbour has been found to be significant. */
+#define        JPC_SESIG       0x0002
+/* The southwest neighbour has been found to be significant. */
+#define        JPC_SWSIG       0x0004
+/* The northwest neighbour has been found to be significant. */
+#define        JPC_NWSIG       0x0008
+/* The north neighbour has been found to be significant. */
+#define        JPC_NSIG        0x0010
+/* The east neighbour has been found to be significant. */
+#define        JPC_ESIG        0x0020
+/* The south neighbour has been found to be significant. */
+#define        JPC_SSIG        0x0040
+/* The west neighbour has been found to be significant. */
+#define        JPC_WSIG        0x0080
+/* The significance mask for 8-connected neighbours. */
+#define        JPC_OTHSIGMSK \
+       (JPC_NSIG | JPC_NESIG | JPC_ESIG | JPC_SESIG | JPC_SSIG | JPC_SWSIG | JPC_WSIG | JPC_NWSIG)
+/* The significance mask for 4-connected neighbours. */
+#define        JPC_PRIMSIGMSK  (JPC_NSIG | JPC_ESIG | JPC_SSIG | JPC_WSIG)
+
+/* The north neighbour is negative in value. */
+#define        JPC_NSGN        0x0100
+/* The east neighbour is negative in value. */
+#define        JPC_ESGN        0x0200
+/* The south neighbour is negative in value. */
+#define        JPC_SSGN        0x0400
+/* The west neighbour is negative in value. */
+#define        JPC_WSGN        0x0800
+/* The sign mask for 4-connected neighbours. */
+#define        JPC_SGNMSK      (JPC_NSGN | JPC_ESGN | JPC_SSGN | JPC_WSGN)
+
+/* This sample has been found to be significant. */
+#define JPC_SIG                0x1000
+/* The sample has been refined. */
+#define        JPC_REFINE      0x2000
+/* This sample has been processed during the significance pass. */
+#define        JPC_VISIT       0x4000
+
+/* The number of aggregation contexts. */
+#define        JPC_NUMAGGCTXS  1
+/* The number of zero coding contexts. */
+#define        JPC_NUMZCCTXS   9
+/* The number of magnitude contexts. */
+#define        JPC_NUMMAGCTXS  3
+/* The number of sign coding contexts. */
+#define        JPC_NUMSCCTXS   5
+/* The number of uniform contexts. */
+#define        JPC_NUMUCTXS    1
+
+/* The context ID for the first aggregation context. */
+#define        JPC_AGGCTXNO    0
+/* The context ID for the first zero coding context. */
+#define        JPC_ZCCTXNO             (JPC_AGGCTXNO + JPC_NUMAGGCTXS)
+/* The context ID for the first magnitude context. */
+#define        JPC_MAGCTXNO    (JPC_ZCCTXNO + JPC_NUMZCCTXS)
+/* The context ID for the first sign coding context. */
+#define        JPC_SCCTXNO             (JPC_MAGCTXNO + JPC_NUMMAGCTXS)
+/* The context ID for the first uniform context. */
+#define        JPC_UCTXNO              (JPC_SCCTXNO + JPC_NUMSCCTXS)
+/* The total number of contexts. */
+#define        JPC_NUMCTXS             (JPC_UCTXNO + JPC_NUMUCTXS)
+
+/******************************************************************************\
+* External data.
+\******************************************************************************/
+
+/* These lookup tables are used by various macros/functions. */
+/* Do not access these lookup tables directly. */
+extern int jpc_zcctxnolut[];
+extern int jpc_spblut[];
+extern int jpc_scctxnolut[];
+extern int jpc_magctxnolut[];
+extern jpc_fix_t jpc_refnmsedec[];
+extern jpc_fix_t jpc_signmsedec[];
+extern jpc_fix_t jpc_refnmsedec0[];
+extern jpc_fix_t jpc_signmsedec0[];
+
+/* The initial settings for the MQ contexts. */
+extern jpc_mqctx_t jpc_mqctxs[];
+
+/******************************************************************************\
+* Functions and macros.
+\******************************************************************************/
+
+/* Initialize the MQ contexts. */
+void jpc_initctxs(jpc_mqctx_t *ctxs);
+
+/* Get the zero coding context. */
+int jpc_getzcctxno(int f, int orient);
+#define        JPC_GETZCCTXNO(f, orient) \
+       (jpc_zcctxnolut[((orient) << 8) | ((f) & JPC_OTHSIGMSK)])
+
+/* Get the sign prediction bit. */
+int jpc_getspb(int f);
+#define        JPC_GETSPB(f) \
+       (jpc_spblut[((f) & (JPC_PRIMSIGMSK | JPC_SGNMSK)) >> 4])
+
+/* Get the sign coding context. */
+int jpc_getscctxno(int f);
+#define        JPC_GETSCCTXNO(f) \
+       (jpc_scctxnolut[((f) & (JPC_PRIMSIGMSK | JPC_SGNMSK)) >> 4])
+
+/* Get the magnitude context. */
+int jpc_getmagctxno(int f);
+#define        JPC_GETMAGCTXNO(f) \
+       (jpc_magctxnolut[((f) & JPC_OTHSIGMSK) | ((((f) & JPC_REFINE) != 0) << 11)])
+
+/* Get the normalized MSE reduction for significance passes. */
+#define        JPC_GETSIGNMSEDEC(x, bitpos)    jpc_getsignmsedec_macro(x, bitpos)
+jpc_fix_t jpc_getsignmsedec_func(jpc_fix_t x, int bitpos);
+#define        jpc_getsignmsedec_macro(x, bitpos) \
+       ((bitpos > JPC_NMSEDEC_FRACBITS) ? jpc_signmsedec[JPC_ASR(x, bitpos - JPC_NMSEDEC_FRACBITS) & JAS_ONES(JPC_NMSEDEC_BITS)] : \
+         (jpc_signmsedec0[JPC_ASR(x, bitpos - JPC_NMSEDEC_FRACBITS) & JAS_ONES(JPC_NMSEDEC_BITS)]))
+
+/* Get the normalized MSE reduction for refinement passes. */
+#define        JPC_GETREFNMSEDEC(x, bitpos)    jpc_getrefnmsedec_macro(x, bitpos)
+jpc_fix_t jpc_refsignmsedec_func(jpc_fix_t x, int bitpos);
+#define        jpc_getrefnmsedec_macro(x, bitpos) \
+       ((bitpos > JPC_NMSEDEC_FRACBITS) ? jpc_refnmsedec[JPC_ASR(x, bitpos - JPC_NMSEDEC_FRACBITS) & JAS_ONES(JPC_NMSEDEC_BITS)] : \
+         (jpc_refnmsedec0[JPC_ASR(x, bitpos - JPC_NMSEDEC_FRACBITS) & JAS_ONES(JPC_NMSEDEC_BITS)]))
+
+/* Arithmetic shift right (with ability to shift left also). */
+#define        JPC_ASR(x, n) \
+       (((n) >= 0) ? ((x) >> (n)) : ((x) << (-(n))))
+
+/* Update the per-sample state information. */
+#define        JPC_UPDATEFLAGS4(fp, rowstep, s, vcausalflag) \
+{ \
+       register jpc_fix_t *np = (fp) - (rowstep); \
+       register jpc_fix_t *sp = (fp) + (rowstep); \
+       if ((vcausalflag)) { \
+               sp[-1] |= JPC_NESIG; \
+               sp[1] |= JPC_NWSIG; \
+               if (s) { \
+                       *sp |= JPC_NSIG | JPC_NSGN; \
+                       (fp)[-1] |= JPC_ESIG | JPC_ESGN; \
+                       (fp)[1] |= JPC_WSIG | JPC_WSGN; \
+               } else { \
+                       *sp |= JPC_NSIG; \
+                       (fp)[-1] |= JPC_ESIG; \
+                       (fp)[1] |= JPC_WSIG; \
+               } \
+       } else { \
+               np[-1] |= JPC_SESIG; \
+               np[1] |= JPC_SWSIG; \
+               sp[-1] |= JPC_NESIG; \
+               sp[1] |= JPC_NWSIG; \
+               if (s) { \
+                       *np |= JPC_SSIG | JPC_SSGN; \
+                       *sp |= JPC_NSIG | JPC_NSGN; \
+                       (fp)[-1] |= JPC_ESIG | JPC_ESGN; \
+                       (fp)[1] |= JPC_WSIG | JPC_WSGN; \
+               } else { \
+                       *np |= JPC_SSIG; \
+                       *sp |= JPC_NSIG; \
+                       (fp)[-1] |= JPC_ESIG; \
+                       (fp)[1] |= JPC_WSIG; \
+               } \
+       } \
+}
+
+/* Initialize the lookup tables used by the codec. */
+void jpc_initluts(void);
+
+/* Get the nominal gain associated with a particular band. */
+int JPC_NOMINALGAIN(int qmfbid, int numlvls, int lvlno, int orient);
+
+/* Get the coding pass type. */
+int JPC_PASSTYPE(int passno);
+
+/* Get the segment type. */
+int JPC_SEGTYPE(int passno, int firstpassno, int bypass);
+
+/* Get the number of coding passess in the segment. */
+int JPC_SEGPASSCNT(int passno, int firstpassno, int numpasses, int bypass,
+  int termall);
+
+/* Is the coding pass terminated? */
+int JPC_ISTERMINATED(int passno, int firstpassno, int numpasses, int termall,
+  int lazy);
+
+#endif
diff --git a/src/libjasper/jpc/jpc_t1dec.c b/src/libjasper/jpc/jpc_t1dec.c
new file mode 100644 (file)
index 0000000..8bbe83a
--- /dev/null
@@ -0,0 +1,922 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Tier 1 Decoder
+ *
+ * $Id$
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+
+#include "jasper/jas_fix.h"
+#include "jasper/jas_stream.h"
+#include "jasper/jas_math.h"
+
+#include "jpc_bs.h"
+#include "jpc_mqdec.h"
+#include "jpc_t1dec.h"
+#include "jpc_t1cod.h"
+#include "jpc_dec.h"
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+static int jpc_dec_decodecblk(jpc_dec_t *dec, jpc_dec_tile_t *tile, jpc_dec_tcomp_t *tcomp, jpc_dec_band_t *band,
+  jpc_dec_cblk_t *cblk, int dopartial, int maxlyrs);
+static int dec_sigpass(jpc_dec_t *dec, jpc_mqdec_t *mqdec, int bitpos, int orient,
+  int vcausalflag, jas_matrix_t *flags, jas_matrix_t *data);
+static int dec_rawsigpass(jpc_dec_t *dec, jpc_bitstream_t *in, int bitpos,
+  int vcausalflag, jas_matrix_t *flags, jas_matrix_t *data);
+static int dec_refpass(jpc_dec_t *dec, jpc_mqdec_t *mqdec, int bitpos, int vcausalflag,
+  jas_matrix_t *flags, jas_matrix_t *data);
+static int dec_rawrefpass(jpc_dec_t *dec, jpc_bitstream_t *in, int bitpos,
+  int vcausalflag, jas_matrix_t *flags, jas_matrix_t *data);
+static int dec_clnpass(jpc_dec_t *dec, jpc_mqdec_t *mqdec, int bitpos, int orient,
+  int vcausalflag, int segsymflag, jas_matrix_t *flags, jas_matrix_t *data);
+
+#if defined(DEBUG)
+static long t1dec_cnt = 0;
+#endif
+
+#if !defined(DEBUG)
+#define        JPC_T1D_GETBIT(mqdec, v, passtypename, symtypename) \
+       ((v) = jpc_mqdec_getbit(mqdec))
+#else
+#define        JPC_T1D_GETBIT(mqdec, v, passtypename, symtypename) \
+{ \
+       (v) = jpc_mqdec_getbit(mqdec); \
+       if (jas_getdbglevel() >= 100) { \
+               jas_eprintf("index = %ld; passtype = %s; symtype = %s; sym = %d\n", t1dec_cnt, passtypename, symtypename, v); \
+               ++t1dec_cnt; \
+       } \
+}
+#endif
+#define        JPC_T1D_GETBITNOSKEW(mqdec, v, passtypename, symtypename) \
+       JPC_T1D_GETBIT(mqdec, v, passtypename, symtypename)
+
+#if !defined(DEBUG)
+#define        JPC_T1D_RAWGETBIT(bitstream, v, passtypename, symtypename) \
+       ((v) = jpc_bitstream_getbit(bitstream))
+#else
+#define        JPC_T1D_RAWGETBIT(bitstream, v, passtypename, symtypename) \
+{ \
+       (v) = jpc_bitstream_getbit(bitstream); \
+       if (jas_getdbglevel() >= 100) { \
+               jas_eprintf("index = %ld; passtype = %s; symtype = %s; sym = %d\n", t1dec_cnt, passtypename, symtypename, v); \
+               ++t1dec_cnt; \
+       } \
+}
+#endif
+
+/******************************************************************************\
+* Code.
+\******************************************************************************/
+
+int jpc_dec_decodecblks(jpc_dec_t *dec, jpc_dec_tile_t *tile)
+{
+       jpc_dec_tcomp_t *tcomp;
+       int compcnt;
+       jpc_dec_rlvl_t *rlvl;
+       int rlvlcnt;
+       jpc_dec_band_t *band;
+       int bandcnt;
+       jpc_dec_prc_t *prc;
+       int prccnt;
+       jpc_dec_cblk_t *cblk;
+       int cblkcnt;
+
+       for (compcnt = dec->numcomps, tcomp = tile->tcomps; compcnt > 0;
+         --compcnt, ++tcomp) {
+               for (rlvlcnt = tcomp->numrlvls, rlvl = tcomp->rlvls;
+                 rlvlcnt > 0; --rlvlcnt, ++rlvl) {
+                       if (!rlvl->bands) {
+                               continue;
+                       }
+                       for (bandcnt = rlvl->numbands, band = rlvl->bands;
+                         bandcnt > 0; --bandcnt, ++band) {
+                               if (!band->data) {
+                                       continue;
+                               }
+                               for (prccnt = rlvl->numprcs, prc = band->prcs;
+                                 prccnt > 0; --prccnt, ++prc) {
+                                       if (!prc->cblks) {
+                                               continue;
+                                       }
+                                       for (cblkcnt = prc->numcblks,
+                                         cblk = prc->cblks; cblkcnt > 0;
+                                         --cblkcnt, ++cblk) {
+                                               if (jpc_dec_decodecblk(dec, tile, tcomp,
+                                                 band, cblk, 1, JPC_MAXLYRS)) {
+                                                       return -1;
+                                               }
+                                       }
+                               }
+
+                       }
+               }
+       }
+
+       return 0;
+}
+
+static int jpc_dec_decodecblk(jpc_dec_t *dec, jpc_dec_tile_t *tile, jpc_dec_tcomp_t *tcomp, jpc_dec_band_t *band,
+  jpc_dec_cblk_t *cblk, int dopartial, int maxlyrs)
+{
+       jpc_dec_seg_t *seg;
+       int i;
+       int bpno;
+       int passtype;
+       int ret;
+       int compno;
+       int filldata;
+       int fillmask;
+       jpc_dec_ccp_t *ccp;
+
+       compno = tcomp - tile->tcomps;
+
+       if (!cblk->flags) {
+               /* Note: matrix is assumed to be zeroed */
+               if (!(cblk->flags = jas_matrix_create(jas_matrix_numrows(cblk->data) +
+                 2, jas_matrix_numcols(cblk->data) + 2))) {
+                       return -1;
+               }
+       }
+
+       seg = cblk->segs.head;
+       while (seg && (seg != cblk->curseg || dopartial) && (maxlyrs < 0 ||
+         seg->lyrno < maxlyrs)) {
+               assert(seg->numpasses >= seg->maxpasses || dopartial);
+               assert(seg->stream);
+               jas_stream_rewind(seg->stream);
+               jas_stream_setrwcount(seg->stream, 0);
+               if (seg->type == JPC_SEG_MQ) {
+                       if (!cblk->mqdec) {
+                               if (!(cblk->mqdec = jpc_mqdec_create(JPC_NUMCTXS, 0))) {
+                                       return -1;
+                               }
+                               jpc_mqdec_setctxs(cblk->mqdec, JPC_NUMCTXS, jpc_mqctxs);
+                       }
+                       jpc_mqdec_setinput(cblk->mqdec, seg->stream);
+                       jpc_mqdec_init(cblk->mqdec);
+               } else {
+                       assert(seg->type == JPC_SEG_RAW);
+                       if (!cblk->nulldec) {
+                               if (!(cblk->nulldec = jpc_bitstream_sopen(seg->stream, "r"))) {
+                                       assert(0);
+                               }
+                       }
+               }
+
+
+               for (i = 0; i < seg->numpasses; ++i) {
+                       if (cblk->numimsbs > band->numbps) {
+                               ccp = &tile->cp->ccps[compno];
+                               if (ccp->roishift <= 0) {
+                                       jas_eprintf("warning: corrupt code stream\n");
+                               } else {
+                                       if (cblk->numimsbs < ccp->roishift - band->numbps) {
+                                               jas_eprintf("warning: corrupt code stream\n");
+                                       }
+                               }
+                       }
+                       bpno = band->roishift + band->numbps - 1 - (cblk->numimsbs +
+                         (seg->passno + i - cblk->firstpassno + 2) / 3);
+if (bpno < 0) {
+       goto premature_exit;
+}
+#if 1
+                       passtype = (seg->passno + i + 2) % 3;
+#else
+                       passtype = JPC_PASSTYPE(seg->passno + i + 2);
+#endif
+                       assert(bpno >= 0 && bpno < 31);
+                       switch (passtype) {
+                       case JPC_SIGPASS:
+                               ret = (seg->type == JPC_SEG_MQ) ? dec_sigpass(dec,
+                                 cblk->mqdec, bpno, band->orient,
+                                 (tile->cp->ccps[compno].cblkctx & JPC_COX_VSC) != 0,
+                                 cblk->flags, cblk->data) :
+                                 dec_rawsigpass(dec, cblk->nulldec, bpno,
+                                 (tile->cp->ccps[compno].cblkctx & JPC_COX_VSC) != 0,
+                                 cblk->flags, cblk->data);
+                               break;
+                       case JPC_REFPASS:
+                               ret = (seg->type == JPC_SEG_MQ) ?
+                                 dec_refpass(dec, cblk->mqdec, bpno,
+                                 (tile->cp->ccps[compno].cblkctx & JPC_COX_VSC) != 0,
+                                 cblk->flags, cblk->data) :
+                                 dec_rawrefpass(dec, cblk->nulldec, bpno,
+                                 (tile->cp->ccps[compno].cblkctx & JPC_COX_VSC) != 0,
+                                 cblk->flags, cblk->data);
+                               break;
+                       case JPC_CLNPASS:
+                               assert(seg->type == JPC_SEG_MQ);
+                               ret = dec_clnpass(dec, cblk->mqdec, bpno,
+                                 band->orient, (tile->cp->ccps[compno].cblkctx &
+                                 JPC_COX_VSC) != 0, (tile->cp->ccps[compno].cblkctx &
+                                 JPC_COX_SEGSYM) != 0, cblk->flags,
+                                 cblk->data);
+                               break;
+                       default:
+                               ret = -1;
+                               break;
+                       }
+                       /* Do we need to reset after each coding pass? */
+                       if (tile->cp->ccps[compno].cblkctx & JPC_COX_RESET) {
+                               jpc_mqdec_setctxs(cblk->mqdec, JPC_NUMCTXS, jpc_mqctxs);
+                       }
+
+                       if (ret) {
+                               jas_eprintf("coding pass failed passtype=%d segtype=%d\n", passtype, seg->type);
+                               return -1;
+                       }
+
+               }
+
+               if (seg->type == JPC_SEG_MQ) {
+/* Note: dont destroy mq decoder because context info will be lost */
+               } else {
+                       assert(seg->type == JPC_SEG_RAW);
+                       if (tile->cp->ccps[compno].cblkctx & JPC_COX_PTERM) {
+                               fillmask = 0x7f;
+                               filldata = 0x2a;
+                       } else {
+                               fillmask = 0;
+                               filldata = 0;
+                       }
+                       if ((ret = jpc_bitstream_inalign(cblk->nulldec, fillmask,
+                         filldata)) < 0) {
+                               return -1;
+                       } else if (ret > 0) {
+                               jas_eprintf("warning: bad termination pattern detected\n");
+                       }
+                       jpc_bitstream_close(cblk->nulldec);
+                       cblk->nulldec = 0;
+               }
+
+               cblk->curseg = seg->next;
+               jpc_seglist_remove(&cblk->segs, seg);
+               jpc_seg_destroy(seg);
+               seg = cblk->curseg;
+       }
+
+       assert(dopartial ? (!cblk->curseg) : 1);
+
+premature_exit:
+       return 0;
+}
+
+/******************************************************************************\
+* Code for significance pass.
+\******************************************************************************/
+
+#define        jpc_sigpass_step(fp, frowstep, dp, bitpos, oneplushalf, orient, mqdec, vcausalflag) \
+{ \
+       int f; \
+       int v; \
+       f = *(fp); \
+       if ((f & JPC_OTHSIGMSK) && !(f & (JPC_SIG | JPC_VISIT))) { \
+               jpc_mqdec_setcurctx((mqdec), JPC_GETZCCTXNO(f, (orient))); \
+               JPC_T1D_GETBIT((mqdec), v, "SIG", "ZC"); \
+               if (v) { \
+                       jpc_mqdec_setcurctx((mqdec), JPC_GETSCCTXNO(f)); \
+                       JPC_T1D_GETBIT((mqdec), v, "SIG", "SC"); \
+                       v ^= JPC_GETSPB(f); \
+                       JPC_UPDATEFLAGS4((fp), (frowstep), v, (vcausalflag)); \
+                       *(fp) |= JPC_SIG; \
+                       *(dp) = (v) ? (-(oneplushalf)) : (oneplushalf); \
+               } \
+               *(fp) |= JPC_VISIT; \
+       } \
+}
+
+static int dec_sigpass(jpc_dec_t *dec, register jpc_mqdec_t *mqdec, int bitpos, int orient,
+  int vcausalflag, jas_matrix_t *flags, jas_matrix_t *data)
+{
+       int i;
+       int j;
+       int one;
+       int half;
+       int oneplushalf;
+       int vscanlen;
+       int width;
+       int height;
+       jpc_fix_t *fp;
+       int frowstep;
+       int fstripestep;
+       jpc_fix_t *fstripestart;
+       jpc_fix_t *fvscanstart;
+       jpc_fix_t *dp;
+       int drowstep;
+       int dstripestep;
+       jpc_fix_t *dstripestart;
+       jpc_fix_t *dvscanstart;
+       int k;
+
+       /* Avoid compiler warning about unused parameters. */
+       dec = 0;
+
+       width = jas_matrix_numcols(data);
+       height = jas_matrix_numrows(data);
+       frowstep = jas_matrix_rowstep(flags);
+       drowstep = jas_matrix_rowstep(data);
+       fstripestep = frowstep << 2;
+       dstripestep = drowstep << 2;
+
+       one = 1 << bitpos;
+       half = one >> 1;
+       oneplushalf = one | half;
+
+       fstripestart = jas_matrix_getref(flags, 1, 1);
+       dstripestart = jas_matrix_getref(data, 0, 0);
+       for (i = height; i > 0; i -= 4, fstripestart += fstripestep,
+         dstripestart += dstripestep) {
+               fvscanstart = fstripestart;
+               dvscanstart = dstripestart;
+               vscanlen = JAS_MIN(i, 4);
+               for (j = width; j > 0; --j, ++fvscanstart, ++dvscanstart) {
+                       fp = fvscanstart;
+                       dp = dvscanstart;
+                       k = vscanlen;
+
+                       /* Process first sample in vertical scan. */
+                       jpc_sigpass_step(fp, frowstep, dp, bitpos, oneplushalf,
+                         orient, mqdec, vcausalflag);
+                       if (--k <= 0) {
+                               continue;
+                       }
+                       fp += frowstep;
+                       dp += drowstep;
+
+                       /* Process second sample in vertical scan. */
+                       jpc_sigpass_step(fp, frowstep, dp, bitpos, oneplushalf,
+                         orient, mqdec, 0);
+                       if (--k <= 0) {
+                               continue;
+                       }
+                       fp += frowstep;
+                       dp += drowstep;
+
+                       /* Process third sample in vertical scan. */
+                       jpc_sigpass_step(fp, frowstep, dp, bitpos, oneplushalf,
+                         orient, mqdec, 0);
+                       if (--k <= 0) {
+                               continue;
+                       }
+                       fp += frowstep;
+                       dp += drowstep;
+
+                       /* Process fourth sample in vertical scan. */
+                       jpc_sigpass_step(fp, frowstep, dp, bitpos, oneplushalf,
+                         orient, mqdec, 0);
+               }
+       }
+       return 0;
+}
+
+#define        jpc_rawsigpass_step(fp, frowstep, dp, oneplushalf, in, vcausalflag) \
+{ \
+       jpc_fix_t f = *(fp); \
+       jpc_fix_t v; \
+       if ((f & JPC_OTHSIGMSK) && !(f & (JPC_SIG | JPC_VISIT))) { \
+               JPC_T1D_RAWGETBIT(in, v, "SIG", "ZC"); \
+               if (v < 0) { \
+                       return -1; \
+               } \
+               if (v) { \
+                       JPC_T1D_RAWGETBIT(in, v, "SIG", "SC"); \
+                       if (v < 0) { \
+                               return -1; \
+                       } \
+                       JPC_UPDATEFLAGS4((fp), (frowstep), v, (vcausalflag)); \
+                       *(fp) |= JPC_SIG; \
+                       *(dp) = v ? (-oneplushalf) : (oneplushalf); \
+               } \
+               *(fp) |= JPC_VISIT; \
+       } \
+}
+
+static int dec_rawsigpass(jpc_dec_t *dec, jpc_bitstream_t *in, int bitpos, int vcausalflag,
+  jas_matrix_t *flags, jas_matrix_t *data)
+{
+       int i;
+       int j;
+       int k;
+       int one;
+       int half;
+       int oneplushalf;
+       int vscanlen;
+       int width;
+       int height;
+       jpc_fix_t *fp;
+       int frowstep;
+       int fstripestep;
+       jpc_fix_t *fstripestart;
+       jpc_fix_t *fvscanstart;
+       jpc_fix_t *dp;
+       int drowstep;
+       int dstripestep;
+       jpc_fix_t *dstripestart;
+       jpc_fix_t *dvscanstart;
+
+       /* Avoid compiler warning about unused parameters. */
+       dec = 0;
+
+       width = jas_matrix_numcols(data);
+       height = jas_matrix_numrows(data);
+       frowstep = jas_matrix_rowstep(flags);
+       drowstep = jas_matrix_rowstep(data);
+       fstripestep = frowstep << 2;
+       dstripestep = drowstep << 2;
+
+       one = 1 << bitpos;
+       half = one >> 1;
+       oneplushalf = one | half;
+
+       fstripestart = jas_matrix_getref(flags, 1, 1);
+       dstripestart = jas_matrix_getref(data, 0, 0);
+       for (i = height; i > 0; i -= 4, fstripestart += fstripestep,
+         dstripestart += dstripestep) {
+               fvscanstart = fstripestart;
+               dvscanstart = dstripestart;
+               vscanlen = JAS_MIN(i, 4);
+               for (j = width; j > 0; --j, ++fvscanstart, ++dvscanstart) {
+                       fp = fvscanstart;
+                       dp = dvscanstart;
+                       k = vscanlen;
+
+                       /* Process first sample in vertical scan. */
+                       jpc_rawsigpass_step(fp, frowstep, dp, oneplushalf,
+                         in, vcausalflag);
+                       if (--k <= 0) {
+                               continue;
+                       }
+                       fp += frowstep;
+                       dp += drowstep;
+
+                       /* Process second sample in vertical scan. */
+                       jpc_rawsigpass_step(fp, frowstep, dp, oneplushalf,
+                         in, 0);
+                       if (--k <= 0) {
+                               continue;
+                       }
+                       fp += frowstep;
+                       dp += drowstep;
+
+                       /* Process third sample in vertical scan. */
+                       jpc_rawsigpass_step(fp, frowstep, dp, oneplushalf,
+                         in, 0);
+                       if (--k <= 0) {
+                               continue;
+                       }
+                       fp += frowstep;
+                       dp += drowstep;
+
+                       /* Process fourth sample in vertical scan. */
+                       jpc_rawsigpass_step(fp, frowstep, dp, oneplushalf,
+                         in, 0);
+
+               }
+       }
+       return 0;
+}
+
+/******************************************************************************\
+* Code for refinement pass.
+\******************************************************************************/
+
+#define        jpc_refpass_step(fp, dp, poshalf, neghalf, mqdec, vcausalflag) \
+{ \
+       int v; \
+       int t; \
+       if (((*(fp)) & (JPC_SIG | JPC_VISIT)) == JPC_SIG) { \
+               jpc_mqdec_setcurctx((mqdec), JPC_GETMAGCTXNO(*(fp))); \
+               JPC_T1D_GETBITNOSKEW((mqdec), v, "REF", "MR"); \
+               t = (v ? (poshalf) : (neghalf)); \
+               *(dp) += (*(dp) < 0) ? (-t) : t; \
+               *(fp) |= JPC_REFINE; \
+       } \
+}
+
+static int dec_refpass(jpc_dec_t *dec, register jpc_mqdec_t *mqdec, int bitpos,
+  int vcausalflag, jas_matrix_t *flags, jas_matrix_t *data)
+{
+       int i;
+       int j;
+       int vscanlen;
+       int width;
+       int height;
+       int one;
+       int poshalf;
+       int neghalf;
+       jpc_fix_t *fp;
+       int frowstep;
+       int fstripestep;
+       jpc_fix_t *fstripestart;
+       jpc_fix_t *fvscanstart;
+       jpc_fix_t *dp;
+       int drowstep;
+       int dstripestep;
+       jpc_fix_t *dstripestart;
+       jpc_fix_t *dvscanstart;
+       int k;
+
+       /* Avoid compiler warning about unused parameters. */
+       dec = 0;
+       vcausalflag = 0;
+
+       width = jas_matrix_numcols(data);
+       height = jas_matrix_numrows(data);
+       frowstep = jas_matrix_rowstep(flags);
+       drowstep = jas_matrix_rowstep(data);
+       fstripestep = frowstep << 2;
+       dstripestep = drowstep << 2;
+
+       one = 1 << bitpos;
+       poshalf = one >> 1;
+       neghalf = (bitpos > 0) ? (-poshalf) : (-1);
+
+       fstripestart = jas_matrix_getref(flags, 1, 1);
+       dstripestart = jas_matrix_getref(data, 0, 0);
+       for (i = height; i > 0; i -= 4, fstripestart += fstripestep,
+         dstripestart += dstripestep) {
+               fvscanstart = fstripestart;
+               dvscanstart = dstripestart;
+               vscanlen = JAS_MIN(i, 4);
+               for (j = width; j > 0; --j, ++fvscanstart, ++dvscanstart) {
+                       fp = fvscanstart;
+                       dp = dvscanstart;
+                       k = vscanlen;
+
+                       /* Process first sample in vertical scan. */
+                       jpc_refpass_step(fp, dp, poshalf, neghalf, mqdec,
+                         vcausalflag);
+                       if (--k <= 0) {
+                               continue;
+                       }
+                       fp += frowstep;
+                       dp += drowstep;
+
+                       /* Process second sample in vertical scan. */
+                       jpc_refpass_step(fp, dp, poshalf, neghalf, mqdec, 0);
+                       if (--k <= 0) {
+                               continue;
+                       }
+                       fp += frowstep;
+                       dp += drowstep;
+
+                       /* Process third sample in vertical scan. */
+                       jpc_refpass_step(fp, dp, poshalf, neghalf, mqdec, 0);
+                       if (--k <= 0) {
+                               continue;
+                       }
+                       fp += frowstep;
+                       dp += drowstep;
+
+                       /* Process fourth sample in vertical scan. */
+                       jpc_refpass_step(fp, dp, poshalf, neghalf, mqdec, 0);
+               }
+       }
+
+       return 0;
+}
+
+#define        jpc_rawrefpass_step(fp, dp, poshalf, neghalf, in, vcausalflag) \
+{ \
+       jpc_fix_t v; \
+       jpc_fix_t t; \
+       if (((*(fp)) & (JPC_SIG | JPC_VISIT)) == JPC_SIG) { \
+               JPC_T1D_RAWGETBIT(in, v, "REF", "MAGREF"); \
+               if (v < 0) { \
+                       return -1; \
+               } \
+               t = (v ? poshalf : neghalf); \
+               *(dp) += (*(dp) < 0) ? (-t) : t; \
+               *(fp) |= JPC_REFINE; \
+       } \
+}
+
+static int dec_rawrefpass(jpc_dec_t *dec, jpc_bitstream_t *in, int bitpos, int vcausalflag,
+  jas_matrix_t *flags, jas_matrix_t *data)
+{
+       int i;
+       int j;
+       int k;
+       int vscanlen;
+       int width;
+       int height;
+       int one;
+       int poshalf;
+       int neghalf;
+       jpc_fix_t *fp;
+       int frowstep;
+       int fstripestep;
+       jpc_fix_t *fstripestart;
+       jpc_fix_t *fvscanstart;
+       jpc_fix_t *dp;
+       int drowstep;
+       int dstripestep;
+       jpc_fix_t *dstripestart;
+       jpc_fix_t *dvscanstart;
+
+       /* Avoid compiler warning about unused parameters. */
+       dec = 0;
+       vcausalflag = 0;
+
+       width = jas_matrix_numcols(data);
+       height = jas_matrix_numrows(data);
+       frowstep = jas_matrix_rowstep(flags);
+       drowstep = jas_matrix_rowstep(data);
+       fstripestep = frowstep << 2;
+       dstripestep = drowstep << 2;
+
+       one = 1 << bitpos;
+       poshalf = one >> 1;
+       neghalf = (bitpos > 0) ? (-poshalf) : (-1);
+
+       fstripestart = jas_matrix_getref(flags, 1, 1);
+       dstripestart = jas_matrix_getref(data, 0, 0);
+       for (i = height; i > 0; i -= 4, fstripestart += fstripestep,
+         dstripestart += dstripestep) {
+               fvscanstart = fstripestart;
+               dvscanstart = dstripestart;
+               vscanlen = JAS_MIN(i, 4);
+               for (j = width; j > 0; --j, ++fvscanstart, ++dvscanstart) {
+                       fp = fvscanstart;
+                       dp = dvscanstart;
+                       k = vscanlen;
+
+                       /* Process first sample in vertical scan. */
+                       jpc_rawrefpass_step(fp, dp, poshalf, neghalf, in,
+                         vcausalflag);
+                       if (--k <= 0) {
+                               continue;
+                       }
+                       fp += frowstep;
+                       dp += drowstep;
+
+                       /* Process second sample in vertical scan. */
+                       jpc_rawrefpass_step(fp, dp, poshalf, neghalf, in, 0);
+                       if (--k <= 0) {
+                               continue;
+                       }
+                       fp += frowstep;
+                       dp += drowstep;
+
+                       /* Process third sample in vertical scan. */
+                       jpc_rawrefpass_step(fp, dp, poshalf, neghalf, in, 0);
+                       if (--k <= 0) {
+                               continue;
+                       }
+                       fp += frowstep;
+                       dp += drowstep;
+
+                       /* Process fourth sample in vertical scan. */
+                       jpc_rawrefpass_step(fp, dp, poshalf, neghalf, in, 0);
+               }
+       }
+       return 0;
+}
+
+/******************************************************************************\
+* Code for cleanup pass.
+\******************************************************************************/
+
+#define        jpc_clnpass_step(f, fp, frowstep, dp, oneplushalf, orient, mqdec, flabel, plabel, vcausalflag) \
+{ \
+       int v; \
+flabel \
+       if (!((f) & (JPC_SIG | JPC_VISIT))) { \
+               jpc_mqdec_setcurctx((mqdec), JPC_GETZCCTXNO((f), (orient))); \
+               JPC_T1D_GETBIT((mqdec), v, "CLN", "ZC"); \
+               if (v) { \
+plabel \
+                       /* Coefficient is significant. */ \
+                       jpc_mqdec_setcurctx((mqdec), JPC_GETSCCTXNO(f)); \
+                       JPC_T1D_GETBIT((mqdec), v, "CLN", "SC"); \
+                       v ^= JPC_GETSPB(f); \
+                       *(dp) = (v) ? (-(oneplushalf)) : (oneplushalf); \
+                       JPC_UPDATEFLAGS4((fp), (frowstep), v, (vcausalflag)); \
+                       *(fp) |= JPC_SIG; \
+               } \
+       } \
+       /* XXX - Is this correct?  Can aggregation cause some VISIT bits not to be reset?  Check. */ \
+       *(fp) &= ~JPC_VISIT; \
+}
+
+static int dec_clnpass(jpc_dec_t *dec, register jpc_mqdec_t *mqdec, int bitpos, int orient,
+  int vcausalflag, int segsymflag, jas_matrix_t *flags, jas_matrix_t *data)
+{
+       int i;
+       int j;
+       int k;
+       int vscanlen;
+       int v;
+       int half;
+       int runlen;
+       int f;
+       int width;
+       int height;
+       int one;
+       int oneplushalf;
+
+       jpc_fix_t *fp;
+       int frowstep;
+       int fstripestep;
+       jpc_fix_t *fstripestart;
+       jpc_fix_t *fvscanstart;
+
+       jpc_fix_t *dp;
+       int drowstep;
+       int dstripestep;
+       jpc_fix_t *dstripestart;
+       jpc_fix_t *dvscanstart;
+
+       /* Avoid compiler warning about unused parameters. */
+       dec = 0;
+
+       one = 1 << bitpos;
+       half = one >> 1;
+       oneplushalf = one | half;
+
+       width = jas_matrix_numcols(data);
+       height = jas_matrix_numrows(data);
+
+       frowstep = jas_matrix_rowstep(flags);
+       drowstep = jas_matrix_rowstep(data);
+       fstripestep = frowstep << 2;
+       dstripestep = drowstep << 2;
+
+       fstripestart = jas_matrix_getref(flags, 1, 1);
+       dstripestart = jas_matrix_getref(data, 0, 0);
+       for (i = 0; i < height; i += 4, fstripestart += fstripestep,
+         dstripestart += dstripestep) {
+               fvscanstart = fstripestart;
+               dvscanstart = dstripestart;
+               vscanlen = JAS_MIN(4, height - i);
+               for (j = width; j > 0; --j, ++fvscanstart, ++dvscanstart) {
+                       fp = fvscanstart;
+                       if (vscanlen >= 4 && (!((*fp) & (JPC_SIG | JPC_VISIT |
+                         JPC_OTHSIGMSK))) && (fp += frowstep, !((*fp) & (JPC_SIG |
+                         JPC_VISIT | JPC_OTHSIGMSK))) && (fp += frowstep, !((*fp) &
+                         (JPC_SIG | JPC_VISIT | JPC_OTHSIGMSK))) && (fp += frowstep,
+                         !((*fp) & (JPC_SIG | JPC_VISIT | JPC_OTHSIGMSK)))) {
+
+                               jpc_mqdec_setcurctx(mqdec, JPC_AGGCTXNO);
+                               JPC_T1D_GETBIT(mqdec, v, "CLN", "AGG");
+                               if (!v) {
+                                       continue;
+                               }
+                               jpc_mqdec_setcurctx(mqdec, JPC_UCTXNO);
+                               JPC_T1D_GETBITNOSKEW(mqdec, v, "CLN", "RL");
+                               runlen = v;
+                               JPC_T1D_GETBITNOSKEW(mqdec, v, "CLN", "RL");
+                               runlen = (runlen << 1) | v;
+                               f = *(fp = fvscanstart + frowstep * runlen);
+                               dp = dvscanstart + drowstep * runlen;
+                               k = vscanlen - runlen;
+                               switch (runlen) {
+                               case 0:
+                                       goto clnpass_partial0;
+                                       break;
+                               case 1:
+                                       goto clnpass_partial1;
+                                       break;
+                               case 2:
+                                       goto clnpass_partial2;
+                                       break;
+                               case 3:
+                                       goto clnpass_partial3;
+                                       break;
+                               }
+                       } else {
+                               f = *(fp = fvscanstart);
+                               dp = dvscanstart;
+                               k = vscanlen;
+                               goto clnpass_full0;
+                       }
+
+                       /* Process first sample in vertical scan. */
+                       jpc_clnpass_step(f, fp, frowstep, dp, oneplushalf, orient,
+                         mqdec, clnpass_full0:, clnpass_partial0:,
+                         vcausalflag);
+                       if (--k <= 0) {
+                               continue;
+                       }
+                       fp += frowstep;
+                       dp += drowstep;
+
+                       /* Process second sample in vertical scan. */
+                       f = *fp;
+                       jpc_clnpass_step(f, fp, frowstep, dp, oneplushalf, orient,
+                               mqdec, ;, clnpass_partial1:, 0);
+                       if (--k <= 0) {
+                               continue;
+                       }
+                       fp += frowstep;
+                       dp += drowstep;
+
+                       /* Process third sample in vertical scan. */
+                       f = *fp;
+                       jpc_clnpass_step(f, fp, frowstep, dp, oneplushalf, orient,
+                               mqdec, ;, clnpass_partial2:, 0);
+                       if (--k <= 0) {
+                               continue;
+                       }
+                       fp += frowstep;
+                       dp += drowstep;
+
+                       /* Process fourth sample in vertical scan. */
+                       f = *fp;
+                       jpc_clnpass_step(f, fp, frowstep, dp, oneplushalf, orient,
+                               mqdec, ;, clnpass_partial3:, 0);
+               }
+       }
+
+       if (segsymflag) {
+               int segsymval;
+               segsymval = 0;
+               jpc_mqdec_setcurctx(mqdec, JPC_UCTXNO);
+               JPC_T1D_GETBITNOSKEW(mqdec, v, "CLN", "SEGSYM");
+               segsymval = (segsymval << 1) | (v & 1);
+               JPC_T1D_GETBITNOSKEW(mqdec, v, "CLN", "SEGSYM");
+               segsymval = (segsymval << 1) | (v & 1);
+               JPC_T1D_GETBITNOSKEW(mqdec, v, "CLN", "SEGSYM");
+               segsymval = (segsymval << 1) | (v & 1);
+               JPC_T1D_GETBITNOSKEW(mqdec, v, "CLN", "SEGSYM");
+               segsymval = (segsymval << 1) | (v & 1);
+               if (segsymval != 0xa) {
+                       jas_eprintf("warning: bad segmentation symbol\n");
+               }
+       }
+
+       return 0;
+}
diff --git a/src/libjasper/jpc/jpc_t1dec.h b/src/libjasper/jpc/jpc_t1dec.h
new file mode 100644 (file)
index 0000000..79cc2ed
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Tier 1 Decoder
+ *
+ * $Id$
+ */
+
+#ifndef JPC_T1DEC_H
+#define JPC_T1DEC_H
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include "jpc_dec.h"
+#include "jpc_mqdec.h"
+#include "jpc_t1cod.h"
+
+/******************************************************************************\
+* Functions.
+\******************************************************************************/
+
+/* Decode all of the code blocks for a particular tile. */
+int jpc_dec_decodecblks(jpc_dec_t *dec, jpc_dec_tile_t *tile);
+
+#endif
diff --git a/src/libjasper/jpc/jpc_t1enc.c b/src/libjasper/jpc/jpc_t1enc.c
new file mode 100644 (file)
index 0000000..3a5acea
--- /dev/null
@@ -0,0 +1,959 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Tier 1 Encoder
+ *
+ * $Id$
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+
+#include "jasper/jas_fix.h"
+#include "jasper/jas_malloc.h"
+#include "jasper/jas_math.h"
+
+#include "jpc_t1enc.h"
+#include "jpc_t1cod.h"
+#include "jpc_enc.h"
+#include "jpc_cod.h"
+#include "jpc_math.h"
+
+static int jpc_encsigpass(jpc_mqenc_t *mqenc, int bitpos, int orient, int,
+  jas_matrix_t *flags, jas_matrix_t *data, int term, long *nmsedec);
+
+static int jpc_encrefpass(jpc_mqenc_t *mqenc, int bitpos, int, jas_matrix_t *flags,
+  jas_matrix_t *data, int term, long *nmsedec);
+
+static int jpc_encclnpass(jpc_mqenc_t *mqenc, int bitpos, int orient, int,
+  int, jas_matrix_t *flags, jas_matrix_t *data, int term, long *nmsedec);
+
+static int jpc_encrawsigpass(jpc_bitstream_t *out, int bitpos, int,
+  jas_matrix_t *flags, jas_matrix_t *data, int term, long *nmsedec);
+
+static int jpc_encrawrefpass(jpc_bitstream_t *out, int bitpos, int,
+  jas_matrix_t *flags, jas_matrix_t *data, int term, long *nmsedec);
+
+/******************************************************************************\
+* Code for encoding code blocks.
+\******************************************************************************/
+
+/* Encode all of the code blocks associated with the current tile. */
+int jpc_enc_enccblks(jpc_enc_t *enc)
+{
+       jpc_enc_tcmpt_t *tcmpt;
+       jpc_enc_tcmpt_t *endcomps;
+       jpc_enc_rlvl_t *lvl;
+       jpc_enc_rlvl_t *endlvls;
+       jpc_enc_band_t *band;
+       jpc_enc_band_t *endbands;
+       jpc_enc_cblk_t *cblk;
+       jpc_enc_cblk_t *endcblks;
+       int i;
+       int j;
+       int mx;
+       int bmx;
+       int v;
+       jpc_enc_tile_t *tile;
+       uint_fast32_t prcno;
+       jpc_enc_prc_t *prc;
+
+       tile = enc->curtile;
+
+       endcomps = &tile->tcmpts[tile->numtcmpts];
+       for (tcmpt = tile->tcmpts; tcmpt != endcomps; ++tcmpt) {
+               endlvls = &tcmpt->rlvls[tcmpt->numrlvls];
+               for (lvl = tcmpt->rlvls; lvl != endlvls; ++lvl) {
+                       if (!lvl->bands) {
+                               continue;
+                       }
+                       endbands = &lvl->bands[lvl->numbands];
+                       for (band = lvl->bands; band != endbands; ++band) {
+                               if (!band->data) {
+                                       continue;
+                               }
+                               for (prcno = 0, prc = band->prcs; prcno < lvl->numprcs; ++prcno, ++prc) {
+                                       if (!prc->cblks) {
+                                               continue;
+                                       }
+                                       bmx = 0;
+                                       endcblks = &prc->cblks[prc->numcblks];
+                                       for (cblk = prc->cblks; cblk != endcblks; ++cblk) {
+                                               mx = 0;
+                                               for (i = 0; i < jas_matrix_numrows(cblk->data); ++i) {
+                                                       for (j = 0; j < jas_matrix_numcols(cblk->data); ++j) {
+                                                               v = abs(jas_matrix_get(cblk->data, i, j));
+                                                               if (v > mx) {
+                                                                       mx = v;
+                                                               }
+                                                       }
+                                               }
+                                               if (mx > bmx) {
+                                                       bmx = mx;
+                                               }
+                                               cblk->numbps = JAS_MAX(jpc_firstone(mx) + 1 - JPC_NUMEXTRABITS, 0);
+                                       }
+
+                                       for (cblk = prc->cblks; cblk != endcblks; ++cblk) {
+                                               cblk->numimsbs = band->numbps - cblk->numbps;
+                                               assert(cblk->numimsbs >= 0);
+                                       }
+
+                                       for (cblk = prc->cblks; cblk != endcblks; ++cblk) {
+                                               if (jpc_enc_enccblk(enc, cblk->stream, tcmpt, band, cblk)) {
+                                                       return -1;
+                                               }
+                                       }
+                               }
+                       }
+               }
+       }
+       return 0;
+}
+
+int getthebyte(jas_stream_t *in, long off)
+{
+       int c;
+       long oldpos;
+       oldpos = jas_stream_tell(in);
+       assert(oldpos >= 0);
+       jas_stream_seek(in, off, SEEK_SET);
+       c = jas_stream_peekc(in);
+       jas_stream_seek(in, oldpos, SEEK_SET);
+       return c;
+}
+
+/* Encode a single code block. */
+int jpc_enc_enccblk(jpc_enc_t *enc, jas_stream_t *out, jpc_enc_tcmpt_t *tcmpt, jpc_enc_band_t *band, jpc_enc_cblk_t *cblk)
+{
+       jpc_enc_pass_t *pass;
+       jpc_enc_pass_t *endpasses;
+       int bitpos;
+       int n;
+       int adjust;
+       int ret;
+       int passtype;
+       int t;
+       jpc_bitstream_t *bout;
+       jpc_enc_pass_t *termpass;
+       jpc_enc_rlvl_t *rlvl;
+       int vcausal;
+       int segsym;
+       int termmode;
+       int c;
+
+       bout = 0;
+       rlvl = band->rlvl;
+
+       cblk->stream = jas_stream_memopen(0, 0);
+       assert(cblk->stream);
+       cblk->mqenc = jpc_mqenc_create(JPC_NUMCTXS, cblk->stream);
+       assert(cblk->mqenc);
+       jpc_mqenc_setctxs(cblk->mqenc, JPC_NUMCTXS, jpc_mqctxs);
+
+       cblk->numpasses = (cblk->numbps > 0) ? (3 * cblk->numbps - 2) : 0;
+       if (cblk->numpasses > 0) {
+               cblk->passes = jas_malloc(cblk->numpasses * sizeof(jpc_enc_pass_t));
+               assert(cblk->passes);
+       } else {
+               cblk->passes = 0;
+       }
+       endpasses = &cblk->passes[cblk->numpasses];
+       for (pass = cblk->passes; pass != endpasses; ++pass) {
+               pass->start = 0;
+               pass->end = 0;
+               pass->term = JPC_ISTERMINATED(pass - cblk->passes, 0, cblk->numpasses, (tcmpt->cblksty & JPC_COX_TERMALL) != 0, (tcmpt->cblksty & JPC_COX_LAZY) != 0);
+               pass->type = JPC_SEGTYPE(pass - cblk->passes, 0, (tcmpt->cblksty & JPC_COX_LAZY) != 0);
+               pass->lyrno = -1;
+if (pass == endpasses - 1) {
+assert(pass->term == 1);
+       pass->term = 1;
+}
+       }
+
+       cblk->flags = jas_matrix_create(jas_matrix_numrows(cblk->data) + 2,
+         jas_matrix_numcols(cblk->data) + 2);
+       assert(cblk->flags);
+
+
+       bitpos = cblk->numbps - 1;
+       pass = cblk->passes;
+       n = cblk->numpasses;
+       while (--n >= 0) {
+
+               if (pass->type == JPC_SEG_MQ) {
+                       /* NOP */
+               } else {
+                       assert(pass->type == JPC_SEG_RAW);
+                       if (!bout) {
+                               bout = jpc_bitstream_sopen(cblk->stream, "w");
+                               assert(bout);
+                       }
+               }
+
+#if 1
+               passtype = (pass - cblk->passes + 2) % 3;
+#else
+               passtype = JPC_PASSTYPE(pass - cblk->passes + 2);
+#endif
+               pass->start = jas_stream_tell(cblk->stream);
+#if 0
+assert(jas_stream_tell(cblk->stream) == jas_stream_getrwcount(cblk->stream));
+#endif
+               assert(bitpos >= 0);
+               vcausal = (tcmpt->cblksty & JPC_COX_VSC) != 0;
+               segsym = (tcmpt->cblksty & JPC_COX_SEGSYM) != 0;
+               if (pass->term) {
+                       termmode = ((tcmpt->cblksty & JPC_COX_PTERM) ?
+                         JPC_MQENC_PTERM : JPC_MQENC_DEFTERM) + 1;
+               } else {
+                       termmode = 0;
+               }
+               switch (passtype) {
+               case JPC_SIGPASS:
+                       ret = (pass->type == JPC_SEG_MQ) ? jpc_encsigpass(cblk->mqenc,
+                         bitpos, band->orient, vcausal, cblk->flags,
+                         cblk->data, termmode, &pass->nmsedec) :
+                         jpc_encrawsigpass(bout, bitpos, vcausal, cblk->flags,
+                         cblk->data, termmode, &pass->nmsedec);
+                       break;
+               case JPC_REFPASS:
+                       ret = (pass->type == JPC_SEG_MQ) ? jpc_encrefpass(cblk->mqenc,
+                         bitpos, vcausal, cblk->flags, cblk->data, termmode,
+                         &pass->nmsedec) : jpc_encrawrefpass(bout, bitpos,
+                         vcausal, cblk->flags, cblk->data, termmode,
+                         &pass->nmsedec);
+                       break;
+               case JPC_CLNPASS:
+                       assert(pass->type == JPC_SEG_MQ);
+                       ret = jpc_encclnpass(cblk->mqenc, bitpos, band->orient,
+                         vcausal, segsym, cblk->flags, cblk->data, termmode,
+                         &pass->nmsedec);
+                       break;
+               default:
+                       assert(0);
+                       break;
+               }
+
+               if (pass->type == JPC_SEG_MQ) {
+                       if (pass->term) {
+                               jpc_mqenc_init(cblk->mqenc);
+                       }
+                       jpc_mqenc_getstate(cblk->mqenc, &pass->mqencstate);
+                       pass->end = jas_stream_tell(cblk->stream);
+                       if (tcmpt->cblksty & JPC_COX_RESET) {
+                               jpc_mqenc_setctxs(cblk->mqenc, JPC_NUMCTXS, jpc_mqctxs);
+                       }
+               } else {
+                       if (pass->term) {
+                               if (jpc_bitstream_pending(bout)) {
+                                       jpc_bitstream_outalign(bout, 0x2a);
+                               }
+                               jpc_bitstream_close(bout);
+                               bout = 0;
+                               pass->end = jas_stream_tell(cblk->stream);
+                       } else {
+                               pass->end = jas_stream_tell(cblk->stream) +
+                                 jpc_bitstream_pending(bout);
+/* NOTE - This will not work.  need to adjust by # of pending output bytes */
+                       }
+               }
+#if 0
+/* XXX - This assertion fails sometimes when various coding modes are used.
+This seems to be harmless, but why does it happen at all? */
+assert(jas_stream_tell(cblk->stream) == jas_stream_getrwcount(cblk->stream));
+#endif
+
+               pass->wmsedec = jpc_fixtodbl(band->rlvl->tcmpt->synweight) *
+                 jpc_fixtodbl(band->rlvl->tcmpt->synweight) *
+                 jpc_fixtodbl(band->synweight) *
+                 jpc_fixtodbl(band->synweight) *
+                 jpc_fixtodbl(band->absstepsize) * jpc_fixtodbl(band->absstepsize) *
+                 ((double) (1 << bitpos)) * ((double)(1 << bitpos)) *
+                 jpc_fixtodbl(pass->nmsedec);
+               pass->cumwmsedec = pass->wmsedec;
+               if (pass != cblk->passes) {
+                       pass->cumwmsedec += pass[-1].cumwmsedec;
+               }
+               if (passtype == JPC_CLNPASS) {
+                       --bitpos;
+               }
+               ++pass;
+       }
+
+#if 0
+dump_passes(cblk->passes, cblk->numpasses, cblk);
+#endif
+
+       n = 0;
+       endpasses = &cblk->passes[cblk->numpasses];
+       for (pass = cblk->passes; pass != endpasses; ++pass) {
+               if (pass->start < n) {
+                       pass->start = n;
+               }
+               if (pass->end < n) {
+                       pass->end = n;
+               }
+               if (!pass->term) {
+                       termpass = pass;
+                       while (termpass - pass < cblk->numpasses &&
+                         !termpass->term) {
+                               ++termpass;
+                       }
+                       if (pass->type == JPC_SEG_MQ) {
+                               t = (pass->mqencstate.lastbyte == 0xff) ? 1 : 0;
+                               if (pass->mqencstate.ctreg >= 5) {
+                                       adjust = 4 + t;
+                               } else {
+                                       adjust = 5 + t;
+                               }
+                               pass->end += adjust;
+                       }
+                       if (pass->end > termpass->end) {
+                               pass->end = termpass->end;
+                       }
+                       if ((c = getthebyte(cblk->stream, pass->end - 1)) == EOF) {
+                               abort();
+                       }
+                       if (c == 0xff) {
+                               ++pass->end;
+                       }
+                       n = JAS_MAX(n, pass->end);
+               } else {
+                       n = JAS_MAX(n, pass->end);
+               }
+       }
+
+#if 0
+dump_passes(cblk->passes, cblk->numpasses, cblk);
+#endif
+
+       if (bout) {
+               jpc_bitstream_close(bout);
+       }
+
+       return 0;
+}
+
+/******************************************************************************\
+* Code for significance pass.
+\******************************************************************************/
+
+#define        sigpass_step(fp, frowstep, dp, bitpos, one, nmsedec, orient, mqenc, vcausalflag) \
+{ \
+       int f; \
+       int v; \
+       f = *(fp); \
+       if ((f & JPC_OTHSIGMSK) && !(f & (JPC_SIG | JPC_VISIT))) { \
+               v = (abs(*(dp)) & (one)) ? 1 : 0; \
+               jpc_mqenc_setcurctx(mqenc, JPC_GETZCCTXNO(f, (orient))); \
+               jpc_mqenc_putbit(mqenc, v); \
+               if (v) { \
+                       *(nmsedec) += JPC_GETSIGNMSEDEC(abs(*(dp)), (bitpos) + JPC_NUMEXTRABITS); \
+                       v = ((*(dp) < 0) ? 1 : 0); \
+                       jpc_mqenc_setcurctx(mqenc, JPC_GETSCCTXNO(f)); \
+                       jpc_mqenc_putbit(mqenc, v ^ JPC_GETSPB(f)); \
+                       JPC_UPDATEFLAGS4(fp, frowstep, v, vcausalflag); \
+                       *(fp) |= JPC_SIG; \
+               } \
+               *(fp) |= JPC_VISIT; \
+       } \
+}
+
+static int jpc_encsigpass(jpc_mqenc_t *mqenc, int bitpos, int orient, int vcausalflag,
+  jas_matrix_t *flags, jas_matrix_t *data, int term, long *nmsedec)
+{
+       int i;
+       int j;
+       int one;
+       int vscanlen;
+       int width;
+       int height;
+       int frowstep;
+       int drowstep;
+       int fstripestep;
+       int dstripestep;
+       jpc_fix_t *fstripestart;
+       jpc_fix_t *dstripestart;
+       jpc_fix_t *fp;
+       jpc_fix_t *dp;
+       jpc_fix_t *fvscanstart;
+       jpc_fix_t *dvscanstart;
+       int k;
+
+       *nmsedec = 0;
+       width = jas_matrix_numcols(data);
+       height = jas_matrix_numrows(data);
+       frowstep = jas_matrix_rowstep(flags);
+       drowstep = jas_matrix_rowstep(data);
+       fstripestep = frowstep << 2;
+       dstripestep = drowstep << 2;
+
+       one = 1 << (bitpos + JPC_NUMEXTRABITS);
+
+       fstripestart = jas_matrix_getref(flags, 1, 1);
+       dstripestart = jas_matrix_getref(data, 0, 0);
+       for (i = height; i > 0; i -= 4, fstripestart += fstripestep,
+         dstripestart += dstripestep) {
+               fvscanstart = fstripestart;
+               dvscanstart = dstripestart;
+               vscanlen = JAS_MIN(i, 4);
+               for (j = width; j > 0; --j, ++fvscanstart, ++dvscanstart) {
+                       fp = fvscanstart;
+                       dp = dvscanstart;
+                       k = vscanlen;
+
+                       sigpass_step(fp, frowstep, dp, bitpos, one,
+                         nmsedec, orient, mqenc, vcausalflag);
+                       if (--k <= 0) {
+                               continue;
+                       }
+                       fp += frowstep;
+                       dp += drowstep;
+                       sigpass_step(fp, frowstep, dp, bitpos, one,
+                         nmsedec, orient, mqenc, 0);
+                       if (--k <= 0) {
+                               continue;
+                       }
+                       fp += frowstep;
+                       dp += drowstep;
+                       sigpass_step(fp, frowstep, dp, bitpos, one,
+                         nmsedec, orient, mqenc, 0);
+                       if (--k <= 0) {
+                               continue;
+                       }
+                       fp += frowstep;
+                       dp += drowstep;
+                       sigpass_step(fp, frowstep, dp, bitpos, one,
+                         nmsedec, orient, mqenc, 0);
+
+               }
+       }
+
+       if (term) {
+               jpc_mqenc_flush(mqenc, term - 1);
+       }
+
+       return jpc_mqenc_error(mqenc) ? (-1) : 0;
+}
+
+#define        rawsigpass_step(fp, frowstep, dp, bitpos, one, nmsedec, out, vcausalflag) \
+{ \
+       jpc_fix_t f = *(fp); \
+       jpc_fix_t v; \
+       if ((f & JPC_OTHSIGMSK) && !(f & (JPC_SIG | JPC_VISIT))) { \
+               v = (abs(*(dp)) & (one)) ? 1 : 0; \
+               if ((jpc_bitstream_putbit((out), v)) == EOF) { \
+                       return -1; \
+               } \
+               if (v) { \
+                       *(nmsedec) += JPC_GETSIGNMSEDEC(abs(*(dp)), (bitpos) + JPC_NUMEXTRABITS); \
+                       v = ((*(dp) < 0) ? 1 : 0); \
+                       if (jpc_bitstream_putbit(out, v) == EOF) { \
+                               return -1; \
+                       } \
+                       JPC_UPDATEFLAGS4(fp, frowstep, v, vcausalflag); \
+                       *(fp) |= JPC_SIG; \
+               } \
+               *(fp) |= JPC_VISIT; \
+       } \
+}
+
+static int jpc_encrawsigpass(jpc_bitstream_t *out, int bitpos, int vcausalflag, jas_matrix_t *flags,
+  jas_matrix_t *data, int term, long *nmsedec)
+{
+       int i;
+       int j;
+       int k;
+       int one;
+       int vscanlen;
+       int width;
+       int height;
+       int frowstep;
+       int drowstep;
+       int fstripestep;
+       int dstripestep;
+       jpc_fix_t *fstripestart;
+       jpc_fix_t *dstripestart;
+       jpc_fix_t *fp;
+       jpc_fix_t *dp;
+       jpc_fix_t *fvscanstart;
+       jpc_fix_t *dvscanstart;
+
+       *nmsedec = 0;
+       width = jas_matrix_numcols(data);
+       height = jas_matrix_numrows(data);
+       frowstep = jas_matrix_rowstep(flags);
+       drowstep = jas_matrix_rowstep(data);
+       fstripestep = frowstep << 2;
+       dstripestep = drowstep << 2;
+
+       one = 1 << (bitpos + JPC_NUMEXTRABITS);
+
+       fstripestart = jas_matrix_getref(flags, 1, 1);
+       dstripestart = jas_matrix_getref(data, 0, 0);
+       for (i = height; i > 0; i -= 4, fstripestart += fstripestep,
+         dstripestart += dstripestep) {
+               fvscanstart = fstripestart;
+               dvscanstart = dstripestart;
+               vscanlen = JAS_MIN(i, 4);
+               for (j = width; j > 0; --j, ++fvscanstart, ++dvscanstart) {
+                       fp = fvscanstart;
+                       dp = dvscanstart;
+                       k = vscanlen;
+
+                       rawsigpass_step(fp, frowstep, dp, bitpos, one,
+                         nmsedec, out, vcausalflag);
+                       if (--k <= 0) {
+                               continue;
+                       }
+                       fp += frowstep;
+                       dp += drowstep;
+
+                       rawsigpass_step(fp, frowstep, dp, bitpos, one,
+                         nmsedec, out, 0);
+                       if (--k <= 0) {
+                               continue;
+                       }
+                       fp += frowstep;
+                       dp += drowstep;
+
+                       rawsigpass_step(fp, frowstep, dp, bitpos, one,
+                         nmsedec, out, 0);
+                       if (--k <= 0) {
+                               continue;
+                       }
+                       fp += frowstep;
+                       dp += drowstep;
+
+                       rawsigpass_step(fp, frowstep, dp, bitpos, one,
+                         nmsedec, out, 0);
+                       if (--k <= 0) {
+                               continue;
+                       }
+                       fp += frowstep;
+                       dp += drowstep;
+
+               }
+       }
+
+       if (term) {
+               jpc_bitstream_outalign(out, 0x2a);
+       }
+
+       return 0;
+}
+
+/******************************************************************************\
+* Code for refinement pass.
+\******************************************************************************/
+
+#define        refpass_step(fp, dp, bitpos, one, nmsedec, mqenc, vcausalflag) \
+{ \
+       int v; \
+       if (((*(fp)) & (JPC_SIG | JPC_VISIT)) == JPC_SIG) { \
+               (d) = *(dp); \
+               *(nmsedec) += JPC_GETREFNMSEDEC(abs(d), (bitpos) + JPC_NUMEXTRABITS); \
+               jpc_mqenc_setcurctx((mqenc), JPC_GETMAGCTXNO(*(fp))); \
+               v = (abs(d) & (one)) ? 1 : 0; \
+               jpc_mqenc_putbit((mqenc), v); \
+               *(fp) |= JPC_REFINE; \
+       } \
+}
+
+static int jpc_encrefpass(jpc_mqenc_t *mqenc, int bitpos, int vcausalflag, jas_matrix_t *flags, jas_matrix_t *data,
+  int term, long *nmsedec)
+{
+       int i;
+       int j;
+       int one;
+       int vscanlen;
+       int d;
+       int width;
+       int height;
+       int frowstep;
+       int drowstep;
+       int fstripestep;
+       int dstripestep;
+       jpc_fix_t *fstripestart;
+       jpc_fix_t *dstripestart;
+       jpc_fix_t *fvscanstart;
+       jpc_fix_t *dvscanstart;
+       jpc_fix_t *dp;
+       jpc_fix_t *fp;
+int k;
+
+       *nmsedec = 0;
+       width = jas_matrix_numcols(data);
+       height = jas_matrix_numrows(data);
+       frowstep = jas_matrix_rowstep(flags);
+       drowstep = jas_matrix_rowstep(data);
+       fstripestep = frowstep << 2;
+       dstripestep = drowstep << 2;
+
+       one = 1 << (bitpos + JPC_NUMEXTRABITS);
+
+       fstripestart = jas_matrix_getref(flags, 1, 1);
+       dstripestart = jas_matrix_getref(data, 0, 0);
+       for (i = height; i > 0; i -= 4, fstripestart += fstripestep,
+         dstripestart += dstripestep) {
+               fvscanstart = fstripestart;
+               dvscanstart = dstripestart;
+               vscanlen = JAS_MIN(i, 4);
+               for (j = width; j > 0; --j, ++fvscanstart, ++dvscanstart) {
+                       fp = fvscanstart;
+                       dp = dvscanstart;
+                       k = vscanlen;
+
+                       refpass_step(fp, dp, bitpos, one, nmsedec,
+                         mqenc, vcausalflag);
+                       if (--k <= 0) {
+                               continue;
+                       }
+                       fp += frowstep;
+                       dp += drowstep;
+                       refpass_step(fp, dp, bitpos, one, nmsedec,
+                         mqenc, 0);
+                       if (--k <= 0) {
+                               continue;
+                       }
+                       fp += frowstep;
+                       dp += drowstep;
+                       refpass_step(fp, dp, bitpos, one, nmsedec,
+                         mqenc, 0);
+                       if (--k <= 0) {
+                               continue;
+                       }
+                       fp += frowstep;
+                       dp += drowstep;
+                       refpass_step(fp, dp, bitpos, one, nmsedec,
+                         mqenc, 0);
+
+               }
+       }
+
+       if (term) {
+               jpc_mqenc_flush(mqenc, term - 1);
+       }
+
+       return jpc_mqenc_error(mqenc) ? (-1) : 0;
+}
+
+#define        rawrefpass_step(fp, dp, bitpos, one, nmsedec, out, vcausalflag) \
+{ \
+       jpc_fix_t d; \
+       jpc_fix_t v; \
+       if (((*(fp)) & (JPC_SIG | JPC_VISIT)) == JPC_SIG) { \
+               d = *(dp); \
+               *(nmsedec) += JPC_GETREFNMSEDEC(abs(d), (bitpos) + JPC_NUMEXTRABITS); \
+               v = (abs(d) & (one)) ? 1 : 0; \
+               if (jpc_bitstream_putbit((out), v) == EOF) { \
+                       return -1; \
+               } \
+               *(fp) |= JPC_REFINE; \
+       } \
+}
+
+static int jpc_encrawrefpass(jpc_bitstream_t *out, int bitpos, int vcausalflag, jas_matrix_t *flags,
+  jas_matrix_t *data, int term, long *nmsedec)
+{
+       int i;
+       int j;
+       int k;
+       int one;
+       int vscanlen;
+       int width;
+       int height;
+       int frowstep;
+       int drowstep;
+       int fstripestep;
+       int dstripestep;
+       jpc_fix_t *fstripestart;
+       jpc_fix_t *dstripestart;
+       jpc_fix_t *fvscanstart;
+       jpc_fix_t *dvscanstart;
+       jpc_fix_t *dp;
+       jpc_fix_t *fp;
+
+       *nmsedec = 0;
+       width = jas_matrix_numcols(data);
+       height = jas_matrix_numrows(data);
+       frowstep = jas_matrix_rowstep(flags);
+       drowstep = jas_matrix_rowstep(data);
+       fstripestep = frowstep << 2;
+       dstripestep = drowstep << 2;
+
+       one = 1 << (bitpos + JPC_NUMEXTRABITS);
+
+       fstripestart = jas_matrix_getref(flags, 1, 1);
+       dstripestart = jas_matrix_getref(data, 0, 0);
+       for (i = height; i > 0; i -= 4, fstripestart += fstripestep,
+         dstripestart += dstripestep) {
+               fvscanstart = fstripestart;
+               dvscanstart = dstripestart;
+               vscanlen = JAS_MIN(i, 4);
+               for (j = width; j > 0; --j, ++fvscanstart, ++dvscanstart) {
+                       fp = fvscanstart;
+                       dp = dvscanstart;
+                       k = vscanlen;
+
+                       rawrefpass_step(fp, dp, bitpos, one, nmsedec,
+                         out, vcausalflag);
+                       if (--k <= 0) {
+                               continue;
+                       }
+                       fp += frowstep;
+                       dp += drowstep;
+                       rawrefpass_step(fp, dp, bitpos, one, nmsedec,
+                         out, vcausalflag);
+                       if (--k <= 0) {
+                               continue;
+                       }
+                       fp += frowstep;
+                       dp += drowstep;
+                       rawrefpass_step(fp, dp, bitpos, one, nmsedec,
+                         out, vcausalflag);
+                       if (--k <= 0) {
+                               continue;
+                       }
+                       fp += frowstep;
+                       dp += drowstep;
+                       rawrefpass_step(fp, dp, bitpos, one, nmsedec,
+                         out, vcausalflag);
+
+               }
+       }
+
+       if (term) {
+               jpc_bitstream_outalign(out, 0x2a);
+       }
+
+       return 0;
+}
+
+/******************************************************************************\
+* Code for cleanup pass.
+\******************************************************************************/
+
+#define        clnpass_step(fp, frowstep, dp, bitpos, one, orient, nmsedec, mqenc, label1, label2, vcausalflag) \
+{ \
+       int f; \
+       int v; \
+label1 \
+       f = *(fp); \
+       if (!(f & (JPC_SIG | JPC_VISIT))) { \
+               jpc_mqenc_setcurctx(mqenc, JPC_GETZCCTXNO(f, (orient))); \
+               v = (abs(*(dp)) & (one)) ? 1 : 0; \
+               jpc_mqenc_putbit((mqenc), v); \
+               if (v) { \
+label2 \
+                       f = *(fp); \
+                       /* Coefficient is significant. */ \
+                       *(nmsedec) += JPC_GETSIGNMSEDEC(abs(*(dp)), (bitpos) + JPC_NUMEXTRABITS); \
+                       jpc_mqenc_setcurctx((mqenc), JPC_GETSCCTXNO(f)); \
+                       v = ((*(dp) < 0) ? 1 : 0); \
+                       jpc_mqenc_putbit((mqenc), v ^ JPC_GETSPB(f)); \
+                       JPC_UPDATEFLAGS4((fp), (frowstep), v, vcausalflag); \
+                       *(fp) |= JPC_SIG; \
+               } \
+       } \
+       *(fp) &= ~JPC_VISIT; \
+}
+
+static int jpc_encclnpass(jpc_mqenc_t *mqenc, int bitpos, int orient, int vcausalflag, int segsymflag, jas_matrix_t *flags,
+  jas_matrix_t *data, int term, long *nmsedec)
+{
+       int i;
+       int j;
+       int k;
+       int vscanlen;
+       int v;
+       int runlen;
+       jpc_fix_t *fp;
+       int width;
+       int height;
+       jpc_fix_t *dp;
+       int one;
+       int frowstep;
+       int drowstep;
+       int fstripestep;
+       int dstripestep;
+       jpc_fix_t *fstripestart;
+       jpc_fix_t *dstripestart;
+       jpc_fix_t *fvscanstart;
+       jpc_fix_t *dvscanstart;
+
+       *nmsedec = 0;
+       width = jas_matrix_numcols(data);
+       height = jas_matrix_numrows(data);
+       frowstep = jas_matrix_rowstep(flags);
+       drowstep = jas_matrix_rowstep(data);
+       fstripestep = frowstep << 2;
+       dstripestep = drowstep << 2;
+
+       one = 1 << (bitpos + JPC_NUMEXTRABITS);
+
+       fstripestart = jas_matrix_getref(flags, 1, 1);
+       dstripestart = jas_matrix_getref(data, 0, 0);
+       for (i = height; i > 0; i -= 4, fstripestart += fstripestep,
+         dstripestart += dstripestep) {
+               fvscanstart = fstripestart;
+               dvscanstart = dstripestart;
+               vscanlen = JAS_MIN(i, 4);
+               for (j = width; j > 0; --j, ++fvscanstart, ++dvscanstart) {
+
+                       fp = fvscanstart;
+                       if (vscanlen >= 4 && !((*fp) & (JPC_SIG | JPC_VISIT |
+                         JPC_OTHSIGMSK)) && (fp += frowstep, !((*fp) & (JPC_SIG |
+                         JPC_VISIT | JPC_OTHSIGMSK))) && (fp += frowstep, !((*fp) &
+                         (JPC_SIG | JPC_VISIT | JPC_OTHSIGMSK))) && (fp += frowstep,
+                         !((*fp) & (JPC_SIG | JPC_VISIT | JPC_OTHSIGMSK)))) {
+                               dp = dvscanstart;
+                               for (k = 0; k < vscanlen; ++k) {
+                                       v = (abs(*dp) & one) ? 1 : 0;
+                                       if (v) {
+                                               break;
+                                       }
+                                       dp += drowstep;
+                               }
+                               runlen = k;
+                               if (runlen >= 4) {
+                                       jpc_mqenc_setcurctx(mqenc, JPC_AGGCTXNO);
+                                       jpc_mqenc_putbit(mqenc, 0);
+                                       continue;
+                               }
+                               jpc_mqenc_setcurctx(mqenc, JPC_AGGCTXNO);
+                               jpc_mqenc_putbit(mqenc, 1);
+                               jpc_mqenc_setcurctx(mqenc, JPC_UCTXNO);
+                               jpc_mqenc_putbit(mqenc, runlen >> 1);
+                               jpc_mqenc_putbit(mqenc, runlen & 1);
+                               fp = fvscanstart + frowstep * runlen;
+                               dp = dvscanstart + drowstep * runlen;
+                               k = vscanlen - runlen;
+                               switch (runlen) {
+                               case 0:
+                                       goto clnpass_partial0;
+                                       break;
+                               case 1:
+                                       goto clnpass_partial1;
+                                       break;
+                               case 2:
+                                       goto clnpass_partial2;
+                                       break;
+                               case 3:
+                                       goto clnpass_partial3;
+                                       break;
+                               }
+                       } else {
+                               runlen = 0;
+                               fp = fvscanstart;
+                               dp = dvscanstart;
+                               k = vscanlen;
+                               goto clnpass_full0;
+                       }
+                       clnpass_step(fp, frowstep, dp, bitpos, one,
+                         orient, nmsedec, mqenc, clnpass_full0:, clnpass_partial0:, vcausalflag);
+                       if (--k <= 0) {
+                               continue;
+                       }
+                       fp += frowstep;
+                       dp += drowstep;
+                       clnpass_step(fp, frowstep, dp, bitpos, one,
+                               orient, nmsedec, mqenc, ;, clnpass_partial1:, 0);
+                       if (--k <= 0) {
+                               continue;
+                       }
+                       fp += frowstep;
+                       dp += drowstep;
+                       clnpass_step(fp, frowstep, dp, bitpos, one,
+                               orient, nmsedec, mqenc, ;, clnpass_partial2:, 0);
+                       if (--k <= 0) {
+                               continue;
+                       }
+                       fp += frowstep;
+                       dp += drowstep;
+                       clnpass_step(fp, frowstep, dp, bitpos, one,
+                               orient, nmsedec, mqenc, ;, clnpass_partial3:, 0);
+               }
+       }
+
+       if (segsymflag) {
+               jpc_mqenc_setcurctx(mqenc, JPC_UCTXNO);
+               jpc_mqenc_putbit(mqenc, 1);
+               jpc_mqenc_putbit(mqenc, 0);
+               jpc_mqenc_putbit(mqenc, 1);
+               jpc_mqenc_putbit(mqenc, 0);
+       }
+
+       if (term) {
+               jpc_mqenc_flush(mqenc, term - 1);
+       }
+
+       return jpc_mqenc_error(mqenc) ? (-1) : 0;
+}
diff --git a/src/libjasper/jpc/jpc_t1enc.h b/src/libjasper/jpc/jpc_t1enc.h
new file mode 100644 (file)
index 0000000..a4845a5
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Tier 1 Encoder
+ *
+ * $Id$
+ */
+
+#ifndef JPC_T1ENC_H
+#define JPC_T1ENC_H
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include "jasper/jas_seq.h"
+
+#include "jpc_enc.h"
+#include "jpc_t1cod.h"
+
+/******************************************************************************\
+* Functions.
+\******************************************************************************/
+
+/* Encode all of the code blocks. */
+int jpc_enc_enccblks(jpc_enc_t *enc);
+
+/* Encode a single code block. */
+int jpc_enc_enccblk(jpc_enc_t *enc, jas_stream_t *out, jpc_enc_tcmpt_t *comp,
+  jpc_enc_band_t *band, jpc_enc_cblk_t *cblk);
+
+#endif
diff --git a/src/libjasper/jpc/jpc_t2cod.c b/src/libjasper/jpc/jpc_t2cod.c
new file mode 100644 (file)
index 0000000..e734900
--- /dev/null
@@ -0,0 +1,684 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Tier-2 Coding Library
+ *
+ * $Id$
+ */
+
+#include "jasper/jas_math.h"
+#include "jasper/jas_malloc.h"
+#include "jasper/jas_math.h"
+
+#include "jpc_cs.h"
+#include "jpc_t2cod.h"
+#include "jpc_math.h"
+
+static int jpc_pi_nextlrcp(jpc_pi_t *pi);
+static int jpc_pi_nextrlcp(jpc_pi_t *pi);
+static int jpc_pi_nextrpcl(jpc_pi_t *pi);
+static int jpc_pi_nextpcrl(jpc_pi_t *pi);
+static int jpc_pi_nextcprl(jpc_pi_t *pi);
+
+int jpc_pi_next(jpc_pi_t *pi)
+{
+       jpc_pchg_t *pchg;
+       int ret;
+
+
+       for (;;) {
+
+               pi->valid = false;
+
+               if (!pi->pchg) {
+                       ++pi->pchgno;
+                       pi->compno = 0;
+                       pi->rlvlno = 0;
+                       pi->prcno = 0;
+                       pi->lyrno = 0;
+                       pi->prgvolfirst = true;
+                       if (pi->pchgno < jpc_pchglist_numpchgs(pi->pchglist)) {
+                               pi->pchg = jpc_pchglist_get(pi->pchglist, pi->pchgno);
+                       } else if (pi->pchgno == jpc_pchglist_numpchgs(pi->pchglist)) {
+                               pi->pchg = &pi->defaultpchg;
+                       } else {
+                               return 1;
+                       }
+               }
+
+               pchg = pi->pchg;
+               switch (pchg->prgord) {
+               case JPC_COD_LRCPPRG:
+                       ret = jpc_pi_nextlrcp(pi);
+                       break;
+               case JPC_COD_RLCPPRG:
+                       ret = jpc_pi_nextrlcp(pi);
+                       break;
+               case JPC_COD_RPCLPRG:
+                       ret = jpc_pi_nextrpcl(pi);
+                       break;
+               case JPC_COD_PCRLPRG:
+                       ret = jpc_pi_nextpcrl(pi);
+                       break;
+               case JPC_COD_CPRLPRG:
+                       ret = jpc_pi_nextcprl(pi);
+                       break;
+               default:
+                       ret = -1;
+                       break;
+               }
+               if (!ret) {
+                       pi->valid = true;
+                       ++pi->pktno;
+                       return 0;
+               }
+               pi->pchg = 0;
+       }
+}
+
+static int jpc_pi_nextlrcp(register jpc_pi_t *pi)
+{
+       jpc_pchg_t *pchg;
+       int *prclyrno;
+
+       pchg = pi->pchg;
+       if (!pi->prgvolfirst) {
+               prclyrno = &pi->pirlvl->prclyrnos[pi->prcno];
+               goto skip;
+       } else {
+               pi->prgvolfirst = false;
+       }
+
+       for (pi->lyrno = 0; pi->lyrno < pi->numlyrs && pi->lyrno <
+         JAS_CAST(int, pchg->lyrnoend); ++pi->lyrno) {
+               for (pi->rlvlno = pchg->rlvlnostart; pi->rlvlno < pi->maxrlvls &&
+                 pi->rlvlno < pchg->rlvlnoend; ++pi->rlvlno) {
+                       for (pi->compno = pchg->compnostart, pi->picomp =
+                         &pi->picomps[pi->compno]; pi->compno < pi->numcomps
+                         && pi->compno < JAS_CAST(int, pchg->compnoend); ++pi->compno,
+                         ++pi->picomp) {
+                               if (pi->rlvlno >= pi->picomp->numrlvls) {
+                                       continue;
+                               }
+                               pi->pirlvl = &pi->picomp->pirlvls[pi->rlvlno];
+                               for (pi->prcno = 0, prclyrno =
+                                 pi->pirlvl->prclyrnos; pi->prcno <
+                                 pi->pirlvl->numprcs; ++pi->prcno,
+                                 ++prclyrno) {
+                                       if (pi->lyrno >= *prclyrno) {
+                                               *prclyrno = pi->lyrno;
+                                               ++(*prclyrno);
+                                               return 0;
+                                       }
+skip:
+                                       ;
+                               }
+                       }
+               }
+       }
+       return 1;
+}
+
+static int jpc_pi_nextrlcp(register jpc_pi_t *pi)
+{
+       jpc_pchg_t *pchg;
+       int *prclyrno;
+
+       pchg = pi->pchg;
+       if (!pi->prgvolfirst) {
+               assert(pi->prcno < pi->pirlvl->numprcs);
+               prclyrno = &pi->pirlvl->prclyrnos[pi->prcno];
+               goto skip;
+       } else {
+               pi->prgvolfirst = 0;
+       }
+
+       for (pi->rlvlno = pchg->rlvlnostart; pi->rlvlno < pi->maxrlvls &&
+         pi->rlvlno < pchg->rlvlnoend; ++pi->rlvlno) {
+               for (pi->lyrno = 0; pi->lyrno < pi->numlyrs && pi->lyrno <
+                 JAS_CAST(int, pchg->lyrnoend); ++pi->lyrno) {
+                       for (pi->compno = pchg->compnostart, pi->picomp =
+                         &pi->picomps[pi->compno]; pi->compno < pi->numcomps &&
+                         pi->compno < JAS_CAST(int, pchg->compnoend); ++pi->compno, ++pi->picomp) {
+                               if (pi->rlvlno >= pi->picomp->numrlvls) {
+                                       continue;
+                               }
+                               pi->pirlvl = &pi->picomp->pirlvls[pi->rlvlno];
+                               for (pi->prcno = 0, prclyrno = pi->pirlvl->prclyrnos;
+                                 pi->prcno < pi->pirlvl->numprcs; ++pi->prcno, ++prclyrno) {
+                                       if (pi->lyrno >= *prclyrno) {
+                                               *prclyrno = pi->lyrno;
+                                               ++(*prclyrno);
+                                               return 0;
+                                       }
+skip:
+                                       ;
+                               }
+                       }
+               }
+       }
+       return 1;
+}
+
+static int jpc_pi_nextrpcl(register jpc_pi_t *pi)
+{
+       int rlvlno;
+       jpc_pirlvl_t *pirlvl;
+       jpc_pchg_t *pchg;
+       int prchind;
+       int prcvind;
+       int *prclyrno;
+       int compno;
+       jpc_picomp_t *picomp;
+       int xstep;
+       int ystep;
+       uint_fast32_t r;
+       uint_fast32_t rpx;
+       uint_fast32_t rpy;
+       uint_fast32_t trx0;
+       uint_fast32_t try0;
+
+       pchg = pi->pchg;
+       if (!pi->prgvolfirst) {
+               goto skip;
+       } else {
+               pi->xstep = 0;
+               pi->ystep = 0;
+               for (compno = 0, picomp = pi->picomps; compno < pi->numcomps;
+                 ++compno, ++picomp) {
+                       for (rlvlno = 0, pirlvl = picomp->pirlvls; rlvlno <
+                         picomp->numrlvls; ++rlvlno, ++pirlvl) {
+                               xstep = picomp->hsamp * (1 << (pirlvl->prcwidthexpn +
+                                 picomp->numrlvls - rlvlno - 1));
+                               ystep = picomp->vsamp * (1 << (pirlvl->prcheightexpn +
+                                 picomp->numrlvls - rlvlno - 1));
+                               pi->xstep = (!pi->xstep) ? xstep : JAS_MIN(pi->xstep, xstep);
+                               pi->ystep = (!pi->ystep) ? ystep : JAS_MIN(pi->ystep, ystep);
+                       }
+               }
+               pi->prgvolfirst = 0;
+       }
+
+       for (pi->rlvlno = pchg->rlvlnostart; pi->rlvlno < pchg->rlvlnoend &&
+         pi->rlvlno < pi->maxrlvls; ++pi->rlvlno) {
+               for (pi->y = pi->ystart; pi->y < pi->yend; pi->y +=
+                 pi->ystep - (pi->y % pi->ystep)) {
+                       for (pi->x = pi->xstart; pi->x < pi->xend; pi->x +=
+                         pi->xstep - (pi->x % pi->xstep)) {
+                               for (pi->compno = pchg->compnostart,
+                                 pi->picomp = &pi->picomps[pi->compno];
+                                 pi->compno < JAS_CAST(int, pchg->compnoend) && pi->compno <
+                                 pi->numcomps; ++pi->compno, ++pi->picomp) {
+                                       if (pi->rlvlno >= pi->picomp->numrlvls) {
+                                               continue;
+                                       }
+                                       pi->pirlvl = &pi->picomp->pirlvls[pi->rlvlno];
+                                       if (pi->pirlvl->numprcs == 0) {
+                                               continue;
+                                       }
+                                       r = pi->picomp->numrlvls - 1 - pi->rlvlno;
+                                       rpx = r + pi->pirlvl->prcwidthexpn;
+                                       rpy = r + pi->pirlvl->prcheightexpn;
+                                       trx0 = JPC_CEILDIV(pi->xstart, pi->picomp->hsamp << r);
+                                       try0 = JPC_CEILDIV(pi->ystart, pi->picomp->vsamp << r);
+                                       if (((pi->x == pi->xstart && ((trx0 << r) % (1 << rpx)))
+                                         || !(pi->x % (1 << rpx))) &&
+                                         ((pi->y == pi->ystart && ((try0 << r) % (1 << rpy)))
+                                         || !(pi->y % (1 << rpy)))) {
+                                               prchind = JPC_FLOORDIVPOW2(JPC_CEILDIV(pi->x, pi->picomp->hsamp
+                                                 << r), pi->pirlvl->prcwidthexpn) - JPC_FLOORDIVPOW2(trx0,
+                                                 pi->pirlvl->prcwidthexpn);
+                                               prcvind = JPC_FLOORDIVPOW2(JPC_CEILDIV(pi->y, pi->picomp->vsamp
+                                                 << r), pi->pirlvl->prcheightexpn) - JPC_FLOORDIVPOW2(try0,
+                                                 pi->pirlvl->prcheightexpn);
+                                               pi->prcno = prcvind * pi->pirlvl->numhprcs + prchind;
+
+                                               assert(pi->prcno < pi->pirlvl->numprcs);
+                                               for (pi->lyrno = 0; pi->lyrno <
+                                                 pi->numlyrs && pi->lyrno < JAS_CAST(int, pchg->lyrnoend); ++pi->lyrno) {
+                                                       prclyrno = &pi->pirlvl->prclyrnos[pi->prcno];
+                                                       if (pi->lyrno >= *prclyrno) {
+                                                               ++(*prclyrno);
+                                                               return 0;
+                                                       }
+skip:
+                                                       ;
+                                               }
+                                       }
+                               }
+                       }
+               }
+       }
+       return 1;
+}
+
+static int jpc_pi_nextpcrl(register jpc_pi_t *pi)
+{
+       int rlvlno;
+       jpc_pirlvl_t *pirlvl;
+       jpc_pchg_t *pchg;
+       int prchind;
+       int prcvind;
+       int *prclyrno;
+       int compno;
+       jpc_picomp_t *picomp;
+       int xstep;
+       int ystep;
+       uint_fast32_t trx0;
+       uint_fast32_t try0;
+       uint_fast32_t r;
+       uint_fast32_t rpx;
+       uint_fast32_t rpy;
+
+       pchg = pi->pchg;
+       if (!pi->prgvolfirst) {
+               goto skip;
+       } else {
+               pi->xstep = 0;
+               pi->ystep = 0;
+               for (compno = 0, picomp = pi->picomps; compno < pi->numcomps;
+                 ++compno, ++picomp) {
+                       for (rlvlno = 0, pirlvl = picomp->pirlvls; rlvlno <
+                         picomp->numrlvls; ++rlvlno, ++pirlvl) {
+                               xstep = picomp->hsamp * (1 <<
+                                 (pirlvl->prcwidthexpn + picomp->numrlvls -
+                                 rlvlno - 1));
+                               ystep = picomp->vsamp * (1 <<
+                                 (pirlvl->prcheightexpn + picomp->numrlvls -
+                                 rlvlno - 1));
+                               pi->xstep = (!pi->xstep) ? xstep :
+                                 JAS_MIN(pi->xstep, xstep);
+                               pi->ystep = (!pi->ystep) ? ystep :
+                                 JAS_MIN(pi->ystep, ystep);
+                       }
+               }
+               pi->prgvolfirst = 0;
+       }
+
+       for (pi->y = pi->ystart; pi->y < pi->yend; pi->y += pi->ystep -
+         (pi->y % pi->ystep)) {
+               for (pi->x = pi->xstart; pi->x < pi->xend; pi->x += pi->xstep -
+                 (pi->x % pi->xstep)) {
+                       for (pi->compno = pchg->compnostart, pi->picomp =
+                         &pi->picomps[pi->compno]; pi->compno < pi->numcomps
+                         && pi->compno < JAS_CAST(int, pchg->compnoend); ++pi->compno,
+                         ++pi->picomp) {
+                               for (pi->rlvlno = pchg->rlvlnostart,
+                                 pi->pirlvl = &pi->picomp->pirlvls[pi->rlvlno];
+                                 pi->rlvlno < pi->picomp->numrlvls &&
+                                 pi->rlvlno < pchg->rlvlnoend; ++pi->rlvlno,
+                                 ++pi->pirlvl) {
+                                       if (pi->pirlvl->numprcs == 0) {
+                                               continue;
+                                       }
+                                       r = pi->picomp->numrlvls - 1 - pi->rlvlno;
+                                       trx0 = JPC_CEILDIV(pi->xstart, pi->picomp->hsamp << r);
+                                       try0 = JPC_CEILDIV(pi->ystart, pi->picomp->vsamp << r);
+                                       rpx = r + pi->pirlvl->prcwidthexpn;
+                                       rpy = r + pi->pirlvl->prcheightexpn;
+                                       if (((pi->x == pi->xstart && ((trx0 << r) % (1 << rpx))) ||
+                                         !(pi->x % (pi->picomp->hsamp << rpx))) &&
+                                         ((pi->y == pi->ystart && ((try0 << r) % (1 << rpy))) ||
+                                         !(pi->y % (pi->picomp->vsamp << rpy)))) {
+                                               prchind = JPC_FLOORDIVPOW2(JPC_CEILDIV(pi->x, pi->picomp->hsamp
+                                                 << r), pi->pirlvl->prcwidthexpn) - JPC_FLOORDIVPOW2(trx0,
+                                                 pi->pirlvl->prcwidthexpn);
+                                               prcvind = JPC_FLOORDIVPOW2(JPC_CEILDIV(pi->y, pi->picomp->vsamp
+                                                 << r), pi->pirlvl->prcheightexpn) - JPC_FLOORDIVPOW2(try0,
+                                                 pi->pirlvl->prcheightexpn);
+                                               pi->prcno = prcvind * pi->pirlvl->numhprcs + prchind;
+                                               assert(pi->prcno < pi->pirlvl->numprcs);
+                                               for (pi->lyrno = 0; pi->lyrno < pi->numlyrs &&
+                                                 pi->lyrno < JAS_CAST(int, pchg->lyrnoend); ++pi->lyrno) {
+                                                       prclyrno = &pi->pirlvl->prclyrnos[pi->prcno];
+                                                       if (pi->lyrno >= *prclyrno) {
+                                                               ++(*prclyrno);
+                                                               return 0;
+                                                       }
+skip:
+                                                       ;
+                                               }
+                                       }
+                               }
+                       }
+               }
+       }
+       return 1;
+}
+
+static int jpc_pi_nextcprl(register jpc_pi_t *pi)
+{
+       int rlvlno;
+       jpc_pirlvl_t *pirlvl;
+       jpc_pchg_t *pchg;
+       int prchind;
+       int prcvind;
+       int *prclyrno;
+       uint_fast32_t trx0;
+       uint_fast32_t try0;
+       uint_fast32_t r;
+       uint_fast32_t rpx;
+       uint_fast32_t rpy;
+
+       pchg = pi->pchg;
+       if (!pi->prgvolfirst) {
+               goto skip;
+       } else {
+               pi->prgvolfirst = 0;
+       }
+
+       for (pi->compno = pchg->compnostart, pi->picomp =
+         &pi->picomps[pi->compno]; pi->compno < JAS_CAST(int, pchg->compnoend); ++pi->compno,
+         ++pi->picomp) {
+               pirlvl = pi->picomp->pirlvls;
+               pi->xstep = pi->picomp->hsamp * (1 << (pirlvl->prcwidthexpn +
+                 pi->picomp->numrlvls - 1));
+               pi->ystep = pi->picomp->vsamp * (1 << (pirlvl->prcheightexpn +
+                 pi->picomp->numrlvls - 1));
+               for (rlvlno = 1, pirlvl = &pi->picomp->pirlvls[1];
+                 rlvlno < pi->picomp->numrlvls; ++rlvlno, ++pirlvl) {
+                       pi->xstep = JAS_MIN(pi->xstep, pi->picomp->hsamp * (1 <<
+                         (pirlvl->prcwidthexpn + pi->picomp->numrlvls -
+                         rlvlno - 1)));
+                       pi->ystep = JAS_MIN(pi->ystep, pi->picomp->vsamp * (1 <<
+                         (pirlvl->prcheightexpn + pi->picomp->numrlvls -
+                         rlvlno - 1)));
+               }
+               for (pi->y = pi->ystart; pi->y < pi->yend;
+                 pi->y += pi->ystep - (pi->y % pi->ystep)) {
+                       for (pi->x = pi->xstart; pi->x < pi->xend;
+                         pi->x += pi->xstep - (pi->x % pi->xstep)) {
+                               for (pi->rlvlno = pchg->rlvlnostart,
+                                 pi->pirlvl = &pi->picomp->pirlvls[pi->rlvlno];
+                                 pi->rlvlno < pi->picomp->numrlvls && pi->rlvlno <
+                                 pchg->rlvlnoend; ++pi->rlvlno, ++pi->pirlvl) {
+                                       if (pi->pirlvl->numprcs == 0) {
+                                               continue;
+                                       }
+                                       r = pi->picomp->numrlvls - 1 - pi->rlvlno;
+                                       trx0 = JPC_CEILDIV(pi->xstart, pi->picomp->hsamp << r);
+                                       try0 = JPC_CEILDIV(pi->ystart, pi->picomp->vsamp << r);
+                                       rpx = r + pi->pirlvl->prcwidthexpn;
+                                       rpy = r + pi->pirlvl->prcheightexpn;
+                                       if (((pi->x == pi->xstart && ((trx0 << r) % (1 << rpx))) ||
+                                         !(pi->x % (pi->picomp->hsamp << rpx))) &&
+                                         ((pi->y == pi->ystart && ((try0 << r) % (1 << rpy))) ||
+                                         !(pi->y % (pi->picomp->vsamp << rpy)))) {
+                                               prchind = JPC_FLOORDIVPOW2(JPC_CEILDIV(pi->x, pi->picomp->hsamp
+                                                 << r), pi->pirlvl->prcwidthexpn) - JPC_FLOORDIVPOW2(trx0,
+                                                 pi->pirlvl->prcwidthexpn);
+                                               prcvind = JPC_FLOORDIVPOW2(JPC_CEILDIV(pi->y, pi->picomp->vsamp
+                                                 << r), pi->pirlvl->prcheightexpn) - JPC_FLOORDIVPOW2(try0,
+                                                 pi->pirlvl->prcheightexpn);
+                                               pi->prcno = prcvind *
+                                                 pi->pirlvl->numhprcs +
+                                                 prchind;
+                                               assert(pi->prcno <
+                                                 pi->pirlvl->numprcs);
+                                               for (pi->lyrno = 0; pi->lyrno <
+                                                 pi->numlyrs && pi->lyrno < JAS_CAST(int, pchg->lyrnoend); ++pi->lyrno) {
+                                                       prclyrno = &pi->pirlvl->prclyrnos[pi->prcno];
+                                                       if (pi->lyrno >= *prclyrno) {
+                                                               ++(*prclyrno);
+                                                               return 0;
+                                                       }
+skip:
+                                                       ;
+                                               }
+                                       }
+                               }
+                       }
+               }
+       }
+       return 1;
+}
+
+static void pirlvl_destroy(jpc_pirlvl_t *rlvl)
+{
+       if (rlvl->prclyrnos) {
+               jas_free(rlvl->prclyrnos);
+       }
+}
+
+static void jpc_picomp_destroy(jpc_picomp_t *picomp)
+{
+       int rlvlno;
+       jpc_pirlvl_t *pirlvl;
+       if (picomp->pirlvls) {
+               for (rlvlno = 0, pirlvl = picomp->pirlvls; rlvlno <
+                 picomp->numrlvls; ++rlvlno, ++pirlvl) {
+                       pirlvl_destroy(pirlvl);
+               }
+               jas_free(picomp->pirlvls);
+       }
+}
+
+void jpc_pi_destroy(jpc_pi_t *pi)
+{
+       jpc_picomp_t *picomp;
+       int compno;
+       if (pi->picomps) {
+               for (compno = 0, picomp = pi->picomps; compno < pi->numcomps;
+                 ++compno, ++picomp) {
+                       jpc_picomp_destroy(picomp);
+               }
+               jas_free(pi->picomps);
+       }
+       if (pi->pchglist) {
+               jpc_pchglist_destroy(pi->pchglist);
+       }
+       jas_free(pi);
+}
+
+jpc_pi_t *jpc_pi_create0()
+{
+       jpc_pi_t *pi;
+       if (!(pi = jas_malloc(sizeof(jpc_pi_t)))) {
+               return 0;
+       }
+       pi->picomps = 0;
+       pi->pchgno = 0;
+       if (!(pi->pchglist = jpc_pchglist_create())) {
+               jas_free(pi);
+               return 0;
+       }
+       return pi;
+}
+
+int jpc_pi_addpchg(jpc_pi_t *pi, jpc_pocpchg_t *pchg)
+{
+       return jpc_pchglist_insert(pi->pchglist, -1, pchg);
+}
+
+jpc_pchglist_t *jpc_pchglist_create()
+{
+       jpc_pchglist_t *pchglist;
+       if (!(pchglist = jas_malloc(sizeof(jpc_pchglist_t)))) {
+               return 0;
+       }
+       pchglist->numpchgs = 0;
+       pchglist->maxpchgs = 0;
+       pchglist->pchgs = 0;
+       return pchglist;
+}
+
+int jpc_pchglist_insert(jpc_pchglist_t *pchglist, int pchgno, jpc_pchg_t *pchg)
+{
+       int i;
+       int newmaxpchgs;
+       jpc_pchg_t **newpchgs;
+       if (pchgno < 0) {
+               pchgno = pchglist->numpchgs;
+       }
+       if (pchglist->numpchgs >= pchglist->maxpchgs) {
+               newmaxpchgs = pchglist->maxpchgs + 128;
+               if (!(newpchgs = jas_realloc(pchglist->pchgs, newmaxpchgs * sizeof(jpc_pchg_t *)))) {
+                       return -1;
+               }
+               pchglist->maxpchgs = newmaxpchgs;
+               pchglist->pchgs = newpchgs;
+       }
+       for (i = pchglist->numpchgs; i > pchgno; --i) {
+               pchglist->pchgs[i] = pchglist->pchgs[i - 1];
+       }
+       pchglist->pchgs[pchgno] = pchg;
+       ++pchglist->numpchgs;
+       return 0;
+}
+
+jpc_pchg_t *jpc_pchglist_remove(jpc_pchglist_t *pchglist, int pchgno)
+{
+       int i;
+       jpc_pchg_t *pchg;
+       assert(pchgno < pchglist->numpchgs);
+       pchg = pchglist->pchgs[pchgno];
+       for (i = pchgno + 1; i < pchglist->numpchgs; ++i) {
+               pchglist->pchgs[i - 1] = pchglist->pchgs[i];
+       }
+       --pchglist->numpchgs;
+       return pchg;
+}
+
+jpc_pchg_t *jpc_pchg_copy(jpc_pchg_t *pchg)
+{
+       jpc_pchg_t *newpchg;
+       if (!(newpchg = jas_malloc(sizeof(jpc_pchg_t)))) {
+               return 0;
+       }
+       *newpchg = *pchg;
+       return newpchg;
+}
+
+jpc_pchglist_t *jpc_pchglist_copy(jpc_pchglist_t *pchglist)
+{
+       jpc_pchglist_t *newpchglist;
+       jpc_pchg_t *newpchg;
+       int pchgno;
+       if (!(newpchglist = jpc_pchglist_create())) {
+               return 0;
+       }
+       for (pchgno = 0; pchgno < pchglist->numpchgs; ++pchgno) {
+               if (!(newpchg = jpc_pchg_copy(pchglist->pchgs[pchgno])) ||
+                 jpc_pchglist_insert(newpchglist, -1, newpchg)) {
+                       jpc_pchglist_destroy(newpchglist);
+                       return 0;
+               }
+       }
+       return newpchglist;
+}
+
+void jpc_pchglist_destroy(jpc_pchglist_t *pchglist)
+{
+       int pchgno;
+       if (pchglist->pchgs) {
+               for (pchgno = 0; pchgno < pchglist->numpchgs; ++pchgno) {
+                       jpc_pchg_destroy(pchglist->pchgs[pchgno]);
+               }
+               jas_free(pchglist->pchgs);
+       }
+       jas_free(pchglist);
+}
+
+void jpc_pchg_destroy(jpc_pchg_t *pchg)
+{
+       jas_free(pchg);
+}
+
+jpc_pchg_t *jpc_pchglist_get(jpc_pchglist_t *pchglist, int pchgno)
+{
+       return pchglist->pchgs[pchgno];
+}
+
+int jpc_pchglist_numpchgs(jpc_pchglist_t *pchglist)
+{
+       return pchglist->numpchgs;
+}
+
+int jpc_pi_init(jpc_pi_t *pi)
+{
+       int compno;
+       int rlvlno;
+       int prcno;
+       jpc_picomp_t *picomp;
+       jpc_pirlvl_t *pirlvl;
+       int *prclyrno;
+
+       pi->prgvolfirst = 0;
+       pi->valid = 0;
+       pi->pktno = -1;
+       pi->pchgno = -1;
+       pi->pchg = 0;
+
+       for (compno = 0, picomp = pi->picomps; compno < pi->numcomps;
+         ++compno, ++picomp) {
+               for (rlvlno = 0, pirlvl = picomp->pirlvls; rlvlno <
+                 picomp->numrlvls; ++rlvlno, ++pirlvl) {
+                       for (prcno = 0, prclyrno = pirlvl->prclyrnos;
+                         prcno < pirlvl->numprcs; ++prcno, ++prclyrno) {
+                               *prclyrno = 0;
+                       }
+               }
+       }
+       return 0;
+}
diff --git a/src/libjasper/jpc/jpc_t2cod.h b/src/libjasper/jpc/jpc_t2cod.h
new file mode 100644 (file)
index 0000000..0a176c9
--- /dev/null
@@ -0,0 +1,299 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Tier-2 Coding Library
+ *
+ * $Id$
+ */
+
+#ifndef JPC_T2COD_H
+#define        JPC_T2COD_H
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include "jpc_cs.h"
+
+/******************************************************************************\
+* Types.
+\******************************************************************************/
+
+/* Progression change list. */
+
+typedef struct {
+
+       /* The number of progression changes. */
+       int numpchgs;
+
+       /* The maximum number of progression changes that can be accomodated
+         without growing the progression change array. */
+       int maxpchgs;
+
+       /* The progression changes. */
+       jpc_pchg_t **pchgs;
+
+} jpc_pchglist_t;
+
+/* Packet iterator per-resolution-level information. */
+
+typedef struct {
+
+       /* The number of precincts. */
+       int numprcs;
+
+       /* The last layer processed for each precinct. */
+       int *prclyrnos;
+
+       /* The precinct width exponent. */
+       int prcwidthexpn;
+
+       /* The precinct height exponent. */
+       int prcheightexpn;
+
+       /* The number of precincts spanning the resolution level in the horizontal
+         direction. */
+       int numhprcs;
+
+} jpc_pirlvl_t;
+
+/* Packet iterator per-component information. */
+
+typedef struct {
+
+       /* The number of resolution levels. */
+       int numrlvls;
+
+       /* The per-resolution-level information. */
+       jpc_pirlvl_t *pirlvls;
+
+       /* The horizontal sampling period. */
+       int hsamp;
+
+       /* The vertical sampling period. */
+       int vsamp;
+
+} jpc_picomp_t;
+
+/* Packet iterator class. */
+
+typedef struct {
+
+       /* The number of layers. */
+       int numlyrs;
+
+       /* The number of resolution levels. */
+       int maxrlvls;
+
+       /* The number of components. */
+       int numcomps;
+
+       /* The per-component information. */
+       jpc_picomp_t *picomps;
+
+       /* The current component. */
+       jpc_picomp_t *picomp;
+
+       /* The current resolution level. */
+       jpc_pirlvl_t *pirlvl;
+
+       /* The number of the current component. */
+       int compno;
+
+       /* The number of the current resolution level. */
+       int rlvlno;
+
+       /* The number of the current precinct. */
+       int prcno;
+
+       /* The number of the current layer. */
+       int lyrno;
+
+       /* The x-coordinate of the current position. */
+       int x;
+
+       /* The y-coordinate of the current position. */
+       int y;
+
+       /* The horizontal step size. */
+       int xstep;
+
+       /* The vertical step size. */
+       int ystep;
+
+       /* The x-coordinate of the top-left corner of the tile on the reference
+         grid. */
+       int xstart;
+
+       /* The y-coordinate of the top-left corner of the tile on the reference
+         grid. */
+       int ystart;
+
+       /* The x-coordinate of the bottom-right corner of the tile on the
+         reference grid (plus one). */
+       int xend;
+
+       /* The y-coordinate of the bottom-right corner of the tile on the
+         reference grid (plus one). */
+       int yend;
+
+       /* The current progression change. */
+       jpc_pchg_t *pchg;
+
+       /* The progression change list. */
+       jpc_pchglist_t *pchglist;
+
+       /* The progression to use in the absense of explicit specification. */
+       jpc_pchg_t defaultpchg;
+
+       /* The current progression change number. */
+       int pchgno;
+
+       /* Is this the first time in the current progression volume? */
+       bool prgvolfirst;
+
+       /* Is the current iterator value valid? */
+       bool valid;
+
+       /* The current packet number. */
+       int pktno;
+
+} jpc_pi_t;
+
+/******************************************************************************\
+* Functions/macros for packet iterators.
+\******************************************************************************/
+
+/* Create a packet iterator. */
+jpc_pi_t *jpc_pi_create0(void);
+
+/* Destroy a packet iterator. */
+void jpc_pi_destroy(jpc_pi_t *pi);
+
+/* Add a progression change to a packet iterator. */
+int jpc_pi_addpchg(jpc_pi_t *pi, jpc_pocpchg_t *pchg);
+
+/* Prepare a packet iterator for iteration. */
+int jpc_pi_init(jpc_pi_t *pi);
+
+/* Set the iterator to the first packet. */
+int jpc_pi_begin(jpc_pi_t *pi);
+
+/* Proceed to the next packet in sequence. */
+int jpc_pi_next(jpc_pi_t *pi);
+
+/* Get the index of the current packet. */
+#define        jpc_pi_getind(pi)       ((pi)->pktno)
+
+/* Get the component number of the current packet. */
+#define jpc_pi_cmptno(pi)      (assert(pi->valid), (pi)->compno)
+
+/* Get the resolution level of the current packet. */
+#define jpc_pi_rlvlno(pi)      (assert(pi->valid), (pi)->rlvlno)
+
+/* Get the layer number of the current packet. */
+#define jpc_pi_lyrno(pi)       (assert(pi->valid), (pi)->lyrno)
+
+/* Get the precinct number of the current packet. */
+#define jpc_pi_prcno(pi)       (assert(pi->valid), (pi)->prcno)
+
+/* Get the progression order for the current packet. */
+#define jpc_pi_prg(pi) (assert(pi->valid), (pi)->pchg->prgord)
+
+/******************************************************************************\
+* Functions/macros for progression change lists.
+\******************************************************************************/
+
+/* Create a progression change list. */
+jpc_pchglist_t *jpc_pchglist_create(void);
+
+/* Destroy a progression change list. */
+void jpc_pchglist_destroy(jpc_pchglist_t *pchglist);
+
+/* Insert a new element into a progression change list. */
+int jpc_pchglist_insert(jpc_pchglist_t *pchglist, int pchgno, jpc_pchg_t *pchg);
+
+/* Remove an element from a progression change list. */
+jpc_pchg_t *jpc_pchglist_remove(jpc_pchglist_t *pchglist, int pchgno);
+
+/* Get an element from a progression change list. */
+jpc_pchg_t *jpc_pchglist_get(jpc_pchglist_t *pchglist, int pchgno);
+
+/* Copy a progression change list. */
+jpc_pchglist_t *jpc_pchglist_copy(jpc_pchglist_t *pchglist);
+
+/* Get the number of elements in a progression change list. */
+int jpc_pchglist_numpchgs(jpc_pchglist_t *pchglist);
+
+/******************************************************************************\
+* Functions/macros for progression changes.
+\******************************************************************************/
+
+/* Destroy a progression change. */
+void jpc_pchg_destroy(jpc_pchg_t *pchg);
+
+/* Copy a progression change. */
+jpc_pchg_t *jpc_pchg_copy(jpc_pchg_t *pchg);
+
+#endif
diff --git a/src/libjasper/jpc/jpc_t2dec.c b/src/libjasper/jpc/jpc_t2dec.c
new file mode 100644 (file)
index 0000000..6d2cb72
--- /dev/null
@@ -0,0 +1,581 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Tier 2 Decoder
+ *
+ * $Id$
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+
+#include "jasper/jas_types.h"
+#include "jasper/jas_fix.h"
+#include "jasper/jas_malloc.h"
+#include "jasper/jas_math.h"
+#include "jasper/jas_stream.h"
+#include "jasper/jas_debug.h"
+
+#include "jpc_bs.h"
+#include "jpc_dec.h"
+#include "jpc_cs.h"
+#include "jpc_mqdec.h"
+#include "jpc_t2dec.h"
+#include "jpc_t1cod.h"
+#include "jpc_math.h"
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+long jpc_dec_lookahead(jas_stream_t *in);
+static int jpc_getcommacode(jpc_bitstream_t *in);
+static int jpc_getnumnewpasses(jpc_bitstream_t *in);
+static int jpc_dec_decodepkt(jpc_dec_t *dec, jas_stream_t *pkthdrstream, jas_stream_t *in, int compno, int lvlno,
+  int prcno, int lyrno);
+
+/******************************************************************************\
+* Code.
+\******************************************************************************/
+
+static int jpc_getcommacode(jpc_bitstream_t *in)
+{
+       int n;
+       int v;
+
+       n = 0;
+       for (;;) {
+               if ((v = jpc_bitstream_getbit(in)) < 0) {
+                       return -1;
+               }
+               if (jpc_bitstream_eof(in)) {
+                       return -1;
+               }
+               if (!v) {
+                       break;
+               }
+               ++n;
+       }
+
+       return n;
+}
+
+static int jpc_getnumnewpasses(jpc_bitstream_t *in)
+{
+       int n;
+
+       if ((n = jpc_bitstream_getbit(in)) > 0) {
+               if ((n = jpc_bitstream_getbit(in)) > 0) {
+                       if ((n = jpc_bitstream_getbits(in, 2)) == 3) {
+                               if ((n = jpc_bitstream_getbits(in, 5)) == 31) {
+                                       if ((n = jpc_bitstream_getbits(in, 7)) >= 0) {
+                                               n += 36 + 1;
+                                       }
+                               } else if (n >= 0) {
+                                       n += 5 + 1;
+                               }
+                       } else if (n >= 0) {
+                               n += 2 + 1;
+                       }
+               } else if (!n) {
+                       n += 2;
+               }
+       } else if (!n) {
+               ++n;
+       }
+
+       return n;
+}
+
+static int jpc_dec_decodepkt(jpc_dec_t *dec, jas_stream_t *pkthdrstream, jas_stream_t *in, int compno, int rlvlno,
+  int prcno, int lyrno)
+{
+       jpc_bitstream_t *inb;
+       jpc_dec_tcomp_t *tcomp;
+       jpc_dec_rlvl_t *rlvl;
+       jpc_dec_band_t *band;
+       jpc_dec_cblk_t *cblk;
+       int n;
+       int m;
+       int i;
+       jpc_tagtreenode_t *leaf;
+       int included;
+       int ret;
+       int numnewpasses;
+       jpc_dec_seg_t *seg;
+       int len;
+       int present;
+       int savenumnewpasses;
+       int mycounter;
+       jpc_ms_t *ms;
+       jpc_dec_tile_t *tile;
+       jpc_dec_ccp_t *ccp;
+       jpc_dec_cp_t *cp;
+       int bandno;
+       jpc_dec_prc_t *prc;
+       int usedcblkcnt;
+       int cblkno;
+       uint_fast32_t bodylen;
+       bool discard;
+       int passno;
+       int maxpasses;
+       int hdrlen;
+       int hdroffstart;
+       int hdroffend;
+
+       /* Avoid compiler warning about possible use of uninitialized
+         variable. */
+       bodylen = 0;
+
+       discard = (lyrno >= dec->maxlyrs);
+
+       tile = dec->curtile;
+       cp = tile->cp;
+       ccp = &cp->ccps[compno];
+
+       /*
+        * Decode the packet header.
+        */
+
+       /* Decode the SOP marker segment if present. */
+       if (cp->csty & JPC_COD_SOP) {
+               if (jpc_dec_lookahead(in) == JPC_MS_SOP) {
+                       if (!(ms = jpc_getms(in, dec->cstate))) {
+                               return -1;
+                       }
+                       if (jpc_ms_gettype(ms) != JPC_MS_SOP) {
+                               jpc_ms_destroy(ms);
+                               jas_eprintf("missing SOP marker segment\n");
+                               return -1;
+                       }
+                       jpc_ms_destroy(ms);
+               }
+       }
+
+hdroffstart = jas_stream_getrwcount(pkthdrstream);
+
+       if (!(inb = jpc_bitstream_sopen(pkthdrstream, "r"))) {
+               return -1;
+       }
+
+       if ((present = jpc_bitstream_getbit(inb)) < 0) {
+               return 1;
+       }
+       JAS_DBGLOG(10, ("\n", present));
+       JAS_DBGLOG(10, ("present=%d ", present));
+
+       /* Is the packet non-empty? */
+       if (present) {
+               /* The packet is non-empty. */
+               tcomp = &tile->tcomps[compno];
+               rlvl = &tcomp->rlvls[rlvlno];
+               bodylen = 0;
+               for (bandno = 0, band = rlvl->bands; bandno < rlvl->numbands;
+                 ++bandno, ++band) {
+                       if (!band->data) {
+                               continue;
+                       }
+                       prc = &band->prcs[prcno];
+                       if (!prc->cblks) {
+                               continue;
+                       }
+                       usedcblkcnt = 0;
+                       for (cblkno = 0, cblk = prc->cblks; cblkno < prc->numcblks;
+                         ++cblkno, ++cblk) {
+                               ++usedcblkcnt;
+                               if (!cblk->numpasses) {
+                                       leaf = jpc_tagtree_getleaf(prc->incltagtree, usedcblkcnt - 1);
+                                       if ((included = jpc_tagtree_decode(prc->incltagtree, leaf, lyrno + 1, inb)) < 0) {
+                                               return -1;
+                                       }
+                               } else {
+                                       if ((included = jpc_bitstream_getbit(inb)) < 0) {
+                                               return -1;
+                                       }
+                               }
+                               JAS_DBGLOG(10, ("\n"));
+                               JAS_DBGLOG(10, ("included=%d ", included));
+                               if (!included) {
+                                       continue;
+                               }
+                               if (!cblk->numpasses) {
+                                       i = 1;
+                                       leaf = jpc_tagtree_getleaf(prc->numimsbstagtree, usedcblkcnt - 1);
+                                       for (;;) {
+                                               if ((ret = jpc_tagtree_decode(prc->numimsbstagtree, leaf, i, inb)) < 0) {
+                                                       return -1;
+                                               }
+                                               if (ret) {
+                                                       break;
+                                               }
+                                               ++i;
+                                       }
+                                       cblk->numimsbs = i - 1;
+                                       cblk->firstpassno = cblk->numimsbs * 3;
+                               }
+                               if ((numnewpasses = jpc_getnumnewpasses(inb)) < 0) {
+                                       return -1;
+                               }
+                               JAS_DBGLOG(10, ("numnewpasses=%d ", numnewpasses));
+                               seg = cblk->curseg;
+                               savenumnewpasses = numnewpasses;
+                               mycounter = 0;
+                               if (numnewpasses > 0) {
+                                       if ((m = jpc_getcommacode(inb)) < 0) {
+                                               return -1;
+                                       }
+                                       cblk->numlenbits += m;
+                                       JAS_DBGLOG(10, ("increment=%d ", m));
+                                       while (numnewpasses > 0) {
+                                               passno = cblk->firstpassno + cblk->numpasses + mycounter;
+       /* XXX - the maxpasses is not set precisely but this doesn't matter... */
+                                               maxpasses = JPC_SEGPASSCNT(passno, cblk->firstpassno, 10000, (ccp->cblkctx & JPC_COX_LAZY) != 0, (ccp->cblkctx & JPC_COX_TERMALL) != 0);
+                                               if (!discard && !seg) {
+                                                       if (!(seg = jpc_seg_alloc())) {
+                                                               return -1;
+                                                       }
+                                                       jpc_seglist_insert(&cblk->segs, cblk->segs.tail, seg);
+                                                       if (!cblk->curseg) {
+                                                               cblk->curseg = seg;
+                                                       }
+                                                       seg->passno = passno;
+                                                       seg->type = JPC_SEGTYPE(seg->passno, cblk->firstpassno, (ccp->cblkctx & JPC_COX_LAZY) != 0);
+                                                       seg->maxpasses = maxpasses;
+                                               }
+                                               n = JAS_MIN(numnewpasses, maxpasses);
+                                               mycounter += n;
+                                               numnewpasses -= n;
+                                               if ((len = jpc_bitstream_getbits(inb, cblk->numlenbits + jpc_floorlog2(n))) < 0) {
+                                                       return -1;
+                                               }
+                                               JAS_DBGLOG(10, ("len=%d ", len));
+                                               if (!discard) {
+                                                       seg->lyrno = lyrno;
+                                                       seg->numpasses += n;
+                                                       seg->cnt = len;
+                                                       seg = seg->next;
+                                               }
+                                               bodylen += len;
+                                       }
+                               }
+                               cblk->numpasses += savenumnewpasses;
+                       }
+               }
+
+               jpc_bitstream_inalign(inb, 0, 0);
+
+       } else {
+               if (jpc_bitstream_inalign(inb, 0x7f, 0)) {
+                       jas_eprintf("alignment failed\n");
+                       return -1;
+               }
+       }
+       jpc_bitstream_close(inb);
+
+       hdroffend = jas_stream_getrwcount(pkthdrstream);
+       hdrlen = hdroffend - hdroffstart;
+       if (jas_getdbglevel() >= 5) {
+               jas_eprintf("hdrlen=%lu bodylen=%lu \n", (unsigned long) hdrlen,
+                 (unsigned long) bodylen);
+       }
+
+       if (cp->csty & JPC_COD_EPH) {
+               if (jpc_dec_lookahead(pkthdrstream) == JPC_MS_EPH) {
+                       if (!(ms = jpc_getms(pkthdrstream, dec->cstate))) {
+                               jas_eprintf("cannot get (EPH) marker segment\n");
+                               return -1;
+                       }
+                       if (jpc_ms_gettype(ms) != JPC_MS_EPH) {
+                               jpc_ms_destroy(ms);
+                               jas_eprintf("missing EPH marker segment\n");
+                               return -1;
+                       }
+                       jpc_ms_destroy(ms);
+               }
+       }
+
+       /* decode the packet body. */
+
+       if (jas_getdbglevel() >= 1) {
+               jas_eprintf("packet body offset=%06ld\n", (long) jas_stream_getrwcount(in));
+       }
+
+       if (!discard) {
+               tcomp = &tile->tcomps[compno];
+               rlvl = &tcomp->rlvls[rlvlno];
+               for (bandno = 0, band = rlvl->bands; bandno < rlvl->numbands;
+                 ++bandno, ++band) {
+                       if (!band->data) {
+                               continue;
+                       }
+                       prc = &band->prcs[prcno];
+                       if (!prc->cblks) {
+                               continue;
+                       }
+                       for (cblkno = 0, cblk = prc->cblks; cblkno < prc->numcblks;
+                         ++cblkno, ++cblk) {
+                               seg = cblk->curseg;
+                               while (seg) {
+                                       if (!seg->stream) {
+                                               if (!(seg->stream = jas_stream_memopen(0, 0))) {
+                                                       return -1;
+                                               }
+                                       }
+#if 0
+jas_eprintf("lyrno=%02d, compno=%02d, lvlno=%02d, prcno=%02d, bandno=%02d, cblkno=%02d, passno=%02d numpasses=%02d cnt=%d numbps=%d, numimsbs=%d\n", lyrno, compno, rlvlno, prcno, band - rlvl->bands, cblk - prc->cblks, seg->passno, seg->numpasses, seg->cnt, band->numbps, cblk->numimsbs);
+#endif
+                                       if (seg->cnt > 0) {
+                                               if (jpc_getdata(in, seg->stream, seg->cnt) < 0) {
+                                                       return -1;
+                                               }
+                                               seg->cnt = 0;
+                                       }
+                                       if (seg->numpasses >= seg->maxpasses) {
+                                               cblk->curseg = seg->next;
+                                       }
+                                       seg = seg->next;
+                               }
+                       }
+               }
+       } else {
+               if (jas_stream_gobble(in, bodylen) != JAS_CAST(int, bodylen)) {
+                       return -1;
+               }
+       }
+       return 0;
+}
+
+/********************************************************************************************/
+/********************************************************************************************/
+
+int jpc_dec_decodepkts(jpc_dec_t *dec, jas_stream_t *pkthdrstream, jas_stream_t *in)
+{
+       jpc_dec_tile_t *tile;
+       jpc_pi_t *pi;
+       int ret;
+
+       tile = dec->curtile;
+       pi = tile->pi;
+       for (;;) {
+if (!tile->pkthdrstream || jas_stream_peekc(tile->pkthdrstream) == EOF) {
+               switch (jpc_dec_lookahead(in)) {
+               case JPC_MS_EOC:
+               case JPC_MS_SOT:
+                       return 0;
+                       break;
+               case JPC_MS_SOP:
+               case JPC_MS_EPH:
+               case 0:
+                       break;
+               default:
+                       return -1;
+                       break;
+               }
+}
+               if ((ret = jpc_pi_next(pi))) {
+                       return ret;
+               }
+if (dec->maxpkts >= 0 && dec->numpkts >= dec->maxpkts) {
+       jas_eprintf("warning: stopping decode prematurely as requested\n");
+       return 0;
+}
+               if (jas_getdbglevel() >= 1) {
+                       jas_eprintf("packet offset=%08ld prg=%d cmptno=%02d "
+                         "rlvlno=%02d prcno=%03d lyrno=%02d\n", (long)
+                         jas_stream_getrwcount(in), jpc_pi_prg(pi), jpc_pi_cmptno(pi),
+                         jpc_pi_rlvlno(pi), jpc_pi_prcno(pi), jpc_pi_lyrno(pi));
+               }
+               if (jpc_dec_decodepkt(dec, pkthdrstream, in, jpc_pi_cmptno(pi), jpc_pi_rlvlno(pi),
+                 jpc_pi_prcno(pi), jpc_pi_lyrno(pi))) {
+                       return -1;
+               }
+++dec->numpkts;
+       }
+
+       return 0;
+}
+
+jpc_pi_t *jpc_dec_pi_create(jpc_dec_t *dec, jpc_dec_tile_t *tile)
+{
+       jpc_pi_t *pi;
+       int compno;
+       jpc_picomp_t *picomp;
+       jpc_pirlvl_t *pirlvl;
+       jpc_dec_tcomp_t *tcomp;
+       int rlvlno;
+       jpc_dec_rlvl_t *rlvl;
+       int prcno;
+       int *prclyrno;
+       jpc_dec_cmpt_t *cmpt;
+
+       if (!(pi = jpc_pi_create0())) {
+               return 0;
+       }
+       pi->numcomps = dec->numcomps;
+       if (!(pi->picomps = jas_malloc(pi->numcomps * sizeof(jpc_picomp_t)))) {
+               jpc_pi_destroy(pi);
+               return 0;
+       }
+       for (compno = 0, picomp = pi->picomps; compno < pi->numcomps; ++compno,
+         ++picomp) {
+               picomp->pirlvls = 0;
+       }
+
+       for (compno = 0, tcomp = tile->tcomps, picomp = pi->picomps;
+         compno < pi->numcomps; ++compno, ++tcomp, ++picomp) {
+               picomp->numrlvls = tcomp->numrlvls;
+               if (!(picomp->pirlvls = jas_malloc(picomp->numrlvls *
+                 sizeof(jpc_pirlvl_t)))) {
+                       jpc_pi_destroy(pi);
+                       return 0;
+               }
+               for (rlvlno = 0, pirlvl = picomp->pirlvls; rlvlno <
+                 picomp->numrlvls; ++rlvlno, ++pirlvl) {
+                       pirlvl->prclyrnos = 0;
+               }
+               for (rlvlno = 0, pirlvl = picomp->pirlvls, rlvl = tcomp->rlvls;
+                 rlvlno < picomp->numrlvls; ++rlvlno, ++pirlvl, ++rlvl) {
+/* XXX sizeof(long) should be sizeof different type */
+                       pirlvl->numprcs = rlvl->numprcs;
+                       if (!(pirlvl->prclyrnos = jas_malloc(pirlvl->numprcs *
+                         sizeof(long)))) {
+                               jpc_pi_destroy(pi);
+                               return 0;
+                       }
+               }
+       }
+
+       pi->maxrlvls = 0;
+       for (compno = 0, tcomp = tile->tcomps, picomp = pi->picomps, cmpt =
+         dec->cmpts; compno < pi->numcomps; ++compno, ++tcomp, ++picomp,
+         ++cmpt) {
+               picomp->hsamp = cmpt->hstep;
+               picomp->vsamp = cmpt->vstep;
+               for (rlvlno = 0, pirlvl = picomp->pirlvls, rlvl = tcomp->rlvls;
+                 rlvlno < picomp->numrlvls; ++rlvlno, ++pirlvl, ++rlvl) {
+                       pirlvl->prcwidthexpn = rlvl->prcwidthexpn;
+                       pirlvl->prcheightexpn = rlvl->prcheightexpn;
+                       for (prcno = 0, prclyrno = pirlvl->prclyrnos;
+                         prcno < pirlvl->numprcs; ++prcno, ++prclyrno) {
+                               *prclyrno = 0;
+                       }
+                       pirlvl->numhprcs = rlvl->numhprcs;
+               }
+               if (pi->maxrlvls < tcomp->numrlvls) {
+                       pi->maxrlvls = tcomp->numrlvls;
+               }
+       }
+
+       pi->numlyrs = tile->cp->numlyrs;
+       pi->xstart = tile->xstart;
+       pi->ystart = tile->ystart;
+       pi->xend = tile->xend;
+       pi->yend = tile->yend;
+
+       pi->picomp = 0;
+       pi->pirlvl = 0;
+       pi->x = 0;
+       pi->y = 0;
+       pi->compno = 0;
+       pi->rlvlno = 0;
+       pi->prcno = 0;
+       pi->lyrno = 0;
+       pi->xstep = 0;
+       pi->ystep = 0;
+
+       pi->pchgno = -1;
+
+       pi->defaultpchg.prgord = tile->cp->prgord;
+       pi->defaultpchg.compnostart = 0;
+       pi->defaultpchg.compnoend = pi->numcomps;
+       pi->defaultpchg.rlvlnostart = 0;
+       pi->defaultpchg.rlvlnoend = pi->maxrlvls;
+       pi->defaultpchg.lyrnoend = pi->numlyrs;
+       pi->pchg = 0;
+
+       pi->valid = 0;
+
+       return pi;
+}
+
+long jpc_dec_lookahead(jas_stream_t *in)
+{
+       uint_fast16_t x;
+       if (jpc_getuint16(in, &x)) {
+               return -1;
+       }
+       if (jas_stream_ungetc(in, x & 0xff) == EOF ||
+         jas_stream_ungetc(in, x >> 8) == EOF) {
+               return -1;
+       }
+       if (x >= JPC_MS_INMIN && x <= JPC_MS_INMAX) {
+               return x;
+       }
+       return 0;
+}
diff --git a/src/libjasper/jpc/jpc_t2dec.h b/src/libjasper/jpc/jpc_t2dec.h
new file mode 100644 (file)
index 0000000..68c8202
--- /dev/null
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Tier 2 Decoder
+ *
+ * $Id$
+ */
+
+#ifndef JPC_T2DEC_H
+#define JPC_T2DEC_H
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include "jasper/jas_fix.h"
+#include "jasper/jas_stream.h"
+
+#include "jpc_bs.h"
+#include "jpc_dec.h"
+#include "jpc_mqdec.h"
+
+/******************************************************************************\
+* Functions.
+\******************************************************************************/
+
+/* Decode the packets for a tile-part. */
+int jpc_dec_decodepkts(jpc_dec_t *dec, jas_stream_t *pkthdrstream,
+  jas_stream_t *in);
+
+/* Create a packet iterator for the decoder. */
+jpc_pi_t *jpc_dec_pi_create(jpc_dec_t *dec, jpc_dec_tile_t *tile);
+
+#endif
diff --git a/src/libjasper/jpc/jpc_t2enc.c b/src/libjasper/jpc/jpc_t2enc.c
new file mode 100644 (file)
index 0000000..9358a1c
--- /dev/null
@@ -0,0 +1,655 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Tier 2 Encoder
+ *
+ * $Id$
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+
+#include "jasper/jas_fix.h"
+#include "jasper/jas_malloc.h"
+#include "jasper/jas_math.h"
+#include "jasper/jas_debug.h"
+
+#include "jpc_flt.h"
+#include "jpc_t2enc.h"
+#include "jpc_t2cod.h"
+#include "jpc_tagtree.h"
+#include "jpc_enc.h"
+#include "jpc_math.h"
+
+/******************************************************************************\
+* Code.
+\******************************************************************************/
+
+static int jpc_putcommacode(jpc_bitstream_t *out, int n)
+{
+       assert(n >= 0);
+
+       while (--n >= 0) {
+               if (jpc_bitstream_putbit(out, 1) == EOF) {
+                       return -1;
+               }
+       }
+       if (jpc_bitstream_putbit(out, 0) == EOF) {
+               return -1;
+       }
+       return 0;
+}
+
+static int jpc_putnumnewpasses(jpc_bitstream_t *out, int n)
+{
+       int ret;
+
+       if (n <= 0) {
+               return -1;
+       } else if (n == 1) {
+               ret = jpc_bitstream_putbit(out, 0);
+       } else if (n == 2) {
+               ret = jpc_bitstream_putbits(out, 2, 2);
+       } else if (n <= 5) {
+               ret = jpc_bitstream_putbits(out, 4, 0xc | (n - 3));
+       } else if (n <= 36) {
+               ret = jpc_bitstream_putbits(out, 9, 0x1e0 | (n - 6));
+       } else if (n <= 164) {
+               ret = jpc_bitstream_putbits(out, 16, 0xff80 | (n - 37));
+       } else {
+               /* The standard has no provision for encoding a larger value.
+               In practice, however, it is highly unlikely that this
+               limitation will ever be encountered. */
+               return -1;
+       }
+
+       return (ret != EOF) ? 0 : (-1);
+}
+
+int jpc_enc_encpkts(jpc_enc_t *enc, jas_stream_t *out)
+{
+       jpc_enc_tile_t *tile;
+       jpc_pi_t *pi;
+
+       tile = enc->curtile;
+
+       jpc_init_t2state(enc, 0);
+       pi = tile->pi;
+       jpc_pi_init(pi);
+
+       if (!jpc_pi_next(pi)) {
+               for (;;) {
+                       if (jpc_enc_encpkt(enc, out, jpc_pi_cmptno(pi), jpc_pi_rlvlno(pi),
+                         jpc_pi_prcno(pi), jpc_pi_lyrno(pi))) {
+                               return -1;
+                       }
+                       if (jpc_pi_next(pi)) {
+                               break;
+                       }
+               }
+       }
+       
+       return 0;
+}
+
+int jpc_enc_encpkt(jpc_enc_t *enc, jas_stream_t *out, int compno, int lvlno, int prcno, int lyrno)
+{
+       jpc_enc_tcmpt_t *comp;
+       jpc_enc_rlvl_t *lvl;
+       jpc_enc_band_t *band;
+       jpc_enc_band_t *endbands;
+       jpc_enc_cblk_t *cblk;
+       jpc_enc_cblk_t *endcblks;
+       jpc_bitstream_t *outb;
+       jpc_enc_pass_t *pass;
+       jpc_enc_pass_t *startpass;
+       jpc_enc_pass_t *lastpass;
+       jpc_enc_pass_t *endpass;
+       jpc_enc_pass_t *endpasses;
+       int i;
+       int included;
+       int ret;
+       jpc_tagtreenode_t *leaf;
+       int n;
+       int t1;
+       int t2;
+       int adjust;
+       int maxadjust;
+       int datalen;
+       int numnewpasses;
+       int passcount;
+       jpc_enc_tile_t *tile;
+       jpc_enc_prc_t *prc;
+       jpc_enc_cp_t *cp;
+       jpc_ms_t *ms;
+
+       tile = enc->curtile;
+       cp = enc->cp;
+
+       if (cp->tcp.csty & JPC_COD_SOP) {
+               if (!(ms = jpc_ms_create(JPC_MS_SOP))) {
+                       return -1;
+               }
+               ms->parms.sop.seqno = jpc_pi_getind(tile->pi);
+               if (jpc_putms(out, enc->cstate, ms)) {
+                       return -1;
+               }
+               jpc_ms_destroy(ms);
+       }
+
+       outb = jpc_bitstream_sopen(out, "w+");
+       assert(outb);
+
+       if (jpc_bitstream_putbit(outb, 1) == EOF) {
+               return -1;
+       }
+       JAS_DBGLOG(10, ("\n"));
+       JAS_DBGLOG(10, ("present. "));
+
+       comp = &tile->tcmpts[compno];
+       lvl = &comp->rlvls[lvlno];
+       endbands = &lvl->bands[lvl->numbands];
+       for (band = lvl->bands; band != endbands; ++band) {
+               if (!band->data) {
+                       continue;
+               }
+               prc = &band->prcs[prcno];
+               if (!prc->cblks) {
+                       continue;
+               }
+
+               endcblks = &prc->cblks[prc->numcblks];
+               for (cblk = prc->cblks; cblk != endcblks; ++cblk) {
+                       if (!lyrno) {
+                               leaf = jpc_tagtree_getleaf(prc->nlibtree, cblk - prc->cblks);
+                               jpc_tagtree_setvalue(prc->nlibtree, leaf, cblk->numimsbs);
+                       }
+                       pass = cblk->curpass;
+                       included = (pass && pass->lyrno == lyrno);
+                       if (included && (!cblk->numencpasses)) {
+                               assert(pass->lyrno == lyrno);
+                               leaf = jpc_tagtree_getleaf(prc->incltree,
+                                 cblk - prc->cblks);
+                               jpc_tagtree_setvalue(prc->incltree, leaf, pass->lyrno);
+                       }
+               }
+
+               endcblks = &prc->cblks[prc->numcblks];
+               for (cblk = prc->cblks; cblk != endcblks; ++cblk) {
+                       pass = cblk->curpass;
+                       included = (pass && pass->lyrno == lyrno);
+                       if (!cblk->numencpasses) {
+                               leaf = jpc_tagtree_getleaf(prc->incltree,
+                                 cblk - prc->cblks);
+                               if (jpc_tagtree_encode(prc->incltree, leaf, lyrno
+                                 + 1, outb) < 0) {
+                                       return -1;
+                               }
+                       } else {
+                               if (jpc_bitstream_putbit(outb, included) == EOF) {
+                                       return -1;
+                               }
+                       }
+                       JAS_DBGLOG(10, ("included=%d ", included));
+                       if (!included) {
+                               continue;
+                       }
+                       if (!cblk->numencpasses) {
+                               i = 1;
+                               leaf = jpc_tagtree_getleaf(prc->nlibtree, cblk - prc->cblks);
+                               for (;;) {
+                                       if ((ret = jpc_tagtree_encode(prc->nlibtree, leaf, i, outb)) < 0) {
+                                               return -1;
+                                       }
+                                       if (ret) {
+                                               break;
+                                       }
+                                       ++i;
+                               }
+                               assert(leaf->known_ && i == leaf->value_ + 1);
+                       }
+
+                       endpasses = &cblk->passes[cblk->numpasses];
+                       startpass = pass;
+                       endpass = startpass;
+                       while (endpass != endpasses && endpass->lyrno == lyrno){
+                               ++endpass;
+                       }
+                       numnewpasses = endpass - startpass;
+                       if (jpc_putnumnewpasses(outb, numnewpasses)) {
+                               return -1;
+                       }
+                       JAS_DBGLOG(10, ("numnewpasses=%d ", numnewpasses));
+
+                       lastpass = endpass - 1;
+                       n = startpass->start;
+                       passcount = 1;
+                       maxadjust = 0;
+                       for (pass = startpass; pass != endpass; ++pass) {
+                               if (pass->term || pass == lastpass) {
+                                       datalen = pass->end - n;
+                                       t1 = jpc_firstone(datalen) + 1;
+                                       t2 = cblk->numlenbits + jpc_floorlog2(passcount);
+                                       adjust = JAS_MAX(t1 - t2, 0);
+                                       maxadjust = JAS_MAX(adjust, maxadjust);
+                                       n += datalen;
+                                       passcount = 1;
+                               } else {
+                                       ++passcount;
+                               }
+                       }
+                       if (jpc_putcommacode(outb, maxadjust)) {
+                               return -1;
+                       }
+                       cblk->numlenbits += maxadjust;
+
+                       lastpass = endpass - 1;
+                       n = startpass->start;
+                       passcount = 1;
+                       for (pass = startpass; pass != endpass; ++pass) {
+                               if (pass->term || pass == lastpass) {
+                                       datalen = pass->end - n;
+assert(jpc_firstone(datalen) < cblk->numlenbits + jpc_floorlog2(passcount));
+                                       if (jpc_bitstream_putbits(outb, cblk->numlenbits + jpc_floorlog2(passcount), datalen) == EOF) {
+                                               return -1;
+                                       }
+                                       n += datalen;
+                                       passcount = 1;
+                               } else {
+                                       ++passcount;
+                               }
+                       }
+               }
+       }
+
+       jpc_bitstream_outalign(outb, 0);
+       jpc_bitstream_close(outb);
+
+       if (cp->tcp.csty & JPC_COD_EPH) {
+               if (!(ms = jpc_ms_create(JPC_MS_EPH))) {
+                       return -1;
+               }
+               jpc_putms(out, enc->cstate, ms);
+               jpc_ms_destroy(ms);
+       }
+
+       comp = &tile->tcmpts[compno];
+       lvl = &comp->rlvls[lvlno];
+       endbands = &lvl->bands[lvl->numbands];
+       for (band = lvl->bands; band != endbands; ++band) {
+               if (!band->data) {
+                       continue;
+               }
+               prc = &band->prcs[prcno];
+               if (!prc->cblks) {
+                       continue;
+               }
+               endcblks = &prc->cblks[prc->numcblks];
+               for (cblk = prc->cblks; cblk != endcblks; ++cblk) {
+                       pass = cblk->curpass;
+
+                       if (!pass) {
+                               continue;
+                       }
+                       if (pass->lyrno != lyrno) {
+                               assert(pass->lyrno < 0 || pass->lyrno > lyrno);
+                               continue;
+                       }
+
+                       endpasses = &cblk->passes[cblk->numpasses];
+                       startpass = pass;
+                       endpass = startpass;
+                       while (endpass != endpasses && endpass->lyrno == lyrno){
+                               ++endpass;
+                       }
+                       lastpass = endpass - 1;
+                       numnewpasses = endpass - startpass;
+
+                       jas_stream_seek(cblk->stream, startpass->start, SEEK_SET);
+                       assert(jas_stream_tell(cblk->stream) == startpass->start);
+                       if (jas_stream_copy(out, cblk->stream, lastpass->end - startpass->start)) {
+                               return -1;
+                       }
+                       cblk->curpass = (endpass != endpasses) ? endpass : 0;
+                       cblk->numencpasses += numnewpasses;
+
+               }
+       }
+
+       return 0;
+}
+
+void jpc_save_t2state(jpc_enc_t *enc)
+{
+/* stream pos in embedded T1 stream may be wrong since not saved/restored! */
+
+       jpc_enc_tcmpt_t *comp;
+       jpc_enc_tcmpt_t *endcomps;
+       jpc_enc_rlvl_t *lvl;
+       jpc_enc_rlvl_t *endlvls;
+       jpc_enc_band_t *band;
+       jpc_enc_band_t *endbands;
+       jpc_enc_cblk_t *cblk;
+       jpc_enc_cblk_t *endcblks;
+       jpc_enc_tile_t *tile;
+       int prcno;
+       jpc_enc_prc_t *prc;
+
+       tile = enc->curtile;
+
+       endcomps = &tile->tcmpts[tile->numtcmpts];
+       for (comp = tile->tcmpts; comp != endcomps; ++comp) {
+               endlvls = &comp->rlvls[comp->numrlvls];
+               for (lvl = comp->rlvls; lvl != endlvls; ++lvl) {
+                       if (!lvl->bands) {
+                               continue;
+                       }
+                       endbands = &lvl->bands[lvl->numbands];
+                       for (band = lvl->bands; band != endbands; ++band) {
+                               if (!band->data) {
+                                       continue;
+                               }
+                               for (prcno = 0, prc = band->prcs; prcno < lvl->numprcs; ++prcno, ++prc) {
+                                       if (!prc->cblks) {
+                                               continue;
+                                       }
+                                       jpc_tagtree_copy(prc->savincltree, prc->incltree);
+                                       jpc_tagtree_copy(prc->savnlibtree, prc->nlibtree);
+                                       endcblks = &prc->cblks[prc->numcblks];
+                                       for (cblk = prc->cblks; cblk != endcblks; ++cblk) {
+                                               cblk->savedcurpass = cblk->curpass;
+                                               cblk->savednumencpasses = cblk->numencpasses;
+                                               cblk->savednumlenbits = cblk->numlenbits;
+                                       }
+                               }
+                       }
+               }
+       }
+
+}
+
+void jpc_restore_t2state(jpc_enc_t *enc)
+{
+
+       jpc_enc_tcmpt_t *comp;
+       jpc_enc_tcmpt_t *endcomps;
+       jpc_enc_rlvl_t *lvl;
+       jpc_enc_rlvl_t *endlvls;
+       jpc_enc_band_t *band;
+       jpc_enc_band_t *endbands;
+       jpc_enc_cblk_t *cblk;
+       jpc_enc_cblk_t *endcblks;
+       jpc_enc_tile_t *tile;
+       int prcno;
+       jpc_enc_prc_t *prc;
+
+       tile = enc->curtile;
+
+       endcomps = &tile->tcmpts[tile->numtcmpts];
+       for (comp = tile->tcmpts; comp != endcomps; ++comp) {
+               endlvls = &comp->rlvls[comp->numrlvls];
+               for (lvl = comp->rlvls; lvl != endlvls; ++lvl) {
+                       if (!lvl->bands) {
+                               continue;
+                       }
+                       endbands = &lvl->bands[lvl->numbands];
+                       for (band = lvl->bands; band != endbands; ++band) {
+                               if (!band->data) {
+                                       continue;
+                               }
+                               for (prcno = 0, prc = band->prcs; prcno < lvl->numprcs; ++prcno, ++prc) {
+                                       if (!prc->cblks) {
+                                               continue;
+                                       }
+                                       jpc_tagtree_copy(prc->incltree, prc->savincltree);
+                                       jpc_tagtree_copy(prc->nlibtree, prc->savnlibtree);
+                                       endcblks = &prc->cblks[prc->numcblks];
+                                       for (cblk = prc->cblks; cblk != endcblks; ++cblk) {
+                                               cblk->curpass = cblk->savedcurpass;
+                                               cblk->numencpasses = cblk->savednumencpasses;
+                                               cblk->numlenbits = cblk->savednumlenbits;
+                                       }
+                               }
+                       }
+               }
+       }
+}
+
+void jpc_init_t2state(jpc_enc_t *enc, int raflag)
+{
+/* It is assumed that band->numbps and cblk->numbps precomputed */
+
+       jpc_enc_tcmpt_t *comp;
+       jpc_enc_tcmpt_t *endcomps;
+       jpc_enc_rlvl_t *lvl;
+       jpc_enc_rlvl_t *endlvls;
+       jpc_enc_band_t *band;
+       jpc_enc_band_t *endbands;
+       jpc_enc_cblk_t *cblk;
+       jpc_enc_cblk_t *endcblks;
+       jpc_enc_pass_t *pass;
+       jpc_enc_pass_t *endpasses;
+       jpc_tagtreenode_t *leaf;
+       jpc_enc_tile_t *tile;
+       int prcno;
+       jpc_enc_prc_t *prc;
+
+       tile = enc->curtile;
+
+       endcomps = &tile->tcmpts[tile->numtcmpts];
+       for (comp = tile->tcmpts; comp != endcomps; ++comp) {
+               endlvls = &comp->rlvls[comp->numrlvls];
+               for (lvl = comp->rlvls; lvl != endlvls; ++lvl) {
+                       if (!lvl->bands) {
+                               continue;
+                       }
+                       endbands = &lvl->bands[lvl->numbands];
+                       for (band = lvl->bands; band != endbands; ++band) {
+                               if (!band->data) {
+                                       continue;
+                               }
+                               for (prcno = 0, prc = band->prcs; prcno < lvl->numprcs; ++prcno, ++prc) {
+                                       if (!prc->cblks) {
+                                               continue;
+                                       }
+                                       jpc_tagtree_reset(prc->incltree);
+                                       jpc_tagtree_reset(prc->nlibtree);
+                                       endcblks = &prc->cblks[prc->numcblks];
+                                       for (cblk = prc->cblks; cblk != endcblks; ++cblk) {
+                                               if (jas_stream_rewind(cblk->stream)) {
+                                                       assert(0);
+                                               }
+                                               cblk->curpass = (cblk->numpasses > 0) ? cblk->passes : 0;
+                                               cblk->numencpasses = 0;
+                                               cblk->numlenbits = 3;
+                                               cblk->numimsbs = band->numbps - cblk->numbps;
+                                               assert(cblk->numimsbs >= 0);
+                                               leaf = jpc_tagtree_getleaf(prc->nlibtree, cblk - prc->cblks);
+                                               jpc_tagtree_setvalue(prc->nlibtree, leaf, cblk->numimsbs);
+
+                                               if (raflag) {
+                                                       endpasses = &cblk->passes[cblk->numpasses];
+                                                       for (pass = cblk->passes; pass != endpasses; ++pass) {
+                                                               pass->lyrno = -1;
+                                                               pass->lyrno = 0;
+                                                       }
+                                               }
+                                       }
+                               }
+                       }
+               }
+       }
+
+}
+
+jpc_pi_t *jpc_enc_pi_create(jpc_enc_cp_t *cp, jpc_enc_tile_t *tile)
+{
+       jpc_pi_t *pi;
+       int compno;
+       jpc_picomp_t *picomp;
+       jpc_pirlvl_t *pirlvl;
+       jpc_enc_tcmpt_t *tcomp;
+       int rlvlno;
+       jpc_enc_rlvl_t *rlvl;
+       int prcno;
+       int *prclyrno;
+
+       if (!(pi = jpc_pi_create0())) {
+               return 0;
+       }
+       pi->pktno = -1;
+       pi->numcomps = cp->numcmpts;
+       if (!(pi->picomps = jas_malloc(pi->numcomps * sizeof(jpc_picomp_t)))) {
+               jpc_pi_destroy(pi);
+               return 0;
+       }
+       for (compno = 0, picomp = pi->picomps; compno < pi->numcomps; ++compno,
+         ++picomp) {
+               picomp->pirlvls = 0;
+       }
+
+       for (compno = 0, tcomp = tile->tcmpts, picomp = pi->picomps;
+         compno < pi->numcomps; ++compno, ++tcomp, ++picomp) {
+               picomp->numrlvls = tcomp->numrlvls;
+               if (!(picomp->pirlvls = jas_malloc(picomp->numrlvls *
+                 sizeof(jpc_pirlvl_t)))) {
+                       jpc_pi_destroy(pi);
+                       return 0;
+               }
+               for (rlvlno = 0, pirlvl = picomp->pirlvls; rlvlno <
+                 picomp->numrlvls; ++rlvlno, ++pirlvl) {
+                       pirlvl->prclyrnos = 0;
+               }
+               for (rlvlno = 0, pirlvl = picomp->pirlvls, rlvl = tcomp->rlvls;
+                 rlvlno < picomp->numrlvls; ++rlvlno, ++pirlvl, ++rlvl) {
+/* XXX sizeof(long) should be sizeof different type */
+                       pirlvl->numprcs = rlvl->numprcs;
+                       if (rlvl->numprcs) {
+                               if (!(pirlvl->prclyrnos = jas_malloc(pirlvl->numprcs *
+                                 sizeof(long)))) {
+                                       jpc_pi_destroy(pi);
+                                       return 0;
+                               }
+                       } else {
+                               pirlvl->prclyrnos = 0;
+                       }
+               }
+       }
+
+       pi->maxrlvls = 0;
+       for (compno = 0, tcomp = tile->tcmpts, picomp = pi->picomps;
+         compno < pi->numcomps; ++compno, ++tcomp, ++picomp) {
+               picomp->hsamp = cp->ccps[compno].sampgrdstepx;
+               picomp->vsamp = cp->ccps[compno].sampgrdstepy;
+               for (rlvlno = 0, pirlvl = picomp->pirlvls, rlvl = tcomp->rlvls;
+                 rlvlno < picomp->numrlvls; ++rlvlno, ++pirlvl, ++rlvl) {
+                       pirlvl->prcwidthexpn = rlvl->prcwidthexpn;
+                       pirlvl->prcheightexpn = rlvl->prcheightexpn;
+                       for (prcno = 0, prclyrno = pirlvl->prclyrnos;
+                         prcno < pirlvl->numprcs; ++prcno, ++prclyrno) {
+                               *prclyrno = 0;
+                       }
+                       pirlvl->numhprcs = rlvl->numhprcs;
+               }
+               if (pi->maxrlvls < tcomp->numrlvls) {
+                       pi->maxrlvls = tcomp->numrlvls;
+               }
+       }
+
+       pi->numlyrs = tile->numlyrs;
+       pi->xstart = tile->tlx;
+       pi->ystart = tile->tly;
+       pi->xend = tile->brx;
+       pi->yend = tile->bry;
+
+       pi->picomp = 0;
+       pi->pirlvl = 0;
+       pi->x = 0;
+       pi->y = 0;
+       pi->compno = 0;
+       pi->rlvlno = 0;
+       pi->prcno = 0;
+       pi->lyrno = 0;
+       pi->xstep = 0;
+       pi->ystep = 0;
+
+       pi->pchgno = -1;
+
+       pi->defaultpchg.prgord = tile->prg;
+       pi->defaultpchg.compnostart = 0;
+       pi->defaultpchg.compnoend = pi->numcomps;
+       pi->defaultpchg.rlvlnostart = 0;
+       pi->defaultpchg.rlvlnoend = pi->maxrlvls;
+       pi->defaultpchg.lyrnoend = pi->numlyrs;
+       pi->pchg = 0;
+
+       pi->valid = 0;
+
+       return pi;
+}
diff --git a/src/libjasper/jpc/jpc_t2enc.h b/src/libjasper/jpc/jpc_t2enc.h
new file mode 100644 (file)
index 0000000..83b325c
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Tier 2 Encoder
+ *
+ * $Id$
+ */
+
+#ifndef JPC_T2ENC_H
+#define JPC_T2ENC_H
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+
+#include "jpc_enc.h"
+
+/******************************************************************************\
+* Functions.
+\******************************************************************************/
+
+/* Encode the packets for a tile. */
+int jpc_enc_encpkts(jpc_enc_t *enc, jas_stream_t *out);
+
+/* Encode the specified packet. */
+int jpc_enc_encpkt(jpc_enc_t *enc, jas_stream_t *out, int compno, int lvlno,
+  int prcno, int lyrno);
+
+/* Save the tier-2 coding state. */
+void jpc_save_t2state(jpc_enc_t *enc);
+
+/* Restore the tier-2 coding state. */
+void jpc_restore_t2state(jpc_enc_t *enc);
+
+/* Initialize the tier-2 coding state. */
+void jpc_init_t2state(jpc_enc_t *enc, int raflag);
+
+/* Create a packet iterator for the encoder. */
+jpc_pi_t *jpc_enc_pi_create(jpc_enc_cp_t *cp, jpc_enc_tile_t *tile);
+
+#endif
diff --git a/src/libjasper/jpc/jpc_tagtree.c b/src/libjasper/jpc/jpc_tagtree.c
new file mode 100644 (file)
index 0000000..06422d3
--- /dev/null
@@ -0,0 +1,393 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Tag Tree Library
+ *
+ * $Id$
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <limits.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <stdio.h>
+
+#include "jasper/jas_malloc.h"
+
+#include "jpc_tagtree.h"
+
+/******************************************************************************\
+* Prototypes.
+\******************************************************************************/
+
+static jpc_tagtree_t *jpc_tagtree_alloc(void);
+
+/******************************************************************************\
+* Code for creating and destroying tag trees.
+\******************************************************************************/
+
+/* Create a tag tree. */
+
+jpc_tagtree_t *jpc_tagtree_create(int numleafsh, int numleafsv)
+{
+       int nplh[JPC_TAGTREE_MAXDEPTH];
+       int nplv[JPC_TAGTREE_MAXDEPTH];
+       jpc_tagtreenode_t *node;
+       jpc_tagtreenode_t *parentnode;
+       jpc_tagtreenode_t *parentnode0;
+       jpc_tagtree_t *tree;
+       int i;
+       int j;
+       int k;
+       int numlvls;
+       int n;
+
+       assert(numleafsh > 0 && numleafsv > 0);
+
+       if (!(tree = jpc_tagtree_alloc())) {
+               return 0;
+       }
+       tree->numleafsh_ = numleafsh;
+       tree->numleafsv_ = numleafsv;
+
+       numlvls = 0;
+       nplh[0] = numleafsh;
+       nplv[0] = numleafsv;
+       do {
+               n = nplh[numlvls] * nplv[numlvls];
+               nplh[numlvls + 1] = (nplh[numlvls] + 1) / 2;
+               nplv[numlvls + 1] = (nplv[numlvls] + 1) / 2;
+               tree->numnodes_ += n;
+               ++numlvls;
+       } while (n > 1);
+
+       if (!(tree->nodes_ = jas_malloc(tree->numnodes_ * sizeof(jpc_tagtreenode_t)))) {
+               return 0;
+       }
+
+       /* Initialize the parent links for all nodes in the tree. */
+
+       node = tree->nodes_;
+       parentnode = &tree->nodes_[tree->numleafsh_ * tree->numleafsv_];
+       parentnode0 = parentnode;
+
+       for (i = 0; i < numlvls - 1; ++i) {
+               for (j = 0; j < nplv[i]; ++j) {
+                       k = nplh[i];
+                       while (--k >= 0) {
+                               node->parent_ = parentnode;
+                               ++node;
+                               if (--k >= 0) {
+                                       node->parent_ = parentnode;
+                                       ++node;
+                               }
+                               ++parentnode;
+                       }
+                       if ((j & 1) || j == nplv[i] - 1) {
+                               parentnode0 = parentnode;
+                       } else {
+                               parentnode = parentnode0;
+                               parentnode0 += nplh[i];
+                       }
+               }
+       }
+       node->parent_ = 0;
+
+       /* Initialize the data values to something sane. */
+
+       jpc_tagtree_reset(tree);
+
+       return tree;
+}
+
+/* Destroy a tag tree. */
+
+void jpc_tagtree_destroy(jpc_tagtree_t *tree)
+{
+       if (tree->nodes_) {
+               jas_free(tree->nodes_);
+       }
+       jas_free(tree);
+}
+
+static jpc_tagtree_t *jpc_tagtree_alloc()
+{
+       jpc_tagtree_t *tree;
+
+       if (!(tree = jas_malloc(sizeof(jpc_tagtree_t)))) {
+               return 0;
+       }
+       tree->numleafsh_ = 0;
+       tree->numleafsv_ = 0;
+       tree->numnodes_ = 0;
+       tree->nodes_ = 0;
+
+       return tree;
+}
+
+/******************************************************************************\
+* Code.
+\******************************************************************************/
+
+/* Copy state information from one tag tree to another. */
+
+void jpc_tagtree_copy(jpc_tagtree_t *dsttree, jpc_tagtree_t *srctree)
+{
+       int n;
+       jpc_tagtreenode_t *srcnode;
+       jpc_tagtreenode_t *dstnode;
+
+       /* The two tag trees must have similar sizes. */
+       assert(srctree->numleafsh_ == dsttree->numleafsh_ &&
+         srctree->numleafsv_ == dsttree->numleafsv_);
+
+       n = srctree->numnodes_;
+       srcnode = srctree->nodes_;
+       dstnode = dsttree->nodes_;
+       while (--n >= 0) {
+               dstnode->value_ = srcnode->value_;
+               dstnode->low_ = srcnode->low_;
+               dstnode->known_ = srcnode->known_;
+               ++dstnode;
+               ++srcnode;
+       }
+}
+
+/* Reset all of the state information associated with a tag tree. */
+
+void jpc_tagtree_reset(jpc_tagtree_t *tree)
+{
+       int n;
+       jpc_tagtreenode_t *node;
+
+       n = tree->numnodes_;
+       node = tree->nodes_;
+
+       while (--n >= 0) {
+               node->value_ = INT_MAX;
+               node->low_ = 0;
+               node->known_ = 0;
+               ++node;
+       }
+}
+
+/* Set the value associated with the specified leaf node, updating
+the other nodes as necessary. */
+
+void jpc_tagtree_setvalue(jpc_tagtree_t *tree, jpc_tagtreenode_t *leaf,
+  int value)
+{
+       jpc_tagtreenode_t *node;
+
+       /* Avoid compiler warnings about unused parameters. */
+       tree = 0;
+
+       assert(value >= 0);
+
+       node = leaf;
+       while (node && node->value_ > value) {
+               node->value_ = value;
+               node = node->parent_;
+       }
+}
+
+/* Get a particular leaf node. */
+
+jpc_tagtreenode_t *jpc_tagtree_getleaf(jpc_tagtree_t *tree, int n)
+{
+       return &tree->nodes_[n];
+}
+
+/* Invoke the tag tree encoding procedure. */
+
+int jpc_tagtree_encode(jpc_tagtree_t *tree, jpc_tagtreenode_t *leaf,
+  int threshold, jpc_bitstream_t *out)
+{
+       jpc_tagtreenode_t *stk[JPC_TAGTREE_MAXDEPTH - 1];
+       jpc_tagtreenode_t **stkptr;
+       jpc_tagtreenode_t *node;
+       int low;
+
+       /* Avoid compiler warnings about unused parameters. */
+       tree = 0;
+
+       assert(leaf);
+       assert(threshold >= 0);
+
+       /* Traverse to the root of the tree, recording the path taken. */
+       stkptr = stk;
+       node = leaf;
+       while (node->parent_) {
+               *stkptr++ = node;
+               node = node->parent_;
+       }
+
+       low = 0;
+       for (;;) {
+               if (low > node->low_) {
+                       /* Deferred propagation of the lower bound downward in
+                         the tree. */
+                       node->low_ = low;
+               } else {
+                       low = node->low_;
+               }
+
+               while (low < threshold) {
+                       if (low >= node->value_) {
+                               if (!node->known_) {
+                                       if (jpc_bitstream_putbit(out, 1) == EOF) {
+                                               return -1;
+                                       }
+                                       node->known_ = 1;
+                               }
+                               break;
+                       }
+                       if (jpc_bitstream_putbit(out, 0) == EOF) {
+                               return -1;
+                       }
+                       ++low;
+               }
+               node->low_ = low;
+               if (stkptr == stk) {
+                       break;
+               }
+               node = *--stkptr;
+
+       }
+       return (leaf->low_ < threshold) ? 1 : 0;
+
+}
+
+/* Invoke the tag tree decoding procedure. */
+
+int jpc_tagtree_decode(jpc_tagtree_t *tree, jpc_tagtreenode_t *leaf,
+  int threshold, jpc_bitstream_t *in)
+{
+       jpc_tagtreenode_t *stk[JPC_TAGTREE_MAXDEPTH - 1];
+       jpc_tagtreenode_t **stkptr;
+       jpc_tagtreenode_t *node;
+       int low;
+       int ret;
+
+       /* Avoid compiler warnings about unused parameters. */
+       tree = 0;
+
+       assert(threshold >= 0);
+
+       /* Traverse to the root of the tree, recording the path taken. */
+       stkptr = stk;
+       node = leaf;
+       while (node->parent_) {
+               *stkptr++ = node;
+               node = node->parent_;
+       }
+
+       low = 0;
+       for (;;) {
+               if (low > node->low_) {
+                       node->low_ = low;
+               } else {
+                       low = node->low_;
+               }
+               while (low < threshold && low < node->value_) {
+                       if ((ret = jpc_bitstream_getbit(in)) < 0) {
+                               return -1;
+                       }
+                       if (ret) {
+                               node->value_ = low;
+                       } else {
+                               ++low;
+                       }
+               }
+               node->low_ = low;
+               if (stkptr == stk) {
+                       break;
+               }
+               node = *--stkptr;
+       }
+
+       return (node->value_ < threshold) ? 1 : 0;
+}
+
+/******************************************************************************\
+* Code for debugging.
+\******************************************************************************/
+
+void jpc_tagtree_dump(jpc_tagtree_t *tree, FILE *out)
+{
+       jpc_tagtreenode_t *node;
+       int n;
+
+       node = tree->nodes_;
+       n = tree->numnodes_;
+       while (--n >= 0) {
+               fprintf(out, "node %p, parent %p, value %d, lower %d, known %d\n",
+                 (void *) node, (void *) node->parent_, node->value_, node->low_,
+                 node->known_);
+               ++node;
+       }
+}
diff --git a/src/libjasper/jpc/jpc_tagtree.h b/src/libjasper/jpc/jpc_tagtree.h
new file mode 100644 (file)
index 0000000..52a75e2
--- /dev/null
@@ -0,0 +1,167 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Tag Tree Library
+ *
+ * $Id$
+ */
+
+#ifndef JPC_TAGTREE_H
+#define JPC_TAGTREE_H
+
+/******************************************************************************\
+* Includes
+\******************************************************************************/
+
+#include <limits.h>
+#include <stdio.h>
+
+#include "jpc_bs.h"
+
+/******************************************************************************\
+* Constants
+\******************************************************************************/
+
+/* The maximum allowable depth for a tag tree. */
+#define JPC_TAGTREE_MAXDEPTH   32
+
+/******************************************************************************\
+* Types
+\******************************************************************************/
+
+/*
+ * Tag tree node.
+ */
+
+typedef struct jpc_tagtreenode_ {
+
+       /* The parent of this node. */
+       struct jpc_tagtreenode_ *parent_;
+
+       /* The value associated with this node. */
+       int value_;
+
+       /* The lower bound on the value associated with this node. */
+       int low_;
+
+       /* A flag indicating if the value is known exactly. */
+       int known_;
+
+} jpc_tagtreenode_t;
+
+/*
+ * Tag tree.
+ */
+
+typedef struct {
+
+       /* The number of leaves in the horizontal direction. */
+       int numleafsh_;
+
+       /* The number of leaves in the vertical direction. */
+       int numleafsv_;
+
+       /* The total number of nodes in the tree. */
+       int numnodes_;
+
+       /* The nodes. */
+       jpc_tagtreenode_t *nodes_;
+
+} jpc_tagtree_t;
+
+/******************************************************************************\
+* Functions.
+\******************************************************************************/
+
+/* Create a tag tree. */
+jpc_tagtree_t *jpc_tagtree_create(int numleafsh, int numleafsv);
+
+/* Destroy a tag tree. */
+void jpc_tagtree_destroy(jpc_tagtree_t *tree);
+
+/* Copy data from one tag tree to another. */
+void jpc_tagtree_copy(jpc_tagtree_t *dsttree, jpc_tagtree_t *srctree);
+
+/* Reset the tag tree state. */
+void jpc_tagtree_reset(jpc_tagtree_t *tree);
+
+/* Set the value associated with a particular leaf node of a tag tree. */
+void jpc_tagtree_setvalue(jpc_tagtree_t *tree, jpc_tagtreenode_t *leaf,
+  int value);
+
+/* Get a pointer to a particular leaf node. */
+jpc_tagtreenode_t *jpc_tagtree_getleaf(jpc_tagtree_t *tree, int n);
+
+/* Invoke the tag tree decoding procedure. */
+int jpc_tagtree_decode(jpc_tagtree_t *tree, jpc_tagtreenode_t *leaf,
+  int threshold, jpc_bitstream_t *in);
+
+/* Invoke the tag tree encoding procedure. */
+int jpc_tagtree_encode(jpc_tagtree_t *tree, jpc_tagtreenode_t *leaf,
+  int threshold, jpc_bitstream_t *out);
+
+/* Dump a tag tree (for debugging purposes). */
+void jpc_tagtree_dump(jpc_tagtree_t *tree, FILE *out);
+
+#endif
diff --git a/src/libjasper/jpc/jpc_tsfb.c b/src/libjasper/jpc/jpc_tsfb.c
new file mode 100644 (file)
index 0000000..7aa293f
--- /dev/null
@@ -0,0 +1,288 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2004 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Tree-Structured Filter Bank (TSFB) Library
+ *
+ * $Id$
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <assert.h>
+
+#include "jasper/jas_malloc.h"
+#include "jasper/jas_seq.h"
+
+#include "jpc_tsfb.h"
+#include "jpc_cod.h"
+#include "jpc_cs.h"
+#include "jpc_util.h"
+#include "jpc_math.h"
+
+void jpc_tsfb_getbands2(jpc_tsfb_t *tsfb, int locxstart, int locystart,
+  int xstart, int ystart, int xend, int yend, jpc_tsfb_band_t **bands,
+  int numlvls);
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+jpc_tsfb_t *jpc_cod_gettsfb(int qmfbid, int numlvls)
+{
+       jpc_tsfb_t *tsfb;
+
+       if (!(tsfb = malloc(sizeof(jpc_tsfb_t))))
+               return 0;
+
+       if (numlvls > 0) {
+               switch (qmfbid) {
+               case JPC_COX_INS:
+                       tsfb->qmfb = &jpc_ns_qmfb2d;
+                       break;
+               default:
+               case JPC_COX_RFT:
+                       tsfb->qmfb = &jpc_ft_qmfb2d;
+                       break;
+               }
+       } else {
+               tsfb->qmfb = 0;
+       }
+       tsfb->numlvls = numlvls;
+       return tsfb;
+}
+
+void jpc_tsfb_destroy(jpc_tsfb_t *tsfb)
+{
+       free(tsfb);
+}
+
+int jpc_tsfb_analyze(jpc_tsfb_t *tsfb, jas_seq2d_t *a)
+{
+       return (tsfb->numlvls > 0) ? jpc_tsfb_analyze2(tsfb, jas_seq2d_getref(a,
+         jas_seq2d_xstart(a), jas_seq2d_ystart(a)), jas_seq2d_xstart(a),
+         jas_seq2d_ystart(a), jas_seq2d_width(a),
+         jas_seq2d_height(a), jas_seq2d_rowstep(a), tsfb->numlvls - 1) : 0;
+}
+
+int jpc_tsfb_analyze2(jpc_tsfb_t *tsfb, int *a, int xstart, int ystart,
+  int width, int height, int stride, int numlvls)
+{
+       if (width > 0 && height > 0) {
+               if ((*tsfb->qmfb->analyze)(a, xstart, ystart, width, height, stride))
+                       return -1;
+               if (numlvls > 0) {
+                       if (jpc_tsfb_analyze2(tsfb, a, JPC_CEILDIVPOW2(xstart,
+                         1), JPC_CEILDIVPOW2(ystart, 1), JPC_CEILDIVPOW2(
+                         xstart + width, 1) - JPC_CEILDIVPOW2(xstart, 1),
+                         JPC_CEILDIVPOW2(ystart + height, 1) -
+                         JPC_CEILDIVPOW2(ystart, 1), stride, numlvls - 1)) {
+                               return -1;
+                       }
+               }
+       }
+       return 0;
+}
+
+int jpc_tsfb_synthesize(jpc_tsfb_t *tsfb, jas_seq2d_t *a)
+{
+       return (tsfb->numlvls > 0) ? jpc_tsfb_synthesize2(tsfb,
+         jas_seq2d_getref(a, jas_seq2d_xstart(a), jas_seq2d_ystart(a)),
+         jas_seq2d_xstart(a), jas_seq2d_ystart(a), jas_seq2d_width(a),
+         jas_seq2d_height(a), jas_seq2d_rowstep(a), tsfb->numlvls - 1) : 0;
+}
+
+int jpc_tsfb_synthesize2(jpc_tsfb_t *tsfb, int *a, int xstart, int ystart,
+  int width, int height, int stride, int numlvls)
+{
+       if (numlvls > 0) {
+               if (jpc_tsfb_synthesize2(tsfb, a, JPC_CEILDIVPOW2(xstart, 1),
+                 JPC_CEILDIVPOW2(ystart, 1), JPC_CEILDIVPOW2(xstart + width,
+                 1) - JPC_CEILDIVPOW2(xstart, 1), JPC_CEILDIVPOW2(ystart +
+                 height, 1) - JPC_CEILDIVPOW2(ystart, 1), stride, numlvls -
+                 1)) {
+                       return -1;
+               }
+       }
+       if (width > 0 && height > 0) {
+               if ((*tsfb->qmfb->synthesize)(a, xstart, ystart, width, height, stride)) {
+                       return -1;
+               }
+       }
+       return 0;
+}
+
+int jpc_tsfb_getbands(jpc_tsfb_t *tsfb, uint_fast32_t xstart,
+  uint_fast32_t ystart, uint_fast32_t xend, uint_fast32_t yend,
+  jpc_tsfb_band_t *bands)
+{
+       jpc_tsfb_band_t *band;
+
+       band = bands;
+       if (tsfb->numlvls > 0) {
+               jpc_tsfb_getbands2(tsfb, xstart, ystart, xstart, ystart, xend, yend,
+                 &band, tsfb->numlvls);
+       } else {
+
+               band->xstart = xstart;
+               band->ystart = ystart;
+               band->xend = xend;
+               band->yend = yend;
+               band->locxstart = xstart;
+               band->locystart = ystart;
+               band->locxend = band->locxstart + band->xend - band->xstart;
+               band->locyend = band->locystart + band->yend - band->ystart;
+               band->orient = JPC_TSFB_LL;
+               band->synenergywt = JPC_FIX_ONE;
+               ++band;
+       }
+       return band - bands;
+}
+
+void jpc_tsfb_getbands2(jpc_tsfb_t *tsfb, int locxstart, int locystart,
+  int xstart, int ystart, int xend, int yend, jpc_tsfb_band_t **bands,
+  int numlvls)
+{
+       int newxstart;
+       int newystart;
+       int newxend;
+       int newyend;
+       jpc_tsfb_band_t *band;
+
+       newxstart = JPC_CEILDIVPOW2(xstart, 1);
+       newystart = JPC_CEILDIVPOW2(ystart, 1);
+       newxend = JPC_CEILDIVPOW2(xend, 1);
+       newyend = JPC_CEILDIVPOW2(yend, 1);
+
+       if (numlvls > 0) {
+
+               jpc_tsfb_getbands2(tsfb, locxstart, locystart, newxstart, newystart,
+                 newxend, newyend, bands, numlvls - 1);
+
+               band = *bands;
+               band->xstart = JPC_FLOORDIVPOW2(xstart, 1);
+               band->ystart = newystart;
+               band->xend = JPC_FLOORDIVPOW2(xend, 1);
+               band->yend = newyend;
+               band->locxstart = locxstart + newxend - newxstart;
+               band->locystart = locystart;
+               band->locxend = band->locxstart + band->xend - band->xstart;
+               band->locyend = band->locystart + band->yend - band->ystart;
+               band->orient = JPC_TSFB_HL;
+               band->synenergywt = jpc_dbltofix(tsfb->qmfb->hpenergywts[
+                 tsfb->numlvls - numlvls] * tsfb->qmfb->lpenergywts[
+                 tsfb->numlvls - numlvls]);
+               ++(*bands);
+
+               band = *bands;
+               band->xstart = newxstart;
+               band->ystart = JPC_FLOORDIVPOW2(ystart, 1);
+               band->xend = newxend;
+               band->yend = JPC_FLOORDIVPOW2(yend, 1);
+               band->locxstart = locxstart;
+               band->locystart = locystart + newyend - newystart;
+               band->locxend = band->locxstart + band->xend - band->xstart;
+               band->locyend = band->locystart + band->yend - band->ystart;
+               band->orient = JPC_TSFB_LH;
+               band->synenergywt = jpc_dbltofix(tsfb->qmfb->lpenergywts[
+                 tsfb->numlvls - numlvls] * tsfb->qmfb->hpenergywts[
+                 tsfb->numlvls - numlvls]);
+               ++(*bands);
+
+               band = *bands;
+               band->xstart = JPC_FLOORDIVPOW2(xstart, 1);
+               band->ystart = JPC_FLOORDIVPOW2(ystart, 1);
+               band->xend = JPC_FLOORDIVPOW2(xend, 1);
+               band->yend = JPC_FLOORDIVPOW2(yend, 1);
+               band->locxstart = locxstart + newxend - newxstart;
+               band->locystart = locystart + newyend - newystart;
+               band->locxend = band->locxstart + band->xend - band->xstart;
+               band->locyend = band->locystart + band->yend - band->ystart;
+               band->orient = JPC_TSFB_HH;
+               band->synenergywt = jpc_dbltofix(tsfb->qmfb->hpenergywts[
+                 tsfb->numlvls - numlvls] * tsfb->qmfb->hpenergywts[
+                 tsfb->numlvls - numlvls]);
+               ++(*bands);
+
+       } else {
+
+               band = *bands;
+               band->xstart = xstart;
+               band->ystart = ystart;
+               band->xend = xend;
+               band->yend = yend;
+               band->locxstart = locxstart;
+               band->locystart = locystart;
+               band->locxend = band->locxstart + band->xend - band->xstart;
+               band->locyend = band->locystart + band->yend - band->ystart;
+               band->orient = JPC_TSFB_LL;
+               band->synenergywt = jpc_dbltofix(tsfb->qmfb->lpenergywts[
+                 tsfb->numlvls - numlvls - 1] * tsfb->qmfb->lpenergywts[
+                 tsfb->numlvls - numlvls - 1]);
+               ++(*bands);
+
+       }
+
+}
diff --git a/src/libjasper/jpc/jpc_tsfb.h b/src/libjasper/jpc/jpc_tsfb.h
new file mode 100644 (file)
index 0000000..1bf9736
--- /dev/null
@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2004 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Tree-Structured Filter Bank (TSFB) Library
+ *
+ * $Id$
+ */
+
+#ifndef JPC_TSFB_H
+#define JPC_TSFB_H
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include "jasper/jas_seq.h"
+
+#include "jpc_fix.h"
+#include "jpc_qmfb.h"
+
+/******************************************************************************\
+* Constants.
+\******************************************************************************/
+
+#define        JPC_TSFB_MAXBANDS       (JPC_TSFB_MAXDEPTH * 3 + 1)
+#define        JPC_TSFB_MAXDEPTH       32
+#define        JPC_TSFB_RITIMODE       JPC_QMFB1D_RITIMODE
+
+#define JPC_TSFB_LL    0
+#define JPC_TSFB_LH    1
+#define JPC_TSFB_HL    2
+#define JPC_TSFB_HH    3
+
+/******************************************************************************\
+* Types.
+\******************************************************************************/
+
+typedef struct {
+       int xstart;
+       int ystart;
+       int xend;
+       int yend;
+       int orient;
+       int locxstart;
+       int locystart;
+       int locxend;
+       int locyend;
+       jpc_fix_t synenergywt;
+} jpc_tsfb_band_t;
+
+typedef struct {
+       int numlvls;
+       jpc_qmfb2d_t *qmfb;
+} jpc_tsfb_t;
+
+/******************************************************************************\
+* Functions.
+\******************************************************************************/
+
+/* Create a TSFB. */
+jpc_tsfb_t *jpc_cod_gettsfb(int qmfbid, int numlevels);
+
+/* Destroy a TSFB. */
+void jpc_tsfb_destroy(jpc_tsfb_t *tsfb);
+
+/* Perform analysis. */
+int jpc_tsfb_analyze(jpc_tsfb_t *tsfb, jas_seq2d_t *x);
+
+/* Perform synthesis. */
+int jpc_tsfb_synthesize(jpc_tsfb_t *tsfb, jas_seq2d_t *x);
+
+/* Get band information for a TSFB. */
+int jpc_tsfb_getbands(jpc_tsfb_t *tsfb, uint_fast32_t xstart,
+  uint_fast32_t ystart, uint_fast32_t xend, uint_fast32_t yend,
+  jpc_tsfb_band_t *bands);
+
+#endif
diff --git a/src/libjasper/jpc/jpc_util.c b/src/libjasper/jpc/jpc_util.c
new file mode 100644 (file)
index 0000000..f53e248
--- /dev/null
@@ -0,0 +1,194 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * $Id$
+ */
+
+/******************************************************************************\
+* Includes
+\******************************************************************************/
+
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+#include <math.h>
+#include <stdlib.h>
+#include <stdarg.h>
+
+#include "jasper/jas_math.h"
+#include "jasper/jas_malloc.h"
+
+#include "jpc_fix.h"
+#include "jpc_cs.h"
+#include "jpc_flt.h"
+#include "jpc_util.h"
+
+/******************************************************************************\
+* Miscellaneous Functions
+\******************************************************************************/
+
+int jpc_atoaf(char *s, int *numvalues, double **values)
+{
+       static char delim[] = ", \t\n";
+       char buf[4096];
+       int n;
+       double *vs;
+       char *cp;
+
+       strncpy(buf, s, sizeof(buf));
+       buf[sizeof(buf) - 1] = '\0';
+       n = 0;
+       if ((cp = strtok(buf, delim))) {
+               ++n;
+               while ((cp = strtok(0, delim))) {
+                       if (cp != '\0') {
+                               ++n;
+                       }
+               }
+       }
+
+       if (n) {
+               if (!(vs = jas_malloc(n * sizeof(double)))) {
+                       return -1;
+               }
+
+               strncpy(buf, s, sizeof(buf));
+               buf[sizeof(buf) - 1] = '\0';
+               n = 0;
+               if ((cp = strtok(buf, delim))) {
+                       vs[n] = atof(cp);
+                       ++n;
+                       while ((cp = strtok(0, delim))) {
+                               if (cp != '\0') {
+                                       vs[n] = atof(cp);
+                                       ++n;
+                               }
+                       }
+               }
+       } else {
+               vs = 0;
+       }
+
+       *numvalues = n;
+       *values = vs;
+
+       return 0;
+}
+
+jas_seq_t *jpc_seq_upsample(jas_seq_t *x, int m)
+{
+       jas_seq_t *z;
+       int i;
+
+       if (!(z = jas_seq_create(jas_seq_start(x) * m, (jas_seq_end(x) - 1) * m + 1)))
+               return 0;
+       for (i = jas_seq_start(z); i < jas_seq_end(z); i++) {
+               *jas_seq_getref(z, i) = (!JAS_MOD(i, m)) ? jas_seq_get(x, i / m) :
+                 jpc_inttofix(0);
+       }
+
+       return z;
+}
+
+jpc_fix_t jpc_seq_norm(jas_seq_t *x)
+{
+       jpc_fix_t s;
+       int i;
+
+       s = jpc_inttofix(0);
+       for (i = jas_seq_start(x); i < jas_seq_end(x); i++) {
+               s = jpc_fix_add(s, jpc_fix_mul(jas_seq_get(x, i), jas_seq_get(x, i)));
+       }
+
+       return jpc_dbltofix(sqrt(jpc_fixtodbl(s)));
+}
+
+jas_seq_t *jpc_seq_conv(jas_seq_t *x, jas_seq_t *y)
+{
+       int i;
+       int j;
+       int k;
+       jas_seq_t *z;
+       jpc_fix_t s;
+       jpc_fix_t v;
+
+       z = jas_seq_create(jas_seq_start(x) + jas_seq_start(y),
+         jas_seq_end(x) + jas_seq_end(y) - 1);
+       assert(z);
+       for (i = jas_seq_start(z); i < jas_seq_end(z); i++) {
+               s = jpc_inttofix(0);
+               for (j = jas_seq_start(y); j < jas_seq_end(y); j++) {
+                       k = i - j;
+                       if (k < jas_seq_start(x) || k >= jas_seq_end(x)) {
+                               v = JPC_FIX_ZERO;
+                       } else {
+                               v = jas_seq_get(x, k);
+                       }
+                       s = jpc_fix_add(s, jpc_fix_mul(jas_seq_get(y, j), v));
+               }
+               *jas_seq_getref(z, i) = s;
+       }
+
+       return z;
+}
diff --git a/src/libjasper/jpc/jpc_util.h b/src/libjasper/jpc/jpc_util.h
new file mode 100644 (file)
index 0000000..526312a
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+#ifndef JPC_UTIL_H
+#define JPC_UTIL_H
+
+/* Parse a comma separated list of real numbers into an array of doubles. */
+int jpc_atoaf(char *s, int *numvalues, double **values);
+
+/* Upsample a sequence. */
+jas_seq_t *jpc_seq_upsample(jas_seq_t *seq, int n);
+
+/* Convolve two sequences. */
+jas_seq_t *jpc_seq_conv(jas_seq_t *seq0, jas_seq_t *seq1);
+
+/* Compute the norm of a sequence. */
+jpc_fix_t jpc_seq_norm(jas_seq_t *x);
+
+#endif
diff --git a/src/libjasper/jpg/Makefile.am b/src/libjasper/jpg/Makefile.am
new file mode 100644 (file)
index 0000000..b6dd646
--- /dev/null
@@ -0,0 +1,79 @@
+# Copyright (c) 2001-2002 Michael David Adams.
+# All rights reserved. 
+
+# __START_OF_JASPER_LICENSE__
+# 
+# JasPer License Version 2.0
+# 
+# Copyright (c) 2001-2006 Michael David Adams
+# Copyright (c) 1999-2000 Image Power, Inc.
+# Copyright (c) 1999-2000 The University of British Columbia
+# 
+# All rights reserved.
+# 
+# Permission is hereby granted, free of charge, to any person (the
+# "User") obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the
+# following conditions:
+# 
+# 1.  The above copyright notices and this permission notice (which
+# includes the disclaimer below) shall be included in all copies or
+# substantial portions of the Software.
+# 
+# 2.  The name of a copyright holder shall not be used to endorse or
+# promote products derived from the Software without specific prior
+# written permission.
+# 
+# THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+# LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+# THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+# "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+# PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+# EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+# PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+# THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+# EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+# BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+# PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+# GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+# ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+# IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+# SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+# AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+# SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+# THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+# PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+# RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+# EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+# 
+# __END_OF_JASPER_LICENSE__
+
+EXTRA_DIST = README
+
+if HAVE_LIBJPEG
+MISCSOURCES = jpg_dec.c jpg_enc.c
+else
+MISCSOURCES = jpg_dummy.c
+endif
+
+noinst_LTLIBRARIES = libjpg.la
+libjpg_la_SOURCES = \
+       jpg_cod.h \
+       jpg_enc.h \
+       jpg_jpeglib.h \
+       $(MISCSOURCES) \
+       jpg_val.c
+EXTRA_libjpg_la_SOURCES = \
+       jpg_dec.c \
+       jpg_enc.c \
+       jpg_dummy.c
+
+INCLUDES = -I$(top_srcdir)/src/libjasper/include
diff --git a/src/libjasper/jpg/Makefile.in b/src/libjasper/jpg/Makefile.in
new file mode 100644 (file)
index 0000000..d688eaf
--- /dev/null
@@ -0,0 +1,524 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# Copyright (c) 2001-2002 Michael David Adams.
+# All rights reserved. 
+
+# __START_OF_JASPER_LICENSE__
+# 
+# JasPer License Version 2.0
+# 
+# Copyright (c) 2001-2006 Michael David Adams
+# Copyright (c) 1999-2000 Image Power, Inc.
+# Copyright (c) 1999-2000 The University of British Columbia
+# 
+# All rights reserved.
+# 
+# Permission is hereby granted, free of charge, to any person (the
+# "User") obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the
+# following conditions:
+# 
+# 1.  The above copyright notices and this permission notice (which
+# includes the disclaimer below) shall be included in all copies or
+# substantial portions of the Software.
+# 
+# 2.  The name of a copyright holder shall not be used to endorse or
+# promote products derived from the Software without specific prior
+# written permission.
+# 
+# THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+# LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+# THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+# "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+# PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+# EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+# PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+# THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+# EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+# BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+# PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+# GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+# ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+# IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+# SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+# AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+# SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+# THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+# PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+# RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+# EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+# 
+# __END_OF_JASPER_LICENSE__
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = src/libjasper/jpg
+DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/acaux/mkinstalldirs
+CONFIG_HEADER =  \
+       $(top_builddir)/src/libjasper/include/jasper/jas_config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libjpg_la_LIBADD =
+am__libjpg_la_SOURCES_DIST = jpg_cod.h jpg_enc.h jpg_jpeglib.h \
+       jpg_dummy.c jpg_dec.c jpg_enc.c jpg_val.c
+@HAVE_LIBJPEG_FALSE@am__objects_1 = jpg_dummy.lo
+@HAVE_LIBJPEG_TRUE@am__objects_1 = jpg_dec.lo jpg_enc.lo
+am_libjpg_la_OBJECTS = $(am__objects_1) jpg_val.lo
+libjpg_la_OBJECTS = $(am_libjpg_la_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/libjasper/include/jasper
+depcomp = $(SHELL) $(top_srcdir)/acaux/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+       $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libjpg_la_SOURCES) $(EXTRA_libjpg_la_SOURCES)
+DIST_SOURCES = $(am__libjpg_la_SOURCES_DIST) \
+       $(EXTRA_libjpg_la_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+HAVE_LIBJPEG_FALSE = @HAVE_LIBJPEG_FALSE@
+HAVE_LIBJPEG_TRUE = @HAVE_LIBJPEG_TRUE@
+HAVE_OPENGL_FALSE = @HAVE_OPENGL_FALSE@
+HAVE_OPENGL_TRUE = @HAVE_OPENGL_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAS_MAJOR_VERSION = @JAS_MAJOR_VERSION@
+JAS_MICRO_VERSION = @JAS_MICRO_VERSION@
+JAS_MINOR_VERSION = @JAS_MINOR_VERSION@
+JAS_RPM_RELEASE = @JAS_RPM_RELEASE@
+JAS_VERSION = @JAS_VERSION@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_AGE = @LT_AGE@
+LT_CURRENT = @LT_CURRENT@
+LT_RELEASE = @LT_RELEASE@
+LT_REVISION = @LT_REVISION@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OPENGL_LIBS = @OPENGL_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+EXTRA_DIST = README
+@HAVE_LIBJPEG_FALSE@MISCSOURCES = jpg_dummy.c
+@HAVE_LIBJPEG_TRUE@MISCSOURCES = jpg_dec.c jpg_enc.c
+noinst_LTLIBRARIES = libjpg.la
+libjpg_la_SOURCES = \
+       jpg_cod.h \
+       jpg_enc.h \
+       jpg_jpeglib.h \
+       $(MISCSOURCES) \
+       jpg_val.c
+
+EXTRA_libjpg_la_SOURCES = \
+       jpg_dec.c \
+       jpg_enc.c \
+       jpg_dummy.c
+
+INCLUDES = -I$(top_srcdir)/src/libjasper/include
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/libjasper/jpg/Makefile'; \
+       cd $(top_srcdir) && \
+         $(AUTOMAKE) --foreign  src/libjasper/jpg/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+       -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+       @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+         test "$$dir" != "$$p" || dir=.; \
+         echo "rm -f \"$${dir}/so_locations\""; \
+         rm -f "$${dir}/so_locations"; \
+       done
+libjpg.la: $(libjpg_la_OBJECTS) $(libjpg_la_DEPENDENCIES) 
+       $(LINK)  $(libjpg_la_LDFLAGS) $(libjpg_la_OBJECTS) $(libjpg_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpg_dec.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpg_dummy.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpg_enc.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpg_val.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+
+distclean-libtool:
+       -rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+           $$tags $$unique; \
+       fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       test -z "$(CTAGS_ARGS)$$tags$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$tags $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && cd $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+       list='$(DISTFILES)'; for file in $$list; do \
+         case $$file in \
+           $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+           $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+         esac; \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+         if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+           dir="/$$dir"; \
+           $(mkdir_p) "$(distdir)$$dir"; \
+         else \
+           dir=''; \
+         fi; \
+         if test -d $$d/$$file; then \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+           fi; \
+           cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+         else \
+           test -f $(distdir)/$$file \
+           || cp -p $$d/$$file $(distdir)/$$file \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+         `test -z '$(STRIP)' || \
+           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+       mostlyclean-am
+
+distclean: distclean-am
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+       clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+       distclean-compile distclean-generic distclean-libtool \
+       distclean-tags distdir dvi dvi-am html html-am info info-am \
+       install install-am install-data install-data-am install-exec \
+       install-exec-am install-info install-info-am install-man \
+       install-strip installcheck installcheck-am installdirs \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+       pdf pdf-am ps ps-am tags uninstall uninstall-am \
+       uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/libjasper/jpg/README b/src/libjasper/jpg/README
new file mode 100644 (file)
index 0000000..00ff0ff
--- /dev/null
@@ -0,0 +1,6 @@
+This directory contains code to support the JPEG image format.  In order
+for the code in this directory to be useful, the free JPEG library from
+the Independent JPEG Group (IJG) is needed.  For legal reasons, the
+IJG JPEG software is not included in the JasPer software distribution.
+The IJG JPEG software can be obtained, however, from:
+    http://www.ijg.org
diff --git a/src/libjasper/jpg/jpg_cod.h b/src/libjasper/jpg/jpg_cod.h
new file mode 100644 (file)
index 0000000..a25eccc
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * JPG Format Library
+ *
+ * $Id$
+ */
+
+#ifndef JPG_COD_H
+#define JPG_COD_H
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+/******************************************************************************\
+* Constants.
+\******************************************************************************/
+
+#define        JPG_MAGIC       0xffd8
+#define JPG_MAGICLEN 2
+
+#endif
diff --git a/src/libjasper/jpg/jpg_dec.c b/src/libjasper/jpg/jpg_dec.c
new file mode 100644 (file)
index 0000000..659accd
--- /dev/null
@@ -0,0 +1,340 @@
+/*
+ * Copyright (c) 2001-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <stdio.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "jasper/jas_tvp.h"
+#include "jasper/jas_stream.h"
+#include "jasper/jas_image.h"
+#include "jasper/jas_string.h"
+
+#include "jpg_jpeglib.h"
+#include "jpg_cod.h"
+
+/******************************************************************************\
+* Types.
+\******************************************************************************/
+
+/* JPEG decoder data sink type. */
+
+typedef struct jpg_dest_s {
+
+       /* Initialize output. */
+       void (*start_output)(j_decompress_ptr cinfo, struct jpg_dest_s *dinfo);
+
+       /* Output rows of decompressed data. */
+       void (*put_pixel_rows)(j_decompress_ptr cinfo, struct jpg_dest_s *dinfo,
+         JDIMENSION rows_supplied);
+
+       /* Cleanup output. */
+       void (*finish_output)(j_decompress_ptr cinfo, struct jpg_dest_s *dinfo);
+
+       /* Output buffer. */
+       JSAMPARRAY buffer;
+
+       /* Height of output buffer. */
+       JDIMENSION buffer_height;
+
+       /* The current row. */
+       JDIMENSION row;
+
+       /* The image used to hold the decompressed sample data. */
+       jas_image_t *image;
+
+       /* The row buffer. */
+       jas_matrix_t *data;
+
+       /* The error indicator.  If this is nonzero, something has gone wrong
+         during decompression. */
+       int error;
+
+} jpg_dest_t;
+
+/******************************************************************************\
+* Local functions.
+\******************************************************************************/
+
+static void jpg_start_output(j_decompress_ptr cinfo, jpg_dest_t *dinfo);
+static void jpg_put_pixel_rows(j_decompress_ptr cinfo, jpg_dest_t *dinfo,
+  JDIMENSION rows_supplied);
+static void jpg_finish_output(j_decompress_ptr cinfo, jpg_dest_t *dinfo);
+static int jpg_copystreamtofile(FILE *out, jas_stream_t *in);
+static jas_image_t *jpg_mkimage(j_decompress_ptr cinfo);
+
+/******************************************************************************\
+* Code for load operation.
+\******************************************************************************/
+
+/* Load an image from a stream in the JPG format. */
+
+jas_image_t *jpg_decode(jas_stream_t *in, char *optstr)
+{
+       struct jpeg_decompress_struct cinfo;
+       struct jpeg_error_mgr jerr;
+       FILE *input_file;
+       jpg_dest_t dest_mgr_buf;
+       jpg_dest_t *dest_mgr = &dest_mgr_buf;
+       int num_scanlines;
+       jas_image_t *image;
+
+       /* Avoid compiler warnings about unused parameters. */
+       optstr = 0;
+
+       image = 0;
+       input_file = 0;
+       if (!(input_file = tmpfile())) {
+               goto error;
+       }
+       if (jpg_copystreamtofile(input_file, in)) {
+               goto error;
+       }
+       rewind(input_file);
+
+       /* Allocate and initialize a JPEG decompression object. */
+       cinfo.err = jpeg_std_error(&jerr);
+       jpeg_create_decompress(&cinfo);
+
+       /* Specify the data source for decompression. */
+       jpeg_stdio_src(&cinfo, input_file);
+
+       /* Read the file header to obtain the image information. */
+       jpeg_read_header(&cinfo, TRUE);
+
+       /* Start the decompressor. */
+       jpeg_start_decompress(&cinfo);
+
+       /* Create an image object to hold the decoded data. */
+       if (!(image = jpg_mkimage(&cinfo))) {
+               goto error;
+       }
+
+       /* Initialize the data sink object. */
+       dest_mgr->image = image;
+       dest_mgr->data = jas_matrix_create(1, cinfo.output_width);
+       dest_mgr->start_output = jpg_start_output;
+       dest_mgr->put_pixel_rows = jpg_put_pixel_rows;
+       dest_mgr->finish_output = jpg_finish_output;
+    dest_mgr->buffer = (*cinfo.mem->alloc_sarray)
+      ((j_common_ptr) &cinfo, JPOOL_IMAGE,
+       cinfo.output_width * cinfo.output_components, (JDIMENSION) 1);
+       dest_mgr->buffer_height = 1;
+       dest_mgr->error = 0;
+
+       /* Process the compressed data. */
+       (*dest_mgr->start_output)(&cinfo, dest_mgr);
+       while (cinfo.output_scanline < cinfo.output_height) {
+               num_scanlines = jpeg_read_scanlines(&cinfo, dest_mgr->buffer,
+                 dest_mgr->buffer_height);
+               (*dest_mgr->put_pixel_rows)(&cinfo, dest_mgr, num_scanlines);
+       }
+       (*dest_mgr->finish_output)(&cinfo, dest_mgr);
+
+       /* Complete the decompression process. */
+       jpeg_finish_decompress(&cinfo);
+
+       /* Destroy the JPEG decompression object. */
+       jpeg_destroy_decompress(&cinfo);
+
+       jas_matrix_destroy(dest_mgr->data);
+
+       fclose(input_file);
+
+       if (dest_mgr->error) {
+               goto error;
+       }
+
+       return image;
+
+error:
+       if (image) {
+               jas_image_destroy(image);
+       }
+       if (input_file) {
+               fclose(input_file);
+       }
+       return 0;
+}
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+static jas_image_t *jpg_mkimage(j_decompress_ptr cinfo)
+{
+       jas_image_t *image;
+       int cmptno;
+       jas_image_cmptparm_t cmptparm;
+       int numcmpts;
+
+       image = 0;
+       numcmpts = cinfo->output_components;
+       if (!(image = jas_image_create0())) {
+               goto error;
+       }
+       for (cmptno = 0; cmptno < numcmpts; ++cmptno) {
+               cmptparm.tlx = 0;
+               cmptparm.tly = 0;
+               cmptparm.hstep = 1;
+               cmptparm.vstep = 1;
+               cmptparm.width = cinfo->image_width;
+               cmptparm.height = cinfo->image_height;
+               cmptparm.prec = 8;
+               cmptparm.sgnd = false;
+               if (jas_image_addcmpt(image, cmptno, &cmptparm)) {
+                       goto error;
+               }
+       }
+
+       if (numcmpts == 3) {
+               jas_image_setclrspc(image, JAS_CLRSPC_SRGB);
+               jas_image_setcmpttype(image, 0,
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_R));
+               jas_image_setcmpttype(image, 1,
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_G));
+               jas_image_setcmpttype(image, 2,
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_B));
+       } else {
+               jas_image_setclrspc(image, JAS_CLRSPC_SGRAY);
+               jas_image_setcmpttype(image, 0,
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_GRAY_Y));
+       }
+
+       return image;
+
+error:
+       if (image) {
+               jas_image_destroy(image);
+       }
+       return 0;
+}
+
+/******************************************************************************\
+* Data source code.
+\******************************************************************************/
+
+static int jpg_copystreamtofile(FILE *out, jas_stream_t *in)
+{
+       int c;
+
+       while ((c = jas_stream_getc(in)) != EOF) {
+               if (fputc(c, out) == EOF) {
+                       return -1;
+               }
+       }
+       if (jas_stream_error(in)) {
+               return -1;
+       }
+       return 0;
+}
+
+/******************************************************************************\
+* Data sink code.
+\******************************************************************************/
+
+static void jpg_start_output(j_decompress_ptr cinfo, jpg_dest_t *dinfo)
+{
+       /* Avoid compiler warnings about unused parameters. */
+       cinfo = 0;
+
+       dinfo->row = 0;
+}
+
+static void jpg_put_pixel_rows(j_decompress_ptr cinfo, jpg_dest_t *dinfo,
+  JDIMENSION rows_supplied)
+{
+       JSAMPLE *bufptr;
+       int cmptno;
+       JDIMENSION x;
+       uint_fast32_t width;
+
+       if (dinfo->error) {
+               return;
+       }
+
+       assert(cinfo->output_components == jas_image_numcmpts(dinfo->image));
+
+       for (cmptno = 0; cmptno < cinfo->output_components; ++cmptno) {
+               width = jas_image_cmptwidth(dinfo->image, cmptno);
+               bufptr = (dinfo->buffer[0]) + cmptno;
+               for (x = 0; x < width; ++x) {
+                       jas_matrix_set(dinfo->data, 0, x, GETJSAMPLE(*bufptr));
+                       bufptr += cinfo->output_components;
+               }
+               if (jas_image_writecmpt(dinfo->image, cmptno, 0, dinfo->row, width, 1,
+                 dinfo->data)) {
+                       dinfo->error = 1;
+               }
+       }
+       dinfo->row += rows_supplied;
+}
+
+static void jpg_finish_output(j_decompress_ptr cinfo, jpg_dest_t *dinfo)
+{
+       /* Avoid compiler warnings about unused parameters. */
+       cinfo = 0;
+       dinfo = 0;
+}
diff --git a/src/libjasper/jpg/jpg_dummy.c b/src/libjasper/jpg/jpg_dummy.c
new file mode 100644 (file)
index 0000000..db70fca
--- /dev/null
@@ -0,0 +1,109 @@
+/*
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <assert.h>
+
+#include "jasper/jas_tvp.h"
+#include "jasper/jas_stream.h"
+#include "jasper/jas_image.h"
+#include "jasper/jas_string.h"
+
+#include "jpg_cod.h"
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+#define        JPG_IJGINFO \
+       "The source code for the IJG JPEG library can be downloaded from:\n" \
+       "    http://www.ijg.org\n"
+
+/******************************************************************************\
+* Code for load operation.
+\******************************************************************************/
+
+/* Load an image from a stream in the JPG format. */
+
+jas_image_t *jpg_decode(jas_stream_t *in, char *optstr)
+{
+       jas_eprintf("error: JPEG decoder not available\n");
+       jas_eprintf("The IJG JPEG library is required for JPEG decoding support.\n");
+       jas_eprintf("%s", JPG_IJGINFO);
+       return 0;
+}
+
+/******************************************************************************\
+* Code for save operation.
+\******************************************************************************/
+
+/* Save an image to a stream in the the JPG format. */
+
+int jpg_encode(jas_image_t *image, jas_stream_t *out, char *optstr)
+{
+       jas_eprintf("error: JPEG encoder not available\n");
+       jas_eprintf("The IJG JPEG library is required for JPEG encoding support.\n");
+       jas_eprintf("%s", JPG_IJGINFO);
+       return -1;
+}
diff --git a/src/libjasper/jpg/jpg_enc.c b/src/libjasper/jpg/jpg_enc.c
new file mode 100644 (file)
index 0000000..4fcf72d
--- /dev/null
@@ -0,0 +1,414 @@
+/*
+ * Copyright (c) 2001-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <assert.h>
+#include "jasper/jas_types.h"
+
+#include "jasper/jas_tvp.h"
+#include "jasper/jas_stream.h"
+#include "jasper/jas_image.h"
+#include "jasper/jas_string.h"
+#include "jasper/jas_debug.h"
+
+#include "jpg_jpeglib.h"
+#include "jpg_cod.h"
+#include "jpg_enc.h"
+
+/******************************************************************************\
+* Types.
+\******************************************************************************/
+
+typedef struct jpg_src_s {
+
+       /* Output buffer. */
+       JSAMPARRAY buffer;
+
+       /* Height of output buffer. */
+       JDIMENSION buffer_height;
+
+       /* The current row. */
+       JDIMENSION row;
+
+       /* The image used to hold the decompressed sample data. */
+       jas_image_t *image;
+
+       /* The row buffer. */
+       jas_matrix_t *data;
+
+       /* The error indicator.  If this is nonzero, something has gone wrong
+         during decompression. */
+       int error;
+
+       jpg_enc_t *enc;
+
+} jpg_src_t;
+
+typedef struct {
+       int qual;
+} jpg_encopts_t;
+
+typedef enum {
+       OPT_QUAL
+} jpg_optid_t;
+
+jas_taginfo_t jpg_opttab[] = {
+       {OPT_QUAL, "quality"},
+       {-1, 0}
+};
+
+/******************************************************************************\
+* Local prototypes.
+\******************************************************************************/
+
+static int jpg_copyfiletostream(jas_stream_t *out, FILE *in);
+static void jpg_start_input(j_compress_ptr cinfo, struct jpg_src_s *sinfo);
+static JDIMENSION jpg_get_pixel_rows(j_compress_ptr cinfo, struct jpg_src_s *sinfo);
+static void jpg_finish_input(j_compress_ptr cinfo, struct jpg_src_s *sinfo);
+static J_COLOR_SPACE tojpgcs(int colorspace);
+static int jpg_parseencopts(char *optstr, jpg_encopts_t *encopts);
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+static int jpg_copyfiletostream(jas_stream_t *out, FILE *in)
+{
+       int c;
+       while ((c = fgetc(in)) != EOF) {
+               if (jas_stream_putc(out, c) == EOF) {
+                       return -1;
+               }
+       }
+       return 0;
+}
+
+static void jpg_start_input(j_compress_ptr cinfo, struct jpg_src_s *sinfo)
+{
+       /* Avoid compiler warnings about unused parameters. */
+       cinfo = 0;
+
+       sinfo->row = 0;
+}
+
+static JDIMENSION jpg_get_pixel_rows(j_compress_ptr cinfo, struct jpg_src_s *sinfo)
+{
+       JSAMPLE *bufptr;
+       int i;
+       int cmptno;
+       int width;
+       int *cmpts;
+
+       cmpts = sinfo->enc->cmpts;
+
+       width = jas_image_width(sinfo->image);
+
+       if (sinfo->error) {
+               return 0;
+       }
+       for (cmptno = 0; cmptno < cinfo->input_components; ++cmptno) {
+               if (jas_image_readcmpt(sinfo->image, cmpts[cmptno], 0, sinfo->row, width, 1, sinfo->data)) {
+                       ;
+               }
+               bufptr = (sinfo->buffer[0]) + cmptno;
+               for (i = 0; i < width; ++i) {
+                       *bufptr = jas_matrix_get(sinfo->data, 0, i);
+                       bufptr += cinfo->input_components;
+               }
+       }
+       ++sinfo->row;
+       return 1;
+}
+
+static void jpg_finish_input(j_compress_ptr cinfo, struct jpg_src_s *sinfo)
+{
+       /* Avoid compiler warnings about unused parameters. */
+       cinfo = 0;
+       sinfo = 0;
+}
+
+/******************************************************************************\
+* Code for save operation.
+\******************************************************************************/
+
+/* Save an image to a stream in the the JPG format. */
+
+int jpg_encode(jas_image_t *image, jas_stream_t *out, char *optstr)
+{
+       JDIMENSION numscanlines;
+       struct jpeg_compress_struct cinfo;
+       struct jpeg_error_mgr jerr;
+       jas_image_coord_t width;
+       jas_image_coord_t height;
+       jpg_src_t src_mgr_buf;
+       jpg_src_t *src_mgr = &src_mgr_buf;
+       FILE *output_file;
+       int cmptno;
+       jpg_enc_t encbuf;
+       jpg_enc_t *enc = &encbuf;
+       jpg_encopts_t encopts;
+
+       output_file = 0;
+
+       if (jpg_parseencopts(optstr, &encopts))
+               goto error;
+
+       switch (jas_clrspc_fam(jas_image_clrspc(image))) {
+       case JAS_CLRSPC_FAM_RGB:
+               if (jas_image_clrspc(image) != JAS_CLRSPC_SRGB)
+                       jas_eprintf("warning: inaccurate color\n");
+               enc->numcmpts = 3;
+               if ((enc->cmpts[0] = jas_image_getcmptbytype(image,
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_R))) < 0 ||
+                 (enc->cmpts[1] = jas_image_getcmptbytype(image,
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_G))) < 0 ||
+                 (enc->cmpts[2] = jas_image_getcmptbytype(image,
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_B))) < 0) {
+                       jas_eprintf("error: missing color component\n");
+                       goto error;
+               }
+               break;
+       case JAS_CLRSPC_FAM_YCBCR:
+               if (jas_image_clrspc(image) != JAS_CLRSPC_SYCBCR)
+                       jas_eprintf("warning: inaccurate color\n");
+               enc->numcmpts = 3;
+               if ((enc->cmpts[0] = jas_image_getcmptbytype(image,
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_YCBCR_Y))) < 0 ||
+                 (enc->cmpts[1] = jas_image_getcmptbytype(image,
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_YCBCR_CB))) < 0 ||
+                 (enc->cmpts[2] = jas_image_getcmptbytype(image,
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_YCBCR_CR))) < 0) {
+                       jas_eprintf("error: missing color component\n");
+                       goto error;
+               }
+               break;
+       case JAS_CLRSPC_FAM_GRAY:
+               if (jas_image_clrspc(image) != JAS_CLRSPC_SGRAY)
+                       jas_eprintf("warning: inaccurate color\n");
+               enc->numcmpts = 1;
+               if ((enc->cmpts[0] = jas_image_getcmptbytype(image,
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_GRAY_Y))) < 0) {
+                       jas_eprintf("error: missing color component\n");
+                       goto error;
+               }
+               break;
+       default:
+               jas_eprintf("error: JPG format does not support color space\n");
+               goto error;
+               break;
+       }
+
+       width = jas_image_width(image);
+       height = jas_image_height(image);
+
+       for (cmptno = 0; cmptno < enc->numcmpts; ++cmptno) {
+               if (jas_image_cmptwidth(image, enc->cmpts[cmptno]) != width ||
+                 jas_image_cmptheight(image, enc->cmpts[cmptno]) != height ||
+                 jas_image_cmpttlx(image, enc->cmpts[cmptno]) != 0 ||
+                 jas_image_cmpttly(image, enc->cmpts[cmptno]) != 0 ||
+                 jas_image_cmpthstep(image, enc->cmpts[cmptno]) != 1 ||
+                 jas_image_cmptvstep(image, enc->cmpts[cmptno]) != 1 ||
+                 jas_image_cmptprec(image, enc->cmpts[cmptno]) != 8 ||
+                 jas_image_cmptsgnd(image, enc->cmpts[cmptno]) != false) {
+                       jas_eprintf("error: The JPG encoder cannot handle an image with this geometry.\n");
+                       goto error;
+               }
+       }
+
+       if (!(output_file = tmpfile())) {
+               goto error;
+       }
+
+       /* Create a JPEG compression object. */
+       cinfo.err = jpeg_std_error(&jerr);
+       jpeg_create_compress(&cinfo);
+
+       /* Specify data destination for compression */
+       jpeg_stdio_dest(&cinfo, output_file);
+
+       cinfo.in_color_space = tojpgcs(jas_image_clrspc(image));
+       cinfo.image_width = width;
+       cinfo.image_height = height;
+       cinfo.input_components = enc->numcmpts;
+       jpeg_set_defaults(&cinfo);
+
+       src_mgr->error = 0;
+       src_mgr->image = image;
+       src_mgr->data = jas_matrix_create(1, width);
+       assert(src_mgr->data);
+       src_mgr->buffer = (*cinfo.mem->alloc_sarray)((j_common_ptr) &cinfo,
+         JPOOL_IMAGE, (JDIMENSION) width * cinfo.input_components,
+         (JDIMENSION) 1);
+       src_mgr->buffer_height = 1;
+       src_mgr->enc = enc;
+
+       /* Read the input file header to obtain file size & colorspace. */
+       jpg_start_input(&cinfo, src_mgr);
+
+       if (encopts.qual >= 0) {
+               jpeg_set_quality(&cinfo, encopts.qual, TRUE);
+       }
+
+       /* Now that we know input colorspace, fix colorspace-dependent defaults */
+       jpeg_default_colorspace(&cinfo);
+
+       /* Start compressor */
+       jpeg_start_compress(&cinfo, TRUE);
+
+       /* Process data */
+       while (cinfo.next_scanline < cinfo.image_height) {
+               if ((numscanlines = jpg_get_pixel_rows(&cinfo, src_mgr)) <= 0) {
+                       break;
+               }
+               jpeg_write_scanlines(&cinfo, src_mgr->buffer, numscanlines);
+       }
+
+       /* Finish compression and release memory */
+       jpg_finish_input(&cinfo, src_mgr);
+       jpeg_finish_compress(&cinfo);
+       jpeg_destroy_compress(&cinfo);
+       jas_matrix_destroy(src_mgr->data);
+
+       rewind(output_file);
+       jpg_copyfiletostream(out, output_file);
+       fclose(output_file);
+       output_file = 0;
+
+       return 0;
+
+error:
+       if (output_file) {
+               fclose(output_file);
+       }
+       return -1;
+}
+
+static J_COLOR_SPACE tojpgcs(int colorspace)
+{
+       switch (jas_clrspc_fam(colorspace)) {
+       case JAS_CLRSPC_FAM_RGB:
+               return JCS_RGB;
+               break;
+       case JAS_CLRSPC_FAM_YCBCR:
+               return JCS_YCbCr;
+               break;
+       case JAS_CLRSPC_FAM_GRAY:
+               return JCS_GRAYSCALE;
+               break;
+       default:
+               abort();
+               break;
+       }
+}
+
+/* Parse the encoder options string. */
+static int jpg_parseencopts(char *optstr, jpg_encopts_t *encopts)
+{
+       jas_tvparser_t *tvp;
+       char *qual_str;
+       int ret;
+
+       tvp = 0;
+
+       /* Initialize default values for encoder options. */
+       encopts->qual = -1;
+
+       /* Create the tag-value parser. */
+       if (!(tvp = jas_tvparser_create(optstr ? optstr : ""))) {
+               goto error;
+       }
+
+       /* Get tag-value pairs, and process as necessary. */
+       while (!(ret = jas_tvparser_next(tvp))) {
+               switch (jas_taginfo_nonull(jas_taginfos_lookup(jpg_opttab,
+                 jas_tvparser_gettag(tvp)))->id) {
+               case OPT_QUAL:
+                       qual_str = jas_tvparser_getval(tvp);
+                       if (sscanf(qual_str, "%d", &encopts->qual) != 1) {
+                               jas_eprintf("ignoring bad quality specifier %s\n",
+                                       jas_tvparser_getval(tvp));
+                               encopts->qual = -1;
+                       }
+                       break;
+               default:
+                       jas_eprintf("warning: ignoring invalid option %s\n",
+                         jas_tvparser_gettag(tvp));
+                       break;
+               }
+       }
+       if (ret < 0) {
+               goto error;
+       }
+
+       /* Destroy the tag-value parser. */
+       jas_tvparser_destroy(tvp);
+
+       return 0;
+
+error:
+       if (tvp) {
+               jas_tvparser_destroy(tvp);
+       }
+       return -1;
+}
diff --git a/src/libjasper/jpg/jpg_enc.h b/src/libjasper/jpg/jpg_enc.h
new file mode 100644 (file)
index 0000000..d0d6c5f
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+#ifndef JPG_ENC_H
+#define JPG_ENC_H
+
+typedef struct {
+       int numcmpts;
+       int cmpts[4];
+} jpg_enc_t;
+
+#endif
diff --git a/src/libjasper/jpg/jpg_jpeglib.h b/src/libjasper/jpg/jpg_jpeglib.h
new file mode 100644 (file)
index 0000000..ad5818c
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+#ifndef JPG_JPEGLIB_H
+#define JPG_JPEGLIB_H
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <stdio.h>
+#include "jasper/jas_types.h"
+
+/* Note: The jpeglib.h header file does not include definitions of
+  FILE, size_t, etc. */
+#include <jpeglib.h>
+
+#endif
diff --git a/src/libjasper/jpg/jpg_val.c b/src/libjasper/jpg/jpg_val.c
new file mode 100644 (file)
index 0000000..338afaf
--- /dev/null
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <stdio.h>
+#include <assert.h>
+
+#include "jasper/jas_stream.h"
+#include "jasper/jas_image.h"
+
+#include "jpg_cod.h"
+
+/******************************************************************************\
+* Code for validate operation.
+\******************************************************************************/
+
+int jpg_validate(jas_stream_t *in)
+{
+       uchar buf[JPG_MAGICLEN];
+       int i;
+       int n;
+
+       assert(JAS_STREAM_MAXPUTBACK >= JPG_MAGICLEN);
+
+       /* Read the validation data (i.e., the data used for detecting
+         the format). */
+       if ((n = jas_stream_read(in, buf, JPG_MAGICLEN)) < 0) {
+               return -1;
+       }
+
+       /* Put the validation data back onto the stream, so that the
+         stream position will not be changed. */
+       for (i = n - 1; i >= 0; --i) {
+               if (jas_stream_ungetc(in, buf[i]) == EOF) {
+                       return -1;
+               }
+       }
+
+       /* Did we read enough data? */
+       if (n < JPG_MAGICLEN) {
+               return -1;
+       }
+
+       /* Does this look like JPEG? */
+       if (buf[0] != (JPG_MAGIC >> 8) || buf[1] != (JPG_MAGIC & 0xff)) {
+               return -1;
+       }
+
+       return 0;
+}
diff --git a/src/libjasper/mif/Makefile.am b/src/libjasper/mif/Makefile.am
new file mode 100644 (file)
index 0000000..b01a233
--- /dev/null
@@ -0,0 +1,66 @@
+# Copyright (c) 2001-2002 Michael David Adams.
+# All rights reserved. 
+
+# __START_OF_JASPER_LICENSE__
+# 
+# JasPer License Version 2.0
+# 
+# Copyright (c) 2001-2006 Michael David Adams
+# Copyright (c) 1999-2000 Image Power, Inc.
+# Copyright (c) 1999-2000 The University of British Columbia
+# 
+# All rights reserved.
+# 
+# Permission is hereby granted, free of charge, to any person (the
+# "User") obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the
+# following conditions:
+# 
+# 1.  The above copyright notices and this permission notice (which
+# includes the disclaimer below) shall be included in all copies or
+# substantial portions of the Software.
+# 
+# 2.  The name of a copyright holder shall not be used to endorse or
+# promote products derived from the Software without specific prior
+# written permission.
+# 
+# THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+# LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+# THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+# "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+# PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+# EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+# PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+# THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+# EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+# BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+# PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+# GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+# ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+# IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+# SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+# AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+# SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+# THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+# PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+# RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+# EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+# 
+# __END_OF_JASPER_LICENSE__
+
+EXTRA_DIST = README
+
+noinst_LTLIBRARIES = libmif.la
+libmif_la_SOURCES = \
+       mif_cod.h \
+       mif_cod.c
+
+INCLUDES = -I$(top_srcdir)/src/libjasper/include
diff --git a/src/libjasper/mif/Makefile.in b/src/libjasper/mif/Makefile.in
new file mode 100644 (file)
index 0000000..94a1ff5
--- /dev/null
@@ -0,0 +1,506 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# Copyright (c) 2001-2002 Michael David Adams.
+# All rights reserved. 
+
+# __START_OF_JASPER_LICENSE__
+# 
+# JasPer License Version 2.0
+# 
+# Copyright (c) 2001-2006 Michael David Adams
+# Copyright (c) 1999-2000 Image Power, Inc.
+# Copyright (c) 1999-2000 The University of British Columbia
+# 
+# All rights reserved.
+# 
+# Permission is hereby granted, free of charge, to any person (the
+# "User") obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the
+# following conditions:
+# 
+# 1.  The above copyright notices and this permission notice (which
+# includes the disclaimer below) shall be included in all copies or
+# substantial portions of the Software.
+# 
+# 2.  The name of a copyright holder shall not be used to endorse or
+# promote products derived from the Software without specific prior
+# written permission.
+# 
+# THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+# LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+# THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+# "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+# PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+# EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+# PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+# THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+# EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+# BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+# PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+# GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+# ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+# IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+# SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+# AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+# SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+# THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+# PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+# RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+# EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+# 
+# __END_OF_JASPER_LICENSE__
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = src/libjasper/mif
+DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/acaux/mkinstalldirs
+CONFIG_HEADER =  \
+       $(top_builddir)/src/libjasper/include/jasper/jas_config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libmif_la_LIBADD =
+am_libmif_la_OBJECTS = mif_cod.lo
+libmif_la_OBJECTS = $(am_libmif_la_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/libjasper/include/jasper
+depcomp = $(SHELL) $(top_srcdir)/acaux/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+       $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libmif_la_SOURCES)
+DIST_SOURCES = $(libmif_la_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+HAVE_LIBJPEG_FALSE = @HAVE_LIBJPEG_FALSE@
+HAVE_LIBJPEG_TRUE = @HAVE_LIBJPEG_TRUE@
+HAVE_OPENGL_FALSE = @HAVE_OPENGL_FALSE@
+HAVE_OPENGL_TRUE = @HAVE_OPENGL_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAS_MAJOR_VERSION = @JAS_MAJOR_VERSION@
+JAS_MICRO_VERSION = @JAS_MICRO_VERSION@
+JAS_MINOR_VERSION = @JAS_MINOR_VERSION@
+JAS_RPM_RELEASE = @JAS_RPM_RELEASE@
+JAS_VERSION = @JAS_VERSION@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_AGE = @LT_AGE@
+LT_CURRENT = @LT_CURRENT@
+LT_RELEASE = @LT_RELEASE@
+LT_REVISION = @LT_REVISION@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OPENGL_LIBS = @OPENGL_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+EXTRA_DIST = README
+noinst_LTLIBRARIES = libmif.la
+libmif_la_SOURCES = \
+       mif_cod.h \
+       mif_cod.c
+
+INCLUDES = -I$(top_srcdir)/src/libjasper/include
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/libjasper/mif/Makefile'; \
+       cd $(top_srcdir) && \
+         $(AUTOMAKE) --foreign  src/libjasper/mif/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+       -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+       @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+         test "$$dir" != "$$p" || dir=.; \
+         echo "rm -f \"$${dir}/so_locations\""; \
+         rm -f "$${dir}/so_locations"; \
+       done
+libmif.la: $(libmif_la_OBJECTS) $(libmif_la_DEPENDENCIES) 
+       $(LINK)  $(libmif_la_LDFLAGS) $(libmif_la_OBJECTS) $(libmif_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mif_cod.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+
+distclean-libtool:
+       -rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+           $$tags $$unique; \
+       fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       test -z "$(CTAGS_ARGS)$$tags$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$tags $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && cd $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+       list='$(DISTFILES)'; for file in $$list; do \
+         case $$file in \
+           $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+           $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+         esac; \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+         if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+           dir="/$$dir"; \
+           $(mkdir_p) "$(distdir)$$dir"; \
+         else \
+           dir=''; \
+         fi; \
+         if test -d $$d/$$file; then \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+           fi; \
+           cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+         else \
+           test -f $(distdir)/$$file \
+           || cp -p $$d/$$file $(distdir)/$$file \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+         `test -z '$(STRIP)' || \
+           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+       mostlyclean-am
+
+distclean: distclean-am
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+       clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+       distclean-compile distclean-generic distclean-libtool \
+       distclean-tags distdir dvi dvi-am html html-am info info-am \
+       install install-am install-data install-data-am install-exec \
+       install-exec-am install-info install-info-am install-man \
+       install-strip installcheck installcheck-am installdirs \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+       pdf pdf-am ps ps-am tags uninstall uninstall-am \
+       uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/libjasper/mif/README b/src/libjasper/mif/README
new file mode 100644 (file)
index 0000000..85adb18
--- /dev/null
@@ -0,0 +1 @@
+This directory contains the code for support of the MIF format.
diff --git a/src/libjasper/mif/mif_cod.c b/src/libjasper/mif/mif_cod.c
new file mode 100644 (file)
index 0000000..17506a1
--- /dev/null
@@ -0,0 +1,751 @@
+/*
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <assert.h>
+
+#include "jasper/jas_tvp.h"
+#include "jasper/jas_stream.h"
+#include "jasper/jas_image.h"
+#include "jasper/jas_string.h"
+#include "jasper/jas_malloc.h"
+
+#include "mif_cod.h"
+
+/******************************************************************************\
+* Local types.
+\******************************************************************************/
+
+typedef enum {
+       MIF_END = 0,
+       MIF_CMPT
+} mif_tagid2_t;
+
+typedef enum {
+       MIF_TLX = 0,
+       MIF_TLY,
+       MIF_WIDTH,
+       MIF_HEIGHT,
+       MIF_HSAMP,
+       MIF_VSAMP,
+       MIF_PREC,
+       MIF_SGND,
+       MIF_DATA
+} mif_tagid_t;
+
+/******************************************************************************\
+* Local functions.
+\******************************************************************************/
+
+static mif_hdr_t *mif_hdr_create(int maxcmpts);
+static void mif_hdr_destroy(mif_hdr_t *hdr);
+static int mif_hdr_growcmpts(mif_hdr_t *hdr, int maxcmpts);
+static mif_hdr_t *mif_hdr_get(jas_stream_t *in);
+static int mif_process_cmpt(mif_hdr_t *hdr, char *buf);
+static int mif_hdr_put(mif_hdr_t *hdr, jas_stream_t *out);
+static int mif_hdr_addcmpt(mif_hdr_t *hdr, int cmptno, mif_cmpt_t *cmpt);
+static mif_cmpt_t *mif_cmpt_create(void);
+static void mif_cmpt_destroy(mif_cmpt_t *cmpt);
+static char *mif_getline(jas_stream_t *jas_stream, char *buf, int bufsize);
+static int mif_getc(jas_stream_t *in);
+static mif_hdr_t *mif_makehdrfromimage(jas_image_t *image);
+
+/******************************************************************************\
+* Local data.
+\******************************************************************************/
+
+jas_taginfo_t mif_tags2[] = {
+       {MIF_CMPT, "component"},
+       {MIF_END, "end"},
+       {-1, 0}
+};
+
+jas_taginfo_t mif_tags[] = {
+       {MIF_TLX, "tlx"},
+       {MIF_TLY, "tly"},
+       {MIF_WIDTH, "width"},
+       {MIF_HEIGHT, "height"},
+       {MIF_HSAMP, "sampperx"},
+       {MIF_VSAMP, "samppery"},
+       {MIF_PREC, "prec"},
+       {MIF_SGND, "sgnd"},
+       {MIF_DATA, "data"},
+       {-1, 0}
+};
+
+/******************************************************************************\
+* Code for load operation.
+\******************************************************************************/
+
+/* Load an image from a stream in the MIF format. */
+
+jas_image_t *mif_decode(jas_stream_t *in, char *optstr)
+{
+       mif_hdr_t *hdr;
+       jas_image_t *image;
+       jas_image_t *tmpimage;
+       jas_stream_t *tmpstream;
+       int cmptno;
+       mif_cmpt_t *cmpt;
+       jas_image_cmptparm_t cmptparm;
+       jas_seq2d_t *data;
+       int_fast32_t x;
+       int_fast32_t y;
+       int bias;
+
+       /* Avoid warnings about unused parameters. */
+       optstr = 0;
+
+       hdr = 0;
+       image = 0;
+       tmpimage = 0;
+       tmpstream = 0;
+       data = 0;
+
+       if (!(hdr = mif_hdr_get(in))) {
+               goto error;
+       }
+
+       if (!(image = jas_image_create0())) {
+               goto error;
+       }
+
+       for (cmptno = 0; cmptno < hdr->numcmpts; ++cmptno) {
+               cmpt = hdr->cmpts[cmptno];
+               tmpstream = cmpt->data ? jas_stream_fopen(cmpt->data, "rb") : in;
+               if (!tmpstream) {
+                       goto error;
+               }
+               if (!(tmpimage = jas_image_decode(tmpstream, -1, 0))) {
+                       goto error;
+               }
+               if (tmpstream != in) {
+                       jas_stream_close(tmpstream);
+                       tmpstream = 0;
+               }
+               if (!cmpt->width) {
+                       cmpt->width = jas_image_cmptwidth(tmpimage, 0);
+               }
+               if (!cmpt->height) {
+                       cmpt->height = jas_image_cmptwidth(tmpimage, 0);
+               }
+               if (!cmpt->prec) {
+                       cmpt->prec = jas_image_cmptprec(tmpimage, 0);
+               }
+               if (cmpt->sgnd < 0) {
+                       cmpt->sgnd = jas_image_cmptsgnd(tmpimage, 0);
+               }
+               cmptparm.tlx = cmpt->tlx;
+               cmptparm.tly = cmpt->tly;
+               cmptparm.hstep = cmpt->sampperx;
+               cmptparm.vstep = cmpt->samppery;
+               cmptparm.width = cmpt->width;
+               cmptparm.height = cmpt->height;
+               cmptparm.prec = cmpt->prec;
+               cmptparm.sgnd = cmpt->sgnd;
+               if (jas_image_addcmpt(image, jas_image_numcmpts(image), &cmptparm)) {
+                       goto error;
+               }
+               if (!(data = jas_seq2d_create(0, 0, cmpt->width, cmpt->height))) {
+                       goto error;
+               }
+               if (jas_image_readcmpt(tmpimage, 0, 0, 0, cmpt->width, cmpt->height,
+                 data)) {
+                       goto error;
+               }
+               if (cmpt->sgnd) {
+                       bias = 1 << (cmpt->prec - 1);
+                       for (y = 0; y < cmpt->height; ++y) {
+                               for (x = 0; x < cmpt->width; ++x) {
+                                       *jas_seq2d_getref(data, x, y) -= bias;
+                               }
+                       }
+               }
+               if (jas_image_writecmpt(image, jas_image_numcmpts(image) - 1, 0, 0,
+                 cmpt->width, cmpt->height, data)) {
+                       goto error;
+               }
+               jas_seq2d_destroy(data);
+               data = 0;
+               jas_image_destroy(tmpimage);
+               tmpimage = 0;
+       }
+
+       mif_hdr_destroy(hdr);
+       hdr = 0;
+       return image;
+
+error:
+       if (image) {
+               jas_image_destroy(image);
+       }
+       if (hdr) {
+               mif_hdr_destroy(hdr);
+       }
+       if (tmpstream && tmpstream != in) {
+               jas_stream_close(tmpstream);
+       }
+       if (tmpimage) {
+               jas_image_destroy(tmpimage);
+       }
+       if (data) {
+               jas_seq2d_destroy(data);
+       }
+       return 0;
+}
+
+/******************************************************************************\
+* Code for save operation.
+\******************************************************************************/
+
+/* Save an image to a stream in the the MIF format. */
+
+int mif_encode(jas_image_t *image, jas_stream_t *out, char *optstr)
+{
+       mif_hdr_t *hdr;
+       jas_image_t *tmpimage;
+       int fmt;
+       int cmptno;
+       mif_cmpt_t *cmpt;
+       jas_image_cmptparm_t cmptparm;
+       jas_seq2d_t *data;
+       int_fast32_t x;
+       int_fast32_t y;
+       int bias;
+
+       hdr = 0;
+       tmpimage = 0;
+       data = 0;
+
+       if (optstr && *optstr != '\0') {
+               jas_eprintf("warning: ignoring unsupported options\n");
+       }
+
+       if ((fmt = jas_image_strtofmt("pnm")) < 0) {
+               jas_eprintf("error: PNM support required\n");
+               goto error;
+       }
+
+       if (!(hdr = mif_makehdrfromimage(image))) {
+               goto error;
+       }
+       if (mif_hdr_put(hdr, out)) {
+               goto error;
+       }
+
+       /* Output component data. */
+       for (cmptno = 0; cmptno < hdr->numcmpts; ++cmptno) {
+               cmpt = hdr->cmpts[cmptno];
+               if (!cmpt->data) {
+                       if (!(tmpimage = jas_image_create0())) {
+                               goto error;
+                       }       
+                       cmptparm.tlx = 0;
+                       cmptparm.tly = 0;
+                       cmptparm.hstep = cmpt->sampperx;
+                       cmptparm.vstep = cmpt->samppery;
+                       cmptparm.width = cmpt->width;
+                       cmptparm.height = cmpt->height;
+                       cmptparm.prec = cmpt->prec;
+                       cmptparm.sgnd = false;
+                       if (jas_image_addcmpt(tmpimage, jas_image_numcmpts(tmpimage), &cmptparm)) {
+                               goto error;
+                       }
+                       if (!(data = jas_seq2d_create(0, 0, cmpt->width, cmpt->height))) {
+                               goto error;
+                       }
+                       if (jas_image_readcmpt(image, cmptno, 0, 0, cmpt->width, cmpt->height,
+                         data)) {
+                               goto error;
+                       }
+                       if (cmpt->sgnd) {
+                               bias = 1 << (cmpt->prec - 1);
+                               for (y = 0; y < cmpt->height; ++y) {
+                                       for (x = 0; x < cmpt->width; ++x) {
+                                               *jas_seq2d_getref(data, x, y) += bias;
+                                       }
+                               }
+                       }
+                       if (jas_image_writecmpt(tmpimage, 0, 0, 0, cmpt->width, cmpt->height,
+                         data)) {
+                               goto error;
+                       }
+                       jas_seq2d_destroy(data);
+                       data = 0;
+                       if (jas_image_encode(tmpimage, out, fmt, 0)) {
+                               goto error;
+                       }
+                       jas_image_destroy(tmpimage);
+                       tmpimage = 0;
+               }
+       }
+
+       mif_hdr_destroy(hdr);
+
+       return 0;
+
+error:
+       if (hdr) {
+               mif_hdr_destroy(hdr);
+       }
+       if (tmpimage) {
+               jas_image_destroy(tmpimage);
+       }
+       if (data) {
+               jas_seq2d_destroy(data);
+       }
+       return -1;
+}
+
+/******************************************************************************\
+* Code for validate operation.
+\******************************************************************************/
+
+int mif_validate(jas_stream_t *in)
+{
+       uchar buf[MIF_MAGICLEN];
+       uint_fast32_t magic;
+       int i;
+       int n;
+
+       assert(JAS_STREAM_MAXPUTBACK >= MIF_MAGICLEN);
+
+       /* Read the validation data (i.e., the data used for detecting
+         the format). */
+       if ((n = jas_stream_read(in, buf, MIF_MAGICLEN)) < 0) {
+               return -1;
+       }
+
+       /* Put the validation data back onto the stream, so that the
+         stream position will not be changed. */
+       for (i = n - 1; i >= 0; --i) {
+               if (jas_stream_ungetc(in, buf[i]) == EOF) {
+                       return -1;
+               }
+       }
+
+       /* Was enough data read? */
+       if (n < MIF_MAGICLEN) {
+               return -1;
+       }
+
+       /* Compute the signature value. */
+       magic = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3];
+
+       /* Ensure that the signature is correct for this format. */
+       if (magic != MIF_MAGIC) {
+               return -1;
+       }
+
+       return 0;
+}
+
+/******************************************************************************\
+* Code for MIF header class.
+\******************************************************************************/
+
+static mif_hdr_t *mif_hdr_create(int maxcmpts)
+{
+       mif_hdr_t *hdr;
+       if (!(hdr = jas_malloc(sizeof(mif_hdr_t)))) {
+               return 0;
+       }
+       hdr->numcmpts = 0;
+       hdr->maxcmpts = 0;
+       hdr->cmpts = 0;
+       if (mif_hdr_growcmpts(hdr, maxcmpts)) {
+               mif_hdr_destroy(hdr);
+               return 0;
+       }
+       return hdr;
+}
+
+static void mif_hdr_destroy(mif_hdr_t *hdr)
+{
+       int cmptno;
+       if (hdr->cmpts) {
+               for (cmptno = 0; cmptno < hdr->numcmpts; ++cmptno) {
+                       mif_cmpt_destroy(hdr->cmpts[cmptno]);
+               }
+               jas_free(hdr->cmpts);
+       }
+       jas_free(hdr);
+}
+
+static int mif_hdr_growcmpts(mif_hdr_t *hdr, int maxcmpts)
+{
+       int cmptno;
+       mif_cmpt_t **newcmpts;
+       assert(maxcmpts >= hdr->numcmpts);
+       newcmpts = (!hdr->cmpts) ? jas_malloc(maxcmpts * sizeof(mif_cmpt_t *)) :
+         jas_realloc(hdr->cmpts, maxcmpts * sizeof(mif_cmpt_t *));
+       if (!newcmpts) {
+               return -1;
+       }
+       hdr->maxcmpts = maxcmpts;
+       hdr->cmpts = newcmpts;
+       for (cmptno = hdr->numcmpts; cmptno < hdr->maxcmpts; ++cmptno) {
+               hdr->cmpts[cmptno] = 0;
+       }
+       return 0;
+}
+
+static mif_hdr_t *mif_hdr_get(jas_stream_t *in)
+{
+       uchar magicbuf[MIF_MAGICLEN];
+       char buf[4096];
+       mif_hdr_t *hdr;
+       bool done;
+       jas_tvparser_t *tvp;
+       int id;
+
+       hdr = 0;
+
+       if (jas_stream_read(in, magicbuf, MIF_MAGICLEN) != MIF_MAGICLEN) {
+               goto error;
+       }
+       if (magicbuf[0] != (MIF_MAGIC >> 24) || magicbuf[1] != ((MIF_MAGIC >> 16) &
+         0xff) || magicbuf[2] != ((MIF_MAGIC >> 8) & 0xff) || magicbuf[3] !=
+         (MIF_MAGIC & 0xff)) {
+               jas_eprintf("error: bad signature\n");
+               goto error;
+       }
+
+       if (!(hdr = mif_hdr_create(0))) {
+               goto error;
+       }
+
+       done = false;
+       do {
+               if (!mif_getline(in, buf, sizeof(buf))) {
+                       goto error;
+               }
+               if (buf[0] == '\0') {
+                       continue;
+               }
+               if (!(tvp = jas_tvparser_create(buf))) {
+                       goto error;
+               }
+               if (jas_tvparser_next(tvp)) {
+                       abort();
+               }
+               id = jas_taginfo_nonull(jas_taginfos_lookup(mif_tags2, jas_tvparser_gettag(tvp)))->id;
+               jas_tvparser_destroy(tvp);
+               switch (id) {
+               case MIF_CMPT:
+                       mif_process_cmpt(hdr, buf);
+                       break;
+               case MIF_END:
+                       done = 1;
+                       break;
+               }
+       } while (!done);
+
+       return hdr;
+
+error:
+       if (hdr) {
+               mif_hdr_destroy(hdr);
+       }
+       return 0;
+}
+
+static int mif_process_cmpt(mif_hdr_t *hdr, char *buf)
+{
+       jas_tvparser_t *tvp;
+       mif_cmpt_t *cmpt;
+       int id;
+
+       cmpt = 0;
+       tvp = 0;
+
+       if (!(cmpt = mif_cmpt_create())) {
+               goto error;
+       }
+       cmpt->tlx = 0;
+       cmpt->tly = 0;
+       cmpt->sampperx = 0;
+       cmpt->samppery = 0;
+       cmpt->width = 0;
+       cmpt->height = 0;
+       cmpt->prec = 0;
+       cmpt->sgnd = -1;
+       cmpt->data = 0;
+
+       if (!(tvp = jas_tvparser_create(buf))) {
+               goto error;
+       }
+       while (!(id = jas_tvparser_next(tvp))) {
+               switch (jas_taginfo_nonull(jas_taginfos_lookup(mif_tags,
+                 jas_tvparser_gettag(tvp)))->id) {
+               case MIF_TLX:
+                       cmpt->tlx = atoi(jas_tvparser_getval(tvp));
+                       break;
+               case MIF_TLY:
+                       cmpt->tly = atoi(jas_tvparser_getval(tvp));
+                       break;
+               case MIF_WIDTH:
+                       cmpt->width = atoi(jas_tvparser_getval(tvp));
+                       break;
+               case MIF_HEIGHT:
+                       cmpt->height = atoi(jas_tvparser_getval(tvp));
+                       break;
+               case MIF_HSAMP:
+                       cmpt->sampperx = atoi(jas_tvparser_getval(tvp));
+                       break;
+               case MIF_VSAMP:
+                       cmpt->samppery = atoi(jas_tvparser_getval(tvp));
+                       break;
+               case MIF_PREC:
+                       cmpt->prec = atoi(jas_tvparser_getval(tvp));
+                       break;
+               case MIF_SGND:
+                       cmpt->sgnd = atoi(jas_tvparser_getval(tvp));
+                       break;
+               case MIF_DATA:
+                       if (!(cmpt->data = jas_strdup(jas_tvparser_getval(tvp)))) {
+                               return -1;
+                       }
+                       break;
+               }
+       }
+       jas_tvparser_destroy(tvp);
+       if (!cmpt->sampperx || !cmpt->samppery) {
+               goto error;
+       }
+       if (mif_hdr_addcmpt(hdr, hdr->numcmpts, cmpt)) {
+               goto error;
+       }
+       return 0;
+
+error:
+       if (cmpt) {
+               mif_cmpt_destroy(cmpt);
+       }
+       if (tvp) {
+               jas_tvparser_destroy(tvp);
+       }
+       return -1;
+}
+
+static int mif_hdr_put(mif_hdr_t *hdr, jas_stream_t *out)
+{
+       int cmptno;
+       mif_cmpt_t *cmpt;
+
+       /* Output signature. */
+       jas_stream_putc(out, (MIF_MAGIC >> 24) & 0xff);
+       jas_stream_putc(out, (MIF_MAGIC >> 16) & 0xff);
+       jas_stream_putc(out, (MIF_MAGIC >> 8) & 0xff);
+       jas_stream_putc(out, MIF_MAGIC & 0xff);
+
+       /* Output component information. */
+       for (cmptno = 0; cmptno < hdr->numcmpts; ++cmptno) {
+               cmpt = hdr->cmpts[cmptno];
+               jas_stream_printf(out, "component tlx=%ld tly=%ld "
+                 "sampperx=%ld samppery=%ld width=%ld height=%ld prec=%d sgnd=%d",
+                 cmpt->tlx, cmpt->tly, cmpt->sampperx, cmpt->samppery, cmpt->width,
+                 cmpt->height, cmpt->prec, cmpt->sgnd);
+               if (cmpt->data) {
+                       jas_stream_printf(out, " data=%s", cmpt->data);
+               }
+               jas_stream_printf(out, "\n");
+       }
+
+       /* Output end of header indicator. */
+       jas_stream_printf(out, "end\n");
+
+       return 0;
+}
+
+static int mif_hdr_addcmpt(mif_hdr_t *hdr, int cmptno, mif_cmpt_t *cmpt)
+{
+       assert(cmptno >= hdr->numcmpts);
+       if (hdr->numcmpts >= hdr->maxcmpts) {
+               if (mif_hdr_growcmpts(hdr, hdr->numcmpts + 128)) {
+                       return -1;
+               }
+       }
+       hdr->cmpts[hdr->numcmpts] = cmpt;
+       ++hdr->numcmpts;
+       return 0;
+}
+
+/******************************************************************************\
+* Code for MIF component class.
+\******************************************************************************/
+
+static mif_cmpt_t *mif_cmpt_create()
+{
+       mif_cmpt_t *cmpt;
+       if (!(cmpt = jas_malloc(sizeof(mif_cmpt_t)))) {
+               return 0;
+       }
+       memset(cmpt, 0, sizeof(mif_cmpt_t));
+       return cmpt;
+}
+
+static void mif_cmpt_destroy(mif_cmpt_t *cmpt)
+{
+       if (cmpt->data) {
+               jas_free(cmpt->data);
+       }
+       jas_free(cmpt);
+}
+
+/******************************************************************************\
+* MIF parsing code.
+\******************************************************************************/
+
+static char *mif_getline(jas_stream_t *stream, char *buf, int bufsize)
+{
+       int c;
+       char *bufptr;
+       assert(bufsize > 0);
+
+       bufptr = buf;
+       while (bufsize > 1) {
+               if ((c = mif_getc(stream)) == EOF) {
+                       break;
+               }
+               *bufptr++ = c;
+               --bufsize;
+               if (c == '\n') {
+                       break;
+               }
+       }
+       *bufptr = '\0';
+       if (!(bufptr = strchr(buf, '\n'))) {
+               return 0;
+       }
+       *bufptr = '\0';
+       return buf;
+}
+
+static int mif_getc(jas_stream_t *in)
+{
+       int c;
+       bool done;
+
+       done = false;
+       do {
+               switch (c = jas_stream_getc(in)) {
+               case EOF:
+                       done = 1;
+                       break;
+               case '#':
+                       for (;;) {
+                               if ((c = jas_stream_getc(in)) == EOF) {
+                                       done = 1;
+                                       break;
+                               }       
+                               if (c == '\n') {
+                                       break;
+                               }
+                       }
+                       break;
+               case '\\':
+                       if (jas_stream_peekc(in) == '\n') {
+                               jas_stream_getc(in);
+                       }
+                       break;
+               default:
+                       done = 1;
+                       break;
+               }
+       } while (!done);
+
+       return c;
+}
+
+/******************************************************************************\
+* Miscellaneous functions.
+\******************************************************************************/
+
+static mif_hdr_t *mif_makehdrfromimage(jas_image_t *image)
+{
+       mif_hdr_t *hdr;
+       int cmptno;
+       mif_cmpt_t *cmpt;
+
+       if (!(hdr = mif_hdr_create(jas_image_numcmpts(image)))) {
+               return 0;
+       }
+       hdr->magic = MIF_MAGIC;
+       hdr->numcmpts = jas_image_numcmpts(image);
+       for (cmptno = 0; cmptno < hdr->numcmpts; ++cmptno) {
+               hdr->cmpts[cmptno] = jas_malloc(sizeof(mif_cmpt_t));
+               cmpt = hdr->cmpts[cmptno];
+               cmpt->tlx = jas_image_cmpttlx(image, cmptno);
+               cmpt->tly = jas_image_cmpttly(image, cmptno);
+               cmpt->width = jas_image_cmptwidth(image, cmptno);
+               cmpt->height = jas_image_cmptheight(image, cmptno);
+               cmpt->sampperx = jas_image_cmpthstep(image, cmptno);
+               cmpt->samppery = jas_image_cmptvstep(image, cmptno);
+               cmpt->prec = jas_image_cmptprec(image, cmptno);
+               cmpt->sgnd = jas_image_cmptsgnd(image, cmptno);
+               cmpt->data = 0;
+       }
+       return hdr;
+}
diff --git a/src/libjasper/mif/mif_cod.h b/src/libjasper/mif/mif_cod.h
new file mode 100644 (file)
index 0000000..a265afa
--- /dev/null
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+#ifndef MIF_COD_H
+#define MIF_COD_H
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include "jasper/jas_types.h"
+
+/******************************************************************************\
+* Constants.
+\******************************************************************************/
+
+#define        MIF_MAGIC               0x4d49460a
+/* signature */
+
+#define        MIF_MAGICLEN    4
+/* length of signature in bytes */
+
+/******************************************************************************\
+* Types.
+\******************************************************************************/
+
+/* Per-component information. */
+
+typedef struct {
+
+       int_fast32_t tlx;
+
+       int_fast32_t tly;
+
+       int_fast32_t width;
+
+       int_fast32_t height;
+
+       int_fast32_t sampperx;
+
+       int_fast32_t samppery;
+
+       int_fast16_t prec;
+
+       int_fast16_t sgnd;
+
+       char *data;
+
+} mif_cmpt_t;
+
+/* MIF header. */
+
+typedef struct {
+
+       uint_fast32_t magic;
+
+       int numcmpts;
+
+       int maxcmpts;
+
+       mif_cmpt_t **cmpts;
+
+} mif_hdr_t;
+
+#endif
diff --git a/src/libjasper/pgx/Makefile.am b/src/libjasper/pgx/Makefile.am
new file mode 100644 (file)
index 0000000..e3c6d1a
--- /dev/null
@@ -0,0 +1,67 @@
+# Copyright (c) 2001-2003 Michael David Adams.
+# All rights reserved. 
+
+# __START_OF_JASPER_LICENSE__
+# 
+# JasPer License Version 2.0
+# 
+# Copyright (c) 2001-2006 Michael David Adams
+# Copyright (c) 1999-2000 Image Power, Inc.
+# Copyright (c) 1999-2000 The University of British Columbia
+# 
+# All rights reserved.
+# 
+# Permission is hereby granted, free of charge, to any person (the
+# "User") obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the
+# following conditions:
+# 
+# 1.  The above copyright notices and this permission notice (which
+# includes the disclaimer below) shall be included in all copies or
+# substantial portions of the Software.
+# 
+# 2.  The name of a copyright holder shall not be used to endorse or
+# promote products derived from the Software without specific prior
+# written permission.
+# 
+# THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+# LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+# THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+# "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+# PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+# EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+# PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+# THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+# EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+# BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+# PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+# GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+# ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+# IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+# SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+# AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+# SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+# THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+# PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+# RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+# EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+# 
+# __END_OF_JASPER_LICENSE__
+
+noinst_LTLIBRARIES = libpgx.la
+libpgx_la_SOURCES = \
+       pgx_cod.h \
+       pgx_enc.h \
+       pgx_cod.c \
+       pgx_dec.c \
+       pgx_enc.c
+
+INCLUDES = -I$(top_srcdir)/src/libjasper/include
diff --git a/src/libjasper/pgx/Makefile.in b/src/libjasper/pgx/Makefile.in
new file mode 100644 (file)
index 0000000..b2f360b
--- /dev/null
@@ -0,0 +1,510 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# Copyright (c) 2001-2003 Michael David Adams.
+# All rights reserved. 
+
+# __START_OF_JASPER_LICENSE__
+# 
+# JasPer License Version 2.0
+# 
+# Copyright (c) 2001-2006 Michael David Adams
+# Copyright (c) 1999-2000 Image Power, Inc.
+# Copyright (c) 1999-2000 The University of British Columbia
+# 
+# All rights reserved.
+# 
+# Permission is hereby granted, free of charge, to any person (the
+# "User") obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the
+# following conditions:
+# 
+# 1.  The above copyright notices and this permission notice (which
+# includes the disclaimer below) shall be included in all copies or
+# substantial portions of the Software.
+# 
+# 2.  The name of a copyright holder shall not be used to endorse or
+# promote products derived from the Software without specific prior
+# written permission.
+# 
+# THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+# LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+# THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+# "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+# PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+# EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+# PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+# THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+# EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+# BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+# PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+# GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+# ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+# IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+# SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+# AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+# SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+# THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+# PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+# RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+# EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+# 
+# __END_OF_JASPER_LICENSE__
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = src/libjasper/pgx
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/acaux/mkinstalldirs
+CONFIG_HEADER =  \
+       $(top_builddir)/src/libjasper/include/jasper/jas_config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libpgx_la_LIBADD =
+am_libpgx_la_OBJECTS = pgx_cod.lo pgx_dec.lo pgx_enc.lo
+libpgx_la_OBJECTS = $(am_libpgx_la_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/libjasper/include/jasper
+depcomp = $(SHELL) $(top_srcdir)/acaux/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+       $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libpgx_la_SOURCES)
+DIST_SOURCES = $(libpgx_la_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+HAVE_LIBJPEG_FALSE = @HAVE_LIBJPEG_FALSE@
+HAVE_LIBJPEG_TRUE = @HAVE_LIBJPEG_TRUE@
+HAVE_OPENGL_FALSE = @HAVE_OPENGL_FALSE@
+HAVE_OPENGL_TRUE = @HAVE_OPENGL_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAS_MAJOR_VERSION = @JAS_MAJOR_VERSION@
+JAS_MICRO_VERSION = @JAS_MICRO_VERSION@
+JAS_MINOR_VERSION = @JAS_MINOR_VERSION@
+JAS_RPM_RELEASE = @JAS_RPM_RELEASE@
+JAS_VERSION = @JAS_VERSION@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_AGE = @LT_AGE@
+LT_CURRENT = @LT_CURRENT@
+LT_RELEASE = @LT_RELEASE@
+LT_REVISION = @LT_REVISION@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OPENGL_LIBS = @OPENGL_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+noinst_LTLIBRARIES = libpgx.la
+libpgx_la_SOURCES = \
+       pgx_cod.h \
+       pgx_enc.h \
+       pgx_cod.c \
+       pgx_dec.c \
+       pgx_enc.c
+
+INCLUDES = -I$(top_srcdir)/src/libjasper/include
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/libjasper/pgx/Makefile'; \
+       cd $(top_srcdir) && \
+         $(AUTOMAKE) --foreign  src/libjasper/pgx/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+       -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+       @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+         test "$$dir" != "$$p" || dir=.; \
+         echo "rm -f \"$${dir}/so_locations\""; \
+         rm -f "$${dir}/so_locations"; \
+       done
+libpgx.la: $(libpgx_la_OBJECTS) $(libpgx_la_DEPENDENCIES) 
+       $(LINK)  $(libpgx_la_LDFLAGS) $(libpgx_la_OBJECTS) $(libpgx_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pgx_cod.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pgx_dec.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pgx_enc.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+
+distclean-libtool:
+       -rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+           $$tags $$unique; \
+       fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       test -z "$(CTAGS_ARGS)$$tags$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$tags $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && cd $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+       list='$(DISTFILES)'; for file in $$list; do \
+         case $$file in \
+           $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+           $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+         esac; \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+         if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+           dir="/$$dir"; \
+           $(mkdir_p) "$(distdir)$$dir"; \
+         else \
+           dir=''; \
+         fi; \
+         if test -d $$d/$$file; then \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+           fi; \
+           cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+         else \
+           test -f $(distdir)/$$file \
+           || cp -p $$d/$$file $(distdir)/$$file \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+         `test -z '$(STRIP)' || \
+           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+       mostlyclean-am
+
+distclean: distclean-am
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+       clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+       distclean-compile distclean-generic distclean-libtool \
+       distclean-tags distdir dvi dvi-am html html-am info info-am \
+       install install-am install-data install-data-am install-exec \
+       install-exec-am install-info install-info-am install-man \
+       install-strip installcheck installcheck-am installdirs \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+       pdf pdf-am ps ps-am tags uninstall uninstall-am \
+       uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/libjasper/pgx/pgx_cod.c b/src/libjasper/pgx/pgx_cod.c
new file mode 100644 (file)
index 0000000..8950788
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include "pgx_cod.h"
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+void pgx_dumphdr(FILE *out, pgx_hdr_t *hdr)
+{
+       fprintf(out, "byteorder=%s sgnd=%s prec=%d width=%d height=%d\n",
+         hdr->bigendian ? "bigendian" : "littleendian",
+         hdr->sgnd ? "signed" : "unsigned",
+         hdr->prec, hdr->width, hdr->height);
+}
diff --git a/src/libjasper/pgx/pgx_cod.h b/src/libjasper/pgx/pgx_cod.h
new file mode 100644 (file)
index 0000000..79a21e8
--- /dev/null
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * PGX Format Library
+ *
+ * $Id$
+ */
+
+#ifndef PGX_COD_H
+#define PGX_COD_H
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <stdio.h>
+
+#include "jasper/jas_types.h"
+
+/******************************************************************************\
+* Constants.
+\******************************************************************************/
+
+#define PGX_MAGIC      0x5047
+#define PGX_MAGICLEN   2
+
+/******************************************************************************\
+* Types.
+\******************************************************************************/
+
+typedef struct {
+
+       uint_fast16_t magic;
+       /* The signature. */
+
+       bool bigendian;
+       /* The byte ordering used. */
+
+       bool sgnd;
+       /* The signedness of the samples. */
+
+       uint_fast32_t prec;
+       /* The precision of the samples. */
+
+       uint_fast32_t width;
+       /* The width of the component. */
+
+       uint_fast32_t height;
+       /* The height of the component. */
+
+} pgx_hdr_t;
+
+/******************************************************************************\
+* Functions.
+\******************************************************************************/
+
+void pgx_dumphdr(FILE *out, pgx_hdr_t *hdr);
+
+#endif
diff --git a/src/libjasper/pgx/pgx_dec.c b/src/libjasper/pgx/pgx_dec.c
new file mode 100644 (file)
index 0000000..560eae4
--- /dev/null
@@ -0,0 +1,414 @@
+/*
+ * Copyright (c) 2001-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <assert.h>
+#include <ctype.h>
+
+#include "jasper/jas_tvp.h"
+#include "jasper/jas_stream.h"
+#include "jasper/jas_image.h"
+#include "jasper/jas_string.h"
+
+#include "pgx_cod.h"
+
+/******************************************************************************\
+* Local prototypes.
+\******************************************************************************/
+
+static int pgx_gethdr(jas_stream_t *in, pgx_hdr_t *hdr);
+static int pgx_getdata(jas_stream_t *in, pgx_hdr_t *hdr, jas_image_t *image);
+static int_fast32_t pgx_getword(jas_stream_t *in, bool bigendian, int prec);
+static int pgx_getsgnd(jas_stream_t *in, bool *sgnd);
+static int pgx_getbyteorder(jas_stream_t *in, bool *bigendian);
+static int pgx_getc(jas_stream_t *in);
+static int pgx_getuint32(jas_stream_t *in, uint_fast32_t *val);
+static jas_seqent_t pgx_wordtoint(uint_fast32_t word, int prec, bool sgnd);
+
+/******************************************************************************\
+* Code for load operation.
+\******************************************************************************/
+
+/* Load an image from a stream in the PGX format. */
+
+jas_image_t *pgx_decode(jas_stream_t *in, char *optstr)
+{
+       jas_image_t *image;
+       pgx_hdr_t hdr;
+       jas_image_cmptparm_t cmptparm;
+
+       /* Avoid compiler warnings about unused parameters. */
+       optstr = 0;
+
+       image = 0;
+
+       if (pgx_gethdr(in, &hdr)) {
+               goto error;
+       }
+
+#ifdef PGX_DEBUG
+       pgx_dumphdr(stderr, &hdr);
+#endif
+
+       if (!(image = jas_image_create0())) {
+               goto error;
+       }
+       cmptparm.tlx = 0;
+       cmptparm.tly = 0;
+       cmptparm.hstep = 1;
+       cmptparm.vstep = 1;
+       cmptparm.width = hdr.width;
+       cmptparm.height = hdr.height;
+       cmptparm.prec = hdr.prec;
+       cmptparm.sgnd = hdr.sgnd;
+       if (jas_image_addcmpt(image, 0, &cmptparm)) {
+               goto error;
+       }
+       if (pgx_getdata(in, &hdr, image)) {
+               goto error;
+       }
+
+       jas_image_setclrspc(image, JAS_CLRSPC_SGRAY);
+       jas_image_setcmpttype(image, 0,
+         JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_GRAY_Y));
+
+       return image;
+
+error:
+       if (image) {
+               jas_image_destroy(image);
+       }
+       return 0;
+}
+
+/******************************************************************************\
+* Code for validate operation.
+\******************************************************************************/
+
+int pgx_validate(jas_stream_t *in)
+{
+       uchar buf[PGX_MAGICLEN];
+       uint_fast32_t magic;
+       int i;
+       int n;
+
+       assert(JAS_STREAM_MAXPUTBACK >= PGX_MAGICLEN);
+
+       /* Read the validation data (i.e., the data used for detecting
+         the format). */
+       if ((n = jas_stream_read(in, buf, PGX_MAGICLEN)) < 0) {
+               return -1;
+       }
+
+       /* Put the validation data back onto the stream, so that the
+         stream position will not be changed. */
+       for (i = n - 1; i >= 0; --i) {
+               if (jas_stream_ungetc(in, buf[i]) == EOF) {
+                       return -1;
+               }
+       }
+
+       /* Did we read enough data? */
+       if (n < PGX_MAGICLEN) {
+               return -1;
+       }
+
+       /* Compute the signature value. */
+       magic = (buf[0] << 8) | buf[1];
+
+       /* Ensure that the signature is correct for this format. */
+       if (magic != PGX_MAGIC) {
+               return -1;
+       }
+
+       return 0;
+}
+
+/******************************************************************************\
+*
+\******************************************************************************/
+
+static int pgx_gethdr(jas_stream_t *in, pgx_hdr_t *hdr)
+{
+       int c;
+       uchar buf[2];
+
+       if ((c = jas_stream_getc(in)) == EOF) {
+               goto error;
+       }
+       buf[0] = c;
+       if ((c = jas_stream_getc(in)) == EOF) {
+               goto error;
+       }
+       buf[1] = c;
+       hdr->magic = buf[0] << 8 | buf[1];
+       if (hdr->magic != PGX_MAGIC) {
+               goto error;
+       }
+       if ((c = pgx_getc(in)) == EOF || !isspace(c)) {
+               goto error;
+       }
+       if (pgx_getbyteorder(in, &hdr->bigendian)) {
+               goto error;
+       }
+       if (pgx_getsgnd(in, &hdr->sgnd)) {
+               goto error;
+       }
+       if (pgx_getuint32(in, &hdr->prec)) {
+               goto error;
+       }
+       if (pgx_getuint32(in, &hdr->width)) {
+               goto error;
+       }
+       if (pgx_getuint32(in, &hdr->height)) {
+               goto error;
+       }
+       return 0;
+
+error:
+       return -1;
+}
+
+static int pgx_getdata(jas_stream_t *in, pgx_hdr_t *hdr, jas_image_t *image)
+{
+       jas_matrix_t *data;
+       uint_fast32_t x;
+       uint_fast32_t y;
+       uint_fast32_t word;
+       int_fast32_t v;
+
+       data = 0;
+
+       if (!(data = jas_matrix_create(1, hdr->width))) {
+               goto error;
+       }
+       for (y = 0; y < hdr->height; ++y) {
+               for (x = 0; x < hdr->width; ++x) {
+                       /* Need to adjust signed value. */
+                       if ((v = pgx_getword(in, hdr->bigendian, hdr->prec)) < 0) {
+                               goto error;
+                       }
+                       word = v;
+                       v = pgx_wordtoint(word, hdr->prec, hdr->sgnd);
+                       jas_matrix_set(data, 0, x, v);
+               }
+               if (jas_image_writecmpt(image, 0, 0, y, hdr->width, 1, data)) {
+                       goto error;
+               }
+       }
+       jas_matrix_destroy(data);
+       return 0;
+
+error:
+       if (data) {
+               jas_matrix_destroy(data);
+       }
+       return -1;
+}
+
+static int_fast32_t pgx_getword(jas_stream_t *in, bool bigendian, int prec)
+{
+       uint_fast32_t val;
+       int i;
+       int j;
+       int c;
+       int wordsize;
+
+       wordsize = (prec + 7) / 8;
+
+       if (prec > 32) {
+               goto error;
+       }
+
+       val = 0;
+       for (i = 0; i < wordsize; ++i) {
+               if ((c = jas_stream_getc(in)) == EOF) {
+                       goto error;
+               }
+               j = bigendian ? (wordsize - 1 - i) : i;
+               val = val | ((c & 0xff) << (8 * j));
+       }
+       val &= (1 << prec) - 1;
+       return val;
+
+error:
+       return -1;
+}
+
+static int pgx_getc(jas_stream_t *in)
+{
+       int c;
+       for (;;) {
+               if ((c = jas_stream_getc(in)) == EOF) {
+                       return -1;
+               }
+               if (c != '#') {
+                       return c;
+               }
+               do {
+                       if ((c = jas_stream_getc(in)) == EOF) {
+                               return -1;
+                       }
+               } while (c != '\n' && c != '\r');
+       }
+}
+
+static int pgx_getbyteorder(jas_stream_t *in, bool *bigendian)
+{
+       int c;
+       char buf[2];
+
+       do {
+               if ((c = pgx_getc(in)) == EOF) {
+                       return -1;
+               }
+       } while (isspace(c));
+
+       buf[0] = c;
+       if ((c = pgx_getc(in)) == EOF) {
+               goto error;
+       }
+       buf[1] = c;
+       if (buf[0] == 'M' && buf[1] == 'L') {
+               *bigendian = true;
+       } else if (buf[0] == 'L' && buf[1] == 'M') {
+               *bigendian = false;
+       } else {
+               goto error;
+       }
+
+       while ((c = pgx_getc(in)) != EOF && !isspace(c)) {
+               ;
+       }
+       if (c == EOF) {
+               goto error;
+       }
+       return 0;
+
+error:
+       return -1;
+}
+
+static int pgx_getsgnd(jas_stream_t *in, bool *sgnd)
+{
+       int c;
+
+       do {
+               if ((c = pgx_getc(in)) == EOF) {
+                       return -1;
+               }
+       } while (isspace(c));
+
+       if (c == '+') {
+               *sgnd = false;
+       } else if (c == '-') {
+               *sgnd = true;
+       } else {
+               goto error;
+       }
+       while ((c = pgx_getc(in)) != EOF && !isspace(c)) {
+               ;
+       }
+       if (c == EOF) {
+               goto error;
+       }
+       return 0;
+
+error:
+       return -1;
+}
+
+static int pgx_getuint32(jas_stream_t *in, uint_fast32_t *val)
+{
+       int c;
+       uint_fast32_t v;
+
+       do {
+               if ((c = pgx_getc(in)) == EOF) {
+                       return -1;
+               }
+       } while (isspace(c));
+
+       v = 0;
+       while (isdigit(c)) {
+               v = 10 * v + c - '0';
+               if ((c = pgx_getc(in)) < 0) {
+                       return -1;
+               }
+       }
+       if (!isspace(c)) {
+               return -1;
+       }
+       *val = v;
+
+       return 0;
+}
+
+static jas_seqent_t pgx_wordtoint(uint_fast32_t v, int prec, bool sgnd)
+{
+       jas_seqent_t ret;
+       v &= (1 << prec) - 1;
+       ret = (sgnd && (v & (1 << (prec - 1)))) ? (v - (1 << prec)) : v;
+       return ret;
+}
diff --git a/src/libjasper/pgx/pgx_enc.c b/src/libjasper/pgx/pgx_enc.c
new file mode 100644 (file)
index 0000000..070edfb
--- /dev/null
@@ -0,0 +1,230 @@
+/*
+ * Copyright (c) 2001-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <assert.h>
+
+#include "jasper/jas_tvp.h"
+#include "jasper/jas_stream.h"
+#include "jasper/jas_image.h"
+#include "jasper/jas_string.h"
+#include "jasper/jas_debug.h"
+
+#include "pgx_cod.h"
+#include "pgx_enc.h"
+
+/******************************************************************************\
+* Local functions.
+\******************************************************************************/
+
+static int pgx_puthdr(jas_stream_t *out, pgx_hdr_t *hdr);
+static int pgx_putdata(jas_stream_t *out, pgx_hdr_t *hdr, jas_image_t *image, int cmpt);
+static int pgx_putword(jas_stream_t *out, bool bigendian, int prec,
+  uint_fast32_t val);
+static uint_fast32_t pgx_inttoword(int_fast32_t val, int prec, bool sgnd);
+
+/******************************************************************************\
+* Code for save operation.
+\******************************************************************************/
+
+/* Save an image to a stream in the the PGX format. */
+
+int pgx_encode(jas_image_t *image, jas_stream_t *out, char *optstr)
+{
+       pgx_hdr_t hdr;
+       uint_fast32_t width;
+       uint_fast32_t height;
+       bool sgnd;
+       int prec;
+       pgx_enc_t encbuf;
+       pgx_enc_t *enc = &encbuf;
+
+       /* Avoid compiler warnings about unused parameters. */
+       optstr = 0;
+
+       switch (jas_clrspc_fam(jas_image_clrspc(image))) {
+       case JAS_CLRSPC_FAM_GRAY:
+               if ((enc->cmpt = jas_image_getcmptbytype(image,
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_GRAY_Y))) < 0) {
+                       jas_eprintf("error: missing color component\n");
+                       return -1;
+               }
+               break;
+       default:
+               jas_eprintf("error: BMP format does not support color space\n");
+               return -1;
+               break;
+       }
+
+       width = jas_image_cmptwidth(image, enc->cmpt);
+       height = jas_image_cmptheight(image, enc->cmpt);
+       prec = jas_image_cmptprec(image, enc->cmpt);
+       sgnd = jas_image_cmptsgnd(image, enc->cmpt);
+
+       /* The PGX format is quite limited in the set of image geometries
+         that it can handle.  Here, we check to ensure that the image to
+         be saved can actually be represented reasonably accurately using the
+         PGX format. */
+       /* There must be exactly one component. */
+       if (jas_image_numcmpts(image) > 1 || prec > 16) {
+               jas_eprintf("The PNM format cannot be used to represent an image with this geometry.\n");
+               return -1;
+       }
+
+       hdr.magic = PGX_MAGIC;
+       hdr.bigendian = true;
+       hdr.sgnd = sgnd;
+       hdr.prec = prec;
+       hdr.width = width;
+       hdr.height = height;
+
+#ifdef PGX_DEBUG
+       pgx_dumphdr(stderr, &hdr);
+#endif
+
+       if (pgx_puthdr(out, &hdr)) {
+               return -1;
+       }
+
+       if (pgx_putdata(out, &hdr, image, enc->cmpt)) {
+               return -1;
+       }
+
+       return 0;
+}
+
+/******************************************************************************\
+\******************************************************************************/
+
+static int pgx_puthdr(jas_stream_t *out, pgx_hdr_t *hdr)
+{
+       jas_stream_printf(out, "%c%c", hdr->magic >> 8, hdr->magic & 0xff);
+       jas_stream_printf(out, " %s %s %d %ld %ld\n", hdr->bigendian ? "ML" : "LM",
+         hdr->sgnd ? "-" : "+", hdr->prec, (long) hdr->width, (long) hdr->height);
+       if (jas_stream_error(out)) {
+               return -1;
+       }
+       return 0;
+}
+
+static int pgx_putdata(jas_stream_t *out, pgx_hdr_t *hdr, jas_image_t *image, int cmpt)
+{
+       jas_matrix_t *data;
+       uint_fast32_t x;
+       uint_fast32_t y;
+       int_fast32_t v;
+       uint_fast32_t word;
+
+       data = 0;
+
+       if (!(data = jas_matrix_create(1, hdr->width))) {
+               goto error;
+       }
+       for (y = 0; y < hdr->height; ++y) {
+               if (jas_image_readcmpt(image, cmpt, 0, y, hdr->width, 1, data)) {
+                       goto error;
+               }
+               for (x = 0; x < hdr->width; ++x) {
+                       v = jas_matrix_get(data, 0, x);
+                       word = pgx_inttoword(v, hdr->prec, hdr->sgnd);
+                       if (pgx_putword(out, hdr->bigendian, hdr->prec, word)) {
+                               goto error;
+                       }
+               }
+       }
+       jas_matrix_destroy(data);
+       data = 0;
+       return 0;
+
+error:
+       if (data) {
+               jas_matrix_destroy(data);
+       }
+       return -1;
+}
+
+static int pgx_putword(jas_stream_t *out, bool bigendian, int prec,
+  uint_fast32_t val)
+{
+       int i;
+       int j;
+       int wordsize;
+
+       val &= (1 << prec) - 1;
+       wordsize = (prec + 7) /8;
+       for (i = 0; i < wordsize; ++i) {
+               j = bigendian ? (wordsize - 1 - i) : i;
+               if (jas_stream_putc(out, (val >> (8 * j)) & 0xff) == EOF) {
+                       return -1;
+               }
+       }
+       return 0;
+}
+
+static uint_fast32_t pgx_inttoword(jas_seqent_t v, int prec, bool sgnd)
+{
+       uint_fast32_t ret;
+       ret = ((sgnd && v < 0) ? ((1 << prec) + v) : v) & ((1 << prec) - 1);
+       return ret;
+}
diff --git a/src/libjasper/pgx/pgx_enc.h b/src/libjasper/pgx/pgx_enc.h
new file mode 100644 (file)
index 0000000..fce059a
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+#ifndef PGX_ENC_H
+#define PGX_ENC_H
+
+typedef struct {
+       int cmpt;
+} pgx_enc_t;
+
+#endif
diff --git a/src/libjasper/pnm/Makefile.am b/src/libjasper/pnm/Makefile.am
new file mode 100644 (file)
index 0000000..5eb88ee
--- /dev/null
@@ -0,0 +1,67 @@
+# Copyright (c) 2001-2002 Michael David Adams.
+# All rights reserved. 
+
+# __START_OF_JASPER_LICENSE__
+# 
+# JasPer License Version 2.0
+# 
+# Copyright (c) 2001-2006 Michael David Adams
+# Copyright (c) 1999-2000 Image Power, Inc.
+# Copyright (c) 1999-2000 The University of British Columbia
+# 
+# All rights reserved.
+# 
+# Permission is hereby granted, free of charge, to any person (the
+# "User") obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the
+# following conditions:
+# 
+# 1.  The above copyright notices and this permission notice (which
+# includes the disclaimer below) shall be included in all copies or
+# substantial portions of the Software.
+# 
+# 2.  The name of a copyright holder shall not be used to endorse or
+# promote products derived from the Software without specific prior
+# written permission.
+# 
+# THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+# LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+# THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+# "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+# PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+# EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+# PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+# THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+# EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+# BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+# PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+# GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+# ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+# IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+# SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+# AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+# SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+# THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+# PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+# RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+# EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+# 
+# __END_OF_JASPER_LICENSE__
+
+noinst_LTLIBRARIES = libpnm.la
+libpnm_la_SOURCES = \
+       pnm_cod.h \
+       pnm_enc.h \
+       pnm_cod.c \
+       pnm_dec.c \
+       pnm_enc.c
+
+INCLUDES = -I$(top_srcdir)/src/libjasper/include
diff --git a/src/libjasper/pnm/Makefile.in b/src/libjasper/pnm/Makefile.in
new file mode 100644 (file)
index 0000000..93385a8
--- /dev/null
@@ -0,0 +1,510 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# Copyright (c) 2001-2002 Michael David Adams.
+# All rights reserved. 
+
+# __START_OF_JASPER_LICENSE__
+# 
+# JasPer License Version 2.0
+# 
+# Copyright (c) 2001-2006 Michael David Adams
+# Copyright (c) 1999-2000 Image Power, Inc.
+# Copyright (c) 1999-2000 The University of British Columbia
+# 
+# All rights reserved.
+# 
+# Permission is hereby granted, free of charge, to any person (the
+# "User") obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the
+# following conditions:
+# 
+# 1.  The above copyright notices and this permission notice (which
+# includes the disclaimer below) shall be included in all copies or
+# substantial portions of the Software.
+# 
+# 2.  The name of a copyright holder shall not be used to endorse or
+# promote products derived from the Software without specific prior
+# written permission.
+# 
+# THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+# LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+# THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+# "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+# PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+# EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+# PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+# THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+# EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+# BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+# PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+# GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+# ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+# IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+# SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+# AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+# SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+# THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+# PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+# RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+# EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+# 
+# __END_OF_JASPER_LICENSE__
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = src/libjasper/pnm
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/acaux/mkinstalldirs
+CONFIG_HEADER =  \
+       $(top_builddir)/src/libjasper/include/jasper/jas_config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libpnm_la_LIBADD =
+am_libpnm_la_OBJECTS = pnm_cod.lo pnm_dec.lo pnm_enc.lo
+libpnm_la_OBJECTS = $(am_libpnm_la_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/libjasper/include/jasper
+depcomp = $(SHELL) $(top_srcdir)/acaux/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+       $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libpnm_la_SOURCES)
+DIST_SOURCES = $(libpnm_la_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+HAVE_LIBJPEG_FALSE = @HAVE_LIBJPEG_FALSE@
+HAVE_LIBJPEG_TRUE = @HAVE_LIBJPEG_TRUE@
+HAVE_OPENGL_FALSE = @HAVE_OPENGL_FALSE@
+HAVE_OPENGL_TRUE = @HAVE_OPENGL_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAS_MAJOR_VERSION = @JAS_MAJOR_VERSION@
+JAS_MICRO_VERSION = @JAS_MICRO_VERSION@
+JAS_MINOR_VERSION = @JAS_MINOR_VERSION@
+JAS_RPM_RELEASE = @JAS_RPM_RELEASE@
+JAS_VERSION = @JAS_VERSION@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_AGE = @LT_AGE@
+LT_CURRENT = @LT_CURRENT@
+LT_RELEASE = @LT_RELEASE@
+LT_REVISION = @LT_REVISION@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OPENGL_LIBS = @OPENGL_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+noinst_LTLIBRARIES = libpnm.la
+libpnm_la_SOURCES = \
+       pnm_cod.h \
+       pnm_enc.h \
+       pnm_cod.c \
+       pnm_dec.c \
+       pnm_enc.c
+
+INCLUDES = -I$(top_srcdir)/src/libjasper/include
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/libjasper/pnm/Makefile'; \
+       cd $(top_srcdir) && \
+         $(AUTOMAKE) --foreign  src/libjasper/pnm/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+       -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+       @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+         test "$$dir" != "$$p" || dir=.; \
+         echo "rm -f \"$${dir}/so_locations\""; \
+         rm -f "$${dir}/so_locations"; \
+       done
+libpnm.la: $(libpnm_la_OBJECTS) $(libpnm_la_DEPENDENCIES) 
+       $(LINK)  $(libpnm_la_LDFLAGS) $(libpnm_la_OBJECTS) $(libpnm_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pnm_cod.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pnm_dec.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pnm_enc.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+
+distclean-libtool:
+       -rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+           $$tags $$unique; \
+       fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       test -z "$(CTAGS_ARGS)$$tags$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$tags $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && cd $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+       list='$(DISTFILES)'; for file in $$list; do \
+         case $$file in \
+           $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+           $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+         esac; \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+         if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+           dir="/$$dir"; \
+           $(mkdir_p) "$(distdir)$$dir"; \
+         else \
+           dir=''; \
+         fi; \
+         if test -d $$d/$$file; then \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+           fi; \
+           cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+         else \
+           test -f $(distdir)/$$file \
+           || cp -p $$d/$$file $(distdir)/$$file \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+         `test -z '$(STRIP)' || \
+           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+       mostlyclean-am
+
+distclean: distclean-am
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+       clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+       distclean-compile distclean-generic distclean-libtool \
+       distclean-tags distdir dvi dvi-am html html-am info info-am \
+       install install-am install-data install-data-am install-exec \
+       install-exec-am install-info install-info-am install-man \
+       install-strip installcheck installcheck-am installdirs \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+       pdf pdf-am ps ps-am tags uninstall uninstall-am \
+       uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/libjasper/pnm/pnm_cod.c b/src/libjasper/pnm/pnm_cod.c
new file mode 100644 (file)
index 0000000..56e09a7
--- /dev/null
@@ -0,0 +1,146 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Portable Pixmap/Graymap Format Support
+ *
+ * $Id$
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <ctype.h>
+#include <math.h>
+#include <stdlib.h>
+#include <assert.h>
+
+#include "jasper/jas_math.h"
+
+#include "pnm_cod.h"
+
+/******************************************************************************\
+* Miscellaneous utilities.
+\******************************************************************************/
+
+/* Determine the PNM type (i.e., PGM or PPM) from the magic number. */
+int pnm_type(uint_fast16_t magic)
+{
+       int type;
+       switch (magic) {
+       case PNM_MAGIC_TXTPPM:
+       case PNM_MAGIC_BINPPM:
+               type = PNM_TYPE_PPM;
+               break;
+       case PNM_MAGIC_TXTPGM:
+       case PNM_MAGIC_BINPGM:
+               type = PNM_TYPE_PGM;
+               break;
+       case PNM_MAGIC_TXTPBM:
+       case PNM_MAGIC_BINPBM:
+               type = PNM_TYPE_PBM;
+               break;
+       default:
+               /* This should not happen. */
+               abort();
+               break;
+       }
+       return type;
+}
+
+/* Determine the PNM format (i.e., text or binary) from the magic number. */
+int pnm_fmt(uint_fast16_t magic)
+{
+       int fmt;
+       switch (magic) {
+       case PNM_MAGIC_TXTPBM:
+       case PNM_MAGIC_TXTPGM:
+       case PNM_MAGIC_TXTPPM:
+               fmt = PNM_FMT_TXT;
+               break;
+       case PNM_MAGIC_BINPBM:
+       case PNM_MAGIC_BINPGM:
+       case PNM_MAGIC_BINPPM:
+               fmt = PNM_FMT_BIN;
+               break;
+       default:
+               /* This should not happen. */
+               abort();
+               break;
+       }
+       return fmt;
+}
+
+/* Determine the depth (i.e., precision) from the maximum value. */
+int pnm_maxvaltodepth(uint_fast32_t maxval)
+{
+       int n;
+
+       n = 0;
+       while (maxval > 0) {
+               maxval >>= 1;
+               ++n;
+       }
+       return n;
+}
diff --git a/src/libjasper/pnm/pnm_cod.h b/src/libjasper/pnm/pnm_cod.h
new file mode 100644 (file)
index 0000000..e73e223
--- /dev/null
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Portable Pixmap/Graymap Format Support
+ *
+ * $Id$
+ */
+
+#ifndef PNM_COD_H
+#define PNM_COD_H
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include "jasper/jas_types.h"
+
+/******************************************************************************\
+* Constants.
+\******************************************************************************/
+
+/* Magic numbers. */
+#define PNM_MAGIC_TXTPBM       0x5031 /* Text Portable BitMap (P1) */
+#define PNM_MAGIC_TXTPGM       0x5032 /* Text Portable GrayMap (P2) */
+#define PNM_MAGIC_TXTPPM       0x5033 /* Text Portable PixMap (P3) */
+#define PNM_MAGIC_BINPBM       0x5034 /* Binary Portable BitMap (P4) */
+#define PNM_MAGIC_BINPGM       0x5035 /* Binary Portable GrayMap (P5) */
+#define PNM_MAGIC_BINPPM       0x5036 /* Binary Portable PixMap (P6) */
+#define        PNM_MAGIC_PAM           0x5037 /* PAM (P7) */
+
+/* Type of image data. */
+#define PNM_TYPE_PPM   0 /* PixMap */
+#define PNM_TYPE_PGM   1 /* GrayMap */
+#define PNM_TYPE_PBM   2 /* BitMap */
+
+/* Format of image data. */
+#define PNM_FMT_TXT    0 /* Text */
+#define PNM_FMT_BIN    1 /* Binary */
+
+#define        PNM_MAXLINELEN  79
+
+#define        PNM_TUPLETYPE_UNKNOWN   0
+#define        PNM_TUPLETYPE_MONO      1
+#define        PNM_TUPLETYPE_GRAY      2
+#define        PNM_TUPLETYPE_GRAYA     3
+#define        PNM_TUPLETYPE_RGB       4
+#define        PNM_TUPLETYPE_RGBA      5
+
+/******************************************************************************\
+* Types.
+\******************************************************************************/
+
+/* File header. */
+
+typedef struct {
+
+       int magic;
+       /* The magic number. */
+
+       int width;
+       /* The image width. */
+
+       int height;
+       /* The image height. */
+
+       int numcmpts;
+
+       int maxval;
+       /* The maximum allowable sample value. */
+
+#if 0
+       int tupletype;
+#endif
+
+       bool sgnd;
+       /* The sample data is signed. */
+
+} pnm_hdr_t;
+
+/******************************************************************************\
+* Functions.
+\******************************************************************************/
+
+int pnm_type(uint_fast16_t magic);
+/* Determine type (i.e., PGM or PPM) from magic number. */
+
+int pnm_fmt(uint_fast16_t magic);
+/* Determine format (i.e., text or binary) from magic number. */
+
+int pnm_maxvaltodepth(uint_fast32_t maxval);
+/* Determine depth (i.e., precision) from maximum value. */
+
+#define        PNM_ONES(n) \
+       (((n) < 32) ? ((1UL << (n)) - 1) : 0xffffffffUL)
+#endif
diff --git a/src/libjasper/pnm/pnm_dec.c b/src/libjasper/pnm/pnm_dec.c
new file mode 100644 (file)
index 0000000..f2ca26e
--- /dev/null
@@ -0,0 +1,564 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Portable Pixmap/Graymap Format Support
+ *
+ * $Id$
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <ctype.h>
+#include <math.h>
+#include <stdlib.h>
+#include <assert.h>
+
+#include "jasper/jas_types.h"
+#include "jasper/jas_stream.h"
+#include "jasper/jas_image.h"
+
+#include "pnm_cod.h"
+
+/******************************************************************************\
+* Local function prototypes.
+\******************************************************************************/
+
+static int pnm_gethdr(jas_stream_t *in, pnm_hdr_t *hdr);
+static int pnm_getdata(jas_stream_t *in, pnm_hdr_t *hdr, jas_image_t *image);
+
+static int pnm_getsintstr(jas_stream_t *in, int_fast32_t *val);
+static int pnm_getuintstr(jas_stream_t *in, uint_fast32_t *val);
+static int pnm_getbitstr(jas_stream_t *in, int *val);
+static int pnm_getc(jas_stream_t *in);
+
+static int pnm_getsint(jas_stream_t *in, int wordsize, int_fast32_t *val);
+static int pnm_getuint(jas_stream_t *in, int wordsize, uint_fast32_t *val);
+static int pnm_getint16(jas_stream_t *in, int *val);
+#define        pnm_getuint32(in, val)  pnm_getuint(in, 32, val)
+
+/******************************************************************************\
+* Local data.
+\******************************************************************************/
+
+static int pnm_allowtrunc = 1;
+
+/******************************************************************************\
+* Load function.
+\******************************************************************************/
+
+jas_image_t *pnm_decode(jas_stream_t *in, char *opts)
+{
+       pnm_hdr_t hdr;
+       jas_image_t *image;
+       jas_image_cmptparm_t cmptparms[3];
+       jas_image_cmptparm_t *cmptparm;
+       int i;
+
+       if (opts) {
+               jas_eprintf("warning: ignoring options\n");
+       }
+
+       /* Read the file header. */
+       if (pnm_gethdr(in, &hdr)) {
+               return 0;
+       }
+
+       /* Create an image of the correct size. */
+       for (i = 0, cmptparm = cmptparms; i < hdr.numcmpts; ++i, ++cmptparm) {
+               cmptparm->tlx = 0;
+               cmptparm->tly = 0;
+               cmptparm->hstep = 1;
+               cmptparm->vstep = 1;
+               cmptparm->width = hdr.width;
+               cmptparm->height = hdr.height;
+               cmptparm->prec = pnm_maxvaltodepth(hdr.maxval);
+               cmptparm->sgnd = hdr.sgnd;
+       }
+       if (!(image = jas_image_create(hdr.numcmpts, cmptparms, JAS_CLRSPC_UNKNOWN))) {
+               return 0;
+       }
+
+       if (hdr.numcmpts == 3) {
+               jas_image_setclrspc(image, JAS_CLRSPC_SRGB);
+               jas_image_setcmpttype(image, 0,
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_R));
+               jas_image_setcmpttype(image, 1,
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_G));
+               jas_image_setcmpttype(image, 2,
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_B));
+       } else {
+               jas_image_setclrspc(image, JAS_CLRSPC_SGRAY);
+               jas_image_setcmpttype(image, 0,
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_GRAY_Y));
+       }
+
+       /* Read image data from stream into image. */
+       if (pnm_getdata(in, &hdr, image)) {
+               jas_image_destroy(image);
+               return 0;
+       }
+
+       return image;
+}
+
+/******************************************************************************\
+* Validation function.
+\******************************************************************************/
+
+int pnm_validate(jas_stream_t *in)
+{
+       uchar buf[2];
+       int i;
+       int n;
+
+       assert(JAS_STREAM_MAXPUTBACK >= 2);
+
+       /* Read the first two characters that constitute the signature. */
+       if ((n = jas_stream_read(in, buf, 2)) < 0) {
+               return -1;
+       }
+       /* Put these characters back to the stream. */
+       for (i = n - 1; i >= 0; --i) {
+               if (jas_stream_ungetc(in, buf[i]) == EOF) {
+                       return -1;
+               }
+       }
+       /* Did we read enough data? */
+       if (n < 2) {
+               return -1;
+       }
+       /* Is this the correct signature for a PNM file? */
+       if (buf[0] == 'P' && isdigit(buf[1])) {
+               return 0;
+       }
+       return -1;
+}
+
+/******************************************************************************\
+* Functions for reading the header.
+\******************************************************************************/
+
+static int pnm_gethdr(jas_stream_t *in, pnm_hdr_t *hdr)
+{
+       int_fast32_t maxval;
+       int_fast32_t width;
+       int_fast32_t height;
+       if (pnm_getint16(in, &hdr->magic) || pnm_getsintstr(in, &width) ||
+         pnm_getsintstr(in, &height)) {
+               return -1;
+       }
+       hdr->width = width;
+       hdr->height = height;
+       if (pnm_type(hdr->magic) != PNM_TYPE_PBM) {
+               if (pnm_getsintstr(in, &maxval)) {
+                       return -1;
+               }
+       } else {
+               maxval = 1;
+       }
+       if (maxval < 0) {
+               hdr->maxval = -maxval;
+               hdr->sgnd = true;
+       } else {
+               hdr->maxval = maxval;
+               hdr->sgnd = false;
+       }
+
+       switch (pnm_type(hdr->magic)) {
+       case PNM_TYPE_PBM:
+       case PNM_TYPE_PGM:
+               hdr->numcmpts = 1;
+               break;
+       case PNM_TYPE_PPM:
+               hdr->numcmpts = 3;
+               break;
+       default:
+               abort();
+               break;
+       }
+
+       return 0;
+}
+
+/******************************************************************************\
+* Functions for processing the sample data.
+\******************************************************************************/
+
+static int pnm_getdata(jas_stream_t *in, pnm_hdr_t *hdr, jas_image_t *image)
+{
+       int ret;
+#if 0
+       int numcmpts;
+#endif
+       int cmptno;
+       int fmt;
+       jas_matrix_t *data[3];
+       int x;
+       int y;
+       int_fast64_t v;
+       int depth;
+       int type;
+       int c;
+       int n;
+
+       ret = -1;
+
+#if 0
+       numcmpts = jas_image_numcmpts(image);
+#endif
+       fmt = pnm_fmt(hdr->magic);
+       type = pnm_type(hdr->magic);
+       depth = pnm_maxvaltodepth(hdr->maxval);
+
+       data[0] = 0;
+       data[1] = 0;
+       data[2] = 0;
+       for (cmptno = 0; cmptno < hdr->numcmpts; ++cmptno) {
+               if (!(data[cmptno] = jas_matrix_create(1, hdr->width))) {
+                       goto done;
+               }
+       }
+
+       for (y = 0; y < hdr->height; ++y) {
+               if (type == PNM_TYPE_PBM) {
+                       if (fmt == PNM_FMT_BIN) {
+                               for (x = 0; x < hdr->width;) {
+                                       if ((c = jas_stream_getc(in)) == EOF) {
+                                               goto done;
+                                       }
+                                       n = 8;
+                                       while (n > 0 && x < hdr->width) {
+                                               jas_matrix_set(data[0], 0, x, 1 - ((c >> 7) & 1));
+                                               c <<= 1;
+                                               --n;
+                                               ++x;
+                                       }
+                               }
+                       } else {
+                               for (x = 0; x < hdr->width; ++x) {
+                                       int uv;
+                                       if (pnm_getbitstr(in, &uv)) {
+                                               goto done;
+                                       }
+                                       jas_matrix_set(data[0], 0, x, 1 - uv);
+                               }
+                       }
+               } else {
+                       for (x = 0; x < hdr->width; ++x) {
+                               for (cmptno = 0; cmptno < hdr->numcmpts; ++cmptno) {
+                                       if (fmt == PNM_FMT_BIN) {
+                                               /* The sample data is in binary format. */
+                                               if (hdr->sgnd) {
+                                                       /* The sample data is signed. */
+                                                       int_fast32_t sv;
+                                                       if (pnm_getsint(in, depth, &sv)) {
+                                                               if (!pnm_allowtrunc) {
+                                                                       goto done;
+                                                               }
+                                                               sv = 0;
+                                                       }
+                                                       v = sv;
+                                               } else {
+                                                       /* The sample data is unsigned. */
+                                                       uint_fast32_t uv;
+                                                       if (pnm_getuint(in, depth, &uv)) {
+                                                               if (!pnm_allowtrunc) {
+                                                                       goto done;
+                                                               }
+                                                               uv = 0;
+                                                       }
+                                                       v = uv;
+                                               }
+                                       } else {
+                                               /* The sample data is in text format. */
+                                               if (hdr->sgnd) {
+                                                       /* The sample data is signed. */
+                                                       int_fast32_t sv;
+                                                       if (pnm_getsintstr(in, &sv)) {
+                                                               if (!pnm_allowtrunc) {
+                                                                       goto done;
+                                                               }
+                                                               sv = 0;
+                                                       }
+                                                       v = sv;
+                                               } else {
+                                                       /* The sample data is unsigned. */
+                                                       uint_fast32_t uv;
+                                                       if (pnm_getuintstr(in, &uv)) {
+                                                               if (!pnm_allowtrunc) {
+                                                                       goto done;
+                                                               }
+                                                               uv = 0;
+                                                       }
+                                                       v = uv;
+                                               }
+                                       }
+                                       jas_matrix_set(data[cmptno], 0, x, v);
+                               }
+                       }
+               }
+               for (cmptno = 0; cmptno < hdr->numcmpts; ++cmptno) {
+                       if (jas_image_writecmpt(image, cmptno, 0, y, hdr->width, 1,
+                         data[cmptno])) {
+                               goto done;
+                       }
+               }
+       }
+
+       ret = 0;
+
+done:
+
+       for (cmptno = 0; cmptno < hdr->numcmpts; ++cmptno) {
+               if (data[cmptno]) {
+                       jas_matrix_destroy(data[cmptno]);
+               }
+       }
+
+       return ret;
+}
+
+/******************************************************************************\
+* Miscellaneous functions.
+\******************************************************************************/
+
+static int pnm_getsint(jas_stream_t *in, int wordsize, int_fast32_t *val)
+{
+       uint_fast32_t tmpval;
+
+       if (pnm_getuint(in, wordsize, &tmpval)) {
+               return -1;
+       }
+       if (val) {
+               assert((tmpval & (1 << (wordsize - 1))) == 0);
+               *val = tmpval;
+       }
+
+       return 0;
+}
+
+static int pnm_getuint(jas_stream_t *in, int wordsize, uint_fast32_t *val)
+{
+       uint_fast32_t tmpval;
+       int c;
+       int n;
+
+       tmpval = 0;
+       n = (wordsize + 7) / 8;
+       while (--n >= 0) {
+               if ((c = jas_stream_getc(in)) == EOF) {
+                       return -1;
+               }
+               tmpval = (tmpval << 8) | c;
+       }
+       tmpval &= (((uint_fast64_t) 1) << wordsize) - 1;
+       if (val) {
+               *val = tmpval;
+       }
+
+       return 0;
+}
+
+static int pnm_getbitstr(jas_stream_t *in, int *val)
+{
+       int c;
+       int_fast32_t v;
+       for (;;) {
+               if ((c = pnm_getc(in)) == EOF) {
+                       return -1;
+               }
+               if (c == '#') {
+                       for (;;) {
+                               if ((c = pnm_getc(in)) == EOF) {
+                                       return -1;
+                               }
+                               if (c == '\n') {
+                                       break;
+                               }
+                       }
+               } else if (c == '0' || c == '1') {
+                       v = c - '0';
+                       break;
+               }
+       }
+       if (val) {
+               *val = v;
+       }
+       return 0;
+}
+
+static int pnm_getuintstr(jas_stream_t *in, uint_fast32_t *val)
+{
+       uint_fast32_t v;
+       int c;
+
+       /* Discard any leading whitespace. */
+       do {
+               if ((c = pnm_getc(in)) == EOF) {
+                       return -1;
+               }
+       } while (isspace(c));
+
+       /* Parse the number. */
+       v = 0;
+       while (isdigit(c)) {
+               v = 10 * v + c - '0';
+               if ((c = pnm_getc(in)) < 0) {
+                       return -1;
+               }
+       }
+
+       /* The number must be followed by whitespace. */
+       if (!isspace(c)) {
+               return -1;
+       }
+
+       if (val) {
+               *val = v;
+       }
+       return 0;
+}
+
+static int pnm_getsintstr(jas_stream_t *in, int_fast32_t *val)
+{
+       int c;
+       int s;
+       int_fast32_t v;
+
+       /* Discard any leading whitespace. */
+       do {
+               if ((c = pnm_getc(in)) == EOF) {
+                       return -1;
+               }
+       } while (isspace(c));
+
+       /* Get the number, allowing for a negative sign. */
+       s = 1;
+       if (c == '-') {
+               s = -1;
+               if ((c = pnm_getc(in)) == EOF) {
+                       return -1;
+               }
+       } else if (c == '+') {
+               if ((c = pnm_getc(in)) == EOF) {
+                       return -1;
+               }
+       }
+       v = 0;
+       while (isdigit(c)) {
+               v = 10 * v + c - '0';
+               if ((c = pnm_getc(in)) < 0) {
+                       return -1;
+               }
+       }
+
+       /* The number must be followed by whitespace. */
+       if (!isspace(c)) {
+               return -1;
+       }
+
+       if (val) {
+               *val = (s >= 0) ? v : (-v);
+       }
+
+       return 0;
+}
+
+static int pnm_getc(jas_stream_t *in)
+{
+       int c;
+       for (;;) {
+               if ((c = jas_stream_getc(in)) == EOF) {
+                       return -1;
+               }
+               if (c != '#') {
+                       return c;
+               }
+               do {
+                       if ((c = jas_stream_getc(in)) == EOF) {
+                               return -1;
+                       }
+               } while (c != '\n' && c != '\r');
+       }
+}
+
+static int pnm_getint16(jas_stream_t *in, int *val)
+{
+       int v;
+       int c;
+
+       if ((c = jas_stream_getc(in)) == EOF) {
+               return -1;
+       }
+       v = c & 0xff;
+       if ((c = jas_stream_getc(in)) == EOF) {
+               return -1;
+       }
+       v = (v << 8) | (c & 0xff);
+       *val = v;
+
+       return 0;
+}
diff --git a/src/libjasper/pnm/pnm_enc.c b/src/libjasper/pnm/pnm_enc.c
new file mode 100644 (file)
index 0000000..3ab889d
--- /dev/null
@@ -0,0 +1,452 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Portable Pixmap/Graymap Format Support
+ *
+ * $Id$
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <ctype.h>
+#include <math.h>
+#include <stdlib.h>
+#include <assert.h>
+
+#include "jasper/jas_types.h"
+#include "jasper/jas_tvp.h"
+#include "jasper/jas_image.h"
+#include "jasper/jas_stream.h"
+#include "jasper/jas_debug.h"
+
+#include "pnm_cod.h"
+#include "pnm_enc.h"
+
+/******************************************************************************\
+* Local types.
+\******************************************************************************/
+
+typedef struct {
+       bool bin;
+} pnm_encopts_t;
+
+typedef enum {
+       OPT_TEXT
+} pnm_optid_t;
+
+jas_taginfo_t pnm_opttab[] = {
+       {OPT_TEXT, "text"},
+       {-1, 0}
+};
+
+/******************************************************************************\
+* Local function prototypes.
+\******************************************************************************/
+
+static int pnm_parseencopts(char *optstr, pnm_encopts_t *encopts);
+static int pnm_puthdr(jas_stream_t *out, pnm_hdr_t *hdr);
+static int pnm_putdata(jas_stream_t *out, pnm_hdr_t *hdr, jas_image_t *image, int numcmpts, int *cmpts);
+
+static int pnm_putsint(jas_stream_t *out, int wordsize, int_fast32_t *val);
+static int pnm_putuint(jas_stream_t *out, int wordsize, uint_fast32_t *val);
+static int pnm_putuint16(jas_stream_t *out, uint_fast16_t val);
+
+/******************************************************************************\
+* Save function.
+\******************************************************************************/
+
+int pnm_encode(jas_image_t *image, jas_stream_t *out, char *optstr)
+{
+       int width;
+       int height;
+       int cmptno;
+       pnm_hdr_t hdr;
+       pnm_encopts_t encopts;
+       int prec;
+       int sgnd;
+       pnm_enc_t encbuf;
+       pnm_enc_t *enc = &encbuf;
+
+       /* Parse the encoder option string. */
+       if (pnm_parseencopts(optstr, &encopts)) {
+               jas_eprintf("invalid PNM encoder options specified\n");
+               return -1;
+       }
+
+       switch (jas_clrspc_fam(jas_image_clrspc(image))) {
+       case JAS_CLRSPC_FAM_RGB:
+               if (jas_image_clrspc(image) != JAS_CLRSPC_SRGB)
+                       jas_eprintf("warning: inaccurate color\n");
+               enc->numcmpts = 3;
+               if ((enc->cmpts[0] = jas_image_getcmptbytype(image,
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_R))) < 0 ||
+                 (enc->cmpts[1] = jas_image_getcmptbytype(image,
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_G))) < 0 ||
+                 (enc->cmpts[2] = jas_image_getcmptbytype(image,
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_B))) < 0) {
+                       jas_eprintf("error: missing color component\n");
+                       return -1;
+               }
+               break;
+       case JAS_CLRSPC_FAM_GRAY:
+               if (jas_image_clrspc(image) != JAS_CLRSPC_SGRAY)
+                       jas_eprintf("warning: inaccurate color\n");
+               enc->numcmpts = 1;
+               if ((enc->cmpts[0] = jas_image_getcmptbytype(image,
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_GRAY_Y))) < 0) {
+                       jas_eprintf("error: missing color component\n");
+                       return -1;
+               }
+               break;
+       default:
+               jas_eprintf("error: unsupported color space\n");
+               return -1;
+               break;
+       }
+
+
+       width = jas_image_cmptwidth(image, enc->cmpts[0]);
+       height = jas_image_cmptheight(image, enc->cmpts[0]);
+       prec = jas_image_cmptprec(image, enc->cmpts[0]);
+       sgnd = jas_image_cmptsgnd(image, enc->cmpts[0]);
+
+       /* The PNM format is quite limited in the set of image geometries
+         that it can handle.  Here, we check to ensure that the image to
+         be saved can actually be represented reasonably accurately using the
+         PNM format. */
+       /* All of the components must have the same width and height. */
+       /* All of the components must have unsigned samples with the same
+         precision.*/
+       /* All of the components must have their top-left corner located at
+         the origin. */
+       for (cmptno = 0; cmptno < enc->numcmpts; ++cmptno) {
+               if (jas_image_cmptwidth(image, enc->cmpts[cmptno]) != width ||
+                 jas_image_cmptheight(image, enc->cmpts[cmptno]) != height ||
+                 jas_image_cmptprec(image, enc->cmpts[cmptno]) != prec ||
+                 jas_image_cmptsgnd(image, enc->cmpts[cmptno]) != sgnd ||
+                 jas_image_cmpthstep(image, enc->cmpts[cmptno]) != jas_image_cmpthstep(image, 0) ||
+                 jas_image_cmptvstep(image, enc->cmpts[cmptno]) != jas_image_cmptvstep(image, 0) ||
+                 jas_image_cmpttlx(image, enc->cmpts[cmptno]) != jas_image_cmpttlx(image, 0) ||
+                 jas_image_cmpttly(image, enc->cmpts[cmptno]) != jas_image_cmpttly(image, 0)) {
+                       jas_eprintf("The PNM format cannot be used to represent an image with this geometry.\n");
+                       return -1;
+               }
+       }
+
+       if (sgnd) {
+               jas_eprintf("warning: support for signed sample data requires use of nonstandard extension to PNM format\n");
+               jas_eprintf("You may not be able to read or correctly display the resulting PNM data with other software.\n");
+       }
+
+       /* Initialize the header. */
+       if (enc->numcmpts == 1) {
+               hdr.magic = encopts.bin ? PNM_MAGIC_BINPGM : PNM_MAGIC_TXTPGM;
+       } else if (enc->numcmpts == 3) {
+               hdr.magic = encopts.bin ? PNM_MAGIC_BINPPM : PNM_MAGIC_TXTPPM;
+       } else {
+               return -1;
+       }
+       hdr.width = width;
+       hdr.height = height;
+       hdr.maxval = (1 << prec) - 1;
+       hdr.sgnd = sgnd;
+
+       /* Write the header. */
+       if (pnm_puthdr(out, &hdr)) {
+               return -1;
+       }
+
+       /* Write the image data. */
+       if (pnm_putdata(out, &hdr, image, enc->numcmpts, enc->cmpts)) {
+               return -1;
+       }
+
+       /* Flush the output stream. */
+       if (jas_stream_flush(out)) {
+               return -1;
+       }
+
+       return 0;
+}
+
+/******************************************************************************\
+* Code for parsing options.
+\******************************************************************************/
+
+/* Parse the encoder options string. */
+static int pnm_parseencopts(char *optstr, pnm_encopts_t *encopts)
+{
+       jas_tvparser_t *tvp;
+       int ret;
+
+       tvp = 0;
+
+       /* Initialize default values for encoder options. */
+       encopts->bin = true;
+
+       /* Create the tag-value parser. */
+       if (!(tvp = jas_tvparser_create(optstr ? optstr : ""))) {
+               goto error;
+       }
+
+       /* Get tag-value pairs, and process as necessary. */
+       while (!(ret = jas_tvparser_next(tvp))) {
+               switch (jas_taginfo_nonull(jas_taginfos_lookup(pnm_opttab,
+                 jas_tvparser_gettag(tvp)))->id) {
+               case OPT_TEXT:
+                       encopts->bin = false;
+                       break;
+               default:
+                       jas_eprintf("warning: ignoring invalid option %s\n",
+                         jas_tvparser_gettag(tvp));
+                       break;
+               }       
+       }
+       if (ret < 0) {
+               goto error;
+       }
+
+       /* Destroy the tag-value parser. */
+       jas_tvparser_destroy(tvp);
+
+       return 0;
+
+error:
+       if (tvp) {
+               jas_tvparser_destroy(tvp);
+       }
+       return -1;
+}
+
+/******************************************************************************\
+* Function for writing header.
+\******************************************************************************/
+
+/* Write the header. */
+static int pnm_puthdr(jas_stream_t *out, pnm_hdr_t *hdr)
+{
+       int_fast32_t maxval;
+
+       if (pnm_putuint16(out, hdr->magic)) {
+               return -1;
+       }
+       if (hdr->sgnd) {
+               maxval = -hdr->maxval;
+       } else {
+               maxval = hdr->maxval;
+       }
+       jas_stream_printf(out, "\n%lu %lu\n%ld\n", (unsigned long) hdr->width,
+         (unsigned long) hdr->height, (long) maxval);
+       if (jas_stream_error(out)) {
+               return -1;
+       }
+       return 0;
+}
+
+/******************************************************************************\
+* Functions for processing the sample data.
+\******************************************************************************/
+
+/* Write the image sample data. */
+static int pnm_putdata(jas_stream_t *out, pnm_hdr_t *hdr, jas_image_t *image, int numcmpts, int *cmpts)
+{
+       int ret;
+       int cmptno;
+       int x;
+       int y;
+       jas_matrix_t *data[3];
+       int fmt;
+       jas_seqent_t *d[3];
+       jas_seqent_t v;
+       int minval;
+       int linelen;
+       int n;
+       char buf[256];
+       int depth;
+
+       ret = -1;
+       fmt = pnm_fmt(hdr->magic);
+       minval = -((int) hdr->maxval + 1);
+       depth = pnm_maxvaltodepth(hdr->maxval);
+
+       data[0] = 0;
+       data[1] = 0;
+       data[2] = 0;
+       for (cmptno = 0; cmptno < numcmpts; ++cmptno) {
+               if (!(data[cmptno] = jas_matrix_create(1, hdr->width))) {
+                       goto done;
+               }
+       }
+
+       for (y = 0; y < hdr->height; ++y) {
+               for (cmptno = 0; cmptno < numcmpts; ++cmptno) {
+                       if (jas_image_readcmpt(image, cmpts[cmptno], 0, y, hdr->width, 1,
+                         data[cmptno])) {
+                               goto done;
+                       }
+                       d[cmptno] = jas_matrix_getref(data[cmptno], 0, 0);
+               }
+               linelen = 0;
+               for (x = 0; x < hdr->width; ++x) {
+                       for (cmptno = 0; cmptno < numcmpts; ++cmptno) {
+                               v = *d[cmptno];
+                               if (v < minval) {
+                                       v = minval;
+                               }
+                               if (v > ((int) hdr->maxval)) {
+                                       v = hdr->maxval;
+                               }
+                               if (fmt == PNM_FMT_BIN) {
+                                       if (hdr->sgnd) {
+                                               int_fast32_t sv;
+                                               sv = v;
+                                               if (pnm_putsint(out, depth, &sv)) {
+                                                       goto done;
+                                               }
+                                       } else {
+                                               uint_fast32_t uv;
+                                               uv = v;
+                                               if (pnm_putuint(out, depth, &uv)) {
+                                                       goto done;
+                                               }
+                                       }
+                               } else {
+                                       n = sprintf(buf, "%s%ld", ((!(!x && !cmptno)) ? " " : ""),
+                                         (long) v);
+                                       if (linelen > 0 && linelen + n > PNM_MAXLINELEN) {
+                                               jas_stream_printf(out, "\n");
+                                               linelen = 0;
+                                       }
+                                       jas_stream_printf(out, "%s", buf);
+                                       linelen += n;
+                               }
+                               ++d[cmptno];
+                       }
+               }
+               if (fmt != PNM_FMT_BIN) {
+                       jas_stream_printf(out, "\n");
+                       linelen = 0;
+               }
+               if (jas_stream_error(out)) {
+                       goto done;
+               }
+       }
+
+       ret = 0;
+
+done:
+
+       for (cmptno = 0; cmptno < numcmpts; ++cmptno) {
+               if (data[cmptno]) {
+                       jas_matrix_destroy(data[cmptno]);
+               }
+       }
+
+       return ret;
+}
+
+/******************************************************************************\
+* Miscellaneous functions.
+\******************************************************************************/
+
+static int pnm_putsint(jas_stream_t *out, int wordsize, int_fast32_t *val)
+{
+       uint_fast32_t tmpval;
+       tmpval = (*val < 0) ?
+         ((~(JAS_CAST(uint_fast32_t, -(*val)) + 1)) & PNM_ONES(wordsize)) :
+         JAS_CAST(uint_fast32_t, (*val));
+       return pnm_putuint(out, wordsize, &tmpval);
+}
+
+static int pnm_putuint(jas_stream_t *out, int wordsize, uint_fast32_t *val)
+{
+       int n;
+       uint_fast32_t tmpval;
+       int c;
+
+       n = (wordsize + 7) / 8;
+       tmpval = (*val);
+       tmpval &= PNM_ONES(8 * n);
+       tmpval = tmpval << (8 * (4 - n));
+       while (--n >= 0) {
+               c = (tmpval >> 24) & 0xff;
+               if (jas_stream_putc(out, c) == EOF) {
+                       return -1;
+               }
+               tmpval = (tmpval << 8) & 0xffffffff;
+       }
+       return 0;
+}
+
+/* Write a 16-bit unsigned integer to a stream. */
+static int pnm_putuint16(jas_stream_t *out, uint_fast16_t val)
+{
+       if (jas_stream_putc(out, (unsigned char)(val >> 8)) == EOF ||
+         jas_stream_putc(out, (unsigned char)(val & 0xff)) == EOF) {
+               return -1;
+       }
+       return 0;
+}
diff --git a/src/libjasper/pnm/pnm_enc.h b/src/libjasper/pnm/pnm_enc.h
new file mode 100644 (file)
index 0000000..6425e59
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+#ifndef PNM_ENC_H
+#define PNM_ENC_H
+
+typedef struct {
+       int numcmpts;
+       int cmpts[4];
+} pnm_enc_t;
+
+#endif
diff --git a/src/libjasper/ras/Makefile.am b/src/libjasper/ras/Makefile.am
new file mode 100644 (file)
index 0000000..49cfe4b
--- /dev/null
@@ -0,0 +1,67 @@
+# Copyright (c) 2001-2002 Michael David Adams.
+# All rights reserved. 
+
+# __START_OF_JASPER_LICENSE__
+# 
+# JasPer License Version 2.0
+# 
+# Copyright (c) 2001-2006 Michael David Adams
+# Copyright (c) 1999-2000 Image Power, Inc.
+# Copyright (c) 1999-2000 The University of British Columbia
+# 
+# All rights reserved.
+# 
+# Permission is hereby granted, free of charge, to any person (the
+# "User") obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the
+# following conditions:
+# 
+# 1.  The above copyright notices and this permission notice (which
+# includes the disclaimer below) shall be included in all copies or
+# substantial portions of the Software.
+# 
+# 2.  The name of a copyright holder shall not be used to endorse or
+# promote products derived from the Software without specific prior
+# written permission.
+# 
+# THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+# LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+# THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+# "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+# PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+# EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+# PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+# THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+# EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+# BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+# PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+# GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+# ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+# IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+# SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+# AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+# SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+# THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+# PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+# RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+# EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+# 
+# __END_OF_JASPER_LICENSE__
+
+noinst_LTLIBRARIES = libras.la
+libras_la_SOURCES = \
+       ras_cod.h \
+       ras_enc.h \
+       ras_cod.c \
+       ras_dec.c \
+       ras_enc.c
+
+INCLUDES = -I$(top_srcdir)/src/libjasper/include
diff --git a/src/libjasper/ras/Makefile.in b/src/libjasper/ras/Makefile.in
new file mode 100644 (file)
index 0000000..57b83f5
--- /dev/null
@@ -0,0 +1,510 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# Copyright (c) 2001-2002 Michael David Adams.
+# All rights reserved. 
+
+# __START_OF_JASPER_LICENSE__
+# 
+# JasPer License Version 2.0
+# 
+# Copyright (c) 2001-2006 Michael David Adams
+# Copyright (c) 1999-2000 Image Power, Inc.
+# Copyright (c) 1999-2000 The University of British Columbia
+# 
+# All rights reserved.
+# 
+# Permission is hereby granted, free of charge, to any person (the
+# "User") obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the
+# following conditions:
+# 
+# 1.  The above copyright notices and this permission notice (which
+# includes the disclaimer below) shall be included in all copies or
+# substantial portions of the Software.
+# 
+# 2.  The name of a copyright holder shall not be used to endorse or
+# promote products derived from the Software without specific prior
+# written permission.
+# 
+# THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+# LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+# THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+# "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+# PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+# EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+# PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+# THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+# EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+# BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+# PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+# GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+# ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+# IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+# SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+# AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+# SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+# THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+# PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+# RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+# EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+# 
+# __END_OF_JASPER_LICENSE__
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = src/libjasper/ras
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/acaux/mkinstalldirs
+CONFIG_HEADER =  \
+       $(top_builddir)/src/libjasper/include/jasper/jas_config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libras_la_LIBADD =
+am_libras_la_OBJECTS = ras_cod.lo ras_dec.lo ras_enc.lo
+libras_la_OBJECTS = $(am_libras_la_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src/libjasper/include/jasper
+depcomp = $(SHELL) $(top_srcdir)/acaux/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+       $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libras_la_SOURCES)
+DIST_SOURCES = $(libras_la_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+HAVE_LIBJPEG_FALSE = @HAVE_LIBJPEG_FALSE@
+HAVE_LIBJPEG_TRUE = @HAVE_LIBJPEG_TRUE@
+HAVE_OPENGL_FALSE = @HAVE_OPENGL_FALSE@
+HAVE_OPENGL_TRUE = @HAVE_OPENGL_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAS_MAJOR_VERSION = @JAS_MAJOR_VERSION@
+JAS_MICRO_VERSION = @JAS_MICRO_VERSION@
+JAS_MINOR_VERSION = @JAS_MINOR_VERSION@
+JAS_RPM_RELEASE = @JAS_RPM_RELEASE@
+JAS_VERSION = @JAS_VERSION@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_AGE = @LT_AGE@
+LT_CURRENT = @LT_CURRENT@
+LT_RELEASE = @LT_RELEASE@
+LT_REVISION = @LT_REVISION@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OPENGL_LIBS = @OPENGL_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+noinst_LTLIBRARIES = libras.la
+libras_la_SOURCES = \
+       ras_cod.h \
+       ras_enc.h \
+       ras_cod.c \
+       ras_dec.c \
+       ras_enc.c
+
+INCLUDES = -I$(top_srcdir)/src/libjasper/include
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/libjasper/ras/Makefile'; \
+       cd $(top_srcdir) && \
+         $(AUTOMAKE) --foreign  src/libjasper/ras/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+       -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+       @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+         test "$$dir" != "$$p" || dir=.; \
+         echo "rm -f \"$${dir}/so_locations\""; \
+         rm -f "$${dir}/so_locations"; \
+       done
+libras.la: $(libras_la_OBJECTS) $(libras_la_DEPENDENCIES) 
+       $(LINK)  $(libras_la_LDFLAGS) $(libras_la_OBJECTS) $(libras_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ras_cod.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ras_dec.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ras_enc.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+
+distclean-libtool:
+       -rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+           $$tags $$unique; \
+       fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       test -z "$(CTAGS_ARGS)$$tags$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$tags $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && cd $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+       list='$(DISTFILES)'; for file in $$list; do \
+         case $$file in \
+           $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+           $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+         esac; \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+         if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+           dir="/$$dir"; \
+           $(mkdir_p) "$(distdir)$$dir"; \
+         else \
+           dir=''; \
+         fi; \
+         if test -d $$d/$$file; then \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+           fi; \
+           cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+         else \
+           test -f $(distdir)/$$file \
+           || cp -p $$d/$$file $(distdir)/$$file \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+         `test -z '$(STRIP)' || \
+           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+       mostlyclean-am
+
+distclean: distclean-am
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+       clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+       distclean-compile distclean-generic distclean-libtool \
+       distclean-tags distdir dvi dvi-am html html-am info info-am \
+       install install-am install-data install-data-am install-exec \
+       install-exec-am install-info install-info-am install-man \
+       install-strip installcheck installcheck-am installdirs \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+       pdf pdf-am ps ps-am tags uninstall uninstall-am \
+       uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/libjasper/ras/ras_cod.c b/src/libjasper/ras/ras_cod.c
new file mode 100644 (file)
index 0000000..816c23b
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Sun Rasterfile Library
+ *
+ * $Id$
+ */
+
+/* Note: There is not currently any code common to both the encoder and
+  decoder. */
+
+/* Keep picky compilers happy. */
+int ras_dummy;
diff --git a/src/libjasper/ras/ras_cod.h b/src/libjasper/ras/ras_cod.h
new file mode 100644 (file)
index 0000000..a8c53ba
--- /dev/null
@@ -0,0 +1,164 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Sun Rasterfile Library
+ *
+ * $Id$
+ */
+
+/******************************************************************************\
+* Sun Rasterfile
+\******************************************************************************/
+
+#ifndef        RAS_COD_H
+#define        RAS_COD_H
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include "jasper/jas_types.h"
+
+/******************************************************************************\
+* Constants.
+\******************************************************************************/
+
+#define        RAS_MAGIC       0x59a66a95
+#define        RAS_MAGICLEN    4
+
+#define        RAS_TYPE_OLD    0
+#define        RAS_TYPE_STD    1
+#define        RAS_TYPE_RLE    2
+
+#define        RAS_MT_NONE     0
+#define        RAS_MT_EQUALRGB 1
+#define        RAS_MT_RAW      2
+
+/******************************************************************************\
+* Types.
+\******************************************************************************/
+
+/* Sun Rasterfile header. */
+typedef struct {
+
+       int_fast32_t magic;
+       /* signature */
+
+       int_fast32_t width;
+       /* width of image (in pixels) */
+
+       int_fast32_t height;
+       /* height of image (in pixels) */
+
+       int_fast32_t depth;
+       /* number of bits per pixel */
+
+       int_fast32_t length;
+       /* length of image data (in bytes) */
+
+       int_fast32_t type;
+       /* format of image data */
+
+       int_fast32_t maptype;
+       /* colormap type */
+
+       int_fast32_t maplength;
+       /* length of colormap data (in bytes) */
+
+} ras_hdr_t;
+
+#define        RAS_CMAP_MAXSIZ 256
+
+/* Color map. */
+typedef struct {
+
+       int len;
+       /* The number of entries in the color map. */
+
+       int data[RAS_CMAP_MAXSIZ];
+       /* The color map data. */
+
+} ras_cmap_t;
+
+/******************************************************************************\
+* Macros.
+\******************************************************************************/
+
+#define RAS_GETBLUE(x) (((x) >> 16) & 0xff)
+#define        RAS_GETGREEN(x) (((x) >> 8) & 0xff)
+#define RAS_GETRED(x)  ((x) & 0xff)
+
+#define RAS_BLUE(x)    (((x) & 0xff) << 16)
+#define RAS_GREEN(x)   (((x) & 0xff) << 8)
+#define        RAS_RED(x)      ((x) & 0xff)
+
+#define RAS_ROWSIZE(hdr) \
+       ((((hdr)->width * (hdr)->depth + 15) / 16) * 2)
+#define RAS_ISRGB(hdr) \
+       ((hdr)->depth == 24 || (hdr)->depth == 32)
+
+#define        RAS_ONES(n) \
+       (((n) == 32) ? 0xffffffffUL : ((1UL << (n)) - 1))
+
+#endif
diff --git a/src/libjasper/ras/ras_dec.c b/src/libjasper/ras/ras_dec.c
new file mode 100644 (file)
index 0000000..a53da8b
--- /dev/null
@@ -0,0 +1,398 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Sun Rasterfile Library
+ *
+ * $Id$
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <assert.h>
+#include <stdlib.h>
+
+#include "jasper/jas_stream.h"
+#include "jasper/jas_image.h"
+#include "jasper/jas_debug.h"
+
+#include "ras_cod.h"
+
+/******************************************************************************\
+* Prototypes.
+\******************************************************************************/
+
+static int ras_gethdr(jas_stream_t *in, ras_hdr_t *hdr);
+static int ras_getint(jas_stream_t *in, int_fast32_t *val);
+
+static int ras_getdata(jas_stream_t *in, ras_hdr_t *hdr, ras_cmap_t *cmap,
+  jas_image_t *image);
+static int ras_getdatastd(jas_stream_t *in, ras_hdr_t *hdr, ras_cmap_t *cmap,
+  jas_image_t *image);
+static int ras_getcmap(jas_stream_t *in, ras_hdr_t *hdr, ras_cmap_t *cmap);
+
+/******************************************************************************\
+* Code.
+\******************************************************************************/
+
+jas_image_t *ras_decode(jas_stream_t *in, char *optstr)
+{
+       ras_hdr_t hdr;
+       ras_cmap_t cmap;
+       jas_image_t *image;
+       jas_image_cmptparm_t cmptparms[3];
+       jas_image_cmptparm_t *cmptparm;
+       int clrspc;
+       int numcmpts;
+       int i;
+
+       if (optstr) {
+               jas_eprintf("warning: ignoring RAS decoder options\n");
+       }
+
+       /* Read the header. */
+       if (ras_gethdr(in, &hdr)) {
+               return 0;
+       }
+
+       /* Does the header information look reasonably sane? */
+       if (hdr.magic != RAS_MAGIC || hdr.width <= 0 || hdr.height <= 0 ||
+         hdr.depth <= 0 || hdr.depth > 32) {
+               return 0;
+       }
+
+       /* In the case of the old format, do not rely on the length field
+       being properly specified.  Calculate the quantity from scratch. */
+       if (hdr.type == RAS_TYPE_OLD) {
+               hdr.length = RAS_ROWSIZE(&hdr) * hdr.height;
+       }
+
+       /* Calculate some quantities needed for creation of the image
+       object. */
+       if (RAS_ISRGB(&hdr)) {
+               clrspc = JAS_CLRSPC_SRGB;
+               numcmpts = 3;
+       } else {
+               clrspc = JAS_CLRSPC_SGRAY;
+               numcmpts = 1;
+       }
+       for (i = 0, cmptparm = cmptparms; i < numcmpts; ++i, ++cmptparm) {
+               cmptparm->tlx = 0;
+               cmptparm->tly = 0;
+               cmptparm->hstep = 1;
+               cmptparm->vstep = 1;
+               cmptparm->width = hdr.width;
+               cmptparm->height = hdr.height;
+               cmptparm->prec = RAS_ISRGB(&hdr) ? 8 : hdr.depth;
+               cmptparm->sgnd = false;
+       }
+       /* Create the image object. */
+       if (!(image = jas_image_create(numcmpts, cmptparms, JAS_CLRSPC_UNKNOWN))) {
+               return 0;
+       }
+
+       /* Read the color map (if there is one). */
+       if (ras_getcmap(in, &hdr, &cmap)) {
+               jas_image_destroy(image);
+               return 0;
+       }
+
+       /* Read the pixel data. */
+       if (ras_getdata(in, &hdr, &cmap, image)) {
+               jas_image_destroy(image);
+               return 0;
+       }
+
+       jas_image_setclrspc(image, clrspc);
+       if (clrspc == JAS_CLRSPC_SRGB) {
+               jas_image_setcmpttype(image, 0,
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_R));
+               jas_image_setcmpttype(image, 1,
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_G));
+               jas_image_setcmpttype(image, 2,
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_B));
+       } else {
+               jas_image_setcmpttype(image, 0,
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_GRAY_Y));
+       }
+
+       return image;
+}
+
+int ras_validate(jas_stream_t *in)
+{
+       uchar buf[RAS_MAGICLEN];
+       int i;
+       int n;
+       uint_fast32_t magic;
+
+       assert(JAS_STREAM_MAXPUTBACK >= RAS_MAGICLEN);
+
+       /* Read the validation data (i.e., the data used for detecting
+         the format). */
+       if ((n = jas_stream_read(in, buf, RAS_MAGICLEN)) < 0) {
+               return -1;
+       }
+
+       /* Put the validation data back onto the stream, so that the
+         stream position will not be changed. */
+       for (i = n - 1; i >= 0; --i) {
+               if (jas_stream_ungetc(in, buf[i]) == EOF) {
+                       return -1;
+               }
+       }
+
+       /* Did we read enough data? */
+       if (n < RAS_MAGICLEN) {
+               return -1;
+       }
+
+       magic = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3];
+
+       /* Is the signature correct for the Sun Rasterfile format? */
+       if (magic != RAS_MAGIC) {
+               return -1;
+       }
+       return 0;
+}
+
+static int ras_getdata(jas_stream_t *in, ras_hdr_t *hdr, ras_cmap_t *cmap,
+  jas_image_t *image)
+{
+       int ret;
+
+       switch (hdr->type) {
+       case RAS_TYPE_OLD:
+       case RAS_TYPE_STD:
+               ret = ras_getdatastd(in, hdr, cmap, image);
+               break;
+       case RAS_TYPE_RLE:
+               jas_eprintf("error: RLE encoding method not supported\n");
+               ret = -1;
+               break;
+       default:
+               jas_eprintf("error: encoding method not supported\n");
+               ret = -1;
+               break;
+       }
+       return ret;
+}
+
+static int ras_getdatastd(jas_stream_t *in, ras_hdr_t *hdr, ras_cmap_t *cmap,
+  jas_image_t *image)
+{
+       int pad;
+       int nz;
+       int z;
+       int c;
+       int y;
+       int x;
+       int v;
+       int i;
+       jas_matrix_t *data[3];
+
+/* Note: This function does not properly handle images with a colormap. */
+       /* Avoid compiler warnings about unused parameters. */
+       cmap = 0;
+
+       for (i = 0; i < jas_image_numcmpts(image); ++i) {
+               data[i] = jas_matrix_create(1, jas_image_width(image));
+               assert(data[i]);
+       }
+
+       pad = RAS_ROWSIZE(hdr) - (hdr->width * hdr->depth + 7) / 8;
+
+       for (y = 0; y < hdr->height; y++) {
+               nz = 0;
+               z = 0;
+               for (x = 0; x < hdr->width; x++) {
+                       while (nz < hdr->depth) {
+                               if ((c = jas_stream_getc(in)) == EOF) {
+                                       return -1;
+                               }
+                               z = (z << 8) | c;
+                               nz += 8;
+                       }
+
+                       v = (z >> (nz - hdr->depth)) & RAS_ONES(hdr->depth);
+                       z &= RAS_ONES(nz - hdr->depth);
+                       nz -= hdr->depth;
+
+                       if (jas_image_numcmpts(image) == 3) {
+                               jas_matrix_setv(data[0], x, (RAS_GETRED(v)));
+                               jas_matrix_setv(data[1], x, (RAS_GETGREEN(v)));
+                               jas_matrix_setv(data[2], x, (RAS_GETBLUE(v)));
+                       } else {
+                               jas_matrix_setv(data[0], x, (v));
+                       }
+               }
+               if (pad) {
+                       if ((c = jas_stream_getc(in)) == EOF) {
+                               return -1;
+                       }
+               }
+               for (i = 0; i < jas_image_numcmpts(image); ++i) {
+                       if (jas_image_writecmpt(image, i, 0, y, hdr->width, 1,
+                         data[i])) {
+                               return -1;
+                       }
+               }
+       }
+
+       for (i = 0; i < jas_image_numcmpts(image); ++i) {
+               jas_matrix_destroy(data[i]);
+       }
+
+       return 0;
+}
+
+static int ras_getcmap(jas_stream_t *in, ras_hdr_t *hdr, ras_cmap_t *cmap)
+{
+       int i;
+       int j;
+       int x;
+       int c;
+       int numcolors;
+       int actualnumcolors;
+
+       switch (hdr->maptype) {
+       case RAS_MT_NONE:
+               break;
+       case RAS_MT_EQUALRGB:
+               {
+               jas_eprintf("warning: palettized images not fully supported\n");
+               numcolors = 1 << hdr->depth;
+               assert(numcolors <= RAS_CMAP_MAXSIZ);
+               actualnumcolors = hdr->maplength / 3;
+               for (i = 0; i < numcolors; i++) {
+                       cmap->data[i] = 0;
+               }
+               if ((hdr->maplength % 3) || hdr->maplength < 0 ||
+                 hdr->maplength > 3 * numcolors) {
+                       return -1;
+               }
+               for (i = 0; i < 3; i++) {
+                       for (j = 0; j < actualnumcolors; j++) {
+                               if ((c = jas_stream_getc(in)) == EOF) {
+                                       return -1;
+                               }
+                               x = 0;
+                               switch (i) {
+                               case 0:
+                                       x = RAS_RED(c);
+                                       break;
+                               case 1:
+                                       x = RAS_GREEN(c);
+                                       break;
+                               case 2:
+                                       x = RAS_BLUE(c);
+                                       break;
+                               }
+                               cmap->data[j] |= x;
+                       }
+               }
+               }
+               break;
+       default:
+               return -1;
+               break;
+       }
+
+       return 0;
+}
+
+static int ras_gethdr(jas_stream_t *in, ras_hdr_t *hdr)
+{
+       if (ras_getint(in, &hdr->magic) || ras_getint(in, &hdr->width) ||
+         ras_getint(in, &hdr->height) || ras_getint(in, &hdr->depth) ||
+         ras_getint(in, &hdr->length) || ras_getint(in, &hdr->type) ||
+         ras_getint(in, &hdr->maptype) || ras_getint(in, &hdr->maplength)) {
+               return -1;
+       }
+
+       if (hdr->magic != RAS_MAGIC) {
+               return -1;
+       }
+
+       return 0;
+}
+
+static int ras_getint(jas_stream_t *in, int_fast32_t *val)
+{
+       int x;
+       int c;
+       int i;
+
+       x = 0;
+       for (i = 0; i < 4; i++) {
+               if ((c = jas_stream_getc(in)) == EOF) {
+                       return -1;
+               }
+               x = (x << 8) | (c & 0xff);
+       }
+
+       *val = x;
+       return 0;
+}
diff --git a/src/libjasper/ras/ras_enc.c b/src/libjasper/ras/ras_enc.c
new file mode 100644 (file)
index 0000000..21e7fcb
--- /dev/null
@@ -0,0 +1,318 @@
+/*
+ * Copyright (c) 1999-2000 Image Power, Inc. and the University of
+ *   British Columbia.
+ * Copyright (c) 2001-2003 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+/*
+ * Sun Rasterfile Library
+ *
+ * $Id$
+ */
+
+/******************************************************************************\
+* Includes.
+\******************************************************************************/
+
+#include <assert.h>
+#include <stdlib.h>
+
+#include "jasper/jas_image.h"
+#include "jasper/jas_stream.h"
+#include "jasper/jas_debug.h"
+
+#include "ras_cod.h"
+#include "ras_enc.h"
+
+/******************************************************************************\
+* Prototypes.
+\******************************************************************************/
+
+static int ras_puthdr(jas_stream_t *out, ras_hdr_t *hdr);
+static int ras_putint(jas_stream_t *out, int val);
+
+static int ras_putdata(jas_stream_t *out, ras_hdr_t *hdr, jas_image_t *image, int numcmpts, int *cmpts);
+static int ras_putdatastd(jas_stream_t *out, ras_hdr_t *hdr, jas_image_t *image, int numcmpts, int *cmpts);
+
+/******************************************************************************\
+* Code.
+\******************************************************************************/
+
+int ras_encode(jas_image_t *image, jas_stream_t *out, char *optstr)
+{
+       int_fast32_t width;
+       int_fast32_t height;
+       int_fast32_t depth;
+       int cmptno;
+#if 0
+       uint_fast16_t numcmpts;
+#endif
+       int i;
+       ras_hdr_t hdr;
+       int rowsize;
+       ras_enc_t encbuf;
+       ras_enc_t *enc = &encbuf;
+
+       if (optstr) {
+               jas_eprintf("warning: ignoring RAS encoder options\n");
+       }
+
+       switch (jas_clrspc_fam(jas_image_clrspc(image))) {
+       case JAS_CLRSPC_FAM_RGB:
+               if (jas_image_clrspc(image) != JAS_CLRSPC_SRGB)
+                       jas_eprintf("warning: inaccurate color\n");
+               enc->numcmpts = 3;
+               if ((enc->cmpts[0] = jas_image_getcmptbytype(image,
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_R))) < 0 ||
+                 (enc->cmpts[1] = jas_image_getcmptbytype(image,
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_G))) < 0 ||
+                 (enc->cmpts[2] = jas_image_getcmptbytype(image,
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_B))) < 0) {
+                       jas_eprintf("error: missing color component\n");
+                       return -1;
+               }
+               break;
+       case JAS_CLRSPC_FAM_GRAY:
+               if (jas_image_clrspc(image) != JAS_CLRSPC_SGRAY)
+                       jas_eprintf("warning: inaccurate color\n");
+               enc->numcmpts = 1;
+               if ((enc->cmpts[0] = jas_image_getcmptbytype(image,
+                 JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_GRAY_Y))) < 0) {
+                       jas_eprintf("error: missing color component\n");
+                       return -1;
+               }
+               break;
+       default:
+               jas_eprintf("error: unsupported color space\n");
+               return -1;
+               break;
+       }
+
+       width = jas_image_cmptwidth(image, enc->cmpts[0]);
+       height = jas_image_cmptheight(image, enc->cmpts[0]);
+       depth = jas_image_cmptprec(image, enc->cmpts[0]);
+
+       for (cmptno = 0; cmptno < enc->numcmpts; ++cmptno) {
+               if (jas_image_cmptwidth(image, enc->cmpts[cmptno]) != width ||
+                 jas_image_cmptheight(image, enc->cmpts[cmptno]) != height ||
+                 jas_image_cmptprec(image, enc->cmpts[cmptno]) != depth ||
+                 jas_image_cmptsgnd(image, enc->cmpts[cmptno]) != false ||
+                 jas_image_cmpttlx(image, enc->cmpts[cmptno]) != 0 ||
+                 jas_image_cmpttly(image, enc->cmpts[cmptno]) != 0) {
+                       jas_eprintf("The RAS format cannot be used to represent an image with this geometry.\n");
+                       return -1;
+               }
+       }
+
+       /* Ensure that the image can be encoded in the desired format. */
+       if (enc->numcmpts == 3) {
+
+               /* All three components must have the same subsampling
+                 factor and have a precision of eight bits. */
+               if (enc->numcmpts > 1) {
+                       for (i = 0; i < enc->numcmpts; ++i) {
+                               if (jas_image_cmptprec(image, enc->cmpts[i]) != 8) {
+                                       return -1;
+                               }
+                       }
+               }
+       } else if (enc->numcmpts == 1) {
+               /* NOP */
+       } else {
+               return -1;
+       }
+
+       hdr.magic = RAS_MAGIC;
+       hdr.width = width;
+       hdr.height = height;
+       hdr.depth = (enc->numcmpts == 3) ? 24 : depth;
+
+       rowsize = RAS_ROWSIZE(&hdr);
+       hdr.length = rowsize * hdr.height;
+       hdr.type = RAS_TYPE_STD;
+
+       hdr.maptype = RAS_MT_NONE;
+       hdr.maplength = 0;
+
+       if (ras_puthdr(out, &hdr)) {
+               return -1;
+       }
+
+       if (ras_putdata(out, &hdr, image, enc->numcmpts, enc->cmpts)) {
+               return -1;
+       }
+
+       return 0;
+}
+
+static int ras_putdata(jas_stream_t *out, ras_hdr_t *hdr, jas_image_t *image, int numcmpts, int *cmpts)
+{
+       int ret;
+
+       switch (hdr->type) {
+       case RAS_TYPE_STD:
+               ret = ras_putdatastd(out, hdr, image, numcmpts, cmpts);
+               break;
+       default:
+               ret = -1;
+               break;
+       }
+       return ret;
+}
+
+static int ras_putdatastd(jas_stream_t *out, ras_hdr_t *hdr, jas_image_t *image,  int numcmpts, int *cmpts)
+{
+       int rowsize;
+       int pad;
+       unsigned int z;
+       int nz;
+       int c;
+       int x;
+       int y;
+       int v;
+       jas_matrix_t *data[3];
+       int i;
+
+       for (i = 0; i < numcmpts; ++i) {
+               data[i] = jas_matrix_create(jas_image_height(image), jas_image_width(image));
+               assert(data[i]);
+       }
+
+       rowsize = RAS_ROWSIZE(hdr);
+       pad = rowsize - (hdr->width * hdr->depth + 7) / 8;
+
+       hdr->length = hdr->height * rowsize;
+
+       for (y = 0; y < hdr->height; y++) {
+               for (i = 0; i < numcmpts; ++i) {
+                       jas_image_readcmpt(image, cmpts[i], 0, y, jas_image_width(image),
+                         1, data[i]);
+               }
+               z = 0;
+               nz = 0;
+               for (x = 0; x < hdr->width; x++) {
+                       z <<= hdr->depth;
+                       if (RAS_ISRGB(hdr)) {
+                               v = RAS_RED((jas_matrix_getv(data[0], x))) |
+                                 RAS_GREEN((jas_matrix_getv(data[1], x))) |
+                                 RAS_BLUE((jas_matrix_getv(data[2], x)));
+                       } else {
+                               v = (jas_matrix_getv(data[0], x));
+                       }
+                       z |= v & RAS_ONES(hdr->depth);
+                       nz += hdr->depth;
+                       while (nz >= 8) {
+                               c = (z >> (nz - 8)) & 0xff;
+                               if (jas_stream_putc(out, c) == EOF) {
+                                       return -1;
+                               }
+                               nz -= 8;
+                               z &= RAS_ONES(nz);
+                       }
+               }
+               if (nz > 0) {
+                       c = (z >> (8 - nz)) & RAS_ONES(nz);
+                       if (jas_stream_putc(out, c) == EOF) {
+                               return -1;
+                       }
+               }
+               if (pad % 2) {
+                       if (jas_stream_putc(out, 0) == EOF) {
+                               return -1;
+                       }
+               }
+       }
+
+       for (i = 0; i < numcmpts; ++i) {
+               jas_matrix_destroy(data[i]);
+       }
+
+       return 0;
+}
+
+static int ras_puthdr(jas_stream_t *out, ras_hdr_t *hdr)
+{
+       if (ras_putint(out, RAS_MAGIC) || ras_putint(out, hdr->width) ||
+         ras_putint(out, hdr->height) || ras_putint(out, hdr->depth) ||
+         ras_putint(out, hdr->length) || ras_putint(out, hdr->type) ||
+         ras_putint(out, hdr->maptype) || ras_putint(out, hdr->maplength)) {
+               return -1;
+       }
+
+       return 0;
+}
+
+static int ras_putint(jas_stream_t *out, int val)
+{
+       int x;
+       int i;
+       int c;
+
+       x = val;
+       for (i = 0; i < 4; i++) {
+               c = (x >> 24) & 0xff;
+               if (jas_stream_putc(out, c) == EOF) {
+                       return -1;
+               }
+               x <<= 8;
+       }
+
+       return 0;
+}
diff --git a/src/libjasper/ras/ras_enc.h b/src/libjasper/ras/ras_enc.h
new file mode 100644 (file)
index 0000000..bf5fe1b
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2002 Michael David Adams.
+ * All rights reserved.
+ */
+
+/* __START_OF_JASPER_LICENSE__
+ * 
+ * JasPer License Version 2.0
+ * 
+ * Copyright (c) 2001-2006 Michael David Adams
+ * Copyright (c) 1999-2000 Image Power, Inc.
+ * Copyright (c) 1999-2000 The University of British Columbia
+ * 
+ * All rights reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person (the
+ * "User") obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ * 
+ * 1.  The above copyright notices and this permission notice (which
+ * includes the disclaimer below) shall be included in all copies or
+ * substantial portions of the Software.
+ * 
+ * 2.  The name of a copyright holder shall not be used to endorse or
+ * promote products derived from the Software without specific prior
+ * written permission.
+ * 
+ * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+ * LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+ * THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+ * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+ * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+ * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+ * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+ * PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+ * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+ * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+ * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+ * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+ * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+ * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+ * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+ * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+ * RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+ * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+ * 
+ * __END_OF_JASPER_LICENSE__
+ */
+
+#ifndef RAS_ENC_H
+#define RAS_ENC_H
+
+typedef struct {
+       int numcmpts;
+       int cmpts[4];
+} ras_enc_t;
+
+#endif
diff --git a/src/msvc/Makefile.am b/src/msvc/Makefile.am
new file mode 100644 (file)
index 0000000..f3160a5
--- /dev/null
@@ -0,0 +1,71 @@
+# Copyright (c) 2001-2002 Michael David Adams.
+# All rights reserved. 
+
+# __START_OF_JASPER_LICENSE__
+# 
+# JasPer License Version 2.0
+# 
+# Copyright (c) 2001-2006 Michael David Adams
+# Copyright (c) 1999-2000 Image Power, Inc.
+# Copyright (c) 1999-2000 The University of British Columbia
+# 
+# All rights reserved.
+# 
+# Permission is hereby granted, free of charge, to any person (the
+# "User") obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the
+# following conditions:
+# 
+# 1.  The above copyright notices and this permission notice (which
+# includes the disclaimer below) shall be included in all copies or
+# substantial portions of the Software.
+# 
+# 2.  The name of a copyright holder shall not be used to endorse or
+# promote products derived from the Software without specific prior
+# written permission.
+# 
+# THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+# LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+# THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+# "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+# PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+# EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+# PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+# THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+# EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+# BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+# PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+# GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+# ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+# IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+# SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+# AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+# SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+# THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+# PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+# RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+# EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+# 
+# __END_OF_JASPER_LICENSE__
+
+EXTRA_DIST = \
+       README \
+       jasper.dsw \
+       libjasper.dsp \
+       jasper.dsp \
+       jiv.dsp \
+       imgcmp.dsp \
+       imginfo.dsp
+
+clean-local:
+       rm -rf *Win32_Debug *Win32_Release
+       rm -rf Release Debug
+       rm -rf *.ncb *.opt *.plg
diff --git a/src/msvc/Makefile.in b/src/msvc/Makefile.in
new file mode 100644 (file)
index 0000000..8884b22
--- /dev/null
@@ -0,0 +1,405 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# Copyright (c) 2001-2002 Michael David Adams.
+# All rights reserved. 
+
+# __START_OF_JASPER_LICENSE__
+# 
+# JasPer License Version 2.0
+# 
+# Copyright (c) 2001-2006 Michael David Adams
+# Copyright (c) 1999-2000 Image Power, Inc.
+# Copyright (c) 1999-2000 The University of British Columbia
+# 
+# All rights reserved.
+# 
+# Permission is hereby granted, free of charge, to any person (the
+# "User") obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the
+# following conditions:
+# 
+# 1.  The above copyright notices and this permission notice (which
+# includes the disclaimer below) shall be included in all copies or
+# substantial portions of the Software.
+# 
+# 2.  The name of a copyright holder shall not be used to endorse or
+# promote products derived from the Software without specific prior
+# written permission.
+# 
+# THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+# LICENSE.  NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
+# THIS DISCLAIMER.  THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+# "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+# PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO
+# EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  NO ASSURANCES ARE
+# PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
+# THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
+# EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
+# BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
+# PROPERTY RIGHTS OR OTHERWISE.  AS A CONDITION TO EXERCISING THE RIGHTS
+# GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
+# ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY.  THE SOFTWARE
+# IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
+# SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
+# AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
+# SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
+# THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
+# PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
+# RISK ACTIVITIES").  THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
+# EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+# 
+# __END_OF_JASPER_LICENSE__
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = src/msvc
+DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/acaux/mkinstalldirs
+CONFIG_HEADER =  \
+       $(top_builddir)/src/libjasper/include/jasper/jas_config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+HAVE_LIBJPEG_FALSE = @HAVE_LIBJPEG_FALSE@
+HAVE_LIBJPEG_TRUE = @HAVE_LIBJPEG_TRUE@
+HAVE_OPENGL_FALSE = @HAVE_OPENGL_FALSE@
+HAVE_OPENGL_TRUE = @HAVE_OPENGL_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAS_MAJOR_VERSION = @JAS_MAJOR_VERSION@
+JAS_MICRO_VERSION = @JAS_MICRO_VERSION@
+JAS_MINOR_VERSION = @JAS_MINOR_VERSION@
+JAS_RPM_RELEASE = @JAS_RPM_RELEASE@
+JAS_VERSION = @JAS_VERSION@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_AGE = @LT_AGE@
+LT_CURRENT = @LT_CURRENT@
+LT_RELEASE = @LT_RELEASE@
+LT_REVISION = @LT_REVISION@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OPENGL_LIBS = @OPENGL_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+EXTRA_DIST = \
+       README \
+       jasper.dsw \
+       libjasper.dsp \
+       jasper.dsp \
+       jiv.dsp \
+       imgcmp.dsp \
+       imginfo.dsp
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/msvc/Makefile'; \
+       cd $(top_srcdir) && \
+         $(AUTOMAKE) --foreign  src/msvc/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+
+distclean-libtool:
+       -rm -f libtool
+uninstall-info-am:
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+       list='$(DISTFILES)'; for file in $$list; do \
+         case $$file in \
+           $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+           $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+         esac; \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+         if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+           dir="/$$dir"; \
+           $(mkdir_p) "$(distdir)$$dir"; \
+         else \
+           dir=''; \
+         fi; \
+         if test -d $$d/$$file; then \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+           fi; \
+           cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+         else \
+           test -f $(distdir)/$$file \
+           || cp -p $$d/$$file $(distdir)/$$file \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+         `test -z '$(STRIP)' || \
+           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-local mostlyclean-am
+
+distclean: distclean-am
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+       clean-local distclean distclean-generic distclean-libtool \
+       distdir dvi dvi-am html html-am info info-am install \
+       install-am install-data install-data-am install-exec \
+       install-exec-am install-info install-info-am install-man \
+       install-strip installcheck installcheck-am installdirs \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+       uninstall uninstall-am uninstall-info-am
+
+
+clean-local:
+       rm -rf *Win32_Debug *Win32_Release
+       rm -rf Release Debug
+       rm -rf *.ncb *.opt *.plg
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/msvc/README b/src/msvc/README
new file mode 100644 (file)
index 0000000..d0b9884
--- /dev/null
@@ -0,0 +1,2 @@
+This directory contains the workspace and project files necessary to
+build JasPer under Windows using MS Visual C Studio.
diff --git a/src/msvc/imgcmp.dsp b/src/msvc/imgcmp.dsp
new file mode 100644 (file)
index 0000000..4d0c53d
--- /dev/null
@@ -0,0 +1,100 @@
+# Microsoft Developer Studio Project File - Name="imgcmp" - Package Owner=<4>\r
+# Microsoft Developer Studio Generated Build File, Format Version 6.00\r
+# ** DO NOT EDIT **\r
+\r
+# TARGTYPE "Win32 (x86) Console Application" 0x0103\r
+\r
+CFG=imgcmp - Win32 Debug\r
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,\r
+!MESSAGE use the Export Makefile command and run\r
+!MESSAGE \r
+!MESSAGE NMAKE /f "imgcmp.mak".\r
+!MESSAGE \r
+!MESSAGE You can specify a configuration when running NMAKE\r
+!MESSAGE by defining the macro CFG on the command line. For example:\r
+!MESSAGE \r
+!MESSAGE NMAKE /f "imgcmp.mak" CFG="imgcmp - Win32 Debug"\r
+!MESSAGE \r
+!MESSAGE Possible choices for configuration are:\r
+!MESSAGE \r
+!MESSAGE "imgcmp - Win32 Release" (based on "Win32 (x86) Console Application")\r
+!MESSAGE "imgcmp - Win32 Debug" (based on "Win32 (x86) Console Application")\r
+!MESSAGE \r
+\r
+# Begin Project\r
+# PROP AllowPerConfigDependencies 0\r
+# PROP Scc_ProjName ""\r
+# PROP Scc_LocalPath ""\r
+CPP=cl.exe\r
+RSC=rc.exe\r
+\r
+!IF  "$(CFG)" == "imgcmp - Win32 Release"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 0\r
+# PROP BASE Output_Dir "imgcmp___Win32_Release"\r
+# PROP BASE Intermediate_Dir "imgcmp___Win32_Release"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 0\r
+# PROP Output_Dir "Win32_Release"\r
+# PROP Intermediate_Dir "imgcmp___Win32_Release"\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c\r
+# ADD CPP /nologo /W3 /GX /O2 /I "..\libjasper\include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "JAS_WIN_MSVC_BUILD" /YX /FD /c\r
+# ADD BASE RSC /l 0x409 /d "NDEBUG"\r
+# ADD RSC /l 0x409 /d "NDEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LINK32=link.exe\r
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386\r
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libjasper.lib /nologo /subsystem:console /machine:I386 /libpath:"Win32_Release"\r
+\r
+!ELSEIF  "$(CFG)" == "imgcmp - Win32 Debug"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 1\r
+# PROP BASE Output_Dir "imgcmp___Win32_Debug"\r
+# PROP BASE Intermediate_Dir "imgcmp___Win32_Debug"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 1\r
+# PROP Output_Dir "Win32_Debug"\r
+# PROP Intermediate_Dir "imgcmp___Win32_Debug"\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c\r
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\libjasper\include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "JAS_WIN_MSVC_BUILD" /YX /FD /GZ /c\r
+# ADD BASE RSC /l 0x409 /d "_DEBUG"\r
+# ADD RSC /l 0x409 /d "_DEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LINK32=link.exe\r
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libjasper.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"Win32_Debug"\r
+\r
+!ENDIF \r
+\r
+# Begin Target\r
+\r
+# Name "imgcmp - Win32 Release"\r
+# Name "imgcmp - Win32 Debug"\r
+# Begin Group "Source Files"\r
+\r
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"\r
+# Begin Source File\r
+\r
+SOURCE=..\appl\imgcmp.c\r
+# End Source File\r
+# End Group\r
+# Begin Group "Header Files"\r
+\r
+# PROP Default_Filter "h;hpp;hxx;hm;inl"\r
+# End Group\r
+# Begin Group "Resource Files"\r
+\r
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"\r
+# End Group\r
+# End Target\r
+# End Project\r
diff --git a/src/msvc/imginfo.dsp b/src/msvc/imginfo.dsp
new file mode 100644 (file)
index 0000000..e18f9c2
--- /dev/null
@@ -0,0 +1,102 @@
+# Microsoft Developer Studio Project File - Name="imginfo" - Package Owner=<4>\r
+# Microsoft Developer Studio Generated Build File, Format Version 6.00\r
+# ** DO NOT EDIT **\r
+\r
+# TARGTYPE "Win32 (x86) Console Application" 0x0103\r
+\r
+CFG=imginfo - Win32 Debug\r
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,\r
+!MESSAGE use the Export Makefile command and run\r
+!MESSAGE \r
+!MESSAGE NMAKE /f "imginfo.mak".\r
+!MESSAGE \r
+!MESSAGE You can specify a configuration when running NMAKE\r
+!MESSAGE by defining the macro CFG on the command line. For example:\r
+!MESSAGE \r
+!MESSAGE NMAKE /f "imginfo.mak" CFG="imginfo - Win32 Debug"\r
+!MESSAGE \r
+!MESSAGE Possible choices for configuration are:\r
+!MESSAGE \r
+!MESSAGE "imginfo - Win32 Release" (based on "Win32 (x86) Console Application")\r
+!MESSAGE "imginfo - Win32 Debug" (based on "Win32 (x86) Console Application")\r
+!MESSAGE \r
+\r
+# Begin Project\r
+# PROP AllowPerConfigDependencies 0\r
+# PROP Scc_ProjName ""\r
+# PROP Scc_LocalPath ""\r
+CPP=cl.exe\r
+RSC=rc.exe\r
+\r
+!IF  "$(CFG)" == "imginfo - Win32 Release"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 0\r
+# PROP BASE Output_Dir "imginfo___Win32_Release"\r
+# PROP BASE Intermediate_Dir "imginfo___Win32_Release"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 0\r
+# PROP Output_Dir "Win32_Release"\r
+# PROP Intermediate_Dir "imginfo___Win32_Release"\r
+# PROP Ignore_Export_Lib 0\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c\r
+# ADD CPP /nologo /W3 /GX /O2 /I "..\libjasper\include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "JAS_WIN_MSVC_BUILD" /YX /FD /c\r
+# ADD BASE RSC /l 0x409 /d "NDEBUG"\r
+# ADD RSC /l 0x409 /d "NDEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LINK32=link.exe\r
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386\r
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libjasper.lib /nologo /subsystem:console /machine:I386 /libpath:"Win32_Release"\r
+\r
+!ELSEIF  "$(CFG)" == "imginfo - Win32 Debug"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 1\r
+# PROP BASE Output_Dir "imginfo___Win32_Debug"\r
+# PROP BASE Intermediate_Dir "imginfo___Win32_Debug"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 1\r
+# PROP Output_Dir "Win32_Debug"\r
+# PROP Intermediate_Dir "imginfo___Win32_Debug"\r
+# PROP Ignore_Export_Lib 0\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c\r
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\libjasper\include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "JAS_WIN_MSVC_BUILD" /YX /FD /GZ /c\r
+# ADD BASE RSC /l 0x409 /d "_DEBUG"\r
+# ADD RSC /l 0x409 /d "_DEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LINK32=link.exe\r
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libjasper.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"Win32_Debug"\r
+\r
+!ENDIF \r
+\r
+# Begin Target\r
+\r
+# Name "imginfo - Win32 Release"\r
+# Name "imginfo - Win32 Debug"\r
+# Begin Group "Source Files"\r
+\r
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"\r
+# Begin Source File\r
+\r
+SOURCE=..\appl\imginfo.c\r
+# End Source File\r
+# End Group\r
+# Begin Group "Header Files"\r
+\r
+# PROP Default_Filter "h;hpp;hxx;hm;inl"\r
+# End Group\r
+# Begin Group "Resource Files"\r
+\r
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"\r
+# End Group\r
+# End Target\r
+# End Project\r
diff --git a/src/msvc/jasper.dsp b/src/msvc/jasper.dsp
new file mode 100644 (file)
index 0000000..34e82ad
--- /dev/null
@@ -0,0 +1,102 @@
+# Microsoft Developer Studio Project File - Name="jasper" - Package Owner=<4>\r
+# Microsoft Developer Studio Generated Build File, Format Version 6.00\r
+# ** DO NOT EDIT **\r
+\r
+# TARGTYPE "Win32 (x86) Console Application" 0x0103\r
+\r
+CFG=jasper - Win32 Debug\r
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,\r
+!MESSAGE use the Export Makefile command and run\r
+!MESSAGE \r
+!MESSAGE NMAKE /f "jasper.mak".\r
+!MESSAGE \r
+!MESSAGE You can specify a configuration when running NMAKE\r
+!MESSAGE by defining the macro CFG on the command line. For example:\r
+!MESSAGE \r
+!MESSAGE NMAKE /f "jasper.mak" CFG="jasper - Win32 Debug"\r
+!MESSAGE \r
+!MESSAGE Possible choices for configuration are:\r
+!MESSAGE \r
+!MESSAGE "jasper - Win32 Release" (based on "Win32 (x86) Console Application")\r
+!MESSAGE "jasper - Win32 Debug" (based on "Win32 (x86) Console Application")\r
+!MESSAGE \r
+\r
+# Begin Project\r
+# PROP AllowPerConfigDependencies 0\r
+# PROP Scc_ProjName ""\r
+# PROP Scc_LocalPath ""\r
+CPP=cl.exe\r
+RSC=rc.exe\r
+\r
+!IF  "$(CFG)" == "jasper - Win32 Release"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 0\r
+# PROP BASE Output_Dir "Release"\r
+# PROP BASE Intermediate_Dir "Release"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 0\r
+# PROP Output_Dir "Win32_Release"\r
+# PROP Intermediate_Dir "jasper___Win32_Release"\r
+# PROP Ignore_Export_Lib 0\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c\r
+# ADD CPP /nologo /W3 /GX /O2 /I "..\libjasper\include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "JAS_WIN_MSVC_BUILD" /YX /FD /c\r
+# ADD BASE RSC /l 0x409 /d "NDEBUG"\r
+# ADD RSC /l 0x409 /d "NDEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LINK32=link.exe\r
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386\r
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libjasper.lib /nologo /subsystem:console /machine:I386 /libpath:"Win32_Release"\r
+\r
+!ELSEIF  "$(CFG)" == "jasper - Win32 Debug"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 1\r
+# PROP BASE Output_Dir "jasper___Win32_Debug"\r
+# PROP BASE Intermediate_Dir "jasper___Win32_Debug"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 1\r
+# PROP Output_Dir "Win32_Debug"\r
+# PROP Intermediate_Dir "jasper___Win32_Debug"\r
+# PROP Ignore_Export_Lib 0\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c\r
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\libjasper\include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "JAS_WIN_MSVC_BUILD" /YX /FD /GZ /c\r
+# ADD BASE RSC /l 0x409 /d "_DEBUG"\r
+# ADD RSC /l 0x409 /d "_DEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LINK32=link.exe\r
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libjasper.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"Win32_Debug"\r
+\r
+!ENDIF \r
+\r
+# Begin Target\r
+\r
+# Name "jasper - Win32 Release"\r
+# Name "jasper - Win32 Debug"\r
+# Begin Group "Source Files"\r
+\r
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"\r
+# Begin Source File\r
+\r
+SOURCE=..\appl\jasper.c\r
+# End Source File\r
+# End Group\r
+# Begin Group "Header Files"\r
+\r
+# PROP Default_Filter "h;hpp;hxx;hm;inl"\r
+# End Group\r
+# Begin Group "Resource Files"\r
+\r
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"\r
+# End Group\r
+# End Target\r
+# End Project\r
diff --git a/src/msvc/jasper.dsw b/src/msvc/jasper.dsw
new file mode 100644 (file)
index 0000000..f4cf8f4
--- /dev/null
@@ -0,0 +1,86 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00\r
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!\r
+\r
+###############################################################################\r
+\r
+Project: "imgcmp"=".\imgcmp.dsp" - Package Owner=<4>\r
+\r
+Package=<5>\r
+{{{\r
+}}}\r
+\r
+Package=<4>\r
+{{{\r
+    Begin Project Dependency\r
+    Project_Dep_Name libjasper\r
+    End Project Dependency\r
+}}}\r
+\r
+###############################################################################\r
+\r
+Project: "imginfo"=".\imginfo.dsp" - Package Owner=<4>\r
+\r
+Package=<5>\r
+{{{\r
+}}}\r
+\r
+Package=<4>\r
+{{{\r
+    Begin Project Dependency\r
+    Project_Dep_Name libjasper\r
+    End Project Dependency\r
+}}}\r
+\r
+###############################################################################\r
+\r
+Project: "jasper"=".\jasper.dsp" - Package Owner=<4>\r
+\r
+Package=<5>\r
+{{{\r
+}}}\r
+\r
+Package=<4>\r
+{{{\r
+    Begin Project Dependency\r
+    Project_Dep_Name libjasper\r
+    End Project Dependency\r
+}}}\r
+\r
+###############################################################################\r
+\r
+Project: "jiv"=".\jiv.dsp" - Package Owner=<4>\r
+\r
+Package=<5>\r
+{{{\r
+}}}\r
+\r
+Package=<4>\r
+{{{\r
+}}}\r
+\r
+###############################################################################\r
+\r
+Project: "libjasper"=".\libjasper.dsp" - Package Owner=<4>\r
+\r
+Package=<5>\r
+{{{\r
+}}}\r
+\r
+Package=<4>\r
+{{{\r
+}}}\r
+\r
+###############################################################################\r
+\r
+Global:\r
+\r
+Package=<5>\r
+{{{\r
+}}}\r
+\r
+Package=<3>\r
+{{{\r
+}}}\r
+\r
+###############################################################################\r
+\r
diff --git a/src/msvc/jiv.dsp b/src/msvc/jiv.dsp
new file mode 100644 (file)
index 0000000..0bb09ee
--- /dev/null
@@ -0,0 +1,102 @@
+# Microsoft Developer Studio Project File - Name="jiv" - Package Owner=<4>\r
+# Microsoft Developer Studio Generated Build File, Format Version 6.00\r
+# ** DO NOT EDIT **\r
+\r
+# TARGTYPE "Win32 (x86) Console Application" 0x0103\r
+\r
+CFG=jiv - Win32 Debug\r
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,\r
+!MESSAGE use the Export Makefile command and run\r
+!MESSAGE \r
+!MESSAGE NMAKE /f "jiv.mak".\r
+!MESSAGE \r
+!MESSAGE You can specify a configuration when running NMAKE\r
+!MESSAGE by defining the macro CFG on the command line. For example:\r
+!MESSAGE \r
+!MESSAGE NMAKE /f "jiv.mak" CFG="jiv - Win32 Debug"\r
+!MESSAGE \r
+!MESSAGE Possible choices for configuration are:\r
+!MESSAGE \r
+!MESSAGE "jiv - Win32 Release" (based on "Win32 (x86) Console Application")\r
+!MESSAGE "jiv - Win32 Debug" (based on "Win32 (x86) Console Application")\r
+!MESSAGE \r
+\r
+# Begin Project\r
+# PROP AllowPerConfigDependencies 0\r
+# PROP Scc_ProjName ""\r
+# PROP Scc_LocalPath ""\r
+CPP=cl.exe\r
+RSC=rc.exe\r
+\r
+!IF  "$(CFG)" == "jiv - Win32 Release"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 0\r
+# PROP BASE Output_Dir "Release"\r
+# PROP BASE Intermediate_Dir "Release"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 0\r
+# PROP Output_Dir "Win32_Release"\r
+# PROP Intermediate_Dir "jiv___Win32_Release"\r
+# PROP Ignore_Export_Lib 0\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c\r
+# ADD CPP /nologo /W3 /GX /O2 /I "..\libjasper\include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "JAS_WIN_MSVC_BUILD" /YX /FD /c\r
+# ADD BASE RSC /l 0x409 /d "NDEBUG"\r
+# ADD RSC /l 0x409 /d "NDEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LINK32=link.exe\r
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386\r
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libjasper.lib /nologo /subsystem:console /machine:I386 /libpath:"Win32_Release"\r
+\r
+!ELSEIF  "$(CFG)" == "jiv - Win32 Debug"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 1\r
+# PROP BASE Output_Dir "Debug"\r
+# PROP BASE Intermediate_Dir "Debug"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 1\r
+# PROP Output_Dir "Win32_Debug"\r
+# PROP Intermediate_Dir "jiv___Win32_Debug"\r
+# PROP Ignore_Export_Lib 0\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c\r
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\libjasper\include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "JAS_WIN_MSVC_BUILD" /YX /FD /GZ /c\r
+# ADD BASE RSC /l 0x409 /d "_DEBUG"\r
+# ADD RSC /l 0x409 /d "_DEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LINK32=link.exe\r
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libjasper.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"Win32_Debug"\r
+\r
+!ENDIF \r
+\r
+# Begin Target\r
+\r
+# Name "jiv - Win32 Release"\r
+# Name "jiv - Win32 Debug"\r
+# Begin Group "Source Files"\r
+\r
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"\r
+# Begin Source File\r
+\r
+SOURCE=..\appl\jiv.c\r
+# End Source File\r
+# End Group\r
+# Begin Group "Header Files"\r
+\r
+# PROP Default_Filter "h;hpp;hxx;hm;inl"\r
+# End Group\r
+# Begin Group "Resource Files"\r
+\r
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"\r
+# End Group\r
+# End Target\r
+# End Project\r
diff --git a/src/msvc/libjasper.dsp b/src/msvc/libjasper.dsp
new file mode 100644 (file)
index 0000000..86cb324
--- /dev/null
@@ -0,0 +1,428 @@
+# Microsoft Developer Studio Project File - Name="libjasper" - Package Owner=<4>\r
+# Microsoft Developer Studio Generated Build File, Format Version 6.00\r
+# ** DO NOT EDIT **\r
+\r
+# TARGTYPE "Win32 (x86) Static Library" 0x0104\r
+\r
+CFG=libjasper - Win32 Debug\r
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,\r
+!MESSAGE use the Export Makefile command and run\r
+!MESSAGE \r
+!MESSAGE NMAKE /f "libjasper.mak".\r
+!MESSAGE \r
+!MESSAGE You can specify a configuration when running NMAKE\r
+!MESSAGE by defining the macro CFG on the command line. For example:\r
+!MESSAGE \r
+!MESSAGE NMAKE /f "libjasper.mak" CFG="libjasper - Win32 Debug"\r
+!MESSAGE \r
+!MESSAGE Possible choices for configuration are:\r
+!MESSAGE \r
+!MESSAGE "libjasper - Win32 Release" (based on "Win32 (x86) Static Library")\r
+!MESSAGE "libjasper - Win32 Debug" (based on "Win32 (x86) Static Library")\r
+!MESSAGE \r
+\r
+# Begin Project\r
+# PROP AllowPerConfigDependencies 0\r
+# PROP Scc_ProjName ""\r
+# PROP Scc_LocalPath ""\r
+CPP=cl.exe\r
+RSC=rc.exe\r
+\r
+!IF  "$(CFG)" == "libjasper - Win32 Release"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 0\r
+# PROP BASE Output_Dir "Release"\r
+# PROP BASE Intermediate_Dir "Release"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 0\r
+# PROP Output_Dir "Win32_Release"\r
+# PROP Intermediate_Dir "libjasper___Win32_Release"\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c\r
+# ADD CPP /nologo /W3 /GX /O2 /I "..\libjasper\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "JAS_WIN_MSVC_BUILD" /YX /FD /c\r
+# ADD BASE RSC /l 0x409 /d "NDEBUG"\r
+# ADD RSC /l 0x409 /d "NDEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LIB32=link.exe -lib\r
+# ADD BASE LIB32 /nologo\r
+# ADD LIB32 /nologo\r
+\r
+!ELSEIF  "$(CFG)" == "libjasper - Win32 Debug"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 1\r
+# PROP BASE Output_Dir "Debug"\r
+# PROP BASE Intermediate_Dir "Debug"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 1\r
+# PROP Output_Dir "Win32_Debug"\r
+# PROP Intermediate_Dir "libjasper___Win32_Debug"\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c\r
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\libjasper\include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "JAS_WIN_MSVC_BUILD" /YX /FD /GZ /c\r
+# ADD BASE RSC /l 0x409 /d "_DEBUG"\r
+# ADD RSC /l 0x409 /d "_DEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LIB32=link.exe -lib\r
+# ADD BASE LIB32 /nologo\r
+# ADD LIB32 /nologo\r
+\r
+!ENDIF \r
+\r
+# Begin Target\r
+\r
+# Name "libjasper - Win32 Release"\r
+# Name "libjasper - Win32 Debug"\r
+# Begin Group "Source Files"\r
+\r
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\bmp\bmp_cod.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\bmp\bmp_dec.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\bmp\bmp_enc.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\base\jas_cm.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\base\jas_debug.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\base\jas_getopt.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\base\jas_icc.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\base\jas_iccdata.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\base\jas_image.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\base\jas_init.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\base\jas_malloc.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\base\jas_seq.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\base\jas_stream.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\base\jas_string.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\base\jas_tmr.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\base\jas_tvp.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\base\jas_version.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jp2\jp2_cod.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jp2\jp2_dec.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jp2\jp2_enc.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpc\jpc_bs.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpc\jpc_cs.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpc\jpc_dec.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpc\jpc_enc.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpc\jpc_math.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpc\jpc_mct.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpc\jpc_mqcod.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpc\jpc_mqdec.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpc\jpc_mqenc.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpc\jpc_qmfb.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpc\jpc_t1cod.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpc\jpc_t1dec.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpc\jpc_t1enc.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpc\jpc_t2cod.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpc\jpc_t2dec.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpc\jpc_t2enc.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpc\jpc_tagtree.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpc\jpc_tsfb.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpc\jpc_util.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpg\jpg_dummy.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpg\jpg_val.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\mif\mif_cod.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\pgx\pgx_cod.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\pgx\pgx_dec.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\pgx\pgx_enc.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\pnm\pnm_cod.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\pnm\pnm_dec.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\pnm\pnm_enc.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\ras\ras_cod.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\ras\ras_dec.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\ras\ras_enc.c\r
+# End Source File\r
+# End Group\r
+# Begin Group "Header Files"\r
+\r
+# PROP Default_Filter "h;hpp;hxx;hm;inl"\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\bmp\bmp_cod.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\include\jasper\jas_cm.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\include\jasper\jas_icc.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\include\jasper\jas_tmr.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jp2\jp2_cod.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jp2\jp2_dec.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpc\jpc_bs.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpc\jpc_cod.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpc\jpc_cs.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpc\jpc_dec.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpc\jpc_enc.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpc\jpc_fix.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpc\jpc_flt.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpc\jpc_math.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpc\jpc_mct.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpc\jpc_mqcod.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpc\jpc_mqdec.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpc\jpc_mqenc.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpc\jpc_qmfb.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpc\jpc_t1cod.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpc\jpc_t1dec.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpc\jpc_t1enc.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpc\jpc_t2cod.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpc\jpc_t2dec.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpc\jpc_t2enc.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpc\jpc_tagtree.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpc\jpc_tsfb.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpc\jpc_util.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\jpg\jpg_cod.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\mif\mif_cod.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\pgx\pgx_cod.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\pnm\pnm_cod.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\libjasper\ras\ras_cod.h\r
+# End Source File\r
+# End Group\r
+# End Target\r
+# End Project\r