changeset 0:d901c9f41a6a default tip

Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
author dawe
date Tue, 07 Jun 2011 17:48:05 -0400
parents
children
files srf2fastq/._README srf2fastq/README srf2fastq/io_lib-1.12.2/CHANGES srf2fastq/io_lib-1.12.2/COPYRIGHT srf2fastq/io_lib-1.12.2/ChangeLog srf2fastq/io_lib-1.12.2/Makefile.am srf2fastq/io_lib-1.12.2/Makefile.in srf2fastq/io_lib-1.12.2/README srf2fastq/io_lib-1.12.2/acinclude.m4 srf2fastq/io_lib-1.12.2/aclocal.m4 srf2fastq/io_lib-1.12.2/bootstrap srf2fastq/io_lib-1.12.2/compile srf2fastq/io_lib-1.12.2/config.guess srf2fastq/io_lib-1.12.2/config.sub srf2fastq/io_lib-1.12.2/configure srf2fastq/io_lib-1.12.2/configure.in srf2fastq/io_lib-1.12.2/depcomp srf2fastq/io_lib-1.12.2/docs/Hash_File_Format srf2fastq/io_lib-1.12.2/docs/ZTR_format srf2fastq/io_lib-1.12.2/install-sh srf2fastq/io_lib-1.12.2/io_lib-config.in srf2fastq/io_lib-1.12.2/io_lib/Makefile.am srf2fastq/io_lib-1.12.2/io_lib/Makefile.in srf2fastq/io_lib-1.12.2/io_lib/Read.c srf2fastq/io_lib-1.12.2/io_lib/Read.h srf2fastq/io_lib-1.12.2/io_lib/abi.h srf2fastq/io_lib-1.12.2/io_lib/alf.h srf2fastq/io_lib-1.12.2/io_lib/array.c srf2fastq/io_lib-1.12.2/io_lib/array.h srf2fastq/io_lib-1.12.2/io_lib/compress.c srf2fastq/io_lib-1.12.2/io_lib/compress.h srf2fastq/io_lib-1.12.2/io_lib/compression.c srf2fastq/io_lib-1.12.2/io_lib/compression.h srf2fastq/io_lib-1.12.2/io_lib/ctfCompress.c srf2fastq/io_lib-1.12.2/io_lib/deflate_interlaced.c srf2fastq/io_lib-1.12.2/io_lib/deflate_interlaced.h srf2fastq/io_lib-1.12.2/io_lib/error.c srf2fastq/io_lib-1.12.2/io_lib/error.h srf2fastq/io_lib-1.12.2/io_lib/expFileIO.c srf2fastq/io_lib-1.12.2/io_lib/expFileIO.h srf2fastq/io_lib-1.12.2/io_lib/files.c srf2fastq/io_lib-1.12.2/io_lib/find.c srf2fastq/io_lib-1.12.2/io_lib/fpoint.c srf2fastq/io_lib-1.12.2/io_lib/fpoint.h srf2fastq/io_lib-1.12.2/io_lib/hash_table.c srf2fastq/io_lib-1.12.2/io_lib/hash_table.h srf2fastq/io_lib-1.12.2/io_lib/jenkins_lookup3.c srf2fastq/io_lib-1.12.2/io_lib/jenkins_lookup3.h srf2fastq/io_lib-1.12.2/io_lib/mFILE.c srf2fastq/io_lib-1.12.2/io_lib/mFILE.h srf2fastq/io_lib-1.12.2/io_lib/mach-io.c srf2fastq/io_lib-1.12.2/io_lib/mach-io.h srf2fastq/io_lib-1.12.2/io_lib/misc.h srf2fastq/io_lib-1.12.2/io_lib/misc_scf.c srf2fastq/io_lib-1.12.2/io_lib/open_trace_file.c srf2fastq/io_lib-1.12.2/io_lib/open_trace_file.h srf2fastq/io_lib-1.12.2/io_lib/os.h srf2fastq/io_lib-1.12.2/io_lib/plain.h srf2fastq/io_lib-1.12.2/io_lib/pooled_alloc.c srf2fastq/io_lib-1.12.2/io_lib/pooled_alloc.h srf2fastq/io_lib-1.12.2/io_lib/read_alloc.c srf2fastq/io_lib-1.12.2/io_lib/read_scf.c srf2fastq/io_lib-1.12.2/io_lib/scf.h srf2fastq/io_lib-1.12.2/io_lib/scf_extras.c srf2fastq/io_lib-1.12.2/io_lib/scf_extras.h srf2fastq/io_lib-1.12.2/io_lib/seqIOABI.c srf2fastq/io_lib-1.12.2/io_lib/seqIOABI.h srf2fastq/io_lib-1.12.2/io_lib/seqIOALF.c srf2fastq/io_lib-1.12.2/io_lib/seqIOCTF.c srf2fastq/io_lib-1.12.2/io_lib/seqIOCTF.h srf2fastq/io_lib-1.12.2/io_lib/seqIOPlain.c srf2fastq/io_lib-1.12.2/io_lib/sff.c srf2fastq/io_lib-1.12.2/io_lib/sff.h srf2fastq/io_lib-1.12.2/io_lib/srf.c srf2fastq/io_lib-1.12.2/io_lib/srf.h srf2fastq/io_lib-1.12.2/io_lib/stdio_hack.h srf2fastq/io_lib-1.12.2/io_lib/strings.c srf2fastq/io_lib-1.12.2/io_lib/tar_format.h srf2fastq/io_lib-1.12.2/io_lib/traceType.c srf2fastq/io_lib-1.12.2/io_lib/traceType.h srf2fastq/io_lib-1.12.2/io_lib/translate.c srf2fastq/io_lib-1.12.2/io_lib/translate.h srf2fastq/io_lib-1.12.2/io_lib/vlen.c srf2fastq/io_lib-1.12.2/io_lib/vlen.h srf2fastq/io_lib-1.12.2/io_lib/write_scf.c srf2fastq/io_lib-1.12.2/io_lib/xalloc.c srf2fastq/io_lib-1.12.2/io_lib/xalloc.h srf2fastq/io_lib-1.12.2/io_lib/ztr.c srf2fastq/io_lib-1.12.2/io_lib/ztr.h srf2fastq/io_lib-1.12.2/io_lib/ztr_translate.c srf2fastq/io_lib-1.12.2/io_lib_config.h srf2fastq/io_lib-1.12.2/io_lib_config.h.in srf2fastq/io_lib-1.12.2/ltmain.sh srf2fastq/io_lib-1.12.2/man/man1/illumina2srf.1 srf2fastq/io_lib-1.12.2/man/man1/srf2fasta.1 srf2fastq/io_lib-1.12.2/man/man1/srf2fastq.1 srf2fastq/io_lib-1.12.2/man/man1/srf2fastq.1~ srf2fastq/io_lib-1.12.2/man/man1/srf_index_hash.1 srf2fastq/io_lib-1.12.2/man/man1/srf_info.1 srf2fastq/io_lib-1.12.2/man/man1/srf_list.1 srf2fastq/io_lib-1.12.2/man/man3/ExperimentFile.3 srf2fastq/io_lib-1.12.2/man/man3/exp2read.3 srf2fastq/io_lib-1.12.2/man/man3/fread_reading.3 srf2fastq/io_lib-1.12.2/man/man3/fread_scf.3 srf2fastq/io_lib-1.12.2/man/man3/fwrite_reading.3 srf2fastq/io_lib-1.12.2/man/man3/fwrite_scf.3 srf2fastq/io_lib-1.12.2/man/man3/read2exp.3 srf2fastq/io_lib-1.12.2/man/man3/read2scf.3 srf2fastq/io_lib-1.12.2/man/man3/read_allocate.3 srf2fastq/io_lib-1.12.2/man/man3/read_deallocate.3 srf2fastq/io_lib-1.12.2/man/man3/read_reading.3 srf2fastq/io_lib-1.12.2/man/man3/read_scf.3 srf2fastq/io_lib-1.12.2/man/man3/read_scf_header.3 srf2fastq/io_lib-1.12.2/man/man3/scf2read.3 srf2fastq/io_lib-1.12.2/man/man3/write_reading.3 srf2fastq/io_lib-1.12.2/man/man3/write_scf.3 srf2fastq/io_lib-1.12.2/man/man3/write_scf_header.3 srf2fastq/io_lib-1.12.2/man/man4/Read.4 srf2fastq/io_lib-1.12.2/missing srf2fastq/io_lib-1.12.2/options.mk srf2fastq/io_lib-1.12.2/progs/Makefile.am srf2fastq/io_lib-1.12.2/progs/Makefile.in srf2fastq/io_lib-1.12.2/progs/append_sff.c srf2fastq/io_lib-1.12.2/progs/convert_trace.c srf2fastq/io_lib-1.12.2/progs/extract_fastq.c srf2fastq/io_lib-1.12.2/progs/extract_qual.c srf2fastq/io_lib-1.12.2/progs/extract_seq.c srf2fastq/io_lib-1.12.2/progs/get_comment.c srf2fastq/io_lib-1.12.2/progs/hash_extract.c srf2fastq/io_lib-1.12.2/progs/hash_list.c srf2fastq/io_lib-1.12.2/progs/hash_sff.c srf2fastq/io_lib-1.12.2/progs/hash_tar.c srf2fastq/io_lib-1.12.2/progs/index_tar.c srf2fastq/io_lib-1.12.2/progs/makeSCF.c srf2fastq/io_lib-1.12.2/progs/scf_dump.c srf2fastq/io_lib-1.12.2/progs/scf_info.c srf2fastq/io_lib-1.12.2/progs/scf_update.c srf2fastq/io_lib-1.12.2/progs/srf2fasta.c srf2fastq/io_lib-1.12.2/progs/srf2fastq.c srf2fastq/io_lib-1.12.2/progs/srf_dump_all.c srf2fastq/io_lib-1.12.2/progs/srf_extract_hash.c srf2fastq/io_lib-1.12.2/progs/srf_extract_linear.c srf2fastq/io_lib-1.12.2/progs/srf_filter.c srf2fastq/io_lib-1.12.2/progs/srf_index_hash.c srf2fastq/io_lib-1.12.2/progs/srf_info.c srf2fastq/io_lib-1.12.2/progs/srf_list.c srf2fastq/io_lib-1.12.2/progs/trace_dump.c srf2fastq/io_lib-1.12.2/progs/ztr_dump.c srf2fastq/io_lib-1.12.2/tests/Makefile.am srf2fastq/io_lib-1.12.2/tests/Makefile.in srf2fastq/io_lib-1.12.2/tests/data/both.info srf2fastq/io_lib-1.12.2/tests/data/both.run/4_ILLUMINA_GA_BUSTARD_PARAMS.txt srf2fastq/io_lib-1.12.2/tests/data/both.run/4_ILLUMINA_GA_CHASTITY.txt srf2fastq/io_lib-1.12.2/tests/data/both.run/4_ILLUMINA_GA_FIRECREST_PARAMS.txt srf2fastq/io_lib-1.12.2/tests/data/both.run/4_ILLUMINA_GA_MATRIX_FWD.txt srf2fastq/io_lib-1.12.2/tests/data/both.run/4_ILLUMINA_GA_PHASING_FWD.txt srf2fastq/io_lib-1.12.2/tests/data/both.run/4_PROGRAM_ID.txt srf2fastq/io_lib-1.12.2/tests/data/both.run/s_4_0133_int.txt srf2fastq/io_lib-1.12.2/tests/data/both.run/s_4_0133_nse.txt srf2fastq/io_lib-1.12.2/tests/data/both.run/s_4_0133_prb.txt srf2fastq/io_lib-1.12.2/tests/data/both.run/s_4_0133_seq.txt srf2fastq/io_lib-1.12.2/tests/data/both.run/s_4_0133_sig2.txt srf2fastq/io_lib-1.12.2/tests/data/both.run/s_4_0134_int.txt srf2fastq/io_lib-1.12.2/tests/data/both.run/s_4_0134_nse.txt srf2fastq/io_lib-1.12.2/tests/data/both.run/s_4_0134_prb.txt srf2fastq/io_lib-1.12.2/tests/data/both.run/s_4_0134_seq.txt srf2fastq/io_lib-1.12.2/tests/data/both.run/s_4_0134_sig2.txt srf2fastq/io_lib-1.12.2/tests/data/both.srf srf2fastq/io_lib-1.12.2/tests/data/proc.info srf2fastq/io_lib-1.12.2/tests/data/proc.srf srf2fastq/io_lib-1.12.2/tests/data/proc.srf.indexed srf2fastq/io_lib-1.12.2/tests/data/raw.info srf2fastq/io_lib-1.12.2/tests/data/raw.srf srf2fastq/io_lib-1.12.2/tests/data/slx-C.fasta srf2fastq/io_lib-1.12.2/tests/data/slx-C.fastq srf2fastq/io_lib-1.12.2/tests/data/slx.fasta srf2fastq/io_lib-1.12.2/tests/data/slx.fastq srf2fastq/io_lib-1.12.2/tests/data/test_run_4_134_369_182.srf srf2fastq/io_lib-1.12.2/tests/data/traces.srf srf2fastq/io_lib-1.12.2/tests/srf2fasta.test srf2fastq/io_lib-1.12.2/tests/srf2fastq.test srf2fastq/io_lib-1.12.2/tests/srf_filter.test srf2fastq/io_lib-1.12.2/tests/srf_index.test srf2fastq/io_lib-1.12.2/tests/srf_info.test srf2fastq/srf2fastq.sh srf2fastq/srf2fastq.xml
diffstat 186 files changed, 94069 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
Binary file srf2fastq/._README has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/README	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,94 @@
+This tool comes with io_lib (from Staden package) version 1.12.2
+io_lib is necessary as you will need srf2fastq executable; if you alread have the binary, skip the io_lib installation.
+You may find a more recent version here http://sourceforge.net/projects/staden/files/
+
+1- Install io_lib
+cd io_lib-1.12.2
+./configure --prefix=PREFIX
+make
+make install #assuming you have already superuser permissions granted
+
+2- Edit srf2fastq.sh
+You will need to change the path of srf2fastq executable if
+PREFIX has been defined different from /usr/local:wq
+
+3- Add support for SRF files in galaxy (if galaxy team hasn't added yet)
+Here comes a series of diffs you may want to integrate. lib/galaxy/datatypes/binary.py and lib/galaxy/datatypes/registry.py
+are part of galaxy distribution so a hg diff output is given. datatype_conf.xml is not in
+galaxy repository (the sample is), so a unified diff is given (well, it's the same...)
+
+diff -r 60448575467f lib/galaxy/datatypes/binary.py
+--- a/lib/galaxy/datatypes/binary.py    Mon Aug 23 10:15:17 2010 -0400
++++ b/lib/galaxy/datatypes/binary.py    Wed Aug 25 10:26:38 2010 +0200
+@@ -222,3 +222,31 @@
+         Binary.__init__( self, **kwd )
+         self._magic = 0x8789F2EB
+         self._name = "BigBed"
++
++class Srf( Binary ):
++    """ Illumina Sequence Archive (SRF) """
++    file_ext = "srf"
++
++    def __init__( self, **kwd ):
++        Binary.__init__( self, **kwd )
++    def sniff( self, filename ):
++        try:
++            header = open( filename ).read(4)
++            if binascii.b2a_hex( header ) == binascii.hexlify( 'SSRF' ):
++                return True
++            return False
++        except:
++            return False
++    def set_peek( self, dataset, is_multi_byte=False ):
++        if not dataset.dataset.purged:
++            dataset.peek  = "Binary srf file" 
++            dataset.blurb = data.nice_size( dataset.get_size() )
++        else:
++            dataset.peek = 'file does not exist'
++            dataset.blurb = 'file purged from disk'
++    def display_peek( self, dataset ):
++        try:
++            return dataset.peek
++        except:
++            return "Binary srf file (%s)" % ( data.nice_size( dataset.get_size() ) )
++
+
+diff -r 60448575467f lib/galaxy/datatypes/registry.py
+--- a/lib/galaxy/datatypes/registry.py  Mon Aug 23 10:15:17 2010 -0400
++++ b/lib/galaxy/datatypes/registry.py  Wed Aug 25 10:28:01 2010 +0200
+@@ -173,6 +173,7 @@
+                 'sam'         : tabular.Sam(), 
+                 'scf'         : binary.Scf(),
+                 'sff'         : binary.Sff(),
++                'srf'         : binary.Srf(),
+                 'tabular'     : tabular.Tabular(),
+                 'taxonomy'    : tabular.Taxonomy(),
+                 'txt'         : data.Text(),
+@@ -213,6 +214,7 @@
+         if len(self.sniff_order) < 1:
+             self.sniff_order = [
+                 binary.Bam(),
++                binary.Srf(),
+                 binary.Sff(),
+                 xml.BlastXml(),
+                 sequence.Maf(),
+
+diff -u datatypes_conf.xml datatypes_conf.xml.sample 
+--- datatypes_conf.xml          2010-08-25 10:32:46.778959931 +0200
++++ datatypes_conf.xml.sample   2010-08-25 07:20:34.190956591 +0200
+@@ -105,7 +105,6 @@
+         <datatype extension="scf" type="galaxy.datatypes.binary:Scf" mimetype="application/octet-stream" display_in_upload="true"/>
+         <datatype extension="Sequences" type="galaxy.datatypes.assembly:Sequences" display_in_upload="false"/>
+         <datatype extension="sff" type="galaxy.datatypes.binary:Sff" mimetype="application/octet-stream" display_in_upload="true"/>
+-        <datatype extension="srf" type="galaxy.datatypes.binary:Srf" mimetype="application/octet-stream" display_in_upload="true"/>
+         <datatype extension="taxonomy" type="galaxy.datatypes.tabular:Taxonomy" display_in_upload="true"/>
+         <datatype extension="tabular" type="galaxy.datatypes.tabular:Tabular" display_in_upload="true"/>
+         <datatype extension="txt" type="galaxy.datatypes.data:Text" display_in_upload="true"/>
+@@ -264,7 +263,6 @@
+           and so on.
+         -->
+         <sniffer type="galaxy.datatypes.binary:Bam"/>
+-        <sniffer type="galaxy.datatypes.binary:Srf"/>
+         <sniffer type="galaxy.datatypes.binary:Sff"/>
+         <sniffer type="galaxy.datatypes.xml:BlastXml"/>
+         <sniffer type="galaxy.datatypes.sequence:Maf"/>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/CHANGES	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,1342 @@
+Version 1.12.2 (15th Jan 2010)
+--------------
+
+* Extra options in srf2fastq: -S to output split regions sequentially
+  to stdout. -r to request a region to be reverse complemented before
+  output.
+
+* API addition
+  - Added pooled_alloc.h. This is a general purpose mechanism of
+    pooling multiple fixed size memory allocations into fewer malloc()
+    library calls.
+  - HashTables now have a HASH_POOL_ITEMS option to use the above
+    pooling system. This reduces memory wasted and speeds them up.
+
+* Bug fix: Fixed ztr_add_text() so that is leaves two nul bytes on the
+  end of TEXT chunks instead of one, as documented in the ZTR
+  specification.
+
+* Bug fix: Fixed buffer overrun in parse region chunks; srf2fastq and
+  srf2fasta.
+
+* Bug fix: API read_sff_read_data() did not skip ahead to the next
+  8-byte boundary.
+
+
+Version 1.12.1 (7th August 2009)
+--------------
+
+* Fixed the endianness detection in io_lib/os.h when used in
+  conjuction with auto-conf. This fix allows for "fat" binaries to be
+  built on MacOS X.
+
+* Fixed io_lib-config program to use -lstaden-read instead of -lread.
+
+
+Version 1.12.0 (29th July 2009)
+--------------
+
+* Renamed the library from libread.so to libstaden-read.so. This was
+  already the case for the Fedora bundled RPM.
+
+* Switched to using libtool to allow building of dynamic libraries.
+  Note that this is tweaked to not use -rpath though. Proper library
+  versioning has been added too.
+
+* Removed deprecated platform specific tools: illumina2srf,
+  srf2illumina.
+
+* Srf_info now reports the compressed size of chunks, sorted by type,
+  in addition to their counts. It also correctly sums to over 2Gb now
+  for base-call counting.
+
+* Various SRF tools have had the maximum sequence length changed from
+  1024 to 10000. This allows for even the most gifting capillary traces.
+
+* API
+  - The Array functions now take size_t instead of int for the
+    array dimensions. (API CHANGE)
+
+  - Removed the (unused?) pipe2 function from compress.h. This was
+    intended to be internal only, and it now clashes with a new linux
+    kernel function. (API CHANGE)
+
+  - Added iterators to the HashTable* api.
+
+* Bug fixes
+
+  - Fixed a memory allocation bug in the codes2codeset() function.
+
+  - ztr2read() should now work better on ZTR structs with no BPOS
+    chunk.
+
+  - Fixed various srf tools when facing an SRF file containing zero
+    chunks in the data block header.
+
+  - index_tar handles some GNU tar extensions better (LongLink).
+
+
+Version 1.11.6.1 (9th December 2008)
+----------------
+
+* Identical except removal of a debugging printf statement in solexa2srf.
+
+
+Version 1.11.6 (9th December 2008)
+--------------
+
+* illumina2srf, srf2illumina, srf2fastq
+  - We no longer change from log-odds to phred when storing data in
+    SRF, instead preferring to just mark it in correct input
+    scale. srf2fastq now honours this scale information and so the
+    conversion from log-odd to phred is done at the export stage
+    instead. (Chris Saunders)
+
+  - Bug fix to srf2illumina qcal conversion. Combined with above
+    changes the qcal output should now be 100% identical to the
+    original data input via illumina2srf.
+
+* API
+  - New function srf_next_ztr_flags. This is like srf_next_ztr but
+    also returns the SRF flags value (good/bad read, etc).
+
+* srf_filter, srf2fastq, srf_info (Steven Leonard)
+  - Improved support for multiple index blocks in SRF files, eg from
+    manually concatenated files.
+
+  - srf2fastq now sports options for splitting the output into
+    multiple fastq files when the input data is a paired-end run.
+
+
+Version 1.11.5 (3rd December 2008)
+--------------
+
+* Illumina2srf
+  - Fixed major bug with using *both* -qf and -qr together. The
+    quality values for the reverse strand were shifted by one
+    character.
+
+  - Fixed qcal quality values so they're not shifted down by 64
+    (illumina format fastq).
+
+  - Fixed bugs in parsing directory names if not matching the expected
+    format.
+
+* Removed major memory leaks from srf_filter.
+
+* hash_sff now has support for outputting the table of contents to a
+  new file rather than appending to an existing sff file or copying
+  the entire contents to a new file.
+
+* Various man pages have been added. The list is still incomplete
+  though. Additions are most welcome.
+
+* New program: srf_list. This lists and/or counts the number of
+  sequences within an SRF file.
+
+
+Version 1.11.4 (11th September 2008)
+--------------
+
+* New "make check" build target to perform some automated tested.
+  Currently limited to testing the SRF tools.
+
+* Fixed machine endianness issues. Specifically this resolves known Intel
+  MacOS-X problems.
+
+* New SRF tools
+
+  - srf_info: reports simple metrics on the contents of an SRF file.
+
+  - srf_filter: slices and dices the SRF file to produce a new one
+    with various types of data removed.
+
+* illumina2srf
+
+  - Minor float/int rounding change when storing int/nse/sig2 data.
+
+  - Improved error detection such that it returns a failure code more
+    often given a parsing issue.
+
+  - Added -pf/pr parameters for storing Phasing files.
+
+  - Reduced memory usage, especially on large numbers of clusters per
+    tile. We may now produce multiple DBH blocks per tile. Also major
+    reduction to memory when handling the .params files.
+
+  - Added storage of 2nd .params file (firecrest).
+
+  - Fixed bug in the automatic base-call version identification.
+
+  - Fixed a bug with using -qf/qr when not providing all tiles (ie not
+    starting from tile number 1).
+
+  - Bug fix with storing the reverse matrix file in paired-end runs; a
+    duplicate of the forward one was being used instead.
+
+* General SRF
+
+  - Improved error checking in srf_index_hash. It now spots duplicate
+    reads and also has a -c option to check an existing SRF file
+    without writing the index.
+
+  - Fixed a memory leak in srf_next_ztr(), triggered in srf2fastq -C.
+
+Version 1.11.3 (9th July 2008)
+--------------
+
+* illumina2srf change:
+
+  - IMPORTANT bug fix to illumina2srf when using the "-r" flag to
+    store raw (.int and .nse) data. This could often result in
+    corrupting the data ZTR meta-data for the SMP4 chunks resulting in
+    confusion over which trace channels are raw and which are
+    processed.
+
+    Fortunately the corruption is reversable. For more details and a
+    fix see the ssrformat announcement of the issue:
+
+    http://www.bcgsc.ca/pipermail/ssrformat/2008-July/000531.html
+
+* General SRF changes:
+
+  - Removed a memory leak in ztr_find_chunks().
+
+  - Added SRFB_NULL_INDEX as an SRF block type. This provides a more
+    transparent way to skip over the 8 zero value bytes that may exist
+    at the end of an SRF file missing an index block.
+
+* Other changes
+
+  - Fixed a bug in extract_seq when operating on multiple files and
+    outputting to a file rather than a pipe. An erroneous seek in the
+    mFILE code lead to it repeatedly truncating the output, resulting
+    in one sequence file at the end instead of multiple files.
+
+
+Version 1.11.2 (4th June 2008)
+--------------
+
+* solexa2srf/srf2solexa changes:
+
+  - Renamed to illumina2srf/srf2illumina.
+
+  - Incorporated support the IPAR format (Come Raczy, Illumina).
+
+  - Added support for qcal format data (Come Raczy).
+
+  - Added -C option to tag data as failing the chastity filter, but it
+    is still included in the SRF output (Camil Toma).
+
+  - Many more additional features added to srf_dump_all provided by
+    Camil Toma. It somewhat overlaps srf2solexa now, but may still
+    have it's own use.
+
+  - Ztr TEXT chunks now output in srf2solexa.
+
+  - Improved ways to specify matrices (-mf/-mr) in solexa2srf.
+
+  - solexa2srf is substantially faster when reading gzipped files.
+
+  - The -N/-n naming scheme options for solexa2srf now default to the
+    same conventions used by GERALD. Added additional %d, %m and %r
+    format rules too.
+
+  - Calibrated confidence values are now output if -qf or -qr
+    paramaters are used, in addition to uncalibrated ones. These are
+    stored in phred scale in a CNF1 ZTR chunk.
+
+* srf2fastq now has a -c option to output calibrated confidence values
+  (if present). It also supports multiple archives on the command line.
+
+* SRF fixes:
+
+  - Better handling of full pathnames in solexa2srf.
+
+  - Use binary IO mode; fixes bugs on Windows.
+
+  - Fixed an error where some chunks were not compressed properly
+    (valid still, just not compressed).
+
+  - Removed memory corruption in solexa2srf (in rare cases).
+
+  - Fixed bug with binary formatted read_id suffixes (fixed by
+    Cristian Goina).
+
+  - Initialised memory in hash table code (used in indexing amongst
+    other things).
+
+  - Indexes very occasionally failed to find a trace that did infact
+    exist. 
+
+  - Removed memory leak in construct_trace_name (patch from John
+    Emhoff, Helicos).
+
+  - Fixed reading of XML block in srf_read_xml(). From John Emhoff.
+
+
+* Added SRF= format string to TRACE_PATH to facilitate on-the-fly
+  extraction from indexed SRF files. This means io_lib can now
+  transparently pull traces from an archive or treat it as if it was a
+  directory - eg "foo.srf/IL15_..._123:456".
+
+* Bug fix (SF-1898427) - now builds on Fedora.
+
+* Better handling of 64-bit file size sensing in autoconf.
+
+
+Version 1.11.1 (not officially released - internal testing only)
+--------------
+
+Version 1.11.0 (20th February 2008)
+--------------
+
+First official release of v1.11.0 and SRF support.
+
+* Further speed improvements to solexa2srf.
+
+* Added extract_qual program (analogous to extract_seq).
+
+* Added new srf2fasta program and also sped up srf2fastq by 25%.
+
+* Solexa2srf now supports storing the raw .int/.nse trace data instead
+  of or in addition to the processed .sig2 data. 
+
+* Solexa2srf now stores enough to reproduce sufficient firecrest
+  output to rerun the solexa basecaller. Specifically that's a couple
+  matrix files and 'region' data for paired end runs.
+
+* Minor changes / bug fixes:
+
+  - extract_seq no longer attempts to gzip the output by default if
+    the input was gzipped
+
+  - ztr2read conversion (eg visible in trace_dump) now correctly
+    handles ZTR files with multiple SMP4 chunks.
+
+  - Fixed memory leaks in various bits of SRF code (srf_extract_linear
+    mainly and srf_index_hash).
+
+
+Version 1.11.0b8 (25th January 2008)
+----------------
+
+(Hopefully final beta test of SRF code before official 1.11.0 release.)
+
+* Bug fixed the index format. We incorrectly handled null dbhFile and
+  containerFile elements plus incorrectly computing the index size.
+
+* Improvements for solexa2srf code.
+  - Can store raw vs processed data
+  - Stores matrix and .params contents.
+  - Optional chastity filtering.
+  - Input data may now be gzipped.
+
+* Minor fixes to output of trace_dump and ztr_dump.
+
+* Minor srf_index_hash bug fixes (when dealing with concatenated
+  indexed files).
+
+
+Version 1.11.0b7 (11th January 2008)
+----------------
+
+* IMPORTANT bug fix to the SRF format. The Data Block Header had the
+  blocksize field 4 bytes too large. Now fixed. Old SRF files will not
+  be readable by this new code (as they were in error).
+
+
+Version 1.11.0b6 (2nd January 2008)
+----------------
+
+* Changes to adhere to SRF v1.3:
+
+* Removal of the readID counter.
+
+* Added support for printf style name formatting.
+
+* Minor index format tweaks (64-bit data, dch/container filenames).
+  Index format is therefore now 1.01.
+
+
+Version 1.11.0b5 (8th November 2007)
+----------------
+
+* Major reorganisation of directories. All library code is in subdir
+  "io_lib". The code now uses "io_lib/xxx.h" in all include statements
+  too.
+
+* Fixed memory leaks in ZTR code
+
+* Various SRF bug fixes and better support for sample OFFS metadata in
+  both ZTR/ZTR.
+
+* Added srf_extract_hash program to perform random-access on a hash
+  indexed SRF archive.
+
+
+Version 1.11.0b4 (26th October 2007)
+----------------
+
+* The SRF format now supported adheres to version 1.2.
+
+* More speedups, in particular focusing on uncompression this time, so
+  srf2solexa is an order of magnitude faster.
+
+* ztr2read() now honours the read_sections() options and so is much
+  faster when only decoding (say) base and quality values.
+
+* New program srf2fastq.
+
+* Internal changes to various ztr data structures. If you use these
+  yourself take note of the new ztr_owns fields to avoid memory leaks.
+
+
+Version 1.11.0b3 (16th October 2007)
+----------------
+
+* Major speed improvements for compression. solexa2srf is now 30-35x faster.
+
+* Fixed various buffer overruns and memory leaks reported by valgrind
+  in the new deflate interlaced and SRF code.
+
+
+Version 1.11.0b2 (2nd October 2007)
+----------------
+
+* Minor version change to fix typoes in Makefile system.
+
+
+Version 1.11.0b1 (28th September 2007)
+----------------
+
+Beta release 1.
+
+* Added preliminary SRF support. This consists of a new	subdirectory
+ 'srf' (yes these all really need merging into a single directory,
+ but that's a later task), a substantial update to ZTR and a variety
+ of SRF tools in progs.
+
+ The old huffman_static.[ch] files were renamed and substantially
+ worked upon to create deflate_interlaced.[ch].
+
+ Added new compression types. xrle2, tshift and qshift. The latter two
+ of these are very specific to trace and quality packings. May need to
+ rename to be more generic.
+
+
+Version 1.10.3 (???)
+--------------
+
+* The HashTable interface now also allows for Bob Jenkins' lookup3
+  64-bit hash function. This allows for substantially larger hash
+  tables.
+
+* Replaced tempnam() with tmpfile(). On systems without tmpfile
+  (Windows) this is simply a wrapper to use the old tempnam calls.
+
+* hash_extract bug fix for windows: now operates in binary mode.
+
+* INCOMPATIBLE CHANGE: On windows we now use semi-colon as the path
+  separator. The reason is that with the MinGW getenv() seems to do
+  "clever things" with PATH variables and consequently ends up
+  corrupting our clumsy attempt of escaping colons in paths.
+
+* Fasta format is semi-supported in "plain" format. It returns the
+  first entry when reading.
+
+* Experimental support for static huffman (STHUFF) compression type.
+
+
+Version 1.10.2 (30th May 2007)
+--------------
+
+Primarily this is a bug fix release.
+
+* Convert_trace now has -signed and -noneg options to control signed
+  vs unsigned issues when shifting trace data about.
+
+* Include files now have C++ extern "C" style guards around them.
+
+* Various programs now accept -ztr command line arguments to force ZTR
+  format reading. This is for consistencies sake only and it is
+  recommended that users simply let the programs automatically detect
+  the file formats.
+
+* Hash_exp now outputs to the same file containing the experiment
+  files (in appended hash-table mode). It also has better Windows
+  handling (stripping ^M and using binary mode).
+
+* hash_extract bug fix: now only needs at least 1 filename specified
+  when fofn mode is not in use.
+
+* mFILE emulation: bug fixes when dealing with ftruncate, append mode,
+  checking for read/write flags, new mfcreate_from() function.
+
+* ZTR: added an experimental ZTR_FORM_STHUFF compression scheme. This
+  uses static huffman encoding on a predefined hard-coded set of
+  huffman tables. The purpose (as yet not put into action) is to allow
+  efficient compression of very small data sets for Illumina, AB
+  SOLiD, etc style traces.
+
+
+Version 1.10.1 (20th June 2006)
+--------------
+
+* Trace files are now opened in read-only mode by default
+  (open_trace_file func).
+
+
+Version 1.10.0 (15th June 2006)
+--------------
+
+* Two new environment variables are used, EXP_PATH and TRACE_PATH, to
+  replace RAWDATA. EXP_PATH is used when the new open_exp_mfile()
+  function is called and TRACE_PATH is used when open_trace_mfile() is
+  called. Both default to using RAWDATA when EXP or TRACE env is now
+  found. Also defined a trace type TT_ANYTR which is analogous to the
+  existing TT_ANY except it will not look for experiment or plain
+  format files.
+
+  Modified the various example programs to use the appropriate open
+  call. This allows for traces and experiment files to have identical
+  names, such as is usually the case when querying named trace objects
+  from a trace server.
+
+* New program: extract_fastq to generate FASTQ output format.
+
+* New program: hash_exp. This allows multiple experiment files to be
+  contatenated together and then indexed so io_lib can still treat
+  them as single files.
+
+* The URL based search path mechanism now by default uses libcurl
+  instead of wget. This makes it considerably faster.
+
+* If an element in RAWDATA, EXP_PATH or TRACE_PATH now starts with the
+  pipe symbol ("|") then the compressed file extension code is negated
+  for that search element. (This prevents looking for foo.gz, foo.Z,
+  foo.bz2, etc if it fails to find foo.)
+
+* Added HashTableDel() and HashTableRemove() functions to take items
+  out of a hash table.
+
+* ZTR's compress_chunk() and uncompress_chunk() functions are now
+  externally callable.
+
+* New program io_lib-config. This has --version, --cflags and --libs
+  options to query the appropriate configuration when compiling and
+  linking against io_lib. There's also a new io_lib.m4 file which
+  provides an AC_CHECK_IO_LIB autoconf macro to use io_lib-config and
+  generate appropriate Makefile substitutions.
+
+* Updated the autoconf code to support libcurl searching.
+
+* Renamed SCF's delta_samples[12] functions to be
+  scf_delta_samples[12]. (From Saul Kravitz)
+
+* Added a '-error filename' option to convert_trace. (From Saul Kravitz)
+
+* Bug fix: HashTableAdd() now works properly with non-string keys.
+
+* Bug fix to read_dup().
+
+* Bug fix to xrle which could read past the array bounds. It also now
+  handles run-lengths of 256 or more.
+
+* Bug fix: the fwrite_* functions no longer close the FILE pointer
+  given to them.
+
+* Bug fix to fdetermine_trace_type(); it now rewinds the file back.
+
+* Bug fix to mfseek and mrewind; they both now clear the EOF flag.
+
+* Bug fix to find_file_dir().
+
+
+Version 1.9.2 (14th December 2005)
+-------------
+
+* Added AC_CHECK_LIB calls for the nsl and socket libraries
+  (gethostbyname / socket functions). Needed for Solaris compilations.
+
+* In extract_seq, used open_trace_mfile instead of
+  open_trace_file. Functionally this is the same, but it is faster.
+
+* fwrite_reading() now frees the temporary mFILE it created.
+
+* mfreopen_compressed() no longer closes the original FILE
+  pointer. This brings it back into line with the original
+  functionality provided in 1.8.x. It also cures a bug where the old
+  file pointer was often left opening meaning operates on many files
+  could could cause a resource leak ending in the inability to open
+  more trace files.
+
+* Added private_data and private_size to the Read struct. Populate
+  these when reading SCF files.
+
+* Hash_extract now returns an error code to the calling process upon
+  failure.
+
+* Major overhaul of hash_sff. It no longer loads the entire file into
+  memory. It can now cope with adding a hash index to an archive that
+  already contains an index.
+
+* Added support for 454's "sorted index" code. NB this is based on the
+  extraction code from their getsff.c code and has not been tested
+  with a genuine indexed SFF file yet.
+
+* Fixed an uninitialised memory access in mfload().
+
+* Fixed a bug where hash query searches for items that do not exist
+  and map to an empty bucket could cause hangs or crashes.
+
+* Fixed a hang in mfload() when reading a zero length file.
+
+
+Version 1.9.1
+-------------
+
+* Implemented the SFF (454) file structure, currently as read-only.
+  This is supported both as an archive containing multiple files and
+  also as a single SFF entry.
+
+* Allow for SFF=? components in RAWDATA search path.
+
+* Tar files, SFF archives and hashed archives (eg hashed tar, sff, or
+  "solid" archives) may now be used as part of a pathname. Eg if a
+  tar file foo.tar contains entry xyzzy.ztr then we can ask to fetch
+  trace foo.tar/xyzzy.ztr instead of requiring setting of the
+  RAWDATA environment variable.
+
+* Changed the HashFile format slightly. It's now format 1.00.
+	
+  The key difference is that it has a file footer pointing back to the
+  hashfile header (so the hashfile can be appended to an archive) and
+  it also has an offset in the header to apply to all seeks within the
+  archive itself, so it can be prepending to an archive that's already
+  been indexed without breaking the offsets.
+
+  Extended the hash_tar program to allow control over these header options.
+
+* Fixed divide-by-zero buf when calling mfread for zero
+
+* Removed the warning for unknown ZTR chunk types. It now just
+  silently stores them in memory. 
+
+* mfopen now honours binary verses ascii differences (and so updated
+  Read.c calls accordingly) so that Windows works better.
+
+* Removed file descriptor 'leak' in write_reading(). 
+
+* Unset compression_used when opening uncompressed files instead of
+  leaving as the last value.
+
+* Fixed a file descriptor (and some memory) leak in
+  freopen_compressed. (Bug ID #1289095) 
+
+* Fixed the hash file saving and loading so that it works on all
+  platforms instead of just x86 linux. There were bugs in assuming the
+  size of structures. The assumptions are still there in that I assume
+  they pad the same internally (for ease of coding - we can change it
+  when we finally see a system which operates differently), but the
+  final "boundary" padding has been resolved.
+
+
+Version 1.9.0
+-------------
+
+* ***INCOMPATIBILITIES*** to 1.8.12
+
+  - The Exp_info structure now internally contains an "mFILE *" member
+    instead of "FILE *" member. If you use the experiment file functions
+    for I/O then hopefully it'll still work. However if you directly
+    manipulated the Exp_info yourself using fprintf etc then you will
+    need to modify your code.
+  
+  - Some functions no longer have external scope. Most of these did not
+    previously have external function prototypes. If you have a burning
+    need to use one of these, please contact me directly via sourceforge.
+    The full list is:
+  
+      ctfType (global variable)            ztr_encode_samples_C         
+      replace_nl                           ztr_encode_samples_G    
+      ctfDecorrelate                       ztr_encode_samples_T    
+      exp_print_line_                      ztr_decode_samples              
+      find_file_tar                        ztr_encode_bases                
+      find_file_archive                    ztr_decode_bases                
+      find_file_url                        ztr_encode_positions    
+      ztr_write_header                     ztr_decode_positions    
+      ztr_write_chunk                      ztr_encode_confidence_1         
+      ztr_read_header                      ztr_decode_confidence_1         
+      ztr_read_chunk_hdr                   ztr_encode_confidence_4         
+      compress_chunk                       ztr_decode_confidence_4         
+      uncompress_chunk                     ztr_encode_text                 
+      ztr_encode_samples_4                 ztr_decode_text                 
+      ztr_decode_samples_4                 ztr_encode_clips                
+      ztr_encode_samples_common            ztr_decode_clips                
+      ztr_encode_samples_A                                         
+  
+  - Some external functions have changed prototypes to use mFILE instead
+    of FILE. Most cases of these I've put in place a wrapper function
+    with the old name, but not yet all. Functions changed are:
+  
+      ctfFRead                             write_scf_samples32       
+      ctfFWrite                            write_scf_base       
+      exp_print_line                       write_scf_bases      
+      exp_print_mline                      write_scf_bases3     
+      exp_print_seq                        write_scf_comment            
+      read_scf_header                      fcompress_file       
+      read_scf_sample1                     fopen_compressed     
+      read_scf_samples1                    freopen_compressed           
+      read_scf_samples31                   be_write_int_1       
+      read_scf_sample2                     be_write_int_2       
+      read_scf_samples2                    be_write_int_4       
+      read_scf_samples32                   be_read_int_1                
+      read_scf_base                        be_read_int_2                
+      read_scf_bases                       be_read_int_4                
+      read_scf_bases3                      le_write_int_1       
+      read_scf_comment                     le_write_int_2       
+      write_scf_header                     le_write_int_4       
+      write_scf_sample1                    le_read_int_1                
+      write_scf_samples1                   le_read_int_2                
+      write_scf_samples31                  le_read_int_4                
+      write_scf_samples2                   fdetermine_trace_type        
+  
+  - Removed support for the OLD unix "pack" program as a valid trace
+    compression algorithm.
+  
+  - Removed CORBA support. (It wasn't enabled and I've no idea if it
+    even worked as I cannot test it.)
+  
+  - The default search order for RAWDATA now has the current working
+    directory at the end of RAWDATA instead of the start.
+  
+* Significant speed ups, particularly when dealing with reading
+  gzipped files or when extracting data from tar files.
+
+* New external functions for faster access via mFILE (memory-file)
+  structs. These mimic the fread/fwrite calls, but with mfread/mfwrite
+  etc.
+
+* Numerous minor tweaks and updates to fix compiler warnings on more
+  stricter modes of the Intel C Compiler.
+
+* Preliminary support for storing pyrosequencing style traces. This
+  has been modeled on the flowgram data from 454, but should be
+  applicable to other platforms. ZTR has been updated to incorporate
+  this too.
+
+  The Read structure also has flow, flow_order, nflows and flow_raw
+  elements too. Code to convert these into the more usual traceA/C/G/T
+  arrays exists currently as part of Trev (in tk_utils in the Staden
+  Package), but this may move into io_lib for the next official release.
+
+* New hash_tar and hash_extract programs. These replace the index_tar
+  program for rast random access. For RAWDATA include "HASH=hashfile"
+  as an element to get io_lib to use the archive hash. It's possible
+  to create hash files of most archive formats as the hash itself
+  contains the offset and size of each item in the archive. This means
+  that extracting an item does not need to know the format of the
+  original archive.
+
+  Some benchmarks show that on ext3 it's actually faster to extract
+  files from the hash than directly via the directory. This was
+  testing with ~200,000 files, whereupon directory lookups become
+  slow. I'd imagine ResierFS or similar to be faster.
+
+* Added an XRLE encoding for ZTR. This is similar to the existing RLE
+  mechanism but it copes with run length encoding of items larger than
+  a single byte. It's current use is for storing the 4-base repeating
+  flow order in 454 data.
+
+
+Version 1.8.12
+--------------
+
+* The ABI format code now reads the confidence values from KB (via
+  PCON field).
+
+* New program: trace_dump. Like scf_dump, but deals with generic input
+  formats.
+
+* Slightly more sensible average spacing calculation in the ABI
+  reading code. It's still not perfect, but is only used when the real
+  spacing value is negative or zero.
+
+* Disabled the base-reordering fix for ABI files. We believe the bug
+  causing this no longer exists.
+
+* Expriment file format: added FT (EMBL feature table) and LF
+  (LiGation; a combination of LI and LE) records.
+
+* Experiment files: strip out digits from the sequence we read
+  (for better support of EMBL files).
+
+* Experiment files: fixed a potential buffer overrun in the conversion
+  of binary confidence values to ascii values.
+
+* Minor improvements to portability (INT_MAX vs MAXINT2) and removal
+  of some compilation warnings.
+
+* Extract_seq now accepts a -fofn argument.
+
+* New functions: read_update_base_positions() and
+  read_udpate_confidence_values() to replace read_update_opos().
+  These apply an edit buffer to the sequence details and are used (for
+  example) within Trev for saving edits back to a trace file.
+
+* Better error handling in fcompress_file().
+
+* New specifiers in RAWDATA. Added a generic URL format (eg
+  "URL=http://some/where/trace=%s") implemented via use of wget. There
+  is also an ARC= format to make use of the Sanger Trace Archive,
+  although currently this will not work externally.
+
+* Zero memory used in read_alloc(). Fixes to read_dup().
+
+
+Version 1.8.11
+--------------
+
+* Rewrote the background subtraction in convert_trace to deal with each
+  channel independently.
+
+* Make install now install the include files (all of them, although not all
+  are strictly required) in $prefix/include/io_lib/.
+
+* Moved the ABI filter wheel order (FWO) reading from outside the sample
+  reading code into the general reading bit as this is needed for reading the
+  comments too (it also applies to the order of the signal strengths). Hence
+  when the READ_COMMENTS section only is defined it now works correctly.
+
+* Moved the DataCount #defines into static values and added a
+  abi_set_data_counts function to change these. This allows reading of the raw
+  data from ABI files. This is used within the new convert_trace -abi_data
+  option.
+
+* Removed a one-byte write buffer overflow in the CTF writing code.
+
+* New Experiment file records WL and WR for indicating clip points within a WT 
+  trace.
+
+* Removed the saved copy of fp for exp_fread_info in 'e' structure as it
+  doesn't belong to us. (If we do store it there then the exp_destroy_info
+  function will free it and this causes bugs.). POTENTIAL INCOMPATIBILITY:
+  if you assumed that exp_destroy_info closed the files that you opened and
+  passed into exp_fread_info, then this is no longer true.
+
+* New function read_dup() to copy a Read structure.
+
+* get_read_conf() now deals with loading confidence values from any suitable
+  format and not just SCF.
+
+* Fixed memory leak in ztr (ztr->text_segments).
+
+
+Version 1.8.10
+--------------
+
+* Added Steven Leonard's changes to index_tar. It no longer adds index entries
+  for directories, unless -d is specified. It also now supports longer names
+  using the @LongLink tar extension.
+
+* Fixed a bug in exp2read where the base positions were random if experiment
+  files are loaded without referencing a trace and without having ON lines.
+
+* New program get_comment. This queries and extracts text fields held within
+  the Read 'info' section
+
+* Overhaul of convert_trace to support the makeSCF options (normalise etc).
+
+
+Version 1.8.9
+-------------
+
+Sorry this isn't a proper changes-by-source listing. Any suggestions for how I 
+collate the 'cvs log' output into something more concise? The below text is
+simply a list of changes, but more complete than in the NEWS file.
+
+* ZTR spec updated to v1.2. The chebyshev predictor has been rewritten in
+  integer format. The old chebyshev still has a format type allocated to it
+  (73), but the new ICHEB format (74) is now the default. The old floating
+  point method was potentially unstable (eg when running on non IEEE fp
+  systems). The new method also seems to save a bit more space.
+
+* The docs and code disagreed for CNF4 storage. Changed the docs to reflect
+  the code (which does as intended).
+
+* ZTR speed increase. Follow1 is substantially faster, increasing write
+  times by about 10%. 
+
+* New named formats types. ZTR1, ZTR2 and ZTR3. ZTR defaults to ZTR2, but we
+  can explicitly ask for another compression level if desired. Also explicit
+  statement of format (TT_ZTR instead of TT_ANY) removes the need for
+  a rewind() call and so ZTR can now work through a pipe.
+
+* General tidy up to remove a few compilation warnings (missing include files,
+  signed vs unsigned issues, etc).
+
+* Initial support is included for BioLIMS integration, but this is not
+  complete. (Unfortunately it requires access to a non-public library.)
+
+* New function compress_str2int - opposite of existing compress_int2str.
+
+* (Steven Leonard). Uses zlib for gzip compression and decompression.
+
+
+
+
+
+These are extracts from the full Staden Package change log. They may not be
+immediately obvious when taken out of context, but we feel this information
+may still be useful to the users of io_lib.
+
+23rd August 2000, James
+-----------------------
+1. Removed find_trace_file and added an open_trace_file function.
+The idea is that searching for a files existance is better done by attempting
+to open it. This in turn allows for more possibilities of file searching.
+        Makefile
+	utils/open_trace_file.c
+	read/Read.c
+	read/scf_extras.c
+	read/translate.[ch]
+	progs/extract_seq.c
+
+2. Added a TAR option to RAWDATA. We can now read trace files directly from
+tar files (although they cannot be written to directly).
+        utils/open_trace_file.c
+	utils/tar_format.h
+
+3. Created an index_tar program to optimise tar reading, although it is not
+mandatory.
+	progs/index_tar.c
+	progs/Makefile
+
+4. Fixed a bug when dealing with plain text files containing spaces.
+        plain/seqIOPlain.c
+
+
+31st July 2000, James
+---------------------
+1. Renamed TTFF to be ZTR.
+	read/Read.[ch]
+	utils/traceType.c
+	utils/compress.c
+	ttff/* -> ztr/*
+	README
+
+2. ZTR reading will now stop when it spots a ZTR magic number. This allows
+concatenation of ZTR files.
+	ztr/ztr.[ch]
+
+
+15th June 2000, James
+---------------------
+1. Added a TTFF_FOLLOW filter type to TTFF. This is enabled with compression
+level 2 for the chromatogram data.
+      io_lib/ttff/ttff.[ch]
+      io_lib/ttff/compression.[ch]
+
+9th June 2000, James
+--------------------
+* RELEASED 1.8.4 */
+
+1. Added zlib bits to windows compilation.
+	io_lib/mk/windows.mk
+
+2. Updated convert_trace. It can now reduce sample-size to 8-bit (with the
+"-8" option) and the formats may now be specified as either integer or text
+format. The text format is case insensitive.
+	io_lib/progs/convert_trace.c
+	io_lib/utils/traceType.c
+
+3. More windows binary vs ascii fixes. When reading we switch to binary mode
+before attempting fdetermine_trace_type, otherwise it fails to auto-detect
+TTFF (which includes a newline as part of the magic number). Also added a
+_setmode() call to the fwrite_reading code too.
+	io_lib/read/Read.c
+
+4. Changed the default compression technique of TTFF to that used in 1.8.2. I
+accidently left it set to the experimental dynamic-delta method in 1.8.3,
+which currently doesn't have the uncompression function! Also removed lots of
+debugging output.
+	io_lib/ttff/ttff.c
+	io_lib/ttff/ttff_translate.c
+
+5. Bug fix to exp2read - when no right hand quality cutoff is specified we
+were defaulting to the left end of the trace, instead of the right end. (This
+only happens when opening experiment files which do not have clip points.)
+	io_lib/read/translate.c
+
+6. Changed the strftime() format in ABI reading code to use %H:%M:%S instead
+of %T, as %T doesn't appear to be part of ANSI (I think it's probably
+XPG4-UNIX). It worked on Unix machines, but not on MS Windows.
+	io_lib/abi/seqIOABI.c
+
+
+8th June 2000, James
+--------------------
+* RELEASED 1.8.3 */
+
+1. Updated the CTF support so that it includes a couple of new block
+types. This allows for base positions being non-sequentially ordered, as is
+possible in severe compressions.
+	 io_lib/ctf/ctfCompress.c
+
+2. Overhaul of TTFF format - now more PNG based in style. Still highly
+experimental.
+	io_lib/ttff/*
+
+
+16th May 2000, James
+--------------------
+* RELEASED 1.8.0 */
+
+1. Added szip support. Szip generally gives better compression ratios than
+gzip and often marginally better than bzip2, but is generally considerably
+slower at decompression.
+	io_lib/utils/compress.[ch]
+
+2. Merged in Jean Thierre-Mieg's CTF code. This is a compressed trace format
+which holds the same data as SCF, but in reduce space.
+	io_lib/read/Read.[ch]
+	io_lib/utils/traceType.c
+	io_lib/ctf/*
+
+3. Added my own highly experimental TTFF format. (Thanks to Jean Thierre-Mieg
+for re-awakining my interest in this.) TTFF files are typically equivalent in
+size to bzip2'ed SCF files, but are much quicker to write than any of the
+currently supported compressed formats. Depends on zlib.
+	io_lib/read/Read.[ch]
+	io_lib/utils/traceType.c
+	io_lib/ttff/*
+
+4. Reorganised the Makefiles for easier building.
+	*/Makefile
+
+5. New program "convert_trace". Primarily a test tool at present as it needs
+a friendlier interface.
+	progs/convert_trace.c
+
+
+20th April 2000, James
+----------------------
+1. Removed a file-descriptor leak in extract_seq.
+	io_lib/progs/extract_seq.c
+
+22nd March 2000, James
+----------------------
+1. Fixed bug in time formatting from ABI files. We used strftime code
+%a without setting tm.tm_wday (number of days since sunday). It's not
+easy to work that out, so we convert from struct tm to time_t, which
+resets any errornous elements of struct tm. Also fixed a silly error
+where the end time was set to the start time (incorrectly).
+	io_lib/abi/seqIOABI.c
+
+25th February 2000, James
+-------------------------
+2. Added checks for QR <= QL in the exp2read conversion function. This caused
+trev to display incorrectly (blanking incorrect screen portions) when dealing
+with inconsistent experiment files. Also changed qclip so that it doesn't
+create this inconsistent case.
+	io_lib/read/translate.c
+
+1st February 2000, Kathryn
+--------------------------
+1. Fixed bug which caused init_exp to crash when QL was more than 5 digits.
+Increased it to handle 15 digits.
+	io_lib/read/translate.c
+
+27th January 2000, James
+------------------------
+1. Moved Gap4's copy of scf_extras into io_lib, and renamed io_liub's
+scf_bits to be scf_extras (to avoid editing too many #include statements).
+Without this we were getting errors due to dynamic linking using odd
+copies. Eg loading libread.so and then libgap.so meant that
+find_trace_file called from edUtils2.c (libgap.so) would pick up the first
+copy from libread.so, despite the fact that there's also a copy in the
+same libgap.so.
+	gap4/scf_extras.[ch]
+	io_lib/scf_bits.[ch]
+
+25th January 2000, Kathryn
+--------------------------
+1. Fixed crash in qclip due to insufficent arguments being passed to 
+find_trace_file and also fixed an array bounds error in scan_right of qclip.c
+	io_lib/read/scf_bits.c
+	
+19th January 2000, James
+------------------------
+4. Copied bits of the fakii and cap2/3 scf/expFile reading code into
+io_lib. Not all of this is in there, just the things which seem to be
+common and sensibly fit there. This also helps qclip to build on Windows.
+FIXME: We should now remove some of this code from Gap4.
+Also fixed a small memory leak in fopen_compressed() - it wasn't freeing
+the result of tempnam().
+	io_lib/read/translate.c
+	io_lib/read/scf_bits.[ch]
+	io_lib/read/seqInfo.[ch]
+	io_lib/utils/files.c
+	io_lib/utils/compress.c
+
+31st August 1999, James
+-----------------------
+1. -fasta_out mode of extract_seq now changes - to N.
+	io_lib/progs/extract_seq.c
+
+27th August 1999, James
+-----------------------
+1. The order of information items added by the abi to scf code has
+changed, to make it more sensible. Also fixed a bug in the textual (rather
+than numerical) date output, and wrote this to the DATE field.
+	io_lib/abi/seqIOABI.c
+
+2. makeSCF no longer adds a MACH field, as this was redudant.
+	io_lib/abi/makeSCF.c
+
+3. Extract_seq now has proper use of CL and CR when using -cosmid_only. It
+was assuming they were the same as QL/QR and SL/SR, which is not the case
+(rather it's like having a CS line of `CL`..`CR`). Extract_seq also now
+has a -fasta_out format option and can handle multiple files, which makes
+it easier to produce a fasta file from multiple experiment files.
+	io_lib/progs/extract_seq.c
+
+4th August 1999, James
+----------------------
+1. The exp2read() function in io_lib now initialises the confidence arrays
+(eg r->prob_A) to zero, or to the experiment file AV line.
+	io_lib/read/translate.c
+
+2nd June 1999, James
+--------------------
+1. The MegaBACE sequencer creates ABI files. However it does so in a odd way.
+Sometimes the samples arrays are truncated such that bases are positioned
+above samples which are not stored in the ABI file. We now realloc the samples
+array in such cases and fill out the remainder with blank data. This removes a
+crash in trev when viewing such data.
+	io_lib/abi/seqIOABI.c
+
+2. Fixed a memory corruption of io-lib compression. The switch to use tempnam
+(for Windows) implies that the filename returned is no longer allocated by us.
+Unfortunately we forgot to remove the xfree(fname) calls.
+	src/io_lib/utils/compress.c
+
+18th May 1999, James
+--------------------
+1. Fixed the trace rescaling option of makeSCF. We now go through the rescale
+function twice. Once to work out the maximum value, and again to do the
+rescaling. This fixes a bug where the maximum value after rescaling was
+sometimes above 65536 and hence cause "trace wraparound" effects.
+	io_lib/progs/makeSCF.c
+
+26th April 1999, JohnT
+----------------------
+1. Allow : to be entered in RAW_DATA by using ::
+	Misc/find.c
+	io_lib/utils/find.c
+
+2. Support for fetching trace files using Corba
+   Modified:
+	Misc/find.c
+	mk/misc.mk
+	io_lib/utils/find.c
+        init_exp/init_exp.c
+        io_lib/read/Makefile
+        io_lib/utils/find.c
+	io_lib/utils/compress.c
+	io_lib/utils/Makefile
+        mk/global.mk
+    Added:
+	io_lib/utils/corba.cpp
+	io_lib/utils/stcorba.h
+    Generated from IDL:
+	io_lib/utils/trace.h
+	io_lib/utils/trace.cpp
+	io_lib/utils/basicServer.h
+	io_lib/utils/basicServer.cpp
+
+
+3. Added ABI utility progs to NT port
+	mk/abi.mk
+
+4. Added Windows 95 support
+	io_lib/utils/compress.c
+        mk/WINNT.mk
+
+5th March 1999, JohnT
+---------------------
+Various changes for WINNT support as follows:
+io_lib/utils       - Don't redirect to /dev/null on WINNT
+
+3rd February 1999, James
+------------------------
+1. Fixed problems reported by Insure on Windows NT.
+These are mainly lack of prototypes (malloc/memcpy) and not returning properly
+from 'int' functions. However one fix to seqed_translate.c (find_line_start3)
+was a array read overflow.
+	io_lib/progs/makeSCF.c
+
+18th January 1999, James
+------------------------
+1. Changed the read2exp io_lib translation function so that it can accept
+lowercase a,c,g,t. Oddly enough it was already coded to accept lowercase IUB
+codes, but we missed out a,c,g and t!
+	io_lib/read/translate.c
+
+15th January 1999, JohnT
+-----------------------
+Modified files thoughout for Windows NT Compatibility as follows:
+
+8. need to explicitly set text or binary file mode under WINNT
+   io_lib/exp_file/expFileIO.c
+
+18. need to include stddef.h for size_t with Visual C++
+    io_lib/utils/array.h
+
+19. need to have target LIBS (not LIB) and correct ordering for correct make
+    on WINNT. Also need additional abstractions to allow for different compile
+    and link calling conventions with Visual C++, and have rules for building
+    Windows .def files.
+    io_lib/abi/Makefile
+    io_lib/alf/Makefile
+    io_lib/exp_file/Makefile
+    io_lib/plain/Makefile
+    io_lib/progs/Makefile
+    io_lib/read/Makefile
+    io_lib/scf/Makefile
+    io_lib/utils/Makefile
+
+18th December 1998, James
+-------------------------
+1. Added bzip2 recognition to the (de)compression code of io_lib. This is now
+the latest bzip, and is recognised by phred (unlike bzip version 1). Bzip2 is
+approx the same as bzip1, but more or less twice as fast for decompression.
+	io_lib/utils/compress.c
+
+27th November 1998, James
+-------------------------
+1. Fixed the trace file searching mechanism in io_lib. When loading an
+experiment file with LN/LT lines, we now first search for the trace file
+relative to the location of the experiment file.
+	io_lib/read/Read.c
+	io_lib/read/translate.[ch]
+
+16th November 1998, James
+-------------------------
+4. Added NT (NoTe) and GD (Gap4 Database) line types to the experiment file.
+	io_lib/exp_file/expFile.[ch]
+
+24th September 1998, James
+--------------------------
+1. The scf reading and writing code now handles traces with zero bases.
+Previously this failed after a malloc(0).
+	io_lib/scf/read_scf.c
+	io_lib/scf/write_scf.c
+
+2. The ABI file reading code has been tidied up. It now also supports
+conversion of more ABI fields, including RUND, RUNT, SPAC(2), CMNT, LANE and
+MTXF.
+	io_lib/abi/seqIOABI.c
+
+17th July 1998, James
+---------------------
+1. Extract_seq now copes with sequences containing no SQ line (instead of just
+SEGV).
+	io_lib/progs/extract_seq
+
+9th July 1998, James
+--------------------
+1. Enforce IUBC code set in io_lib when converting from trace (any format) to
+experiment file. We leave the IUBC 'N' intact.
+	io_lib/read/translate.c
+
+28th May 1998, James
+--------------------
+1. Added a read_sections() function to io_lib so that programs can state
+which bits of a trace file they are interested in. The loading code only
+then parses those bits. This can give big increases to things like init_exp
+which only wants bases and does not care about the delta-delta format of SCF
+trace data.
+	io_lib/read/Read.h
+	io_lib/read/translate.c
+	io_lib/scf/scf.h
+	io_lib/scf/read_scf.c	
+	io_lib/abi/seqIOABI.c
+	io_lib/alf/seqIOALF.c
+	init_exp/init_exp.c
+
+3. Extract GELN (gel name) from ABI file when converting to SCF.
+	io_lib/abi/seqIOABI.[ch]
+
+2. Improved the makeSCF -normalise option. Background subtraction is now
+cleaner (and simpler) and it also now scales the heights. Moved it to io_lib
+as it's now freely available.
+	io_lib/progs/makeSCF.c
+
+23rd March 1998, James
+----------------------
+1. Removed the change made on 7th May 1997 to seqIOPlain.c. This code is used
+by extract_seq, and so clipping in seqIOPlain causes double clipping (and
+hence wrong sections).
+	io_lib/plain/seqIOPlain.c
+
+11th March 1998, James
+----------------------
+2. Removed the requirement of EXP_FILE_LINE_LENGTH in exp_fread_info().
+This allows for (eg) tags with very long comments to be read in without
+being truncated.
+	io_lib/exp_file/expFileIO.c
+
+4th March 1998, James
+---------------------
+1. Following advice from Leif Hansson <leif.hansson@mbox4.swipnet.se>, the ALF
+reading code now reads the "Raw data" subfile when the "Processed data"
+subfile is not present, as "Processed data" is apparently an optional output
+of the pharmacia software. Raw data is in the same format, although I do not
+know what processing takes place to convert it to Processed data. (Looking at
+some real traces, apparently none!)
+	io_lib/alf/seqIOALF.c
+
+24th February 1998, James
+-------------------------
+1. Added an ABI in MacBinary format file type detector so that these are
+now autodetected.
+	io_lib/utils/traceType.c
+
+15th January 1998, James
+------------------------
+1. Rewrote the delta_samples1/2 functions to be faster. Times vary between 0.55
+and 0.7 fractions of the original time.
+	io_lib/scf/misc_scf.c
+
+4th December 1997, James
+------------------------
+1. First post-release bug fix.
+Io_lib incorrect sets read->trace_name when reading anything except SCF files.
+This means that when outputting to an experiment file no LN line is present.
+	io_lib/read/Read.c
+
+1st October 1997, James
+-----------------------
+1. Allow for SCF files to contain 0 bases. This mainly affects memory
+allocation, but also the display widget.
+	io_lib/scf/read_scf.c
+	io_lib/utils/read_alloc.c
+
+28/29th August 1997, James
+--------------------------
+2. Added a few changes to make the code more portable for the Mac. Not really
+used at present.
+	Misc/os.h
+	Misc/files.c
+	io_lib/utils/traceType.c
+	io_lib/read/translate.c
+	io_lib/utils/compress.c
+
+30th June 1997, James
+---------------------
+1. The exp2read function produced invalid rightCutoff values (INT_MAX) when no
+QR line is present. It now correctly sets it to 0.
+	io_lib/read/translate.c
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/COPYRIGHT	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,59 @@
+The files in these directories are covered by a mixture of compatible
+BSD style opensource licences. In summary all this code should be free
+of GPL issues and is freely available to do with as you wish.
+
+Most code is copyright Medical Research council and is made available
+under this licence:
+
+/*
+ * Copyright (c) Medical Research Council 1994. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+Newer files and changes are copyright Genome Research Ltd using the
+following compatible BSD licence. Disentangling which is which is
+somewhat tricky, but it's sufficient to say that work in the CVS tree
+from August 2002 will be bound by the GRL licence instead.
+
+/*
+ * Copyright (c), Genome Research Ltd (GRL).
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *
+ *     * Redistributions in binary form must reproduce the above
+ *       copyright notice, this list of conditions and the following
+ *       disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ *     * Neither the name of the Genome Research Limited nor the
+ *       names of its contributors may be used to endorse or promote
+ *       products derived from this software without specific prior
+ *       written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY GRL ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL GRL BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/ChangeLog	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,3685 @@
+===============================================================================
+2009-07-29: RELEASE 1.12.2
+
+------------------------------------------------------------------------
+r1952 | jkbonfield | 2010-01-14 17:28:02 +0000 (Thu, 14 Jan 2010) | 2 lines
+Changed paths:
+   M /io_lib/trunk/CHANGES
+   M /io_lib/trunk/README
+   M /io_lib/trunk/configure.in
+
+Updates to produce 1.12.2
+
+------------------------------------------------------------------------
+r1951 | jkbonfield | 2010-01-14 17:21:14 +0000 (Thu, 14 Jan 2010) | 3 lines
+Changed paths:
+   M /io_lib/trunk/io_lib/os.h
+
+Guarded HAVE_* definitions behind #ifndef checks to avoid warnings in
+certain cases.
+
+------------------------------------------------------------------------
+r1950 | jkbonfield | 2010-01-14 16:44:42 +0000 (Thu, 14 Jan 2010) | 5 lines
+Changed paths:
+   M /io_lib/trunk/man/man1/srf2fastq.1
+   M /io_lib/trunk/progs/srf2fastq.c
+
+Added -r option as requested in source forge Patch ID: 2926627, as
+suggested by jmendler.
+
+The exact implementation differs in minor ways.
+------------------------------------------------------------------------
+r1939 | jkbonfield | 2010-01-07 09:36:18 +0000 (Thu, 07 Jan 2010) | 3 lines
+Changed paths:
+   M /io_lib/trunk/progs/srf2fasta.c
+   M /io_lib/trunk/progs/srf2fastq.c
+   M /io_lib/trunk/progs/srf_extract_hash.c
+
+Fixed the usage() function to exit 1 instead of 0.
+(Patch from Jordan Mendler)
+
+------------------------------------------------------------------------
+r1930 | jkbonfield | 2009-12-03 14:04:01 +0000 (Thu, 03 Dec 2009) | 7 lines
+Changed paths:
+   M /io_lib/trunk/io_lib/sff.c
+
+Fixed a bug in read_sff_read_data (with thanks to Tim Massingham).
+After reading the data the function did not pad out to the next 8-byte
+boundary.
+
+This only surfaces when using the library from your own tools as the
+programs supplied with io_lib never read more than a single sff read.
+
+------------------------------------------------------------------------
+r1924 | jkbonfield | 2009-11-23 12:20:18 +0000 (Mon, 23 Nov 2009) | 6 lines
+Changed paths:
+   M /io_lib/trunk/progs/srf2fastq.c
+
+Applied patch from Jordan Mendler:
+https://sourceforge.net/tracker/index.php?func=detail&aid=2900087&group_id=100316&atid=627060
+
+This adds a -S (sequential) option to srf2fastq to interleave forward
+and reverse fragments in the same output file as desired by BFast.
+
+------------------------------------------------------------------------
+r1851 | daviesrob | 2009-10-02 10:29:05 +0100 (Fri, 02 Oct 2009) | 1 line
+Changed paths:
+   M /io_lib/trunk/progs/srf2fastq.c
+
+Fixed buffer overrun in parse_regn
+------------------------------------------------------------------------
+r1850 | daviesrob | 2009-10-02 10:02:30 +0100 (Fri, 02 Oct 2009) | 1 line
+Changed paths:
+   M /io_lib/trunk/progs/srf_info.c
+
+Fixed buffer overrun in parse_regn
+------------------------------------------------------------------------
+r1834 | daviesrob | 2009-09-11 17:48:32 +0100 (Fri, 11 Sep 2009) | 1 line
+Changed paths:
+   M /io_lib/trunk/Makefile.am
+   M /io_lib/trunk/io_lib/ztr.c
+
+Added pooled_alloc.h to list of include files to install.  Fixed
+ztr_add_text so
+ that it leaves two NUL bytes on the end of the TEXT chunk, as
+ documented in the
+ ZTR specification.
+------------------------------------------------------------------------
+r1813 | daviesrob | 2009-09-01 12:37:37 +0100 (Tue, 01 Sep 2009) | 1 line
+Changed paths:
+   M /io_lib/trunk/io_lib/Makefile.am
+   M /io_lib/trunk/io_lib/hash_table.c
+   M /io_lib/trunk/io_lib/hash_table.h
+   A /io_lib/trunk/io_lib/pooled_alloc.c
+   A /io_lib/trunk/io_lib/pooled_alloc.h
+   M /io_lib/trunk/io_lib/srf.c
+   M /io_lib/trunk/io_lib/srf.h
+
+Added HASH_POOL_ITEMS option to hash table code to allocate HashItems
+in pools,
+which reduces malloc overhead in big hash tables.  Also made
+srf_index_add_trace
+_body use pooled storage for trace names.
+
+
+===============================================================================
+2009-07-29: RELEASE 1.12.1
+
+------------------------------------------------------------------------
+r1806 | jkbonfield | 2009-08-07 16:46:20 +0100 (Fri, 07 Aug 2009) | 1 line
+Changed paths:
+   M /io_lib/trunk/README
+   M /io_lib/trunk/configure.in
+
+Updated version to 1.12.1
+------------------------------------------------------------------------
+r1805 | jkbonfield | 2009-08-07 16:18:28 +0100 (Fri, 07 Aug 2009) | 1 line
+Changed paths:
+   M /io_lib/trunk/Makefile.am
+   M /io_lib/trunk/README
+
+Minor edit
+------------------------------------------------------------------------
+r1792 | jkbonfield | 2009-08-03 11:58:49 +0100 (Mon, 03 Aug 2009) | 4 lines
+Changed paths:
+   M /io_lib/trunk/io_lib/os.h
+
+Moved the autoconf detection of endianness to the start of os.h. This
+means that machine/compiler testing #ifdefs take precedence, allowing
+for cross-compilation and "fat" binaries on MacOS X.
+
+------------------------------------------------------------------------
+r1791 | jkbonfield | 2009-08-03 11:56:50 +0100 (Mon, 03 Aug 2009) | 2 lines
+Changed paths:
+   M /io_lib/trunk/tests/Makefile.am
+   M /io_lib/trunk/tests/srf_index.test
+
+Minor tweaks to checks/dist.
+
+------------------------------------------------------------------------
+r1789 | jkbonfield | 2009-07-31 12:17:27 +0100 (Fri, 31 Jul 2009) | 2 lines
+Changed paths:
+   M /io_lib/trunk/io_lib-config.in
+
+Fixed -lread to be -lstaden-read
+
+------------------------------------------------------------------------
+r1780 | jkbonfield | 2009-07-29 10:07:56 +0100 (Wed, 29 Jul 2009) | 2 lines
+Changed paths:
+   M /io_lib/trunk/CHANGES
+   M /io_lib/trunk/ChangeLog
+   M /io_lib/trunk/README
+
+Minor updates to state version 1.12.0
+
+
+===============================================================================
+2009-07-29: RELEASE 1.12.0
+
+------------------------------------------------------------------------
+r1779 | jkbonfield | 2009-07-29 09:53:33 +0100 (Wed, 29 Jul 2009) | 2 lines
+Changed paths:
+   M /io_lib/trunk/Makefile.am
+
+The man1 pages are now installed too.
+
+------------------------------------------------------------------------
+r1778 | jkbonfield | 2009-07-28 17:42:26 +0100 (Tue, 28 Jul 2009) | 2 lines
+Changed paths:
+   M /io_lib/trunk/tests/Makefile.am
+   D /io_lib/trunk/tests/data/.params
+   A /io_lib/trunk/tests/data/both.info (from /io_lib/trunk/tests/data/slx_out/both.info:1776)
+   A /io_lib/trunk/tests/data/both.run (from /io_lib/trunk/tests/data/slx_out/both.run:1776)
+   A /io_lib/trunk/tests/data/both.srf (from /io_lib/trunk/tests/data/slx_out/both.srf:1776)
+   A /io_lib/trunk/tests/data/proc.info (from /io_lib/trunk/tests/data/slx_out/proc.info:1776)
+   A /io_lib/trunk/tests/data/proc.srf (from /io_lib/trunk/tests/data/slx_out/proc.srf:1776)
+   A /io_lib/trunk/tests/data/proc.srf.indexed (from /io_lib/trunk/tests/data/slx_out/proc.srf.indexed:1776)
+   A /io_lib/trunk/tests/data/raw.info (from /io_lib/trunk/tests/data/slx_out/raw.info:1776)
+   A /io_lib/trunk/tests/data/raw.srf (from /io_lib/trunk/tests/data/slx_out/raw.srf:1776)
+   A /io_lib/trunk/tests/data/slx-C.fasta (from /io_lib/trunk/tests/data/slx_out/slx-C.fasta:1776)
+   A /io_lib/trunk/tests/data/slx-C.fastq (from /io_lib/trunk/tests/data/slx_out/slx-C.fastq:1776)
+   A /io_lib/trunk/tests/data/slx.fasta (from /io_lib/trunk/tests/data/slx_out/slx.fasta:1776)
+   A /io_lib/trunk/tests/data/slx.fastq (from /io_lib/trunk/tests/data/slx_out/slx.fastq:1776)
+   D /io_lib/trunk/tests/data/slx_in
+   D /io_lib/trunk/tests/data/slx_out
+   A /io_lib/trunk/tests/data/test_run_4_134_369_182.srf (from /io_lib/trunk/tests/data/slx_out/test_run_4_134_369_182.srf:1776)
+   A /io_lib/trunk/tests/data/traces.srf (from /io_lib/trunk/tests/data/slx_out/traces.srf:1776)
+   D /io_lib/trunk/tests/illumina2srf.test
+   M /io_lib/trunk/tests/srf2fasta.test
+   M /io_lib/trunk/tests/srf2fastq.test
+   D /io_lib/trunk/tests/srf2illumina.test
+   M /io_lib/trunk/tests/srf_filter.test
+   M /io_lib/trunk/tests/srf_index.test
+   M /io_lib/trunk/tests/srf_info.test
+
+Updated tests now that srf2illumina and illumina2srf have been removed.
+
+------------------------------------------------------------------------
+r1777 | jkbonfield | 2009-07-28 16:44:43 +0100 (Tue, 28 Jul 2009) | 3 lines
+Changed paths:
+   D /io_lib/trunk/Makefile
+   M /io_lib/trunk/bootstrap
+   D /io_lib/trunk/io_lib/Makefile
+   D /io_lib/trunk/progs/Makefile
+
+Removed remnant Makefiles from the old staden package build
+system. All we have left now is the autoconf build files.
+
+------------------------------------------------------------------------
+r1775 | jkbonfield | 2009-07-28 16:37:18 +0100 (Tue, 28 Jul 2009) | 8 lines
+Changed paths:
+   A /io_lib/branches
+   A /io_lib/tags
+   A /io_lib/trunk
+   A /io_lib/trunk/CHANGES (from /staden/trunk/src/io_lib/CHANGES:1774)
+   A /io_lib/trunk/COPYRIGHT (from /staden/trunk/src/io_lib/COPYRIGHT:1774)
+   A /io_lib/trunk/ChangeLog (from /staden/trunk/src/io_lib/ChangeLog:1774)
+   A /io_lib/trunk/Makefile (from /staden/trunk/src/io_lib/Makefile:1774)
+   A /io_lib/trunk/Makefile.am (from /staden/trunk/src/io_lib/Makefile.am:1774)
+   A /io_lib/trunk/README (from /staden/trunk/src/io_lib/README:1774)
+   A /io_lib/trunk/acinclude.m4 (from /staden/trunk/src/io_lib/acinclude.m4:1774)
+   A /io_lib/trunk/bootstrap (from /staden/trunk/src/io_lib/bootstrap:1774)
+   A /io_lib/trunk/configure.in (from /staden/trunk/src/io_lib/configure.in:1774)
+   A /io_lib/trunk/dependencies (from /staden/trunk/src/io_lib/dependencies:1774)
+   A /io_lib/trunk/docs (from /staden/trunk/src/io_lib/docs:1774)
+   A /io_lib/trunk/include (from /staden/trunk/src/io_lib/include:1774)
+   A /io_lib/trunk/io_lib (from /staden/trunk/src/io_lib/io_lib:1774)
+   A /io_lib/trunk/io_lib-config.in (from /staden/trunk/src/io_lib/io_lib-config.in:1774)
+   A /io_lib/trunk/io_lib.m4 (from /staden/trunk/src/io_lib/io_lib.m4:1774)
+   A /io_lib/trunk/man (from /staden/trunk/src/io_lib/man:1774)
+   A /io_lib/trunk/options.mk (from /staden/trunk/src/io_lib/options.mk:1774)
+   A /io_lib/trunk/progs (from /staden/trunk/src/io_lib/progs:1774)
+   A /io_lib/trunk/tests (from /staden/trunk/src/io_lib/tests:1774)
+   D /staden/trunk/src/io_lib/CHANGES
+   D /staden/trunk/src/io_lib/COPYRIGHT
+   D /staden/trunk/src/io_lib/ChangeLog
+   D /staden/trunk/src/io_lib/Makefile
+   D /staden/trunk/src/io_lib/Makefile.am
+   D /staden/trunk/src/io_lib/README
+   D /staden/trunk/src/io_lib/acinclude.m4
+   D /staden/trunk/src/io_lib/bootstrap
+   D /staden/trunk/src/io_lib/configure.in
+   D /staden/trunk/src/io_lib/dependencies
+   D /staden/trunk/src/io_lib/docs
+   D /staden/trunk/src/io_lib/include
+   D /staden/trunk/src/io_lib/io_lib
+   D /staden/trunk/src/io_lib/io_lib-config.in
+   D /staden/trunk/src/io_lib/io_lib.m4
+   D /staden/trunk/src/io_lib/man
+   D /staden/trunk/src/io_lib/options.mk
+   D /staden/trunk/src/io_lib/progs
+   D /staden/trunk/src/io_lib/tests
+
+Moved io_lib from staden source tree into it's own top-level
+subversion directory, complete with tags, branches, and trunk.
+
+For now the old tagged copies of io_lib are still in the staden/tags/
+directory with tag names io_lib-<version>, but that is perhaps right
+and proper (as it's where the code actually resided at that release
+number).
+
+------------------------------------------------------------------------
+r1772 | jkbonfield | 2009-07-28 15:32:58 +0100 (Tue, 28 Jul 2009) | 4 lines
+Changed paths:
+   M /staden/trunk/src/io_lib/progs/Makefile.am
+   D /staden/trunk/src/io_lib/progs/solexa2srf.c
+   D /staden/trunk/src/io_lib/progs/srf2solexa.c
+
+Removed Illumina/Solexa specific programs. These are now out of date
+with respect to Illumina's own fork, plus I don't think they belong in
+the largely platform agnostic library.
+
+------------------------------------------------------------------------
+r1771 | jkbonfield | 2009-07-28 12:44:07 +0100 (Tue, 28 Jul 2009) | 7
+lines
+Changed paths:
+   M /staden/trunk/src/io_lib/CHANGES
+   M /staden/trunk/src/io_lib/ChangeLog
+   M /staden/trunk/src/io_lib/README
+   M /staden/trunk/src/io_lib/configure.in
+   M /staden/trunk/src/io_lib/io_lib/Makefile.am
+
+Preparations for 1.12.0 release.
+
+There is now proper versioning support for the library too. The soname
+used here is libstaden-read.so.1, to distinguish from any earlier
+dynamic libraries. (The ABI definitely has changed over the years in
+incompatible manners.)
+
+------------------------------------------------------------------------
+r1770 | jkbonfield | 2009-07-28 09:17:29 +0100 (Tue, 28 Jul 2009) | 1 line
+Changed paths:
+   M /staden/trunk/src/io_lib/tests/data/slx_out/both.info
+   M /staden/trunk/src/io_lib/tests/data/slx_out/raw.info
+
+Updated for new format srf_info output
+------------------------------------------------------------------------
+r1769 | jkbonfield | 2009-07-28 09:16:11 +0100 (Tue, 28 Jul 2009) | 2 lines
+Changed paths:
+   M /staden/trunk/src/io_lib/tests/data/slx_out/proc.info
+
+Updated with new format output.
+
+------------------------------------------------------------------------
+r1768 | jkbonfield | 2009-07-27 17:49:44 +0100 (Mon, 27 Jul 2009) | 2 lines
+Changed paths:
+   M /staden/trunk/src/io_lib/io_lib/vlen.c
+
+Include os.h so we can pick up NEED_VA_COPY definition.
+
+------------------------------------------------------------------------
+r1767 | jkbonfield | 2009-07-27 17:48:37 +0100 (Mon, 27 Jul 2009) | 5 lines
+Changed paths:
+   M /staden/trunk/src/io_lib/progs/srf_filter.c
+
+Reorganisation to allow chunks to be added as well as removed. At
+present this only supports adding REGN chunks.
+
+(Patch supplied by Steven Leonard.)
+
+------------------------------------------------------------------------
+r1766 | jkbonfield | 2009-07-27 17:46:07 +0100 (Mon, 27 Jul 2009) | 3 lines
+Changed paths:
+   M /staden/trunk/src/io_lib/progs/index_tar.c
+
+Handle GNU tar extensions: LongLink notation.
+(Patch supplied by Steven Leonard).
+
+------------------------------------------------------------------------
+r1765 | jkbonfield | 2009-07-27 17:45:16 +0100 (Mon, 27 Jul 2009) | 4 lines
+Changed paths:
+   M /staden/trunk/src/io_lib/progs/srf2fasta.c
+   M /staden/trunk/src/io_lib/progs/srf2fastq.c
+   M /staden/trunk/src/io_lib/progs/srf_extract_hash.c
+
+Changed the maximum read length from 1024 to 10000. This allows for
+capillary traces to be stored in SRF.
+(Patch supplied by Steven Leonard)
+
+------------------------------------------------------------------------
+r1764 | jkbonfield | 2009-07-27 17:43:36 +0100 (Mon, 27 Jul 2009) | 3 lines
+Changed paths:
+   M /staden/trunk/src/io_lib/progs/srf_info.c
+
+Use int64_t instead of long for base counts and chunk sizes.
+(Supplied by Steven Leonard.)
+
+------------------------------------------------------------------------
+r1763 | jkbonfield | 2009-07-27 16:49:10 +0100 (Mon, 27 Jul 2009) | 3 lines
+Changed paths:
+   M /staden/trunk/src/io_lib/man/man1/srf_info.1
+   M /staden/trunk/src/io_lib/progs/srf_info.c
+
+Added compressed chunk size to the per-chunk type output. This allows
+us to see what takes up the most storage in an SRF.
+
+------------------------------------------------------------------------
+r1762 | jkbonfield | 2009-07-27 16:47:20 +0100 (Mon, 27 Jul 2009) | 1 line
+Changed paths:
+   M /staden/trunk/src/io_lib/io_lib/ztr.c
+
+removed C9Xism
+
+------------------------------------------------------------------------
+r1761 | jkbonfield | 2009-07-27 15:01:16 +0100 (Mon, 27 Jul 2009) | 5 lines
+Changed paths:
+   M /staden/trunk/src/io_lib/configure.in
+   M /staden/trunk/src/io_lib/io_lib/Makefile.am
+   M /staden/trunk/src/io_lib/progs/Makefile.am
+
+Re-enabled libtool, with a workaround to remove the infuriating rpath
+nonsense. (It's now 2x slower to configure, 3x slower to compile and
+10x more anguish to debug, but at least I can sleep at night knowing
+rpath hasn't had it's wicked way with the code.)
+
+------------------------------------------------------------------------
+r1756 | jkbonfield | 2009-07-24 10:27:29 +0100 (Fri, 24 Jul 2009) | 5 lines
+Changed paths:
+   M /staden/trunk/src/Makefile.in
+   A /staden/trunk/src/io_lib/io_lib/Makefile
+
+Added a Makefile for io_lib/io_lib; so the library itself. This isn't
+expected to be used normally, but it allows me to test local copies of
+io_lib (under a different library name) in conjunction with the staden
+source tree before releasing either.
+
+------------------------------------------------------------------------
+r1723 | jkbonfield | 2009-06-22 12:38:26 +0100 (Mon, 22 Jun 2009) | 2 lines
+Changed paths:
+   M /staden/trunk/src/io_lib/io_lib/ztr_translate.c
+
+Gracefully handle the case of a trace with no BPOS chunk in ztr2read().
+
+------------------------------------------------------------------------
+r1722 | jkbonfield | 2009-06-22 12:37:32 +0100 (Mon, 22 Jun 2009) | 2 lines
+Changed paths:
+   M /staden/trunk/src/io_lib/io_lib/hash_table.c
+   M /staden/trunk/src/io_lib/io_lib/hash_table.h
+
+Added the hash table iterator functions (copied from Gap5's hache tables).
+
+------------------------------------------------------------------------
+r1721 | jkbonfield | 2009-06-22 12:36:52 +0100 (Mon, 22 Jun 2009) | 2 lines
+Changed paths:
+   M /staden/trunk/src/io_lib/io_lib/deflate_interlaced.c
+
+Fixed a memory allocation issue of codes2codeset().
+
+------------------------------------------------------------------------
+r1720 | jkbonfield | 2009-06-22 12:35:21 +0100 (Mon, 22 Jun 2009) | 4 lines
+Changed paths:
+   M /staden/trunk/src/io_lib/Makefile
+
+Remove use of curl-config --libs. While useful for linking against
+static libraries, it just adds unwanted dependencies in a dynamic
+build environment.
+
+------------------------------------------------------------------------
+r1596 | jkbonfield | 2009-04-20 12:34:23 +0100 (Mon, 20 Apr 2009) | 6 lines
+Changed paths:
+   M /staden/trunk/src/io_lib/io_lib/compress.c
+   M /staden/trunk/src/io_lib/io_lib/compress.h
+
+Made pipe2() internal as it's not used anywhere else yet.
+
+Also renamed from pipe2 to pipe_into. This resolves SF bug #2629155;
+pipe2 has been added as a system function to glibc 2.9 as an interface
+to the new (2.6.27+) kernel system call of the same name.
+
+------------------------------------------------------------------------
+r1526 | jkbonfield | 2009-03-04 14:38:16 +0000 (Wed, 04 Mar 2009) | 5 lines
+Changed paths:
+   M /staden/trunk/src/io_lib/progs/srf_info.c
+
+Fixed the same bug with mf_end and ztr_partial_decode from srf.c.
+
+Specifically a ZTR file with no chunks in the srf data block header
+failed.
+
+------------------------------------------------------------------------
+r1525 | jkbonfield | 2009-03-04 14:23:58 +0000 (Wed, 04 Mar 2009) | 4 lines
+Changed paths:
+   M /staden/trunk/src/io_lib/io_lib/srf.c
+
+Bug fix to srf_next_ztr_flags. When faced with a ZTR header with no
+ZTR chunks in the srf data block header it erroneously set mf_end to
+zero instead of the actual length.
+
+------------------------------------------------------------------------
+r1455 | jkbonfield | 2009-01-22 17:19:25 +0000 (Thu, 22 Jan 2009) | 3 lines
+Changed paths:
+   M /staden/trunk/src/io_lib/io_lib/array.c
+   M /staden/trunk/src/io_lib/io_lib/array.h
+
+Updated the Array struct to use size_t, matching the copy in Misc (yes
+I know, multiple variants is asking for trouble).
+
+------------------------------------------------------------------------
+r1428 | jkbonfield | 2008-12-11 10:22:25 +0000 (Thu, 11 Dec 2008) | 3 lines
+Changed paths:
+   M /staden/trunk/src/io_lib/progs/srf2solexa.c
+
+Changed dump_qcal so it handles negative log-odds scores. In practice
+I've never seen these occur with the 1.0 solexa pipeline release though.
+
+
+===============================================================================
+2008-12-10  James Bonfield  <jkb@sanger.ac.uk>
+
+	* 1.11.6.1 released.
+
+	* progs/solexa2srf.c:
+	Removal of debugging output.
+
+2008-12-10  James Bonfield  <jkb@sanger.ac.uk>
+
+	* 1.11.6 released.
+
+2008-12-10  jkbonfield  <jkb@sanger.ac.uk>
+
+	* progs/solexa2srf.c:
+	Fixed the add_qcal_chunk code so it doesn't assume that it can strlen
+	the binary quality string.
+	
+	* man/man1/srf2fastq.1,
+	* man/man1/srf_info.1:
+	(10:17:27) Updated to reflect newly added options. 
+
+	* progs/srf2fastq.c:
+	(10:19:25) Merged in changes from Steven Leonard. - Extra options
+	were added to provide explicit control over the read   names
+	(whether to add /1, /2, ...) and filenames. - Renamed -p (primer)
+	as -e (explicit). 
+
+	* progs/srf_info.c:
+	(10:20:18) Merged in changes from Steven Leonard - Call srf_destroy
+	before exiting in various failure cases. This has   no real impact
+	except to make it easier to look for real memory leaks. 
+
+2008-12-09  jkbonfield  <jkb@sanger.ac.uk>
+
+	* progs/srf2fastq.c:
+	(10:20:00) Fixed an error with split file mode - it read past the
+	end of an array.
+	
+	We now check the SCALE option on CNF4 and CNF1 chunks and convert
+	the data accordingly to phred. 
+
+	* progs/solexa2srf.c:
+	(10:23:31) Merged in some of the changes made by Chris Saunders
+	from Illumina.
+	
+	Most significantly this now stores CNF1 data in log-odds format and
+	sets SCALE meta-data accordingly. This makes srf2illumina work
+	better as it doesn't go from log-odds to phred back to log-odds,
+	destroying data in rounding. 
+
+	* tests/data/slx_out/both.info,
+	* tests/data/slx_out/both.srf,
+	* tests/data/slx_out/proc.info,
+	* tests/data/slx_out/proc.srf,
+	* tests/data/slx_out/proc.srf.indexed,
+	* tests/data/slx_out/raw.info,
+	* tests/data/slx_out/raw.srf,
+	* tests/data/slx_out/test_run_4_134_369_182.srf,
+	* tests/data/slx_out/both.run/4_PROGRAM_ID.txt:
+	(12:26:13) Updated to accommodate illumina2srf version string
+	change. 
+
+	* progs/srf_filter.c:
+	(12:28:30) Bad case of missing braces! 
+
+2008-12-08  jkbonfield  <jkb@sanger.ac.uk>
+
+	* io_lib/compression.c:
+	(12:32:38) Better error handling in tshift method 
+
+	* io_lib/compress.c,
+	* io_lib/compress.h:
+	(12:33:40) Added remove_extension() function. (Not yet used by
+	io_lib, but potentially handy and used by some external tools.)
+	(Steven Leonard) 
+
+	* progs/srf2solexa.c:
+	(12:34:38) Bug fixed the qcal conversion - now use the correct
+	lookup table and added .499 to match the rounding used in
+	solexa2srf.c. 
+
+	* progs/srf2fastq.c,
+	* progs/srf_filter.c,
+	* progs/srf_info.c:
+	(12:35:40) Merged in Steven Leonard's changes.
+	
+	These mainly involve better support for multiple index blocks in
+	SRF files (eg concatenated files), support for splitting output
+	files in srf2fastq, and extra reporting options in srf_info. 
+
+	* io_lib/ztr.c,
+	* io_lib/ztr.h:
+	(17:15:58) Added const to string params in ztr_add_text. 
+
+	* io_lib/srf.c,
+	* io_lib/srf.h:
+	(17:23:53) New function srf_next_ztr_flags. This is the same as the
+	old srf_next_ztr function except with the addition of an extra
+	argument into which the SRF Data Block 'flags' value is copied when
+	returning the next trace. 
+
+===============================================================================
+2008-12-04  James Bonfield  <jkb@sanger.ac.uk>
+
+	* 1.11.5 released.
+
+2008-12-03  jkbonfield  <jkb@sanger.ac.uk>
+
+	* progs/solexa2srf.c:
+	(17:29:10) Fixed qcal format so it now correctly drops quality by
+	the 64 offset added in the fastq-a-like strings.
+	
+	Fixed a bug with the 2-file calibration mode (-qf and -qr). A
+	single combined -qf alone works fine, but when pasting the split
+	file mode (fwd + rev) a newline crept halfway into the quality
+	string causing the reverse qualities to be shifted by one. 
+
+	* progs/solexa2srf.c:
+	(17:29:56) Bumped version to 1.11 
+
+2008-12-02  jkbonfield  <jkb@sanger.ac.uk>
+
+	* progs/srf_filter.c:
+	(14:38:58) Removed some major memory leaks. 
+
+	* io_lib/srf.c,
+	* progs/srf_filter.c:
+	(15:01:04) More memory leak fixed (although tiny). 
+
+2008-10-23  jkbonfield  <jkb@sanger.ac.uk>
+
+	* progs/hash_sff.c:
+	(14:08:19) Added support for outputting only the table of contents
+	to a new file without copying the existing sff files. This is
+	useful if we have the original sff files in an archive that we
+	cannot modify. 
+
+2008-10-07  jkbonfield  <jkb@sanger.ac.uk>
+
+	* progs/Makefile.am:
+	(16:02:51) Added extract_fastq to the list of programs to build. 
+
+2008-09-29  jkbonfield  <jkb@sanger.ac.uk>
+
+	* man/man1/illumina2srf.1,
+	* man/man1/srf2fasta.1,
+	* man/man1/srf2fastq.1,
+	* man/man1/srf_info.1,
+	* man/man1/srf_list.1:
+	(13:40:01) Added the first draft of several manual pages. 
+
+	* man/man1/illumina2srf.1:
+	(13:44:09) *** empty log message *** 
+
+	* progs/Makefile.am,
+	* progs/srf_list.c:
+	(14:00:22) Added new program: srf_list. This lists or counts the
+	sequence names within an SRF file. 
+
+	* io_lib/srf.c:
+	(14:01:38) The srf_next_block_details now uses the trace_body
+	struct held within the srf struct. This means it can be queried
+	after a successful call and is utilised by srf_list to obtain the
+	trace body size. 
+
+	* man/man1/srf_index_hash.1:
+	(14:08:36) First draft of man page. 
+
+2008-09-18  jkbonfield  <jkb@sanger.ac.uk>
+
+	* progs/solexa2srf.c:
+	(12:59:37) Fixed a bug with parsing the directory name. If it fails
+	it left the run number in an inconsistent state.
+	
+	This shouldn't cause issues in production pipelines, but does if
+	you copy the files out of the run folders. 
+
+	* io_lib/srf.c,
+	* io_lib/srf.h,
+	* progs/solexa2srf.c:
+	(16:33:45) Overhauled the SRF indexing code.
+	
+	Much of the indexing code in srf_index_hash.c has been moved over
+	to srf.c so it can be used by other programs.  An API has been
+	created too so it is now far easier to create, add to and save an
+	index.
+	
+	Added support for writing indexes in illumina2srf. Note that now if
+	no index is written we also write out 8 bytes of zero, indicating
+	the length of the index is zero. (This is required by more recent
+	versions of the SRF specification.)
+	
+	Still to do: tools such as srf_filter should be updating the index
+	(or at least removing the old ones). This will now be easier to do
+	with these code updates.
+	
+	Updated the tests to check the new illumina2srf -i option too. 
+
+	* progs/srf_index_hash.c,
+	* tests/illumina2srf.test,
+	* tests/srf_index.test,
+	* tests/data/slx_out/both.srf,
+	* tests/data/slx_out/proc.srf,
+	* tests/data/slx_out/raw.srf:
+	(16:33:46) Overhauled the SRF indexing code.
+	
+	Much of the indexing code in srf_index_hash.c has been moved over
+	to srf.c so it can be used by other programs.  An API has been
+	created too so it is now far easier to create, add to and save an
+	index.
+	
+	Added support for writing indexes in illumina2srf. Note that now if
+	no index is written we also write out 8 bytes of zero, indicating
+	the length of the index is zero. (This is required by more recent
+	versions of the SRF specification.)
+	
+	Still to do: tools such as srf_filter should be updating the index
+	(or at least removing the old ones). This will now be easier to do
+	with these code updates.
+	
+	Updated the tests to check the new illumina2srf -i option too. 
+
+===============================================================================
+2008-09-11  James Bonfield  <jkb@sanger.ac.uk>
+
+	* 1.11.4 released.
+
+2008-09-11  James Bonfield  <jkb@sanger.ac.uk>
+
+	* Makefile.am,
+	* bootstrap,
+	* configure.in:
+	(08:43:42) Updated for version number and inclusion of tests dir. 
+
+	* io_lib/Attic/Makefile.in:
+	(08:43:55) Removed due to being auto-generated from Makefile.am 
+
+	* io_lib/os.h:
+	(08:44:56) Tidy up of endianness detection. I split apart the
+	endian step from the os-components (no strdup, etc). Also changed
+	the order so that when using autoconf the automatically detected
+	settings override any existing assumptions from os.h. 
+
+	* io_lib/hash_table.h:
+	(08:46:10) Included sys/types.h for off_t type. 
+
+	* CHANGES,
+	* ChangeLog,
+	* README:
+	(10:25:27) Final tweaks for preparing 1.11.4 
+
+	* io_lib/srf.h:
+	(10:52:37) Changed block_type from char to int. This cures a
+	problem on PowerMac (PPC) running Debian where char is by default
+	an unsigned type, meaning it cannot be compared to EOF (-1). 
+
+	* tests/srf_index.test,
+	* tests/data/slx_out/Attic/test_run:4:134:369:182.srf,
+	* tests/data/slx_out/test_run_4_134_369_182.srf:
+	(11:09:11) Renamed test_run:4:134:369:182.srf to
+	test_run_4_134_369_182.srf as Windows cannot cope with colons in
+	filenames, causing the tar file to fail to unpack. Grrr. 
+
+	* Makefile.am,
+	* io_lib/srf.c,
+	* progs/solexa2srf.c,
+	* progs/srf2fasta.c,
+	* progs/srf2fastq.c,
+	* progs/srf2solexa.c,
+	* progs/srf_dump_all.c,
+	* progs/srf_extract_linear.c,
+	* tests/Makefile.am,
+	* tests/srf_index.test,
+	* tests/srf_info.test:
+	(15:25:29) A variety of changes to make the code work correctly
+	using msys/mingw on Windows. These mainly revolve around binary
+	mode and nl/cr issues. 
+
+2008-09-10  James Bonfield  <jkb@sanger.ac.uk>
+
+	* tests/Makefile.am,
+	* tests/illumina2srf.test,
+	* tests/srf2fasta.test,
+	* tests/srf2fastq.test,
+	* tests/srf2illumina.test,
+	* tests/srf_filter.test,
+	* tests/srf_index.test,
+	* tests/srf_info.test,
+	* tests/data/.params,
+	* tests/data/slx_in/.params,
+	* tests/data/slx_in/s_4_0133_int.txt.gz,
+	* tests/data/slx_in/s_4_0133_nse.txt.gz,
+	* tests/data/slx_in/s_4_0134_int.txt.gz,
+	* tests/data/slx_in/s_4_0134_nse.txt.gz,
+	* tests/data/slx_in/Bustard1.9.5_28-08-2008_auto/s_4_0133_prb.txt,
+	* tests/data/slx_in/Bustard1.9.5_28-08-2008_auto/s_4_0133_qhg.txt,
+	* tests/data/slx_in/Bustard1.9.5_28-08-2008_auto/s_4_0133_seq.txt,
+	* tests/data/slx_in/Bustard1.9.5_28-08-2008_auto/s_4_0133_sig2.txt,
+	* tests/data/slx_in/Bustard1.9.5_28-08-2008_auto/s_4_0134_prb.txt,
+	* tests/data/slx_in/Bustard1.9.5_28-08-2008_auto/s_4_0134_qhg.txt,
+	* tests/data/slx_in/Bustard1.9.5_28-08-2008_auto/s_4_0134_seq.txt,
+	* tests/data/slx_in/Bustard1.9.5_28-08-2008_auto/s_4_0134_sig2.txt,
+	* tests/data/slx_in/Bustard1.9.5_28-08-2008_auto/Phasing/s_4_01_phasing.xml,
+	* tests/data/slx_in/Matrix/s_4_02_matrix.txt,
+	* tests/data/slx_out/both.info,
+	* tests/data/slx_out/both.srf,
+	* tests/data/slx_out/proc.info,
+	* tests/data/slx_out/proc.srf,
+	* tests/data/slx_out/proc.srf.indexed,
+	* tests/data/slx_out/raw.info,
+	* tests/data/slx_out/raw.srf,
+	* tests/data/slx_out/slx-C.fasta,
+	* tests/data/slx_out/slx-C.fastq,
+	* tests/data/slx_out/slx.fasta,
+	* tests/data/slx_out/slx.fastq,
+	* tests/data/slx_out/test_run:4:134:369:182.srf,
+	* tests/data/slx_out/traces.srf,
+	* tests/data/slx_out/both.run/4_ILLUMINA_GA_BUSTARD_PARAMS.txt,
+	* tests/data/slx_out/both.run/4_ILLUMINA_GA_CHASTITY.txt:
+	(15:53:41) First pass at a "make check" target. Currently this is
+	centred around the newer code, specifically SRF support. 
+
+	* tests/data/slx_out/both.run/4_ILLUMINA_GA_FIRECREST_PARAMS.txt,
+	* tests/data/slx_out/both.run/4_ILLUMINA_GA_MATRIX_FWD.txt,
+	* tests/data/slx_out/both.run/4_ILLUMINA_GA_PHASING_FWD.txt,
+	* tests/data/slx_out/both.run/4_PROGRAM_ID.txt,
+	* tests/data/slx_out/both.run/s_4_0133_int.txt,
+	* tests/data/slx_out/both.run/s_4_0133_nse.txt,
+	* tests/data/slx_out/both.run/s_4_0133_prb.txt,
+	* tests/data/slx_out/both.run/s_4_0133_seq.txt,
+	* tests/data/slx_out/both.run/s_4_0133_sig2.txt,
+	* tests/data/slx_out/both.run/s_4_0134_int.txt,
+	* tests/data/slx_out/both.run/s_4_0134_nse.txt,
+	* tests/data/slx_out/both.run/s_4_0134_prb.txt,
+	* tests/data/slx_out/both.run/s_4_0134_seq.txt,
+	* tests/data/slx_out/both.run/s_4_0134_sig2.txt:
+	(15:53:42) First pass at a "make check" target. Currently this is
+	centred around the newer code, specifically SRF support. 
+
+	* tests/Makefile.am,
+	* tests/illumina2srf.test,
+	* tests/srf2fasta.test,
+	* tests/srf2fastq.test,
+	* tests/srf2illumina.test,
+	* tests/srf_filter.test,
+	* tests/srf_index.test,
+	* tests/srf_info.test:
+	(16:13:19) Fixed tests to use $outdir for output directory so we
+	can neatly tidy it up for make distclean. Without this make
+	distcheck fails. 
+
+	* tests/Makefile.am,
+	* tests/illumina2srf.test,
+	* tests/srf2fasta.test,
+	* tests/srf2fastq.test,
+	* tests/srf2illumina.test,
+	* tests/srf_filter.test,
+	* tests/srf_index.test,
+	* tests/srf_info.test:
+	(16:43:33) Fixed some bashisms and switched to make use of srcdir
+	instead of top_srcdir/tests. 
+
+2008-09-09  James Bonfield  <jkb@sanger.ac.uk>
+
+	* acinclude.m4:
+	(13:27:35) Fixed the LIBCURL_CHECK_CONFIG code to not believe the
+	output from "curl-config --libs". We try -lcurl first off to see if
+	that also works. The reason is simply that curl-config --libs
+	typically loves to explicitly specify all the implicit
+	dependencies, such as -lssl -lcrypto -ldl, etc. This in turn locks
+	compiled io_lib libraries and binaries into requiring very specific
+	version of system libraries. 
+
+	* io_lib/Attic/Makefile.in:
+	(13:27:57) *** empty log message *** 
+
+	* io_lib/compression.c:
+	(13:30:24) Minor speed tweaks to qshift and unqshift 
+
+	* io_lib/mFILE.c,
+	* progs/solexa2srf.c:
+	(13:31:41) Added include of io_lib_config.h for autoconf builds so
+	that the ftello and similar functions get the correct prototypes. 
+
+	* io_lib/srf.c,
+	* io_lib/srf.h:
+	(13:32:44) Made partial_decode_ztr non-static and added it, along
+	with ztr_dup and construct_trace_name to the external header file
+	for use in other parts of io_lib. 
+
+	* progs/Makefile.am,
+	* progs/srf_filter.c,
+	* progs/srf_info.c:
+	(13:36:40) Added two new programs from Steven Leonard.
+	
+	srf_info: dumps out basic information on the contents of an SRF    
+	      file, including the read name prefixes used, how many	   
+	  DBs per DBH and frequencies of ZTR chunk and meta-data	 
+	strings.
+	
+	srf_filter: a tool to produce new srf files by filtering in or out 
+		data from an existing srf file. This can be performed	   
+	    either at the entire trace level (eg tagged as good or	   
+	bad) or also at individual ZTR chunk levels (eg processed      
+	data only). 
+
+	* progs/srf2fasta.c,
+	* progs/srf2fastq.c:
+	(13:37:37) Include string.h for additional prototypes (for -Wall
+	-Wno-paranthesis compilations). 
+
+	* progs/srf_extract_hash.c:
+	(13:38:47) Major overhaul from Steven Leonard. It now supports a
+	-fastq option to output fastq instead of ZTR files and optionally
+	can use calibrated or non-calibrated confidence values too. 
+
+	* progs/srf_extract_linear.c:
+	(13:39:44) Added support for SRFB_NULL_INDEX so that srf files with
+	a blank index do not causes crashes. 
+
+	* progs/srf_index_hash.c:
+	(13:40:44) Added extra error checking from Steven Leonard to spot
+	duplicate read names. The new -c option also allows checking of an
+	existing srf file without attempting to write a new index. 
+
+2008-09-08  James Bonfield  <jkb@sanger.ac.uk>
+
+	* progs/solexa2srf.c:
+	(08:40:20) Fixed bug reported by Robert Sanders. The fwd matrix was
+	being written twice on paired-end runs instead of fwd+reverse. 
+
+	* COPYRIGHT,
+	* io_lib/open_trace_file.c,
+	* io_lib/sff.c:
+	(10:56:46) Updated 454's copyright notice (following correspondence
+	from Jim Knight at 454) to explicitly include permission to modify
+	and redistribute the code.
+	
+	Also updated the GRL licence to be explicit rather than just an
+	implied BSD style. 
+
+2008-08-29  James Bonfield  <jkb@sanger.ac.uk>
+
+	* io_lib/deflate_interlaced.c:
+	(09:00:39) Added external codes2codeset() function to turn
+	bit-length arrays into codesets. Useful for tools that wish to use
+	this code to use their own precomputed huffman trees. 
+
+	* io_lib/deflate_interlaced.h:
+	(09:00:53) *** empty log message *** 
+
+	* progs/solexa2srf.c:
+	(09:01:21) Renamed ILLUMINA_GA_PARAMS and ILLUMINA_GA_PARAMS2 to
+	ILLUMINA_GA_BUSTARD_PARAMS and ILLUMINA_GA_FIRECREST_PARAMS. 
+
+2008-08-26  James Bonfield  <jkb@sanger.ac.uk>
+
+	* progs/solexa2srf.c:
+	(11:07:09) Added the second .params file (Data directory).
+	
+	Major reduction in memory usage when adding the .params files; we
+	only hold this in memory for the first ZTR file per DBH as it ends
+	up in the header anyway. (This also speeds things up too.) 
+
+2008-08-08  James Bonfield  <jkb@sanger.ac.uk>
+
+	* progs/solexa2srf.c:
+	(10:21:28) Fixed a bug in parse_4_float when handling strings with
+	leading zeroes after the point, eg "17.04". Fortunately this is
+	never triggered in the solexa data as it's always one single value
+	after the decimal point. 
+
+	* configure.in,
+	* io_lib/os.h:
+	(10:33:29) Applied Chris Saunders' patch to use autoconf for
+	checking machine endianness. 
+
+	* progs/solexa2srf.c:
+	(16:52:10) Added a MAX_READS_PER_DBH #define to solexa2srf
+	(defaults at 10000) to reduce the maximum number of traces per tile
+	we process between SRF data block headers. This helps reduce the
+	maximum memory usage which is especially important on dense GA2
+	runs where 200,000 clusters in a tile can be achieved.
+	
+	Also fixed a bug with using -qf/-qr when not supplying a list of
+	tiles consecutively starting with tile 1. 
+
+2008-08-05  James Bonfield  <jkb@sanger.ac.uk>
+
+	* io_lib/srf.c:
+	(08:18:14) Fixed memory leak in srf_next_ztr reported by Rob Egan.
+	Triggered by srf2fastq -C. 
+
+2008-07-24  James Bonfield  <jkb@sanger.ac.uk>
+
+	* progs/solexa2srf.c:
+	(15:47:32) Updated version to v1.10
+	
+	Added -pf/-pr parameters to allow the phasing files to be stored.
+	By default it attempts to derive these filenames from the fwd/rev
+	cycle numbers.
+	
+	Auto-compute the basecaller name and version string from the
+	directory name. 
+
+	* progs/solexa2srf.c:
+	(15:58:15) Bug fix to get_base_caller() so that it can identify the
+	directory when given a full pathname to elsewhere other than the
+	cwd. 
+
+2008-07-18  James Bonfield  <jkb@sanger.ac.uk>
+
+	* progs/solexa2srf.c:
+	(15:54:51) No longer iterate through tiles printing up . or !
+	depending on whether we encounter an error. Now it just aborts at
+	the point of failure.
+	
+	Also made the parsing code more robust as in a couple specific
+	cases it only wrote to stderr without actually generating a
+	non-zero exit code.
+	
+	These mean the tool is more amenable to running in a production
+	pipeline. If it gets any error at all it'll be more obvious and
+	forces attention. 
+
+2008-07-11  James Bonfield  <jkb@sanger.ac.uk>
+
+	* progs/solexa2srf.c:
+	(11:35:28) Updated the rounding of int/nse/sig2 to all use the
+	rint() function to round to closest integer value. Previously
+	int/nse rounded down and sig2 rounded closest. (Although the
+	rounding on sig2 was via +/- 0.5 and so the half-way cases
+	sometimes give different answers to the new code using rint()).
+	
+	It has a very minor impact overall, but it is now consistent. 
+
+===============================================================================
+2008-07-09  James Bonfield  <jkb@sanger.ac.uk>
+
+	* 1.11.3 released.
+
+2008-07-09  jkbonfield  <jkb@sanger.ac.uk>
+
+	* io_lib/mFILE.c:
+	* io_lib/Read.c,
+	* io_lib/mFILE.h:
+	(13:54:59) Fixed a bug visible with "extract_seq -fasta_out -fofn f
+	-output f.fasta" whereby only the last file was visible. This is
+	due to the mFILE mechanism and an explicit fseek upon writing each
+	file. Fixed this by using an extended freopen option ("wbx" instead
+	of "wb") to override this feature. It's not ideal, but gets the job
+	done - I hope. 
+
+2008-07-08  jkbonfield  <jkb@sanger.ac.uk>
+
+	* io_lib/srf.c,
+	* io_lib/srf.h:
+	(13:22:57) Added SRFB_NULL_INDEX as an SRF block type. It's
+	essentially type 0 and is defined to be 8 long (with 7 more zeros).
+	The purpose is to transparently gloss over the 8-zeros that may be
+	on the end of some files indicating a missing index block. 
+
+	* progs/solexa2srf.c:
+	(13:34:40) MAJOR BUG FIX!
+	
+	Fixed a bug in reorder_ztr() whereby the sorted order of multiple
+	chunks of the same chunk type were not "stable". The result of this
+	is that 3 SMP4 chunks (say A, B, C) may end up sorted A, B, C with
+	nchunks==9 and C, A, B with nchunks==15. Given that an optimisation
+	means that we change the number of chunks depending on whether
+	we've encoded HUFF chunks this causes a "corruption" in as far as
+	the correct data is stored but with potentially an incorrect
+	meta-data block for the first SMP4 chunk.
+	
+	See srf_fix.c to reverse this problem.
+	
+	Also added a warning regarding the -C option and -qf option. These
+	are inherently incompatible (right now) as purity filtered data is
+	not calibrated.
+	
+	Updated version to v1.8 
+
+2008-06-12  jkbonfield  <jkb@sanger.ac.uk>
+
+	* progs/srf2fasta.c,
+	* progs/srf2fastq.c:
+	(10:44:23) Removed memory leaks from using ztr_find_chunks and not
+	freeing the result. 
+
+===============================================================================
+2008-06-04  James Bonfield  <jkb@sanger.ac.uk>
+
+	* 1.11.2 released.
+
+2008-06-04  jkbonfield  <jkb@sanger.ac.uk>
+
+	* docs/ZTR_format:
+	(13:06:36) Added some text regarding *ideas* for version 2. These
+	are not officially part of any stanard yet. 
+
+	* io_lib/compression.c:
+	(13:06:54) Comment change only. 
+
+2008-06-03  jkbonfield  <jkb@sanger.ac.uk>
+
+	* io_lib/srf.c:
+	(16:23:50) Applied bug fix from John Emhoff: srf_read_xml was
+	incorrectly interpreting the XML length as the length of the XML
+	string rather than the entire SRF block itself including header. It
+	now agrees with srf_write_xml, which interpreted this correctly. 
+
+2008-05-23  jkbonfield  <jkb@sanger.ac.uk>
+
+	* docs/ZTR_format:
+	(08:38:05) Documented TYPE meta-data for SMP4 and removed the
+	comment about being mutually exclusive with SAMP.
+	
+	Added explanation of log-odds vs phred scales.
+	
+	Added CNF1 chunk type (how did I miss this before?). 
+
+2008-05-21  jkbonfield  <jkb@sanger.ac.uk>
+
+	* io_lib/srf.c:
+	(09:12:23) Fixed memory leak in construct_trace_name. (Patch from
+	John Emhoff at Heliocos.) 
+
+2008-05-14  jkbonfield  <jkb@sanger.ac.uk>
+
+	* progs/solexa2srf.c:
+	(13:08:34) Fixed floating point to integer rounding of trace data
+	to round to closest instead of floor(value). 
+
+	* io_lib/srf.c,
+	* io_lib/srf.h,
+	* progs/solexa2srf.c,
+	* progs/srf2fasta.c,
+	* progs/srf2fastq.c,
+	* progs/srf2solexa.c,
+	* progs/srf_dump_all.c:
+	(14:13:15) Added changes from Camil Toma (albeit modified here and
+	there) to incorporate the -C option to various tools. This allows
+	for chastity filtered data to be stored in SRF, but tagged as being
+	bad data. We then get the option to filter it on extraction
+	instead. 
+
+2008-05-13  jkbonfield  <jkb@sanger.ac.uk>
+
+	* progs/solexa2srf.c:
+	(14:25:53) Reverted the footer position change in encode_ztr() back
+	(to the 20th February 2008) to taking out the meta-data into the
+	header block too. Although this contains variable data (OFFS=value)
+	it's the same for all members of a tile. 
+
+2008-05-08  jkbonfield  <jkb@sanger.ac.uk>
+
+	* io_lib/open_trace_file.c:
+	(11:06:53) Sped up searching in SRF files by stripping off the
+	directory name when calling srf_find_trace(). (It got to this
+	before eventually, but only after searching various false
+	combinations.)
+
+	* io_lib/os.h:
+	(11:07:31) Minor change to prevent errors when compiling within the
+	Staden Package. No impact for autoconf version. 
+
+	* io_lib/srf.c:
+	(11:08:18) Fixed bug in srf_find_trace that caused it to rarely
+	fail to find a trace when querying the hash table. 
+
+2008-05-06  jkbonfield  <jkb@sanger.ac.uk>
+
+	* docs/ZTR_format:
+	(11:44:51) Fixed error in the pictoral diagram describing the magic
+	number. (It is correct everywhere else.) 
+
+	* io_lib/open_trace_file.c:
+	(14:27:24) Added SRF interfaces to open_trace_file meaning we can
+	now try specifying traces file fubar.srf/tname or
+	TRACE_PATH=SRF=fubar.srf and tname. 
+
+	* configure.in,
+	* io_lib/ztr.c,
+	* progs/Makefile.am,
+	* progs/solexa2srf.c,
+	* progs/srf2solexa.c:
+	(15:35:36) Implemented Come Raczy's (Illumina) changes. These
+	involved renaming the solexa2srf and srf2solexa tools to be
+	illumina2srf and srf2illumina and the addition of qcal support in
+	preparation for the GA v1.0 release.
+	
+	Note that currently the filenames are the same as before, in order
+	to preserve change history. 
+
+	* Makefile:
+	(15:43:33) Added srf.o to the Staden Package Makefile (NB: not part
+	of the autoconf system.) 
+
+2008-04-15  jkbonfield  <jkb@sanger.ac.uk>
+
+	* io_lib/hash_table.c:
+	(15:09:41) Initialises pb and pc in hash() function when using
+	HASH_FUNC_JENKINS3. Bug reported by Cristian Goina. 
+
+2008-04-08  jkbonfield  <jkb@sanger.ac.uk>
+
+	* progs/solexa2srf.c:
+	(11:22:33) Fixed a code inefficiency when using -qf and -qr. 
+
+	* io_lib/srf.c,
+	* io_lib/srf.h:
+	(16:16:55) Fixed bugs regarding binary format read_id suffixes,
+	reported and mostly patched by Cristian Goina.
+	
+	The srf_trace_body_t struct now has a read_id_length field.
+	
+	The srf_construct_trace_body() function has an extra argument to
+	pass in the length, or -1 if unknown (it'll use strlen then).
+	
+	New function srf_write_pstringb to write binary pstrings, avoiding
+	the requirement for strlen(). 
+
+	* progs/solexa2srf.c:
+	(16:21:57) Added extra arg to srf_construct_trace_body call (see
+	srf.c change log).
+	
+	Fixed a bug introduced in the recent efficiency improvements for
+	-qf/-qr. These meant that many sequences were incorrectly skipped. 
+
+2008-04-07  jkbonfield  <jkb@sanger.ac.uk>
+
+	* progs/solexa2srf.c:
+	(08:54:06) Increased the estimation of number of bytes per cycle in
+	the allocation in get_sig(). 
+
+	* progs/solexa2srf.c:
+	(15:11:06) Fixed error that crept in when error checking was added
+	to compress_chunk calls. Missing curly braces meant that some
+	chunks were not compressed while other chunks got needless
+	additional layers of compression. 
+
+2008-04-03  jkbonfield  <jkb@sanger.ac.uk>
+
+	* progs/solexa2srf.c:
+	(15:57:06) The defaults for -N and -n are now using the same naming
+	conventions used in Gerald during the fastq generation steps. To do
+	this is looks at the run folder root directory name to get the run
+	date, machine name and run number. (These are available for use as
+	%d, %m and %r in the format strings.)
+	
+	Calibrated confidence values are now automatically included if the
+	-qf or -qr parameters are used (specifying the fastq filename).
+	Note this only works currently if the number of bases after
+	calibration is the same as the number before. The calibrated
+	confidence values are written in a CNF1 ztr chunk (in addition to
+	the existing CNF4 chunk for uncalibrated values) and are rescaled
+	to adhere to the phred scale (-10 * log10(1-P)).
+	
+	Added meta-data to the confidence chunks (CNF1 and CNF4) with a
+	SCALE key. The value is either LO (log-odds) or PH (phred). This
+	increases file size somewhat as it's written once per trace, but
+	the long-term goal is to upgrade ZTR to support the ability to
+	specific default meta-data keys/values. 
+
+	* progs/srf2fastq.c:
+	(15:57:58) Added a -c option to output calibrated confidence values
+	instead of uncalibrated ones.
+	
+	Plus additionally it should be able to handle multiple archives on
+	the command line instead of a single one. 
+
+	* progs/solexa2srf.c:
+	(17:00:28) Added support for using popen() to gzip -cd instead of
+	using gzopen. The reason is that it's between 3 and 5 times faster
+	doing that. I'm unsure why, but overall it sped up solexa2srf -r 3
+	fold when the Firecrest data is gzipped. 
+
+2008-04-02  jkbonfield  <jkb@sanger.ac.uk>
+
+	* progs/solexa2srf.c:
+	(09:14:45) Fixed the footer(aka body) position calculation so it
+	works still on trace files containing no trace data at all. Ie
+	solexa2srf -P. 
+
+	* progs/solexa2srf.c:
+	(09:28:02) Added Camil Toma's (Broad) changes to support -mf and
+	-mr paremeters. These provide finer grained control over the
+	filenames of the forward and reverse matrices. 
+
+	* progs/srf2solexa.c:
+	(09:29:04) Added Camil Toma's (Broad) changes to extract text files
+	embedded in ZTR TEXT chunks. 
+
+	* progs/srf_dump_all.c:
+	(10:54:29) Added Camil Toma's (Broad) changes to srf_dump_all.
+	These add multiple new features, increasing the source length 7
+	fold.
+
+	* progs/srf2solexa.c,
+	* progs/srf_dump_all.c:
+	(10:56:06) Fixed bug reported by Cristian Goina (JCVI): we now use
+	srf_open with mode "rb" instead of "r". This resolves an issue on
+	Windows/DOS when dealing with binary data including ^Z characters
+	being interpreted as EOF. 
+
+	* progs/srf_dump_all.c:
+	(11:05:25) Fixed missing newlines in the standard "dump" format. 
+
+2008-03-20  jkbonfield  <jkb@sanger.ac.uk>
+
+	* io_lib/hash_table.c,
+	* progs/hash_list.c:
+	(09:45:07) Added more includes of io_lib_config.h to ensure 64-bit
+	file support works correctly. 
+
+2008-03-13  jkbonfield  <jkb@sanger.ac.uk>
+
+	* progs/solexa2srf.c:
+	(09:32:15) Fixed an error when passing in fully qualified
+	pathnames. We now chdir() to the directory containing the seq.txt
+	file and work from there.
+	
+	Also some functions involved in supporting fastq files with
+	callibrated confidence values. This is unfinished and needs more
+	work, specifically it doesn't do anything with the sequence/qual
+	yet (just parses it) and the entire operation should probably work
+	from the GERALD directory instead of the Bustard directory. Hence
+	for now the -qf and -qr options are undocumented. 
+
+	* progs/solexa2srf.c:
+	(11:53:32) Incorporated Come Razy's changes to solexa2srf, with a
+	few modifications to adhere to C89 instead of C9X C standards.
+	
+	These add support for the new Illumina IPAR file format via the -I
+	command line option. 
+
+2008-02-29  jkbonfield  <jkb@sanger.ac.uk>
+
+	* acinclude.m4,
+	* configure.in:
+	(14:10:53) Fixed autoconf build environment for Fedora. We no
+	longer assume /usr/lib is a valid default for zlib, instead relying
+	on either the compiler to find it or an explicit --with-zlib
+	option.
+	
+	See SF bug 1898427
+	https://sourceforge.net/tracker/index.php?func=detail&aid=1898427&g
+	roup_id=100316&atid=627058 
+
+===============================================================================
+2008-02-20  James Bonfield  <jkb@sanger.ac.uk>
+
+	* 1.11.0 released.
+
+2008-02-20  James Bonfield  <jkb@sanger.ac.uk>
+
+        * progs/srf2fastq.c:
+	(12:49:09) Removed the ztr2read conversion and operate
+	directly on
+	the ztr struct. This is now 25% faster.
+		
+        * progs/srf2fasta.c:
+        (12:49:30) New program - trivially modelled on srf2fastq.c
+	
+	* progs/solexa2srf.c:
+	(10:33:36) Altered the header/footer split for ZTR to stop just
+	before the metadata part of a SMP4 chunk. Previously it was after
+	this and just before the data, but now we can have multiple SMP4
+	chunks in a single ZTR file this was breaking things. 
+
+2008-02-18  James Bonfield <jkb@sanger.ac.uk>
+
+	* io_lib/ztr.h:
+	(16:53:52) Added ZTR_TYPE_REGN definition. We have no explicit code
+	to implement this yet in ztr.c, but for now it's in solexa2srf. 
+
+	* progs/solexa2srf.c:
+	(16:55:38) Added support for specifying the start coord for the 2nd
+	read in a paired-read run (solexa2srf -2 <cycle.no.>). This also
+	adds a REGN chunk to the ZTR file and stores the second matrix file
+	too. 
+
+	* progs/srf2solexa.c:
+	(16:56:39) Major overhaul to support raw data as well as processed
+	data. Still to-do: write out .params and the two matrix files. 
+
+2008-02-15  James Bonfield <jkb@sanger.ac.uk>
+
+	* io_lib/srf.c:
+	(10:05:54) Fixed memory leak in srf_read_trace_body usage. This was
+	primarily visible from within srf_index_hash. 
+
+	* progs/srf2solexa.c,
+	* io_lib/srf.c,
+	* progs/srf_index_hash.c,
+	* progs/srf_extract_hash.c:
+	(12:35:19) Added include of io_lib-config.h to ensure picking up
+	the correct compiler definitions for 64-bit file size support. 
+
+	* progs/srf_extract_linear.c:
+	(12:40:55) Fixed memory leaks. 
+
+2008-02-14  James Bonfield <jkb@sanger.ac.uk>
+
+	* progs/solexa2srf.c:
+	(17:02:42) Don't bother performing ZTR_FORM_TSHIFT transformation
+	on the solexa noise data as it doesn't help it at all. Also hard
+	coded the interlaced huffman to operate in batches of 2 instead of
+	8 for noise data for the same reason. 
+
+	* io_lib/ztr_translate.c:
+	(17:07:15) ztr2read() now correctly handles translation of ZTR
+	files with multiple samples in. Specifically it only sets the Read
+	struct baseline and trace[ACGT] arrays when the TYPE meta-data
+	field is blank, PROC or A,C,G T.
+	
+	This fixes trace_dump etc on solexa srf files, (note that the srf
+	files themselves were perfect valid anyway). 
+
+2008-02-06  James Bonfield <jkb@sanger.ac.uk>
+
+	* progs/extract_seq.c:
+	(11:04:38) Use set_compression_method to explicitly disable gzipped
+	output from extract_seq (which is by default on if the input is
+	gzipped). 
+
+	* io_lib/Makefile.in,
+	* progs/Makefile.am,
+	* progs/extract_qual.c:
+	(11:04:59) Added Steven Leonard's extract_qual program (derived
+	from extract_seq). 
+
+2008-01-28  James Bonfield <jkb@sanger.ac.uk>
+
+	* progs/solexa2srf.c:
+	(09:47:42) Sped up parse_4_int and parse_4_float substantially. 
+
+2008-01-25  James Bonfield  <jkb@sanger.ac.uk>
+
+	* Tagged iolib-1-11-0b8
+
+        * progs/solexa2srf.c:
+        (11:38:34) Fixed small memory leak in zfopen/zfclose.
+
+        Fixed a bug where reorder_ztr could put CNF4 before BASE,
+        breaking
+        the decoding.
+
+        Added support for loading solexa matrix and params files into
+        appropriately named TEXT key/value pairs. It also adds the
+        PROGRAM_ID there now too.
+
+        Sped up chastity filtering. We now only read the line of text
+        rather than decode it for data that is filtered.
+
+        Minor tweaks to program usage output.
+
+        * progs/trace_dump.c:
+        (11:39:09) Updated output to be more inline with
+        srf_dump_all. Also
+        now supports baseline properly.
+
+        * progs/ztr_dump.c:
+        (11:39:34) Added ZTR_FORM_XRLE2, ZTR_FORM_QSHIFT and
+        ZTR_FORM_TSHIFT.
+
+2008-01-24  James Bonfield  <jkb@sanger.ac.uk>
+
+        * io_lib/ztr.c,
+        * io_lib/ztr.h:
+        (17:17:52) Two new utility functions that are *long* overdue.
+
+        ztr_new_chunk() - creates and initialises a new chunk in a ztr
+        struct.
+
+        ztr_add_text() - adds arbitrary key/value pairs to the TEXT
+        chunk,
+                     creating it if required.
+
+2008-01-22  James Bonfield  <jkb@sanger.ac.uk>
+
+        * io_lib/srf.c,
+        * io_lib/srf.h:
+        (11:07:40) Allow for srf_read_index_hdr() to be used to read
+        an index internal to the file rather than at the end of the
+	file. To accommodate this an extra "no_seek" argument has been
+	added.
+
+        * progs/solexa2srf.c:
+        (11:10:56) Support multiple trace channels (raw "int" & noise,
+        in addition to or instead of the processed data).
+
+        Input data may now optionally be compressed.
+
+        Added a -c option to do chastity filtering via the .qhg files.
+
+        Improved the dynamic range filtering. We no longer trim all
+	negative values in preference for high positive values. Instead we
+	set the clip points to trim the least number of total values.
+
+        * progs/srf2solexa.c:
+        (11:11:35) Fixed the baseline subtraction. It now uses the
+        correct value instead of a hardcoded 32768.
+
+        * progs/srf_extract_linear.c:
+        (11:12:15) Changed to use the new srf_read_index_hdr arguments.
+
+        * progs/srf_index_hash.c:
+        (11:13:12) Improved index support when the input is
+        concatenated SRF files already containing indices. It now
+	overwrites the last index.
+
+        * progs/ztr_dump.c:
+        (11:13:47) Added display of meta-data TYPE field for trace
+        sample chunks.
+
+2008-01-14  James Bonfield  <jkb@sanger.ac.uk>
+
+        * io_lib/srf.c,
+        * io_lib/srf.h,
+        * progs/srf_index_hash.c:
+        (16:57:36) Bug fixes to do with reading and writing the index
+        format. We incorrectly handled having null dbhFile and
+        containerFile elements, plus also computed the index size wrong
+	for these fields too.
+
+===============================================================================
+2008-01-11  James Bonfield  <jkb@sanger.ac.uk>
+
+	* 1.11.0b7 released.
+
+	* io_lib/srf.c:
+	(11:35:09) IMPORTANT BUG FIX: The SRF Data Block Header
+	had the blockSize field 4 bytes too large, so SRF files produced
+	did not conform to the standard.
+	Also fixed SRF reading support for when headerBlob is zero length.
+	We then delay ztr decoding until we've read the actual data blob.
+
+	* io_lib/compression.c,
+	* io_lib/deflate_interlaced.c,
+	* io_lib/deflate_interlaced.h,
+	* io_lib/srf.c,
+	* io_lib/ztr.c,
+	* io_lib/ztr_translate.c,
+	* progs/solexa2srf.c:
+	(12:26:11) Added missing prototypes and fixed various signed vs
+	unsigned assignments, as spotted by the Intel C Compiler.
+
+2008-01-02  James Bonfield  <jkb@sanger.ac.uk>
+
+	* Tagged iolib-1-11-0b6
+
+2008-01-02  James Bonfield  <jkb@sanger.ac.uk>
+
+	* io_lib/srf.c:
+	(11:41:00) Removed some debugging output
+
+2007-12-12  James Bonfield  <jkb@sanger.ac.uk>
+
+	* io_lib/srf.c,
+	* io_lib/srf.h,
+	* progs/srf_index_hash.c:
+	(18:50:46) Updates to SRF 1.3. This includes removal of	the readID
+	counter and added support for printf style formatting. It also has
+	some tweaks to the format for the index (32-bit vs 64-bit and
+	dbh/container file strings).
+
+	Both versions have therefore been bumped (SRF 1.3 and index 1.01).
+
+	TODO: support for extracting data from an SRF file that's split
+	with container headers, trace headers and trace bodies all in
+	separate files.
+
+2007-11-12  James Bonfield  <jkb@sanger.ac.uk>
+
+	* Tagged iolib-1-11-0b5
+
+2007-11-08  James Bonfield  <jkb@sanger.ac.uk>
+
+	* io_lib/Read.c,
+	* io_lib/Read.h,
+	* io_lib/abi.h,
+	* io_lib/alf.h,
+	* io_lib/array.c,
+	* io_lib/array.h,
+	* io_lib/compress.c,
+	* io_lib/compress.h,
+	* io_lib/compression.c,
+	* io_lib/compression.h,
+	* io_lib/ctfCompress.c,
+	* io_lib/deflate_interlaced.c,
+	* io_lib/deflate_interlaced.h,
+	* io_lib/error.c,
+	* io_lib/error.h,
+	* io_lib/expFileIO.c:
+	* io_lib/expFileIO.h,
+	* io_lib/files.c,
+	* io_lib/find.c,
+	* io_lib/fpoint.c,
+	* io_lib/fpoint.h,
+	* io_lib/hash_table.c,
+	* io_lib/hash_table.h,
+	* io_lib/jenkins_lookup3.c,
+	* io_lib/jenkins_lookup3.h,
+	* io_lib/mFILE.c,
+	* io_lib/mFILE.h,
+	* io_lib/mach-io.c,
+	* io_lib/mach-io.h,
+	* io_lib/misc.h,
+	* io_lib/misc_scf.c,
+	* io_lib/open_trace_file.c,
+	* io_lib/open_trace_file.h,
+	* io_lib/os.h,
+	* io_lib/plain.h,
+	* io_lib/read_alloc.c,
+	* io_lib/read_scf.c,
+	* io_lib/scf.h,
+	* io_lib/scf_extras.c,
+	* io_lib/scf_extras.h,
+	* io_lib/seqIOABI.c,
+	* io_lib/seqIOABI.h,
+	* io_lib/seqIOALF.c,
+	* io_lib/seqIOCTF.c,
+	* io_lib/seqIOCTF.h,
+	* io_lib/seqIOPlain.c,
+	* io_lib/sff.c,
+	* io_lib/sff.h,
+	* io_lib/srf.c,
+	* io_lib/srf.h,
+	* io_lib/stdio_hack.h,
+	* io_lib/strings.c,
+	* io_lib/tar_format.h,
+	* io_lib/traceType.c,
+	* io_lib/traceType.h,
+	* io_lib/translate.c,
+	* io_lib/translate.h:
+	* io_lib/Makefile.am,
+	* io_lib/Makefile.in,
+	* io_lib/vlen.c,
+	* io_lib/vlen.h,
+	* io_lib/write_scf.c,
+	* io_lib/xalloc.c,
+	* io_lib/xalloc.h,
+	* io_lib/ztr.c,
+	* io_lib/ztr.h,
+	* io_lib/ztr_translate.c:
+	(14:58:14) Renamed files from
+	{abi,alf,ctf,exp_file,plain,read,scf,sff,srf,utils,ztr} subdirs to
+	a single io_lib subdir.
+	
+	The purpose of this is so that code can #include <io_lib/foo.h>
+	from both within this source tree and externally when compiling
+	against io_lib, resolving problems when including files that then
+	include other io_lib files. Plus it's simply tidier this way. 
+
+	* io_lib/Read.c:
+	* io_lib/Read.h,
+	* io_lib/abi.h,
+	* io_lib/alf.h,
+	* io_lib/array.c,
+	* io_lib/compress.c,
+	* io_lib/compress.h,
+	* io_lib/compression.c,
+	* io_lib/compression.h,
+	* io_lib/ctfCompress.c,
+	* io_lib/deflate_interlaced.c,
+	* io_lib/expFileIO.c,
+	* io_lib/expFileIO.h,
+	* io_lib/files.c,
+	* io_lib/find.c,
+	* io_lib/fpoint.c,
+	* io_lib/hash_table.c,
+	* io_lib/jenkins_lookup3.c,
+	* io_lib/mFILE.c,
+	* io_lib/mach-io.c,
+	* io_lib/mach-io.h,
+	* io_lib/misc.h,
+	* io_lib/misc_scf.c,
+	* io_lib/open_trace_file.c,
+	* io_lib/open_trace_file.h,
+	* io_lib/plain.h,
+	* io_lib/read_alloc.c,
+	* io_lib/read_scf.c,
+	* io_lib/scf.h,
+	* io_lib/scf_extras.c,
+	* io_lib/scf_extras.h,
+	* io_lib/seqIOABI.c,
+	* io_lib/seqIOABI.h,
+	* io_lib/seqIOALF.c,
+	* io_lib/seqIOCTF.c,
+	* io_lib/seqIOCTF.h,
+	* io_lib/seqIOPlain.c,
+	* io_lib/sff.c,
+	* io_lib/sff.h,
+	* io_lib/srf.c,
+	* io_lib/srf.h,
+	* io_lib/stdio_hack.h,
+	* io_lib/strings.c,
+	* io_lib/traceType.c,
+	* io_lib/traceType.h,
+	* io_lib/translate.c,
+	* io_lib/translate.h,
+	* io_lib/vlen.c,
+	* io_lib/write_scf.c,
+	* io_lib/xalloc.c,
+	* io_lib/ztr.c,
+	* io_lib/ztr.h,
+	* io_lib/ztr_translate.c,
+	* progs/Makefile.am,
+	* progs/append_sff.c,
+	* progs/convert_trace.c,
+	* progs/extract_fastq.c,
+	* progs/extract_seq.c,
+	* progs/get_comment.c,
+	* progs/hash_exp.c,
+	* progs/hash_extract.c:
+	* progs/hash_list.c,
+	* progs/hash_sff.c,
+	* progs/hash_tar.c,
+	* progs/index_tar.c,
+	* progs/makeSCF.c,
+	* progs/scf_dump.c,
+	* progs/scf_info.c,
+	* progs/scf_update.c,
+	* progs/solexa2srf.c,
+	* progs/srf2fastq.c,
+	* progs/srf2solexa.c,
+	* progs/srf_dump_all.c,
+	* progs/srf_extract_hash.c,
+	* progs/srf_extract_linear.c,
+	* progs/srf_index_hash.c,
+	* progs/trace_dump.c,
+	* progs/ztr_dump.c:
+	(17:24:16) Modify the include paths to use "io_lib/foo.h" instead
+	of "foo.h" or <foo.h>.
+	
+	The advantage of this is that the source for external programs
+	compiled and linked against io_lib can use exactly the same
+	#include statements as the progs/* files. 
+
+	* Makefile.am,
+	* configure.in:
+	(17:37:00) Updated to handle the filename movements. 
+
+	* docs/Hash_File_Format,
+	* docs/ZTR_format:
+	(17:42:14) Moved from elsewhere 
+
+2007-11-06  James Bonfield  <jkb@sanger.ac.uk>
+
+	* README,
+	* CHANGES
+	Updated 
+
+	* progs/Makefile.am:
+	(10:09:33) Added srf_extract_hash; demonstration of using
+	srf_find_trace to query a hash table index. 
+
+	* progs/srf_extract_hash.c:
+	(10:09:34) Added srf_extract_hash; demonstration of using
+	srf_find_trace to query a hash table index. 
+
+	* srf/srf.h:
+	(10:10:15) Bug fix: updated version string to 1.2. (We were already
+	writing using the 1.2 standard but claiming 1.1) 
+
+	* srf/srf.c:
+	(10:12:04) Bug fix when using glibc: added explicit include of
+	io_lib_config.h prior to stdio.h so the AC_SYS_LARGEFILE autoconf
+	magic does its tricks. This is only required for glibc, which
+	appears broken by default as it doesn't contain a prototype for
+	fseeko despite exporting the system, unless explicit macros are
+	defined. 
+
+2007-11-02  James Bonfield  <jkb@sanger.ac.uk>
+
+	* progs/solexa2srf.c:
+	(13:57:30) Improved handling of out-of-range data. Specifically
+	what happens when the minimum value in a trace is -40000 and the
+	maximum value is +50000. We now clip -ve values if the range
+	doesn't fit. 
+
+	* ztr/ztr_translate.c:
+	(13:59:41) Added SMP4 'OFFS' metadata and Read->baseline support
+	when converting from read2ztr. 
+
+2007-11-01  James Bonfield  <jkb@sanger.ac.uk>
+
+	* srf/srf.c:
+	(14:24:30) More error checking paranoia in SRF support; given that
+	fwrite() can sometimes claim success even when it failed we now
+	explicitly call ferror and check fclose() return. 
+
+	* ztr/FORMAT,
+	* ztr/ztr.c,
+	* ztr/ztr.h,
+	* ztr/ztr_translate.c:
+	(14:26:02) Better support for ZTR v1.2. We now correctly handle
+	SAMP/SMP4 metadata fields and make use of OFFS when converting to
+	Read. 
+
+	* progs/solexa2srf.c,
+	* progs/srf_dump_all.c:
+	(14:26:35) Improved support for ztr OFFS metadata and removed the
+	old crufty SHIFT_BY #define. 
+
+	* progs/solexa2srf.c:
+	(17:35:58) Bug fix: we were missing the trailing nul of the trace
+	OFFS metadata value.
+	
+	Also the setting of min_val when the range is too high was invalid.
+	Note further work is needed here as we've already truncated to
+	16-bit making it impossible to tell where the wraparound occurs. 
+
+	* ztr/ztr.c,
+	* ztr/ztr_translate.c:
+	(18:00:55) Fixed memory leaks. 
+
+2007-10-26  James Bonfield  <jkb@sanger.ac.uk>
+
+	* progs/Makefile.am,
+	* progs/srf2fastq.c:
+	(10:35:56) Added srf2fastq conversion to demonstrate usage of
+	read_sections() and as a benchmark for pure sequence+quality
+	extraction. (It appears to cope at about 100,000 sequences/second.) 
+
+	* ztr/deflate_interlaced.c,
+	* ztr/deflate_interlaced.h:
+	(10:38:04) Changed generate_code_set and huffman_codeset_destroy to
+	keep the same huffman_codeset_t structure for all uses of one of
+	the predetermined CODE_* codesets. 
+
+	* ztr/ztr_translate.c:
+	(10:40:37) ztr2read() now honours the read_sections() setting. To
+	do this it also means it uncompresses data on the fly, but only for
+	chunk types that it needs to. Hence this code no longer needs
+	uncompress_ztr() calling first either. 
+
+	* srf/srf.c,
+	* srf/srf.h:
+	(10:46:07) Moved some static local variables out of srf_next_ztr
+	into the srf_t object. This means the code should be
+	multi-threaded. 
+
+	* ztr/FORMAT:
+	(10:47:07) Current v1.3 draft 
+
+	* ztr/Attic/deflate_simple.c,
+	* ztr/Attic/deflate_simple.h:
+	(10:50:32) Replaced by deflate_interlaced.[ch] some time ago. 
+
+	* progs/srf2solexa.c:
+	(11:35:59) Switched to using srf_next_ztr() in order to avoid
+	repeated huffman codeset decoding. Now much faster. 
+
+	* CHANGES:
+	(14:28:27) *** empty log message *** 
+
+	* README,
+	* configure.in:
+	(14:31:48) *** empty log message *** 
+
+2007-10-25  James Bonfield  <jkb@sanger.ac.uk>
+
+	* progs/srf_dump_all.c,
+	* progs/srf_extract_linear.c,
+	* srf/srf.c,
+	* srf/srf.h,
+	* ztr/compression.c,
+	* ztr/deflate_interlaced.c,
+	* ztr/deflate_interlaced.h,
+	* ztr/ztr.c,
+	* ztr/ztr.h:
+	(14:21:16) Upgraded SRF to support v1.2 specification. NOTE: No
+	support is kept for v1.1!
+	
+	Dramatically improved the speed of sequential decoding (eg in
+	srf_dump_all) by use of caching huffman_codeset_t structs. 
+
+	* progs/srf_dump_all.c:
+	(16:55:24) Added unused (#if-ed out) printf variant. It's for
+	possible efficiency gains, but ignoring for now. 
+
+	* ztr/compression.c,
+	* ztr/deflate_interlaced.c:
+	(16:56:06) Fixed unsthuff uncompression for the predfined CODE_*
+	huffman trees. 
+
+2007-10-17  James Bonfield  <jkb@sanger.ac.uk>
+
+	* progs/solexa2srf.c:
+	(16:56:11) Dropped ZLIB compression of BPOS as A) it's tiny anyway
+	and B) we don't want to waste time compressing it over and over
+	again. (TODO: actually we don't need to encode it over and over
+	again either.) 
+
+===============================================================================
+2007-10-16  James Bonfield  <jkb@sanger.ac.uk>
+
+	* progs/solexa2srf.c,
+	* srf/srf.c,
+	* ztr/compression.c,
+	* ztr/deflate_interlaced.c,
+	* ztr/deflate_interlaced.h,
+	* ztr/ztr.c:
+	* ztr/ztr.h:
+	(08:36:06) Improvements to speed following code profiling. 
+
+	* progs/solexa2srf.c:
+	(16:49:38) Major overhaul of parsing code. We now roll our own
+	specialist parser instead of using strtok and sscanf. This has
+	approximately doubled the speed (so maybe 4-5x faster in the
+	parsing component). 
+
+	* configure.in:
+	(16:52:06) Boost version to 1.11.0b3 
+
+2007-10-11  James Bonfield  <jkb@sanger.ac.uk>
+
+	* ztr/deflate_interlaced.c:
+	(13:34:48) Fixed a buffer overrun. 
+
+	* ztr/compression.c:
+	(13:35:59) Removed a small memory leak and improved initialisation
+	in tshift to avoid (harmless) valgrind error. 
+
+	* progs/srf2solexa.c,
+	* progs/srf_dump_all.c,
+	* srf/srf.c:
+	(13:37:29) Removed memory leaks. 
+
+2007-10-02  James Bonfield  <jkb@sanger.ac.uk>
+
+	* README,
+	* ztr/FORMAT:
+	(08:55:47) Minor doc updates 
+
+	* read/Makefile.am:
+	(08:57:02) Fixed src vs srf typo. 
+
+	* README:
+	(08:58:09) Version change 
+
+	* configure.in:
+	(08:59:11) Version change 
+
+2007-09-28  James Bonfield  <jkb@sanger.ac.uk>
+
+	* Makefile.am,
+	* configure.in,
+	* progs/Makefile.am,
+	* progs/solexa2srf.c,
+	* progs/srf2solexa.c,
+	* progs/srf_dump_all.c:
+	(11:07:15) File Edit Options Buffers Tools Help Version 1.11.0b1
+	
+	Added preliminary SRF support. This consists of a new subdirectory
+	'srf' (yes these all really need merging into a single directory,
+	but that's a later task), a substantial update to ZTR and a variety
+	of SRF tools in progs.
+	
+	The old huffman_static.[ch] files were renamed and substantially
+	worked upon to create deflate_interlaced.[ch].
+	
+	Added new compression types. xrle2, tshift and qshift. The latter
+	two of these are very specific to trace and quality packings. May
+	need to rename to be more generic. 
+
+	* progs/srf_extract_linear.c,
+	* progs/srf_index_hash.c,
+	* progs/ztr_dump.c,
+	* read/Makefile.am,
+	* srf/srf.c,
+	* srf/srf.h,
+	* ztr/compression.c,
+	* ztr/compression.h,
+	* ztr/deflate_interlaced.c,
+	* ztr/deflate_interlaced.h,
+	* ztr/Attic/huffman_static.c,
+	* ztr/Attic/huffman_static.h,
+	* ztr/ztr.c,
+	* ztr/ztr.h:
+	(11:07:16) File Edit Options Buffers Tools Help Version 1.11.0b1
+	
+	Added preliminary SRF support. This consists of a new subdirectory
+	'srf' (yes these all really need merging into a single directory,
+	but that's a later task), a substantial update to ZTR and a variety
+	of SRF tools in progs.
+	
+	The old huffman_static.[ch] files were renamed and substantially
+	worked upon to create deflate_interlaced.[ch].
+	
+	Added new compression types. xrle2, tshift and qshift. The latter
+	two of these are very specific to trace and quality packings. May
+	need to rename to be more generic. 
+
+	* ztr/compression.c:
+	(15:28:12) Fixed a bug in run length encoding XRLE2 format when
+	dealing with very long repeat runs. 
+
+	* ztr/FORMAT-1.2:
+	(15:34:26) Fixed error in XRLE description. 
+
+	* ztr/FORMAT:
+	(15:34:41) Further updates documenting version 1.3 changes 
+
+2007-09-03  James Bonfield  <jkb@sanger.ac.uk>
+
+	* ztr/Attic/deflate_simple.c,
+	* ztr/Attic/deflate_simple.h:
+	(11:11:12) Mostly a rename from huffman_static to deflate_simple,
+	but also a large overhaul and redesign. This code implements the
+	huffman component of the Deflate algorithm. 
+
+	* ztr/compression.c,
+	* ztr/compression.h,
+	* ztr/ztr.c,
+	* ztr/ztr.h:
+	(11:12:16) Updates to deal with the change from huffman_static to
+	deflate_simple. 
+
+	* Makefile:
+	* Makefile.am,
+	* read/Makefile.am:
+	* progs/ztr_dump.c:
+	(11:35:50) Update for rename of huffman_static.h to
+	deflate_simple.h 
+
+2007-08-15  James Bonfield  <jkb@sanger.ac.uk>
+
+	* ztr/compression.c,
+	* ztr/Attic/huffman_static.c,
+	* ztr/Attic/huffman_static.h:
+	(15:30:04) Major overhaul of huffman_static.c.
+	
+	It's been substantially tuned for speed and also has several bug
+	fixes to ensure we have a consistent sort function before applying
+	the canonical_codes function (which previously meant differing
+	qsort implementations would give different codes). 
+
+	* ztr/FORMAT-1.2:
+	(15:31:58) Created a snapshot of FORMAT for ZTR v1.2 only 
+
+2007-07-16  James Bonfield  <jkb@sanger.ac.uk>
+
+	* acinclude.m4,
+	* configure.in:
+	(08:03:42) Updated configure.in to support --with-lib=DIR. 
+
+	* utils/files.c:
+	(08:05:23) Switched from using tempnam() to tmpfile(). This meant
+	recreating tmpfile() wrapper on MS Windows to avoid bugs with it
+	always attempting to write to the root directory, regardless of
+	user privs. 
+
+	* utils/open_trace_file.c,
+	* utils/os.h:
+	(08:05:24) Switched from using tempnam() to tmpfile(). This meant
+	recreating tmpfile() wrapper on MS Windows to avoid bugs with it
+	always attempting to write to the root directory, regardless of
+	user privs. 
+
+	* progs/hash_extract.c:
+	(09:01:39) Fixed bug on windows: we now set stdout to be binary
+	mode first. 
+
+	* utils/open_trace_file.c:
+	(09:02:51) INCOMPATIBLE CHANGE: On windows we now use semi-colon as
+	the path separator. The reason is that with the MinGW getenv()
+	seems to do "clever things" with PATH variables and consequently
+	ends up corrupting our clumsy attempt of escaping colons in paths. 
+
+2007-07-11  James Bonfield  <jkb@sanger.ac.uk>
+
+	* Makefile,
+	* Makefile.am,
+	* read/Makefile.am,
+	* utils/hash_table.c,
+	* utils/hash_table.h,
+	* utils/jenkins_lookup3.c,
+	* utils/jenkins_lookup3.h:
+	(13:57:26) Added Bob Jenkins' lookup3.c code to the hash_table
+	support. It also now uses this for 64-bit hashing. 
+
+2007-07-06  James Bonfield  <jkb@sanger.ac.uk>
+
+	* ztr/Attic/huffman_static.c:
+	(09:06:46) Bug fix to last commit - finish adding the CODE_ENGLISH
+	and removal of other code sets. 
+
+2007-07-05  James Bonfield  <jkb@sanger.ac.uk>
+
+	* plain/seqIOPlain.c:
+	(08:27:43) For FASTA format files we now, eventually, read the
+	first sequence. 
+
+	* ztr/FORMAT,
+	* ztr/Attic/huffman_static.c,
+	* ztr/Attic/huffman_static.h,
+	* ztr/ztr.c,
+	* ztr/ztr.h:
+	(08:28:30) Work-in-progress update to support HUFF chunks and
+	STHUFF (static huffman) compression methods. 
+
+	* progs/ztr_dump.c:
+	(08:29:15) Updated to support the new static-huffman compression
+	method. 
+
+	* ztr/Attic/huffman_static.c,
+	* ztr/Attic/huffman_static.h:
+	(10:45:48) Removed potentially variable huffman trees (solexa
+	trace, confidence values) and added an english text tree. This was
+	based on War of the Worlds, The Gold Bug, 200000 Leagues Under the
+	Sea and the "man ascii" unix manual page for a bit of variety. It
+	also includes the SYM_ANY escape code for handling out-of-band
+	data. 
+
+===============================================================================
+2007-05-30  James Bonfield  <jkb@sanger.ac.uk>
+
+	* progs/extract_seq.c:
+	(11:10:59) Fixed usage string (added -ztr). 
+
+	* io_lib-config.in:
+	(11:11:26) Added explicit @LIBZ@ to --libs. 
+
+	* progs/hash_sff.c:
+	(11:12:07) Fixed FILE handling bug. 
+
+	* ztr/ztr.c:
+	(11:13:07) Maded entropy() static to avoid clash with ztr_dump.c 
+
+	* CHANGES,
+	* README,
+	* configure.in:
+	(11:34:53) Updated to version 1.10.2 
+
+2007-04-19  James Bonfield  <jkb@sanger.ac.uk>
+
+	* utils/hash_table.c:
+	(16:18:19) Fixed a memory leak and also changed to use off_t
+	instead of long for file offsets. 
+
+	* ztr/Attic/huffman_static.c:
+	* ztr/Attic/huffman_static.h:
+	* ztr/ztr.c:
+	* ztr/ztr.h:
+	* Makefile:
+	* Makefile.am:
+	* read/Makefile.am:
+	(16:21:59) Added HUFFMAN_STATIC ZTR compression method. 
+
+	* configure.in:
+	* abi/fpoint.h:
+	* abi/seqIOABI.h:
+	* ctf/seqIOCTF.h,
+	* exp_file/expFileIO.h:
+	* progs/convert_trace.c,
+	* progs/extract_fastq.c:
+	* progs/extract_seq.c:
+	* progs/hash_sff.c,
+	* progs/makeSCF.c:
+	* progs/ztr_dump.c:
+	* read/Read.h:
+	* read/scf_extras.h:
+	* read/translate.h:
+	* scf/scf.h:
+	* sff/sff.h:
+	* utils/array.h:
+	* utils/compress.h:
+	* utils/error.h:
+	* utils/hash_table.h:
+	* utils/mFILE.h:
+	* utils/mach-io.h:
+	* utils/misc.h:
+	* utils/open_trace_file.h:
+	* utils/os.h:
+	* utils/stdio_hack.h:
+	* utils/tar_format.h:
+	* utils/traceType.h:
+	* utils/vlen.h:
+	* utils/xalloc.h:
+	* ztr/compression.h:
+	(16:30:14) Added extern "C" {...} guards around all header files to
+	ease use from within C++ source. 
+
+2006-08-07  James Bonfield  <jkb@sanger.ac.uk>
+
+	* progs/convert_trace.c:
+	(14:12:39) Added -signed and -noneg options to perform shifting of
+	trace data to avoid the unsigned issues for TRACE. 
+
+2006-07-18  James Bonfield  <jkb@sanger.ac.uk>
+
+	* utils/traceType.c:
+	(13:44:13) Added support for anytr in str2int and int2str
+	conversions. 
+
+2006-07-06  James Bonfield  <jkb@sanger.ac.uk>
+
+	* progs/hash_exp.c:
+	(08:45:18) Use binary mode, for windows. 
+
+	* progs/hash_exp.c:
+	(09:20:20) Remove control-M from end of line when indexing ID
+	lines. 
+
+	* progs/hash_exp.c:
+	(09:22:52) Oops; removal of debugging info 
+
+2006-07-05  James Bonfield  <jkb@sanger.ac.uk>
+
+	* Makefile,
+	* dependencies:
+	(15:45:01) Fixed dependency generation for io_lib 
+
+2006-07-04  James Bonfield  <jkb@sanger.ac.uk>
+
+	* utils/mFILE.c,
+	* utils/mFILE.h:
+	(13:43:28) Added mfcreate_from(). It has a usage syntax identical
+	to mfreopen(), but unlike mfreopen() it doesn't do anything with
+	the file pointer (neither closing ie or remembering it in the
+	structure). 
+
+	* progs/extract_fastq.c:
+	(16:19:30) Pathname hacking and listed -ztr on command line. 
+
+	* progs/extract_seq.c,
+	* progs/makeSCF.c:
+	(16:20:17) Added -ztr as a command line option. 
+
+	* progs/hash_exp.c:
+	(16:21:14) Hash_exp now outputs to the same file containing the
+	experiment files (in appended hash-table mode). 
+
+	* progs/hash_extract.c:
+	(16:21:53) Bug fix: now only needs at least 1 filename specified
+	when fofn mode is not in use. 
+
+	* progs/hash_list.c:
+	(16:22:40) error detection and protection 
+
+2006-06-27  James Bonfield  <jkb@sanger.ac.uk>
+
+	* utils/mFILE.c:
+	(11:16:21) Bug fix to the previous change: mstdin(), mstdout() and
+	mstderr() now correctly mark their streams and read and write
+	capable. 
+
+	* utils/mFILE.c,
+	* utils/mFILE.h:
+	(15:48:15) Added mfdetach() to allow the file pointer to be closed
+	without deallocating the mFILE structure.
+	
+	Also removed the mFILE->fname component and replaced uses with
+	checks to mode & MF_WRITE. 
+
+	* utils/mFILE.c,
+	* utils/mFILE.h:
+	(15:58:52) Corrected duff spelling! 
+
+2006-06-26  James Bonfield  <jkb@sanger.ac.uk>
+
+	* utils/mFILE.c,
+	* utils/mFILE.h:
+	(16:47:30) Fixed a bug in mfflush whereby it could attempt to write
+	HUGE amounts of data (-ve size) when files are truncated before
+	flushing; it now fseeks before doing the write and checks if the
+	size is +ve.
+	
+	Also fixed mfwrite to correctly reset the flush_pos record.
+	
+	Added a mode field to the mFILE structure so we can keep track of
+	append and read-only flags. These are checked for in the mfwrite
+	function so mfwrite now writes to the correct location when append
+	mode is used (ie forced to the end of file) and it now returns 0
+	when attempting to write to a read-only mFILE. 
+
+===============================================================================
+2006-06-20  awhitwham  <awhitwham@sanger.ac.uk>
+
+	* utils/open_trace_file.c:
+	(11:37:24) Changed to open trace files as read only 
+
+	* configure.in:
+	(13:42:57) Updated to version 1.10.1 
+
+2006-06-15  James Bonfield  <jkb@sanger.ac.uk>
+
+	* io_lib.m4:
+	(10:58:46) First working(?) version; testing on the Internal Trace
+	Server. 
+
+	* io_lib.m4:
+	(11:18:39) bug fix IO_LIB_CPPFLAGS & IO_LIB_LDFLAGS initialisation" 
+
+	* Makefile.am:
+	(11:25:57) Added io_lib-config to install scripts 
+
+	* progs/Makefile.am:
+	(11:26:28) Added LIBCURL flags 
+
+	* read/Makefile.am:
+	(11:26:54) Added LIBCURL_CPPFLAGS usage. 
+
+	* CHANGES:
+	(15:40:12) *** empty log message *** 
+
+	* progs/Makefile.am:
+	(15:40:28) Added ztr_dump to the list of progs. 
+
+	* progs/ztr_dump.c:
+	(15:41:05) Support for log2 format. 
+
+	* ztr/compression.c,
+	* ztr/compression.h,
+	* ztr/ztr.c:
+	(15:42:06) Added a ZTR_FORM_LOG2 compression technique. It's an
+	experimental lossy compression and is turned off right now; the
+	space saving was only about 10% and if we go lossy I want big
+	changes not small ones. 
+
+	* ztr/ztr.h:
+	(15:42:07) Added a ZTR_FORM_LOG2 compression technique. It's an
+	experimental lossy compression and is turned off right now; the
+	space saving was only about 10% and if we go lossy I want big
+	changes not small ones. 
+
+	* README:
+	(15:43:46) *** empty log message *** 
+
+2006-06-14  James Bonfield  <jkb@sanger.ac.uk>
+
+	* progs/convert_trace.c:
+	(08:53:43) Added a -error option to request stderr goes to a file
+	instead of stderr. (from Saul Kravitz) 
+
+	* scf/misc_scf.c,
+	* scf/read_scf.c,
+	* scf/write_scf.c:
+	(08:58:12) Renamed delta_samples[12] to be scf_delta_samples[12].
+	(patch supplied by Saul Kravitz) 
+
+	* scf/scf.h:
+	(08:58:29) Renamed delta_samples[12] to be scf_delta_samples[12].
+	(patch supplied by Saul Kravitz) 
+
+	* utils/open_trace_file.c:
+	(08:58:55) Comment update 
+
+	* utils/open_trace_file.c:
+	* Makefile:
+	(16:28:29) Renamed USE_LIBCURL to be HAVE_LIBCURL to make it
+	compatible with autoconf. 
+
+	* bootstrap:
+	(16:28:56) Added removal of io_lib-config 
+
+	* acinclude.m4,
+	* configure.in:
+	(16:29:55) Added libcurl checking code (in acinclude.m4). 
+
+	* io_lib-config.in:
+	(16:31:18) New io_lib-config program to query the compile and link
+	parameters needed when using io_lib. 
+
+	* io_lib.m4:
+	(16:46:32) Initial draft (unchecked) of autoconf macros for use by
+	packages (in configure.in) that want to make use of io_lib. 
+
+2006-06-13  James Bonfield  <jkb@sanger.ac.uk>
+
+	* progs/Makefile:
+	(11:50:47) Added ZLIB_INC include path. 
+
+2006-06-09  James Bonfield  <jkb@sanger.ac.uk>
+
+	* utils/open_trace_file.c:
+	(08:53:24) Somewhere along the line I managed to break the most
+	common of all search mechanisms; local filenames on disk! Fixed
+	find_file_dir(). 
+
+2006-06-08  James Bonfield  <jkb@sanger.ac.uk>
+
+	* Makefile,
+	* utils/open_trace_file.c:
+	(13:21:59) Added libcurl support and made this the default instead
+	of using WGET for URL based accesses. Fixed a bug in the old wget
+	code also though involving handling of zero-sized replies.
+	
+	Removed the compressed file extension iteration code in
+	find_file_dir as it's now included in the master open_trace_file
+	function instead (and so was yielding stats on fubar.scf.gz.bz2 and
+	similar). It's also now possible to turn off the compressed file
+	extension iteration code by prefixing a search path element with a
+	"|" symbol.
+	
+	Replaced RAWDATA environment with EXP_PATH and TRACE_PATH. These
+	default back to RAWDATA when not defined. Created new functions
+	named open_exp_file and open_exp_mfile which use EXP_PATH instead
+	of TRACE_PATH. These allow for experiment files and trace files to
+	share the same names (as is the case in external "trace servers")
+	but use different accessor routes to return the data. 
+
+	* utils/open_trace_file.h:
+	(13:22:40) New prototypes or the open_exp_{file,mfile} code and
+	iolib_[sg]et_{trace,exp}_path calls. 
+
+	* progs/Makefile,
+	* progs/hash_exp.c:
+	(13:25:15) New program hash_exp. This allows for multiple
+	experiment files to be concatenated together instead a single
+	multi-sequence file and then be indexed (using hash_exp) to allow
+	for a HASH=... EXP_PATH element to extract the data back out again. 
+
+	* progs/convert_trace.c,
+	* progs/extract_seq.c,
+	* read/Read.c,
+	* read/Read.h,
+	* read/scf_extras.c,
+	* read/translate.c:
+	(13:28:29) Make use of open_exp_mfile instead of open_trace_mfile
+	when we know we've explicitly requested a file in EXP format. This
+	ensures we'll use the correct search path where appropriate.
+	
+	Also defined an ANYTR trace format which is identical to the old
+	ANY format except that it excludes EXP and PLN (ie "ANY TRace").
+	Again this is used internally to ensure we pick the correct search
+	path when dealing with fetching traces and/or experiment files. 
+
+	* utils/mFILE.c:
+	(13:29:23) Fixed a bug in mfseek and mrewind. Both now clear the
+	EOF flag. 
+
+	* utils/traceType.c:
+	(13:33:16) Bug fix to fdetermine_trace_type: now rewinds back. 
+
+	* Makefile:
+	(15:21:02) Fixed the include/.links target (added sff) 
+
+	* progs/Makefile,
+	* progs/extract_fastq.c:
+	(15:22:24) Added extract_fastq program. 
+
+2006-05-30  James Bonfield  <jkb@sanger.ac.uk>
+
+	* ztr/compression.c:
+	(08:46:57) Fixed a bug in xrle(); it now correctly handles runs of
+	256 or more. 
+
+2006-04-12  James Bonfield  <jkb@sanger.ac.uk>
+
+	* read/Read.c:
+	(10:53:27) Changed various fwrite_* functions to not close the FILE
+	pointer given to them. 
+
+2006-02-28  James Bonfield  <jkb@sanger.ac.uk>
+
+	* ztr/compression.c:
+	(17:10:36) Fixed bug reading past memory in xrle(). (Thanks to
+	Kathryn Beal for identifying this.) 
+
+2006-02-27  James Bonfield  <jkb@sanger.ac.uk>
+
+	* ztr/ztr.c,
+	* ztr/ztr.h:
+	(14:40:06) Removed static from compress_chunk and uncompress_chunk.
+	Added prototypes to ztr.h. 
+
+2006-02-23  James Bonfield  <jkb@sanger.ac.uk>
+
+	* utils/read_alloc.c:
+	(15:08:36) Fixed a bug in read_dup and not initialising read->info. 
+
+	* utils/read_alloc.c:
+	(16:00:44) Fixed typo. 
+
+2006-02-20  James Bonfield  <jkb@sanger.ac.uk>
+
+	* utils/hash_table.c:
+	(12:16:50) Allow HashTableAdd to take a non-string for the key. 
+
+2006-01-26  James Bonfield  <jkb@sanger.ac.uk>
+
+	* utils/hash_table.c,
+	* utils/hash_table.h:
+	(09:37:02) Fixed HashTableAdd with non-string keys and without
+	HASH_NONVOLATILE_KEYS defined. It used strdup, but now allocates
+	and memcpys.
+	
+	Added HashTableDel and HashTableRemove functions. HashTableDel
+	removes and destroys a specified HashItem. HashTableRemove removes
+	and destroys all items attached to a given key. 
+
+===============================================================================
+2005-12-14  James Bonfield  <jkb@sanger.ac.uk>
+
+	* CHANGES,
+	* README,
+	* configure.in:
+	(14:35:00) Update for 1.9.2 
+
+2005-12-09  James Bonfield  <jkb@sanger.ac.uk>
+
+	* configure.in:
+	(17:32:31) Added AC_CHECK_LIB calls for nsl and socket
+	(gethostbyname and socket). Needed for Solaris compilations. 
+
+2005-11-16  James Bonfield  <jkb@sanger.ac.uk>
+
+	* progs/extract_seq.c:
+	(14:14:16) Used open_trace_mfile instead of open_trace_file to
+	avoid the need for temporary files and hence speeds this up. 
+
+	* read/Read.c:
+	(14:23:23) fwrite_reading now frees the temporary mFILE it created. 
+
+	* read/Read.h,
+	* read/translate.c:
+	(14:45:41) Added private_data and private_size to the Read
+	structure & populate from SCF. 
+
+	* utils/compress.c:
+	(14:48:51) mfreopen_compressed no longer closes the original FILE*.
+	This makes it backwards compatible once more with the original
+	version and also cures a bug whereby the old file pointer was often
+	left open, leading to running out of file descriptors. 
+
+	* utils/mFILE.c:
+	(15:05:51) Fixed uninitialised check when filename was specified
+	but not found in mfload. 
+
+	* utils/read_alloc.c:
+	(15:17:01) Added private_data to read struct 
+
+2005-11-10  James Bonfield  <jkb@sanger.ac.uk>
+
+	* progs/hash_extract.c:
+	(11:32:06) Now returns an error code (to the calling process) if it
+	failed to extract a sequence. 
+
+	* utils/hash_table.c:
+	(11:33:07) Fixed problem in hashquery when searching for something
+	that has a hash key not present (ie empty hash bucket). 
+
+===============================================================================
+2005-10-27  James Bonfield  <jkb@sanger.ac.uk>
+
+	* utils/mFILE.c:
+	(15:46:45) Fixed hang in mfload when given zero length files. 
+
+2005-10-25  James Bonfield  <jkb@sanger.ac.uk>
+
+	* read/translate.c:
+	(08:20:26) NDEBUG checks 
+
+2005-10-21  James Bonfield  <jkb@sanger.ac.uk>
+
+	* bootstrap:
+	(09:15:23) Removed more auto-generated files. 
+
+	* configure.in,
+	* progs/Makefile.am:
+	(09:16:43) Further removal of libtool specific bits (AC_CHECK_LIB). 
+
+	* Makefile:
+	(16:03:35) Fixed bug with IOLIB_ZTR vs IOLIB_SFF macro. 
+
+	* Makefile.am,
+	* bootstrap,
+	* configure.in,
+	* read/Read.h,
+	* utils/compress.c:
+	(16:04:48) Replaced automake's generated config.h file
+	io_lib_config and allow for it to be installed with "make install". 
+
+	* progs/Makefile.am:
+	(16:05:19) Added append_sff to the targets. 
+
+	* read/translate.c:
+	(16:05:42) Disabled asserts 
+
+	* utils/mFILE.c:
+	(16:06:25) Fixed bug in mfgetc when dealing with 8-bit data. It
+	always now returns unsigned values except when EOF 
+
+	* utils/open_trace_file.c:
+	(16:07:20) Updated TAR magic number to be just the 5 first bytes as
+	the 6th differs between systems (space vs nul). 
+
+2005-10-20  James Bonfield  <jkb@sanger.ac.uk>
+
+	* sff/sff.c:
+	(13:31:22) Split the read functions into read & decode functions so
+	that we can unpack SFF structs from other sources. 
+
+	* progs/Makefile,
+	* progs/append_sff.c:
+	(13:31:58) Added an append_sff.c program, to combine multiple SFF
+	archives into a single archive. 
+
+2005-10-18  James Bonfield  <jkb@sanger.ac.uk>
+
+	* progs/convert_trace.c:
+	(16:41:44) Modified to check RAWDATA search path when loading
+	traces. 
+
+	* progs/hash_sff.c:
+	(16:42:58) Major overhaul to not load the entire SFF file into
+	memory. It also handles copying the SFF file to a new file and
+	adding an index to an SFF archive that already has an index. 
+
+	* sff/sff.c,
+	* sff/sff.h:
+	(16:44:31) Restructured read functions to load & decode functions
+	so we can decode SFF data blocks obtained via other means (eg as
+	used in the indexing code). 
+
+	* utils/open_trace_file.c:
+	(16:45:42) Added SFF "sorted index" code, based on 454's getsff.c
+	implementation. Also restructured the SFF querying code a bit so
+	that it caches this data. 
+
+2005-10-14  James Bonfield  <jkb@sanger.ac.uk>
+
+	* CHANGES:
+	(16:07:36) *** empty log message *** 
+
+	* exp_file/expFileIO.c:
+	(16:08:32) Renamed _MSV_VER to _WIN32 so that the binary/ascii
+	conversions for experiment file IO works once more under Windows. 
+
+	* progs/Makefile,
+	* progs/Makefile.am,
+	* progs/hash_sff.c:
+	(16:09:08) Added hash_sff program. This adds a .hsh format index to
+	the SFF container. 
+
+	* sff/sff.c,
+	* sff/sff.h:
+	(16:10:10) A total rewrite of the SFF code due to the recent
+	changes in file format. This code handles access of a *single* SFF
+	entry. The code to manipulate multi-file SFF (ie the container) is
+	in open_trace_file.c. 
+
+	* utils/hash_table.c,
+	* utils/hash_table.h:
+	(16:11:33) HashFileSave now returns the length of the saved hash.
+	
+	HashFileFopen now sets afp by default to be the same as hfp. Extra
+	checking has been added when closing these file pointers to ensure
+	we don't close twice if they point to the same FILE*. 
+
+	* utils/mFILE.c,
+	* utils/mFILE.h:
+	(16:12:58) Added an mfascii() function. This allows for changing
+	from binary to ascii after a file has been opened. It should be
+	called in place of where the windows-specific _set_mode() function
+	would be used.
+	
+	There is currently no analagous ascii-to-binary conversion, but I
+	have not yet found a need for it either. 
+
+	* utils/mach-io.c,
+	* utils/mach-io.h:
+	(16:13:29) Added [bl]e_{read,write}_int_8 functions for use with
+	8-byte data types found in SFF. 
+
+	* utils/open_trace_file.c:
+	(16:14:55) Added a SFF= format for the RAWDATA search path. This
+	handles the SFF container in much the same way that TAR= and HASH=
+	works.
+	
+	Also for all three of these types you can now do archive/entry
+	instead. Eg "extract_seq traces.tar/xyz.ztr" will work and it'll
+	even look for traces.tar in RAWDATA if required. 
+
+	* utils/os.h:
+	(16:15:19) Added a uint1 typedef for completeness. 
+
+	* Makefile.am,
+	* read/Makefile.am:
+	(16:16:06) Makefile support for new sff.c files. 
+
+	* dependencies:
+	(16:16:23) *** empty log message *** 
+
+	* configure.in:
+	(16:16:43) Updated to version 1.9.1. 
+
+2005-10-04  James Bonfield  <jkb@sanger.ac.uk>
+
+	* Makefile:
+	(08:54:30) Added sff to make distsrc 
+
+	* utils/hash_table.c:
+	(11:34:03) Cast ptrdiff_t value to int for %.*s argument. 
+
+2005-09-29  James Bonfield  <jkb@sanger.ac.uk>
+
+	* utils/hash_table.c,
+	* utils/hash_table.h:
+	(16:04:06) Fixed the hash file saving and loading so that it works
+	on all platforms instead of just x86 linux. There were bugs in
+	assuming the size of structures. The assumptions are still there in
+	that I assume they pad the same internally (for ease of coding - we
+	can change it when we finally see a system which operates
+	differently), but the final "boundary" padding has been resolved. 
+
+2005-09-28  James Bonfield  <jkb@sanger.ac.uk>
+
+	* progs/hash_list.c:
+	(10:16:49) *** empty log message *** 
+
+2005-09-19  James Bonfield  <jkb@sanger.ac.uk>
+
+	* utils/compress.c:
+	(13:58:02) Fixed a file descriptor (and some memory) leak in
+	freopen_compressed. (Bug ID 1289095) 
+
+2005-09-08  James Bonfield  <jkb@sanger.ac.uk>
+
+	* ztr/ztr.c,
+	* ztr/ztr_translate.c:
+	(11:29:06) Don't try to compress SAMP chunks with meta-data PYRW as
+	the raw pyrosequencing data from 454 doesn't compress. 
+
+	* progs/Makefile,
+	* progs/hash_tar.c,
+	* utils/Hash_File_Format,
+	* utils/hash_table.c,
+	* utils/hash_table.h:
+	(11:30:56) Changed the HashFile format slightly. It's now format
+	1.00.
+	
+	The key difference is that it has a file footer pointing back to
+	the hashfile header (so the hashfile can be appended to an archive)
+	and it also has an offset in the header to apply to all seeks
+	within the archive itself, so it can be prepending to an archive
+	that's already been indexed without breaking the offsets.
+	
+	Extended the hash_tar program to allow control over these header
+	options. 
+
+2005-08-26  James Bonfield  <jkb@sanger.ac.uk>
+
+	* dependencies:
+	(08:24:32) Rebuilt 
+
+2005-08-25  James Bonfield  <jkb@sanger.ac.uk>
+
+	* progs/makeSCF.c,
+	* ztr/ztr.c:
+	(10:22:20) General code tidyup to prevent warnings. 
+
+2005-08-15  James Bonfield  <jkb@sanger.ac.uk>
+
+	* utils/hash_table.c:
+	(15:25:18) Fixed HashTableLoad so it correctly stores the HashTable
+	in the HashFile structure. It also now checks for the correct size
+	of file to load. 
+
+	* sff/sff.c,
+	* sff/sff.h:
+	(15:25:44) Added SFF (454 flowgram) file reading support. 
+
+2005-08-10  James Bonfield  <jkb@sanger.ac.uk>
+
+	* Makefile,
+	* README,
+	* options.mk:
+	(15:15:24) Added draft SFF format support. I need to verify if the
+	example data files I tested this with are correct or if the SFF
+	draft spec is correct (as they differ marginally in places). Hence
+	this format may change soon. 
+
+	* read/Read.c,
+	* read/Read.h,
+	* utils/traceType.c:
+	(15:15:25) Added draft SFF format support. I need to verify if the
+	example data files I tested this with are correct or if the SFF
+	draft spec is correct (as they differ marginally in places). Hence
+	this format may change soon. 
+
+	* progs/ztr_dump.c:
+	(15:16:31) Added (commented out) code for extra debugging. 
+
+	* progs/Makefile:
+	(15:16:48) Added hash_extract to the Makefile. 
+
+2005-07-22  James Bonfield  <jkb@sanger.ac.uk>
+
+	* utils/compress.c:
+	(15:52:07) Unset compression_used when opening uncompressed files
+	instead of leaving as the last value. 
+
+2005-07-15  James Bonfield  <jkb@sanger.ac.uk>
+
+	* read/Read.c:
+	(15:16:58) Removed file descriptor 'leak' in write_reading(). 
+
+2005-07-14  James Bonfield  <jkb@sanger.ac.uk>
+
+	* exp_file/expFileIO.c:
+	(13:53:45) Commenting only 
+
+	* read/Read.c,
+	* utils/mFILE.c:
+	(13:54:54) mfopen now honours binary verses ascii differences (and
+	so updated Read.c calls accordingly) so that Windows works better.
+	
+	Also improved append mode of opening. 
+
+2005-07-13  James Bonfield  <jkb@sanger.ac.uk>
+
+	* ztr/ztr.c:
+	(08:41:16) Removed the warning for unknown chunk types. It now just
+	silently stores them in memory. 
+
+2005-07-11  James Bonfield  <jkb@sanger.ac.uk>
+
+	* utils/mFILE.c:
+	(14:01:50) Fixed divide-by-zero buf when calling mfread for zero
+	bytes. 
+
+	* read/Read.c:
+	(16:07:38) Fixed IO_LIB_* macros to be IOLIB_* macros. 
+
+2005-07-07  James Bonfield  <jkb@sanger.ac.uk>
+
+	* Makefile.am:
+	* progs/Makefile.am:
+	(09:01:50) Removed libtool requirements. 
+
+	* configure.in:
+	(09:02:07) Removed use of libtool. 
+
+	* Attic/Makefile.in,
+	* abi/Attic/Makefile.in:
+	* alf/Attic/Makefile.in,
+	* ctf/Attic/Makefile.in:
+	* exp_file/Attic/Makefile.in,
+	* plain/Attic/Makefile.in:
+	* progs/Attic/Makefile.in,
+	* read/Attic/Makefile.in,
+	* scf/Attic/Makefile.in:
+	* utils/Attic/Makefile.in,
+	* ztr/Attic/Makefile.in:
+	* Attic/config.h.in:
+	* Attic/configure:
+	* Attic/depcomp,
+	* Attic/install-sh,
+	* Attic/ltmain.sh,
+	* Attic/missing:
+	* abi/Attic/Makefile.am,
+	* alf/Attic/Makefile.am,
+	* ctf/Attic/Makefile.am:
+	* exp_file/Attic/Makefile.am,
+	* plain/Attic/Makefile.am,
+	* scf/Attic/Makefile.am,
+	* utils/Attic/Makefile.am,
+	* ztr/Attic/Makefile.am:
+	(09:09:50) Removed as these have now been collapsed into the
+	read/Makefile.am. 
+
+	* README:
+	(09:10:19) *** empty log message *** 
+
+	* read/Makefile.am:
+	(09:12:18) Subsumed the other */Makefile.am files. 
+
+	* progs/hash_tar.c:
+	(09:12:48) On Windows, set stdout to be _O_BINARY. 
+
+	* read/Read.c:
+	(09:13:22) Fixed the _O_BINARY setting code on windows to check for
+	fp being valid and to use the mf->fp instead of fp. 
+
+	* utils/compress.c:
+	(09:15:30) Added checks for HAVE_SYS_WAIT_H for Windows handling. 
+
+	* utils/compress.c:
+	(09:20:04) Moved HAVE_ZLIB_H from compress.c and put in os.h (when
+	autoconf is not in use). 
+
+	* utils/hash_table.c:
+	(09:21:45) Changed bucket_pos from int64_t to int32_t (as was
+	intended) so it works on windows correctly. 
+
+	* utils/mFILE.c:
+	(09:22:50) Added more _O_BINARY checks for windows. 
+
+	* utils/open_trace_file.c:
+	(09:23:28) Added error checking in open_trace_file(). 
+
+	* bootstrap:
+	(10:28:38) Added to simplify initialisation of the autoconf system. 
+
+	* utils/os.h:
+	(10:34:54) Moved os.h from include to utils. 
+
+	* Makefile.am:
+	(10:49:17) Fixed missing backslash in pkginclude_HEADERS. 
+
+	* Attic/config.guess,
+	* Attic/config.sub,
+	* Attic/ltconfig,
+	* Attic/mkinstalldirs,
+	* Attic/stamp-h.in:
+	(10:55:09) Removed more auto-generated files from CVS tree. 
+
+	* read/Read.h:
+	(14:28:29) *** empty log message *** 
+
+2005-07-04  James Bonfield  <jkb@sanger.ac.uk>
+
+	* README:
+	(09:24:49) *** empty log message *** 
+
+	* CHANGES:
+	(09:24:50) *** empty log message *** 
+
+	* Makefile.am,
+	* progs/Makefile.am,
+	* read/Makefile.am,
+	* scf/Attic/Makefile.am,
+	* utils/Attic/Makefile.am:
+	(09:25:34) Adjusted EXTRA_DIST definitions to only include files we
+	still appear to have! 
+
+	* Attic/Makefile.in,
+	* progs/Attic/Makefile.in:
+	* read/Attic/Makefile.in,
+	* scf/Attic/Makefile.in,
+	* utils/Attic/Makefile.in:
+	* Attic/config.h.in,
+	* Attic/configure:
+	* configure.in:
+	(09:27:05) Updated to use newer AC_INIT syntax. 
+
+	* read/Read.c:
+	(10:21:50) Made the default output format ZTR. Do not compress
+	output (via gzip for example) if ZTR2 or ZTR3 is used. 
+
+	* utils/compress.c:
+	(10:25:19) If HAVE_ZLIB isn't defined then the memgzip/memgunzip
+	functions are now also not built (and hence removes compilation
+	errors).
+	
+	The pipe2 function now uses waitpid to avoid zombies. 
+
+	* utils/mFILE.c,
+	* utils/mFILE.h:
+	(10:29:41) Added mfrecreate() function to	change an existing
+	mFILE to point to new data. Better handling of append mode in
+	mfreopen. Fixed mf->fname such that it's now always a pointer to
+	malloced data. Added mfdestroy to deallocate memory, but without
+	flushing or closing file descriptors. Changed mfflush to write data
+	regardless of whether it's stdin/stdout. This means that
+	mfflush+mfdestroy can be used to close	 an mFILE without closing
+	the underlying FILE pointer used. Added mftruncate. Rewrote mfread
+	to do a single memcpy instead of   looped  memcpys. 
+
+===============================================================================
+2005-06-29  James Bonfield  <jkb@sanger.ac.uk>
+
+	* CHANGES,
+	* Makefile,
+	* README,
+	* dependencies:
+	(13:33:14) Version 1.9.0-test
+	
+	* Significant speed ups, particularly when dealing with reading	 
+	gzipped files or when extracting data from tar files.
+	
+	* New external functions for faster access via mFILE (memory-file) 
+	 structs. These mimic the fread/fwrite calls, but with
+	mfread/mfwrite	 etc.
+	
+	* Some functions previously available in external scope, but not  
+	defined in header files, have now been made internal only  
+	("static"). Please contact me if you were using these and have a  
+	burning need for them to remain external.
+	
+	* Numerous minor tweaks and updates to fix compiler warnings on
+	more   stricter modes of the Intel C Compiler.
+	
+	* Preliminary support for storing pyrosequencing style traces. This
+	  has been modeled on the flowgram data from 454, but should be	 
+	applicable to other platforms. ZTR has been updated to incorporate 
+	 this too.
+	
+	  The Read structure also has flow, flow_order, nflows and flow_raw
+	  elements too. Code to convert these into the more usual
+	traceA/C/G/T   arrays exists currently as part of Trev (in tk_utils
+	in the Staden	Package), but this may move into io_lib for the
+	next official	release.
+	
+	* New hash_tar and hash_extract programs. These replace the
+	index_tar   program for rast random access. For RAWDATA include
+	"HASH=hashfile"	  as an element to get io_lib to use the archive
+	hash. It's possible   to create hash files of most archive formats
+	as the hash itself   contains the offset and size of each item in
+	the archive. This means	  that extracting an item does not need to
+	know the format of the	 original archive.
+	
+	  Some benchmarks show that on ext3 it's actually faster to extract
+	  files from the hash than directly via the directory. This was	 
+	testing with ~200,000 files, whereupon directory lookups become	 
+	slow. I'd imagine ResierFS or similar to be faster.
+	
+	* Added an XRLE encoding for ZTR. This is similar to the existing
+	RLE   mechanism but it copes with run length encoding of items
+	larger than   a single byte. It's current use is for storing the
+	4-base repeating   flow order in 454 data.
+	
+	* Potential incompatibilities:
+	
+	  - The Exp_info structure now has an "mFILE *fp" member instead of
+	    "FILE *fp".
+	
+	  - As mentioned above, some functions are no longer external.
+	These	  include many ctf functions, ztr_(de)compress,	   
+	ztr_chunk_(read/write), be_read_*, be_write_*,
+	
+	  - The default search order for RAWDATA is that the current
+	directory     is searched after the rest of rawdata instead of
+	before.
+	
+	  - Removed support for the old unix "pack" program as a
+	compression	tool. 
+
+	* abi/abi.h,
+	* abi/fpoint.c,
+	* abi/seqIOABI.c,
+	* abi/seqIOABI.h,
+	* alf/alf.h,
+	* alf/seqIOALF.c,
+	* ctf/ctfCompress.c,
+	* ctf/seqIOCTF.c,
+	* ctf/seqIOCTF.h,
+	* exp_file/expFileIO.c,
+	* exp_file/expFileIO.h,
+	* plain/plain.h:
+	(13:33:32) Version 1.9.0-test
+	
+	* Significant speed ups, particularly when dealing with reading	 
+	gzipped files or when extracting data from tar files.
+	
+	* New external functions for faster access via mFILE (memory-file) 
+	 structs. These mimic the fread/fwrite calls, but with
+	mfread/mfwrite	 etc.
+	
+	* Some functions previously available in external scope, but not  
+	defined in header files, have now been made internal only  
+	("static"). Please contact me if you were using these and have a  
+	burning need for them to remain external.
+	
+	* Numerous minor tweaks and updates to fix compiler warnings on
+	more   stricter modes of the Intel C Compiler.
+	
+	* Preliminary support for storing pyrosequencing style traces. This
+	  has been modeled on the flowgram data from 454, but should be	 
+	applicable to other platforms. ZTR has been updated to incorporate 
+	 this too.
+	
+	  The Read structure also has flow, flow_order, nflows and flow_raw
+	  elements too. Code to convert these into the more usual
+	traceA/C/G/T   arrays exists currently as part of Trev (in tk_utils
+	in the Staden	Package), but this may move into io_lib for the
+	next official	release.
+	
+	* New hash_tar and hash_extract programs. These replace the
+	index_tar   program for rast random access. For RAWDATA include
+	"HASH=hashfile"	  as an element to get io_lib to use the archive
+	hash. It's possible   to create hash files of most archive formats
+	as the hash itself   contains the offset and size of each item in
+	the archive. This means	  that extracting an item does not need to
+	know the format of the	 original archive.
+	
+	  Some benchmarks show that on ext3 it's actually faster to extract
+	  files from the hash than directly via the directory. This was	 
+	testing with ~200,000 files, whereupon directory lookups become	 
+	slow. I'd imagine ResierFS or similar to be faster.
+	
+	* Added an XRLE encoding for ZTR. This is similar to the existing
+	RLE   mechanism but it copes with run length encoding of items
+	larger than   a single byte. It's current use is for storing the
+	4-base repeating   flow order in 454 data.
+	
+	* Potential incompatibilities:
+	
+	  - The Exp_info structure now has an "mFILE *fp" member instead of
+	    "FILE *fp".
+	
+	  - As mentioned above, some functions are no longer external.
+	These	  include many ctf functions, ztr_(de)compress,	   
+	ztr_chunk_(read/write), be_read_*, be_write_*,
+	
+	  - The default search order for RAWDATA is that the current
+	directory     is searched after the rest of rawdata instead of
+	before.
+	
+	  - Removed support for the old unix "pack" program as a
+	compression	tool. 
+
+	* plain/seqIOPlain.c,
+	* progs/Makefile,
+	* progs/convert_trace.c,
+	* progs/extract_seq.c,
+	* progs/get_comment.c,
+	* progs/hash_extract.c,
+	* progs/hash_tar.c,
+	* progs/makeSCF.c,
+	* progs/trace_dump.c,
+	* progs/ztr_dump.c,
+	* read/Read.c,
+	* read/Read.h,
+	* read/scf_extras.c,
+	* read/translate.c,
+	* scf/misc_scf.c,
+	* scf/read_scf.c,
+	* scf/scf.h,
+	* scf/write_scf.c,
+	* utils/compress.c,
+	* utils/compress.h,
+	* utils/hash_table.c,
+	* utils/hash_table.h,
+	* utils/mach-io.c,
+	* utils/mach-io.h,
+	* utils/open_trace_file.c,
+	* utils/open_trace_file.h,
+	* utils/read_alloc.c,
+	* utils/traceType.c,
+	* utils/traceType.h,
+	* ztr/FORMAT,
+	* ztr/compression.c,
+	* ztr/compression.h,
+	* ztr/ztr.c,
+	* ztr/ztr.h,
+	* ztr/ztr_translate.c:
+	(13:33:33) Version 1.9.0-test
+	
+	* Significant speed ups, particularly when dealing with reading	 
+	gzipped files or when extracting data from tar files.
+	
+	* New external functions for faster access via mFILE (memory-file) 
+	 structs. These mimic the fread/fwrite calls, but with
+	mfread/mfwrite	 etc.
+	
+	* Some functions previously available in external scope, but not  
+	defined in header files, have now been made internal only  
+	("static"). Please contact me if you were using these and have a  
+	burning need for them to remain external.
+	
+	* Numerous minor tweaks and updates to fix compiler warnings on
+	more   stricter modes of the Intel C Compiler.
+	
+	* Preliminary support for storing pyrosequencing style traces. This
+	  has been modeled on the flowgram data from 454, but should be	 
+	applicable to other platforms. ZTR has been updated to incorporate 
+	 this too.
+	
+	  The Read structure also has flow, flow_order, nflows and flow_raw
+	  elements too. Code to convert these into the more usual
+	traceA/C/G/T   arrays exists currently as part of Trev (in tk_utils
+	in the Staden	Package), but this may move into io_lib for the
+	next official	release.
+	
+	* New hash_tar and hash_extract programs. These replace the
+	index_tar   program for rast random access. For RAWDATA include
+	"HASH=hashfile"	  as an element to get io_lib to use the archive
+	hash. It's possible   to create hash files of most archive formats
+	as the hash itself   contains the offset and size of each item in
+	the archive. This means	  that extracting an item does not need to
+	know the format of the	 original archive.
+	
+	  Some benchmarks show that on ext3 it's actually faster to extract
+	  files from the hash than directly via the directory. This was	 
+	testing with ~200,000 files, whereupon directory lookups become	 
+	slow. I'd imagine ResierFS or similar to be faster.
+	
+	* Added an XRLE encoding for ZTR. This is similar to the existing
+	RLE   mechanism but it copes with run length encoding of items
+	larger than   a single byte. It's current use is for storing the
+	4-base repeating   flow order in 454 data.
+	
+	* Potential incompatibilities:
+	
+	  - The Exp_info structure now has an "mFILE *fp" member instead of
+	    "FILE *fp".
+	
+	  - As mentioned above, some functions are no longer external.
+	These	  include many ctf functions, ztr_(de)compress,	   
+	ztr_chunk_(read/write), be_read_*, be_write_*,
+	
+	  - The default search order for RAWDATA is that the current
+	directory     is searched after the rest of rawdata instead of
+	before.
+	
+	  - Removed support for the old unix "pack" program as a
+	compression	tool. 
+
+	* utils/vlen.c,
+	* utils/vlen.h:
+	(13:35:42) vlen/vflen functions to estimate the maximum data size
+	written out by a printf style function. This is used by the new
+	mFILE functions. 
+
+	* utils/mFILE.c,
+	* utils/mFILE.h:
+	(13:39:13) mFILE struct support. This is basically a set of
+	functions to similulate stdio file support on a block of memory
+	instead of a file, for purposes of speed and to avoid the need of
+	writing data out to a file only to be opened and read back in again
+	(which happened a lot before).
+	
+	stdio_hack.h is, like it says, a hacky bunch of #defines to turn
+	stdio functions and io_lib functions into their mFILE equivalents.
+	It is used internally to convert old code (eg ABI file reading) to
+	use mFILE structures, but can also be used by the brave to update
+	their own code. Use with extreme caution. 
+
+	* utils/stdio_hack.h:
+	(13:39:14) mFILE struct support. This is basically a set of
+	functions to similulate stdio file support on a block of memory
+	instead of a file, for purposes of speed and to avoid the need of
+	writing data out to a file only to be opened and read back in again
+	(which happened a lot before).
+	
+	stdio_hack.h is, like it says, a hacky bunch of #defines to turn
+	stdio functions and io_lib functions into their mFILE equivalents.
+	It is used internally to convert old code (eg ABI file reading) to
+	use mFILE structures, but can also be used by the brave to update
+	their own code. Use with extreme caution. 
+
+2005-06-08  James Bonfield  <jkb@sanger.ac.uk>
+
+	* utils/hash_table.c:
+	* utils/hash_table.h:
+	* progs/hash_extract.c,
+	* progs/hash_tar.c:
+	(08:37:49) Added some simple hash table functions. Layered on top
+	of these are HashFiles, which allow hash table indexing of files to
+	be stored on disk. hash_tar and hash_extract test programs
+	illustrate its use on tar files, much like index_tar does. 
+
+	* utils/open_trace_file.c:
+	(08:38:22) Added support for integrating the new hashfile code via
+	a "HASH=hashfile" RAWDATA setting. 
+
+2005-04-27  James Bonfield  <jkb@sanger.ac.uk>
+
+	* progs/get_comment.c:
+	(16:15:51) Removed "might be used uninitialised" warning messages
+	from the compiler. 
+
+2005-02-09  James Bonfield  <jkb@sanger.ac.uk>
+
+	* abi/seqIOABI.c:
+	(10:08:03) Added getABIIndexEntrySW and modified getABIString to
+	correctly determine the string type (pascal vs C-string). This
+	means MODL numbers now come out as 3730 instead of 730 (for
+	example). 
+
+2004-12-06  James Bonfield  <jkb@sanger.ac.uk>
+
+	* progs/ztr_dump.c:
+	(17:41:58) Corrected minor compiler warnings. 
+
+2004-11-16  James Bonfield  <jkb@sanger.ac.uk>
+
+	* exp_file/expFileIO.c:
+	(12:10:16) Major speed up of reading large experiment files. Tested
+	on a 1Mb sequence with AV, ON and SQ lines the new code is 1000
+	times faster on the Alpha.
+	
+	Primarily the difference comes from removing O(N^2) complexities by
+	removing strcat & strlen type of operations. 
+
+2004-10-29  James Bonfield  <jkb@sanger.ac.uk>
+
+	* Makefile:
+	(10:42:10) Automatically create binary output directories. 
+
+2004-10-21  James Bonfield  <jkb@sanger.ac.uk>
+
+	* dependencies:
+	(11:39:28) *** empty log message *** 
+
+2004-10-14  James Bonfield  <jkb@sanger.ac.uk>
+
+	* progs/convert_trace.c:
+	(15:38:18) Added a "-subtract <amount>" option to allow removal of
+	a specific DC offset. 
+
+2004-10-08  James Bonfield  <jkb@sanger.ac.uk>
+
+	* progs/convert_trace.c:
+	(14:49:06) Fixed a divide-by-zero error in the normalisation code. 
+
+2004-10-01  James Bonfield  <jkb@sanger.ac.uk>
+
+	* progs/convert_trace.c:
+	(10:56:07) Rewrote rescale_heights (the "-normalise" option) using
+	an amplitude tracker with an attack & delay model. This seems to
+	work well at adjusting for both gradual amplitude variations and
+	for downscaling huge dye-blobs. 
+
+2004-08-17  James Bonfield  <jkb@sanger.ac.uk>
+
+	* progs/Makefile,
+	* progs/Makefile.am,
+	* progs/ztr_dump.c:
+	(13:37:17) Added a ztr_dump program. 
+
+2004-08-05  James Bonfield  <jkb@sanger.ac.uk>
+
+	* progs/index_tar.c:
+	(09:32:05) Fix bug submitted by Steve Leonard. If a directory is
+	too large to fit in the name (>100) but short enough to fit in the
+	prefix the name field will be empty, this is not the cas for
+	ordinary files where the name field is always non-empty. 
+
+2004-07-26  James Bonfield  <jkb@sanger.ac.uk>
+
+	* exp_file/expFileIO.c:
+	(14:24:35) MinGW port 
+
+	* utils/open_trace_file.c:
+	(14:26:13) MinGW port 
+
+===============================================================================
+2004-06-01  James Bonfield  <jkb@sanger.ac.uk>
+
+	* CHANGES,
+	* Makefile.am,
+	* Attic/Makefile.in,
+	* README,
+	* Attic/config.guess,
+	* Attic/config.h.in,
+	* Attic/config.sub,
+	* Attic/configure,
+	* configure.in,
+	* Attic/depcomp,
+	* Attic/install-sh,
+	* Attic/ltmain.sh,
+	* Attic/missing,
+	* Attic/mkinstalldirs:
+	* abi/Attic/Makefile.in,
+	* alf/Attic/Makefile.in:
+	* ctf/Attic/Makefile.in,
+	* exp_file/Attic/Makefile.in,
+	* plain/Attic/Makefile.in,
+	* progs/Makefile.am,
+	* progs/Attic/Makefile.in,
+	* read/Attic/Makefile.in,
+	* scf/Attic/Makefile.in,
+	* utils/Attic/Makefile.in,
+	* ztr/Attic/Makefile.in:
+	(08:54:51) Updated notes to claim this is version 1.8.12 and
+	rebuilt all the automake/autoconf/libtool generated files. 
+
+2004-05-13  James Bonfield  <jkb@sanger.ac.uk>
+
+	* abi/seqIOABI.c:
+	(16:14:10) Improved spacing fix. 
+
+2004-05-12  James Bonfield  <jkb@sanger.ac.uk>
+
+	* abi/seqIOABI.c:
+	(08:27:40) Applied change suggested by Saul A. Kravitz. The
+	fallback fspacing is now calculated over the range that basecalls
+	exist rather than the total length of trace. 
+
+2004-03-03  James Bonfield  <jkb@sanger.ac.uk>
+
+	* ztr/ztr_translate.c:
+	(17:45:52) Treat Read->basePos as 16-bit, which means hard-coding
+	the first two bytes in ztr_encode_positions for each pos as zero. 
+
+2004-02-19  James Bonfield  <jkb@sanger.ac.uk>
+
+	* exp_file/expFileIO.c:
+	(12:13:52) Fixed typo in LG qualifier (was LF). 
+
+	* exp_file/expFileIO.h:
+	(13:48:59) More type fixes; EFLT_LG was given the same number as
+	_FT. Now diff. 
+
+2004-02-12  James Bonfield  <jkb@sanger.ac.uk>
+
+	* dependencies:
+	(10:32:01) *** empty log message *** 
+
+2004-02-09  James Bonfield  <jkb@sanger.ac.uk>
+
+	* exp_file/expFileIO.c,
+	* exp_file/expFileIO.h:
+	(14:39:52) Added LG (LiGation) to experiment file definition. 
+
+2004-01-13  James Bonfield  <jkb@sanger.ac.uk>
+
+	* read/translate.c:
+	(17:02:00) In read2exp only set the file format to be TT_EXP when
+	'redirection to trace' is not enabled (ie it indicates where the
+	sequence came from, EXP or SCF/ZTR/...). 
+
+2003-11-17  James Bonfield  <jkb@sanger.ac.uk>
+
+	* utils/open_trace_file.c:
+	(14:52:28) Added ARC= and URL= RAWDATA search methods to fetch
+	traces via the ensembl trace archive and via a URL. 
+
+2003-10-24  James Bonfield  <jkb@sanger.ac.uk>
+
+	* abi/seqIOABI.c:
+	(08:24:07) Protect against the base spacing being listed as a
+	negative number in the ABI file. 
+
+	* progs/extract_seq.c:
+	(08:24:29) Added a -fofn option 
+
+	* utils/compress.c:
+	(08:24:57) More error checking on writing compressed files. 
+
+2003-07-10  James Bonfield  <jkb@sanger.ac.uk>
+
+	* Makefile:
+	(11:14:14) Put back the Staden Makefile as I accidently overwrote
+	this with the autoconf generate one. 
+
+	* progs/Makefile:
+	(11:14:18) *** empty log message *** 
+
+2003-07-07  James Bonfield  <jkb@sanger.ac.uk>
+
+	* abi/seqIOABI.c,
+	* abi/seqIOABI.h:
+	(11:20:37) Confidence values (PCON 1) are now loaded from ABI
+	files. 
+
+	* Makefile.am:
+	* Attic/Makefile.in,
+	* Attic/config.guess,
+	* Attic/config.h.in,
+	* Attic/config.sub,
+	* Attic/configure,
+	* configure.in,
+	* Attic/install-sh,
+	* Attic/ltconfig,
+	* Attic/ltmain.sh,
+	* Attic/missing,
+	* Attic/mkinstalldirs,
+	* Attic/stamp-h.in:
+	(11:24:47) Added automake/autoconf/libtool files to CVS tree. Not
+	all of these are 'source' files as some are generated by others,
+	but for ease of compilation the output from these tools is
+	distribute too, meaning that only './configure' needs to be run. 
+
+	* abi/Attic/Makefile.am,
+	* abi/Attic/Makefile.in:
+	(11:24:52) *** empty log message *** 
+
+	* alf/Attic/Makefile.am,
+	* alf/Attic/Makefile.in,
+	* ctf/Attic/Makefile.am,
+	* ctf/Attic/Makefile.in,
+	* exp_file/Attic/Makefile.am,
+	* exp_file/Attic/Makefile.in,
+	* plain/Attic/Makefile.am,
+	* plain/Attic/Makefile.in,
+	* progs/Makefile.am:
+	(11:25:02) *** empty log message *** 
+
+	* progs/Attic/Makefile.in,
+	* read/Makefile.am,
+	* read/Attic/Makefile.in,
+	* scf/Attic/Makefile.am,
+	* scf/Attic/Makefile.in,
+	* utils/Attic/Makefile.am,
+	* utils/Attic/Makefile.in,
+	* ztr/Attic/Makefile.am,
+	* ztr/Attic/Makefile.in:
+	(11:25:03) *** empty log message *** 
+
+	* Makefile:
+	(11:48:43) Updates to automake/conf system. 
+
+	* Makefile.am,
+	* Attic/Makefile.in,
+	* Attic/config.guess,
+	* Attic/config.h.in,
+	* Attic/config.sub,
+	* Attic/configure,
+	* Attic/depcomp,
+	* Attic/ltmain.sh:
+	(11:48:44) Updates to automake/conf system. 
+
+	* abi/Attic/Makefile.am,
+	* abi/Attic/Makefile.in,
+	* alf/Attic/Makefile.am,
+	* alf/Attic/Makefile.in,
+	* ctf/Attic/Makefile.am,
+	* ctf/Attic/Makefile.in,
+	* exp_file/Attic/Makefile.am,
+	* exp_file/Attic/Makefile.in,
+	* plain/Attic/Makefile.am,
+	* plain/Attic/Makefile.in,
+	* progs/Makefile,
+	* progs/Makefile.am:
+	(11:48:50) *** empty log message *** 
+
+	* progs/Attic/Makefile.in,
+	* read/Makefile.am,
+	* read/Attic/Makefile.in,
+	* read/Read.h,
+	* scf/Attic/Makefile.am,
+	* scf/Attic/Makefile.in,
+	* utils/Attic/Makefile.am,
+	* utils/Attic/Makefile.in,
+	* ztr/Attic/Makefile.am:
+	(11:48:51) *** empty log message *** 
+
+	* ztr/Attic/Makefile.in:
+	(11:48:54) *** empty log message *** 
+
+	* read/Read.h:
+	(11:56:56) *** empty log message *** 
+
+2003-06-09  James Bonfield  <jkb@sanger.ac.uk>
+
+	* CHANGES,
+	* COPYRIGHT,
+	* Makefile,
+	* README,
+	* options.mk,
+	* abi/abi.h,
+	* abi/fpoint.c,
+	* abi/fpoint.h,
+	* abi/seqIOABI.c:
+	(11:24:36) Import of Staden Package 2003.0b2 
+
+	* CHANGES,
+	* COPYRIGHT,
+	* Makefile,
+	* README,
+	* options.mk,
+	* abi/abi.h,
+	* abi/fpoint.c,
+	* abi/fpoint.h,
+	* abi/seqIOABI.c:
+	(11:24:36) branches:  1.1.1; Initial revision 
+
+	* abi/seqIOABI.h,
+	* alf/alf.h,
+	* alf/seqIOALF.c,
+	* ctf/ctfCompress.c,
+	* ctf/seqIOCTF.c,
+	* ctf/seqIOCTF.h,
+	* exp_file/expFileIO.c,
+	* exp_file/expFileIO.h,
+	* plain/plain.h,
+	* plain/seqIOPlain.c,
+	* progs/Makefile,
+	* progs/convert_trace.c,
+	* progs/extract_seq.c,
+	* progs/get_comment.c,
+	* progs/index_tar.c,
+	* progs/makeSCF.c,
+	* progs/scf_dump.c,
+	* progs/scf_info.c,
+	* progs/scf_update.c,
+	* progs/trace_dump.c,
+	* read/Read.c,
+	* read/Read.h,
+	* read/scf_extras.c,
+	* read/scf_extras.h,
+	* read/translate.c,
+	* read/translate.h,
+	* scf/misc_scf.c,
+	* scf/read_scf.c,
+	* scf/scf.h,
+	* scf/write_scf.c,
+	* utils/array.c,
+	* utils/array.h,
+	* utils/compress.c,
+	* utils/compress.h,
+	* utils/error.c,
+	* utils/error.h,
+	* utils/files.c,
+	* utils/find.c,
+	* utils/mach-io.c,
+	* utils/mach-io.h,
+	* utils/misc.h,
+	* utils/open_trace_file.c,
+	* utils/open_trace_file.h,
+	* utils/read_alloc.c,
+	* utils/strings.c,
+	* utils/tar_format.h,
+	* utils/traceType.c:
+	(11:24:37) Import of Staden Package 2003.0b2 
+
+	* abi/seqIOABI.h,
+	* alf/alf.h,
+	* alf/seqIOALF.c,
+	* ctf/ctfCompress.c,
+	* ctf/seqIOCTF.c,
+	* ctf/seqIOCTF.h,
+	* exp_file/expFileIO.c,
+	* exp_file/expFileIO.h,
+	* plain/plain.h,
+	* plain/seqIOPlain.c,
+	* progs/Makefile,
+	* progs/convert_trace.c,
+	* progs/extract_seq.c,
+	* progs/get_comment.c,
+	* progs/index_tar.c,
+	* progs/makeSCF.c,
+	* progs/scf_dump.c,
+	* progs/scf_info.c,
+	* progs/scf_update.c,
+	* progs/trace_dump.c,
+	* read/Read.c,
+	* read/Read.h,
+	* read/scf_extras.c,
+	* read/scf_extras.h,
+	* read/translate.c,
+	* read/translate.h,
+	* scf/misc_scf.c,
+	* scf/read_scf.c,
+	* scf/scf.h,
+	* scf/write_scf.c,
+	* utils/array.c,
+	* utils/array.h,
+	* utils/compress.c,
+	* utils/compress.h,
+	* utils/error.c,
+	* utils/error.h,
+	* utils/files.c,
+	* utils/find.c,
+	* utils/mach-io.c,
+	* utils/mach-io.h,
+	* utils/misc.h,
+	* utils/open_trace_file.c,
+	* utils/open_trace_file.h,
+	* utils/read_alloc.c,
+	* utils/strings.c,
+	* utils/tar_format.h,
+	* utils/traceType.c:
+	(11:24:37) branches:  1.1.1; Initial revision 
+
+	* man/man3/ExperimentFile.3,
+	* man/man3/exp2read.3,
+	* man/man3/fread_reading.3,
+	* man/man3/fread_scf.3,
+	* man/man3/fwrite_reading.3,
+	* man/man3/fwrite_scf.3,
+	* man/man3/read2exp.3,
+	* man/man3/read2scf.3,
+	* man/man3/read_allocate.3,
+	* man/man3/read_deallocate.3,
+	* man/man3/read_reading.3,
+	* man/man3/read_scf.3,
+	* man/man3/read_scf_header.3,
+	* man/man3/scf2read.3,
+	* man/man3/write_reading.3,
+	* man/man3/write_scf.3,
+	* man/man3/write_scf_header.3,
+	* man/man4/Read.4,
+	* utils/traceType.h,
+	* utils/xalloc.c,
+	* utils/xalloc.h,
+	* ztr/FORMAT,
+	* ztr/compression.c,
+	* ztr/compression.h,
+	* ztr/ztr.c,
+	* ztr/ztr.h,
+	* ztr/ztr_translate.c:
+	(11:24:38) Import of Staden Package 2003.0b2 
+
+	* man/man3/ExperimentFile.3,
+	* man/man3/exp2read.3,
+	* man/man3/fread_reading.3,
+	* man/man3/fread_scf.3,
+	* man/man3/fwrite_reading.3,
+	* man/man3/fwrite_scf.3,
+	* man/man3/read2exp.3,
+	* man/man3/read2scf.3,
+	* man/man3/read_allocate.3,
+	* man/man3/read_deallocate.3,
+	* man/man3/read_reading.3,
+	* man/man3/read_scf.3,
+	* man/man3/read_scf_header.3,
+	* man/man3/scf2read.3,
+	* man/man3/write_reading.3,
+	* man/man3/write_scf.3,
+	* man/man3/write_scf_header.3,
+	* man/man4/Read.4,
+	* utils/traceType.h,
+	* utils/xalloc.c,
+	* utils/xalloc.h,
+	* ztr/FORMAT,
+	* ztr/compression.c,
+	* ztr/compression.h,
+	* ztr/ztr.c,
+	* ztr/ztr.h,
+	* ztr/ztr_translate.c:
+	(11:24:38) branches:  1.1.1; Initial revision 
+
+	* Makefile:
+	(11:59:11) Added include/.links target to main library instead of
+	progs, thus making the build work cleanly from a newly checked out
+	copy. 
+
+	* Makefile:
+	(14:22:43) Fix .links code. 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/Makefile.am	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,73 @@
+AUTOMAKE_OPTIONS = foreign no-dependencies
+
+SUBDIRS = io_lib progs tests
+
+man_MANS = \
+	man/man1/srf_index_hash.1 \
+	man/man1/srf_info.1 \
+	man/man1/srf_list.1 \
+	man/man1/illumina2srf.1 \
+	man/man1/srf2fasta.1 \
+	man/man1/srf2fastq.1 \
+	man/man3/read_scf_header.3 \
+	man/man3/read_allocate.3 \
+	man/man3/ExperimentFile.3 \
+	man/man3/write_reading.3 \
+	man/man3/write_scf.3 \
+	man/man3/read_deallocate.3 \
+	man/man3/fwrite_reading.3 \
+	man/man3/read2scf.3 \
+	man/man3/scf2read.3 \
+	man/man3/fwrite_scf.3 \
+	man/man3/write_scf_header.3 \
+	man/man3/read_reading.3 \
+	man/man3/read_scf.3 \
+	man/man3/exp2read.3 \
+	man/man3/fread_reading.3 \
+	man/man3/read2exp.3 \
+	man/man3/fread_scf.3 \
+	man/man4/Read.4
+
+pkginclude_HEADERS = \
+	io_lib/Read.h \
+	io_lib/scf_extras.h \
+	io_lib/translate.h \
+	io_lib/abi.h \
+	io_lib/fpoint.h \
+	io_lib/seqIOABI.h \
+	io_lib/alf.h \
+	io_lib/seqIOCTF.h \
+	io_lib/expFileIO.h \
+	io_lib/plain.h \
+	io_lib/scf.h \
+	io_lib/sff.h \
+	io_lib/array.h \
+	io_lib/compress.h \
+	io_lib/error.h \
+	io_lib/mach-io.h \
+	io_lib/misc.h \
+	io_lib/open_trace_file.h \
+	io_lib/tar_format.h \
+	io_lib/traceType.h \
+	io_lib/xalloc.h \
+	io_lib/mFILE.h \
+	io_lib/stdio_hack.h \
+	io_lib/vlen.h \
+	io_lib/hash_table.h \
+	io_lib/jenkins_lookup3.h \
+	io_lib/os.h \
+	io_lib/compression.h \
+	io_lib/ztr.h \
+	io_lib/deflate_interlaced.h \
+	io_lib/srf.h \
+	io_lib/pooled_alloc.h \
+	io_lib_config.h
+
+bin_SCRIPTS = io_lib-config
+
+EXTRA_DIST = README COPYRIGHT ChangeLog CHANGES man options.mk bootstrap \
+	docs/ZTR_format docs/Hash_File_Format io_lib-config.in
+
+
+dist-hook:
+	rm -rf `find $(distdir)/man -name .svn`
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/Makefile.in	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,905 @@
+# 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@
+
+
+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@
+DIST_COMMON = README $(am__configure_deps) $(pkginclude_HEADERS) \
+	$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(srcdir)/io_lib-config.in $(srcdir)/io_lib_config.h.in \
+	$(top_srcdir)/configure ChangeLog compile config.guess \
+	config.sub depcomp install-sh ltmain.sh missing
+subdir = .
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
+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 = $(install_sh) -d
+CONFIG_HEADER = io_lib_config.h
+CONFIG_CLEAN_FILES = io_lib-config
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" \
+	"$(DESTDIR)$(man3dir)" "$(DESTDIR)$(man4dir)" \
+	"$(DESTDIR)$(pkgincludedir)"
+binSCRIPT_INSTALL = $(INSTALL_SCRIPT)
+SCRIPTS = $(bin_SCRIPTS)
+depcomp =
+am__depfiles_maybe =
+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
+man1dir = $(mandir)/man1
+man3dir = $(mandir)/man3
+man4dir = $(mandir)/man4
+NROFF = nroff
+MANS = $(man_MANS)
+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|^.*/||'`;
+pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(pkginclude_HEADERS)
+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
+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@
+GREP = @GREP@
+HAVE_ZLIB_FALSE = @HAVE_ZLIB_FALSE@
+HAVE_ZLIB_TRUE = @HAVE_ZLIB_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBCURL = @LIBCURL@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBZ = @LIBZ@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+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@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+VERS_AGE = @VERS_AGE@
+VERS_CURRENT = @VERS_CURRENT@
+VERS_REVISION = @VERS_REVISION@
+_libcurl_config = @_libcurl_config@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+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@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+AUTOMAKE_OPTIONS = foreign no-dependencies
+SUBDIRS = io_lib progs tests
+man_MANS = \
+	man/man1/srf_index_hash.1 \
+	man/man1/srf_info.1 \
+	man/man1/srf_list.1 \
+	man/man1/illumina2srf.1 \
+	man/man1/srf2fasta.1 \
+	man/man1/srf2fastq.1 \
+	man/man3/read_scf_header.3 \
+	man/man3/read_allocate.3 \
+	man/man3/ExperimentFile.3 \
+	man/man3/write_reading.3 \
+	man/man3/write_scf.3 \
+	man/man3/read_deallocate.3 \
+	man/man3/fwrite_reading.3 \
+	man/man3/read2scf.3 \
+	man/man3/scf2read.3 \
+	man/man3/fwrite_scf.3 \
+	man/man3/write_scf_header.3 \
+	man/man3/read_reading.3 \
+	man/man3/read_scf.3 \
+	man/man3/exp2read.3 \
+	man/man3/fread_reading.3 \
+	man/man3/read2exp.3 \
+	man/man3/fread_scf.3 \
+	man/man4/Read.4
+
+pkginclude_HEADERS = \
+	io_lib/Read.h \
+	io_lib/scf_extras.h \
+	io_lib/translate.h \
+	io_lib/abi.h \
+	io_lib/fpoint.h \
+	io_lib/seqIOABI.h \
+	io_lib/alf.h \
+	io_lib/seqIOCTF.h \
+	io_lib/expFileIO.h \
+	io_lib/plain.h \
+	io_lib/scf.h \
+	io_lib/sff.h \
+	io_lib/array.h \
+	io_lib/compress.h \
+	io_lib/error.h \
+	io_lib/mach-io.h \
+	io_lib/misc.h \
+	io_lib/open_trace_file.h \
+	io_lib/tar_format.h \
+	io_lib/traceType.h \
+	io_lib/xalloc.h \
+	io_lib/mFILE.h \
+	io_lib/stdio_hack.h \
+	io_lib/vlen.h \
+	io_lib/hash_table.h \
+	io_lib/jenkins_lookup3.h \
+	io_lib/os.h \
+	io_lib/compression.h \
+	io_lib/ztr.h \
+	io_lib/deflate_interlaced.h \
+	io_lib/srf.h \
+	io_lib/pooled_alloc.h \
+	io_lib_config.h
+
+bin_SCRIPTS = io_lib-config
+EXTRA_DIST = README COPYRIGHT ChangeLog CHANGES man options.mk bootstrap \
+	docs/ZTR_format docs/Hash_File_Format io_lib-config.in
+
+all: io_lib_config.h
+	$(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+.SUFFIXES:
+am--refresh:
+	@:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+	cd $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+	cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+
+io_lib_config.h: stamp-h1
+	@if test ! -f $@; then \
+	  rm -f stamp-h1; \
+	  $(MAKE) stamp-h1; \
+	else :; fi
+
+stamp-h1: $(srcdir)/io_lib_config.h.in $(top_builddir)/config.status
+	@rm -f stamp-h1
+	cd $(top_builddir) && $(SHELL) ./config.status io_lib_config.h
+$(srcdir)/io_lib_config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) 
+	cd $(top_srcdir) && $(AUTOHEADER)
+	rm -f stamp-h1
+	touch $@
+
+distclean-hdr:
+	-rm -f io_lib_config.h stamp-h1
+io_lib-config: $(top_builddir)/config.status $(srcdir)/io_lib-config.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+install-binSCRIPTS: $(bin_SCRIPTS)
+	@$(NORMAL_INSTALL)
+	test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
+	@list='$(bin_SCRIPTS)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  if test -f $$d$$p; then \
+	    f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+	    echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+	    $(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \
+	  else :; fi; \
+	done
+
+uninstall-binSCRIPTS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(bin_SCRIPTS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+	  echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(bindir)/$$f"; \
+	done
+
+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
+install-man3: $(man3_MANS) $(man_MANS)
+	@$(NORMAL_INSTALL)
+	test -z "$(man3dir)" || $(mkdir_p) "$(DESTDIR)$(man3dir)"
+	@list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \
+	l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+	for i in $$l2; do \
+	  case "$$i" in \
+	    *.3*) 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 \
+	    3*) ;; \
+	    *) ext='3' ;; \
+	  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)$(man3dir)/$$inst'"; \
+	  $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst"; \
+	done
+uninstall-man3:
+	@$(NORMAL_UNINSTALL)
+	@list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \
+	l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+	for i in $$l2; do \
+	  case "$$i" in \
+	    *.3*) list="$$list $$i" ;; \
+	  esac; \
+	done; \
+	for i in $$list; do \
+	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+	  case "$$ext" in \
+	    3*) ;; \
+	    *) ext='3' ;; \
+	  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)$(man3dir)/$$inst'"; \
+	  rm -f "$(DESTDIR)$(man3dir)/$$inst"; \
+	done
+install-man4: $(man4_MANS) $(man_MANS)
+	@$(NORMAL_INSTALL)
+	test -z "$(man4dir)" || $(mkdir_p) "$(DESTDIR)$(man4dir)"
+	@list='$(man4_MANS) $(dist_man4_MANS) $(nodist_man4_MANS)'; \
+	l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+	for i in $$l2; do \
+	  case "$$i" in \
+	    *.4*) 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 \
+	    4*) ;; \
+	    *) ext='4' ;; \
+	  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)$(man4dir)/$$inst'"; \
+	  $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man4dir)/$$inst"; \
+	done
+uninstall-man4:
+	@$(NORMAL_UNINSTALL)
+	@list='$(man4_MANS) $(dist_man4_MANS) $(nodist_man4_MANS)'; \
+	l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+	for i in $$l2; do \
+	  case "$$i" in \
+	    *.4*) list="$$list $$i" ;; \
+	  esac; \
+	done; \
+	for i in $$list; do \
+	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+	  case "$$ext" in \
+	    4*) ;; \
+	    *) ext='4' ;; \
+	  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)$(man4dir)/$$inst'"; \
+	  rm -f "$(DESTDIR)$(man4dir)/$$inst"; \
+	done
+install-pkgincludeHEADERS: $(pkginclude_HEADERS)
+	@$(NORMAL_INSTALL)
+	test -z "$(pkgincludedir)" || $(mkdir_p) "$(DESTDIR)$(pkgincludedir)"
+	@list='$(pkginclude_HEADERS)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  f=$(am__strip_dir) \
+	  echo " $(pkgincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgincludedir)/$$f'"; \
+	  $(pkgincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgincludedir)/$$f"; \
+	done
+
+uninstall-pkgincludeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkginclude_HEADERS)'; for p in $$list; do \
+	  f=$(am__strip_dir) \
+	  echo " rm -f '$(DESTDIR)$(pkgincludedir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(pkgincludedir)/$$f"; \
+	done
+
+# 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) io_lib_config.h.in $(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) io_lib_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: ctags-recursive $(HEADERS) $(SOURCES) io_lib_config.h.in $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS) io_lib_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)
+	$(am__remove_distdir)
+	mkdir $(distdir)
+	$(mkdir_p) $(distdir)/. $(distdir)/docs $(distdir)/io_lib
+	@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
+	$(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 $(SCRIPTS) $(MANS) $(HEADERS) io_lib_config.h
+installdirs: installdirs-recursive
+installdirs-am:
+	for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(man4dir)" "$(DESTDIR)$(pkgincludedir)"; 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-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-hdr \
+	distclean-libtool distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-man install-pkgincludeHEADERS
+
+install-exec-am: install-binSCRIPTS
+
+install-info: install-info-recursive
+
+install-man: install-man1 install-man3 install-man4
+
+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-binSCRIPTS uninstall-info-am uninstall-man \
+	uninstall-pkgincludeHEADERS
+
+uninstall-info: uninstall-info-recursive
+
+uninstall-man: uninstall-man1 uninstall-man3 uninstall-man4
+
+.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-hdr distclean-libtool \
+	distclean-recursive distclean-tags distcleancheck distdir \
+	distuninstallcheck dvi dvi-am html html-am info info-am \
+	install install-am install-binSCRIPTS install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-man1 install-man3 \
+	install-man4 install-pkgincludeHEADERS 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-binSCRIPTS uninstall-info-am uninstall-man \
+	uninstall-man1 uninstall-man3 uninstall-man4 \
+	uninstall-pkgincludeHEADERS
+
+
+dist-hook:
+	rm -rf `find $(distdir)/man -name .svn`
+# 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:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/README	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,134 @@
+			IO_LIB VERSION 1.12.2
+			=====================
+
+Io_lib is a library of file reading and writing code to provide a general
+purpose trace file (and Experiment File) reading interface. The programmer
+simply calls the (eg) read_reading to create a "Read" C structure with the
+data loaded into memory. It has been compiled and tested on a variety
+of unix systems, MacOS X and MS Windows.
+
+The directories below here contain the io_lib code. These support the
+following file formats:
+
+	SCF trace files
+	ABI trace files
+	ALF trace files
+	CTF trace files
+	ZTR trace files
+	SFF trace archives
+	SRF trace archives
+	Experiment files
+	Plain text files
+
+These link together to form a single "libstaden-read" library supporting
+all the file formats via a single read_reading (or fread_reading or
+mfread_reading) function call and analogous write_reading functions
+too. See the file include/Read.h for the generic 'Read' structure.
+
+
+
+What's new in 1.12.2
+====================
+
+Extra options in srf2fastq:
+	-S to output split regions sequentially to stdout.
+	-r to request a region to be reverse complemented before output.
+
+API changes in HashTable code:
+	We now support HASH_POOL_ITEMS flag to reduce memory usage and
+	fragmentation, while speeding it up too. The pooled_alloc
+	methods implementing this may be useful in other places too.
+	(This change does not break the existing ABI.)
+
+Minor bug fixes (see CHANGES file).
+
+
+What's new in 1.12.1
+====================
+
+Library renaming:
+	The final object is no longer libread.so (or read.dll), but
+	libstaden-read.so. This had already been done by the Fedora bundled
+	version and work was in progress to do this in Debian too.
+
+Illumina2srf/srf2illumina:
+	Both of these tools have now been removed. Illumina itself should
+	now be supporting these tools and shipping appropriate versions
+	compatible with each GA-pipeline release.
+
+Libtool:
+	We now create dynamic library too, in addition to the static
+	versions, using the autoconf "libtool" program.  Furthermore we now
+	have proper library versioning, starting with an soname of
+	libstaden-read.so.1 for this release.
+
+INCOMPATIBILITY:
+	The Array data type and Array* functions now use size_t instead of
+	int for the array sizes. This means programs linked against the old
+	io_lib releases are not binary compatible with this version. 
+
+See CHANGES and ChangeLog for a full list of changes and for older release
+notes.
+
+
+Older comments
+==============
+
+In 1.11.x the SRF support was added. The SRF v1.3 format specification can
+be found here:
+
+http://www.bcgsc.ca/pipermail/ssrformat/attachments/20071209/b0f865a0/ShortSequenceFormatDec9th_v_1_3-0001.doc
+
+The ZTR specification changes involve adding some new compression
+types (the general purpose XRLE2 plus some more solexa specific TSHIT
+and QSHIFT methods), a region chunk (REGN) to indicate the location of
+paired-end data stored in a single trace, improved meta-data support
+for SMP4/SAMP chunks including specifying the baseline (OFFS meta-data
+tag) and various minor tweaks. There's still a few questions in the
+ZTR format itself (pending feedback), but what is implemented
+currently is also what has been described in the docs/ZTR_format
+file.
+
+Finally the directory layout has been greatly simplified with the
+merging of all the format directories into a single "io_lib"
+directory and the programs utilising it remaining in the "progs"
+subdirectory.
+
+
+Building
+========
+
+We use the GNU autoconf build mechanism.
+
+To build:
+
+1. ./configure
+
+"./configure --help" will give a list of the options for GNU autoconf. For
+modifying the compiler options or flags you may wish to redefine the CC or
+CFLAGS variable.
+
+Eg (in sh or bash):
+   CC=cc CFLAGS=-g ./configure
+
+2. make (or gmake)
+
+This will build the sources.
+
+CFLAGS may also be changed a build time using (eg):
+    make 'CFLAGS=-g ...'
+
+3. make install
+
+The default installation location is /usr/local/bin and /usr/local/lib. These
+can be changed with the --prefix option to "configure".
+
+
+Under Microsoft Windows we recommend the use of MSYS and MINGW as a
+build environment. These contain enough tools to build using the
+configure script. Visit http://sourceforge.net/projects/mingw/files/
+and download/install Automated MinGW Installer (eg MinGW-5.1.4.exe),
+MSYS Base System (eg MSYS-1.0.11.exe) and MSYS Supplementary Tools (eg
+msysDTK-1.0.1.exe).
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/acinclude.m4	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,341 @@
+# LIBCURL_CHECK_CONFIG ([DEFAULT-ACTION], [MINIMUM-VERSION],
+#                       [ACTION-IF-YES], [ACTION-IF-NO])
+# ----------------------------------------------------------
+# David Shaw <dshaw@jabberwocky.com <mailto:dshaw@jabberwocky.com>> May-09-2006
+# Modified by Rob to deal with curl-config linking against more libraries than
+# strictly necessary.
+#
+# Checks for libcurl.  DEFAULT-ACTION is the string yes or no to
+# specify whether to default to --with-libcurl or --without-libcurl.
+# If not supplied, DEFAULT-ACTION is yes.  MINIMUM-VERSION is the
+# minimum version of libcurl to accept.  Pass the version as a regular
+# version number like 7.10.1. If not supplied, any version is
+# accepted.  ACTION-IF-YES is a list of shell commands to run if
+# libcurl was successfully found and passed the various tests.
+# ACTION-IF-NO is a list of shell commands that are run otherwise.
+# Note that using --without-libcurl does run ACTION-IF-NO.
+#
+# This macro #defines HAVE_LIBCURL if a working libcurl setup is
+# found, and sets @LIBCURL@ and @LIBCURL_CPPFLAGS@ to the necessary
+# values.  Other useful defines are LIBCURL_FEATURE_xxx where xxx are
+# the various features supported by libcurl, and LIBCURL_PROTOCOL_yyy
+# where yyy are the various protocols supported by libcurl.  Both xxx
+# and yyy are capitalized.  See the list of AH_TEMPLATEs at the top of
+# the macro for the complete list of possible defines.  Shell
+# variables $libcurl_feature_xxx and $libcurl_protocol_yyy are also
+# defined to 'yes' for those features and protocols that were found.
+# Note that xxx and yyy keep the same capitalization as in the
+# curl-config list (e.g. it's "HTTP" and not "http").
+#
+# Users may override the detected values by doing something like:
+# LIBCURL="-lcurl" LIBCURL_CPPFLAGS="-I/usr/myinclude" ./configure
+#
+# For the sake of sanity, this macro assumes that any libcurl that is
+# found is after version 7.7.2, the first version that included the
+# curl-config script.  Note that it is very important for people
+# packaging binary versions of libcurl to include this script!
+# Without curl-config, we can only guess what protocols are available,
+# or use curl_version_info to figure it out at runtime.
+
+AC_DEFUN([LIBCURL_CHECK_CONFIG],
+[
+  AH_TEMPLATE([LIBCURL_FEATURE_SSL],[Defined if libcurl supports SSL])
+  AH_TEMPLATE([LIBCURL_FEATURE_KRB4],[Defined if libcurl supports KRB4])
+  AH_TEMPLATE([LIBCURL_FEATURE_IPV6],[Defined if libcurl supports IPv6])
+  AH_TEMPLATE([LIBCURL_FEATURE_LIBZ],[Defined if libcurl supports libz])
+  AH_TEMPLATE([LIBCURL_FEATURE_ASYNCHDNS],[Defined if libcurl supports AsynchDNS])
+  AH_TEMPLATE([LIBCURL_FEATURE_IDN],[Defined if libcurl supports IDN])
+  AH_TEMPLATE([LIBCURL_FEATURE_SSPI],[Defined if libcurl supports SSPI])
+  AH_TEMPLATE([LIBCURL_FEATURE_NTLM],[Defined if libcurl supports NTLM])
+
+  AH_TEMPLATE([LIBCURL_PROTOCOL_HTTP],[Defined if libcurl supports HTTP])
+  AH_TEMPLATE([LIBCURL_PROTOCOL_HTTPS],[Defined if libcurl supports HTTPS])
+  AH_TEMPLATE([LIBCURL_PROTOCOL_FTP],[Defined if libcurl supports FTP])
+  AH_TEMPLATE([LIBCURL_PROTOCOL_FTPS],[Defined if libcurl supports FTPS])
+  AH_TEMPLATE([LIBCURL_PROTOCOL_FILE],[Defined if libcurl supports FILE])
+  AH_TEMPLATE([LIBCURL_PROTOCOL_TELNET],[Defined if libcurl supports TELNET])
+  AH_TEMPLATE([LIBCURL_PROTOCOL_LDAP],[Defined if libcurl supports LDAP])
+  AH_TEMPLATE([LIBCURL_PROTOCOL_DICT],[Defined if libcurl supports DICT])
+  AH_TEMPLATE([LIBCURL_PROTOCOL_TFTP],[Defined if libcurl supports TFTP])
+
+  AC_ARG_WITH(libcurl,
+     AC_HELP_STRING([--with-libcurl=DIR],[look for the curl library in DIR]),
+     [_libcurl_with=$withval],[_libcurl_with=ifelse([$1],,[yes],[$1])])
+
+  if test "$_libcurl_with" != "no" ; then
+
+     AC_PROG_AWK
+
+     _libcurl_version_parse="eval $AWK '{split(\$NF,A,\".\"); X=256*256*A[[1]]+256*A[[2]]+A[[3]]; print X;}'"
+
+     _libcurl_try_link=yes
+
+     if test -d "$_libcurl_with" ; then
+        LIBCURL_CPPFLAGS="-I$withval/include"
+        _libcurl_ldflags="-L$withval/lib"
+        AC_PATH_PROG([_libcurl_config],["$withval/bin/curl-config"])
+     else
+	AC_PATH_PROG([_libcurl_config],[curl-config])
+     fi
+
+     if test x$_libcurl_config != "x" ; then
+        AC_CACHE_CHECK([for the version of libcurl],
+	   [libcurl_cv_lib_curl_version],
+           [libcurl_cv_lib_curl_version=`$_libcurl_config --version | $AWK '{print $[]2}'`])
+
+	_libcurl_version=`echo $libcurl_cv_lib_curl_version | $_libcurl_version_parse`
+	_libcurl_wanted=`echo ifelse([$2],,[0],[$2]) | $_libcurl_version_parse`
+
+        if test $_libcurl_wanted -gt 0 ; then
+	   AC_CACHE_CHECK([for libcurl >= version $2],
+	      [libcurl_cv_lib_version_ok],
+              [
+   	      if test $_libcurl_version -ge $_libcurl_wanted ; then
+	         libcurl_cv_lib_version_ok=yes
+      	      else
+	         libcurl_cv_lib_version_ok=no
+  	      fi
+              ])
+        fi
+
+	if test $_libcurl_wanted -eq 0 || test x$libcurl_cv_lib_version_ok = xyes ; then
+           if test x"$LIBCURL_CPPFLAGS" = "x" ; then
+              LIBCURL_CPPFLAGS=`$_libcurl_config --cflags`
+           fi
+           if test x"$LIBCURL" = "x" ; then
+	      # libcurl-config --libs gives a ridiculous number of libraries
+	      # check to see if we can actually link just using -lcurl
+
+	      LIBCURL=${LIBCURL-"$_libcurl_ldflags -lcurl"}
+
+	      AC_CACHE_CHECK([whether libcurl just needs -lcurl],
+		[libcurl_cv_lib_curl_only_needs_minus_l_curl],
+		[
+		_libcurl_save_cppflags=$CPPFLAGS
+           	CPPFLAGS="$LIBCURL_CPPFLAGS $CPPFLAGS"
+           	_libcurl_save_libs=$LIBS
+           	LIBS="$LIBCURL $LIBS"
+		
+		AC_LINK_IFELSE(AC_LANG_PROGRAM([#include <curl/curl.h>],[
+/* Try and use a few common options to force a failure if we are
+   missing symbols or can't link. */
+int x;
+curl_easy_setopt(NULL,CURLOPT_URL,NULL);
+x=CURL_ERROR_SIZE;
+x=CURLOPT_WRITEFUNCTION;
+x=CURLOPT_FILE;
+x=CURLOPT_ERRORBUFFER;
+x=CURLOPT_STDERR;
+x=CURLOPT_VERBOSE;
+]),libcurl_cv_lib_curl_only_needs_minus_l_curl=yes,libcurl_cv_lib_curl_only_needs_minus_l_curl=no)
+
+          	CPPFLAGS=$_libcurl_save_cppflags
+           	LIBS=$_libcurl_save_libs
+           	unset _libcurl_save_cppflags
+           	unset _libcurl_save_libs
+           	])
+
+
+		if test "x$libcurl_cv_lib_curl_only_needs_minus_l_curl" != xyes ; then
+                   LIBCURL=`$_libcurl_config --libs`
+		fi
+
+              # This is so silly, but Apple actually has a bug in their
+	      # curl-config script.  Fixed in Tiger, but there are still
+	      # lots of Panther installs around.
+              case "${host}" in
+                 powerpc-apple-darwin7*)
+                    LIBCURL=`echo $LIBCURL | sed -e 's|-arch i386||g'`
+                 ;;
+              esac
+           fi
+
+	   # All curl-config scripts support --feature
+	   _libcurl_features=`$_libcurl_config --feature`
+
+           # Is it modern enough to have --protocols? (7.12.4)
+	   if test $_libcurl_version -ge 461828 ; then
+              _libcurl_protocols=`$_libcurl_config --protocols`
+           fi
+	else
+           _libcurl_try_link=no
+	fi
+
+	unset _libcurl_wanted
+     fi
+
+     if test $_libcurl_try_link = yes ; then
+
+        # we didn't find curl-config, so let's see if the user-supplied
+        # link line (or failing that, "-lcurl") is enough.
+        LIBCURL=${LIBCURL-"$_libcurl_ldflags -lcurl"}
+
+        AC_CACHE_CHECK([whether libcurl is usable],
+           [libcurl_cv_lib_curl_usable],
+           [
+           _libcurl_save_cppflags=$CPPFLAGS
+           CPPFLAGS="$LIBCURL_CPPFLAGS $CPPFLAGS"
+           _libcurl_save_libs=$LIBS
+           LIBS="$LIBCURL $LIBS"
+
+           AC_LINK_IFELSE(AC_LANG_PROGRAM([#include <curl/curl.h>],[
+/* Try and use a few common options to force a failure if we are
+   missing symbols or can't link. */
+int x;
+curl_easy_setopt(NULL,CURLOPT_URL,NULL);
+x=CURL_ERROR_SIZE;
+x=CURLOPT_WRITEFUNCTION;
+x=CURLOPT_FILE;
+x=CURLOPT_ERRORBUFFER;
+x=CURLOPT_STDERR;
+x=CURLOPT_VERBOSE;
+]),libcurl_cv_lib_curl_usable=yes,libcurl_cv_lib_curl_usable=no)
+
+           CPPFLAGS=$_libcurl_save_cppflags
+           LIBS=$_libcurl_save_libs
+           unset _libcurl_save_cppflags
+           unset _libcurl_save_libs
+           ])
+
+        if test $libcurl_cv_lib_curl_usable = yes ; then
+
+	   # Does curl_free() exist in this version of libcurl?
+	   # If not, fake it with free()
+
+           _libcurl_save_cppflags=$CPPFLAGS
+           CPPFLAGS="$CPPFLAGS $LIBCURL_CPPFLAGS"
+           _libcurl_save_libs=$LIBS
+           LIBS="$LIBS $LIBCURL"
+
+           AC_CHECK_FUNC(curl_free,,
+  	      AC_DEFINE(curl_free,free,
+		[Define curl_free() as free() if our version of curl lacks curl_free.]))
+
+           CPPFLAGS=$_libcurl_save_cppflags
+           LIBS=$_libcurl_save_libs
+           unset _libcurl_save_cppflags
+           unset _libcurl_save_libs
+
+           AC_DEFINE(HAVE_LIBCURL,1,
+             [Define to 1 if you have a functional curl library.])
+           AC_SUBST(LIBCURL_CPPFLAGS)
+           AC_SUBST(LIBCURL)
+
+           for _libcurl_feature in $_libcurl_features ; do
+	      AC_DEFINE_UNQUOTED(AS_TR_CPP(libcurl_feature_$_libcurl_feature),[1])
+	      eval AS_TR_SH(libcurl_feature_$_libcurl_feature)=yes
+           done
+
+	   if test "x$_libcurl_protocols" = "x" ; then
+
+	      # We don't have --protocols, so just assume that all
+	      # protocols are available
+	      _libcurl_protocols="HTTP FTP FILE TELNET LDAP DICT"
+
+	      if test x$libcurl_feature_SSL = xyes ; then
+	         _libcurl_protocols="$_libcurl_protocols HTTPS"
+
+		 # FTPS wasn't standards-compliant until version
+		 # 7.11.0
+		 if test $_libcurl_version -ge 461568; then
+		    _libcurl_protocols="$_libcurl_protocols FTPS"
+		 fi
+	      fi
+	   fi
+
+	   for _libcurl_protocol in $_libcurl_protocols ; do
+	      AC_DEFINE_UNQUOTED(AS_TR_CPP(libcurl_protocol_$_libcurl_protocol),[1])
+	      eval AS_TR_SH(libcurl_protocol_$_libcurl_protocol)=yes
+           done
+	else
+	   unset LIBCURL
+	   unset LIBCURL_CPPFLAGS
+        fi
+     fi
+
+     unset _libcurl_try_link
+     unset _libcurl_version_parse
+     unset _libcurl_config
+     unset _libcurl_feature
+     unset _libcurl_features
+     unset _libcurl_protocol
+     unset _libcurl_protocols
+     unset _libcurl_version
+     unset _libcurl_ldflags
+  fi
+
+  if test x$_libcurl_with = xno || test x$libcurl_cv_lib_curl_usable != xyes ; then
+     # This is the IF-NO path
+     ifelse([$4],,:,[$4])
+  else
+     # This is the IF-YES path
+     ifelse([$3],,:,[$3])
+  fi
+
+  unset _libcurl_with
+])dnl
+
+# ZLIB_CHECK_CONFIG ([DEFAULT-ACTION] [MINIMUM-VERSION],
+#                    [ACTION-IF-YES], [ACTION-IF-NO])
+#
+AC_DEFUN([ZLIB_CHECK_CONFIG],
+[
+  AC_ARG_WITH(zlib,
+	      AC_HELP_STRING([--with-zlib=DIR],[look for zlib in DIR]),
+	      [_zlib_with=$withval],[_zlib_with="no"])
+
+  ZLIB_ROOT=""
+  if test "$_zlib_with" != "no"
+  then
+     if test -f "$_zlib_with/include/zlib.h"
+     then
+         ZLIB_ROOT=$_zlib_with
+     fi
+  fi
+
+  # Check if it's a working library
+  zlib_ok=no
+  if test "$ZLIB_ROOT" != ""
+  then
+    _cppflags=$CPPFLAGS
+    CPPFLAGS="$CPPFLAGS -I${ZLIB_ROOT}/include"
+    _ldflags=$LDFLAGS
+    LDFLAGS="$LFDLAGS -L${ZLIB_ROOT}/lib"
+    AC_LANG_SAVE
+    AC_LANG_C
+    AC_CHECK_LIB(z, inflateEnd,
+	[AC_CHECK_HEADER(zlib.h, zlib_ok=yes, zlib_ok=no)])
+    AC_LANG_RESTORE
+    if test "$zlib_ok" != "yes"
+    then
+        # Backout and whinge
+        CPPFLAGS=$_cppflags
+        LDFLAGS=$_ldflags
+        AC_MSG_WARN("--with-zlib specified, but non functioning")
+    fi
+
+  else
+    # Maybe it works "out of the box"?
+    AC_CHECK_LIB(z, inflateEnd,
+	[AC_CHECK_HEADER(zlib.h, zlib_ok=yes, zlib_ok=no)])
+  fi
+
+  if test "$zlib_ok" = "yes"
+  then
+      AC_DEFINE(HAVE_ZLIB, 1,
+         [Define to 1 if you have a functional libz.])
+      if test "$ZLIB_ROOT" != ""
+      then
+          LIBZ="-L${ZLIB_ROOT}/lib -lz"
+      else
+          LIBZ=-lz
+      fi
+      AC_SUBST(LIBZ)
+  else
+    AC_MSG_WARN("No functioning zlib found")
+  fi
+
+  # Not sure how many of these are needed, but it's belt-and-braces mode
+  AH_TEMPLATE([HAVE_ZLIB], [Define if zlib is installed])
+  AM_CONDITIONAL(HAVE_ZLIB, test "$zlib_ok" = "yes")
+])
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/aclocal.m4	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,7261 @@
+# 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 Debian 1.5.22-4+etch1 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
+  ;;
+
+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* | k*bsd*-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'
+  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
+
+  # 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)); 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 /usr/lib $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'
+  ;;
+
+netbsdelf*-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='NetBSD ld.elf_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* | 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* | k*bsd*-gnu)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+netbsd* | netbsdelf*-gnu)
+  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* | 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* | k*bsd*-gnu)
+    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* | netbsdelf*-gnu)
+    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)
+
+# 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=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
+
+# 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=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
+
+# 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=$lt_sys_lib_search_path_spec
+
+# 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* | k*bsd*-gnu)
+  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* | 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* | k*bsd*-gnu)
+	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* | netbsdelf*-gnu)
+	;;
+      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* | k*bsd*-gnu)
+      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'
+  ;;
+  linux* | k*bsd*-gnu)
+    _LT_AC_TAGVAR(link_all_deplibs, $1)=no
+  ;;
+  *)
+    _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* | k*bsd*-gnu)
+      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
+	_LT_AC_TAGVAR(link_all_deplibs, $1)=no
+      else
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    netbsd* | netbsdelf*-gnu)
+      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* | 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* | netbsdelf*-gnu)
+      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
+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_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"])
+])
+
+# 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 8
+
+# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
+AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
+
+# 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])])
+
+# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
+# From Jim Meyering
+
+# Copyright (C) 1996, 1998, 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 4
+
+AC_DEFUN([AM_MAINTAINER_MODE],
+[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+  dnl maintainer-mode is disabled by default
+  AC_ARG_ENABLE(maintainer-mode,
+[  --enable-maintainer-mode  enable make rules and dependencies not useful
+			  (and sometimes confusing) to the casual installer],
+      USE_MAINTAINER_MODE=$enableval,
+      USE_MAINTAINER_MODE=no)
+  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
+  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
+  MAINT=$MAINTAINER_MODE_TRUE
+  AC_SUBST(MAINT)dnl
+]
+)
+
+AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
+
+# 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
+
+m4_include([acinclude.m4])
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/bootstrap	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+# If this doesn't work, you may wish to try running "autoreconf" instead.
+
+set -x
+rm -rf install-sh missing mkinstalldirs depcomp aclocal.m4 config.cache config.log config.status configure autom4te.cache io_lib_config.h.in config.sub config.guess Makefile.in progs/Makefile.in progs/Makefile read/Makefile.in read/Makefile tests/Makefile tests/Makefile.in dependencies io_lib-config
+libtoolize --force --copy && \
+aclocal -I . && \
+autoheader && \
+automake --foreign --add-missing --copy && \
+autoconf
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/compile	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,142 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand `-c -o'.
+
+scriptversion=2005-05-14.22
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
+# Written by Tom Tromey <tromey@cygnus.com>.
+#
+# 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., 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.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+case $1 in
+  '')
+     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+Wrapper for compilers which do not understand `-c -o'.
+Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
+arguments, and rename the output as expected.
+
+If you are trying to build a whole package this is not the
+right script to run: please start by reading the file `INSTALL'.
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "compile $scriptversion"
+    exit $?
+    ;;
+esac
+
+ofile=
+cfile=
+eat=
+
+for arg
+do
+  if test -n "$eat"; then
+    eat=
+  else
+    case $1 in
+      -o)
+	# configure might choose to run compile as `compile cc -o foo foo.c'.
+	# So we strip `-o arg' only if arg is an object.
+	eat=1
+	case $2 in
+	  *.o | *.obj)
+	    ofile=$2
+	    ;;
+	  *)
+	    set x "$@" -o "$2"
+	    shift
+	    ;;
+	esac
+	;;
+      *.c)
+	cfile=$1
+	set x "$@" "$1"
+	shift
+	;;
+      *)
+	set x "$@" "$1"
+	shift
+	;;
+    esac
+  fi
+  shift
+done
+
+if test -z "$ofile" || test -z "$cfile"; then
+  # If no `-o' option was seen then we might have been invoked from a
+  # pattern rule where we don't need one.  That is ok -- this is a
+  # normal compilation that the losing compiler can handle.  If no
+  # `.c' file was seen then we are probably linking.  That is also
+  # ok.
+  exec "$@"
+fi
+
+# Name of file we expect compiler to create.
+cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
+
+# Create the lock directory.
+# Note: use `[/.-]' here to ensure that we don't use the same name
+# that we are using for the .o file.  Also, base the name on the expected
+# object file name, since that is what matters with a parallel build.
+lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d
+while true; do
+  if mkdir "$lockdir" >/dev/null 2>&1; then
+    break
+  fi
+  sleep 1
+done
+# FIXME: race condition here if user kills between mkdir and trap.
+trap "rmdir '$lockdir'; exit 1" 1 2 15
+
+# Run the compile.
+"$@"
+ret=$?
+
+if test -f "$cofile"; then
+  mv "$cofile" "$ofile"
+elif test -f "${cofile}bj"; then
+  mv "${cofile}bj" "$ofile"
+fi
+
+rmdir "$lockdir"
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/config.guess	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,1500 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
+#   Inc.
+
+timestamp='2006-07-02'
+
+# 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., 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.
+
+
+# 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, 2002, 2003, 2004, 2005
+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 ;;
+    --version | -v )
+       echo "$version" ; exit ;;
+    --help | --h* | -h )
+       echo "$usage"; exit ;;
+    -- )     # 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 "$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 ; set_cc_for_build= ;'
+
+# 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
+
+# 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 ;;
+    *:OpenBSD:*:*)
+	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+	exit ;;
+    *:ekkoBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+	exit ;;
+    *:SolidBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+	exit ;;
+    macppc:MirBSD:*:*)
+	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+	exit ;;
+    *:MirBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+	exit ;;
+    alpha:OSF1:*:*)
+	case $UNAME_RELEASE in
+	*4.0)
+		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+		;;
+	*5.*)
+	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+		;;
+	esac
+	# 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 Pn.n version is a patched version.
+	# 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/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+	exit ;;
+    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 ;;
+    21064:Windows_NT:50:3)
+	echo alpha-dec-winnt3.5
+	exit ;;
+    Amiga*:UNIX_System_V:4.0:*)
+	echo m68k-unknown-sysv4
+	exit ;;
+    *:[Aa]miga[Oo][Ss]:*:*)
+	echo ${UNAME_MACHINE}-unknown-amigaos
+	exit ;;
+    *:[Mm]orph[Oo][Ss]:*:*)
+	echo ${UNAME_MACHINE}-unknown-morphos
+	exit ;;
+    *:OS/390:*:*)
+	echo i370-ibm-openedition
+	exit ;;
+    *:z/VM:*:*)
+	echo s390-ibm-zvmoe
+	exit ;;
+    *:OS400:*:*)
+        echo powerpc-ibm-os400
+	exit ;;
+    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+	echo arm-acorn-riscix${UNAME_RELEASE}
+	exit ;;
+    arm:riscos:*:*|arm:RISCOS:*:*)
+	echo arm-unknown-riscos
+	exit ;;
+    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+	echo hppa1.1-hitachi-hiuxmpp
+	exit ;;
+    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 ;;
+    NILE*:*:*:dcosx)
+	echo pyramid-pyramid-svr4
+	exit ;;
+    DRS?6000:unix:4.0:6*)
+	echo sparc-icl-nx6
+	exit ;;
+    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+	case `/usr/bin/uname -p` in
+	    sparc) echo sparc-icl-nx7; exit ;;
+	esac ;;
+    sun4H:SunOS:5.*:*)
+	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    i86pc:SunOS:5.*:*)
+	echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    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 ;;
+    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 ;;
+    sun3*:SunOS:*:*)
+	echo m68k-sun-sunos${UNAME_RELEASE}
+	exit ;;
+    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 ;;
+    aushp:SunOS:*:*)
+	echo sparc-auspex-sunos${UNAME_RELEASE}
+	exit ;;
+    # 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 ;;
+    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+	echo m68k-atari-mint${UNAME_RELEASE}
+        exit ;;
+    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+        echo m68k-atari-mint${UNAME_RELEASE}
+	exit ;;
+    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+        echo m68k-milan-mint${UNAME_RELEASE}
+        exit ;;
+    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+        echo m68k-hades-mint${UNAME_RELEASE}
+        exit ;;
+    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+        echo m68k-unknown-mint${UNAME_RELEASE}
+        exit ;;
+    m68k:machten:*:*)
+	echo m68k-apple-machten${UNAME_RELEASE}
+	exit ;;
+    powerpc:machten:*:*)
+	echo powerpc-apple-machten${UNAME_RELEASE}
+	exit ;;
+    RISC*:Mach:*:*)
+	echo mips-dec-mach_bsd4.3
+	exit ;;
+    RISC*:ULTRIX:*:*)
+	echo mips-dec-ultrix${UNAME_RELEASE}
+	exit ;;
+    VAX*:ULTRIX*:*:*)
+	echo vax-dec-ultrix${UNAME_RELEASE}
+	exit ;;
+    2020:CLIX:*:* | 2430:CLIX:*:*)
+	echo clipper-intergraph-clix${UNAME_RELEASE}
+	exit ;;
+    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 &&
+	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+	  SYSTEM_NAME=`$dummy $dummyarg` &&
+	    { echo "$SYSTEM_NAME"; exit; }
+	echo mips-mips-riscos${UNAME_RELEASE}
+	exit ;;
+    Motorola:PowerMAX_OS:*:*)
+	echo powerpc-motorola-powermax
+	exit ;;
+    Motorola:*:4.3:PL8-*)
+	echo powerpc-harris-powermax
+	exit ;;
+    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+	echo powerpc-harris-powermax
+	exit ;;
+    Night_Hawk:Power_UNIX:*:*)
+	echo powerpc-harris-powerunix
+	exit ;;
+    m88k:CX/UX:7*:*)
+	echo m88k-harris-cxux7
+	exit ;;
+    m88k:*:4*:R4*)
+	echo m88k-motorola-sysv4
+	exit ;;
+    m88k:*:3*:R3*)
+	echo m88k-motorola-sysv3
+	exit ;;
+    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 ;;
+    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
+	echo m88k-dolphin-sysv3
+	exit ;;
+    M88*:*:R3*:*)
+	# Delta 88k system running SVR3
+	echo m88k-motorola-sysv3
+	exit ;;
+    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+	echo m88k-tektronix-sysv3
+	exit ;;
+    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+	echo m68k-tektronix-bsd
+	exit ;;
+    *:IRIX*:*:*)
+	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+	exit ;;
+    ????????: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 ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
+    i*86:AIX:*:*)
+	echo i386-ibm-aix
+	exit ;;
+    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 ;;
+    *: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
+		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+		then
+			echo "$SYSTEM_NAME"
+		else
+			echo rs6000-ibm-aix3.2.5
+		fi
+	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 ;;
+    *: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 ;;
+    *:AIX:*:*)
+	echo rs6000-ibm-aix
+	exit ;;
+    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+	echo romp-ibm-bsd4.4
+	exit ;;
+    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
+	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
+	exit ;;                             # report: romp-ibm BSD 4.3
+    *:BOSX:*:*)
+	echo rs6000-bull-bosx
+	exit ;;
+    DPX/2?00:B.O.S.:*:*)
+	echo m68k-bull-sysv3
+	exit ;;
+    9000/[34]??:4.3bsd:1.*:*)
+	echo m68k-hp-bsd
+	exit ;;
+    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+	echo m68k-hp-bsd4.4
+	exit ;;
+    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
+	    eval $set_cc_for_build
+
+	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
+	    # generating 64-bit code.  GNU and HP use different nomenclature:
+	    #
+	    # $ CC_FOR_BUILD=cc ./config.guess
+	    # => hppa2.0w-hp-hpux11.23
+	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+	    # => hppa64-hp-hpux11.23
+
+	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+		grep __LP64__ >/dev/null
+	    then
+		HP_ARCH="hppa2.0w"
+	    else
+		HP_ARCH="hppa64"
+	    fi
+	fi
+	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+	exit ;;
+    ia64:HP-UX:*:*)
+	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+	echo ia64-hp-hpux${HPUX_REV}
+	exit ;;
+    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 && SYSTEM_NAME=`$dummy` &&
+		{ echo "$SYSTEM_NAME"; exit; }
+	echo unknown-hitachi-hiuxwe2
+	exit ;;
+    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+	echo hppa1.1-hp-bsd
+	exit ;;
+    9000/8??:4.3bsd:*:*)
+	echo hppa1.0-hp-bsd
+	exit ;;
+    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+	echo hppa1.0-hp-mpeix
+	exit ;;
+    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+	echo hppa1.1-hp-osf
+	exit ;;
+    hp8??:OSF1:*:*)
+	echo hppa1.0-hp-osf
+	exit ;;
+    i*86:OSF1:*:*)
+	if [ -x /usr/sbin/sysversion ] ; then
+	    echo ${UNAME_MACHINE}-unknown-osf1mk
+	else
+	    echo ${UNAME_MACHINE}-unknown-osf1
+	fi
+	exit ;;
+    parisc*:Lites*:*:*)
+	echo hppa1.1-hp-lites
+	exit ;;
+    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+	echo c1-convex-bsd
+        exit ;;
+    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+	if getsysinfo -f scalar_acc
+	then echo c32-convex-bsd
+	else echo c2-convex-bsd
+	fi
+        exit ;;
+    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+	echo c34-convex-bsd
+        exit ;;
+    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+	echo c38-convex-bsd
+        exit ;;
+    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+	echo c4-convex-bsd
+        exit ;;
+    CRAY*Y-MP:*:*:*)
+	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    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 ;;
+    CRAY*TS:*:*:*)
+	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*T3E:*:*:*)
+	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*SV1:*:*:*)
+	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    *:UNICOS/mp:*:*)
+	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    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 ;;
+    5000:UNIX_System_V:4.*:*)
+        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+	exit ;;
+    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+	exit ;;
+    sparc*:BSD/OS:*:*)
+	echo sparc-unknown-bsdi${UNAME_RELEASE}
+	exit ;;
+    *:BSD/OS:*:*)
+	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+	exit ;;
+    *:FreeBSD:*:*)
+	case ${UNAME_MACHINE} in
+	    pc98)
+		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	    amd64)
+		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	    *)
+		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	esac
+	exit ;;
+    i*:CYGWIN*:*)
+	echo ${UNAME_MACHINE}-pc-cygwin
+	exit ;;
+    i*:MINGW*:*)
+	echo ${UNAME_MACHINE}-pc-mingw32
+	exit ;;
+    i*:windows32*:*)
+    	# uname -m includes "-pc" on this system.
+    	echo ${UNAME_MACHINE}-mingw32
+	exit ;;
+    i*:PW*:*)
+	echo ${UNAME_MACHINE}-pc-pw32
+	exit ;;
+    x86:Interix*:[3456]*)
+	echo i586-pc-interix${UNAME_RELEASE}
+	exit ;;
+    EM64T:Interix*:[3456]*)
+	echo x86_64-unknown-interix${UNAME_RELEASE}
+	exit ;;
+    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+	echo i${UNAME_MACHINE}-pc-mks
+	exit ;;
+    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 ;;
+    i*:UWIN*:*)
+	echo ${UNAME_MACHINE}-pc-uwin
+	exit ;;
+    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+	echo x86_64-unknown-cygwin
+	exit ;;
+    p*:CYGWIN*:*)
+	echo powerpcle-unknown-cygwin
+	exit ;;
+    prep*:SunOS:5.*:*)
+	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    *:GNU:*:*)
+	# the GNU system
+	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+	exit ;;
+    *:GNU/*:*:*)
+	# other systems with GNU libc and userland
+	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+	exit ;;
+    i*86:Minix:*:*)
+	echo ${UNAME_MACHINE}-pc-minix
+	exit ;;
+    arm*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    avr32*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    cris:Linux:*:*)
+	echo cris-axis-linux-gnu
+	exit ;;
+    crisv32:Linux:*:*)
+	echo crisv32-axis-linux-gnu
+	exit ;;
+    frv:Linux:*:*)
+    	echo frv-unknown-linux-gnu
+	exit ;;
+    ia64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    m32r*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    m68*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    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 | sed -n '
+	    /^CPU/{
+		s: ::g
+		p
+	    }'`"
+	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+	;;
+    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 | sed -n '
+	    /^CPU/{
+		s: ::g
+		p
+	    }'`"
+	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+	;;
+    or32:Linux:*:*)
+	echo or32-unknown-linux-gnu
+	exit ;;
+    ppc:Linux:*:*)
+	echo powerpc-unknown-linux-gnu
+	exit ;;
+    ppc64:Linux:*:*)
+	echo powerpc64-unknown-linux-gnu
+	exit ;;
+    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 ;;
+    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 ;;
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
+	echo hppa64-unknown-linux-gnu
+	exit ;;
+    s390:Linux:*:* | s390x:Linux:*:*)
+	echo ${UNAME_MACHINE}-ibm-linux
+	exit ;;
+    sh64*:Linux:*:*)
+    	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    sh*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    sparc:Linux:*:* | sparc64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    vax:Linux:*:*)
+	echo ${UNAME_MACHINE}-dec-linux-gnu
+	exit ;;
+    x86_64:Linux:*:*)
+	echo x86_64-unknown-linux-gnu
+	exit ;;
+    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 ;;
+	  coff-i386)
+		echo "${UNAME_MACHINE}-pc-linux-gnucoff"
+		exit ;;
+	  "")
+		# 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 ;;
+	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
+	#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+	LIBC=gnu
+	#else
+	LIBC=gnuaout
+	#endif
+	#endif
+	#ifdef __dietlibc__
+	LIBC=dietlibc
+	#endif
+EOF
+	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+	    /^LIBC/{
+		s: ::g
+		p
+	    }'`"
+	test x"${LIBC}" != x && {
+		echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+		exit
+	}
+	test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
+	;;
+    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 ;;
+    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 ;;
+    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 ;;
+    i*86:XTS-300:*:STOP)
+	echo ${UNAME_MACHINE}-unknown-stop
+	exit ;;
+    i*86:atheos:*:*)
+	echo ${UNAME_MACHINE}-unknown-atheos
+	exit ;;
+    i*86:syllable:*:*)
+	echo ${UNAME_MACHINE}-pc-syllable
+	exit ;;
+    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+	echo i386-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    i*86:*DOS:*:*)
+	echo ${UNAME_MACHINE}-pc-msdosdjgpp
+	exit ;;
+    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 ;;
+    i*86:*:5:[678]*)
+    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
+	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 ;;
+    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 ;;
+    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 ;;
+    Intel:Mach:3*:*)
+	echo i386-pc-mach3
+	exit ;;
+    paragon:*:*:*)
+	echo i860-intel-osf1
+	exit ;;
+    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 ;;
+    mini*:CTIX:SYS*5:*)
+	# "miniframe"
+	echo m68010-convergent-sysv
+	exit ;;
+    mc68k:UNIX:SYSTEM5:3.51m)
+	echo m68k-convergent-sysv
+	exit ;;
+    M680?0:D-NIX:5.3:*)
+	echo m68k-diab-dnix
+	exit ;;
+    M68*:*:R3V[5678]*:*)
+	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+    3[345]??:*: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 | S7501*:*: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; }
+	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+          && { echo i486-ncr-sysv4; exit; } ;;
+    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+	echo m68k-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    mc68030:UNIX_System_V:4.*:*)
+	echo m68k-atari-sysv4
+	exit ;;
+    TSUNAMI:LynxOS:2.*:*)
+	echo sparc-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    rs6000:LynxOS:2.*:*)
+	echo rs6000-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+	echo powerpc-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    SM[BE]S:UNIX_SV:*:*)
+	echo mips-dde-sysv${UNAME_RELEASE}
+	exit ;;
+    RM*:ReliantUNIX-*:*:*)
+	echo mips-sni-sysv4
+	exit ;;
+    RM*:SINIX-*:*:*)
+	echo mips-sni-sysv4
+	exit ;;
+    *: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 ;;
+    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+                      # says <Richard.M.Bartel@ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit ;;
+    *:UNIX_System_V:4*:FTX*)
+	# From Gerald Hewes <hewes@openmarket.com>.
+	# How about differentiating between stratus architectures? -djm
+	echo hppa1.1-stratus-sysv4
+	exit ;;
+    *:*:*:FTX*)
+	# From seanf@swdc.stratus.com.
+	echo i860-stratus-sysv4
+	exit ;;
+    i*86:VOS:*:*)
+	# From Paul.Green@stratus.com.
+	echo ${UNAME_MACHINE}-stratus-vos
+	exit ;;
+    *:VOS:*:*)
+	# From Paul.Green@stratus.com.
+	echo hppa1.1-stratus-vos
+	exit ;;
+    mc68*:A/UX:*:*)
+	echo m68k-apple-aux${UNAME_RELEASE}
+	exit ;;
+    news*:NEWS-OS:6*:*)
+	echo mips-sony-newsos6
+	exit ;;
+    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 ;;
+    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
+	echo powerpc-be-beos
+	exit ;;
+    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
+	echo powerpc-apple-beos
+	exit ;;
+    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
+	echo i586-pc-beos
+	exit ;;
+    SX-4:SUPER-UX:*:*)
+	echo sx4-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-5:SUPER-UX:*:*)
+	echo sx5-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-6:SUPER-UX:*:*)
+	echo sx6-nec-superux${UNAME_RELEASE}
+	exit ;;
+    Power*:Rhapsody:*:*)
+	echo powerpc-apple-rhapsody${UNAME_RELEASE}
+	exit ;;
+    *:Rhapsody:*:*)
+	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+	exit ;;
+    *:Darwin:*:*)
+	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+	case $UNAME_PROCESSOR in
+	    unknown) UNAME_PROCESSOR=powerpc ;;
+	esac
+	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+	exit ;;
+    *: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 ;;
+    *:QNX:*:4*)
+	echo i386-pc-qnx
+	exit ;;
+    NSE-?:NONSTOP_KERNEL:*:*)
+	echo nse-tandem-nsk${UNAME_RELEASE}
+	exit ;;
+    NSR-?:NONSTOP_KERNEL:*:*)
+	echo nsr-tandem-nsk${UNAME_RELEASE}
+	exit ;;
+    *:NonStop-UX:*:*)
+	echo mips-compaq-nonstopux
+	exit ;;
+    BS2000:POSIX*:*:*)
+	echo bs2000-siemens-sysv
+	exit ;;
+    DS/*:UNIX_System_V:*:*)
+	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+	exit ;;
+    *: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 ;;
+    *:TOPS-10:*:*)
+	echo pdp10-unknown-tops10
+	exit ;;
+    *:TENEX:*:*)
+	echo pdp10-unknown-tenex
+	exit ;;
+    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+	echo pdp10-dec-tops20
+	exit ;;
+    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+	echo pdp10-xkl-tops20
+	exit ;;
+    *:TOPS-20:*:*)
+	echo pdp10-unknown-tops20
+	exit ;;
+    *:ITS:*:*)
+	echo pdp10-unknown-its
+	exit ;;
+    SEI:*:*:SEIUX)
+        echo mips-sei-seiux${UNAME_RELEASE}
+	exit ;;
+    *:DragonFly:*:*)
+	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+	exit ;;
+    *:*VMS:*:*)
+    	UNAME_MACHINE=`(uname -p) 2>/dev/null`
+	case "${UNAME_MACHINE}" in
+	    A*) echo alpha-dec-vms ; exit ;;
+	    I*) echo ia64-dec-vms ; exit ;;
+	    V*) echo vax-dec-vms ; exit ;;
+	esac ;;
+    *:XENIX:*:SysV)
+	echo i386-pc-xenix
+	exit ;;
+    i*86:skyos:*:*)
+	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+	exit ;;
+    i*86:rdos:*:*)
+	echo ${UNAME_MACHINE}-pc-rdos
+	exit ;;
+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\n"); 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 && SYSTEM_NAME=`$dummy` &&
+	{ echo "$SYSTEM_NAME"; exit; }
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
+
+# 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 ;;
+    c2*)
+	if getsysinfo -f scalar_acc
+	then echo c32-convex-bsd
+	else echo c2-convex-bsd
+	fi
+	exit ;;
+    c34*)
+	echo c34-convex-bsd
+	exit ;;
+    c38*)
+	echo c38-convex-bsd
+	exit ;;
+    c4*)
+	echo c4-convex-bsd
+	exit ;;
+    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
+
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
+and
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
+
+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:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/config.sub	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,1608 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
+#   Inc.
+
+timestamp='2006-07-02'
+
+# 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., 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.
+
+
+# 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, 2002, 2003, 2004, 2005
+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 ;;
+    --version | -v )
+       echo "$version" ; exit ;;
+    --help | --h* | -h )
+       echo "$usage"; exit ;;
+    -- )     # 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 ;;
+
+    * )
+       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* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-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 | -knuth | -cray)
+		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
+		;;
+	-sco6)
+		os=-sco5v6
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-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/'`
+		;;
+	-sco5v6*)
+		# 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] \
+	| am33_2.0 \
+	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+	| bfin \
+	| c4x | clipper \
+	| d10v | d30v | dlx | dsp16xx \
+	| fr30 | frv \
+	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+	| i370 | i860 | i960 | ia64 \
+	| ip2k | iq2000 \
+	| m32c | m32r | m32rle | m68000 | m68k | m88k \
+	| maxq | mb | microblaze | mcore \
+	| mips | mipsbe | mipseb | mipsel | mipsle \
+	| mips16 \
+	| mips64 | mips64el \
+	| mips64vr | mips64vrel \
+	| mips64orion | mips64orionel \
+	| mips64vr4100 | mips64vr4100el \
+	| mips64vr4300 | mips64vr4300el \
+	| mips64vr5000 | mips64vr5000el \
+	| mips64vr5900 | mips64vr5900el \
+	| mipsisa32 | mipsisa32el \
+	| mipsisa32r2 | mipsisa32r2el \
+	| mipsisa64 | mipsisa64el \
+	| mipsisa64r2 | mipsisa64r2el \
+	| mipsisa64sb1 | mipsisa64sb1el \
+	| mipsisa64sr71k | mipsisa64sr71kel \
+	| mipstx39 | mipstx39el \
+	| mn10200 | mn10300 \
+	| mt \
+	| msp430 \
+	| nios | nios2 \
+	| ns16k | ns32k \
+	| or32 \
+	| pdp10 | pdp11 | pj | pjl \
+	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+	| pyramid \
+	| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+	| sh64 | sh64le \
+	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+	| spu | strongarm \
+	| tahoe | thumb | tic4x | tic80 | tron \
+	| v850 | v850e \
+	| we32k \
+	| x86 | xscale | xscalee[bl] | 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)
+		;;
+	ms1)
+		basic_machine=mt-unknown
+		;;
+
+	# 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-* | avr32-* \
+	| bfin-* | bs2000-* \
+	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+	| clipper-* | craynv-* | 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-* | iq2000-* \
+	| m32c-* | m32r-* | m32rle-* \
+	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+	| m88110-* | m88k-* | maxq-* | mcore-* \
+	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+	| mips16-* \
+	| mips64-* | mips64el-* \
+	| mips64vr-* | mips64vrel-* \
+	| mips64orion-* | mips64orionel-* \
+	| mips64vr4100-* | mips64vr4100el-* \
+	| mips64vr4300-* | mips64vr4300el-* \
+	| mips64vr5000-* | mips64vr5000el-* \
+	| mips64vr5900-* | mips64vr5900el-* \
+	| mipsisa32-* | mipsisa32el-* \
+	| mipsisa32r2-* | mipsisa32r2el-* \
+	| mipsisa64-* | mipsisa64el-* \
+	| mipsisa64r2-* | mipsisa64r2el-* \
+	| mipsisa64sb1-* | mipsisa64sb1el-* \
+	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
+	| mipstx39-* | mipstx39el-* \
+	| mmix-* \
+	| mt-* \
+	| msp430-* \
+	| nios-* | nios2-* \
+	| none-* | np1-* | ns16k-* | ns32k-* \
+	| orion-* \
+	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+	| pyramid-* \
+	| romp-* | rs6000-* \
+	| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+	| sparclite-* \
+	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+	| tahoe-* | thumb-* \
+	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+	| tron-* \
+	| v850-* | v850e-* | vax-* \
+	| we32k-* \
+	| x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \
+	| 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
+		;;
+    	abacus)
+		basic_machine=abacus-unknown
+		;;
+	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
+		;;
+	amd64-*)
+		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	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
+		;;
+	craynv)
+		basic_machine=craynv-cray
+		os=-unicosmp
+		;;
+	cr16c)
+		basic_machine=cr16c-unknown
+		os=-elf
+		;;
+	crds | unos)
+		basic_machine=m68k-crds
+		;;
+	crisv32 | crisv32-* | etraxfs*)
+		basic_machine=crisv32-axis
+		;;
+	cris | cris-* | etrax*)
+		basic_machine=cris-axis
+		;;
+	crx)
+		basic_machine=crx-unknown
+		os=-elf
+		;;
+	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
+		;;
+	djgpp)
+		basic_machine=i586-pc
+		os=-msdosdjgpp
+		;;
+	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
+		;;
+	monitor)
+		basic_machine=m68k-rom68k
+		os=-coff
+		;;
+	morphos)
+		basic_machine=powerpc-unknown
+		os=-morphos
+		;;
+	msdos)
+		basic_machine=i386-pc
+		os=-msdos
+		;;
+	ms1-*)
+		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+		;;
+	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
+		;;
+	nsr-tandem)
+		basic_machine=nsr-tandem
+		;;
+	op50n-* | op60c-*)
+		basic_machine=hppa1.1-oki
+		os=-proelf
+		;;
+	openrisc | openrisc-*)
+		basic_machine=or32-unknown
+		;;
+	os400)
+		basic_machine=powerpc-ibm
+		os=-os400
+		;;
+	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
+		;;
+	pc98)
+		basic_machine=i386-pc
+		;;
+	pc98-*)
+		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	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
+		;;
+	rdos)
+		basic_machine=i386-pc
+		os=-rdos
+		;;
+	rom68k)
+		basic_machine=m68k-rom68k
+		os=-coff
+		;;
+	rm[46]00)
+		basic_machine=mips-siemens
+		;;
+	rtpc | rtpc-*)
+		basic_machine=romp-ibm
+		;;
+	s390 | s390-*)
+		basic_machine=s390-ibm
+		;;
+	s390x | s390x-*)
+		basic_machine=s390x-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
+		;;
+	tpf)
+		basic_machine=s390x-ibm
+		os=-tpf
+		;;
+	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
+		;;
+	xbox)
+		basic_machine=i686-pc
+		os=-mingw32
+		;;
+	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
+		;;
+	mmix)
+		basic_machine=mmix-knuth
+		;;
+	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
+		;;
+	sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
+		basic_machine=sh-unknown
+		;;
+	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+		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* | -knetbsd* | -mirbsd* | -netbsd* \
+	      | -openbsd* | -solidbsd* \
+	      | -ekkobsd* | -kfreebsd* | -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* | -linux-newlib* | -linux-uclibc* \
+	      | -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* | -dragonfly* \
+	      | -skyos* | -haiku* | -rdos* | -toppers*)
+	# 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* | -haiku* \
+	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+		;;
+	-mac*)
+		os=`echo $os | sed -e 's|mac|macos|'`
+		;;
+	-linux-dietlibc)
+		os=-linux-dietlibc
+		;;
+	-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
+		;;
+        -os400*)
+		os=-os400
+		;;
+	-wince*)
+		os=-wince
+		;;
+	-osfrose*)
+		os=-osfrose
+		;;
+	-osf*)
+		os=-osf
+		;;
+	-utek*)
+		os=-bsd
+		;;
+	-dynix*)
+		os=-bsd
+		;;
+	-acis*)
+		os=-aos
+		;;
+	-atheos*)
+		os=-atheos
+		;;
+	-syllable*)
+		os=-syllable
+		;;
+	-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
+		;;
+        -tpf*)
+		os=-tpf
+		;;
+	-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
+		;;
+	-zvmoe)
+		os=-zvmoe
+		;;
+	-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
+        spu-*)
+		os=-elf
+		;;
+	*-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
+		;;
+	*-haiku)
+		os=-haiku
+		;;
+	*-ibm)
+		os=-aix
+		;;
+    	*-knuth)
+		os=-mmixware
+		;;
+	*-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
+				;;
+			-os400*)
+				vendor=ibm
+				;;
+			-ptx*)
+				vendor=sequent
+				;;
+			-tpf*)
+				vendor=ibm
+				;;
+			-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
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/configure	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,24980 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.61 for io_lib 1.12.2.
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006 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 more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+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
+
+
+
+
+# PATH needs CR
+# 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
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+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
+IFS=$as_save_IFS
+
+     ;;
+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_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+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) >/dev/null 2>&1 && $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+if test "x$CONFIG_SHELL" = x; then
+  if (eval ":") 2>/dev/null; then
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+
+  if test $as_have_required = yes && 	 (eval ":
+(as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=\$LINENO
+  as_lineno_2=\$LINENO
+  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+  :
+else
+  as_candidate_shells=
+    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=.
+  case $as_dir in
+	 /*)
+	   for as_base in sh bash ksh sh5; do
+	     as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+	   done;;
+       esac
+done
+IFS=$as_save_IFS
+
+
+      for as_shell in $as_candidate_shells $SHELL; do
+	 # Try only shells that exist, to save several forks.
+	 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+		{ ("$as_shell") 2> /dev/null <<\_ASEOF
+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
+
+
+:
+_ASEOF
+}; then
+  CONFIG_SHELL=$as_shell
+	       as_have_required=yes
+	       if { "$as_shell" 2> /dev/null <<\_ASEOF
+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
+
+
+:
+(as_func_return () {
+  (exit $1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+  break
+fi
+
+fi
+
+      done
+
+      if test "x$CONFIG_SHELL" != x; then
+  for as_var in BASH_ENV ENV
+        do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+        done
+        export CONFIG_SHELL
+        exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+    if test $as_have_required = no; then
+  echo This script requires a shell more modern than all the
+      echo shells that I found on your system.  Please install a
+      echo modern shell, or manually run the script under such a
+      echo shell if you do have one.
+      { (exit 1); exit 1; }
+fi
+
+
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+  echo No shell found that supports shell functions.
+  echo Please tell autoconf@gnu.org about your system,
+  echo including any error possibly output before this
+  echo message
+}
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # 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 after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, 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
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\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 sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir
+fi
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s='ln -s'
+  # ... but there are two gotchas:
+  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+  # In both cases, we have to default to `cp -p'.
+  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+    as_ln_s='cp -p'
+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$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+        test -d "$1/.";
+      else
+	case $1 in
+        -*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+
+
+# 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
+
+exec 7<&0 </dev/null 6>&1
+
+# 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`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Identity of this package.
+PACKAGE_NAME='io_lib'
+PACKAGE_TARNAME='io_lib'
+PACKAGE_VERSION='1.12.2'
+PACKAGE_STRING='io_lib 1.12.2'
+PACKAGE_BUGREPORT=''
+
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef 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
+datarootdir
+datadir
+sysconfdir
+sharedstatedir
+localstatedir
+includedir
+oldincludedir
+docdir
+infodir
+htmldir
+dvidir
+pdfdir
+psdir
+libdir
+localedir
+mandir
+DEFS
+ECHO_C
+ECHO_N
+ECHO_T
+LIBS
+build_alias
+host_alias
+target_alias
+INSTALL_PROGRAM
+INSTALL_SCRIPT
+INSTALL_DATA
+CYGPATH_W
+PACKAGE
+VERSION
+ACLOCAL
+AUTOCONF
+AUTOMAKE
+AUTOHEADER
+MAKEINFO
+install_sh
+STRIP
+INSTALL_STRIP_PROGRAM
+mkdir_p
+AWK
+SET_MAKE
+am__leading_dot
+AMTAR
+am__tar
+am__untar
+MAINTAINER_MODE_TRUE
+MAINTAINER_MODE_FALSE
+MAINT
+VERS_CURRENT
+VERS_REVISION
+VERS_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
+build
+build_cpu
+build_vendor
+build_os
+host
+host_cpu
+host_vendor
+host_os
+GREP
+EGREP
+LN_S
+ECHO
+AR
+RANLIB
+CPP
+CXX
+CXXFLAGS
+ac_ct_CXX
+CXXDEPMODE
+am__fastdepCXX_TRUE
+am__fastdepCXX_FALSE
+CXXCPP
+F77
+FFLAGS
+ac_ct_F77
+LIBTOOL
+_libcurl_config
+LIBCURL_CPPFLAGS
+LIBCURL
+LIBZ
+HAVE_ZLIB_TRUE
+HAVE_ZLIB_FALSE
+LIBOBJS
+LTLIBOBJS'
+ac_subst_files=''
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP
+CXX
+CXXFLAGS
+CCC
+CXXCPP
+F77
+FFLAGS'
+
+
+# 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.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+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
+
+  case $ac_option in
+  *=*)	ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *)	ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -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)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$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 ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -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'`
+    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 ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$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 ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    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 ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$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'`
+    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; }; }
+    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 directory names.
+for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
+		datadir sysconfdir sharedstatedir localstatedir includedir \
+		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+		libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; }
+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
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  { echo "$as_me: error: Working directory cannot be determined" >&2
+   { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  { echo "$as_me: error: pwd does not report name of working directory" >&2
+   { (exit 1); exit 1; }; }
+
+
+# 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 the parent directory.
+  ac_confdir=`$as_dirname -- "$0" ||
+$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
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+	cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
+   { (exit 1); exit 1; }; }
+	pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# 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 io_lib 1.12.2 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 \`..']
+
+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]
+  --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]
+  --datarootdir=DIR      read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR          read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR          info documentation [DATAROOTDIR/info]
+  --localedir=DIR        locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR           man documentation [DATAROOTDIR/man]
+  --docdir=DIR           documentation root [DATAROOTDIR/doc/io_lib]
+  --htmldir=DIR          html documentation [DOCDIR]
+  --dvidir=DIR           dvi documentation [DOCDIR]
+  --pdfdir=DIR           pdf documentation [DOCDIR]
+  --psdir=DIR            ps documentation [DOCDIR]
+_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
+
+System types:
+  --build=BUILD     configure for building on BUILD [guessed]
+  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+  case $ac_init_help in
+     short | recursive ) echo "Configuration of io_lib 1.12.2:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --enable-maintainer-mode  enable make rules and dependencies not useful
+			  (and sometimes confusing) to the casual installer
+  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors
+  --enable-shared[=PKGS]  build shared libraries [default=yes]
+  --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-largefile     omit support for large files
+
+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-libcurl=DIR      look for the curl library in DIR
+  --with-zlib=DIR         look for zlib in DIR
+
+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>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    C/C++/Objective 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
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" || continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested 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
+    else
+      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+io_lib configure 1.12.2
+generated by GNU Autoconf 2.61
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006 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
+fi
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by io_lib $as_me 1.12.2, which was
+generated by GNU Autoconf 2.61.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+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`
+/usr/bin/hostinfo      = `(/usr/bin/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
+IFS=$as_save_IFS
+
+} >&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_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_arg'"
+      ;;
+    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: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+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,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+	"s/'\''/'\''\\\\'\'''\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+	eval ac_val=\$$ac_var
+	case $ac_val in
+	*\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+	esac
+	echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      echo "$as_me: caught signal $ac_signal"
+    echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r 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 -f -r conftest* 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 -n "$CONFIG_SITE"; then
+  set x "$CONFIG_SITE"
+elif test "x$prefix" != xNONE; then
+  set x "$prefix/share/config.site" "$prefix/etc/config.site"
+else
+  set x "$ac_default_prefix/share/config.site" \
+	"$ac_default_prefix/etc/config.site"
+fi
+shift
+for ac_site_file
+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 $ac_precious_vars; 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_config_headers="$ac_config_headers io_lib_config.h"
+
+am__api_version="1.9"
+ac_aux_dir=
+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; 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 \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
+echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# 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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+
+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.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    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 -f 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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 x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+	@echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$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='io_lib'
+ VERSION='1.12.2'
+
+
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+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 -'
+
+
+
+
+
+{ echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6; }
+    # Check whether --enable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then
+  enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
+else
+  USE_MAINTAINER_MODE=no
+fi
+
+  { echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
+echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6; }
+
+
+if test $USE_MAINTAINER_MODE = yes; then
+  MAINTAINER_MODE_TRUE=
+  MAINTAINER_MODE_FALSE='#'
+else
+  MAINTAINER_MODE_TRUE='#'
+  MAINTAINER_MODE_FALSE=
+fi
+
+  MAINT=$MAINTAINER_MODE_TRUE
+
+
+
+# For my own benefit, here's a summary of how versioning should work.
+#
+# Library versioning, not to be confused with the release number:
+# Update VERS_CURRENT when an interface changes in an incompatible manner.
+#     eg. change of struct, removing a function, changing a prototype.
+#     Also increment this when we add new functions in a backwards compatible
+#     manner, but update VERS_AGE too (see below).
+#
+# Update VERS_REVISION whenever VERS_CURRENT hasn't changed, but the source
+#     code has. (Otherwise reset revision to 0).
+#
+# Update VERS_AGE if new interfaces have been added, causing VERS_CURRENT to
+#        be incremented too. The idea is that if the previous values are
+#        VERS_CURRENT=2, VERS_AGE=0 then after adding a new function we
+#        get VERS_CURRENT=3, VERS_AGE=1 (ie ABI compat with vers 2 or 3).
+#
+# Also see:
+# http://www.gnu.org/software/libtool/manual/libtool.html#Updating-version-info
+
+# Example: We have io_lib 1.11.6 implementing ABI vers 0, rev 6, age 0.
+# Our library has an soname of libstaden-read.so.0 and files as follows:
+#       (SONAME      libstaden-read.so.0)
+# 	libstaden-read.so -> libstaden-read.so.0.0.6
+#       libstaden-read.so.0 -> libstaden-read.so.0.0.6
+#       libstaden-read.so.0.0.6
+#
+# We then release io_lib 1.12.0 with modified structs, so it's incompatible.
+# We bump to ABI vers 1, rev 0, age 0 - giving:
+#       (SONAME      libstaden-read.so.1)
+# 	libstaden-read.so -> libstaden-read.so.1.0.0
+#       libstaden-read.so.1 -> libstaden-read.so.1.0.0
+#       libstaden-read.so.1.0.0
+#
+# If in 1.12.1 to 1.12.5 we then perform several successive minor tweaks (bug
+# fix, optimisation, etc) that do not change the ABI at all, we may
+# end up with ABI vers 1, rev 5, age 0:
+#       (SONAME      libstaden-read.so.1)
+# 	libstaden-read.so -> libstaden-read.so.1.0.5
+#       libstaden-read.so.1 -> libstaden-read.so.1.0.5
+#       libstaden-read.so.1.0.5
+#
+# And assume in 1.13.0 we add an extra public function. Code linked
+# against 1.12.x still works (aka library version 1) meaning our
+# soname doesn't change, but we do update ABI version: vers 2, rev 0, age 1.
+#       (SONAME      libstaden-read.so.1)
+# 	libstaden-read.so -> libstaden-read.so.1.1.0
+#       libstaden-read.so.1 -> libstaden-read.so.1.1.0
+#       libstaden-read.so.1.1.0
+
+VERS_CURRENT=2
+VERS_REVISION=0
+VERS_AGE=1
+
+
+
+
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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.exe
+  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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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.exe
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+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`
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -V >&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[^ ]*//'`
+#
+# List of possible output files, starting from the most likely.
+# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
+# only as a last resort.  b.out is created by i960 compilers.
+ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
+#
+# The IRIX 6 linker writes into existing files which may not be
+# executable, retaining their permissions.  Remove them first so a
+# subsequent execution test works.
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { (ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
+	;;
+    [ab].out )
+	# We found the default executable, but exeext='' is most
+	# certainly right.
+	break;;
+    *.* )
+        if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+	then :; else
+	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	fi
+	# We set ac_cv_exeext here because the later test for it is not
+	# safe: cross compilers may not add the suffix if given an `-o'
+	# argument, so we may need to know it at that point already.
+	# Even if this section looks crufty: it has the advantage of
+	# actually working.
+	break;;
+    * )
+	break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+
+{ echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6; }
+if test -z "$ac_file"; then
+  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
+
+# Check that 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'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 that 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 { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 | *.map | *.inf | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	  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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
+    *) 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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; 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 core 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
+{ 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
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	CFLAGS=""
+      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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_c_werror_flag=$ac_save_c_werror_flag
+	 CFLAGS="-g"
+	 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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+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 ISO C89" >&5
+echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_prog_cc_c89=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 -std 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 -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 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
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_c89=$ac_arg
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6; } ;;
+  xno)
+    { echo "$as_me:$LINENO: result: unsupported" >&5
+echo "${ECHO_T}unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+
+
+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 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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+
+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.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    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'
+
+# Check whether --enable-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=yes
+fi
+
+
+# Check whether --enable-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 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
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+echo "$as_me: error: cannot run $SHELL $ac_aux_dir/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_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  { { 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=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_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; }
+case $ac_cv_build in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+echo "$as_me: error: invalid value of canonical build" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ 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
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+echo "$as_me: error: invalid value of canonical host" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+{ 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
+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 grep that handles long lines and -e" >&5
+echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # Extract the first word of "grep ggrep" to use in msg output
+if test -z "$GREP"; then
+set dummy grep ggrep; ac_prog_name=$2
+if test "${ac_cv_path_GREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_path_GREP_found=false
+# Loop through the user's path and test for each of PROGNAME-LIST
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in grep ggrep; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
+    ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+    { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+    # Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+
+    $ac_path_GREP_found && break 3
+  done
+done
+
+done
+IFS=$as_save_IFS
+
+
+fi
+
+GREP="$ac_cv_path_GREP"
+if test -z "$GREP"; then
+  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
+echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
+if test "${ac_cv_path_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_path_EGREP="$GREP -E"
+   else
+     # Extract the first word of "egrep" to use in msg output
+if test -z "$EGREP"; then
+set dummy egrep; ac_prog_name=$2
+if test "${ac_cv_path_EGREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_path_EGREP_found=false
+# Loop through the user's path and test for each of PROGNAME-LIST
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in egrep; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
+    ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+    { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+    # Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+
+    $ac_path_EGREP_found && break 3
+  done
+done
+
+done
+IFS=$as_save_IFS
+
+
+fi
+
+EGREP="$ac_cv_path_EGREP"
+if test -z "$EGREP"; then
+  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+
+   fi
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
+echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+
+# Check whether --with-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* | 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* | k*bsd*-gnu)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+netbsd* | netbsdelf*-gnu)
+  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 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 4459 "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 { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      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 { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.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 nonexistent 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 { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.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 { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.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 nonexistent 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 { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; 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 core 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>
+#include <stdlib.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))
+      return 2;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 core.conftest.* 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 { as_var=$as_ac_Header; eval "test \"\${$as_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.  */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; 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 core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.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;}
+
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&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=cpp
+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 -z "$CXX"; then
+  if test -n "$CCC"; then
+    CXX=$CCC
+  else
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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 g++ c++ gpp aCC CC cxx cc++ cl.exe 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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
+
+  if test "x$ac_ct_CXX" = x; then
+    CXX="g++"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CXX=$ac_ct_CXX
+  fi
+fi
+
+  fi
+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`
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -V >&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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; 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 core 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
+{ 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
+  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
+   ac_cxx_werror_flag=yes
+   ac_cv_prog_cxx_g=no
+   CXXFLAGS="-g"
+   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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cxx_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	CXXFLAGS=""
+      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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+	 CXXFLAGS="-g"
+	 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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cxx_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+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
+ac_ext=cpp
+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=cpp
+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 { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.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 nonexistent 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 { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.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 { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.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 nonexistent 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 { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.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=cpp
+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 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn
+  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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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
+
+  if test "x$ac_ct_F77" = x; then
+    F77=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    F77=$ac_ct_F77
+  fi
+fi
+
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -V >&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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_f77_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_f77_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; 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 core 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* | k*bsd*-gnu)
+  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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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
+
+  if test "x$ac_ct_AR" = x; then
+    AR="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    AR=$ac_ct_AR
+  fi
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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
+
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+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 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 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:7186: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:7190: \$? = $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* | k*bsd*-gnu)
+      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:7454: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:7458: \$? = $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:7558: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:7562: \$? = $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* | k*bsd*-gnu)
+      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
+	link_all_deplibs=no
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    netbsd* | netbsdelf*-gnu)
+      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 { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      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 { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      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* | 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* | netbsdelf*-gnu)
+      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
+  ;;
+
+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* | k*bsd*-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'
+  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
+
+  # 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)); 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 /usr/lib $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'
+  ;;
+
+netbsdelf*-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='NetBSD ld.elf_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 GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      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 GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+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
+#endif
+
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      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 GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      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 GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+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
+#endif
+
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      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 GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      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 GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      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 GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      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 9855 "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 9955 "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
+
+# 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=$lt_predep_objects
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects
+
+# 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=$lt_compiler_lib_search_path
+
+# 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=$lt_sys_lib_search_path_spec
+
+# 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 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=cpp
+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 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 { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      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 { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      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* | 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* | k*bsd*-gnu)
+    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* | netbsdelf*-gnu)
+    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* | 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* | k*bsd*-gnu)
+	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* | netbsdelf*-gnu)
+	;;
+      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:12291: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:12295: \$? = $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:12395: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:12399: \$? = $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'
+  ;;
+  linux* | k*bsd*-gnu)
+    link_all_deplibs_CXX=no
+  ;;
+  *)
+    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
+  ;;
+
+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* | k*bsd*-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'
+  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
+
+  # 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)); 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 /usr/lib $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'
+  ;;
+
+netbsdelf*-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='NetBSD ld.elf_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
+
+# 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=$lt_predep_objects_CXX
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_CXX
+
+# 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=$lt_compiler_lib_search_path_CXX
+
+# 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=$lt_sys_lib_search_path_spec
+
+# 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* | k*bsd*-gnu)
+      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:13956: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:13960: \$? = $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:14060: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:14064: \$? = $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* | k*bsd*-gnu)
+      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
+	link_all_deplibs_F77=no
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+
+    netbsd* | netbsdelf*-gnu)
+      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 { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_f77_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      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 { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_f77_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      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* | 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* | netbsdelf*-gnu)
+      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
+  ;;
+
+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* | k*bsd*-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'
+  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
+
+  # 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)); 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 /usr/lib $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'
+  ;;
+
+netbsdelf*-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='NetBSD ld.elf_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
+
+# 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=$lt_predep_objects_F77
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_F77
+
+# 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=$lt_compiler_lib_search_path_F77
+
+# 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=$lt_sys_lib_search_path_spec
+
+# 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:16247: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:16251: \$? = $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* | k*bsd*-gnu)
+      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:16515: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:16519: \$? = $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:16619: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:16623: \$? = $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* | k*bsd*-gnu)
+      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
+	link_all_deplibs_GCJ=no
+      else
+	ld_shlibs_GCJ=no
+      fi
+      ;;
+
+    netbsd* | netbsdelf*-gnu)
+      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 { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      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 { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      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* | 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* | netbsdelf*-gnu)
+      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
+  ;;
+
+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* | k*bsd*-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'
+  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
+
+  # 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)); 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 /usr/lib $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'
+  ;;
+
+netbsdelf*-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='NetBSD ld.elf_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
+
+# 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=$lt_predep_objects_GCJ
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_GCJ
+
+# 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=$lt_compiler_lib_search_path_GCJ
+
+# 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=$lt_sys_lib_search_path_spec
+
+# 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
+
+# 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=$lt_predep_objects_RC
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_RC
+
+# 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=$lt_compiler_lib_search_path_RC
+
+# 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=$lt_sys_lib_search_path_spec
+
+# 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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# by Marcelo Magallon <mmagallo@efis.ucr.ac.cr>
+# Turn around -rpath problem with libtool 1.0c
+# This define should be improbable enough to not conflict with anything.
+echo host=$host
+case ${host} in
+  *-linux-gnu)
+    { echo "$as_me:$LINENO: result: Fixing libtool for -rpath problems." >&5
+echo "${ECHO_T}Fixing libtool for -rpath problems." >&6; }
+    sed < libtool > libtool-2 \
+    's/^hardcode_libdir_flag_spec.*$'/'hardcode_libdir_flag_spec=""/'
+    mv libtool-2 libtool
+    chmod 755 libtool
+  ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-libcurl was given.
+if test "${with_libcurl+set}" = set; then
+  withval=$with_libcurl; _libcurl_with=$withval
+else
+  _libcurl_with=yes
+fi
+
+
+  if test "$_libcurl_with" != "no" ; then
+
+     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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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
+
+
+     _libcurl_version_parse="eval $AWK '{split(\$NF,A,\".\"); X=256*256*A[1]+256*A[2]+A[3]; print X;}'"
+
+     _libcurl_try_link=yes
+
+     if test -d "$_libcurl_with" ; then
+        LIBCURL_CPPFLAGS="-I$withval/include"
+        _libcurl_ldflags="-L$withval/lib"
+        # Extract the first word of ""$withval/bin/curl-config"", so it can be a program name with args.
+set dummy "$withval/bin/curl-config"; 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_path__libcurl_config+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $_libcurl_config in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path__libcurl_config="$_libcurl_config" # Let the user override the test with a path.
+  ;;
+  *)
+  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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path__libcurl_config="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+_libcurl_config=$ac_cv_path__libcurl_config
+if test -n "$_libcurl_config"; then
+  { echo "$as_me:$LINENO: result: $_libcurl_config" >&5
+echo "${ECHO_T}$_libcurl_config" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+     else
+	# Extract the first word of "curl-config", so it can be a program name with args.
+set dummy curl-config; 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_path__libcurl_config+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $_libcurl_config in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path__libcurl_config="$_libcurl_config" # Let the user override the test with a path.
+  ;;
+  *)
+  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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path__libcurl_config="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+_libcurl_config=$ac_cv_path__libcurl_config
+if test -n "$_libcurl_config"; then
+  { echo "$as_me:$LINENO: result: $_libcurl_config" >&5
+echo "${ECHO_T}$_libcurl_config" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+     fi
+
+     if test x$_libcurl_config != "x" ; then
+        { echo "$as_me:$LINENO: checking for the version of libcurl" >&5
+echo $ECHO_N "checking for the version of libcurl... $ECHO_C" >&6; }
+if test "${libcurl_cv_lib_curl_version+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  libcurl_cv_lib_curl_version=`$_libcurl_config --version | $AWK '{print $2}'`
+fi
+{ echo "$as_me:$LINENO: result: $libcurl_cv_lib_curl_version" >&5
+echo "${ECHO_T}$libcurl_cv_lib_curl_version" >&6; }
+
+	_libcurl_version=`echo $libcurl_cv_lib_curl_version | $_libcurl_version_parse`
+	_libcurl_wanted=`echo 0 | $_libcurl_version_parse`
+
+        if test $_libcurl_wanted -gt 0 ; then
+	   { echo "$as_me:$LINENO: checking for libcurl >= version " >&5
+echo $ECHO_N "checking for libcurl >= version ... $ECHO_C" >&6; }
+if test "${libcurl_cv_lib_version_ok+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+   	      if test $_libcurl_version -ge $_libcurl_wanted ; then
+	         libcurl_cv_lib_version_ok=yes
+      	      else
+	         libcurl_cv_lib_version_ok=no
+  	      fi
+
+fi
+{ echo "$as_me:$LINENO: result: $libcurl_cv_lib_version_ok" >&5
+echo "${ECHO_T}$libcurl_cv_lib_version_ok" >&6; }
+        fi
+
+	if test $_libcurl_wanted -eq 0 || test x$libcurl_cv_lib_version_ok = xyes ; then
+           if test x"$LIBCURL_CPPFLAGS" = "x" ; then
+              LIBCURL_CPPFLAGS=`$_libcurl_config --cflags`
+           fi
+           if test x"$LIBCURL" = "x" ; then
+	      # libcurl-config --libs gives a ridiculous number of libraries
+	      # check to see if we can actually link just using -lcurl
+
+	      LIBCURL=${LIBCURL-"$_libcurl_ldflags -lcurl"}
+
+	      { echo "$as_me:$LINENO: checking whether libcurl just needs -lcurl" >&5
+echo $ECHO_N "checking whether libcurl just needs -lcurl... $ECHO_C" >&6; }
+if test "${libcurl_cv_lib_curl_only_needs_minus_l_curl+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+		_libcurl_save_cppflags=$CPPFLAGS
+           	CPPFLAGS="$LIBCURL_CPPFLAGS $CPPFLAGS"
+           	_libcurl_save_libs=$LIBS
+           	LIBS="$LIBCURL $LIBS"
+
+		cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <curl/curl.h>
+int
+main ()
+{
+
+/* Try and use a few common options to force a failure if we are
+   missing symbols or can't link. */
+int x;
+curl_easy_setopt(NULL,CURLOPT_URL,NULL);
+x=CURL_ERROR_SIZE;
+x=CURLOPT_WRITEFUNCTION;
+x=CURLOPT_FILE;
+x=CURLOPT_ERRORBUFFER;
+x=CURLOPT_STDERR;
+x=CURLOPT_VERBOSE;
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  libcurl_cv_lib_curl_only_needs_minus_l_curl=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	libcurl_cv_lib_curl_only_needs_minus_l_curl=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+
+          	CPPFLAGS=$_libcurl_save_cppflags
+           	LIBS=$_libcurl_save_libs
+           	unset _libcurl_save_cppflags
+           	unset _libcurl_save_libs
+
+fi
+{ echo "$as_me:$LINENO: result: $libcurl_cv_lib_curl_only_needs_minus_l_curl" >&5
+echo "${ECHO_T}$libcurl_cv_lib_curl_only_needs_minus_l_curl" >&6; }
+
+
+		if test "x$libcurl_cv_lib_curl_only_needs_minus_l_curl" != xyes ; then
+                   LIBCURL=`$_libcurl_config --libs`
+		fi
+
+              # This is so silly, but Apple actually has a bug in their
+	      # curl-config script.  Fixed in Tiger, but there are still
+	      # lots of Panther installs around.
+              case "${host}" in
+                 powerpc-apple-darwin7*)
+                    LIBCURL=`echo $LIBCURL | sed -e 's|-arch i386||g'`
+                 ;;
+              esac
+           fi
+
+	   # All curl-config scripts support --feature
+	   _libcurl_features=`$_libcurl_config --feature`
+
+           # Is it modern enough to have --protocols? (7.12.4)
+	   if test $_libcurl_version -ge 461828 ; then
+              _libcurl_protocols=`$_libcurl_config --protocols`
+           fi
+	else
+           _libcurl_try_link=no
+	fi
+
+	unset _libcurl_wanted
+     fi
+
+     if test $_libcurl_try_link = yes ; then
+
+        # we didn't find curl-config, so let's see if the user-supplied
+        # link line (or failing that, "-lcurl") is enough.
+        LIBCURL=${LIBCURL-"$_libcurl_ldflags -lcurl"}
+
+        { echo "$as_me:$LINENO: checking whether libcurl is usable" >&5
+echo $ECHO_N "checking whether libcurl is usable... $ECHO_C" >&6; }
+if test "${libcurl_cv_lib_curl_usable+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+           _libcurl_save_cppflags=$CPPFLAGS
+           CPPFLAGS="$LIBCURL_CPPFLAGS $CPPFLAGS"
+           _libcurl_save_libs=$LIBS
+           LIBS="$LIBCURL $LIBS"
+
+           cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <curl/curl.h>
+int
+main ()
+{
+
+/* Try and use a few common options to force a failure if we are
+   missing symbols or can't link. */
+int x;
+curl_easy_setopt(NULL,CURLOPT_URL,NULL);
+x=CURL_ERROR_SIZE;
+x=CURLOPT_WRITEFUNCTION;
+x=CURLOPT_FILE;
+x=CURLOPT_ERRORBUFFER;
+x=CURLOPT_STDERR;
+x=CURLOPT_VERBOSE;
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  libcurl_cv_lib_curl_usable=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	libcurl_cv_lib_curl_usable=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+
+           CPPFLAGS=$_libcurl_save_cppflags
+           LIBS=$_libcurl_save_libs
+           unset _libcurl_save_cppflags
+           unset _libcurl_save_libs
+
+fi
+{ echo "$as_me:$LINENO: result: $libcurl_cv_lib_curl_usable" >&5
+echo "${ECHO_T}$libcurl_cv_lib_curl_usable" >&6; }
+
+        if test $libcurl_cv_lib_curl_usable = yes ; then
+
+	   # Does curl_free() exist in this version of libcurl?
+	   # If not, fake it with free()
+
+           _libcurl_save_cppflags=$CPPFLAGS
+           CPPFLAGS="$CPPFLAGS $LIBCURL_CPPFLAGS"
+           _libcurl_save_libs=$LIBS
+           LIBS="$LIBS $LIBCURL"
+
+           { echo "$as_me:$LINENO: checking for curl_free" >&5
+echo $ECHO_N "checking for curl_free... $ECHO_C" >&6; }
+if test "${ac_cv_func_curl_free+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 curl_free to an innocuous variant, in case <limits.h> declares curl_free.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define curl_free innocuous_curl_free
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char curl_free (); 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 curl_free
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char curl_free ();
+/* 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_curl_free || defined __stub___curl_free
+choke me
+#endif
+
+int
+main ()
+{
+return curl_free ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_curl_free=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_curl_free=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_curl_free" >&5
+echo "${ECHO_T}$ac_cv_func_curl_free" >&6; }
+if test $ac_cv_func_curl_free = yes; then
+  :
+else
+
+cat >>confdefs.h <<\_ACEOF
+#define curl_free free
+_ACEOF
+
+fi
+
+
+           CPPFLAGS=$_libcurl_save_cppflags
+           LIBS=$_libcurl_save_libs
+           unset _libcurl_save_cppflags
+           unset _libcurl_save_libs
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBCURL 1
+_ACEOF
+
+
+
+
+           for _libcurl_feature in $_libcurl_features ; do
+	      cat >>confdefs.h <<_ACEOF
+#define `echo "libcurl_feature_$_libcurl_feature" | $as_tr_cpp` 1
+_ACEOF
+
+	      eval `echo "libcurl_feature_$_libcurl_feature" | $as_tr_sh`=yes
+           done
+
+	   if test "x$_libcurl_protocols" = "x" ; then
+
+	      # We don't have --protocols, so just assume that all
+	      # protocols are available
+	      _libcurl_protocols="HTTP FTP FILE TELNET LDAP DICT"
+
+	      if test x$libcurl_feature_SSL = xyes ; then
+	         _libcurl_protocols="$_libcurl_protocols HTTPS"
+
+		 # FTPS wasn't standards-compliant until version
+		 # 7.11.0
+		 if test $_libcurl_version -ge 461568; then
+		    _libcurl_protocols="$_libcurl_protocols FTPS"
+		 fi
+	      fi
+	   fi
+
+	   for _libcurl_protocol in $_libcurl_protocols ; do
+	      cat >>confdefs.h <<_ACEOF
+#define `echo "libcurl_protocol_$_libcurl_protocol" | $as_tr_cpp` 1
+_ACEOF
+
+	      eval `echo "libcurl_protocol_$_libcurl_protocol" | $as_tr_sh`=yes
+           done
+	else
+	   unset LIBCURL
+	   unset LIBCURL_CPPFLAGS
+        fi
+     fi
+
+     unset _libcurl_try_link
+     unset _libcurl_version_parse
+     unset _libcurl_config
+     unset _libcurl_feature
+     unset _libcurl_features
+     unset _libcurl_protocol
+     unset _libcurl_protocols
+     unset _libcurl_version
+     unset _libcurl_ldflags
+  fi
+
+  if test x$_libcurl_with = xno || test x$libcurl_cv_lib_curl_usable != xyes ; then
+     # This is the IF-NO path
+     have_curl=no
+  else
+     # This is the IF-YES path
+     have_curl=yes
+  fi
+
+  unset _libcurl_with
+
+
+
+# Check whether --with-zlib was given.
+if test "${with_zlib+set}" = set; then
+  withval=$with_zlib; _zlib_with=$withval
+else
+  _zlib_with="no"
+fi
+
+
+  ZLIB_ROOT=""
+  if test "$_zlib_with" != "no"
+  then
+     if test -f "$_zlib_with/include/zlib.h"
+     then
+         ZLIB_ROOT=$_zlib_with
+     fi
+  fi
+
+  # Check if it's a working library
+  zlib_ok=no
+  if test "$ZLIB_ROOT" != ""
+  then
+    _cppflags=$CPPFLAGS
+    CPPFLAGS="$CPPFLAGS -I${ZLIB_ROOT}/include"
+    _ldflags=$LDFLAGS
+    LDFLAGS="$LFDLAGS -L${ZLIB_ROOT}/lib"
+
+    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 inflateEnd in -lz" >&5
+echo $ECHO_N "checking for inflateEnd in -lz... $ECHO_C" >&6; }
+if test "${ac_cv_lib_z_inflateEnd+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lz  $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 GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char inflateEnd ();
+int
+main ()
+{
+return inflateEnd ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_z_inflateEnd=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_z_inflateEnd=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_z_inflateEnd" >&5
+echo "${ECHO_T}$ac_cv_lib_z_inflateEnd" >&6; }
+if test $ac_cv_lib_z_inflateEnd = yes; then
+  if test "${ac_cv_header_zlib_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for zlib.h" >&5
+echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_zlib_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5
+echo "${ECHO_T}$ac_cv_header_zlib_h" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking zlib.h usability" >&5
+echo $ECHO_N "checking zlib.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 <zlib.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; 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 core 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 zlib.h presence" >&5
+echo $ECHO_N "checking zlib.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 <zlib.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.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: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: zlib.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: zlib.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: zlib.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: zlib.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: zlib.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: zlib.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: zlib.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: zlib.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: zlib.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: zlib.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: zlib.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: zlib.h: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for zlib.h" >&5
+echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_zlib_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_zlib_h=$ac_header_preproc
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5
+echo "${ECHO_T}$ac_cv_header_zlib_h" >&6; }
+
+fi
+if test $ac_cv_header_zlib_h = yes; then
+  zlib_ok=yes
+else
+  zlib_ok=no
+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
+
+    if test "$zlib_ok" != "yes"
+    then
+        # Backout and whinge
+        CPPFLAGS=$_cppflags
+        LDFLAGS=$_ldflags
+        { echo "$as_me:$LINENO: WARNING: \"--with-zlib specified" >&5
+echo "$as_me: WARNING: \"--with-zlib specified" >&2;}
+    fi
+
+  else
+    # Maybe it works "out of the box"?
+    { echo "$as_me:$LINENO: checking for inflateEnd in -lz" >&5
+echo $ECHO_N "checking for inflateEnd in -lz... $ECHO_C" >&6; }
+if test "${ac_cv_lib_z_inflateEnd+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lz  $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 GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char inflateEnd ();
+int
+main ()
+{
+return inflateEnd ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_z_inflateEnd=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_z_inflateEnd=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_z_inflateEnd" >&5
+echo "${ECHO_T}$ac_cv_lib_z_inflateEnd" >&6; }
+if test $ac_cv_lib_z_inflateEnd = yes; then
+  if test "${ac_cv_header_zlib_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for zlib.h" >&5
+echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_zlib_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5
+echo "${ECHO_T}$ac_cv_header_zlib_h" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking zlib.h usability" >&5
+echo $ECHO_N "checking zlib.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 <zlib.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; 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 core 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 zlib.h presence" >&5
+echo $ECHO_N "checking zlib.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 <zlib.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.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: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: zlib.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: zlib.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: zlib.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: zlib.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: zlib.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: zlib.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: zlib.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: zlib.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: zlib.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: zlib.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: zlib.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: zlib.h: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for zlib.h" >&5
+echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_zlib_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_zlib_h=$ac_header_preproc
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5
+echo "${ECHO_T}$ac_cv_header_zlib_h" >&6; }
+
+fi
+if test $ac_cv_header_zlib_h = yes; then
+  zlib_ok=yes
+else
+  zlib_ok=no
+fi
+
+
+fi
+
+  fi
+
+  if test "$zlib_ok" = "yes"
+  then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ZLIB 1
+_ACEOF
+
+      if test "$ZLIB_ROOT" != ""
+      then
+          LIBZ="-L${ZLIB_ROOT}/lib -lz"
+      else
+          LIBZ=-lz
+      fi
+
+  else
+    { echo "$as_me:$LINENO: WARNING: \"No functioning zlib found\"" >&5
+echo "$as_me: WARNING: \"No functioning zlib found\"" >&2;}
+  fi
+
+  # Not sure how many of these are needed, but it's belt-and-braces mode
+
+
+
+
+if test "$zlib_ok" = "yes"; then
+  HAVE_ZLIB_TRUE=
+  HAVE_ZLIB_FALSE='#'
+else
+  HAVE_ZLIB_TRUE='#'
+  HAVE_ZLIB_FALSE=
+fi
+
+
+
+{ echo "$as_me:$LINENO: checking for library containing gethostbyname" >&5
+echo $ECHO_N "checking for library containing gethostbyname... $ECHO_C" >&6; }
+if test "${ac_cv_search_gethostbyname+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_func_search_save_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 GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char gethostbyname ();
+int
+main ()
+{
+return gethostbyname ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' nsl; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_search_gethostbyname=$ac_res
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext
+  if test "${ac_cv_search_gethostbyname+set}" = set; then
+  break
+fi
+done
+if test "${ac_cv_search_gethostbyname+set}" = set; then
+  :
+else
+  ac_cv_search_gethostbyname=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_search_gethostbyname" >&5
+echo "${ECHO_T}$ac_cv_search_gethostbyname" >&6; }
+ac_res=$ac_cv_search_gethostbyname
+if test "$ac_res" != no; then
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+{ echo "$as_me:$LINENO: checking for library containing socket" >&5
+echo $ECHO_N "checking for library containing socket... $ECHO_C" >&6; }
+if test "${ac_cv_search_socket+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_func_search_save_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 GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char socket ();
+int
+main ()
+{
+return socket ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' socket; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_search_socket=$ac_res
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext
+  if test "${ac_cv_search_socket+set}" = set; then
+  break
+fi
+done
+if test "${ac_cv_search_socket+set}" = set; then
+  :
+else
+  ac_cv_search_socket=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_search_socket" >&5
+echo "${ECHO_T}$ac_cv_search_socket" >&6; }
+ac_res=$ac_cv_search_socket
+if test "$ac_res" != no; then
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+else
+  { echo "$as_me:$LINENO: checking for socket in -lsocket" >&5
+echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6; }
+if test "${ac_cv_lib_socket_socket+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket -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 GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char socket ();
+int
+main ()
+{
+return socket ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_socket_socket=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_socket_socket=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5
+echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6; }
+if test $ac_cv_lib_socket_socket = yes; then
+  LIBS="-lsocket -lnsl $LIBS"
+fi
+
+fi
+
+
+{ echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
+echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; }
+if test "${ac_cv_c_bigendian+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # See if sys/param.h defines the BYTE_ORDER macro.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+#include <sys/param.h>
+
+int
+main ()
+{
+#if  ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \
+	&& BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN)
+ bogus endian macros
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  # It does; now see whether it defined to BIG_ENDIAN or not.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+#include <sys/param.h>
+
+int
+main ()
+{
+#if BYTE_ORDER != BIG_ENDIAN
+ not big endian
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_c_bigendian=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_c_bigendian=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	# It does not; compile a test program.
+if test "$cross_compiling" = yes; then
+  # try to guess the endianness by grepping values into an object file
+  ac_cv_c_bigendian=unknown
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; }
+short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }
+int
+main ()
+{
+ _ascii (); _ebcdic ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then
+  ac_cv_c_bigendian=yes
+fi
+if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+  if test "$ac_cv_c_bigendian" = unknown; then
+    ac_cv_c_bigendian=no
+  else
+    # finding both strings is unlikely to happen, but who knows?
+    ac_cv_c_bigendian=unknown
+  fi
+fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+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 ()
+{
+
+  /* Are we little or big endian?  From Harbison&Steele.  */
+  union
+  {
+    long int l;
+    char c[sizeof (long int)];
+  } u;
+  u.l = 1;
+  return u.c[sizeof (long int) - 1] == 1;
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_c_bigendian=no
+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_c_bigendian=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
+echo "${ECHO_T}$ac_cv_c_bigendian" >&6; }
+case $ac_cv_c_bigendian in
+  yes)
+
+cat >>confdefs.h <<\_ACEOF
+#define WORDS_BIGENDIAN 1
+_ACEOF
+ ;;
+  no)
+     ;;
+  *)
+    { { echo "$as_me:$LINENO: error: unknown endianness
+presetting ac_cv_c_bigendian=no (or yes) will help" >&5
+echo "$as_me: error: unknown endianness
+presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
+   { (exit 1); exit 1; }; } ;;
+esac
+
+
+{ 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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; 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 core 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>
+#include <stdlib.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))
+      return 2;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 core.conftest.* 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
+
+{ echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6; }
+if test "${ac_cv_header_sys_wait_h+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 <sys/types.h>
+#include <sys/wait.h>
+#ifndef WEXITSTATUS
+# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8)
+#endif
+#ifndef WIFEXITED
+# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+#endif
+
+int
+main ()
+{
+  int s;
+  wait (&s);
+  s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_header_sys_wait_h=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_header_sys_wait_h=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6; }
+if test $ac_cv_header_sys_wait_h = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SYS_WAIT_H 1
+_ACEOF
+
+fi
+
+
+
+
+for ac_header in fcntl.h limits.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.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;}
+
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&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
+
+if test "${ac_cv_header_zlib_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for zlib.h" >&5
+echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_zlib_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5
+echo "${ECHO_T}$ac_cv_header_zlib_h" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking zlib.h usability" >&5
+echo $ECHO_N "checking zlib.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 <zlib.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; 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 core 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 zlib.h presence" >&5
+echo $ECHO_N "checking zlib.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 <zlib.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.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: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: zlib.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: zlib.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: zlib.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: zlib.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: zlib.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: zlib.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: zlib.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: zlib.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: zlib.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: zlib.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: zlib.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: zlib.h: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for zlib.h" >&5
+echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_zlib_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_zlib_h=$ac_header_preproc
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5
+echo "${ECHO_T}$ac_cv_header_zlib_h" >&6; }
+
+fi
+
+
+
+{ echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
+echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; }
+if test "${ac_cv_c_bigendian+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # See if sys/param.h defines the BYTE_ORDER macro.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+#include <sys/param.h>
+
+int
+main ()
+{
+#if  ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \
+	&& BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN)
+ bogus endian macros
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  # It does; now see whether it defined to BIG_ENDIAN or not.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+#include <sys/param.h>
+
+int
+main ()
+{
+#if BYTE_ORDER != BIG_ENDIAN
+ not big endian
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_c_bigendian=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_c_bigendian=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	# It does not; compile a test program.
+if test "$cross_compiling" = yes; then
+  # try to guess the endianness by grepping values into an object file
+  ac_cv_c_bigendian=unknown
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; }
+short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }
+int
+main ()
+{
+ _ascii (); _ebcdic ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then
+  ac_cv_c_bigendian=yes
+fi
+if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+  if test "$ac_cv_c_bigendian" = unknown; then
+    ac_cv_c_bigendian=no
+  else
+    # finding both strings is unlikely to happen, but who knows?
+    ac_cv_c_bigendian=unknown
+  fi
+fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+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 ()
+{
+
+  /* Are we little or big endian?  From Harbison&Steele.  */
+  union
+  {
+    long int l;
+    char c[sizeof (long int)];
+  } u;
+  u.l = 1;
+  return u.c[sizeof (long int) - 1] == 1;
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_c_bigendian=no
+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_c_bigendian=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
+echo "${ECHO_T}$ac_cv_c_bigendian" >&6; }
+case $ac_cv_c_bigendian in
+  yes)
+
+cat >>confdefs.h <<\_ACEOF
+#define WORDS_BIGENDIAN 1
+_ACEOF
+ ;;
+  no)
+     ;;
+  *)
+    { { echo "$as_me:$LINENO: error: unknown endianness
+presetting ac_cv_c_bigendian=no (or yes) will help" >&5
+echo "$as_me: error: unknown endianness
+presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
+   { (exit 1); exit 1; }; } ;;
+esac
+
+{ echo "$as_me:$LINENO: checking for short" >&5
+echo $ECHO_N "checking for short... $ECHO_C" >&6; }
+if test "${ac_cv_type_short+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
+typedef short ac__type_new_;
+int
+main ()
+{
+if ((ac__type_new_ *) 0)
+  return 0;
+if (sizeof (ac__type_new_))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_type_short=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_type_short=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5
+echo "${ECHO_T}$ac_cv_type_short" >&6; }
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ echo "$as_me:$LINENO: checking size of short" >&5
+echo $ECHO_N "checking size of short... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_short+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "$cross_compiling" = yes; then
+  # Depending upon the size, compute the lo and hi bounds.
+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
+   typedef short ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_lo=0 ac_mid=0
+  while :; do
+    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
+   typedef short ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_lo=`expr $ac_mid + 1`
+			if test $ac_lo -le $ac_mid; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	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
+   typedef short ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=-1 ac_mid=-1
+  while :; do
+    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
+   typedef short ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_lo=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_hi=`expr '(' $ac_mid ')' - 1`
+			if test $ac_mid -le $ac_hi; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			ac_mid=`expr 2 '*' $ac_mid`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_lo= ac_hi=
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+  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
+   typedef short ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_short=$ac_lo;;
+'') if test "$ac_cv_type_short" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (short)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (short)
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_short=0
+   fi ;;
+esac
+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
+   typedef short ac__type_sizeof_;
+static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    return 1;
+  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
+    {
+      long int i = longval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+	return 1;
+      fprintf (f, "%ld\n", i);
+    }
+  else
+    {
+      unsigned long int i = ulongval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+	return 1;
+      fprintf (f, "%lu\n", i);
+    }
+  return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_sizeof_short=`cat conftest.val`
+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 )
+if test "$ac_cv_type_short" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (short)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (short)
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_short=0
+   fi
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.val
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5
+echo "${ECHO_T}$ac_cv_sizeof_short" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_SHORT $ac_cv_sizeof_short
+_ACEOF
+
+
+{ echo "$as_me:$LINENO: checking for int" >&5
+echo $ECHO_N "checking for int... $ECHO_C" >&6; }
+if test "${ac_cv_type_int+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
+typedef int ac__type_new_;
+int
+main ()
+{
+if ((ac__type_new_ *) 0)
+  return 0;
+if (sizeof (ac__type_new_))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_type_int=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_type_int=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5
+echo "${ECHO_T}$ac_cv_type_int" >&6; }
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ echo "$as_me:$LINENO: checking size of int" >&5
+echo $ECHO_N "checking size of int... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_int+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "$cross_compiling" = yes; then
+  # Depending upon the size, compute the lo and hi bounds.
+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
+   typedef int ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_lo=0 ac_mid=0
+  while :; do
+    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
+   typedef int ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_lo=`expr $ac_mid + 1`
+			if test $ac_lo -le $ac_mid; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	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
+   typedef int ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=-1 ac_mid=-1
+  while :; do
+    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
+   typedef int ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_lo=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_hi=`expr '(' $ac_mid ')' - 1`
+			if test $ac_mid -le $ac_hi; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			ac_mid=`expr 2 '*' $ac_mid`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_lo= ac_hi=
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+  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
+   typedef int ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_int=$ac_lo;;
+'') if test "$ac_cv_type_int" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (int)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (int)
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_int=0
+   fi ;;
+esac
+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
+   typedef int ac__type_sizeof_;
+static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    return 1;
+  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
+    {
+      long int i = longval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+	return 1;
+      fprintf (f, "%ld\n", i);
+    }
+  else
+    {
+      unsigned long int i = ulongval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+	return 1;
+      fprintf (f, "%lu\n", i);
+    }
+  return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_sizeof_int=`cat conftest.val`
+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 )
+if test "$ac_cv_type_int" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (int)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (int)
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_int=0
+   fi
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.val
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5
+echo "${ECHO_T}$ac_cv_sizeof_int" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_INT $ac_cv_sizeof_int
+_ACEOF
+
+
+{ echo "$as_me:$LINENO: checking for long" >&5
+echo $ECHO_N "checking for long... $ECHO_C" >&6; }
+if test "${ac_cv_type_long+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
+typedef long ac__type_new_;
+int
+main ()
+{
+if ((ac__type_new_ *) 0)
+  return 0;
+if (sizeof (ac__type_new_))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_type_long=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_type_long=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5
+echo "${ECHO_T}$ac_cv_type_long" >&6; }
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ echo "$as_me:$LINENO: checking size of long" >&5
+echo $ECHO_N "checking size of long... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_long+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "$cross_compiling" = yes; then
+  # Depending upon the size, compute the lo and hi bounds.
+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
+   typedef long ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_lo=0 ac_mid=0
+  while :; do
+    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
+   typedef long ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_lo=`expr $ac_mid + 1`
+			if test $ac_lo -le $ac_mid; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	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
+   typedef long ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=-1 ac_mid=-1
+  while :; do
+    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
+   typedef long ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_lo=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_hi=`expr '(' $ac_mid ')' - 1`
+			if test $ac_mid -le $ac_hi; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			ac_mid=`expr 2 '*' $ac_mid`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_lo= ac_hi=
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+  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
+   typedef long ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_long=$ac_lo;;
+'') if test "$ac_cv_type_long" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (long)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (long)
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_long=0
+   fi ;;
+esac
+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
+   typedef long ac__type_sizeof_;
+static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    return 1;
+  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
+    {
+      long int i = longval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+	return 1;
+      fprintf (f, "%ld\n", i);
+    }
+  else
+    {
+      unsigned long int i = ulongval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+	return 1;
+      fprintf (f, "%lu\n", i);
+    }
+  return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_sizeof_long=`cat conftest.val`
+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 )
+if test "$ac_cv_type_long" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (long)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (long)
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_long=0
+   fi
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.val
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5
+echo "${ECHO_T}$ac_cv_sizeof_long" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG $ac_cv_sizeof_long
+_ACEOF
+
+
+{ 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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_c_inline=$ac_kw
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  test "$ac_cv_c_inline" != no && break
+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 mode_t" >&5
+echo $ECHO_N "checking for mode_t... $ECHO_C" >&6; }
+if test "${ac_cv_type_mode_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
+typedef mode_t ac__type_new_;
+int
+main ()
+{
+if ((ac__type_new_ *) 0)
+  return 0;
+if (sizeof (ac__type_new_))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_type_mode_t=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_type_mode_t=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5
+echo "${ECHO_T}$ac_cv_type_mode_t" >&6; }
+if test $ac_cv_type_mode_t = yes; then
+  :
+else
+
+cat >>confdefs.h <<_ACEOF
+#define mode_t int
+_ACEOF
+
+fi
+
+
+# Check whether --enable-largefile was given.
+if test "${enable_largefile+set}" = set; then
+  enableval=$enable_largefile;
+fi
+
+if test "$enable_largefile" != no; then
+
+  { echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5
+echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6; }
+if test "${ac_cv_sys_largefile_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_sys_largefile_CC=no
+     if test "$GCC" != yes; then
+       ac_save_CC=$CC
+       while :; do
+	 # IRIX 6.2 and later do not support large files by default,
+	 # so use the C compiler's -n32 option if that helps.
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+		       && LARGE_OFF_T % 2147483647 == 1)
+		      ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+	 rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+	 CC="$CC -n32"
+	 rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_sys_largefile_CC=' -n32'; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+	 break
+       done
+       CC=$ac_save_CC
+       rm -f conftest.$ac_ext
+    fi
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5
+echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6; }
+  if test "$ac_cv_sys_largefile_CC" != no; then
+    CC=$CC$ac_cv_sys_largefile_CC
+  fi
+
+  { echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5
+echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6; }
+if test "${ac_cv_sys_file_offset_bits+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  while :; do
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+		       && LARGE_OFF_T % 2147483647 == 1)
+		      ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_sys_file_offset_bits=no; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core 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.  */
+#define _FILE_OFFSET_BITS 64
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+		       && LARGE_OFF_T % 2147483647 == 1)
+		      ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_sys_file_offset_bits=64; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  ac_cv_sys_file_offset_bits=unknown
+  break
+done
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5
+echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6; }
+case $ac_cv_sys_file_offset_bits in #(
+  no | unknown) ;;
+  *)
+cat >>confdefs.h <<_ACEOF
+#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
+_ACEOF
+;;
+esac
+rm -f conftest*
+  if test $ac_cv_sys_file_offset_bits = unknown; then
+    { echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5
+echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6; }
+if test "${ac_cv_sys_large_files+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  while :; do
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+		       && LARGE_OFF_T % 2147483647 == 1)
+		      ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_sys_large_files=no; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core 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.  */
+#define _LARGE_FILES 1
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+		       && LARGE_OFF_T % 2147483647 == 1)
+		      ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_sys_large_files=1; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  ac_cv_sys_large_files=unknown
+  break
+done
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5
+echo "${ECHO_T}$ac_cv_sys_large_files" >&6; }
+case $ac_cv_sys_large_files in #(
+  no | unknown) ;;
+  *)
+cat >>confdefs.h <<_ACEOF
+#define _LARGE_FILES $ac_cv_sys_large_files
+_ACEOF
+;;
+esac
+rm -f conftest*
+  fi
+fi
+
+{ echo "$as_me:$LINENO: checking for _LARGEFILE_SOURCE value needed for large files" >&5
+echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6; }
+if test "${ac_cv_sys_largefile_source+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  while :; do
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h> /* for off_t */
+     #include <stdio.h>
+int
+main ()
+{
+int (*fp) (FILE *, off_t, int) = fseeko;
+     return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_sys_largefile_source=no; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext 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.  */
+#define _LARGEFILE_SOURCE 1
+#include <sys/types.h> /* for off_t */
+     #include <stdio.h>
+int
+main ()
+{
+int (*fp) (FILE *, off_t, int) = fseeko;
+     return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_sys_largefile_source=1; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_sys_largefile_source=unknown
+  break
+done
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_source" >&5
+echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6; }
+case $ac_cv_sys_largefile_source in #(
+  no | unknown) ;;
+  *)
+cat >>confdefs.h <<_ACEOF
+#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
+_ACEOF
+;;
+esac
+rm -f conftest*
+
+# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
+# in glibc 2.1.3, but that breaks too many other things.
+# If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
+if test $ac_cv_sys_largefile_source != unknown; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_FSEEKO 1
+_ACEOF
+
+fi
+
+
+{ echo "$as_me:$LINENO: checking for library containing cos" >&5
+echo $ECHO_N "checking for library containing cos... $ECHO_C" >&6; }
+if test "${ac_cv_search_cos+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_func_search_save_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 GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cos ();
+int
+main ()
+{
+return cos ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' m; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_search_cos=$ac_res
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext
+  if test "${ac_cv_search_cos+set}" = set; then
+  break
+fi
+done
+if test "${ac_cv_search_cos+set}" = set; then
+  :
+else
+  ac_cv_search_cos=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_search_cos" >&5
+echo "${ECHO_T}$ac_cv_search_cos" >&6; }
+ac_res=$ac_cv_search_cos
+if test "$ac_res" != no; then
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+
+for ac_func in strdup
+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 { as_var=$as_ac_var; eval "test \"\${$as_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 GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+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
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&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
+
+
+ac_config_files="$ac_config_files Makefile io_lib/Makefile progs/Makefile tests/Makefile io_lib-config"
+
+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, we kill variables containing newlines.
+# 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.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     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 "$as_me:$LINENO: updating cache $cache_file" >&5
+echo "$as_me: updating cache $cache_file" >&6;}
+    cat confcache >$cache_file
+  else
+    { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  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}'
+
+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_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+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_ZLIB_TRUE}" && test -z "${HAVE_ZLIB_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_ZLIB\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_ZLIB\" 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 more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+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
+
+
+
+
+# PATH needs CR
+# 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
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+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
+IFS=$as_save_IFS
+
+     ;;
+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_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+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) >/dev/null 2>&1 && $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # 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 after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, 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
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\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 sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir
+fi
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s='ln -s'
+  # ... but there are two gotchas:
+  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+  # In both cases, we have to default to `cp -p'.
+  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+    as_ln_s='cp -p'
+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$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+        test -d "$1/.";
+      else
+	case $1 in
+        -*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+exec 6>&1
+
+# Save the log message, to keep $[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by io_lib $as_me 1.12.2, which was
+generated by GNU Autoconf 2.61.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+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 and configuration settings, 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="\\
+io_lib config.status 1.12.2
+configured by $0, generated by GNU Autoconf 2.61,
+  with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2006 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+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
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    echo "$ac_cs_version"; exit ;;
+  --debug | --debu | --deb | --de | --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;;
+  --he | --h)
+    # Conflict between --help and --header
+    { 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 ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) { 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"
+     ac_need_defaults=false ;;
+
+  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 CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+  CONFIG_SHELL=$SHELL
+  export CONFIG_SHELL
+  exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "io_lib_config.h") CONFIG_HEADERS="$CONFIG_HEADERS io_lib_config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "io_lib/Makefile") CONFIG_FILES="$CONFIG_FILES io_lib/Makefile" ;;
+    "progs/Makefile") CONFIG_FILES="$CONFIG_FILES progs/Makefile" ;;
+    "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
+    "io_lib-config") CONFIG_FILES="$CONFIG_FILES io_lib-config" ;;
+
+  *) { { 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 against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$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 "./confXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} ||
+{
+   echo "$me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
+
+#
+# Set up the sed scripts for 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
+
+_ACEOF
+
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  cat >conf$$subs.sed <<_ACEOF
+SHELL!$SHELL$ac_delim
+PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
+PACKAGE_NAME!$PACKAGE_NAME$ac_delim
+PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
+PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
+PACKAGE_STRING!$PACKAGE_STRING$ac_delim
+PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
+exec_prefix!$exec_prefix$ac_delim
+prefix!$prefix$ac_delim
+program_transform_name!$program_transform_name$ac_delim
+bindir!$bindir$ac_delim
+sbindir!$sbindir$ac_delim
+libexecdir!$libexecdir$ac_delim
+datarootdir!$datarootdir$ac_delim
+datadir!$datadir$ac_delim
+sysconfdir!$sysconfdir$ac_delim
+sharedstatedir!$sharedstatedir$ac_delim
+localstatedir!$localstatedir$ac_delim
+includedir!$includedir$ac_delim
+oldincludedir!$oldincludedir$ac_delim
+docdir!$docdir$ac_delim
+infodir!$infodir$ac_delim
+htmldir!$htmldir$ac_delim
+dvidir!$dvidir$ac_delim
+pdfdir!$pdfdir$ac_delim
+psdir!$psdir$ac_delim
+libdir!$libdir$ac_delim
+localedir!$localedir$ac_delim
+mandir!$mandir$ac_delim
+DEFS!$DEFS$ac_delim
+ECHO_C!$ECHO_C$ac_delim
+ECHO_N!$ECHO_N$ac_delim
+ECHO_T!$ECHO_T$ac_delim
+LIBS!$LIBS$ac_delim
+build_alias!$build_alias$ac_delim
+host_alias!$host_alias$ac_delim
+target_alias!$target_alias$ac_delim
+INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
+INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
+INSTALL_DATA!$INSTALL_DATA$ac_delim
+CYGPATH_W!$CYGPATH_W$ac_delim
+PACKAGE!$PACKAGE$ac_delim
+VERSION!$VERSION$ac_delim
+ACLOCAL!$ACLOCAL$ac_delim
+AUTOCONF!$AUTOCONF$ac_delim
+AUTOMAKE!$AUTOMAKE$ac_delim
+AUTOHEADER!$AUTOHEADER$ac_delim
+MAKEINFO!$MAKEINFO$ac_delim
+install_sh!$install_sh$ac_delim
+STRIP!$STRIP$ac_delim
+INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim
+mkdir_p!$mkdir_p$ac_delim
+AWK!$AWK$ac_delim
+SET_MAKE!$SET_MAKE$ac_delim
+am__leading_dot!$am__leading_dot$ac_delim
+AMTAR!$AMTAR$ac_delim
+am__tar!$am__tar$ac_delim
+am__untar!$am__untar$ac_delim
+MAINTAINER_MODE_TRUE!$MAINTAINER_MODE_TRUE$ac_delim
+MAINTAINER_MODE_FALSE!$MAINTAINER_MODE_FALSE$ac_delim
+MAINT!$MAINT$ac_delim
+VERS_CURRENT!$VERS_CURRENT$ac_delim
+VERS_REVISION!$VERS_REVISION$ac_delim
+VERS_AGE!$VERS_AGE$ac_delim
+CC!$CC$ac_delim
+CFLAGS!$CFLAGS$ac_delim
+LDFLAGS!$LDFLAGS$ac_delim
+CPPFLAGS!$CPPFLAGS$ac_delim
+ac_ct_CC!$ac_ct_CC$ac_delim
+EXEEXT!$EXEEXT$ac_delim
+OBJEXT!$OBJEXT$ac_delim
+DEPDIR!$DEPDIR$ac_delim
+am__include!$am__include$ac_delim
+am__quote!$am__quote$ac_delim
+AMDEP_TRUE!$AMDEP_TRUE$ac_delim
+AMDEP_FALSE!$AMDEP_FALSE$ac_delim
+AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim
+CCDEPMODE!$CCDEPMODE$ac_delim
+am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim
+am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim
+build!$build$ac_delim
+build_cpu!$build_cpu$ac_delim
+build_vendor!$build_vendor$ac_delim
+build_os!$build_os$ac_delim
+host!$host$ac_delim
+host_cpu!$host_cpu$ac_delim
+host_vendor!$host_vendor$ac_delim
+host_os!$host_os$ac_delim
+GREP!$GREP$ac_delim
+EGREP!$EGREP$ac_delim
+LN_S!$LN_S$ac_delim
+ECHO!$ECHO$ac_delim
+AR!$AR$ac_delim
+RANLIB!$RANLIB$ac_delim
+CPP!$CPP$ac_delim
+CXX!$CXX$ac_delim
+CXXFLAGS!$CXXFLAGS$ac_delim
+_ACEOF
+
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
+    break
+  elif $ac_last_try; then
+    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+  ac_eof=`expr $ac_eof + 1`
+fi
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+CEOF$ac_eof
+_ACEOF
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  cat >conf$$subs.sed <<_ACEOF
+ac_ct_CXX!$ac_ct_CXX$ac_delim
+CXXDEPMODE!$CXXDEPMODE$ac_delim
+am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim
+am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim
+CXXCPP!$CXXCPP$ac_delim
+F77!$F77$ac_delim
+FFLAGS!$FFLAGS$ac_delim
+ac_ct_F77!$ac_ct_F77$ac_delim
+LIBTOOL!$LIBTOOL$ac_delim
+_libcurl_config!$_libcurl_config$ac_delim
+LIBCURL_CPPFLAGS!$LIBCURL_CPPFLAGS$ac_delim
+LIBCURL!$LIBCURL$ac_delim
+LIBZ!$LIBZ$ac_delim
+HAVE_ZLIB_TRUE!$HAVE_ZLIB_TRUE$ac_delim
+HAVE_ZLIB_FALSE!$HAVE_ZLIB_FALSE$ac_delim
+LIBOBJS!$LIBOBJS$ac_delim
+LTLIBOBJS!$LTLIBOBJS$ac_delim
+_ACEOF
+
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 17; then
+    break
+  elif $ac_last_try; then
+    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+  ac_eof=`expr $ac_eof + 1`
+fi
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
+_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+:end
+s/|#_!!_#|//g
+CEOF$ac_eof
+_ACEOF
+
+
+# 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
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+fi # test -n "$CONFIG_FILES"
+
+
+for ac_tag in  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
+echo "$as_me: error: Invalid tag $ac_tag." >&2;}
+   { (exit 1); exit 1; }; };;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
+	 # because $ac_f cannot contain `:'.
+	 test -f "$ac_f" ||
+	   case $ac_f in
+	   [\\/$]*) false;;
+	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+	   esac ||
+	   { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+   { (exit 1); exit 1; }; };;
+      esac
+      ac_file_inputs="$ac_file_inputs $ac_f"
+    done
+
+    # 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.  */
+    configure_input="Generated from "`IFS=:
+	  echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    fi
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin";;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$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'`
+  { as_dir="$ac_dir"
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$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'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+case `sed -n '/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+' $ac_file_inputs` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+    s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+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&@top_builddir@&$ac_top_builddir_sub&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+$ac_datarootdir_hack
+" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&5
+echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&2;}
+
+  rm -f "$tmp/stdin"
+  case $ac_file in
+  -) cat "$tmp/out"; rm -f "$tmp/out";;
+  *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
+  esac
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+_ACEOF
+
+# Transform confdefs.h into a sed script `conftest.defines', that
+# substitutes the proper values into config.h.in to produce config.h.
+rm -f conftest.defines conftest.tail
+# First, append a space to every undef/define line, to ease matching.
+echo 's/$/ /' >conftest.defines
+# Then, protect against being on the right side of a sed subst, or in
+# an unquoted here document, in config.status.  If some macros were
+# called several times there might be several #defines for the same
+# symbol, which is useless.  But do not sort them, since the last
+# AC_DEFINE must be honored.
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where
+# NAME is the cpp macro being defined, VALUE is the value it is being given.
+# PARAMS is the parameter list in the macro definition--in most cases, it's
+# just an empty string.
+ac_dA='s,^\\([	 #]*\\)[^	 ]*\\([	 ]*'
+ac_dB='\\)[	 (].*,\\1define\\2'
+ac_dC=' '
+ac_dD=' ,'
+
+uniq confdefs.h |
+  sed -n '
+	t rset
+	:rset
+	s/^[	 ]*#[	 ]*define[	 ][	 ]*//
+	t ok
+	d
+	:ok
+	s/[\\&,]/\\&/g
+	s/^\('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p
+	s/^\('"$ac_word_re"'\)[	 ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p
+  ' >>conftest.defines
+
+# Remove the space that was appended to ease matching.
+# Then replace #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.
+# (The regexp can be short, since the line contains either #define or #undef.)
+echo 's/ $//
+s,^[	 #]*u.*,/* & */,' >>conftest.defines
+
+# Break up conftest.defines:
+ac_max_sed_lines=50
+
+# First sed command is:	 sed -f defines.sed $ac_file_inputs >"$tmp/out1"
+# Second one is:	 sed -f defines.sed "$tmp/out1" >"$tmp/out2"
+# Third one will be:	 sed -f defines.sed "$tmp/out2" >"$tmp/out1"
+# et cetera.
+ac_in='$ac_file_inputs'
+ac_out='"$tmp/out1"'
+ac_nxt='"$tmp/out2"'
+
+while :
+do
+  # Write a here document:
+    cat >>$CONFIG_STATUS <<_ACEOF
+    # First, check the format of the line:
+    cat >"\$tmp/defines.sed" <<\\CEOF
+/^[	 ]*#[	 ]*undef[	 ][	 ]*$ac_word_re[	 ]*\$/b def
+/^[	 ]*#[	 ]*define[	 ][	 ]*$ac_word_re[(	 ]/b def
+b
+:def
+_ACEOF
+  sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS
+  echo 'CEOF
+    sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS
+  ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in
+  sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail
+  grep . conftest.tail >/dev/null || break
+  rm -f conftest.defines
+  mv conftest.tail conftest.defines
+done
+rm -f conftest.defines conftest.tail
+
+echo "ac_result=$ac_in" >>$CONFIG_STATUS
+cat >>$CONFIG_STATUS <<\_ACEOF
+  if test x"$ac_file" != x-; then
+    echo "/* $configure_input  */" >"$tmp/config.h"
+    cat "$ac_result" >>"$tmp/config.h"
+    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
+      rm -f $ac_file
+      mv "$tmp/config.h" $ac_file
+    fi
+  else
+    echo "/* $configure_input  */"
+    cat "$ac_result"
+  fi
+  rm -f "$tmp/out12"
+# 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" >`$as_dirname -- $ac_file ||
+$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
+ ;;
+
+  :C)  { echo "$as_me:$LINENO: executing $ac_file commands" >&5
+echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "depfiles":C) 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=`$as_dirname -- "$mf" ||
+$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=`$as_dirname -- "$file" ||
+$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'`
+    { as_dir=$dirpart/$fdir
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$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'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+ ;;
+
+  esac
+done # for ac_tag
+
+
+{ (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
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/configure.in	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,125 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(io_lib, 1.12.2)
+AM_CONFIG_HEADER(io_lib_config.h)
+AM_INIT_AUTOMAKE
+AM_MAINTAINER_MODE
+
+# For my own benefit, here's a summary of how versioning should work.
+#
+# Library versioning, not to be confused with the release number:
+# Update VERS_CURRENT when an interface changes in an incompatible manner.
+#     eg. change of struct, removing a function, changing a prototype.
+#     Also increment this when we add new functions in a backwards compatible
+#     manner, but update VERS_AGE too (see below).
+#
+# Update VERS_REVISION whenever VERS_CURRENT hasn't changed, but the source
+#     code has. (Otherwise reset revision to 0).
+#
+# Update VERS_AGE if new interfaces have been added, causing VERS_CURRENT to
+#        be incremented too. The idea is that if the previous values are
+#        VERS_CURRENT=2, VERS_AGE=0 then after adding a new function we
+#        get VERS_CURRENT=3, VERS_AGE=1 (ie ABI compat with vers 2 or 3).
+#
+# Also see:
+# http://www.gnu.org/software/libtool/manual/libtool.html#Updating-version-info
+
+# Example: We have io_lib 1.11.6 implementing ABI vers 0, rev 6, age 0.
+# Our library has an soname of libstaden-read.so.0 and files as follows:
+#       (SONAME      libstaden-read.so.0)
+# 	libstaden-read.so -> libstaden-read.so.0.0.6
+#       libstaden-read.so.0 -> libstaden-read.so.0.0.6
+#       libstaden-read.so.0.0.6
+#
+# We then release io_lib 1.12.0 with modified structs, so it's incompatible.
+# We bump to ABI vers 1, rev 0, age 0 - giving:
+#       (SONAME      libstaden-read.so.1)
+# 	libstaden-read.so -> libstaden-read.so.1.0.0
+#       libstaden-read.so.1 -> libstaden-read.so.1.0.0
+#       libstaden-read.so.1.0.0
+#
+# If in 1.12.1 to 1.12.5 we then perform several successive minor tweaks (bug
+# fix, optimisation, etc) that do not change the ABI at all, we may
+# end up with ABI vers 1, rev 5, age 0:
+#       (SONAME      libstaden-read.so.1)
+# 	libstaden-read.so -> libstaden-read.so.1.0.5
+#       libstaden-read.so.1 -> libstaden-read.so.1.0.5
+#       libstaden-read.so.1.0.5
+#
+# And assume in 1.13.0 we add an extra public function. Code linked
+# against 1.12.x still works (aka library version 1) meaning our
+# soname doesn't change, but we do update ABI version: vers 2, rev 0, age 1.
+#       (SONAME      libstaden-read.so.1)
+# 	libstaden-read.so -> libstaden-read.so.1.1.0
+#       libstaden-read.so.1 -> libstaden-read.so.1.1.0
+#       libstaden-read.so.1.1.0
+
+VERS_CURRENT=2
+VERS_REVISION=0
+VERS_AGE=1
+AC_SUBST(VERS_CURRENT)
+AC_SUBST(VERS_REVISION)
+AC_SUBST(VERS_AGE)
+
+dnl Checks for programs.
+AC_PROG_CC
+AC_PROG_INSTALL
+AC_PROG_LIBTOOL
+
+# by Marcelo Magallon <mmagallo@efis.ucr.ac.cr>
+# Turn around -rpath problem with libtool 1.0c
+# This define should be improbable enough to not conflict with anything.
+echo host=$host
+case ${host} in
+  *-linux-gnu)
+    AC_MSG_RESULT([Fixing libtool for -rpath problems.])
+    sed < libtool > libtool-2 \
+    's/^hardcode_libdir_flag_spec.*$'/'hardcode_libdir_flag_spec=""/'
+    mv libtool-2 libtool
+    chmod 755 libtool
+  ;;
+esac
+
+dnl Check for libcurl and zlib
+LIBCURL_CHECK_CONFIG(,,[have_curl=yes], [have_curl=no])
+ZLIB_CHECK_CONFIG(,,[have_zlib=yes], [have_zlib=no])
+
+dnl Socket support for Solaris (et al)
+AC_SEARCH_LIBS([gethostbyname], [nsl])
+AC_SEARCH_LIBS([socket], [socket], [],
+    [AC_CHECK_LIB([socket], [socket],
+                  [LIBS="-lsocket -lnsl $LIBS"], [], [-lnsl])])
+
+dnl Check host endian-ness
+AC_C_BIGENDIAN
+
+dnl Checks for header files.
+AC_HEADER_STDC
+AC_HEADER_SYS_WAIT
+AC_CHECK_HEADERS(fcntl.h limits.h unistd.h)
+AC_CHECK_HEADER(zlib.h)
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_C_BIGENDIAN
+AC_CHECK_SIZEOF(short,2)
+AC_CHECK_SIZEOF(int,4)
+AC_CHECK_SIZEOF(long,4)
+dnl AC_C_CONST
+AC_C_INLINE
+AC_TYPE_MODE_T
+dnl AC_TYPE_OFF_T
+dnl AC_TYPE_SIZE_T
+dnl AC_STRUCT_TM
+
+dnl Large file support
+AC_SYS_LARGEFILE
+AC_FUNC_FSEEKO
+
+dnl Checks for library functions.
+AC_SEARCH_LIBS(cos, m)
+dnl AC_FUNC_MEMCMP
+dnl AC_FUNC_STRFTIME
+dnl AC_FUNC_VPRINTF
+AC_CHECK_FUNCS(strdup)
+dnl AC_CHECK_FUNCS(mktime strspn strstr strtol)
+
+AC_OUTPUT(Makefile io_lib/Makefile progs/Makefile tests/Makefile io_lib-config)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/depcomp	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,530 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2005-07-09.11
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005 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., 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.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+  '')
+     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+  depmode     Dependency tracking mode.
+  source      Source file read by `PROGRAMS ARGS'.
+  object      Object file output by `PROGRAMS ARGS'.
+  DEPDIR      directory where to store dependencies.
+  depfile     Dependency file to output.
+  tmpdepfile  Temporary file to use when outputing dependencies.
+  libtool     Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "depcomp $scriptversion"
+    exit $?
+    ;;
+esac
+
+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
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+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.  In older versions, 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.
+  # Version 6 uses the directory in both cases.
+  stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
+  tmpdepfile="$stripped.u"
+  if test "$libtool" = yes; then
+    "$@" -Wc,-M
+  else
+    "$@" -M
+  fi
+  stat=$?
+
+  if test -f "$tmpdepfile"; then :
+  else
+    stripped=`echo "$stripped" | sed 's,^.*/,,'`
+    tmpdepfile="$stripped.u"
+  fi
+
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+
+  if test -f "$tmpdepfile"; then
+    outname="$stripped.o"
+    # 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"
+  ;;
+
+icc)
+  # Intel's C compiler understands `-MD -MF file'.  However on
+  #    icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
+  # ICC 7.0 will fill foo.d with something like
+  #    foo.o: sub/foo.c
+  #    foo.o: sub/foo.h
+  # which is wrong.  We want:
+  #    sub/foo.o: sub/foo.c
+  #    sub/foo.o: sub/foo.h
+  #    sub/foo.c:
+  #    sub/foo.h:
+  # ICC 7.1 will output
+  #    foo.o: sub/foo.c sub/foo.h
+  # and will wrap long lines using \ :
+  #    foo.o: sub/foo.c ... \
+  #     sub/foo.h ... \
+  #     ...
+
+  "$@" -MD -MF "$tmpdepfile"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  # Each line is of the form `foo.o: dependent.h',
+  # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+  # Do two passes, one to just change these to
+  # `$object: dependent.h' and one to simply `dependent.h:'.
+  sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process this invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
+    sed -e 's/$/ :/' >> "$depfile"
+  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
+      # With Tru64 cc, shared objects can also be used to make a
+      # static library.  This mecanism is used in libtool 1.4 series to
+      # handle both shared and static libraries in a single compilation.
+      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+      #
+      # With libtool 1.5 this exception was removed, and libtool now
+      # generates 2 separate objects for the 2 libraries.  These two
+      # compilations output dependencies in in $dir.libs/$base.o.d and
+      # in $dir$base.o.d.  We have to check for both files, because
+      # one of the two compilations can be disabled.  We should prefer
+      # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+      # automatically cleaned when .libs/ is deleted, while ignoring
+      # the former would cause a distcleancheck panic.
+      tmpdepfile1=$dir.libs/$base.lo.d   # libtool 1.4
+      tmpdepfile2=$dir$base.o.d          # libtool 1.5
+      tmpdepfile3=$dir.libs/$base.o.d    # libtool 1.5
+      tmpdepfile4=$dir.libs/$base.d      # Compaq CCC V6.2-504
+      "$@" -Wc,-MD
+   else
+      tmpdepfile1=$dir$base.o.d
+      tmpdepfile2=$dir$base.d
+      tmpdepfile3=$dir$base.d
+      tmpdepfile4=$dir$base.d
+      "$@" -MD
+   fi
+
+   stat=$?
+   if test $stat -eq 0; then :
+   else
+      rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+      exit $stat
+   fi
+
+   for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+   do
+     test -f "$tmpdepfile" && break
+   done
+   if test -f "$tmpdepfile"; then
+      sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+      # That's a tab and a space 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 preprocessed 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'.
+  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
+  # Require at least two characters before searching for `:'
+  # in the target name.  This is to cope with DOS-style filenames:
+  # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+  "$@" $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 $?
+  # Remove any Libtool call
+  if test "$libtool" = yes; then
+    while test $1 != '--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+  # 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 ;;
+    # Strip any option that makedepend may not understand.  Remove
+    # the object too, otherwise makedepend will parse it as a source file.
+    -*|$object)
+      ;;
+    *)
+      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 preprocessed 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 -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+       -e '/^#line [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 preprocessed 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
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/docs/Hash_File_Format	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,83 @@
+A Hash File is an on-disk copy of a Hash Table keyed by filenames and
+with data containing a file size and position within an archive. It's
+designed to be a general purpose indexing tool for most archive
+formats or for "solid" (concatenated) file archives.
+
+Basic operations need to be performed on hash files and there are
+tools to do this:
+
+Listing the contents
+	hash_list [-l]
+
+Extraction
+	hash_extract
+
+Concatenation
+	hash_cat
+
+
+The Hash File format is:
+
+Header, archive file name, file headers/footers, hash buckets, hash
+linked list items, footer.
+
+In more detail:
+
+Header:
+   ".hsh" (magic numebr)
+   x4     (1-bytes of version code, eg "1.00")
+   x1     (HASH_FUNC_? function used)
+   x1     (number of file headers: FH. These count from 1 to FH inclusive)
+   x1     (number of file footers: FF. These count from 1 to FF inclusive)
+   x1     (reserved - zero for now)
+   x4     (4-bytes big-endian; number of hash buckets)
+   x8     (offset to add to item positions. eg size of this index)
+   x4     (total size of hashfile, includingf header, ..., index, footer)
+Archive name:
+   x1     (length 'L', zero => no name)
+   xL      (archive filename)
+File headers (FH copies of):
+   x8     (position)
+   x4     (size)
+File footers (FH copies of):
+   x8     (position)
+   x4     (size)
+Buckets (multiples of)
+   x4     (4-byte offset of linked list pos,  rel. to the start of the hdr)
+Items (per bucket chain, not written if Bucket[?]==0)
+   x1     (key length 'K', zero => end of chain)
+   xK     (key)
+   x0.5   (File header to use. zero => none) top 4 bits
+   x0.5   (File footer to use. zero => none) bottom 4 bits
+   x8     (position)
+   x4     (size)
+Index footer:
+   ".hsh" (magic number)
+   x8     (offset to Hash Header. >=0 = absolute, -ve = relative to end)
+
+The HashFile index may either be a separate file to the archive, in
+which case the "Archive name" section references the archive itself,
+or part of the archive itself in which case archive name is zero
+length. Additionally if the archive name length is non-zero but the
+first byte of the archive filename is zero then it is also considered
+to be part of the same archive. This allows for an index previously
+generated as a separate file to simply be appended to the archive with
+a minimal of binary editing (ie zeroing 1 byte).
+
+The HashFile index may also be at the start (preferred and searched
+for first) or the end of the file. This is the rationale behind having
+an index footer. It allows us to simply append a hash of a tar file to
+the end of the tar file itself and it'll work just fine without
+breaking the format of the tar file. (Tar files end with a blank
+block, so additional data is not read by tar.) Appending the hashfile
+requires an extra 2 seeks and 1 read (if opening from scratch) to fetch
+a file compared to prepending the hashfile. 
+
+If the hash file was originally stored as a separate file from the
+archive but is now being merged then zero the first byte of the
+archive filename and either prepend or append as desired. If you
+prepend the hash file then note that all the absolute offsets in the
+Item structures will now be incorrect. A correction factor may be
+applied, of the size of the HashFile itself, and this is the purpose
+of the offset field in the header.
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/docs/ZTR_format	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,1602 @@
+Notes: 28th May 2008
+
+For version 2.0 consider the following:
+
+1) Remove defunct or useless chunk types and compression formats.
+2) Rationalise inconsitent behaviour (eg endianness on zlib chunk).
+3) Support split header/data formats for SRF
+4) Formalise meta-data use better.
+5) More pie-in-the-sky ideas?
+
+What we've described so far could easily be said to be v1.4. It's
+backwards compatible and fairly minor is change. If we truely want to
+go for version 2 then taking the chance to remove all those niggles
+that we've kept purely for backwards compatibility would be good.
+
+In more detail:
+
+1) Removal of RLE and floating point chebyshev polynomials. Mark XRLE
+   as deprecated?
+
+   We may wish to add an extra option to XRLE2 to indicate the repeat
+   count before specifying the remaining run-length. This breaks the
+   format though. (Or add XRLE3 to allow such control?)
+
+2) Strange things I can see are:
+
+   2.1) All chunks use big-endian data except for zlib which has a
+        little-endian length.
+
+   2.2) The order that data is stored in differs per chunk type. For
+        trace data we store all As, then all Cs, all Gs and finally
+        all Ts. For confidence values we store called first followed
+        by remaining. Both SMP4 and CNF4 essentially hold 1 piece of
+        data per base type per base position, it's just the word size
+        and packing order that differs.
+
+	This means TSHIFT and QSHIFT compression types are tied very
+	much to trace and quality value chunks, rather than being
+	generic transforms. Maybe we should always have the same
+	encoding order and some standard compression/transformations
+	to reorder as desired.
+
+	An example:
+	All data related per call is stored in the natural order
+	produced. (eg as utilised in CNF1, BPOS).
+
+	All data related per base-type per call is stored in the order
+	produced: A, C, G, T for the first base position, A, C, G, T
+	for the second position, and so on.
+
+	Then we have standard filters that can swap between
+	ACGTACGTACGT... and AAA...CCC...GGG...TTT... or to
+	<called><non-called * 3>... order (which requires a BASE chunk
+	present to encode/decode). We'd have 1, 2 and 4 byte variants
+	of such filters. They do not need to understand the nature of
+	the data they're manipulating, just the word size and a
+	predetermined order to shuffle the data around in.
+
+	For CNF4 a combination of {ACGT}* to {<called><non-called*3>}*
+	followed by {ACGT}* to A*C*G*T* ordering would end up with all
+	<called> followed by all 3 remaining non-called. Ie as it is
+	now (which we then promptly "undo" in solexa data by using
+	TSHIFT).a
+	
+3) I'm wondering if there's mileage here in having negative lengths to
+   indicate constant data + variable data further on.
+
+   Eg length -10 means the next 10 bytes are the start of the data for
+   this chunk. Some stage later we'll read a 4-byte length followed by
+   the remaining data for this chunk.
+
+   Rationale: often we end up with many identical bytes at the start
+   of a chunk. For example, we take a solexa trace (0 0 value...), run
+   it through TSHIFT (80 0 0 0 previous data => 80 0 0 0 0 0 value ...)
+   and then through STHUFF (77 80(eg) data), but data is the
+   compressed stream always starting with 80 0 0 0 0 0 so typically it's
+   always the same starting string.
+
+   Tested on an SRF file I see SMP4 always starting with the same 9
+   bytes of data, BASE starting with the same 3 bytes and CNF4 always
+   starting with the same 7 bytes. Hence we'd have lengths -9, -3 and
+   -7 in the chunk headers and move that common data to the header
+   block too. That's approx 3% of the size of our SRF file.
+
+4) I propose *all* chunks have some standard meta-data fields
+   available for use. These can be:
+
+   4.1) GROUP - all chunks sharing the same GROUP value are considered
+        as being related to one another. This provides a mechanism for
+        multiple base-call, base position and confidence value chunks
+        while still knowing which confidence values belong to which
+        call. It also allows for multiple SAMP chunks (instead of the
+        SMP4 chunk) to be collated together if desired.
+
+	I don't expect many ZTR files to contain calls from multiple
+	base-callers, but it's maybe a nice extension and seems quite
+	a simple/clean use of meta-data.
+
+   4.2) ENCODING - the default encoding for the chunk data is as
+        described in the chunk. We may however wish to override this
+        and, for example, store SMP4 data as 32-bit floating point
+        values instead of 16-bit integers. This specifies that.
+
+	Question: do we want this available universally everywhere? If
+	not, we should at least use the same meta-data keyword for all
+	occurrences.
+
+   4.3)	TRANSFORM - a simple transformation description. This is
+        essentially a mini-formula. It replaces the OFFS meta-data
+        used in SMP4 which is simply a transform of X+value.
+
+5) There are more generic ways to save storage by removing redundancy.
+
+   Most probably they're not worth it, but I list them here for
+   discussion still.
+
+   5.1) Use 7-bit variable sized encodings for values instead of fixed
+        32-bit sizes.
+
+	Eg instead of storing 1000 as 0x3*0x100 + 0xe8 (00 00 03 e8)
+	we could store it as 0x7*0x80 + 0x68 (80|07 68). The logic
+	here being setting the top bit implies this isn't the final
+	value and more data follows. It allows for variable sized
+	fields so that small numbers take up fewer bytes. The same can
+	be applied to data in SRF structs too.
+
+	Realistically it saves 2 bytes per record in SRF and an
+	unknown amount for ZTR - estimated 8 or so (3 for cnf4/base
+	and 2 for smp4). It's only 1.5% saving though in total.
+
+   5.2) A general purpose dictionary system. Instead of attempting to
+        move headers to one area and data somewhere else, possibly
+        also taking common portions of data and putting that somewhere
+        too, we could provide a dictionary system whereby we
+        previously remove redundancy by replacing all occurrences of a
+	particular byte pattern with a new shorter code. (We'd need an
+        escape mechanism for when it occurs by chance.) The dictionary
+        can then be specified in it's own chunk which is stored in the
+        header portion.
+
+	This then works for portions of chunk header (eg if the
+	meta-data changes) rather than full headers, where the data
+	blocks always start with the same text, or where we want to
+	have sensible names in text fields but don't like them taking
+	up too much space.
+
+	It's maybe a bit messy though and complex to implement, plus
+	it's unknown how big an impact having to escape accidental
+	dictionary codes from appearing in real data. The more formal
+	way of removing redundancy is probably better.
+
+    5.3) Lossy compression. I believe there's still room for this,
+         although it needs careful thought.
+
+	 The floating point format really isn't an ideal way to do it
+	 though, so I'd much rather have an encoding system that uses
+	 N*log(signal/M+1) plus a sign bit, stored in integers.
+
+	 As we store data in integers the value of N combined with the
+	 maximum value for log(signal/M+1) gives us the number of bits
+	 we wish to encode to. Essentially we're storing the log value
+	 to a fixed point precision.
+
+	 The value of M dictates the slope of the errors we get from
+	 logging. It's hard to describe, but basically as signal gets
+	 larger our average error in storing the signal also gets
+	 larger. That's true for floating point values too as there's
+	 a fixed number of bits and they're being used to represent
+	 larger and larger values, meaning the resolution drops.
+
+	 I have various test code and graphs showing error profiles
+	 for logs vs fixed point vs floating point. Logs or fixed
+	 point are nearly always preferable to a floating point format
+	 for size vs accuracy.
+
+-----------------------------------------------------------------------------
+
+CHANGE (since 1.2):
+SAMP and SMP4 now has meta data fields indicating the zero base-line.
+
+CLARIFICATION
+The specification now explicitly states that trace samples are
+unsigned, although the new OFFS meta-data can be used to turn these
+into signed values.
+
+CLARIFICATION
+We explicitly state that multiple TEXT chunks maybe present in the ZTR
+file and will be concatenated together. Also the trailing (nul) byte
+is now optional.
+
+CHANGE
+Added CSET (character set) meta-data for BASEs so ABI SOLID encoding
+can be used. This removes the requirement of IUPAC characters only.
+
+CHANGE
+Added XRLE2, QSHIFT, TSHIFT and STHUFF compression types.
+
+INCOMPATIBLE CHANGE:
+I propose for this version to make all meta-data adhere to a specific
+format rather than adhoc. It'll consist of zero or more copies of
+'identifier nul value nul'. See the format below for details.
+
+The only use of meta-data in 1.2 was for SAMP (not SMP4) chunks to
+indicate the channel the data came from. From now on file readers will
+need to check the version number in the header to determine how to
+parse the SAMP meta-data.
+
+
+[Search for "FIXME" for my comments / questions to be answered. They
+elaborate on the summary below and provide more context.]
+
+
+QUESTION1:
+Should we adapt ZTR to not be so inefficient with regards
+to tiny chunks. Specifically a 5 byte chunk size, 4 byte meta-data
+size (normally zero anyway) and 4 byte data length is all
+wasteful. These combined comprise 5-10% of the total SRF size. Note
+that changing this would break backwards compatibility.
+
+QUESTION2:
+Do I need a means to specify the "default meta-data". Specifically if
+we have lots of SAMP chunks (for example) and every single one is
+stating that the zero "offset" value is 32768 then we may want a
+mechanism of specifying that the default OFFS value is 32768 for all
+subsequent SAMP chunks.
+
+One possible way to do this is to have a new chunk type which sets the
+default. Eg for the SAMP chunk we could define a SaMP chunk to modify
+the default for SAMP. This seems oddly named, but it's utilising the
+bit5 of the 2nd byte which so far has been reserved as zero. (In the
+first byte bit 5 set => private namespace and not part of the public spec.)
+
+For now I'm just ignoring this issue though.
+
+QUESTION3:
+I've defined new transforms named TSHIFT and QSHIFT specifically
+designed for adjusting the layout of CND4 and SMP4 chunk types to an
+order more amenable for compression by interlaced deflate. They do the
+job, but I'm wondering if it's better to simply redefine the input
+data to be a more consistent ordering so that we can define more
+general purpose transforms rather than one dedicated to the original
+trace layout and one for the quality layout.
+
+I'm ignoring this for now as it would break backwards compatibility.
+
+QUESTION4:
+For the OFFS meta-data in SMP4 and SAMP chunks I have a 16-bit offset
+to specify the zero position.  Ie OFFS of 10000 means a sample of 9000
+becomes -1000 after processing.
+
+Should it be a signed or unsigned 16-bit value. Signed means we could
+encode values ranging from 10000 to 70000 by specify OFFS as -10000.
+
+Should it be 32-bit instead? Should we have OFFI and OFFF for integer
+and floating point equivalents?
+
+QUESTION5:
+For region encoding where should the region name belong - the
+meta-data section or the REGION_LIST TEXT identifier? It's currently
+in both places. My gut instinct tells me it belongs in the meta-data
+for the REGION_LIST chunk itself.
+
+QUESTION6:
+Can we have clarification on what the region code types mean,
+specifically "tech read".
+
+QUESTION7:
+Should we add SAMP/SMP4 meta-data indicating a down-scale factor? For
+454 data this could be 100, so we know value 123 is really 1.23. Note
+this is maybe better implemented below using fixed-point precision.
+
+QUESTION8:
+How do we deal with floating point values?
+
+I think the chunk meta-data should detail the format of the data block
+itself (as it is strictly speaking data about the data so it fits
+there well). A lack of meta data should imply the usual unsigned
+16-bit quantities.
+
+There's two main ways to encode fractions:
+
+Floating point where we have a mantissa and an exponent.
+	- See http://en.wikipedia.org/wiki/IEEE_floating-point_standard
+	- large dynamic range
+	- fixed number of significant bits
+	- varying "resolution". Ie can represent tiny differences
+	  between two very small floating point numbers, but not
+	  between two very large floating point numbers.
+
+Fixed point where we have a fixed number of bits for the component
+before and after the decimal point.
+	- See http://en.wikipedia.org/wiki/Q_%28number_format%29
+	- constant resolution
+	- effectively used by SFF (specified to 2 decimal places)
+	- easy to treat as integers so can be fast and dealt with by
+	  small embedded CPUs without FPUs.
+
+
+Floating point maybe appropriate as effectively it's the same as
+logging your signals and storing those. It offers large dynamic range
+so can cope with abnormally large values (at the expense of precision)
+while retaining lots of variation at the low end to distinguish small
+values. However it's CPU intensive to cope with anything other than
+the CPU provided 32-bit and 64-bit floating point formats.
+
+Single precision 32-bit floats in IEEE-754 have:
+ 1 bit  (31):    Sign
+ 8 bits (23-30): Exponent (bias 127, so stroring 100 => -27)
+23 bits (0-22):  Mantissa 
+
+Effectively we store any binary value as a normalised expression:
+
+                    <exponent>
+    1.<mantissa> * 2
+
+
+Eg 1732.5:
+
+=> 11011000100.1 (binary)
+=> 1.10110001001 (binary) * 2^10
+
+Exponent+127 => 137 => 10001001 (binary)
+
+sign  exponent  mantissa
+   0  10001001  10110001001000000000000
+
+(17325 => 0x43ad  => 0x0010001110101101
+
+However we probably want 16-bit and 24-bit floating point types for
+efficiencies sake. Do we go with some fixed predefined floating point
+formats for 8-bit, 16-bit, 24-bit and 32-bit layouts (with 32-bit
+being identical to IEEE754) or do we allow for specification of the
+mantissa and exponent Eg FLOAT=23.8, FLOAT=17.6 or FLOAT=5.2 in the
+meta-data block?
+
+FLOAT=17.6 (24-bit) gives ranges +/- 8.6*10^9
+FLOAT=5.2  (8-bit)  gives ranges +/- 64 (I think).
+
+Alternatively if we restrict ourselves to only using the most
+significant 14 bits of the mantissa then storing as standard 32-bit
+floats implies 1 in every 4 bytes is zero. This may provide for a
+very crude, but fast way to implement reduced size floating point
+values - ie FLOAT=15.8 (24-bit signed).
+
+For fixed point (as in SFF values) there's already a draft standard
+for implementation in C (ISO/IEC TR 18037:2004).
+
+One benefit of fixed point over floating point is speed of
+implementation. Fixed point numbers can just be dealt with as
+integers. Eg subtracting two fixed point 16-bit values can be done in
+integers using a-b and the result is the same as if we'd done all the
+bit twiddling and maths directly simulating a real fixed-point unit.
+
+My gut feeling is that we'd want to explicitly declare the number of
+bits for integral and fractional components in the meta-data block.
+
+Comments?
+
+James
+
+PS. The latest (only minor tweaks from before) ZTR draft spec
+follows.
+
+
+
+
+1.3 draft 3 (19 Oct 2007)
+
+				ZTR SPEC v1.3
+				=============
+
+Header
+======
+
+The header consists of an 8 byte magic number (see below), followed by
+a 1-byte major version number and 1-byte minor version number.
+
+Changes in minor numbers should not cause problems for parsers. It indicates
+a change in chunk types (different contents), but the file format is the
+same.
+
+The major number is reserved for any incompatible file format changes (which
+hopefully should be never).
+
+/* The header */
+typedef struct {
+    unsigned char  magic[8];	  /* 0xae5a54520d0a1a0a (b.e.) */
+    unsigned char  version_major; /* 1 */
+    unsigned char  version_minor; /* 3 */
+} ztr_header_t;
+
+/* The ZTR magic numbers */
+#define ZTR_MAGIC		"\256ZTR\r\n\032\n"
+#define ZTR_VERSION_MAJOR	1
+#define ZTR_VERSION_MINOR	3
+
+So the total header will consist of:
+
+Byte number   0  1  2  3  4  5  6  7  8  9
+            +--+--+--+--+--+--+--+--+--+--+
+Hex values  |ae 5a 54 52 0d 0a 1a 0a|01 03|
+            +--+--+--+--+--+--+--+--+--+--+
+
+Chunk format
+============
+
+The basic structure of a ZTR file is (header,chunk*) - ie header followed by
+zero or more chunks. Each chunk consists of a type, some meta-data and some
+data, along with the lengths of both the meta-data and data.
+
+Byte number   0  1  2  3   4    5    6   7   8  9
+            +--+--+--+--+----+----+----+---+--+  -  +--+--+--+--+--+--  -  --+
+Hex values  |   type    |meta-data length  | meta-data |data length| data .. |
+            +--+--+--+--+----+----+----+---+--+  -  +--+--+--+--+--+--  -  --+
+
+FIXME: For very short reads this is a large overhead. We have 8 bytes
+of length information (of which typically only 1-2 are non-zero) and 4
+bytes for type (which typically only has one of 4-5 values). This
+means about 10 bytes wasted per chunk, or maybe 5-10% of the total
+file size. Changing this would be a radical departure from ZTR; is it
+justified given the savings? (est. 4.8% for 74bp reads, 8.4% for 27bp
+reads).
+One idea if to consider a ZTR file (the non "block" components at
+least) to be a series of huffman codes, by default all 8-bit long and
+matching their ASCII codes. Then a dedicated chunk could be used to
+adjust these default codes. It's therefore backwards compatible, but
+is that also overkill? (NB, this looks like it'd save 6% on the
+overall file size.)
+
+Ie in C:
+
+typedef struct {
+    uint4 type;			/* chunk type (b.e.) */
+    uint4 mdlength;		/* length of meta-data field (b.e.) */
+    char *mdata;		/* meta data */
+    uint4 dlength;		/* length of data field (b.e.) */
+    char *data;			/* a format byte and the data itself */
+} ztr_chunk_t;
+
+All 2 and 4-byte integer values are stored in big endian format.
+
+The meta-data is uncompressed (and so it does not start with a format
+byte). From version 1.3 onwards meta-data is defined to be in key
+value pairs adhering to the same structure defined in the TEXT chunk
+("key\0value\0"). Exceptions are made for this only for purposes of
+backwards compatibility in the SAMP chunk type. The contents of the
+meta-data is chunk specific, and many chunk types will have no
+meta-data. In this case the meta-data length field will be zero and
+this will be followed immediately by the data-length field.
+
+Ie all meta-data adheres to the following structure:
+
+Meta-data: (version 1.3 onwards only)
+            +-  -  -+--+-  -  -+--+-     -+-  -  -+--+-  -  -+--+
+Hex values  | ident | 0| value | 0|   -   | ident | 0| value | 0|
+            +-  -  -+--+-  -  -+--+-     -+-  -  -+--+-  -  -+--+
+
+FIXME: Can we have specify the meta-data once per ZTR file and omit it
+in subsequent chunks? Eg a blank chunk with meta-data only in the
+header. Chunks in the body then specify meta-data length as 0xFFFFFFFF
+as an indicator meaning "use the last meta-data defined for this chunk
+type". Useful when split in two, as in SRF?
+
+Note that this means both ident and values must not themselves contain
+the zero byte (a nul character), hence we generally store ident-value
+pairs in ASCII string forms.
+
+The data length ("dlength") is the length in bytes of the entire
+'data' block, including the format information held within it.
+
+The first byte of the data consists of a format byte. The most basic format is
+zero - indicating that the data is "as is"; it's the real thing. Other formats
+exist in order to encode various filtering and compression techniques. The
+information encoded in the next bytes will depend on the format byte.
+
+
+RAW (#0) - no formatting
+--------
+
+Byte number   0 1  2       N
+            +--+--+--  -  --+
+Hex values  | 0|  raw data  |
+            +--+--+--  -  --+
+
+Raw data has no compression or filtering. It just contains the unprocessed
+data. It consists of a one byte header (0) indicating raw format followed by N 
+bytes of data.
+
+
+RLE (#1) - simple run-length encoding
+-------
+
+Byte number   0  1    2     3     4      5     6  7  8               N
+            +--+----+----+-----+-----+-------+--+--+--+--  -  --+--+--+
+Hex values  | 1| Uncompressed length | guard | run length encoded data|
+            +--+----+----+-----+-----+-------+--+--+--+--  -  --+--+--+
+
+Run length encoding replaces stretches of N identical bytes (with value V)
+with the guard byte G followed by N and V. All other byte values are stored 
+as normal, except for occurrences of the guard byte, which is stored as G 0.
+For example with a guard value of 8:
+
+Input data:
+	20 9 9 9 9 9 10 9 8 7
+
+Output data:
+	1			(rle format)
+	0 0 0 10		(original length)
+	8			(guard)
+	20 8 5 9 10 9 8 0 7	(rle data)
+
+
+ZLIB (#2) - see RFC 1950
+---------
+
+Byte number   0  1    2     3     4    5  6  7         N
+            +--+----+----+-----+-----+--+--+--+--  -  --+
+Hex values  | 2| Uncompressed length | Zlib encoded data|
+            +--+----+----+-----+-----+--+--+--+--  -  --+
+
+This uses the zlib code to compress a data stream. The ZLIB data may itself be 
+encoded using a variety of methods (LZ77, Huffman), but zlib will
+automatically determine the format itself. Often using zlib mode
+Z_HUFFMAN_ONLY will provide best compression when combined with other
+filtering techniques.
+
+
+XRLE (#3) - multi-byte run-length encoding
+---------
+
+Byte number   0    1     2     3  4  5                N
+            +--+------+-------+--+--+--+--  -  --+--+--+
+Hex values  | 3| size | guard | run length encoded data|
+            +--+------+-------+--+--+--+--  -  --+--+--+
+
+Much standard RLE, but this mechanism has a byte to specify the length
+of the data item we compare to check for runs. It is not restricted to
+spotted runs aligned on 'size' byte boundaries either.
+
+No uncompressed length is encoded here as technically this is not
+required (although it does make decoding a bit slower). The compressed
+length alone is sufficient to work out the uncompressed length after
+decompressing.
+
+Guard bytes in the input stream are 'escaped' by the replacing the
+guard byte followed by zero. Guard bytes in a parameterised run (ie X
+copies of Y where Y contains the guard) do not need to be 'escaped'
+
+Input data:
+10 12 12 13 12 13 12 13 12 13 14
+
+Output data:
+3				(xrle format)
+2				(size of blocks to compare)
+12			        (guard, 12 is a bad choice but illustrative)
+10 12 0 12 4 12 13 14           (rle data)
+
+
+XRLE2 (#4) - word aligned multi-byte run-length encoding
+----------
+Version 1.3 onwards
+
+Byte number   0     1       RSZ          multiple of RSZ
+            +--+-----+---------+-- - - - - - - - - - ---+
+Hex values  | 4| RSZ | padding | run length encoded data|
+            +--+-----+---------+-- - - - - - - - - - ---+
+
+This achieves the same goal as XRLE, but is designed to maintain data
+aligned to specific 'record size' boundaries. This sometimes has
+benefits over XRLE in that subsequent a interlaced deflate entropy
+encoding may work better on record-aligned data streams.
+
+The first byte holds the format (#4) while the record size (RSZ) is
+held in the second byte. In order to ensure the entire block of data
+is aligned on 'RSZ' bounaries RSZ-2 padding bytes are written out
+before the data itself starts. The contents of these bytes can be
+anything.
+
+Unlike XRLE it also does not use an explicit guard byte. If we term a
+'word' to be a block of data of size RSZ, then whenever we read a word
+which is identical to the last word written then we write out that
+word (so we have two consecutive words in the output data) followed by
+a counter of how many additional copies of that word are found, up to
+255. This counter consists of 1 byte indicating the number of
+additional copies of the word followed by RSZ-1 padding bytes to
+maintain word alignment. While the contents of these padding bytes may
+be anything, it is suggested that they adhere to same value
+distribution as observed elsewhere in the data block in order to keep
+the data entropy low. (For example repeating the previous bytes from
+'word' will do.)
+
+Example:
+
+Input data: taken in pairs:
+        1 0  2 2  2 2  3 1  3 1  3 1  2 4  2 4  2 4  2 3
+
+Output data:
+        4 2				(xrle2 format, rec size 2)
+	1 0				("1 0" from input)
+	2 2 2 2 0 2			("2 2" x 2)
+	3 1 3 1 1 1			("3 1" x 3)
+	2 4 2 4 1 4			("2 4" x 3)
+	2 3				("2 3")
+
+
+DELTA1 (#64) - 8-bit delta
+------------
+
+Byte number   0       1        2      N 
+            +--+-------------+--  -  --+
+Hex values  |40| Delta level |   data  |
+            +--+-------------+--  -  --+
+
+This technique replaces successive bytes with their differences. The level
+indicates how many rounds of differencing to apply, which should be between 1
+and 3. For determining the first difference we compare against zero. All
+differences are internally performed using unsigned values with automatic an
+wrap-around (taking the bottom 8-bits). Hence 2-1 is 1 and 1-2 is 255.
+
+For example, with level set to 1:
+
+Input data:
+      10 20 10 200 190 5
+
+Output data:
+       1			(delta1 format)
+       1			(level)
+       10 10 246 190 246 71	(delta data)
+
+For level set to 2:
+       
+Input data:
+      10 20 10 200 190 5
+
+Output data:
+       1			(delta1 format)
+       2			(level)
+       10 0 236 200 56 81	(delta data)
+
+
+DELTA2 (#65) - 16-bit delta
+------------
+
+Byte number   0       1        2      N 
+            +--+-------------+--  -  --+
+Hex values  |41| Delta level |   data  |
+            +--+-------------+--  -  --+
+
+This format is as data format 64 except that the input data is read in 2-byte
+values, so we take the difference between successive 16-bit numbers. For
+example "0x10 0x20 0x30 0x10" (4 8-bit numbers; 2 16-bit numbers) yields "0x10
+0x20 0x1f 0xf0". All 16-bit input data is assumed to be aligned to the start
+of the buffer and is assumed to be in big-endian format.
+
+
+DELTA2 (#66) - 32-bit delta
+------------
+
+Byte number   0       1        2  3  4      N 
+            +--+-------------+--+--+--  -  --+
+Hex values  |42| Delta level | 0| 0|   data  |
+            +--+-------------+--+--+--  -  --+
+
+
+This format is as data formats 64 and 65 except that the input data is read in
+4-byte values, so we take the difference between successive 32-bit numbers.
+
+Two padding bytes (2 and 3) should always be set to zero. Their purpose is to
+make sure that the compressed block is still aligned on a 4-byte boundary
+(hence making it easy to pass straight into the 32to8 filter).
+
+
+Data format 67-69/0x43-0x45 - reserved
+---------------------------
+
+At present these are reserved for dynamic differencing where the 'level' field 
+varies - applying the appropriate level for each section of data. Experimental 
+at present...
+
+
+16TO8 (#70) - 16 to 8 bit conversion
+-----------
+
+Byte number   0
+            +--+--  -  --+
+Hex values  |46|   data  |
+            +--+--  -  --+
+
+This method assumes that the input data is a series of big endian 2-byte
+signed integer values. If the value is in the range of -127 to +127 inclusive
+then it is written as a single signed byte in the output stream, otherwise we
+write out -128 followed by the 2-byte value (in big endian format). This
+method works well following one of the delta techniques as most of the 16-bit
+values are typically then small enough to fit in one byte.
+
+Example input data:
+	0 10 0 5 -1 -5 0 200 -4 -32 (bytes)
+	(As 16-bit big-endian values: 10 5 -5 200 -800)
+
+Output data:
+       70			(16-to-8 format)
+       10 5 -5 -128 0 200 -128 -4 -32
+
+
+32TO8 (#71) - 32 to 8 bit conversion
+-----------
+
+Byte number   0
+            +--+--  -  --+
+Hex values  |47|   data  |
+            +--+--  -  --+
+
+This format is similar to format 16TO8, but we are reducing 32-bit numbers (big
+endian) to 8-bit numbers.
+
+
+FOLLOW1 (#72) - "follow" predictor
+-------------
+
+Byte number   0  1     FF 100  101   N
+            +--+--  -  -  - --+-- - --+
+Hex values  |48| follow bytes |  data |
+            +--+--  -  -  - --+-- - --+
+
+For each symbol we compute the most frequent symbol following it. This is
+stored in the "follow bytes" block (256 bytes). The first character in the
+data block is stored as-is. Then for each subsequent character we store the
+difference between the predicted character value (obtained by using
+follow[previous_character]) and the real value. This is a very crude, but
+fast, method of removing some residual non-randomness in the input data and so 
+will reduce the data entropy. It is best to use this prior to entropy encoding 
+(such as huffman encoding).
+
+
+CHEB445 (#73) - floating point 16-bit chebyshev polynomial predictor
+-------------
+Version 1.1 only.
+Deprecated: replaced by format 74 in Version 1.2.
+
+WARNING: This method was experimental and have been replaced with an
+integer equivalent. The floating point method may give system specific
+results.
+
+Byte number   0  1  2      N
+            +--+--+--  -  --+
+Hex values  |49| 0|   data  |
+            +--+--+--  -  --+
+
+This method takes big-endian 16-bit data and attempts to curve-fit it using
+chebyshev polynomials. The exact method employed uses the 4 preceeding values
+to calculate chebyshev polynomials with 5 coefficents. Of these 5 coefficients
+only 4 are used to predict the next value. Then we store the difference
+between the predicted value and the real value. This procedure is repeated
+throughout each 16-bit value in the data. The first four 16-bit values are
+stored with a simple 1-level 16-bit delta function. Reversing the predictor
+follows the same procedure, except now adding the differences between stored
+value and predicted value to get the real value.
+
+
+ICHEB (#74) - integer based 16-bit chebyshev polynomial predictor
+-----------
+Version 1.2 onwards
+This replaces the floating point CHEB445 format in ZTR v1.1.
+
+
+Byte number   0  1  2      N
+            +--+--+--  -  --+
+Hex values  |4A| 0|   data  |
+            +--+--+--  -  --+
+
+This method takes big-endian 16-bit data and attempts to curve-fit it using
+chebyshev polynomials. The exact method employed uses the 4 preceeding values
+to calculate chebyshev polynomials with 5 coefficents. Of these 5 coefficients
+only 4 are used to predict the next value. Then we store the difference
+between the predicted value and the real value. This procedure is repeated
+throughout each 16-bit value in the data. The first four 16-bit values are
+stored with a simple 1-level 16-bit delta function. Reversing the predictor
+follows the same procedure, except now adding the differences between stored
+value and predicted value to get the real value.
+
+STHUFF (#77) - Interlaced Deflate
+------------
+Version 1.3 onwards
+
+Byte number   0  1  2                      N
+            +--+--+-- - - - - - --+-- - - --+
+Hex values  |4D| C| huffman codes |  data   |
+            +--+--+-- - - - - - --+-- - - --+
+
+This compresses data using huffman encoding using the Deflate
+algorithm for storing the codes and data. It is analogous to using
+zlib with the Z_HUFFMAN_ONLY strategy and a negative window
+size. However it has a few tweaks for optimal compression of very
+small data sets. See RFC 1951 for details of Deflate. If the following
+text is in decrepancy with RFC 1951 then the RFC takes priority. The
+following is included as additional explanatory material only.
+
+Huffman compression works by replacing each character (or 'symbol')
+with a string of bits. Common symbols have are encoded using few bits
+and rare symbols need a longer string of bits. The net effect is that
+the overall number of bits needed to store a message is reduced.
+
+To uncompress a compressed data stream it is necessary to know which
+symbols are present and what their bit-strings are. For brevity this
+is achieved by storing only the lengths of the bit-string for each
+symbol and generating bit-strings from the lengths. As long as the
+same canonical algorithm is used in both the encoder and decoder then
+knowing the lengths alone is sufficient. Knowledge of this algorithm
+is required for uncompressing the data, so it is defined as follows:
+
+1. Sort symbols by the length of their bit-strings, smallest first.
+
+   The collating order for symbols sharing the same length is defined
+   as ASCII values 0 to 255 inclusive followed by the EOF symbol.
+
+2. X = 0
+
+3. For all bit lengths 'L' from 1 to 24 inclusive: 
+
+           For all Symbols of bit length 'L', sorted as above:
+                   Code(Symbol) = least significant 'L' bits of X
+                   X = X + 1
+           End loop
+
+           X = X * 2
+
+   End loop
+
+This is the same algorithm utilised in the Deflate algorithm (RFC 1951).
+
+
+For example compressing "abracadabra" gives:      /\            
+                                                 0  1           
+Symbol    bit-length    Code(X)                 /    \          
+-------------------------------                a     /\         
+a         1              0 0                        /  \                
+b         3              4 100                     0    1       
+c         3              5 101                    /      \        
+r         3              6 110                   /        \       
+d         4             14 1110                 /\        /\    
+EOF       4             15 1111                0  1      0  1   
+                                              /    \    /    \  
+which in turn leads to 28 bits               b      c  r     /\ 
+of output:                                                  0  1        
+                                                           /    \       
+ 0100110010101110010011001111                             d     EOF
+(ab  r  ac  ad   ab  r  aEOF)      
+
+
+In the data format defined above, 'C' is a code-set number. If it is
+zero the the huffman codes to uncompress 'data' are stored in the
+following bytes using the same format describe in the DFLH chunk type
+below, otherwise no huffman codes are stored and a predefined
+set of huffman codes are used being either defined in a preceeding
+DFLH chunk (for 128 <= 'C' <= 255) or statically defined in this
+document (for 1 <= 'C' <= 127).  Immediately following this is the
+compressed bit-stream itself.
+
+The statically defined huffman code-sets are as follows. The symbols
+are listed below as their printable ASCII character or hash followed
+by a number, so A and #65 are the same symbol. We use the algorithm
+described above to turn these bit-lengths into actual huffman codes.
+
+C=1: CODE_DNA
+
+    Length   Symbols
+    ----------------
+    2        A C T
+    3        G
+    4        N
+    5	     #0
+    6        EOF
+    13       #1 to #6 inclusive
+    14       #7 to #255 except where already listed above
+
+C=2: CODE_DNA_AMBIG (DNA with IUPAC ambiguity codes)
+
+    Length   Symbols
+    ----------------
+    2        A C T
+    3        G
+    4        N
+    7	     #0 #45
+    8        B D H K M R S V W Y
+    11	     EOF
+    14	     #226
+    15	     #1 to #255 except where already listed above
+
+C=3: CODE_ENGLISH (English text)
+
+    Length   Symbols
+    ----------------
+    3	     #32 e
+    4	     a i n o s t
+    5	     d h l r u
+    6	     #10 #13 #44 c f g m p w y
+    7	     #46 b v
+    8	     #34 I k
+    9	     #45 A N T
+    10	     #39 #59 #63 B C E H M S W x
+    11	     #33 0 1 F G
+    15	     #0 to #255 except where already listed above
+
+
+It is recommended that this compression format is used only for small
+data sizes and ZLIB is used for larger (a few K and above) data.
+
+
+QSHIFT (#79) - 4-byte quality reorder
+------------
+Version 1.3 onwards
+
+This reorders the quality signal to be 4-tuples of the quality for the
+called base followed by the quality of the other 3 base types in the
+order they appear in a,c,g,t (minus the called base).
+
+The purpose is to allow a 4-byte interlaced deflate algorithm to
+operate efficiently.
+
+
+TSHIFT (#70) - 8-byte trace reorder
+------------
+Version 1.3 onwards
+
+This reorders the trace signal to be 4-tuples of the 16-bit trace
+signals for the called base followed by the signal from the other 3
+base types in the order they appear in a,c,g,t (minus the called
+base).
+
+The purpose is to allow a 8-byte interlaced deflate algorithm to
+operate efficiently.
+
+FIXME: QSHIFT and TSHIFT could be general purpose byte rearrangements
+without any knowledge of the data type they're holding. They need the
+input data to be consistently ordered and not the large differences we
+see between quality and trace right now.
+
+
+Version 1.3 onwards
+Chunk types
+===========
+
+As described above, each chunk has a type. The format of the data contained in 
+the chunk data field (when written in format 0) is described below.
+Note that no chunks are mandatory. It is valid to have no chunks at all.
+However some chunk types may depend on the existance of others. This will be
+indicated below, where applicable.
+
+Each chunk type is stored as a 4-byte value. Bit 5 of the first byte is used
+to indicate whether the chunk type is part of the public ZTR spec (bit 5 of
+first byte == 0) or is a private/custom type (bit 5 of first byte == 1). Bit
+5 of the remaining 3 bytes is reserved - they must always be set to zero.
+
+Practically speaking this means that public chunk types consist entirely of
+upper case letters (eg TEXT) whereas private chunk types start with a
+lowercase letter (eg tEXT). Note that in this example TEXT and tEXT are
+completely independent types and they may have no more relationship with each
+other than (for example) TEXT and BPOS types.
+
+It is valid to have multiples of some chunks (eg text chunks), but not for
+others (such as base calls). The order of chunks does not matter unless
+explicitly specified.
+
+A chunk may have meta-data associated with it. This is data about the data
+chunk. For example the data chunk could be a series of 16-bit trace samples,
+while the meta-data could be a label attached to that trace (to distinguish
+trace A from traces C, G and T). Meta-data is typically very small and so it
+is never need be compressed in any of the public chunk types (although
+meta-data is specific to each chunk type and so it would be valid to have
+private chunks with compressed meta-data if desirable).
+
+The first byte of each chunk data when uncompressed must be zero, indicating
+raw format. If, having read the chunk data, this is not the case then the
+chunk needs decompressing or reverse filtering until the first byte is
+zero. There may be a few padding bytes between the format byte and the first
+element of real data in the chunk. This is to make file processing simpler
+when the chunk data consists of 16 or 32-bit words; the padding bytes ensure
+that the data is aligned to the appropriate word size. Any padding bytes
+required will be listed in the appopriate chunk definition below.
+
+
+The following lists the chunk types available in 32-bit big-endian format.
+In all cases the data is presented in the uncompressed form, starting with the 
+raw format byte and any appropriate padding.
+
+SAMP
+----
+
+Or Meta-data: (version 1.2 and before)
+Byte number   0  1  2  3
+            +--+--+--+--+
+Hex values  | data name |
+            +--+--+--+--+
+
+Data:
+Byte number   0  1  2  3  4  5  6  7       N
+            +--+--+--+--+--+--+--+--+-     -+
+Hex values  | 0| 0| data| data| data|   -   |
+            +--+--+--+--+--+--+--+--+-     -+
+
+This encodes a series of 16-bit unsigned trace samples. The first data
+byte is the format (raw); the second data byte is present for padding
+purposes only. After that comes a series of 16-bit big-endian
+values.  Although stored as unsigned, a baseline value can be
+specified which is should then be subtracted from all values to
+generated signed data if required. By default the baseline is zero.
+
+Valid identifiers for the meta-data (version 1.3 onwards) are:
+
+Ident	     Value(s)
+---------------------------------------------------------------------
+TYPE	     "A", "C", "G", "T", "PYNO" or "PYRW"
+OFFS         16-bit signed integer representing the 'zero' position,
+	     in ASCII.
+
+[ FIXME: signed or unsigned? Signed means we couldn't store data in
+the range from -48K to +16K. Unsigned means we couldn't store data in
+the range 10K to 70K. What's most useful? Or should OFFS be 32-bit
+instead? ]
+
+Versions prior to 1.3 specified meta-data consisted of a single 4-byte
+block containing a 4-byte name associated with the trace. If a
+type-name is shorter than 4 bytes then it should be right padded with
+nul characters to 4 bytes. For sequencing traces the four lanes
+representig A, C, G and T signals have names "A\0\0\0", "C\0\0\0",
+"G\0\0\0" and "T\0\0\0". PYNO and PYRW refer to normalised and raw
+pyrogram data (eg from 454 instruments). At present other names are
+not reserved, but it is recommended that (for consistency with
+elsewhere) you label private trace arrays with names starting in a
+lowercase letter (specifically, bit 5 is 1).
+
+For the purposes of backwards compatibility, readers should check the
+version number in the ZTR header to determine whether the old or new
+style meta-data formatting is in use.
+
+For sequencing traces it is expected that there will be four SAMP chunks,
+although the order is not specified.
+
+
+SMP4
+----
+
+Meta-data: optional - see below
+
+Data:
+Byte number   0  1  2  3  4  5  6  7       N
+            +--+--+--+--+--+--+--+--+-     -+
+Hex values  | 0| 0| data| data| data|   -   |
+            +--+--+--+--+--+--+--+--+-     -+
+
+
+As per SAMP, this encodes a series of unsigned 16-bit trace values, to
+be base-line corrected by the OFFS meta-data value as appropriate.
+
+The first byte is 0 (raw format). Next is a single padding byte (also 0).
+Then follows a series of 2-byte big-endian trace samples for the "A" trace,
+followed by a series of 2-byte big-endian traces samples for the "C" trace,
+also followed by the "G" and "T" traces (in that order). The assumption is
+made that there is the same number of data points for all traces and hence the 
+length of each trace is simply the number of data elements divided by four.
+
+Experimentation has shown that this gives around 3% saving over 4
+separate SAMP chunks, but it lacks in flexibility.
+
+Valid identifiers for the meta-data are:
+
+Ident	     Value(s)
+---------------------------------------------------------------------
+OFFS         16-bit signed integer representing the 'zero' position
+TYPE         The type of data-set encoded. Values can be:
+             "PROC" - processed data for viewing, also the default
+                      when no type field is found.
+             "SLXI" - Illumina GA raw intensities (.int.txt files)
+             "SLXN" - Illumina GA noise intensities (.nse.txt files)
+	      
+
+BASE
+----
+
+Meta-data: optional - see below
+
+Data:
+Byte number   0  1  2  3      N  
+            +--+--+--+--  -  --+
+Hex values  | 0| base calls    |
+            +--+--+--+--  -  --+
+
+The first byte is 0 (raw format). This is followed by the base calls in ASCII
+format (one base per byte). By default it is assumed that all base
+calls are stored using the IUPAC characters[1].
+
+Valid identifiers for the meta-data are:
+
+Ident	 Meaning         Value(s)
+---------------------------------------------------------------------
+CSET     Character-set   'I' (ASCII #73) => IUPAC ("ACGTUMRWSYKVHDBN")
+			 '0' (ASCII #49) => ABI SOLiD ("0123N")
+
+BPOS
+----
+
+Meta-data: none present
+
+Data:
+Byte number   0  1  2  3  4  5  6  7       
+            +--+--+--+--+--+--+--+--+-     -+--+--+--+--+
+Hex values  | 0| padding|   data    |   -   |    data   |
+            +--+--+--+--+--+--+--+--+-     -+--+--+--+--+
+
+This chunk contains the mapping of base call (BASE) numbers to sample (SAMP)
+numbers; it defines the position of each base call in the trace data. The
+position here is defined as the numbering of the 16-bit positions held in the
+SAMP array, counting zero as the first value.
+
+The format is 0 (raw format) followed by three padding bytes (all 0). Next
+follows a series of 4-byte big-endian numbers specifying the position of each
+base call as an index into the sample arrays (when considered as a 2-byte
+array with the format header stripped off).
+
+Excluding the format and padding bytes, the number of 4-byte elements should
+be identical to the number of base calls. All sample numbers are counted from
+zero. No sample number in BPOS should be beyond the end of the SAMP arrays
+(although it should not be assumed that the SAMP chunks will be before this
+chunk). Note that the BPOS elements may not be totally in sorted order as
+the base calls may be shifted relative to one another due to compressions.
+
+
+CNF1
+----
+
+Meta-data: optional - see below
+
+Data:
+Byte number   0  1              N 
+            +--+--+--   -   --+--+
+Hex values  | 0| call confidence |
+            +--+--+--   -   --+--+
+
+(N == number of bases in BASE chunk)
+
+Valid identifiers for the meta-data are:
+
+Ident	 Value(s)   Meaning
+---------------------------------------------------------------------
+SCALE    PH         Phred-scaled confidence values. (Default). i.e. for
+                    a call with probability p:  -10*log10(1-p)
+         LO         Log-odds scaled values. ie:  10*log10(p/(1-p))
+	
+
+The first byte of this chunk is 0 (raw format). This is then followed by a
+series signed 8-bit confidence values for the called bases.
+
+Either phred or log-odds (as used by the Illumina GA) scale ranges are
+appropriate.
+
+
+CNF4
+----
+
+Meta-data: optional - see below
+
+Data:
+Byte number   0  1              N              4N
+            +--+--+--   -   --+--+----- -  -----+
+Hex values  | 0| call confidence | A/C/G/T conf |
+            +--+--+--   -   --+--+----- -  -----+
+
+(N == number of bases in BASE chunk)
+
+Valid identifiers for the meta-data are:
+
+Ident	 Value(s)   Meaning
+---------------------------------------------------------------------
+SCALE    PH         Phred-scaled confidence values. i.e. for a call
+		    with probability p:  -10*log10(1-p)	 
+		    (NB: default, but often inappropriate.)
+         LO         Log-odds scaled values. ie:  10*log10(p/(1-p))
+	
+
+The first byte of this chunk is 0 (raw format). This is then followed by a
+series signed 8-bit confidence values for the called base. Next comes
+all the remaining confidence values for A, C, G and T excluding those
+that have already been written (ie the called base). So for a sequence
+AGT we would store confidences A1 G2 T3 C1 G1 T1 A2 C2 T2 A3 C3 G3.
+
+The purpose of this is to group the (likely) highest confidence value (those
+for the called base) at the start of the chunk followed by the remaining
+values. Hence if phred confidence values are written in a CNF4 chunk the first
+quarter of chunk will consist of phred confidence values and the last three
+quarters will (assuming no ambiguous base calls) consist entirely of zeros.
+
+For the purposes of storage the confidence value for a base call that is not
+A, C, G or T (in any case) is stored as if the base call was T.
+
+If only one confidence value exists per base then either the phred or
+log-odds scales work well. The first N bytes will be the called bases
+and the remaining 3*N will be zero (optimal for run-length-encoding), 
+but consider using the CNF1 chunk type instead in this situation.
+
+If all 4 base types have their own confidence value then the log-odds
+scale will work well. In this case the phred scale is an inappropriate
+choice as it cannot encode both very likely and very unlikely events.
+
+Note: if this chunk exists it must exist after a BASE chunk.
+
+TEXT
+----
+
+Meta-data: none present
+
+Data:	      0 
+            +--+-  -  -+--+-  -  -+--+-     -+-  -  -+--+-  -  -+--+-----+
+Hex values  | 0| ident | 0| value | 0|   -   | ident | 0| value | 0| (0) |
+            +--+-  -  -+--+-  -  -+--+-     -+-  -  -+--+-  -  -+--+-----+
+
+This contains a series of "identifier\0value\0" pairs.
+
+The identifiers and values may be any length and may contain any data
+except the nul character. The nul character marks the end of the
+identifier or the end of the value. Multiple identifier-value pairs
+are allowable. Prior to version 1.3 a double nul character marked the
+end of the list (labeled "(0)" above), but from version 1.3 the end
+of the list may also be marked by the end of chunk.
+
+Identifiers starting with bit 5 clear (uppercase) are part of the public ZTR
+spec. Any public identifier not listed as part of this spec should be
+considered as reserved. Identifiers that have bit 6 set (lowercase) are for
+private use and no restriction is placed on these.
+
+Multiple TEXT chunks may exist within the ZTR file. If so they are
+considered to be concatenated together.
+
+See below for the text identifier list.
+
+CLIP
+----
+
+Meta-data: none present
+
+Data:
+Byte number   0  1  2  3  4  5  6  7  8
+            +--+--+--+--+--+--+--+--+--+
+Hex values  | 0| left clip | right clip|
+            +--+--+--+--+--+--+--+--+--+
+
+This contains suggested quality clip points. These are stored as zero (raw
+data) followed by a 4-byte big endian value for the left clip point and a
+4-byte big endian value for the right clip point. Clip points are defined in
+units of base calls, starting from 0. (Q: is that correct!?)
+
+
+
+CR32
+----
+
+Meta-data: none present
+
+Data:
+Byte number   0  1  2  3  4 
+            +--+--+--+--+--+
+Hex values  | 0|   CRC-32  |
+            +--+--+--+--+--+
+
+This chunk is always just 4 bytes of data containing a CRC-32 checksum,
+computed according to the widely used ANSI X3.66 standard. If present, the
+checksum will be a check of all of the data since the last CR32 chunk.
+This will include checking the header if this is the first CR32 chunk, and
+including the previous CRC32 chunk if it is not. Obviously the checksum will
+not include checks on this CR32 chunk.
+
+
+COMM
+----
+
+Meta-data: none present
+
+Data:
+Byte number   0  1        N
+            +--+--   -   --+
+Hex values  | 0| free text |
+            +--+--   -   --+
+
+This allows arbitrary textual data to be added. It does not require a
+identifier-value pairing or any nul termination.
+
+
+DFLH
+----
+
+Meta-data: none present
+
+Data:
+Byte number   0  1                         N
+            +--+--+-- - - - - - - - - - - --+
+Hex values  | 0| C| Deflate format data ... |
+            +--+--+-- - - - - - - - - - - --+
+
+'C' is the code-set number referred to within that compression method.
+It should be 128 onwards and is used to distinguish between multiple
+huffman tables. It is used in conjunction with the data compression
+format 77 ("Deflate"). 
+
+Following this is data in the Deflate format (RFC 1951). This should
+consist of the header for a single block using dynamic huffman with
+the BFINAL (last block) flag set.
+
+In Deflate streams the end of the huffman codes and the start of
+the compressed data stream itself may occur part way through a
+byte. Therefore the last byte of the this block is bitwise ORed
+with the first byte of the data stream compressed referring back to
+this code-set number. Therefore all unused bits in the last byte of
+this block should be set to zero. Likewise if the data bit-stream in
+this block ends on an exact byte boundary then an additional blank
+byte must be added to ensure the ORing method above still works.
+
+
+DFLC
+----
+
+Meta-data: none present
+
+Data:
+Byte number   0
+            +--+---+- - - - ---+--+-- - - - - - - - - - - - --+
+Hex values  | 0| C |code-order |FF| Deflate dynamic codes ... |
+            +--+---+- - - - ---+--+-- - - - - - - - - - - - --+
+
+Multi-context Deflate compression codes defined for use by data format
+78 (HUFF_MULTI).
+
+This is like the DFLH format, except it encodes multiple huffman trees
+instead of a single tree along with the order in which the multiple
+trees should be used (the "code-order").
+
+'C' is the code-set number referred to within that compression method.
+It should be 128 onwards and is used to distinguish between multiple
+huffman tables. 
+
+The code-order is a run-length encoded series of 8-bit numbers
+indicating which huffman code set should be used for which byte. For
+each byte in the input stream the HUFF_MULTI method selects the
+appropriate huffman code by using indexing code-order with the input
+data position modulo the number of values in code-order.
+
+Following this is data in the Deflate format (RFC 1951). This should
+consist of the header component for a single block using dynamic
+huffman with the BFINAL (last block) flag set, up to and including
+the HDIST+1 code lengths for the distance alphabet. This will then be
+immediately followed by the next set of huffman codes, and so on until
+all index values containing within the code-order have been accounted
+for.
+
+In Deflate streams the end of the huffman codes and the start of
+the compressed data stream itself may occur part way through a
+byte. Therefore the last byte of the this block is bitwise ORed
+with the first byte of the data stream compressed referring back to
+this code-set number. Therefore all unused bits in the last byte of
+this block should be set to zero. Likewise if the data bit-stream in
+this block ends on an exact byte boundary then an additional blank
+byte must be added to ensure the ORing method above still works.
+
+
+For example, compression of 16-bit data is sometimes best achieved by
+producing one set of huffman codes for the top 8 bits and another set
+for the bottom 8 bits, rather than mixing these together by treating
+the 16-bit data as a series of 8-bit quantities. In this case our
+code-order would consist of just two entries; (0, 1).
+
+Alternatively we may have 4 1-byte confidence values stored per base
+in the order of the confidence of the base-called base type first
+followed by the 3 remaining confidence values. We observe that
+compressing byte 0, 4, 8, 12, ... as one set and bytes 1,2,3, 5,6,7,
+... as another set yields higher compression ratios. In this case the
+code-order would consist of 4 entries; (0, 1, 1, 1).
+
+
+REGN
+----
+
+Meta-data: optional - see below
+
+Data:
+Byte number   0   1   2   3   4   5   6   7   8
+            +--+---+---+---+---+---+---+---+---+
+Hex values  | 0| 1st boundary  | 2nd boundary  | ...
+            +--+---+---+---+---+---+---+---+---+
+
+This chunk is used to break a trace down into a series of segments. We
+store the boundary between segments, so the list above will contain
+one less boundary than there are segments with the first segment
+implicitly starting from the first base and the last segment implictly
+extending to the last base.
+
+Each 4-byte unsigned value indicates a position within the sequence or
+trace counting from 0 as the first element and marking the first base
+of the next region. For example three regions of DNA may be:
+
+    0  1  2  3   4  5  6  7  8   9 10 11 12
+    T  A  C  G   G  A  T  T  C   G  A  A  C
+   |<-reg. 1->| |<--reg. 2--->| |<-reg. 3->|
+
+This would give the 1st boundary as 4 and the 2nd boundary as 9.
+
+The lack of a REGN chunk implies one single region extending from the
+first to last base in the sequence.
+
+Valid identifiers for the meta-data are:
+
+Ident	 Meaning              Value(s)
+---------------------------------------------------------------------
+COORD    Coordinate system    'T' = trace coordinates
+	                      'B' = base coordinations (default)
+
+NAME     Region names	      A semicolon separated list of
+			      "name:code" pairs. Eg
+			      primer1:T;read1:P;primer2:T;read2:P
+
+[FIXME: NAME identifier here is the same as the REGION_LIST TEXT
+identifier. We need to decide where it belongs and pick one. If we can
+get a way to specify the default meta-data contents then logically
+speaking the best place to store this is in the meta-data along side
+the chunk data itself.]
+
+The NAME identifier is used to attach a meaning to the regions
+described in the data chunk. It consists of a semi-colon separated
+list of names or name:code pairs. The codes, if present are a single
+character from the predefined list below and are separated from the
+name by a colon.
+
+Code    Meaning
+---------------------------------------
+T	Tech read (e.g. primer, linker)
+B	Bio read
+I	Inverted read
+D	Duplicate read
+P	Paired read
+
+FIXME: I don't like the above meanings. They don't, well, "mean" much
+to me! What's a tech read?
+
+
+
+Text Identifiers
+================
+
+These are for use in the TEXT segments. None are required, but if any of these
+identifiers are present they must confirm to the description below. Much
+(currently all) of this list has been taken from the NCBI Trace Archive [2]
+documentation. It is duplicated here as the ZTR spec is not tied to the same
+revision schedules as the NCBI trace archive (although it is intended that any
+suitable updates to the trace archive should be mirrored in this ZTR spec).
+
+The Trace Archive specifies a maximum length of values. The ZTR spec does not
+have length limitations, but for compatibility these sizes should still be
+observed.
+
+The Trace Archive also states some identifiers are mandatory; these are marked
+by asterisks below. These identifiers are not mandatory in the ZTR spec (but
+clearly they need to exist if the data is to be submitted to the NCBI).
+
+Finally, some fields are not appropriate for use in the ZTR spec, such as
+BASE_FILE (the name of a file containing the base calls). Such fields are
+included only for compatibility with the Trace Arhive. It is not expected that 
+use of ZTR would allow for the base calls to be read from an external file
+instead of the ZTR BASE chunk.
+
+[ Quoted from TraceArchiveRFC v1.17 ]
+
+Identifier      Size       Meaning			 Example value(s)
+----------      -----      ----------------------------  -----------------
+TRACE_NAME *      250      name of the trace             HBBBA1U2211
+                           as used at the center
+                           unique within the center
+                           but not among centers.
+                           
+SUBMISSION_TYPE *   -      type of submission
+                           
+CENTER_NAME *     100      name of center                BCM
+CENTER_PROJECT    200      internal project name         HBBB
+                           used within the center
+                           
+TRACE_FILE *      200      file name of the trace	 ./traces/TRACE001.scf
+                           relative to the top of
+                           the volume.
+                           
+TRACE_FORMAT *     20      format of the tracefile
+                           
+SOURCE_TYPE *       -      source of the read
+                           
+INFO_FILE         200      file name of the info file
+INFO_FILE_FORMAT   20        
+                           
+BASE_FILE         200      file name of the base calls
+QUAL_FILE         200      file name of the base calls
+                           
+                           
+TRACE_DIRECTION     -      direction of the read
+TRACE_END           -      end of the template
+PRIMER            200      primer sequence
+PRIMER_CODE                which primer was used
+                           
+STRATEGY            -      sequencing strategy
+TRACE_TYPE_CODE     -      purpose of trace
+                           
+PROGRAM_ID         100     creator of trace file         phred-0.990722.h
+                           program-version
+                           
+TEMPLATE_ID         20     used for read pairing         HBBBA2211
+                           
+CHEMISTRY_CODE       -     code of the chemistry         (see below)
+ITERATION            -     attempt/redo                  1
+                           (int 1 to 255)
+                           
+CLIP_QUALITY_LEFT          left clip of the read in bp due to quality
+CLIP_QUALITY_RIGHT         right " " " " "
+CLIP_VECTOR_LEFT           left clip of the read in bp due to vector
+CLIP_VECTOR_RIGHT          right " " " " "
+
+                           
+SVECTOR_CODE        40     sequencing vector used        (in table)
+SVECTOR_ACCESSION   40     sequencing vector used        (in table)
+CVECTOR_CODE        40     clone vector used             (in table)
+CVECTOR_ACCESSION   40     clone vector used             (in table)
+                           
+INSERT_SIZE          -     expected size of insert       2000,10000
+                           in base pairs (bp)
+                           (int 1 to 2^32)
+                           
+PLATE_ID            32     plate id at the center          
+WELL_ID                    well                          1-384
+
+
+SPECIES_CODE *       -     code for species
+SUBSPECIES_ID       40     name of the subspecies
+                           Is this the same as strain
+
+CHROMOSOME           8     name of the chromosome        ChrX, Chr01, Chr09
+                           
+                           
+LIBRARY_ID          30     the source library of the clone
+CLONE_ID            30     clone id                      RPCI11-1234 
+ 
+ACCESSION           30     NCBI accession number         AC00001
+                           
+PICK_GROUP_ID       30     an id to group traces picked
+                           at the same time.
+PREP_GROUP_ID       30     an id to group traces prepared
+                           at the same time
+                           
+                           
+RUN_MACHINE_ID      30     id of sequencing machine
+RUN_MACHINE_TYPE    30     type/model of machine
+RUN_LANE            30     lane or capillary of the trace
+RUN_DATE             -     date of run
+RUN_GROUP_ID        30     an identifier to group traces
+                           run on the same machine
+
+[ End of quote from TraceArchiveRFC ]
+
+More detailed information on the format of these values should be obtained
+from the Trace Archive RFC [2].
+
+In addition to the above the following TEXT identifiers have meaning
+specific to the ZTR format:
+
+Identifier     Meaning			     Example value(s)
+----------     ----------------------------  -------------------------------
+REGION_LIST    A semi-colon separated list   primer1:T;read1:P
+               identifying regions of a      
+	       trace. See the REGN chunk     Region 1;Region 2;Region 3
+	       definition for details.
+                           
+
+FIXME: Should this simply be the meta-data associated with the REGN
+chunk?
+                           
+
+
+References
+==========
+[1] IUPAC: http://www.chem.qmw.ac.uk/iubmb/misc/naseq.html
+
+[2] http://www.ncbi.nlm.nih.gov/Traces/TraceArchiveRFC.html
+
+[3] J.Bonfield and R.Staden, "ZTR: a new format for DNA sequence trace
+data". Bioinformatics Vol. 18 no. 1 2002. 
+
+
+FIXME: As an aside, not doing the final entropy encoding steps (zlib,
+deflate, etc) and just using bzip2 on an entire SRF archive yields a
+considerable saving. On tests it varied between 23% (27bp reads) and
+13% (74bp reads) smaller than the Deflate compressed
+data. Unfortunately it pretty much removes all chance of random access
+in the data unless I can get a working FM-Index implementation
+(which is very unlikely in a short time). This makes it appropriate
+for transmission perhaps, but not for indexing and querying random
+sequences.
+
+A substantial chunk (5-9%) of this saving comes from the repeated ZTR
+block types (names like "BASE", "CNF4" and common components like 0x00000000
+for the meta-data size). The remainder probably comes from
+similarities between one ZTR file and another.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/install-sh	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,323 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2005-05-14.22
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person 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, sublicense, 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:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "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.  IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# 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}"
+
+chmodcmd="$chmodprog 0755"
+chowncmd=
+chgrpcmd=
+stripcmd=
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=
+dst=
+dir_arg=
+dstarg=
+no_target_directory=
+
+usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+   or: $0 [OPTION]... SRCFILES... DIRECTORY
+   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+   or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+-c         (ignored)
+-d         create directories instead of installing files.
+-g GROUP   $chgrpprog installed files to GROUP.
+-m MODE    $chmodprog installed files to MODE.
+-o USER    $chownprog installed files to USER.
+-s         $stripprog installed files.
+-t DIRECTORY  install into DIRECTORY.
+-T         report an error if DSTFILE is a directory.
+--help     display this help and exit.
+--version  display version info and exit.
+
+Environment variables override the default commands:
+  CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
+"
+
+while test -n "$1"; do
+  case $1 in
+    -c) shift
+        continue;;
+
+    -d) dir_arg=true
+        shift
+        continue;;
+
+    -g) chgrpcmd="$chgrpprog $2"
+        shift
+        shift
+        continue;;
+
+    --help) echo "$usage"; exit $?;;
+
+    -m) chmodcmd="$chmodprog $2"
+        shift
+        shift
+        continue;;
+
+    -o) chowncmd="$chownprog $2"
+        shift
+        shift
+        continue;;
+
+    -s) stripcmd=$stripprog
+        shift
+        continue;;
+
+    -t) dstarg=$2
+	shift
+	shift
+	continue;;
+
+    -T) no_target_directory=true
+	shift
+	continue;;
+
+    --version) echo "$0 $scriptversion"; exit $?;;
+
+    *)  # When -d is used, all remaining arguments are directories to create.
+	# When -t is used, the destination is already specified.
+	test -n "$dir_arg$dstarg" && break
+        # Otherwise, the last argument is the destination.  Remove it from $@.
+	for arg
+	do
+          if test -n "$dstarg"; then
+	    # $@ is not empty: it contains at least $arg.
+	    set fnord "$@" "$dstarg"
+	    shift # fnord
+	  fi
+	  shift # arg
+	  dstarg=$arg
+	done
+	break;;
+  esac
+done
+
+if test -z "$1"; then
+  if test -z "$dir_arg"; then
+    echo "$0: no input file specified." >&2
+    exit 1
+  fi
+  # It's OK to call `install-sh -d' without argument.
+  # This can happen when creating conditional directories.
+  exit 0
+fi
+
+for src
+do
+  # Protect names starting with `-'.
+  case $src in
+    -*) src=./$src ;;
+  esac
+
+  if test -n "$dir_arg"; then
+    dst=$src
+    src=
+
+    if test -d "$dst"; then
+      mkdircmd=:
+      chmodcmd=
+    else
+      mkdircmd=$mkdirprog
+    fi
+  else
+    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+    # might cause directories to be created, which would be especially bad
+    # if $src (and thus $dsttmp) contains '*'.
+    if test ! -f "$src" && test ! -d "$src"; then
+      echo "$0: $src does not exist." >&2
+      exit 1
+    fi
+
+    if test -z "$dstarg"; then
+      echo "$0: no destination specified." >&2
+      exit 1
+    fi
+
+    dst=$dstarg
+    # Protect names starting with `-'.
+    case $dst in
+      -*) dst=./$dst ;;
+    esac
+
+    # If destination is a directory, append the input filename; won't work
+    # if double slashes aren't ignored.
+    if test -d "$dst"; then
+      if test -n "$no_target_directory"; then
+	echo "$0: $dstarg: Is a directory" >&2
+	exit 1
+      fi
+      dst=$dst/`basename "$src"`
+    fi
+  fi
+
+  # This sed command emulates the dirname command.
+  dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
+
+  # Make sure that the destination directory exists.
+
+  # Skip lots of stat calls in the usual case.
+  if test ! -d "$dstdir"; then
+    defaultIFS='
+	 '
+    IFS="${IFS-$defaultIFS}"
+
+    oIFS=$IFS
+    # Some sh's can't handle IFS=/ for some reason.
+    IFS='%'
+    set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
+    shift
+    IFS=$oIFS
+
+    pathcomp=
+
+    while test $# -ne 0 ; do
+      pathcomp=$pathcomp$1
+      shift
+      if test ! -d "$pathcomp"; then
+        $mkdirprog "$pathcomp"
+	# mkdir can fail with a `File exist' error in case several
+	# install-sh are creating the directory concurrently.  This
+	# is OK.
+	test -d "$pathcomp" || exit
+      fi
+      pathcomp=$pathcomp/
+    done
+  fi
+
+  if test -n "$dir_arg"; then
+    $doit $mkdircmd "$dst" \
+      && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
+      && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
+      && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
+      && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
+
+  else
+    dstfile=`basename "$dst"`
+
+    # Make a couple of temp file names in the proper directory.
+    dsttmp=$dstdir/_inst.$$_
+    rmtmp=$dstdir/_rm.$$_
+
+    # Trap to clean up those temp files at exit.
+    trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+    trap '(exit $?); exit' 1 2 13 15
+
+    # Copy the file name to the temp name.
+    $doit $cpprog "$src" "$dsttmp" &&
+
+    # 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 $cpprog $src $dsttmp" command.
+    #
+    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
+      && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
+      && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
+      && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
+
+    # Now rename the file to the real destination.
+    { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
+      || {
+	   # The rename failed, perhaps because mv can't rename something else
+	   # to itself, or perhaps because mv is so ancient that it does not
+	   # support -f.
+
+	   # Now remove or move aside any old file at destination location.
+	   # We try this two ways since rm can't unlink itself on some
+	   # systems and the destination file might be busy for other
+	   # reasons.  In this case, the final cleanup might fail but the new
+	   # file should still install successfully.
+	   {
+	     if test -f "$dstdir/$dstfile"; then
+	       $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
+	       || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
+	       || {
+		 echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
+		 (exit 1); exit 1
+	       }
+	     else
+	       :
+	     fi
+	   } &&
+
+	   # Now rename the file to the real destination.
+	   $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
+	 }
+    }
+  fi || { (exit 1); exit 1; }
+done
+
+# The final little trick to "correctly" pass the exit status to the exit trap.
+{
+  (exit 0); exit 0
+}
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib-config.in	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,45 @@
+#!/bin/sh
+#
+# This program prints up a few io_lib configuration parameters. It is
+# designed to be used in other build environments so that programs
+# using io_lib can automatically generate the appropriate CFLAGS and LDFLAGS.
+
+usage() {
+    cat << _EOF_
+Usage: io_lib-config [option]
+
+where 'option' is any one of:
+
+  --cflags      C and preprocessor flags (eg -I/foo/include)
+  --libs        Link-line parameters, eg -L/foo/lib -lstaden-read
+  --version	List io_lib version number
+
+_EOF_
+
+    exit $1
+}
+
+[ $# -eq 0 ] && usage 1
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+includedir=@includedir@
+
+case "$1" in
+--cflags)
+    echo "-I@includedir@"
+    ;;
+--libs)
+    echo "-L@libdir@ -lstaden-read @LDFLAGS@ @LIBS@ @LIBCURL@ @LIBZ@"
+    ;;
+--version)
+    echo @VERSION@
+    ;;
+--help)
+    usage 0
+    ;;
+*)
+    echo "Unknown option '$1'" 1>&2
+    exit 1
+esac
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/Makefile.am	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,77 @@
+lib_LTLIBRARIES = libstaden-read.la
+
+libstaden_read_la_SOURCES = \
+	Read.c \
+	Read.h \
+	scf_extras.c \
+	scf_extras.h \
+	translate.c \
+	translate.h \
+	compression.c \
+	compression.h \
+	ztr.c \
+	ztr.h \
+	ztr_translate.c \
+	deflate_interlaced.c \
+	deflate_interlaced.h \
+	abi.h \
+	fpoint.c \
+	fpoint.h \
+	seqIOABI.c \
+	seqIOABI.h \
+	seqIOALF.c \
+	alf.h \
+	ctfCompress.c \
+	seqIOCTF.c \
+	seqIOCTF.h \
+	expFileIO.c \
+	expFileIO.h \
+	plain.h \
+	seqIOPlain.c \
+	misc_scf.c \
+	read_scf.c \
+	scf.h \
+	write_scf.c \
+	sff.c \
+	sff.h \
+	srf.c \
+	srf.h \
+	array.c \
+	array.h \
+	compress.c \
+	compress.h \
+	error.c \
+	error.h \
+	files.c \
+	find.c \
+	mach-io.c \
+	mach-io.h \
+	misc.h \
+	open_trace_file.c \
+	open_trace_file.h \
+	read_alloc.c \
+	strings.c \
+	tar_format.h \
+	traceType.c \
+	traceType.h \
+	xalloc.c \
+	xalloc.h \
+	vlen.c \
+	vlen.h \
+	hash_table.c \
+	hash_table.h \
+	jenkins_lookup3.c \
+	jenkins_lookup3.h \
+	mFILE.c \
+	mFILE.h \
+	os.h \
+	stdio_hack.h \
+	pooled_alloc.c \
+	pooled_alloc.h
+
+libstaden_read_la_CPPFLAGS = @LIBCURL_CPPFLAGS@
+
+libstaden_read_la_LDFLAGS = -version-info @VERS_CURRENT@:@VERS_REVISION@:@VERS_AGE@ 
+libstaden_read_la_LIBADD = @LIBZ@ @LIBCURL@
+
+INCLUDES = -I${top_srcdir}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/Makefile.in	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,836 @@
+# 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@
+
+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@
+subdir = io_lib
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/io_lib_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)
+libstaden_read_la_DEPENDENCIES =
+am_libstaden_read_la_OBJECTS = libstaden_read_la-Read.lo \
+	libstaden_read_la-scf_extras.lo libstaden_read_la-translate.lo \
+	libstaden_read_la-compression.lo libstaden_read_la-ztr.lo \
+	libstaden_read_la-ztr_translate.lo \
+	libstaden_read_la-deflate_interlaced.lo \
+	libstaden_read_la-fpoint.lo libstaden_read_la-seqIOABI.lo \
+	libstaden_read_la-seqIOALF.lo libstaden_read_la-ctfCompress.lo \
+	libstaden_read_la-seqIOCTF.lo libstaden_read_la-expFileIO.lo \
+	libstaden_read_la-seqIOPlain.lo libstaden_read_la-misc_scf.lo \
+	libstaden_read_la-read_scf.lo libstaden_read_la-write_scf.lo \
+	libstaden_read_la-sff.lo libstaden_read_la-srf.lo \
+	libstaden_read_la-array.lo libstaden_read_la-compress.lo \
+	libstaden_read_la-error.lo libstaden_read_la-files.lo \
+	libstaden_read_la-find.lo libstaden_read_la-mach-io.lo \
+	libstaden_read_la-open_trace_file.lo \
+	libstaden_read_la-read_alloc.lo libstaden_read_la-strings.lo \
+	libstaden_read_la-traceType.lo libstaden_read_la-xalloc.lo \
+	libstaden_read_la-vlen.lo libstaden_read_la-hash_table.lo \
+	libstaden_read_la-jenkins_lookup3.lo \
+	libstaden_read_la-mFILE.lo libstaden_read_la-pooled_alloc.lo
+libstaden_read_la_OBJECTS = $(am_libstaden_read_la_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/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 = $(libstaden_read_la_SOURCES)
+DIST_SOURCES = $(libstaden_read_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@
+GREP = @GREP@
+HAVE_ZLIB_FALSE = @HAVE_ZLIB_FALSE@
+HAVE_ZLIB_TRUE = @HAVE_ZLIB_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBCURL = @LIBCURL@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBZ = @LIBZ@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+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@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+VERS_AGE = @VERS_AGE@
+VERS_CURRENT = @VERS_CURRENT@
+VERS_REVISION = @VERS_REVISION@
+_libcurl_config = @_libcurl_config@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+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@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+lib_LTLIBRARIES = libstaden-read.la
+libstaden_read_la_SOURCES = \
+	Read.c \
+	Read.h \
+	scf_extras.c \
+	scf_extras.h \
+	translate.c \
+	translate.h \
+	compression.c \
+	compression.h \
+	ztr.c \
+	ztr.h \
+	ztr_translate.c \
+	deflate_interlaced.c \
+	deflate_interlaced.h \
+	abi.h \
+	fpoint.c \
+	fpoint.h \
+	seqIOABI.c \
+	seqIOABI.h \
+	seqIOALF.c \
+	alf.h \
+	ctfCompress.c \
+	seqIOCTF.c \
+	seqIOCTF.h \
+	expFileIO.c \
+	expFileIO.h \
+	plain.h \
+	seqIOPlain.c \
+	misc_scf.c \
+	read_scf.c \
+	scf.h \
+	write_scf.c \
+	sff.c \
+	sff.h \
+	srf.c \
+	srf.h \
+	array.c \
+	array.h \
+	compress.c \
+	compress.h \
+	error.c \
+	error.h \
+	files.c \
+	find.c \
+	mach-io.c \
+	mach-io.h \
+	misc.h \
+	open_trace_file.c \
+	open_trace_file.h \
+	read_alloc.c \
+	strings.c \
+	tar_format.h \
+	traceType.c \
+	traceType.h \
+	xalloc.c \
+	xalloc.h \
+	vlen.c \
+	vlen.h \
+	hash_table.c \
+	hash_table.h \
+	jenkins_lookup3.c \
+	jenkins_lookup3.h \
+	mFILE.c \
+	mFILE.h \
+	os.h \
+	stdio_hack.h \
+	pooled_alloc.c \
+	pooled_alloc.h
+
+libstaden_read_la_CPPFLAGS = @LIBCURL_CPPFLAGS@
+libstaden_read_la_LDFLAGS = -version-info @VERS_CURRENT@:@VERS_REVISION@:@VERS_AGE@ 
+libstaden_read_la_LIBADD = @LIBZ@ @LIBCURL@
+INCLUDES = -I${top_srcdir}
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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  io_lib/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  io_lib/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(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
+libstaden-read.la: $(libstaden_read_la_OBJECTS) $(libstaden_read_la_DEPENDENCIES) 
+	$(LINK) -rpath $(libdir) $(libstaden_read_la_LDFLAGS) $(libstaden_read_la_OBJECTS) $(libstaden_read_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstaden_read_la-Read.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstaden_read_la-array.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstaden_read_la-compress.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstaden_read_la-compression.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstaden_read_la-ctfCompress.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstaden_read_la-deflate_interlaced.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstaden_read_la-error.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstaden_read_la-expFileIO.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstaden_read_la-files.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstaden_read_la-find.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstaden_read_la-fpoint.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstaden_read_la-hash_table.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstaden_read_la-jenkins_lookup3.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstaden_read_la-mFILE.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstaden_read_la-mach-io.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstaden_read_la-misc_scf.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstaden_read_la-open_trace_file.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstaden_read_la-pooled_alloc.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstaden_read_la-read_alloc.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstaden_read_la-read_scf.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstaden_read_la-scf_extras.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstaden_read_la-seqIOABI.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstaden_read_la-seqIOALF.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstaden_read_la-seqIOCTF.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstaden_read_la-seqIOPlain.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstaden_read_la-sff.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstaden_read_la-srf.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstaden_read_la-strings.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstaden_read_la-traceType.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstaden_read_la-translate.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstaden_read_la-vlen.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstaden_read_la-write_scf.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstaden_read_la-xalloc.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstaden_read_la-ztr.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstaden_read_la-ztr_translate.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 $@ $<
+
+libstaden_read_la-Read.lo: Read.c
+@am__fastdepCC_TRUE@	if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstaden_read_la-Read.lo -MD -MP -MF "$(DEPDIR)/libstaden_read_la-Read.Tpo" -c -o libstaden_read_la-Read.lo `test -f 'Read.c' || echo '$(srcdir)/'`Read.c; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libstaden_read_la-Read.Tpo" "$(DEPDIR)/libstaden_read_la-Read.Plo"; else rm -f "$(DEPDIR)/libstaden_read_la-Read.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Read.c' object='libstaden_read_la-Read.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstaden_read_la-Read.lo `test -f 'Read.c' || echo '$(srcdir)/'`Read.c
+
+libstaden_read_la-scf_extras.lo: scf_extras.c
+@am__fastdepCC_TRUE@	if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstaden_read_la-scf_extras.lo -MD -MP -MF "$(DEPDIR)/libstaden_read_la-scf_extras.Tpo" -c -o libstaden_read_la-scf_extras.lo `test -f 'scf_extras.c' || echo '$(srcdir)/'`scf_extras.c; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libstaden_read_la-scf_extras.Tpo" "$(DEPDIR)/libstaden_read_la-scf_extras.Plo"; else rm -f "$(DEPDIR)/libstaden_read_la-scf_extras.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='scf_extras.c' object='libstaden_read_la-scf_extras.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstaden_read_la-scf_extras.lo `test -f 'scf_extras.c' || echo '$(srcdir)/'`scf_extras.c
+
+libstaden_read_la-translate.lo: translate.c
+@am__fastdepCC_TRUE@	if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstaden_read_la-translate.lo -MD -MP -MF "$(DEPDIR)/libstaden_read_la-translate.Tpo" -c -o libstaden_read_la-translate.lo `test -f 'translate.c' || echo '$(srcdir)/'`translate.c; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libstaden_read_la-translate.Tpo" "$(DEPDIR)/libstaden_read_la-translate.Plo"; else rm -f "$(DEPDIR)/libstaden_read_la-translate.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='translate.c' object='libstaden_read_la-translate.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstaden_read_la-translate.lo `test -f 'translate.c' || echo '$(srcdir)/'`translate.c
+
+libstaden_read_la-compression.lo: compression.c
+@am__fastdepCC_TRUE@	if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstaden_read_la-compression.lo -MD -MP -MF "$(DEPDIR)/libstaden_read_la-compression.Tpo" -c -o libstaden_read_la-compression.lo `test -f 'compression.c' || echo '$(srcdir)/'`compression.c; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libstaden_read_la-compression.Tpo" "$(DEPDIR)/libstaden_read_la-compression.Plo"; else rm -f "$(DEPDIR)/libstaden_read_la-compression.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='compression.c' object='libstaden_read_la-compression.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstaden_read_la-compression.lo `test -f 'compression.c' || echo '$(srcdir)/'`compression.c
+
+libstaden_read_la-ztr.lo: ztr.c
+@am__fastdepCC_TRUE@	if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstaden_read_la-ztr.lo -MD -MP -MF "$(DEPDIR)/libstaden_read_la-ztr.Tpo" -c -o libstaden_read_la-ztr.lo `test -f 'ztr.c' || echo '$(srcdir)/'`ztr.c; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libstaden_read_la-ztr.Tpo" "$(DEPDIR)/libstaden_read_la-ztr.Plo"; else rm -f "$(DEPDIR)/libstaden_read_la-ztr.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='ztr.c' object='libstaden_read_la-ztr.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstaden_read_la-ztr.lo `test -f 'ztr.c' || echo '$(srcdir)/'`ztr.c
+
+libstaden_read_la-ztr_translate.lo: ztr_translate.c
+@am__fastdepCC_TRUE@	if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstaden_read_la-ztr_translate.lo -MD -MP -MF "$(DEPDIR)/libstaden_read_la-ztr_translate.Tpo" -c -o libstaden_read_la-ztr_translate.lo `test -f 'ztr_translate.c' || echo '$(srcdir)/'`ztr_translate.c; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libstaden_read_la-ztr_translate.Tpo" "$(DEPDIR)/libstaden_read_la-ztr_translate.Plo"; else rm -f "$(DEPDIR)/libstaden_read_la-ztr_translate.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='ztr_translate.c' object='libstaden_read_la-ztr_translate.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstaden_read_la-ztr_translate.lo `test -f 'ztr_translate.c' || echo '$(srcdir)/'`ztr_translate.c
+
+libstaden_read_la-deflate_interlaced.lo: deflate_interlaced.c
+@am__fastdepCC_TRUE@	if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstaden_read_la-deflate_interlaced.lo -MD -MP -MF "$(DEPDIR)/libstaden_read_la-deflate_interlaced.Tpo" -c -o libstaden_read_la-deflate_interlaced.lo `test -f 'deflate_interlaced.c' || echo '$(srcdir)/'`deflate_interlaced.c; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libstaden_read_la-deflate_interlaced.Tpo" "$(DEPDIR)/libstaden_read_la-deflate_interlaced.Plo"; else rm -f "$(DEPDIR)/libstaden_read_la-deflate_interlaced.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='deflate_interlaced.c' object='libstaden_read_la-deflate_interlaced.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstaden_read_la-deflate_interlaced.lo `test -f 'deflate_interlaced.c' || echo '$(srcdir)/'`deflate_interlaced.c
+
+libstaden_read_la-fpoint.lo: fpoint.c
+@am__fastdepCC_TRUE@	if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstaden_read_la-fpoint.lo -MD -MP -MF "$(DEPDIR)/libstaden_read_la-fpoint.Tpo" -c -o libstaden_read_la-fpoint.lo `test -f 'fpoint.c' || echo '$(srcdir)/'`fpoint.c; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libstaden_read_la-fpoint.Tpo" "$(DEPDIR)/libstaden_read_la-fpoint.Plo"; else rm -f "$(DEPDIR)/libstaden_read_la-fpoint.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='fpoint.c' object='libstaden_read_la-fpoint.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstaden_read_la-fpoint.lo `test -f 'fpoint.c' || echo '$(srcdir)/'`fpoint.c
+
+libstaden_read_la-seqIOABI.lo: seqIOABI.c
+@am__fastdepCC_TRUE@	if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstaden_read_la-seqIOABI.lo -MD -MP -MF "$(DEPDIR)/libstaden_read_la-seqIOABI.Tpo" -c -o libstaden_read_la-seqIOABI.lo `test -f 'seqIOABI.c' || echo '$(srcdir)/'`seqIOABI.c; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libstaden_read_la-seqIOABI.Tpo" "$(DEPDIR)/libstaden_read_la-seqIOABI.Plo"; else rm -f "$(DEPDIR)/libstaden_read_la-seqIOABI.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='seqIOABI.c' object='libstaden_read_la-seqIOABI.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstaden_read_la-seqIOABI.lo `test -f 'seqIOABI.c' || echo '$(srcdir)/'`seqIOABI.c
+
+libstaden_read_la-seqIOALF.lo: seqIOALF.c
+@am__fastdepCC_TRUE@	if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstaden_read_la-seqIOALF.lo -MD -MP -MF "$(DEPDIR)/libstaden_read_la-seqIOALF.Tpo" -c -o libstaden_read_la-seqIOALF.lo `test -f 'seqIOALF.c' || echo '$(srcdir)/'`seqIOALF.c; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libstaden_read_la-seqIOALF.Tpo" "$(DEPDIR)/libstaden_read_la-seqIOALF.Plo"; else rm -f "$(DEPDIR)/libstaden_read_la-seqIOALF.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='seqIOALF.c' object='libstaden_read_la-seqIOALF.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstaden_read_la-seqIOALF.lo `test -f 'seqIOALF.c' || echo '$(srcdir)/'`seqIOALF.c
+
+libstaden_read_la-ctfCompress.lo: ctfCompress.c
+@am__fastdepCC_TRUE@	if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstaden_read_la-ctfCompress.lo -MD -MP -MF "$(DEPDIR)/libstaden_read_la-ctfCompress.Tpo" -c -o libstaden_read_la-ctfCompress.lo `test -f 'ctfCompress.c' || echo '$(srcdir)/'`ctfCompress.c; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libstaden_read_la-ctfCompress.Tpo" "$(DEPDIR)/libstaden_read_la-ctfCompress.Plo"; else rm -f "$(DEPDIR)/libstaden_read_la-ctfCompress.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='ctfCompress.c' object='libstaden_read_la-ctfCompress.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstaden_read_la-ctfCompress.lo `test -f 'ctfCompress.c' || echo '$(srcdir)/'`ctfCompress.c
+
+libstaden_read_la-seqIOCTF.lo: seqIOCTF.c
+@am__fastdepCC_TRUE@	if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstaden_read_la-seqIOCTF.lo -MD -MP -MF "$(DEPDIR)/libstaden_read_la-seqIOCTF.Tpo" -c -o libstaden_read_la-seqIOCTF.lo `test -f 'seqIOCTF.c' || echo '$(srcdir)/'`seqIOCTF.c; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libstaden_read_la-seqIOCTF.Tpo" "$(DEPDIR)/libstaden_read_la-seqIOCTF.Plo"; else rm -f "$(DEPDIR)/libstaden_read_la-seqIOCTF.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='seqIOCTF.c' object='libstaden_read_la-seqIOCTF.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstaden_read_la-seqIOCTF.lo `test -f 'seqIOCTF.c' || echo '$(srcdir)/'`seqIOCTF.c
+
+libstaden_read_la-expFileIO.lo: expFileIO.c
+@am__fastdepCC_TRUE@	if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstaden_read_la-expFileIO.lo -MD -MP -MF "$(DEPDIR)/libstaden_read_la-expFileIO.Tpo" -c -o libstaden_read_la-expFileIO.lo `test -f 'expFileIO.c' || echo '$(srcdir)/'`expFileIO.c; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libstaden_read_la-expFileIO.Tpo" "$(DEPDIR)/libstaden_read_la-expFileIO.Plo"; else rm -f "$(DEPDIR)/libstaden_read_la-expFileIO.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='expFileIO.c' object='libstaden_read_la-expFileIO.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstaden_read_la-expFileIO.lo `test -f 'expFileIO.c' || echo '$(srcdir)/'`expFileIO.c
+
+libstaden_read_la-seqIOPlain.lo: seqIOPlain.c
+@am__fastdepCC_TRUE@	if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstaden_read_la-seqIOPlain.lo -MD -MP -MF "$(DEPDIR)/libstaden_read_la-seqIOPlain.Tpo" -c -o libstaden_read_la-seqIOPlain.lo `test -f 'seqIOPlain.c' || echo '$(srcdir)/'`seqIOPlain.c; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libstaden_read_la-seqIOPlain.Tpo" "$(DEPDIR)/libstaden_read_la-seqIOPlain.Plo"; else rm -f "$(DEPDIR)/libstaden_read_la-seqIOPlain.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='seqIOPlain.c' object='libstaden_read_la-seqIOPlain.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstaden_read_la-seqIOPlain.lo `test -f 'seqIOPlain.c' || echo '$(srcdir)/'`seqIOPlain.c
+
+libstaden_read_la-misc_scf.lo: misc_scf.c
+@am__fastdepCC_TRUE@	if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstaden_read_la-misc_scf.lo -MD -MP -MF "$(DEPDIR)/libstaden_read_la-misc_scf.Tpo" -c -o libstaden_read_la-misc_scf.lo `test -f 'misc_scf.c' || echo '$(srcdir)/'`misc_scf.c; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libstaden_read_la-misc_scf.Tpo" "$(DEPDIR)/libstaden_read_la-misc_scf.Plo"; else rm -f "$(DEPDIR)/libstaden_read_la-misc_scf.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='misc_scf.c' object='libstaden_read_la-misc_scf.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstaden_read_la-misc_scf.lo `test -f 'misc_scf.c' || echo '$(srcdir)/'`misc_scf.c
+
+libstaden_read_la-read_scf.lo: read_scf.c
+@am__fastdepCC_TRUE@	if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstaden_read_la-read_scf.lo -MD -MP -MF "$(DEPDIR)/libstaden_read_la-read_scf.Tpo" -c -o libstaden_read_la-read_scf.lo `test -f 'read_scf.c' || echo '$(srcdir)/'`read_scf.c; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libstaden_read_la-read_scf.Tpo" "$(DEPDIR)/libstaden_read_la-read_scf.Plo"; else rm -f "$(DEPDIR)/libstaden_read_la-read_scf.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='read_scf.c' object='libstaden_read_la-read_scf.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstaden_read_la-read_scf.lo `test -f 'read_scf.c' || echo '$(srcdir)/'`read_scf.c
+
+libstaden_read_la-write_scf.lo: write_scf.c
+@am__fastdepCC_TRUE@	if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstaden_read_la-write_scf.lo -MD -MP -MF "$(DEPDIR)/libstaden_read_la-write_scf.Tpo" -c -o libstaden_read_la-write_scf.lo `test -f 'write_scf.c' || echo '$(srcdir)/'`write_scf.c; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libstaden_read_la-write_scf.Tpo" "$(DEPDIR)/libstaden_read_la-write_scf.Plo"; else rm -f "$(DEPDIR)/libstaden_read_la-write_scf.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='write_scf.c' object='libstaden_read_la-write_scf.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstaden_read_la-write_scf.lo `test -f 'write_scf.c' || echo '$(srcdir)/'`write_scf.c
+
+libstaden_read_la-sff.lo: sff.c
+@am__fastdepCC_TRUE@	if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstaden_read_la-sff.lo -MD -MP -MF "$(DEPDIR)/libstaden_read_la-sff.Tpo" -c -o libstaden_read_la-sff.lo `test -f 'sff.c' || echo '$(srcdir)/'`sff.c; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libstaden_read_la-sff.Tpo" "$(DEPDIR)/libstaden_read_la-sff.Plo"; else rm -f "$(DEPDIR)/libstaden_read_la-sff.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='sff.c' object='libstaden_read_la-sff.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstaden_read_la-sff.lo `test -f 'sff.c' || echo '$(srcdir)/'`sff.c
+
+libstaden_read_la-srf.lo: srf.c
+@am__fastdepCC_TRUE@	if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstaden_read_la-srf.lo -MD -MP -MF "$(DEPDIR)/libstaden_read_la-srf.Tpo" -c -o libstaden_read_la-srf.lo `test -f 'srf.c' || echo '$(srcdir)/'`srf.c; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libstaden_read_la-srf.Tpo" "$(DEPDIR)/libstaden_read_la-srf.Plo"; else rm -f "$(DEPDIR)/libstaden_read_la-srf.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='srf.c' object='libstaden_read_la-srf.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstaden_read_la-srf.lo `test -f 'srf.c' || echo '$(srcdir)/'`srf.c
+
+libstaden_read_la-array.lo: array.c
+@am__fastdepCC_TRUE@	if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstaden_read_la-array.lo -MD -MP -MF "$(DEPDIR)/libstaden_read_la-array.Tpo" -c -o libstaden_read_la-array.lo `test -f 'array.c' || echo '$(srcdir)/'`array.c; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libstaden_read_la-array.Tpo" "$(DEPDIR)/libstaden_read_la-array.Plo"; else rm -f "$(DEPDIR)/libstaden_read_la-array.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='array.c' object='libstaden_read_la-array.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstaden_read_la-array.lo `test -f 'array.c' || echo '$(srcdir)/'`array.c
+
+libstaden_read_la-compress.lo: compress.c
+@am__fastdepCC_TRUE@	if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstaden_read_la-compress.lo -MD -MP -MF "$(DEPDIR)/libstaden_read_la-compress.Tpo" -c -o libstaden_read_la-compress.lo `test -f 'compress.c' || echo '$(srcdir)/'`compress.c; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libstaden_read_la-compress.Tpo" "$(DEPDIR)/libstaden_read_la-compress.Plo"; else rm -f "$(DEPDIR)/libstaden_read_la-compress.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='compress.c' object='libstaden_read_la-compress.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstaden_read_la-compress.lo `test -f 'compress.c' || echo '$(srcdir)/'`compress.c
+
+libstaden_read_la-error.lo: error.c
+@am__fastdepCC_TRUE@	if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstaden_read_la-error.lo -MD -MP -MF "$(DEPDIR)/libstaden_read_la-error.Tpo" -c -o libstaden_read_la-error.lo `test -f 'error.c' || echo '$(srcdir)/'`error.c; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libstaden_read_la-error.Tpo" "$(DEPDIR)/libstaden_read_la-error.Plo"; else rm -f "$(DEPDIR)/libstaden_read_la-error.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='error.c' object='libstaden_read_la-error.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstaden_read_la-error.lo `test -f 'error.c' || echo '$(srcdir)/'`error.c
+
+libstaden_read_la-files.lo: files.c
+@am__fastdepCC_TRUE@	if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstaden_read_la-files.lo -MD -MP -MF "$(DEPDIR)/libstaden_read_la-files.Tpo" -c -o libstaden_read_la-files.lo `test -f 'files.c' || echo '$(srcdir)/'`files.c; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libstaden_read_la-files.Tpo" "$(DEPDIR)/libstaden_read_la-files.Plo"; else rm -f "$(DEPDIR)/libstaden_read_la-files.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='files.c' object='libstaden_read_la-files.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstaden_read_la-files.lo `test -f 'files.c' || echo '$(srcdir)/'`files.c
+
+libstaden_read_la-find.lo: find.c
+@am__fastdepCC_TRUE@	if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstaden_read_la-find.lo -MD -MP -MF "$(DEPDIR)/libstaden_read_la-find.Tpo" -c -o libstaden_read_la-find.lo `test -f 'find.c' || echo '$(srcdir)/'`find.c; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libstaden_read_la-find.Tpo" "$(DEPDIR)/libstaden_read_la-find.Plo"; else rm -f "$(DEPDIR)/libstaden_read_la-find.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='find.c' object='libstaden_read_la-find.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstaden_read_la-find.lo `test -f 'find.c' || echo '$(srcdir)/'`find.c
+
+libstaden_read_la-mach-io.lo: mach-io.c
+@am__fastdepCC_TRUE@	if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstaden_read_la-mach-io.lo -MD -MP -MF "$(DEPDIR)/libstaden_read_la-mach-io.Tpo" -c -o libstaden_read_la-mach-io.lo `test -f 'mach-io.c' || echo '$(srcdir)/'`mach-io.c; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libstaden_read_la-mach-io.Tpo" "$(DEPDIR)/libstaden_read_la-mach-io.Plo"; else rm -f "$(DEPDIR)/libstaden_read_la-mach-io.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='mach-io.c' object='libstaden_read_la-mach-io.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstaden_read_la-mach-io.lo `test -f 'mach-io.c' || echo '$(srcdir)/'`mach-io.c
+
+libstaden_read_la-open_trace_file.lo: open_trace_file.c
+@am__fastdepCC_TRUE@	if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstaden_read_la-open_trace_file.lo -MD -MP -MF "$(DEPDIR)/libstaden_read_la-open_trace_file.Tpo" -c -o libstaden_read_la-open_trace_file.lo `test -f 'open_trace_file.c' || echo '$(srcdir)/'`open_trace_file.c; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libstaden_read_la-open_trace_file.Tpo" "$(DEPDIR)/libstaden_read_la-open_trace_file.Plo"; else rm -f "$(DEPDIR)/libstaden_read_la-open_trace_file.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='open_trace_file.c' object='libstaden_read_la-open_trace_file.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstaden_read_la-open_trace_file.lo `test -f 'open_trace_file.c' || echo '$(srcdir)/'`open_trace_file.c
+
+libstaden_read_la-read_alloc.lo: read_alloc.c
+@am__fastdepCC_TRUE@	if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstaden_read_la-read_alloc.lo -MD -MP -MF "$(DEPDIR)/libstaden_read_la-read_alloc.Tpo" -c -o libstaden_read_la-read_alloc.lo `test -f 'read_alloc.c' || echo '$(srcdir)/'`read_alloc.c; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libstaden_read_la-read_alloc.Tpo" "$(DEPDIR)/libstaden_read_la-read_alloc.Plo"; else rm -f "$(DEPDIR)/libstaden_read_la-read_alloc.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='read_alloc.c' object='libstaden_read_la-read_alloc.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstaden_read_la-read_alloc.lo `test -f 'read_alloc.c' || echo '$(srcdir)/'`read_alloc.c
+
+libstaden_read_la-strings.lo: strings.c
+@am__fastdepCC_TRUE@	if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstaden_read_la-strings.lo -MD -MP -MF "$(DEPDIR)/libstaden_read_la-strings.Tpo" -c -o libstaden_read_la-strings.lo `test -f 'strings.c' || echo '$(srcdir)/'`strings.c; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libstaden_read_la-strings.Tpo" "$(DEPDIR)/libstaden_read_la-strings.Plo"; else rm -f "$(DEPDIR)/libstaden_read_la-strings.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='strings.c' object='libstaden_read_la-strings.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstaden_read_la-strings.lo `test -f 'strings.c' || echo '$(srcdir)/'`strings.c
+
+libstaden_read_la-traceType.lo: traceType.c
+@am__fastdepCC_TRUE@	if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstaden_read_la-traceType.lo -MD -MP -MF "$(DEPDIR)/libstaden_read_la-traceType.Tpo" -c -o libstaden_read_la-traceType.lo `test -f 'traceType.c' || echo '$(srcdir)/'`traceType.c; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libstaden_read_la-traceType.Tpo" "$(DEPDIR)/libstaden_read_la-traceType.Plo"; else rm -f "$(DEPDIR)/libstaden_read_la-traceType.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='traceType.c' object='libstaden_read_la-traceType.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstaden_read_la-traceType.lo `test -f 'traceType.c' || echo '$(srcdir)/'`traceType.c
+
+libstaden_read_la-xalloc.lo: xalloc.c
+@am__fastdepCC_TRUE@	if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstaden_read_la-xalloc.lo -MD -MP -MF "$(DEPDIR)/libstaden_read_la-xalloc.Tpo" -c -o libstaden_read_la-xalloc.lo `test -f 'xalloc.c' || echo '$(srcdir)/'`xalloc.c; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libstaden_read_la-xalloc.Tpo" "$(DEPDIR)/libstaden_read_la-xalloc.Plo"; else rm -f "$(DEPDIR)/libstaden_read_la-xalloc.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='xalloc.c' object='libstaden_read_la-xalloc.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstaden_read_la-xalloc.lo `test -f 'xalloc.c' || echo '$(srcdir)/'`xalloc.c
+
+libstaden_read_la-vlen.lo: vlen.c
+@am__fastdepCC_TRUE@	if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstaden_read_la-vlen.lo -MD -MP -MF "$(DEPDIR)/libstaden_read_la-vlen.Tpo" -c -o libstaden_read_la-vlen.lo `test -f 'vlen.c' || echo '$(srcdir)/'`vlen.c; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libstaden_read_la-vlen.Tpo" "$(DEPDIR)/libstaden_read_la-vlen.Plo"; else rm -f "$(DEPDIR)/libstaden_read_la-vlen.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='vlen.c' object='libstaden_read_la-vlen.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstaden_read_la-vlen.lo `test -f 'vlen.c' || echo '$(srcdir)/'`vlen.c
+
+libstaden_read_la-hash_table.lo: hash_table.c
+@am__fastdepCC_TRUE@	if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstaden_read_la-hash_table.lo -MD -MP -MF "$(DEPDIR)/libstaden_read_la-hash_table.Tpo" -c -o libstaden_read_la-hash_table.lo `test -f 'hash_table.c' || echo '$(srcdir)/'`hash_table.c; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libstaden_read_la-hash_table.Tpo" "$(DEPDIR)/libstaden_read_la-hash_table.Plo"; else rm -f "$(DEPDIR)/libstaden_read_la-hash_table.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='hash_table.c' object='libstaden_read_la-hash_table.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstaden_read_la-hash_table.lo `test -f 'hash_table.c' || echo '$(srcdir)/'`hash_table.c
+
+libstaden_read_la-jenkins_lookup3.lo: jenkins_lookup3.c
+@am__fastdepCC_TRUE@	if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstaden_read_la-jenkins_lookup3.lo -MD -MP -MF "$(DEPDIR)/libstaden_read_la-jenkins_lookup3.Tpo" -c -o libstaden_read_la-jenkins_lookup3.lo `test -f 'jenkins_lookup3.c' || echo '$(srcdir)/'`jenkins_lookup3.c; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libstaden_read_la-jenkins_lookup3.Tpo" "$(DEPDIR)/libstaden_read_la-jenkins_lookup3.Plo"; else rm -f "$(DEPDIR)/libstaden_read_la-jenkins_lookup3.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='jenkins_lookup3.c' object='libstaden_read_la-jenkins_lookup3.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstaden_read_la-jenkins_lookup3.lo `test -f 'jenkins_lookup3.c' || echo '$(srcdir)/'`jenkins_lookup3.c
+
+libstaden_read_la-mFILE.lo: mFILE.c
+@am__fastdepCC_TRUE@	if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstaden_read_la-mFILE.lo -MD -MP -MF "$(DEPDIR)/libstaden_read_la-mFILE.Tpo" -c -o libstaden_read_la-mFILE.lo `test -f 'mFILE.c' || echo '$(srcdir)/'`mFILE.c; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libstaden_read_la-mFILE.Tpo" "$(DEPDIR)/libstaden_read_la-mFILE.Plo"; else rm -f "$(DEPDIR)/libstaden_read_la-mFILE.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='mFILE.c' object='libstaden_read_la-mFILE.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstaden_read_la-mFILE.lo `test -f 'mFILE.c' || echo '$(srcdir)/'`mFILE.c
+
+libstaden_read_la-pooled_alloc.lo: pooled_alloc.c
+@am__fastdepCC_TRUE@	if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstaden_read_la-pooled_alloc.lo -MD -MP -MF "$(DEPDIR)/libstaden_read_la-pooled_alloc.Tpo" -c -o libstaden_read_la-pooled_alloc.lo `test -f 'pooled_alloc.c' || echo '$(srcdir)/'`pooled_alloc.c; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libstaden_read_la-pooled_alloc.Tpo" "$(DEPDIR)/libstaden_read_la-pooled_alloc.Plo"; else rm -f "$(DEPDIR)/libstaden_read_la-pooled_alloc.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='pooled_alloc.c' object='libstaden_read_la-pooled_alloc.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstaden_read_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstaden_read_la-pooled_alloc.lo `test -f 'pooled_alloc.c' || echo '$(srcdir)/'`pooled_alloc.c
+
+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:
+	for dir in "$(DESTDIR)$(libdir)"; 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-libLTLIBRARIES 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-exec-am: install-libLTLIBRARIES
+
+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 uninstall-libLTLIBRARIES
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libLTLIBRARIES 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-data install-data-am install-exec \
+	install-exec-am install-info install-info-am \
+	install-libLTLIBRARIES 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 \
+	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:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/Read.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,555 @@
+/*
+ * Copyright (c) Medical Research Council 1994. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+/* 
+ * File: 	Read.c
+ * Purpose:	Performs read/write IO on the Read data stucture.
+ * Last update: 01/09/94
+ */
+
+
+/*
+    The Read data type is designed so that it can hold a varying degree
+    of information about sequences, yet have a single set of calls
+    to access the data.
+
+    There are plenty of assumptions around that both the number of
+    bases and the number of points will fit into an int_2, a short.
+
+*/
+
+/* ---- Includes ---- */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <fcntl.h> /* Only need on windows for _O_BINARY */
+#include <unistd.h>
+
+#include "io_lib/Read.h"
+#include "io_lib/mFILE.h"
+
+#ifdef IOLIB_ABI
+# include "io_lib/abi.h"
+#endif
+#ifdef IOLIB_SCF
+# include "io_lib/scf.h"
+#endif
+#ifdef IOLIB_ALF
+# include "io_lib/alf.h"
+#endif
+#ifdef IOLIB_PLN
+# include "io_lib/plain.h"
+#endif
+#ifdef IOLIB_ZTR
+# include "io_lib/ztr.h"
+#endif
+#ifdef IOLIB_CTF
+# include "io_lib/seqIOCTF.h"
+#endif
+#ifdef IOLIB_SFF
+# include "io_lib/sff.h"
+#endif
+#ifdef IOLIB_EXP
+# include "io_lib/expFileIO.h"
+#endif
+#ifdef USE_BIOLIMS
+# include "spBiolims.h"
+#endif
+
+#include "io_lib/xalloc.h"
+#include "io_lib/translate.h"
+#include "io_lib/traceType.h"
+#include "io_lib/misc.h"
+#include "io_lib/open_trace_file.h"
+
+/*
+ * Read a sequence from a file "fnin" of format "format". If "format" is 0
+ * (ANY_FORMAT), we automatically determine the correct format.
+ * Returns:
+ *   Read *   for success
+ *   NULLRead for failure
+ */
+Read *read_reading(char *fn, int format) {
+    Read *read;
+    mFILE *fp;
+
+#ifdef USE_BIOLIMS
+    if( !strncmp(fn,BIOLIMS_TAG,strlen(BIOLIMS_TAG))){
+	return spReadBiolimsReading(fn);
+   }
+#endif
+
+    /*
+     * If we're asking for an Experiment file, read it.
+     * If the format is ANY then attempt EXP first following by trace.
+     * Otherwise use the trace search mechanism.
+     *
+     * Note this is purely for locating files and not for forcing the file
+     * format. It's here so that experiment files and trace files may be
+     * given identical names but accessed through different search paths
+     * (as is the case with the trace server).
+     */
+    if (format == TT_EXP) {
+	if (NULL == (fp = open_exp_mfile(fn, NULL))) {
+	    errout("'%s': couldn't open\n", fn);
+	    return NULL;
+	}
+    } else {
+	fp = NULL;
+	if (format == TT_ANY)
+	    fp = open_exp_mfile(fn, NULL);
+
+	if (!fp && NULL == (fp = open_trace_mfile(fn, NULL))) {
+	    errout("'%s': couldn't open\n", fn);
+	    return NULL;
+	}
+    }
+
+    read = mfread_reading(fp, fn, format);
+    mfclose(fp);
+
+    return read;
+}
+
+/*
+ * Read a sequence from a FILE *fp of format "format". If "format" is 0
+ * (ANY_FORMAT), we automatically determine the correct format.
+ * We still pass a filename 'fn' although this isn't used other than for
+ * filling in the read->trace_name field.
+ *
+ * NB this function should NOT be used when Biolims support is required
+ * (as biolims readings are not stored in a file)
+ *
+ * Returns:
+ *   Read *   for success
+ *   NULLRead for failure
+ */
+Read *mfread_reading(mFILE *fp, char *fn, int format) {
+    Read *read;
+    mFILE *newfp;
+
+    if (!fn)
+	fn = "(unknown)";
+
+    newfp = freopen_compressed(fp, NULL);
+    if (newfp != fp) {
+	fp = newfp;
+    } else {
+	newfp = NULL;
+    }
+
+#ifdef _WIN32
+    /*
+     * jkb 16/05/00 comment below
+     *
+     * On windows "prog < file.abi" will work wrongly (compared to
+     * "prog file.abi") because windows is rather stupid. It treats ascii
+     * and binary streams differently, it considers stdin to be ascii unless
+     * told otherwise, and it can only be told otherwise by using non-ansi
+     * windows-specific function calls.
+     */
+    if (format != TT_EXP && format != TT_PLN && fp->fp)
+	_setmode(_fileno(fp->fp), _O_BINARY);
+#endif
+
+    if (format == TT_ANY || format == TT_ANYTR) {
+	format = fdetermine_trace_type(fp);
+	mrewind(fp);
+    }
+
+    switch (format) {
+    case TT_UNK:
+    case TT_ERR:
+	errout("File '%s' has unknown trace type\n", fn);
+	read = NULLRead;
+	break;
+
+#ifdef IOLIB_SCF
+    case TT_SCF: {
+        Scf *scf;
+	scf = mfread_scf(fp);
+
+	if (scf) {
+	    read = scf2read(scf);
+	    scf_deallocate(scf);
+	} else
+	    read = NULLRead;
+
+	break;
+    }
+#endif
+
+#ifdef IOLIB_CTF
+    case TT_CTF:
+	read = mfread_ctf(fp);
+	break;
+#endif
+
+#ifdef IOLIB_SFF
+    case TT_SFF:
+	read = mfread_sff(fp);
+	break;
+#endif
+
+#ifdef IOLIB_ZTR
+    case TT_ZTR:
+    case TT_ZTR1:
+    case TT_ZTR2:
+    case TT_ZTR3: {
+        ztr_t *ztr;
+
+	if ((ztr = mfread_ztr(fp))) {
+	    uncompress_ztr(ztr);
+	    read = ztr2read(ztr);
+	    delete_ztr(ztr);
+	} else {
+	    read = NULLRead;
+	}
+	break;
+    }
+#endif
+
+#ifdef IOLIB_ABI
+    case TT_ABI:
+	read = mfread_abi(fp);
+	break;
+#endif
+
+#ifdef IOLIB_ALF
+    case TT_ALF:
+	read = mfread_alf(fp);
+	break;
+#endif
+
+#ifdef IOLIB_EXP
+    case TT_EXP: {
+	/* FIXME: we shouldn't redirect like this */
+	Exp_info *e = exp_mfread_info(fp);
+	
+	read = e ? exp2read(e,fn) : NULLRead;
+	break;
+    }
+#endif
+
+#ifdef IOLIB_PLN
+    case TT_PLN:
+	read = mfread_pln(fp);
+	break;
+#endif
+
+    default:
+	errout("Unknown format %d specified to read_reading()\n", format);
+	read = NULLRead;
+    }
+
+    if (read != NULLRead && (read->trace_name = (char *)xmalloc(strlen(fn)+1)))
+	strcpy(read->trace_name, fn);
+
+    if (newfp) mfclose(newfp);
+
+    return read;
+}
+
+Read *fread_reading(FILE *fp, char *fn, int format) {
+    return mfread_reading(mfreopen(fn, "rb", fp), fn, format);
+}
+
+/*
+ * Write a sequence to a FILE *fp of format "format". If "format" is 0,
+ * we choose our favourite - SCF.
+ *
+ * Returns:
+ *   0 for success
+ *  -1 for failure
+ */
+int mfwrite_reading(mFILE *fp, Read *read, int format) {
+    int r = -1;
+    int no_compress = 0;
+
+#ifdef _WIN32
+    /*
+     * jkb 09/06/00 comment below
+     *
+     * On windows "prog > file.scf" will work wrongly (compared to
+     * "prog file.scf") because windows is rather stupid. It treats ascii
+     * and binary streams differently, it considers stdout to be ascii unless
+     * told otherwise, and it can only be told otherwise by using non-ansi
+     * windows-specific function calls.
+     */
+    if (format != TT_EXP && format != TT_PLN && fp->fp)
+	_setmode(_fileno(fp->fp), _O_BINARY);
+#endif
+
+    switch (format) {
+    default:
+	/* Defaults to ZTR type */
+
+#ifdef IOLIB_ZTR
+    case TT_ZTR:
+    case TT_ZTR2: {
+        ztr_t *ztr;
+	ztr = read2ztr(read);
+	compress_ztr(ztr, 2);
+	r = mfwrite_ztr(fp, ztr); 
+	delete_ztr(ztr);
+	no_compress = 1;
+	break;
+    }
+    case TT_ZTR1: {
+        ztr_t *ztr;
+	ztr = read2ztr(read);
+	compress_ztr(ztr, 1);
+	r = mfwrite_ztr(fp, ztr); 
+	delete_ztr(ztr);
+	break;
+    }
+    case TT_ZTR3: {
+        ztr_t *ztr;
+	ztr = read2ztr(read);
+	compress_ztr(ztr, 3);
+	r = mfwrite_ztr(fp, ztr); 
+	delete_ztr(ztr);
+	no_compress = 1;
+	break;
+    }
+#endif
+
+#ifdef IOLIB_SCF
+    case TT_SCF: {
+        Scf *scf;
+	scf = read2scf(read);
+	r = mfwrite_scf(scf, fp);
+	scf_deallocate(scf);
+	break;
+    }
+#endif
+
+#ifdef IOLIB_CTF
+    case TT_CTF:
+	r = mfwrite_ctf(fp, read); 
+	break;
+#endif
+
+#ifdef IOLIB_ABI
+    case TT_ABI:
+	/*return mfwrite_abi(fp, read); */
+	break;
+#endif
+
+#ifdef IOLIB_SFF
+    case TT_SFF:
+	/*return mfwrite_sff(fp, read); */
+	break;
+#endif
+
+#ifdef IOLIB_ALF
+    case TT_ALF:
+	/* return mfwrite_alf(fp, read); */
+	break;
+#endif
+
+#ifdef IOLIB_EXP
+    case TT_EXP: {
+	Exp_info *e = read2exp(read, read->ident ? read->ident : "unknown");
+	
+	if (NULL == e) {
+	    fprintf(stderr, "Failed to create experiment file.\n");
+	    r = -1;
+	} else {
+	    exp_print_mfile(fp, e);
+	    exp_destroy_info(e);
+	    r = 0;
+	}
+	break;
+    }
+#endif
+
+#ifdef IOLIB_PLN
+    case TT_PLN:
+	r = mfwrite_pln(fp, read);
+	break;
+#endif
+    }
+
+    mftruncate(fp, -1);
+    if (r == 0 && !no_compress) {
+	fcompress_file(fp);
+    }
+    mfflush(fp);
+
+    return r;
+}
+
+int fwrite_reading(FILE *fp, Read *read, int format) {
+    int ret;
+    mFILE *mf = mfreopen(NULL, "wbx", fp);
+    if (mf) {
+	ret = mfwrite_reading(mf, read, format);
+	mfflush(mf);
+	mf->fp = NULL; /* Don't want this closed here */
+	mfclose(mf);
+    } else {
+	return -1;
+    }
+
+    return ret;
+}
+
+/*
+ * Write a sequence to a file "fn" of format "format". If "format" is 0,
+ * we choose our favourite - SCF.
+ *
+ * Returns:
+ *   0 for success
+ *  -1 for failure
+ */
+int write_reading(char *fn, Read *read, int format) {
+    int ret;
+    mFILE *fp = mfopen(fn, "wb");
+    if (!fp)
+	return -1;
+    
+    ret = mfwrite_reading(fp, read, format);
+    mfclose(fp);
+    return ret;
+}
+
+/*
+ * Old style stub interfaces implemented simply as redirection through
+ * fread_reading and frwrite_reading.
+ */
+#ifdef IOLIB_ABI
+Read *fread_abi(FILE *fp) {
+    return fread_reading(fp, NULL, TT_ABI);
+}
+
+int fwrite_abi(FILE *fp, Read *read) {
+    return fwrite_reading(fp, read, TT_ABI);
+}
+#endif
+
+#ifdef IOLIB_ALF
+Read *fread_alf(FILE *fp) {
+    return fread_reading(fp, NULL, TT_ALF);
+}
+
+int fwrite_alf(FILE *fp, Read *read) {
+    return fwrite_reading(fp, read, TT_ALF);
+}
+#endif
+
+#ifdef IOLIB_CTF
+Read *fread_ctf(FILE *fp) {
+    return fread_reading(fp, NULL, TT_CTF);
+}
+
+int fwrite_ctf(FILE *fp, Read *read) {
+    return fwrite_reading(fp, read, TT_CTF);
+}
+#endif
+
+#ifdef IOLIB_PLN
+Read *fread_pln(FILE *fp) {
+    return fread_reading(fp, NULL, TT_PLN);
+}
+
+int fwrite_pln(FILE *fp, Read *read) {
+    return fwrite_reading(fp, read, TT_PLN);
+}
+#endif
+
+#ifdef IOLIB_ZTR
+ztr_t *fread_ztr(FILE *fp) {
+    ztr_t *z;
+    mFILE *mf;
+
+    if (NULL == (mf = mfreopen(NULL, "rb", fp)))
+	return NULL;
+
+    z = mfread_ztr(mf);
+    mfclose(mf);
+    return z;
+}
+
+int fwrite_ztr(FILE *fp, ztr_t *z) {
+    mFILE *mf;
+    int r;
+
+    if (NULL == (mf = mfreopen(NULL, "wbx", fp)))
+	return -1;
+
+    r = mfwrite_ztr(mf, z);
+    mfflush(mf);
+    mf->fp = NULL; /* Don't want this closed here */
+    mfclose(mf);
+    return r;
+}
+#endif
+
+#ifdef IOLIB_SCF
+Scf *fread_scf(FILE *fp) {
+    Scf *s;
+    mFILE *mf;
+
+    if (NULL == (mf = mfreopen(NULL, "rb", fp)))
+	return NULL;
+
+    s = mfread_scf(mf);
+    mf->fp = NULL; /* Don't want this closed here */
+    mfclose(mf);
+    return s;
+}
+
+int fwrite_scf(Scf *s, FILE *fp) {
+    mFILE *mf;
+    int r;
+
+    if (NULL == (mf = mfreopen(NULL, "wbx", fp)))
+	return -1;
+
+    r = mfwrite_scf(s, mf);
+    mfflush(mf);
+    mf->fp = NULL; /* Don't want this closed here */
+    mfclose(mf);
+    return r;
+}
+#endif
+
+#ifdef IOLIB_EXP
+Exp_info *exp_fread_info(FILE *fp) {
+    Exp_info *e;
+    mFILE *mf;
+
+    if (NULL == (mf = mfreopen(NULL, "rb", fp)))
+	return NULL;
+
+    e = exp_mfread_info(mf);
+    mf->fp = NULL; /* Don't want this closed here */
+    mfclose(mf);
+    return e;
+}
+
+void exp_print_file(FILE *fp, Exp_info *e) {
+    mFILE *mf;
+
+    if (NULL == (mf = mfreopen(NULL, "wbx", fp)))
+	return;
+
+    exp_print_mfile(mf, e);
+    mfflush(mf);
+    mf->fp = NULL; /* Don't want this closed here */
+    mfclose(mf);
+}
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/Read.h	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,274 @@
+/*
+ * Copyright (c) Medical Research Council 1994. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+#ifndef _Read_h_
+#define _Read_h_
+
+/* 
+ * Title:	Read
+ *
+ * File: 	Read.h
+ * Purpose:	Read data type
+ * Last update:	June  14 1994
+ */
+
+/*
+ * This module encodes the `Read' sequence data structure.
+ *
+ * A `Read' contains information about bases and traces which are laid
+ * out along a single dimension of points. The number of points in a
+ * paricular sequence is given by `getNPoints', and these are numbered
+ * 0..getNPoints-1. At each point there are four trace readings, one
+ * for each base.
+ *
+ * The number of bases is `getNBases' which are numbered 0..N-1. 
+ * Bases are represented by `char's. Every base is located at a 
+ * particular point.
+ *
+ * The behaviour of these routines is undefined if given NULLRead or
+ * an undefined sequence.
+ */
+
+#include "io_lib/os.h"
+#include "io_lib/scf.h"
+#include "io_lib/mFILE.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * The autoconf setup doesn't use options.mk as the Makefile is rebuilt.
+ * I haven't worked out how to do the analogous via autoconf, so for now
+ * I take the easy approach and hard-code all formats to be enabled
+ */
+#ifdef HAVE_CONFIG_H
+#include "io_lib_config.h"
+#define IOLIB_ABI
+#define IOLIB_SCF
+#define IOLIB_ALF
+#define IOLIB_PLN
+#define IOLIB_CTF
+#define IOLIB_EXP
+#define IOLIB_SFF
+#endif
+
+/* Only add ZTR support if we've got ZLIB installed */
+#ifdef HAVE_ZLIB
+#  ifndef IOLIB_ZTR
+#    define IOLIB_ZTR
+#  endif
+#endif
+
+/*
+ *-----------------------------------------------------------------------------
+ * Macros
+ *-----------------------------------------------------------------------------
+ */
+
+#define NULLRead     ((Read *)NULL)
+
+/* Trace file formats */
+#define TT_ERR -1
+#define TT_UNK 0
+#define TT_SCF 1
+#define TT_ABI 2
+#define TT_ALF 3
+#define TT_PLN 4
+#define TT_EXP 5
+#define TT_CTF 6
+#define TT_ZTR 7
+#define TT_ZTR1 8
+#define TT_ZTR2 9
+#define TT_ZTR3 10
+#define TT_BIO 11
+#define TT_SFF 12
+#define TT_ANY TT_UNK
+/* ANYTR is specifically any *trace* type and not EXP or PLN format */
+#define TT_ANYTR 13
+
+#define READ_BASES	(1<<0)
+#define READ_SAMPLES	(1<<1)
+#define READ_COMMENTS	(1<<2)
+#define READ_ALL	(READ_BASES | READ_SAMPLES | READ_COMMENTS)
+
+/*
+ *-----------------------------------------------------------------------------
+ * Structures and typedefs
+ *-----------------------------------------------------------------------------
+ */
+
+typedef uint_2 TRACE;        /* for trace heights */
+
+typedef struct
+{
+    int		format;	     /* Trace file format */
+    char       *trace_name;  /* Trace file name */
+
+    int         NPoints;     /* No. of points of data */
+    int         NBases;      /* No. of bases */
+
+    /* Traces */
+    TRACE      *traceA;      /* Array of length `NPoints' */
+    TRACE      *traceC;      /* Array of length `NPoints' */
+    TRACE      *traceG;      /* Array of length `NPoints' */
+    TRACE      *traceT;      /* Array of length `NPoints' */
+    TRACE       maxTraceVal; /* The maximal value in any trace */
+    int         baseline;    /* The zero offset for TRACE values */ 
+
+    /* Bases */
+    char       *base;        /* Array of length `NBases' */
+    uint_2     *basePos;     /* Array of length `NBases' */
+
+    /* Cutoffs */
+    int         leftCutoff;  /* Number of unwanted bases */
+    int         rightCutoff; /* First unwanted base at right end */
+
+    /* Miscellaneous Sequence Information */
+    char       *info;        /* misc seq info, eg comments */
+
+    /* Probability information */
+    char       *prob_A;      /* Array of length 'NBases' */
+    char       *prob_C;      /* Array of length 'NBases' */
+    char       *prob_G;      /* Array of length 'NBases' */
+    char       *prob_T;      /* Array of length 'NBases' */
+
+    /* The original input format data, or NULL if inapplicable */
+    int orig_trace_format;
+    void (*orig_trace_free)(void *ptr);
+    void *orig_trace;
+
+    char       *ident;	     /* Seq id, NULL for unknown. Malloced data.
+				Owned and freed by io_lib. */
+
+    /* Pyrosequencing "peaks" (more like spikes). NULL if not used */
+    int          nflows;     /* Number of "flows" */
+    char        *flow_order; /* Bases flowed across */
+    float       *flow;       /* Processed to be 1 base unit oriented */
+    unsigned int*flow_raw;   /* Unprocessed data */
+
+    void *private_data;	     /* The 'private data' block and size from SCF, */
+    int private_size;        /*         NULL & 0 if not present.            */
+} Read;
+
+
+/*
+ *-----------------------------------------------------------------------------
+ * Function prototypes
+ *-----------------------------------------------------------------------------
+ */
+
+
+/* ----- Main I/O routines ----- */
+
+/*
+ * Read a sequence from a file "fn" of format "format". If "format" is 0
+ * (TT_ANY), we automatically determine the correct format.
+ *
+ * Returns:
+ *   Read *   for success
+ *   NULLRead for failure
+ */
+Read *read_reading(char *fn, int format);
+Read *fread_reading(FILE *fp, char *fn, int format);
+Read *mfread_reading(mFILE *fp, char *fn, int format);
+
+
+/*
+ * Write a sequence to a file "fn" of format "format". If "format" is 0,
+ * we choose our favourite - SCF.
+ *
+ * Returns:
+ *   0 for success
+ *  -1 for failure
+ */
+int write_reading(char *fn, Read *read, int format);
+int fwrite_reading(FILE *fp, Read *read, int format);
+int mfwrite_reading(mFILE *fp, Read *read, int format);
+
+
+/* ----- Utility routines ----- */
+
+/*
+ * Allocate a new sequence, with the given sizes.
+ * Returns:
+ *   "Read *" for success
+ *   "NULLRead" for failure
+ */
+Read *read_allocate(int num_points, int num_bases);
+
+
+/*
+ * Duplicates the read structure and optionally gives it a new filename.
+ * The following fields are not duplicated:
+ *    
+ *  int  orig_trace_format;
+ *  void (*orig_trace_free)(void *ptr);
+ *  void *orig_trace;
+ *  char *ident;
+ *
+ * Returns:
+ *   "Read *" for success
+ *   "NULLRead" for failure
+ */
+Read* read_dup( Read* src, const char* new_name );
+
+
+/*
+ * Free memory allocated to a sequence by read_allocate().
+ */
+void read_deallocate(Read *read);
+
+/* unix specific file deletion routine */
+
+int remove_file(char *fn);
+
+Read *read_abi(char *fn);
+Read *fread_abi(FILE *fp);
+Read *mfread_abi(mFILE *fp);
+int write_abi(char *fn, Read *read);
+int fwrite_abi(FILE *fp, Read *read);
+int mfwrite_abi(mFILE *fp, Read *read);
+
+int write_alf(char *fn, Read *read);
+int fwrite_alf(FILE *fp, Read *read);
+int mfwrite_alf(mFILE *fp, Read *read);
+Read *read_alf(char *fn);
+Read *fread_alf(FILE *fp);
+Read *mfread_alf(mFILE *fp);
+
+int write_pln(char *fn, Read *read);
+int fwrite_pln(FILE *fp, Read *read);
+int mfwrite_pln(mFILE *fp, Read *read);
+Read *read_pln(char *fn);
+Read *fread_pln(FILE *fp);
+Read *mfread_pln(mFILE *fp);
+
+Read *read_ctf(char *fn);
+Read *fread_ctf(FILE *fp);
+Read *mfread_ctf(mFILE *fp);
+int write_ctf(char *fn, Read *read);
+int fwrite_ctf(FILE *fp, Read *read);
+int mfwrite_ctf(mFILE *fp, Read *read);
+
+int read_sections(int sec);
+
+#include "io_lib/translate.h"
+#include "io_lib/compress.h"
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _Read_h_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/abi.h	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) Medical Research Council 1994. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+#ifndef _seqIOABI_h
+#define _seqIOABI_h
+
+
+/* 
+ * Title:       seqIOABI
+ * 
+ * File: 	 seqIOABI.h
+ *Purpose:	 IO of ABI sequences
+ * Last update: Mon May 28 1990
+ */
+
+
+
+
+/* ---- Imports ---- */
+
+#include "io_lib/Read.h"
+
+#endif  /*_seqIOABI_h*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/alf.h	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) Medical Research Council 1994. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+#ifndef _seqIOALF_h
+#define _seqIOALF_h
+
+
+/* 
+ * Title:       seqIOALF
+ *
+ * File: 	 seqIOALF.h
+ * Purpose:	 IO of ABI sequences
+ * Last update:  Fri 9th September 1994
+ */
+
+
+
+
+/* ---- Imports ---- */
+
+
+#include "io_lib/Read.h"
+
+#endif  /*_seqIOALF_h*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/array.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,145 @@
+/*
+ * Copyright (c) Medical Research Council 1994. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+/*
+ * File: array.c
+ * Version:
+ *
+ * Description:
+ *
+ * Created:
+ * Updated:
+ *
+ */
+
+#include <stdio.h>
+#include <sys/types.h>
+
+#include "io_lib/array.h"
+#include "io_lib/xalloc.h"
+
+
+/*
+ * For error reporting
+ */
+int ArrayError = 0;
+
+
+char *ArrayErrorString(int err)
+{
+    switch(err) {
+    case ARRAY_NO_ERROR:          return "No error";
+    case ARRAY_FULL:     	  return "Array full";
+    case ARRAY_INVALID_ARGUMENTS: return "Invalid arguments";
+    case ARRAY_OUT_OF_MEMORY:     return "Out of memory";
+    default:			  return "Unknown error";
+    }
+}
+
+
+
+Array ArrayCreate(size_t size, size_t dim)
+/*
+ * create a new array
+ */
+{
+    Array a;
+    
+    if ( (a = (Array) xmalloc(sizeof(ArrayStruct)) ) == NULL ) {
+	ArrayError = ARRAY_OUT_OF_MEMORY;
+    } else {
+	a->size = size;
+	a->dim = dim?dim:1;
+	a->max = 0;
+	if ( (a->base = (void *)xmalloc(a->size * a->dim)) == NULL ) {
+	    ArrayError = ARRAY_OUT_OF_MEMORY;
+	    xfree(a);
+	    a = NULL;
+	}
+    }
+    
+    return a;
+    
+}
+
+
+
+int ArrayExtend(Array a, size_t dim)
+/*
+ * extend array
+ */
+{
+    void *newbase;
+    size_t old_dim;
+
+    if (a == NULL) return ArrayError = ARRAY_INVALID_ARGUMENTS;
+    if (dim < a->dim) return ArrayError = ARRAY_NO_ERROR;
+
+    old_dim = a->dim;
+    while (dim >= a->dim) {
+	a->dim = a->dim * 1.2 + 1;
+    }
+
+    if ( (newbase = (void *)xrealloc(a->base, a->size * a->dim)) == NULL ) {
+	a->dim = old_dim;
+	return ArrayError = ARRAY_OUT_OF_MEMORY;
+    } else {
+	a->base = newbase;
+    }
+
+    return ArrayError = ARRAY_NO_ERROR;
+}
+
+
+
+
+void *ArrayRef(Array a, size_t i)
+{
+    if (a==NULL) {
+	ArrayError = ARRAY_INVALID_ARGUMENTS;
+	return NULL;
+    }
+
+    if (i >= a->max) {
+	if (i >= a->dim) {
+	    if (ArrayExtend(a,i+1)) {
+		/* ArrayExtend sets ArrayError */
+		return NULL;
+	    }
+	}
+	a->max = i+1;
+    }
+
+    return (void *) arrp(char,a,i*a->size);
+}
+
+
+
+int ArrayDestroy(Array a)
+/*
+ * destroy array
+ */
+{
+    if (a==NULL) return ArrayError = ARRAY_INVALID_ARGUMENTS;
+    
+    if (a->base != NULL) xfree(a->base);
+    a->base= NULL;
+    xfree(a);
+
+    return ArrayError = ARRAY_NO_ERROR;
+    
+    
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/array.h	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) Medical Research Council 1994. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+/*
+ * File: array.h
+ * Version:
+ *
+ * Description:
+ *
+ * Created:
+ * Updated:
+ *
+ */
+
+#ifndef _ARRAY_H_
+#define _ARRAY_H_
+
+/* 12/1/99 johnt - use stddef.h not sys/types.h for size_t */
+#include <stddef.h>		/* IMPORT: size_t */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct {
+    size_t size;		/* element size */
+    size_t dim;			/* allocated number of elements */
+    size_t max;			/* elements accessed */
+    void *base;			/* base address of array */
+} ArrayStruct, *Array;
+
+
+
+extern Array ArrayCreate(size_t size, size_t dim);
+
+extern int ArrayExtend(Array a, size_t dim);
+
+extern void *ArrayRef(Array a, size_t i);
+
+extern int ArrayDestroy(Array a);
+
+#define ArrayMax(a) ( (a)->max )
+
+#define ArrayBase(t,a) ( (t *)((a)->base) )
+
+/*
+#define arr(t,a,n) \
+    (*(t*)((a)->base + (a)->size*(n)))
+
+#define arrp(t,a,n) \
+    ((t*)((a)->base + (a)->size*(n)))
+*/
+
+
+
+
+#define arr(t,a,n) \
+    ((t*)((a)->base))[n]
+
+#define ARR(t,a,n) \
+    (*((t*)ArrayRef((a),(n))))
+
+#define arrp(t,a,n) \
+    &((t*)((a)->base))[n]
+#define ARRP(t,a,n) \
+    ((t*)ArrayRef(a,n))
+
+#define ARRAY_NO_ERROR			 0
+#define ARRAY_FULL			-1
+#define ARRAY_INVALID_ARGUMENTS		-2
+#define ARRAY_OUT_OF_MEMORY		-3
+
+extern int ArrayError;
+
+extern char *ArrayErrorString(int error);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*_ARRAY_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/compress.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,585 @@
+/*
+ * Copyright (c) Medical Research Council 1994. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+/*
+ * Handles compression and decompression.
+ * Two functions are available. One compresses files, and the other opens
+ * (read only) a compressed file and returns a FILE pointer.
+ * Neither of these two are likely to work under Windows or MacOS.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef HAVE_SYS_WAIT_H
+#    include <sys/wait.h>
+#    define DO_PIPE2
+#endif
+#include <errno.h>
+#include <unistd.h>
+#include <string.h>
+#include <sys/time.h>
+
+#include "io_lib/os.h" /* for ftruncate() under WINNT */
+
+#ifdef HAVE_CONFIG_H
+#include "io_lib_config.h"
+#endif
+
+#include "io_lib/compress.h"
+
+#ifdef HAVE_ZLIB
+#include <zlib.h>
+
+/* ------------------------------------------------------------------------- */
+/* GZIP reading and writing code via ZLIB. */
+
+#define BS 8192
+
+#define MAX_WBITS 15
+
+#define FTEXT    (1<<0)
+#define FHCRC    (1<<1)
+#define FEXTRA   (1<<2)
+#define FNAME    (1<<3)
+#define FCOMMENT (1<<4)
+/* Given a gzip file this returns the size of the gzip header */
+static int gzheadersize(unsigned char *data) {
+    int offset = 10;
+    int flags = data[3];
+
+    if (flags & FEXTRA)
+	offset += 2 + data[offset] + data[offset+1]*256;
+
+    if (flags & FNAME)
+	while (data[offset++]);
+
+    if (flags & FCOMMENT)
+	while (data[offset++]);
+
+    if (flags & FHCRC)
+	offset += 2;
+
+    return offset;
+}
+
+char *memgunzip(char *data, size_t size, size_t *udata_size) {
+    int gzheader;
+    z_stream s;
+    char *udata = NULL;
+    int udata_alloc = 0;
+    int udata_pos = 0;
+
+    /* Compute gzip header size */
+    gzheader = gzheadersize((unsigned char *)data);
+
+    /* Initialise zlib stream starting after the header */
+    s.zalloc = (alloc_func)0;
+    s.zfree = (free_func)0;
+    s.opaque = (voidpf)0;
+    s.next_in = (unsigned char *)data + gzheader;
+    s.avail_in = size - gzheader;
+    inflateInit2(&s, -MAX_WBITS);
+
+    /* Decode to 'udata' array */
+    for (;;) {
+	int err;
+	if (udata_alloc - udata_pos < 1) {
+	    udata_alloc = udata_alloc ? udata_alloc * 2 : 256;
+	    udata = realloc(udata, udata_alloc);
+	}
+	s.next_out = (unsigned char *)&udata[udata_pos];
+	s.avail_out = udata_alloc - udata_pos;
+	err = inflate(&s, Z_NO_FLUSH);
+	udata_pos = udata_alloc - s.avail_out;
+	if (err) {
+	    if (err == Z_STREAM_END) {
+		break;
+	    } else {
+		inflateEnd(&s);
+		return NULL;
+	    }
+	}
+    }
+
+    inflateEnd(&s);
+    *udata_size = udata_pos;
+
+    return udata;
+}
+
+char *memgzip(char *data, size_t size, size_t *cdata_size) {
+    z_stream s;
+    char *cdata = NULL;
+    int cdata_alloc = 0;
+    int cdata_pos = 0;
+    int err;
+    uint32_t i32;
+
+    /* Create a minimal gzip header */
+    cdata = malloc(cdata_alloc = size*1.02+10+8);
+    memcpy(cdata, "\037\213\010\000\000\000\000\000\000\377", 10);
+    cdata_pos = 10;
+
+    /* Initialise zlib stream starting after the header */
+    s.zalloc = (alloc_func)0;
+    s.zfree = (free_func)0;
+    s.opaque = (voidpf)0;
+    s.next_in = (unsigned char *)data;
+    s.avail_in = size;
+
+    err = deflateInit2(&s, Z_DEFAULT_COMPRESSION, Z_DEFLATED, -MAX_WBITS,
+		       9 /* DEF_MEM_LEVEL */, Z_DEFAULT_STRATEGY);
+
+    /* Encode to 'cdata' array */
+    for (;s.avail_in;) {
+	s.next_out = (unsigned char *)&cdata[cdata_pos];
+	s.avail_out = cdata_alloc - cdata_pos;
+	if (cdata_alloc - cdata_pos <= 0) {
+	    fprintf(stderr, "Gzip produced larger output than expected. Abort\n"); 
+	    return NULL;
+	}
+	err = deflate(&s, Z_NO_FLUSH);
+	cdata_pos = cdata_alloc - s.avail_out;
+	if (err != Z_OK)
+	    break;
+    }
+    deflate(&s, Z_FINISH);
+    cdata_pos = 10 + s.total_out;
+
+    i32 = crc32(0L, (unsigned char *)data, size);
+    cdata[cdata_pos++] = (int)(i32 & 0xff); i32 >>= 8;
+    cdata[cdata_pos++] = (int)(i32 & 0xff); i32 >>= 8;
+    cdata[cdata_pos++] = (int)(i32 & 0xff); i32 >>= 8;
+    cdata[cdata_pos++] = (int)(i32 & 0xff); i32 >>= 8;
+
+    i32 = size;
+    cdata[cdata_pos++] = (int)(i32 & 0xff); i32 >>= 8;
+    cdata[cdata_pos++] = (int)(i32 & 0xff); i32 >>= 8;
+    cdata[cdata_pos++] = (int)(i32 & 0xff); i32 >>= 8;
+    cdata[cdata_pos++] = (int)(i32 & 0xff); i32 >>= 8;
+
+    deflateEnd(&s);
+    *cdata_size = cdata_pos;
+
+    return cdata;
+}
+#endif
+
+#ifdef DO_PIPE2
+/* ------------------------------------------------------------------------- */
+/* pipe_into - for piping via compression and decompression tools */
+
+/*
+ * This pipes 'input' data of length 'size' into a unix 'command'.
+ * The output is then returned as an allocated block of memory. It is the
+ * caller's responsibility to free this data.
+ *
+ * Returns malloc()ed data on success
+ *         NULL on failure
+ */
+#define PIPEBS 8192
+static char *pipe_into(const char *command, char *input, size_t insize,
+		       size_t *outsize) {
+    char *output = NULL;
+    int output_alloc = 0;
+    int output_used = 0;
+    int fdp[2][2];
+    fd_set rdfds, wrfds;
+    int n = 0;
+    pid_t pid;
+    char buf[PIPEBS];
+    int len, status;
+    int eof_rd = 0, eof_wr = 0;
+
+    /*
+     * Make the connections:
+     *
+     * fdp[0] is stdin for the child
+     * fdp[1] is stdout for the child
+     * fdp[x][0] is the read end, and fdp[x][1] is the write end.
+     * Hence:
+     *     fdp[0][1] (parent's output) ->  (child's stdin) fdp[0][0]
+     *     fdp[1][1] (child's stdout)  -> (parent's input) fdp[1][0]
+     */
+
+    if (-1 == pipe(fdp[0]))
+        return NULL;
+
+    if (-1 == pipe(fdp[1])) {
+        close(fdp[0][0]);
+        close(fdp[0][1]);
+        return NULL;
+    }
+
+    if (n < fdp[1][0] + 1)
+	n = fdp[1][0] + 1;
+    if (n < fdp[0][1] + 1)
+	n = fdp[0][1] + 1;
+
+    switch(pid = fork()) {
+    case 0: /* child */
+        dup2(fdp[0][0], 0);
+        dup2(fdp[1][1], 1);
+        close(fdp[0][1]);
+        close(fdp[1][0]);
+
+        execlp("sh", "sh", "-c", command, NULL);
+        exit(1);
+
+    default: /* parent */
+        close(fdp[0][0]);
+        close(fdp[1][1]);
+        break;
+
+    case -1: /* error */
+	return NULL;
+    }
+
+    /*
+     * Set both parent ends to be non blocking. Deadlock can not be
+     * completely avoided in a double pipe, so if something's going to
+     * break we want to make sure it'll be the child, not the parent.
+     */
+    (void)fcntl(fdp[0][1], F_SETFL, O_NONBLOCK);
+    (void)fcntl(fdp[1][0], F_SETFL, O_NONBLOCK);
+
+    do {
+	struct timeval tv;
+	int r;
+
+	FD_ZERO(&rdfds);
+	FD_ZERO(&wrfds);
+	if (!eof_wr)
+	    FD_SET(fdp[0][1], &wrfds);
+	if (!eof_rd)
+	    FD_SET(fdp[1][0], &rdfds);
+
+	tv.tv_sec = 1;
+	tv.tv_usec = 0;
+	if (-1 == (r = select(n, &rdfds, &wrfds, NULL, &tv)))
+	    /* Handle EINTR etc... */
+	    break;
+
+	if (r) {
+	    if (FD_ISSET(fdp[1][0], &rdfds)) {
+		len = read(fdp[1][0], buf, PIPEBS);
+		if (len > 0) {
+		    while (output_used + len > output_alloc) {
+			output_alloc = output_alloc ? output_alloc*2 : PIPEBS;
+			output = realloc(output, output_alloc);
+		    }
+		    memcpy(&output[output_used], buf, len);
+		    output_used += len;
+		} else {
+		    close(fdp[1][0]);
+		    eof_rd = 1;
+		}
+	    }
+	    if (FD_ISSET(fdp[0][1], &wrfds)) {
+		len = write(fdp[0][1], input, insize>PIPEBS ? PIPEBS : insize);
+		if (len > 0) {
+		    input += len;
+		    insize -= len;
+
+		    if (insize == 0) {
+			close(fdp[0][1]);
+			eof_wr = 1;
+		    }
+		}
+	    }
+	}
+	
+    } while(!eof_rd || !eof_wr);
+
+    close(fdp[0][1]);   /* should be closed already, but being doubly- */
+    close(fdp[1][0]);   /* sure in case of error */
+    waitpid(pid, &status, 0);
+
+    *outsize = output_used;
+    return output;
+}
+#endif /* DO_PIPE2 */
+
+/* ------------------------------------------------------------------------- */
+/* The main external routines for io_lib */
+
+/*
+ * This contains the last used compression method.
+ */
+static int compression_used = 0;
+
+typedef struct {
+    unsigned char magic[3];
+    int magicl;
+    char *compress;
+    char *uncompress;
+    char *extension;
+} Magics;
+
+/*
+ * The list of magic numbers. The attempted order for compression is the
+ * order of entries in this file.
+ *
+ * NB: bzip gives very good (better than gzip) results, is sometimes faster for
+ * compression, but unfortunately much slower (4x?) for decompression. Most
+ * people won't have it anyway.
+ *
+ * szip is definitely the best in compression ratios, and is faster than bzip.
+ * However it's still slower than gzip. For comparable ratios, but much faster,
+ * see the ztr format.
+ */
+static Magics magics[] = {
+    {{'B',   'Z',    '0'},	3,	"bzip",		"bzip -d",   ".bz"},
+    {{'\037', 0213, '\0'},	2,	"gzip",		"gzip -d",   ".gz"},
+    {{'\037', 0235, '\0'},	2,	"compress",	"uncompress",".Z"},
+    {{'B',   'Z',    'h'},	3,	"bzip2",	"bzip2 -d",  ".bz2"},
+    {{'S',   'Z',   '\n'},	3,	"szip",	        "szip -d",   ".sz"},
+};
+
+void set_compression_method(int method) {
+    compression_used = method;
+}
+
+int get_compression_method(void) {
+    return compression_used;
+}
+
+/*
+ * Converts compress mode strings (eg "gzip") to numbers.
+ */
+int compress_str2int(char *mode) {
+    if (strcmp(mode, "bzip") == 0)
+	return COMP_METHOD_BZIP;
+    else if (strcmp(mode, "bzip2") == 0)
+	return COMP_METHOD_BZIP2;
+    else if (strcmp(mode, "gzip") == 0)
+	return COMP_METHOD_GZIP;
+    else if (strcmp(mode, "compress") == 0)
+	return COMP_METHOD_COMPRESS;
+    else if (strcmp(mode, "szip") == 0)
+	return COMP_METHOD_SZIP;
+    else return 0;
+
+}
+/*
+ * Converts compress mode numbers to strings (eg "gzip").
+ */
+char *compress_int2str(int mode) {
+    switch (mode) {
+    case COMP_METHOD_BZIP:      return "bzip";
+    case COMP_METHOD_GZIP:      return "gzip";
+    case COMP_METHOD_BZIP2:     return "bzip2";
+    case COMP_METHOD_COMPRESS:  return "compress";
+    case COMP_METHOD_SZIP:      return "szip";
+    }
+    return "none";
+}
+
+/*
+ * Compress a file using the method set in the compression_used value
+ * (set by set_compression_method and fopen_compressed).
+ *
+ * If compression succeeds, we rename the file back its original name.
+ *
+ * When compression_used is 0 no compression is done.
+ */
+int compress_file(char *file) {
+    char fname[2048];
+    mFILE *mf;
+    FILE *fp;
+
+    /* Do nothing unless requested */
+    if (compression_used == 0)
+	return 0;
+
+    mf = mfopen(file, "r");
+    fcompress_file(mf);
+
+    sprintf(fname, "%s%s", file, magics[compression_used-1].extension);
+    if (NULL == (fp = fopen(fname, "wb")))
+	return -1;
+
+    fwrite(mf->data, 1, mf->size, fp);
+    fclose(fp);
+    mfclose(mf);
+
+
+    return 0;
+}
+
+/*
+ * Compress an mFILE using the method set in the compression_used value
+ * (set by set_compression_method and fopen_compressed). This is done
+ * in-memory by using a pipe to and from the compression program, or zlib
+ * if we want to use gzip.
+ *
+ * When compression_used is 0 no compression is done.
+ */
+int fcompress_file(mFILE *fp) {
+    size_t size;
+    char *data;
+
+    /* Do nothing unless requested */
+    if (compression_used == 0)
+	return 0;
+
+#ifdef HAVE_ZLIB
+    /*
+     * If zlib is used then we use it to implement gzip internally, thus
+     * saving starting up a separate process. This is substantially faster.
+     */
+    if (compression_used == 2) {
+	data = memgzip(fp->data, fp->size, &size);
+    } else
+#endif
+    {
+#ifdef DO_PIPE2
+	/*
+	 * We have to pipe the data via an external tool, avoiding temporary
+	 * files for speed.
+	 */
+	data = pipe_into(magics[compression_used-1].compress,
+			 fp->data, fp->size, &size);
+#else
+	return -1;
+#endif
+    }
+
+    mfrecreate(fp, data, size);
+    mfseek(fp, size, SEEK_SET);
+
+    return 0;
+}
+
+
+/*
+ * Returns a file pointer of an uncompressed copy of 'file'.
+ * 'file' need not exist if 'file'.ext (eg file.gz)
+ * exists and can be uncompressed.
+ *
+ * NO LONGER SUPPORTED:-
+ * If ofp is non NULL then the original file pointer will also be returned
+ * (opened for update) to allow writing back to the original file. In cases
+ * of uncompressed data this is the same as the returned file pointer.
+ */
+mFILE *fopen_compressed(char *file, mFILE **ofp) {
+    int num_magics = sizeof(magics) / sizeof(*magics);
+    int i;
+    char fext[1024];
+
+    if (ofp) {
+	fprintf(stderr, "ofp not supported in fopen_compressed() yet\n");
+	*ofp = NULL;
+    }
+
+    /*
+     * Try opening the file and reading the magic number.
+     * If this doesn't work, then don't worry - the filename may be
+     * the original name which has been renamed due to compression.
+     * (eg file.gz).
+     */
+    for (i = -1; i < num_magics; i++) {
+	mFILE *fp, *newfp;
+
+	if (i == -1) {
+	    if (NULL == (fp = mfopen(file, "rb")))
+		continue;
+	} else {
+	    sprintf(fext, "%s%s", file, magics[i].extension);
+	    if (NULL == (fp = mfopen(fext, "rb")))
+		continue;
+	}
+
+	newfp = freopen_compressed(fp, NULL);
+	if (fp != newfp)
+	    /* Was compressed, so free compressed copy & return uncompressed */
+	    mfclose(fp);
+
+	if (newfp) {
+	    return newfp;
+	}
+    }
+
+    return NULL;
+}
+
+/*
+ * Returns a file pointer of an uncompressed copy of 'fp'.
+ * This may be the input fp or it may be a new fp.
+ * The input fp is not modified and is left open. Therefore it is left up
+ * to the caller to close the input fp and to check whether the returned fp
+ * differs, and if so to close that too.
+ */
+mFILE *freopen_compressed(mFILE *fp, mFILE **ofp) {
+    int num_magics = sizeof(magics) / sizeof(*magics);
+    unsigned char mg[3];
+    int i;
+    char *udata;
+    size_t usize;
+
+    if (ofp) {
+	fprintf(stderr, "ofp not supported in fopen_compressed() yet\n");
+	*ofp = NULL;
+    }
+
+    /* Test that it's compressed with full magic number */
+    mfread(mg, 1, 3, fp);
+    mrewind(fp);
+    for (i = 0; i < num_magics; i++) {
+	if (0 == memcmp(mg, magics[i].magic, magics[i].magicl))
+	    break;
+    }
+    if (i == num_magics) {
+	compression_used = 0;
+	return fp;
+    }
+
+#ifdef HAVE_ZLIB
+    if (i == 1) {
+	udata = memgunzip(fp->data, fp->size, &usize);
+    } else
+#endif
+    {
+#ifdef DO_PIPE2
+	udata = pipe_into(magics[i].uncompress, fp->data, fp->size, &usize);
+#else
+	return NULL;
+#endif
+    }
+
+    compression_used = i+1;
+
+    return mfcreate(udata, usize);
+}
+
+/*
+ * Given a filename remove a known compression extension
+ *
+ * Returns: None
+ */
+void remove_extension(char *file) {
+    int num_magics = sizeof(magics) / sizeof(*magics);
+    int i;
+    for (i=0;i<num_magics;i++) {
+      char *cp = file+strlen(file)-strlen(magics[i].extension);
+      if (strcmp(cp, magics[i].extension) == 0) {
+            *cp = '\0';
+            return;
+        }
+    }
+    return;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/compress.h	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) Medical Research Council 1994. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+#ifndef _COMPRESS_H
+#define _COMPRESS_H
+
+#include <stdio.h>
+
+#include "io_lib/mFILE.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Compress a file using the method set in the compression_used value
+ * (set by set_compression_method and fopen_compressed).
+ *
+ * If compression succeeds, we rename the file back its original name.
+ *
+ * When compression_used is 0 no compression is done.
+ */
+int compress_file(char *file);
+int fcompress_file(mFILE *fp);
+
+/*
+ * Returns a file pointer of an uncompressed copy of 'file'.
+ * 'file' need not exist if 'file'.ext (eg file.gz)
+ * exists and can be uncompressed.
+ *
+ * If ofp is non NULL then the original file pointer will also be returned
+ * (opened for update) to allow writing back to the original file. In cases
+ * of uncompressed data this is the same as the returned file pointer.
+ */
+mFILE *fopen_compressed(char *file, mFILE **ofp);
+
+/*
+ * Returns a file pointer of an uncompressed copy of 'fp'.
+ *
+ * If ofp is non NULL then the original file pointer will also be returned
+ * (opened for update) to allow writing back to the original file. In cases
+ * of uncompressed data this is the same as the returned file pointer.
+ */
+mFILE *freopen_compressed(mFILE *fp, mFILE **ofp);
+
+/*
+ * Sets the desired compression method. The below macros relate to entries
+ * in the compression magic numbers table.
+ */
+void set_compression_method(int method);
+int get_compression_method(void);
+
+/*
+ * Converts compress mode strings (eg "gzip") to numbers.
+ */
+int compress_str2int(char *mode);
+
+/*
+ * Converts compress mode numbers to strings (eg "gzip").
+ */
+char *compress_int2str(int mode);
+
+#define COMP_METHOD_NONE	0
+#define COMP_METHOD_BZIP	1
+#define COMP_METHOD_GZIP	2
+#define COMP_METHOD_COMPRESS	3
+#define COMP_METHOD_BZIP2	5
+#define COMP_METHOD_SZIP	6
+
+/*
+ * In memory gzip and gunzip using zlib. In each case data is the input
+ * data (with 'size') and the returned value is the output data along with
+ * [cu]data_size being the returned data size.
+ *
+ * Both return NULL on failure
+ */
+char *memgzip(char *data, size_t size, size_t *cdata_size);
+char *memgunzip(char *data, size_t size, size_t *udata_size);
+
+/*
+ * Given a filename remove a known compression extension
+ *
+ * Returns: None
+ */
+void remove_extension(char *file);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _COMPRESS_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/compression.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,2503 @@
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <zlib.h>
+#include <assert.h>
+#include <math.h>
+#include <ctype.h>
+
+#ifndef M_PI
+#  define M_PI 3.14159265358979323846
+#endif
+
+#include "io_lib/ztr.h"
+#include "io_lib/os.h"
+#include "io_lib/compression.h"
+#include "io_lib/xalloc.h"
+
+#ifndef NDEBUG 
+#  define NDEBUG 
+#endif 
+
+/*
+ * ---------------------------------------------------------------------------
+ * ZTR_FORM_ZLIB
+ * ---------------------------------------------------------------------------
+ */
+
+/*
+ * Some comments on zlib usage.
+ *
+ * - Ideally for trace data, after decorrelation, we should use Z_FILTERED.
+ *   Empirical studies show that this gives the best compression ratio, but
+ *   it is slow (about the same speed as normal gzip). MUCH faster is huffman
+ *   only, and it doesn't give radically different compression ratios.
+ *
+ * - When compressing using Z_HUFFMAN_ONLY we used compression level
+ *   '1' as this invokes the deflate_fast() algorithm. It makes no
+ *   difference to the compression level, but it seems to be quicker still.
+ *
+ */
+
+/*
+ * zlib_huff()
+ *
+ * Compresses data using huffman encoding, as implemented by zlib.
+ *
+ * Arguments:
+ *	uncomp		Uncompressed input data
+ *	uncomp_len	Length of uncomp data
+ *	comp_len	Output: length of compressed data
+ *
+ * Returns:
+ *	Compressed data if successful
+ *	NULL if not successful
+ */
+char *zlib_huff(char *uncomp, int uncomp_len, int strategy, int *comp_len) {
+    z_stream zstr;
+    int err;
+    int comp_len_tmp = (int)(uncomp_len * 1.001 + 12); /* Maximum expansion size */
+    char *comp = (char *)xmalloc(comp_len_tmp+5);
+    int c_len;
+
+    /* Initialise zlib */
+    zstr.zalloc = (alloc_func)0;
+    zstr.zfree = (free_func)0;
+    zstr.opaque = (voidpf)0;
+
+    if ((err = deflateInit2(&zstr, 1, Z_DEFLATED, 15, 8, strategy)) != Z_OK) {
+	fprintf(stderr, "zlib errror in deflateInit2(): %d\n", err);
+	return NULL;
+    }
+
+    /* Set up input and output buffers */
+    zstr.next_in = (unsigned char *)uncomp;
+    zstr.avail_in = uncomp_len;
+    zstr.next_out = (unsigned char *)comp+5;
+    zstr.avail_out = comp_len_tmp;
+    
+    /* Do the compression */
+    if ((err = deflate(&zstr, Z_FINISH)) != Z_STREAM_END) {
+	fprintf(stderr, "zlib errror in deflate(): %d\n", err);
+	return NULL;
+    }
+
+    /* Tidy up */
+    deflateEnd(&zstr);
+
+    c_len = zstr.total_out;
+
+    /* Return */
+    comp[0] = ZTR_FORM_ZLIB;
+    comp[1] = (uncomp_len >>  0) & 0xff;
+    comp[2] = (uncomp_len >>  8) & 0xff;
+    comp[3] = (uncomp_len >> 16) & 0xff;
+    comp[4] = (uncomp_len >> 24) & 0xff;
+
+    if (comp_len)
+	*comp_len = c_len+5;
+
+    return comp;
+}
+
+/*
+ * zlib_dehuff()
+ *
+ * Uncompresses data using huffman encoding, as implemented by zlib.
+ *
+ * Arguments:
+ *	comp		Compressed input data
+ *	comp_len	Length of comp data
+ *	uncomp_len	Output: length of uncompressed data
+ *
+ * Returns:
+ *	Uncompressed data if successful
+ *	NULL if not successful
+ */
+char *zlib_dehuff(char *comp, int comp_len, int *uncomp_len) {
+    z_stream zstr;
+    int err;
+    char *uncomp;
+    int ulen;
+
+    /* Allocate */
+    ulen =
+	((unsigned char)comp[1] <<  0) +
+	((unsigned char)comp[2] <<  8) +
+	((unsigned char)comp[3] << 16) +
+	((unsigned char)comp[4] << 24);
+    uncomp = (char *)xmalloc(ulen);
+
+    /* Initialise zlib */
+    zstr.zalloc = (alloc_func)0;
+    zstr.zfree = (free_func)0;
+    zstr.opaque = (voidpf)0;
+
+    if ((err = inflateInit(&zstr)) != Z_OK) {
+	fprintf(stderr, "zlib errror in inflateInit(): %d\n", err);
+	return NULL;
+    }
+
+    /* Set up input and output buffers */
+    zstr.next_in = (unsigned char *)comp+5;
+    zstr.avail_in = comp_len-5;
+    zstr.next_out = (unsigned char *)uncomp;
+    zstr.avail_out = ulen;
+    
+    /* Do the decompression */
+    if ((err = inflate(&zstr, Z_FINISH)) != Z_STREAM_END) {
+	fprintf(stderr, "zlib errror in deflate(): %d\n", err);
+	return NULL;
+    }
+
+    /* Tidy up */
+    inflateEnd(&zstr);
+
+    if (uncomp_len)
+	*uncomp_len = ulen;
+
+    return uncomp;
+}
+
+
+/*
+ * ---------------------------------------------------------------------------
+ * ZTR_FORM_RLE
+ * ---------------------------------------------------------------------------
+ */
+
+/*
+ * Run length encoding.
+ *
+ * Any run of 3 or more identical characters (up to 255 in a row) are replaced
+ * by a 'guard' byte followed by the number of characters followed by
+ * the character value itself.
+ * Any single guard value in the input is escaped using 'guard 0'.
+ *
+ * Specifying guard as -1 will automatically pick one of the least used
+ * characters in the input as the guard.
+ *
+ * Arguments:
+ *	uncomp		Input data
+ *	uncomp_len	Length of input data 'uncomp'
+ *	guard		Guard byte - used to encode "N" copies of data
+ *	comp_len	Output: length of compressed data
+ *
+ * Returns:
+ *	Compressed data if successful
+ *	NULL if not successful
+ */
+char *rle(char *uncomp, int uncomp_len, int guard, int *comp_len) {
+    int i, k, c_len = 0;
+    char *comp = xmalloc(2 * uncomp_len + 6);
+    char *out = comp + 6;
+
+    /* A guard of -1 implies to search for the least frequent symbol */
+    if (guard == -1) {
+	int cnt[256];
+	int bestcnt = uncomp_len + 1;
+
+	for (i = 0; i < 256; i++)
+	    cnt[i] = 0;
+
+	for (i = 0; i < uncomp_len; i++) {
+	    cnt[(unsigned char)uncomp[i]]++;
+	}
+
+	for (i = 0; i < 256; i++) {
+	    if (cnt[i] < bestcnt) {
+		bestcnt = cnt[i];
+		guard = i;
+	    }
+	}
+    }
+
+    for (i = 0; i < uncomp_len; i=k) {
+	/*
+	 * Detect blocks of up identical bytes up to 255 bytes long.
+	 */
+	for (k = i; k < uncomp_len && uncomp[i] == uncomp[k]; k++)
+	    if (k-i == 255)
+		break;
+
+	/* 1, 2 or 3 bytes are best stored "as is" */
+	if (k-i < 4) {
+	    do {
+		/*
+		 * If we find 'guard' in our sequence, escape it by
+		 * outputting 'guard' <zero>. (We know that we'll never
+		 * write out zero copies of a token in our rle compression
+		 * algorithm.)
+		 */
+		if ((unsigned char)(uncomp[i]) == guard) {
+		    out[c_len++] = guard;
+		    out[c_len++] = 0;
+		} else {
+		    out[c_len++] = uncomp[i];
+		}
+		i++;
+	    } while (k >= i+1);
+	} else {
+	    /* More than 3 bytes: store as ('guard', length, byte value) */
+	    out[c_len++] = guard;
+	    out[c_len++] = k-i;
+	    out[c_len++] = uncomp[i];
+	}
+    }
+
+    /* Return */
+    comp[0] = ZTR_FORM_RLE;
+    comp[1] = (uncomp_len >>  0) & 0xff;
+    comp[2] = (uncomp_len >>  8) & 0xff;
+    comp[3] = (uncomp_len >> 16) & 0xff;
+    comp[4] = (uncomp_len >> 24) & 0xff;
+    comp[5] = guard;
+
+    if (comp_len)
+	*comp_len = c_len+6;
+
+    return comp;
+}
+
+/*
+ * Reverses run length encoding.
+ *
+ * Arguments:
+ *	comp		Compressed input data
+ *	comp_len	Length of comp data
+ *	uncomp_len	Output: length of uncompressed data
+ *
+ * Returns:
+ *	Uncompressed data if successful
+ *	NULL if not successful
+ */
+/* ARGSUSED */
+char *unrle(char *comp, int comp_len, int *uncomp_len) {
+    int in_i, out_i, i, val, count, out_len;
+    char *uncomp;
+    unsigned char *in = (unsigned char *)comp+6;
+    char *out;
+    int guard = (unsigned char)comp[5];
+
+    /* Allocate */
+    out_len =
+	((unsigned char)comp[1] <<  0) +
+	((unsigned char)comp[2] <<  8) +
+	((unsigned char)comp[3] << 16) +
+	((unsigned char)comp[4] << 24);
+    out = uncomp = (char *)xmalloc(out_len);
+    
+    for (in_i = out_i = 0; out_i < out_len; in_i++) {
+	if (in[in_i] != guard) {
+	    /* When not 'guard' it's easy - just output this token */
+	    assert(out_i >= 0 && out_i < out_len);
+	    out[out_i++] = in[in_i];
+
+	} else {
+	    /*
+	     * Found an 'guard' token. If next token is zero, then
+	     * we were simply escaping a real 'guard' token in the input
+	     * data, otherwise output a string of bytes.
+	     */
+	    count = in[++in_i];
+	    if (count != 0) {
+		val = in[++in_i];
+		for (i = 0; i < count; i++) {
+		    assert(out_i >= 0 && out_i < out_len);
+		    out[out_i++] = val;
+		}
+	    } else {
+		assert(out_i >= 0 && out_i < out_len);
+		out[out_i++] = guard;
+	    }
+	}
+    }
+
+    if (uncomp_len)
+	*uncomp_len = out_len;
+
+    return uncomp;
+}
+
+/*
+ * ---------------------------------------------------------------------------
+ * ZTR_FORM_XRLE
+ * ---------------------------------------------------------------------------
+ */
+
+/*
+ * Mutli-byte run length encoding.
+ *
+ * Any run of 3 or more identical characters (up to 255 in a row) are replaced
+ * by a 'guard' byte followed by the number of characters followed by
+ * the character value itself.
+ * Any single guard value in the input is escaped using 'guard 0'.
+ *
+ * Specifying guard as -1 will automatically pick one of the least used
+ * characters in the input as the guard.
+ *
+ * Arguments:
+ *	uncomp		Input data
+ *	uncomp_len	Length of input data 'uncomp'
+ *	guard		Guard byte - used to encode "N" copies of data
+ *      rsz             Size of blocks to compare for run checking.
+ *	comp_len	Output: length of compressed data
+ *
+ * Returns:
+ *	Compressed data if successful
+ *	NULL if not successful
+ */
+char *xrle(char *uncomp, int uncomp_len, int guard, int rsz, int *comp_len) {
+    char *comp = (char *)malloc(2 * uncomp_len + 3);
+    char *out = comp;
+    int i, j, k;
+
+    /* A guard of -1 implies to search for the least frequent symbol */
+    if (guard == -1) {
+	int cnt[256];
+	int bestcnt = uncomp_len + 1;
+
+	for (i = 0; i < 256; i++)
+	    cnt[i] = 0;
+
+	for (i = 0; i < uncomp_len; i++) {
+	    cnt[(unsigned char)uncomp[i]]++;
+	}
+
+	for (i = 0; i < 256; i++) {
+	    if (cnt[i] < bestcnt) {
+		bestcnt = cnt[i];
+		guard = i;
+	    }
+	}
+    }
+
+    *out++ = ZTR_FORM_XRLE;
+    *out++ = rsz;
+    *out++ = guard;
+
+    for (i = 0; i < uncomp_len; i = k) {
+	/* Count repeats */
+	k = i + rsz;
+	while (k <= uncomp_len - rsz && !memcmp(&uncomp[i], &uncomp[k], rsz)) {
+	       k += rsz;
+	       if ((k-i)/rsz == 255)
+		   break;
+	}
+
+	if (k-i > rsz) {
+	    /* Duplicates, so RLE */
+	    *out++ = guard;
+	    *out++ = (k-i)/rsz;
+	    for (j = 0; j < rsz; j++)
+		*out++ = uncomp[i+j];
+	} else {
+	    /* No dups, store as is escaping guarding as appropriate */
+	    if ((unsigned char)(uncomp[i]) == guard) {
+		*out++ = guard;
+		*out++ = 0;
+	    } else {
+		*out++ = uncomp[i];
+	    }
+	    k = i+1;
+	}
+    }
+
+    *comp_len = out-comp;
+
+    return comp;
+}
+
+
+/*
+ * Reverses multi-byte run length encoding.
+ *
+ * Arguments:
+ *	comp		Compressed input data
+ *	comp_len	Length of comp data
+ *	uncomp_len	Output: length of uncompressed data
+ *
+ * Returns:
+ *	Uncompressed data if successful
+ *	NULL if not successful
+ */
+char *unxrle(char *comp, int comp_len, int *uncomp_len) {
+    char *uncomp;
+    char *out;
+    int rsz = (unsigned char)comp[1];
+    int guard = (unsigned char)comp[2];
+    unsigned char *in;
+    int unclen = 0, cpos, len;
+    
+    /* Calculate uncompressed length */
+    for (in = (unsigned char *)comp, cpos = 3; cpos < comp_len; unclen++) {
+	if (in[cpos++] == guard) {
+	    if ((len = in[cpos++])) {
+		cpos += rsz;
+		unclen += len*rsz -1;
+	    }
+	}
+    }
+    *uncomp_len = unclen;
+
+    /* Expand */
+    uncomp = out = (char *)malloc(unclen+1);
+    for (in = (unsigned char *)comp, cpos = 3; cpos < comp_len;) {
+	char c;
+	if ((c = in[cpos++]) != guard) {
+	    *out++ = c;
+	} else {
+	    int len = in[cpos++];
+	    if (len) {
+		int i, j;
+		for (i = 0; i < len; i++) {
+		    for (j = 0; j < rsz; j++) {
+			*out++ = in[cpos+j];
+		    }
+		}
+		cpos += rsz;
+	    } else {
+		*out++ = guard;
+	    }
+	}
+    }
+    *out++ = 0;
+
+    return uncomp;
+}
+
+/*
+ * Mutli-byte run length encoding.
+ *
+ * Steps along in words of size 'rsz'. Unlike XRLE above this does run-length
+ * encoding by writing out an additional "length" word every time 2 or more
+ * words in a row are spotted. This removes the need for a guard byte.
+ *
+ * Additionally this method ensures that both input and output formats remain
+ * aligned on words of size 'rsz'.
+ *
+ * Arguments:
+ *	uncomp		Input data
+ *	uncomp_len	Length of input data 'uncomp'
+ *      rsz             Size of blocks to compare for run checking.
+ *	comp_len	Output: length of compressed data
+ *
+ * Returns:
+ *	Compressed data if successful
+ *	NULL if not successful
+ */
+char *xrle2(char *uncomp, int uncomp_len, int rsz, int *comp_len) {
+    char *comp = (char *)malloc(1.4*uncomp_len + rsz);
+    char *last = uncomp;
+    char *out = comp;
+    int i, j, k, run_len = 0;
+
+    *out++ = ZTR_FORM_XRLE2;
+    *out++ = rsz;
+    for (i = 2; i < rsz; i++)
+	*out++ = -40;
+
+    /* FIXME: how to deal with uncomp_len not being a multiple of rsz */
+    for (i = 0; i < uncomp_len; i += rsz) {
+	/* FIXME: use inline #def versions of memcmp/memcpy for speed? */
+	memcpy(out,  &uncomp[i], rsz);
+	out += rsz;
+
+	if (memcmp(last, &uncomp[i], rsz) == 0) {
+	    run_len++;
+	} else {
+	    run_len = 1;
+	    last = &uncomp[i];
+	}
+
+	/* NB: >= 3 is more optimal in many cases */
+	if (run_len >= 2) {
+	    /* Count remaining copies */
+	    for (k = i+rsz; k < uncomp_len && run_len < 257; k += rsz) {
+		if (memcmp(last, &uncomp[k], rsz) != 0)
+		    break;
+		run_len++;
+	    }
+	    run_len -= 2;
+
+	    *out++ = run_len;
+	    for (j = 1; j < rsz; j++) {
+		/* Padding with last reduces entropy compared to padding
+		 * with copies of run_len
+		 */
+		*out++ = last[j];
+	    }
+	    i = k-rsz;
+
+	    last = out-rsz;
+	    run_len = 0;
+	}
+    }
+
+    *comp_len = out-comp;
+
+    return comp;
+}
+
+/*
+ * Reverses multi-byte run length encoding (xrle_new).
+ *
+ * Arguments:
+ *	comp		Compressed input data
+ *	comp_len	Length of comp data
+ *	uncomp_len	Output: length of uncompressed data
+ *
+ * Returns:
+ *	Uncompressed data if successful
+ *	NULL if not successful
+ */
+char *unxrle2(char *comp, int comp_len, int *uncomp_len) {
+    char *out, *last;
+    int out_len, out_alloc, rsz, i, j, run_len;
+
+    out_alloc = comp_len*2; /* just an estimate */
+    out_len = 0;
+    if (NULL == (out = (char *)malloc(out_alloc)))
+	return NULL;
+
+    if (*comp++ != ZTR_FORM_XRLE2)
+	return NULL;
+
+    /* Read rsz and swallow padding */
+    rsz = *comp++;
+    comp_len -= 2;
+    for (i = 2; i < rsz; i++) {
+	comp++;
+	comp_len--;
+    }
+    
+    /* Uncompress */
+    run_len = 0;
+    last = comp;
+    for (i = 0; i < comp_len;) {
+	while (out_len + rsz > out_alloc) {
+	    out_alloc *= 2;
+	    if (NULL == (out = (char *)realloc(out, out_alloc)))
+		return NULL;
+	}
+	memcpy(&out[out_len], &comp[i], rsz);
+
+	if (memcmp(&out[out_len], last, rsz) == 0) {
+	    run_len++;
+	} else {
+	    run_len = 1;
+	}
+
+	i += rsz;
+	out_len += rsz;
+
+	/* NB: >= 3 is more optimal in many cases */
+	if (run_len >= 2) {
+	    /* Count remaining copies */
+	    run_len = (unsigned char)comp[i];
+	    i += rsz;
+
+	    while (out_len + run_len * rsz > out_alloc) {
+		out_alloc *= 2;
+		if (NULL == (out = (char *)realloc(out, out_alloc)))
+		    return NULL;
+	    }
+
+	    for (j = 0; j < run_len; j++) {
+		memcpy(&out[out_len], last, rsz);
+		out_len += rsz;
+	    }
+	    run_len = 0;
+	}
+
+	last = &comp[i-rsz];
+    }
+
+    /* Shrink back down to avoid excessive memory usage */
+    out = realloc(out, out_len);
+    *uncomp_len = out_len;
+
+    return out;
+}
+
+
+/*
+ * ---------------------------------------------------------------------------
+ * ZTR_FORM_DELTA1
+ * ---------------------------------------------------------------------------
+ */
+
+/*
+ * This replaces 'samples' with successive differences between samples.
+ * These implementations support 'level's of 1, 2 and 3.
+ *
+ * NB: This is analogous to our SCF delta_samples1 (etc) function, except that
+ * this function about 40% faster.
+ *
+ * Implementation details taken from Jean Thierry-Mieg's CTF code.
+ */
+
+/*
+ * decorrelate1()
+ *
+ * Produce successive deltas from a 1-byte array.
+ *
+ * Arguments:
+ *	uncomp		Uncompressed data
+ *	uncomp_len	Length of uncompressed data
+ *	level		Differencing level (must be 1, 2 or 3)
+ *	comp_len	Return: where to store new compressed length
+ *
+ * Returns:
+ *	Success: A decorrelated buffer (malloced)
+ *	Failure: NULL
+ */
+char *decorrelate1(char *x_uncomp,
+		   int uncomp_len,
+		   int level,
+		   int *comp_len) {
+    int i, z;
+    int u1 = 0, u2 = 0, u3 = 0;
+    char *comp = (char *)xmalloc(uncomp_len + 2);
+    unsigned char *u_uncomp = (unsigned char *)x_uncomp;
+
+    if (!comp)
+	return NULL;
+
+    comp+=2;
+    switch (level) {
+    case 1:
+	for (i = 0; i < uncomp_len; i++) {
+	    z = u1;
+	    u1 = u_uncomp[i];
+	    comp[i] = u_uncomp[i] - z;
+	}
+	break;
+	
+    case 2:
+	for (i = 0; i < uncomp_len; i++) {
+	    z = 2*u1 - u2;
+	    u2 = u1;
+	    u1 = u_uncomp[i];
+	    comp[i] = u_uncomp[i] - z;
+	}
+	break;
+
+    case 3:
+	for (i = 0; i < uncomp_len; i++) {
+	    z = 3*u1 - 3*u2 + u3;
+	    u3 = u2;
+	    u2 = u1;
+	    u1 = u_uncomp[i];
+	    comp[i] = u_uncomp[i] - z;
+	}
+	break;
+
+    default:
+	return NULL;
+    }
+    comp-=2;
+    comp[0] = ZTR_FORM_DELTA1;
+    comp[1] = level;
+
+    *comp_len = uncomp_len+2;
+
+    return comp;
+}
+
+#define ABS(a) ((a) > 0 ? (a) : -(a))
+
+/* ZTR_FORM_DDELTA1 - experimental */
+char *decorrelate1dyn(char *x_uncomp,
+		      int uncomp_len,
+		      int *comp_len) {
+    int i, j, z[4];
+    int u1 = 0, u2 = 0, u3 = 0;
+    char *comp = (char *)xmalloc(uncomp_len + 2);
+    unsigned char *u_uncomp = (unsigned char *)x_uncomp;
+    int level = 3; /* default level */
+    int last_level = level;
+    int best;
+
+    if (!comp)
+	return NULL;
+
+    comp+=2;
+    for (i = 0; i < uncomp_len; i++) {
+	z[1] = u1;
+	z[2] = 2*u1 - u2;
+	z[3] = 3*u1 - 3*u2 + u3;
+	comp[i] = u_uncomp[i] - z[last_level];
+	best = 10000;
+	for (j = 1; j < 3; j++) {
+	    if (ABS(u_uncomp[i] - z[j]) < best) {
+		best = ABS(u_uncomp[i] - z[j]);
+		last_level = j;
+	    }
+	}
+	u3 = u2;
+	u2 = u1;
+	u1 = u_uncomp[i];
+    }
+    comp-=2;
+    comp[0] = ZTR_FORM_DDELTA1;
+    comp[1] = level;
+
+    *comp_len = uncomp_len+2;
+
+    return comp;
+}
+
+/*
+ * recorrelate1()
+ *
+ * The reverse of decorrelate1()
+ *
+ * Arguments:
+ *	comp		Compressed input data
+ *	comp_len	Length of comp data
+ *	uncomp_len	Output: length of uncompressed data
+ *
+ * Returns:
+ *	Success: uncompressed data
+ *	Failure: NULL
+ */
+char *recorrelate1(char *x_comp,
+		   int comp_len,
+		   int *uncomp_len) {
+    int i, z;
+    int u1 = 0, u2 = 0, u3 = 0;
+    int level = x_comp[1];
+    char *uncomp;
+
+    uncomp = (char *)xmalloc(comp_len-2);
+    if (!uncomp)
+	return NULL;
+
+    x_comp+=2;
+    comp_len-=2;
+    *uncomp_len = comp_len;
+
+    switch (level) {
+    case 1:
+	for (i = 0; i < comp_len; i++) {
+	    z = u1;
+	    u1 = uncomp[i] = x_comp[i] + z;
+	}
+	break;
+
+    case 2:
+	for (i = 0; i < comp_len; i++) {
+	    z = 2*u1 - u2;
+	    u2 = u1;
+	    u1 = uncomp[i] = x_comp[i] + z;
+	}
+	break;
+	
+    case 3:
+	for (i = 0; i < comp_len; i++) {
+	    z = 3*u1 - 3*u2 + u3;
+	    u3 = u2;
+	    u2 = u1;
+	    u1 = uncomp[i] = x_comp[i] + z;
+	}
+	break;
+    }
+
+    return uncomp;
+}
+
+/*
+ * ---------------------------------------------------------------------------
+ * ZTR_FORM_DELTA2
+ * ---------------------------------------------------------------------------
+ */
+
+/*
+ * decorrelate2()
+ *
+ * Produce successive deltas from a 2-byte array (big endian)
+ *
+ * Arguments:
+ *	uncomp		Uncompressed data
+ *	uncomp_len	Length of uncompressed data
+ *	level		Differencing level (must be 1, 2 or 3)
+ *	comp_len	Return: where to store new compressed length
+ *
+ * Returns:
+ *	Success: A decorrelated buffer (malloced)
+ *	Failure: NULL
+ */
+char *decorrelate2(char *x_uncomp,
+		   int uncomp_len,
+		   int level,
+		   int *comp_len) {
+    int i, z, delta;
+    int u1 = 0, u2 = 0, u3 = 0;
+    char *comp = (char *)xmalloc(uncomp_len + 2);
+    unsigned char *u_uncomp = (unsigned char *)x_uncomp;
+
+    if (!comp)
+	return NULL;
+
+    comp+=2;
+    switch (level) {
+    case 1:
+	for (i = 0; i < uncomp_len; i+=2) {
+	    z = u1;
+	    u1 = (u_uncomp[i] << 8) + u_uncomp[i+1];
+	    delta = u1 - z;
+	    comp[i  ] = (delta >> 8) & 0xff;
+	    comp[i+1] = (delta >> 0) & 0xff;
+	}
+	break;
+	
+    case 2:
+	for (i = 0; i < uncomp_len; i+=2) {
+	    z = 2*u1 - u2;
+	    u2 = u1;
+	    u1 = (u_uncomp[i] << 8) + u_uncomp[i+1];
+	    delta = u1 - z;
+	    comp[i  ] = (delta >> 8) & 0xff;
+	    comp[i+1] = (delta >> 0) & 0xff;
+	}
+	break;
+
+    case 3:
+	for (i = 0; i < uncomp_len; i+=2) {
+	    z = 3*u1 - 3*u2 + u3;
+	    u3 = u2;
+	    u2 = u1;
+	    u1 = (u_uncomp[i] << 8) + u_uncomp[i+1];
+	    delta = u1 - z;
+	    comp[i  ] = (delta >> 8) & 0xff;
+	    comp[i+1] = (delta >> 0) & 0xff;
+	}
+	break;
+
+    default:
+	return NULL;
+    }
+    comp-=2;
+    comp[0] = ZTR_FORM_DELTA2;
+    comp[1] = level;
+
+    *comp_len = uncomp_len+2;
+
+    return comp;
+}
+
+char *decorrelate2dyn(char *x_uncomp,
+		      int uncomp_len,
+		      int *comp_len) {
+    int i, j, z[4];
+    int u1 = 0, u2 = 0, u3 = 0;
+    char *comp = (char *)xmalloc(uncomp_len + 2);
+    unsigned char *u_uncomp = (unsigned char *)x_uncomp;
+    int level = 2; /* minimum level */
+    int last_level = level;
+    int best;
+
+    if (!comp)
+	return NULL;
+
+    comp+=2;
+    for (i = 0; i < uncomp_len; i+=2) {
+	z[0] = 0;
+	z[1] = u1;
+	z[2] = 2*u1 - u2;
+	z[3] = 3*u1 - 3*u2 + u3;
+	u3 = u2;
+	u2 = u1;
+	u1 = (u_uncomp[i]<<8) + u_uncomp[i+1];
+	comp[i  ] = ((u1 - z[last_level]) >> 8) & 0xff;
+	comp[i+1] = ((u1 - z[last_level]) >> 0) & 0xff;
+	best = 10000;
+	for (j = level; j < 4; j++) {
+	    if (ABS(u1 - z[j]) < best) {
+		best = ABS(u1 - z[j]);
+		last_level = j;
+	    }
+	}
+    }
+    comp-=2;
+    comp[0] = ZTR_FORM_DDELTA2;
+    comp[1] = level;
+
+    *comp_len = uncomp_len+2;
+
+    return comp;
+}
+
+/*
+ * recorrelate2()
+ *
+ * The reverse of decorrelate2()
+ *
+ * Arguments:
+ *	comp		Compressed input data
+ *	comp_len	Length of comp data
+ *	uncomp_len	Output: length of uncompressed data
+ *
+ * Returns:
+ *	Success: uncompressed data
+ *	Failure: NULL
+ */
+char *recorrelate2(char *x_comp,
+		   int comp_len,
+		   int *uncomp_len) {
+    int i, z;
+    int u1 = 0, u2 = 0, u3 = 0;
+    int level = x_comp[1];
+    char *uncomp;
+    unsigned char *u_comp = (unsigned char *)x_comp;
+
+    uncomp = (char *)xmalloc(comp_len-2);
+    if (!uncomp)
+	return NULL;
+
+    u_comp+=2;
+    comp_len-=2;
+    *uncomp_len = comp_len;
+
+    switch (level) {
+    case 1:
+	for (i = 0; i < comp_len; i+=2) {
+	    z = u1;
+	    u1 = ((u_comp[i] << 8) | u_comp[i+1]) + z;
+	    uncomp[i  ] = (u1 >> 8) & 0xff;
+	    uncomp[i+1] = (u1 >> 0) & 0xff;
+	}
+	break;
+
+    case 2:
+	for (i = 0; i < comp_len; i+=2) {
+	    z = 2*u1 - u2;
+	    u2 = u1;
+	    u1 = ((u_comp[i] << 8) | u_comp[i+1]) + z;
+	    uncomp[i  ] = (u1 >> 8) & 0xff;
+	    uncomp[i+1] = (u1 >> 0) & 0xff;
+	}
+	break;
+	
+    case 3:
+	for (i = 0; i < comp_len; i+=2) {
+	    z = 3*u1 - 3*u2 + u3;
+	    u3 = u2;
+	    u2 = u1;
+	    u1 = ((u_comp[i] << 8) | u_comp[i+1]) + z;
+	    uncomp[i  ] = (u1 >> 8) & 0xff;
+	    uncomp[i+1] = (u1 >> 0) & 0xff;
+	}
+	break;
+    }
+
+    return uncomp;
+}
+
+/*
+ * ---------------------------------------------------------------------------
+ * ZTR_FORM_DELTA4
+ * ---------------------------------------------------------------------------
+ */
+
+/*
+ * decorrelate4()
+ *
+ * Produce successive deltas from a 4-byte array (big endian)
+ *
+ * Arguments:
+ *	uncomp		Uncompressed data
+ *	uncomp_len	Length of uncompressed data
+ *	level		Differencing level (must be 1, 2 or 3)
+ *	comp_len	Return: where to store new compressed length
+ *
+ * Returns:
+ *	Success: A decorrelated buffer (malloced)
+ *	Failure: NULL
+ */
+char *decorrelate4(char *x_uncomp,
+		   int uncomp_len,
+		   int level,
+		   int *comp_len) {
+    int i, z, delta;
+    int u1 = 0, u2 = 0, u3 = 0;
+    char *comp = (char *)xmalloc(uncomp_len + 4);
+    unsigned char *u_uncomp = (unsigned char *)x_uncomp;
+
+    if (!comp)
+	return NULL;
+
+    comp+=4;
+    switch (level) {
+    case 1:
+	for (i = 0; i < uncomp_len; i+=4) {
+	    z = u1;
+	    u1 =(u_uncomp[i  ] << 24) +
+		(u_uncomp[i+1] << 16) +
+		(u_uncomp[i+2] <<  8) +
+		(u_uncomp[i+3] <<  0);
+	    delta = u1 - z;
+	    comp[i  ] = (delta >> 24) & 0xff;
+	    comp[i+1] = (delta >> 16) & 0xff;
+	    comp[i+2] = (delta >>  8) & 0xff;
+	    comp[i+3] = (delta >>  0) & 0xff;
+	}
+	break;
+	
+    case 2:
+	for (i = 0; i < uncomp_len; i+=4) {
+	    z = 2*u1 - u2;
+	    u2 = u1;
+	    u1 =(u_uncomp[i  ] << 24) +
+		(u_uncomp[i+1] << 16) +
+		(u_uncomp[i+2] <<  8) +
+		(u_uncomp[i+3] <<  0);
+	    delta = u1 - z;
+	    comp[i  ] = (delta >> 24) & 0xff;
+	    comp[i+1] = (delta >> 16) & 0xff;
+	    comp[i+2] = (delta >>  8) & 0xff;
+	    comp[i+3] = (delta >>  0) & 0xff;
+	}
+	break;
+
+    case 3:
+	for (i = 0; i < uncomp_len; i+=4) {
+	    z = 3*u1 - 3*u2 + u3;
+	    u3 = u2;
+	    u2 = u1;
+	    u1 =(u_uncomp[i  ] << 24) +
+		(u_uncomp[i+1] << 16) +
+		(u_uncomp[i+2] <<  8) +
+		(u_uncomp[i+3] <<  0);
+	    delta = u1 - z;
+	    comp[i  ] = (delta >> 24) & 0xff;
+	    comp[i+1] = (delta >> 16) & 0xff;
+	    comp[i+2] = (delta >>  8) & 0xff;
+	    comp[i+3] = (delta >>  0) & 0xff;
+	}
+	break;
+
+    default:
+	return NULL;
+    }
+    comp-=4;
+    comp[0] = ZTR_FORM_DELTA4;
+    comp[1] = level;
+    comp[2] = 0; /* dummy - to align on 4-byte boundary */
+    comp[3] = 0; /* dummy - to align on 4-byte boundary */
+
+    *comp_len = uncomp_len+4;
+
+    return comp;
+}
+
+/*
+ * recorrelate4()
+ *
+ * The reverse of decorrelate4()
+ *
+ * Arguments:
+ *	comp		Compressed input data
+ *	comp_len	Length of comp data
+ *	uncomp_len	Output: length of uncompressed data
+ *
+ * Returns:
+ *	Success: uncompressed data
+ *	Failure: NULL
+ */
+char *recorrelate4(char *x_comp,
+		   int comp_len,
+		   int *uncomp_len) {
+    int i, z;
+    int u1 = 0, u2 = 0, u3 = 0;
+    int level = x_comp[1];
+    char *uncomp;
+    unsigned char *u_comp = (unsigned char *)x_comp;
+
+    uncomp = (char *)xmalloc(comp_len-4);
+    if (!uncomp)
+	return NULL;
+
+    u_comp+=4;
+    comp_len-=4;
+    *uncomp_len = comp_len;
+
+    switch (level) {
+    case 1:
+	for (i = 0; i < comp_len; i+=4) {
+	    z = u1;
+	    u1 = z +
+		((u_comp[i  ] << 24) |
+		 (u_comp[i+1] << 16) |
+		 (u_comp[i+2] <<  8) |
+		  u_comp[i+3]);
+	    uncomp[i  ] = (u1 >> 24) & 0xff;
+	    uncomp[i+1] = (u1 >> 16) & 0xff;
+	    uncomp[i+2] = (u1 >>  8) & 0xff;
+	    uncomp[i+3] = (u1 >>  0) & 0xff;
+	}
+	break;
+
+    case 2:
+	for (i = 0; i < comp_len; i+=4) {
+	    z = 2*u1 - u2;
+	    u2 = u1;
+	    u1 = z +
+		((u_comp[i  ] << 24) |
+		 (u_comp[i+1] << 16) |
+		 (u_comp[i+2] <<  8) |
+		  u_comp[i+3]);
+	    uncomp[i  ] = (u1 >> 24) & 0xff;
+	    uncomp[i+1] = (u1 >> 16) & 0xff;
+	    uncomp[i+2] = (u1 >>  8) & 0xff;
+	    uncomp[i+3] = (u1 >>  0) & 0xff;
+	}
+	break;
+	
+    case 3:
+	for (i = 0; i < comp_len; i+=4) {
+	    z = 3*u1 - 3*u2 + u3;
+	    u3 = u2;
+	    u2 = u1;
+	    u1 = z +
+		((u_comp[i  ] << 24) |
+		 (u_comp[i+1] << 16) |
+		 (u_comp[i+2] <<  8) |
+		  u_comp[i+3]);
+	    uncomp[i  ] = (u1 >> 24) & 0xff;
+	    uncomp[i+1] = (u1 >> 16) & 0xff;
+	    uncomp[i+2] = (u1 >>  8) & 0xff;
+	    uncomp[i+3] = (u1 >>  0) & 0xff;
+	}
+	break;
+    }
+
+    return uncomp;
+}
+
+
+/*
+ * ---------------------------------------------------------------------------
+ * ZTR_FORM_16TO8
+ * ---------------------------------------------------------------------------
+ */
+
+/*
+ * shrink_16to8()
+ *
+ * Stores an array of 16-bit (big endian) array elements in an 8-bit array.
+ * We assume that most 16-bit elements encode numbers that fit in an 8-bit
+ * value. When not possible, we store a marker followed by the 16-bit value
+ * stored as multiple 8-bit values.
+ *
+ *	uncomp		Uncompressed data
+ *	uncomp_len	Length of uncompressed data (in bytes)
+ *	comp_len	Return: where to store new compressed length
+ *	
+ * Returns:
+ *	Success: An 8-bit array (malloced)
+ *	Failure: NULL
+ */
+char *shrink_16to8(char *x_uncomp, int uncomp_len, int *comp_len) {
+    char *comp;
+    int i, j, i16;
+    signed char *s_uncomp = (signed char *)x_uncomp;
+
+    /* Allocation - worst case is 3 * (uncomp_len/2) + 1 */
+    if (NULL == (comp = (char *)xmalloc(3 * (uncomp_len/2) + 1)))
+	return NULL;
+
+    comp[0] = ZTR_FORM_16TO8;
+    for (i = 0, j = 1; i < uncomp_len; i+=2) {
+	i16 = (s_uncomp[i] << 8) | (unsigned char)s_uncomp[i+1];
+	if (i16 >= -127 && i16 <= 127) {
+	    comp[j++] = i16;
+	} else {
+	    comp[j++] = -128;
+	    comp[j++] = s_uncomp[i];
+	    comp[j++] = s_uncomp[i+1];
+	}
+    }
+
+    /* Reclaim unneeded memory */
+    comp = xrealloc(comp, j);
+    
+    *comp_len = j;
+    return comp;
+}
+
+
+/*
+ * expand_8to16()
+ *
+ * The opposite of the shrink_16to8() function.
+ *
+ *	comp		Compressed input data
+ *	comp_len	Length of comp data (in bytes)
+ *	uncomp_len	Output: length of uncompressed data (in bytes)
+ *	
+ * Returns:
+ *	Success: Uncompressed data (char *)
+ *	Failure: NULL
+ */
+char *expand_8to16(char *x_comp, int comp_len, int *uncomp_len) {
+    int i, j;
+    char *uncomp;
+    signed char *s_comp = (signed char *)x_comp;
+
+    /* Allocation - worst case is twice comp_len */
+    if (NULL == (uncomp = (char *)xmalloc(comp_len*2)))
+	return NULL;
+
+#if 0
+    for (i = 0, j = 1; j < comp_len; i+=2) {
+	if (s_comp[j] != -128) {
+	    uncomp[i  ] = s_comp[j] < 0 ? -1 : 0;
+	    uncomp[i+1] = s_comp[j++];
+	} else {
+	    j++;
+	    uncomp[i  ] = s_comp[j++];
+	    uncomp[i+1] = s_comp[j++];
+	}
+    }
+#endif
+
+    for (i = 0, j = 1; j < comp_len; i+=2) {
+	if (s_comp[j] >= 0) {
+	    uncomp[i  ] = 0;
+	    uncomp[i+1] = s_comp[j++];
+	} else {
+	    if (s_comp[j] != -128) {
+		uncomp[i+1] = s_comp[j++];
+		uncomp[i  ] = -1;
+	    } else {
+		j++;
+		uncomp[i  ] = s_comp[j++];
+		uncomp[i+1] = s_comp[j++];
+	    }
+	}
+    }
+
+    /* Reclaim unneeded memory */
+    uncomp = xrealloc(uncomp, i);
+    
+    *uncomp_len = i;
+    return uncomp;
+}
+
+/*
+ * ---------------------------------------------------------------------------
+ * ZTR_FORM_32TO8
+ * ---------------------------------------------------------------------------
+ */
+
+/*
+ * shrink_32to8()
+ *
+ * Stores an array of 32-bit (big endian) array elements in an 8-bit array.
+ * We assume that most 32-bit elements encode numbers that fit in an 8-bit
+ * value. When not possible, we store a marker followed by the 32-bit value
+ * stored as multiple 8-bit values.
+ *
+ *	uncomp		Uncompressed data
+ *	uncomp_len	Length of uncompressed data (in bytes)
+ *	comp_len	Return: where to store new compressed length
+ *	
+ * Returns:
+ *	Success: An 8-bit array (malloced)
+ *	Failure: NULL
+ */
+char *shrink_32to8(char *x_uncomp, int uncomp_len, int *comp_len) {
+    char *comp;
+    int i, j, i32;
+    signed char *s_uncomp = (signed char *)x_uncomp;
+
+    /* Allocation - worst case is 5 * (uncomp_len/4) + 1 */
+    if (NULL == (comp = (char *)xmalloc(5 * (uncomp_len/4) + 1)))
+	return NULL;
+
+    comp[0] = ZTR_FORM_32TO8;
+    for (i = 0, j = 1; i < uncomp_len; i+=4) {
+	i32 = (s_uncomp[i] << 24) |
+	    (s_uncomp[i+1] << 16) |
+	    (s_uncomp[i+2] <<  8) |
+	    (unsigned char)s_uncomp[i+3];
+	if (i32 >= -127 && i32 <= 127) {
+	    comp[j++] = i32;
+	} else {
+	    comp[j++] = -128;
+	    comp[j++] = s_uncomp[i];
+	    comp[j++] = s_uncomp[i+1];
+	    comp[j++] = s_uncomp[i+2];
+	    comp[j++] = s_uncomp[i+3];
+	}
+    }
+
+    /* Reclaim unneeded memory */
+    comp = xrealloc(comp, j);
+    
+    *comp_len = j;
+    return comp;
+}
+
+/*
+ * expand_8to32()
+ *
+ * The opposite of the shrink_32to8() function.
+ *
+ *	comp		Compressed input data
+ *	comp_len	Length of comp data (in bytes)
+ *	uncomp_len	Output: length of uncompressed data (in bytes)
+ *	
+ * Returns:
+ *	Success: Uncompressed data (char *)
+ *	Failure: NULL
+ */
+char *expand_8to32(char *comp, int comp_len, int *uncomp_len) {
+    int i, j;
+    char *uncomp;
+    signed char *s_comp = (signed char *)comp; 
+
+    /* Allocation - worst case is four times comp_len */
+    if (NULL == (uncomp = (char *)xmalloc(comp_len*4)))
+	return NULL;
+
+    for (i = 0, j = 1; j < comp_len; i+=4) {
+	if (s_comp[j] != -128) {
+	    uncomp[i  ] = s_comp[j] < 0 ? -1 : 0;
+	    uncomp[i+1] = s_comp[j] < 0 ? -1 : 0;
+	    uncomp[i+2] = s_comp[j] < 0 ? -1 : 0;
+	    uncomp[i+3] = s_comp[j++];
+	} else {
+	    j++;
+	    uncomp[i  ] = s_comp[j++];
+	    uncomp[i+1] = s_comp[j++];
+	    uncomp[i+2] = s_comp[j++];
+	    uncomp[i+3] = s_comp[j++];
+	}
+    }
+
+    /* Reclaim unneeded memory */
+    uncomp = xrealloc(uncomp, i);
+    
+    *uncomp_len = i;
+    return uncomp;
+}
+
+/*
+ * ---------------------------------------------------------------------------
+ * ZTR_FORM_FOLLOW1
+ * ---------------------------------------------------------------------------
+ */
+static int follow_tab[256][256];
+char *follow1(char *x_uncomp,
+	      int uncomp_len,
+	      int *comp_len) {
+    char *comp = (char *)xmalloc(uncomp_len + 256 + 1);
+    unsigned char *u_uncomp = (unsigned char *)x_uncomp;
+    signed char *s_uncomp = ((signed char *)x_uncomp);
+    int i, j;
+    char next[256];
+    int count[256];
+
+    if (!comp)
+	return NULL;
+
+    /* Count di-freqs */
+    memset(follow_tab, 0, 256*256*sizeof(int));
+#if 0
+    for (i = 0; i < uncomp_len-1; i++)
+	follow_tab[u_uncomp[i]][u_uncomp[i+1]]++;
+
+    /* Pick the most frequent next byte from the preceeding byte */
+    for (i = 0; i < 256; i++) {
+	int bestval, bestind;
+
+	bestval = bestind = 0;
+	for (j = 0; j < 256; j++) {
+	    if (follow_tab[i][j] > bestval) {
+		bestval = follow_tab[i][j];
+		bestind = j;
+	    }
+	}
+	next[i] = bestind;
+    }
+#endif
+    memset(next, 0, 256*sizeof(*next));
+    memset(count, 0, 256*sizeof(*count));
+    /* Pick the most frequent next byte from the preceeding byte */
+    for (i = 0; i < uncomp_len-1; ) {
+	int cur = u_uncomp[i];
+	int nxt = u_uncomp[++i];
+	int folcnt = ++follow_tab[cur][nxt];
+	if (folcnt > count[cur]) {
+	    count[cur] = folcnt;
+	    next[cur] = nxt;
+	}
+    }
+
+    j = 0;
+    comp[j++] = ZTR_FORM_FOLLOW1;
+
+    /* Output 'next' array */
+    for (i = 0; i < 256; i++, j++)
+	comp[j] = next[i];
+
+    /* Output new 'uncomp' as next['uncomp'] */
+    comp[j++] = u_uncomp[0];
+    for (i = 1; i < uncomp_len; i++, j++) {
+	comp[j] = next[u_uncomp[i-1]] - s_uncomp[i];
+    }
+    *comp_len = j;
+
+    return comp;
+}
+
+char *unfollow1(char *x_comp,
+		int comp_len,
+		int *uncomp_len) {
+    unsigned char *u_uncomp;
+    int i, j;
+    char next[256];
+    unsigned char *u_comp = (unsigned char *)x_comp;
+    signed   char *s_comp = (signed   char *)x_comp;
+
+    u_uncomp = (unsigned char *)xmalloc(comp_len-256-1);
+    if (!u_uncomp)
+	return NULL;
+
+    /* Load next[] array */
+    j = 1;
+    for (i = 0; i < 256; i++, j++)
+	next[i] = u_comp[j];
+
+    /* Replace comp[x] with next[comp[x-1]] - comp[x]*/
+    u_uncomp[0] = u_comp[j++];
+
+    comp_len -= 257;
+    s_comp   += 257;
+    for (i = 1; i < comp_len; i++) {
+	u_uncomp[i] = next[u_uncomp[i-1]] - s_comp[i];
+    }
+
+    *uncomp_len = i;
+
+    return (char *)u_uncomp;
+}
+
+
+/*
+ * ---------------------------------------------------------------------------
+ * ZTR_FORM_CHEB445
+ * ---------------------------------------------------------------------------
+ */
+
+#if 0
+/*
+ * Compresses using chebyshev polynomials to predict the next peak.
+ * Based on around 96 modern ABI files it compresses by around 5% (varied
+ * between 3.9 and 6.6).
+ */
+
+/*
+ * For now this has been disabled in favour of the integer version below
+ * as we cannot guarantee all systems to have the same floating point
+ * roundings, especially with the final conversion to integer.
+ * (Also, for some unknown reason, the integer version produces smaller
+ * files.)
+ */
+
+char *cheb445comp(char *uncomp, int uncomp_len, int *data_len)
+{
+    int i, k, l, z;
+    int datap;
+    float frac[5];
+    float fz[25];
+    signed short *d16 = (signed short *)uncomp;
+    int nwords = uncomp_len / 2;
+    short *dptr = d16;
+    signed short *data = (signed short *)malloc((nwords+1)*sizeof(short));
+
+    data[0] = le_int2(ZTR_FORM_CHEB445);
+    /* Check for boundary cases */
+    if (nwords <= 4) {
+	switch (nwords) {
+	case 4:
+	    data[4] = be_int2(be_int2(d16[3])-be_int2(d16[2]));
+	case 3:
+	    data[3] = be_int2(be_int2(d16[2])-be_int2(d16[1]));
+	case 2:
+	    data[2] = be_int2(be_int2(d16[1])-be_int2(d16[0]));
+	case 1:
+	    data[1] = be_int2(d16[0]);
+	}
+	*data_len = nwords*2;
+	return (char *)data;
+    }
+
+    /* First 4 values are just direct deltas */
+    data[1] = be_int2(d16[0]);
+    data[2] = be_int2(be_int2(d16[1])-be_int2(d16[0]));
+    data[3] = be_int2(be_int2(d16[2])-be_int2(d16[1]));
+    data[4] = be_int2(be_int2(d16[3])-be_int2(d16[2]));
+    datap = 5;
+
+    /* Initialise - speeds up loop */
+    for (k = 0; k < 5; k++) {
+	float kx = cos(M_PI*(k+0.5)/5)*1.5;
+	frac[k] = (kx + 1.5) - (int)(kx + 1.5);
+    }
+    for (z = l = 0; l < 5; l++) {
+	for (k = 0; k < 5; k++, z++) {
+	    fz[z] = 0.4 * cos(l * M_PI*(k+0.5)/5);
+	}
+    }
+
+    /* Loop */
+    for (i = 0; i < nwords-4; i++) {
+	float dd, y = 10/3.0;
+	float f[5], coef[5];
+	signed short diff;
+	int p;
+	    
+	f[0] = be_int2(dptr[2])*frac[4] + be_int2(dptr[3])*frac[0];
+	f[1] = be_int2(dptr[2])*frac[3] + be_int2(dptr[3])*frac[1];
+	f[2] = be_int2(dptr[1])*frac[2] + be_int2(dptr[2])*frac[2];
+	f[3] = be_int2(dptr[0])*frac[1] + be_int2(dptr[1])*frac[3];
+	f[4] = be_int2(dptr[0])*frac[0] + be_int2(dptr[1])*frac[4];
+    
+	for (z = l = 0; l < 5; l++, z+=5)
+	    coef[l] = f[0] * fz[z+0] +
+		      f[1] * fz[z+1] +
+		      f[2] * fz[z+2] +
+		      f[3] * fz[z+3] +
+		      f[4] * fz[z+4];
+
+	dd = y*coef[3]+coef[2];
+	p = 0.5 + 5/3.0*(y*dd-coef[3]+coef[1])-dd+coef[0]/2.0;
+
+	if (p < 0) p = 0;
+	diff = be_int2(dptr[4]) - p;
+	data[datap++] = be_int2(diff);
+
+	dptr++;
+    }
+
+    *data_len = datap*2;
+
+    return (char *)data;
+}
+
+char *cheb445uncomp(char *comp, int comp_len, int *uncomp_len)
+{
+    int i, k, l, z;
+    float frac[5];
+    float fz[25];
+    signed short *d16 = (signed short *)comp;
+    int nwords = comp_len / 2;
+    signed short *data = (signed short *)xmalloc(comp_len);
+    short *dptr = data, *dptr2 = d16;
+
+    /* Check for boundary cases */
+    if (nwords <= 3) {
+	switch (nwords) {
+	case 3:
+	    data[0] = be_int2(d16[1]);
+	    data[1] = be_int2(be_int2(d16[2])+be_int2(data[0]));
+	    data[2] = be_int2(be_int2(d16[3])+be_int2(data[1]));
+	    break;
+	case 2:
+	    data[0] = be_int2(d16[1]);
+	    data[1] = be_int2(be_int2(d16[2])+be_int2(data[0]));
+	    break;
+	case 1:
+	    data[0] = be_int2(d16[1]);
+	    break;
+	}
+	*uncomp_len = (nwords-1)*2;
+	return (char *)data;
+    }
+
+    /* First 3 values are just direct deltas */
+    data[0] = be_int2(d16[1]);
+    data[1] = be_int2(be_int2(d16[2])+be_int2(data[0]));
+    data[2] = be_int2(be_int2(d16[3])+be_int2(data[1]));
+    data[3] = be_int2(be_int2(d16[4])+be_int2(data[2]));
+    dptr2 += 5;
+
+    /* Initialise - speeds up loop */
+    for (k = 0; k < 5; k++) {
+	float kx = cos(M_PI*(k+0.5)/5)*1.5;
+	frac[k] = (kx + 1.5) - (int)(kx + 1.5);
+    }
+    for (z = l = 0; l < 5; l++) {
+	for (k = 0; k < 5; k++, z++) {
+	    fz[z] = 0.4 * cos(l * M_PI*(k+0.5)/5);
+	}
+    }
+
+    /* Loop */
+    for (i = 0; i < nwords-3; i++) {
+	float dd, y = 10/3.0;
+	float f[5], coef[5];
+	signed short diff;
+	int p;
+	    
+	f[0] = be_int2(dptr[2])*frac[4] + be_int2(dptr[3])*frac[0];
+	f[1] = be_int2(dptr[2])*frac[3] + be_int2(dptr[3])*frac[1];
+	f[2] = be_int2(dptr[1])*frac[2] + be_int2(dptr[2])*frac[2];
+	f[3] = be_int2(dptr[0])*frac[1] + be_int2(dptr[1])*frac[3];
+	f[4] = be_int2(dptr[0])*frac[0] + be_int2(dptr[1])*frac[4];
+    
+	for (z = l = 0; l < 5; l++, z+=5)
+	    coef[l] = f[0] * fz[z+0] +
+		      f[1] * fz[z+1] +
+		      f[2] * fz[z+2] +
+		      f[3] * fz[z+3] +
+		      f[4] * fz[z+4];
+
+	dd = y*coef[3]+coef[2];
+	p = 0.5 + 5/3.0*(y*dd-coef[3]+coef[1])-dd+coef[0]/2.0;
+
+	if (p < 0) p = 0;
+	diff = be_int2(*dptr2) + p;
+	dptr[4] = be_int2(diff);
+
+	dptr++;
+	dptr2++;
+    }
+
+    *uncomp_len = (nwords-1)*2;
+    return (char *)data;
+}
+#endif
+
+/*
+ * ---------------------------------------------------------------------------
+ * ZTR_FORM_ICHEB
+ * ---------------------------------------------------------------------------
+ */
+
+/*
+ * Integer versions of the chebyshev polynomial compressor. This uses
+ * the polynomials to predict the next peak from the preceeding 3.
+ * Tested on 100 ABI-3700, Megabace and Licor files it compressed by
+ * around 7-8%. (Oddly this is slightly more than the floating point
+ * version.)
+ *
+ * These require 32-bit integers and have code to make sure that arithmetic
+ * does not overflow this.
+ */
+#define CH1 150
+#define CH2 105
+char *ichebcomp(char *uncomp, int uncomp_len, int *data_len)
+{
+    int i, l, z;
+    int datap;
+    int frac[5] = {139,57,75,93,11};
+    int fz[20] = {42, 42, 42, 42, 42,
+		  39, 24,  0,-24,-39,
+		  33,-12,-42,-12, 33,
+		  24,-39,  0, 39,-24};
+    int dfac;
+    signed short *d16 = (signed short *)uncomp;
+    int nwords = uncomp_len / 2;
+    short *dptr = d16;
+    signed short *data = (signed short *)malloc((nwords+1)*sizeof(short));
+
+    data[0] = le_int2(ZTR_FORM_ICHEB);
+    /* Check for boundary cases */
+    if (nwords <= 4) {
+	switch (nwords) {
+	case 4:
+	    data[4] = be_int2(be_int2(d16[3])-be_int2(d16[2]));
+	case 3:
+	    data[3] = be_int2(be_int2(d16[2])-be_int2(d16[1]));
+	case 2:
+	    data[2] = be_int2(be_int2(d16[1])-be_int2(d16[0]));
+	case 1:
+	    data[1] = be_int2(d16[0]);
+	}
+	*data_len = nwords*2;
+	return (char *)data;
+    }
+
+    /* First 4 values are just direct deltas */
+    data[1] = be_int2(d16[0]);
+    data[2] = be_int2(be_int2(d16[1])-be_int2(d16[0]));
+    data[3] = be_int2(be_int2(d16[2])-be_int2(d16[1]));
+    data[4] = be_int2(be_int2(d16[3])-be_int2(d16[2]));
+    datap = 5;
+
+    /* Loop */
+    for (i = 4; i < nwords; i++) {
+	int dd, f[5];
+	signed int coef[4];
+	signed short diff;
+	int p;
+
+	/*
+	 * FIXME: As an alternative to the range checking below, if we
+	 * scale dptr[X] such that it's never higher than 2800 then
+	 * the 32-bit arithmetic will never overflow. Practically speaking,
+	 * all observed ABI and Megabace files have vales up to 1600 only.
+	 */
+
+	/*
+	 * frac[N] is always paired with frac[4-N], summing to 1.0 - or
+	 * 150 when scaled.
+	 * Hence f[0] has range 0 to 65536*150.
+	 */
+	f[0] = ((unsigned short)be_int2(dptr[2]))*frac[4] +
+	       ((unsigned short)be_int2(dptr[3]))*frac[0];
+	f[1] = ((unsigned short)be_int2(dptr[2]))*frac[3] +
+	       ((unsigned short)be_int2(dptr[3]))*frac[1];
+	f[2] = ((unsigned short)be_int2(dptr[1]))*frac[2] +
+	       ((unsigned short)be_int2(dptr[2]))*frac[2];
+	f[3] = ((unsigned short)be_int2(dptr[0]))*frac[1] +
+	       ((unsigned short)be_int2(dptr[1]))*frac[3];
+	f[4] = ((unsigned short)be_int2(dptr[0]))*frac[0] +
+	       ((unsigned short)be_int2(dptr[1]))*frac[4];
+
+	/*
+	 * fz[z+0..5] sums to no more than 210 (5*42) and no less than 0.
+	 * Therefore coef[l] has range 0 to 65536*150*210, which (just)
+	 * fits in 31-bits, plus 1 for the sign.
+	 */
+	for (z = l = 0; l < 4; l++, z+=5)
+	    coef[l] = (f[0] * fz[z+0] +
+		       f[1] * fz[z+1] +
+		       f[2] * fz[z+2] +
+		       f[3] * fz[z+3] +
+		       f[4] * fz[z+4]);
+
+	/*
+	 * computing p requires at most a temporary variable of 
+	 * 24.1 * coef, but coef may be a full 32-bit integer.
+	 * If coef is sufficiently close to cause an integer overflow then
+	 * we scale it down.
+	 */
+	{
+	    int max = 0;
+
+	    for (l = 0; l < 4; l++) {
+		if (max < ABS(coef[l]))
+		    max = ABS(coef[l]);
+	    }
+
+    
+	    if (max > 1<<26) {
+		dfac = max / (1<<26) + 1;
+		for (l = 0; l < 4; l++)
+		    coef[l] /= dfac;
+	    } else {
+		dfac = 1;
+	    }
+	}
+
+	dd = (coef[3]/3)*10+coef[2];
+	p = ((((dd/3)*10-coef[3]+coef[1])/3)*5-dd+coef[0]/2)/(CH1*CH2);
+	p *= dfac;
+
+	if (p < 0) p = 0;
+	diff = be_int2(dptr[4]) - p;
+	data[datap++] = be_int2(diff);
+
+	dptr++;
+    }
+
+    *data_len = datap*2;
+
+    return (char *)data;
+}
+
+char *ichebuncomp(char *comp, int comp_len, int *uncomp_len)
+{
+    int i, l, z;
+    int frac[5] = {139,57,75,93,11};
+    int fz[20] = {42, 42, 42, 42, 42,
+		  39, 24,  0,-24,-39,
+		  33,-12,-42,-12, 33,
+		  24,-39,  0, 39,-24};
+    signed short *d16 = (signed short *)comp;
+    int nwords = comp_len / 2 - 1;
+    signed short *data = (signed short *)xmalloc(comp_len);
+    short *dptr = data, *dptr2 = d16;
+    int dfac;
+
+    /* Check for boundary cases */
+    if (nwords <= 4) {
+	switch (nwords) {
+	case 4:
+	    data[0] = be_int2(d16[1]);
+	    data[1] = be_int2(be_int2(d16[2])+be_int2(data[0]));
+	    data[2] = be_int2(be_int2(d16[3])+be_int2(data[1]));
+	    data[3] = be_int2(be_int2(d16[4])+be_int2(data[2]));
+	    break;
+	case 3:
+	    data[0] = be_int2(d16[1]);
+	    data[1] = be_int2(be_int2(d16[2])+be_int2(data[0]));
+	    data[2] = be_int2(be_int2(d16[3])+be_int2(data[1]));
+	    break;
+	case 2:
+	    data[0] = be_int2(d16[1]);
+	    data[1] = be_int2(be_int2(d16[2])+be_int2(data[0]));
+	    break;
+	case 1:
+	    data[0] = be_int2(d16[1]);
+	    break;
+	}
+	*uncomp_len = nwords*2;
+	return (char *)data;
+    }
+
+    /* First 4 values are just direct deltas */
+    data[0] = be_int2(d16[1]);
+    data[1] = be_int2(be_int2(d16[2])+be_int2(data[0]));
+    data[2] = be_int2(be_int2(d16[3])+be_int2(data[1]));
+    data[3] = be_int2(be_int2(d16[4])+be_int2(data[2]));
+    dptr2 += 5;
+
+    /* Loop */
+    for (i = 4; i < nwords; i++) {
+	int dd, coef[5], f[5];
+	signed short diff;
+	int p;
+	    
+	f[0] = ((unsigned short)be_int2(dptr[2]))*frac[4] +
+	       ((unsigned short)be_int2(dptr[3]))*frac[0];
+	f[1] = ((unsigned short)be_int2(dptr[2]))*frac[3] +
+	       ((unsigned short)be_int2(dptr[3]))*frac[1];
+	f[2] = ((unsigned short)be_int2(dptr[1]))*frac[2] +
+	       ((unsigned short)be_int2(dptr[2]))*frac[2];
+	f[3] = ((unsigned short)be_int2(dptr[0]))*frac[1] +
+	       ((unsigned short)be_int2(dptr[1]))*frac[3];
+	f[4] = ((unsigned short)be_int2(dptr[0]))*frac[0] +
+	       ((unsigned short)be_int2(dptr[1]))*frac[4];
+    
+	for (z = l = 0; l < 4; l++, z+=5)
+	    coef[l] = f[0] * fz[z+0] +
+		      f[1] * fz[z+1] +
+		      f[2] * fz[z+2] +
+		      f[3] * fz[z+3] +
+		      f[4] * fz[z+4];
+
+	/*
+	 * computing p requires at most a temporary variable of 
+	 * 24.1 * coef, but coef may be a full 32-bit integer.
+	 * If coef is sufficiently close to cause an integer overflow then
+	 * we scale it down.
+	 */
+	{
+	    int max = 0;
+
+	    for (l = 0; l < 4; l++) {
+		if (max < ABS(coef[l]))
+		    max = ABS(coef[l]);
+	    }
+
+    
+	    if (max > 1<<26) {
+		dfac = max / (1<<26) + 1;
+		for (l = 0; l < 4; l++)
+		    coef[l] /= dfac;
+	    } else {
+		dfac = 1;
+	    }
+	}
+
+	dd = (coef[3]/3)*10+coef[2];
+	p = ((((dd/3)*10-coef[3]+coef[1])/3)*5-dd+coef[0]/2)/(CH1*CH2);
+	p *= dfac;
+
+	if (p < 0) p = 0;
+	diff = be_int2(*dptr2) + p;
+	dptr[4] = be_int2(diff);
+
+	dptr++;
+	dptr2++;
+    }
+
+    *uncomp_len = nwords*2;
+    return (char *)data;
+}
+
+/*
+ * ---------------------------------------------------------------------------
+ * ZTR_FORM_LOG
+ * ---------------------------------------------------------------------------
+ */
+
+/*
+ * This is a LOSSY compression. It replaces N with 10 * log2(N).
+ * (Just an idea, and not a great one it seems.)
+ */
+char *log2_data(char *x_uncomp,
+		int uncomp_len,
+		int *comp_len) {
+    int i, u1, l1;
+    char *comp = (char *)xmalloc(uncomp_len + 2);
+    unsigned char *u_uncomp = (unsigned char *)x_uncomp;
+    
+    if (!comp)
+	return NULL;
+
+    comp+=2;
+    for (i = 0; i < uncomp_len; i+=2) {
+	u1 =(u_uncomp[i  ] <<  8) +
+	    (u_uncomp[i+1] <<  0);
+	l1 = (int)(10 * log(u1+1) / log(2));
+	comp[i  ] = (l1 >> 8) & 0xff;
+	comp[i+1] = (l1 >> 0) & 0xff;
+    }
+
+    comp-=2;
+    comp[0] = ZTR_FORM_LOG2;
+    comp[1] = 0; /* dummy - to align on 2-byte boundary */
+
+    *comp_len = uncomp_len+2;
+
+    return comp;
+}
+
+char *unlog2_data(char *x_comp,
+		  int comp_len,
+		  int *uncomp_len) {
+    int i, u1, l1;
+    char *uncomp;
+    unsigned char *u_comp = (unsigned char *)x_comp;
+
+    uncomp = (char *)xmalloc(comp_len-2);
+    if (!uncomp)
+	return NULL;
+
+    u_comp+=2;
+    comp_len-=2;
+    *uncomp_len = comp_len;
+
+    for (i = 0; i < comp_len; i+=2) {
+	l1 = ((u_comp[i  ] << 8) |
+	      (u_comp[i+1] << 0));
+	u1 = (int)pow(2.0, l1/10.0)-1;
+	uncomp[i  ] = (u1 >> 8) & 0xff;
+	uncomp[i+1] = (u1 >> 0) & 0xff;
+    }
+
+    return uncomp;
+}
+
+/*
+ * ---------------------------------------------------------------------------
+ * ZTR_FORM_STHUFF
+ * ---------------------------------------------------------------------------
+ */
+
+/*
+ * Implements compression using a set of static huffman codes stored using
+ * the Deflate algorithm (and so in this respect it's similar to zlib).
+ *
+ * The huffman codes though can be previously stored in the ztr object
+ * using ztr_add_hcode(). "cset" indicates which numbered stored huffman
+ * code set is to be used, or passing zero will use inline codes (ie they
+ * are stored in the data stream itself, just as in standard deflate).
+ *
+ * Arguments:
+ *	ztr		ztr_t pointer; used to find stored code-sets
+ *	uncomp		The uncompressed input data
+ *	uncomp_len	Length of uncomp
+ *	cset		Stored code-set number, zero for inline
+ *	recsz		Record size - only used when cset == 0.
+ *	comp_len	Output: length of compressed data
+ *
+ * Returns:
+ *	Compressed data stream if successful + comp_len
+ *      NULL on failure
+ */
+char *sthuff(ztr_t *ztr, char *uncomp, int uncomp_len, 
+	     int cset, int recsz, int *comp_len) {
+    block_t *blk = block_create(NULL, 2);
+    unsigned char bytes[2];
+    huffman_codeset_t *c = NULL;
+    unsigned char *comp = NULL;
+    ztr_hcode_t *hc = NULL;
+
+    if (cset >= CODE_USER) {
+	if (NULL == (hc = ztr_find_hcode(ztr, cset)))
+	    return NULL;
+	c = hc->codes;
+    } else if (cset != CODE_INLINE) {
+	c = generate_code_set(cset, 1, NULL, 0, 1, MAX_CODE_LEN, 0);
+    }
+
+    if (!c) {
+	/* No cached ones found, so inline some instead */
+	cset = 0;
+	c = generate_code_set(0, recsz, (unsigned char *)uncomp, uncomp_len, 1,
+			      MAX_CODE_LEN, 0);
+    }
+
+    bytes[0] = ZTR_FORM_STHUFF;
+    bytes[1] = cset;
+    store_bytes(blk, bytes, 2);
+
+    if (hc) {
+	if (!c->blk) {
+	    c->blk = block_create(NULL, 2);
+	    store_codes(c->blk, c, 1);
+	}
+	blk->bit = c->blk->bit;
+    } else {
+	store_codes(blk, c, 1);
+    }
+
+    /*
+    {int i;
+    for (i = 0; i < c->ncodes; i++) {
+	output_code_set(stderr, c->codes[i]);
+    }}
+    */
+
+
+    /*
+     * Unless CODE_INLINE, all we wanted to know is what bit number
+     * to start on. The above is therefore somewhat inefficient.
+     */
+    if (cset != 0) {
+	blk->byte = 2;
+	memset(&blk->data[2], 0, blk->alloc - 2);
+    }
+
+    if (0 == huffman_multi_encode(blk, c, cset,
+			    (unsigned char *)uncomp, uncomp_len)) {
+	comp = blk->data;
+	*comp_len = blk->byte + (blk->bit != 0);
+	block_destroy(blk, 1);
+    }
+
+    if (cset == 0)
+	huffman_codeset_destroy(c);
+
+    return (char *)comp;
+}
+
+char *unsthuff(ztr_t *ztr, char *comp, int comp_len, int *uncomp_len) {
+    int cset = (unsigned char)(comp[1]);
+    huffman_codeset_t *cs = NULL, *cs_free = NULL;
+    block_t *blk_in = block_create(NULL, comp_len),
+	*blk_out = block_create(NULL, 1000);
+    int bfinal = 1, bit_num = 0;
+    char *uncomp;
+
+    if (cset >= CODE_USER) {
+	/* Scans through HUFF chunks */
+	ztr_hcode_t *hc = ztr_find_hcode(ztr, cset);
+	if (!hc)
+	    return NULL;
+
+	cs = hc->codes;
+	bit_num = cs->bit_num;
+	blk_in->bit = 0;
+    } else if (cset > 0) {
+	/* Create some temporary huffman_codes to stringify */
+	cs_free = cs = generate_code_set(cset, 1, NULL, 0, 1, MAX_CODE_LEN, 0);
+	if (!cs)
+	    return NULL;
+
+	bit_num = cs->bit_num;
+	blk_in->bit = 0;
+    } /* else inline codes */
+
+    /*
+     * We need to know at what bit the huffman codes would have ended on
+     * so we can store our huffman encoded symbols immediately following it.
+     * For speed though this bit-number is cached.
+     */
+    blk_in->data[blk_in->byte++] |= *(comp+2);
+    store_bytes(blk_in, (unsigned char *)comp+3, comp_len-3);
+
+
+    /* Rewind */
+    blk_in->byte = 0;
+    blk_in->bit = bit_num;
+
+    do {
+	block_t *out;
+
+	/*
+	 * We're either at the start of a block with codes to restore
+	 * (cset == INLINE or the 2nd onwards block) or we've already
+	 * got some codes in cs and we're at the position where huffman
+	 * encoded symbols are stored. 
+	 */
+	if (!cs)
+	    if (NULL == (cs = cs_free = restore_codes(blk_in, &bfinal)))
+		return NULL;
+
+	/*
+	{int i;
+	for (i = 0; i < cs->ncodes; i++) {
+	    output_code_set(stderr, cs->codes[i]);
+	}}
+	*/
+
+	if (NULL == (out = huffman_multi_decode(blk_in, cs))) {
+	    huffman_codeset_destroy(cs);
+	    return NULL;
+	}
+
+	/* Could optimise this for the common case of only 1 block */
+	store_bytes(blk_out, out->data, out->byte);
+	block_destroy(out, 0);
+	if (cs_free)
+	    huffman_codeset_destroy(cs_free);
+	cs = cs_free = NULL;
+    } while (!bfinal);
+
+    *uncomp_len = blk_out->byte;
+    uncomp = (char *)blk_out->data;
+
+    block_destroy(blk_in, 0);
+    block_destroy(blk_out, 1);
+
+    return uncomp;
+}
+
+
+#ifndef NDEBUG
+#define SYM_EOF 256
+static void output_code_set(FILE *fp, huffman_codes_t *cds) {
+    int i, j;
+    int nbits_in = 0, nbits_out = 0;
+    huffman_code_t *codes = cds->codes;
+    int ncodes = cds->ncodes;
+
+    fprintf(fp, "static huffman_code_t codes_FIXME[] = {\n");
+    for (i = j = 0; i < ncodes; i++) {
+	nbits_out += codes[i].nbits * codes[i].freq;
+	nbits_in  += 8*codes[i].freq;
+	if (j == 0)
+	    fprintf(fp, "    ");
+	if (codes[i].symbol == SYM_EOF) {
+	    fprintf(fp, "{SYM_EOF,%3d}, ", codes[i].nbits);
+	    j = 10;
+	} else {
+	    if (isalnum(codes[i].symbol)) {
+		fprintf(fp, "{'%c',%3d}, ", codes[i].symbol, codes[i].nbits);
+	    } else {
+		fprintf(fp, "{%3d,%3d}, ", codes[i].symbol, codes[i].nbits);
+	    }
+	}
+	j++;
+	
+	if (j >= 6) {
+	    fputc('\n', fp);
+	    j = 0;
+	}
+    }
+    if (j)
+	fputc('\n', fp);
+    fprintf(fp, "};\n");
+    fprintf(fp, "/* Expected compression to %f of input */\n",
+	    (double)nbits_out/nbits_in);
+}
+#endif
+
+/*
+ * Reorders quality data from its RAW format to an interleaved 4-byte
+ * aligned format.
+ *
+ * Starting with sequence A1 C2 G3 the raw format is quality of called
+ * bases followed by quality of remaining bases in triplets per base:
+ * 0 (RAW format)
+ * Q(A1) Q(C2) Q(G3)
+ * Q(C1) Q(G1) Q(T1) 
+ * Q(A2) Q(G2) Q(T2) 
+ * Q(A3) Q(C3) Q(T3) 
+ *
+ * We reorder it to:
+ * ZTR_FORM_QSHIFT <any> <any> 0(raw)
+ * Q(A1) Q(C1) Q(G1) Q(T1)
+ * Q(C2) Q(A2) Q(G2) Q(T2)
+ * Q(G3) Q(A3) Q(C3) Q(T3)
+ * 
+ * Returns shifted data on success
+ *         NULL on failure
+ */
+char *qshift(char *qold, int qlen, int *new_len) {
+    int i, j, k;
+    char *qnew;
+    int nbases;
+
+    /*
+     * Correct input is raw encoding + 4x nbases bytes
+     */
+    if ((qlen-1)%4 != 0 || *qold != 0)
+	return NULL;
+
+    nbases = (qlen-1)/4;
+    qnew = (char *)malloc((nbases+1)*4);
+    qnew[0] = ZTR_FORM_QSHIFT; /* reorder code */
+    qnew[1] = -40;  /* pad */
+    qnew[2] = -40;  /* pad */
+    qnew[3] = qold[0];
+
+    for (i = 0, j = 4, k = nbases; i < nbases; i++, j+=4, k+=3) {
+	qnew[j  ] = qold[1+i  ];
+	qnew[j+1] = qold[1+k  ];
+	qnew[j+2] = qold[1+k+1];
+	qnew[j+3] = qold[1+k+2];
+    }
+
+    *new_len = (nbases+1)*4;
+    return qnew;
+}
+
+/*
+ * The opposite transform from qshift() above.
+ *
+ * Returns unshifted data on success
+ *         NULL on failure.
+ */
+char *unqshift(char *qold, int qlen, int *new_len) {
+    int i, j, k;
+    char *qnew;
+    int nbases;
+
+    /*
+     * Correct input is 4x (nbases+1) bytes
+     */
+    if (qlen%4 != 0 || *qold != ZTR_FORM_QSHIFT)
+	return NULL;
+
+    nbases = qlen/4-1;
+    qnew = (char *)malloc(nbases*4+1);
+    qnew[0] = 0; /* raw byte */
+
+    for (i = 0, j = 4, k = nbases; i < nbases; i++, j+=4, k+=3) {
+	qnew[1+i  ] = qold[j  ];
+	qnew[1+k  ] = qold[j+1];
+	qnew[1+k+1] = qold[j+2];
+	qnew[1+k+2] = qold[j+3];
+    }
+
+    *new_len = nbases*4+1;
+    return qnew;
+}
+
+/*
+ * Given a sequence ACTG this shifts trace data from the order:
+ *
+ *     A1A2A3A4 C1C2C3C4 G1G2G3G4 T1T2T3T4
+ *
+ * to
+ *
+ *     A1C1G1T1 C2A2G2T2 T3A3C3G3 G4C4C4T4
+ *
+ * Ie for each base it ouputs the signal for the called base first
+ * followed by the remaining 3 signals in A,C,G,T order (minus the
+ * called signal already output).
+ */
+
+/*
+ * NCBI uses a rotation mechanism. Thus instead of converting acGt (G
+ * called) to Gact they produce Gtac.
+ *
+ * Given 4 columns of data the two schemes produce value orderings as:
+ *
+ * Rotate: Acgt       Shift: Acgt
+ *         Cgta              Cagt
+ *         Gtac              Gact
+ *         Tacg              Tacg
+ *
+ * As a consequence any channel bias for a/c/g/t is better preserved
+ * by shifting than it is by rotating as each column (except #1) are
+ * only populated by two base types and 2 of those columns are on a
+ * 3:1 ratio.
+ */
+/* #define ROTATE_INSTEAD */
+char *tshift(ztr_t *ztr, char *told_c, int tlen, int *new_len) {
+    int nc, i;
+    ztr_chunk_t **base = ztr_find_chunks(ztr, ZTR_TYPE_BASE, &nc);
+    char *bases;
+    int nbases;
+    unsigned short *tnew, *told;
+
+    if (nc == 0)
+	return NULL;
+
+    if (*told_c != 0)
+	return NULL; /* assume RAW format trace input */
+
+    /* Use last BASE chunk if multiple are present */
+    /* FIXME: ensure uncompressed first */
+    bases  = base[nc-1]->data+1;
+    nbases = base[nc-1]->dlength-1;
+
+    if (nbases != (tlen-2)/8) {
+	fprintf(stderr, "Mismatch in number of base calls to samples\n");
+	return NULL;
+    }
+
+    /* Allocate and initialise header */
+    told = ((unsigned short *)told_c) + 1;
+    *new_len = (nbases*4+4) * sizeof(*tnew);
+    tnew = (unsigned short *)malloc(*new_len);
+    for (i = 0; i < 4; i++) {
+	tnew[i] = 0;
+    }
+    ((char *)tnew)[0] = ZTR_FORM_TSHIFT;
+
+#ifdef ROTATE_INSTEAD
+    /* Reorder */
+    for (i = 0; i < nbases; i++) {
+	switch(bases[i]) {
+	case 'T':
+	    tnew[4+i*4+0] = told[3*nbases+i]; /* TACG */
+	    tnew[4+i*4+1] = told[0*nbases+i];
+	    tnew[4+i*4+2] = told[1*nbases+i];
+	    tnew[4+i*4+3] = told[2*nbases+i];
+	    break;
+	case 'G':
+	    tnew[4+i*4+0] = told[2*nbases+i]; /* GTAC */
+	    tnew[4+i*4+1] = told[3*nbases+i];
+	    tnew[4+i*4+2] = told[0*nbases+i];
+	    tnew[4+i*4+3] = told[1*nbases+i];
+	    break;
+	case 'C':
+	    tnew[4+i*4+0] = told[1*nbases+i]; /* CGTA */
+	    tnew[4+i*4+1] = told[2*nbases+i];
+	    tnew[4+i*4+2] = told[3*nbases+i];
+	    tnew[4+i*4+3] = told[0*nbases+i];
+	    break;
+	default:
+	    tnew[4+i*4+0] = told[0*nbases+i]; /* ACGT */
+	    tnew[4+i*4+1] = told[1*nbases+i];
+	    tnew[4+i*4+2] = told[2*nbases+i];
+	    tnew[4+i*4+3] = told[3*nbases+i];
+	    break;
+	}
+    }
+#else
+    /* Reorder */
+    for (i = 0; i < nbases; i++) {
+	switch(bases[i]) {
+	case 'T':
+	    tnew[4+i*4+0] = told[3*nbases+i]; /* TACG */
+	    tnew[4+i*4+1] = told[0*nbases+i];
+	    tnew[4+i*4+2] = told[1*nbases+i];
+	    tnew[4+i*4+3] = told[2*nbases+i];
+	    break;
+	case 'G':
+	    tnew[4+i*4+0] = told[2*nbases+i]; /* GACT */
+	    tnew[4+i*4+1] = told[0*nbases+i];
+	    tnew[4+i*4+2] = told[1*nbases+i];
+	    tnew[4+i*4+3] = told[3*nbases+i];
+	    break;
+	case 'C':
+	    tnew[4+i*4+0] = told[1*nbases+i]; /* CAGT */
+	    tnew[4+i*4+1] = told[0*nbases+i];
+	    tnew[4+i*4+2] = told[2*nbases+i];
+	    tnew[4+i*4+3] = told[3*nbases+i];
+	    break;
+	default:
+	    tnew[4+i*4+0] = told[0*nbases+i]; /* ACGT */
+	    tnew[4+i*4+1] = told[1*nbases+i];
+	    tnew[4+i*4+2] = told[2*nbases+i];
+	    tnew[4+i*4+3] = told[3*nbases+i];
+	    break;
+	}
+    }
+#endif
+
+    xfree(base);
+
+    return (char *)tnew;
+}
+
+char *untshift(ztr_t *ztr, char *told_c, int tlen, int *new_len) {
+    unsigned short *tnew, *told = (unsigned short *)told_c;
+    int nc, nbases, i;
+    char *bases;
+    ztr_chunk_t **base = ztr_find_chunks(ztr, ZTR_TYPE_BASE, &nc);
+
+    if (nc == 0)
+	return NULL;
+
+    /* Use last BASE chunk if multiple are present */
+    uncompress_chunk(ztr, base[nc-1]);
+    bases  = base[nc-1]->data+1;
+    nbases = base[nc-1]->dlength-1;
+
+    *new_len = 2 + nbases*4 * sizeof(*tnew);
+    tnew = (unsigned short *)malloc(*new_len);
+    tnew[0] = 0;
+    told += 4;
+
+#ifdef ROTATE_INSTEAD
+    /* Reorder */
+    for (i = 0; i < nbases; i++) {
+	switch(bases[i]) {
+	case 'T':
+	    tnew[1+3*nbases+i] = *told++; /* TACG */
+	    tnew[1+0*nbases+i] = *told++;
+	    tnew[1+1*nbases+i] = *told++;
+	    tnew[1+2*nbases+i] = *told++;
+	    break;
+	case 'G':
+	    tnew[1+2*nbases+i] = *told++; /* GTAC */
+	    tnew[1+3*nbases+i] = *told++;
+	    tnew[1+0*nbases+i] = *told++;
+	    tnew[1+1*nbases+i] = *told++;
+	    break;
+	case 'C':
+	    tnew[1+1*nbases+i] = *told++; /* CGTA */
+	    tnew[1+2*nbases+i] = *told++;
+	    tnew[1+3*nbases+i] = *told++;
+	    tnew[1+0*nbases+i] = *told++;
+	    break;
+	default:
+	    tnew[1+0*nbases+i] = *told++; /* ACGT */
+	    tnew[1+1*nbases+i] = *told++;
+	    tnew[1+2*nbases+i] = *told++;
+	    tnew[1+3*nbases+i] = *told++;
+	    break;
+	}
+    }
+#else
+    /* Reorder */
+    for (i = 0; i < nbases; i++) {
+	switch(bases[i]) {
+	case 'T':
+	    tnew[1+3*nbases+i] = *told++; /* TACG */
+	    tnew[1+0*nbases+i] = *told++;
+	    tnew[1+1*nbases+i] = *told++;
+	    tnew[1+2*nbases+i] = *told++;
+	    break;
+	case 'G':
+	    tnew[1+2*nbases+i] = *told++; /* GACT */
+	    tnew[1+0*nbases+i] = *told++;
+	    tnew[1+1*nbases+i] = *told++;
+	    tnew[1+3*nbases+i] = *told++;
+	    break;
+	case 'C':
+	    tnew[1+1*nbases+i] = *told++; /* CAGT */
+	    tnew[1+0*nbases+i] = *told++;
+	    tnew[1+2*nbases+i] = *told++;
+	    tnew[1+3*nbases+i] = *told++;
+	    break;
+	default:
+	    tnew[1+0*nbases+i] = *told++; /* ACGT */
+	    tnew[1+1*nbases+i] = *told++;
+	    tnew[1+2*nbases+i] = *told++;
+	    tnew[1+3*nbases+i] = *told++;
+	    break;
+	}
+    }
+#endif
+
+    xfree(base);
+
+    return (char *)tnew;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/compression.h	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,447 @@
+#ifndef _COMPRESSION_H_
+#define _COMPRESSION_H_
+
+#include "io_lib/os.h"
+#include <zlib.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * zlib_huff()
+ *
+ * Compresses data using huffman encoding, as implemented by zlib.
+ *
+ * Arguments:
+ *	uncomp		Uncompressed input data
+ *	uncomp_len	Length of uncomp data
+ *	comp_len	Output: length of compressed data
+ *
+ * Returns:
+ *	Compressed data if successful
+ *	NULL if not successful
+ */
+char *zlib_huff(char *uncomp, int uncomp_len, int strategy, int *comp_len);
+
+/*
+ * zlib_dehuff()
+ *
+ * Uncompresses data using huffman encoding, as implemented by zlib.
+ *
+ * Arguments:
+ *	comp		Compressed input data
+ *	comp_len	Length of comp data
+ *	uncomp_len	Output: length of uncompressed data
+ *
+ * Returns:
+ *	Uncompressed data if successful
+ *	NULL if not successful
+ */
+char *zlib_dehuff(char *comp, int comp_len, int *uncomp_len);
+
+/*
+ * zlib_dehuff2()
+ *
+ * Uncompresses data using huffman encoding, as implemented by zlib.
+ * Similar to zlib_dehuff above, but with the following differences:
+ *
+ * 1) It pastes together the zlib stream from two components; comp1+comp2
+ *    with the last byte of comp1 overlapping (ORed) with the first byte
+ *    of comp2. This allows for separation of the huffman codes from
+ *    the compressed data itself.
+ * 2) It uses the raw Deflate format rather than Zlib's wrapping of it.
+ * 3) It uses an EOF symbol to mark the end rather than encoding the
+ *    uncompressed size in the header
+ * 
+ *
+ * Arguments:
+ *	comp1		Compressed input data part 1
+ *	comp1_len	Length of comp1 data
+ *	comp2		Compressed input data part 2
+ *	comp2_len	Length of comp2 data
+ *	uncomp_len	Output: length of uncompressed data
+ *
+ * Returns:
+ *	Uncompressed data if successful
+ *	NULL if not successful
+ */
+char *zlib_dehuff2(char *comp1, int comp1_len,
+		   char *comp2, int comp2_len,
+		   int *uncomp_len);
+
+/*
+ * Run length encoding.
+ *
+ * Any run of 3 or more identical characters (up to 255 in a row) are replaced
+ * by a 'guard' byte followed by the number of characters followed by
+ * the character value itself.
+ * Any single guard value in the input is escaped using 'guard 0'.
+ *
+ * Specifying guard as -1 will automatically pick one of the least used
+ * characters in the input as the guard.
+ *
+ * Arguments:
+ *	uncomp		Input data
+ *	uncomp_len	Length of input data 'uncomp'
+ *	guard		Guard byte - used to encode "N" copies of data
+ *	comp_len	Output: length of compressed data
+ *
+ * Returns:
+ *	Compressed data if successful
+ *	NULL if not successful
+ */
+char *rle(char *uncomp, int uncomp_len, int guard, int *comp_len);
+
+/*
+ * Reverses run length encoding.
+ *
+ * Arguments:
+ *	comp		Compressed input data
+ *	comp_len	Length of comp data
+ *	uncomp_len	Output: length of uncompressed data
+ *
+ * Returns:
+ *	Uncompressed data if successful
+ *	NULL if not successful
+ */
+char *unrle(char *comp, int comp_len, int *uncomp_len);
+
+/*
+ * Mutli-byte run length encoding.
+ *
+ * Any run of 3 or more identical characters (up to 255 in a row) are replaced
+ * by a 'guard' byte followed by the number of characters followed by
+ * the character value itself.
+ * Any single guard value in the input is escaped using 'guard 0'.
+ *
+ * Specifying guard as -1 will automatically pick one of the least used
+ * characters in the input as the guard.
+ *
+ * Arguments:
+ *	uncomp		Input data
+ *	uncomp_len	Length of input data 'uncomp'
+ *	guard		Guard byte - used to encode "N" copies of data
+ *      rsz             Size of blocks to compare for run checking.
+ *	comp_len	Output: length of compressed data
+ *
+ * Returns:
+ *	Compressed data if successful
+ *	NULL if not successful
+ */
+char *xrle(char *uncomp, int uncomp_len, int guard, int rsz, int *comp_len);
+
+/*
+ * Reverses multi-byte run length encoding.
+ *
+ * Arguments:
+ *	comp		Compressed input data
+ *	comp_len	Length of comp data
+ *	uncomp_len	Output: length of uncompressed data
+ *
+ * Returns:
+ *	Uncompressed data if successful
+ *	NULL if not successful
+ */
+char *unxrle(char *comp, int comp_len, int *uncomp_len);
+
+/*
+ * Mutli-byte run length encoding.
+ *
+ * Steps along in words of size 'rsz'. Unlike XRLE above this does run-length
+ * encoding by writing out an additional "length" word every time 2 or more
+ * words in a row are spotted. This removes the need for a guard byte.
+ *
+ * Additionally this method ensures that both input and output formats remain
+ * aligned on words of size 'rsz'.
+ *
+ * Arguments:
+ *	uncomp		Input data
+ *	uncomp_len	Length of input data 'uncomp'
+ *      rsz             Size of blocks to compare for run checking.
+ *	comp_len	Output: length of compressed data
+ *
+ * Returns:
+ *	Compressed data if successful
+ *	NULL if not successful
+ */
+char *xrle2(char *uncomp, int uncomp_len, int rsz, int *comp_len);
+
+/*
+ * Reverses multi-byte run length encoding (xrle_new).
+ *
+ * Arguments:
+ *	comp		Compressed input data
+ *	comp_len	Length of comp data
+ *	uncomp_len	Output: length of uncompressed data
+ *
+ * Returns:
+ *	Uncompressed data if successful
+ *	NULL if not successful
+ */
+char *unxrle2(char *comp, int comp_len, int *uncomp_len);
+
+/*
+ * decorrelate1()
+ *
+ * Produce successive deltas from a 1-byte array.
+ *
+ * Arguments:
+ *	uncomp		Uncompressed data
+ *	uncomp_len	Length of uncompressed data
+ *	level		Differencing level (must be 1, 2 or 3)
+ *	comp_len	Return: where to store new compressed length
+ *
+ * Returns:
+ *	Success: A decorrelated buffer (malloced)
+ *	Failure: NULL
+ */
+char *decorrelate1(char *uncomp, int uncomp_len, int level, int *comp_len);
+char *decorrelate1dyn(char *s_uncomp, int uncomp_len, int *comp_len);
+
+/*
+ * recorrelate1()
+ *
+ * The reverse of decorrelate1()
+ *
+ * Arguments:
+ *	comp		Compressed input data
+ *	comp_len	Length of comp data
+ *	uncomp_len	Output: length of uncompressed data
+ *
+ * Returns:
+ *	Success: uncompressed data
+ *	Failure: NULL
+ */
+char *recorrelate1(char *comp, int comp_len, int *uncomp_len);
+
+/*
+ * decorrelate2()
+ *
+ * Produce successive deltas from a 2-byte array (big endian)
+ *
+ * Arguments:
+ *	uncomp		Uncompressed data
+ *	uncomp_len	Length of uncompressed data
+ *	level		Differencing level (must be 1, 2 or 3)
+ *	comp_len	Return: where to store new compressed length
+ *
+ * Returns:
+ *	Success: A decorrelated buffer (malloced)
+ *	Failure: NULL
+ */
+char *decorrelate2(char *uncomp, int uncomp_len, int level, int *comp_len);
+char *decorrelate2dyn(char *s_uncomp, int uncomp_len, int *comp_len);
+
+/*
+ * recorrelate2()
+ *
+ * The reverse of decorrelate2()
+ *
+ * Arguments:
+ *	comp		Compressed input data
+ *	comp_len	Length of comp data
+ *	uncomp_len	Output: length of uncompressed data
+ *
+ * Returns:
+ *	Success: uncompressed data
+ *	Failure: NULL
+ */
+char *recorrelate2(char *comp, int comp_len, int *uncomp_len);
+
+/*
+ * decorrelate4()
+ *
+ * Produce successive deltas from a 4-byte array (big endian)
+ *
+ * Arguments:
+ *	uncomp		Uncompressed data
+ *	uncomp_len	Length of uncompressed data
+ *	level		Differencing level (must be 1, 2 or 3)
+ *	comp_len	Return: where to store new compressed length
+ *
+ * Returns:
+ *	Success: A decorrelated buffer (malloced)
+ *	Failure: NULL
+ */
+char *decorrelate4(char *uncomp, int uncomp_len, int level, int *comp_len);
+
+/*
+ * recorrelate4()
+ *
+ * The reverse of decorrelate4()
+ *
+ * Arguments:
+ *	comp		Compressed input data
+ *	comp_len	Length of comp data
+ *	uncomp_len	Output: length of uncompressed data
+ *
+ * Returns:
+ *	Success: uncompressed data
+ *	Failure: NULL
+ */
+char *recorrelate4(char *comp, int comp_len, int *uncomp_len);
+
+/*
+ * shrink_16to8()
+ *
+ * Stores an array of 16-bit (big endian) array elements in an 8-bit array.
+ * We assume that most 16-bit elements encode numbers that fit in an 8-bit
+ * value. When not possible, we store a marker followed by the 16-bit value
+ * stored as multiple 8-bit values.
+ *
+ *	uncomp		Uncompressed data
+ *	uncomp_len	Length of uncompressed data (in bytes)
+ *	comp_len	Return: where to store new compressed length
+ *	
+ * Returns:
+ *	Success: An 8-bit array (malloced)
+ *	Failure: NULL
+ */
+char *shrink_16to8(char *uncomp, int uncomp_len, int *comp_len);
+
+/*
+ * expand_8to16()
+ *
+ * The opposite of the shrink_16to8() function.
+ *
+ *	comp		Compressed input data
+ *	comp_len	Length of comp data (in bytes)
+ *	uncomp_len	Output: length of uncompressed data (in bytes)
+ *	
+ * Returns:
+ *	Success: Uncompressed data (char *)
+ *	Failure: NULL
+ */
+char *expand_8to16(char *comp, int comp_len, int *uncomp_len);
+
+/*
+ * shrink_32to8()
+ *
+ * Stores an array of 32-bit (big endian) array elements in an 8-bit array.
+ * We assume that most 32-bit elements encode numbers that fit in an 8-bit
+ * value. When not possible, we store a marker followed by the 32-bit value
+ * stored as multiple 8-bit values.
+ *
+ *	uncomp		Uncompressed data
+ *	uncomp_len	Length of uncompressed data (in bytes)
+ *	comp_len	Return: where to store new compressed length
+ *	
+ * Returns:
+ *	Success: An 8-bit array (malloced)
+ *	Failure: NULL
+ */
+char *shrink_32to8(char *uncomp, int uncomp_len, int *comp_len);
+
+/*
+ * expand_8to32()
+ *
+ * The opposite of the shrink_32to8() function.
+ *
+ *	comp		Compressed input data
+ *	comp_len	Length of comp data (in bytes)
+ *	uncomp_len	Output: length of uncompressed data (in bytes)
+ *	
+ * Returns:
+ *	Success: Uncompressed data (char *)
+ *	Failure: NULL
+ */
+char *expand_8to32(char *comp, int comp_len, int *uncomp_len);
+
+char *follow1(char *s_uncomp,
+	      int uncomp_len,
+	      int *comp_len);
+
+char *unfollow1(char *s_comp,
+		int comp_len,
+		int *uncomp_len);
+
+char *ichebcomp(char *uncomp,
+		int uncomp_len,
+		int *data_len);
+
+char *ichebuncomp(char *comp,
+		  int comp_len,
+		  int *uncomp_len);
+
+/*
+ * This is a LOSSY compression. It replaces N with 10 * log2(N).
+ */
+char *log2_data(char *x_uncomp,
+		int uncomp_len,
+		int *comp_len);
+
+char *unlog2_data(char *x_comp,
+		  int comp_len,
+		  int *uncomp_len);
+
+/*
+ * Implements compression using a set of static huffman codes stored using
+ * the Deflate algorithm (and so in this respect it's similar to zlib).
+ *
+ * The huffman codes though can be previously stored in the ztr object
+ * using ztr_add_hcode(). "cset" indicates which numbered stored huffman
+ * code set is to be used, or passing zero will use inline codes (ie they
+ * are stored in the data stream itself, just as in standard deflate).
+ *
+ * Arguments:
+ *	ztr		ztr_t pointer; used to find stored code-sets
+ *	uncomp		The uncompressed input data
+ *	uncomp_len	Length of uncomp
+ *	cset		Stored code-set number, zero for inline
+ *	recsz		Record size - only used when cset == 0.
+ *	comp_len	Output: length of compressed data
+ *
+ * Returns:
+ *	Compressed data stream if successful + comp_len
+ *      NULL on failure
+ */
+char *sthuff(ztr_t *ztr, char *uncomp, int uncomp_len, 
+	     int cset, int recsz, int *comp_len);
+char *unsthuff(ztr_t *ztr, char *comp, int comp_len, int *uncomp_len);
+
+/*
+ * Reorders quality data from its RAW format to an interleaved 4-byte
+ * aligned format.
+ *
+ * Starting with sequence A1 C2 G3 the raw format is quality of called
+ * bases followed by quality of remaining bases:
+ * 0 (RAW format)
+ * Q(A1) Q(C2) Q(G3)
+ * Q(C2) Q(A2) Q(A3) 
+ * Q(G2) Q(G2) Q(C3) 
+ * Q(T2) Q(T2) Q(T3) 
+ *
+ * We reorder it to:
+ * ZTR_FORM_QSHIFT <any> <any> 0(raw)
+ * Q(A1) Q(C1) Q(G1) Q(T1)
+ * Q(C2) Q(A2) Q(G2) Q(T2)
+ * Q(G3) Q(A3) Q(C3) Q(T3)
+ * 
+ * Returns shifted data on success
+ *         NULL on failure
+ */
+char *qshift(char *qold, int qlen, int *new_len);
+char *unqshift(char *qold, int qlen, int *new_len);
+
+/*
+ * Given a sequence ACTG this shifts trace data from the order:
+ *
+ *     A1A2A3A4 C1C2C3C4 G1G2G3G4 T1T2T3T4
+ *
+ * to
+ *
+ *     A1C1G1T1 C2A2G2T2 T3A3C3G3 G4C4C4T4
+ *
+ * Ie for each base it ouputs the signal for the called base first
+ * followed by the remaining 3 signals in A,C,G,T order (minus the
+ * called signal already output).
+ */
+char *tshift(ztr_t *ztr, char *told_c, int tlen, int *new_len);
+char *untshift(ztr_t *ztr, char *told_c, int tlen, int *new_len);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _COMPRESSION_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/ctfCompress.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,1436 @@
+/*  File: ctftrace.c
+    %W% %G%
+*/
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "io_lib/seqIOCTF.h"
+#include "io_lib/stdio_hack.h"
+
+#define ACEDB4
+
+#define A_ 1
+#define T_ 2
+#define G_ 4
+#define C_ 8
+
+/*#include "regular.h"
+#include "keyset.h"
+#include "dna.h"
+*/
+#include "io_lib/array.h"
+#include "io_lib/Read.h"
+
+/*
+ * #defines to modify this file to compile easily as part of the Staden
+ * Package io_lib.
+ */
+#define freeSeq(_s) (read_deallocate(_s), (_s) = 0)
+#define seqMax(_seq)  ((_seq)->NPoints )
+#define seqMaxBase(_seq)  ((_seq)->NBases)
+
+#define xmalloc malloc
+#define xcalloc calloc
+#define xrealloc realloc
+#define xfree free
+
+#define arrayCreate(s,t) ArrayCreate(sizeof(t),(s))
+#define array(a,n,t) ARR(t,a,n)
+#define arrayMax ArrayMax
+#define arrayDestroy ArrayDestroy
+#undef arrp
+#define arrp(a,n,t) \
+    &((t*)((a)->base))[n]
+#define arrayReCreate(a,n,t) arrayCreate(n,t)
+#define arrayExists(a) ((a)->base != NULL)
+
+#define BOOL int
+#define mysize_t size_t
+#define FALSE 0
+#define TRUE 1
+
+
+#define MAGIC 523747
+#define PREDICTIONMODE 3  /* predictor degree */
+#define COMPRESSIONMODE 3 /* compressor version */
+
+static char *ctfType = 0 ;
+
+/**********************************************************/
+/**********************************************************/
+
+static int ctfTracePeakValue ( Read *seq)
+{
+  int i, ii, max = 0 ;
+  TRACE *bp[4], *u ;
+  
+  bp[0] = seq->traceA ;
+  bp[1] = seq->traceC ;
+  bp[2] = seq->traceG ;
+  bp[3] = seq->traceT ;
+  
+  ii = 4 ; 
+  while (ii--)
+    {
+      u = bp[ii] - 1 ;
+      i = seqMax(seq) ;
+      while (u++, i--)
+	if (*u > max) max = *u ;
+    }
+  
+  seq->maxTraceVal = max ;
+  return max ;
+}
+
+/**********************************************************/
+/* get/store in sex independant way */
+static int ctfGetInt (unsigned char *cp)
+{
+  int n = 0, i = 4 ;
+  
+  while (i--) 
+    { n <<= 8 ; n |= *cp++ ; }
+  return n ;
+}
+
+/**********/
+
+static void ctfStoreInt (unsigned char *cp, int n)
+{
+  int i = 4 ;
+  
+  cp += 4 ;
+  while (cp--, i--) 
+    { *cp = n & 0xff ; n >>= 8 ; }
+}
+
+/**********************************************************/
+/**********************************************************/
+/* Method zero
+   store the shorts as a pair of char
+*/
+static Array ctfCompress0 (Array a)
+{ 
+  int i = arrayMax (a) ;
+  Array b = arrayCreate (2 * i, unsigned char) ; /* always true */
+  unsigned char *cp, *cp0 ;
+  short *sp, z ;
+
+  array (b, 2*i - 1 , unsigned char) = 0 ;  /* make room */
+  cp = cp0 = arrp (b , 0, unsigned char) ;
+  sp = arrp (a, 0, short) ;
+
+  while (i--)
+    {
+      z = *sp++ ;
+      *cp++ = (z >> 8) & 0xff ;
+      *cp++ = z &  0xff ;
+    }
+  arrayMax(b) = cp - cp0 ;
+  return b ;
+}
+
+/**********************************************************/
+
+static Array ctfDecompress0 (int dataMax, int shMax,
+			     unsigned char *cp)
+{ 
+  int i = shMax ;
+  Array b = 0 ;
+  short *sp ;
+
+  if (dataMax != 2 * shMax)
+    return 0 ;
+
+  b = arrayCreate (shMax, short) ;
+  array (b, shMax - 1, short) = 0 ;  /* make room */
+  sp = arrp (b, 0, short) ;
+
+  while (i--)
+    {
+      *sp++ = ((*cp)<< 8) | (*(cp + 1)) ;
+      cp += 2 ;
+    }
+  return b ;
+}
+
+/**********************************************************/
+/**********************************************************/
+/* Method one
+   converts short s to unsigned char cc:
+   if s in range -126, +126, cc = s + 128
+   else transmit 0xFF then value on 2 bytes 
+*/
+static Array ctfCompress1 (Array a)
+{
+  int i = arrayMax (a), j ;
+  Array b = arrayCreate (3 *i, char) ; /* unreliable size, use arrayp */
+  short *sp, z ;
+
+  array (b, 3*i - 1 , unsigned char) = 0 ;  /* make room */
+  j = 0 ;
+  sp = arrp (a, 0, short) ;
+
+  while (i--)
+    {
+      z = *sp++ + 128 ;
+      while (z >= 254) { z -= 252 ; array (b , j++, unsigned char) = 254 ;}
+      while (z <= 1) { z += 252 ; array (b , j++, unsigned char) = 1 ; }
+      array (b , j++, unsigned char) = z ;
+    }
+  arrayMax (b) = j ;
+  return b ;
+}
+
+/**********************************************************/
+
+static Array ctfDecompress1 (int dataMax, int shMax,
+			    unsigned char *cp)
+{
+  int i = dataMax, dz = 0 ;
+  short *sp, *spMax ;
+  Array b = arrayCreate (shMax, short) ;
+
+  array (b, shMax  - 1, short) = 0 ;  /* make room */
+  sp = arrp (b, 0, short) ;
+  spMax = sp + shMax ;
+
+  cp-- ;
+  while (cp++, i-- && sp < spMax)
+    switch (*cp)
+      {
+      case 1: dz -= 252 ; break ;
+      case 254: dz += 252 ; break ;
+      default: *sp++ = dz + *cp - 128 ; dz = 0 ; break ;
+      }
+  if (i != -1 || sp != spMax)
+    arrayDestroy (b) ;
+  return b ;
+}
+
+/**********************************************************/
+/**********************************************************/
+/* Method two
+   convert strings of zeroes as single chars
+   small values as 7 bit codes
+   rest as shorts in next 2 bytes
+*/
+
+static Array ctfCompress2 (Array a)
+{
+  int n0, n1, n2, n3, n4 ;
+  int i = arrayMax (a), j = 0 ;
+  Array b = arrayCreate (3 *i, char) ; /* worst case */
+  unsigned char *cp, *cp0 ;
+  short *sp, z ;
+
+  array (b, 3*i - 1 , unsigned char) = 0 ;  /* make room */
+  cp = cp0 = arrp (b , 0, unsigned char) ;
+  sp = arrp (a, 0, short) ;
+
+  n0 = n1 = n2 = n3 = n4 = 0 ;
+  while (i--)
+    {
+      z = *sp++ ;
+      if (!z)  /* string of zeroes */
+	{
+	  j =1 ;
+	  while (i > 0 && j < 126 && !(*sp)) { j++ ; sp++; i-- ; } ;
+	  *cp++ =  (j & 0x7f) ; /* bit 1 = 0 */
+	  n0 += j ; n1++ ;
+	}
+      else if ( z < 63 && z > - 63)
+	{
+	  j = z + 63 ; /* range 1 ... 125 */
+	  *cp++ = 0x80 | (j & 0x7f) ;
+	  n2++ ;
+	}
+      else if ( z < 128 && z > -129)
+	{
+	  j = z + 128 ; /* range 0 ... 255 */
+	  *cp++ = 0x80 | 126 ;
+	  *cp++ = j & 0xff ;
+	  n3++ ;
+	}
+      else
+	{
+	  j = z ; 
+	  *cp++ = 0x80 | 127 ;
+	  *cp++ = (j >> 8) & 0xff ;
+	  *cp++ = j & 0xff ;	
+	  n4++ ;
+	}
+    }
+  arrayMax(b) = cp - cp0 ;
+  printf ("compress2 : %d zeros in %d bytes, %d < 7 , %d byte, %d short total %d char for %d shrt\n",
+	  n0, n1, n2, n3, n4, arrayMax(b), arrayMax(a)) ;
+  return b ;
+}
+/*
+compress2 : 
+  12338 zeros in 3328 bytes, 14616 < 7 , 23 byte, 3 short 
+          total 17999 char for 26980 shrt
+*/
+
+/**********************************************************/
+
+static Array ctfDecompress2 (int dataMax, int shMax,
+			    unsigned char *cp)
+{
+  int i = dataMax, mode, arg ;
+  unsigned char cc, cc1, cc2 ;
+  short *sp, *spMax ;
+  Array b = arrayCreate (shMax, short) ;
+
+  array (b, shMax  - 1, short) = 0 ;  /* make room */
+  sp = arrp (b, 0, short) ;
+  spMax = sp + shMax ;
+
+  while (i-- && sp < spMax)
+    {
+      cc = *cp++ ;
+      mode = cc & 0x80 ; arg = cc & 0x7f ;
+      switch (mode)
+	{
+	case 0: /* initial zero = string of zero */
+	  while (arg-- && sp < spMax) *sp++ = 0 ; 
+	  break ;
+	case 0x80:
+	  switch (arg)
+	    {
+	    case 127:   /* next 2 bytes is a short */
+	      i -= 2 ;
+	      cc1 = *cp++ ; cc2 = *cp++ ;
+	      *sp++ = (cc1 << 8) | cc2 ;
+	      break ;
+	    case 126:   /* next byte is a byte */
+	      i-- ;
+	      cc1 = *cp++ ;
+	      *sp++ = cc1 - 128 ;
+	      break ;
+	    default:   /* 7 bytes is sufficient */
+	      *sp++ = arg - 63 ;
+	      break ;
+	    }
+	}
+    }
+  if (i != -1 || sp != spMax)
+    arrayDestroy (b) ;
+  return b ;
+}
+
+/**********************************************************/
+/**********************************************************/
+/* Method two
+   convert strings of zeroes as single chars
+   small values as 7 bit codes
+   rest as shorts in next 2 bytes
+*/
+
+/**********************************************************/
+/* create a code for the 125 most frequent words */
+static void ctfCompress3Init (Array *aap, int **lp, int **mp, int *maxCodep)
+{
+  short *sp ; int  i, j, k ;
+  static int lng[128], mark[128], maxCode = 0 ;
+  static Array aa = 0 ; 
+
+
+  *aap = aa ; *lp = lng ; *mp = mark ; *maxCodep = maxCode ;
+  if (aa) return ;
+  *aap = aa = arrayCreate (512, short) ;
+  array (aa, 511, short) = 0 ; /* make room */
+  sp = arrp (aa, 0, short) ;
+  j = 0 ;
+
+  i = 0 ;  /* empty word */
+  mark[i] = j ; j += lng[i] ; 
+  
+  /* single values up to +- 8 */
+  for (k = 1 ; i < 126 && k < 12 ; k++)
+    { 
+      i++ ; 
+      mark[i] = j ; *sp++ = k ;
+      lng [i] = 1 ; j++ ;
+      i++ ; 
+      mark[i] = j ; *sp++ = -k ;
+      lng [i] = 1 ; j++ ;
+    }
+  /* double values up to 50 */
+  for (k = 1 ; i < 126 && k < 6 ; k++)
+    { 
+      i++ ; 
+      mark[i] = j ; *sp++ = k ; *sp++ = 0 ;
+      lng [i] = 2 ; j += 2 ;
+      i++ ; 
+      mark[i] = j ; *sp++ = -k ; *sp++ = 0 ;
+      lng [i] = 2 ; j += 2 ;
+    }
+  /* double values up to 51 */
+  for (k = 1 ; i < 126 && k < 6 ; k++)
+    { 
+      i++ ; 
+      mark[i] = j ; *sp++ = k ; *sp++ = 1 ;
+      lng [i] = 2 ; j += 2 ;
+      i++ ; 
+      mark[i] = j ; *sp++ = -k ; *sp++ = 1 ;
+      lng [i] = 2 ; j += 2 ;
+    }
+  /* double values up to 5-1 */
+  for (k = 1 ; i < 126 && k < 6 ; k++)
+    { 
+      i++ ; 
+      mark[i] = j ; *sp++ = k ; *sp++ = -1 ;
+      lng [i] = 2 ; j += 2 ;
+      i++ ; 
+      mark[i] = j ; *sp++ = -k ; *sp++ = -1 ;
+      lng [i] = 2 ; j += 2 ;
+    }
+  /* double values up to 15 */
+  for (k = 1 ; i < 126 && k < 6 ; k++)
+    { 
+      i++ ; 
+      mark[i] = j ; *sp++ = 1 ; *sp++ = k ;
+      lng [i] = 2 ; j += 2 ;
+      i++ ; 
+      mark[i] = j ; *sp++ = 1 ; *sp++ = -k ;
+      lng [i] = 2 ; j += 2 ;
+    }
+  /* double values up to -15 */
+  for (k = 1 ; i < 126 && k < 6 ; k++)
+    { 
+      i++ ; 
+      mark[i] = j ; *sp++ = -1 ; *sp++ = k ;
+      lng [i] = 2 ; j += 2 ;
+      i++ ; 
+      mark[i] = j ; *sp++ = -1 ; *sp++ = -k ;
+      lng [i] = 2 ; j += 2 ;
+    }
+  /* triple values up to 111 */
+
+  i++ ; mark[i] = j ; *sp++ = 1 ; *sp++ = 0 ; *sp++ = 1 ;
+  lng [i] = 3 ; j += 3 ;
+  i++ ; mark[i] = j ; *sp++ = 1 ; *sp++ = 0 ; *sp++ = -1 ;
+  lng [i] = 3 ; j += 3 ;
+  i++ ; mark[i] = j ; *sp++ = 1 ; *sp++ = 1 ; *sp++ = 1 ;
+  lng [i] = 3 ; j += 3 ;
+  i++ ; mark[i] = j ; *sp++ = 1 ; *sp++ = 1 ; *sp++ = -1 ;
+  lng [i] = 3 ; j += 3 ;
+  i++ ; mark[i] = j ; *sp++ = 1 ; *sp++ = -1 ; *sp++ = 1 ;
+  lng [i] = 3 ; j += 3 ;
+  i++ ; mark[i] = j ; *sp++ = 1 ; *sp++ = -1 ; *sp++ = 1 ;
+  lng [i] = 3 ; j += 3 ;
+
+  i++ ; mark[i] = j ; *sp++ = -1 ; *sp++ = 0 ; *sp++ = 1 ;
+  lng [i] = 3 ; j += 3 ;
+  i++ ; mark[i] = j ; *sp++ = -1 ; *sp++ = 0 ; *sp++ = -1 ;
+  lng [i] = 3 ; j += 3 ;
+  i++ ; mark[i] = j ; *sp++ = -1 ; *sp++ = 1 ; *sp++ = 1 ;
+  lng [i] = 3 ; j += 3 ;
+  i++ ; mark[i] = j ; *sp++ = -1 ; *sp++ = 1 ; *sp++ = -1 ;
+  lng [i] = 3 ; j += 3 ;
+  i++ ; mark[i] = j ; *sp++ = -1 ; *sp++ = -1 ; *sp++ = 1 ;
+  lng [i] = 3 ; j += 3 ;
+  i++ ; mark[i] = j ; *sp++ = -1 ; *sp++ = -1 ; *sp++ = 1 ;
+  lng [i] = 3 ; j += 3 ;
+
+  /* quadruple values up to 1111 */
+
+  i++ ; mark[i] = j ; *sp++ = 1 ; *sp++ = 0 ; *sp++ = 0 ; *sp++ = 1 ;
+  lng [i] = 4 ; j += 4 ;
+  i++ ; mark[i] = j ; *sp++ = 1 ; *sp++ = 0 ; *sp++ = 1 ; *sp++ = 1 ;
+  lng [i] = 4 ; j += 4 ;
+  i++ ; mark[i] = j ; *sp++ = 1 ; *sp++ = 0 ; *sp++ = -1 ; *sp++ = 1 ;
+  lng [i] = 4 ; j += 4 ;
+  i++ ; mark[i] = j ; *sp++ = 1 ; *sp++ = 1 ; *sp++ = 0 ; *sp++ = 1 ;
+  lng [i] = 4 ; j += 4 ;
+  i++ ; mark[i] = j ; *sp++ = 1 ; *sp++ = 1 ; *sp++ = 1 ; *sp++ = 1 ;
+  lng [i] = 4 ; j += 4 ;
+  i++ ; mark[i] = j ; *sp++ = 1 ; *sp++ = 1 ; *sp++ = -1 ; *sp++ = 1 ;
+  lng [i] = 4 ; j += 4 ;
+  i++ ; mark[i] = j ; *sp++ = 1 ; *sp++ = -1 ; *sp++ = 0 ; *sp++ = 1 ;
+  lng [i] = 4 ; j += 4 ;
+  i++ ; mark[i] = j ; *sp++ = 1 ; *sp++ = -1 ; *sp++ = 1 ; *sp++ = 1 ;
+  lng [i] = 4 ; j += 4 ;
+  i++ ; mark[i] = j ; *sp++ = 1 ; *sp++ = -1 ; *sp++ = -1 ; *sp++ = 1 ;
+  lng [i] = 4 ; j += 4 ;
+
+  i++ ; mark[i] = j ; *sp++ = 1 ; *sp++ = 0 ; *sp++ = 0 ; *sp++ = -1 ;
+  lng [i] = 4 ; j += 4 ;
+  i++ ; mark[i] = j ; *sp++ = 1 ; *sp++ = 0 ; *sp++ = 1 ; *sp++ = -1 ;
+  lng [i] = 4 ; j += 4 ;
+  i++ ; mark[i] = j ; *sp++ = 1 ; *sp++ = 0 ; *sp++ = -1 ; *sp++ = -1 ;
+  lng [i] = 4 ; j += 4 ;
+  i++ ; mark[i] = j ; *sp++ = 1 ; *sp++ = 1 ; *sp++ = 0 ; *sp++ = -1 ;
+  lng [i] = 4 ; j += 4 ;
+  i++ ; mark[i] = j ; *sp++ = 1 ; *sp++ = 1 ; *sp++ = 1 ; *sp++ = -1 ;
+  lng [i] = 4 ; j += 4 ;
+  i++ ; mark[i] = j ; *sp++ = 1 ; *sp++ = 1 ; *sp++ = -1 ; *sp++ =- 1 ;
+  lng [i] = 4 ; j += 4 ;
+  i++ ; mark[i] = j ; *sp++ = 1 ; *sp++ = -1 ; *sp++ = 0 ; *sp++ = -1 ;
+  lng [i] = 4 ; j += 4 ;
+  i++ ; mark[i] = j ; *sp++ = 1 ; *sp++ = -1 ; *sp++ = 1 ; *sp++ = -1 ;
+  lng [i] = 4 ; j += 4 ;
+  i++ ; mark[i] = j ; *sp++ = 1 ; *sp++ = -1 ; *sp++ = -1 ; *sp++ = -1 ;
+  lng [i] = 4 ; j += 4 ;
+
+  i++ ; mark[i] = j ; *sp++ = -1 ; *sp++ = 0 ; *sp++ = 0 ; *sp++ = 1 ;
+  lng [i] = 4 ; j += 4 ;
+  i++ ; mark[i] = j ; *sp++ = -1 ; *sp++ = 0 ; *sp++ = 1 ; *sp++ = 1 ;
+  lng [i] = 4 ; j += 4 ;
+  i++ ; mark[i] = j ; *sp++ = -1 ; *sp++ = 0 ; *sp++ = -1 ; *sp++ = 1 ;
+  lng [i] = 4 ; j += 4 ;
+  i++ ; mark[i] = j ; *sp++ = -1 ; *sp++ = 1 ; *sp++ = 0 ; *sp++ = 1 ;
+  lng [i] = 4 ; j += 4 ;
+  i++ ; mark[i] = j ; *sp++ = -1 ; *sp++ = 1 ; *sp++ = 1 ; *sp++ = 1 ;
+  lng [i] = 4 ; j += 4 ;
+  i++ ; mark[i] = j ; *sp++ = -1 ; *sp++ = 1 ; *sp++ = -1 ; *sp++ = 1 ;
+  lng [i] = 4 ; j += 4 ;
+  i++ ; mark[i] = j ; *sp++ = -1 ; *sp++ = -1 ; *sp++ = 0 ; *sp++ = 1 ;
+  lng [i] = 4 ; j += 4 ;
+  i++ ; mark[i] = j ; *sp++ = -1 ; *sp++ = -1 ; *sp++ = 1 ; *sp++ = 1 ;
+  lng [i] = 4 ; j += 4 ;
+  i++ ; mark[i] = j ; *sp++ = -1 ; *sp++ = -1 ; *sp++ = -1 ; *sp++ = 1 ;
+  lng [i] = 4 ; j += 4 ;
+
+  i++ ; mark[i] = j ; *sp++ = -1 ; *sp++ = 0 ; *sp++ = 0 ; *sp++  = -1 ;
+  lng [i] = 4 ; j += 4 ;
+  i++ ; mark[i] = j ; *sp++ = -1 ; *sp++ = 0 ; *sp++ = 1 ; *sp++  = -1 ;
+  lng [i] = 4 ; j += 4 ;
+  i++ ; mark[i] = j ; *sp++ = -1 ; *sp++ = 0 ; *sp++ = -1 ; *sp++  = -1 ;
+  lng [i] = 4 ; j += 4 ;
+  i++ ; mark[i] = j ; *sp++ = -1 ; *sp++ = 1 ; *sp++ = 0 ; *sp++  = -1 ;
+  lng [i] = 4 ; j += 4 ;
+  i++ ; mark[i] = j ; *sp++ = -1 ; *sp++ = 1 ; *sp++ = 1 ; *sp++  = -1 ;
+  lng [i] = 4 ; j += 4 ;
+  i++ ; mark[i] = j ; *sp++ = -1 ; *sp++ = 1 ; *sp++ = -1 ; *sp++  = -1 ;
+  lng [i] = 4 ; j += 4 ;
+  i++ ; mark[i] = j ; *sp++ = -1 ; *sp++ = -1 ; *sp++ = 0 ; *sp++  = -1 ;
+  lng [i] = 4 ; j += 4 ;
+  i++ ; mark[i] = j ; *sp++ = -1 ; *sp++ = -1 ; *sp++ = 1 ; *sp++  = -1 ;
+  lng [i] = 4 ; j += 4 ;
+  i++ ; mark[i] = j ; *sp++ = -1 ; *sp++ = -1 ; *sp++ = -1 ; *sp++  = -1 ;
+  lng [i] = 4 ; j += 4 ;
+
+  i++ ; mark[i] = j ; *sp++ = 1 ; *sp++ = 0 ; *sp++ = 0 ; *sp++ = 0 ; *sp++  = 1 ;
+  lng [i] = 5 ; j += 5 ;
+  i++ ; mark[i] = j ; *sp++ = 1 ; *sp++ = 0 ; *sp++ = 0 ; *sp++ = 0 ; *sp++  = -1 ;
+  lng [i] = 5 ; j += 5 ;
+  i++ ; mark[i] = j ; *sp++ = -1 ; *sp++ = 0 ; *sp++ = 0 ; *sp++ = 0 ; *sp++  = 1 ;
+  lng [i] = 5 ; j += 5 ;
+  i++ ; mark[i] = j ; *sp++ = -1 ; *sp++ = 0 ; *sp++ = 0 ; *sp++ = 0 ; *sp++  = -1 ;
+  lng [i] = 5 ; j += 5 ;
+
+  if (i >= 126) 
+    { fprintf (stderr, "FATAL ERROR, ctfCompress3Init i=%d > 126", i) ;
+      exit (1) ;
+    }
+  if (j > 511)  
+    { 
+      fprintf (stderr, "FATAL ERROR, ctfCompress3Init j=%d > 511", j) ; 
+      exit (1) ;
+    }
+  *maxCodep = maxCode = i ;
+}
+
+/**********************************************************/
+
+static Array ctfCompress3 (Array a)
+{
+  int n0, n1, n10, n2, n3, n4 ;
+  int i = arrayMax (a), j = 0, n ;
+  Array b = arrayCreate (3 *i, char) ; /* worst case */
+  unsigned char *cp, *cp0 ;
+  short *sp, *sp1, *wp, z ;
+  int w, *lng, *mark, maxCode ;
+  Array aa = 0 ; 
+  BOOL debug = FALSE ;
+
+  ctfCompress3Init (&aa, &lng, &mark, &maxCode) ;
+
+  array (b, 3*i - 1 , unsigned char) = 0 ;  /* make room */
+  cp = cp0 = arrp (b , 0, unsigned char) ;
+  sp = arrp (a, 0, short) ;
+
+  n0 = n1 = n10 = n2 = n3 = n4 = 0 ;
+  while (i--)
+    {
+      z = *sp++ ;
+      if (!z)  /* string of zeroes */
+	{
+	  j =1 ;
+	  while (i > 0 && j < 126 && !(*sp)) { j++ ; sp++; i-- ; } ;
+	  *cp++ =  j & 0x7f ;  /* bit 1 = 0 */
+	  n0 += j ; n1++ ;
+	  continue ;
+	}
+       /* search for code word */
+      for (w = maxCode ; w > 1 ; w--)  /* w-- favors long code words */
+	{
+	  n = lng[w] ; wp = arrp (aa, mark[w], short) ; sp1 = sp - 1 ;
+	  while (n-- && *wp++ == *sp1++) ;
+	  if (n == -1) break ;
+	}
+      if (w > 1 && lng[w] < i) /* code word found */
+	{
+	  n2++ ; n10 += lng[w] ;  *cp++ = 0x80 | (w & 0x7f) ;
+	  sp += lng[w] - 1 ; i -= lng[w] - 1 ;
+	  if (lng[w] <= 0)
+	    {
+	      fprintf (stderr, "FATAL ERROR in ctfCompress3 bad coding lng[w]") ;
+	      exit (1) ;
+	    }
+	}
+      else if ( z < 128 && z > -129) /* transmit byte */
+	{
+	  j = z + 128 ; /* range 0 ... 255 */
+	  *cp++ = 0x80 | 126 ;
+	  *cp++ = j & 0xff ;
+	  n3++ ;
+	}
+      else     /* transmit short */
+	{
+	  j = z ; 
+	  *cp++ = 0x80 | 127 ;
+	  *cp++ = (j >> 8) & 0xff ;
+	  *cp++ = j & 0xff ;	
+	  n4++ ;
+	}
+    }
+  arrayMax(b) = cp - cp0 ;
+  if (debug) 
+    printf (" // compress3:\n//  %d zeros in %d bytes, %d values coded in %d byte, %d bytes, %d short. \n// Total %d char for %d shrt\n",
+	  n0, n1, n10, n2, n3, n4, arrayMax(b), arrayMax(a)) ;
+  if (arrayMax(a) != n0 + n10 + n3 + n4)
+    { 
+      fprintf (stderr, "FATAL ERROR in ctfCompress3, codind error in compress 3") ;
+      exit (1) ;
+    }
+  return b ;
+}
+/*
+compress3 : 
+//found   10829 zeros in 1865 bytes, 16524 values coded in 9114 byte, 183 bytes, 0 short. 
+// Total 11162 char for 27536 shrt
+*/
+
+/**********************************************************/
+
+static Array ctfDecompress3 (int dataMax, int shMax,
+			    unsigned char *cp)
+{
+  int i = dataMax, mode, arg, n ;
+  unsigned char cc, cc1, cc2 ;
+  short *sp, *spMax, *wp ;
+  Array b = arrayCreate (shMax, short) ;
+  int *lng, *mark, maxCode ;
+  Array aa = 0 ; 
+  int n0, n1, n10, n2, n3, n4 ;
+  BOOL debug = FALSE ;
+
+  ctfCompress3Init (&aa, &lng, &mark, &maxCode) ;
+
+  array (b, shMax - 1, short) = 0 ;  /* make room */
+  sp = arrp (b, 0, short) ;
+  spMax = sp + shMax ;
+  n0 = n1 = n10 = n2 = n3 = n4 = 0 ;
+
+  while (i-- && sp < spMax)
+    {
+      cc = *cp++ ;
+      mode = cc & 0x80 ; arg = cc & 0x7f ;
+      switch (mode)
+	{
+	case 0: /* initial zero = string of zero */
+	  if (arg <= 0) /* should not happen */
+	    { 
+	      fprintf (stderr,"bad decompress3") ; 
+	      goto abort ;
+	    }  
+	  n1++ ; n0 += arg ;
+	  while (arg-- && sp < spMax) *sp++ = 0 ; 
+	  break ;
+	case 0x80:
+	  switch (arg)
+	    {
+	    case 127:   /* next 2 bytes is a short */
+	      i -= 2 ;  /* I need 3 bytes to code a short */
+	      cc1 = *cp++ ; cc2 = *cp++ ;
+	      *sp++ = (cc1 << 8) | cc2 ;
+	      n4++ ;
+	      break ;
+	    case 126:   /* next byte is a byte */
+	      i-- ;     /* I need 2 bytes to code a char */
+	      cc1 = *cp++ ;
+	      *sp++ = cc1 - 128 ;
+	      n3++ ;
+	      break ;
+	    default:   /* 7 bytes is a code */
+	      n = lng[arg] ; 
+	      n2++ ; n10 += n ;
+	      wp = arrp (aa, mark[arg], short) ;
+	      while (n-- && sp < spMax) *sp++ = *wp++ ;
+	      break ;
+	    }
+	}
+    }
+  if (debug)
+    printf (" // compress3:\n//found   %d zeros in %d bytes, %d values coded in %d byte, %d bytes, %d short. \n// Total %d char for %d shrt\n",
+	    n0, n1, n10, n2, n3, n4, n1 + n2 + n3 + n4, n0 + n10 + n3 + n4) ;
+  
+  if (i != -1 || sp != spMax)
+    goto abort ;
+  return b ;
+
+abort:
+  arrayDestroy (b) ;
+  return 0 ;
+}
+
+/**********************************************************/
+/**********************************************************/
+
+static Array ctfDecompress (int compressionMode, 
+			    int dataMax, int traceMax, 
+			    unsigned char **cpp)
+{ 
+  Array a = 0 ;
+
+  switch (compressionMode)
+    {
+    case 0:
+      a = ctfDecompress0 (dataMax, 4*traceMax, *cpp) ;
+      break ;
+    case 1:
+      a = ctfDecompress1 (dataMax, 4*traceMax, *cpp) ;
+      break ;
+    case 2:
+      a = ctfDecompress2 (dataMax, 4*traceMax, *cpp) ;
+      break ;
+    case 3:
+      a = ctfDecompress3 (dataMax, 4*traceMax, *cpp) ;
+      break ;
+    default:  /* unknown compression mode */
+      break ;
+    }
+
+  *cpp += dataMax ;
+  return a ;
+}
+
+/**********************************************************/
+
+static Array ctfCompress (int compressionMode, Array a)
+{
+  switch (compressionMode)
+    {
+    case 0:
+      return ctfCompress0 (a) ;
+    case 1:
+      return ctfCompress1 (a) ;
+    case 2:
+      return ctfCompress2 (a) ;
+    case 3:
+      return ctfCompress3 (a) ;
+    default:
+      fprintf (stderr,"FATAL ERROR in ctfCompress, Non existing compression mode") ;
+      exit (1) ;
+      return 0 ; /* for compiler happiness */
+    }
+}
+
+/**********************************************************/
+/**********************************************************/
+/* called by saucisse fill, a system to test the efficiency of the system */
+
+static Array ctfDecorrelate (Read *read, int predictionMode)
+{
+  int j, j1, u1, u2, u3, u4 ;
+  short *zp, z = 0 ;
+  TRACE *tt[4], *sp ;
+  int traceMax = read->NPoints ;
+  Array a = arrayCreate (4 * traceMax, short) ;
+
+  if (predictionMode == -1)
+    predictionMode = PREDICTIONMODE ;
+
+  tt[0] = read->traceA ;
+  tt[1] = read->traceG ;
+  tt[2] = read->traceC ;
+  tt[3] = read->traceT ;
+
+  array (a, 4 * traceMax - 1 , short) = 0 ;  /* make room */
+  zp = arrp (a, 0, short) ;
+  for (j1 = 0 ; j1 < 4 ; j1++)
+    { 
+      sp = tt[j1] ;
+
+      u1 = u2 = u3 = u4 = 0 ;
+      for (j=0 ; j < traceMax ; zp++, sp++, j++)
+	{ 
+	  switch (predictionMode)
+	    {
+	    case 1: z = u1 ; break ; /* predict flat, transmit derivative */
+	    case 2: z = 2*u1 - u2 ; break ; /* predict line trans dd2 */
+	    case 3: z = 3*u1 - 3*u2 + u3 ; break ; /* predict parabole */
+	    case 4: z = 4*u1 - 6*u2 + 4*u3 - u4; break ; /* overpredict ! */
+	    case 0: 
+	    default: z = 0 ; break ; /* predict zero, transmit value */
+	    }
+	  u4 = u3  ; u3 = u2 ; u2 = u1 ; u1 = *sp ;
+	  *zp = u1 - z ;
+	}
+    }
+  return a ;
+}
+
+/**********************************************************/
+
+static BOOL ctfRecorrelate (Read *read, int predictionMode, Array a)
+{ 
+  int j, j1, u1, u2, u3, u4, z = 0 ;
+  short *zp ;
+  TRACE *sp, *tt[4] ;
+  int traceMax = read->NPoints ;
+
+  if (!a || arrayMax(a) != 4 * traceMax)
+    return FALSE ;
+
+  for (j1 = 0 ; j1 < 4 ; j1++) tt[j1] = 0 ; /* to allow harmless abort */
+  zp = arrp (a, 0, short) ;
+  for (j1 = 0 ; j1 < 4 ; j1++)
+    { 
+      /* staden's allocation system */
+      sp = tt[j1] = (TRACE *) malloc(traceMax * sizeof (TRACE)) ;
+      memset (sp, 0, traceMax * sizeof (TRACE)) ;
+      u1 = u2 = u3 = u4 = 0 ;
+      for (j=0 ; j < traceMax ; zp++, sp++, j++)
+	{ 
+	  switch (predictionMode)
+	    {
+	    case 1: z = u1 ; break ; /* predict flat, transmit derivative */
+	    case 2: z = 2*u1 - u2 ; break ; /* predict line trans dd2 */
+	    case 3: z = 3*u1 - 3*u2 + u3 ; break ; /* predict parabole */
+	    case 4: z = 4*u1 - 6*u2 + 4*u3 - u4; break ; /* overpredict ! */
+	    case 0: 
+	    default: z = 0 ; break ; /* predict zero, transmit value */
+	    }
+	  u4 = u3  ; u3 = u2 ; u2 = u1 ; u1 = *sp = z + *zp ;
+	}
+    }
+  read->traceA  = tt[0];
+  read->traceG  = tt[1];
+  read->traceC  = tt[2];
+  read->traceT  = tt[3];
+
+  return TRUE ;
+}
+
+/**********************************************************/
+/**********************************************************/
+/* returns 0: no probability available
+           1: single base proba or equal proba on all bases,
+              in this case, fill mixProba
+           2: independant proba for the various bases
+	   */
+
+static int ctfProbInfoLevel  (Read *read, unsigned char *mixProb)
+{
+  int i, a, t, g, c, n, probInfoLevel = 0 ;
+
+  n = read->NBases ;
+  probInfoLevel = 0 ; i = 0 ;	  
+  if (read->prob_A && read->prob_C && read->prob_G && read->prob_T)
+    while (probInfoLevel < 4 && n--)
+      {
+	i = 0 ; a = t = g = c = 0 ;
+	if ((a = read->prob_A [n])) { mixProb[n] = read->prob_A [n] ; i++ ; }
+	if ((c = read->prob_C [n])) { mixProb[n] = read->prob_C [n] ; i++ ; }
+	if ((g = read->prob_G [n])) { mixProb[n] = read->prob_G [n] ; i++ ; }
+	if ((t = read->prob_T [n])) { mixProb[n] = read->prob_T [n] ; i++ ; }
+	
+	switch (i)
+	  {
+	  case 0: break ;
+	  case 1: probInfoLevel = 1 ; break ;
+	  case 4: if (a == c && a == g && a == t) { probInfoLevel = 1 ; break ; }
+	              /* else fall to default */
+	  default: probInfoLevel = 4 ; break ;
+	  } 
+	/*
+	  if (p++ < 12 ) fprintf (stderr, "probInfoLevel %d %d %d %d %d \n", 
+		 probInfoLevel, a, c, g, t) ;
+		 */
+      }
+  /*  fprintf (stderr, "probInfoLevel %d\n", probInfoLevel) ; */
+  return probInfoLevel ;  
+}
+
+/**********************************************************/
+
+static Array  ctfPackTraces (Read *read)
+{ 
+  signed int x, dx;
+  int section, sectionLength ;
+  int i, n, dataMax, probInfoLevel, 
+    traceMax = read->NPoints, baseMax = read->NBases,
+    safe0 = 0, safe = 50 ;
+  Array a = 0 , a1 = 0, a2 = 0 ;
+  unsigned char *cp, *b ;
+  unsigned short *bp ;
+  unsigned char * mixProb = 0 ; 
+  unsigned char *cq ;
+  Array bb = 0 ;
+  TRACE *ap, *bbp ;
+  
+  ctfTracePeakValue (read) ; /* sets read-> maxTraceVal */
+  mixProb = (unsigned char *) malloc (read->NBases) ;
+
+  probInfoLevel = ctfProbInfoLevel (read, mixProb) ;
+
+lao:  /* the idea is that i will never have to loop */
+  safe = 12 * traceMax + 2 * baseMax + probInfoLevel * baseMax + safe0 * traceMax + 64 ;
+  if (a) arrayDestroy (a) ;
+  a = arrayCreate (safe, unsigned char) ;
+  array (a, safe + 150, unsigned char) = 0 ; /* make room */
+  cp = arrp (a, 0, unsigned char) ;
+  
+
+  ctfStoreInt (cp, MAGIC) ; cp += 4 ; safe -= 4 ;
+
+  /* SECTION 11 bases  */
+  if (!ctfType || strchr(ctfType, '1'))
+    {
+      section = 11 ;
+      sectionLength = baseMax + 8 ;
+      n = baseMax ; 
+      ctfStoreInt (cp, section) ; cp += 4 ; safe -= 4 ;
+      ctfStoreInt (cp, sectionLength) ; cp += 4 ; safe -= 4 ;
+      
+      ctfStoreInt (cp, baseMax) ; cp += 4 ; safe -= 4 ;
+      ctfStoreInt (cp, MAGIC) ; cp += 4 ; safe -= 4 ;
+      
+      n = baseMax ; safe -= n ;
+      b = (unsigned char *)read->base ; 
+      memcpy (cp, b, n) ; cp += n ;
+      
+      ctfStoreInt (cp, MAGIC) ; cp += 4 ; safe -= 4 ;
+    }
+
+  /* SECTION 12 base positions, upgrades old section 1 */
+  if (!ctfType || strchr(ctfType, '1'))
+    {
+      section = 12 ;
+      sectionLength = baseMax + 8 ;
+      n = baseMax ; x = 0 ;
+      bp = read->basePos ;
+      while (n--)
+	{
+	  dx = *bp++ - x + 32 ;
+	  if (dx < 0 || dx > 255)
+	    { sectionLength += 2 ; safe -= 2 ; }
+	}
+      ctfStoreInt (cp, section) ; cp += 4 ; safe -= 4 ;
+      ctfStoreInt (cp, sectionLength) ; cp += 4 ; safe -= 4 ;
+      
+      ctfStoreInt (cp, baseMax) ; cp += 4 ; safe -= 4 ;
+      ctfStoreInt (cp, MAGIC) ; cp += 4 ; safe -= 4 ;
+      
+      n = baseMax ; safe -= n ;
+      x = 0 ;
+      bp = read->basePos ;
+      
+      while (n--)
+	{ 
+	  dx = *bp++ - x + 32 ;
+	  /* these will smoothe away after a few steps */
+	  if (dx < 0)
+	    {
+	      *cp++ = 254 ; dx = -dx ;
+	      *cp++ = (dx >> 8) & 0xff;
+	      *cp++ = (dx >> 0) & 0xff;
+	    }
+	  else if (dx < 254)
+	    *cp++ = dx;
+	  else /* dx >= 254 */
+	    {
+	      *cp++ = 255 ;
+	      *cp++ = (dx >> 8) & 0xff;
+	      *cp++ = (dx >> 0) & 0xff;
+	    }
+	  x += dx - 32; 
+	}
+      
+      ctfStoreInt (cp, MAGIC) ; cp += 4 ; safe -= 4 ;
+    }
+
+  /* SECTION 2 the traces */
+  if (!ctfType || strchr(ctfType, '2'))
+    {
+      a1 = ctfDecorrelate (read, PREDICTIONMODE) ;
+      a2 = ctfCompress (COMPRESSIONMODE, a1) ;
+      dataMax = arrayMax (a2) ;
+      
+      if (1)  /* debugging */
+	{
+	  cq = arrp (a2, 0, unsigned char) ;
+	  bb = ctfDecompress (COMPRESSIONMODE, dataMax, traceMax, &cq) ;
+	  i = 4*traceMax ;
+	  
+	  ap = arrp (a1, 0, TRACE) ;
+	  bbp = arrp (bb, 0, TRACE) ;
+	  while (i--)
+	    if (*ap++ != *bbp++)
+	      {
+		fprintf (stderr, 
+			 "FATAL ERROR bad compress decompress at i = %d\n", i) ;
+		exit (1) ;
+	      }
+	  arrayDestroy (bb) ;
+	}
+      
+      section = 2 ;
+      sectionLength = 16 + dataMax ;
+      ctfStoreInt (cp, section) ; cp += 4 ; safe -= 4 ;
+      ctfStoreInt (cp, sectionLength) ; cp += 4 ; safe -= 4 ;
+      
+      ctfStoreInt (cp, PREDICTIONMODE) ; cp += 4 ; safe -= 4 ;
+      ctfStoreInt (cp, COMPRESSIONMODE) ; cp += 4 ; safe -= 4 ;
+      ctfStoreInt (cp, traceMax) ; cp += 4 ; safe -= 4 ;
+      ctfStoreInt (cp, dataMax) ; cp += 4 ; safe -= 4 ;
+      
+      ctfStoreInt (cp, MAGIC) ; cp += 4 ; safe -= 4 ;
+      
+      if (safe > dataMax)
+	memcpy (cp, arrp(a2, 0, unsigned char), (mysize_t) dataMax) ;
+      cp += dataMax ; safe -= dataMax ;
+      arrayDestroy (a1) ;
+      arrayDestroy (a2) ;
+      if (safe < 0)
+	{ safe0++ ; goto lao ; }
+      
+      /* end section */
+      if (safe < 12)
+	{ safe0++ ; goto lao ; }
+      ctfStoreInt (cp, MAGIC) ; cp += 4 ; safe -= 4 ;
+    }
+
+  
+  /* SECTION 3 miscelaneous info */
+  if (!ctfType || strchr(ctfType, '3'))
+    {
+      section = 3 ;
+      
+      if (read->info)
+	n = strlen(read->info) ;
+      else
+	n = 0 ;
+      if (!read->rightCutoff)
+	read->rightCutoff = read->NBases + 1 ;
+      
+      sectionLength = 20 + n ;
+      ctfStoreInt (cp, section) ; cp += 4 ; safe -= 4 ;
+      ctfStoreInt (cp, sectionLength) ; cp += 4 ; safe -= 4 ;
+      
+      ctfStoreInt (cp, read->leftCutoff) ; cp += 4 ; safe -= 4 ;
+      ctfStoreInt (cp, read->rightCutoff) ; cp += 4 ; safe -= 4 ;
+      ctfStoreInt (cp, read->orig_trace_format) ; cp += 4 ; safe -= 4 ;
+      ctfStoreInt (cp, read->maxTraceVal) ; cp += 4 ; safe -= 4 ;
+      ctfStoreInt (cp, n) ; cp += 4 ; safe -= 4 ;
+      if (n > 0 && safe > n) 
+	{ strncpy ((char *)cp, read->info, n) ; cp += n ; } ; 
+      safe -= n ;
+      /* end section */
+      if (safe < 12)
+	{ safe0++ ; goto lao ; }
+      ctfStoreInt (cp, MAGIC) ; cp += 4 ; safe -= 4 ;
+    }
+
+  /* SECTION 4 Probability information */  
+  if (!ctfType || strchr(ctfType, '4'))
+    {
+      switch (probInfoLevel)
+	{
+	case 4:
+	  section = 4 ;
+	  sectionLength = 4 * baseMax + 4 ; n = baseMax ;
+	  ctfStoreInt (cp, section) ; cp += 4 ; safe -= 4 ;
+	  ctfStoreInt (cp, sectionLength) ; cp += 4 ; safe -= 4 ;
+	  
+	  ctfStoreInt (cp, baseMax) ; cp += 4 ; safe -= 4 ;
+	  if (safe > n) { memcpy (cp, read->prob_A, n) ; cp += n ;} 
+	  safe -= n ; 
+	  if (safe > n) { memcpy (cp, read->prob_C, n) ; cp += n ; }
+	  safe -= n ; 
+	  if (safe > n) { memcpy (cp, read->prob_G, n) ; cp += n ; }
+	  safe -= n ; 
+	  if (safe > n) { memcpy (cp, read->prob_T, n) ; cp += n ; }
+	  safe -= n ; 
+	  if (safe < 12)
+	    { safe0++ ; goto lao ; }
+
+	  ctfStoreInt (cp, MAGIC) ; cp += 4 ; safe -= 4 ;
+	  break ;
+	case 1:
+	  section = 5 ;
+	  sectionLength = baseMax + 4 ; n = baseMax ;
+	  ctfStoreInt (cp, section) ; cp += 4 ; safe -= 4 ;
+	  ctfStoreInt (cp, sectionLength) ; cp += 4 ; safe -= 4 ;
+	  
+	  ctfStoreInt (cp, baseMax) ; cp += 4 ; safe -= 4 ;
+	  if (safe > n) { memcpy (cp, mixProb, n) ; cp += n ; safe -= n ; }
+	  if (safe < 12)
+	    { safe0++ ; goto lao ; }
+	  
+	  ctfStoreInt (cp, MAGIC) ; cp += 4 ; safe -= 4 ;
+	  break ;
+	}
+    }
+
+  /* SECTION 999 the end */
+  if (TRUE)
+    {
+      section = 999 ;
+      sectionLength = 0 ;
+      ctfStoreInt (cp, section) ; cp += 4 ; safe -= 4 ;
+      ctfStoreInt (cp, sectionLength) ; cp += 4 ; safe -= 4 ;
+      
+      ctfStoreInt (cp, MAGIC) ; cp += 4 ; safe -= 4 ;
+      
+      if (safe < 0)
+	{ safe0++ ; goto lao ; }
+    }
+
+  arrayMax (a) = cp - arrp (a, 0, unsigned char) ;
+
+  free (mixProb) ;
+  return a ;  
+}
+
+/**********************************************************/
+
+static void ctfUnmixProb (Read *read, int n, unsigned char *mixProb) 
+{
+  unsigned char *cp, *cq, *ca, *cg, *ct, *cc ;
+
+  ca = (unsigned char *)(read->prob_A = (char *) malloc (n)) ;
+  cc = (unsigned char *)(read->prob_C = (char *) malloc (n)) ;
+  cg = (unsigned char *)(read->prob_G = (char *) malloc (n)) ;
+  ct = (unsigned char *)(read->prob_T = (char *) malloc (n)) ;
+  cp = (unsigned char *)read->base ;
+  cq = mixProb ;
+  while (n--)
+    switch (*cp++)
+      {
+      case 'A': case 'a':
+	*ca++ = *cq++ ; *cc++ = *cg++ = *ct++ = 0 ;
+	break ;
+      case 'C': case 'c':
+	*cc++ = *cq++ ; *cg++ = *ct++ = *ca++ = 0 ;
+	break ;
+      case 'G': case 'g':	
+	*cg++ = *cq++ ; *ct++ = *ca++ = *cc++ = 0 ;
+	break ;
+      case 'T': case 't':	
+	*ct++ = *cq++ ; *ca++ = *cc++ = *cg++ = 0 ;
+	break ;
+      default:
+	*ca++ = *cc++ = *cg++ = *ct++ = *cq++ ;
+	break ;
+      }
+}
+
+/**********************************************************/
+
+#define CHECKMAGIC   \
+magic = ctfGetInt (cp) ; \
+cp += 4 ; nn -= 4 ; \
+if (magic != MAGIC) \
+{ \
+  fprintf (stderr, "Error reading compressed trace file, sorry\n") ;  \
+  goto abort ; \
+}
+
+
+static BOOL ctfUnPackTraces (Read *read, Array a)
+{ 
+  int compressionMode, predictionMode, magic ;
+  int section, sectionLength ;
+  int n, nn, traceMax, baseMax, dataMax, nMixProb = 0 ;
+  signed int x, dx;
+  Array  decompressedData = 0 ;
+  unsigned char *cp, *b ;
+  unsigned short *bp ;
+  unsigned char *ucp, *mixProb = 0 ;
+
+  if (!arrayExists (a))
+    return FALSE ;
+
+  cp = arrp (a, 0, unsigned char) ; nn = arrayMax (a) ;
+
+  while (TRUE)
+    {
+      CHECKMAGIC ; 
+      section = ctfGetInt (cp) ; cp += 4 ; nn -= 4 ;
+      sectionLength = ctfGetInt (cp) ; cp += 4 ; nn -= 4 ;
+      switch (section)
+	{
+	case 999:  /* end of record */
+	  goto done ;
+	case 1:  /* read the bases  and positions, problem if negative dx */
+	  baseMax = read->NBases = ctfGetInt (cp) ; cp += 4 ; nn -= 4 ;
+	  CHECKMAGIC ;
+
+	  n = baseMax ; nn -= 2 * n ;
+
+	  read->base = (char *)malloc (baseMax) ; /* staden's alloc */
+	  b = (unsigned char *)read->base;
+	  bp = read->basePos = (unsigned short *) malloc (baseMax * sizeof (unsigned short)) ;
+	  
+	  x = 0 ;
+	  
+	  while (n--)
+	    { x += *cp++ ;
+	    *bp++ = x ;
+	    switch ((*cp++) & 0xf)
+	     {
+	     case A_: *b++ = 'A' ; break ;
+	     case T_: *b++ = 'T' ; break ;
+	     case G_: *b++ = 'G' ; break ;
+	     case C_: *b++ = 'C' ; break ;
+	     default: *b++ = 'N' ; break ;
+	     }
+	    }
+	  break ;
+	  
+	case 11:  /* read the basecall, fullproof method */
+	  baseMax = read->NBases = ctfGetInt (cp) ; cp += 4 ; nn -= 4 ;
+	  CHECKMAGIC ;
+
+	  n = baseMax ; nn -= n ;
+	  b = (unsigned char *)(read->base = (char *)malloc (baseMax)) ; 
+	  memcpy (b, cp, n) ;
+	  cp += n ;
+	  break ;
+	  
+	case 12:  /* read the baspos, fullproof method */
+	  baseMax = read->NBases = ctfGetInt (cp) ; cp += 4 ; nn -= 4 ;
+	  CHECKMAGIC ;
+
+	  n = baseMax ; nn -= n ;
+
+	  bp = read->basePos = (unsigned short *) malloc (baseMax * sizeof (unsigned short)) ;
+	  
+	  x = 0 ;
+	  while (n--)
+	    { 
+	      dx = (unsigned char) *cp++;
+	      if (dx == 254) 
+		{
+		  dx = (cp[0] << 8) | cp[1];
+		  cp += 2; nn -= 2 ;
+		  dx = -dx ;
+		}
+	      else if (dx == 255) 
+		{
+		  dx = (cp[0] << 8) | cp[1];
+		  cp += 2; nn -= 2 ;
+		}
+	      dx -= 32 ;
+	      x += dx;
+	      *bp++ = x ;
+	    }
+	  break ;
+	  
+	case 2:  /* read the traces */
+	  predictionMode = ctfGetInt (cp) ; cp += 4 ; nn -= 4 ;
+	  compressionMode = ctfGetInt (cp) ; cp += 4 ; nn -= 4 ;
+	  traceMax = read->NPoints = ctfGetInt (cp) ; cp += 4 ; nn -= 4 ;
+	  dataMax = ctfGetInt (cp) ; cp += 4 ; nn -= 4 ;
+	  CHECKMAGIC ;
+	  decompressedData = ctfDecompress (compressionMode, dataMax, traceMax, &cp) ;
+	  if (!ctfRecorrelate (read, predictionMode, decompressedData))
+	    goto abort ;	  
+	  arrayDestroy (decompressedData) ;
+	  break ;
+	  
+	case 3:  /* read miscelaneous info */
+	  read->leftCutoff = ctfGetInt (cp) ; cp += 4 ; nn -= 4 ;
+	  read->rightCutoff = ctfGetInt (cp) ; cp += 4 ; nn -= 4 ;
+	  read->orig_trace_format = ctfGetInt (cp) ; cp += 4 ; nn -= 4 ; 
+	  read->maxTraceVal = ctfGetInt (cp) ; cp += 4 ; nn -= 4 ;
+	  n = ctfGetInt (cp) ; cp += 4 ; nn -= 4 ;
+	  if (n > 0)
+	    {
+	      read->info = (char *) malloc (n+1) ; 
+	      strncpy (read->info, (char *)cp, n) ; cp += n ; nn -= n ;
+	      read->info[n] = 0 ; /* zero terminate the string */
+	    }
+	  break ;
+
+	case 4:  /*  Probability information */  
+	  n = ctfGetInt (cp) ; cp += 4 ; nn -= 4 ;
+	  read->prob_A = (char *) malloc (n) ;
+	  read->prob_C = (char *) malloc (n) ;
+	  read->prob_G = (char *) malloc (n) ;
+	  read->prob_T = (char *) malloc (n) ;
+	  memcpy (read->prob_A, cp, n) ; cp += n ; nn -= n ;
+	  memcpy (read->prob_C, cp, n) ; cp += n ; nn -= n ;
+	  memcpy (read->prob_G, cp, n) ; cp += n ; nn -= n ;
+	  memcpy (read->prob_T, cp, n) ; cp += n ; nn -= n ; 
+	  break ;
+
+	case 5:  /*  Mixed Probability information */  
+	  n = ctfGetInt (cp) ; cp += 4 ; nn -= 4 ;
+	  mixProb = (unsigned char*) malloc (n) ; nMixProb = n ;
+	  ucp = cp ; /* to please memcpy */
+	  memcpy (mixProb, ucp, n) ; cp += n ; nn -= n ; 
+	  break ;
+
+	case 6:
+	  /* The original input format data, used in staden's
+	     int orig_trace_format;
+	     void *orig_trace;
+	     
+	     i do not yet support that because i am not sure it is used
+	     so i
+	     */
+
+	  /*   fallthru  to default */
+
+	default: /* not yet defined stuff */
+	  cp += sectionLength ; 
+	  break ;
+	}
+    }
+
+ done:
+  if (mixProb)
+    {
+      if (read->NBases == nMixProb)
+	ctfUnmixProb (read, nMixProb, mixProb) ; 
+      else
+	fprintf (stderr, "mixProb problem, read->NBases = %d nMixProb = %d",
+		   read->NBases, nMixProb ) ;
+    }
+  if (!read->rightCutoff)
+    read->rightCutoff = read->NBases + 1 ;
+  
+
+  if (mixProb) free (mixProb) ;
+  CHECKMAGIC ;   /* terminal CHECK */
+  return TRUE ;
+
+ abort:
+  arrayDestroy (decompressedData) ;
+
+  freeSeq (read) ;
+  return FALSE ;
+}
+
+/**********************************************************/
+/**********************************************************/
+/**********************************************************/
+
+static BOOL ctfWriteTrace (FILE *ff, Array a)
+{
+  int n ; char *cp ;
+
+  n = arrayMax (a) ;  cp = arrp (a, 0, char) ;
+  fwrite (cp, n, 1, ff) ;
+  return TRUE ;
+} 
+
+/**********************************************************/
+
+static Array ctfReadTrace (FILE *fil)
+{
+  unsigned int i = 0, nr, nb = 100000, size = 1 ; 
+  unsigned char *cp ;
+  Array a = arrayCreate (nb, unsigned char) ;
+
+  do
+    {
+      array(a,(++i)*nb,unsigned char) = 0 ; /* to create space */
+      cp = arrp(a,nb*(i-1),unsigned char) ; /* possible relocation */
+    }
+  while ((nr = fread (cp, size, nb, fil)) == nb) ;
+  
+  arrayMax(a) -= nb - nr; /* artificial space removed */
+ 
+  if(!arrayMax(a))
+    arrayDestroy(a) ;
+
+  return a ;
+} 
+
+/**********************************************************/
+/**********************************************************/
+/*****   interaction with staden 's makeSCF ***************/
+/**********************************************************/
+
+int ctfFWrite (FILE *ff, Read *read) 
+{
+  int result = -1 ; /* assume error */
+
+  if (read &&  read->NBases && read->NPoints && ff)
+    {
+      Array a = ctfPackTraces (read);
+      
+      ctfWriteTrace (ff, a) ;
+      arrayDestroy (a) ;
+  
+      result = 0 ; /* success */
+    }
+
+  return result ;
+} /* ctfFWrite */
+
+/**********************************************************/
+
+Read *ctfFRead (FILE *ff)
+{
+  Read * read = 0 ;
+  int NBases = 0 ;
+  Array a = 0 ;
+
+  if ((a = ctfReadTrace (ff)) &&
+      (read =  (Read *) malloc (sizeof(Read))))
+    {
+      memset (read, 0, sizeof(Read)) ;
+      if (ctfUnPackTraces (read, a))
+	{
+	  read->format = TT_CTF ;
+	  NBases = read->NBases ;
+	  
+	  if (!read->prob_A) 
+	    {
+	      read->prob_A = (char *) malloc (NBases) ;
+	      if (!read->prob_C) read->prob_C = (char *) malloc (NBases) ;
+	      if (!read->prob_G) read->prob_G = (char *) malloc (NBases) ;
+	      if (!read->prob_T) read->prob_T = (char *) malloc (NBases) ;
+	      memset (read->prob_A, 0, NBases) ;
+	      memset (read->prob_C, 0, NBases) ;
+	      memset (read->prob_G, 0, NBases) ;
+	      memset (read->prob_T, 0, NBases) ;
+	    }
+	  
+	  read->orig_trace = 0x0 ;
+	}
+      else
+	read = 0 ;
+    }
+
+ arrayDestroy (a) ;
+ return read ;
+}  /* ctfFRead */
+
+/* Examples
+   run -s -any /users/mieg/CTFtest/tt/a.scf -ctfout a.scf.ctf
+   run -s -any /users/mieg/CTFtest/tt/a.scf.ctf -output a.scf.ctf.scf
+   */
+
+/**********************************************************/
+/**********************************************************/
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/deflate_interlaced.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,2282 @@
+/*
+ * This code implements "interlaced deflate", and is *based* on a
+ * simplistic implementation of the Deflate algorithm.
+ * See http://www.ietf.org/rfc/rfc1951.txt for details on the original
+ * Deflate algorithm.
+ *
+ * It differs from RFC1951 in two important ways:
+ *
+ * 1) It only supports the huffman encoding step and does not attempt
+ *    to do any LZ-style string matching to generate distance codes.
+ *    (These generally do not improve data compression for our desired
+ *    use.)
+ *
+ * 2) It optionally allows interleaving of multiple huffman trees for
+ *    a single data stream. NB: when multiple codes are used this is
+ *    incompatible with RFC1951.
+ *
+ * It has been written here, instead of using zlib, so that we can separate
+ * out the encoding of the huffman tree from the compression of the data
+ * stream into separate memory sections with the intent to optimise
+ * compression of very small blocks of data by sharing one set of frequency
+ * tables (ie huffman tree) with multiple sets of compressed data blocks.
+ *
+ * James Bonfield, 2007
+ */
+
+#define NDEBUG /* disable asserts for production use */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <unistd.h>
+#include <assert.h>
+#include <unistd.h>
+
+#include "io_lib/deflate_interlaced.h"
+
+#ifndef MIN
+#    define MIN(a,b) ((a) < (b) ? (a) : (b))
+#endif
+#ifndef MAX
+#    define MAX(a,b) ((a) > (b) ? (a) : (b))
+#endif
+
+/* #define TEST_MAIN */
+
+/*
+ * ---------------------------------------------------------------------------
+ * Local structs & defines
+ */
+
+/* Used in tree construction only */
+typedef struct node {
+    int count;
+    int sym; /* char or SYM_EOF */
+    struct node *parent;
+    struct node *next;
+} node_t;
+
+#define SYM_EOF 256
+
+static void output_code_set(FILE *fp, huffman_codes_t *codes);
+static void output_code_set2(FILE *fp, huffman_codes_t *codes);
+int next_symbol(block_t *in, int *htab);
+
+/*
+ * ---------------------------------------------------------------------------
+ * Our standard precomputed tables, for DNA, English text, etc.
+ */
+
+/* DNA */
+/*
+ * A   00
+ * C   01
+ * G   110
+ * T   10
+ * N   1110
+ * EOF 11110
+ * ?   11111*
+ */
+static huffman_code_t codes_dna[] = {
+    {'A',  2}, {'C',  2}, {'T',  2}, {'G',  3}, {'N',  4}, {  0,  5},
+    {SYM_EOF,  6},
+    {  1, 13}, {  2, 13}, {  3, 13}, {  4, 13}, {  5, 13}, {  6, 13},
+    {  7, 14}, {  8, 14}, {  9, 14}, { 10, 14}, { 11, 14}, { 12, 14},
+    { 13, 14}, { 14, 14}, { 15, 14}, { 16, 14}, { 17, 14}, { 18, 14},
+    { 19, 14}, { 20, 14}, { 21, 14}, { 22, 14}, { 23, 14}, { 24, 14},
+    { 25, 14}, { 26, 14}, { 27, 14}, { 28, 14}, { 29, 14}, { 30, 14},
+    { 31, 14}, { 32, 14}, { 33, 14}, { 34, 14}, { 35, 14}, { 36, 14},
+    { 37, 14}, { 38, 14}, { 39, 14}, { 40, 14}, { 41, 14}, { 42, 14},
+    { 43, 14}, { 44, 14}, { 45, 14}, { 46, 14}, { 47, 14}, {'0', 14},
+    {'1', 14}, {'2', 14}, {'3', 14}, {'4', 14}, {'5', 14}, {'6', 14},
+    {'7', 14}, {'8', 14}, {'9', 14}, { 58, 14}, { 59, 14}, { 60, 14},
+    { 61, 14}, { 62, 14}, { 63, 14}, { 64, 14}, {'B', 14}, {'D', 14},
+    {'E', 14}, {'F', 14}, {'H', 14}, {'I', 14}, {'J', 14}, {'K', 14},
+    {'L', 14}, {'M', 14}, {'O', 14}, {'P', 14}, {'Q', 14}, {'R', 14},
+    {'S', 14}, {'U', 14}, {'V', 14}, {'W', 14}, {'X', 14}, {'Y', 14},
+    {'Z', 14}, { 91, 14}, { 92, 14}, { 93, 14}, { 94, 14}, { 95, 14},
+    { 96, 14}, {'a', 14}, {'b', 14}, {'c', 14}, {'d', 14}, {'e', 14},
+    {'f', 14}, {'g', 14}, {'h', 14}, {'i', 14}, {'j', 14}, {'k', 14},
+    {'l', 14}, {'m', 14}, {'n', 14}, {'o', 14}, {'p', 14}, {'q', 14},
+    {'r', 14}, {'s', 14}, {'t', 14}, {'u', 14}, {'v', 14}, {'w', 14},
+    {'x', 14}, {'y', 14}, {'z', 14}, {123, 14}, {124, 14}, {125, 14},
+    {126, 14}, {127, 14}, {128, 14}, {129, 14}, {130, 14}, {131, 14},
+    {132, 14}, {133, 14}, {134, 14}, {135, 14}, {136, 14}, {137, 14},
+    {138, 14}, {139, 14}, {140, 14}, {141, 14}, {142, 14}, {143, 14},
+    {144, 14}, {145, 14}, {146, 14}, {147, 14}, {148, 14}, {149, 14},
+    {150, 14}, {151, 14}, {152, 14}, {153, 14}, {154, 14}, {155, 14},
+    {156, 14}, {157, 14}, {158, 14}, {159, 14}, {160, 14}, {161, 14},
+    {162, 14}, {163, 14}, {164, 14}, {165, 14}, {166, 14}, {167, 14},
+    {168, 14}, {169, 14}, {170, 14}, {171, 14}, {172, 14}, {173, 14},
+    {174, 14}, {175, 14}, {176, 14}, {177, 14}, {178, 14}, {179, 14},
+    {180, 14}, {181, 14}, {182, 14}, {183, 14}, {184, 14}, {185, 14},
+    {186, 14}, {187, 14}, {188, 14}, {189, 14}, {190, 14}, {191, 14},
+    {192, 14}, {193, 14}, {194, 14}, {195, 14}, {196, 14}, {197, 14},
+    {198, 14}, {199, 14}, {200, 14}, {201, 14}, {202, 14}, {203, 14},
+    {204, 14}, {205, 14}, {206, 14}, {207, 14}, {208, 14}, {209, 14},
+    {210, 14}, {211, 14}, {212, 14}, {213, 14}, {214, 14}, {215, 14},
+    {216, 14}, {217, 14}, {218, 14}, {219, 14}, {220, 14}, {221, 14},
+    {222, 14}, {223, 14}, {224, 14}, {225, 14}, {226, 14}, {227, 14},
+    {228, 14}, {229, 14}, {230, 14}, {231, 14}, {232, 14}, {233, 14},
+    {234, 14}, {235, 14}, {236, 14}, {237, 14}, {238, 14}, {239, 14},
+    {240, 14}, {241, 14}, {242, 14}, {243, 14}, {244, 14}, {245, 14},
+    {246, 14}, {247, 14}, {248, 14}, {249, 14}, {250, 14}, {251, 14},
+    {252, 14}, {253, 14}, {254, 14}, {255, 14},
+};
+
+/* DNA with a few ambiguity codes */
+static huffman_code_t codes_dna_ambig[] = {
+    {'A',  2}, {'C',  2}, {'T',  2}, {'G',  3}, {'N',  4}, {  0,  7},
+    { 45,  7}, {'B',  8}, {'D',  8}, {'H',  8}, {'K',  8}, {'M',  8},
+    {'R',  8}, {'S',  8}, {'V',  8}, {'W',  8}, {'Y',  8}, {SYM_EOF, 11},
+    {226, 14}, {  1, 15}, {  2, 15}, {  3, 15}, {  4, 15}, {  5, 15},
+    {  6, 15}, {  7, 15}, {  8, 15}, {  9, 15}, { 10, 15}, { 11, 15},
+    { 12, 15}, { 13, 15}, { 14, 15}, { 15, 15}, { 16, 15}, { 17, 15},
+    { 18, 15}, { 19, 15}, { 20, 15}, { 21, 15}, { 22, 15}, { 23, 15},
+    { 24, 15}, { 25, 15}, { 26, 15}, { 27, 15}, { 28, 15}, { 29, 15},
+    { 30, 15}, { 31, 15}, { 32, 15}, { 33, 15}, { 34, 15}, { 35, 15},
+    { 36, 15}, { 37, 15}, { 38, 15}, { 39, 15}, { 40, 15}, { 41, 15},
+    { 42, 15}, { 43, 15}, { 44, 15}, { 46, 15}, { 47, 15}, {'0', 15},
+    {'1', 15}, {'2', 15}, {'3', 15}, {'4', 15}, {'5', 15}, {'6', 15},
+    {'7', 15}, {'8', 15}, {'9', 15}, { 58, 15}, { 59, 15}, { 60, 15},
+    { 61, 15}, { 62, 15}, { 63, 15}, { 64, 15}, {'E', 15}, {'F', 15},
+    {'I', 15}, {'J', 15}, {'L', 15}, {'O', 15}, {'P', 15}, {'Q', 15},
+    {'U', 15}, {'X', 15}, {'Z', 15}, { 91, 15}, { 92, 15}, { 93, 15},
+    { 94, 15}, { 95, 15}, { 96, 15}, {'a', 15}, {'b', 15}, {'c', 15},
+    {'d', 15}, {'e', 15}, {'f', 15}, {'g', 15}, {'h', 15}, {'i', 15},
+    {'j', 15}, {'k', 15}, {'l', 15}, {'m', 15}, {'n', 15}, {'o', 15},
+    {'p', 15}, {'q', 15}, {'r', 15}, {'s', 15}, {'t', 15}, {'u', 15},
+    {'v', 15}, {'w', 15}, {'x', 15}, {'y', 15}, {'z', 15}, {123, 15},
+    {124, 15}, {125, 15}, {126, 15}, {127, 15}, {128, 15}, {129, 15},
+    {130, 15}, {131, 15}, {132, 15}, {133, 15}, {134, 15}, {135, 15},
+    {136, 15}, {137, 15}, {138, 15}, {139, 15}, {140, 15}, {141, 15},
+    {142, 15}, {143, 15}, {144, 15}, {145, 15}, {146, 15}, {147, 15},
+    {148, 15}, {149, 15}, {150, 15}, {151, 15}, {152, 15}, {153, 15},
+    {154, 15}, {155, 15}, {156, 15}, {157, 15}, {158, 15}, {159, 15},
+    {160, 15}, {161, 15}, {162, 15}, {163, 15}, {164, 15}, {165, 15},
+    {166, 15}, {167, 15}, {168, 15}, {169, 15}, {170, 15}, {171, 15},
+    {172, 15}, {173, 15}, {174, 15}, {175, 15}, {176, 15}, {177, 15},
+    {178, 15}, {179, 15}, {180, 15}, {181, 15}, {182, 15}, {183, 15},
+    {184, 15}, {185, 15}, {186, 15}, {187, 15}, {188, 15}, {189, 15},
+    {190, 15}, {191, 15}, {192, 15}, {193, 15}, {194, 15}, {195, 15},
+    {196, 15}, {197, 15}, {198, 15}, {199, 15}, {200, 15}, {201, 15},
+    {202, 15}, {203, 15}, {204, 15}, {205, 15}, {206, 15}, {207, 15},
+    {208, 15}, {209, 15}, {210, 15}, {211, 15}, {212, 15}, {213, 15},
+    {214, 15}, {215, 15}, {216, 15}, {217, 15}, {218, 15}, {219, 15},
+    {220, 15}, {221, 15}, {222, 15}, {223, 15}, {224, 15}, {225, 15},
+    {227, 15}, {228, 15}, {229, 15}, {230, 15}, {231, 15}, {232, 15},
+    {233, 15}, {234, 15}, {235, 15}, {236, 15}, {237, 15}, {238, 15},
+    {239, 15}, {240, 15}, {241, 15}, {242, 15}, {243, 15}, {244, 15},
+    {245, 15}, {246, 15}, {247, 15}, {248, 15}, {249, 15}, {250, 15},
+    {251, 15}, {252, 15}, {253, 15}, {254, 15}, {255, 15},
+};
+
+/* English text */
+static huffman_code_t codes_english[] = {
+    { 32,  3}, {'e',  3}, {'a',  4}, {'i',  4}, {'n',  4}, {'o',  4},
+    {'s',  4}, {'t',  4}, {'d',  5}, {'h',  5}, {'l',  5}, {'r',  5},
+    {'u',  5}, { 10,  6}, { 13,  6}, { 44,  6}, {'c',  6}, {'f',  6},
+    {'g',  6}, {'m',  6}, {'p',  6}, {'w',  6}, {'y',  6}, { 46,  7},
+    {'b',  7}, {'v',  7}, { 34,  8}, {'I',  8}, {'k',  8}, { 45,  9},
+    {'A',  9}, {'N',  9}, {'T',  9}, { 39, 10}, { 59, 10}, { 63, 10},
+    {'B', 10}, {'C', 10}, {'E', 10}, {'H', 10}, {'M', 10}, {'S', 10},
+    {'W', 10}, {'x', 10}, { 33, 11}, {'0', 11}, {'1', 11}, {'F', 11},
+    {'G', 11}, {  0, 15}, {  1, 15}, {  2, 15}, {  3, 15}, {  4, 15},
+    {  5, 15}, {  6, 15}, {  7, 15}, {  8, 15}, {  9, 15}, { 11, 15},
+    { 12, 15}, { 14, 15}, { 15, 15}, { 16, 15}, { 17, 15}, { 18, 15},
+    { 19, 15}, { 20, 15}, { 21, 15}, { 22, 15}, { 23, 15}, { 24, 15},
+    { 25, 15}, { 26, 15}, { 27, 15}, { 28, 15}, { 29, 15}, { 30, 15},
+    { 31, 15}, { 35, 15}, { 36, 15}, { 37, 15}, { 38, 15}, { 40, 15},
+    { 41, 15}, { 42, 15}, { 43, 15}, { 47, 15}, {'2', 15}, {'3', 15},
+    {'4', 15}, {'5', 15}, {'6', 15}, {'7', 15}, {'8', 15}, {'9', 15},
+    { 58, 15}, { 60, 15}, { 61, 15}, { 62, 15}, { 64, 15}, {'D', 15},
+    {'J', 15}, {'K', 15}, {'L', 15}, {'O', 15}, {'P', 15}, {'Q', 15},
+    {'R', 15}, {'U', 15}, {'V', 15}, {'X', 15}, {'Y', 15}, {'Z', 15},
+    { 91, 15}, { 92, 15}, { 93, 15}, { 94, 15}, { 95, 15}, { 96, 15},
+    {'j', 15}, {'q', 15}, {'z', 15}, {123, 15}, {124, 15}, {125, 15},
+    {126, 15}, {127, 15}, {128, 15}, {129, 15}, {130, 15}, {131, 15},
+    {132, 15}, {133, 15}, {134, 15}, {135, 15}, {136, 15}, {137, 15},
+    {138, 15}, {139, 15}, {140, 15}, {141, 15}, {142, 15}, {143, 15},
+    {144, 15}, {145, 15}, {146, 15}, {147, 15}, {148, 15}, {149, 15},
+    {150, 15}, {151, 15}, {152, 15}, {153, 15}, {154, 15}, {155, 15},
+    {156, 15}, {157, 15}, {158, 15}, {159, 15}, {160, 15}, {161, 15},
+    {162, 15}, {163, 15}, {164, 15}, {165, 15}, {166, 15}, {167, 15},
+    {168, 15}, {169, 15}, {170, 15}, {171, 15}, {172, 15}, {173, 15},
+    {174, 15}, {175, 15}, {176, 15}, {177, 15}, {178, 15}, {179, 15},
+    {180, 15}, {181, 15}, {182, 15}, {183, 15}, {184, 15}, {185, 15},
+    {186, 15}, {187, 15}, {188, 15}, {189, 15}, {190, 15}, {191, 15},
+    {192, 15}, {193, 15}, {194, 15}, {195, 15}, {196, 15}, {197, 15},
+    {198, 15}, {199, 15}, {200, 15}, {201, 15}, {202, 15}, {203, 15},
+    {204, 15}, {205, 15}, {206, 15}, {207, 15}, {208, 15}, {209, 15},
+    {210, 15}, {211, 15}, {212, 15}, {213, 15}, {214, 15}, {215, 15},
+    {216, 15}, {217, 15}, {218, 15}, {219, 15}, {220, 15}, {221, 15},
+    {222, 15}, {223, 15}, {224, 15}, {225, 15}, {226, 15}, {227, 15},
+    {228, 15}, {229, 15}, {230, 15}, {231, 15}, {232, 15}, {233, 15},
+    {234, 15}, {235, 15}, {236, 15}, {237, 15}, {238, 15}, {239, 15},
+    {240, 15}, {241, 15}, {242, 15}, {243, 15}, {244, 15}, {245, 15},
+    {246, 15}, {247, 15}, {248, 15}, {249, 15}, {250, 15}, {251, 15},
+    {252, 15}, {253, 15}, {254, 15}, {255, 15}, {SYM_EOF, 15},
+};
+
+static huffman_codeset_t *static_codeset[NCODES_STATIC];
+
+/*
+ * ---------------------------------------------------------------------------
+ * Block_t structure support
+ */
+
+/*
+ * Allocates and returns a new block_t struct of a specified default size.
+ * A default 'data' pointer may be passed in, in which it must have
+ * been created using malloc(size). Otherwise if data is NULL then
+ * size indicates the amount of memory to allocate. Size maybe zero to
+ * defer allocation.
+ *
+ * Returns newly created block_t* on success
+ *         NULL on failure
+ */
+block_t *block_create(unsigned char *data, size_t size) {
+    block_t *b = (block_t *)malloc(sizeof(*b));
+    if (!b)
+	return NULL;
+
+    b->data = data;
+    b->alloc = size;
+    b->byte = 0;
+    b->bit = 0;
+
+    if (size && !data && NULL == (b->data = calloc(size, 1))) {
+	free(b);
+	return NULL;
+    }
+
+    return b;
+}
+
+/*
+ * Deallocates memory created by block_create().
+ * keep_data is a boolean which if true requests that the data held within
+ * the block should not be deallocated as it is in use elsewhere.
+ */
+void block_destroy(block_t *blk, int keep_data) {
+    if (!blk)
+	return;
+
+    if (!keep_data && blk->data)
+	free(blk->data);
+    
+    free(blk);
+}
+
+/*
+ * Ensures a block_t holds at least 'size' bytes.
+ * Newly allocated data is initialised to zero.
+ *
+ * Returns 0 on success
+ *        -1 on failure, leaving block pointing to the existing data
+ */
+int block_resize(block_t *blk, size_t size) {
+    unsigned char *newp = NULL;
+
+    if (!blk)
+	return -1;
+
+    /* Grow size to next power of 2, if we're growing */
+    if (size > blk->alloc) {
+	size--;
+	size |= size >> 1;
+	size |= size >> 2;
+	size |= size >> 4;
+	size |= size >> 8;
+	size |= size >> 16;
+	size++;
+    }
+
+    if (NULL == (newp = realloc(blk->data, size)))
+	return -1;
+    else
+	blk->data = newp;
+
+    if (size > blk->alloc)
+	memset(&blk->data[blk->alloc], 0, size - blk->alloc);
+    blk->alloc = size;
+
+    return 0;
+}
+
+
+/*
+ * ---------------------------------------------------------------------------
+ * Tree building and code generation functions
+ */
+
+/*
+ * Reverses the order of bits in the bottom nbits of val.
+ * Returns the bit-reverse value.
+ */
+unsigned int bit_reverse(unsigned int val, int nbits) {
+    unsigned int new = 0, i;
+
+    for (i = 0; i < nbits; i++) {
+	new = (new << 1) | (val & 1);
+	val >>= 1;
+    }
+
+    return new;
+}
+
+
+/*
+ * Generates canonical huffman codes given a set of symbol bit lengths.
+ * The results are stored within the supplied huffman_codes_t struct.
+ *
+ * Returns 0 on success
+ *        -1 on failure
+ */
+static int canonical_codes(huffman_codes_t *c) {
+    int i, j;
+    unsigned int code, last_len;
+    int clens[33];
+    int offs[33];
+    huffman_code_t ctmp[258];
+    signed int symtab[258];
+
+    /* Sort by bit-length, subfield symbol - much faster than qsort() */
+    for (i = 0; i < 258; i++)
+	symtab[i] = -1;
+    for (i = 0; i < c->ncodes; i++)
+	symtab[c->codes[i].symbol] = i;
+    for (i = 0; i <= 32; i++)
+	offs[i] = clens[i] = 0;
+    for (i = 0; i < c->ncodes; i++)
+	clens[c->codes[i].nbits]++;
+    for (i = 1; i <= 32; i++)
+	offs[i] = offs[i-1] + clens[i-1];
+    for (i = 0; i < 258; i++) {
+	if (symtab[i] != -1)
+	    ctmp[offs[c->codes[symtab[i]].nbits]++] = c->codes[symtab[i]];
+    }
+    memcpy(c->codes, ctmp, c->ncodes * sizeof(huffman_code_t));
+
+    /*
+     * Force all codes to be <= max_code_len. This is needed due to the
+     * 15-bit length limitation of Deflate literal codes and the 7-bit 
+     * limit of the code bit-length table.
+     */
+    /* Find first point of failure */
+    for (i = 0; i < c->ncodes; i++) {
+	if (c->codes[i].nbits > c->max_code_len)
+	    break;
+    }
+
+    /*
+     * From here on we shrink the length of the current code by increasing
+     * the length of an earlier symbol, at last_code.
+     */
+    if (i != c->ncodes) {
+	int delta = 0;
+
+	/*
+	fprintf(stderr, "=== REORDERING %d ===\n", c->code_set);
+	output_code_set(stderr, c);
+	output_code_set2(stderr, c);
+	*/
+
+	for (; i < c->ncodes; i++) {
+	    int k, cur_len;
+
+	    c->codes[i].nbits -= delta;
+	    if (c->codes[i].nbits <= c->max_code_len)
+		continue;
+
+	    for (j = i; j >= 0 && c->codes[j].nbits >= c->max_code_len; j--)
+		;
+	    if (j < 0) {
+		fprintf(stderr,
+			"Too many symbols to fit in bit-length requirements\n");
+		fprintf(stderr, "=== FAILING ===\n");
+		output_code_set(stderr, c);
+		output_code_set2(stderr, c);
+		abort();
+	    }
+
+	    /*
+	    fprintf(stderr, "Changing code %d/%d to len %d\n",
+		    c->codes[i].symbol, c->codes[j].symbol,
+		    c->codes[j].nbits+1);
+	    */
+	    cur_len = c->codes[i].nbits;
+	    c->codes[i].nbits = ++c->codes[j].nbits;
+
+	    /*
+	     * Shrink the next code by one, or if none at that bit-length
+	     * the next 2, and so on
+	     */
+	    delta = 1;
+	    for (k = i+1; delta && k < c->ncodes; k++) {
+		while (c->codes[k].nbits > cur_len) {
+		    delta *= 2;
+		    cur_len++;
+		}
+		c->codes[k].nbits--;
+		delta--;
+	    }
+	    assert(delta == 0);
+	}
+
+	/*
+	fprintf(stderr, "=== REORDERED TO %d ===\n", c->code_set);
+	output_code_set(stderr, c);
+	output_code_set2(stderr, c);
+	*/
+
+	/* Ordering is shot - regenerate via brute force way */
+	return canonical_codes(c);
+    }
+
+
+    /* Generate codes */
+    code = last_len = 0; /* stop warning */
+    for (i = 0; i < c->ncodes; i++) {
+	int nbits = c->codes[i].nbits;
+
+	if (i == 0) {
+	    code = 0;
+	    last_len = nbits;
+	} else {
+	    code++;
+	}
+	if (nbits > last_len) {
+	    code <<= (nbits - last_len);
+	    last_len = nbits;
+	}
+	c->codes[i].code = bit_reverse(code, nbits);
+    }
+
+    /* Reindex so the symbol is the primary index into codes */
+    for (i = 0; i <= 257; i++) {
+	c->lookup[i].nbits = 0;
+    }
+    for (i = 0; i < c->ncodes; i++) {
+        c->lookup[c->codes[i].symbol] = c->codes[i];
+    }
+
+    return 0;
+}
+
+static int node_compar2(const void *vp1, const void *vp2) {
+    const node_t *n1 = *(const node_t **)vp1;
+    const node_t *n2 = *(const node_t **)vp2;
+
+    /*
+     * The sort order is vital here. This needs to return the same collating
+     * order on all systems so that differing qsort() functions will not
+     * swap around symbols with the same bit lengths, hence we sort by both
+     * fields to force a unique stable ordering.
+     */
+    if (n1->count != n2->count)
+	return n1->count - n2->count;
+    else
+	return n2->sym - n1->sym;
+}
+
+/*
+ * Computes the huffman bit-lengths for a data set. We don't care
+ * about the actual tree, just how deep the symbols end up.
+ *
+ * Huffman trees are constructed by constructing a set of nodes
+ * initially containing the symbol and it's frequency. We then merge
+ * the two least used nodes to produce a new node with a combined
+ * frequency. Repeat until one root node is left.
+ *
+ * data/len is the input data to analyse.
+ *
+ * 'eof' is a boolean to indicate whether the EOF symbol should be included
+ * in the symbols produced.
+ *
+ * all_codes is a boolean to indicate whether we should include symbols not
+ * found in the input data set. (This was used to create the static lookup
+ * tables.)
+ *
+ * Returns huffman_codes_t* on success
+ *         NULL on failure
+ */
+huffman_codes_t *calc_bit_lengths(unsigned char *data, int len,
+				  int eof, int max_code_len, int all_codes,
+				  int start, int skip) {
+    int i, ncodes;
+    node_t nodes[258+257], *head, *new = &nodes[258];
+    node_t *n2[258+257];
+    int map[258];
+    huffman_codes_t *c;
+    int hist[256];
+
+    if (NULL == (c = (huffman_codes_t *)malloc(sizeof(*c))))
+	return NULL;
+    c->codes_static = 0;
+    c->max_code_len = max_code_len;
+
+    /* Count frequencies of symbols */
+    memset(hist, 0, 256*sizeof(*hist));
+    /* Calc freqs */
+    for (i = start; i < len; i+=skip) {
+	hist[data[i]]++;
+    }
+
+
+    /*
+     * Initialise nodes. We build a map of ASCII character code to node
+     * number. (By default it's a simple 1:1 mapping unless legal_chars is
+     * defined.)
+     */
+    ncodes = 0;
+    if (eof) {
+	nodes[ncodes].sym = SYM_EOF;
+	nodes[ncodes].count = eof;
+	nodes[ncodes].parent = NULL;
+	n2[ncodes] = &nodes[ncodes];
+	map[SYM_EOF] = ncodes++;
+    }
+
+    /* All 256 chars existing at a minimal level */
+    if (all_codes) {
+	for (i = 0; i < 256; i++) {
+	    nodes[ncodes].sym = i;
+	    nodes[ncodes].count = hist[i];
+	    nodes[ncodes].parent = NULL;
+	    n2[ncodes] = &nodes[ncodes];
+	    map[i] = ncodes++;
+	}
+    } else {
+	/* Only include non-zero symbols */
+	for (i = 0; i < 256; i++) {
+	    if (hist[i] == 0)
+		continue;
+	    nodes[ncodes].sym = i;
+	    nodes[ncodes].count = hist[i];
+	    nodes[ncodes].parent = NULL;
+	    n2[ncodes] = &nodes[ncodes];
+	    map[i] = ncodes++;
+	}
+    }
+
+    /* Sort by counts, smallest first and form a sorted linked list */
+    qsort(n2, ncodes, sizeof(*n2), node_compar2);
+
+    /* Skip symbols that do not occur, unless all_codes is true */
+    for (i = 0; i < ncodes; i++) {
+	n2[i]->next = i+1 < ncodes ? n2[i+1] : NULL;
+    }
+
+    /* Repeatedly merge two smallest values */
+    head = n2[0];
+    while (head && head->next) {
+	node_t *after = head->next, *n;
+	int sum = head->count + head->next->count;
+	
+	for (n = head->next->next; n; after = n, n = n->next) {
+	    if (sum < n->count)
+		break;
+	}
+
+	/* Produce a new summation node and link it in place */
+	after->next = new;
+	new->next = n;
+	new->sym = '?';
+	new->count = sum;
+	new->parent = NULL;
+	head->parent = new;
+	head->next->parent = new;
+	head = head->next->next;
+
+	new++;
+    }
+
+    /* Walk up tree computing the bit-lengths for our symbols */
+    c->ncodes = ncodes;
+    c->codes = (huffman_code_t *)malloc(c->ncodes * sizeof(*c->codes));
+    if (NULL == c->codes) {
+	free(c);
+	return NULL;
+    }
+
+    for (i = 0; i < ncodes; i++) {
+	int len = 0;
+	node_t *n;
+	for (n = n2[i]->parent; n; n = n->parent) {
+	    len++;
+	}
+
+	c->codes[i].symbol = n2[i]->sym;
+	c->codes[i].freq   = n2[i]->count;
+	c->codes[i].nbits  = len ? len : 1; /* special case, nul input */
+    }
+
+    if (0 != canonical_codes(c)) {
+	free(c);
+	return NULL;
+    }
+
+    return c;
+}
+
+/*
+ * A special case of the generate_code_set() function below, but for
+ * creating predefined code sets from bit-length arrays. Useful for
+ * code that wants to use a predetermined huffman tree.
+ *
+ *
+ * Returns huffman_codes_t* on success; free using huffman_codes_destroy().
+ *         NULL on failure.
+ */
+huffman_codeset_t *codes2codeset(huffman_code_t *codes, int ncodes,
+				 int code_num) {
+    huffman_codeset_t *cs;
+    huffman_codes_t *c;
+
+    if (NULL == (cs = (huffman_codeset_t *)malloc(sizeof(*cs))))
+	return NULL;
+
+    if (NULL == (c = (huffman_codes_t *)malloc(sizeof(*c))))
+	return NULL;
+
+    cs->codes = (huffman_codes_t **)malloc(sizeof(*cs->codes));
+    cs->codes[0] = c;
+    cs->ncodes = 1;
+    cs->code_set = code_num;
+    cs->blk = NULL;
+    cs->bit_num = 0;
+    cs->decode_t = NULL;
+    cs->decode_J4 = NULL;
+    
+    c->codes_static = 1;
+    c->max_code_len = MAX_CODE_LEN;
+
+    c->codes = codes;
+    c->ncodes = ncodes;
+
+    cs->bit_num = 0; /* FIXME: need to know this */
+
+    canonical_codes(c);
+
+    return cs;
+}
+
+/*
+ * Initialises and returns a huffman_codes_t struct from a specified code_set.
+ * If code_set is not one of the standard predefined values then the
+ * input data is analysed using calc_bit_lengths() above to produce the
+ * optimal set of huffman codes, otherwise we return predefined values.
+ *
+ * 'eof' is a boolean to indicate whether the EOF symbol should be included
+ * in the symbols produced.
+ *
+ * all_codes is a boolean to indicate whether we should include symbols not
+ * found in the input data set. (This was used to create the static lookup
+ * tables.)
+ *
+ * Returns huffman_codes_t* on success; free using huffman_codes_destroy().
+ *         NULL on failure.
+ */
+huffman_codeset_t *generate_code_set(int code_set, int ncodes,
+				     unsigned char *data, int len,
+				     int eof, int max_code_len,
+				     int all_codes) {
+    huffman_codeset_t *cs;
+
+    /*
+     * Either INLINE or a CODE_USER+ set of codes.
+     * => analyse the data and compute a new set of bit-lengths & codes.
+     */
+    if (code_set >= 128 || code_set == CODE_INLINE) { 
+	int i;
+
+	if (NULL == (cs = (huffman_codeset_t *)malloc(sizeof(*cs))))
+	    return NULL;
+
+	cs->code_set = code_set;
+	cs->ncodes = ncodes;
+	cs->codes = (huffman_codes_t **)malloc(cs->ncodes*sizeof(*cs->codes));
+	cs->blk = NULL;
+	cs->bit_num = 0;
+	cs->decode_t = NULL;
+	cs->decode_J4 = NULL;
+
+	for (i = 0; i < ncodes; i++) {
+	    /*
+	     * If requested, include EOF all code sets, but at a
+	     * frequency of only '1' occurrance where we predict it
+	     * not to be needed.
+	     */
+	    if (eof && (len+i)%ncodes)
+		eof = 1;
+	    cs->codes[i] = calc_bit_lengths(data, len, eof, max_code_len,
+					    all_codes, i, ncodes);
+	    cs->codes[i]->codes_static = 0;
+	    if (NULL == cs->codes[i]) {
+		/* FIXME: tidy up */
+		return NULL;
+	    }
+
+	    canonical_codes(cs->codes[i]);
+	}
+
+    /*
+     * Otherwise we use the determined codes at the top of this file, such
+     * as codes_dna and codes_english.
+     */
+    } else {
+	if (code_set < 1 || code_set >= NCODES_STATIC) {
+	    fprintf(stderr, "Unknown huffman code set '%d'\n", code_set);
+	    return NULL;
+	}
+
+	/* If our global codeset hasn't been initialised yet, do so */
+	if (!static_codeset[code_set]) {
+	    huffman_codes_t *c = (huffman_codes_t *)malloc(sizeof(*c));
+
+	    if (NULL == (cs = (huffman_codeset_t *)malloc(sizeof(*cs))))
+		return NULL;
+
+	    cs->codes = (huffman_codes_t **)malloc(sizeof(*cs->codes));
+	    cs->codes[0] = c;
+	    cs->ncodes = 1;
+	    cs->code_set = code_set;
+	    cs->blk = NULL;
+	    cs->bit_num = 0;
+	    cs->decode_t = NULL;
+	    cs->decode_J4 = NULL;
+
+	    c->codes_static = 1;
+	    c->max_code_len = MAX_CODE_LEN;
+
+	    switch(code_set) {
+	    case CODE_DNA:
+		c->codes = codes_dna;
+		c->ncodes = sizeof(codes_dna)/sizeof(*c->codes);
+		cs->bit_num = 5;
+		break;
+
+	    case CODE_DNA_AMBIG:
+		c->codes = codes_dna_ambig;
+		c->ncodes = sizeof(codes_dna_ambig)/sizeof(*c->codes);
+		cs->bit_num = 1;
+		break;
+
+	    case CODE_ENGLISH:
+		c->codes = codes_english;
+		c->ncodes = sizeof(codes_english)/sizeof(*c->codes);
+		cs->bit_num = 1;
+		break;
+
+	    default:
+		fprintf(stderr, "Unknown huffman code set '%d'\n", code_set);
+		return NULL;
+	    }
+
+	    canonical_codes(c);
+
+	    static_codeset[code_set] = cs;
+	}
+
+	cs = static_codeset[code_set];
+    }
+
+    return cs;
+}
+
+void huffman_codes_destroy(huffman_codes_t *c) {
+    if (!c)
+	return;
+
+    if (!c->codes_static && c->codes)
+	free(c->codes);
+
+    free(c);
+}
+
+void huffman_codeset_destroy(huffman_codeset_t *cs) {
+    int i;
+
+    if (!cs)
+	return;
+
+    /* If this codeset is one of the predefined global ones we do nothing */
+    if (cs->ncodes == 1 && cs->codes[0]->codes_static)
+	return;
+
+    for (i = 0; i < cs->ncodes; i++)
+	huffman_codes_destroy(cs->codes[i]);
+    if (cs->codes)
+	free(cs->codes);
+    if (cs->blk)
+	block_destroy(cs->blk, 0);
+    if (cs->decode_t)
+	free(cs->decode_t);
+    if (cs->decode_J4)
+	free(cs->decode_J4);
+
+    free(cs);
+}
+
+/*
+ * ---------------------------------------------------------------------------
+ * Encoding and decoding related functions
+ */
+
+/*
+ * Can store up to 24-bits worth of data encoded in an integer value
+ * Possibly we'd want to have a less optimal store_bits function when dealing
+ * with nbits > 24, but for now we assume the codes generated are never
+ * that big. (Given this is only possible with 121392 or more
+ * characters with exactly the correct frequency distribution we check
+ * for it elsewhere.)
+ */
+static void store_bits(block_t *block, unsigned int val, int nbits) {
+    /* fprintf(stderr, " store_bits: %02x %d\n", val, nbits); */
+
+#if 1
+    {
+	unsigned int curr = block->data[block->byte];
+	curr |= (val & ((1 << nbits)-1)) << block->bit;
+	block->bit += nbits;
+	while (block->bit >= 8) {
+	    block->data[block->byte++] = curr & 0xff;
+	    curr >>= 8;
+	    block->bit -= 8;
+	}
+	block->data[block->byte] = curr & 0xff;
+    }
+    return;
+
+#else
+
+    {
+      /* Slow, but simple */
+      unsigned int mask = 1;
+      int bit = 1 << block->bit;
+      do {
+	if (val & mask)
+	    block->data[block->byte] |= bit;
+	/*
+	 * Data should be zeroed anyway, so this is not needed.
+	 *
+	 * else
+	 *    block->data[block->byte] &= ~bit;
+	*/
+
+	if (++block->bit == 8) {
+	    block->bit = 0;
+	    block->byte++;
+	    block->data[block->byte] = 0;
+	    bit = 1;
+	} else {
+	    bit <<= 1;
+	}
+	mask <<= 1;
+      } while(--nbits);
+    }
+
+#endif
+}
+
+/*
+ * Reads up to 24-bits worth of data and returns. Updates the block
+ * byte and bit values to indicate the current 'read' position.
+ *
+ * Returns unsigned value on success (>=0)
+ *         -1 on failure
+ */
+static signed int get_bits(block_t *block, int nbits) {
+    unsigned int val, bnum = 0;
+
+    if (block->byte*8 + block->bit + nbits > block->alloc * 8)
+	return -1;
+
+    /* Fetch the partial byte of data */
+    val = (block->data[block->byte]) >> block->bit;
+    bnum = 8 - block->bit;
+
+    /* And additional entire bytes worth as required */
+    while (bnum <= nbits) {
+	val |= block->data[++block->byte] << bnum;
+	bnum += 8;
+    }
+
+    block->bit = (block->bit + nbits) % 8;
+    return val & ((1 << nbits) - 1);
+}
+
+/* stores nbytes bytes, padding to align on the next byte boundary */
+void store_bytes(block_t *block, unsigned char *val, int nbytes) {
+    /* Align */
+    if (block->bit != 0) {
+	block->byte++;
+	block->bit = 0;
+    }
+
+    /* Resize */
+    block_resize(block, block->byte + nbytes + 1);
+
+    /* Store */
+    memcpy(&block->data[block->byte], val, nbytes);
+    block->byte += nbytes;
+}
+
+
+/*
+ * Encodes the huffman symbol bit-lengths as a serialised block of data
+ * suitable for storing in a ZTR "ZLBH" chunk. This uses the Deflate
+ * storage format defined in RFC1951.
+ *
+ * Returns: 0 on success
+ *         -1 on failure
+ */
+int store_codes_single(block_t *out, huffman_codes_t *c) {
+    int i;
+    unsigned char bl_code[257]; /* bit-length codes and for codes 16-18 */
+    unsigned char bl_opt[257];  /*     the operand to the blcode */
+    unsigned char sorted_codes[258];
+    int bl_freq[19]; /* frequency of bit-length codes produced */
+    int bl_count;
+    huffman_codes_t *bl_cds = NULL;
+    int hclen_order[] = {
+	16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15
+    };
+    int hlit, hdist, hclen, hcmap[19];
+
+    /* output_code_set (stderr, c); */
+
+    if (out->alloc < out->byte + 1000) {
+	out->alloc = out->byte + 1000;
+	if (NULL == (out->data = realloc(out->data, out->alloc)))
+	    return -1;
+    }
+
+    /*
+     *-----------------------------------------------------------------
+     * Reformat the dynamic code bit-lengths into an alphabet of 19 
+     * "code length" symbols as defined in RFC1951.
+     */
+    memset(sorted_codes, 0, 258);
+    for (i = 0; i < c->ncodes; i++) {
+	sorted_codes[c->codes[i].symbol] = c->codes[i].nbits;
+    }
+    for (i = 0; i < 19; i++)
+	bl_freq[i] = 0;
+
+    bl_count = 0;
+    for (i = 0; i < 257; ) {
+	int j = i+1, n;
+	int v = sorted_codes[i];
+	while (j < 257 && sorted_codes[j] == v)
+	    j++;
+
+	n = j-i; /* n = run-length */
+	/* fprintf(stderr, "value=%d, run_len=%d\n", v, n); */
+	if (v == 0) {
+	    /* bit-len zero => no code and uses code 17/18 for run len */
+	    while (n > 0) {
+		while (n >= 11) {
+		    bl_freq[18]++;
+		    bl_code[bl_count] = 18;
+		    bl_opt[bl_count] = MIN(n, 138)-11;
+		    n -= bl_opt[bl_count]+11;
+		    bl_count++;
+		}
+
+		while (n >= 3) {
+		    bl_freq[17]++;
+		    bl_code[bl_count] = 17;
+		    bl_opt[bl_count] = MIN(n, 10)-3;
+		    n -= bl_opt[bl_count]+3;
+		    bl_count++;
+		}
+
+		switch (n) {
+		case 2: bl_code[bl_count++] = 0; bl_freq[0]++; n--;
+		case 1: bl_code[bl_count++] = 0; bl_freq[0]++; n--;
+		}
+	    }
+	} else if (v <= 15) {
+	    /* non-zero code, uses code 16 for run-len */
+	    if (n >= 4) {
+		bl_freq[v]++;
+		bl_code[bl_count++] = v;
+		n--;
+		while (n >= 3) {
+		    bl_freq[16]++;
+		    bl_code[bl_count] = 16;
+		    bl_opt[bl_count] = MIN(n, 6)-3;
+		    n -= bl_opt[bl_count]+3;
+		    bl_count++;
+		}
+	    }
+
+	    switch(n) {
+	    case 3: bl_code[bl_count++] = v; bl_freq[v]++; n--;
+	    case 2: bl_code[bl_count++] = v; bl_freq[v]++; n--;
+	    case 1: bl_code[bl_count++] = v; bl_freq[v]++; n--;
+	    }
+	} else {
+	    fprintf(stderr, "Unsupported code length: %d\n", v);
+	}
+
+	i = j;
+    }
+    hlit = 257;
+
+    /* Add a single distance code of zero bits. This means that there
+     * are no distance codes used at all.
+     */
+    bl_code[bl_count++] = 0;
+    bl_freq[0]++;
+    hdist = 1;
+
+    /* Produce new huffman codes for our code-length symbols. */
+    bl_cds = calc_bit_lengths(bl_code, bl_count, 0, 7, 0, 0, 1);
+    /* output_code_set (stderr, bl_cds); */
+
+    /*
+     *-----------------------------------------------------------------
+     * Output the "code length" bit-lengths, 3 bits at a time.
+     *
+     * Compute how many HCLEN code length values we need, using the
+     * predefined order in the RFC.
+     */
+    for (hclen = 19; hclen > 0; hclen--) {
+	if (bl_freq[hclen_order[hclen-1]])
+	    break;
+    }
+
+    store_bits(out, hlit-257,  5);
+    store_bits(out, hdist-1, 5);
+    store_bits(out, hclen-4, 4);
+
+    for (i = 0; i < 19; i++)
+	hcmap[i] = -1;
+    for (i = 0; i < bl_cds->ncodes; i++)
+	hcmap[bl_cds->codes[i].symbol] = i;
+    for (i = 0; i < hclen; i++) {
+	if (hcmap[hclen_order[i]] >= 0) {
+	    store_bits(out, bl_cds->codes[hcmap[hclen_order[i]]].nbits, 3);
+	} else {
+	    store_bits(out, 0, 3);
+	}
+    }
+
+
+    /*
+     *----------------------------------------------------------------
+     * Finally output the original bit-lengths using the code-len codes.
+     */
+    for (i = 0; i < bl_count; i++) {
+	huffman_code_t *c = &bl_cds->codes[hcmap[bl_code[i]]];
+	store_bits(out, c->code, c->nbits); 
+	/*
+	fprintf(stderr, "bl_code %d (opt %d), code %d/%d\n",
+		bl_code[i], bl_opt[i], c->code, c->nbits);
+	*/
+	switch(bl_code[i]) {
+	case 18:
+	    store_bits(out, bl_opt[i], 7);
+	    break;
+	case 17:
+	    store_bits(out, bl_opt[i], 3);
+	    break;
+	case 16:
+	    store_bits(out, bl_opt[i], 2);
+	    break;
+	}
+    }
+
+    huffman_codes_destroy(bl_cds);
+
+    return 0;
+}
+
+/*
+ * A wrapper around store_codes_single to output either a single or multiple
+ * huffman codes to a block.
+ *
+ * This also creates a new block and fills out the block header appropriately.
+ *
+ * Returns 0 on success
+ *        -1 on failure
+ */
+int store_codes(block_t *out, huffman_codeset_t *cs, int last_block) {
+    int i;
+
+    if (out->alloc < out->byte + 1000) {
+	out->alloc = out->byte + 1000;
+	if (NULL == (out->data = realloc(out->data, out->alloc)))
+	    return -1;
+    }
+
+    /* Header details */
+    store_bits(out, last_block != 0,  1); /* last block */
+    if (cs->ncodes == 1) {
+	store_bits(out, 2,  2); /* dynamic huffman */
+    } else {
+	int nbits = 0;
+	store_bits(out, 3,  2); /* multiple tree dynamic huffman */
+	while (1<<nbits <= cs->ncodes-1)
+	    nbits++;
+	store_bits(out, nbits-1, 4);
+	store_bits(out, cs->ncodes-1, nbits);
+    }
+
+    for (i = 0; i < cs->ncodes; i++) {
+	if (-1 == store_codes_single(out, cs->codes[i]))
+	    return -1;
+    }
+
+    return 0;
+}
+
+/*
+ * This is the opposite of the store_codes() function. It loads generates
+ * huffman_codes_t structs from the a serialised data stream as presented
+ * in the above format.
+ *
+ * The input data is the data-string. On return the number of bytes
+ * consumed will be returned in *len_used (if non NULL).
+ * This is to allow stripping off of the huffman codes from a longer
+ * array of data (ie probably followed by the STHUFF encoded chunk
+ * itself).
+ *
+ * Returns: malloced huffman_codes_t structure on success.
+ *          NULL on failure.
+ */
+huffman_codes_t *restore_codes_single(block_t *block) {
+    int hlit, hdist, hclen;
+    int hclen_order[19] = {
+	16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15
+    };
+    int hc_bitlen[19], i;
+    huffman_codes_t *bl_cds, *cds;
+    int sym, sym_val, last_len;
+    int htab[256];
+
+    hlit   = get_bits(block, 5)+257;
+    hdist  = get_bits(block, 5)+1;
+    hclen  = get_bits(block, 4)+4;
+
+    /*
+    fprintf(stderr, "bfinal = %d, btype=%d\n", *bfinal, btype);
+    fprintf(stderr, "hlit=0x%x, hdist=0x%x, hclen=0x%x\n",
+	    hlit, hdist, hclen);
+    */
+
+    /* Read HCLEN code-lengths and construct huffman codes from them */
+    for (i = 0; i < hclen; i++)
+	hc_bitlen[hclen_order[i]] = get_bits(block, 3);
+    for (; i < 19; i++)
+	hc_bitlen[hclen_order[i]] = 0;
+
+    bl_cds = (huffman_codes_t *)malloc(sizeof(*bl_cds));
+    bl_cds->codes_static = 0;
+    bl_cds->ncodes = 0;
+    bl_cds->codes = (huffman_code_t *)malloc(19 * sizeof(*bl_cds->codes));
+    bl_cds->max_code_len = 7;
+    for (i = 0; i < 19; i++) {
+	if (hc_bitlen[i]) {
+	    bl_cds->codes[bl_cds->ncodes].symbol = i;
+	    bl_cds->codes[bl_cds->ncodes].nbits = hc_bitlen[i];
+	    bl_cds->ncodes++;
+	}
+    }
+
+    canonical_codes(bl_cds);
+    /* output_code_set (stderr, bl_cds); */
+
+    /* Build a lookup table of possible codes to symbols */
+    for (i = 0; i < 256; i++)
+	htab[i] = -1;
+    for (i = 0; i < bl_cds->ncodes; i++) {
+	htab[bit_reverse(bl_cds->codes[i].code, bl_cds->codes[i].nbits)
+	     | (1<<bl_cds->codes[i].nbits)]
+	    = bl_cds->codes[i].symbol;
+    }
+
+    /* Now decode the next HLIT literal codes using bl_cds */
+    cds = (huffman_codes_t *)malloc(sizeof(*cds));
+    cds->codes_static = 0;
+    cds->ncodes = 0;
+    cds->codes = (huffman_code_t *)malloc(257 * sizeof(*cds->codes));
+    cds->max_code_len = 15;
+    sym_val = last_len = 0;
+    while ((sym = next_symbol(block, htab)) != -1) {
+	int count;
+	/* fprintf(stderr, "LIT Sym=%d\n", sym); */
+
+	switch(sym) {
+	case 16:
+	    count = get_bits(block, 2) + 3;
+	    /* fprintf(stderr, "   +%d\n", count); */
+	    for (i = 0; i < count; i++) {
+		cds->codes[cds->ncodes].symbol = sym_val++;
+		cds->codes[cds->ncodes++].nbits = last_len;
+	    }
+	    break;
+	    
+	case 17:
+	    count = get_bits(block, 3) + 3;
+	    /* fprintf(stderr, "   +%d\n", count); */
+	    sym_val += count;
+	    last_len = 0;
+	    break;
+	    
+	case 18:
+	    count = get_bits(block, 7) + 11;
+	    /* fprintf(stderr, "   +%d\n", count); */
+	    sym_val += count;
+	    last_len = 0;
+	    break;
+
+	case 0:
+	    sym_val++;
+	    last_len = 0;
+	    break;
+
+	default:
+	    cds->codes[cds->ncodes].symbol = sym_val++;
+	    last_len = cds->codes[cds->ncodes++].nbits = sym;
+	}
+
+	if (sym_val >= hlit)
+	    break;
+    }
+    assert(sym != -1);
+    assert(cds->ncodes <= 257);
+
+    /* Skip HDIST codes. Hopefully only 1 of zero length */
+    sym_val = 0;
+    while ((sym = next_symbol(block, htab)) != -1) {
+	/* fprintf(stderr, "DIST Sym=%d\n", sym); */
+
+	switch(sym) {
+	case 16:
+	    sym_val += get_bits(block, 2) + 3;
+	    break;
+	    
+	case 17:
+	    sym_val += get_bits(block, 3) + 3;
+	    break;
+	    
+	case 18:
+	    sym_val += get_bits(block, 7) + 11;
+	    break;
+
+	default:
+	    sym_val++;
+	}
+
+	if (sym_val >= hdist)
+	    break;
+    }
+    assert(sym != -1);
+
+    huffman_codes_destroy(bl_cds);
+    canonical_codes(cds);
+    /* output_code_set(stderr, cds); */
+
+    return cds;
+}
+
+huffman_codeset_t *restore_codes(block_t *block, int *bfinal) {
+    int btype;
+    huffman_codeset_t *cs;
+    
+    /* Header details */
+    if (bfinal)
+	*bfinal = get_bits(block, 1);
+    else
+	get_bits(block, 1);
+    btype  = get_bits(block, 2);
+
+    cs = (huffman_codeset_t *)malloc(sizeof(*cs));
+    cs->code_set = 0;
+    cs->blk = NULL;
+    cs->bit_num = 0;
+    cs->decode_t = NULL;
+    cs->decode_J4 = NULL;
+
+    if (btype == 2) {
+	/* Standard Deflate algorithm */
+	cs->ncodes = 1;
+	cs->codes = (huffman_codes_t **)malloc(cs->ncodes*sizeof(*cs->codes));
+	cs->codes[0] = restore_codes_single(block);
+    } else if (btype == 3) {
+	/* Deflate extension - multiple codes */
+	int nbits, i;
+	nbits  = get_bits(block, 4) + 1;
+	cs->ncodes = get_bits(block, nbits) + 1;
+	cs->codes = (huffman_codes_t **)malloc(cs->ncodes*sizeof(*cs->codes));
+	for (i = 0; i < cs->ncodes; i++) {
+	    cs->codes[i] = restore_codes_single(block);
+	}
+    } else {
+	fprintf(stderr, "restore_codes() only implemented for "
+		"BTYPE == DYNAMIC HUFFMAN and INTERLACED HUFFMAN\n");
+	return NULL;
+    }
+
+    cs->bit_num = block->bit;
+
+    return cs;
+}
+
+/*
+ * Given a multiple sets of huffman codes and a block of data this
+ * compresses and returns the data block. It iterates around each set
+ * of huffman codes in a cyclic fashion encoding each byte with the
+ * appropriate huffman codes.
+ *
+ * Returns: 0 on success
+ *          -1 on failure
+ */
+int huffman_multi_encode(block_t *blk, huffman_codeset_t *cs,
+			 int code_set, unsigned char *data, int len) {
+    int i, nc;
+    huffman_code_t *lookup;
+    huffman_codes_t **c;
+
+    if (!cs) {
+	/* No codes known, so derive our own */
+	fprintf(stderr, "FIXME: use generate_code_set() to build our own codes here\n");
+	return -1;
+    } else {
+	c  = cs->codes;
+	nc = cs->ncodes;
+    }
+
+    /*
+     * The maximum size to encode len bytes is < 9 bits per symbol
+     * (not quite 8 due to an EOF symbol) plus the overhead of the bit-length
+     * tree. That in turn, with alternating 8/9 bit-lengths would max out
+     * as 258*8 + 5+5+4 + 19*3 + 258*5 bits (429 bytes), but in practice
+     * I'm not even sure if it's possible to construct such a set of code
+     * lengths that would compress that poor.
+     *
+     * This of course assumes we're using appropriate compression codes.
+     * Given a user may give a completely inappropriate code we have to
+     * assume every symbol is actually 15 bits instead of < 9 on average.
+     *
+     * We ensure blk here is large enough for the worst case scenario so we
+     * don't incur overheads in store_bits().
+     */
+    if (blk->alloc <= 429 + 2*len + 2 + blk->byte) {
+	blk->alloc  = 429 + 2*len + 2 + blk->byte;
+	blk->data = realloc(blk->data, blk->alloc);
+	if (!blk->data)
+	    return -1;
+    }
+
+    /*
+     * Splitting this special case out is worth it as it's approx 30% faster.
+     * Also note that the nc > 1 case is faster with a separate counter and
+     * test than using modulus (by a factor of 2). It could be sped up further
+     * for powers of 2 using bitwise AND, but the difference is not huge.
+     */
+    if (nc == 1) {
+	lookup = c[0]->lookup;
+	for (i = 0; i < len; i++) {
+	    assert(lookup[data[i]].nbits > 0);
+	    store_bits(blk, lookup[data[i]].code,
+		       lookup[data[i]].nbits);
+	}
+    } else {
+	int count = 0;
+	for (i = 0; i < len; i++) {
+	    lookup = c[count]->lookup;
+	    assert(lookup[data[i]].nbits > 0);
+	    store_bits(blk, lookup[data[i]].code,
+		       lookup[data[i]].nbits);
+	    if (++count == nc)
+		count = 0;
+	}
+    }
+
+    lookup = c[i%nc]->lookup;
+    store_bits(blk, lookup[SYM_EOF].code, lookup[SYM_EOF].nbits);
+
+    assert(blk->alloc > blk->byte);
+
+    /* We probably massively overallocated, so return some of it back */
+    blk->data = realloc(blk->data, blk->byte+1);
+    blk->alloc = blk->byte+1;
+
+    return 0;
+}
+
+/*
+ * The opposite of huffman_encode().
+ * Decode a huffman stream from 'block' using huffman codes 'c'.
+ *
+ * Returns: allocated block_t pointer on success
+ *          NULL on failure.
+ *
+ * Method 1
+ * --------
+ *
+ * At any node in our tree we can precompute a lookup table so that upon
+ * reading the next 'k' bits we know the new node we'd end up in and what
+ * symbols to export.
+ * Then decoding simply works in fixed sets of k bits at a time.
+ *
+ * We use k=4 for efficient table space (they fit neatly in cache) and ease
+ * of decoding 4-bits at a time. k=8 is about 20% faster as reading the input
+ * byte by byte is easy, but the setup time is substantially longer
+ * (16x at a guess) and the lookup tables no longer fit in the L1 cache.
+ */
+block_t *huffman_decode(block_t *in, huffman_codes_t *c) {
+    block_t *out;
+    htree_t t[513]; /* number of internal nodes */
+    int i, j, n;
+    int new_node, node_num;
+    h_jump4_t J4[513][16];
+    unsigned char *cp;
+
+    if (NULL == (out = block_create(NULL, 8*in->alloc+8))) {
+	block_destroy(in, 0);
+	return NULL;
+    }
+
+    /* Construct the tree from the codes */
+    new_node = 1;
+    t[0].l[0] = t[0].l[1] = -1;
+    t[0].c[0] = t[0].c[1] = 0;
+    for (i = 0; i < c->ncodes; i++) {
+	int n = 0;
+	unsigned int v = c->codes[i].code;
+
+	for (j = 0; j < c->codes[i].nbits-1; j++) {
+	    int b = v & 1;
+	    if (t[n].c[b]) {
+		n = t[n].c[b];
+	    } else {
+		n = (t[n].c[b] = new_node++);
+		t[n].c[0] = t[n].c[1] = 0;
+		t[n].l[0] = t[n].l[1] = -1;
+	    }
+	    v >>= 1;
+	}
+	/* last bit */
+	t[n].l[v & 1] = c->codes[i].symbol;
+    }
+
+    /* Build the 16 wide lookup table per node */
+    for (n = 0; n < new_node; n++) {
+	for (j = 0; j < 16; j++) {
+	    unsigned int v = j;
+	    int n2 = n;
+	    h_jump4_t *hj = &J4[n][j];
+	    hj->nsymbols = 0;
+	    hj->top_bit = 0;
+	    for (i = 0; i < 4; i++) {
+		int b = v & 1;
+		if (t[n2].l[b] >= 0) {
+		    hj->symbol[hj->nsymbols++] = t[n2].l[b];
+		    if (t[n2].l[b] == SYM_EOF)
+			if (!hj->top_bit)
+			    hj->top_bit |= 1 << (hj->nsymbols-1);
+		}
+		n2 = t[n2].c[b];
+		v >>= 1;
+	    }
+	    hj->jump = n2;
+	}
+    }
+
+#if 0
+    /* Debug output */
+    for (n = 0; n < new_node; n++) {
+	printf("Node %d, c[]={%d,%d}, l[]={%d,%d}\n",
+	       n, t[n].c[0], t[n].c[1], t[n].l[0], t[n].l[1]);
+	for (i = 0; i < 256; i++) {
+	    printf("\t%02x %s =>%02d, ", i, print_8rev(i), J4[n][i].jump);
+	    for (k = 0; k < J4[n][i].nsymbols; k++) {
+		if (isprint(J4[n][i].symbol[k]))
+		    printf(" '%c'", J4[n][i].symbol[k]);
+		else
+		    printf(" %03d", J4[n][i].symbol[k]);
+	    }
+	    printf("\n");
+	}
+    }
+#endif
+
+
+    /*
+     * Decoding - part 1
+     * We're part way through a byte, so decode bit by bit up to the next
+     * whole byte and then we start the fast decoding section.
+     */
+    cp = out->data;
+    node_num = 0;
+    while (in->bit != 0) {
+	int b = get_bits(in, 1);
+	if (t[node_num].l[b] != -1) {
+	    if (t[node_num].l[b] != SYM_EOF) {
+		*cp++ = t[node_num].l[b];
+	    } else {
+		out->byte = cp - out->data;
+		return out;
+	    }
+	}
+	node_num = t[node_num].c[b];
+    }
+
+    /*
+     * Decoding - part 2
+     *
+     * We handle data nibble by nibble using the nibble to get an
+     * h_jump4_t lookup from the J4[] table.
+     * If top_bit is clear then we know we have no funny business (SYM_EOF)
+     * so we use a fast decoding technique, otherwise we have to do a slower
+     * loop with a check.
+     */
+    {
+	int last_node = 0;
+	unsigned char *last_cp = cp;
+	h_jump4_t *x = &J4[node_num][in->data[in->byte] & 0x0f];
+	int l = x->nsymbols;
+	int b;
+
+	/*
+	 * This is the tight loop, so we over-optimise here by ignoring EOF
+	 * and relying on knowing the length of the input data stream.
+	 * This allows us to ignore the 9-bit data and only operate on
+	 * the basic 0-255 symbols, glossing over the minor issue that EOF
+	 * will look like an ordinary symbol.
+	 */
+	for (i = in->byte; i < in->alloc; i++) {
+	    last_cp = cp;
+	    last_node = node_num;
+
+	    x = &J4[node_num][in->data[i] & 0x0f];
+	    l = x->nsymbols;
+
+	    for (j = 0; j < l; j++) {	
+		*cp++ = x->symbol[j];
+	    }
+	    node_num = x->jump;
+
+	    if (x->top_bit)
+		break;
+
+	    x = &J4[node_num][(in->data[i] >> 4) & 0x0f];
+	    l = x->nsymbols;
+	     
+	    for (j = 0; j < l; j++) {	
+		*cp++ = x->symbol[j];
+	    }
+	    node_num = x->jump;
+
+	    if (x->top_bit)
+		break;
+	}
+
+    
+	/*
+	 * Decoding - part 3
+	 *
+	 * The above optimisation has unfortunately added EOF to our data
+	 * along with whatever else was packed in the last byte after the
+	 * EOF symbol. So we rewind one byte and finish off decoding
+	 * the slow way - walking the tree.
+	 */
+	cp = last_cp;
+	node_num = last_node;
+	in->byte = i;
+	in->bit = 0;
+	while (-1 != (b = get_bits(in, 1))) {
+	    if (t[node_num].l[b] != -1) {
+		if (t[node_num].l[b] != SYM_EOF) {
+		    *cp++ = t[node_num].l[b];
+		} else {
+		    out->byte = cp - out->data;
+		    return out;
+		}
+	    }
+	    node_num = t[node_num].c[b];
+	}
+     }
+
+
+    /* We shouldn't reach here */
+    return NULL;
+}
+
+int init_decode_tables(huffman_codeset_t *cs) {
+    int nnodes, i, j, n, nc;
+    huffman_codes_t **c;
+    int new_node, rec;
+    h_jump4_t (*J4)[16] = NULL;
+    htree_t *t;
+    
+    c = cs->codes;
+    nc = cs->ncodes;
+
+    /* Allocate memory for internal nodes (nsyms-1 for each code set) */
+    for (nnodes = i = 0; i < nc; i++) {
+	nnodes += c[i]->ncodes-1;
+    }
+
+    if (NULL == (t = (htree_t *)malloc(nnodes * sizeof(*t))))
+	goto error;
+
+    if (NULL == (J4 = (h_jump4_t (*)[16])malloc(nnodes * sizeof(*J4))))
+	goto error;
+
+    /*
+     * Construct the tree from the codes.
+     * We have one tree for all 'nc' huffman codes with each tree pointing
+     * to the root of the next one (or first) tree whenever we emit a
+     * symbol.
+     *
+     * This then effectively means the decoding step is identical to the
+     * single huffman code function.
+     */
+    new_node = 0;
+    for (rec = 0; rec < nc; rec++) {
+	int root = new_node++;
+	int next_root = rec == nc-1
+	    ? 0
+	    : root + c[rec]->ncodes-1;
+	    
+	t[root].l[0] = t[root].l[1] = -1;
+	t[root].c[0] = t[root].c[1] = next_root;
+	for (i = 0; i < c[rec]->ncodes; i++) {
+	    int n = root;
+	    unsigned int v = c[rec]->codes[i].code;
+
+	    for (j = 0; j < c[rec]->codes[i].nbits-1; j++) {
+		int b = v & 1;
+		if (t[n].c[b] != next_root) {
+		    n = t[n].c[b];
+		} else {
+		    n = (t[n].c[b] = new_node++);
+		    t[n].c[0] = t[n].c[1] = next_root;
+		    t[n].l[0] = t[n].l[1] = -1;
+		}
+		v >>= 1;
+	    }
+	    /* last bit */
+	    t[n].l[v & 1] = c[rec]->codes[i].symbol;
+	}
+    }
+
+    /*
+    for (i = 0; i < new_node; i++) {
+	printf("t[%d] = {(%d,%d), (%d,%d)}\n",
+	       i,
+	       t[i].l[0], t[i].l[1],
+	       t[i].c[0], t[i].c[1]);
+    }
+    */
+
+    /* Build the 16 wide lookup table per node */
+    for (n = 0; n < new_node; n++) {
+	for (j = 0; j < 16; j++) {
+	    unsigned int v = j;
+	    int n2 = n;
+	    h_jump4_t *hj = &J4[n][j];
+	    hj->nsymbols = 0;
+	    hj->top_bit = 0;
+	    for (i = 0; i < 4; i++) {
+		int b = v & 1;
+		if (t[n2].l[b] >= 0) {
+		    hj->symbol[hj->nsymbols++] = t[n2].l[b];
+		    if (t[n2].l[b] == SYM_EOF)
+			if (!hj->top_bit)
+			    hj->top_bit |= 1 << (hj->nsymbols-1);
+		}
+		n2 = t[n2].c[b];
+		v >>= 1;
+	    }
+	    hj->jump = n2;
+	    /*
+	    printf("J4[%d][%d] = {'%.*s', %d}\n",
+		   n, j, hj->nsymbols, hj->symbol, n2);
+	    */
+	}
+    }
+
+    cs->decode_t = t;
+    cs->decode_J4 = J4;
+
+    return 0;
+
+ error:
+    if (t)
+	free(t);
+
+    if (J4)
+	free(J4);
+
+    cs->decode_t = NULL;
+    cs->decode_J4 = NULL;
+
+    return -1;
+}
+
+/*
+ * The opposite of huffman_encode().
+ * Decode a huffman stream from 'block' using huffman codes 'c'.
+ *
+ * Returns: allocated block_t pointer on success
+ *          NULL on failure.
+ *
+ * Method 1
+ * --------
+ *
+ * At any node in our tree we can precompute a lookup table so that upon
+ * reading the next 'k' bits we know the new node we'd end up in and what
+ * symbols to export.
+ * Then decoding simply works in fixed sets of k bits at a time.
+ *
+ * We use k=4 for efficient table space (they fit neatly in cache) and ease
+ * of decoding 4-bits at a time. k=8 is about 20% faster as reading the input
+ * byte by byte is easy, but the setup time is substantially longer
+ * (16x at a guess) and the lookup tables no longer fit in the L1 cache.
+ *
+ * NB: This version also handles multiple interleaved huffman codes as
+ * this support doesn't really slow down the decoding process.
+ */
+block_t *huffman_multi_decode(block_t *in, huffman_codeset_t *cs) {
+    block_t *out = NULL;
+    int i, j;
+    int node_num;
+    unsigned char *cp;
+    huffman_codes_t **c;
+    int nc;
+    h_jump4_t (*J4)[16];
+    htree_t *t;
+
+    if (!cs)
+	return NULL;
+    c = cs->codes;
+    nc = cs->ncodes;
+
+    /* Ensure precomputed lookup tables exist */
+    if (!cs->decode_t || !cs->decode_J4)
+	if (-1 == init_decode_tables(cs))
+	    return NULL;
+
+    t  = cs->decode_t;
+    J4 = cs->decode_J4;
+
+    if (NULL == (out = block_create(NULL, 9*(in->alloc+1)))) {
+	goto error;
+    }
+
+    /*
+     * Decoding - part 1
+     * We're part way through a byte, so decode bit by bit up to the next
+     * whole byte and then we start the fast decoding section.
+     */
+    cp = out->data;
+    node_num = 0;
+    while (in->bit != 0) {
+	int b = get_bits(in, 1);
+	htree_t *t2 = &t[node_num];
+	if (t2->l[b] != -1) {
+	    if (t2->l[b] != SYM_EOF) {
+		*cp++ = t2->l[b];
+	    } else {
+		out->byte = cp - out->data;
+		goto success;
+	    }
+	}
+	node_num = t2->c[b];
+    }
+
+    /*
+     * Decoding - part 2
+     *
+     * We now handle data nibble by nibble using the nibble to get an
+     * h_jump4_t lookup from the J4[] table.
+     * If top_bit is clear then we know we have no funny business (SYM_EOF)
+     * so we use a fast decoding technique, otherwise we have to do a slower
+     * loop with a check.
+     */
+    {
+	int last_node = node_num;
+	unsigned char *last_cp = cp;
+	h_jump4_t *x = &J4[node_num][in->data[in->byte] & 0x0f];
+	int l = x->nsymbols;
+	int b;
+
+	/*
+	 * This is the tight loop, so we over-optimise here by ignoring EOF
+	 * and relying on knowing the length of the input data stream.
+	 * This allows us to ignore the 9-bit data and only operate on
+	 * the basic 0-255 symbols, glossing over the minor issue that EOF
+	 * will look like an ordinary symbol.
+	 */
+	for (i = in->byte; i < in->alloc; i++) {
+	    last_cp = cp;
+	    last_node = node_num;
+
+	    x = &J4[node_num][in->data[i] & 0x0f];
+	    l = x->nsymbols;
+
+	    /* printf("val=%d\n", in->data[i] & 0x0f); */
+	    for (j = 0; j < l; j++) {
+		*cp++ = x->symbol[j];
+	    }
+	    node_num = x->jump;
+
+	    if (x->top_bit)
+		break;
+
+	    x = &J4[node_num][(in->data[i] >> 4) & 0x0f];
+	    l = x->nsymbols;
+	     
+	    for (j = 0; j < l; j++) {	
+		*cp++ = x->symbol[j];
+	    }
+	    node_num = x->jump;
+
+	    if (x->top_bit)
+		break;
+	}
+
+    
+	/*
+	 * Decoding - part 3
+	 *
+	 * The above optimisation has unfortunately added EOF to our data
+	 * along with whatever else was packed in the last byte after the
+	 * EOF symbol. So we rewind one byte and finish off decoding
+	 * the slow way - walking the tree.
+	 */
+	cp = last_cp;
+	node_num = last_node;
+	in->byte = i;
+	in->bit = 0;
+	while (-1 != (b = get_bits(in, 1))) {
+	    htree_t *t2 = &t[node_num];
+	    if (t2->l[b] != -1) {
+		if (t2->l[b] != SYM_EOF) {
+		    *cp++ = t2->l[b];
+		} else {
+		    out->byte = cp - out->data;
+		    goto success;
+		}
+	    }
+	    node_num = t2->c[b];
+	}
+     }
+
+ success:
+    return out;
+
+ error:
+    if (out)
+	block_destroy(out, 0);
+
+    return NULL;
+}
+
+#if 0
+/* A simple to understand (but slow) version of the above function */
+block_t *huffman_multi_decode(block_t *in, huffman_codes_t **c, int nc) {
+    block_t *out;
+    htree_t (*t)[513]; /* number of internal nodes */
+    int i, j, n, rec;
+    int new_node, node_num;
+    unsigned char *cp;
+    int bC; /* byte count */
+
+    if (NULL == (t = (htree_t (*)[513])malloc(nc * sizeof(*t))))
+	return NULL;
+
+    if (NULL == (out = block_create(NULL, 8*in->alloc+8))) {
+	block_destroy(in, 0);
+	free(t);
+	return NULL;
+    }
+
+    /* Construct the tree from the codes */
+    for (rec = 0; rec < nc; rec++) {
+	new_node = 1;
+	t[rec][0].l[0] = t[rec][0].l[1] = -1;
+	t[rec][0].c[0] = t[rec][0].c[1] = 0;
+	for (i = 0; i < c[rec]->ncodes; i++) {
+	    int n = 0;
+	    unsigned int v = c[rec]->codes[i].code;
+
+	    for (j = 0; j < c[rec]->codes[i].nbits-1; j++) {
+		int b = v & 1;
+		if (t[rec][n].c[b]) {
+		    n = t[rec][n].c[b];
+		} else {
+		    n = (t[rec][n].c[b] = new_node++);
+		    t[rec][n].c[0] = t[rec][n].c[1] = 0;
+		    t[rec][n].l[0] = t[rec][n].l[1] = -1;
+		}
+		v >>= 1;
+	    }
+	    /* last bit */
+	    t[rec][n].l[v & 1] = c[rec]->codes[i].symbol;
+	}
+    }
+
+    /*
+     * Decoding - the slow way. How to speed up multi-code decoding?
+     */
+    cp = out->data;
+    node_num = 0;
+    bC = 0;
+    while (in->byte < in->alloc) {
+	htree_t *t2;
+	int b = get_bits(in, 1);
+	t2 = &t[bC%nc][node_num];
+	if (t2->l[b] != -1) {
+	    if (t2->l[b] != SYM_EOF) {
+		*cp++ = t2->l[b];
+		bC++;
+		node_num = 0;
+	    } else {
+		out->byte = cp - out->data;
+		free(t);
+		return out;
+	    }
+	} else {
+	    node_num = t2->c[b];
+	}
+    }
+
+    /* We shouldn't reach here */
+    free(t);
+    return NULL;
+}
+#endif
+
+/*
+ * A slow version of the above huffman_decode function. This is designed as
+ * a piecemeal decoder for purposes of restoring the huffman codes themselves.
+ * NB: this only works for code lengths small enough to keep inside the
+ * htab[] dimensions - IT DOES NOT CHECK THIS.
+ *
+ * Returns the next symbol
+ *         -1 for failure
+ */
+int next_symbol(block_t *in, int *htab) {
+    int b, v = 0, c = 1;
+    while ((b = get_bits(in, 1)) != -1) {
+	v = (v<<1) | b | (c <<= 1);
+
+	if (htab[v] != -1)
+	    return htab[v];
+    }
+
+    return -1;
+}
+
+
+/*
+ * ---------------------------------------------------------------------------
+ * Debug code. This turns the library into a stand-alone program for
+ * easy debugging.x
+ */
+static void output_code_set(FILE *fp, huffman_codes_t *cds) {
+    int i, j;
+    int nbits_in = 0, nbits_out = 0;
+    huffman_code_t *codes = cds->codes;
+    int ncodes = cds->ncodes;
+
+    fprintf(fp, "static huffman_code_t codes_FIXME[] = {\n");
+    for (i = j = 0; i < ncodes; i++) {
+	nbits_out += codes[i].nbits * codes[i].freq;
+	nbits_in  += 8*codes[i].freq;
+	if (j == 0)
+	    fprintf(fp, "    ");
+	if (codes[i].symbol == SYM_EOF) {
+	    fprintf(fp, "{SYM_EOF,%3d}, ", codes[i].nbits);
+	    j = 10;
+	} else {
+	    if (isalnum(codes[i].symbol)) {
+		fprintf(fp, "{'%c',%3d}, ", codes[i].symbol, codes[i].nbits);
+	    } else {
+		fprintf(fp, "{%3d,%3d}, ", codes[i].symbol, codes[i].nbits);
+	    }
+	}
+	j++;
+	
+	if (j >= 6) {
+	    fputc('\n', fp);
+	    j = 0;
+	}
+    }
+    if (j)
+	fputc('\n', fp);
+    fprintf(fp, "};\n");
+    fprintf(fp, "/* Expected compression to %f of input */\n",
+	    (double)nbits_out/nbits_in);
+}
+
+static void output_code_set2(FILE *fp, huffman_codes_t *cds) {
+    int i;
+    huffman_code_t *codes = cds->codes;
+    int ncodes = cds->ncodes;
+
+    fprintf(fp, "huffman_code_t = {\n");
+    for (i = 0; i < ncodes; i++) {
+	fprintf(fp, "\t%d:\t%3d %c %2d %04x %d\n",
+		i,codes[i].symbol, codes[i].symbol,
+		codes[i].nbits, codes[i].code,
+		codes[i].freq);
+    }
+    fprintf(fp, "};\n");
+}
+
+
+/*
+ * --------------------------------------------------------------------------
+ * A test main() to create an application capable of compressing and
+ * uncompressing stdin.
+ */
+
+#ifdef TEST_MAIN
+#include <fcntl.h>
+/* #include <zlib.h> */
+
+/*
+ * Slurps the entirety of stdin into a malloced buffer and returns a pointer
+ * to it.
+ *
+ * Returns: malloced buffer on success, *lenp equal to length
+ *          NULL on failure
+ */
+static unsigned char *load(int *lenp, char *fn) {
+    unsigned char *data = NULL;
+    int dsize = 0;
+    int dcurr = 0, len;
+    int fd = 0;
+
+    if (fn) {
+	if (-1 == (fd = open(fn, O_RDONLY, 0))) {
+	    perror(fn);
+	    return NULL;
+	}
+    }
+
+    do {
+	if (dsize - dcurr < 8192) {
+	    dsize = dsize ? dsize * 2 : 8192;
+	    if (NULL == (data = realloc(data, dsize))) {
+		if (fd)
+		    close(fd);
+		return NULL;
+	    }
+	}
+
+	len = read(fd, data + dcurr, 8192);
+	if (len > 0)
+	    dcurr += len;
+    } while (len > 0);
+
+    if (len == -1) {
+	perror("read");
+	if (fd)
+	    close(fd);
+	return NULL;
+    }
+
+    if (fd)
+	close(fd);
+
+    *lenp = dcurr;
+    return data;
+}
+
+/*
+ * Returns 0 for success
+ *        -1 for failure.
+ */
+int decode_main(unsigned char *data, int len, int code_set) {
+    huffman_codeset_t *cs = NULL;
+    block_t *blk_in;
+    unsigned char *out;
+    int err, out_len, i;
+    int bfinal;
+
+    blk_in = block_create(NULL, 1000 + len);
+
+    if (code_set != 0) {
+	cs = generate_code_set(code_set, 1,  /* no. codes */
+			       NULL, 0,      /* data + size */
+			       1,	     /* eof */
+			       MAX_CODE_LEN,
+			       0);	     /* all_codes */
+	store_codes(blk_in, cs, 1);
+    }
+
+    if (blk_in->bit != 0) {
+	blk_in->data[blk_in->byte] |= data[0];
+	memcpy(&blk_in->data[blk_in->byte+1], data+1, len-1);
+    } else {
+	memcpy(&blk_in->data[blk_in->byte], data, len);
+    }
+
+    /* Do the decoding */
+    do {
+	block_t *out;
+	if (!cs)
+	    cs = restore_codes(blk_in, &bfinal);
+	out = huffman_multi_decode(blk_in, cs);
+	write(1, out->data, out->byte);
+	block_destroy(out, 0);
+	huffman_codeset_destroy(cs);
+	cs = NULL;
+    } while (!bfinal);
+
+    block_destroy(blk_in, 0);
+
+    return 0;
+}
+
+/*
+ * Returns 0 for success
+ *        -1 for failure.
+ */
+int encode_main(unsigned char *data, int len, int code_set, int rec_size,
+		int blk_size, int dump_tree, int exit_after_tree) {
+    /* Encoding */
+    unsigned char *d2 = data;
+    block_t *blk;
+    huffman_codeset_t *cs;
+
+    blk = block_create(NULL, 8192);
+    fprintf(stderr, "Input %d bytes\n", len);
+
+    do {
+	int l2 = len > blk_size ? blk_size : len;
+	int i;
+
+	if (code_set != 0)
+	    l2 = len; /* predefined code-sets have final-block bit set */
+	cs = generate_code_set(code_set, rec_size,
+			       d2, l2, /* Data and length */
+			       1,      /* eof */
+			       MAX_CODE_LEN,
+			       0);     /* all codes */
+	if (!cs)
+	    return -1;
+
+	if (dump_tree) {
+	    for (i = 0; i < rec_size; i++) {
+		printf("==Sub-set %d==\n", i);
+		output_code_set(stdout, cs->codes[i]);
+		/* output_code_set2(stdout, cs->codes[i]); */
+	    }
+	    if (exit_after_tree)
+		return 0;
+	}
+
+	store_codes(blk, cs, l2 == len);
+	if (code_set != 0) {
+	    blk->data[blk->byte = 0] = 0;  /* starting bit no. preseved */
+	} else {
+	    /*
+	      fprintf(stderr, "codes finished at %d bytes, %d bits\n",
+		    blk->byte, blk->bit);
+	    */
+	}
+	if (exit_after_tree) {
+	    write(1, blk->data, blk->byte + (blk->bit != 0));
+	    return 0;
+	}
+
+	huffman_multi_encode(blk, cs, code_set, d2, l2);
+
+	huffman_codeset_destroy(cs);
+	len -= l2;
+	d2  += l2;
+
+    } while (len > 0);
+    write(1, blk->data, blk->byte + (blk->bit != 0));
+
+    fprintf(stderr, "Output %ld bytes\n", blk->byte + (blk->bit != 0));
+    block_destroy(blk, 0);
+
+    return 0;
+}
+
+int main(int argc, char **argv) {
+    unsigned char *data;
+    int decode = 0;
+    int dump_tree = 0;
+    int exit_after_tree = 0;
+    int code_set = CODE_INLINE;
+    int blk_size = 0x7fff;
+    int rec_size = 1;
+    int c, r, len;
+    char *fn = NULL;
+
+    while ((c = getopt(argc, argv, "c:detxl:b:hr:i:")) != -1) {
+	switch (c) {
+	case 'b':
+	    blk_size = atoi(optarg);
+	    break;
+
+	case 'c':
+	    code_set = atoi(optarg);
+	    break;
+
+	case 'r':
+	    rec_size = atoi(optarg);
+	    break;
+
+	case 'd':
+	    decode = 1;
+	    break;
+
+	case 'e':
+	    decode = 0;
+	    break;
+
+	case 't':
+	    dump_tree = 1;
+	    break;
+
+	case 'x':
+	    exit_after_tree = 1;
+	    break;
+	    
+	case 'i':
+	    fn = optarg;
+	    break;
+
+	default:
+	    fprintf(stderr, "Usage: huffman_static [options] < stdin > stdout\n");
+	    fprintf(stderr, "    Decoding options\n");
+	    fprintf(stderr, "        -d\tdecode flag\n");
+	    fprintf(stderr, "    Encoding options\n");
+	    fprintf(stderr, "        -e\tencode flag\n");
+	    fprintf(stderr, "        -b size\tspecify the block-size\n");
+	    fprintf(stderr, "        -c code\tspecify code-set. 0 => inline\n");
+	    fprintf(stderr, "        -t\tpretty-print the code-set used\n");
+	    fprintf(stderr, "        -x\texit after outputting code-set\n");
+	    exit(c != 'h');
+	}
+    }
+
+    data = load(&len, fn);
+
+    r = decode
+	? decode_main(data, len, code_set)
+	: encode_main(data, len, code_set, rec_size,
+		      blk_size, dump_tree, exit_after_tree);
+
+    free(data);
+
+    return r == 0 ? 0 : 1;
+}
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/deflate_interlaced.h	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,116 @@
+#ifndef _DEFLATE_SIMPLE_H_
+#define _DEFLATE_SIMPLE_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* inlined codes */
+#define CODE_INLINE	  0   
+
+/* predefined codes */
+#define CODE_DNA	  1   /* DNA, uppercase only */
+#define CODE_DNA_AMBIG	  2   /* DNA, uc with ambiguity codes */
+#define CODE_ENGLISH      3   /* English text */
+#define NCODES_STATIC     4   /* Cheat, but we count from 0 for ease */
+
+/* predefined elsewhere in HUFF chunks, 128 onwards */
+#define CODE_USER	  128 
+
+#define MAX_CODE_LEN	  15 /* maximum allowed by RFC 1951 */
+
+#ifndef ZTR_FORM_STHUFF
+#  define ZTR_FORM_STHUFF  77
+#endif
+
+/* A single symbol and it's encoding */
+typedef struct {
+    signed int symbol; /* 0-255 character, 256 = exception code, 257 = EOF */
+    int nbits;
+    unsigned int code;
+    int freq;
+} huffman_code_t;
+
+/* A collection of huffman_code_t along with decoding optimisations */
+typedef struct {
+    huffman_code_t *codes;
+    int ncodes;
+    int codes_static;
+    huffman_code_t lookup[258]; /* Mapping of symbol character to code */
+    int max_code_len;
+} huffman_codes_t;
+
+/* Use for store_bits() and get_bits() */
+typedef struct block {
+    unsigned char *data;
+    size_t alloc;
+    size_t byte;
+    int bit;
+} block_t;
+
+/* Tree and jump-table data structures used for fast decoding. */
+typedef struct {
+    /* Graph construction */
+    unsigned short c[2]; /* child node */
+      signed short l[2]; /* symbol to emit on transition. -1 => none */
+} htree_t;
+
+typedef struct {
+    /* Byte-wise jumping table */
+    unsigned short jump;
+    unsigned char symbol[4];
+    unsigned char nsymbols;
+    unsigned char top_bit;   /* bit 9 of symbol[] */
+} h_jump4_t;
+
+
+/* A collection of huffman_codes_t, for use with the multi-code codec */
+typedef struct {
+    huffman_codes_t **codes;
+    int ncodes;
+    int code_set; /* (128-255) The user specified number for this encoding */
+
+    /* Cached binary version of codeset, assumes last block */
+    block_t *blk;
+    int      bit_num; /* if 1st block, which bit will stored codes end on */
+
+    /* Cache huffman_multi_decode parameters */
+    h_jump4_t (*decode_J4)[16];
+    htree_t *decode_t;
+} huffman_codeset_t;
+
+block_t *block_create(unsigned char *data, size_t size);
+void block_destroy(block_t *blk, int keep_data);
+int block_resize(block_t *blk, size_t size);
+void store_bytes(block_t *block, unsigned char *val, int nbytes);
+
+
+int huffman_encode(block_t *blk, huffman_codes_t *c, int code_set,
+		   unsigned char *data, int len);
+
+block_t *huffman_decode(block_t *in, huffman_codes_t *c);
+
+int huffman_multi_encode(block_t *blk, huffman_codeset_t *cs,
+			 int code_set, unsigned char *data, int len);
+
+block_t *huffman_multi_decode(block_t *in, huffman_codeset_t *cs);
+
+huffman_codeset_t *codes2codeset(huffman_code_t *codes, int ncodes,
+				 int code_num);
+huffman_codeset_t *generate_code_set(int code_set, int ncodes,
+				     unsigned char *data, int len,
+				     int eof, int max_code_len,
+				     int all_codes);
+
+int store_codes(block_t *out,
+		huffman_codeset_t *c,
+		int last_block);
+huffman_codeset_t *restore_codes(block_t *block, int *bfinal);
+void huffman_codes_destroy(huffman_codes_t *c);
+void huffman_codeset_destroy(huffman_codeset_t *cs);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _DEFLATE_SIMPLE_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/error.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) Medical Research Council 1994. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <stdarg.h>
+
+/*
+ * Usage:
+ *
+ * errout(format, args...);
+ */
+void errout(char *fmt, ...) {
+    va_list args;
+
+    va_start(args, fmt);
+    vfprintf(stderr, fmt, args);
+
+    va_end(args);
+}
+
+/*
+ * memmove() does not exist on SunOS 4.x, despite being an ANSI library call.
+ *
+ * void *memmove(void *to, const void *from, size_t len) {
+ *    bcopy(from, to, len);
+ *    return to;
+ * }
+ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/error.h	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) Medical Research Council 1994. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+#ifndef _ERROR_H_
+#define _ERROR_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern void error(char *fmt, ...);
+extern void errout(char *fmt, ...);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*_GAP_ERROR_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/expFileIO.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,1251 @@
+/*
+ * Copyright (c) Medical Research Council 1994. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+/*
+ * File: expFileIO.c
+ * Version:
+ *
+ * Description: Routines for reading and writing to experiment files.
+ *
+ * 1. Opening experiment files
+ * 2. Reading information from an experiment file
+ * 3. Appending to experiment files
+ * 4. Closing an opened experiment file
+ *
+ * Created:
+ * Updated:
+ *
+ */
+
+/*
+ * Tag format:
+ *
+ * 0        10 
+ * |----.----|-
+ * TG   TYPE S position..length
+ * TG        One or more comment lines starting at character position 10
+ * TG        Each line represents a line of tag.
+ * TG         Extra indentation is simply added to the comment.
+ *
+ * Where S is the strand, either "+", "-", or "=" (both).
+ * Eg:
+ *
+ * TG   COMM = 100..110
+ * TG        This comment contains
+ * TG          several lines.
+ *
+ * So the above is a COMMent tag on both strands from bases 100 to 110
+ * inclusive containing the annotation
+ * "This comment contains\n  several lines.\n"
+ *
+ * This is written using exp_put_str giving the multi line string:
+ * "COMM = 100..110\nThis comment contains\n  several lines."
+ *
+ * (ie the indentation is added by the experiment file format, not by the
+ *  calling routines. Similarly this indentation is stripped out again when
+ *  reading back.)
+ */
+
+
+#include <stdio.h>
+#include <string.h> /* IMPORT: strdup (hopefully!) */
+#include <ctype.h>
+
+/* 6/1/99 johnt - includes needed for Visual C++ */
+#ifdef _MSC_VER
+#  include <io.h>
+#  include <fcntl.h>
+#endif
+
+#include "io_lib/expFileIO.h"
+#include "io_lib/xalloc.h"
+#include "io_lib/misc.h"
+#include "io_lib/stdio_hack.h"
+
+/* Fixup for broken SunOS 4.x systems */
+#ifndef FOPEN_MAX
+#define FOPEN_MAX 20
+#endif
+
+static int exp_check_eid_read(Exp_info *e,int id);
+
+/*************************************************************
+ * Line types for experiment file
+ *************************************************************/
+
+char eflt_feature_ids[MAXIMUM_EFLTS][MAXIMUM_EFLT_LENGTH+1] = {
+    "CF", /*  0 cloning vector sequence file */
+    "CN", /*  1 clone name */
+    "CS", /*  2 cloning vector sequence present in sequence */
+    "CV", /*  3 cloning vector type */
+    "DR", /*  4 direction of read */
+    "DT", /*  5 date of experiment */
+    "EN", /*  6 experiment name */
+    "EX", /*  7 experimental notes */
+    "FM", /*  8 sequencing vector fragmentation method */
+    "LN", /*  9 local format trace file name */
+    "LT", /* 10 local format trace file type */
+    "MC", /* 11 machine on which experiment ran */
+    "MN", /* 12 machine generated trace file name */
+    "MT", /* 13 machine generated trace file type */
+    "OP", /* 14 operator */
+    "PN", /* 15 primer name */
+    "QR", /* 16 poor quality sequence present at right (3') end */
+    "SC", /* 17 sequencing vector cloning site */
+    "SF", /* 18 sequencing vector sequence file */
+    "SI", /* 19 sequencing vector insertion length */
+    "SL", /* 20 sequencing vector present at left (5') end */
+    "SP", /* 21 sequencing vector primer site (relative to cloning site) */
+    "SQ", /* 22 sequence */
+    "SR", /* 23 sequencing vector present at right (3') end */
+    "ST", /* 24 strands */
+    "SV", /* 25 sequencing vector type */
+    "TN", /* 26 template name */
+    "QL", /* 27 poor quality sequence present at left (5') end */
+    "PS", /* 28 processing status */
+    "CC", /* 29 comments */
+    "SS", /* 30 sequence to screen against */
+    /* added 27-May-93 */
+    "TG", /* 31 gel tag line */
+    "ID", /* 32 identifier */
+    /* added 24-Sep-93 */
+    "AQ", /* 33 average quality measure */
+    /* added 15-Oct-93 */
+    "PR", /* 34 primer type */
+    "LI", /* 35 subclone library (mtd) */
+    "LE", /* 36 subclone library entry (well) */
+    /* added 19-Apr-94 */
+    "TC", /* 37 contig tag line */
+    "AC", /* 38 accession number */
+    /* added 11-Nov-94 */
+    "BC", /* 39 base calling software */
+    "ON", /* 40 original base numbers (positions) */
+    "AV", /* 41 accuracy (quality) values */
+    "PC", /* 42 position in contig */
+    "SE", /* 43 sense, whether it is complemented */
+    /* added 5-4-95 */
+    "CL", /* 44 cloning vector left end*/
+    "CR", /* 45 cloning vector right end*/
+    "AP", /* 46 assembly position */
+    "CH", /* 47 special chemistry used (eg taq) */
+    "PD", /* 48 primer data - the sequence of a primer */
+    "WT", /* 49 wild type trace */
+    "NT", /* 50 note */
+    "GD", /* 51 Gap4 database file */
+    "WL", /* 52 wildtype trace left clip point */
+    "WR", /* 53 wildtype trace right clip point */
+    "FT", /* 54 EMBL format feature table */
+    "LG"  /* 55 LiGation: an amalgamation of LI and LE */
+};
+
+
+
+
+/*************************************************************
+ * Output/update lines
+ *************************************************************/
+
+static int exp_print_line_(FILE *fp, char *eflt, char *entry)
+/*
+ * Output an experiment file line
+ */
+{
+    return fprintf(fp,
+		   "%-5s%s\n",
+		   eflt,
+		   entry
+		   )  <  0;
+}
+
+int exp_print_line(FILE *fp, Exp_info *e, int eflt, int i)
+/*
+ * Output an experiment file line
+ */
+{
+    return exp_print_line_(fp,
+			   eflt_feature_ids[eflt], 
+			   arr(char *,e->entries[eflt],i)
+			   );
+}
+
+/*
+ * Outputs a multi-line experiment file line.
+ * Continuation lines are automatically added by adding 5 characters of extra
+ * indentation at the start of each continuation.
+ *
+ * returns -1 for failure, 0 for success.
+ */
+int exp_print_mline(FILE *fp, Exp_info *e, int eflt, int i) {
+    char *p, *c;
+
+    p = arr(char *, e->entries[eflt], i);
+
+    /* first line */
+    if (c = strchr(p, '\n'))
+	*c = '\0';
+    if (-1 == exp_print_line_(fp, eflt_feature_ids[eflt], p))
+	return -1;
+
+    while (c) {
+	*c = '\n';
+	p = c+1;
+	
+	if (c = strchr(p, '\n')) {
+	    *c = '\0';
+	}
+	
+	if (-1 == fprintf(fp, "%-10s%s\n", eflt_feature_ids[eflt], p))
+	    return -1;
+    }
+
+    return 0;
+}
+
+
+int exp_print_seq(FILE *fp, Exp_info *e, int eflt, int i)
+/*
+ * Output an experiment file multi line
+ */
+{
+    int j, l;
+    char *seq;
+    if (fprintf(fp,"%-5s",eflt_feature_ids[eflt])<0) return 1;
+
+    l = strlen(seq = arr(char *,e->entries[eflt],i));
+    for(j=0;j<l;j++) {
+	if (j%60==0) if ( fprintf(fp,"\n    ") < 0 ) return 1;
+	if (j%10==0) if ( fprintf(fp," ") < 0 ) return 1;
+	if ( fprintf(fp,"%c",seq[j]) < 0 ) return 1;
+    }
+    if ( fprintf(fp,"\n//\n") < 0 ) return 1;
+
+    return 0;
+}
+
+int exp_get_feature_index(char *e)
+{
+    int i;
+    for (i = 0; i < MAXIMUM_EFLTS; i++) {
+	if (eflt_feature_ids[i][0] == e[0] &&
+	    eflt_feature_ids[i][1] == e[1])
+	    return i;
+    }
+    
+    return -1;
+}
+
+
+/*************************************************************
+ * Utility routines
+ *************************************************************/
+
+/*
+ * Creates a string of 'range format' from the start and end points.
+ * The string (of form start..end) is also returned.
+ */
+char *exp_create_range(char *str, int start, int end) {
+    sprintf(str, "%d..%d", start, end);
+    return str;
+}
+
+/*
+ * Extracts the start and end points from a range string.
+ * Returns 0 for success and -1 for failure.
+ */
+int exp_extract_range(char *str, int *start, int *end) {
+    return sscanf(str, "%d..%d", start, end) != 2;
+}
+
+Exp_info *exp_create_info(void)
+/*
+ * Allocate space for new experiment file information
+ */
+{
+    Exp_info *new;
+    int i;
+    
+    new = (Exp_info *)xmalloc(sizeof(Exp_info));
+    if (new != NULL) {
+	for(i=0; i< MAXIMUM_EFLTS ; i++) {
+	    new->Nentries[i] = 0;
+	    new->entries[i] = ArrayCreate(sizeof(char *), 1/*one entry*/);
+	}
+	new->fp = NULL;
+    }
+    
+    return new;
+}
+
+
+void exp_destroy_info(Exp_info *e)
+/*
+ * Destroy experiment file information
+ */
+{
+    int i;
+    int j;
+    if (e != NULL_Exp_info) {
+	for (i = 0; i < MAXIMUM_EFLTS; i++) {
+	    Array a = e->entries[i];
+	    for(j=0;j<e->Nentries[i];j++)
+		if (arr(char *,a,j) != NULL) xfree(arr(char *,a,j));
+	    ArrayDestroy(a);
+	}
+	if (e->fp != NULL) fclose(e->fp);
+	xfree(e);
+    }
+}
+
+
+
+
+/*
+ * Read from file a sequence, discarding all white space til a // is
+ * encountered
+ */
+static char *exp_read_sequence(FILE *fp)
+{
+    char *seq = NULL;
+    size_t seq_len = 0, seq_alloc;
+    char line[EXP_FILE_LINE_LENGTH+1];
+    char *l;
+    static int valid_char[256], init = 0;
+
+    /* Initialise lookup tables for efficiency later on.*/
+    if (!init) {
+	int i;
+	for (i = 0; i < 256; i++) {
+	    if (i < 128 && !isspace(i) && !isdigit(i) && !iscntrl(i))
+		valid_char[i] = 1;
+	    else
+		valid_char[i] = 0;
+	}
+	init = 1;
+    }
+
+    /* Initialise memory */
+    seq_alloc = EXP_FILE_LINE_LENGTH * 8;
+    seq = (char *)xmalloc(seq_alloc);
+    if (NULL == seq)
+	return NULL;
+    seq[0] = '\0';
+
+    /* Reading line by line, until we get "//" */
+    l = fgets(line,EXP_FILE_LINE_LENGTH,fp);
+    while (l!= NULL && strncmp(l,"//",2)) {
+	char *a, *b;
+
+	/* make sure the seq buffer is large enough */
+	if (seq_len + EXP_FILE_LINE_LENGTH + 1 > seq_alloc) {
+	    seq_alloc *= 2;
+	    if (NULL == (seq = (char *)xrealloc(seq, seq_alloc)))
+		return NULL;
+	}
+
+	/* copy to seq, stripping spaces on the fly */
+	for(a=line, b = &seq[seq_len]; *a; a++)
+	    if (valid_char[(unsigned char)*a])
+		*b++ = *a;
+	*b = '\0';
+	seq_len = b-seq;
+
+	l = fgets(line,EXP_FILE_LINE_LENGTH,fp);
+    }
+
+    /* Shrink the allocated string to reduce memory usage */
+    seq = (char *)xrealloc(seq, seq_len + 1);
+    
+    return seq;
+}
+
+
+/*
+ * Converts the opos[] array into a char array.
+ * In doing so this shrinks the data size by using a .. notation.
+ * No check is made that buf is large enough. It is recommended that buf is
+ * allocated to 5*len which covers the worst case (for sequences less that
+ * 9999 bases long).
+ *
+ * Note that on older systems sprintf may return the first argument rather
+ * than the number of characters written.
+ * For this reason we have to do the counting ourselves.
+ */
+char *opos2str(int2 *opos, int len, char *buf) {
+    int i, st, f, dir = 0;
+    char *r = buf, *rs = buf;
+    
+    f = opos[st = 0];
+    for (i = 1; i < len; f=opos[i++]) {
+	if (dir == 0)
+	    if (opos[i] == f+1)
+		dir=1;
+	    else if (opos[i] == f-1)
+		dir=-1;
+
+	if (dir && opos[i] != f + dir) {
+	    if (st != i-1)
+		sprintf(buf, "%d..%d ", opos[st], opos[i-1]);
+	    else
+		sprintf(buf, "%d ", opos[st]);
+	    st = i;
+	    dir = 0;
+
+	    buf += strlen(buf);
+		
+	} else if (dir == 0) {
+	    sprintf(buf, "%d ", f);
+
+	    st = i;
+	    buf += strlen(buf);
+	}
+
+	if (buf - rs > 60) {
+	    *buf++ = '\n';
+	    *buf = '\0';
+	    rs = buf - 6;
+	}	
+    }
+    
+    if (st != i-1)
+	sprintf(buf, "%d..%d", opos[st], opos[i-1]);
+    else
+	sprintf(buf, "%d", opos[st]);
+    
+    return r;
+}
+
+
+
+/*
+ * Expands from the character string .. notation to the opos[] array, up to
+ * a maximum of len elements in opos[].
+ *
+ * Returns the length of the opos array.
+ */
+int str2opos(int2 *opos, int len, char *buf) {
+    /* int i, n1, n2, st, en, m, j = 0; */
+    int i, j = 0, st, en;
+    char *cp;
+
+    while (j < len && *buf) {
+	st = strtol(buf, &cp, 10);
+	if (buf == cp) {
+	    buf++;
+	    continue;
+	}
+	buf = cp;
+	if (buf[0] == '.' && buf[1] == '.') {
+	    en = strtol(buf += 2, &cp, 10);
+	    if (buf == cp) {
+		opos[j++] = st;
+		buf++;
+		continue;
+	    }
+	    buf = cp;
+
+	    if (en >= st)
+		for (i = st; i <= en && j < len; i++)
+		    opos[j++] = i;
+	    else
+		for (i = st; i >= en && j < len; i--)
+		    opos[j++] = i;
+	} else {
+	    opos[j++] = st;
+	}
+    }
+
+    return j;
+}
+
+
+/*
+ * Converts the accuracy value string (AV) to the confidence array up to
+ * a maximum of len elements in conf[].
+ *
+ * The AV string is of format:
+ * "x y z ..." where x, y and z are confidence values for the first three
+ * called bases. Or:
+ * "a,b,c,d e,f,g,h i,j,k,l ..." where the 4-tuples represent the four
+ * confidence values for each base.
+ *
+ * Returns: number of confidence values read, or -1 for error.
+ */
+int str2conf(int1 *conf, int len, char *buf) {
+    int ind = 0;
+
+    while (*buf && ind < len) {
+	char *new_buf;
+	int val1;
+
+	val1 = strtol(buf, &new_buf, 10);
+	if (new_buf == buf)
+	    break;
+
+	if (*new_buf == ',') {
+	    fprintf(stderr, "4-tuple system is currently unsupported\n");
+	    return -1;
+	}
+
+	conf[ind++] = val1;
+	buf = new_buf;
+    }
+
+    return ind;
+}
+
+
+/*
+ * Converts the confidence array to the accuracy value string (AV).
+ *
+ * Note no memory overrun checks are performed on buf. It is recommended
+ * that it is allocated to 4*len (worst case of "255 " for each base) plus.
+ * a couple of terminating newline and null plus another byte per 15 values
+ * to allow for the 60-char line length.
+ * For ease, allocating to 5*len+2 is more than sufficient.
+ *
+ * Returns the buf argument.
+ */
+char *conf2str(int1 *conf, int len, char *buf) {
+    int i;
+    char *ret = buf, *rs = buf;
+
+    for (i = 0; i < len; i++) {
+	sprintf(buf, "%d ", conf[i]);
+	buf += strlen(buf);
+
+	if (buf - rs > 60) {
+	    *buf++ = '\n';
+	    *buf = '\0';
+	    rs = buf - 6;
+	}
+    }
+
+    return ret;
+}
+
+/*************************************************************
+ * Main C interface routines
+ *************************************************************/
+
+
+/*
+ * Closes an experiment file (if open), but does not free it.
+ */
+void exp_close(Exp_info *e) {
+    if (e->fp) {
+	fclose(e->fp);
+	e->fp = NULL;
+    }
+}
+
+
+Exp_info *exp_read_info(char *file)
+/*
+ * Read in an experiment file and return handle
+ */
+{
+    Exp_info *e;
+    FILE *fp;
+    
+    /*
+     * open for read
+     */
+    if ((fp = fopen(file,"r"))==NULL) {
+	return NULL_Exp_info;
+    }
+
+    e = exp_fread_info(fp);
+    fclose(fp);
+
+    if (NULL_Exp_info == e) {
+	return NULL_Exp_info;
+    }	
+
+    /*
+     * reopen for appending
+     */
+    e->fp = fopen(file,"a");
+    
+    return e;
+    
+}
+
+
+/*
+ * Read in an experiment file and return handle
+ */
+Exp_info *exp_fread_info(FILE *fp)
+{
+    Exp_info *e;
+    char line[EXP_FILE_LINE_LENGTH+1];
+    char *aline;
+    int alloced_length = EXP_FILE_LINE_LENGTH+1;
+    int apos, len;
+    int last_entry = -1;
+    size_t entry_len = 0;
+    
+    e = exp_create_info();
+
+  
+    /*
+     * No longer has an effect due to mFILE already being loaded. Ifdef not
+     * triggered under mingw anyway.
+     */
+#ifdef _WIN32
+    /* 6/1/99 johnt - need to ensure text mode to translate \r\n to \n */
+    /* _setmode(fileno(fp),_O_TEXT); */
+    mfascii(fp);
+#endif
+    
+    /*
+     * open for read, set this temporarily in this function. Should be NULL
+     * when exiting as this isn't our file pointer to own, but the destroy
+     * function does attempt to automatically close it.
+     */
+    e->fp = fp;
+
+    if (NULL == (aline = (char *)xmalloc(alloced_length)))
+	return NULL;
+    
+    if (e != NULL_Exp_info) {
+	int at_end = 0;
+
+	for(;;) {
+	    char *c;
+	    int entry;
+
+	    /* Read into aline, joining and allocating as necessary */
+	    apos = 0;
+	    do {
+		if (fgets(line,EXP_FILE_LINE_LENGTH,e->fp) == NULL) {
+		    at_end = 1;
+		    break;
+		}
+
+		len = strlen(line);
+		if (apos + len >= alloced_length) {
+		    alloced_length *= 2;
+		    if (NULL == (aline = (char *)xrealloc(aline,
+							  alloced_length))) {
+			e->fp = NULL;
+			return NULL;
+		    }
+		}
+
+		strcpy(aline+apos, line);
+		apos += len;
+	    } while (line[len-1] != '\n');
+
+	    if (at_end)
+		break;
+
+	    /*
+	     * zero terminate first argument
+	     * set c to point to second argument
+	     *
+	     * FIXME: c should point to character 6 always. Indentation is
+	     * important when considering continuation lines.
+	     */
+	    for (c=aline;*c && !isspace(*c); c++) ;
+	    if (*c) {
+		*c++ = '\0';
+		for (;*c && isspace(*c); c++) ;
+	    }
+	    
+	    entry = exp_get_feature_index(aline);
+	    if (entry >= 0) {
+		/*
+		 * Tag lines may be split over multiple lines. If we have no
+		 * tag type then we append to the existing tag.
+		 */
+		if (entry == last_entry &&
+		    (int)(c-aline) >= 10/* continuation lines */
+		    && (entry == EFLT_TG || entry == EFLT_TC ||
+			entry == EFLT_ON || entry == EFLT_AV ||
+			entry == EFLT_NT || entry == EFLT_FT)) {
+		    char *en;
+		    size_t l1, l2;
+
+		    /*
+		     * Extend our current line by the appropriate amount
+		     */
+		    if( exp_check_eid_read(e,entry) )
+			return NULL;
+		    en = exp_get_entry(e,entry);
+		    l1 = entry_len;
+		    l2 = strlen(&aline[10]);
+
+		    if (NULL == (en = exp_get_entry(e, entry) =
+				 (char *)xrealloc(en, l1 + l2 + 1))) {
+			e->fp = NULL;
+			return NULL;
+		    }
+		    
+
+		    /*
+		     * Append the new line (without the \n char)
+		     */
+		    en[l1] = '\n';
+		    aline[l2+9] = '\0';
+		    strcpy(&en[l1+1], &aline[10]);
+
+		    entry_len += l2;
+		} else {
+		    /*
+		     * Increment number of entries for line type entry
+		     * This will force exp_get_entry() to return pointer to
+		     * next free element in array
+		     */
+		    (void)ArrayRef(e->entries[entry],e->Nentries[entry]++);
+		    
+		    if (entry == EFLT_SQ)
+			exp_get_entry(e,entry) = exp_read_sequence(e->fp);
+		    else {
+			char *eoln = strchr(c,'\n');
+			int i;
+
+			if (eoln!=NULL) *eoln='\0';
+
+			if (entry == EFLT_LT)
+			    for (i=3; isspace(c[i]) && i >= 0; c[i--]='\0');
+
+			exp_get_entry(e,entry) = (char *)strdup(c);
+			entry_len = strlen(c);
+		    }
+		}
+	    }
+
+	    last_entry = entry;
+	}
+    }
+
+    e->fp = NULL;
+    xfree(aline);
+    
+    return e;
+}
+
+static int exp_check_eid_read(Exp_info *e,int id)
+/*
+ * Check these are a valid combination and that
+ * an entry exists for read
+ */
+{
+    return (
+	    e == NULL ||
+	    id < 0 ||
+	    id >= MAXIMUM_EFLTS ||
+	    e->Nentries[id] == 0 ||
+	    eflt_feature_ids[id][0]=='\0'
+	    );
+}
+
+static int exp_check_eid_write(Exp_info *e,int id)
+/*
+ * Check these are a valid combination and that
+ * an entry exists for write
+ */
+{
+    return (e == NULL ||
+	    id < 0 ||
+	    id >= MAXIMUM_EFLTS ||
+	    e->fp == NULL ||
+	    eflt_feature_ids[id][0]=='\0');
+}
+
+
+
+
+
+
+int exp_get_int(Exp_info *e, int id, int *val)
+/*
+ * Get the integer for entry id
+ * returns:
+ *    0 - success
+ *    1 - no entry
+ */
+{
+    if ( exp_check_eid_read(e,id) ) return 1;
+    *val = atoi(exp_get_entry(e,id));
+    return 0;
+}
+
+
+int exp_get_rng(Exp_info *e, int id, int *from, int *to)
+/*
+ * Get the integer pair for entry id
+ * returns:
+ *    0 - success
+ *    1 - no entry
+ */
+{
+    if ( exp_check_eid_read(e,id) ) return 1;
+    (void)exp_extract_range(exp_get_entry(e,id), from, to);
+
+    return 0;
+}
+
+
+
+int exp_get_str(Exp_info *e, int id, char *s, f_implicit s_l)
+/*
+ * Get the string for entry id
+ * returns:
+ *    0 - success
+ *    1 - no entry
+ */
+{
+    if ( exp_check_eid_read(e,id) ) return 1;
+    strncpy(s,exp_get_entry(e,id),s_l);
+    
+    return 0;
+}
+
+
+static int exp_append_str(Exp_info *e, int id, char *s, int len)
+/*
+ * Append the string to experiment file for entry id
+ * returns:
+ *    0 - success
+ *    1 - no update
+ */
+{
+    (void)ArrayRef(e->entries[id],e->Nentries[id]++);
+    exp_get_entry(e,id) = (char *)xmalloc(len+1);
+    strncpy(exp_get_entry(e,id), s, len);
+    exp_get_entry(e,id)[len] = '\0';
+    
+    if ( id == EFLT_SQ )
+	return exp_print_seq(e->fp,e,id,e->Nentries[id]-1);
+    else if (id == EFLT_TG || id == EFLT_TC ||
+	     id == EFLT_ON || id == EFLT_AV ||
+	     id == EFLT_NT || id == EFLT_FT)
+	return exp_print_mline(e->fp,e,id,e->Nentries[id]-1);
+    else
+	return exp_print_line(e->fp,e,id,e->Nentries[id]-1);
+}
+
+
+int exp_put_int(Exp_info *e, int id, int *val)
+/*
+ * Append the integer for entry id to the experiment file
+ * returns:
+ *    0 - success
+ *    1 - no update
+ */
+{
+    char buf[EXP_FILE_LINE_LENGTH];
+    if ( exp_check_eid_write(e,id) ) return 1;
+    sprintf(buf,"%d",*val);
+    return exp_append_str(e,id,buf,strlen(buf));
+}
+
+
+int exp_put_rng(Exp_info *e, int id, int *from, int *to)
+/*
+ * Append the integer pair for entry id to the experiment file
+ * returns:
+ *    0 - success
+ *    1 - no update
+ */
+{
+    char buf[EXP_FILE_LINE_LENGTH];
+    if ( exp_check_eid_write(e,id) ) return 1;
+
+    (void )exp_create_range(buf, *from, *to);
+
+    return exp_append_str(e,id,buf,strlen(buf));
+}
+
+
+
+int exp_put_str(Exp_info *e, int id, char *s, f_implicit s_l)
+/*
+ * Append the string for entry id to the experiment file
+ * returns:
+ *    0 - success
+ *    1 - no update
+ */
+{
+    if ( exp_check_eid_write(e,id) ) return 1;
+    return exp_append_str(e,id,s,s_l);
+}
+
+
+/*************************************************************
+ * FORTRAN INTERFACE
+ *************************************************************/
+
+
+
+static int init_done = 0;
+static int NHandles = 0;
+static Exp_info **Handles = NULL;
+
+static int initialise(void)
+{
+    int i;
+    
+    if (init_done) return 0;
+    init_done++;
+    
+    NHandles = FOPEN_MAX;
+    
+    if ( (Handles = (Exp_info **)xmalloc(sizeof(Exp_info *) * NHandles)) == NULL) {
+	NHandles = 0;
+	return 1;
+    }
+    
+    for (i=0; i<NHandles; i++) Handles[i] = NULL;
+    
+    return 0;
+}
+
+
+static int get_free_handle(void)
+/*
+ * find a free entry in the Exp array
+ * returns -1 if there is none
+ */
+{
+    int i;
+    
+    (void) initialise();
+    
+    if (!NHandles) return -1; /* no slots! */
+    for (i=0; i<NHandles && Handles[i]!=NULL; i++) ;
+    return (i==NHandles)?-1:i;
+}
+
+
+static int check_handle(f_int *handle)
+{
+    return (handle == NULL ||
+	    (int) (*handle) <= 0 ||
+	    (int) (*handle) > NHandles);
+}
+
+
+
+f_int expopn_(char *fn, f_implicit fn_l)
+/*
+ * FORTRAN interface to exp_open_file()
+ */
+{
+    char cfn[1025];
+    int handle;
+    
+    if ( (handle = get_free_handle()) >= 0 ) {
+	f2cstr(fn,fn_l,cfn,1024);
+	Handles[handle] = exp_read_info(cfn);
+    }
+    
+    return (f_int) (handle+1);
+}
+
+
+
+f_proc_ret expkil_(f_int *handle)
+/*
+ * FORTRAN interface to exp_destroy_info
+ */
+{
+    Exp_info *e;
+    if ( check_handle(handle) ) f_proc_return();
+    e = (Exp_info *) Handles[(int)(*handle)-1];
+    
+    exp_destroy_info(e);
+    
+    Handles[(int)(*handle)-1] = NULL;
+    *handle = 0;
+    
+    f_proc_return();
+}
+
+f_int expri_(f_int *handle, f_int *id, f_int *val)
+/*
+ * FORTRAN interface to exp_get_int
+ */
+{
+    Exp_info *e;
+    if ( check_handle(handle) ) return 1;
+    e = (Exp_info *) Handles[(int)(*handle)-1];
+    
+    return exp_get_int(e, (int)*id, (int *)val);
+}
+
+
+f_int exprr_(f_int *handle, f_int *id, f_int *from, f_int *to)
+/*
+ * FORTRAN interface to exp_get_rng
+ */
+{
+    Exp_info *e;
+    if ( check_handle(handle) ) return 1;
+    e = (Exp_info *) Handles[(int)(*handle)-1];
+    
+    return exp_get_rng(e,(int)*id,(int *)from,(int *)to);
+    
+}
+
+/* ARGSUSED */
+f_int exprsa_(f_int *handle, f_int *id, char *s, f_int *max_len, f_implicit s_l)
+/*
+ * FORTRAN interface to exp_get_str workalike
+ * NOTE: for use with FORTRAN CHARACTER arrays instead CHARACTER strings
+ */
+{
+    Exp_info *e;
+    if ( check_handle(handle) ) return 1;
+    e = (Exp_info *) Handles[(int)(*handle)-1];
+    
+    if ( exp_check_eid_read(e,*id) ) return 1;
+    c2fstr(exp_get_entry(e,*id),(int)*max_len,s,(int)*max_len);
+    return 0;
+}
+
+
+f_int exprs_(f_int *handle, f_int *id, char *s, f_implicit s_l)
+/*
+ * FORTRAN interface to exp_get_str workalike
+ * NOTE: for use with FORTRAN CHARACTER strings instead CHARACTER arrays
+ */
+{
+    Exp_info *e;
+    if ( check_handle(handle) ) return 1;
+    e = (Exp_info *) Handles[(int)(*handle)-1];
+    
+    if ( exp_check_eid_read(e,*id) ) return 1;
+    c2fstr(exp_get_entry(e,*id),s_l,s,s_l);
+    return 0;
+}
+
+
+f_int expwi_(f_int *handle, f_int *id, f_int *val)
+/*
+ * FORTRAN interface to exp_put_int
+ */
+{
+    Exp_info *e;
+    if ( check_handle(handle) ) return 1;
+    e = (Exp_info *) Handles[(int)(*handle)-1];
+    
+    return exp_put_int(e, (int)*id, (int *)val);
+}
+
+
+f_int expwr_(f_int *handle, f_int *id, f_int *from, f_int *to)
+/*
+ * FORTRAN interface to exp_put_rng
+ */
+{
+    Exp_info *e;
+    if ( check_handle(handle) ) return 1;
+    e = (Exp_info *) Handles[(int)(*handle)-1];
+    
+    return exp_put_rng(e, (int)*id, (int *)from, (int *)to);
+}
+
+
+/* ARGSUSED */
+f_int expwsa_(f_int *handle, f_int *id, char *s, f_int *max_len, f_implicit s_l)
+/*
+ * FORTRAN interface to exp_put_str workalike
+ * NOTE: for use with FORTRAN CHARACTER arrays instead CHARACTER strings
+ */
+{
+    Exp_info *e;
+    char buf[EXP_FILE_LINE_LENGTH];
+    if ( check_handle(handle) ) return 1;
+    e = (Exp_info *) Handles[(int)(*handle)-1];
+    
+    
+    if ( exp_check_eid_write(e,*id) ) return 1;
+    /* don't allow multi-line entries to be written */
+    if (*id == EFLT_SQ ) return 1;
+    f2cstr(s,(int)*max_len,buf,sizeof(buf));
+    return exp_append_str(e,*id,buf,strlen(buf));
+    
+}
+
+f_int expws_(f_int *handle, f_int *id, char *s, f_implicit s_l)
+/*
+ * FORTRAN interface to exp_put_str workalike
+ * NOTE: for use with FORTRAN CHARACTER strings instead CHARACTER arrays
+ */
+{
+    char buf[EXP_FILE_LINE_LENGTH];
+    Exp_info *e;
+    if ( check_handle(handle) ) return 1;
+    e = (Exp_info *) Handles[(int)(*handle)-1];
+    
+    
+    if ( exp_check_eid_write(e,*id) ) return 1;
+    /* don't allow multi-line entries to be written */
+    if (*id == EFLT_SQ ) return 1;
+    f2cstr(s,s_l,buf,sizeof(buf));
+    return exp_append_str(e,*id,buf,s_l);
+}
+
+/*
+ * FORTRAN interface to exp_create_range()
+ */
+void expcr_(char *str, f_int *start, f_int *end, f_implicit str_l) {
+    exp_create_range(str, *start, *end);
+    c2fstr(str, str_l, str, str_l);
+
+    f_proc_return();
+}
+
+/*
+ * FORTRAN interface to exp_extract_range()
+ */
+/* ARGSUSED */
+f_int exper_(char *str, f_int *start, f_int *end, f_implicit str_l) {
+    return exp_extract_range(str, start, end);
+}
+
+
+
+
+/*************************************************************
+ * Go for it!
+ *************************************************************/
+
+static void print_line(FILE *fp, Exp_info *e, int eflt, int all)
+{
+    if (all) {
+	int i;
+	for(i=0;i<e->Nentries[eflt];i++) exp_print_line(fp,e,eflt,i);
+    } else if (e->Nentries[eflt] > 0) {
+	exp_print_line(fp,e,eflt,e->Nentries[eflt]-1);
+    }
+}
+
+
+static void print_mline(FILE *fp, Exp_info *e, int eflt, int all)
+{
+    if (all) {
+	int i;
+	for(i=0;i<e->Nentries[eflt];i++) exp_print_mline(fp,e,eflt,i);
+    } else if (e->Nentries[eflt] > 0) {
+	exp_print_mline(fp,e,eflt,e->Nentries[eflt]-1);
+    }
+}
+
+
+
+static void print_seq(FILE *fp, Exp_info *e, int eflt)
+{
+    if (e->Nentries[eflt] > 0)
+        exp_print_seq(fp,e,eflt,e->Nentries[eflt]-1);
+}
+
+
+
+
+void exp_print_file(FILE *fp, Exp_info *e)
+{
+    print_line(fp,e,EFLT_ID, 0);
+    print_line(fp,e,EFLT_AC, 0);
+    print_line(fp,e,EFLT_EN, 0);
+
+    print_line(fp,e,EFLT_CC, 1);
+    print_line(fp,e,EFLT_EX, 1);
+    print_line(fp,e,EFLT_PS, 1);
+
+    print_line(fp,e,EFLT_LN, 0);
+    print_line(fp,e,EFLT_LT, 0);
+
+    print_line(fp,e,EFLT_CF, 0);
+    print_line(fp,e,EFLT_CV, 0);
+    print_line(fp,e,EFLT_CS, 0);
+    print_line(fp,e,EFLT_CL, 0);
+    print_line(fp,e,EFLT_CR, 0);
+
+    print_line(fp,e,EFLT_SF, 0);
+    print_line(fp,e,EFLT_SV, 0);
+    print_line(fp,e,EFLT_SI, 0);
+    print_line(fp,e,EFLT_SC, 0);
+    print_line(fp,e,EFLT_SP, 0);
+    print_line(fp,e,EFLT_PD, 0);
+    print_line(fp,e,EFLT_FM, 0);
+    print_line(fp,e,EFLT_SL, 0);
+    print_line(fp,e,EFLT_SR, 0);
+
+    print_line(fp,e,EFLT_QL, 0);
+    print_line(fp,e,EFLT_QR, 0);
+
+    print_mline(fp,e,EFLT_TG,1);
+    print_mline(fp,e,EFLT_TC,1);
+    print_mline(fp,e,EFLT_NT,1);
+
+    print_line(fp,e,EFLT_CN, 0);
+    print_line(fp,e,EFLT_TN, 0);
+    print_line(fp,e,EFLT_PN, 0);
+    print_line(fp,e,EFLT_PR, 0);
+    print_line(fp,e,EFLT_LI, 0);
+    print_line(fp,e,EFLT_LE, 0);
+    print_line(fp,e,EFLT_CH, 0);
+
+    print_mline(fp,e,EFLT_ON,0);
+    print_line(fp,e,EFLT_AQ, 0);
+    print_mline(fp,e,EFLT_AV,0);
+
+    print_line(fp,e,EFLT_DR, 0);
+    print_line(fp,e,EFLT_SE, 0);
+    print_line(fp,e,EFLT_PC, 0);
+    print_line(fp,e,EFLT_AP, 0);
+    print_line(fp,e,EFLT_ST, 0);
+
+    print_line(fp,e,EFLT_DT, 0);
+    print_line(fp,e,EFLT_MC, 0);
+    print_line(fp,e,EFLT_MN, 0);
+    print_line(fp,e,EFLT_MT, 0);
+    print_line(fp,e,EFLT_OP, 1);
+    print_line(fp,e,EFLT_BC, 0);
+    print_line(fp,e,EFLT_SS, 0);
+
+    print_line(fp,e,EFLT_WT, 0);
+    print_line(fp,e,EFLT_WL, 0);
+    print_line(fp,e,EFLT_WR, 0);
+
+    print_mline(fp,e,EFLT_FT,1);
+
+    print_seq (fp,e,EFLT_SQ);
+}
+
+
+/*
+ * Allocate an set a new experiment file entry
+ */
+char *exp_set_entry(Exp_info *e, int eflt, char *str) {
+    char *s;
+    size_t l;
+
+    if (NULL == ArrayRef(e->entries[eflt], e->Nentries[eflt]))
+	return NULL;
+    else
+	e->Nentries[eflt]++;
+
+    l = strlen(str);
+    if (NULL == (s = exp_get_entry(e, eflt) = (char *)xmalloc(l+1))) {
+	e->Nentries[eflt]--;
+	return NULL;
+    }
+    strcpy(s, str);
+
+    return s;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/expFileIO.h	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,345 @@
+/*
+ * Copyright (c) Medical Research Council 1994. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+/*
+ * File: expFileIO.h
+ * Version:
+ *
+ * Description:
+ *
+ * Created:
+ * Updated:
+ *
+ */
+
+#ifndef _EXPFILEIO_H_
+#define _EXPFILEIO_H_
+
+#include <stdio.h>
+
+#include "io_lib/mFILE.h"
+#include "io_lib/array.h"
+#include "io_lib/os.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Definitions
+ */
+#define MAXIMUM_EFLT_LENGTH     4
+#define MAXIMUM_EFLTS          60
+#define EFLT_FILE_LINE_LENGTH 128
+#define EXP_FILE_LINE_LENGTH  128
+
+typedef Array Exp_entries;
+
+typedef struct {
+    Array entries[MAXIMUM_EFLTS]; /* array of array of entries */
+    int Nentries[MAXIMUM_EFLTS];
+    mFILE *fp;
+} Exp_info;
+
+#define NULL_Exp_info ( (Exp_info *) NULL )
+
+
+
+#define exp_Nentries(E,I) ((E)->Nentries[I]) /* get last entry for line I */
+
+#define exp_get_entry(E,I) (arr(char *,(E)->entries[I],(E)->Nentries[I] - 1)) /* get last entry for line I */
+
+/*
+ * Allocate an set a new experiment file entry
+ */
+extern char *exp_set_entry(Exp_info *e, int eflt, char *str);
+
+
+
+/*************************************************************
+ * Experiment file line types
+ *************************************************************/ 
+
+extern char eflt_feature_ids[MAXIMUM_EFLTS][MAXIMUM_EFLT_LENGTH+1];
+
+#define EFLT_CF  0
+#define EFLT_CN  1
+#define EFLT_CS  2
+#define EFLT_CV  3
+#define EFLT_DR  4
+#define EFLT_DT  5
+#define EFLT_EN  6
+#define EFLT_EX  7
+#define EFLT_FM  8
+#define EFLT_LN  9
+#define EFLT_LT 10
+#define EFLT_MC 11
+#define EFLT_MN 12
+#define EFLT_MT 13
+#define EFLT_OP 14
+#define EFLT_PN 15
+#define EFLT_QR 16
+#define EFLT_SC 17
+#define EFLT_SF 18
+#define EFLT_SI 19
+#define EFLT_SL 20
+#define EFLT_SP 21
+#define EFLT_SQ 22
+#define EFLT_SR 23
+#define EFLT_ST 24
+#define EFLT_SV 25
+#define EFLT_TN 26
+#define EFLT_QL 27
+#define EFLT_PS 28
+#define EFLT_CC 29
+#define EFLT_SS 30
+#define EFLT_TG 31
+#define EFLT_ID 32
+#define EFLT_AQ 33
+#define EFLT_PR 34
+#define EFLT_LI 35
+#define EFLT_LE 36
+#define EFLT_TC 37
+#define EFLT_AC 38
+#define EFLT_BC 39
+#define EFLT_ON 40
+#define EFLT_AV 41
+#define EFLT_PC 42
+#define EFLT_SE 43
+#define EFLT_CL 44
+#define EFLT_CR 45
+#define EFLT_AP 46
+#define EFLT_CH 47
+#define EFLT_PD 48
+#define EFLT_WT 49
+#define EFLT_NT 50
+#define EFLT_GD 51
+#define EFLT_WL 52
+#define EFLT_WR 53
+#define EFLT_FT 54
+#define EFLT_LG 55
+
+
+/*************************************************************************************/
+
+
+/*
+ * Creates a string of 'range format' from the start and end points.
+ * The string (of form start..end) is also returned.
+ */
+extern char *exp_create_range(char *str, int start, int end);
+
+/*
+ * Extracts the start and end points from a range string.
+ * Returns 0 for success and -1 for failure.
+ */
+extern int exp_extract_range(char *str, int *start, int *end);
+
+/*
+ * Output an experiment file line
+ */
+extern int exp_print_line(mFILE *fp, Exp_info *e, int eflt, int i);
+
+/*
+ * Output an experiment file multi-line
+ */
+extern int exp_print_mline(mFILE *fp, Exp_info *e, int eflt, int i);
+
+extern int exp_print_seq(mFILE *fp, Exp_info *e, int eflt, int i);
+/*
+ * Output an experiment file multi line
+ */
+
+
+
+extern int exp_get_feature_index(char *e);
+
+extern void exp_destroy_info(Exp_info *e);
+/*
+ * Destroy experiment file information
+ */
+
+
+
+extern Exp_info *exp_create_info(void);
+/*
+ * Allocate space for new experiment file information
+ */
+
+
+
+
+
+
+
+extern Exp_info *exp_fread_info(FILE *fp);
+extern Exp_info *exp_mfread_info(mFILE *fp);
+extern Exp_info *exp_read_info(char *file);
+/*
+ * Read in an experiment file and return handle
+ */
+
+
+char *opos2str(int2 *opos, int len, char *buf);
+int   str2opos(int2 *opos, int len, char *buf);
+char *conf2str(int1 *conf, int len, char *buf);
+int   str2conf(int1 *conf, int len, char *buf);
+
+extern int exp_get_int(Exp_info *e, int id, int *val);
+/*
+ * Get the integer for entry id
+ * returns:
+ *    0 - success
+ *    1 - no entry
+ */
+
+
+extern int exp_get_rng(Exp_info *e, int id, int *from, int *to);
+/*
+ * Get the integer pair for entry id
+ * returns:
+ *    0 - success
+ *    1 - no entry
+ */
+
+
+extern int exp_get_str(Exp_info *e, int id, char *s, f_implicit s_l);
+/*
+ * Get the string for entry id
+ * returns:
+ *    0 - success
+ *    1 - no entry
+ */
+
+
+extern int exp_put_int(Exp_info *e, int id, int *val);
+/*
+ * Append the integer for entry id to the experiment file
+ * returns:
+ *    0 - success
+ *    1 - no update
+ */
+
+
+extern int exp_put_rng(Exp_info *e, int id, int *from, int *to);
+/*
+ * Append the integer pair for entry id to the experiment file
+ * returns:
+ *    0 - success
+ *    1 - no update
+ */
+
+
+
+extern int exp_put_str(Exp_info *e, int id, char *s, f_implicit s_l);
+/*
+ * Append the string for entry id to the experiment file
+ * returns:
+ *    0 - success
+ *    1 - no update
+ */
+
+
+extern void exp_close(Exp_info *e);
+/*
+ * Closes an experiment file (if open), but does not free it.
+ */
+
+/*
+ * FORTRAN INTERFACE
+ */
+
+
+
+extern f_int expopn_(char *fn, f_implicit fn_l);
+/*
+ * FORTRAN interface to exp_open_file()
+ */
+
+extern f_proc_ret expkil_(f_int *le);
+/*
+ * FORTRAN interface to exp_destroy_info
+ */
+
+extern f_int expri_(f_int *le, f_int *id, f_int *val);
+/*
+ * FORTRAN interface to exp_get_int
+ */
+
+
+extern f_int exprr_(f_int *le, f_int *id, f_int *from, f_int *to);
+/*
+ * FORTRAN interface to exp_get_rng
+ */
+
+
+extern f_int exprsa_(f_int *le, f_int *id, char *s, f_int *max_len, f_implicit s_l);
+/*
+ * FORTRAN interface to exp_get_str workalike
+ * NOTE: for use with FORTRAN CHARACTER arrays instead CHARACTER strings
+ */
+
+extern f_int exprs_(f_int *le, f_int *id, char *s, f_implicit s_l);
+/*
+ * FORTRAN interface to exp_get_str workalike
+ * NOTE: for use with FORTRAN CHARACTER strings instead CHARACTER arrays
+ */
+
+extern f_int expwi_(f_int *le, f_int *id, f_int *val);
+/*
+ * FORTRAN interface to exp_put_int
+ */
+
+
+extern f_int expwr_(f_int *le, f_int *id, f_int *from, f_int *to);
+/*
+ * FORTRAN interface to exp_put_rng
+ */
+
+
+
+extern f_int expwsa_(f_int *le, f_int *id, char *s, f_int *max_len, f_implicit s_l);
+/*
+ * FORTRAN interface to exp_put_str workalike
+ * NOTE: for use with FORTRAN CHARACTER arrays instead CHARACTER strings
+ */
+
+
+
+extern f_int expws_(f_int *le, f_int *id, char *s, f_implicit s_l);
+/*
+ * FORTRAN interface to exp_put_str workalike
+ * NOTE: for use with FORTRAN CHARACTER strings instead CHARACTER arrays
+ */
+
+
+extern void exp_print_file(FILE *fp, Exp_info *e);
+extern void exp_print_mfile(mFILE *fp, Exp_info *e);
+
+/*
+ * FORTRAN interface to exp_create_range()
+ */
+extern void expcr_(char *str, f_int *start, f_int *end, f_implicit str_l);
+
+/*
+ * FORTRAN interface to exp_extract_range()
+ */
+extern f_int exper_(char *str, f_int *start, f_int *end, f_implicit str_l);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _EXPFILEIO_H_ */
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/files.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,192 @@
+/*
+ * Copyright (c) Medical Research Council 1994. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+#include "io_lib/misc.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Alliant's Concentrix <sys/stat.h> is hugely deficient */
+/* Define things we require in this program              */
+/* Methinks S_IFMT and S_IFDIR aren't defined in POSIX   */
+#ifndef S_ISDIR
+#define S_ISDIR(m)      (((m)&S_IFMT) == S_IFDIR)
+#endif /*!S_ISDIR*/
+#ifndef S_ISREG
+#define S_ISREG(m)      (((m)&S_IFMT) == S_IFREG)
+#endif /*!S_ISREG*/
+
+int is_directory(char * fn)
+{
+    struct stat buf;
+    if ( stat(fn,&buf) ) return 0;
+    return S_ISDIR(buf.st_mode);
+}
+
+int is_file(char * fn)
+{
+    struct stat buf;
+    if ( stat(fn,&buf) ) return 0;
+    return S_ISREG(buf.st_mode);
+}
+
+int file_exists(char * fn)
+{
+    struct stat buf;
+    return ( stat(fn,&buf) == 0);
+}
+
+int compressed_file_exists(char *fname)
+{
+    struct stat buf;
+    char fn[2048];
+
+    if (stat(fname, &buf) == 0) return 1;
+
+    sprintf(fn, "%s.gz", fname);
+    if (stat(fn, &buf) == 0) return 1;
+
+    sprintf(fn, "%s.bz", fname);
+    if (stat(fn, &buf) == 0) return 1;
+
+    sprintf(fn, "%s.bz2", fname);
+    if (stat(fn, &buf) == 0) return 1;
+
+    sprintf(fn, "%s.Z", fname);
+    if (stat(fn, &buf) == 0) return 1;
+
+    sprintf(fn, "%s.z", fname);
+    if (stat(fn, &buf) == 0) return 1;
+
+    return 0;
+}
+
+int file_size(char * fn)
+{
+    struct stat buf;
+    if ( stat(fn,&buf) != 0) return 0;
+    return buf.st_size;
+}
+
+/*
+ * ---------------------------------------------------------------------------
+ * File of filename management
+ */
+
+FILE *open_fofn(char *files) {
+  return fopen(files, "r");
+}
+
+char *read_fofn(FILE *fp) {
+  char line[256];
+  static char name[256];
+  
+  while (fgets(line, 254, fp)) {
+    if (1 == sscanf(line, "%s", name))
+      return name;
+  }
+
+  return NULL;
+}
+
+void close_fofn(FILE *fp) {
+  fclose(fp);
+}
+
+
+/*
+ * ---------------------------------------------------------------------------
+ * Temporary file handling.
+ */
+
+#ifdef _WIN32
+/*
+ * On UNIX systems we use tmpfile().
+ *
+ * On windows this is broken because it always attempts to create files in
+ * the root directory of the current drive, and fails if the user does not
+ * have write permission.
+ *
+ * We can't wrap up mkstemp() either as that doesn't exist under windows.
+ * Instead we roll our own tmpfile() using the native windows API.
+ */
+#include <windows.h>
+#include <winbase.h>
+#include <stdio.h>
+#include <io.h>
+#include <fcntl.h>
+#define _POSIX_ /* needed to get PATH_MAX */
+#include <limits.h>
+
+static void display_win_error(char *msg) {
+    LPVOID lpMsgBuf;
+    FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+    	          FORMAT_MESSAGE_FROM_SYSTEM |
+    	          FORMAT_MESSAGE_IGNORE_INSERTS,
+    	          NULL,
+    	          GetLastError(),
+    	          0,                 /* Default language */
+    	          (LPTSTR)&lpMsgBuf, /* Got to love void* to str casts! */
+    	          0, NULL);
+    fprintf(stderr, "%s: error #%d, %s", msg, GetLastError(), lpMsgBuf);
+    LocalFree(lpMsgBuf);
+}
+
+/*
+ * Creates a temporary file and returns a FILE pointer to it.
+ * The file will be automatically deleted when it is closed or the
+ * applicaton exits.
+ *
+ * Returns NULL on failure.
+ */
+FILE *tmpfile(void) {
+    DWORD ret;
+    char tmp_path[PATH_MAX], shrt_path[PATH_MAX];
+    int fd;
+    FILE *fp;
+
+    /* The Windows Way: get the temp directory and a file within it */
+    ret = GetTempPath(PATH_MAX, tmp_path);
+    if (ret == 0 || ret > PATH_MAX) {
+	display_win_error("GetTempPath()");
+        return NULL;
+    }
+
+    if (0 == GetTempFileName(tmp_path, "fubar", 0, shrt_path)) {
+	display_win_error("GetTempFileName()");
+	return NULL;
+    }
+
+    /*
+     * O_TRUNC incase anyone has managed to inject data in the newly created
+     * file already via race-conditions.
+     *
+     * O_EXCL to (in theory) stop anyone else opening it and to die if someone
+     * beat us to it - although this appears to not actually work on Windows.
+     *
+     * O_TEMPORARY so that the file is removed on close.
+     */
+    if (-1 == (fd = _open(shrt_path, O_RDWR | O_TRUNC | O_EXCL |
+			  O_BINARY | O_TEMPORARY, 0600))) {
+	perror(shrt_path);
+    }
+
+    /* Replace fd with FILE*. No need to close fd */
+    if (NULL == (fp = _fdopen(fd, "r+b"))) {
+	perror(shrt_path);
+    }
+
+    return fp;
+}
+
+#endif /* _WIN32 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/find.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) Medical Research Council 1994. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+#include "io_lib/misc.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+/* 19/3/99 johnt - added Corba support */
+#ifdef USE_CORBA
+#include "stcorba.h"
+#endif
+
+#ifdef USE_BIOLIMS
+#include "spBiolims.h"
+#endif
+
+char *myfind(char *file, char* searchpath, int (*found) (char *) )
+{
+    static char wholePath[1024];
+    char *path;
+    char *f;
+
+    f = NULL;
+    if (found(file)) {
+	strcpy(wholePath,file);
+	f = wholePath;
+    } else if (searchpath != NULL) {
+	char *paths;
+	char *next;
+
+	paths = (char *) malloc(strlen(searchpath)+1);
+	strcpy(paths,searchpath);
+
+	path = paths;
+	next = strchr(path,':');
+        while( next && (*(next+1) == ':' )){
+    	   /* 26/03/99 johnt - allow : to be entered into path by using :: */
+ 	   memmove(next,next+1,strlen(next+1)+1); /* shuffle up data [including \0]*/
+	   next = strchr(next+1,':');
+	}
+        if(next)
+	    *next = '\0';
+
+	while (path!= NULL) {
+
+#ifdef USE_CORBA	
+	  /* 19/03/99 johnt - if it is a corba path - look there */
+          if( !strncmp( CORBATAG,path,strlen(CORBATAG))){
+	    if(corba_found(wholePath,path+strlen(CORBATAG),file)){
+	      f = wholePath;
+	      break;
+	    }
+	  }
+	  else
+#endif
+#ifdef USE_BIOLIMS
+	  if( !strncmp( BIOLIMS_TAG,path,strlen(BIOLIMS_TAG))){
+	    if(biolims_found(wholePath,path+strlen(BIOLIMS_TAG),file)){
+	      f = wholePath;
+	      break;
+	    }
+	  }
+	  else
+#endif    
+	  {
+	    (void) strcpy(wholePath,path);
+	    (void) strcat(wholePath,"/");
+	    (void) strcat(wholePath,file);
+	    if (found(wholePath)) {
+	      f = wholePath;
+	      break;
+	    }
+	  }
+	  path = next;
+	  if( path ){
+	      path++;
+	      next = strchr(path,':');
+	      while( next && (*(next+1) == ':' )){
+    		 /* 26/03/99 johnt - allow : to be entered into path by using :: */
+ 		 memmove(next,next+1,strlen(next+1)+1); /* shuffle up data */
+		 next = strchr(next+1,':');
+	      }
+	      if(next)
+		*next='\0';
+	  }
+	}
+	free(paths);
+    }
+
+    return f;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/fpoint.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) Medical Research Council 1994. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+#include <math.h>
+#include "io_lib/fpoint.h"
+/*
+extern double log ( double x ) ;
+extern double exp ( double x ) ;
+*/
+#define IEEE
+
+float int_to_float(int in)
+/*
+** interpret the integer in as a
+** floating point number in IEEE format
+*/
+{
+   /*
+  Assume `in' is stored as a float according to the 
+  ANSI IEEE 754-1985 standard. See the tables below:
+
+  s = sign ( 1 bit)
+  e = biased exponent (8 bits)
+  f = fraction (23 bits)
+
+  floating point number =  (-1)^s 2^(e-127) 1.f
+
+     Bits  Name      Content
+      31   Sign      1 iff number is negative
+    23-30  Exponent  Eight-Bit exponent, biased by 127
+     0-22  Fraction  23-bit fraction component of normalised significant.
+		     The "one" bit is "hidden"
+
+  If IEEE floating point format is supported on your machine...
+  ensure there is a #define IEEE somewhere. 
+  */
+
+#ifdef IEEE
+  union {
+    int i;
+    float f;
+  } cvt;
+  cvt.i = in;
+  return cvt.f;
+#else
+  int fraction;
+  int exponent;
+  int sign;
+
+  fraction = in & ( (1<<23)-1 );
+  exponent = (in >> 23) & ( (1<<8)-1 );
+  sign = (in >> 31);
+
+  return
+    (float) (
+      (sign?-1.0:1.0) *
+      exp ( log ( (double) 2.0) * (double) (exponent - 127 - 23) ) *
+      (double) ((1<<23)+fraction)) ;
+#endif
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/fpoint.h	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) Medical Research Council 1994. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+#ifndef _fpoint_h
+#define _fpoint_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern float int_to_float(int in);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _fpoint_h */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/hash_table.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,1452 @@
+#ifdef HAVE_CONFIG_H
+#include "io_lib_config.h"
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include "io_lib/os.h"
+#include "io_lib/hash_table.h"
+#include "io_lib/jenkins_lookup3.h"
+
+/* =========================================================================
+ * TCL's hash function. Basically hash*9 + char.
+ * =========================================================================
+ */
+
+uint32_t HashTcl(uint8_t *data, int len) {
+    uint32_t hash = 0;
+    int i;
+
+    for (i = 0; i < len; i++) {
+	hash += (hash<<3) + data[i];
+    }
+
+    return hash;
+}
+
+/* =========================================================================
+ * Paul Hsieh's hash function
+ * http://www.azillionmonkeys.com/qed/hash.html
+ * =========================================================================
+ */
+
+#undef get16bits
+#if (defined(__GNUC__) && defined(__i386__)) || defined(__WATCOMC__) \
+  || defined(_MSC_VER) || defined (__BORLANDC__) || defined (__TURBOC__)
+#define get16bits(d) (*((const uint16_t *) (d)))
+#endif
+
+#if !defined (get16bits)
+#define get16bits(d) ((((const uint8_t *)(d))[1] << 8UL)\
+                      +((const uint8_t *)(d))[0])
+#endif
+
+uint32_t HashHsieh(uint8_t *data, int len) {
+    uint32_t hash = 0, tmp;
+    int rem;
+
+    if (len <= 0 || data == NULL) return 0;
+
+    rem = len & 3;
+    len >>= 2;
+
+    /* Main loop */
+    for (;len > 0; len--) {
+        hash  += get16bits (data);
+        tmp    = (get16bits (data+2) << 11) ^ hash;
+        hash   = (hash << 16) ^ tmp;
+        data  += 2*sizeof (uint16_t);
+        hash  += hash >> 11;
+    }
+
+    /* Handle end cases */
+    switch (rem) {
+    case 3: hash += get16bits (data);
+	hash ^= hash << 16;
+	hash ^= data[sizeof (uint16_t)] << 18;
+	hash += hash >> 11;
+	break;
+    case 2: hash += get16bits (data);
+	hash ^= hash << 11;
+	hash += hash >> 17;
+	break;
+    case 1: hash += *data;
+	hash ^= hash << 10;
+	hash += hash >> 1;
+    }
+
+    /* Force "avalanching" of final 127 bits */
+    hash ^= hash << 3;
+    hash += hash >> 5;
+    hash ^= hash << 2;
+    hash += hash >> 15;
+    hash ^= hash << 10;
+
+    return hash;
+}
+
+/* =========================================================================
+ * Bob Jenkins' hash function
+ * http://burtleburtle.net/bob/hash/doobs.html
+ *
+ * See jenkins_lookup3.c for a new version of this that has good hash
+ * characteristics for a full 64-bit hash value.
+ * =========================================================================
+ */
+
+#define hashsize(n) ((uint32_t)1<<(n))
+#define hashmask(n) (hashsize(n)-1)
+
+/*
+--------------------------------------------------------------------
+mix -- mix 3 32-bit values reversibly.
+For every delta with one or two bits set, and the deltas of all three
+  high bits or all three low bits, whether the original value of a,b,c
+  is almost all zero or is uniformly distributed,
+* If mix() is run forward or backward, at least 32 bits in a,b,c
+  have at least 1/4 probability of changing.
+* If mix() is run forward, every bit of c will change between 1/3 and
+  2/3 of the time.  (Well, 22/100 and 78/100 for some 2-bit deltas.)
+mix() was built out of 36 single-cycle latency instructions in a 
+  structure that could supported 2x parallelism, like so:
+      a -= b; 
+      a -= c; x = (c>>13);
+      b -= c; a ^= x;
+      b -= a; x = (a<<8);
+      c -= a; b ^= x;
+      c -= b; x = (b>>13);
+      ...
+  Unfortunately, superscalar Pentiums and Sparcs can't take advantage 
+  of that parallelism.  They've also turned some of those single-cycle
+  latency instructions into multi-cycle latency instructions.  Still,
+  this is the fastest good hash I could find.  There were about 2^^68
+  to choose from.  I only looked at a billion or so.
+--------------------------------------------------------------------
+*/
+#define mix(a,b,c) \
+{ \
+  a -= b; a -= c; a ^= (c>>13); \
+  b -= c; b -= a; b ^= (a<<8); \
+  c -= a; c -= b; c ^= (b>>13); \
+  a -= b; a -= c; a ^= (c>>12);  \
+  b -= c; b -= a; b ^= (a<<16); \
+  c -= a; c -= b; c ^= (b>>5); \
+  a -= b; a -= c; a ^= (c>>3);  \
+  b -= c; b -= a; b ^= (a<<10); \
+  c -= a; c -= b; c ^= (b>>15); \
+}
+
+/*
+--------------------------------------------------------------------
+hash() -- hash a variable-length key into a 32-bit value
+  k       : the key (the unaligned variable-length array of bytes)
+  len     : the length of the key, counting by bytes
+  initval : can be any 4-byte value
+Returns a 32-bit value.  Every bit of the key affects every bit of
+the return value.  Every 1-bit and 2-bit delta achieves avalanche.
+About 6*len+35 instructions.
+
+The best hash table sizes are powers of 2.  There is no need to do
+mod a prime (mod is sooo slow!).  If you need less than 32 bits,
+use a bitmask.  For example, if you need only 10 bits, do
+  h = (h & hashmask(10));
+In which case, the hash table should have hashsize(10) elements.
+
+If you are hashing n strings (uint8_t **)k, do it like this:
+  for (i=0, h=0; i<n; ++i) h = hash( k[i], len[i], h);
+
+By Bob Jenkins, 1996.  bob_jenkins@burtleburtle.net.  You may use this
+code any way you wish, private, educational, or commercial.  It's free.
+
+See http://burtleburtle.net/bob/hash/evahash.html
+Use for hash table lookup, or anything where one collision in 2^^32 is
+acceptable.  Do NOT use for cryptographic purposes.
+--------------------------------------------------------------------
+*/
+
+uint32_t HashJenkins(uint8_t *k, int length /*, uint32_t initval */)
+{
+   register uint32_t a,b,c,len;
+
+   /* Set up the internal state */
+   len = length;
+   a = b = 0x9e3779b9;  /* the golden ratio; an arbitrary value */
+   c = 0; /* initval; */        /* the previous hash value */
+
+   /*---------------------------------------- handle most of the key */
+   while (len >= 12)
+   {
+      a += (k[0] +((uint32_t)k[1]<<8) +((uint32_t)k[2]<<16) +((uint32_t)k[3]<<24));
+      b += (k[4] +((uint32_t)k[5]<<8) +((uint32_t)k[6]<<16) +((uint32_t)k[7]<<24));
+      c += (k[8] +((uint32_t)k[9]<<8) +((uint32_t)k[10]<<16)+((uint32_t)k[11]<<24));
+      mix(a,b,c);
+      k += 12; len -= 12;
+   }
+
+   /*------------------------------------- handle the last 11 bytes */
+   c += length;
+   switch(len)              /* all the case statements fall through */
+   {
+   case 11: c+=((uint32_t)k[10]<<24);
+   case 10: c+=((uint32_t)k[9]<<16);
+   case 9 : c+=((uint32_t)k[8]<<8);
+      /* the first byte of c is reserved for the length */
+   case 8 : b+=((uint32_t)k[7]<<24);
+   case 7 : b+=((uint32_t)k[6]<<16);
+   case 6 : b+=((uint32_t)k[5]<<8);
+   case 5 : b+=k[4];
+   case 4 : a+=((uint32_t)k[3]<<24);
+   case 3 : a+=((uint32_t)k[2]<<16);
+   case 2 : a+=((uint32_t)k[1]<<8);
+   case 1 : a+=k[0];
+     /* case 0: nothing left to add */
+   }
+   mix(a,b,c);
+   /*-------------------------------------------- report the result */
+   return c;
+}
+
+/*
+ * An interface to the above hash functions.
+ * Returns:
+ *    A 32-bit hash key, suitable for masking down to smaller bit sizes
+ */
+uint32_t hash(int func, uint8_t *key, int key_len) {
+    switch (func) {
+    case HASH_FUNC_HSIEH:
+	return HashHsieh(key, key_len);
+
+    case HASH_FUNC_TCL:
+	return HashTcl(key, key_len);
+	
+    case HASH_FUNC_JENKINS:
+	return HashJenkins(key, key_len);
+
+    case HASH_FUNC_JENKINS3:
+      {
+	uint32_t pc = 0, pb = 0;
+	HashJenkins3(key, key_len, &pc, &pb);
+	return pc;
+      }
+    }
+    
+    return 0;
+}
+
+/*
+ * As per hash() above but returns a 64-bit key. For 32-bit hash functions
+ * this is simply a duplication of the 32-bit value.
+ */
+uint64_t hash64(int func, uint8_t *key, int key_len) {
+    uint32_t pc = 0, pb = 0;
+
+    switch (func) {
+    case HASH_FUNC_HSIEH:
+	pb = pc = HashHsieh(key, key_len);
+	break;
+
+    case HASH_FUNC_TCL:
+	pb = pc = HashTcl(key, key_len);
+	break;
+	
+    case HASH_FUNC_JENKINS:
+	pb = pc = HashJenkins(key, key_len);
+	break;
+
+    case HASH_FUNC_JENKINS3:
+	HashJenkins3(key, key_len, &pc, &pb);
+	break;
+    }
+    
+    return pc + (((uint64_t)pb)<<32);
+}
+
+/* =========================================================================
+ * Hash Table handling code
+ * =========================================================================
+ */
+
+/* Multiplicative factors indicating when to grow or shrink the hash table */
+#define HASH_TABLE_RESIZE 3
+
+/*
+ * Creates a HashItem for use with HashTable h.
+ *
+ * Returns:
+ *    A pointer to new HashItem on success
+ *    NULL on failure.
+ */
+static HashItem *HashItemCreate(HashTable *h) {
+    HashItem *hi;
+
+    hi = (h->options & HASH_POOL_ITEMS
+	  ? pool_alloc(h->hi_pool) : malloc(sizeof(*hi)));
+    if (NULL == hi) return NULL;
+
+    hi->data.p    = NULL;
+    hi->data.i    = 0;
+    hi->next      = NULL;
+    hi->key       = NULL;
+    hi->key_len   = 0;
+
+    h->nused++;
+    
+    return hi;
+}
+
+/*
+ * Deallocates a HashItem created via HashItemCreate.
+ *
+ * This function will not remove the item from the HashTable so be sure to
+ * call HashTableDel() first if appropriate.
+ */
+static void HashItemDestroy(HashTable *h, HashItem *hi, int deallocate_data) {
+    if (!hi) return;
+
+    if (!(h->options & HASH_NONVOLATILE_KEYS) || (h->options & HASH_OWN_KEYS))
+	if (hi->key)
+	    free(hi->key);
+
+    if (deallocate_data && hi->data.p)
+	free(hi->data.p);
+
+    if (h->options & HASH_POOL_ITEMS) {
+        pool_free(h->hi_pool, hi);
+    } else {
+	free(hi);
+    }
+
+    h->nused--;
+}
+
+/*
+ * Creates a new HashTable object. Size will be rounded up to the next
+ * power of 2. It is a starting point and hash tables may be grown or shrunk
+ * as needed (if HASH_DYNAMIC_SIZE is used).
+ *
+ * If HASH_POOL_ITEMS is used, HashItems will be allocated in blocks to reduce
+ * malloc overhead in the case where a large number of items is required.
+ * HashItems allocated this way will be put on a free list when destroyed; the
+ * memory will only be reclaimed when the entire hash table is destroyed.
+ *
+ * Options are as defined in the header file (see HASH_* macros).
+ *
+ * Returns:
+ *    A pointer to a HashTable on success
+ *    NULL on failure
+ */
+HashTable *HashTableCreate(int size, int options) {
+    HashTable *h;
+    int i, bits;
+    uint32_t mask;
+
+    if (!(h = (HashTable *)malloc(sizeof(*h))))
+	return NULL;
+
+    if (options & HASH_POOL_ITEMS) {
+        h->hi_pool = pool_create(sizeof(HashItem));
+	if (NULL == h->hi_pool) {
+	    free(h);
+	    return NULL;
+	}
+    } else {
+        h->hi_pool = NULL;
+    }
+
+    if (size < 4)
+	size = 4; /* an inconsequential minimum size */
+
+    /* Round the requested size to the next power of 2 */
+    bits = 0;
+    size--;
+    while (size) {
+	size /= 2;
+	bits++;
+    }
+    size = 1<<bits;
+    mask = size-1;
+
+    h->nbuckets = size;
+    h->mask = mask;
+    h->options = options;
+    h->nused = 0;
+    h->bucket = (HashItem **)malloc(sizeof(*h->bucket) * size);
+    if (NULL == h->bucket) {
+        HashTableDestroy(h, 0);
+        return NULL;
+    }
+
+    for (i = 0; i < size; i++) {
+	h->bucket[i] = NULL;
+    }
+
+    return h;
+}
+
+/*
+ * Deallocates a HashTable object (created by HashTableCreate).
+ *
+ * The deallocate_data parameter is a boolean to indicate whether the
+ * data attached to the hash table should also be free()d. DO NOT USE
+ * this if the HashData attached was not a pointer allocated using
+ * malloc().
+ */
+void HashTableDestroy(HashTable *h, int deallocate_data) {
+    int i;
+
+    if (!h)
+	return;
+
+    if (h->bucket) {
+        for (i = 0; i < h->nbuckets; i++) {
+	    HashItem *hi = h->bucket[i], *next = NULL;
+	    for (hi = h->bucket[i]; hi; hi = next) {
+	        next = hi->next;
+		HashItemDestroy(h, hi, deallocate_data);
+	    }
+	}
+
+	free(h->bucket);
+    }
+
+    if (h->hi_pool) pool_destroy(h->hi_pool);
+
+    free(h);
+}
+
+/*
+ * Resizes a HashTable to have 'newsize' buckets.
+ * This is called automatically when adding or removing items so that the
+ * hash table keeps at a sensible scale.
+ *
+ * FIXME: Halving the size of the hash table is simply a matter of coaelescing
+ * every other bucket. Instead we currently rehash (which is slower).
+ * Doubling the size of the hash table currently requires rehashing, but this
+ * too could be optimised by storing the full 32-bit hash of the key along
+ * with the key itself. This then means that it's just a matter of seeing what
+ * the next significant bit is. It's a memory vs speed tradeoff though and
+ * re-hashing is pretty quick.
+ *
+ * Returns 0 for success
+ *        -1 for failure
+ */
+int HashTableResize(HashTable *h, int newsize) {
+    HashTable *h2;
+    int i;
+
+    /* fprintf(stderr, "Resizing to %d\n", newsize); */
+
+    /* Create a new hash table and rehash everything into it */
+    h2 = HashTableCreate(newsize, h->options);
+    
+    for (i = 0; i < h->nbuckets; i++) {
+	HashItem *hi, *next;
+	for (hi = h->bucket[i]; hi; hi = next) {
+	    uint64_t hv = hash64(h2->options & HASH_FUNC_MASK,
+				 (uint8_t *)hi->key, hi->key_len) & h2->mask;
+	    next = hi->next;
+	    hi->next = h2->bucket[hv];
+	    h2->bucket[hv] = hi;
+	}
+    }
+
+    /* Swap the links over & free */
+    free(h->bucket);
+    h->bucket   = h2->bucket;
+    h->nbuckets = h2->nbuckets;
+    h->mask     = h2->mask;
+    free(h2);
+
+    return 0;
+}
+
+/*
+ * Adds a HashData item to HashTable h with a specific key. Key can be binary
+ * data, but if key_len is passed as zero then strlen() will be used to
+ * determine the key length.
+ *
+ * The "new" pointer may be passed as NULL. When not NULL it is filled out
+ * as a boolean to indicate whether the key is already in this hash table.
+ *
+ * The HASH_ALLOW_DUP_KEYS option (specified when using HashTableCreate)
+ * will allow duplicate keys to be stored, and hence *new is also zero.
+ * By default duplicate keys are disallowed.
+ *
+ * Keys are considered to be volatile memory (ie temporary storage) and so the
+ * hash table takes separate copies of them. To avoid this use the
+ * HASH_NONVOLATILE_KEYS option.
+ *
+ * If the HASH_OWN_KEYS option was specified when creating the table then
+ * keys will be considered to be owned by the hash table. In this case
+ * the key will be freed when the table is destroyed regardless of
+ * whether the HASH_NONVOLATILE_KEYS option was used to allocate its
+ * own private copy.
+ *
+ * Returns:
+ *    The HashItem created (or matching if a duplicate) on success
+ *    NULL on failure
+ */
+HashItem *HashTableAdd(HashTable *h, char *key, int key_len, HashData data,
+		       int *new) {
+    uint64_t hv;
+    HashItem *hi;
+
+    if (!key_len)
+	key_len = strlen(key);
+
+    hv = hash64(h->options & HASH_FUNC_MASK, (uint8_t *)key, key_len)
+	& h->mask;
+
+    /* Already exists? */
+    if (!(h->options & HASH_ALLOW_DUP_KEYS)) {
+	for (hi = h->bucket[hv]; hi; hi = hi->next) {
+	    if (key_len == hi->key_len &&
+		memcmp(key, hi->key, key_len) == 0) {
+		if (new) *new = 0;
+		return hi;
+	    }
+	}
+    }
+
+    /* No, so create a new one and link it in */
+    if (NULL == (hi = HashItemCreate(h)))
+	return NULL;
+
+    if (h->options & HASH_NONVOLATILE_KEYS)
+	hi->key = key;
+    else {
+	hi->key = (char *)malloc(key_len+1);
+	memcpy(hi->key, key, key_len);
+	hi->key[key_len] = 0; /* null terminate incase others print keys */
+    }
+    hi->key_len = key_len;
+    hi->data = data;
+    hi->next = h->bucket[hv];
+    h->bucket[hv] = hi;
+
+    if ((h->options & HASH_DYNAMIC_SIZE) &&
+	h->nused > HASH_TABLE_RESIZE * h->nbuckets)
+	HashTableResize(h, h->nbuckets*4);
+
+    if (new) *new = 1;
+
+    return hi;
+}
+
+
+/*
+ * Removes a specified HashItem from the HashTable. (To perform this it needs
+ * to rehash based on the hash key as hash_item only has a next pointer and
+ * not a previous pointer.)
+ * 
+ * The HashItem itself is also destroyed (by an internal call to
+ * HashItemDestroy). The deallocate_data parameter controls whether the data
+ * associated with the HashItem should also be free()d.
+ *
+ * See also the HashTableRemove() function to remove by key instead of
+ * HashItem.
+ *
+ * Returns 0 on success
+ *        -1 on failure (eg HashItem not in the HashTable);
+ */
+int HashTableDel(HashTable *h, HashItem *hi, int deallocate_data) {
+    uint64_t hv;
+    HashItem *next, *last;
+
+    hv = hash64(h->options & HASH_FUNC_MASK,
+		(uint8_t *)hi->key, hi->key_len) & h->mask;
+
+    for (last = NULL, next = h->bucket[hv]; next;
+	 last = next, next = next->next) {
+	if (next == hi) {
+	    /* Link last to next->next */
+	    if (last)
+		last->next = next->next;
+	    else
+		h->bucket[hv] = next->next;
+
+	    HashItemDestroy(h, hi, deallocate_data);
+
+	    return 0;
+	}
+    }
+
+    return -1;
+}
+
+
+/*
+ * Searches the HashTable for the data registered with 'key' and removes
+ * these items from the HashTable. In essence this is a combination of
+ * HashTableSearch and HashTableDel functions.
+ *
+ * If HASH_ALLOW_DUP_KEYS is used this will remove all items matching 'key',
+ * otherwise just a single item will be removed.
+ *
+ * If 'deallocate_data' is true the data associated with the HashItem will
+ * be free()d.
+ *
+ * Returns
+ *    0 on success (at least one item found)
+ *   -1 on failure (no items found).
+ */
+int HashTableRemove(HashTable *h, char *key, int key_len,
+		    int deallocate_data) {
+    uint64_t hv;
+    HashItem *last, *next, *hi;
+    int retval = -1;
+
+    if (!key_len)
+	key_len = strlen(key);
+
+    hv = hash64(h->options & HASH_FUNC_MASK, (uint8_t *)key, key_len)
+	& h->mask;
+
+    last = NULL;
+    next = h->bucket[hv];
+
+    while (next) {
+	hi = next;
+	if (key_len == hi->key_len &&
+	    memcmp(key, hi->key, key_len) == 0) {
+	    /* An item to remove, adjust links and destroy */
+	    if (last)
+		last->next = hi->next;
+	    else
+		h->bucket[hv] = hi->next;
+
+	    next = hi->next;
+	    HashItemDestroy(h, hi, deallocate_data);
+
+	    retval = 0;
+	    if (!(h->options & HASH_ALLOW_DUP_KEYS))
+		break;
+
+	} else {
+	    /* We only update last when it's something we haven't destroyed */
+	    last = hi;
+	    next = hi->next;
+	}
+    }
+
+    return retval;
+}
+
+/*
+ * Searches the HashTable for the data registered with 'key'.
+ * If HASH_ALLOW_DUP_KEYS is used this will just be the first one found.
+ * You will then need to use HashTableNext to iterate through the matches.
+ *
+ * Returns
+ *    HashItem if found
+ *    NULL if not found
+ */
+HashItem *HashTableSearch(HashTable *h, char *key, int key_len) {
+    uint64_t hv;
+    HashItem *hi;
+
+    if (!key_len)
+	key_len = strlen(key);
+
+    hv = hash64(h->options & HASH_FUNC_MASK, (uint8_t *)key, key_len)
+	& h->mask;
+    for (hi = h->bucket[hv]; hi; hi = hi->next) {
+	if (key_len == hi->key_len &&
+	    memcmp(key, hi->key, key_len) == 0)
+	    return hi;
+    }
+
+    return NULL;
+}
+
+/*
+ * Find the next HashItem (starting from 'hi') to also match this key.
+ * This is only valid when the HASH_ALLOW_DUP_KEYS is in use.
+ *
+ * Returns
+ *    HashItem if found
+ *    NULL if not found
+ */
+HashItem *HashTableNext(HashItem *hi, char *key, int key_len) {
+    if (!hi)
+	return NULL;
+
+    for (hi = hi->next; hi; hi = hi->next) {
+	if (key_len == hi->key_len &&
+	    memcmp(key, hi->key, key_len) == 0)
+	    return hi;
+    }
+
+    return NULL;
+}
+
+/*
+ * Dumps a textual represenation of the hash table to stdout.
+ */
+void HashTableDump(HashTable *h, FILE *fp) {
+    int i;
+    for (i = 0; i < h->nbuckets; i++) {
+	HashItem *hi;
+	for (hi = h->bucket[i]; hi; hi = hi->next) {
+	    fprintf(fp, "%.*s\n", hi->key_len, hi->key);
+	}
+    }
+}
+
+/*
+ * Produces some simple statistics on the hash table population.
+ */
+void HashTableStats(HashTable *h, FILE *fp) {
+    int i;
+    double avg = (double)h->nused / h->nbuckets;
+    double var = 0;
+    int maxlen = 0;
+    int filled = 0;
+    int clen[51];
+
+    for (i = 0; i <= 50; i++)
+	clen[i] = 0;
+
+    for (i = 0; i < h->nbuckets; i++) {
+	int len = 0;
+	HashItem *hi;
+	for (hi = h->bucket[i]; hi; hi = hi->next) {
+	    len++;
+	}
+	if (len > 0) {
+	    filled++;
+	    if (len > maxlen)
+		maxlen = len;
+	}
+	clen[len <= 50 ? len : 50]++;
+	var += (len-avg) * (len-avg);
+    }
+    var /= h->nbuckets;
+    /* sd = sqrt(var); */
+
+    fprintf(fp, "Nbuckets  = %d\n", h->nbuckets);
+    fprintf(fp, "Nused     = %d\n", h->nused);
+    fprintf(fp, "Avg chain = %f\n", avg);
+    fprintf(fp, "Chain var.= %f\n", var);
+    fprintf(fp, "%%age full = %f\n", (100.0*filled)/h->nbuckets);
+    fprintf(fp, "max len   = %d\n", maxlen);
+    for (i = 0; i <= maxlen; i++) {
+	fprintf(fp, "Chain %2d   = %d\n", i, clen[i]);
+    }
+}
+
+/*
+ * --------------------------------------------------------------------
+ * Below we have a specialisation of the HashTable code where the data
+ * attached to the hash table is a position,size pair. This allows for the
+ * hash table to encode positions and sizes of items within a file archive.
+ * --------------------------------------------------------------------
+ */
+
+/*
+ * Writes the HashTable structures to 'fp'.
+ * This is a specialisation of the HashTable where the HashData is a
+ * position,size tuple.
+ *
+ * This consists of the following format:
+ * Header:
+ *    ".hsh" (magic numebr)
+ *    x4     (1-bytes of version code, eg "1.00")
+ *    x1     (HASH_FUNC_? function used)
+ *    x1     (number of file headers: FH. These count from 1 to FH inclusive)
+ *    x1     (number of file footers: FF. These count from 1 to FF inclusive)
+ *    x1     (reserved - zero for now)
+ *    x4     (4-bytes big-endian; number of hash buckets)
+ *    x8     (offset to add to item positions. eg size of this index)
+ *    x4     (4-bytes big-endian; number of bytes in hash file, inc. header)
+ * Archive name:
+ *    x1     (length, zero => no name)
+ *    ?      (archive filename)
+ * File headers (FH copies of):
+ *    x8     (position)
+ *    x4     (size)
+ * File footers (FH copies of):
+ *    x8     (position)
+ *    x4     (size)
+ * Buckets (multiples of)
+ *    x4     (4-byte offset of linked list pos,  rel. to the start of the hdr)
+ * Items (per bucket chain, not written if Bucket[?]==0)
+ *    x1     (key length, zero => end of chain)
+ *    ?      (key)
+ *    x0.5   (File header to use. zero => none) top 4 bits
+ *    x0.5   (File footer to use. zero => none) bottom 4 bits
+ *    x8     (position)
+ *    x4     (size)
+ * ... arbitrary gap (but likely none)
+ * Index footer:
+ *    ".hsh" (magic number)
+ *    x8     (offset to Hash Header. +ve = absolute, -ve = relative to end)
+ *
+ * It is designed such that on-disk querying of the hash table can be done
+ * purely by forward seeks. (This is generally faster due to pre-fetching of
+ * the subsequent blocks by many disk controllers.)
+ *
+ * Returns: the number of bytes written on success
+ *         -1 for error
+ */
+uint64_t HashFileSave(HashFile *hf, FILE *fp, int64_t offset) {
+    int i;
+    HashItem *hi;
+    uint32_t *bucket_pos;
+    uint64_t hfsize = 0, be_hfsize;
+    HashTable *h = hf->h;
+    HashFileFooter foot;
+   
+    /* Compute the coordinates of the hash items */
+    hfsize = HHSIZE;				/* header */
+    hfsize += 1 + (hf->archive
+		   ? strlen(hf->archive)
+		   : 0);			/* filename */
+    hfsize += h->nbuckets * 4; 			/* buckets */
+    for (i = 0; i < hf->nheaders; i++)		/* headers */
+	hfsize += 12;
+    for (i = 0; i < hf->nfooters; i++)		/* footers */
+	hfsize += 12;
+    bucket_pos = (uint32_t *)calloc(h->nbuckets, sizeof(uint32_t));
+    for (i = 0; i < h->nbuckets; i++) {
+	bucket_pos[i] = hfsize;
+
+	if (!(hi = h->bucket[i]))
+	    continue;
+	for (; hi; hi = hi->next) {
+	    hfsize += 1 + 1 + hi->key_len + 8 + 4; /* keys, pos, size */
+	}
+	hfsize++;				/* list-end marker */
+    }
+    hfsize += sizeof(foot);
+
+    /* Write the header: */
+    memcpy(hf->hh.magic, HASHFILE_MAGIC, 4);
+    memcpy(hf->hh.vers,  HASHFILE_VERSION, 4);
+    hf->hh.hfunc    = h->options & HASH_FUNC_MASK;
+    hf->hh.nheaders = hf->nheaders;
+    hf->hh.nfooters = hf->nfooters;
+    hf->hh.nbuckets = be_int4(h->nbuckets);
+    hf->hh.offset   = offset == HASHFILE_PREPEND
+	? be_int8(hfsize) /* archive will be append to this file */
+	: be_int8(offset);
+    hf->hh.size     = be_int4(hfsize);
+    fwrite(&hf->hh, HHSIZE, 1, fp);
+
+    /* Write the archive filename, if known */
+    if (hf->archive && *hf->archive) {
+	fputc(strlen(hf->archive), fp);
+	fputs(hf->archive, fp);
+    } else {
+	fputc(0, fp);
+    }
+
+    /* Write out the headers and footers */
+    for (i = 0; i < hf->nheaders; i++) {
+	HashFileSection hs;
+	hs.pos  = be_int8(hf->headers[i].pos);
+	fwrite(&hs.pos, 8, 1, fp);
+	hs.size = be_int4(hf->headers[i].size);
+	fwrite(&hs.size, 4, 1, fp);
+    }
+
+    for (i = 0; i < hf->nfooters; i++) {
+	HashFileSection hs;
+	hs.pos  = be_int8(hf->footers[i].pos);
+	fwrite(&hs.pos, 8, 1, fp);
+	hs.size = be_int4(hf->footers[i].size);
+	fwrite(&hs.size, 4, 1, fp);
+    }
+
+    /* Write out hash buckets */
+    for (i = 0; i < h->nbuckets; i++) {
+	uint32_t zero = 0;
+	uint32_t be32;
+
+	if (!(hi = h->bucket[i])) {
+	    fwrite(&zero, 4, 1, fp);
+	    continue;
+	}
+
+	be32 = be_int4(bucket_pos[i]);
+	fwrite(&be32, 4, 1, fp);
+    }
+    free(bucket_pos);
+
+    /*
+     * Write the hash_item linked lists. The first item is the
+     * hash key length. We append a zero to the end of the list so we
+     * can check this key length to determine the end of this hash
+     * item list.
+     */
+    for (i = 0; i < h->nbuckets; i++) {
+	if (!(hi = h->bucket[i]))
+	    continue;
+	for (; hi; hi = hi->next) {
+	    uint64_t be64;
+	    uint32_t be32;
+	    HashFileItem *hfi = (HashFileItem *)hi->data.p;
+	    unsigned char headfoot = 0;
+
+	    fprintf(fp, "%c%.*s", hi->key_len,
+		    hi->key_len, hi->key);
+	    headfoot = (((hfi->header) & 0xf) << 4) | ((hfi->footer) & 0xf);
+	    fwrite(&headfoot, 1, 1, fp);
+	    be64 = be_int8(hfi->pos);
+	    fwrite(&be64, 8, 1, fp);
+	    be32 = be_int4(hfi->size);
+	    fwrite(&be32, 4, 1, fp);
+	}
+        fputc(0, fp);
+    }
+
+    /* Finally write the footer referencing back to the header start */
+    memcpy(foot.magic, HASHFILE_MAGIC, 4);
+    be_hfsize = be_int8(-hfsize);
+    memcpy(foot.offset, &be_hfsize, 8);
+    fwrite(&foot, sizeof(foot), 1, fp);
+
+    return hfsize;
+}
+
+/*
+ * Reads an entire HashTable from fp.
+ *
+ * Returns:
+ *    A filled out HashTable pointer on success
+ *    NULL on failure   
+ */
+HashFile *HashFileLoad_old(FILE *fp) {
+    int i;
+    HashTable *h;
+    HashItem *hi;
+    HashFile *hf;
+    uint32_t *bucket_pos;
+    unsigned char *htable;
+    int htable_pos;
+    int fnamelen;
+
+    if (NULL == (hf = (HashFile *)calloc(1, sizeof(HashFile))))
+	return NULL;
+    if (NULL == (htable = (unsigned char *)malloc(HHSIZE)))
+	return NULL;
+
+    /* Read and create the hash table header */
+    if (HHSIZE != fread(htable, 1, HHSIZE, fp))
+	return NULL;
+    memcpy(&hf->hh, htable, HHSIZE);
+    hf->hh.nbuckets = be_int4(hf->hh.nbuckets);
+    hf->hh.offset = be_int8(hf->hh.offset);
+    hf->hh.size = be_int4(hf->hh.size);
+    hf->h = h = HashTableCreate(hf->hh.nbuckets, hf->hh.hfunc);
+    bucket_pos = (uint32_t *)calloc(h->nbuckets, sizeof(uint32_t));
+
+    /* Load the archive filename */
+    fnamelen = fgetc(fp);
+    if (fnamelen) {
+	hf->archive = (char *)malloc(fnamelen+1);
+	fread(hf->archive, 1, fnamelen, fp);
+	hf->archive[fnamelen] = 0;
+	if (hf->archive[0] == 0) {
+	    free(hf->archive);
+	    hf->archive = NULL;
+	}
+    }
+
+    /* Load the rest of the hash table to memory */
+    htable_pos = HHSIZE + fnamelen + 1;
+    if (NULL == (htable = (unsigned char *)realloc(htable, hf->hh.size)))
+	return NULL;
+    if (hf->hh.size-htable_pos !=
+	fread(&htable[htable_pos], 1, hf->hh.size-htable_pos, fp))
+	return NULL;
+
+    /* Read the header / footer items */
+    for (i = 0; i < hf->hh.nheaders; i++)
+	htable_pos += 8; /* skip them for now */
+    for (i = 0; i < hf->hh.nfooters; i++)
+	htable_pos += 8; /* skip them for now */
+
+    /* Identify the "bucket pos". Detemines which buckets have data */
+    for (i = 0; i < h->nbuckets; i++) {
+	memcpy(&bucket_pos[i], &htable[htable_pos], 4);
+	bucket_pos[i] = be_int4(bucket_pos[i]);
+	htable_pos += 4;
+    }
+
+    /* Read the hash table items */
+    for (i = 0; i < h->nbuckets; i++) {
+	if (!bucket_pos[i])
+	    continue;
+	for (;;) {
+	    int c;
+	    unsigned char uc;
+	    char key[256];
+	    uint64_t pos;
+	    uint32_t size;
+	    HashFileItem *hfi;
+
+	    c = htable[htable_pos++];
+	    if (c == EOF || !c)
+		break;
+
+	    /* key */
+	    memcpy(key, &htable[htable_pos], c);
+	    htable_pos += c;
+
+	    /* header/footer */
+	    uc = htable[htable_pos++];
+	    hfi = (HashFileItem *)malloc(sizeof(*hfi));
+	    hfi->header = (uc >> 4) & 0xf;
+	    hfi->footer = uc & 0xf;
+
+	    /* pos */
+	    memcpy(&pos, &htable[htable_pos], 8);
+	    htable_pos += 8;
+	    hfi->pos = be_int8(pos) + hf->hh.offset;
+
+	    /* size */
+	    memcpy(&size, &htable[htable_pos], 4);
+	    htable_pos += 4;
+	    hfi->size = be_int4(size);
+
+	    /* Add to the hash table */
+	    hi = HashItemCreate(h);
+	    hi->next = h->bucket[i];
+	    h->bucket[i] = hi;
+	    hi->key_len = c;
+	    hi->key = (char *)malloc(c+1);
+	    memcpy(hi->key, key, c);
+	    hi->key[c] = 0; /* For debugging convenience only */
+	    hi->data.p = hfi;
+	}
+    }
+
+    fprintf(stderr, "done\n");
+    fflush(stderr);
+    free(bucket_pos);
+
+    return hf;
+}
+
+/*
+ * Opens a stored hash table file. It also internally keeps an open file to
+ * hash and the archive files.
+ *
+ * Returns the HashFile pointer on success
+ *         NULL on failure
+ */
+HashFile *HashFileFopen(FILE *fp) {
+    HashFile *hf = HashFileCreate(0, 0);
+    int archive_len;
+    int i;
+
+    /* Set the stdio buffer to be small to avoid massive I/O wastage */
+
+    /* Read the header */
+    hf->hfp = fp;
+    hf->afp = fp;
+    hf->hf_start = ftello(hf->hfp);
+
+    if (HHSIZE != fread(&hf->hh, 1, HHSIZE, hf->hfp)) {
+	HashFileDestroy(hf);
+	return NULL;
+    }
+    if (memcmp(HASHFILE_MAGIC, &hf->hh, 4) != 0) {
+	HashFileFooter foot;
+	int64_t offset;
+
+	/* Invalid magic number, try other end of file! */
+	fseeko(hf->hfp, -(off_t)sizeof(HashFileFooter), SEEK_END);
+	if (sizeof(foot) != fread(&foot, 1, sizeof(foot), hf->hfp)) {
+	    HashFileDestroy(hf);
+	    return NULL;
+	}
+	if (memcmp(HASHFILE_MAGIC, &foot.magic, 4) != 0) {
+	    HashFileDestroy(hf);
+	    return NULL;
+	}
+	memcpy(&offset, foot.offset, 8);
+	offset = be_int8(offset);
+	fseeko(hf->hfp, offset, SEEK_CUR);
+	hf->hf_start = ftello(hf->hfp);
+	if (HHSIZE != fread(&hf->hh, 1, HHSIZE, hf->hfp)) {
+	    HashFileDestroy(hf);
+	    return NULL;
+	}
+    }
+    if (memcmp(hf->hh.vers, HASHFILE_VERSION, 4) != 0) {
+	/* incorrect version */
+	HashFileDestroy(hf);
+	return NULL;
+    }
+    
+    hf->hh.nbuckets = be_int4(hf->hh.nbuckets);
+    hf->hh.offset   = be_int8(hf->hh.offset);
+    hf->hh.size     = be_int4(hf->hh.size);
+
+    /* Load the main archive filename */
+    if ((archive_len = fgetc(hf->hfp))) {
+	hf->archive = (char *)malloc(archive_len+1);
+	fread(hf->archive, 1, archive_len, hf->hfp);
+	hf->archive[archive_len] = 0;
+	if (hf->archive[0] == 0) {
+	    free(hf->archive);
+	    hf->archive = NULL;
+	}
+    }
+
+    hf->header_size = HHSIZE + 1 + archive_len +
+	12 * (hf->hh.nheaders + hf->hh.nfooters);
+    hf->nheaders = hf->hh.nheaders;
+    hf->nfooters = hf->hh.nfooters;
+
+    /* Load the header and footer locations */
+    hf->headers = hf->nheaders
+	? (HashFileSection *)malloc(hf->nheaders * sizeof(HashFileSection))
+	: NULL;
+    for (i = 0; i < hf->nheaders; i++) {
+	fread(&hf->headers[i].pos,  8, 1, hf->hfp);
+	fread(&hf->headers[i].size, 4, 1, hf->hfp);
+	hf->headers[i].pos  = be_int8(hf->headers[i].pos) + hf->hh.offset;
+	hf->headers[i].size = be_int4(hf->headers[i].size);
+	hf->headers[i].cached_data = NULL;
+    }
+
+    hf->footers = hf->nfooters
+	? (HashFileSection *)malloc(hf->nfooters * sizeof(HashFileSection))
+	: NULL;
+    for (i = 0; i < hf->nfooters; i++) {
+	fread(&hf->footers[i].pos,  8, 1, hf->hfp);
+	fread(&hf->footers[i].size, 4, 1, hf->hfp);
+	hf->footers[i].pos  = be_int8(hf->footers[i].pos) + hf->hh.offset;
+	hf->footers[i].size = be_int4(hf->footers[i].size);
+	hf->footers[i].cached_data = NULL;
+    }
+
+    return hf;
+}
+
+HashFile *HashFileOpen(char *fname) {
+    FILE *fp;
+    HashFile *hf;
+
+    /* Open the hash and read the header */
+    if (NULL == (fp = fopen(fname, "rb")))
+	return NULL;
+
+    if (!(hf = HashFileFopen(fp)))
+	return NULL;
+
+    /* Open the main archive too */
+    if (hf->archive) {
+	if (NULL == (hf->afp = fopen(hf->archive, "rb"))) {
+	    /* Possibly done via a relative pathname (optimal infact) */
+	    char *cp;
+	    char aname[1024];
+	    if (NULL == (cp = strrchr(fname, '/'))) {
+		HashFileDestroy(hf);
+		return NULL;
+	    }
+	    sprintf(aname, "%.*s%s", (int)(cp-fname+1), fname, hf->archive);
+	    if (NULL == (hf->afp = fopen(aname, "rb"))) {
+
+		return NULL;
+	    }
+	}
+    } else {
+	hf->afp = hf->hfp;
+    }
+
+    return hf;
+}
+
+HashFile *HashFileLoad(FILE *fp) {
+    HashFile *hf;
+    char *htable;
+    off_t htable_pos;
+    int i;
+    HashItem *hi;
+    HashTable *h;
+    uint32_t *bucket_pos;
+    uint32_t hsize;
+
+    /* Open the hash table */
+    fseeko(fp, 0, SEEK_SET);
+    if (NULL == (hf = HashFileFopen(fp)))
+	return NULL;
+
+    HashTableDestroy(hf->h, 1);
+    h = hf->h = HashTableCreate(hf->hh.nbuckets, hf->hh.hfunc);
+    bucket_pos = (uint32_t *)calloc(h->nbuckets, sizeof(uint32_t));
+
+    /* Also load in the entire thing to memory */
+    htable = (char *)malloc(hf->hh.size);
+    fseeko(fp, hf->hf_start, SEEK_SET);
+    hsize = fread(htable, 1, hf->hh.size, fp);
+    if (hf->hh.size != hsize) {
+	free(htable);
+	return NULL;
+    }
+
+    /*
+     * HashFileOpen has already decoded the headers up to and including the
+     * individual file header/footer sections, but not the buckets and item
+     * lists, so we start from there.
+     */
+    htable_pos = hf->header_size;
+    
+    /* Identify the "bucket pos". Detemines which buckets have data */
+    for (i = 0; i < h->nbuckets; i++) {
+	memcpy(&bucket_pos[i], &htable[htable_pos], 4);
+	bucket_pos[i] = be_int4(bucket_pos[i]);
+	htable_pos += 4;
+    }
+
+    /* Read the hash table items */
+    for (i = 0; i < h->nbuckets; i++) {
+	if (!bucket_pos[i])
+	    continue;
+	for (;;) {
+	    int c;
+	    unsigned char uc;
+	    char key[256];
+	    uint64_t pos;
+	    uint32_t size;
+	    HashFileItem *hfi;
+
+	    c = htable[htable_pos++];
+	    if (c == EOF || !c)
+		break;
+
+	    /* key */
+	    memcpy(key, &htable[htable_pos], c);
+	    htable_pos += c;
+
+	    /* header/footer */
+	    uc = htable[htable_pos++];
+	    hfi = (HashFileItem *)malloc(sizeof(*hfi));
+	    hfi->header = (uc >> 4) & 0xf;
+	    hfi->footer = uc & 0xf;
+
+	    /* pos */
+	    memcpy(&pos, &htable[htable_pos], 8);
+	    htable_pos += 8;
+	    hfi->pos = be_int8(pos) + hf->hh.offset;
+
+	    /* size */
+	    memcpy(&size, &htable[htable_pos], 4);
+	    htable_pos += 4;
+	    hfi->size = be_int4(size);
+
+	    /* Add to the hash table */
+	    hi = HashItemCreate(h);
+	    hi->next = h->bucket[i];
+	    h->bucket[i] = hi;
+	    hi->key_len = c;
+	    hi->key = (char *)malloc(c+1);
+	    memcpy(hi->key, key, c);
+	    hi->key[c] = 0; /* For debugging convenience only */
+	    hi->data.p = hfi;
+	}
+    }
+
+    fflush(stderr);
+    free(bucket_pos);
+
+    return hf;
+}
+
+/*
+ * Searches the named HashFile for a specific key.
+ * When found it returns the position and size of the object in pos and size.
+ *
+ * Returns
+ *    0 on success (pos & size updated)
+ *   -1 on failure
+ */
+int HashFileQuery(HashFile *hf, uint8_t *key, int key_len,
+		  HashFileItem *item) {
+    uint64_t hval;
+    uint32_t pos;
+    int klen;
+    int cur_offset = 0;
+
+    /* Hash 'key' to compute the bucket number */
+    hval = hash64(hf->hh.hfunc, key, key_len) & (hf->hh.nbuckets-1);
+
+    /* Read the bucket to find the first linked list item location */
+    if (-1 == fseeko(hf->hfp, hf->hf_start + 4*hval + hf->header_size,SEEK_SET))
+	return -1;
+    if (4 != fread(&pos, 1, 4, hf->hfp))
+	return -1;
+    pos = be_int4(pos);
+    cur_offset = 4*hval + 4 + hf->header_size;
+
+    if (0 == pos)
+	/* No bucket pos => key not present */
+	return -1;
+
+    /* Jump to the HashItems list and look through for key */
+    if (-1 == fseeko(hf->hfp, pos - cur_offset, SEEK_CUR))
+	return -1;
+
+    for (klen = fgetc(hf->hfp); klen; klen = fgetc(hf->hfp)) {
+	char k[256];
+	unsigned char headfoot;
+	uint64_t pos;
+	uint32_t size;
+
+	fread(k, klen, 1, hf->hfp);
+	fread(&headfoot, 1, 1, hf->hfp);
+	item->header = (headfoot >> 4) & 0xf;
+	item->footer = headfoot & 0xf;
+	fread(&pos, 8, 1, hf->hfp);
+	pos = be_int8(pos) + hf->hh.offset;
+	fread(&size, 4, 1, hf->hfp);
+	size = be_int4(size);
+	if (klen == key_len && 0 == memcmp(key, k, key_len)) {
+	    item->pos = pos;
+	    item->size = size;
+	    return 0;
+	}
+    }
+
+    return -1;
+}
+
+HashFile *HashFileCreate(int size, int options) {
+    HashFile *hf;
+
+    if (NULL == (hf = (HashFile *)calloc(1, sizeof(*hf))))
+	return NULL;
+    if (NULL == (hf->h = HashTableCreate(size, options)))
+	return NULL;
+
+    return hf;
+}
+
+void HashFileDestroy(HashFile *hf) {
+    if (!hf)
+	return;
+
+    if (hf->h)
+	HashTableDestroy(hf->h, 1);
+    if (hf->archive)
+	free(hf->archive);
+    if (hf->headers) {
+	int i;
+	for (i = 0; i < hf->nheaders; i++) {
+	    if (hf->headers[i].cached_data)
+		free(hf->headers[i].cached_data);
+	}
+	free(hf->headers);
+    }
+    if (hf->footers) {
+	int i;
+	for (i = 0; i < hf->nfooters; i++) {
+	    if (hf->footers[i].cached_data)
+		free(hf->footers[i].cached_data);
+	}
+	free(hf->footers);
+    }
+
+    if (hf->afp)
+	fclose(hf->afp);
+    if (hf->hfp && hf->hfp != hf->afp)
+	fclose(hf->hfp);
+
+    free(hf);
+}
+
+/*
+ * Extracts the contents for a file out of the HashFile.
+ */
+char *HashFileExtract(HashFile *hf, char *fname, size_t *len) {
+    HashFileItem hfi;
+    size_t sz, pos;
+    char *data;
+    HashFileSection *head = NULL, *foot = NULL;
+
+    /* Find out if and where the item is in the archive */
+    if (-1 == HashFileQuery(hf, (uint8_t *)fname, strlen(fname), &hfi))
+	return NULL;
+
+    /* Work out the size including header/footer and allocate */
+    sz = hfi.size;
+    if (hfi.header) {
+	head = &hf->headers[hfi.header-1];
+	sz += head->size;
+    }
+    if (hfi.footer) {
+	foot = &hf->footers[hfi.footer-1];
+	sz += foot->size;
+    }
+    *len = sz;
+
+    if (NULL == (data = (char *)malloc(sz+1)))
+	return NULL;
+    data[sz] = 0;
+
+    /* Header */
+    pos = 0;
+    if (head) {
+	fseeko(hf->afp, head->pos, SEEK_SET);
+	fread(&data[pos], head->size, 1, hf->afp);
+	pos += head->size;
+    }
+
+    /* Main file */
+    fseeko(hf->afp, hfi.pos, SEEK_SET);
+    fread(&data[pos], hfi.size, 1, hf->afp);
+    pos += hfi.size;
+
+    /* Footer */
+    if (foot) {
+	fseeko(hf->afp, foot->pos, SEEK_SET);
+	fread(&data[pos], foot->size, 1, hf->afp);
+	pos += foot->size;
+    }
+
+    return data;
+}
+
+/*
+ * Iterates through members of a hash table returning items sequentially.
+ *
+ * Returns the next HashItem on success
+ *         NULL on failure.
+ */
+HashItem *HashTableIterNext(HashTable *h, HashIter *iter) {
+    do {
+	if (iter->hi == NULL) {
+	    if (++iter->bnum >= h->nbuckets)
+		break;
+	    iter->hi = h->bucket[iter->bnum];
+	} else {
+	    iter->hi = iter->hi->next;
+	}
+    } while (!iter->hi);
+    
+    return iter->hi;
+}
+
+void HashTableIterReset(HashIter *iter) {
+    if (iter) {
+	iter->bnum = -1;
+	iter->hi = NULL;
+    }
+}
+
+HashIter *HashTableIterCreate(void) {
+    HashIter *iter = (HashIter *)malloc(sizeof(*iter));
+
+    HashTableIterReset(iter);
+    return iter;
+}
+
+void HashTableIterDestroy(HashIter *iter) {
+    if (iter)
+	free(iter);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/hash_table.h	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,163 @@
+#ifndef _HASH_TABLE_H_
+#define _HASH_TABLE_H_
+
+#include <inttypes.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "io_lib/pooled_alloc.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* The data referenced by the hash table */
+typedef union {
+    uint64_t i;
+    void *p;
+} HashData;
+
+/* A hash item with "next" pointer to use in a linked list */
+typedef struct HashItemStruct {
+    HashData data;        /* user defined data attached to this key */
+    char    *key;         /* key we hashed on */
+    int      key_len;     /* and its length */
+    struct HashItemStruct *next;
+} HashItem;
+
+/* The main hash table structure itself */
+typedef struct {
+    int       options;  /* HASH_FUNC & HASH_OPT macros */
+    uint32_t  nbuckets; /* Number of hash buckets; power of 2 */
+    uint32_t  mask;	/* bit-mask equiv of nbuckets */
+    int       nused;    /* How many hash entries we're storing */
+    HashItem **bucket;  /* The bucket "list heads" themselves */
+    pool_alloc_t *hi_pool; /* Pool of allocated HashItem structs */
+} HashTable;
+
+/* An iterator on HashTable items */
+typedef struct {
+    int bnum;
+    HashItem *hi;
+} HashIter;
+
+#define HASHFILE_MAGIC ".hsh"
+#define HASHFILE_VERSION "1.00"
+#define HASHFILE_PREPEND -1
+
+/* File format: the hash table header */
+typedef struct {
+    char magic[4];
+    char vers[4];
+    char hfunc;
+    unsigned char nheaders;
+    unsigned char nfooters;
+    char reserved; /* 0 */
+    uint32_t nbuckets;
+    int64_t offset;
+    uint32_t size;
+} HashFileHeader;
+
+/* sizeof(HashFileHeader) minus terminal padding */
+#define HHSIZE 28
+
+typedef struct {
+    char magic[4];
+    char offset[8];
+} HashFileFooter;
+
+/* The data block attached to the hash table */
+typedef struct {
+    uint64_t pos;
+    uint32_t size;
+    unsigned char header; /* zero if not set */
+    unsigned char footer; /* zero if not set */
+} HashFileItem;
+
+/* Common headers or footers to prepend to the archive contents */
+typedef struct {
+    uint64_t pos;
+    uint32_t size;
+    unsigned char *cached_data;
+} HashFileSection;
+
+/*
+ * The main structure for the HashFile functions.
+ *
+ * We obtain an existing HashFile by opening a stored hash file or by
+ * loading the entire thing.
+ * New empty ones can be created using HashFileCreate.
+ */
+typedef struct {
+    HashFileHeader hh;		/* on-disk file header */
+    HashTable *h;		/* the in-memory hash table */
+    int nheaders;		/* number of common file headers */
+    HashFileSection *headers;	/* on-disk common file headers struct */
+    int nfooters;		/* number of common file footers */
+    HashFileSection *footers;	/* on-disk common file footers struct */
+    FILE *hfp;			/* hash FILE */
+    FILE *afp;			/* archive FILE */
+    char *archive;		/* archive filename */
+    int header_size;		/* size of header + filename + N(head/feet) */
+    off_t hf_start;		/* location of HashFile header in file */
+} HashFile;
+
+/* Functions to to use HashTable.options */
+#define HASH_FUNC_HSIEH       0
+#define HASH_FUNC_TCL         1
+#define HASH_FUNC_JENKINS     2
+#define HASH_FUNC_JENKINS3    3
+#define HASH_FUNC_MASK        7
+
+/* Other HashTable.options values */
+#define HASH_NONVOLATILE_KEYS (1<<3)
+#define HASH_ALLOW_DUP_KEYS   (1<<4)
+#define HASH_DYNAMIC_SIZE     (1<<5)
+#define HASH_OWN_KEYS	      (1<<6)
+#define HASH_POOL_ITEMS       (1<<7)
+
+/* Hashing prototypes */
+uint32_t hash(int func, uint8_t *key, int key_len);
+uint64_t hash64(int func, uint8_t *key, int key_len);
+uint32_t HashJenkins(uint8_t *k, int length);
+uint32_t HashTcl(uint8_t *data, int len);
+uint32_t HashHsieh(uint8_t *k, int length);
+
+/* HashTable management prototypes */
+HashTable *HashTableCreate(int size, int options);
+void HashTableDestroy(HashTable *h, int deallocate_date);
+int HashTableResize(HashTable *h, int newsize);
+HashItem *HashTableAdd(HashTable *h, char *key, int key_len,
+		       HashData data, int *added);
+int HashTableDel(HashTable *h, HashItem *hi, int deallocate_data);
+int HashTableRemove(HashTable *h, char *key, int key_len, int deallocate_data);
+HashItem *HashTableSearch(HashTable *h, char *key, int key_len);
+HashItem *HashTableNext(HashItem *hi, char *key, int key_len);
+
+void HashTableStats(HashTable *h, FILE *fp);
+void HashTableDump(HashTable *h, FILE *fp);
+
+/* Iterator prototypes */
+HashIter *HashTableIterCreate(void);
+void HashTableIterDestroy(HashIter *iter);
+HashItem *HashTableIterNext(HashTable *h, HashIter *iter);
+void HashTableIterReset(HashIter *iter);
+
+/* HashFile prototypes */
+uint64_t HashFileSave(HashFile *hf, FILE *fp, int64_t offset);
+HashFile *HashFileLoad(FILE *fp);
+int HashFileQuery(HashFile *hf, uint8_t *key, int key_len, HashFileItem *item);
+char *HashFileExtract(HashFile *hf, char *fname, size_t *len);
+
+
+HashFile *HashFileCreate(int size, int options);
+void HashFileDestroy(HashFile *hf);
+HashFile *HashFileOpen(char *fname);
+HashFile *HashFileFopen(FILE *fp);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _HASH_TABLE_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/jenkins_lookup3.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,987 @@
+/*
+-------------------------------------------------------------------------------
+lookup3.c, by Bob Jenkins, May 2006, Public Domain.
+
+These are functions for producing 32-bit hashes for hash table lookup.
+hashword(), hashlittle(), hashlittle2(), hashbig(), mix(), and final() 
+are externally useful functions.  Routines to test the hash are included 
+if SELF_TEST is defined.  You can use this free for any purpose.  It's in
+the public domain.  It has no warranty.
+
+You probably want to use hashlittle().  hashlittle() and hashbig()
+hash byte arrays.  hashlittle() is is faster than hashbig() on
+little-endian machines.  Intel and AMD are little-endian machines.
+On second thought, you probably want hashlittle2(), which is identical to
+hashlittle() except it returns two 32-bit hashes for the price of one.  
+You could implement hashbig2() if you wanted but I haven't bothered here.
+
+If you want to find a hash of, say, exactly 7 integers, do
+  a = i1;  b = i2;  c = i3;
+  mix(a,b,c);
+  a += i4; b += i5; c += i6;
+  mix(a,b,c);
+  a += i7;
+  final(a,b,c);
+then use c as the hash value.  If you have a variable length array of
+4-byte integers to hash, use hashword().  If you have a byte array (like
+a character string), use hashlittle().  If you have several byte arrays, or
+a mix of things, see the comments above hashlittle().  
+
+Why is this so big?  I read 12 bytes at a time into 3 4-byte integers, 
+then mix those integers.  This is fast (you can do a lot more thorough
+mixing with 12*3 instructions on 3 integers than you can with 3 instructions
+on 1 byte), but shoehorning those bytes into integers efficiently is messy.
+-------------------------------------------------------------------------------
+*/
+/* #define SELF_TEST 1 */
+
+#include <stdio.h>      /* defines printf for tests */
+#include <time.h>       /* defines time_t for timings in the test */
+#include <inttypes.h>   /* defines uint32_t etc */
+#include <sys/param.h>  /* attempt to define endianness */
+#ifdef linux
+# include <endian.h>    /* attempt to define endianness */
+#endif
+
+#include "io_lib/jenkins_lookup3.h"
+
+/*
+ * My best guess at if you are big-endian or little-endian.  This may
+ * need adjustment.
+ */
+#if (defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && \
+     __BYTE_ORDER == __LITTLE_ENDIAN) || \
+    (defined(i386) || defined(__i386__) || defined(__i486__) || \
+     defined(__i586__) || defined(__i686__) || defined(vax) || defined(MIPSEL))
+# define HASH_LITTLE_ENDIAN 1
+# define HASH_BIG_ENDIAN 0
+#elif (defined(__BYTE_ORDER) && defined(__BIG_ENDIAN) && \
+       __BYTE_ORDER == __BIG_ENDIAN) || \
+      (defined(sparc) || defined(POWERPC) || defined(mc68000) || defined(sel))
+# define HASH_LITTLE_ENDIAN 0
+# define HASH_BIG_ENDIAN 1
+#else
+# define HASH_LITTLE_ENDIAN 0
+# define HASH_BIG_ENDIAN 0
+#endif
+
+#define hashsize(n) ((uint32_t)1<<(n))
+#define hashmask(n) (hashsize(n)-1)
+#define rot(x,k) (((x)<<(k)) | ((x)>>(32-(k))))
+
+/*
+-------------------------------------------------------------------------------
+mix -- mix 3 32-bit values reversibly.
+
+This is reversible, so any information in (a,b,c) before mix() is
+still in (a,b,c) after mix().
+
+If four pairs of (a,b,c) inputs are run through mix(), or through
+mix() in reverse, there are at least 32 bits of the output that
+are sometimes the same for one pair and different for another pair.
+This was tested for:
+* pairs that differed by one bit, by two bits, in any combination
+  of top bits of (a,b,c), or in any combination of bottom bits of
+  (a,b,c).
+* "differ" is defined as +, -, ^, or ~^.  For + and -, I transformed
+  the output delta to a Gray code (a^(a>>1)) so a string of 1's (as
+  is commonly produced by subtraction) look like a single 1-bit
+  difference.
+* the base values were pseudorandom, all zero but one bit set, or 
+  all zero plus a counter that starts at zero.
+
+Some k values for my "a-=c; a^=rot(c,k); c+=b;" arrangement that
+satisfy this are
+    4  6  8 16 19  4
+    9 15  3 18 27 15
+   14  9  3  7 17  3
+Well, "9 15 3 18 27 15" didn't quite get 32 bits diffing
+for "differ" defined as + with a one-bit base and a two-bit delta.  I
+used http://burtleburtle.net/bob/hash/avalanche.html to choose 
+the operations, constants, and arrangements of the variables.
+
+This does not achieve avalanche.  There are input bits of (a,b,c)
+that fail to affect some output bits of (a,b,c), especially of a.  The
+most thoroughly mixed value is c, but it doesn't really even achieve
+avalanche in c.
+
+This allows some parallelism.  Read-after-writes are good at doubling
+the number of bits affected, so the goal of mixing pulls in the opposite
+direction as the goal of parallelism.  I did what I could.  Rotates
+seem to cost as much as shifts on every machine I could lay my hands
+on, and rotates are much kinder to the top and bottom bits, so I used
+rotates.
+-------------------------------------------------------------------------------
+*/
+#define mix(a,b,c) \
+{ \
+  a -= c;  a ^= rot(c, 4);  c += b; \
+  b -= a;  b ^= rot(a, 6);  a += c; \
+  c -= b;  c ^= rot(b, 8);  b += a; \
+  a -= c;  a ^= rot(c,16);  c += b; \
+  b -= a;  b ^= rot(a,19);  a += c; \
+  c -= b;  c ^= rot(b, 4);  b += a; \
+}
+
+/*
+-------------------------------------------------------------------------------
+final -- final mixing of 3 32-bit values (a,b,c) into c
+
+Pairs of (a,b,c) values differing in only a few bits will usually
+produce values of c that look totally different.  This was tested for
+* pairs that differed by one bit, by two bits, in any combination
+  of top bits of (a,b,c), or in any combination of bottom bits of
+  (a,b,c).
+* "differ" is defined as +, -, ^, or ~^.  For + and -, I transformed
+  the output delta to a Gray code (a^(a>>1)) so a string of 1's (as
+  is commonly produced by subtraction) look like a single 1-bit
+  difference.
+* the base values were pseudorandom, all zero but one bit set, or 
+  all zero plus a counter that starts at zero.
+
+These constants passed:
+ 14 11 25 16 4 14 24
+ 12 14 25 16 4 14 24
+and these came close:
+  4  8 15 26 3 22 24
+ 10  8 15 26 3 22 24
+ 11  8 15 26 3 22 24
+-------------------------------------------------------------------------------
+*/
+#define final(a,b,c) \
+{ \
+  c ^= b; c -= rot(b,14); \
+  a ^= c; a -= rot(c,11); \
+  b ^= a; b -= rot(a,25); \
+  c ^= b; c -= rot(b,16); \
+  a ^= c; a -= rot(c,4);  \
+  b ^= a; b -= rot(a,14); \
+  c ^= b; c -= rot(b,24); \
+}
+
+/*
+--------------------------------------------------------------------
+ This works on all machines.  To be useful, it requires
+ -- that the key be an array of uint32_t's, and
+ -- that the length be the number of uint32_t's in the key
+
+ The function hashword() is identical to hashlittle() on little-endian
+ machines, and identical to hashbig() on big-endian machines,
+ except that the length has to be measured in uint32_ts rather than in
+ bytes.  hashlittle() is more complicated than hashword() only because
+ hashlittle() has to dance around fitting the key bytes into registers.
+--------------------------------------------------------------------
+*/
+static uint32_t hashword(
+const uint32_t *k,                   /* the key, an array of uint32_t values */
+size_t          length,               /* the length of the key, in uint32_ts */
+uint32_t        initval)         /* the previous hash, or an arbitrary value */
+{
+  uint32_t a,b,c;
+
+  /* Set up the internal state */
+  a = b = c = 0xdeadbeef + (((uint32_t)length)<<2) + initval;
+
+  /*------------------------------------------------- handle most of the key */
+  while (length > 3)
+  {
+    a += k[0];
+    b += k[1];
+    c += k[2];
+    mix(a,b,c);
+    length -= 3;
+    k += 3;
+  }
+
+  /*------------------------------------------- handle the last 3 uint32_t's */
+  switch(length)                     /* all the case statements fall through */
+  { 
+  case 3 : c+=k[2];
+  case 2 : b+=k[1];
+  case 1 : a+=k[0];
+    final(a,b,c);
+  case 0:     /* case 0: nothing left to add */
+    break;
+  }
+  /*------------------------------------------------------ report the result */
+  return c;
+}
+
+
+/*
+--------------------------------------------------------------------
+hashword2() -- same as hashword(), but take two seeds and return two
+32-bit values.  pc and pb must both be nonnull, and *pc and *pb must
+both be initialized with seeds.  If you pass in (*pb)==0, the output 
+(*pc) will be the same as the return value from hashword().
+--------------------------------------------------------------------
+*/
+static void hashword2 (
+const uint32_t *k,                   /* the key, an array of uint32_t values */
+size_t          length,               /* the length of the key, in uint32_ts */
+uint32_t       *pc,                      /* IN: seed OUT: primary hash value */
+uint32_t       *pb)               /* IN: more seed OUT: secondary hash value */
+{
+  uint32_t a,b,c;
+
+  /* Set up the internal state */
+  a = b = c = 0xdeadbeef + ((uint32_t)(length<<2)) + *pc;
+  c += *pb;
+
+  /*------------------------------------------------- handle most of the key */
+  while (length > 3)
+  {
+    a += k[0];
+    b += k[1];
+    c += k[2];
+    mix(a,b,c);
+    length -= 3;
+    k += 3;
+  }
+
+  /*------------------------------------------- handle the last 3 uint32_t's */
+  switch(length)                     /* all the case statements fall through */
+  { 
+  case 3 : c+=k[2];
+  case 2 : b+=k[1];
+  case 1 : a+=k[0];
+    final(a,b,c);
+  case 0:     /* case 0: nothing left to add */
+    break;
+  }
+  /*------------------------------------------------------ report the result */
+  *pc=c; *pb=b;
+}
+
+
+/*
+-------------------------------------------------------------------------------
+hashlittle() -- hash a variable-length key into a 32-bit value
+  k       : the key (the unaligned variable-length array of bytes)
+  length  : the length of the key, counting by bytes
+  initval : can be any 4-byte value
+Returns a 32-bit value.  Every bit of the key affects every bit of
+the return value.  Two keys differing by one or two bits will have
+totally different hash values.
+
+The best hash table sizes are powers of 2.  There is no need to do
+mod a prime (mod is sooo slow!).  If you need less than 32 bits,
+use a bitmask.  For example, if you need only 10 bits, do
+  h = (h & hashmask(10));
+In which case, the hash table should have hashsize(10) elements.
+
+If you are hashing n strings (uint8_t **)k, do it like this:
+  for (i=0, h=0; i<n; ++i) h = hashlittle( k[i], len[i], h);
+
+By Bob Jenkins, 2006.  bob_jenkins@burtleburtle.net.  You may use this
+code any way you wish, private, educational, or commercial.  It's free.
+
+Use for hash table lookup, or anything where one collision in 2^^32 is
+acceptable.  Do NOT use for cryptographic purposes.
+-------------------------------------------------------------------------------
+*/
+
+static uint32_t hashlittle( const void *key, size_t length, uint32_t initval)
+{
+  uint32_t a,b,c;                                          /* internal state */
+  union { const void *ptr; size_t i; } u;     /* needed for Mac Powerbook G4 */
+
+  /* Set up the internal state */
+  a = b = c = 0xdeadbeef + ((uint32_t)length) + initval;
+
+  u.ptr = key;
+  if (HASH_LITTLE_ENDIAN && ((u.i & 0x3) == 0)) {
+    const uint32_t *k = (const uint32_t *)key;         /* read 32-bit chunks */
+#ifdef VALGRIND
+    const uint8_t  *k8;
+#endif
+
+    /*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */
+    while (length > 12)
+    {
+      a += k[0];
+      b += k[1];
+      c += k[2];
+      mix(a,b,c);
+      length -= 12;
+      k += 3;
+    }
+
+    /*----------------------------- handle the last (probably partial) block */
+    /* 
+     * "k[2]&0xffffff" actually reads beyond the end of the string, but
+     * then masks off the part it's not allowed to read.  Because the
+     * string is aligned, the masked-off tail is in the same word as the
+     * rest of the string.  Every machine with memory protection I've seen
+     * does it on word boundaries, so is OK with this.  But VALGRIND will
+     * still catch it and complain.  The masking trick does make the hash
+     * noticably faster for short strings (like English words).
+     */
+#ifndef VALGRIND
+
+    switch(length)
+    {
+    case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;
+    case 11: c+=k[2]&0xffffff; b+=k[1]; a+=k[0]; break;
+    case 10: c+=k[2]&0xffff; b+=k[1]; a+=k[0]; break;
+    case 9 : c+=k[2]&0xff; b+=k[1]; a+=k[0]; break;
+    case 8 : b+=k[1]; a+=k[0]; break;
+    case 7 : b+=k[1]&0xffffff; a+=k[0]; break;
+    case 6 : b+=k[1]&0xffff; a+=k[0]; break;
+    case 5 : b+=k[1]&0xff; a+=k[0]; break;
+    case 4 : a+=k[0]; break;
+    case 3 : a+=k[0]&0xffffff; break;
+    case 2 : a+=k[0]&0xffff; break;
+    case 1 : a+=k[0]&0xff; break;
+    case 0 : return c;              /* zero length strings require no mixing */
+    }
+
+#else /* make valgrind happy */
+
+    k8 = (const uint8_t *)k;
+    switch(length)
+    {
+    case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;
+    case 11: c+=((uint32_t)k8[10])<<16;  /* fall through */
+    case 10: c+=((uint32_t)k8[9])<<8;    /* fall through */
+    case 9 : c+=k8[8];                   /* fall through */
+    case 8 : b+=k[1]; a+=k[0]; break;
+    case 7 : b+=((uint32_t)k8[6])<<16;   /* fall through */
+    case 6 : b+=((uint32_t)k8[5])<<8;    /* fall through */
+    case 5 : b+=k8[4];                   /* fall through */
+    case 4 : a+=k[0]; break;
+    case 3 : a+=((uint32_t)k8[2])<<16;   /* fall through */
+    case 2 : a+=((uint32_t)k8[1])<<8;    /* fall through */
+    case 1 : a+=k8[0]; break;
+    case 0 : return c;
+    }
+
+#endif /* !valgrind */
+
+  } else if (HASH_LITTLE_ENDIAN && ((u.i & 0x1) == 0)) {
+    const uint16_t *k = (const uint16_t *)key;         /* read 16-bit chunks */
+    const uint8_t  *k8;
+
+    /*--------------- all but last block: aligned reads and different mixing */
+    while (length > 12)
+    {
+      a += k[0] + (((uint32_t)k[1])<<16);
+      b += k[2] + (((uint32_t)k[3])<<16);
+      c += k[4] + (((uint32_t)k[5])<<16);
+      mix(a,b,c);
+      length -= 12;
+      k += 6;
+    }
+
+    /*----------------------------- handle the last (probably partial) block */
+    k8 = (const uint8_t *)k;
+    switch(length)
+    {
+    case 12: c+=k[4]+(((uint32_t)k[5])<<16);
+             b+=k[2]+(((uint32_t)k[3])<<16);
+             a+=k[0]+(((uint32_t)k[1])<<16);
+             break;
+    case 11: c+=((uint32_t)k8[10])<<16;     /* fall through */
+    case 10: c+=k[4];
+             b+=k[2]+(((uint32_t)k[3])<<16);
+             a+=k[0]+(((uint32_t)k[1])<<16);
+             break;
+    case 9 : c+=k8[8];                      /* fall through */
+    case 8 : b+=k[2]+(((uint32_t)k[3])<<16);
+             a+=k[0]+(((uint32_t)k[1])<<16);
+             break;
+    case 7 : b+=((uint32_t)k8[6])<<16;      /* fall through */
+    case 6 : b+=k[2];
+             a+=k[0]+(((uint32_t)k[1])<<16);
+             break;
+    case 5 : b+=k8[4];                      /* fall through */
+    case 4 : a+=k[0]+(((uint32_t)k[1])<<16);
+             break;
+    case 3 : a+=((uint32_t)k8[2])<<16;      /* fall through */
+    case 2 : a+=k[0];
+             break;
+    case 1 : a+=k8[0];
+             break;
+    case 0 : return c;                     /* zero length requires no mixing */
+    }
+
+  } else {                        /* need to read the key one byte at a time */
+    const uint8_t *k = (const uint8_t *)key;
+
+    /*--------------- all but the last block: affect some 32 bits of (a,b,c) */
+    while (length > 12)
+    {
+      a += k[0];
+      a += ((uint32_t)k[1])<<8;
+      a += ((uint32_t)k[2])<<16;
+      a += ((uint32_t)k[3])<<24;
+      b += k[4];
+      b += ((uint32_t)k[5])<<8;
+      b += ((uint32_t)k[6])<<16;
+      b += ((uint32_t)k[7])<<24;
+      c += k[8];
+      c += ((uint32_t)k[9])<<8;
+      c += ((uint32_t)k[10])<<16;
+      c += ((uint32_t)k[11])<<24;
+      mix(a,b,c);
+      length -= 12;
+      k += 12;
+    }
+
+    /*-------------------------------- last block: affect all 32 bits of (c) */
+    switch(length)                   /* all the case statements fall through */
+    {
+    case 12: c+=((uint32_t)k[11])<<24;
+    case 11: c+=((uint32_t)k[10])<<16;
+    case 10: c+=((uint32_t)k[9])<<8;
+    case 9 : c+=k[8];
+    case 8 : b+=((uint32_t)k[7])<<24;
+    case 7 : b+=((uint32_t)k[6])<<16;
+    case 6 : b+=((uint32_t)k[5])<<8;
+    case 5 : b+=k[4];
+    case 4 : a+=((uint32_t)k[3])<<24;
+    case 3 : a+=((uint32_t)k[2])<<16;
+    case 2 : a+=((uint32_t)k[1])<<8;
+    case 1 : a+=k[0];
+             break;
+    case 0 : return c;
+    }
+  }
+
+  final(a,b,c);
+  return c;
+}
+
+
+/*
+ * hashlittle2: return 2 32-bit hash values
+ *
+ * This is identical to hashlittle(), except it returns two 32-bit hash
+ * values instead of just one.  This is good enough for hash table
+ * lookup with 2^^64 buckets, or if you want a second hash if you're not
+ * happy with the first, or if you want a probably-unique 64-bit ID for
+ * the key.  *pc is better mixed than *pb, so use *pc first.  If you want
+ * a 64-bit value do something like "*pc + (((uint64_t)*pb)<<32)".
+ */
+void HashJenkins3( 
+  const void *key,       /* the key to hash */
+  size_t      length,    /* length of the key */
+  uint32_t   *pc,        /* IN: primary initval, OUT: primary hash */
+  uint32_t   *pb)        /* IN: secondary initval, OUT: secondary hash */
+{
+  uint32_t a,b,c;                                          /* internal state */
+  union { const void *ptr; size_t i; } u;     /* needed for Mac Powerbook G4 */
+
+  /* Set up the internal state */
+  a = b = c = 0xdeadbeef + ((uint32_t)length) + *pc;
+  c += *pb;
+
+  u.ptr = key;
+  if (HASH_LITTLE_ENDIAN && ((u.i & 0x3) == 0)) {
+    const uint32_t *k = (const uint32_t *)key;         /* read 32-bit chunks */
+#ifdef VALGRIND
+    const uint8_t  *k8;
+#endif
+
+    /*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */
+    while (length > 12)
+    {
+      a += k[0];
+      b += k[1];
+      c += k[2];
+      mix(a,b,c);
+      length -= 12;
+      k += 3;
+    }
+
+    /*----------------------------- handle the last (probably partial) block */
+    /* 
+     * "k[2]&0xffffff" actually reads beyond the end of the string, but
+     * then masks off the part it's not allowed to read.  Because the
+     * string is aligned, the masked-off tail is in the same word as the
+     * rest of the string.  Every machine with memory protection I've seen
+     * does it on word boundaries, so is OK with this.  But VALGRIND will
+     * still catch it and complain.  The masking trick does make the hash
+     * noticably faster for short strings (like English words).
+     */
+#ifndef VALGRIND
+
+    switch(length)
+    {
+    case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;
+    case 11: c+=k[2]&0xffffff; b+=k[1]; a+=k[0]; break;
+    case 10: c+=k[2]&0xffff; b+=k[1]; a+=k[0]; break;
+    case 9 : c+=k[2]&0xff; b+=k[1]; a+=k[0]; break;
+    case 8 : b+=k[1]; a+=k[0]; break;
+    case 7 : b+=k[1]&0xffffff; a+=k[0]; break;
+    case 6 : b+=k[1]&0xffff; a+=k[0]; break;
+    case 5 : b+=k[1]&0xff; a+=k[0]; break;
+    case 4 : a+=k[0]; break;
+    case 3 : a+=k[0]&0xffffff; break;
+    case 2 : a+=k[0]&0xffff; break;
+    case 1 : a+=k[0]&0xff; break;
+    case 0 : *pc=c; *pb=b; return;  /* zero length strings require no mixing */
+    }
+
+#else /* make valgrind happy */
+
+    k8 = (const uint8_t *)k;
+    switch(length)
+    {
+    case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;
+    case 11: c+=((uint32_t)k8[10])<<16;  /* fall through */
+    case 10: c+=((uint32_t)k8[9])<<8;    /* fall through */
+    case 9 : c+=k8[8];                   /* fall through */
+    case 8 : b+=k[1]; a+=k[0]; break;
+    case 7 : b+=((uint32_t)k8[6])<<16;   /* fall through */
+    case 6 : b+=((uint32_t)k8[5])<<8;    /* fall through */
+    case 5 : b+=k8[4];                   /* fall through */
+    case 4 : a+=k[0]; break;
+    case 3 : a+=((uint32_t)k8[2])<<16;   /* fall through */
+    case 2 : a+=((uint32_t)k8[1])<<8;    /* fall through */
+    case 1 : a+=k8[0]; break;
+    case 0 : *pc=c; *pb=b; return;  /* zero length strings require no mixing */
+    }
+
+#endif /* !valgrind */
+
+  } else if (HASH_LITTLE_ENDIAN && ((u.i & 0x1) == 0)) {
+    const uint16_t *k = (const uint16_t *)key;         /* read 16-bit chunks */
+    const uint8_t  *k8;
+
+    /*--------------- all but last block: aligned reads and different mixing */
+    while (length > 12)
+    {
+      a += k[0] + (((uint32_t)k[1])<<16);
+      b += k[2] + (((uint32_t)k[3])<<16);
+      c += k[4] + (((uint32_t)k[5])<<16);
+      mix(a,b,c);
+      length -= 12;
+      k += 6;
+    }
+
+    /*----------------------------- handle the last (probably partial) block */
+    k8 = (const uint8_t *)k;
+    switch(length)
+    {
+    case 12: c+=k[4]+(((uint32_t)k[5])<<16);
+             b+=k[2]+(((uint32_t)k[3])<<16);
+             a+=k[0]+(((uint32_t)k[1])<<16);
+             break;
+    case 11: c+=((uint32_t)k8[10])<<16;     /* fall through */
+    case 10: c+=k[4];
+             b+=k[2]+(((uint32_t)k[3])<<16);
+             a+=k[0]+(((uint32_t)k[1])<<16);
+             break;
+    case 9 : c+=k8[8];                      /* fall through */
+    case 8 : b+=k[2]+(((uint32_t)k[3])<<16);
+             a+=k[0]+(((uint32_t)k[1])<<16);
+             break;
+    case 7 : b+=((uint32_t)k8[6])<<16;      /* fall through */
+    case 6 : b+=k[2];
+             a+=k[0]+(((uint32_t)k[1])<<16);
+             break;
+    case 5 : b+=k8[4];                      /* fall through */
+    case 4 : a+=k[0]+(((uint32_t)k[1])<<16);
+             break;
+    case 3 : a+=((uint32_t)k8[2])<<16;      /* fall through */
+    case 2 : a+=k[0];
+             break;
+    case 1 : a+=k8[0];
+             break;
+    case 0 : *pc=c; *pb=b; return;  /* zero length strings require no mixing */
+    }
+
+  } else {                        /* need to read the key one byte at a time */
+    const uint8_t *k = (const uint8_t *)key;
+
+    /*--------------- all but the last block: affect some 32 bits of (a,b,c) */
+    while (length > 12)
+    {
+      a += k[0];
+      a += ((uint32_t)k[1])<<8;
+      a += ((uint32_t)k[2])<<16;
+      a += ((uint32_t)k[3])<<24;
+      b += k[4];
+      b += ((uint32_t)k[5])<<8;
+      b += ((uint32_t)k[6])<<16;
+      b += ((uint32_t)k[7])<<24;
+      c += k[8];
+      c += ((uint32_t)k[9])<<8;
+      c += ((uint32_t)k[10])<<16;
+      c += ((uint32_t)k[11])<<24;
+      mix(a,b,c);
+      length -= 12;
+      k += 12;
+    }
+
+    /*-------------------------------- last block: affect all 32 bits of (c) */
+    switch(length)                   /* all the case statements fall through */
+    {
+    case 12: c+=((uint32_t)k[11])<<24;
+    case 11: c+=((uint32_t)k[10])<<16;
+    case 10: c+=((uint32_t)k[9])<<8;
+    case 9 : c+=k[8];
+    case 8 : b+=((uint32_t)k[7])<<24;
+    case 7 : b+=((uint32_t)k[6])<<16;
+    case 6 : b+=((uint32_t)k[5])<<8;
+    case 5 : b+=k[4];
+    case 4 : a+=((uint32_t)k[3])<<24;
+    case 3 : a+=((uint32_t)k[2])<<16;
+    case 2 : a+=((uint32_t)k[1])<<8;
+    case 1 : a+=k[0];
+             break;
+    case 0 : *pc=c; *pb=b; return;  /* zero length strings require no mixing */
+    }
+  }
+
+  final(a,b,c);
+  *pc=c; *pb=b;
+}
+
+
+
+/*
+ * hashbig():
+ * This is the same as hashword() on big-endian machines.  It is different
+ * from hashlittle() on all machines.  hashbig() takes advantage of
+ * big-endian byte ordering. 
+ */
+static uint32_t hashbig( const void *key, size_t length, uint32_t initval)
+{
+  uint32_t a,b,c;
+  union { const void *ptr; size_t i; } u; /* to cast key to (size_t) happily */
+
+  /* Set up the internal state */
+  a = b = c = 0xdeadbeef + ((uint32_t)length) + initval;
+
+  u.ptr = key;
+  if (HASH_BIG_ENDIAN && ((u.i & 0x3) == 0)) {
+    const uint32_t *k = (const uint32_t *)key;         /* read 32-bit chunks */
+#ifdef VALGRIND
+    const uint8_t  *k8;
+#endif
+
+    /*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */
+    while (length > 12)
+    {
+      a += k[0];
+      b += k[1];
+      c += k[2];
+      mix(a,b,c);
+      length -= 12;
+      k += 3;
+    }
+
+    /*----------------------------- handle the last (probably partial) block */
+    /* 
+     * "k[2]<<8" actually reads beyond the end of the string, but
+     * then shifts out the part it's not allowed to read.  Because the
+     * string is aligned, the illegal read is in the same word as the
+     * rest of the string.  Every machine with memory protection I've seen
+     * does it on word boundaries, so is OK with this.  But VALGRIND will
+     * still catch it and complain.  The masking trick does make the hash
+     * noticably faster for short strings (like English words).
+     */
+#ifndef VALGRIND
+
+    switch(length)
+    {
+    case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;
+    case 11: c+=k[2]&0xffffff00; b+=k[1]; a+=k[0]; break;
+    case 10: c+=k[2]&0xffff0000; b+=k[1]; a+=k[0]; break;
+    case 9 : c+=k[2]&0xff000000; b+=k[1]; a+=k[0]; break;
+    case 8 : b+=k[1]; a+=k[0]; break;
+    case 7 : b+=k[1]&0xffffff00; a+=k[0]; break;
+    case 6 : b+=k[1]&0xffff0000; a+=k[0]; break;
+    case 5 : b+=k[1]&0xff000000; a+=k[0]; break;
+    case 4 : a+=k[0]; break;
+    case 3 : a+=k[0]&0xffffff00; break;
+    case 2 : a+=k[0]&0xffff0000; break;
+    case 1 : a+=k[0]&0xff000000; break;
+    case 0 : return c;              /* zero length strings require no mixing */
+    }
+
+#else  /* make valgrind happy */
+
+    k8 = (const uint8_t *)k;
+    switch(length)                   /* all the case statements fall through */
+    {
+    case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;
+    case 11: c+=((uint32_t)k8[10])<<8;  /* fall through */
+    case 10: c+=((uint32_t)k8[9])<<16;  /* fall through */
+    case 9 : c+=((uint32_t)k8[8])<<24;  /* fall through */
+    case 8 : b+=k[1]; a+=k[0]; break;
+    case 7 : b+=((uint32_t)k8[6])<<8;   /* fall through */
+    case 6 : b+=((uint32_t)k8[5])<<16;  /* fall through */
+    case 5 : b+=((uint32_t)k8[4])<<24;  /* fall through */
+    case 4 : a+=k[0]; break;
+    case 3 : a+=((uint32_t)k8[2])<<8;   /* fall through */
+    case 2 : a+=((uint32_t)k8[1])<<16;  /* fall through */
+    case 1 : a+=((uint32_t)k8[0])<<24; break;
+    case 0 : return c;
+    }
+
+#endif /* !VALGRIND */
+
+  } else {                        /* need to read the key one byte at a time */
+    const uint8_t *k = (const uint8_t *)key;
+
+    /*--------------- all but the last block: affect some 32 bits of (a,b,c) */
+    while (length > 12)
+    {
+      a += ((uint32_t)k[0])<<24;
+      a += ((uint32_t)k[1])<<16;
+      a += ((uint32_t)k[2])<<8;
+      a += ((uint32_t)k[3]);
+      b += ((uint32_t)k[4])<<24;
+      b += ((uint32_t)k[5])<<16;
+      b += ((uint32_t)k[6])<<8;
+      b += ((uint32_t)k[7]);
+      c += ((uint32_t)k[8])<<24;
+      c += ((uint32_t)k[9])<<16;
+      c += ((uint32_t)k[10])<<8;
+      c += ((uint32_t)k[11]);
+      mix(a,b,c);
+      length -= 12;
+      k += 12;
+    }
+
+    /*-------------------------------- last block: affect all 32 bits of (c) */
+    switch(length)                   /* all the case statements fall through */
+    {
+    case 12: c+=k[11];
+    case 11: c+=((uint32_t)k[10])<<8;
+    case 10: c+=((uint32_t)k[9])<<16;
+    case 9 : c+=((uint32_t)k[8])<<24;
+    case 8 : b+=k[7];
+    case 7 : b+=((uint32_t)k[6])<<8;
+    case 6 : b+=((uint32_t)k[5])<<16;
+    case 5 : b+=((uint32_t)k[4])<<24;
+    case 4 : a+=k[3];
+    case 3 : a+=((uint32_t)k[2])<<8;
+    case 2 : a+=((uint32_t)k[1])<<16;
+    case 1 : a+=((uint32_t)k[0])<<24;
+             break;
+    case 0 : return c;
+    }
+  }
+
+  final(a,b,c);
+  return c;
+}
+
+
+#ifdef SELF_TEST
+
+/* used for timings */
+void driver1()
+{
+  uint8_t buf[256];
+  uint32_t i;
+  uint32_t h=0;
+  time_t a,z;
+
+  time(&a);
+  for (i=0; i<256; ++i) buf[i] = 'x';
+  for (i=0; i<1; ++i) 
+  {
+    h = hashlittle(&buf[0],1,h);
+  }
+  time(&z);
+  if (z-a > 0) printf("time %d %.8x\n", z-a, h);
+}
+
+/* check that every input bit changes every output bit half the time */
+#define HASHSTATE 1
+#define HASHLEN   1
+#define MAXPAIR 60
+#define MAXLEN  70
+void driver2()
+{
+  uint8_t qa[MAXLEN+1], qb[MAXLEN+2], *a = &qa[0], *b = &qb[1];
+  uint32_t c[HASHSTATE], d[HASHSTATE], i=0, j=0, k, l, m=0, z;
+  uint32_t e[HASHSTATE],f[HASHSTATE],g[HASHSTATE],h[HASHSTATE];
+  uint32_t x[HASHSTATE],y[HASHSTATE];
+  uint32_t hlen;
+
+  printf("No more than %d trials should ever be needed \n",MAXPAIR/2);
+  for (hlen=0; hlen < MAXLEN; ++hlen)
+  {
+    z=0;
+    for (i=0; i<hlen; ++i)  /*----------------------- for each input byte, */
+    {
+      for (j=0; j<8; ++j)   /*------------------------ for each input bit, */
+      {
+	for (m=1; m<8; ++m) /*------------ for serveral possible initvals, */
+	{
+	  for (l=0; l<HASHSTATE; ++l)
+	    e[l]=f[l]=g[l]=h[l]=x[l]=y[l]=~((uint32_t)0);
+
+      	  /*---- check that every output bit is affected by that input bit */
+	  for (k=0; k<MAXPAIR; k+=2)
+	  { 
+	    uint32_t finished=1;
+	    /* keys have one bit different */
+	    for (l=0; l<hlen+1; ++l) {a[l] = b[l] = (uint8_t)0;}
+	    /* have a and b be two keys differing in only one bit */
+	    a[i] ^= (k<<j);
+	    a[i] ^= (k>>(8-j));
+	     c[0] = hashlittle(a, hlen, m);
+	    b[i] ^= ((k+1)<<j);
+	    b[i] ^= ((k+1)>>(8-j));
+	     d[0] = hashlittle(b, hlen, m);
+	    /* check every bit is 1, 0, set, and not set at least once */
+	    for (l=0; l<HASHSTATE; ++l)
+	    {
+	      e[l] &= (c[l]^d[l]);
+	      f[l] &= ~(c[l]^d[l]);
+	      g[l] &= c[l];
+	      h[l] &= ~c[l];
+	      x[l] &= d[l];
+	      y[l] &= ~d[l];
+	      if (e[l]|f[l]|g[l]|h[l]|x[l]|y[l]) finished=0;
+	    }
+	    if (finished) break;
+	  }
+	  if (k>z) z=k;
+	  if (k==MAXPAIR) 
+	  {
+	     printf("Some bit didn't change: ");
+	     printf("%.8x %.8x %.8x %.8x %.8x %.8x  ",
+	            e[0],f[0],g[0],h[0],x[0],y[0]);
+	     printf("i %d j %d m %d len %d\n", i, j, m, hlen);
+	  }
+	  if (z==MAXPAIR) goto done;
+	}
+      }
+    }
+   done:
+    if (z < MAXPAIR)
+    {
+      printf("Mix success  %2d bytes  %2d initvals  ",i,m);
+      printf("required  %d  trials\n", z/2);
+    }
+  }
+  printf("\n");
+}
+
+/* Check for reading beyond the end of the buffer and alignment problems */
+void driver3()
+{
+  uint8_t buf[MAXLEN+20], *b;
+  uint32_t len;
+  uint8_t q[] = "This is the time for all good men to come to the aid of their country...";
+  uint32_t h;
+  uint8_t qq[] = "xThis is the time for all good men to come to the aid of their country...";
+  uint32_t i;
+  uint8_t qqq[] = "xxThis is the time for all good men to come to the aid of their country...";
+  uint32_t j;
+  uint8_t qqqq[] = "xxxThis is the time for all good men to come to the aid of their country...";
+  uint32_t ref,x,y;
+  uint8_t *p;
+
+  printf("Endianness.  These lines should all be the same (for values filled in):\n");
+  printf("%.8x                            %.8x                            %.8x\n",
+         hashword((const uint32_t *)q, (sizeof(q)-1)/4, 13),
+         hashword((const uint32_t *)q, (sizeof(q)-5)/4, 13),
+         hashword((const uint32_t *)q, (sizeof(q)-9)/4, 13));
+  p = q;
+  printf("%.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x\n",
+         hashlittle(p, sizeof(q)-1, 13), hashlittle(p, sizeof(q)-2, 13),
+         hashlittle(p, sizeof(q)-3, 13), hashlittle(p, sizeof(q)-4, 13),
+         hashlittle(p, sizeof(q)-5, 13), hashlittle(p, sizeof(q)-6, 13),
+         hashlittle(p, sizeof(q)-7, 13), hashlittle(p, sizeof(q)-8, 13),
+         hashlittle(p, sizeof(q)-9, 13), hashlittle(p, sizeof(q)-10, 13),
+         hashlittle(p, sizeof(q)-11, 13), hashlittle(p, sizeof(q)-12, 13));
+  p = &qq[1];
+  printf("%.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x\n",
+         hashlittle(p, sizeof(q)-1, 13), hashlittle(p, sizeof(q)-2, 13),
+         hashlittle(p, sizeof(q)-3, 13), hashlittle(p, sizeof(q)-4, 13),
+         hashlittle(p, sizeof(q)-5, 13), hashlittle(p, sizeof(q)-6, 13),
+         hashlittle(p, sizeof(q)-7, 13), hashlittle(p, sizeof(q)-8, 13),
+         hashlittle(p, sizeof(q)-9, 13), hashlittle(p, sizeof(q)-10, 13),
+         hashlittle(p, sizeof(q)-11, 13), hashlittle(p, sizeof(q)-12, 13));
+  p = &qqq[2];
+  printf("%.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x\n",
+         hashlittle(p, sizeof(q)-1, 13), hashlittle(p, sizeof(q)-2, 13),
+         hashlittle(p, sizeof(q)-3, 13), hashlittle(p, sizeof(q)-4, 13),
+         hashlittle(p, sizeof(q)-5, 13), hashlittle(p, sizeof(q)-6, 13),
+         hashlittle(p, sizeof(q)-7, 13), hashlittle(p, sizeof(q)-8, 13),
+         hashlittle(p, sizeof(q)-9, 13), hashlittle(p, sizeof(q)-10, 13),
+         hashlittle(p, sizeof(q)-11, 13), hashlittle(p, sizeof(q)-12, 13));
+  p = &qqqq[3];
+  printf("%.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x\n",
+         hashlittle(p, sizeof(q)-1, 13), hashlittle(p, sizeof(q)-2, 13),
+         hashlittle(p, sizeof(q)-3, 13), hashlittle(p, sizeof(q)-4, 13),
+         hashlittle(p, sizeof(q)-5, 13), hashlittle(p, sizeof(q)-6, 13),
+         hashlittle(p, sizeof(q)-7, 13), hashlittle(p, sizeof(q)-8, 13),
+         hashlittle(p, sizeof(q)-9, 13), hashlittle(p, sizeof(q)-10, 13),
+         hashlittle(p, sizeof(q)-11, 13), hashlittle(p, sizeof(q)-12, 13));
+  printf("\n");
+
+  /* check that hashlittle2 and hashlittle produce the same results */
+  i=47; j=0;
+  hashlittle2(q, sizeof(q), &i, &j);
+  if (hashlittle(q, sizeof(q), 47) != i)
+    printf("hashlittle2 and hashlittle mismatch\n");
+
+  /* check that hashword2 and hashword produce the same results */
+  len = 0xdeadbeef;
+  i=47, j=0;
+  hashword2(&len, 1, &i, &j);
+  if (hashword(&len, 1, 47) != i)
+    printf("hashword2 and hashword mismatch %x %x\n", 
+	   i, hashword(&len, 1, 47));
+
+  /* check hashlittle doesn't read before or after the ends of the string */
+  for (h=0, b=buf+1; h<8; ++h, ++b)
+  {
+    for (i=0; i<MAXLEN; ++i)
+    {
+      len = i;
+      for (j=0; j<i; ++j) *(b+j)=0;
+
+      /* these should all be equal */
+      ref = hashlittle(b, len, (uint32_t)1);
+      *(b+i)=(uint8_t)~0;
+      *(b-1)=(uint8_t)~0;
+      x = hashlittle(b, len, (uint32_t)1);
+      y = hashlittle(b, len, (uint32_t)1);
+      if ((ref != x) || (ref != y)) 
+      {
+	printf("alignment error: %.8x %.8x %.8x %d %d\n",ref,x,y,
+               h, i);
+      }
+    }
+  }
+}
+
+/* check for problems with nulls */
+ void driver4()
+{
+  uint8_t buf[1];
+  uint32_t h,i,state[HASHSTATE];
+
+
+  buf[0] = ~0;
+  for (i=0; i<HASHSTATE; ++i) state[i] = 1;
+  printf("These should all be different\n");
+  for (i=0, h=0; i<8; ++i)
+  {
+    h = hashlittle(buf, 0, h);
+    printf("%2ld  0-byte strings, hash is  %.8x\n", i, h);
+  }
+}
+
+
+int main()
+{
+  driver1();   /* test that the key is hashed: used for timings */
+  driver2();   /* test that whole key is hashed thoroughly */
+  driver3();   /* test that nothing but the key is hashed */
+  driver4();   /* test hashing multiple buffers (all buffers are null) */
+  return 1;
+}
+
+#endif  /* SELF_TEST */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/jenkins_lookup3.h	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,22 @@
+#ifndef _JENKINS_LOOKUP3_H_
+#define _JENKINS_LOOKUP3_H_
+
+#include <inttypes.h>     /* defines uint32_t etc */
+
+/*
+ * HashJenkins3: return 2 32-bit hash values
+ *
+ * This is identical to hashlittle(), except it returns two 32-bit hash
+ * values instead of just one.  This is good enough for hash table
+ * lookup with 2^^64 buckets, or if you want a second hash if you're not
+ * happy with the first, or if you want a probably-unique 64-bit ID for
+ * the key.  *pc is better mixed than *pb, so use *pc first.  If you want
+ * a 64-bit value do something like "*pc + (((uint64_t)*pb)<<32)".
+ */
+void HashJenkins3( 
+  const void *key,       /* the key to hash */
+  size_t      length,    /* length of the key */
+  uint32_t   *pc,        /* IN: primary initval, OUT: primary hash */
+  uint32_t   *pb);       /* IN: secondary initval, OUT: secondary hash */
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/mFILE.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,558 @@
+#ifdef HAVE_CONFIG_H
+#include "io_lib_config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdarg.h>
+
+#include "io_lib/os.h"
+#include "io_lib/mFILE.h"
+#include "io_lib/vlen.h"
+
+/*
+ * This file contains memory-based versions of the most commonly used
+ * (by io_lib) stdio functions.
+ *
+ * Actual file IO takes place either on opening or closing an mFILE.
+ *
+ * Coupled to this are a bunch of rather scary macros which can be obtained
+ * by including stdio_hack.h. It is recommended though that you use mFILE.h
+ * instead and replace fopen with mfopen (etc). This is more or less
+ * mandatory if you wish to use both FILE and mFILE structs in a single file.
+ */
+
+static mFILE *m_channel[3];  /* stdin, stdout and stderr fakes */
+
+/*
+ * Reads the entirety of fp into memory. If 'fn' exists it is the filename
+ * associated with fp. This will be used for more optimal reading (via a
+ * stat to identify the size and a single read). Otherwise we use successive
+ * reads until EOF.
+ *
+ * Returns a malloced buffer on success of length *size
+ *         NULL on failure
+ */
+static char *mfload(FILE *fp, const char *fn, size_t *size, int binary) {
+    struct stat sb;
+    char *data = NULL;
+    size_t allocated = 0, used = 0;
+    int bufsize = 8192;
+
+#ifdef _WIN32
+    if (binary)
+	_setmode(_fileno(fp), _O_BINARY);
+    else 
+	_setmode(_fileno(fp), _O_TEXT);
+#endif
+
+    if (fn && -1 != stat(fn, &sb)) {
+	data = malloc(allocated = sb.st_size);
+	bufsize = sb.st_size;
+    } else {
+	fn = NULL;
+    }
+
+    do {
+	size_t len;
+	if (used + bufsize > allocated) {
+	    allocated += bufsize;
+	    data = realloc(data, allocated);
+	}
+	len = fread(data + used, 1, allocated - used, fp);
+	if (len > 0)
+	    used += len;
+    } while (!feof(fp) && (fn == NULL || used < sb.st_size));
+
+    *size = used;
+
+    return data;
+}
+
+/*
+ * Creates and returns m_channel[0].
+ * We initialise this on the first attempted read, which then slurps in
+ * all of stdin until EOF is met.
+ */
+mFILE *mstdin(void) {
+    if (m_channel[0])
+	return m_channel[0];
+
+    m_channel[0] = mfcreate(NULL, 0);
+    m_channel[0]->fp = stdin;
+    return m_channel[0];
+}
+
+static void init_mstdin(void) {
+    static int done_stdin = 0;
+    if (done_stdin)
+	return;
+
+    m_channel[0]->data = mfload(stdin, NULL, &m_channel[0]->size, 1);
+    m_channel[0]->mode = MF_READ;
+    done_stdin = 1;
+}
+
+/*
+ * Creates and returns m_channel[1]. This is the fake for stdout. It starts as
+ * an empty buffer which is physically written out only when mfflush or
+ * mfclose are called.
+ */
+mFILE *mstdout(void) {
+    if (m_channel[1])
+	return m_channel[1];
+
+    m_channel[1] = mfcreate(NULL, 0);
+    m_channel[1]->fp = stdout;
+    m_channel[1]->mode = MF_WRITE;
+    return m_channel[1];
+}
+
+/*
+ * Stderr as an mFILE.
+ * The code handles stderr by returning m_channel[2], but also checking
+ * for stderr in fprintf (the common usage of it) to auto-flush.
+ */
+mFILE *mstderr(void) {
+    if (m_channel[2])
+	return m_channel[2];
+
+    m_channel[2] = mfcreate(NULL, 0);
+    m_channel[2]->fp = stderr;
+    m_channel[2]->mode = MF_WRITE;
+    return m_channel[2];
+}
+
+
+/*
+ * For creating existing mFILE pointers directly from memory buffers.
+ */
+mFILE *mfcreate(char *data, int size) {
+    mFILE *mf = (mFILE *)malloc(sizeof(*mf));
+    mf->fp = NULL;
+    mf->data = data;
+    mf->alloced = size;
+    mf->size = size;
+    mf->eof = 0;
+    mf->offset = 0;
+    mf->flush_pos = 0;
+    mf->mode = MF_READ | MF_WRITE;
+    return mf;
+}
+
+/*
+ * Recreate an existing mFILE to house new data/size.
+ * It also rewinds the file.
+ */
+void mfrecreate(mFILE *mf, char *data, int size) {
+    if (mf->data)
+	free(mf->data);
+    mf->data = data;
+    mf->size = size;
+    mf->alloced = size;
+    mf->eof = 0;
+    mf->offset = 0;
+    mf->flush_pos = 0;
+}
+
+
+/*
+ * Creates a new mFILE to contain the contents of the FILE pointer.
+ * This mFILE is purely for in-memory operations and has no links to the
+ * original FILE* it came from. It also doesn't close the FILE pointer.
+ * Consider using mfreopen() is you need different behaviour.
+ *
+ * Returns mFILE * on success
+ *         NULL on failure.
+ */ 
+mFILE *mfcreate_from(const char *path, const char *mode_str, FILE *fp) {
+   mFILE *mf; 
+
+    /* Open using mfreopen() */
+    if (NULL == (mf = mfreopen(path, mode_str, fp)))
+	return NULL;
+    
+    /* Disassociate from the input stream */
+    mf->fp = NULL;
+
+    return mf;
+}
+
+/*
+ * Converts a FILE * to an mFILE *.
+ * Use this for wrapper functions to turn external prototypes requring
+ * FILE * as an argument into internal code using mFILE *.
+ */
+mFILE *mfreopen(const char *path, const char *mode_str, FILE *fp) {
+    mFILE *mf;
+    int r = 0, w = 0, a = 0, b = 0, x = 0, mode = 0;
+
+    /* Parse mode:
+     * r = read file contents (if truncated => don't read)
+     * w = write on close
+     * a = position at end of buffer
+     * x = position at same location as the original fp
+     */
+    if (strchr(mode_str, 'r'))
+	r = 1, mode |= MF_READ;
+    if (strchr(mode_str, 'w'))
+	w = 1, mode |= MF_WRITE | MF_TRUNC;
+    if (strchr(mode_str, 'a'))
+	w = a = 1, mode |= MF_WRITE | MF_APPEND;
+    if (strchr(mode_str, 'b'))
+	b = 1, mode |= MF_BINARY;
+    if (strchr(mode_str, 'x'))
+	x = 1;
+    if (strchr(mode_str, '+')) {
+        w = 1, mode |= MF_READ | MF_WRITE;
+	if (a)
+	    r = 1;
+    }
+
+    if (r) {
+	mf = mfcreate(NULL, 0);
+	if (!(mode & MF_TRUNC)) {
+	    mf->data = mfload(fp, path, &mf->size, b);
+	    mf->alloced = mf->size;
+	    if (!a)
+		fseek(fp, 0, SEEK_SET);
+	}
+    } else {
+	/* Write - initialise the data structures */
+	mf = mfcreate(NULL, 0);
+    }
+    mf->fp = fp;
+    mf->mode = mode;
+
+    if (x) {
+	if (ftello(fp) != -1) {
+	    mf->mode |= MF_MODEX;
+	}
+    }
+    
+    if (a) {
+	mf->flush_pos = mf->size;
+	fseek(fp, 0, SEEK_END);
+    }
+
+    return mf;
+}
+
+/*
+ * Opens a file. If we have read access (r or a+) then it loads the entire
+ * file into memory. If We have write access then the pathname is stored.
+ * We do not actually write until an mfclose, which then checks this pathname.
+ */
+mFILE *mfopen(const char *path, const char *mode) {
+    FILE *fp;
+
+    if (NULL == (fp = fopen(path, mode)))
+	return NULL;
+    return mfreopen(path, mode, fp);
+}
+
+/*
+ * Closes an mFILE. If the filename is known (implying write access) then this
+ * also writes the data to disk.
+ *
+ * Stdout is handled by calling mfflush which writes to stdout if appropriate.
+ */
+int mfclose(mFILE *mf) {
+    if (!mf)
+	return -1;
+
+    mfflush(mf);
+
+    if (mf->fp)
+	fclose(mf->fp);
+
+    mfdestroy(mf);
+
+    return 0;
+}
+
+/*
+ * Closes the file pointer contained within the mFILE without destroying
+ * the in-memory data.
+ */
+int mfdetach(mFILE *mf) {
+    if (!mf)
+	return -1;
+
+    mfflush(mf);
+
+    if (mf->fp) {
+	fclose(mf->fp);
+	mf->fp = NULL;
+    }
+
+    return 0;
+}
+
+/*
+ * Destroys an mFILE structure but does not flush or close it
+ */
+int mfdestroy(mFILE *mf) {
+    if (!mf)
+	return -1;
+
+    if (mf->data)
+	free(mf->data);
+    free(mf);
+
+    return 0;
+}
+
+/*
+ * Seek/tell functions. Nothing more than updating and reporting an
+ * in-memory index. NB we can seek on stdin or stdout even provided we
+ * haven't been flushing.
+ */
+int mfseek(mFILE *mf, long offset, int whence) {
+    switch (whence) {
+    case SEEK_SET:
+	mf->offset = offset;
+	break;
+    case SEEK_CUR:
+	mf->offset += offset;
+	break;
+    case SEEK_END:
+	mf->offset = mf->size + offset;
+	break;
+    default:
+	errno = EINVAL;
+	return -1;
+    }
+
+    mf->eof = 0;
+    return 0;
+}
+
+long mftell(mFILE *mf) {
+    return mf->offset;
+}
+
+void mrewind(mFILE *mf) {
+    mf->offset = 0;
+    mf->eof = 0;
+}
+
+/*
+ * mftruncate is not directly a translation of ftruncate as the latter
+ * takes a file descriptor instead of a FILE *. It performs the analogous
+ * role though.
+ *
+ * If offset is -1 then the file is truncated to be the current file
+ * offset.
+ */
+void mftruncate(mFILE *mf, long offset) {
+    mf->size = offset != -1 ? offset : mf->offset;
+    if (mf->offset > mf->size)
+	mf->offset = mf->size;
+}
+
+int mfeof(mFILE *mf) {
+    return mf->eof;
+}
+
+/*
+ * mFILE read/write functions. Basically these turn fread/fwrite syntax
+ * into memcpy statements, with appropriate memory handling for writing.
+ */
+size_t mfread(void *ptr, size_t size, size_t nmemb, mFILE *mf) {
+    size_t len;
+    char *cptr = (char *)ptr;
+    
+    if (mf == m_channel[0]) init_mstdin();
+
+    if (mf->size <= mf->offset)
+	return 0;
+
+    len = size * nmemb <= mf->size - mf->offset
+	? size * nmemb
+	: mf->size - mf->offset;
+    if (!size)
+	return 0;
+
+    memcpy(cptr, &mf->data[mf->offset], len);
+    mf->offset += len;
+    cptr += len;
+    
+    if (len != size * nmemb) {
+	mf->eof = 1;
+    }
+
+    return len / size;
+}
+
+size_t mfwrite(void *ptr, size_t size, size_t nmemb, mFILE *mf) {
+    if (!(mf->mode & MF_WRITE))
+	return 0;
+
+    /* Append mode => forced all writes to end of file */
+    if (mf->mode & MF_APPEND)
+	mf->offset = mf->size;
+
+    /* Make sure we have enough room */
+    while (size * nmemb + mf->offset > mf->alloced) {
+	mf->alloced = mf->alloced ? mf->alloced * 2 : 1024;
+	mf->data = (void *)realloc(mf->data, mf->alloced);
+    }
+
+    /* Record where we need to reflush from */
+    if (mf->offset < mf->flush_pos)
+	mf->flush_pos = mf->offset;
+
+    /* Copy the data over */
+    memcpy(&mf->data[mf->offset], ptr, size * nmemb);
+    mf->offset += size * nmemb;
+    if (mf->size < mf->offset)
+	mf->size = mf->offset;
+
+    return nmemb;
+}
+
+int mfgetc(mFILE *mf) {
+    if (mf == m_channel[0]) init_mstdin();
+    if (mf->offset < mf->size) {
+	return (unsigned char)mf->data[mf->offset++];
+    }
+
+    mf->eof = 1;
+    return -1;
+}
+
+int mungetc(int c, mFILE *mf) {
+    if (mf->offset > 0) {
+	mf->data[--mf->offset] = c;
+	return c;
+    }
+    
+    mf->eof = 1;
+    return -1;
+}
+
+char *mfgets(char *s, int size, mFILE *mf) {
+    int i;
+
+    if (mf == m_channel[0]) init_mstdin();
+    *s = 0;
+    for (i = 0; i < size-1;) {
+	if (mf->offset < mf->size) {
+	    s[i] = mf->data[mf->offset++];
+	    if (s[i++] == '\n')
+		break;
+	} else {
+	    mf->eof = 1;
+	    break;
+	}
+    }
+
+    s[i] = 0;
+    return i ? s : NULL;
+}
+
+/*
+ * Flushes an mFILE. If this is a real open of a file in write mode then
+ * mFILE->fp will be set. We then write out any new data in mFILE since the
+ * last flush. We cannot tell what may have been modified as we don't keep
+ * track of that, so we typically rewrite out the entire file contents between
+ * the last flush_pos and the end of file.
+ *
+ * For stderr/stdout we also reset the offsets so we cannot modify things
+ * we've already output.
+ */
+int mfflush(mFILE *mf) {
+    if (!mf->fp)
+	return 0;
+
+    /* FIXME: only do this when opened in write mode */
+    if (mf == m_channel[1] || mf == m_channel[2]) {
+	fwrite(mf->data + mf->flush_pos, 1, mf->size - mf->flush_pos, mf->fp);
+	fflush(mf->fp);
+
+	/* Stdout & stderr are non-seekable streams so throw away the data */
+	mf->offset = mf->size = mf->flush_pos = 0;
+    }
+
+    /* only flush when opened in write mode */
+    if (mf->mode & MF_WRITE) {
+	if (mf->flush_pos < mf->size) {
+	    if (!mf->mode & MF_MODEX)
+		fseek(mf->fp, mf->flush_pos, SEEK_SET);
+	    fwrite(mf->data + mf->flush_pos, 1,
+		   mf->size - mf->flush_pos, mf->fp);
+	    fflush(mf->fp);
+	}
+	ftruncate(fileno(mf->fp), ftell(mf->fp));
+	mf->flush_pos = mf->size;
+    }
+
+    return 0;
+}
+
+/*
+ * A wrapper around vsprintf() to write to an mFILE. This also uses vflen() to
+ * estimate how many additional bytes of storage will be required for the
+ * vsprintf to work.
+ */
+int mfprintf(mFILE *mf, char *fmt, ...) {
+    int ret;
+    size_t est_length;
+    va_list args;
+
+    va_start(args, fmt);
+    est_length = vflen(fmt, args);
+    va_end(args);
+    while (est_length + mf->offset > mf->alloced) {
+	mf->alloced = mf->alloced ? mf->alloced * 2 : 1024;
+	mf->data = (void *)realloc(mf->data, mf->alloced);
+    }
+
+    va_start(args, fmt);
+    ret = vsprintf(&mf->data[mf->offset], fmt, args);
+    va_end(args);
+
+    if (ret > 0) {
+	mf->offset += ret;
+	if (mf->size < mf->offset)
+	    mf->size = mf->offset;
+    }
+
+    if (mf->fp == stderr) {
+	/* Auto-flush for stderr */
+	mfflush(mf);
+    }
+
+    return ret;
+}
+
+/*
+ * Converts an mFILE from binary to ascii mode by replacing all
+ * cr-nl with nl.
+ *
+ * Primarily used on windows when we've uncompressed a binary file which
+ * happens to be a text file (eg Experiment File). Previously we would have
+ * seeked back to the start and used _setmode(fileno(fp), _O_TEXT).
+ *
+ * Side effect: resets offset and flush_pos back to the start.
+ */
+void mfascii(mFILE *mf) {
+    size_t p1, p2;
+
+    for (p1 = p2 = 1; p1 < mf->size; p1++, p2++) {
+	if (mf->data[p1] == '\n' && mf->data[p1-1] == '\r') {
+	    p2--; /* delete the \r */
+	}
+	mf->data[p2] = mf->data[p1];
+    }
+    mf->size = p2;
+
+    mf->offset = mf->flush_pos = 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/mFILE.h	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,57 @@
+#ifndef _MFILE_H_
+#define _MFILE_H_
+
+#include <stdio.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct {
+    FILE *fp;
+    char *data;
+    size_t alloced;
+    int eof;
+    int mode; /* open mode in MF_?? define bit pattern */
+    size_t size;
+    size_t offset;
+    size_t flush_pos;
+} mFILE;
+
+#define MF_READ    1
+#define MF_WRITE   2
+#define MF_APPEND  4
+#define MF_BINARY  8
+#define MF_TRUNC  16
+#define MF_MODEX  32
+
+mFILE *mfreopen(const char *path, const char *mode, FILE *fp);
+mFILE *mfopen(const char *path, const char *mode);
+int mfdetach(mFILE *mf);
+int mfclose(mFILE *mf);
+int mfdestroy(mFILE *mf);
+int mfseek(mFILE *mf, long offset, int whence);
+long mftell(mFILE *mf);
+void mrewind(mFILE *mf);
+void mftruncate(mFILE *mf, long offset);
+int mfeof(mFILE *mf);
+size_t mfread(void *ptr, size_t size, size_t nmemb, mFILE *mf);
+size_t mfwrite(void *ptr, size_t size, size_t nmemb, mFILE *mf);
+int mfgetc(mFILE *mf);
+int mungetc(int c, mFILE *mf);
+mFILE *mfcreate(char *data, int size);
+mFILE *mfcreate_from(const char *path, const char *mode_str, FILE *fp);
+void mfrecreate(mFILE *mf, char *data, int size);
+char *mfgets(char *s, int size, mFILE *mf);
+int mfflush(mFILE *mf);
+int mfprintf(mFILE *mf, char *fmt, ...);
+mFILE *mstdin(void);
+mFILE *mstdout(void);
+mFILE *mstderr(void);
+void mfascii(mFILE *mf);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _MFILE_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/mach-io.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,255 @@
+/*
+ * Copyright (c) Medical Research Council 1994. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+/*
+ * Machine independant io:
+ * For reading and writing to big-endian and little-endian files
+ *
+ * Routines available:
+ *     be_write_int_1()
+ *     be_write_int_2()
+ *     be_write_int_4()
+ *     be_write_int_8()
+ *     be_read_int_1()
+ *     be_read_int_2()
+ *     be_read_int_4()
+ *     be_read_int_8()
+ *     le_write_int_1()
+ *     le_write_int_2()
+ *     le_write_int_4()
+ *     le_write_int_8()
+ *     le_read_int_1()
+ *     le_read_int_2()
+ *     le_read_int_4()
+ *     le_read_int_8()
+ *
+ * All routine return:
+ *    0 - an error has occurred during io operation
+ *    1 - value suggessfully read or written
+ */
+
+#include <stdio.h>
+#include "io_lib/stdio_hack.h"
+#include "io_lib/mach-io.h"
+
+
+
+
+/**********************************************************************/
+/* IO for big-endian files                                            */
+/**********************************************************************/
+
+/*
+ * Write a big-endian int1
+ */
+int be_write_int_1(FILE *fp, uint1 *i1)
+{
+    if (fwrite(i1, sizeof(uint1), 1, fp) != 1) return (0);
+    return (1);
+}
+
+
+/*
+* Write a big-endian int2
+*/
+int be_write_int_2(FILE *fp, uint2 *i2)
+{
+    uint2 i = be_int2(*i2);
+    
+    if (fwrite(&i, 2, 1, fp) != 1) return (0);
+    return (1);
+}
+
+/*
+ * Write a big-endian int4
+ */
+int be_write_int_4(FILE *fp, uint4 *i4)
+{
+    uint4 i = be_int4(*i4);
+    
+    if (fwrite(&i, 4, 1, fp) != 1) return (0);
+
+    return (1);
+}
+
+/*
+ * Write a big-endian int8
+ */
+int be_write_int_8(FILE *fp, uint8 *i8)
+{
+    uint8 i = be_int8(*i8);
+    
+    if (fwrite(&i, 8, 1, fp) != 1) return (0);
+
+    return (1);
+}
+
+
+/*
+ * Read a big-endian int1
+ */
+int be_read_int_1(FILE *fp, uint1 *i1)
+{
+    if (fread(i1, sizeof(uint1), 1, fp) != 1) return (0);
+    return (1);
+}
+
+
+/*
+ * Read a big-endian int2
+ */
+int be_read_int_2(FILE *fp, uint2 *i2)
+{
+    uint2 i;
+    
+    if (fread(&i, 2, 1, fp) != 1) return (0);
+    *i2 = be_int2(i);
+
+    return (1);
+}
+
+
+/*
+ * Read a big-endian int4
+ */
+int be_read_int_4(FILE *fp, uint4 *i4)
+{
+    uint4 i;
+    
+    if (fread(&i, 4, 1, fp) != 1) return (0);
+    *i4 = be_int4(i);
+
+    return (1);
+}
+
+
+/*
+ * Read a big-endian int8
+ */
+int be_read_int_8(FILE *fp, uint8 *i8)
+{
+    uint8 i;
+    
+    if (fread(&i, 8, 1, fp) != 1) return (0);
+    *i8 = be_int8(i);
+
+    return (1);
+}
+
+
+
+
+
+/**********************************************************************/
+/* IO for little-endian files                                         */
+/**********************************************************************/
+
+/*
+ * Write a little-endian int1
+ */
+int le_write_int_1(FILE *fp, uint1 *i1)
+{
+    if (fwrite(i1, sizeof(uint1), 1, fp) != 1) return (0);
+    return (1);
+}
+
+
+/*
+ * Write a little-endian int2
+ */
+int le_write_int_2(FILE *fp, uint2 *i2)
+{
+    uint2 i = le_int2(*i2);
+    
+    if (fwrite(&i, 2, 1, fp) != 1) return (0);
+
+    return (1);
+}
+
+
+/*
+ * Write a little-endian int4
+ */
+int le_write_int_4(FILE *fp, uint4 *i4)
+{
+    uint4 i = le_int4(*i4);
+    
+    if (fwrite(&i, 4, 1, fp) != 1) return (0);
+
+    return (1);
+}
+
+
+/*
+ * Write a little-endian int8
+ */
+int le_write_int_8(FILE *fp, uint8 *i8)
+{
+    uint8 i = le_int8(*i8);
+    
+    if (fwrite(&i, 8, 1, fp) != 1) return (0);
+
+    return (1);
+}
+
+
+/*
+ * Read a little-endian int1
+ */
+int le_read_int_1(FILE *fp, uint1 *i1)
+{
+    if (fread(i1, sizeof(uint1), 1, fp) != 1) return (0);
+    return (1);
+}
+
+
+/*
+ * Read a little-endian int2
+ */
+int le_read_int_2(FILE *fp, uint2 *i2)
+{
+    uint2 i;
+    
+    if (fread(&i, 2, 1, fp) != 1) return (0);
+    *i2 = le_int2(i);
+
+    return (1);
+}
+
+/*
+ * Read a little-endian int4
+ */
+int le_read_int_4(FILE *fp, uint4 *i4)
+{
+    uint4 i;
+    
+    if (fread(&i, 4, 1, fp) != 1) return (0);
+    *i4 = le_int4(i);
+
+    return (1);
+}
+
+
+/*
+ * Read a little-endian int8
+ */
+int le_read_int_8(FILE *fp, uint8 *i8)
+{
+    uint8 i;
+    
+    if (fread(&i, 8, 1, fp) != 1) return (0);
+    *i8 = le_int8(i);
+
+    return (1);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/mach-io.h	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,140 @@
+/*
+ * Copyright (c) Medical Research Council 1994. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+#ifndef _mach_io_h
+#define _mach_io_h
+/*
+ * Machine independant io
+ * For reading and writing to big-endian and little-endian files
+ *
+ * Routines available:
+ *     be_write_int_1()
+ *     be_write_int_2()
+ *     be_write_int_4()
+ *     be_read_int_1()
+ *     be_read_int_2()
+ *     be_read_int_4()
+ *     le_write_int_1()
+ *     le_write_int_2()
+ *     le_write_int_4()
+ *     le_read_int_1()
+ *     le_read_int_2()
+ *     le_read_int_4()
+ *
+ * All routine return:
+ *    0 - an error has occurred during io operation
+ *    1 - value successfully read or written
+ */
+
+#include <stdio.h>
+#include "io_lib/os.h"
+#include "io_lib/mFILE.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**********************************************************************/
+/* IO for big-endian files                                            */
+/**********************************************************************/
+
+/*
+ * Write a big-endian int1
+ */
+extern int be_write_int_1(mFILE *fp, uint1 *i1);
+
+/*
+ * Write a big-endian int2
+ */
+extern int be_write_int_2(mFILE *fp, uint2 *i2);
+
+/*
+ * Write a big-endian int4
+ */
+extern int be_write_int_4(mFILE *fp, uint4 *i4);
+
+/*
+ * Write a big-endian int8
+ */
+extern int be_write_int_8(mFILE *fp, uint8 *i8);
+
+/*
+ * Read a big-endian int1
+ */
+extern int be_read_int_1(mFILE *fp, uint1 *i1);
+
+/*
+ * Read a big-endian int2
+ */
+extern int be_read_int_2(mFILE *fp, uint2 *i2);
+
+/*
+ * Read a big-endian int4
+ */
+extern int be_read_int_4(mFILE *fp, uint4 *i4);
+
+/*
+ * Read a big-endian int8
+ */
+extern int be_read_int_8(mFILE *fp, uint8 *i8);
+
+/**********************************************************************/
+/* IO for little-endian files                                         */
+/**********************************************************************/
+
+/*
+ * Write a little-endian int1
+ */
+extern int le_write_int_1(mFILE *fp, uint1 *i1);
+
+/*
+ * Write a little-endian int2
+ */
+extern int le_write_int_2(mFILE *fp, uint2 *i2);
+
+/*
+ * Write a little-endian int4
+ */
+extern int le_write_int_4(mFILE *fp, uint4 *i4);
+
+/*
+ * Write a little-endian int8
+ */
+extern int le_write_int_8(mFILE *fp, uint8 *i8);
+
+/*
+ * Read a little-endian int1
+ */
+extern int le_read_int_1(mFILE *fp, uint1 *i1);
+
+/*
+ * Read a little-endian int2
+ */
+extern int le_read_int_2(mFILE *fp, uint2 *i2);
+
+/*
+ * Read a little-endian int4
+ */
+extern int le_read_int_4(mFILE *fp, uint4 *i4);
+
+/*
+ * Read a little-endian int8
+ */
+extern int le_read_int_8(mFILE *fp, uint8 *i8);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _mach_io_h */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/misc.h	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,114 @@
+#ifndef _misc_h
+#define _misc_h
+
+#include <stdio.h>
+#include <stdarg.h>  /* varargs needed for v*printf() prototypes */
+#include <sys/types.h>
+
+#include "io_lib/os.h"
+#include "io_lib/xalloc.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern int is_directory(char * fn);
+extern int is_file(char * fn);
+extern int file_exists(char * fn);
+extern int compressed_file_exists(char *fname);
+extern int file_size(char * fn);
+extern FILE *open_fofn(char *files);
+extern char *read_fofn(FILE *fp);
+extern void close_fofn(FILE *fp);
+extern int fstrlen(char *f, int max_f);
+extern void f2cstr(char *f, int max_f, char *c, int max_c);
+extern void c2fstr(char *c, int max_c, char *f, int max_f);
+extern char *mystrtok(char *s, char *ct);
+extern char *myfind(char *file, char* searchpath, int (*found) (char *) );
+extern void crash (char* format,...);
+extern void str_tolower (char *s);
+extern void str_toupper (char *s);
+extern char *fn_tail (char *s);
+extern void fn_tolower (char *s);
+extern void fn_toupper (char *s);
+extern void shell_call(char *command, char *output, int len);
+extern char *date_str(void);
+#ifdef NOSTRDUP
+extern char *strdup(const char *s);
+#endif
+#ifdef NOSTRSTR
+extern char *strstr(char *cs, char *ct);
+#endif
+
+#ifdef NOMEMMOVE
+#define memmove(d,s,l) bcopy(s,d,l)
+#endif
+extern int myusleep(unsigned int useconds);
+
+extern void errout(char *fmt, ...);
+extern void messout(char *fmt, ...);
+
+/*
+ * Useful macros
+ */
+#define findfile(F,S) myfind((F),(S),file_exists)
+/*is_file fails for symbolic links*/
+/*#define findfile(F,S) myfind((F),(S),is_file)*/
+
+#if defined(min)
+#undef min
+#undef max
+#endif
+
+#define min(A,B) ( ( (A) < (B) ) ? (A) : (B) )
+#define max(A,B) ( ( (A) > (B) ) ? (A) : (B) )
+#define sgn(A) ( (A) ? ( ( (A) < 0 ) ? -1 : 1 ) : 0 )
+
+#ifdef MIN
+#undef MIN
+#endif
+#define MIN(A,B) ( ( (A) < (B) ) ? (A) : (B) )
+#ifdef MAX
+#undef MAX
+#endif
+#define MAX(A,B) ( ( (A) > (B) ) ? (A) : (B) )
+#define SGN(A) ( (A) ? ( ( (A) < 0 ) ? -1 : 1 ) : 0 )
+#define ABS(A) ( (A) < 0 ? -(A) : (A) )
+
+/* Number of elements in array */
+#define Number(A) ( sizeof(A) / sizeof((A)[0]) )
+
+/*
+ * Things taken from the new gap text_output.h. They'll be used globally
+ * across all the programs in the end.
+ */
+
+/*
+ * Usage: verror(priority, format, args...);
+ * NB: don't pass more than 8K per call
+ */
+#define ERR_WARN 0
+#define ERR_FATAL 1
+void verror(int priority, char *name, char *fmt, ...);
+
+/*
+ * Usage: vmessage(format, args...);
+ * NB: don't pass more than 8K per call
+ */
+void vmessage(char *fmt, ...);
+
+/*
+ * Adds a new header to the text output window.
+ */
+void vfuncheader(char *fmt, ...);
+
+/*
+ * As vfuncheader, but only outputting when necessary.
+ */
+void vfuncgroup(int group, char *fmt, ...);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*_misc_h*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/misc_scf.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,282 @@
+/*
+ * Copyright (c) Medical Research Council 1994. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+/* 
+  Title:       misc_scf.c
+  
+  Purpose:	 misc handling of Standard Chromatogram Format sequences
+  Last update:   August 18 1994
+  
+  Change log:
+  18 Aug 1994  Creation from bits of {read,write}scf.c and new code.
+
+*/
+
+#include <stdio.h>
+#include <string.h>
+
+#include "io_lib/scf.h"
+#include "io_lib/mach-io.h"
+#include "io_lib/xalloc.h"
+
+#include "io_lib/stdio_hack.h"
+
+float scf_version_str2float(char version[])
+{
+    char v[5];
+    strncpy(v,version,4);v[4]='\0';
+    if (strspn(v,"0123456789. ")!=4) return 0.0;
+    return (float)atof(v);
+}
+
+char *scf_version_float2str(float f)
+{
+    static char v[5];
+
+    sprintf(v, "%1.2f", f);
+    return v;
+}
+
+
+/*
+ * Allocates memory for the scf elements based upon arguments passed.
+ * Returns;
+ *    Scf *	- Success. The scf structure and it's samples, bases,
+ *                and comments fields have been allocated.
+ *    NULL	- Failure.
+ */
+Scf *scf_allocate(int num_samples, int sample_size, int num_bases,
+		  int comment_size, int private_size) {
+    Scf *scf;
+
+    scf = (Scf *)xcalloc(1, sizeof(Scf));
+    if (NULL == scf)
+	return NULL;
+
+    /* bases - +1 as a safety guard for when num_bases==0 */
+    scf->bases = (Bases *)xcalloc(sizeof(Bases), num_bases+1);
+    if (NULL == scf->bases)
+	return NULL;
+
+    /* samples */
+    scf->header.sample_size = sample_size;
+    if (scf->header.sample_size == 1) {
+	scf->samples.samples1 = (Samples1 *)xmalloc(num_samples *
+						    sizeof(Samples1) + 1);
+    } else {
+	scf->samples.samples2 = (Samples2 *)xmalloc(num_samples *
+						    sizeof(Samples2) + 1);
+    }
+    if (NULL == scf->samples.samples1) {
+	xfree(scf->bases);
+	xfree(scf);
+	return NULL;
+    }
+
+    /* comments */
+    if (comment_size) {
+	scf->comments = (Comments *)xmalloc(sizeof(Comments) *
+					    (comment_size + 1));
+	if (NULL == scf->comments) {
+	    xfree(scf->bases);
+	    xfree(scf->samples.samples1);
+	    xfree(scf);
+	    return NULL;
+	}
+    } else
+	scf->comments = NULL;
+
+    /* private data */
+    if (private_size) {
+	scf->private_data = (char *)xmalloc(private_size);
+	if (NULL == scf->private_data) {
+	    xfree(scf->bases);
+	    xfree(scf->samples.samples1);
+	    if (scf->comments) xfree(scf->comments);
+	    xfree(scf);
+	    return NULL;
+	}
+    } else
+	scf->private_data = NULL;
+    
+    return scf;
+}
+
+void scf_deallocate(Scf *scf) {
+    xfree(scf->bases);
+    xfree(scf->samples.samples1);
+    if (scf->comments)
+	xfree(scf->comments);
+    if (scf->private_data)
+	xfree(scf->private_data);
+    xfree(scf);
+}
+
+
+int is_scf(char *fn)
+/*
+ * Check to see if file with name `fn' is in SCF format
+ * 
+ * Returns:
+ * 1 - is SCF format
+ * 0 - not SCF format
+ *-1 - failure
+ */
+{
+    FILE *fp;
+    uint_4 magic;
+    int ok;
+    
+    if ( (fp=fopen(fn,"rb")) == NULL) {
+	ok = -1;
+    } else {
+	if ( be_read_int_4(fp, &magic) != 1 ) {
+	    ok = 0;
+	} else {
+	    ok = (magic==SCF_MAGIC);
+	}
+	fclose(fp);
+    }
+    
+    return ok;
+}
+
+void scf_delta_samples1 ( int1 samples[], int num_samples, int job) {
+
+    /* If job == DELTA_IT:
+       change a series of sample points to a series of delta delta values:
+       ie change them first: delta = current_value - previous_value
+       then delta_delta = delta - previous_delta
+
+       else
+       do the reverse
+       */
+
+    int i;
+
+    if ( DELTA_IT == job ) {
+#ifdef CLEAR_BUT_SLOW
+	int1 p_delta, p_sample;
+
+	p_delta  = 0;
+	for (i=0;i<num_samples;i++) {
+	    p_sample = samples[i];
+	    samples[i] = samples[i] - p_delta;
+	    p_delta  = p_sample;
+	}
+	p_delta  = 0;
+	for (i=0;i<num_samples;i++) {
+	    p_sample = samples[i];
+	    samples[i] = samples[i] - p_delta;
+	    p_delta  = p_sample;
+	}
+#else
+	for (i = num_samples-1 ; i > 1; i--) {
+	    samples[i] = samples[i] - 2*samples[i-1] + samples[i-2];
+	}
+	samples[1] = samples[1] - 2*samples[0];
+#endif
+
+    } else {
+
+#ifdef CLEAR_BUT_SLOW
+	int1 p_sample;
+
+	p_sample = 0;
+	for (i=0;i<num_samples;i++) {
+	    samples[i] = samples[i] + p_sample;
+	    p_sample = samples[i];
+	}
+	p_sample = 0;
+	for (i=0;i<num_samples;i++) {
+	    samples[i] = samples[i] + p_sample;
+	    p_sample = samples[i];
+	}
+#else
+	int1 p_sample1, p_sample2;
+	
+	p_sample1 = p_sample2 = 0;
+	for (i = 0; i < num_samples; i++) {
+	    p_sample1  = p_sample1 + samples[i];
+	    samples[i] = p_sample1 + p_sample2;
+	    p_sample2  = samples[i];
+	}
+#endif
+    }
+}
+
+void scf_delta_samples2 ( uint_2 samples[], int num_samples, int job) {
+
+    /* If job == DELTA_IT:
+       change a series of sample points to a series of delta delta values:
+       ie change them first: delta = current_value - previous_value
+       then delta_delta = delta - previous_delta
+
+       else
+       do the reverse
+       */
+
+    register int i;
+
+    if ( DELTA_IT == job ) {
+#ifdef CLEAR_BUT_SLOW
+	register uint_2 p_delta, p_sample;
+
+	p_delta  = 0;
+	for (i=0;i<num_samples;i++) {
+	    p_sample = samples[i];
+	    samples[i] = samples[i] - p_delta;
+	    p_delta  = p_sample;
+	}
+	p_delta  = 0;
+	for (i=0;i<num_samples;i++) {
+	    p_sample = samples[i];
+	    samples[i] = samples[i] - p_delta;
+	    p_delta  = p_sample;
+	}
+#else
+	for (i = num_samples-1 ; i > 1; i--) {
+	    samples[i] = samples[i] - 2*samples[i-1] + samples[i-2];
+	}
+	samples[1] = samples[1] - 2*samples[0];
+#endif
+
+    } else {
+
+#ifdef CLEAR_BUT_SLOW
+	register uint_2 p_sample;
+
+	p_sample = 0;
+	for (i=0;i<num_samples;i++) {
+	    samples[i] = samples[i] + p_sample;
+	    p_sample = samples[i];
+	}
+	p_sample = 0;
+	for (i=0;i<num_samples;i++) {
+	    samples[i] = samples[i] + p_sample;
+	    p_sample = samples[i];
+	}
+#else
+	uint_2 p_sample1, p_sample2;
+	
+	p_sample1 = p_sample2 = 0;
+	for (i = 0; i < num_samples; i++) {
+	    p_sample1  = p_sample1 + samples[i];
+	    samples[i] = p_sample1 + p_sample2;
+	    p_sample2  = samples[i];
+	}
+#endif
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/open_trace_file.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,1151 @@
+#ifdef HAVE_CONFIG_H
+#  include "io_lib_config.h"
+#endif
+
+#if !(defined(_MSC_VER) || defined(__MINGW32__))
+#  define TRACE_ARCHIVE
+#  ifndef HAVE_LIBCURL
+#    define USE_WGET
+#  endif
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <ctype.h>
+#include <limits.h>
+#include "io_lib/os.h"
+#ifdef TRACE_ARCHIVE
+#  include <sys/socket.h>
+#  include <netinet/in.h>
+#  include <netdb.h>
+#  include <sys/time.h>
+#  include <errno.h>
+#endif
+#ifdef USE_WGET
+#  include <sys/wait.h>
+#endif
+#ifndef PATH_MAX
+#  define PATH_MAX 1024
+#endif
+#ifdef HAVE_LIBCURL
+#  include <curl/curl.h>
+#endif
+
+#include "io_lib/open_trace_file.h"
+#include "io_lib/misc.h"
+#include "io_lib/tar_format.h"
+#include "io_lib/compress.h"
+#include "io_lib/hash_table.h"
+#include "io_lib/sff.h"
+#include "io_lib/srf.h"
+
+/*
+ * Supported compression extensions. See the magics array in compress.c for
+ * the full structure.
+ */
+static char *magics[] = {"", ".bz", ".gz", ".Z", ".z", ".bz2", ".sz"};
+
+/*
+ * Tokenises the search path splitting on colons (unix) or semicolons (windows).
+ * We also  explicitly add a "./" to the end of the search path
+ *
+ * Returns: A new search path with items separated by nul chars. Two nul
+ *          chars in a row represent the end of the tokenised path.
+ * Returns NULL for a failure.
+ *
+ * The returned data has been malloced. It is up to the caller to free this
+ * memory.
+ */
+static char *tokenise_search_path(char *searchpath) {
+    char *newsearch;
+    unsigned int i, j;
+    size_t len;
+#ifdef _WIN32
+    char path_sep = ';';
+#else
+    char path_sep = ':';
+#endif
+
+    if (!searchpath)
+	searchpath="";
+
+    newsearch = (char *)malloc((len = strlen(searchpath))+5);
+    if (!newsearch)
+	return NULL;
+
+    for (i = 0, j = 0; i < len; i++) {
+	/* "::" => ":". Used for escaping colons in http://foo */
+	if (i < len-1 && searchpath[i] == ':' && searchpath[i+1] == ':') {
+	    newsearch[j++] = ':';
+	    i++;
+	    continue;
+	}
+
+	if (searchpath[i] == path_sep) {
+	    /* Skip blank path components */
+	    if (j && newsearch[j-1] != 0)
+		newsearch[j++] = 0;
+	} else {
+	    newsearch[j++] = searchpath[i];
+	}
+    }
+
+    if (j)
+	newsearch[j++] = 0;
+    newsearch[j++] = '.';
+    newsearch[j++] = '/';
+    newsearch[j++] = 0;
+    newsearch[j++] = 0;
+    
+    return newsearch;
+}
+
+/*
+ * Searches for file in the tar pointed to by tarname. If it finds it, it
+ * copies it out and returns a file pointer to the temporary file,
+ * otherwise we return NULL.
+ *
+ * If 'tarname'.index exists we will use this as a fast lookup method,
+ * otherwise we just do a sequential search through the tar.
+ *
+ * Offset specifies a starting search position. Set this to zero if you want
+ * to search through the entire tar file, otherwise set it to the byte offset
+ * into the file of the tar header block for the desired file to extract.
+ * (Note that the tar index file overrides this value.)
+ *
+ * Returns mFILE pointer if found
+ *         NULL if not.
+ */
+static mFILE *find_file_tar(char *file, char *tarname, size_t offset) {
+    int num_magics = sizeof(magics) / sizeof(*magics);
+    char path[PATH_MAX+101];
+    FILE *fp;
+    tar_block blk;
+    int size;
+    int name_len = strlen(file);
+
+    /* Maximum name length for a tar file */
+    if (name_len > 100)
+	return NULL;
+
+    /* Search the .index file */
+    sprintf(path, "%s.index", tarname);
+    if (file_exists(path)) {
+	FILE *fpind = fopen(path, "r");
+	char *cp;
+	int tmp_off;
+	int found = 0;
+	
+	if (fpind) {
+	    while (fgets(path, PATH_MAX+100, fpind)) {
+		if (cp = strchr(path, '\n'))
+		    *cp = 0;
+		tmp_off = strtol(path, &cp, 10);
+		while (isspace(*cp))
+		    cp++;
+		if (strncmp(cp, file, name_len) == 0) {
+		    int i;
+		    for (i = 0; i < num_magics; i++) {
+			if (strcmp(&cp[name_len], magics[i]) == 0) {
+			    offset = tmp_off;
+			    found = 1;
+			    break;
+			}
+		    }
+		    if (found)
+			break;
+		}
+	    }
+	    fclose(fpind);
+
+	    /* Not in index */
+	    if (!found)
+		return NULL;
+	}
+    }
+
+    if (NULL == (fp = fopen(tarname, "rb")))
+	return NULL;
+
+    /*
+     * Search through the tar file (starting from index position) looking
+     * for our filename. If there was no index then we start from position 0.
+     */
+    fseek(fp, offset, SEEK_SET);
+    while(fread(&blk, sizeof(blk), 1, fp) == 1) {
+	if (!blk.header.name[0])
+	    break;
+
+	size = strtol(blk.header.size, NULL, 8);
+
+	/* start with the same name... */
+	if (strncmp(blk.header.name, file, name_len) == 0) {
+	    char *data;
+	    int i;
+
+	    /* ... but does it end with a known compression extension? */
+	    for (i = 0; i < num_magics; i++) {
+		if (strcmp(&blk.header.name[name_len], magics[i]) == 0) {
+		    break;
+		}
+	    }
+	    /* ... apparently not? continue then */
+	    if (i == num_magics)
+		continue;
+
+	    /* Found it - copy out the data to an mFILE */
+	    if (NULL == (data = (char *)malloc(size)))
+		return NULL;
+	    if (size != fread(data, 1, size, fp)) {
+		free(data);
+		return NULL;
+	    }
+	    return mfcreate(data, size);
+	}
+
+	fseek(fp, TBLOCK*((size+TBLOCK-1)/TBLOCK), SEEK_CUR);
+    }
+
+    fclose(fp);
+    return NULL;
+}
+
+/*
+ * Reads a hash file to look for a filename. The hash file contains the
+ * (relative) pathname for the file it is an index for along with the
+ * positions and sizes of each file contained within it. The file format
+ * of the archive itself is irrelevant provided that the data is not
+ * internally compressed in some manner specific to that archive.
+ *
+ * Return mFILE pointer if found
+ *        NULL if not
+ */
+static mFILE *find_file_hash(char *file, char *hashfile) {
+    size_t size;
+    static HashFile *hf = NULL;
+    static char hf_name[1024];
+    char *data;
+
+    /* Cache an open HashFile for fast accesing */
+    if (strcmp(hashfile, hf_name) != 0) {
+	if (hf)
+	    HashFileDestroy(hf);
+	hf = HashFileOpen(hashfile);
+
+	if (!hf)
+	    return NULL;
+	strcpy(hf_name, hashfile);
+    }
+
+    /* Search */
+    if (NULL == (data = HashFileExtract(hf, file, &size)))
+	return NULL;
+
+    /* Found, so copy the contents to a fake FILE pointer */
+    return mfcreate(data, size);
+}
+
+/*
+ * Extracts a single trace from an SRF file.
+ *
+ * Return mFILE pointer if found
+ *        NULL if not
+ */
+static mFILE *find_file_srf(char *tname, char *srffile) {
+    srf_t *srf;
+    uint64_t cpos, hpos, dpos;
+    mFILE *mf = NULL;
+    char *cp;
+
+    if (NULL == (srf = srf_open(srffile, "r")))
+	return NULL;
+
+    if (NULL != (cp = strrchr(tname, '/')))
+    	tname = cp+1;
+
+    if (0 == srf_find_trace(srf, tname, &cpos, &hpos, &dpos)) {
+	char *data = malloc(srf->th.trace_hdr_size + srf->tb.trace_size);
+	if (!data) {
+	    srf_destroy(srf, 1);
+	    return NULL;
+	}
+	memcpy(data, srf->th.trace_hdr, srf->th.trace_hdr_size);
+	memcpy(data + srf->th.trace_hdr_size,
+	       srf->tb.trace, srf->tb.trace_size);
+	mf = mfcreate(data, srf->th.trace_hdr_size + srf->tb.trace_size);
+    }
+
+    srf_destroy(srf, 1);
+    return mf;
+}
+
+#ifdef TRACE_ARCHIVE
+/*
+ * Searches for file in the ensembl trace archive pointed to by arcname.
+ * If it finds it, it copies it out and returns a file pointer to the
+ * temporary file, otherwise we return NULL.
+ *
+ * Arcname has the form address:port, eg "titan/22100"
+ *
+ * Returns mFILE pointer if found
+ *         NULL if not.
+ */
+#define RDBUFSZ 8192
+static mFILE *find_file_archive(char *file, char *arcname) {
+    char server[1024], *cp;
+    int port;
+    struct hostent *host;
+    struct sockaddr_in saddr;
+    int s = 0;
+    char msg[1024];
+    ssize_t msg_len;
+    char buf[RDBUFSZ];
+    mFILE *fpout;
+    int block_count;
+
+    /* Split arc name into server and port */
+    if (!(cp = strchr(arcname, '/')))
+	return NULL;
+    strncpy(server, arcname, 1023);
+    server[MIN(1023,cp-arcname)] = 0;
+    port = atoi(cp+1);
+
+    /* Make and connect socket */
+    if (NULL == (host = gethostbyname(server))) {
+	perror("gethostbyname()");
+	return NULL;
+    }
+    saddr.sin_port = htons(port);
+    saddr.sin_family = host->h_addrtype;
+    memcpy(&saddr.sin_addr,host->h_addr_list[0], host->h_length);
+    if ((s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1) {
+	perror("socket()");
+	return NULL;
+    }
+    if (connect(s, (struct sockaddr *)&saddr, sizeof(saddr)) == -1) {
+	perror("connect()");
+	return NULL;
+    }
+
+    /* The minimal message to send down is "--scf tracename" */
+    sprintf(msg, "--scf %.*s\n", 1000, file);
+    msg_len = strlen(msg);
+    if (send(s, msg, msg_len, 0) != msg_len) {
+	/*
+	 * partial request sent, but requests are short so if this
+	 * happens it's unlikely we'll cure it by sending multiple
+	 * fragments.
+	 */
+	/* close(s); */
+	return NULL;
+    }
+
+    /*
+     * Create a fake FILE (mFILE) and write to it.
+     */
+    fpout = mfcreate(NULL, 0);
+
+    /*
+     * Read the data back, in multiple blocks if necessary and write it
+     * to our temporary file. We use a blocking read with a low timeout to
+     * prevent locking up the application indefinitely.
+     */
+    {
+	struct timeval tv = {0, 10000};
+	setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv, sizeof(tv));
+    }
+    errno = 0;
+    block_count = 200;
+    while ((msg_len = read(s, buf, RDBUFSZ)) > 0 ||
+	   (errno == EWOULDBLOCK && --block_count)) {
+	errno = 0;
+	if (msg_len > 0)
+	    mfwrite(buf, 1, msg_len, fpout);
+    }
+    close(s);
+
+    if (!block_count) {
+	mfclose(fpout);
+	return NULL;
+    }
+
+    mrewind(fpout);
+
+    return fpout;
+}
+#endif
+
+#ifdef USE_WGET
+/* NB: non-reentrant due to reuse of handle */
+static mFILE *find_file_url(char *file, char *url) {
+    char buf[8192], *cp;
+    mFILE *fp;
+    int pid;
+    int maxlen = 8190 - strlen(file);
+    char *fname = tempnam(NULL, NULL);
+    int status;
+
+    /* Expand %s for the trace name */
+    for (cp = buf; *url && cp - buf < maxlen; url++) {
+	if (*url == '%' && *(url+1) == 's') {
+	    url++;
+	    cp += strlen(strcpy(cp, file));
+	} else {
+	    *cp++ = *url;
+	}
+    }
+    *cp++ = 0;
+
+    /* Execute wget */
+    if ((pid = fork())) {
+	waitpid(pid, &status, 0);
+    } else {
+	execlp("wget", "wget", "-q", "-O", fname, buf, NULL);
+    }
+
+    /* Return a filepointer to the result (if it exists) */
+    fp = (!status && file_size(fname) != 0) ? mfopen(fname, "rb") : NULL;
+    remove(fname);
+    free(fname);
+
+    return fp;
+}
+#endif
+
+#ifdef HAVE_LIBCURL
+static mFILE *find_file_url(char *file, char *url) {
+    char buf[8192], *cp;
+    mFILE *mf = NULL, *headers = NULL;
+    int maxlen = 8190 - strlen(file);
+    static CURL *handle = NULL;
+    static int curl_init = 0;
+    char errbuf[CURL_ERROR_SIZE];
+
+    *errbuf = 0;
+
+    if (!curl_init) {
+	if (curl_global_init(CURL_GLOBAL_ALL))
+	    return NULL;
+
+	if (NULL == (handle = curl_easy_init()))
+	    goto error;
+
+	curl_init = 1;
+    }
+
+    /* Expand %s for the trace name */
+    for (cp = buf; *url && cp - buf < maxlen; url++) {
+	if (*url == '%' && *(url+1) == 's') {
+	    url++;
+	    cp += strlen(strcpy(cp, file));
+	} else {
+	    *cp++ = *url;
+	}
+    }
+    *cp++ = 0;
+
+    /* Setup the curl */
+    if (NULL == (mf = mfcreate(NULL, 0)) ||
+	NULL == (headers = mfcreate(NULL, 0)))
+	return NULL;
+
+    if (0 != curl_easy_setopt(handle, CURLOPT_URL, buf))
+	goto error;
+    if (0 != curl_easy_setopt(handle, CURLOPT_TIMEOUT, 10L))
+	goto error;
+    if (0 != curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, mfwrite))
+	goto error;
+    if (0 != curl_easy_setopt(handle, CURLOPT_WRITEDATA, mf))
+	goto error;
+    if (0 != curl_easy_setopt(handle, CURLOPT_HEADERFUNCTION, mfwrite))
+	goto error;
+    if (0 != curl_easy_setopt(handle, CURLOPT_WRITEHEADER, headers))
+	goto error;
+    if (0 != curl_easy_setopt(handle, CURLOPT_ERRORBUFFER, errbuf))
+	goto error;
+    
+    /* Fetch! */
+    if (0 != curl_easy_perform(handle))
+	goto error;
+    
+    /* Report errors is approproate. 404 is silent as it may have just been
+     * a search via RAWDATA path, everything else is worth reporting.
+     */
+    {
+	float version;
+	int response;
+	char nul = 0;
+	mfwrite(&nul, 1, 1, headers);
+	if (2 == sscanf(headers->data, "HTTP/%f %d", &version, &response)) {
+	    if (response != 200) {
+		if (response != 404)
+		    fprintf(stderr, "%.*s\n",
+			    (int)headers->size, headers->data);
+		goto error;
+	    }
+	}
+    }
+
+    if (mftell(mf) == 0)
+	goto error;
+
+    mfdestroy(headers);
+
+    mrewind(mf);
+    return mf;
+
+ error:
+    if (mf)
+	mfdestroy(mf);
+    if (headers)
+	mfdestroy(headers);
+    if (*errbuf)
+	fprintf(stderr, "%s\n", errbuf);
+    return NULL;
+}
+#endif
+
+/*
+ * Takes an SFF file in 'data' and edits the header to ensure
+ * that it has no index listed and only claims to contain a single entry.
+ * This isn't strictly necessary for the sff/sff.c reading code, but it is
+ * the 'Right Thing' to do.
+ *
+ * Returns an mFILE on success or NULL on failure.
+ */
+static mFILE *sff_single(char *data, size_t size) {
+    *(uint64_t *)(data+8)  = be_int8(0); /* index offset */
+    *(uint32_t *)(data+16) = be_int4(0); /* index size */
+    *(uint32_t *)(data+20) = be_int4(1); /* number of reads */
+
+    return mfcreate(data, size);
+}
+
+/* Hash (.hsh) format index searching for SFF files */
+static mFILE *sff_hash_query(char *sff, char *entry, FILE *fp) {
+    static HashFile *hf = NULL;
+    static char sff_copy[1024];
+    static FILE *fp_copy = NULL;
+    char *data;
+    size_t size;
+
+    /* Cache an open HashFile for fast accessing */
+    if (strcmp(sff, sff_copy) != 0) {
+	if (hf) {
+	    hf->afp = hf->hfp = NULL; /* will be closed by our parent */
+	    HashFileDestroy(hf);
+	}
+	fseek(fp, -4, SEEK_CUR);
+	if (NULL == (hf = HashFileFopen(fp)))
+	    return NULL;
+
+	strcpy(sff_copy, sff);
+	fp_copy = fp;
+    }
+
+    data = HashFileExtract(hf, entry, &size);
+    
+    return data ? sff_single(data, size) : NULL;
+}
+
+
+/*
+ * getuint4_255
+ *
+ * A function to convert a 4-byte TVF/SFF value into an integer, where
+ * the bytes are base 255 numbers.  This is used to store the index offsets.
+ */
+static unsigned int getuint4_255(unsigned char *b)
+{
+    return
+        ((unsigned int) b[0]) * 255 * 255 * 255 +
+        ((unsigned int) b[1]) * 255 * 255 +
+        ((unsigned int) b[2]) * 255 +
+        ((unsigned int) b[3]);
+}
+
+/*
+ * 454 sorted format (.srt) index searching for SFF files.
+ * Uses a binary search.
+ * This function and getuint4_255 above are taken with permission
+ * from 454's getsff.c with the following licence:
+ *
+ * Copyright (c)[2001-2005] 454 Life Sciences Corporation. All Rights Reserved.
+ *
+ * THE SOFTWARE IS PROVIDED "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. 
+ *
+ * IN NO EVENT SHALL LICENSOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided
+ * that this copyright and notice appears in all copies.
+ */
+static mFILE *sff_sorted_query(char *sff, char *accno, FILE *fp,
+			       uint32_t index_length) {
+    static unsigned char *index;
+    static char sff_copy[1024];
+    unsigned char *us;
+    uint32_t start, end;
+    uint32_t offset;
+    char *data = NULL;
+    static char chdr[1024];
+    static int chdrlen = 0, nflows = 0;
+    char rhdr[1024];
+    int rhdrlen;
+    int nbases, dlen;
+    int bytes_per_flow = 2;
+
+    /* Cache index if we're querying the same SFF file */
+    if (strcmp(sff_copy, sff) != 0) {
+	if (index)
+	    xfree(index);
+	if (NULL == (index = (unsigned char *)xmalloc(index_length)))
+	    return NULL;
+
+	if (index_length != fread(index, 1, index_length, fp)) {
+	    xfree(index);
+	    return NULL;
+	}
+	strcpy(sff_copy, sff);
+
+	/* Read the common header too - minimal decoding necessary */
+	fseek(fp, 0, SEEK_SET);
+	if (31 != fread(chdr, 1, 31, fp))
+	    return NULL;
+	chdrlen = be_int2(*(uint16_t *)(chdr+24));
+	nflows  = be_int2(*(uint16_t *)(chdr+28));
+	if (chdrlen-31 != fread(chdr+31, 1, chdrlen-31, fp))
+	    return NULL;
+    }
+
+    /*
+     * Perform a binary search of the index, stopping when the search
+     * region becomes relatively small.  This assumes that no accession
+     * number is near 200 characters.
+     */
+    start = 0;
+    end = index_length;
+    while (end - start > 200) {
+	uint32_t mid;
+	int val;
+        mid = (start + end) / 2;
+
+        /*
+         * From the byte midpoint, scan backwards to the beginning of the
+         * index record that covers that byte midpoint.
+         */
+        while (mid > start && index[mid-1] != 255) {
+            mid--;
+        }
+        val = strcmp(accno, (char *)(index+mid));
+
+        if (val == 0) {
+            break;
+        } else if (val < 0) {
+            end = mid;
+        } else {
+            start = mid;
+        }
+    }
+
+    /*
+     * Scan through the small search region, looking for the accno.
+     */
+    while (start < end) {
+        if (strcmp(accno, (char *)(index+start)) == 0) {
+            /*
+             * If the accno is found, skip the accno characters,
+             * then get the record offset.
+             */
+            for (us=index+start; *us; us++,start++) ;
+            us++;
+            start++;
+
+            offset = getuint4_255(us);
+            if (us[4] != 255) {
+		return NULL;
+            }
+
+	    /*
+	     * The original getsff.c here computed the record size by
+	     * looking at the next index item and comparing it's offset to
+	     * this one, or the end of file position if this is the last
+	     * item. This has two problems:
+	     * 1: It means the index itself cannot be added to the end of
+	     *    the file.
+	     * 2: It means that we cannot simply add an index to a SFF
+	     *    file without also reordering all of the items within it.
+	     *
+	     * We solve this by reading the read header to work out the
+	     * object size instead.
+	     */
+	    break;
+        }
+
+        /*
+         * Skip to the beginning of the next index element.
+         */
+        while (start < end && index[start] != 255) {
+            start++;
+        }
+        start++;
+    }
+
+    /*
+     * Now offset indicates the position of the SFF entry. Read and decode
+     * header to get data length. Then read this too.
+     */
+    fseek(fp, offset, SEEK_SET);
+    if (16 != fread(rhdr, 1, 16, fp))
+	return NULL;
+
+    rhdrlen   = be_int2(*(uint16_t *)rhdr);
+    nbases   = be_int4(*(uint32_t *)(rhdr+4));
+    
+    if (rhdrlen-16 != fread(rhdr+16, 1, rhdrlen-16, fp))
+	return NULL;
+    dlen = (nflows * bytes_per_flow + nbases * 3 + 7) & ~7;
+
+    /* Built up the fake SFF entry */
+    if (NULL == (data = (char *)xmalloc(chdrlen + rhdrlen + dlen)))
+	return NULL;
+
+    memcpy(data, chdr, chdrlen);
+    memcpy(data + chdrlen, rhdr, rhdrlen);
+    if (dlen != fread(data + chdrlen + rhdrlen, 1, dlen, fp)) {
+	xfree(data);
+	return NULL;
+    }
+
+    /* Convert to mFILE */
+    return sff_single(data, chdrlen + rhdrlen + dlen);
+}
+
+
+/*
+ * This returns an mFILE containing an SFF entry.
+ *
+ * This does the minimal decoding necessary to skip through the SFF
+ * container to find an entry. In this respect it is a semi-duplication
+ * of sff/sff.[ch], but implemented for efficiency.
+ *
+ * Having found an entry it packs the common header, the read specific
+ * header and the read data into a single block of memory and returns this
+ * as an mFILE. In essence it produces a single-read SFF archive. This
+ * is then decoded by the normal sff parsing code representing a small
+ * amount of redundancy, but one which is swamped by the I/O time.
+ */
+static mFILE *find_file_sff(char *entry, char *sff) {
+    static FILE *fp = NULL;
+    static char sff_copy[1024];
+    char chdr[65536], rhdr[65536]; /* generous, but worst case */
+    uint32_t nkey, nflows, chdrlen, rhdrlen, dlen, magic;
+    uint64_t file_pos;
+    static uint64_t index_offset = 0;
+    static uint32_t index_length = 0;
+    static char index_format[8];
+    uint32_t nreads, i;
+    size_t entry_len = strlen(entry);
+    int bytes_per_flow = 2;
+    char *fake_file;
+
+    /*
+     * Check cached information so rapid queries to the same archive are
+     * fast.
+     * ASSUMPTION: we won't externally replace the sff file with another of
+     * the same name.
+     */
+    if (strcmp(sff, sff_copy) == 0) {
+	if (memcmp(index_format, ".hsh1.00", 8) == 0) {
+	    return sff_hash_query(sff, entry, fp);
+	} else if (memcmp(index_format, ".srt1.00", 8) == 0) {
+	    return sff_sorted_query(sff, entry, fp, index_length-8);
+	}
+    }
+
+    if (fp)
+	fclose(fp);
+
+    strcpy(sff_copy, sff);
+    *index_format = 0;
+
+
+    /* Read the common header */
+    if (NULL == (fp = fopen(sff, "rb")))
+	return NULL;
+    if (31 != fread(chdr, 1, 31, fp))
+	return NULL;
+
+    /* Check magic & vers: TODO */
+    magic = be_int4(*(uint32_t *)chdr);
+    if (magic != SFF_MAGIC)
+	return NULL;
+    if (memcmp(chdr+4, SFF_VERSION, 4) != 0)
+	return NULL;
+
+    /* If we have an index, use it, otherwise search linearly */
+    index_offset = be_int8(*(uint64_t *)(chdr+8));
+    index_length = be_int4(*(uint32_t *)(chdr+16));
+    if (index_length != 0) {
+	long orig_pos = ftell(fp);
+	fseek(fp, index_offset, SEEK_SET);
+	fread(index_format, 1, 8, fp);
+
+	if (memcmp(index_format, ".hsh1.00", 8) == 0) {
+	    /* HASH index v1.00 */
+	    return sff_hash_query(sff, entry, fp);
+
+	} else if (memcmp(index_format, ".srt1.00", 8) == 0) {
+	    /* 454 sorted v1.00 */
+	    return sff_sorted_query(sff, entry, fp, index_length-8);
+	} else {
+	    /* Unknown index: revert back to a slow linear scan */
+	    fseek(fp, orig_pos, SEEK_SET);
+	}
+    }
+
+    nreads  = be_int4(*(uint32_t *)(chdr+20));
+    chdrlen = be_int2(*(uint16_t *)(chdr+24));
+    nkey    = be_int2(*(uint16_t *)(chdr+26));
+    nflows  = be_int2(*(uint16_t *)(chdr+28));
+
+    /* Read the remainder of the header */
+    if (chdrlen-31 != fread(chdr+31, 1, chdrlen-31, fp))
+	return NULL;
+
+    file_pos = chdrlen;
+
+    /* Loop until we find the correct entry */
+    for (i = 0; i < nreads; i++) {
+	uint16_t name_len;
+	uint32_t nbases;
+
+	/* Index could be between common header and first read - skip */
+	if (file_pos == index_offset) {
+	    fseek(fp, index_length, SEEK_CUR);
+	    file_pos += index_length;
+	}
+
+	/* Read 16 bytes to get name length */
+	if (16 != fread(rhdr, 1, 16, fp))
+	    return NULL;
+	rhdrlen   = be_int2(*(uint16_t *)rhdr);
+	name_len = be_int2(*(uint16_t *)(rhdr+2));
+	nbases   = be_int4(*(uint32_t *)(rhdr+4));
+
+	/* Read the rest of the header */
+	if (rhdrlen-16 != fread(rhdr+16, 1, rhdrlen-16, fp))
+	    return NULL;
+
+	file_pos += rhdrlen;
+
+	dlen = (nflows * bytes_per_flow + nbases * 3 + 7) & ~7;
+
+	if (name_len == entry_len  && 0 == memcmp(rhdr+16, entry, entry_len))
+	    break;
+
+	/* This is not the read you are looking for... */
+	fseek(fp, dlen, SEEK_CUR);
+    }
+
+    if (i == nreads) {
+	/* Not found */
+	return NULL;
+    }
+
+    /*
+     * Although we've decoded some bits already, we take the more modular
+     * approach of packing the sections together and passing the entire
+     * data structure off as a single-read SFF file to be decoded fully
+     * by the sff reading code.
+     */
+    if (NULL == (fake_file = (char *)xmalloc(chdrlen + rhdrlen + dlen)))
+	return NULL;
+
+    memcpy(fake_file, chdr, chdrlen);
+    memcpy(fake_file+chdrlen, rhdr, rhdrlen);
+    if (dlen != fread(fake_file+chdrlen+rhdrlen, 1, dlen, fp)) {
+	xfree(fake_file);
+	return NULL;
+    }
+
+    /* Convert to an mFILE and return */
+    return sff_single(fake_file, chdrlen+rhdrlen+dlen);
+}
+
+/*
+ * Searches for file in the directory 'dirname'. If it finds it, it opens
+ * it. This also searches for compressed versions of the file in dirname
+ * too.
+ *
+ * Returns mFILE pointer if found
+ *         NULL if not
+ */
+static mFILE *find_file_dir(char *file, char *dirname) {
+    char path[PATH_MAX+1], path2[PATH_MAX+1];
+    size_t len = strlen(dirname);
+    char *cp;
+
+    if (dirname[len-1] == '/')
+	len--;
+
+    /* Special case for "./" or absolute filenames */
+    if (*file == '/' || (len==1 && *dirname == '.'))
+	sprintf(path, "%s", file);
+    else
+	sprintf(path, "%.*s/%s", (int)len, dirname, file);
+
+    if (is_file(path)) {
+	return mfopen(path, "rb");
+    }
+
+    /*
+     * Given a pathname /a/b/c if a/b is a file and not a directory then
+     * we'd get an ENOTDIR error. Instead we assume that a/b is an archive
+     * and we attempt to work out what type by reading the first and last
+     * bits of the file.
+     */
+    if (cp = strrchr(file, '/')) {
+	strcpy(path2, path); /* path contains / too as it's from file */
+	*strrchr(path2, '/') = 0;
+
+	if (is_file(path2)) {
+	    /* Open the archive to test for magic numbers */
+	    char magic[8];
+	    FILE *fp;
+	    enum archive_type_t {
+		NONE, HASH, TAR, SFF, SRF
+	    } type = NONE;
+
+	    if (NULL == (fp = fopen(path2, "rb")))
+		return NULL;
+	    memcpy(magic, "\0\0\0\0\0\0", 4);
+	    fread(magic, 1, 4, fp);
+
+	    /* .hsh or .sff at start */
+	    if (memcmp(magic, ".hsh", 4) == 0)
+		type = HASH;
+	    else if (memcmp(magic, ".sff", 4) == 0)
+		type = SFF;
+
+	    /* Or .hsh or Ihsh at the end */
+	    if (NONE == type) {
+		fseek(fp, -16, SEEK_END);
+		fread(magic, 1, 8, fp);
+		if (memcmp(magic+4, ".hsh", 4) == 0)
+		    type = HASH;
+		else if (memcmp(magic, "Ihsh", 4) == 0)
+		    type = SRF;
+	    }
+
+	    /* or ustar 257 bytes in to indicate un-hashed tar */
+	    if (NONE == type) {
+		fseek(fp, 257, SEEK_SET);
+		fread(magic, 1, 5, fp);
+		if (memcmp(magic, "ustar", 5) == 0)
+		    type = TAR;
+	    }
+	    fclose(fp);
+
+	    switch (type) {
+	    case HASH:
+		return find_file_hash(cp+1, path2);
+	    case TAR:
+		return find_file_tar(cp+1, path2, 0);
+	    case SFF:
+		return find_file_sff(cp+1, path2);
+	    case SRF:
+		return find_file_srf(cp+1, path2);
+	    case NONE:
+		break;
+	    }
+
+	    return NULL;
+	}
+    }
+
+    return NULL;
+}
+
+/*
+ * ------------------------------------------------------------------------
+ * Public functions below.
+ */
+
+/*
+ * Opens a trace file named 'file'. This is initially looked for as a
+ * pathname relative to a file named "relative_to". This may (for
+ * example) be the name of an experiment file referencing the trace
+ * file. In this case by passing relative_to as the experiment file
+ * filename the trace file will be picked up in the same directory as
+ * the experiment file. Relative_to may be supplied as NULL.
+ *
+ * 'file' is looked for at relative_to, then the current directory, and then
+ * all of the locations listed in 'path' (which is a colon separated list).
+ * If 'path' is NULL it uses the RAWDATA environment variable instead.
+ *
+ * Returns a mFILE pointer when found.
+ *           NULL otherwise.
+ */
+mFILE *open_path_mfile(char *file, char *path, char *relative_to) {
+    char *newsearch;
+    char *ele;
+    mFILE *fp;
+
+    /* Use path first */
+    if (!path)
+	path = getenv("RAWDATA");
+    if (NULL == (newsearch = tokenise_search_path(path)))
+	return NULL;
+    
+    /*
+     * Step through the search path testing out each component.
+     * We now look through each path element treating some prefixes as
+     * special, otherwise we treat the element as a directory.
+     */
+    for (ele = newsearch; *ele; ele += strlen(ele)+1) {
+	int i;
+	char *suffix[6] = {"", ".gz", ".bz2", ".sz", ".Z", ".bz2"};
+	for (i = 0; i < 6; i++) {
+	    char file2[1024];
+	    char *ele2;
+	    int valid = 1;
+
+	    /*
+	     * '|' prefixing a path component indicates that we do not
+	     * wish to perform the compression extension searching in that
+	     * location.
+	     */
+	    if (*ele == '|') {
+		ele2 = ele+1;
+		valid = (i == 0);
+	    } else {
+		ele2 = ele;
+	    }
+
+	    sprintf(file2, "%s%s", file, suffix[i]);
+
+	    if (0 == strncmp(ele2, "TAR=", 4)) {
+		if (valid && (fp = find_file_tar(file2, ele2+4, 0))) {
+		    free(newsearch);
+		    return fp;
+		}
+
+	    } else if (0 == strncmp(ele2, "HASH=", 5)) {
+		if (valid && (fp = find_file_hash(file2, ele2+5))) {
+		    free(newsearch);
+		    return fp;
+		}
+#ifdef TRACE_ARCHIVE
+	    } else if (0 == strncmp(ele2, "ARC=", 4)) {
+		if (valid && (fp = find_file_archive(file2, ele2+4))) {
+		    free(newsearch);
+		    return fp;
+		}
+#endif
+#if defined(USE_WGET) || defined(HAVE_LIBCURL)
+	    } else if (0 == strncmp(ele2, "URL=", 4)) {
+		if (valid && (fp = find_file_url(file2, ele2+4))) {
+		    free(newsearch);
+		    return fp;
+		}
+#endif
+	    } else if (0 == strncmp(ele2, "SFF=", 4)) {
+		if (valid && (fp = find_file_sff(file2, ele2+4))) {
+		    free(newsearch);
+		    return fp;
+		}
+
+	    } else if (0 == strncmp(ele2, "SRF=", 4)) {
+		if (valid && (fp = find_file_srf(file2, ele2+4))) {
+		    free(newsearch);
+		    return fp;
+		}
+
+	    } else {
+		if (valid && (fp = find_file_dir(file2, ele2))) {
+		    free(newsearch);
+		    return fp;
+		}
+	    }
+	}
+    }
+
+    free(newsearch);
+
+    /* Look in the same location as the incoming 'relative_to' filename */
+    if (relative_to) {
+	char *cp;
+	char relative_path[PATH_MAX+1];
+	strcpy(relative_path, relative_to);
+	if (cp = strrchr(relative_path, '/'))
+	    *cp = 0;
+	if (fp = find_file_dir(file, relative_path))
+	    return fp;
+    }
+
+    return NULL;
+}
+
+FILE *open_path_file(char *file, char *path, char *relative_to) {
+    mFILE *mf = open_path_mfile(file, path, relative_to);
+    FILE *fp;
+
+    if (!mf)
+	return NULL;
+
+    if (mf->fp)
+	return mf->fp;
+
+    /* Secure temporary file generation */
+    if (NULL == (fp = tmpfile()))
+	return NULL;
+
+    /* Copy the data */
+    fwrite(mf->data, 1, mf->size, fp);
+    rewind(fp);
+    mfclose(mf);
+
+    return fp;
+}
+
+static char *exp_path = NULL;
+static char *trace_path = NULL;
+
+void  iolib_set_trace_path(char *path) { trace_path = path; }
+char *iolib_get_trace_path(void)       { return trace_path; }
+void  iolib_set_exp_path  (char *path) { exp_path = path; }
+char *iolib_get_exp_path  (void)       { return exp_path; }
+
+/*
+ * Trace file functions: uses TRACE_PATH environment variable.
+ */
+mFILE *open_trace_mfile(char *file, char *rel_to) {
+    return open_path_mfile(file, trace_path ? trace_path
+			                    : getenv("TRACE_PATH"), rel_to);
+}
+
+FILE *open_trace_file(char *file, char *rel_to) {
+    return open_path_file(file, trace_path ? trace_path
+			                   : getenv("TRACE_PATH"), rel_to);
+}
+
+/*
+ * Trace file functions: uses EXP_PATH environment variable.
+ */
+mFILE *open_exp_mfile(char *file, char *relative_to) {
+    return open_path_mfile(file, exp_path ? exp_path
+			                  : getenv("EXP_PATH"), relative_to);
+}
+
+FILE *open_exp_file(char *file, char *relative_to) {
+    return open_path_file(file, exp_path ? exp_path
+			                 : getenv("EXP_PATH"), relative_to);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/open_trace_file.h	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,38 @@
+#ifndef _OPEN_TRACE_FILE_H_
+#define _OPEN_TRACE_FILE_H_
+
+#include "io_lib/mFILE.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Opens a trace file named 'file'. This is initially looked for as a
+ * pathname relative to a file named "relative_to". This may (for
+ * example) be the name of an experiment file referencing the trace
+ * file. In this case by passing relative_to as the experiment file
+ * filename the trace file will be picked up in the same directory as
+ * the experiment file. Relative_to may be supplied as NULL.
+ *
+ * 'file' is looked for at relative_to, then the current directory, and then
+ * all of the locations listed in RAWDATA (which is a colon separated list).
+ *
+ * Returns a mFILE pointer when found.
+ *           NULL otherwise.
+ */
+mFILE *open_trace_mfile(char *file, char *relative_to);
+FILE *open_trace_file(char *file, char *relative_to);
+mFILE *open_exp_mfile(char *file, char *relative_to);
+FILE *open_exp_file(char *file, char *relative_to);
+
+void  iolib_set_trace_path(char *path);
+char *iolib_get_trace_path(void);
+void  iolib_set_exp_path  (char *path);
+char *iolib_get_exp_path  (void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _OPEN_TRACE_FILE_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/os.h	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,456 @@
+/*
+ * File: os.h
+ *
+ * Author: 
+ *         MRC Laboratory of Molecular Biology
+ *	   Hills Road
+ *	   Cambridge CB2 2QH
+ *	   United Kingdom
+ *
+ * Description: operating system specific type definitions
+ *
+ */
+
+#ifndef _OS_H_
+#define _OS_H_
+
+/*
+ * The autoconf setup doesn't use options.mk as the Makefile is rebuilt.
+ * I haven't worked out how to do the analogous via autoconf, so for now
+ * I take the easy approach and hard-code all formats to be enabled
+ */
+#ifdef HAVE_CONFIG_H
+#include "io_lib_config.h"
+#define IOLIB_ABI
+#define IOLIB_SCF
+#define IOLIB_ALF
+#define IOLIB_PLN
+#define IOLIB_CTF
+#define IOLIB_EXP
+#define IOLIB_SFF
+#endif
+
+#include <limits.h>
+#include <inttypes.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Emulation of config.h stuff when not using autoconf
+ */
+#ifndef HAVE_CONFIG_H
+#    ifndef HAVE_ZLIB
+#        define HAVE_ZLIB
+#    endif
+#    ifndef HAVE_SYS_WAIT_H
+#        define HAVE_SYS_WAIT_H
+#    endif
+#endif
+
+/*
+ *-----------------------------------------------------------------------------
+ * <inttypes.h> definitions, incase they're not present
+ *-----------------------------------------------------------------------------
+ */
+#ifndef PRId64
+#define __PRI64__ "l"
+#define PRId64 __PRI64__ "d"
+#define PRId32 "d"
+#define PRId16 "d"
+#define PRId8  "d"
+#define PRIu64 __PRI64__ "u"
+#define PRIu32 "u"
+#define PRIu16 "u"
+#define PRIu8  "u"
+#endif
+
+
+/*
+ *-----------------------------------------------------------------------------
+ * Operating system specifics
+ *-----------------------------------------------------------------------------
+ */
+/*
+ * SunOS 4.x
+ * Even though we use the ANSI gcc, we make use the the standard SunOS 4.x
+ * libraries and include files, which are non-ansi
+ */
+#if defined(__sun__) && !defined(__svr4__)
+#define SEEK_SET 0
+#define SEEK_CUR 1
+#define SEEK_END 2
+#define FOPEN_MAX 64
+#define FILENAME_MAX 1024
+
+/* Missing functions, defined in strings.c */
+#define NOMEMMOVE
+#define NOSTRERROR
+#define BUGGY_SSCANF
+#endif
+
+/* 
+ * SunOS 5.x - gcc or Sun's cc 
+ */ 
+#if (defined(__sun__) || defined(__sun)) && (defined(__svr4__) || defined(__SVR4))
+#  define IMAGEDISPLAY 
+#  define NOSTRDUP 
+#endif 
+
+/*
+ * Microsoft Visual C++
+ * Windows
+ */
+#if defined(_MSC_VER)
+#define popen _popen
+#define pclose _pclose
+typedef int mode_t;
+#define ftruncate(fd,len) _chsize(fd,len)
+#define sysconf(x) 512
+#define NOPIPE
+#define NOLOCKF
+#define NOSTRCASECMP
+#define NO_STRPTIME
+#undef HAVE_SYS_WAIT_H
+#endif
+
+
+/*
+ * Microsoft Windows running MinGW
+ */
+#if defined(__MINGW32__)
+/* #define mkdir(filename,mode) mkdir((filename)) */
+#define NOPIPE
+#define NOLOCKF
+#define NO_STRPTIME
+#define sysconf(x) 512
+#define ftruncate(fd,len) _chsize(fd,len)
+#undef HAVE_SYS_WAIT_H
+#endif
+
+/* Generic WIN32 API issues */
+#ifdef _WIN32
+#  ifndef HAVE_FSEEKO
+#    if __MSVCRT_VERSION__ >= 0x800
+       /* if you have MSVCR80 installed then you can use these definitions: */
+#      define off_t __int64
+#      define fseeko _fseeki64
+#      define ftello _ftelli64
+#    else
+       /* otherwise we're stuck with 32-bit file support */
+#      define off_t long
+#      define fseeko fseek
+#      define ftello ftell
+#    endif
+#  endif /* !HAVE_FSEEKO */
+#endif /* _WIN32 */
+
+/*
+ * Linux on AMD64 also needs to use va_copy()
+ */
+#if defined(__linux__) && defined(__amd64__)
+#  ifndef NEED_VA_COPY
+#    define NEED_VA_COPY
+#  endif
+#endif
+
+/*
+ * DEC Alpha's running Digital UNIX
+ */
+#if defined(__alpha)
+/* Nothing as yet */
+#endif
+
+/*
+ * Silicon Graphics - Irix
+ */
+#if defined(__sgi)
+#define NOSTRDUP
+#define NO_STRPTIME
+#endif
+
+/*
+ * Macs (<= OS 9) - yuk!
+ */
+#if defined(MAC)
+#define NOSTRDUP
+#endif
+
+#if defined(__APPLE__) && defined(__ppc__)
+#define NO_STRPTIME
+#define NOLOCKF
+#endif
+
+#if defined(__APPLE__) && defined(__i386__)
+/* nothing untoward as yet */
+#endif
+
+/*
+ *-----------------------------------------------------------------------------
+ * Machine endianness.
+ * These are overridden at the end when using autoconf, but are here for
+ * when being built as part of the Staden Package.
+ *-----------------------------------------------------------------------------
+ */
+
+/*
+ * First guess via autoconf. This is here as endianness can only be computed
+ * by autoconf for the machine we're building on. Hence cross-compilations
+ * or MacOSX "fat binaries" cannot work via autoconf in this manner.
+ *
+ * These provide a default for when the machine specific ifdefs below do you
+ * catch your system type.
+ */
+#ifdef HAVE_CONFIG_H
+#    if defined(WORDS_BIGENDIAN)
+#        ifdef SP_LITTLE_ENDIAN
+#            undef SP_LITTLE_ENDIAN
+#        endif
+#        define SP_BIG_ENDIAN
+#    else
+#        ifdef SP_BIG_ENDIAN
+#            undef SP_BIG_ENDIAN
+#        endif
+#        define SP_LITTLE_ENDIAN
+#    endif
+#endif
+
+/*
+ * x86 equivalents
+ */
+#if defined(__i386__) || defined(__i386) || defined(__amd64__) || defined(__amd64)
+#  if defined(SP_BIG_ENDIAN)
+#    undef SP_BIG_ENDIAN
+#  endif
+#  define SP_LITTLE_ENDIAN
+#endif
+
+/*
+ * DEC Alpha
+ */
+#if defined(__alpha__) || defined(__alpha)
+#  if defined(SP_LITTLE_ENDIAN)
+#    undef SP_LITTLE_ENDIAN
+#  endif
+#  define SP_BIG_ENDIAN
+#endif
+
+/*
+ * SUN Sparc
+ */
+#if defined(__sparc__) || defined(__sparc)
+#  if defined(SP_LITTLE_ENDIAN)
+#    undef SP_LITTLE_ENDIAN
+#  endif
+#  define SP_BIG_ENDIAN
+#endif
+
+/*
+ * PowerPC
+ */
+#if defined(__ppc__) || defined(__ppc)
+#  if defined(SP_LITTLE_ENDIAN)
+#    undef SP_LITTLE_ENDIAN
+#  endif
+#  define SP_BIG_ENDIAN
+#endif
+
+/* Some catch-alls */
+#if defined(__LITTLE_ENDIAN__) || defined(__LITTLEENDIAN__)
+#    define SP_LITTLE_ENDIAN
+#endif
+
+#if defined(__BIG_ENDIAN__) || defined(__BIGENDIAN__)
+#    define SP_BIG_ENDIAN
+#endif
+
+#if defined(SP_BIG_ENDIAN) && defined(SP_LITTLE_ENDIAN)
+#    error Both BIG and LITTLE endian defined. Fix os.h and/or Makefile
+#endif
+
+#if !defined(SP_BIG_ENDIAN) && !defined(SP_LITTLE_ENDIAN)
+#    error Neither BIG nor LITTLE endian defined. Fix os.h and/or Makefile
+#endif
+
+
+/*
+ *-----------------------------------------------------------------------------
+ * Typedefs for data sizes. Note there's umpteen versions of typedefs here
+ * due to old code being supported. The ones that should be used everywhere
+ * are {u,}int[124].
+ *
+ * C9X defines its own versions of these in inttypes.h so new code should
+ * ideally be using the (for example) int32_t style of types.
+ *-----------------------------------------------------------------------------
+ */
+
+/*
+ * One byte integers
+ */ 
+typedef unsigned char	int1;
+typedef unsigned char	uint1;
+
+/*
+ * Two byte integers
+ */
+typedef signed short	int2;
+typedef unsigned short	uint2;
+
+/*
+ * Four byte integers
+ */
+typedef signed int	int4;
+typedef unsigned int	uint4;
+
+typedef int64_t		int8;
+typedef uint64_t	uint8;
+
+/*
+ * Backwards compatibility
+ */
+typedef signed char	int_1;
+typedef unsigned char	uint_1;
+typedef signed short	int_2;
+typedef unsigned short	uint_2;
+typedef signed int	int_4;
+typedef unsigned int	uint_4;
+
+
+/*
+ *-----------------------------------------------------------------------------
+ * The FORTRAN interface.
+ *-----------------------------------------------------------------------------
+ */
+
+typedef int4 f_int;
+typedef int4 f_implicit;
+typedef void f_proc_ret;	/* procedure return value */
+
+/* James Bonfield compatability mode */
+typedef int4 int_f;		/* f_int */
+typedef int4 int_fl;		/* f_implicit */
+
+#define f_proc_return() return /* (f_proc_ret) 0 */
+
+/*
+ * Use when calling/defining a Fortran function from C.
+ */
+#ifdef VMS
+#    define FORT(symbol) (symbol)
+#else
+#    define FORT(symbol) (_symbol)
+#endif
+
+
+/*
+ *-----------------------------------------------------------------------------
+ * Some handy definitions.
+ *-----------------------------------------------------------------------------
+ */
+
+#define MAXINT8 (9223372036854775807LL)
+#define MAXINT4 (INT_MAX)
+#define MAXINT2 (SHRT_MAX)
+
+
+/*
+ *=============================================================================
+ * Anything below here should not be changed.
+ *=============================================================================
+ */
+
+#define False 0
+#define True 1
+
+
+/*
+ * Our new swap runs at the same speed on Ultrix, but substantially faster
+ * (300% for swap_int4, ~50% for swap_int2) on an Alpha (due to the lack of
+ * decent 'char' support).
+ *
+ * They also have the ability to swap in situ (src == dst). Newer code now
+ * relies on this so don't change back!
+ */
+#define iswap_int8(x) \
+    (((x & 0x00000000000000ffLL) << 56) + \
+     ((x & 0x000000000000ff00LL) << 40) + \
+     ((x & 0x0000000000ff0000LL) << 24) + \
+     ((x & 0x00000000ff000000LL) <<  8) + \
+     ((x & 0x000000ff00000000LL) >>  8) + \
+     ((x & 0x0000ff0000000000LL) >> 24) + \
+     ((x & 0x00ff000000000000LL) >> 40) + \
+     ((x & 0xff00000000000000LL) >> 56))
+
+#define iswap_int4(x) \
+    (((x & 0x000000ff) << 24) + \
+     ((x & 0x0000ff00) <<  8) + \
+     ((x & 0x00ff0000) >>  8) + \
+     ((x & 0xff000000) >> 24))
+
+#define iswap_int2(x) \
+    (((x & 0x00ff) << 8) + \
+     ((x & 0xff00) >> 8))
+
+#define swap_int8(src, dst) ((dst) = iswap_int8(src))
+#define swap_int4(src, dst) ((dst) = iswap_int4(src))
+#define swap_int2(src, dst) ((dst) = iswap_int2(src))
+
+
+/*
+ * Linux systems may use byteswap.h to get assembly versions of byte-swap
+ * on intel systems. This can be as trivial as the bswap opcode, which works
+ * out at over 2-times faster than iswap_int4 above.
+ */
+#if 0
+#if defined(__linux__)
+#    include <byteswap.h>
+#    undef iswap_int8
+#    undef iswap_int4
+#    undef iswap_int2
+#    define iswap_int8 bswap_64
+#    define iswap_int4 bswap_32
+#    define iswap_int2 bswap_16
+#endif
+#endif
+
+
+/*
+ * Macros to specify that data read in is of a particular endianness.
+ * The macros here swap to the appropriate order for the particular machine
+ * running the macro and return the new answer. These may also be used when
+ * writing to a file to specify that we wish to write in (eg) big endian
+ * format.
+ *
+ * This leads to efficient code as most of the time these macros are
+ * trivial.
+ */
+#ifdef SP_BIG_ENDIAN
+#define be_int8(x) (x)
+#define be_int4(x) (x)
+#define be_int2(x) (x)
+#define be_int1(x) (x)
+
+#define le_int8(x) iswap_int8((x))
+#define le_int4(x) iswap_int4((x))
+#define le_int2(x) iswap_int2((x))
+#define le_int1(x) (x)
+#endif
+
+#ifdef SP_LITTLE_ENDIAN
+#define be_int8(x) iswap_int8((x))
+#define be_int4(x) iswap_int4((x))
+#define be_int2(x) iswap_int2((x))
+#define be_int1(x) (x)
+
+#define le_int8(x) (x)
+#define le_int4(x) (x)
+#define le_int2(x) (x)
+#define le_int1(x) (x)
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*_OS_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/plain.h	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) Medical Research Council 1994. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+#ifndef _seqIOPlain_h
+#define _seqIOPlain_h
+
+
+/* 
+ * Title:       seqIOPlain
+ *
+ * File: 	 seqIOPlain.h
+ * Purpose:	 IO of plain sequences
+ * Last update:  Fri 9th September 1994
+ */
+
+
+
+
+/* ---- Imports ---- */
+
+
+#include "io_lib/Read.h"
+
+
+#endif  /*_seqIOPlain_h*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/pooled_alloc.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,140 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdint.h>
+
+#include "io_lib/pooled_alloc.h"
+
+//#define TEST_MAIN
+
+#define PSIZE 1024*1024
+
+pool_alloc_t *pool_create(size_t dsize) {
+    pool_alloc_t *p;
+
+    if (NULL == (p = (pool_alloc_t *)malloc(sizeof(*p))))
+	return NULL;
+
+    /* Minimum size is a pointer, for free list */
+    dsize = (dsize + sizeof(void *) - 1) & ~(sizeof(void *)-1);
+    if (dsize < sizeof(void *))
+	dsize = sizeof(void *);
+    p->dsize = dsize;
+
+    p->npools = 0;
+    p->pools = NULL;
+    p->free  = NULL;
+
+    return p;
+}
+
+static pool_t *new_pool(pool_alloc_t *p) {
+    size_t i, n = PSIZE / p->dsize;
+    pool_t *pool;
+    char *cp;
+    
+    pool = realloc(p->pools, (p->npools + 1) * sizeof(*p->pools));
+    if (NULL == pool) return NULL;
+    p->pools = pool;
+    pool = &p->pools[p->npools];
+
+    pool->pool = malloc(n * p->dsize);
+    if (NULL == pool->pool) return NULL;
+
+    pool->used = 0;
+
+    p->npools++;
+
+    return pool;
+}
+
+void pool_destroy(pool_alloc_t *p) {
+    size_t i;
+
+    for (i = 0; i < p->npools; i++) {
+        free(p->pools[i].pool);
+    }
+    free(p->pools);
+    free(p);
+}
+
+void *pool_alloc(pool_alloc_t *p) {
+    size_t i;
+    pool_t *pool;
+    void *ret;
+
+    /* Look on free list */
+    if (NULL != p->free) {
+        ret = p->free;
+	p->free = *((void **)p->free);
+	return ret;
+    }
+
+    /* Look for space in the last pool */
+    if (p->npools) {
+        pool = &p->pools[p->npools - 1];
+        if (pool->used + p->dsize < PSIZE) {
+	    ret = ((char *) pool->pool) + pool->used;
+	    pool->used += p->dsize;
+	    return ret;
+	}
+    }
+
+    /* Need a new pool */
+    pool = new_pool(p);
+    if (NULL == pool) return NULL;
+
+    pool->used = p->dsize;
+    return pool->pool;
+}
+
+void pool_free(pool_alloc_t *p, void *ptr) {
+    size_t psize, i;
+
+    *(void **)ptr = p->free;
+    p->free = ptr;
+}
+
+#ifdef TEST_MAIN
+typedef struct {
+    int x, y, z;
+} xyz;
+
+#define NP 10000
+int main(void) {
+    int i;
+    xyz *item;
+    xyz **items;
+    pool_alloc_t *p = pool_create(sizeof(xyz));
+
+    items = (xyz **)malloc(NP * sizeof(*items));
+
+    for (i = 0; i < NP; i++) {
+	item = pool_alloc(p);
+	item->x = i;
+	item->y = i+1;
+	item->z = i+2;
+	items[i] = item;
+    }
+
+    for (i = 0; i < NP; i++) {
+	item = items[i];
+	if (i % 3)
+	    pool_free(p, item);
+    }
+
+    for (i = 0; i < NP; i++) {
+	item = pool_alloc(p);
+	item->x = 1000000+i;
+	item->y = 1000000+i+1;
+	item->z = 1000000+i+2;
+    }
+
+    for (i = 0; i < NP; i++) {
+	item = items[i];
+	printf("%d\t%d\t%d\t%d\n", i, item->x, item->y, item->z);
+	pool_free(p, item);
+    }
+
+    return 0;
+}
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/pooled_alloc.h	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,26 @@
+#ifndef _POOLED_ALLOC_H_
+#define _POOLED_ALLOC_H_
+
+/*
+ * Implements a pooled block allocator where all items are the same size,
+ * but we need many of them.
+ */
+typedef struct {
+    void   *pool;
+    size_t  used;
+} pool_t;
+
+typedef struct {
+    size_t dsize;
+    size_t npools;
+    pool_t *pools;
+    void *free;
+} pool_alloc_t;
+
+pool_alloc_t *pool_create(size_t dsize);
+void pool_destroy(pool_alloc_t *p);
+void *pool_alloc(pool_alloc_t *p);
+void pool_free(pool_alloc_t *p, void *ptr);
+
+
+#endif /*_POOLED_ALLOC_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/read_alloc.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,280 @@
+/*
+ * Copyright (c) Medical Research Council 1994. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+/* 
+ * File: 	read_alloc.c
+ * Purpose:	Performs the allocation/freeing of Read structures
+ * Last update: 01/09/94
+ */
+
+
+/*
+    The Read data type is designed so that it can hold a varying degree
+    of information about sequences, yet have a single set of calls
+    to access the data.
+
+    There are plenty of assumptions around that both the number of
+    bases and the number of points will fit into an int_2, a short.
+
+*/
+
+/* ---- Includes ---- */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+
+#include "io_lib/misc.h"
+#include "io_lib/Read.h"
+
+/*
+ * Allocate a new sequence, with the given sizes.
+ * Returns:
+ *   "Read *" for success
+ *   "NULLRead" for failure
+ */
+Read *read_allocate(int num_points, int num_bases) {
+    Read *seq = NULLRead;
+
+    int sections = read_sections(0);
+
+    /* Allocate the body of the sequence */
+    if ((seq = (Read *)xmalloc(sizeof(Read))) == NULL)
+	return(NULLRead);
+
+    seq->NPoints = num_points;
+    seq->NBases  = num_bases;
+
+    /*   
+     * Initialise the body, all pointers are set to NULL so we can
+     * happily call `read_deallocate()`.
+     */
+    seq->leftCutoff  = 0;
+    seq->rightCutoff = 0;
+    seq->maxTraceVal = 0;
+    seq->baseline = 0;
+
+    seq->traceC    = NULL;
+    seq->traceA    = NULL;
+    seq->traceG    = NULL;
+    seq->traceT    = NULL;
+
+    seq->base      = NULL;
+    seq->basePos   = NULL;
+
+    seq->info = NULL;
+    seq->format = TT_ANY;
+    seq->trace_name = NULL;
+
+    seq->prob_A = NULL;
+    seq->prob_C = NULL;
+    seq->prob_G = NULL;
+    seq->prob_T = NULL;
+
+    seq->orig_trace_format = TT_ANY;
+    seq->orig_trace = NULL;
+    seq->orig_trace_free = NULL;
+
+    seq->ident = NULL;
+
+    /* Allocate space for the bases - 1 extra for the ->base field so
+     * that we can treat it as a NULL terminated string.
+     */
+    if (sections & READ_BASES &&
+	(((seq->base	  = (char *)xcalloc(num_bases+1,1))   == NULL) ||
+	 ((seq->basePos   = (uint_2 *)xcalloc(num_bases+1,2)) == NULL) ||
+	 ((seq->prob_A    = (char *)xcalloc(num_bases+1,1))   == NULL) ||
+	 ((seq->prob_C    = (char *)xcalloc(num_bases+1,1))   == NULL) ||
+	 ((seq->prob_G    = (char *)xcalloc(num_bases+1,1))   == NULL) ||
+	 ((seq->prob_T    = (char *)xcalloc(num_bases+1,1))   == NULL))
+	)
+    {
+	read_deallocate(seq);
+	return NULLRead;
+    }
+
+    if (sections & READ_SAMPLES &&
+	(((seq->traceC   =(TRACE *)xcalloc(num_points+1, 2))  == NULL)||
+	 ((seq->traceA   =(TRACE *)xcalloc(num_points+1, 2))  == NULL)||
+	 ((seq->traceG   =(TRACE *)xcalloc(num_points+1, 2))  == NULL)||
+	 ((seq->traceT   =(TRACE *)xcalloc(num_points+1, 2))  == NULL))
+	)
+    {
+	read_deallocate(seq);
+	return NULLRead;
+    }
+
+    seq->nflows = 0;
+    seq->flow_order = NULL;
+    seq->flow = NULL;
+    seq->flow_raw = NULL;
+
+    seq->private_data = NULL;
+    seq->private_size = 0;
+    
+    return seq;
+}
+
+
+/*
+ * Free memory allocated to a sequence by read_allocate().
+ */
+void read_deallocate(Read *read)
+{
+    if (read == NULLRead)
+	return;
+
+    if (read->traceC  != NULL)  xfree(read->traceC);
+    if (read->traceA  != NULL)  xfree(read->traceA);
+    if (read->traceG  != NULL)  xfree(read->traceG);
+    if (read->traceT  != NULL)  xfree(read->traceT);
+
+    if (read->base    != NULL)  xfree(read->base);
+    if (read->basePos != NULL)  xfree(read->basePos);
+
+    if (read->info    != NULL)  xfree(read->info);
+
+    if (read->prob_A  != NULL)  xfree(read->prob_A);
+    if (read->prob_C  != NULL)  xfree(read->prob_C);
+    if (read->prob_G  != NULL)  xfree(read->prob_G);
+    if (read->prob_T  != NULL)  xfree(read->prob_T);
+
+    if (read->trace_name != NULL) xfree(read->trace_name);
+
+    if (read->orig_trace != NULL) {
+	if (read->orig_trace_free)
+	    read->orig_trace_free(read->orig_trace);
+	else
+	    xfree(read->orig_trace);
+    }
+
+    if (read->ident != NULL)
+	xfree(read->ident);
+
+    if (read->flow_order)
+	xfree(read->flow_order);
+    if (read->flow)
+	xfree(read->flow);
+    if (read->flow_raw)
+	xfree(read->flow_raw);
+
+    if (read->private_data)
+	xfree(read->private_data);
+
+    xfree(read);
+}
+
+
+
+
+/*
+ * Duplicates the read structure and optionally gives it a new filename.
+ * The following fields are not duplicated:
+ *    
+ *  int  orig_trace_format;
+ *  void (*orig_trace_free)(void *ptr);
+ *  void *orig_trace;
+ *  char *ident;
+ *
+ * Returns:
+ *   "Read *" for success
+ *   "NULLRead" for failure
+ */
+Read* read_dup( Read* src, const char* new_name )
+{
+    int   n;
+    Read* dst;
+    assert(src);
+
+    /* Allocate storage and initialise */
+    dst = read_allocate( src->NPoints, src->NBases );
+    if( dst == NULLRead )
+	return 0;
+    dst->info       = 0;
+    dst->trace_name = 0;
+
+
+    /* Copy over possibly new name */
+    if( new_name )
+	n = strlen(new_name);
+    else if( src->trace_name )
+	n = strlen(src->trace_name);
+    else
+	n = 0;
+    if( n > 0 )	{
+	dst->trace_name = (char*) xmalloc(n+1);
+	if( !dst->trace_name )
+	    goto error;
+
+	if(new_name) 
+	    strcpy( dst->trace_name, new_name );
+	else
+	    strcpy( dst->trace_name, src->trace_name );
+    }
+	
+	
+    /* Copy over info */
+    if( src->info ) {
+	dst->info = strdup(src->info);
+    }
+
+
+    /* Copy single fields */
+    dst->format      = src->format;
+    dst->maxTraceVal = src->maxTraceVal;
+    dst->leftCutoff  = src->leftCutoff;
+    dst->rightCutoff = src->rightCutoff;
+    dst->baseline    = src->baseline; 
+    
+
+    /* Copy NPoints fields if they exist */
+    if( src->traceA )
+	{
+	    for( n=0; n<src->NPoints; n++ )
+		{
+		    dst->traceA[n] = src->traceA[n];
+		    dst->traceC[n] = src->traceC[n];
+		    dst->traceG[n] = src->traceG[n];
+		    dst->traceT[n] = src->traceT[n];
+		}
+	}
+    
+    
+    /* Copy NBases fields if they exist */
+    if( src->base && src->base[0] )
+	{
+	    for( n=0; n<src->NBases; n++ )
+		{
+		    dst->base[n]    = src->base[n];
+		    dst->basePos[n] = src->basePos[n];
+		    if( src->prob_A )
+			{
+			    dst->prob_A[n] = src->prob_A[n];
+			    dst->prob_C[n] = src->prob_C[n];
+			    dst->prob_G[n] = src->prob_G[n];
+			    dst->prob_T[n] = src->prob_T[n];
+			}
+		}
+	}
+    
+    
+    /* Success */
+    return dst;
+
+ error:
+    /* Failure */
+    read_deallocate(dst);
+    return NULLRead;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/read_scf.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,448 @@
+/*
+ * Copyright (c) Medical Research Council 1994. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+/* 
+  Title:       read_scf.c
+  
+  Purpose:	 read IO of Standard Chromatogram Format sequences
+  Last update:   August 18 1994
+  
+  Change log:
+  4 Feb 1992,  Now draft proposal version 2
+  20 Feb 1992, Grab info from comment lines
+  19 Aug 1992, If SCF file has clip information, don't clip automatically
+  10 Nov 1992  SCF comments now stored in seq data structure
+  18 Aug 1994  Renamed from  ReadIOSCF.c; now purely SCF IO (no Seq structs)
+
+*/
+
+/* ---- Imports ---- */
+
+#include <ctype.h>
+#include <stdio.h>    /* IMPORT: fopen, fclose, fseek, ftell, fgetc,
+			 EOF */
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+
+#include "io_lib/mach-io.h"
+#include "io_lib/xalloc.h"
+#include "io_lib/compress.h"
+#include "io_lib/Read.h"
+
+#include "io_lib/stdio_hack.h"
+#include "io_lib/scf.h"      /* SCF structures */
+
+
+/* SunOS4 has it's definitions in unistd, which we won't include for compat. */
+#ifndef SEEK_SET
+#define SEEK_SET 0
+#define SEEK_CUR 1
+#define SEEK_END 2
+#endif
+
+/* ---- Exported functions ---- */
+
+int read_scf_header(FILE *fp, Header *h)
+{
+    int i;
+
+    if (be_read_int_4(fp,&h->magic_number)==False)        return -1;
+
+    if (h->magic_number != SCF_MAGIC)
+	return -1;
+
+    if (be_read_int_4(fp,&h->samples)==False)             return -1;
+    if (be_read_int_4(fp,&h->samples_offset)==False)      return -1;
+    if (be_read_int_4(fp,&h->bases)==False)               return -1;
+    if (be_read_int_4(fp,&h->bases_left_clip)==False)     return -1;
+    if (be_read_int_4(fp,&h->bases_right_clip)==False)    return -1;
+    if (be_read_int_4(fp,&h->bases_offset)==False)        return -1;
+    if (be_read_int_4(fp,&h->comments_size)==False)       return -1;
+    if (be_read_int_4(fp,&h->comments_offset)==False)     return -1;
+    if (fread(&h->version[0],sizeof(h->version),1,fp)!=1) return -1;
+    if (be_read_int_4(fp,&h->sample_size)==False)         return -1;
+    if (be_read_int_4(fp,&h->code_set)==False)            return -1;
+    if (be_read_int_4(fp,&h->private_size)==False)        return -1;
+    if (be_read_int_4(fp,&h->private_offset)==False)      return -1;
+    for (i=0;i<18;i++)
+	if (be_read_int_4(fp,&h->spare[i])==False)        return -1;
+    
+    return 0;
+}
+
+
+int read_scf_sample1(FILE *fp, Samples1 *s)
+{
+    uint_1 buf[4];
+
+    if (4 != fread(buf, 1, 4, fp)) return -1;
+    s->sample_A = buf[0];
+    s->sample_C = buf[1];
+    s->sample_G = buf[2];
+    s->sample_T = buf[3];
+
+/*
+    if (1 != fread(s, 4, 1, fp)) return -1;
+*/
+
+    return 0;
+}
+
+
+int read_scf_sample2(FILE *fp, Samples2 *s)
+{
+    uint_2 buf[4];
+
+    if (4 != fread(buf, 2, 4, fp)) return -1;
+    s->sample_A = be_int2(buf[0]);
+    s->sample_C = be_int2(buf[1]);
+    s->sample_G = be_int2(buf[2]);
+    s->sample_T = be_int2(buf[3]);
+    
+    return 0;
+}
+
+int read_scf_samples1(FILE *fp, Samples1 *s, size_t num_samples) {
+    size_t i;
+
+    for (i = 0; i < num_samples; i++) {
+	if (-1 == read_scf_sample1(fp, &(s[i])))
+	    return -1;
+    }
+
+    return 0;
+}
+
+
+int read_scf_samples2(FILE *fp, Samples2 *s, size_t num_samples) {
+    size_t i;
+
+    for (i = 0; i < num_samples; i++) {
+	if (-1 == read_scf_sample2(fp, &(s[i])))
+	    return -1;
+    }
+
+    return 0;
+}
+
+
+int read_scf_samples32(FILE *fp, Samples2 *s, size_t num_samples) {
+    size_t i;
+    uint2 *samples_out;
+
+    /* version to read delta delta data in 2 bytes */
+
+    if ( ! (samples_out = (uint2 *)xmalloc((num_samples+1) * 
+					    sizeof(uint2)))) {
+	return -1;
+    }
+
+
+    if (num_samples != fread(samples_out, 2, num_samples, fp)) return -1;
+#ifdef SP_LITTLE_ENDIAN
+    for (i = 0; i < num_samples; i++) {
+	samples_out[i] = be_int2(samples_out[i]);
+    }
+#endif
+    scf_delta_samples2 ( samples_out, num_samples, 0);
+    for (i = 0; i < num_samples; i++) {
+	(&s[i])->sample_A = samples_out[i];
+    }
+
+    if (num_samples != fread(samples_out, 2, num_samples, fp)) return -1;
+#ifdef SP_LITTLE_ENDIAN
+    for (i = 0; i < num_samples; i++) {
+	samples_out[i] = be_int2(samples_out[i]);
+    }
+#endif
+    scf_delta_samples2 ( samples_out, num_samples, 0);
+    for (i = 0; i < num_samples; i++) {
+	(&s[i])->sample_C = samples_out[i];
+    }
+
+    if (num_samples != fread(samples_out, 2, num_samples, fp)) return -1;
+#ifdef SP_LITTLE_ENDIAN
+    for (i = 0; i < num_samples; i++) {
+	samples_out[i] = be_int2(samples_out[i]);
+    }
+#endif
+    scf_delta_samples2 ( samples_out, num_samples, 0);
+    for (i = 0; i < num_samples; i++) {
+	(&s[i])->sample_G = samples_out[i];
+    }
+
+    if (num_samples != fread(samples_out, 2, num_samples, fp)) return -1;
+#ifdef SP_LITTLE_ENDIAN
+    for (i = 0; i < num_samples; i++) {
+	samples_out[i] = be_int2(samples_out[i]);
+    }
+#endif
+    scf_delta_samples2 ( samples_out, num_samples, 0);
+    for (i = 0; i < num_samples; i++) {
+	(&s[i])->sample_T = samples_out[i];
+    }
+    xfree(samples_out);
+    return 0;
+}
+
+int read_scf_samples31(FILE *fp, Samples1 *s, size_t num_samples) {
+    size_t i;
+    int1 *samples_out;
+
+    /* version to read delta delta data in 1 byte */
+
+    if ( ! (samples_out = (int1 *)xmalloc((num_samples+1) * 
+					    sizeof(int1)))) {
+	return -1;
+    }
+
+    if (num_samples != fread(samples_out, 1, num_samples, fp)) return -1;
+    scf_delta_samples1 ( samples_out, num_samples, 0);
+    for (i = 0; i < num_samples; i++) {
+	(&s[i])->sample_A = samples_out[i];
+    }
+
+    if (num_samples != fread(samples_out, 1, num_samples, fp)) return -1;
+    scf_delta_samples1 ( samples_out, num_samples, 0);
+    for (i = 0; i < num_samples; i++) {
+	(&s[i])->sample_C = samples_out[i];
+    }
+
+    if (num_samples != fread(samples_out, 1, num_samples, fp)) return -1;
+    scf_delta_samples1 ( samples_out, num_samples, 0);
+    for (i = 0; i < num_samples; i++) {
+	(&s[i])->sample_G = samples_out[i];
+    }
+
+    if (num_samples != fread(samples_out, 1, num_samples, fp)) return -1;
+    scf_delta_samples1 ( samples_out, num_samples, 0);
+    for (i = 0; i < num_samples; i++) {
+	(&s[i])->sample_T = samples_out[i];
+    }
+
+    xfree(samples_out);
+    return 0;
+}
+
+int read_scf_base(FILE *fp, Bases *b)
+{
+    uint_1 buf[12];
+
+    if (1 != fread(buf, 12, 1, fp)) return -1;
+    b->peak_index = be_int4(((uint_4 *)buf)[0]);
+    b->prob_A = buf[4];
+    b->prob_C = buf[5];
+    b->prob_G = buf[6];
+    b->prob_T = buf[7];
+    b->base   = buf[8];
+    b->spare[0] = buf[9];
+    b->spare[1] = buf[10];
+    b->spare[2] = buf[11];
+
+    return 0;
+}
+
+
+int read_scf_bases(FILE *fp, Bases *b, size_t num_bases) {
+    size_t i;
+
+    for (i = 0; i < num_bases; i++) {
+	if (-1 == read_scf_base(fp, &(b[i])))
+	    return -1;
+    }
+
+    return 0;
+}
+
+int read_scf_bases3(FILE *fp, Bases *b, size_t num_bases)
+{
+    size_t i;
+    uint_4 *buf4;
+    uint_1 *buf1;
+
+    if (NULL == (buf4 = (uint_4 *)xmalloc(1 + 4 * num_bases)))
+	return -1;
+
+    if (NULL == (buf1 = (uint_1 *)xmalloc(1 + 8 * num_bases))) {
+	xfree(buf4);
+	return -1;
+    }
+
+    if (num_bases != fread(buf4, 4, num_bases, fp)) return -1;
+    for (i=0; i < num_bases; i++)
+	(&b[i])->peak_index = be_int4(buf4[i]);
+
+    if (8 * num_bases != fread(buf1, 1, 8 * num_bases, fp)) return -1;
+
+    for (i=0; i < num_bases; i++) {
+	(&b[i])->prob_A   = buf1[i];
+	(&b[i])->prob_C   = buf1[i+num_bases];
+	(&b[i])->prob_G   = buf1[i+2*num_bases];
+	(&b[i])->prob_T   = buf1[i+3*num_bases];
+	(&b[i])->base     = buf1[i+4*num_bases];
+	(&b[i])->spare[0] = buf1[i+5*num_bases];
+	(&b[i])->spare[1] = buf1[i+6*num_bases];
+	(&b[i])->spare[2] = buf1[i+7*num_bases];
+    }
+
+    xfree(buf4);
+    xfree(buf1);
+
+    return 0;
+}
+
+
+
+int read_scf_comment(FILE *fp, Comments *c, size_t s)
+{
+    if (fread(c, 1, s, fp) != s) return -1;
+
+    return 0;
+}
+
+
+/*
+ * Read the SCF format sequence from FILE *fp into a 'scf' structure.
+ * A NULL result indicates failure.
+ */
+Scf *fread_scf(FILE *fp) {
+    Scf *scf;
+    Header h;
+    int err;
+    float scf_version;
+    int sections = read_sections(0);
+
+    /* Read header */
+    if (read_scf_header(fp, &h) == -1) {
+	return NULL;
+    }
+
+    /* Allocate memory */
+    if (NULL == (scf = scf_allocate(h.samples, h.sample_size,
+				    h.bases, h.comments_size,
+				    h.private_size))) 
+	return NULL;
+
+    /* fake things for older style SCF -- SD */
+    if (h.sample_size != 1 && h.sample_size != 2) h.sample_size = 1;
+
+    scf_version = scf_version_str2float(h.version);
+
+    memcpy(&scf->header, &h, sizeof(Header));
+
+    if (sections & READ_SAMPLES) {
+	/* Read samples */
+	if (fseek(fp, (off_t)h.samples_offset, 0 /* SEEK_SET */) != 0) {
+	    scf_deallocate(scf);
+	    return NULL;
+	}
+
+	if ( 2.9 > scf_version ) {
+
+	    if (h.sample_size == 1) {
+		err= read_scf_samples1(fp, scf->samples.samples1, h.samples);
+	    }
+	    else {
+		err= read_scf_samples2(fp, scf->samples.samples2, h.samples);
+	    }
+	}
+	else {
+
+	    if (h.sample_size == 1) {
+		err= read_scf_samples31(fp, scf->samples.samples1, h.samples);
+	    } 
+	    else {
+		err= read_scf_samples32(fp, scf->samples.samples2, h.samples);
+	    }
+	}
+	if (-1 == err) {
+	    scf_deallocate(scf);
+	    return NULL;
+	}
+    }
+
+    if (sections & READ_BASES) {
+	/* Read bases */
+	if (fseek(fp, (off_t)h.bases_offset, 0 /* SEEK_SET */) != 0) {
+	    scf_deallocate(scf);
+	    return NULL;
+	}
+
+	if ( 2.9 > scf_version ) {
+
+	    if (-1 == read_scf_bases(fp, scf->bases, h.bases)) {
+		scf_deallocate(scf);
+		return NULL;
+	    }
+	}
+	else {
+	
+	    if (-1 == read_scf_bases3(fp, scf->bases, h.bases)) {
+		scf_deallocate(scf);
+		return NULL;
+	    }
+	}
+    }
+
+    if (sections & READ_COMMENTS) {
+	/* Read comments */
+	if (scf->comments) {
+	    if (fseek(fp,(off_t)(h.comments_offset), 0) != 0
+		|| -1 == read_scf_comment(fp, scf->comments,
+					  h.comments_size)) {
+		/*
+		 * Was: "scf_deallocate(scf); return NULL;".
+		 * We now simply clear the comments and gracefully continue.
+		 */
+		fprintf(stderr, "Warning: SCF file had invalid comment field\n");
+		xfree(scf->comments);
+		scf->comments = NULL;
+	    } else {
+		scf->comments[h.comments_size] = '\0';
+	    }
+	}
+    }
+
+    /* Read private data */
+    if (h.private_size) {
+	if (-1 == fseek(fp, (off_t)(h.private_offset), 0) ||
+	    h.private_size != fread(scf->private_data, 1, h.private_size, fp)){
+	    scf_deallocate(scf);
+	    return NULL;
+	}
+    }
+
+    return scf;
+}
+
+/*
+ * Read the SCF format sequence with name `fn' into a 'scf' structure.
+ * A NULL result indicates failure.
+ */
+Scf *read_scf(char *fn) {
+    Scf *scf;
+
+    FILE *fp;
+
+    /* Open fn for reading in binary mode */
+
+    if (NULL == (fp = fopen_compressed(fn, NULL)))
+	return NULL;
+
+    scf = fread_scf(fp);
+    fclose(fp);
+
+    return scf;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/scf.h	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,447 @@
+/*
+ * Copyright (c) Medical Research Council 1994. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+/*
+ * File: scf.h
+ * Version: 3.00
+ *
+ * Description: file structure definitions for SCF file
+ *
+ * Created: 19 November 1992
+ *
+ */
+
+#ifndef _SCF_H_
+#define _SCF_H_
+
+#include <stdio.h>
+#include <sys/types.h>
+
+#include "io_lib/mFILE.h"
+#include "io_lib/os.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ *-----------------------------------------------------------------------------
+ * Macros
+ *-----------------------------------------------------------------------------
+ */
+
+/* The SCF magic number */
+#define SCF_MAGIC (((((uint_4)'.'<<8)+(uint_4)'s'<<8)+(uint_4)'c'<<8)+(uint_4)'f')
+
+/* prior to this was a different format */
+#define SCF_VERSION_OLDEST 2.00
+#define SCF_VERSION_OLD 2.02
+
+/* The current SCF format level */
+#define SCF_VERSION 3.00
+
+/* Uncertainty code sets supported */
+#define CSET_DEFAULT 0  /* {A,C,G,T,-} */
+#define CSET_STADEN  1 
+#define CSET_NC_IUB  2  /* Pharmacia A.L.F. */
+#define CSET_ALF     3  /* extended NC_IUB */
+#define CSET_ABI     4  /* {A,C,G,T,N} */
+#define CSET_IBI     5  /* IBI/Pustell */
+#define CSET_DNASTAR 6  /* DNA* */
+#define CSET_DNASIS  7
+#define CSET_PCGENE  8  /* IG/PC-Gene */
+#define CSET_GENIE   9  /* MicroGenie */
+
+/* define samples to delta_delta values */
+#define DELTA_IT 1
+
+/* What components to read */
+#define READ_BASES	(1<<0)
+#define READ_SAMPLES	(1<<1)
+#define READ_COMMENTS	(1<<2)
+#define READ_ALL	(READ_BASES | READ_SAMPLES | READ_COMMENTS)
+
+/*
+ *-----------------------------------------------------------------------------
+ * Structures and typedefs
+ *-----------------------------------------------------------------------------
+ */
+
+/*
+ * Type definition for the Header structure
+ */
+typedef struct {
+    uint_4 magic_number;       /* SCF_MAGIC */
+    uint_4 samples;            /* Number of elements in Samples matrix */
+    uint_4 samples_offset;     /* Byte offset from start of file */
+    uint_4 bases;              /* Number of bases in Bases matrix */
+    uint_4 bases_left_clip;    /* OBSOLETE: No. bases in left clip (vector) */
+    uint_4 bases_right_clip;   /* OBSOLETE: No. bases in right clip (qual) */
+    uint_4 bases_offset;       /* Byte offset from start of file */
+    uint_4 comments_size;      /* Number of bytes in Comment section */
+    uint_4 comments_offset;    /* Byte offset from start of file */
+    char   version[4];	       /* "version.revision" */
+    uint_4 sample_size;	       /* precision of samples (in bytes) */
+    uint_4 code_set;	       /* uncertainty codes used */
+    uint_4 private_size;       /* size of private data, 0 if none */
+    uint_4 private_offset;     /* Byte offset from start of file */
+    uint_4 spare[18];          /* Unused */
+} Header;
+
+/*
+ * Header.sample_size == 1.
+ */
+typedef struct {
+    uint_1 sample_A;			/* Sample for A trace */
+    uint_1 sample_C;			/* Sample for C trace */
+    uint_1 sample_G;			/* Sample for G trace */
+    uint_1 sample_T;			/* Sample for T trace */
+} Samples1;
+
+/*
+ * Header.sample_size == 2.
+ */
+typedef struct {
+    uint_2 sample_A;			/* Sample for A trace */
+    uint_2 sample_C;			/* Sample for C trace */
+    uint_2 sample_G;			/* Sample for G trace */
+    uint_2 sample_T;			/* Sample for T trace */
+} Samples2;
+
+/*
+ * Type definition for the sequence data
+ */
+typedef struct {
+    uint_4 peak_index;        /* Index into Samples matrix for base position */
+    uint_1 prob_A;            /* Probability of it being an A */
+    uint_1 prob_C;            /* Probability of it being an C */
+    uint_1 prob_G;            /* Probability of it being an G */
+    uint_1 prob_T;            /* Probability of it being an T */
+    char base;		      /* Base called */
+    uint_1 spare[3];          /* Spare */
+} Bases;
+
+
+/*
+ * Type definition for the comments
+ */
+typedef char Comments;      /* Zero terminated list of \n separated entries */
+
+
+/*
+ * All of the above structs in a single scf format.
+ */
+typedef struct {
+    Header header;
+    union Samples {
+	Samples1 *samples1;
+	Samples2 *samples2;
+    } samples;
+    Bases *bases;
+    Comments *comments;
+    char *private_data;
+} Scf;
+
+/*
+ *-----------------------------------------------------------------------------
+ * Function prototypes
+ *-----------------------------------------------------------------------------
+ */
+
+/*
+ * Reading SCF Files
+ * -----------------
+ */
+
+/*
+ * Read the Header struct.
+ * Returns:
+ *    0 - success
+ *   -1 - failure
+ */
+int read_scf_header(mFILE *fp, Header *h);
+
+/*
+ * Read a single 8bit sample
+ * Returns:
+ *    0 - success
+ *   -1 - failure
+ */
+int read_scf_sample1(mFILE *fp, Samples1 *s);
+
+/*
+ * Read several 8bit samples
+ * Returns:
+ *    0 - success
+ *   -1 - failure
+ */
+int read_scf_samples1(mFILE *fp, Samples1 *s, size_t num_samples);
+
+/*
+ * Read several 8bit samples in delta_delta format
+ * Returns:
+ *    0 - success
+ *   -1 - failure
+ */
+int read_scf_samples31(mFILE *fp, Samples1 *s, size_t num_samples);
+
+/*
+ * Read a single 16bit sample
+ * Returns:
+ *    0 - success
+ *   -1 - failure
+ */
+int read_scf_sample2(mFILE *fp, Samples2 *s);
+
+/*
+ * Read several 16bit samples
+ * Returns:
+ *    0 - success
+ *   -1 - failure
+ */
+int read_scf_samples2(mFILE *fp, Samples2 *s, size_t num_samples);
+
+/*
+ * Read several 16bit samples in delta_delta format
+ * Returns:
+ *    0 - success
+ *   -1 - failure
+ */
+int read_scf_samples32(mFILE *fp, Samples2 *s, size_t num_samples);
+
+/*
+ * Read a single Bases structure
+ * Returns:
+ *    0 - success
+ *   -1 - failure
+ */
+int read_scf_base(mFILE *fp, Bases *b);
+
+/*
+ * Read several Bases structures consecutively
+ * Returns:
+ *    0 - success
+ *   -1 - failure
+ */
+int read_scf_bases(mFILE *fp, Bases *b, size_t num_bases);
+
+/*
+ * Read Bases, peak_indexes and probs
+ * Returns:
+ *    0 - success
+ *   -1 - failure
+ */
+int read_scf_bases3(mFILE *fp, Bases *b, size_t num_bases);
+
+/*
+ * Read the SCF Comments.
+ * Returns:
+ *    0 - success
+ *   -1 - failure
+ */
+int read_scf_comment(mFILE *fp, Comments *c, size_t l);
+
+/*
+ * Reads a whole SCF file into a Scf structure. This memory for this
+ * structure is allocated by this routine. To free this memory use
+ * scf_deallocate().
+ * Returns:
+ *    Scf *	- Success, the Scf structure read.
+ *    NULL	- Failure.
+ * On failure NULL is returned, otherwise the Scf struct.
+ */
+Scf *read_scf(char *fn);
+Scf *fread_scf(FILE *fp);
+Scf *mfread_scf(mFILE *fp);
+
+
+/*
+ * Writing SCF Files
+ * -----------------
+ */
+
+/*
+ * Write the Header struct.
+ * Returns:
+ *    0 - success
+ *   -1 - failure
+ */
+int write_scf_header(mFILE *fp, Header *h);
+
+/*
+ * Write a single 8bit sample
+ * Returns:
+ *    0 - success
+ *   -1 - failure
+ */
+int write_scf_sample1(mFILE *fp, Samples1 *s);
+
+/*
+ * Write several 8bit samples
+ * Returns:
+ *    0 - success
+ *   -1 - failure
+ */
+int write_scf_samples1(mFILE *fp, Samples1 *s, size_t num_samples);
+
+/*
+ * Write several 8bit samples in delta_delta format
+ * Returns:
+ *    0 - success
+ *   -1 - failure
+ */
+int write_scf_samples31(mFILE *fp, Samples1 *s, size_t num_samples);
+
+/*
+ * Write 16bit samples
+ * Returns:
+ *    0 - success
+ *   -1 - failure
+ */
+int write_scf_sample2(mFILE *fp, Samples2 *s);
+
+/*
+ * Write several 16bit samples
+ * Returns:
+ *    0 - success
+ *   -1 - failure
+ */
+int write_scf_samples2(mFILE *fp, Samples2 *s, size_t num_samples);
+
+/*
+ * Write several 16bit samples in delta_delta format
+ * Returns:
+ *    0 - success
+ *   -1 - failure
+ */
+int write_scf_samples32(mFILE *fp, Samples2 *s, size_t num_samples);
+
+/*
+ * Write the Bases structure
+ * Returns:
+ *    0 - success
+ *   -1 - failure
+ */
+int write_scf_base(mFILE *fp, Bases *b);
+
+/*
+ * Write the several Bases structures consecutively
+ * Returns:
+ *    0 - success
+ *   -1 - failure
+ */
+int write_scf_bases(mFILE *fp, Bases *b, size_t num_bases);
+
+/*
+ * Write the bases, then peak indexes, then probs
+ * Returns:
+ *    0 - success
+ *   -1 - failure
+ */
+int write_scf_bases3(mFILE *fp, Bases *b, size_t num_bases);
+
+/*
+ * Write the SCF Comments.
+ * Returns:
+ *    0 - success
+ *   -1 - failure
+ */
+int write_scf_comment(mFILE *fp, Comments *c, size_t l);
+
+
+/*
+ * Writes a whole Scf structure to filename "fn".
+ * This initialises several fields in the Header struct for you. These are:
+ *     samples_offset
+ *     bases_offset
+ *     comments_offset
+ *     magic_number
+ *
+ * All other fields are assumed to be correctly set.
+ *
+ * Returns:
+ *     0 for success
+ *    -1 for failure
+ */
+int write_scf(Scf *scf, char *fn);
+int fwrite_scf(Scf *scf, FILE *fp);
+int mfwrite_scf(Scf *scf, mFILE *fp);
+
+/*
+ * Request which (major) version of scf to use when writing.
+ * Defaults to the latest. Currently suitable fields are
+ * 2 and 3.
+ *
+ * Returns 0 for success, -1 for failure.
+ */
+int set_scf_version(int version);
+
+
+/*
+ * Miscellaneous SCF utilities
+ * ---------------------------
+ */
+
+/*
+ * Converts an SCF version string (eg "2.00") to a float
+ */
+float scf_version_str2float(char version[]);
+
+/*
+ * Converts an SCF version float (eg 2.00) to a string
+ * Returns:
+ *    A statically allocated 5 character string.
+ */
+char *scf_version_float2str(float f);
+
+/*
+ * Allocates memory for the scf elements based upon arguments passed.
+ * Returns;
+ *    Scf *	- Success. The scf structure and it's samples, bases,
+ *                and comments fields have been allocated.
+ *    NULL	- Failure.
+ */
+Scf *scf_allocate(int num_samples, int sample_size, int num_bases,
+		  int comment_size, int private_size);
+
+/*
+ * Frees memory allocated by scf_allocate.
+ */
+void scf_deallocate(Scf *scf);
+
+/*
+ * Checks to see if the file with name "fn" is in SCF format.
+ * Returns:
+ *   1  - is in SCF format
+ *   0  - is not in SCF format
+ *  -1  - failure
+ */
+int is_scf(char *fn);
+
+/*
+ * Change sample points to delta_delta values for uint1
+ */
+void scf_delta_samples1 ( int1 samples[], int num_samples, int job);
+
+/*
+ * Change sample points to delta_delta values for uint2
+ */
+void scf_delta_samples2 ( uint2 samples[], int num_samples, int job);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*_SCF_H_*/
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/scf_extras.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,241 @@
+/*
+ * Copyright (c) Medical Research Council 1998. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies and that credit is given
+ * where due.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * Kathryn Beal, as part of the Staden Package at the MRC Laboratory of
+ * Molecular Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+/*
+ * This file contains the necessary code for reading the quality values from
+ * an SCF file. It supports both V2 and V3 SCF formats.
+ * It's done in an efficient manner by extracting only the relevant SCF
+ * components.
+ * This file is derived from the Gap4 source file scf_extras.c.
+ */
+
+#include <stdlib.h>
+
+#include "io_lib/stdio_hack.h"
+#include "io_lib/compress.h"
+#include "io_lib/misc.h"
+#include "io_lib/scf.h"
+#include "io_lib/expFileIO.h"
+#include "io_lib/traceType.h"
+#include "io_lib/open_trace_file.h"
+#include "io_lib/scf_extras.h"
+
+/*
+ * ---------------------------------------------------------------------------
+ * Loads confidence values from the trace file and averages them.
+ * 'opos' is optional - if not known then set to NULL.
+ *
+ * Returns 0 for success
+ *        -1 for failure
+ */
+int get_read_conf(Exp_info *e, int length, int2 *opos, int1 *conf) {
+    int ttype, i;
+    FILE *fp;
+    uint_1 *prob_A, *prob_C, *prob_G, *prob_T;
+    char *seq;
+    float scf_version;
+    int nbases = 0;
+
+    /* Sanity check */
+    if (!(exp_Nentries(e,EFLT_LT) && exp_Nentries(e,EFLT_LN)))
+	return -1;
+
+    /* Find and load trace file */
+    ttype = trace_type_str2int(exp_get_entry(e, EFLT_LT));
+
+    if (ttype != TT_SCF &&
+	ttype != TT_CTF &&
+	ttype != TT_ZTR)
+	return -1;
+
+    /*
+     * We only support direct reading accuracy values from SCF files.
+     * Otherwise we have to take a slower approach.
+     */
+    if (ttype != TT_SCF) {
+	Read *r;
+	int sec = read_sections(0);
+	read_sections(READ_BASES);
+
+	if (NULL == (r = read_reading(exp_get_entry(e,EFLT_LN), TT_ANYTR))) {
+	    read_sections(sec);
+	    return -1;
+	}
+
+	prob_A = (int1 *)xmalloc(r->NBases);
+	prob_C = (int1 *)xmalloc(r->NBases);
+	prob_G = (int1 *)xmalloc(r->NBases);
+	prob_T = (int1 *)xmalloc(r->NBases);
+	seq    = (char *)xmalloc(r->NBases);
+
+	memcpy(prob_A, r->prob_A, r->NBases);
+	memcpy(prob_C, r->prob_C, r->NBases);
+	memcpy(prob_G, r->prob_G, r->NBases);
+	memcpy(prob_T, r->prob_T, r->NBases);
+	memcpy(seq,    r->base,   r->NBases);
+
+	nbases = r->NBases;
+
+	read_deallocate(r);
+	read_sections(sec);
+
+    } else {
+	Header h;
+	/* For SCF files we read directly - the above code would also do. */
+
+	if (NULL == (fp = open_trace_file(exp_get_entry(e,EFLT_LN), NULL)))
+	    return -1;
+
+	/* Read the SCF header */
+	if (-1 == read_scf_header(fp, &h))
+	    return -1;
+	scf_version = scf_version_str2float(h.version);
+	nbases = h.bases;
+
+	/* Alloc memory */
+	prob_A = (uint_1 *)xmalloc(h.bases * sizeof(*prob_A));
+	prob_C = (uint_1 *)xmalloc(h.bases * sizeof(*prob_A));
+	prob_G = (uint_1 *)xmalloc(h.bases * sizeof(*prob_A));
+	prob_T = (uint_1 *)xmalloc(h.bases * sizeof(*prob_A));
+	seq    = (char   *)xmalloc(h.bases * sizeof(*seq));
+	if (NULL == prob_A ||
+	    NULL == prob_C ||
+	    NULL == prob_G ||
+	    NULL == prob_T ||
+	    NULL == seq)
+	    return -1;
+
+	/* Load base scores */
+	if (scf_version >= 3.0) {
+	    /*
+	     * Version 3 base format:
+	     * num_bases * 4byte peak index
+	     * num_bases * prob_A
+	     * num_bases * prob_C
+	     * num_bases * prob_G
+	     * num_bases * prob_T
+	     * num_bases * base
+	     * num_bases * spare (x3)
+	     */
+	    fseek(fp, (off_t)h.bases_offset + 4 * h.bases, SEEK_SET);
+	    if (h.bases != fread(prob_A, 1, h.bases, fp))
+		return -1;
+	    if (h.bases != fread(prob_C, 1, h.bases, fp))
+		return -1;
+	    if (h.bases != fread(prob_G, 1, h.bases, fp))
+		return -1;
+	    if (h.bases != fread(prob_T, 1, h.bases, fp))
+		return -1;
+	    if (h.bases != fread(seq, 1, h.bases, fp))
+		return -1;
+	} else {
+	    int i;
+	    uint_1 buf[12];
+
+	    /*
+	     * Version 2 base format
+	     * num_bases * base_struct,  where base_struct is 12 bytes:
+	     *     0-3 peak_index
+	     *     4-7 prob_A/C/G/T
+	     *     8   base
+	     *     9-  spare
+	     */
+	    fseek(fp, (off_t)h.bases_offset, SEEK_SET);
+
+	    for (i = 0; (unsigned)i < h.bases; i++) {
+		if (1 != fread(buf, 12, 1, fp))
+		    return -1;
+		prob_A[i] = buf[4];
+		prob_C[i] = buf[5];
+		prob_G[i] = buf[6];
+		prob_T[i] = buf[7];
+		seq[i]    = buf[8];
+	    }
+	}
+
+	fclose(fp);
+    }
+
+    /* Determine confidence values */
+    if (opos) {
+	for (i=0; i<length; i++) {
+	    if (opos[i] == 0) {
+		/* Inserted base, change to 0% */
+		conf[i] = 0;
+	    } else {
+		switch(seq[opos[i]-1]) {
+		case 'a':
+		case 'A':
+		    conf[i] = prob_A[opos[i]-1];
+		    break;
+		case 'c':
+		case 'C':
+		    conf[i] = prob_C[opos[i]-1];
+		    break;
+		case 'g':
+		case 'G':
+		    conf[i] = prob_G[opos[i]-1];
+		    break;
+		case 't':
+		case 'T':
+		    conf[i] = prob_T[opos[i]-1];
+		    break;
+		default:
+		    conf[i] = 2;
+		}
+	    }
+	}
+    } else {
+	int mlength = MIN(length, nbases);
+
+	for (i=0; i < mlength; i++) {
+	    switch(seq[i]) {
+	    case 'a':
+	    case 'A':
+		conf[i] = prob_A[i];
+		break;
+	    case 'c':
+	    case 'C':
+		conf[i] = prob_C[i];
+		break;
+	    case 'g':
+	    case 'G':
+		conf[i] = prob_G[i];
+		break;
+	    case 't':
+	    case 'T':
+		conf[i] = prob_T[i];
+		break;
+	    case 'n':
+	    case 'N':
+	    case '-':
+		conf[i] = (prob_A[i] + prob_C[i] + prob_G[i] + prob_T[i]) / 4;
+		break;
+	    default:
+		conf[i] = 2;
+	    }
+	}
+	for (; i < length; i++)
+	    conf[i] = 2;
+    }
+
+    xfree(prob_A);
+    xfree(prob_C);
+    xfree(prob_G);
+    xfree(prob_T);
+    xfree(seq);
+
+    return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/scf_extras.h	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) Medical Research Council 1998. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies and that credit is given
+ * where due.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * Kathryn Beal, as part of the Staden Package at the MRC Laboratory of
+ * Molecular Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+#ifndef _SCFBITS_H_
+#define _SCFBITS_H_
+
+#include "io_lib/expFileIO.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int get_read_conf(Exp_info *e, int length, int2 *opos, int1 *conf);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _SCFBITS_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/seqIOABI.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,957 @@
+/*
+ * Copyright (c) Medical Research Council 1994. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+/* 
+ * Title:       seqIOABI
+ * 
+ * File: 	seqIOABI.c
+ * Purpose:	Reading (not writing) of ABI sequences
+ * Last update: Fri Sep 02, 1994
+ *
+ * Change log:
+ * 27/11/90 SD     writeSeqABI() outputs header to sequence file:
+ * format: ;{noOfBases}{leftCutOff}{basesWritten}{type}{tracefile}
+ * eg:     ;   867    45    383ABI a09b7.s1RES
+ * 28.11.90 SD  put undesirables under STLOUIS compilation flag
+ * 11.12.90 SD  new static function tail to find file name in path name
+ * 02.01.91 SD  Merged with St.L version
+ * 15.01.91 SD  New include added (opp.h)
+ * 30.07.91 SD  Those ole FWO_ field blues
+ * 17.09.91 LFW changed STLOUIS compilation flag to SAVE_EDITS
+ *              and AUTO_CLIP
+ * 25.10.91 SD  Machine independant I/O...removed BIGENDIAN flag
+ * 21.07.92 LFW Added finding of primer position
+ * 11.11.92 LFW added section to actually check that the trace it
+ *              is trying to open is an ALF file using traceType sub
+ * 10.11.92 SD  FWO_ and S/N% interpretation. Comments for information
+ *              window.
+ * 05-Jul-93 SD Added code to check base positions are in order and adjust
+ *              them if they are not
+ * 02.09.94 JKB Change to use Read instead of Seq library.
+ */
+
+
+/*
+ * In the absense of any better format to store our ABI data in we use
+ * the Read structure. Hence this module should be considered part of the
+ * Read libary.
+ *
+ * This library also requires use of the mach-io code for the endian
+ * independent machine IO.
+ * 
+ * The ABI results file is controlled by an index found towards
+ * the end --- this is pointed to by a longword found at `IndexPO'.
+ * The index consists of a number of entries, each of which is
+ * four character label followed by 6 long words. The first of these
+ * long words holds a simple count (starting at 1) for those cases
+ * where there are multiple entries with the same label. Entries should
+ * be found by label (and count), rather than their index position,
+ * because entries can be ommited or new ones added. This happens when
+ * ABI changes the version of their software and also depending
+ * on whether the data was analysed or unalaysed. We do, however,
+ * make assumptions about the relative order of entries.
+ * 
+ * Ideally we would have a separate module which provides a number
+ * of functions to extract the data we are interested in, keeping
+ * the ABI format well wrapped up and out of harms way.
+ * 
+ * Note that we are relying on the endian-ness of the machine being
+ * appropriate so we can just read long words in as integers. This
+ * should be recoded to deal with running on different endians.
+ */
+
+
+
+
+/* ---- Imports ---- */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <string.h>
+#include <time.h>
+
+#include "io_lib/stdio_hack.h"
+
+#include "io_lib/seqIOABI.h"
+#include "io_lib/Read.h"
+#include "io_lib/abi.h"
+#include "io_lib/fpoint.h"    /* IMPORT: int_to_float */
+#include "io_lib/mach-io.h"
+#include "io_lib/xalloc.h"
+#include "io_lib/misc.h"
+
+/* ---- Constants ---- */
+
+#define BasesPerLine 50 /* For output formatting */
+
+#define baseIndex(B) ((B)=='C'?0:(B)=='A'?1:(B)=='G'?2:3)
+
+static int header_fudge = 0;
+
+/* DATA block numbers for traces, in order of FWO_ */
+static int DataCount[4] = {9, 10, 11, 12};
+
+int dump_labels(FILE *fp, off_t indexO) {
+    off_t entryNum = -1;
+    uint_4 entryLabel, entryLw1;
+
+    do {
+	entryNum++;
+
+	if (fseek(fp, header_fudge+indexO+(entryNum*IndexEntryLength), 0) != 0)
+	    return 0;
+
+	if (!be_read_int_4(fp, &entryLabel))
+	    return 0;
+
+	if (!be_read_int_4(fp, &entryLw1))
+	    return 0;
+
+	if (entryLabel) {
+	    unsigned char c1, c2, c3, c4;
+
+	    c1 = (entryLabel >> 24) & 0xff;
+	    c2 = (entryLabel >> 16) & 0xff;
+	    c3 = (entryLabel >>  8) & 0xff;
+	    c4 = (entryLabel >>  0) & 0xff;
+
+	    if (!isprint(c1))
+		break;
+
+	    printf("%c%c%c%c %d\n", c1, c2, c3, c4, entryLw1);
+	}
+    } while (entryLabel);
+
+    return 0;
+}
+
+/*
+ * From the ABI results file connected to `fp' whose index starts
+ * at byte offset `indexO', return in `val' the `lw'th long word
+ * from the `count'th entry labelled `label'.
+ * The result is 0 for failure, or index offset for success.
+ */
+int getABIIndexEntryLW(FILE *fp, off_t indexO,
+		       uint_4 label, uint_4 count, int lw,
+		       uint_4 *val) {
+    off_t entryNum=-1;
+    int i;
+    uint_4 entryLabel, entryLw1;
+    
+    do {
+	entryNum++;
+
+	if (fseek(fp, header_fudge+indexO+(entryNum*IndexEntryLength), 0) != 0)
+	    return 0;
+
+	if (!be_read_int_4(fp, &entryLabel))
+	    return 0;
+
+	if (!be_read_int_4(fp, &entryLw1))
+	    return 0;
+    } while (!(entryLabel == label && entryLw1 == count));
+    
+    for(i=2; i<=lw; i++)
+	if (!be_read_int_4(fp, val))
+	    return 0;
+    
+    return indexO+(entryNum*IndexEntryLength);
+}
+
+/*
+ * From the ABI results file connected to `fp' whose index starts
+ * at byte offset `indexO', return in `val' the `sw'th short word
+ * from the `count'th entry labelled `label'.
+ * The result is 0 for failure, or index offset for success.
+ */
+int getABIIndexEntrySW(FILE *fp, off_t indexO,
+		       uint_4 label, uint_4 count, int sw,
+		       uint_2 *val) {
+    off_t entryNum=-1;
+    int i;
+    uint_4 entryLabel, entryLw1;
+    
+    do {
+	entryNum++;
+
+	if (fseek(fp, header_fudge+indexO+(entryNum*IndexEntryLength), 0) != 0)
+	    return 0;
+
+	if (!be_read_int_4(fp, &entryLabel))
+	    return 0;
+
+	if (!be_read_int_4(fp, &entryLw1))
+	    return 0;
+    } while (!(entryLabel == label && entryLw1 == count));
+    
+    for(i=4; i<=sw; i++)
+	if (!be_read_int_2(fp, val))
+	    return 0;
+    
+    return indexO+(entryNum*IndexEntryLength);
+}
+
+
+/*
+ * Gets the offset of the ABI index.
+ * Returns -1 for failure, 0 for success.
+ */
+int getABIIndexOffset(FILE *fp, uint_4 *indexO) {
+    uint_4 magic;
+
+    /*
+     * Initialise header_fudge.
+     *
+     * This is usually zero, but maybe we've transfered a file in MacBinary
+     * format in which case we'll have an extra 128 bytes to add to all
+     * our fseeks.
+     */
+    rewind(fp);
+    be_read_int_4(fp, &magic);
+    header_fudge = (magic == ABI_MAGIC ? 0 : 128);
+
+    if ((fseek(fp, header_fudge + IndexPO, 0) != 0) ||
+	(!be_read_int_4(fp, indexO)))
+	return -1;
+    else
+	return 0;
+}
+
+/*
+ * Get an "ABI String". These strings are either pointed to by the index
+ * offset, or held in the offset itself when the string is <= 4 characters.
+ * The "type" of the index entry is either 0x12 (a pascal string in which
+ * case the first byte of the string determines its length) or a 0x02 (a
+ * C-style string with length coming from the abi index).
+ *
+ * "string" will be max 256 bytes for the pascal string, but is of unknown
+ * (and hence potentially buggy) length for C-strings. For now we live with
+ * it as this entire file needs rewriting from scratch anyway.
+ *
+ * Returns -1 for failure, string length for success.
+ */
+int getABIString(FILE *fp, off_t indexO, uint_4 label, uint_4 count,
+		 char *string) {
+    uint_4 off;
+    uint_4 len;
+    uint_2 type;
+    
+    off = getABIIndexEntrySW(fp, indexO, label, count, 4, &type);
+    if (!off)
+	return -1;
+
+    if (off = getABIIndexEntryLW(fp, indexO, label, count, 4, &len)) {
+	uint_1 len2;
+
+	if (!len)
+	    return 0;
+
+	/* Determine offset */
+	if (len <= 4)
+	    off += 20;
+	else
+	    getABIIndexEntryLW(fp, indexO, label, count, 5, &off);
+
+	/* Read length byte */
+	if (type == 0x12) {
+	    fseek(fp, header_fudge + off, 0);
+	    be_read_int_1(fp, &len2);
+	} else {
+	    len2 = len;
+	}
+
+	/* Read data (max 255 bytes) */
+	fread(string, len2, 1, fp);
+	string[len2] = 0;
+
+	return len2;
+    } else
+	return -1;
+}
+
+static void replace_nl(char *string) {
+    char *cp;
+
+    for (cp = string; *cp; cp++) {
+	if (*cp == '\n') *cp = ' ';
+    }
+}
+
+
+/*
+ * Get an "ABI Int_1". This is raw 1-byte integer data pointed to by the
+ * offset, or held in the offset itself when the data is <= 4 characters.
+ *
+ * If indexO is 0 then we do not search for (or indeed use) label and count,
+ * but simply assume that we are already at the correct offset and read from
+ * here. (NB: This negates the length <= 4 check.)
+ *
+ * Returns -1 for failure, length desired for success (it'll only fill out
+ * up to max_data_len elements, but it gives an indication of whether there
+ * was more to come).
+ */
+int getABIint1(FILE *fp, off_t indexO, uint_4 label, uint_4 count,
+	       uint_1 *data, int max_data_len) {
+    uint_4 off;
+    uint_4 len, len2;
+
+    if (indexO) {
+	if (!(off = getABIIndexEntryLW(fp, indexO, label, count, 4, &len)))
+	    return -1;
+
+	if (!len)
+	    return 0;
+
+	/* Determine offset */
+	if (len <= 4)
+	    off += 20;
+	else
+	    getABIIndexEntryLW(fp, indexO, label, count, 5, &off);
+    
+	len2 = MIN((uint_4)max_data_len, len);
+
+	fseek(fp, header_fudge + off, 0);
+    } else {
+	len = len2 = max_data_len;
+    }
+
+    fread(data, len2, 1, fp);
+
+    return len;
+}
+
+/*
+ * Get an "ABI Int_2". This is raw 2-byte integer data pointed to by the
+ * offset, or held in the offset itself when the data is <= 4 characters.
+ *
+ * Returns -1 for failure, length desired for success (it'll only fill out
+ * up to max_data_len elements, but it gives an indication of whether there
+ * was more to come).
+ */
+int getABIint2(FILE *fp, off_t indexO, uint_4 label, uint_4 count,
+	       uint_2 *data, int max_data_len) {
+    int len, l2;
+    int i;
+
+    len = getABIint1(fp, indexO, label, count, (uint_1 *)data, max_data_len*2);
+    if (-1 == len)
+	return -1;
+
+    len /= 2;
+    l2 = MIN(len, max_data_len);
+    for (i = 0; i < l2; i++) {
+	data[i] = be_int2(data[i]);
+    }
+
+    return len;
+}
+
+/*
+ * Get an "ABI Int_4". This is raw 4-byte integer data pointed to by the
+ * offset, or held in the offset itself when the data is <= 4 characters.
+ *
+ * Returns -1 for failure, length desired for success (it'll only fill out
+ * up to max_data_len elements, but it gives an indication of whether there
+ * was more to come).
+ */
+int getABIint4(FILE *fp, off_t indexO, uint_4 label, uint_4 count,
+	       uint_4 *data, int max_data_len) {
+    int len, l2;
+    int i;
+
+    len = getABIint1(fp, indexO, label, count, (uint_1 *)data, max_data_len*4);
+    if (-1 == len)
+	return -1;
+
+    len /= 4;
+    l2 = MIN(len, max_data_len);
+    for (i = 0; i < l2; i++) {
+	data[i] = be_int4(data[i]);
+    }
+
+    return len;
+}
+
+/*
+ * Change the DATA counts for fetching traces
+ */
+void abi_set_data_counts(int f, int w, int o, int _) {
+    DataCount[0] = f;
+    DataCount[1] = w;
+    DataCount[2] = o;
+    DataCount[3] = _;
+}
+
+/*
+ * Put the DATA counts back to their defaults.
+ */
+void abi_reset_data_counts(void) {
+    DataCount[0] = 9;
+    DataCount[1] = 10;
+    DataCount[2] = 11;
+    DataCount[3] = 12;
+}
+
+/*
+ * Read the ABI format sequence from FILE *fp into a Read structure.
+ * All printing characters (as defined by ANSII C `isprint')
+ * are accepted, but `N's are translated to `-'s. In this respect we
+ * are adhering (more or less) to the CSET_DEFAULT uncertainty code set.
+ * 
+ * Returns:
+ *   Read *	- Success, the Read structure read.
+ *   NULLRead	- Failure.
+ */
+Read *fread_abi(FILE *fp) {
+    Read *read = NULLRead;
+    int i;
+    float fspacing;		/* average base spacing */
+    uint_4 numPoints, numBases;
+    uint_4 signalO;
+    int no_bases = 0;
+    int sections = read_sections(0);
+    uint_1 *conf;
+
+    uint_4 fwo_;     /* base -> lane mapping */
+    uint_4 indexO;   /* File offset where the index is */
+    uint_4 baseO;    /* File offset where the bases are stored */
+    uint_4 dataCO;   /* File offset where the C trace is stored */
+    uint_4 dataAO;   /* File offset where the A trace is stored */
+    uint_4 dataGO;   /* File offset where the G trace is stored */
+    uint_4 dataTO;   /* File offset where the T trace is stored */
+    uint_4 offset;   /* Generic offset */
+    uint_4 offset2;  /* Generic offset */
+    uint_4 offset3;  /* Generic offset */
+    uint_4 offset4;  /* Generic offset */
+
+    
+
+    /* Get the index offset */
+    if (-1 == getABIIndexOffset(fp, &indexO))
+	goto bail_out;
+    
+    /* Get the number of points */
+    if (!getABIIndexEntryLW(fp,(off_t)indexO,DataEntryLabel,DataCount[0],
+			    3,&numPoints))
+	goto bail_out;	
+    
+    /* Get the number of bases */
+    if (!getABIIndexEntryLW(fp,(off_t)indexO,BaseEntryLabel,1,3,&numBases)) {
+	no_bases = 1;
+	numBases = 0;
+    }
+
+    
+    /* Allocate the sequence */
+    if (NULLRead == (read = read_allocate(numPoints, numBases)))
+	goto bail_out;	
+    
+    /* Get the Filter Wheel Order (FWO_) field ... */
+    if (!getABIIndexEntryLW(fp,(off_t)indexO,FWO_Label,1,5,&fwo_)) {
+	/* Guess at CAGT */
+	fwo_ = 0x43414754;
+    }
+
+    /*
+     * The order of the DATA fields is determined by the field FWO_
+     * Juggle around with data pointers to get it right
+     */
+    if (sections & READ_SAMPLES) {
+	uint_4 *dataxO[4];
+	
+	dataxO[0] = &dataCO;
+	dataxO[1] = &dataAO;
+	dataxO[2] = &dataGO;
+	dataxO[3] = &dataTO;
+	
+	/*Get the positions of the four traces */
+	if (!(getABIIndexEntryLW(fp, (off_t)indexO, DataEntryLabel,
+				 DataCount[0], 5,
+				 dataxO[baseIndex((char)(fwo_>>24&255))]) &&
+	      getABIIndexEntryLW(fp, (off_t)indexO, DataEntryLabel,
+				 DataCount[1], 5,
+				 dataxO[baseIndex((char)(fwo_>>16&255))]) &&
+	      getABIIndexEntryLW(fp, (off_t)indexO, DataEntryLabel,
+				 DataCount[2], 5,
+				 dataxO[baseIndex((char)(fwo_>>8&255))]) &&
+	      getABIIndexEntryLW(fp, (off_t)indexO, DataEntryLabel,
+				 DataCount[3], 5,
+				 dataxO[baseIndex((char)(fwo_&255))]))) {
+	    goto bail_out;
+	}
+    }
+    
+    
+    /*************************************************************
+     * Read the traces and bases information
+     *************************************************************/
+
+    if (sections & READ_SAMPLES) {
+	/* Read in the C trace */
+	if (fseek(fp, header_fudge + (off_t)dataCO, 0) == -1) goto bail_out;
+	getABIint2(fp, 0, 0, 0, read->traceC, read->NPoints);
+	
+	/* Read in the A trace */
+	if (fseek(fp, header_fudge + (off_t)dataAO, 0) == -1) goto bail_out;
+	getABIint2(fp, 0, 0, 0, read->traceA, read->NPoints);
+	
+	/* Read in the G trace */
+	if (fseek(fp, header_fudge + (off_t)dataGO, 0) == -1) goto bail_out;
+	getABIint2(fp, 0, 0, 0, read->traceG, read->NPoints);
+	
+	/* Read in the T trace */
+	if (fseek(fp, header_fudge + (off_t)dataTO, 0) == -1) goto bail_out;
+	getABIint2(fp, 0, 0, 0, read->traceT, read->NPoints);
+	
+	/* Compute highest trace peak */
+	for (i=0; i < read->NPoints; i++) {
+	    if (read->maxTraceVal < read->traceA[i])
+		read->maxTraceVal = read->traceA[i];
+	    if (read->maxTraceVal < read->traceC[i])
+		read->maxTraceVal = read->traceC[i];
+	    if (read->maxTraceVal < read->traceG[i])
+		read->maxTraceVal = read->traceG[i];
+	    if (read->maxTraceVal < read->traceT[i])
+		read->maxTraceVal = read->traceT[i];
+	}
+    }
+    
+    if (no_bases || !(sections & READ_BASES))
+	goto skip_bases;
+
+    /* Read in base confidence values */
+    if (!(conf = (uint_1 *)xcalloc(sizeof(*conf), read->NBases)))
+	goto bail_out;
+    getABIint1(fp, indexO, BaseConfLabel, 1, conf, read->NBases);
+
+    /* Read in the bases */
+    if (!(getABIIndexEntryLW(fp, (off_t)indexO, BaseEntryLabel, 1, 5, &baseO)
+	  && (fseek(fp, header_fudge + (off_t)baseO, 0) == 0) ))
+	goto bail_out;
+
+    for (i = 0; i < (read->NBases); i++) {
+	int ch;
+	
+	if ((ch = fgetc(fp)) == EOF)
+	    goto bail_out;
+
+	read->base[i] = (ch == 'N') ? '-' : (char)ch;
+	switch(read->base[i]) {
+	case 'A':
+	case 'a':
+	    read->prob_A[i] = conf[i];
+	    read->prob_C[i] = 0;
+	    read->prob_G[i] = 0;
+	    read->prob_T[i] = 0;
+	    break;
+
+	case 'C':
+	case 'c':
+	    read->prob_A[i] = 0;
+	    read->prob_C[i] = conf[i];
+	    read->prob_G[i] = 0;
+	    read->prob_T[i] = 0;
+	    break;
+
+	case 'G':
+	case 'g':
+	    read->prob_A[i] = 0;
+	    read->prob_C[i] = 0;
+	    read->prob_G[i] = conf[i];
+	    read->prob_T[i] = 0;
+	    break;
+
+	case 'T':
+	case 't':
+	    read->prob_A[i] = 0;
+	    read->prob_C[i] = 0;
+	    read->prob_G[i] = 0;
+	    read->prob_T[i] = conf[i];
+	    break;
+
+	default:
+	    read->prob_A[i] = 0;
+	    read->prob_C[i] = 0;
+	    read->prob_G[i] = 0;
+	    read->prob_T[i] = 0;
+	    break;
+	} 
+    }
+    read->base[i] = 0;
+    xfree(conf);
+    
+   
+    /* Read in the base positions */
+    if (-1 == getABIint2(fp, indexO, BasePosEntryLabel, 1, read->basePos,
+			 read->NBases))
+	goto bail_out;
+
+    /*
+     * Check for corrupted traces where the bases are positioned on sample
+     * coordinates which do not exist. Witnessed on some MegaBACE files.
+     */
+    if (read->basePos[read->NBases-1] > read->NPoints) {
+	int n = read->basePos[read->NBases-1]+1;
+	read->traceA = (TRACE *)xrealloc(read->traceA, n * sizeof(TRACE));
+	read->traceC = (TRACE *)xrealloc(read->traceC, n * sizeof(TRACE));
+	read->traceG = (TRACE *)xrealloc(read->traceG, n * sizeof(TRACE));
+	read->traceT = (TRACE *)xrealloc(read->traceT, n * sizeof(TRACE));
+
+	if (read->traceA == NULL || read->traceC == NULL ||
+	    read->traceC == NULL || read->traceG == NULL)
+	    goto bail_out;
+
+	for (i = read->NPoints; i < n; i++) {
+	    read->traceA[i] = 0;
+	    read->traceC[i] = 0;
+	    read->traceG[i] = 0;
+	    read->traceT[i] = 0;
+	}
+	read->NPoints = n;
+    }
+
+ skip_bases:
+    
+    
+    /*************************************************************
+     * Gather useful information - the comments field
+     *************************************************************/
+    if (sections & READ_COMMENTS) {
+	char buffer[257];
+	char comment[8192], line[8192];
+	char commstr[256], *commstrp;
+	int clen;
+	int_4 spacing;
+	uint_2 i2;
+	uint_4 i4;
+	
+	*comment = '\0';
+
+	/* The ABI comments */
+	clen = getABIString(fp, indexO, CMNTLabel, 1, commstr);
+	if (clen != -1) {
+	    char *p;
+
+	    commstr[clen] = 0;
+	    commstrp = commstr;
+
+	    do {
+		char line[300];
+		
+		if (p = strchr(commstrp, '\n'))
+		    *p++ = 0;
+		
+		sprintf(line, "COMM=%s\n", commstrp);
+		strcat(comment, line);
+	    } while(commstrp = p);
+	}
+
+	
+	/* Get Sample Name Offset */
+	if (-1 != getABIString(fp, indexO, SMPLLabel, 1, buffer)) {
+	    replace_nl(buffer);
+	    sprintf(line, "NAME=%s\n", buffer);
+	    strcat(comment, line);
+	}
+	
+	/* LANE */
+	if (-1 != getABIint2(fp, indexO, LANELabel, 1, &i2, 1)) {
+	    sprintf(line, "LANE=%d\n", i2);
+	    strcat(comment, line);
+	}
+
+	/* Get Signal Strength Offset */
+	if (getABIIndexEntryLW(fp, (off_t)indexO, SignalEntryLabel, 1, 5,
+			       &signalO)) {
+	    int_2 C,A,G,T;
+	    int_2 *base[4];
+	    base[0] = &C;
+	    base[1] = &A;
+	    base[2] = &G;
+	    base[3] = &T;
+
+	    if (fseek(fp, header_fudge + (off_t)signalO, 0) != -1 &&
+		be_read_int_2(fp, (uint_2 *)
+			      base[baseIndex((char)(fwo_>>24&255))]) &&
+		be_read_int_2(fp, (uint_2 *)
+			      base[baseIndex((char)(fwo_>>16&255))]) &&
+		be_read_int_2(fp, (uint_2 *)
+			      base[baseIndex((char)(fwo_>>8&255))]) &&
+		be_read_int_2(fp, (uint_2 *)
+			      base[baseIndex((char)(fwo_&255))])) {
+		sprintf(line, "SIGN=A=%d,C=%d,G=%d,T=%d\n",
+			A, C, G, T);
+		strcat(comment, line);
+	    }
+	}
+
+	/* Get the spacing.. it's a float but don't worry yet */
+	fspacing = 0;
+	if (-1 != getABIint4(fp, indexO, SpacingEntryLabel, 1,
+			     (uint_4 *)&spacing, 1)) {
+	    fspacing = int_to_float(spacing);
+	    sprintf(line, "SPAC=%-6.2f\n", fspacing);
+	    strcat(comment, line);
+	}
+	/* Correction for when spacing is negative. Why does this happen? */
+	if (fspacing <= 0) {
+	    if (read->NBases > 1) {
+		if (sections & READ_BASES)
+		    fspacing = (float)(read->basePos[read->NBases-1] -
+				       read->basePos[0])
+			/ (float) (read->NBases-1);
+		else
+		    fspacing = (float) read->NPoints / (float) read->NBases;
+	    } else {
+		fspacing = 1;
+	    }
+	}
+
+	
+	/* Get primer position */
+	if (getABIIndexEntryLW(fp, (off_t)indexO, PPOSLabel, 1, 5,
+			       (uint_4 *)&i4)) {
+	    /* ppos stores in MBShort of pointer */
+	    sprintf(line, "PRIM=%d\n", (i4>>16));
+	    strcat(comment, line);
+	}
+
+	/* RUND/RUNT */
+	if (getABIIndexEntryLW(fp, (off_t)indexO, RUNDLabel, 1, 5, &offset) &&
+	    getABIIndexEntryLW(fp, (off_t)indexO, RUNDLabel, 2, 5, &offset2) &&
+	    getABIIndexEntryLW(fp, (off_t)indexO, RUNTLabel, 1, 5, &offset3) &&
+	    getABIIndexEntryLW(fp, (off_t)indexO, RUNTLabel, 2, 5, &offset4)) {
+	    char buffer[1025];
+	    char buffer_s[1025];
+	    char buffer_e[1025];
+	    struct tm t;
+	    uint_4 rund_s, rund_e, runt_s, runt_e;
+
+	    rund_s = offset;
+	    rund_e = offset2;
+	    runt_s = offset3;
+	    runt_e = offset4;
+
+	    sprintf(buffer, "%04d%02d%02d.%02d%02d%02d - %04d%02d%02d.%02d%02d%02d",
+		    rund_s >> 16, (rund_s >> 8) & 0xff, rund_s & 0xff,
+		    runt_s >> 24, (runt_s >> 16) & 0xff, (runt_s >> 8) & 0xff,
+		    rund_e >> 16, (rund_e >> 8) & 0xff, rund_e & 0xff,
+		    runt_e >> 24, (runt_e >> 16) & 0xff, (runt_e >> 8) & 0xff);
+
+	    memset(&t, 0, sizeof(t));
+	    t.tm_mday = rund_s & 0xff;
+	    t.tm_mon = ((rund_s >> 8) & 0xff) - 1;
+	    t.tm_year = (rund_s >> 16) - 1900;
+	    t.tm_hour = runt_s >> 24;
+	    t.tm_min = (runt_s >> 16) & 0xff;
+	    t.tm_sec = (runt_s >> 8) & 0xff;
+	    t.tm_isdst = -1;
+	    /*
+	     * Convert struct tm to time_t. We ignore the time_t value, but
+	     * the conversion process will update the tm_wday element of
+	     * struct tm.
+	     */
+	    mktime(&t);
+	    strftime(buffer_s, 1024, "%a %d %b %H:%M:%S %Y", &t);
+
+	    t.tm_mday = rund_e & 0xff;
+	    t.tm_mon = ((rund_e >> 8) & 0xff) - 1;
+	    t.tm_year = (rund_e >> 16) - 1900;
+	    t.tm_hour = runt_e >> 24;
+	    t.tm_min = (runt_e >> 16) & 0xff;
+	    t.tm_sec = (runt_e >> 8) & 0xff;
+	    t.tm_isdst = -1;
+	    /*
+	     * Convert struct tm to time_t. We ignore the time_t value, but
+	     * the conversion process will update the tm_wday element of
+	     * struct tm.
+	     */
+	    mktime(&t);
+	    strftime(buffer_e, 1024, "%a %d %b %H:%M:%S %Y", &t);
+
+	    sprintf(line, "DATE=%s to %s\nRUND=%s\n",
+		    buffer_s, buffer_e, buffer);
+	    strcat(comment, line);
+	}
+
+
+	/* Get Dye Primer Offset */
+	if (-1 != getABIString(fp, indexO, PDMFLabel, 1, buffer)) {
+	    replace_nl(buffer);
+	    sprintf(line, "DYEP=%s\n", buffer);
+	    strcat(comment, line);
+	}
+
+	/* Get Machine Name Offset */
+	if (-1 != getABIString(fp, indexO, MCHNLabel, 1, buffer)) {
+	    replace_nl(buffer);
+	    sprintf(line, "MACH=%s\n", buffer);
+	    strcat(comment, line);
+	}
+
+	/* Machine model */
+	if (-1 != getABIString(fp, indexO, MODLLabel, 1, buffer)) {
+	    replace_nl(buffer);
+	    sprintf(line, "MODL=%s\n", buffer);
+	    strcat(comment, line);
+	}
+
+	/* Matrix file */
+	if (-1 != getABIString(fp, indexO, MTXFLabel, 1, buffer)) {
+	    replace_nl(buffer);
+	    sprintf(line, "MTXF=%s\n", buffer);
+	    strcat(comment, line);
+	}
+
+	/* Base calling version */
+	if (-1 != getABIString(fp, indexO, SPACLabel, 2, buffer)) {
+	    replace_nl(buffer);
+	    sprintf(line, "BCAL=%s\n", buffer);
+	    strcat(comment, line);
+	}
+
+	/* Software versions */
+	if (-1 != getABIString(fp, indexO, SVERLabel, 1, buffer)) {
+	    replace_nl(buffer);
+	    sprintf(line, "VER1=%s\n", buffer);
+	    strcat(comment, line);
+	}
+	if (-1 != getABIString(fp, indexO, SVERLabel, 2, buffer)) {
+	    replace_nl(buffer);
+	    sprintf(line, "VER2=%s\n", buffer);
+	    strcat(comment, line);
+	}
+
+	/* Get Gel Name Offset */
+	if (-1 != getABIString(fp, indexO, GelNameLabel, 1, buffer)) {
+	    replace_nl(buffer);
+	    sprintf(line, "GELN=%s\n", buffer);
+	    strcat(comment, line);
+	}
+
+	/* dumplicate string and set info */
+	{
+	    char *s = (char *)xmalloc(strlen(comment)+1);
+	    strcpy(s,comment);
+	    read->info = s;
+	}
+    }
+
+
+
+    /*************************************************************
+     * Check base positions are in order
+     *************************************************************/
+#if 0
+    /*
+     * Disable for now as the original ABI bug this is meant to fix shouldn't 
+     * happen any more, and this has the effect of reordering bases where there
+     * are compressions (which is wrong to do).
+     */
+    if (sections & READ_SAMPLES) {
+	float pos;
+	int start;
+
+	for (i = 1; i < read->NBases; ) {
+	    if (read->basePos[i] < read->basePos[i-1]) {
+		fprintf(stderr,"fread_abi(): Base positions are not in order. Fixing (%d=%d, %d=%d)\n", i-1, read->basePos[i-1], i, read->basePos[i]);
+
+		/* pass 1 - find end of region */
+		start = i - 1;
+		pos = (float) read->basePos[i-1] + fspacing;
+		for(;i < read->NBases && (int)read->basePos[i] < pos;i++) {
+		    pos += fspacing;
+		}
+
+		/* calculate average base spacing */
+		if (i < read->NBases )
+		    fspacing = ((float) read->basePos[i] -
+				(float) read->basePos[start]) /
+				    (float)(i - start);
+
+		/* pass 2 - adjust */
+		i = start + 1;
+		pos = (float) read->basePos[i-1] + fspacing;
+		for(;i < read->NBases && (int)read->basePos[i] < pos;i++) {
+		    read->basePos[i] = (int) pos;
+		    pos += fspacing;
+		}
+
+	    } else {
+		i++;
+	    }
+	}
+    }
+#endif
+
+    
+    /* SUCCESS */
+
+    read->format = TT_ABI;
+    return(read);
+
+    /* FAILURE */
+ bail_out:
+    if (read)
+	read_deallocate(read);
+
+    return NULLRead;
+}
+
+/*
+ * Read the ABI format sequence from file 'fn' into a Read structure.
+ * All printing characters (as defined by ANSII C `isprint')
+ * are accepted, but `N's are translated to `-'s. In this respect we
+ * are adhering (more or less) to the CSET_DEFAULT uncertainty code set.
+ * 
+ * Returns:
+ *   Read *	- Success, the Read structure read.
+ *   NULLRead	- Failure.
+ */
+Read *read_abi(char *fn) {
+    Read *read;
+    FILE *fp;
+
+    /* Open file */
+    if ((fp = fopen(fn, "rb")) == NULL)
+	return NULLRead;
+
+    read = fread_abi(fp);
+    fclose(fp);
+
+    if (read && (read->trace_name = (char *)xmalloc(strlen(fn)+1)))
+	strcpy(read->trace_name, fn);
+
+    return read;
+}
+    
+/*
+ * Write to an ABI file - unsupported.
+ */
+/* ARGSUSED */
+int write_abi(char *fn, Read *read) {
+    fprintf(stderr, "ABI write support is unavailable\n");
+    return -1;
+}
+
+/*
+ * Write to an ABI file - unsupported.
+ */
+/* ARGSUSED */
+int fwrite_abi(FILE *fp, Read *read) {
+    fprintf(stderr, "ABI write support is unavailable\n");
+    return -1;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/seqIOABI.h	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,155 @@
+/*
+ * Copyright (c) Medical Research Council 1994. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+#ifndef _seqIOABI_h_
+#define _seqIOABI_h_
+
+#include <sys/types.h> /* off_t */
+#include "io_lib/os.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * The ABI magic number - "ABIF"
+ */
+#define ABI_MAGIC	((int_4) ((((('A'<<8)+'B')<<8)+'I')<<8)+'F')
+
+/*
+ * The index is located towards the end of the ABI trace file.
+ * It's location is given by a longword at a fixed place.
+ */
+#define IndexPO ((off_t)26)
+
+#define IndexEntryLength 28
+
+/*
+ * Here are some labels we will be looking for, four chars packed
+ * into an int_4
+ */
+#define LABEL(a) ((int_4) ((((((a)[0]<<8)+(a)[1])<<8)+(a)[2])<<8)+(a)[3])
+#define DataEntryLabel    LABEL("DATA")
+#define BaseEntryLabel    LABEL("PBAS")
+#define BasePosEntryLabel LABEL("PLOC")
+#define SpacingEntryLabel LABEL("SPAC")
+#define SignalEntryLabel  LABEL("S/N%")
+#define FWO_Label         LABEL("FWO_")
+#define MCHNLabel         LABEL("MCHN")
+#define PDMFLabel         LABEL("PDMF")
+#define SMPLLabel         LABEL("SMPL")
+#define PPOSLabel         LABEL("PPOS")
+#define CMNTLabel         LABEL("CMNT")
+#define GelNameLabel      LABEL("GELN")
+#define LANELabel         LABEL("LANE")
+#define RUNDLabel         LABEL("RUND")
+#define RUNTLabel         LABEL("RUNT")
+#define MTXFLabel         LABEL("MTXF")
+#define SPACLabel         LABEL("SPAC")
+#define SVERLabel         LABEL("SVER")
+#define MODLLabel         LABEL("MODL")
+#define BaseConfLabel	  LABEL("PCON")
+
+
+/*
+ * From the ABI results file connected to `fp' whose index starts
+ * at byte offset `indexO', return in `val' the `lw'th long word
+ * from the `count'th entry labelled `label'.
+ * The result is 0 for failure, or index offset for success.
+ */
+int getABIIndexEntryLW(FILE *fp, off_t indexO,
+		       uint_4 label, uint_4 count, int lw,
+		       uint_4 *val);
+
+/*
+ * From the ABI results file connected to `fp' whose index starts
+ * at byte offset `indexO', return in `val' the `sw'th short word
+ * from the `count'th entry labelled `label'.
+ * The result is 0 for failure, or index offset for success.
+ */
+int getABIIndexEntrySW(FILE *fp, off_t indexO,
+		       uint_4 label, uint_4 count, int sw,
+		       uint_2 *val);
+
+/*
+ * Gets the offset of the ABI index.
+ * Returns -1 for failure, 0 for success.
+ */
+int getABIIndexOffset(FILE *fp, uint_4 *indexO);
+
+/*
+ * Get an "ABI String". These strings are either pointed to by the index
+ * offset, or held in the offset itself when the string is <= 4 characters.
+ * The first byte of the string determines its length.
+ * 'string' is a buffer 256 characters long.
+ *
+ * Returns -1 for failure, string length for success.
+ */
+int getABIString(FILE *fp, off_t indexO, uint_4 label, uint_4 count,
+		 char *string);
+
+/*
+ * Get an "ABI Int_1". This is raw 1-byte integer data pointed to by the
+ * offset, or held in the offset itself when the data is <= 4 characters.
+ *
+ * If indexO is 0 then we do not search for (or indeed use) label and count,
+ * but simply assume that we are already at the correct offset and read from
+ * here. (NB: This negates the length <= 4 check.)
+ *
+ * Returns -1 for failure, length desired for success (it'll only fill out
+ * up to max_data_len elements, but it gives an indication of whether there
+ * was more to come).
+ */
+int getABIint1(FILE *fp, off_t indexO, uint_4 label, uint_4 count,
+	       uint_1 *data, int max_data_len);
+
+/*
+ * Get an "ABI Int_2". This is raw 2-byte integer data pointed to by the
+ * offset, or held in the offset itself when the data is <= 4 characters.
+ *
+ * Returns -1 for failure, length desired for success (it'll only fill out
+ * up to max_data_len elements, but it gives an indication of whether there
+ * was more to come).
+ */
+int getABIint2(FILE *fp, off_t indexO, uint_4 label, uint_4 count,
+	       uint_2 *data, int max_data_len);
+
+/*
+ * Get an "ABI Int_4". This is raw 4-byte integer data pointed to by the
+ * offset, or held in the offset itself when the data is <= 4 characters.
+ *
+ * Returns -1 for failure, length desired for success (it'll only fill out
+ * up to max_data_len elements, but it gives an indication of whether there
+ * was more to come).
+ */
+int getABIint4(FILE *fp, off_t indexO, uint_4 label, uint_4 count,
+	       uint_4 *data, int max_data_len);
+
+int dump_labels(FILE *fp, off_t indexO);
+
+/*
+ * Change the DATA counts for fetching traces
+ */
+void abi_set_data_counts(int f, int w, int o, int _);
+
+/*
+ * Put the DATA counts back to their defaults.
+ */
+void abi_reset_data_counts(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _seqIOABI_h_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/seqIOALF.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,424 @@
+/*
+ * Copyright (c) Medical Research Council 1994. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+/* 
+ * Title:       seqIOALF
+ *
+ * File: 	 seqIOALF.c
+ * Purpose:	 IO of ALF sequences
+ * Last update:  9th September 1994
+ */
+
+/*
+ * Change Log :- 
+ * 14.01.91 SD
+ * when complimenting the sequence with an odd number of bases,
+ * the middle base position was not adjusted.
+ * 15.01.91 SD  Put StLouis stuff on compilation flag
+ * 15.01.91 SD  New include file (opp.h)
+ * 02.08.91 SD  Changes the mapping of uncertainty codes so that we
+ * now only generate A C G T and -
+ * Previously... bug in interpreting ALF integer fields.
+ * We now treat them as unsigned.
+ * 17.09.91 LFW changed STLOUIS compilation flag to SAVE_EDITS
+ * and AUTO_CLIP
+ * 25.10.91 SD  Machine independant I/O...removed BIGENDIAN flag
+ * 25.11.91 SD There was a hard limit (of 1024) for allocation of
+ * space for number of bases, yet program would 
+ * read in more if there were any, causing nasties to happen.
+ * 
+ * 11.11.92 LFW added section to actually check that the trace it
+ * is trying to open is an ALF file using traceType sub
+ * 
+ * 10.11.92 SD  SCF comments now stored in seq data structure
+ * 09.09.94 JKB Update to use Read instead of Seq library.
+ * 04.03.98 JKB Look for "Raw data" when "Processed data" is not found.
+ */
+
+/* RMD I made substantial changes to this file 12/28/90 so as to
+ * read sequence data more freely (necessary when reading data from
+ * multiple trace files).
+ * The affected area is indicated by comments starting RMD, like
+ * this one.
+ */
+
+/* This file was adapted by LFW from seqIOABI.c.
+ * The ALF results file is a concatenation of many files with an
+ * index structure at the beginning, consisting of a 512 byte
+ * block that we ignore, followed by 128 byte blocks describing
+ * each file.  All files, including the header region, are rounded 
+ * up to a multiple of 512 bytes long.  
+ * The getIndexEntry routines identify the 128 byte index component
+ * of interest by matching 4 chars of its ASCII label, then extract
+ * the field of choice from that entry.
+ * 
+ * Note that the SUN and PC are of opposite endian-ness, so that
+ * we have to provide special routines to read words and longwords
+ * from the results file.  Luckily the floating point numbers are
+ * written out in ASCII.
+ */
+
+
+/* ---- Imports ---- */
+
+
+#include <ctype.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "io_lib/stdio_hack.h"
+
+#include "io_lib/Read.h"
+#include "io_lib/mach-io.h"
+#include "io_lib/xalloc.h"
+
+/* ---- Constants ---- */
+
+#define BasesPerLine 50 /* For output formatting */
+
+#define IndexEntryLength ((off_t)128)
+
+
+/*
+ * Here are some labels we will be looking for, four chars packed
+ * into a long word.
+ */
+#define EntryLabel        ((uint_4) ((((('A'<<8)+'L')<<8)+'F')<<8)+' ')
+#define BaseEntryLabel    ((uint_4) ((((('S'<<8)+'e')<<8)+'q')<<8)+'u')
+#define DataEntryLabel    ((uint_4) ((((('P'<<8)+'r')<<8)+'o')<<8)+'c')
+#define RawDataEntryLabel ((uint_4) ((((('R'<<8)+'a')<<8)+'w')<<8)+' ')
+
+/* RMD make enough space for bases - hard limit */
+#define BASELIMIT 4096
+
+
+/* ---- Internal functions ---- */
+
+/*
+ * From the ALF results file connected to `fp' whose index starts
+ * at byte offset `indexO', return in `val' the `lw'th long word
+ * from the entry labelled `label'.
+ * The result is 0 for failure, 1 for success.
+ */
+static int getIndexEntryLW(FILE *fp, off_t indexO,
+			   uint_4 label, int lw,
+			   uint_4 *val) {
+    off_t entryNum=-1;
+    int i;
+    uint_4 entryLabel;
+    
+    do {
+	entryNum++;
+	if (fseek(fp, indexO+(entryNum*IndexEntryLength), 0) != 0) 
+	    return 0;
+	    
+	if (!be_read_int_4(fp, &entryLabel))
+	    return 0;
+    } while (!(entryLabel == label));
+    
+    for(i=2; i<lw; i++)
+	if (!be_read_int_4(fp, val))
+	    return 0;
+    
+    
+    /* when i = lw read in the 4 bytes backwards */
+    if (!le_read_int_4(fp,val))
+	return 0;
+    
+    return 1;
+}
+
+/*
+ * From the ALF results file connected to `fp' whose index starts
+ * at byte offset `indexO', return in `val' the `lw'th  word (int2)
+ * from the entry labelled `label'.
+ * The result is 0 for failure, 1 for success.
+ */
+static int getIndexEntryW(FILE *fp, off_t indexO,
+			  uint_4 label, int lw,
+			  uint_2 *val) {
+    off_t entryNum=-1;
+    int i;
+    uint_4 entryLabel;
+    uint_4 jval;
+    
+    do {
+	entryNum++;
+	if (fseek(fp, indexO+(entryNum*IndexEntryLength), 0) != 0)
+	    return 0;
+
+	if (!be_read_int_4(fp, &entryLabel))
+	    return 0;
+	} while (!(entryLabel == label));
+    
+    
+    for(i=2; i<lw; i++)
+	if (!be_read_int_4(fp, &jval))
+	    return 0;
+
+    if (!le_read_int_2(fp, val))
+	return 0;
+    
+    return 1;
+}
+
+
+/* ---- Exports ---- */
+
+
+/*
+ * Read the ALF format sequence from FILE *fp into a Read structure.
+ * All printing characters (as defined by ANSII C `isprint')
+ * are accepted, but `N's are translated to `-'s. In this respect we
+ * are adhering (more or less) to the CSET_DEFAULT uncertainty code set.
+ * 
+ * Returns:
+ *   Read *	- Success, the Read structure read.
+ *   NULLRead	- Failure.
+ */
+Read *fread_alf(FILE *fp) {
+    Read *read = NULLRead;
+    int i;
+    int numPoints;
+    int sections = read_sections(0);
+    
+    uint_4 data_size;
+    uint_4 dataO;
+    uint_4 header_size=396; /* size of the header of the processed data
+			       section */
+    uint_2 actBaseDataSize; /* actual number of bytes of data of information
+			       containing the base and basePos information */
+    int num_points;         /* keeps track of the actual number of points,
+			       rather than the early guess of numPoints */
+
+    off_t indexO;           /* File offset where the index is */
+    uint_4 baseO;           /* File offset where the bases are stored */
+    
+    
+    /*
+     * RMD lots of changes below here until end of data reading section
+     * Some are cosmetic.
+     * getIndexEntry calls in front of where they were needed, and made
+     * There is a substantive change to the inner loop of the sequence
+     * reading section.  This now uses fscanf - much less rigid than the
+     * previous scheme.  Note that it reads bp as a float.  This is because
+     * it is a float in multiple trace data files! (bizarre Pharmacia
+     * programming!).
+     */
+    
+    
+    /*************************************************************
+     * Read the various file offsets
+     *************************************************************/
+
+    /* indexO is the offset of the index.
+     * Or I could look for the first label, starting 'ALF'
+     * if I used 512 then none of the entries are on long 
+     * word boundaries
+     */
+    indexO = 522;
+    
+    /* offset in file of first base of sequence */
+    if (! (getIndexEntryLW(fp,indexO,BaseEntryLabel,12,&baseO)) )
+	goto bail_out;
+    
+    /* actual size of region containing this data */
+    if (! (getIndexEntryW(fp,indexO,BaseEntryLabel,10,&actBaseDataSize)) )
+	goto bail_out;
+    
+    /* Look for Processed data first. If we fail to find it, then look for
+     * the Raw data (same format).
+     */
+
+    /* offset in file to start of processed data segment - there 
+     * is then a header of size header_size (currently 396)
+     */
+    if (! (getIndexEntryLW(fp,indexO,DataEntryLabel,12,&dataO)) ) {
+	if (! (getIndexEntryLW(fp,indexO,RawDataEntryLabel,12,&dataO)) )
+	    goto bail_out;
+
+	/* actual size of region containing this data */
+	if (! (getIndexEntryLW(fp,indexO,RawDataEntryLabel,10,&data_size)) )
+	    goto bail_out;
+    } else {
+	/* actual size of region containing this data */
+	if (! (getIndexEntryLW(fp,indexO,DataEntryLabel,10,&data_size)) )
+	    goto bail_out;
+    }
+    
+    /* Because each trace value is stored in a 2 byte
+     * integer, thus to store A C G T information
+     * it takes 8 bytes.  So subtract off the header and
+     * divide by 8
+     */
+    numPoints = (int)((data_size - header_size)/ 8); 
+    
+    /* Allocate the sequence */
+    if (NULLRead == (read = read_allocate(numPoints, BASELIMIT)))
+	goto bail_out;
+    
+    /*************************************************************
+     * Read the bases information
+     *************************************************************/
+    if (sections & READ_BASES) {
+	/* new locals introduced by LFW and/or RMD for the ALF */
+	int numBases;	/* number of nucleotides read in */
+	float bp;
+	char ch;
+
+	if (!(fseek(fp, (off_t)baseO, 0) == 0))
+	    goto bail_out;
+	
+	for (numBases = 0; (unsigned)ftell(fp) < baseO+(unsigned short)actBaseDataSize
+	                   && numBases<BASELIMIT;) {
+	    char line[200];
+
+	    fgets(line, (int)sizeof(line), fp);
+	    sscanf(line, "%c %*d %f", &ch, &bp);
+	    
+	    /* we convert ch to Staden format here */
+	    switch (ch) {
+	    case 'A':
+	    case 'C':
+	    case 'G':
+	    case 'T':
+		break;
+	    default:
+		ch = '-';
+/*
+		if (isupper(ch))
+		    ch = '-';
+		else
+		    ch = '\0';
+*/
+	    }
+	    
+	    if (ch) {
+		read->base[numBases]    = ch;
+		read->prob_A[numBases]	= 0;
+		read->prob_C[numBases]	= 0;
+		read->prob_G[numBases]	= 0;
+		read->prob_T[numBases]	= 0;
+		read->basePos[numBases] = bp;
+		++numBases;
+	    }
+	}
+	read->base[numBases] = 0;
+	
+	read->NBases  = numBases;
+    }
+    
+    /*************************************************************
+     * Read the trace information
+     *************************************************************/
+    
+    if (sections & READ_SAMPLES) {
+	
+	/*
+	 * Traces are stored as 2 byte integers in records in the order of
+	 * A C G T A C G T ...
+	 */
+	
+	if (fseek(fp, (off_t)(dataO+header_size), 0) != 0) 
+	    goto bail_out;
+	
+	num_points = 0;
+	
+	for (i=0; i < read->NPoints; i++) {
+	    if (!le_read_int_2(fp, &(read->traceA[i])))
+		goto bail_out;
+	    if (read->maxTraceVal < read->traceA[i])
+		read->maxTraceVal = read->traceA[i];
+	    
+	    if (!le_read_int_2(fp, &(read->traceC[i])))
+		goto bail_out;
+	    if (read->maxTraceVal < read->traceC[i])
+		read->maxTraceVal = read->traceC[i];
+	    
+	    if (!le_read_int_2(fp, &(read->traceG[i])))
+		goto bail_out;
+	    if (read->maxTraceVal < read->traceG[i])
+		read->maxTraceVal = read->traceG[i];
+	    
+	    if (!le_read_int_2(fp, &(read->traceT[i])))
+		goto bail_out;
+	    if (read->maxTraceVal < read->traceT[i])
+		read->maxTraceVal = read->traceT[i];
+	    
+	    if (read->traceA[i]==0 && read->traceT[i]==0 &&
+		read->traceC[i]==0 && read->traceG[i]==0 &&
+		i > (numPoints-64))
+		break;
+	    
+	    num_points++;
+	}
+    }
+    
+    /* SUCCESS */
+
+    read->format = TT_ALF;
+    return(read);
+
+    /* FAILURE */
+ bail_out:
+    if (read)
+	read_deallocate(read);
+
+    return NULLRead;
+}
+
+/*
+ * Read the ALF format sequence with name `fn' into a Read structure.
+ * All printing characters (as defined by ANSII C `isprint')
+ * are accepted, but `N's are translated to `-'s. In this respect we
+ * are adhering (more or less) to the CSET_DEFAULT uncertainty code set.
+ * 
+ * Returns:
+ *   Read *	- Success, the Read structure read.
+ *   NULLRead	- Failure.
+ */
+Read *read_alf(char *fn) {
+    FILE *fp;
+    Read *read;
+
+    /* Open file */
+    if ((fp = fopen(fn, "rb")) == NULL)
+	return NULLRead;
+
+    read = fread_alf(fp);
+    fclose(fp);
+
+    if (read && (read->trace_name = (char *)xmalloc(strlen(fn)+1)))
+	strcpy(read->trace_name, fn);
+
+    return read;
+}
+
+/*
+ * Write to an ALF file - unsupported.
+ */
+/* ARGSUSED */
+int write_alf(char *fn, Read *read) {
+    fprintf(stderr, "ALF write support is unavailable\n");
+    return -1;
+}
+
+/*
+ * Write to an ALF file - unsupported.
+ */
+/* ARGSUSED */
+int fwrite_alf(FILE *fp, Read *read) {
+    fprintf(stderr, "ALF write support is unavailable\n");
+    return -1;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/seqIOCTF.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,88 @@
+/* 
+ * Title:       seqIOCTF
+ * 
+ * File: 	seqIOCTF.c
+ * Purpose:	Reading/writing of CTF sequences
+ * Last update: March 2000
+ *
+ * Change log:
+ * Created mieg, march 2000, importing code from wabi/ctftrace.c
+ */
+
+
+/* ---- Imports ---- */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <string.h>
+
+#include "io_lib/Read.h"
+#include "io_lib/seqIOCTF.h"
+#include "io_lib/abi.h"
+#include "io_lib/mach-io.h"
+#include "io_lib/xalloc.h"
+#include "io_lib/stdio_hack.h"
+
+/* ---- Constants ---- */
+
+/*
+ * Read the CTF format sequence from FILE *fp into a Read structure.
+
+ * Returns:
+ *   Read *	- Success, the Read structure read.
+ *   NULLRead	- Failure.
+ */
+Read *fread_ctf (FILE *fp) {
+    Read *read = ctfFRead (fp) ;
+
+    return read ;
+}
+
+/*
+ * Read the CTF format sequence from file 'fn' into a Read structure.
+ */
+
+Read *read_ctf (char *fn) {
+    Read *read;
+    FILE *fp;
+
+    /* Open file */
+    if ((fp = fopen(fn, "rb")) == NULL)
+	return NULLRead;
+
+    read = fread_ctf(fp);
+    fclose(fp);
+
+    if (read && (read->trace_name = (char *)xmalloc(strlen(fn)+1)))
+	strcpy(read->trace_name, fn);
+
+    return read;
+}
+    
+
+/*
+ * Write to an CTF file - unsupported.
+ */
+/* ARGSUSED */
+int fwrite_ctf (FILE *fp, Read *read) {
+  return ctfFWrite (fp, read) ;
+}
+
+/*
+ * Write to an CTF file 
+ */
+/* ARGSUSED */
+int write_ctf(char *fn, Read *read) {
+  FILE *fp;
+  
+  /* Open file */
+  if ((fp = fopen(fn, "wb")) == NULL)
+    return -1 ;
+  
+  fwrite_ctf (fp, read) ;
+  fclose(fp);
+
+  return 0 ;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/seqIOCTF.h	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,32 @@
+#ifndef _seqIOCTF_h_
+#define _seqIOCTF_h_
+
+#include "io_lib/Read.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+Read *ctfFRead (mFILE *ff) ;
+int ctfFWrite (mFILE *ff, Read *read) ;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _seqIOCTF_h_ */
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/seqIOPlain.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,263 @@
+/*
+ * Copyright (c) Medical Research Council 1994. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+/* 
+  Title:       seqIOPlain
+  
+  File: 	 seqIOPlain.c
+  Purpose:	 IO of plain sequences
+  Last update: Tuesday Jan 15 1991
+  
+  Change log:
+  
+  28.11.90 SD  put undesirables under STLOUIS compilation flag
+  15.01.91 SD  new include file (opp.h)
+  17.09.91 LFW changed STLOUIS compilation flag to SAVE_EDITS
+  and AUTO_CLIP
+  08.09.94 JKB Plain files now also uses the ';<' and ';>' lines.
+  09.09.94 JKB Update to use Read instead of Seq library.
+  01.06.07 JKB Supports single-read fasta files; about time too!
+  */
+
+
+#define LINE_LENGTH 60
+
+/*
+ * This module should be regarded as part of `read' since it is
+ * privy to the internal structure of `Read'.
+ *
+ * This library also requires use of the mach-io code for the endian
+ * independent machine IO.
+ *
+ * Any references to the writing or reading of edited sequences,
+ * or to the bottom strand were added by lfw
+ */
+
+
+
+
+/* ---- Imports ---- */
+
+#include <stdio.h>      /* IMPORT: fopen, fclose, fseek, ftell, fgetc */
+#include <ctype.h>      /* IMPORT: isprint */
+#include <string.h>
+
+#include "io_lib/misc.h"
+#include "io_lib/plain.h"
+#include "io_lib/Read.h"
+#include "io_lib/xalloc.h"
+#include "io_lib/traceType.h"
+
+#include "io_lib/stdio_hack.h"
+/* ---- Constants ---- */
+
+#define BasesPerLine 50 /* For output formatting */
+
+
+/* ---- Exports ---- */
+
+
+/*
+ * Read the plain format sequence from FILE *fp into a Read structure.
+ * All printing characters (as defined by ANSII C `isprint')
+ * are accepted, but `N's are translated to `-'s.
+ *
+ * Returns:
+ *   Read *     - Success, the Read structure read.
+ *   NULLRead   - Failure.
+ */
+Read *fread_pln(FILE *fp) {
+    Read *read = NULLRead;
+    off_t fileLen;
+    int  ch;
+    char *leftc, *rightc, *leftcp, *rightcp;
+    int first = 1;
+
+    /*
+     * Find the length of the file.
+     * Use this as an overestimate of the length of the sequence.
+     */
+    fseek(fp, (off_t) 0, 2);
+    if ((fileLen = ftell(fp)) > INT_MAX /*Was MAXINT2*/)
+	goto bail_out;
+
+    fseek(fp, (off_t) 0, 0);
+    
+    /* Allocate the sequence */
+    if (NULLRead == (read = read_allocate(0, fileLen)))
+	goto bail_out;
+
+    if (NULL == (leftc = (char *)xmalloc(fileLen)))
+	goto bail_out;
+
+    if (NULL == (rightc = (char *)xmalloc(fileLen)))
+	goto bail_out;
+
+    leftcp = leftc;
+    rightcp = rightc;
+
+    /* Read in the bases */
+    
+    read->NBases = 0;
+    read->format = TT_PLN;
+
+    while ((ch = fgetc(fp)) != EOF) {
+	if (ch == '>') {
+	    /* Fasta format file - skip the header and load the first
+	     * fasta sequence only. We don't even attempt to worry about
+	     * multi-sequence file formats for now.
+	     */
+	    if (!first)
+		break;
+
+	    while(ch != '\n' && ch != EOF)
+		ch = fgetc(fp);
+
+	}  else if (ch==';') {
+	    /*
+	     * ;< is left cutoff,
+	     * ;> is right cutoff.
+	     * Any other ';'s we can treat as a comments.
+	     */
+	    ch = fgetc(fp);
+
+	    if (first == 1 && ch != '<' && ch != '>') {
+		int d;
+		char type[5], name[17], line[1024];
+
+		line[0] = ch;
+		fgets(&line[1], 1022, fp);
+
+		if (5 == sscanf(line, "%6d%6d%6d%4c%s",
+				&d, &d, &d, type, name)) {
+		    char * p;
+
+		    if (p = strchr(type, ' '))
+			*p = 0;
+
+		    read->format = trace_type_str2int(type);
+		    read->trace_name = (char *)xmalloc(strlen(name)+1);
+		    if (read->trace_name)
+			strcpy(read->trace_name, name);
+		}
+	    }
+
+	    else if (ch == '<') {
+		ch = fgetc(fp);
+		while (ch != '\n') {
+		    *leftcp++ = ch;
+		    ch = fgetc(fp);
+		}
+	    } else if (ch == '>') {
+		ch = fgetc(fp);
+		while (ch != '\n') {
+		    *rightcp++ = ch;
+		    ch = fgetc(fp);
+		}
+	    } else {
+		while(ch != '\n' && ch != EOF)
+		    ch = fgetc(fp);
+	    }
+        } else if (isprint(ch) && !isspace(ch)) {
+	    read->base[read->NBases++] = ((ch)=='N') ? '-' : (ch);
+	}
+	
+	first = 0;
+    }
+
+    *leftcp = *rightcp = 0;
+
+    read->leftCutoff = strlen(leftc);
+    read->rightCutoff = read->leftCutoff + read->NBases + 1;
+    memmove(&read->base[read->leftCutoff], read->base, read->NBases);
+    memmove(read->base, leftc, read->leftCutoff);
+    memmove(&read->base[read->leftCutoff + read->NBases],
+	    rightc, strlen(rightc));
+
+    read->NBases += read->leftCutoff + strlen(rightc);
+    read->base[read->NBases] = 0;
+
+    xfree(leftc);
+    xfree(rightc);
+    
+    /* SUCCESS */
+    return(read);
+
+    /* FAILURE */
+ bail_out:
+    if (read)
+	read_deallocate(read);
+
+    return NULLRead;
+}
+
+/*
+ * Read the plain format sequence with name `fn' into a Read structure.
+ * All printing characters (as defined by ANSII C `isprint')
+ * are accepted, but `N's are translated to `-'s.
+ *
+ * Returns:
+ *   Read *     - Success, the Read structure read.
+ *   NULLRead   - Failure.
+ */
+Read *read_pln(char *fn) {
+    FILE *fp;
+    Read *read;
+
+    /* Open file */
+    if ((fp = fopen(fn, "r")) == NULL)
+	return NULLRead;
+
+    read = fread_pln(fp);
+    fclose(fp);
+
+    if (read && read->trace_name == NULL &&
+	(read->trace_name = (char *)xmalloc(strlen(fn)+1)))
+	strcpy(read->trace_name, fn);
+
+    return read;
+}
+
+
+/*
+ * Write to a Plain file
+ */
+int fwrite_pln(FILE *fp, Read *read) {
+    int i, err = 0;
+
+    for (i = 0; i < read->NBases; i += LINE_LENGTH)
+        if (-1 == fprintf(fp, "%.*s\n",
+			  read->NBases - i > LINE_LENGTH
+			  ? LINE_LENGTH : read->NBases - i,
+			  &read->base[i]))
+	    err = 1;
+    
+    return err ? -1 : 0;
+}
+
+int write_pln(char *fn, Read *read) {
+    FILE *fp;
+
+    if ((fp = fopen(fn,"w")) == NULL) 
+	return -1;
+
+    if (fwrite_pln(fp, read)) {
+	fclose(fp);
+	return -1;
+    }
+
+    fclose(fp);
+    return 0;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/sff.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,380 @@
+/*
+ * Portions of this code have been derived from 454 Life Sciences Corporation's
+ * getsff.c code (specifically the WriteSFFFile function.
+ * It bears the following copyright notice:
+ *
+ * ------------------------------------------------------------
+ * Copyright (c)[2001-2005] 454 Life Sciences Corporation. All Rights Reserved.
+ *
+ * THE SOFTWARE IS PROVIDED "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.
+ *
+ * IN NO EVENT SHALL LICENSOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided
+ * that this copyright and notice appears in all copies.
+ * ------------------------------------------------------------
+ *
+ * The remainder is Copyright Genome Research Limited (GRL) and is covered
+ * by a BSD style license as described elsewhere in this source tree.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "io_lib/Read.h"
+#include "io_lib/xalloc.h"
+#include "io_lib/sff.h"
+#include "io_lib/misc.h"
+
+/* -------------------------------------------------------------------------*/
+/* General purpose decoding and mFILE reading functions */
+
+/*
+ * Unpacks the 31-byte fixed size part of the SFF common header.
+ * It allocates memory for this and for the flow order and key, but does
+ * not read the flow & key information (as this may not be in buf).
+ * It also checks that the MAGIC and VERSION match as expected.
+ *
+ * Returns sff_common_header* on success
+ *         NULL on failure
+ */
+sff_common_header *decode_sff_common_header(unsigned char *buf) {
+    sff_common_header *h;
+
+    if (NULL == (h = (sff_common_header *)xcalloc(1, sizeof(*h))))
+	return NULL;
+
+    h->magic           = be_int4(*(uint32_t *)(buf+0));
+    memcpy(h->version, buf+4, 4);
+    h->index_offset    = be_int8(*(uint64_t *)(buf+8));
+    h->index_len       = be_int4(*(uint32_t *)(buf+16));
+    h->nreads          = be_int4(*(uint32_t *)(buf+20));
+    h->header_len      = be_int2(*(uint16_t *)(buf+24));
+    h->key_len         = be_int2(*(uint16_t *)(buf+26));
+    h->flow_len        = be_int2(*(uint16_t *)(buf+28));
+    h->flowgram_format = be_int1(*(uint8_t  *)(buf+30));
+
+    if (h->magic != SFF_MAGIC || memcmp(h->version, SFF_VERSION, 4)) {
+	xfree(h);
+	return NULL;
+    }
+
+    if (NULL == (h->flow = (char *)xmalloc(h->flow_len)))
+	return free_sff_common_header(h), NULL;
+    if (NULL == (h->key  = (char *)xmalloc(h->key_len)))
+	return free_sff_common_header(h), NULL;
+
+    return h;
+}
+
+/*
+ * Encodes the data in 'h' to the file SFF representation. Buf should be
+ * allocated to be 31 + h->flow_len + h->key_len + 8.
+ *
+ * Returns: the written length of buf
+ */
+int encode_sff_common_header(sff_common_header *h, unsigned char *buf) {
+    int end;
+
+    *(uint32_t *)(buf+0)  = be_int4(h->magic);
+    memcpy(buf+4, h->version, 4);
+    *(uint64_t *)(buf+8)  = be_int8(h->index_offset);
+    *(uint32_t *)(buf+16) = be_int4(h->index_len);
+    *(uint32_t *)(buf+20) = be_int4(h->nreads);
+    *(uint16_t *)(buf+24) = be_int2(h->header_len);
+    *(uint16_t *)(buf+26) = be_int2(h->key_len);
+    *(uint16_t *)(buf+28) = be_int2(h->flow_len);
+    *(uint8_t  *)(buf+30) = be_int1(h->flowgram_format);
+    memcpy(buf+31, h->flow, h->flow_len);
+    memcpy(buf+31+h->flow_len, h->key, h->key_len);
+    end = 31+h->flow_len+h->key_len;
+    memcpy(buf+end, "\0\0\0\0\0\0\0\0", ((end+7)&~7)-end);
+    
+    return (end+7)&~7;
+}
+
+/*
+ * Reads a common header (including variable length components) from an mFILE.
+ *
+ * Returns the a pointer to the header on success
+ *         NULL on failure
+ */
+sff_common_header *read_sff_common_header(mFILE *mf) {
+    sff_common_header *h;
+    unsigned char chdr[31];
+
+    if (31 != mfread(chdr, 1, 31, mf))
+	return NULL;
+    h = decode_sff_common_header(chdr);
+
+    if (h->flow_len != mfread(h->flow, 1, h->flow_len, mf))
+	return free_sff_common_header(h), NULL;
+    if (h->key_len != mfread(h->key , 1, h->key_len,  mf))
+	return free_sff_common_header(h), NULL;
+
+    /* Pad to 8 chars */
+    mfseek(mf, (mftell(mf) + 7)& ~7, SEEK_SET);
+
+    return h;
+}
+
+/*
+ * Deallocates memory used by an SFF common header.
+ */
+void free_sff_common_header(sff_common_header *h) {
+    if (!h)
+	return;
+    if (h->flow)
+	xfree(h->flow);
+    if (h->key)
+	xfree(h->key);
+    xfree(h);
+}
+
+/*
+ * Unpacks the 16-byte fixed size part of the SFF read header.
+ * It allocates memory for this and for the base calls, but does not
+ * unpack these.
+ *
+ * Returns sff_read_header* on success
+ *         NULL on failure
+ */
+sff_read_header *decode_sff_read_header(unsigned char *buf) {
+    sff_read_header *h;
+
+    if (NULL == (h = (sff_read_header *)xcalloc(1, sizeof(*h))))
+	return NULL;
+
+    h->header_len         = be_int2(*(uint16_t *)(buf+0));
+    h->name_len           = be_int2(*(uint16_t *)(buf+2));
+    h->nbases             = be_int4(*(uint32_t *)(buf+4));
+    h->clip_qual_left     = be_int2(*(uint16_t *)(buf+8));
+    h->clip_qual_right    = be_int2(*(uint16_t *)(buf+10));
+    h->clip_adapter_left  = be_int2(*(uint16_t *)(buf+12));
+    h->clip_adapter_right = be_int2(*(uint16_t *)(buf+14));
+
+    if (NULL == (h->name  = (char *)xmalloc(h->name_len)))
+	return free_sff_read_header(h), NULL;
+
+    return h;
+}
+
+/*
+ * Encodes the data in 'h' to the file SFF representation. Buf should be
+ * allocated to be 16 + h->name_len + 8.
+ *
+ * Returns: the written length of buf
+ */
+int encode_sff_read_header(sff_read_header *h, unsigned char *buf) {
+    int end;
+
+    *(uint16_t *)(buf+0)  = be_int2(h->header_len);
+    *(uint16_t *)(buf+2)  = be_int2(h->name_len);
+    *(uint32_t *)(buf+4)  = be_int4(h->nbases);
+    *(uint16_t *)(buf+8)  = be_int2(h->clip_qual_left);
+    *(uint16_t *)(buf+10) = be_int2(h->clip_qual_right);
+    *(uint16_t *)(buf+12) = be_int2(h->clip_adapter_left);
+    *(uint16_t *)(buf+14) = be_int2(h->clip_adapter_right);
+    memcpy(buf+16, h->name, h->name_len);
+    end = 16+h->name_len;
+    memcpy(buf+end, "\0\0\0\0\0\0\0\0", ((end+7)&~7)-end);
+    
+    return (end+7)&~7;
+}
+
+/*
+ * Reads a read header (including variable length components) from an mFILE.
+ *
+ * Returns the a pointer to the header on success
+ *         NULL on failure
+ */
+sff_read_header *read_sff_read_header(mFILE *mf) {
+    sff_read_header *h;
+    unsigned char rhdr[16];
+
+    if (16 != mfread(rhdr, 1, 16, mf))
+	return NULL;
+    h = decode_sff_read_header(rhdr);
+
+    if (h->name_len != mfread(h->name, 1, h->name_len, mf))
+	return free_sff_read_header(h), NULL;
+    
+    /* Pad to 8 chars */
+    mfseek(mf, (mftell(mf) + 7)& ~7, SEEK_SET);
+
+    return h;
+}
+
+/*
+ * Deallocates memory used by an SFF read header
+ */
+void free_sff_read_header(sff_read_header *h) {
+    if (!h)
+	return;
+    if (h->name)
+	xfree(h->name);
+    free(h);
+}
+
+/*
+ * Reads a read data block from an mFILE given a count of the number of
+ * flows and basecalls (from the common header and read headers).
+ *
+ * Returns the a pointer to sff_read_data on success
+ *         NULL on failure
+ */
+sff_read_data *read_sff_read_data(mFILE *mf, int nflows, int nbases) {
+    sff_read_data *d;
+    int i;
+
+    if (NULL == (d = (sff_read_data *)xcalloc(1, sizeof(*d))))
+	return NULL;
+
+    if (NULL == (d->flowgram = (uint16_t *)xcalloc(nflows, 2)))
+	return free_sff_read_data(d), NULL;
+    if (nflows != mfread(d->flowgram, 2, nflows, mf))
+	return free_sff_read_data(d), NULL;
+    for (i = 0; i < nflows; i++)
+	d->flowgram[i] = be_int2(d->flowgram[i]);
+
+    if (NULL == (d->flow_index = (uint8_t *)xmalloc(nbases)))
+	return free_sff_read_data(d), NULL;
+    if (nbases != mfread(d->flow_index, 1, nbases, mf))
+	return free_sff_read_data(d), NULL;
+
+    if (NULL == (d->bases = (char *)xmalloc(nbases)))
+	return free_sff_read_data(d), NULL;
+    if (nbases != mfread(d->bases, 1, nbases, mf))
+	return free_sff_read_data(d), NULL;
+
+    if (NULL == (d->quality = (uint8_t *)xmalloc(nbases)))
+	return free_sff_read_data(d), NULL;
+    if (nbases != mfread(d->quality, 1, nbases, mf))
+	return free_sff_read_data(d), NULL;
+
+    /* Pad to 8 chars */
+    mfseek(mf, (mftell(mf) + 7)& ~7, SEEK_SET);
+
+    return d;
+}
+
+/*
+ * Deallocates memory used by an SFF read data block
+ */
+void free_sff_read_data(sff_read_data *d) {
+    if (!d)
+	return;
+    if (d->flowgram)
+	xfree(d->flowgram);
+    if (d->flow_index)
+	xfree(d->flow_index);
+    if (d->bases)
+	xfree(d->bases);
+    if (d->quality)
+	xfree(d->quality);
+    xfree(d);
+}
+
+
+/* -------------------------------------------------------------------------*/
+
+/*
+ * Reads an SFF file from an mFILE and decodes it to a Read struct.
+ *
+ * Returns Read* on success
+ *         NULL on failure
+ */
+Read *mfread_sff(mFILE *mf) {
+    int i, bpos;
+    Read *r;
+    sff_common_header *ch;
+    sff_read_header *rh;
+    sff_read_data *rd;
+
+    /* Load the SFF contents */
+    if (NULL == (ch = read_sff_common_header(mf)))
+	return NULL;
+    if (NULL == (rh = read_sff_read_header(mf))) {
+	free_sff_common_header(ch);
+	return NULL;
+    }
+    if (NULL == (rd = read_sff_read_data(mf, ch->flow_len, rh->nbases))) {
+	free_sff_common_header(ch);
+	free_sff_read_header(rh);
+	return NULL;
+    }
+
+    /* Convert to Read struct */
+    r = read_allocate(0,0);
+    if (r->basePos) free(r->basePos);
+    if (r->base)    free(r->base);
+    if (r->prob_A)  free(r->prob_A);
+    if (r->prob_C)  free(r->prob_C);
+    if (r->prob_G)  free(r->prob_G);
+    if (r->prob_T)  free(r->prob_T);
+
+    r->nflows = ch->flow_len;
+    r->flow_order = ch->flow; ch->flow = NULL;
+    r->flow_raw = NULL;
+    r->flow = (float *)malloc(r->nflows * sizeof(float));
+    for (i = 0; i < r->nflows; i++) {
+	r->flow[i] = rd->flowgram[i] / 100.0;
+    }
+
+    r->NBases = rh->nbases;
+    r->basePos = (uint_2 *)calloc(r->NBases, 2);
+    r->base    = rd->bases; rd->bases = NULL;
+    r->prob_A  = (char *)calloc(r->NBases, 1);
+    r->prob_C  = (char *)calloc(r->NBases, 1);
+    r->prob_G  = (char *)calloc(r->NBases, 1);
+    r->prob_T  = (char *)calloc(r->NBases, 1);
+
+    bpos = 0;
+    for (i=0; i < r->NBases; i++) {
+	r->prob_A[i] = 0;
+	r->prob_C[i] = 0;
+	r->prob_G[i] = 0;
+	r->prob_T[i] = 0;
+	switch (r->base[i]) {
+	case 'A':
+	case 'a':
+	    r->prob_A[i] = rd->quality[i];
+	    break;
+	case 'C':
+	case 'c':
+	    r->prob_C[i] = rd->quality[i];
+	    break;
+	case 'G':
+	case 'g':
+	    r->prob_G[i] = rd->quality[i];
+	    break;
+	case 'T':
+	case 't':
+	    r->prob_T[i] = rd->quality[i];
+	    break;
+	}
+
+	bpos += rd->flow_index[i];
+	r->basePos[i] = bpos;
+    }
+
+    r->leftCutoff = MAX(rh->clip_qual_left, rh->clip_adapter_left);
+    r->rightCutoff = MIN(rh->clip_qual_right
+			 ? rh->clip_qual_right
+			 : r->NBases+1,
+			 rh->clip_adapter_right
+			 ? rh->clip_adapter_right
+			 : r->NBases+1);
+
+    free_sff_common_header(ch);
+    free_sff_read_header(rh);
+    free_sff_read_data(rd);
+
+    return r;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/sff.h	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,87 @@
+#ifndef _SFF_H_
+#define _SFF_H_
+
+#include "io_lib/Read.h"
+#include "io_lib/os.h"
+#include "io_lib/mFILE.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * This mirrors the order that the SFF header has on disc. We have one of
+ * these only.
+ *
+ * The flow and key are variable length fields as defined by flow_len
+ * and key_len.
+ * The on-disc structure is then also padded out with zeros to the 8-byte
+ * word boundary.
+ */
+typedef struct {
+    uint32_t magic;
+    char      version[4];
+    uint64_t  index_offset;
+    uint32_t  index_len;
+    uint32_t  nreads;
+    uint16_t  header_len;
+    uint16_t  key_len;
+    uint16_t  flow_len;
+    uint8_t   flowgram_format;
+    char     *flow;
+    char     *key;
+} sff_common_header;
+
+#define SFF_MAGIC   0x2e736666 /* ".sff" */
+#define SFF_VERSION "\0\0\0\1"
+
+/*
+ * We have one read_header per "reading" in the SFF archive.
+ * It too is padded to an 8-byte boundary.
+ */
+typedef struct {
+    uint16_t  header_len;
+    uint16_t  name_len;
+    uint32_t  nbases;
+    uint16_t  clip_qual_left;
+    uint16_t  clip_qual_right;
+    uint16_t  clip_adapter_left;
+    uint16_t  clip_adapter_right;
+    char     *name;
+} sff_read_header;
+
+/*
+ * We have one read_data section per reading, following the read_header.
+ * It is padded to an 8-byte boundary.
+ */
+typedef struct {
+    uint16_t *flowgram;   /* x 100.0 */
+    uint8_t  *flow_index; /* relative to last */
+    char     *bases;
+    uint8_t  *quality;
+} sff_read_data;
+
+
+/*
+ * Low level functions to decode SFF internals
+ */
+sff_common_header *decode_sff_common_header(unsigned char *buf);
+sff_common_header *read_sff_common_header(mFILE *mf);
+void free_sff_common_header(sff_common_header *h);
+sff_read_header *decode_sff_read_header(unsigned char *buf);
+void free_sff_read_header(sff_read_header *h);
+sff_read_header *read_sff_read_header(mFILE *mf);
+void free_sff_read_data(sff_read_data *d);
+sff_read_data *read_sff_read_data(mFILE *mf, int nflows, int nbases);
+
+
+/*
+ * Loads the first SFF sequence from an SFF container and returns as a Read.
+ */
+Read *mfread_sff(mFILE *mf);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _SFF_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/srf.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,2089 @@
+#ifdef HAVE_CONFIG_H
+#include "io_lib_config.h"
+#endif
+
+#include <stdio.h>
+#include <assert.h>
+#include <string.h>
+#include "io_lib/Read.h"
+#include "io_lib/misc.h"
+#include "io_lib/ztr.h"
+#include "io_lib/hash_table.h"
+
+#include "io_lib/srf.h"
+
+/*
+ * ---------------------------------------------------------------------------
+ * Object creation / destruction.
+ */
+
+/*
+ * Allocates and returns an srf_t structure.
+ * fp is the file point associated with this SRF file. Pass as NULL if unknown
+ * at this stage.
+ *
+ * Returns malloced memory on success
+ *         NULL on failure
+ */
+srf_t *srf_create(FILE *fp) {
+    srf_t *srf = (srf_t *)calloc(1, sizeof(*srf));
+
+    if (srf)
+	srf->fp = fp;
+    return srf;
+}
+
+/*
+ * Opens an SRF archive for reading or writing as defined by 'mode'. Mode is
+ * passed directly on to fopen() and so uses the same flags.
+ *
+ * Returns a srf_t struct pointer on success.
+ *         NULL on failure
+ */
+srf_t *srf_open(char *fn, char *mode) {
+    FILE *fp;
+    char bmode[11];
+    size_t l, i;
+
+    /* Enforce binary mode for windows */
+    if ((l = strlen(mode)) < 9) {
+	int binary = 0;
+	for (i = 0; i < l; i++) {
+	    if ('b' == (bmode[i] = mode[i]))
+		binary=1;
+	}
+	if (!binary)
+	    bmode[i++] = 'b';
+	bmode[i] = 0;
+	mode = bmode;
+    }
+    
+    return (fp = fopen(fn, mode)) ? srf_create(fp) : NULL;
+}
+
+/*
+ * Deallocates an srf_t struct. If auto_close is true then it also closes
+ * any associated FILE pointer.
+ */
+void srf_destroy(srf_t *srf, int auto_close) {
+    if (!srf)
+	return;
+    
+    if (auto_close && srf->fp) {
+	if (-1 == fclose(srf->fp))
+	    perror("fclose(srf->fp)");
+    }
+
+    if(srf->th.trace_hdr)
+	free(srf->th.trace_hdr);
+
+    if (srf->mf)
+	mfdestroy(srf->mf);
+
+    if (srf->ztr)
+	delete_ztr(srf->ztr);
+
+    free(srf);
+}
+
+/*
+ * ---------------------------------------------------------------------------
+ * Base data type I/O.
+ */
+
+/* 
+ * Writes a null-terminated C string in pascal-string form.
+ * Returns the number of bytes written or
+ *         -1 for failure.
+ */
+int srf_write_pstring(srf_t *srf, char *str) {
+    size_t l = str ? strlen(str) : 0;
+    if (l > 255)
+	return -1;
+
+    if (l)
+	return fprintf(srf->fp, "%c%s", (int)l, str);
+    else
+	return fprintf(srf->fp, "%c", (int)l);
+}
+
+/*
+ * As per srf_write_pstring but 'str' may hold binary data including nul
+ * chars, hence we pass over length as a separate paremeter.
+ */
+int srf_write_pstringb(srf_t *srf, char *str, int length) {
+    if (length > 255 || length < 0)
+	return -1;
+
+    if (length)
+	return fprintf(srf->fp, "%c%s", (int)length, str);
+    else
+	return fprintf(srf->fp, "%c", (int)length);
+}
+
+/*
+ * Reads a pascal-style string from the srf file.
+ * 'str' passed in needs to be at least 256 bytes long. The string read
+ * will be stored there and nul terminated.
+ *
+ * Returns the length of the string read (minus nul char),
+ *         -1 for failure
+ */
+int srf_read_pstring(srf_t *srf, char *str) {
+    int len;
+
+    if (EOF == (len = fgetc(srf->fp)))
+	return -1;
+    if (len != fread(str, 1, len, srf->fp))
+	return -1;
+    str[len] = '\0';
+
+    return len;
+}
+
+/*
+ * Read/write unsigned 32-bit and 64-bit values in big-endian format
+ * (ie the same as ZTR and SCF endian uses).
+ * Functions all return 0 for success, -1 for failure.
+ */
+int srf_read_uint32(srf_t *srf, uint32_t *val) {
+    unsigned char d[4];
+    if (1 != fread(d, 4, 1, srf->fp))
+	return -1;
+
+    *val = (d[0] << 24) | (d[1] << 16) | (d[2] << 8) | (d[3] << 0);
+    return 0;
+}
+
+int srf_write_uint32(srf_t *srf, uint32_t val) {
+    unsigned char d[4];
+    d[0] = (val >> 24) & 0xff;
+    d[1] = (val >> 16) & 0xff;
+    d[2] = (val >>  8) & 0xff;
+    d[3] = (val >>  0) & 0xff;
+
+    return fwrite(d, 4, 1, srf->fp) ? 0 : -1;
+}
+
+int srf_read_uint64(srf_t *srf, uint64_t *val) {
+    unsigned char d[8];
+    if (1 != fread(d, 8, 1, srf->fp))
+	return -1;
+
+    *val = ((uint64_t)d[0] << 56)
+	 | ((uint64_t)d[1] << 48)
+	 | ((uint64_t)d[2] << 40)
+	 | ((uint64_t)d[3] << 32)
+	 | ((uint64_t)d[4] << 24)
+	 | ((uint64_t)d[5] << 16)
+	 | ((uint64_t)d[6] <<  8)
+	 | ((uint64_t)d[7] <<  0);
+    return 0;
+}
+
+int srf_write_uint64(srf_t *srf, uint64_t val) {
+    unsigned char d[8];
+    d[0] = (val >> 56) & 0xff;
+    d[1] = (val >> 48) & 0xff;
+    d[2] = (val >> 40) & 0xff;
+    d[3] = (val >> 32) & 0xff;
+    d[4] = (val >> 24) & 0xff;
+    d[5] = (val >> 16) & 0xff;
+    d[6] = (val >>  8) & 0xff;
+    d[7] = (val >>  0) & 0xff;
+
+    return fwrite(d, 8, 1, srf->fp) ? 0 : -1;
+}
+
+/*
+ * ---------------------------------------------------------------------------
+ * Mid level I/O - srf block type handling
+ */
+
+
+/*
+ * Allocates and initialises a container header structure. An existing
+ * srf_cont_hdr_t may be passed in to avoid allocation of a new object.
+ *
+ * Returns: allocated cont_header on success, to be freed using
+ *          srf_destroy_cont_hdr() (if allocated here),
+ *          NULL on failure.
+ */
+srf_cont_hdr_t *srf_construct_cont_hdr(srf_cont_hdr_t *ch,
+				       char *bc,
+				       char *bc_version) {
+    if (!ch) {
+	if (NULL == (ch = (srf_cont_hdr_t *)calloc(1, sizeof(*ch))))
+	    return NULL;
+    }
+
+    ch->block_type = SRFB_CONTAINER;
+    strcpy(ch->version, SRF_VERSION);
+    ch->container_type = 'Z';
+    strncpy(ch->base_caller, bc, 255);
+    strncpy(ch->base_caller_version, bc_version, 255);
+
+    return ch;
+}
+
+/*
+ * Deallocates an srf_cont_hdr_t constructed by srf_construct_cont_hdr().
+ */
+void srf_destroy_cont_hdr(srf_cont_hdr_t *ch) {
+    if (ch)
+	free(ch);
+}
+
+/*
+ * Reads a container header and stores the result in 'ch'.
+ * Returns 0 for success
+ *        -1 for failure
+ */
+int srf_read_cont_hdr(srf_t *srf, srf_cont_hdr_t *ch) {
+    char magic[3];
+    uint32_t sz;
+
+    if (!ch)
+	return -1;
+
+    /* Check block type */
+    if (EOF == (ch->block_type = fgetc(srf->fp)))
+	return -1;
+    if (ch->block_type != SRFB_CONTAINER)
+	return -1;
+
+    /* Check magic number && version */
+    if (3 != fread(magic, 1, 3, srf->fp))
+	return -1;
+    if (0 != srf_read_uint32(srf, &sz))
+	return -1;
+    if (srf_read_pstring(srf, ch->version) < 0)
+	return -1;
+    if (strncmp(magic, "SRF", 3) || strcmp(ch->version, SRF_VERSION))
+	return -1;
+    
+    /* Containter type, base caller bits */
+    if (EOF == (ch->container_type = fgetc(srf->fp)) ||
+	srf_read_pstring(srf, ch->base_caller) < 0||
+	srf_read_pstring(srf, ch->base_caller_version) < 0)
+	return -1;
+
+    return 0;
+}
+
+/*
+ * Writes a container header to disk.
+ *
+ * 4 Block type + magic number ("SSRF")
+ * 1+n: pString for version number ("1.0")
+ * 1: "Z" => container type is ZTR
+ * 1+n: pString for base-caller ("eg Bustard")
+ * 1+n: pString for base-caller version (eg "1.8.28")
+ * 4: uint32 distance from start of header to first data block.
+ * 4: uint32 distance from start of block to index block (0). FIXME
+ *
+ * Returns 0 for success
+ *        -1 for failure
+ */
+int srf_write_cont_hdr(srf_t *srf, srf_cont_hdr_t *ch) {
+    uint32_t sz = 0;
+
+    if (!ch)
+	return -1;
+
+    /* Magic number && version */
+    if (4 != fwrite(SRF_MAGIC, 1, 4, srf->fp))
+	return -1;
+
+    /* Header size */
+    sz =  9
+	+ (ch->version ? strlen(ch->version) : 0) + 1
+	+ (ch->base_caller ? strlen(ch->base_caller) : 0) + 1
+	+ (ch->base_caller_version ? strlen(ch->base_caller_version) : 0) + 1;
+    if (0 != srf_write_uint32(srf, sz))
+	return -1;
+
+    if (srf_write_pstring(srf, ch->version) < 0)
+	return -1;
+    
+    /* Containter type, base caller bits */
+    if (EOF == fputc(ch->container_type, srf->fp))
+	return -1;
+    if (srf_write_pstring(srf, ch->base_caller) < 0)
+	return -1;
+    if (srf_write_pstring(srf, ch->base_caller_version) < 0)
+	return -1;
+
+    return ferror(srf->fp) ? -1 : 0;
+}
+
+/*
+ * Reads an XML TraceInfo block
+ * Returns 0 for success
+ *        -1 for failure
+ */
+int srf_read_xml(srf_t *srf, srf_xml_t *xml) {
+    int block_type;
+
+    if (EOF == (block_type = fgetc(srf->fp)))
+	return -1;
+    if (block_type != SRFB_XML)
+	return -1;
+
+    if (0 != srf_read_uint32(srf, &xml->xml_len))
+	return -1;
+    xml->xml_len -= 5;
+
+    if (NULL == (xml->xml = (char *)realloc(xml->xml, xml->xml_len+1)))
+	return -1;
+    if (xml->xml_len != fread(xml->xml, 1, xml->xml_len, srf->fp))
+	return -1;
+    xml->xml[xml->xml_len] = 0;
+
+    return 0;
+}
+
+/*
+ * Writes an XML TraceInfo block
+ * Returns 0 for success
+ *        -1 for failure
+ */
+int srf_write_xml(srf_t *srf, srf_xml_t *xml) {
+    if (!srf->fp)
+	return -1;
+
+    if (EOF == fputc(SRFB_XML, srf->fp))
+	return -1;
+
+    if (-1 == srf_write_uint32(srf, xml->xml_len+5))
+	return -1;
+
+    if (xml->xml_len != fwrite(xml->xml, 1, xml->xml_len, srf->fp))
+	return -1;
+
+    return ferror(srf->fp) ? -1 : 0;
+}
+
+/*
+ * Initialises a srf_trace_header_t and inserts some passed in values.
+ * If the supplied th is NULL then a new structure is allocated.
+ *
+ * Returns a pointer to the dh passed in (or allocated if NULL) on success
+ *         NULL on failure
+ */
+srf_trace_hdr_t *srf_construct_trace_hdr(srf_trace_hdr_t *th,
+					 char *prefix,
+					 unsigned char *header,
+					 uint32_t header_sz) {
+    if (!th) {
+	if (NULL == (th = (srf_trace_hdr_t *)calloc(1, sizeof(*th))))
+	    return NULL;
+    }
+
+    th->block_type = SRFB_TRACE_HEADER;
+    strncpy(th->id_prefix, prefix, 255);
+    th->trace_hdr_size = header_sz;
+    th->trace_hdr = header;
+    th->read_prefix_type = 'E';
+
+    return th;
+}
+
+/*
+ * Deallocates a srf_trace_hdr_t if allocated by
+ * srf_construct_trace_hdr().
+ * Do not use this if you passed in a static srf_trace_hdr to the construct
+ * function.
+ */
+void srf_destroy_trace_hdr(srf_trace_hdr_t *th) {
+    if (th) {
+	if (th->trace_hdr)
+	    free(th->trace_hdr);
+	free(th);
+    }
+}
+
+/*
+ * Reads a data header and stores the result in 'th'.
+ * Returns 0 for success
+ *        -1 for failure
+ */
+int srf_read_trace_hdr(srf_t *srf, srf_trace_hdr_t *th) {
+    int z;
+
+    /* Check block type */
+    if (EOF == (th->block_type = fgetc(srf->fp)))
+	return -1;
+
+    if (th->block_type != SRFB_TRACE_HEADER)
+	return -1;
+    if (0 != srf_read_uint32(srf, &th->trace_hdr_size))
+	return -1;
+    th->trace_hdr_size -= 1 + 4 + 1;
+
+    /* Read-id prefix */
+    if (EOF == (th->read_prefix_type = fgetc(srf->fp)))
+	return -1;
+    if ((z = srf_read_pstring(srf, th->id_prefix)) < 0)
+	return -1;
+    th->trace_hdr_size -= z+1;
+
+    /* The data header itself */
+    if (th->trace_hdr)
+	free(th->trace_hdr);
+    if (th->trace_hdr_size) {
+	if (NULL == (th->trace_hdr = malloc(th->trace_hdr_size)))
+	    return -1;
+	if (th->trace_hdr_size != fread(th->trace_hdr, 1,
+					  th->trace_hdr_size, srf->fp)) {
+	    free(th->trace_hdr);
+	    th->trace_hdr = NULL;
+	    return -1;
+	}
+    } else {
+	th->trace_hdr = NULL;
+    }
+
+    return 0;
+}
+
+/*
+ * Writes a srf_trace_hdr_t structure to disk.
+ * Returns 0 for sucess
+ *        -1 for failure
+ */
+int srf_write_trace_hdr(srf_t *srf, srf_trace_hdr_t *th) {
+    uint32_t sz;
+
+    if (!srf->fp)
+	return -1;
+
+    if (EOF == fputc(th->block_type, srf->fp))
+	return -1;
+
+    /* Size */
+    sz = 1 + 4 + 1
+	+ (th->id_prefix ? strlen(th->id_prefix) : 0) + 1
+	+ th->trace_hdr_size;
+    if (-1 == srf_write_uint32(srf, sz))
+	return -1;
+
+    /* Prefix */
+    if (EOF == fputc(th->read_prefix_type, srf->fp))
+	return -1;
+    if (-1 == srf_write_pstring(srf, th->id_prefix))
+	return -1;
+
+    /* The ztr header blob itself... */
+    if (th->trace_hdr_size !=
+	fwrite(th->trace_hdr, 1, th->trace_hdr_size, srf->fp))
+	return -1;
+
+    return ferror(srf->fp) ? -1 : 0;
+}
+
+
+srf_trace_body_t *srf_construct_trace_body(srf_trace_body_t *tb,
+					   char *suffix,
+					   int suffix_len,
+					   unsigned char *body,
+					   uint32_t body_size,
+					   unsigned char flags) {
+    if (!tb) {
+	if (NULL == (tb = (srf_trace_body_t *)calloc(1, sizeof(*tb))))
+	    return NULL;
+    }
+    tb->block_type = SRFB_TRACE_BODY;
+    if (suffix_len == -1) {
+	suffix_len = strlen(suffix);
+	if (suffix_len > 255)
+	    suffix_len = 255;
+    }
+    memcpy(tb->read_id, suffix, suffix_len);
+    tb->read_id[suffix_len] = 0;
+    tb->read_id_length = suffix_len;
+
+    tb->trace = body;
+    tb->trace_size = body_size;
+    tb->flags = flags;
+
+    return tb;
+}
+
+void srf_destroy_trace_body(srf_trace_body_t *tb) {
+    if (tb)
+	free(tb);
+}
+
+/*
+ * Writes a new trace body.
+ *
+ * Returns: 0 on success
+ *          -1 on failure
+ */
+int srf_write_trace_body(srf_t *srf, srf_trace_body_t *tb) {
+    uint32_t sz;
+
+    if (!srf->fp)
+	return -1;
+
+    if (EOF == fputc(tb->block_type, srf->fp))
+	return -1;
+
+    /* Size */
+    sz = 6 + tb->read_id_length+1 + tb->trace_size;
+    if (0 != srf_write_uint32(srf, sz))
+	return -1;
+
+    /* Flags and name */
+    if (EOF == (fputc(tb->flags, srf->fp)))
+	return -1;
+    if (-1 == srf_write_pstringb(srf, tb->read_id, tb->read_id_length))
+	return -1;
+
+    /* Tbe ztr footer blob itself... */
+    if (tb->trace_size != fwrite(tb->trace, 1, tb->trace_size, srf->fp))
+	return -1;
+
+    return ferror(srf->fp) ? -1 : 0;
+}
+
+/*
+ * Reads a trace header + trace 'blob' and stores the result in 'th'
+ * If no_trace is true then it skips loading the trace data itself.
+ *
+ * Returns 0 for success
+ *        -1 for failure
+ */
+int srf_read_trace_body(srf_t *srf, srf_trace_body_t *tb, int no_trace) {
+    int z;
+
+    /* Check block type */
+    if (EOF == (tb->block_type = fgetc(srf->fp)))
+	return -1;
+    if (tb->block_type != SRFB_TRACE_BODY)
+	return -1;
+
+    /* Size */
+    if (0 != srf_read_uint32(srf, &tb->trace_size))
+	return -1;
+    tb->trace_size -= 6;
+
+    /* Flags */
+    if (EOF == (z = fgetc(srf->fp)))
+	return -1;
+    tb->flags = z;
+
+    /* Read-id suffix */
+    if ((z = srf_read_pstring(srf, tb->read_id)) < 0)
+	return -1;
+    tb->read_id_length = z;
+    tb->trace_size -= z+1;
+
+    /* The trace data itself */
+    if (!no_trace) {
+	if (tb->trace_size) {
+	    if (NULL == (tb->trace = malloc(tb->trace_size)))
+		return -1;
+	    if (tb->trace_size != fread(tb->trace, 1, tb->trace_size,
+					srf->fp)) {
+		free(tb->trace);
+		tb->trace = NULL;
+		return -1;
+	    }
+	} else {
+	    tb->trace = NULL;
+	}
+    } else {
+	/* Skip */
+	fseeko(srf->fp, tb->trace_size, SEEK_CUR);
+	tb->trace = NULL;
+    }
+
+    return 0;
+}
+
+
+/*
+ * Reads a SRF index header. See srf_write_index_hdr for the format.
+ * If no_seek is true it reads the header starting at the current file
+ * offset, otherwise it seeks to the end of the file and reads that
+ * header instead.
+ *
+ * Returns 0 on success and fills out *hdr
+ *         -1 on failure
+ */
+int srf_read_index_hdr(srf_t *srf, srf_index_hdr_t *hdr, int no_seek) {
+    int sz, z;
+
+    /* Load footer */
+    if (!no_seek) {
+	if (0 != fseeko(srf->fp, -16, SEEK_END))
+	    return -1;
+	
+	if (4 != fread(hdr->magic,   1, 4, srf->fp))
+	    return -1;
+	if (4 != fread(hdr->version, 1, 4, srf->fp))
+	    return -1;
+	if (0 != srf_read_uint64(srf, &hdr->size))
+	    return -1;
+
+	/* Check for validity */
+        if (memcmp(hdr->magic,	 SRF_INDEX_MAGIC,   4) ||
+	    memcmp(hdr->version, SRF_INDEX_VERSION, 4))
+	    return -1;
+
+	/* Seek to index header and re-read */
+	if (0 != fseeko(srf->fp, -hdr->size, SEEK_END))
+	    return -1;
+    }
+
+    if (4 != fread(hdr->magic,   1, 4, srf->fp))
+	return -1;
+    if (4 != fread(hdr->version, 1, 4, srf->fp))
+	return -1;
+    if (0 != srf_read_uint64(srf, &hdr->size))
+	return -1;
+
+    /* Check once more */
+    if (memcmp(hdr->magic,   SRF_INDEX_MAGIC,   4) ||
+	memcmp(hdr->version, SRF_INDEX_VERSION, 4))
+	return -1;
+
+    /* And finally the remainder of the index header details */
+    if (EOF == (hdr->index_type         = fgetc(srf->fp)))
+	return -1;
+    if (EOF == (hdr->dbh_pos_stored_sep = fgetc(srf->fp)))
+	return -1;
+
+    if (0 != srf_read_uint32(srf, &hdr->n_container))
+	return -1;
+    if (0 != srf_read_uint32(srf, &hdr->n_data_block_hdr))
+	return -1;
+    if (0 != srf_read_uint64(srf, &hdr->n_buckets))
+	return -1;
+
+    sz = 34; /* fixed size of the above records */
+
+    if ((z = srf_read_pstring(srf, hdr->dbh_file)) < 0)
+	return -1;
+    sz += z+1;
+    if ((z = srf_read_pstring(srf, hdr->cont_file)) < 0)
+	return -1;
+    sz += z+1;
+
+    hdr->index_hdr_sz = sz;
+
+    return 0;
+}
+
+/*
+ * Writes a SRF index header.
+ *
+ * Header:
+ *   x4    magic number, starting with 'I'.
+ *   x4    version code (eg "1.00")
+ *   x8    index size
+ *   x1    index type ('E' normally)
+ *   x1    dbh_pos_stored_sep (indicates if the item list contains the
+ *         "data block header" index number).
+ *   x4    number of containers
+ *   x4    number of DBHs
+ *   x8    number of hash buckets
+ *
+ *   x*    dbhFile  p-string (NULL if held within the same file)
+ *   x*    contFile p-string (NULL if held within the same file)
+ *
+ * Returns 0 on success
+ *        -1 on failure
+ */
+int srf_write_index_hdr(srf_t *srf, srf_index_hdr_t *hdr) {
+    if (4 != fwrite(hdr->magic,   1, 4, srf->fp))
+	return -1;
+    if (4 != fwrite(hdr->version, 1, 4, srf->fp))
+	return -1;
+    if (0 != srf_write_uint64(srf, hdr->size))
+	return -1;
+
+    if (EOF == fputc(hdr->index_type, srf->fp))
+	return -1;
+    if (EOF == fputc(hdr->dbh_pos_stored_sep, srf->fp))
+	return -1;
+
+    if (0 != srf_write_uint32(srf, hdr->n_container))
+	return -1;
+    if (0 != srf_write_uint32(srf, hdr->n_data_block_hdr))
+	return -1;
+    if (0 != srf_write_uint64(srf, hdr->n_buckets))
+	return -1;
+
+    if (-1 == srf_write_pstring(srf, hdr->dbh_file))
+	return -1;
+    if (-1 == srf_write_pstring(srf, hdr->cont_file))
+	return -1;
+
+    return ferror(srf->fp) ? -1 : 0;
+}
+
+/* Position in index - internal struct used for code below only */
+typedef struct {
+    uint64_t pos;
+    uint32_t dbh;
+} pos_dbh;
+
+/*
+ * This allocates and initialises an srf_index_t struct filling out the
+ * fields to default values or the supplied parameters. It does not
+ * actually write anything to disc itself.
+ *
+ * Note: non-NULL values for ch_file and th_file are not implemented yet.
+ *
+ * ch_file is the container header file. If specified as non-NULL it is the 
+ * name of the file storing the container and DB records (trace bodies).
+ * NULL implies all the data is in the same file.
+ *
+ * th_file is the filename where we store the DBH records (trace headers).
+ * NULL implies all the data is in the same file.
+ *
+ * dbh_sep is a boolean value used to indicate whether we store the
+ * location of DBH+DB per trace or just the DB record. The latter uses less
+ * space and is most generally used, but the former is required if DBH and DB
+ * are split apart into two files (ch_file and th_file).
+ *
+ * Returns srf_index_t pointer on success.
+ *         NULL on failure
+ */
+srf_index_t *srf_index_create(char *ch_file, char *th_file, int dbh_sep) {
+    srf_index_t *idx = (srf_index_t *)malloc(sizeof(srf_index_t));
+    if (!idx)
+	return NULL;
+
+    if (ch_file) {
+	strncpy(idx->ch_file, ch_file, PATH_MAX);
+	idx->ch_file[PATH_MAX] = 0;
+    } else {
+	idx->ch_file[0] = 0;
+    }
+
+    if (th_file) {
+	strncpy(idx->th_file, th_file, PATH_MAX);
+	idx->th_file[PATH_MAX] = 0;
+    } else {
+	idx->th_file[0] = 0;
+    }
+
+    idx->dbh_pos_stored_sep = dbh_sep;
+
+    /* Create the arrays and hash table */
+    if (!(idx->ch_pos = ArrayCreate(sizeof(uint64_t), 0)))
+	return NULL;
+
+    if (!(idx->th_pos = ArrayCreate(sizeof(uint64_t), 0)))
+	return NULL;
+
+    if (!(idx->name_blocks = ArrayCreate(sizeof(srf_name_block_t), 0)))
+        return NULL;
+
+    if (!(idx->db_hash = HashTableCreate(0, HASH_DYNAMIC_SIZE |
+					    HASH_FUNC_JENKINS3 |
+					    HASH_NONVOLATILE_KEYS |
+					    HASH_POOL_ITEMS)))
+	return NULL;
+
+    return idx;
+}
+
+
+/*
+ * Deallocates memory used by an srf_index_t structure.
+ */
+void srf_index_destroy(srf_index_t *idx) {
+    size_t i;
+
+    if (!idx)
+	return;
+
+    if (idx->db_hash)
+	HashTableDestroy(idx->db_hash, 0);
+    if (idx->ch_pos)
+	ArrayDestroy(idx->ch_pos);
+    if (idx->th_pos)
+	ArrayDestroy(idx->th_pos);
+    if (idx->name_blocks) {
+        for (i = 0; i < ArrayMax(idx->name_blocks); i++) {
+	    if (NULL != arr(srf_name_block_t, idx->name_blocks, i).names)
+	        free(arr(srf_name_block_t, idx->name_blocks, i).names);
+        }
+	ArrayDestroy(idx->name_blocks);
+    }
+
+    free(idx);
+}
+
+
+/*
+ * Dumps out some statistics on the index to fp, or stderr if fp
+ * is NULL.
+ */
+void srf_index_stats(srf_index_t *idx, FILE *fp) {
+    HashTableStats(idx->db_hash, fp ? fp : stderr);
+}
+
+
+/*
+ * Adds a container header (CH block) to the srf index.
+ *
+ * Returns 0 on success
+ *        -1 on failure
+ */
+int srf_index_add_cont_hdr(srf_index_t *idx, uint64_t pos) {
+    uint64_t *ip = ARRP(uint64_t, idx->ch_pos, ArrayMax(idx->ch_pos));
+    return ip ? (*ip = pos, 0) : -1;
+}
+
+
+/*
+ * Adds a trace header (DBH block) to the srf index.
+ *
+ * Returns 0 on success
+ *        -1 on failure
+ */
+int srf_index_add_trace_hdr(srf_index_t *idx, uint64_t pos) {
+    uint64_t *ip = ARRP(uint64_t, idx->th_pos, ArrayMax(idx->th_pos));
+    return ip ? (*ip = pos, 0) : -1;
+}
+
+
+/*
+ * Adds a trace body (DB block) to the srf index.
+ *
+ * Returns 0 on success
+ *        -1 on failure
+ */
+int srf_index_add_trace_body(srf_index_t *idx, char *name, uint64_t pos) {
+    HashData hd;
+    pos_dbh *pdbh;
+    srf_name_block_t *blockp;
+    char *name_copy;
+    size_t name_len;
+    int new;
+
+    if (idx->dbh_pos_stored_sep) {
+	if (NULL == (pdbh = (pos_dbh *)malloc(sizeof(*pdbh))))
+	    return -1;
+	pdbh->pos = pos;
+	pdbh->dbh = ArrayMax(idx->th_pos);
+	hd.p = pdbh;
+    } else {
+	hd.i = pos;
+    }
+
+    name_len = strlen(name) + 1; /* Include NULL */
+
+    /* Allocate more space for names if needed */
+    if (ArrayMax(idx->name_blocks) == 0
+	|| arr(srf_name_block_t, idx->name_blocks,
+	       ArrayMax(idx->name_blocks) -  1).space <= name_len) {
+        blockp = ARRP(srf_name_block_t, idx->name_blocks,
+		      ArrayMax(idx->name_blocks));
+	if (NULL == blockp) return -1;
+
+	blockp->used = 0;
+	blockp->space = (name_len < SRF_INDEX_NAME_BLOCK_SIZE
+			 ? SRF_INDEX_NAME_BLOCK_SIZE
+			 : name_len);
+	blockp->names = xmalloc(blockp->space);
+	if (NULL == blockp->names) {
+	    ArrayMax(idx->name_blocks)--;
+	    return -1;
+	}	
+    }
+
+    blockp = ARRP(srf_name_block_t, idx->name_blocks,
+		  ArrayMax(idx->name_blocks) - 1);
+    name_copy = blockp->names + blockp->used;
+    memcpy(name_copy, name, name_len);
+    blockp->used  += name_len;
+    blockp->space -= name_len;
+
+    if (NULL == HashTableAdd(idx->db_hash, name_copy, name_len - 1, hd, &new)){
+        return -1;
+    }
+    if (0 == new) {
+	fprintf(stderr, "duplicate read name %s\n", name);
+	return -1;
+    }
+
+    return 0;
+}
+
+
+/*
+ * Writes the HashTable structures to 'fp'.
+ * This is a specialisation of the HashTable where the HashData is a
+ * position,size tuple.
+ *
+ * Header:
+ *   x4    magic number, starting with 'I'.
+ *   x4    version code (eg "1.00")
+ *   x8    index size (should be x4 as we assume bucket locs are x4?)
+ *
+ *   x1    index type ('E' normally)
+ *   x1    dbh_pos_stored_sep (indicates if the item list contains the
+ *         "data block header" index number).
+ *
+ *   x4    number of containers
+ *   x4    number of DBHs
+ *   x8    number of hash buckets
+ *
+ *   x*    dbhFile  p-string (NULL if held within the same file)
+ *   x*    contFile p-string (NULL if held within the same file)
+ *
+ * Containers: (1 entry per container)
+ *   x8    file position of container header
+ *
+ * Data Block Headers: (1 entry per DBH)
+ *   x8    file position of container header
+ *
+ * Buckets: (1 entry per bucket)
+ *   x8    8-byte offset of linked list pos,  rel. to the start of the hdr
+ *
+ * Items: (1 per trace)
+ *   x1    name disambiguation hash, top-most bit set => last item in list
+ *   x8    data position
+ *  (x4)  (dbh_index - optional; present if dbh_pos_stored_sep is 1)
+ *
+ * Footer:
+ *   x4    magic number
+ *   x4    version
+ *   x8    index size
+ *
+ * Returns: the number of bytes written on success
+ *         -1 for error
+ */
+int srf_index_write(srf_t *srf, srf_index_t *idx) {
+    unsigned int i, j;
+    srf_index_hdr_t hdr;
+    uint64_t *bucket_pos;
+    int item_sz;
+    HashTable *h = idx->db_hash;
+
+    /* Option: whether to store dbh positions directly in the index */
+    hdr.dbh_pos_stored_sep = idx->dbh_pos_stored_sep;
+
+    /* Compute index size and bucket offsets */
+    hdr.size = 34 +
+	1 + (idx->ch_file ? strlen(idx->ch_file) : 0) +
+	1 + (idx->th_file ? strlen(idx->th_file) : 0);
+    hdr.size += 8*(ArrayMax(idx->ch_pos) +
+		   ArrayMax(idx->th_pos) +
+		   h->nbuckets);
+    if (NULL == (bucket_pos = (uint64_t *)calloc(h->nbuckets,
+						 sizeof(*bucket_pos))))
+	return -1;
+    for (i = 0; i < h->nbuckets; i++) {
+	HashItem *hi;
+	if (!(hi = h->bucket[i]))
+	    continue;
+	bucket_pos[i] = hdr.size;
+	item_sz = 1 + 8 + (hdr.dbh_pos_stored_sep ? 4 : 0);
+	for (; hi; hi = hi->next)
+	    hdr.size += item_sz;
+    }
+    hdr.size += 16; /* footer */
+
+    /* Construct and write out the index header */
+    memcpy(hdr.magic,   SRF_INDEX_MAGIC,   4);
+    memcpy(hdr.version, SRF_INDEX_VERSION, 4);
+    hdr.index_type = 'E';
+    hdr.n_container = ArrayMax(idx->ch_pos);
+    hdr.n_data_block_hdr = ArrayMax(idx->th_pos);
+    hdr.n_buckets = h->nbuckets;
+    if (idx->th_file)
+	strncpy(hdr.dbh_file,  idx->th_file, 255);
+    else
+	hdr.dbh_file[0] = 0;
+    if (idx->ch_file)
+	strncpy(hdr.cont_file, idx->ch_file, 255);
+    else
+	hdr.cont_file[0] = 0;
+    if (0 != srf_write_index_hdr(srf, &hdr))
+	return -1;
+
+    /* Write the container and data block header arrays */
+    j = ArrayMax(idx->ch_pos);
+    for (i = 0; i < j; i++) {
+	if (0 != srf_write_uint64(srf, arr(uint64_t, idx->ch_pos, i)))
+	    return -1;
+    }
+
+    j = ArrayMax(idx->th_pos);
+    for (i = 0; i < j; i++) {
+	if (0 != srf_write_uint64(srf, arr(uint64_t, idx->th_pos, i)))
+	    return -1;
+    }
+
+    /* Write out buckets */
+    for (i = 0; i < h->nbuckets; i++) {
+	if (0 != srf_write_uint64(srf, bucket_pos[i]))
+	    return -1;
+    }
+
+    /* Write out the trace locations themselves */
+    for (i = 0; i < h->nbuckets; i++) {
+	HashItem *hi;
+	/*
+	fprintf(stderr, "Bucket %d offset %lld vs %lld\n",
+		i, ftell(srf->fp), bucket_pos[i]);
+	*/
+	if (!(hi = h->bucket[i]))
+	    continue;
+	for (; hi; hi = hi->next) {
+	    uint64_t pos;
+	    uint32_t dbh = 0;
+	    uint32_t h7;
+
+	    if (hdr.dbh_pos_stored_sep) {
+		pos_dbh *pdbh = (pos_dbh *)hi->data.p;
+		pos = pdbh->pos;
+		dbh = pdbh->dbh;
+	    } else {
+		pos = hi->data.i;
+	    }
+
+	    /* Rehash key in 7 bits;  */
+	    h7 = hash64(h->options & HASH_FUNC_MASK,
+			(uint8_t *)hi->key, hi->key_len) >> 57;
+	    if (!hi->next)
+		h7 |= 0x80;
+	    /*
+	    fprintf(stderr, "\t%.*s => %x @ %lld\n",
+		    hi->key_len, hi->key, h7, pos);
+	    */
+	    if (fputc(h7, srf->fp) < 0)
+		return -1;
+	    if (0 != srf_write_uint64(srf, pos))
+		return -1;
+
+	    if (hdr.dbh_pos_stored_sep)
+		if (0 != srf_write_uint32(srf, dbh))
+		    return -1;
+	}
+    }
+
+    /* Footer */
+    if (4 != fwrite(hdr.magic,   1, 4, srf->fp))
+	return -1;
+    if (4 != fwrite(hdr.version, 1, 4, srf->fp))
+	return -1;
+    if (0 != srf_write_uint64(srf, hdr.size))
+	return -1;
+
+    free(bucket_pos);
+
+    return 0;
+}
+
+/*
+ * ---------------------------------------------------------------------------
+ * Trace name codec details.
+ */
+
+/*
+ * Reads up to 32-bits worth of data and returns. Updates the block
+ * byte and bit values to indicate the current 'read' position.
+ *
+ * Returns unsigned value on success (>=0)
+ *         -1 on failure
+ */
+static uint32_t get_hi_bits(block_t *block, int nbits) {
+    unsigned int val, bnum = 0;
+
+    if (block->byte*8 + block->bit + nbits > block->alloc * 8)
+        return -1;
+
+    /* Fetch the partial byte of data */
+    val = (block->data[block->byte]) & (1<<(8-block->bit))-1;
+    bnum = 8 - block->bit;
+
+    if (bnum >= nbits) {
+	val >>= bnum-nbits;
+	val &= (1<<nbits)-1;
+	block->bit += nbits;
+	return val;
+    }
+
+    /* And additional entire bytes worth as required */
+    while (bnum+8 <= nbits && bnum+8 < 32) {
+	val <<= 8;
+        val |= block->data[++block->byte];
+        bnum += 8;
+    }
+
+    /* The remaining partial byte */
+    val <<= nbits-bnum;
+    val |= (block->data[++block->byte] >> (8-(nbits-bnum)))
+	& (1<<(nbits-bnum))-1;
+    block->bit = nbits-bnum;
+
+    return val;
+}
+
+/*
+ * Stores up to 32-bits of data in a block
+ */
+static void set_hi_bits(block_t *block, uint32_t val, int nbits) {
+    unsigned int curr = block->data[block->byte];
+    
+    /* Pack first partial byte */
+    if (nbits > 8-block->bit) {
+	curr |= val >> (nbits -= 8-block->bit);
+	block->data[block->byte] = curr;
+	block->data[++block->byte] = 0;
+	block->bit = 0;
+    } else {
+	curr |= val << (8-block->bit - nbits);
+	block->data[block->byte] = curr;
+	if ((block->bit += nbits) == 8) {
+	    block->bit = 0;
+	    block->data[++block->byte] = 0;
+	}
+	return;
+    }
+
+    /* Handle whole bytes worth */
+    while (nbits > 8) {
+	block->data[block->byte++] = (val >> (nbits-=8)) & 0xff;
+    }
+
+    /* And finally any remaining bits left */
+    block->data[block->byte] = (val & ((1<<nbits) - 1)) << (8-nbits);
+    block->bit = nbits;
+}
+
+
+/*
+ * Formats are specified embedded in 'fmt' using a percent-rule, much
+ * like printf().
+ *
+ * Both fmt and suffix are C-style nul terminated strings.
+ *
+ * The format consists of:
+ *
+ * '%' <field-width> <bits-used> <format-code>
+ *
+ * Field-width is a numerical value indicating the number of characters we
+ * wish to print. It is optional as without specifying this we emit as
+ * many characters as are needed to describe the data. If specified the
+ * output is padded to be at least field-width in size. The padding character
+ * may vary on the otuput format, but will typically be '0'.
+ *
+ * Bits-used consists of '.' (a full stop) followed by a numerical value
+ * indicating the number of bits to read from the suffix, starting from
+ * bit 0 or the next free bit following a previous format. If not specified
+ * generally all bits are used (8 * suffix_len) unless otherwise indicated
+ * below.
+ * 
+ * Format-code may be one of:
+ *    'd' decimal values (0-9)
+ *    'o' octal values (0-7)
+ *    'x' hexidecimal values, lowercase
+ *    'X' hexidecimal values, uppercase
+ *    'j' base-36 encoding, lowercase
+ *    'J' base-36 encoding, uppercase (454)
+ *    'c' a single character (default bits used = 8)
+ *    's' string (all bits used, treated as ascii)
+ *    '%' a literal percent character (no bits used).
+ *
+ * Returns the number of bytes written to 'name' on success
+ *         -1 on failure
+ */
+#define emit(c) \
+    if (out_pos < name_len-1) { \
+        name[out_pos++] = (c); \
+    } else { \
+        block_destroy(blk, 1);\
+        return name_len; \
+    }
+
+int construct_trace_name(char *fmt,
+			 unsigned char *suffix, int suffix_len,
+			 char *name, int name_len) {
+    block_t *blk = block_create(suffix, suffix_len);
+    int out_pos = 0;
+    int percent = 0;
+
+    /* Default nul-terminate for abort cases */
+    name[name_len-1] = '\0';
+
+    for(; *fmt; fmt++) {
+	switch(*fmt) {
+
+	/* A format specifier */
+	case '%': {
+	    int width = 0;
+	    int bits = 0;
+	    uint32_t val;
+
+	    fmt++;
+	    percent++;
+
+	    /* Width specifier */
+	    if (0 == (width = strtol(fmt, &fmt, 10)))
+		width = 1; /* minimum width */
+
+	    /* Bit size specifier */
+	    if ('.' == *fmt) {
+		fmt++;
+		bits = strtol(fmt, &fmt, 10);
+	    }
+
+	    /* The format code */
+	    switch (*fmt) {
+		int i;
+
+	    case '%':
+		for (i = 0; i < width; i++) {
+		    emit('%');
+		}
+		break;
+
+	    case 'o':
+	    case 'd':
+	    case 'x':
+	    case 'X':
+	    case 'j':
+	    case 'J': {
+		/* One of the integer encoding formats */
+		char *digits = "0123456789abcdef";
+		int d = 0, tmp_ind = 0;
+		char tmp[1024];
+
+		switch(*fmt) {
+		case 'o': d=8;	break;
+		case 'd': d=10; break;
+		case 'x': d=16; break;
+
+		case 'X':
+		    d=16;
+		    digits = "0123456789ABCDEF";
+		    break;
+
+		case 'j':
+		    d=36;
+		    digits = "abcdefghijklmnopqrstuvwxyz0123456789";
+		    break;
+		    
+		case 'J': /* Used by 454 */
+		    d=36;
+		    digits = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
+		    break;
+		}
+
+		while (bits > 0) {
+		    int32_t sv;
+		    int nb = bits > 32 ? 32 : bits;
+		    if (-1 == (sv = get_hi_bits(blk, nb)))
+			return -1;
+		    val = sv;
+
+		    do {
+			tmp[tmp_ind++] = digits[val % d];
+			val /= d;
+		    } while (val != 0);
+
+		    bits -= nb;
+		}
+
+		/* Pad to requested size */
+		for (i = width; i > tmp_ind; i--)
+		    emit(*digits);
+
+		/* Output the formatted value itself */
+		do {
+		    emit(tmp[--tmp_ind]);
+		} while (tmp_ind != 0);
+
+		break;
+	    }
+
+	    case 'c':
+		/* A single n-bit character */
+		if (!bits)
+		    bits = 8;
+		if (-1 == (val = get_hi_bits(blk, bits)))
+		    return -1;
+
+		emit(val);
+		break;
+
+	    case 's': {
+		/* A string, to the end of suffix, of n-bit characters */
+		if (!bits)
+		    bits = 8;
+		/* Reading n-bits at a time to produce a string */
+		while (-1 != (val = get_hi_bits(blk, bits)))
+		    emit(val);
+		break;
+	    }
+
+	    default:
+		fprintf(stderr, "Unknown arg: %c\n", *fmt);
+	    }
+	    
+	}
+
+	case '\0':
+	    break;
+
+	default:
+	    emit(*fmt);
+	}
+    }
+
+    /*
+     * No percent rule found implies the name is a simple string
+     * concatenation of prefix and suffix
+     */
+    if (!percent) {
+	int i;
+
+	/* A strncpy would be more efficient here */
+	for (i = 0; suffix[i]; i++) {
+	    emit(suffix[i]);
+	}
+    }
+
+    emit('\0');
+
+    block_destroy(blk, 1);
+    return out_pos;
+}
+
+/*
+ * The opposite of above.
+ * Given a format and a set of arguments packs the values into the
+ * supplied 'suffix' string. This should be 256 characters long and the
+ * first byte will consist of the real length.
+ *
+ * Returns 0 on success
+ *        -1 on failuare
+ */
+int pack_trace_suffix(unsigned char *suffix, char *fmt, ...) {
+    block_t *blk = block_create(NULL, 256);
+    va_list args;
+
+    va_start(args, fmt);
+
+    for(; *fmt; fmt++) {
+	switch(*fmt) {
+
+	/* A format specifier */
+	case '%': {
+	    int width = 0;
+	    int bits = 0;
+	    signed int val;
+
+	    fmt++;
+
+	    /* Width specifier - ignore this */
+	    width = strtol(fmt, &fmt, 10);
+
+	    /* Bit size specifier */
+	    if ('.' == *fmt) {
+		fmt++;
+		bits = strtol(fmt, &fmt, 10);
+	    }
+
+	    /* The format code */
+	    switch (*fmt) {
+	    case '%':
+		/* A literal percent */
+		break;
+
+	    case 'o':
+	    case 'd':
+	    case 'x':
+	    case 'X':
+	    case 'j':
+	    case 'J':
+		/* A numeric value - it doesn't matter what format it
+		 * is specified as, just how many bits.
+		 */
+		val = (uint32_t)va_arg(args, int);
+		set_hi_bits(blk, val, bits);
+		break;
+
+	    case 'c':
+		if (!bits)
+		    bits = 8;
+		val = (unsigned char)va_arg(args, int);
+		set_hi_bits(blk, val, bits);
+		break;
+
+	    case 's': {
+		char *s = (char *)va_arg(args, char *);
+		if (!bits)
+		    bits = 8;
+
+		for (; *s; s++) {
+		    set_hi_bits(blk, *s, bits);
+		}
+		break;
+	    }
+
+	    default:
+		fprintf(stderr, "Unknown arg: %c\n", *fmt);
+	    }
+	}
+	}
+    }
+
+    if (blk->byte >= 256)
+	return -1;
+
+    *suffix = blk->byte + (blk->bit > 0);
+    memcpy(suffix+1, blk->data, *suffix);
+
+    return 0;
+}
+
+
+/*
+ * ---------------------------------------------------------------------------
+ * Higher level I/O functions
+ */
+
+/*
+ * Fetches the next trace from an SRF container as a "memory-FILE".
+ * Name, if defined (which should be a buffer of at least 512 bytes long)
+ * will be filled out to contain the read name.
+ * 
+ * Returns mFILE containing trace on success
+ *         NULL on failure.
+ */
+mFILE *srf_next_trace(srf_t *srf, char *name) {
+    do {
+	int type;
+
+	switch(type = srf_next_block_type(srf)) {
+	case -1:
+	    /* EOF */
+	    return NULL;
+
+	case SRFB_NULL_INDEX: {
+	    /*
+	     * Maybe the last 8 bytes of a the file (or previously was
+	     * last 8 bytes prior to concatenating SRF files together).
+	     * If so it's the index length and should always be 8 zeros.
+	     */
+	    uint64_t ilen;
+	    if (1 != fread(&ilen, 8, 1, srf->fp))
+		return NULL;
+	    if (ilen != 0)
+		return NULL;
+	    break;
+	}
+
+	case SRFB_CONTAINER:
+	    if (0 != srf_read_cont_hdr(srf, &srf->ch))
+		return NULL;
+	    break;
+
+	case SRFB_XML:
+	    if (0 != srf_read_xml(srf, &srf->xml))
+		return NULL;
+	    break;
+
+	case SRFB_TRACE_HEADER:
+	    if (0 != srf_read_trace_hdr(srf, &srf->th))
+		return NULL;
+
+	    break;
+
+	case SRFB_TRACE_BODY: {
+	    mFILE *mf = mfcreate(NULL, 0);
+	    srf_trace_body_t tb;
+	    tb.trace = NULL;
+
+	    if (!mf || 0 != srf_read_trace_body(srf, &tb, 0))
+		return NULL;
+
+	    if (name) {
+		if (-1 == construct_trace_name(srf->th.id_prefix,
+					       (unsigned char *)tb.read_id,
+					       tb.read_id_length,
+					       name, 512)) {
+		    return NULL;
+		}
+	    }
+
+	    if (srf->th.trace_hdr_size)
+		mfwrite(srf->th.trace_hdr, 1, srf->th.trace_hdr_size, mf);
+	    if (tb.trace_size)
+		mfwrite(tb.trace, 1, tb.trace_size, mf);
+
+	    if (tb.trace)
+		free(tb.trace);
+
+	    mrewind(mf);
+	    return mf;
+	}
+
+	case SRFB_INDEX: {
+	    off_t pos = ftell(srf->fp);
+	    srf_read_index_hdr(srf, &srf->hdr, 1);
+
+	    /* Skip the index body */
+	    fseeko(srf->fp, pos + srf->hdr.size, SEEK_SET);
+	    break;
+	}
+
+	default:
+	    fprintf(stderr, "Block of unknown type '%c'. Aborting\n", type);
+	    return NULL;
+	}
+    } while (1);
+
+    return NULL;
+}
+
+/*
+ * Decodes a partial ZTR file consisting of data in 'mf'.
+ * Note that mf may contain a partial chunk, so we need to be careful on
+ * error checking.
+ *
+ * If a ztr object is passed in (in 'z') then we assume we've already
+ * loaded the ZTR header and get straight down to decoding the remaining
+ * chunks. Otherwise we also decode the header.
+ *
+ * If no chunk is visible at all then we'll return NULL and rewind mf.
+ * Otherwise we'll leave the file pointer at the start of the next 
+ * partial chunk (or EOF if none) and return the ztr_t pointer.
+ */
+ztr_t *partial_decode_ztr(srf_t *srf, mFILE *mf, ztr_t *z) {
+    ztr_t *ztr;
+    ztr_chunk_t *chunk;
+    long pos = 0;
+
+    if (z) {
+	/* Use existing ZTR object => already loaded header */
+	ztr = z;
+
+    } else {
+	/* Allocate or use existing ztr */
+	if (NULL == (ztr = new_ztr()))
+	    return NULL;
+
+	/* Read the header */
+	if (-1 == ztr_read_header(mf, &ztr->header)) {
+	    if (!z)
+		delete_ztr(ztr);
+	    mrewind(mf);
+	    return NULL;
+	}
+
+	/* Check magic number and version */
+	if (memcmp(ztr->header.magic, ZTR_MAGIC, 8) != 0) {
+	    if (!z)
+		delete_ztr(ztr);
+	    mrewind(mf);
+	    return NULL;
+	}
+
+	if (ztr->header.version_major != ZTR_VERSION_MAJOR) {
+	    if (!z)
+		delete_ztr(ztr);
+	    mrewind(mf);
+	    return NULL;
+	}
+    }
+
+    /* Load chunks */
+    pos = mftell(mf);
+    while (chunk = ztr_read_chunk_hdr(mf)) {
+	chunk->data = (char *)xmalloc(chunk->dlength);
+	if (chunk->dlength != mfread(chunk->data, 1, chunk->dlength, mf))
+	    break;
+
+	ztr->nchunks++;
+	ztr->chunk = (ztr_chunk_t *)xrealloc(ztr->chunk, ztr->nchunks *
+					     sizeof(ztr_chunk_t));
+	memcpy(&ztr->chunk[ztr->nchunks-1], chunk, sizeof(*chunk));
+	xfree(chunk);
+	pos = mftell(mf);
+    }
+
+    /*
+     * At this stage we're 'pos' into the mFILE mf with any remainder being
+     * a partial block.
+     */
+    if (0 == ztr->nchunks) {
+	if (!z)
+	    delete_ztr(ztr);
+	mrewind(mf);
+	return NULL;
+    }
+
+    /* Ensure we exit at the start of a ztr CHUNK */
+    mfseek(mf, pos, SEEK_SET);
+
+    /* If this is the header part, ensure we uncompress and init. data */
+    if (!z) {
+	/* Force caching of huffman code_sets */
+	ztr_find_hcode(ztr, CODE_USER);
+
+	/* And uncompress the rest */
+	uncompress_ztr(ztr);
+    }
+
+    return ztr;
+}
+
+/*
+ * Creates a copy of ztr_t 'src' and returns it. The newly returned ztr_t
+ * will consist of shared components where src and dest overlap, but freeing
+ * dest will know what's appropriate to free and what is not.
+ */
+ztr_t *ztr_dup(ztr_t *src) {
+    ztr_t *dest = new_ztr();
+    int i;
+
+    if (!dest)
+	return NULL;
+
+    /* Basics */
+    *dest = *src;
+
+    /* Mirror chunks */
+    dest->chunk = (ztr_chunk_t *)malloc(src->nchunks * sizeof(ztr_chunk_t));
+    for (i = 0; i < src->nchunks; i++) {
+	dest->chunk[i] = src->chunk[i];
+	dest->chunk[i].ztr_owns = 0; /* src owns the data/meta_data */
+    }
+
+    /* Mirror text_segments; no overlap here */
+    dest->text_segments = (ztr_text_t *)malloc(src->ntext_segments *
+					       sizeof(ztr_text_t));
+    for (i = 0; i < src->ntext_segments; i++) {
+	dest->text_segments[i] = src->text_segments[i];
+    }
+
+    /* huffman hcodes */
+    dest->hcodes = (ztr_hcode_t *)malloc(src->nhcodes * sizeof(ztr_hcode_t));
+    for (i = 0; i < src->nhcodes; i++) {
+	dest->hcodes[i] = src->hcodes[i];
+	dest->hcodes[i].ztr_owns = 0;
+    }
+
+    return dest;
+}
+
+/*
+ * Fetches the next trace from an SRF container as a ZTR object.
+ * This is more efficient than srf_next_trace() if we are serially
+ * reading through many traces as we decode ZTR data less often and can
+ * cache data from one trace to the next.
+ *
+ * Name, if defined (which should be a buffer of at least 512 bytes long)
+ * will be filled out to contain the read name.
+ *
+ * filter_mask should consist of zero or more SRF_READ_FLAG_* bits.
+ * Reads with one or more flags matching these bits will be skipped over.
+ *
+ * flags, if non-NULL, is filled out on exit to contain the SRF flags
+ * from the Data Block structure.
+ *
+ * Returns ztr_t * on success
+ *         NULL on failure.
+ */
+ztr_t *srf_next_ztr_flags(srf_t *srf, char *name, int filter_mask,
+			  int *flags) {
+    do {
+	int type;
+
+	switch(type = srf_next_block_type(srf)) {
+	case -1:
+	    /* EOF */
+	    return NULL;
+
+	case SRFB_NULL_INDEX: {
+	    /*
+	     * Maybe the last 8 bytes of a the file (or previously was
+	     * last 8 bytes prior to concatenating SRF files together).
+	     * If so it's the index length and should always be 8 zeros.
+	     */
+	    uint64_t ilen;
+	    if (1 != fread(&ilen, 8, 1, srf->fp))
+		return NULL;
+	    if (ilen != 0)
+		return NULL;
+	    break;
+	}
+
+	case SRFB_CONTAINER:
+	    if (0 != srf_read_cont_hdr(srf, &srf->ch))
+		return NULL;
+	    break;
+
+	case SRFB_XML:
+	    if (0 != srf_read_xml(srf, &srf->xml))
+		return NULL;
+	    break;
+
+	case SRFB_TRACE_HEADER:
+	    if (0 != srf_read_trace_hdr(srf, &srf->th))
+		return NULL;
+
+	    /* Decode ZTR chunks in the header */
+	    if (srf->mf)
+		mfdestroy(srf->mf);
+
+	    srf->mf = mfcreate(NULL, 0);
+	    if (srf->th.trace_hdr_size)
+		mfwrite(srf->th.trace_hdr, 1, srf->th.trace_hdr_size, srf->mf);
+	    if (srf->ztr)
+		delete_ztr(srf->ztr);
+	    mrewind(srf->mf);
+
+	    if (NULL != (srf->ztr = partial_decode_ztr(srf, srf->mf, NULL))) {
+		srf->mf_pos = mftell(srf->mf);
+	    } else {
+		/* Maybe not enough to decode or no headerBlob. */
+		/* So delay until decoding the body. */
+		srf->mf_pos = 0;
+	    }
+	    mfseek(srf->mf, 0, SEEK_END);
+	    srf->mf_end = mftell(srf->mf);
+
+	    break;
+
+	case SRFB_TRACE_BODY: {
+	    srf_trace_body_t tb;
+	    ztr_t *ztr_tmp;
+
+	    if (!srf->mf || 0 != srf_read_trace_body(srf, &tb, 0))
+		return NULL;
+
+	    if (name) {
+		if (-1 == construct_trace_name(srf->th.id_prefix,
+					       (unsigned char *)tb.read_id,
+					       tb.read_id_length,
+					       name, 512)) {
+		    return NULL;
+		}
+	    }
+
+	    mfseek(srf->mf, srf->mf_end, SEEK_SET);
+	    if (tb.trace_size) {
+		mfwrite(tb.trace, 1, tb.trace_size, srf->mf);
+		free(tb.trace);
+		tb.trace = NULL;
+	    }
+	    mftruncate(srf->mf, mftell(srf->mf));
+	    mfseek(srf->mf, srf->mf_pos, SEEK_SET);
+
+	    if (tb.flags & filter_mask) {
+		break; /* Filtered, so skip it */
+	    } else {
+		if (flags)
+		    *flags = tb.flags;
+		if (srf->ztr)
+		    ztr_tmp = ztr_dup(srf->ztr); /* inefficient, but simple */
+		else
+		    ztr_tmp = NULL;
+
+		return partial_decode_ztr(srf, srf->mf, ztr_tmp);
+	    }
+	}
+
+	case SRFB_INDEX: {
+	    off_t pos = ftell(srf->fp);
+	    srf_read_index_hdr(srf, &srf->hdr, 1);
+
+	    /* Skip the index body */
+	    fseeko(srf->fp, pos + srf->hdr.size, SEEK_SET);
+	    break;
+	}
+
+	default:
+	    fprintf(stderr, "Block of unknown type '%c'. Aborting\n", type);
+	    return NULL;
+	}
+    } while (1);
+
+    return NULL;
+}
+
+ztr_t *srf_next_ztr(srf_t *srf, char *name, int filter_mask) {
+    return srf_next_ztr_flags(srf, name, filter_mask, NULL);
+}
+
+/*
+ * Returns the type of the next block.
+ * -1 for none (EOF)
+ */
+int srf_next_block_type(srf_t *srf) {
+    int c = fgetc(srf->fp);
+    if (c == EOF)
+	return -1;
+
+    ungetc(c, srf->fp);
+
+    return c;
+}
+
+/*
+ * Reads the next SRF block from an archive and returns the block type.
+ * If the block is a trace it'll return the full trace name too (maximum
+ * 512 bytes).
+ *
+ * Returns block type on success, writing to pos and name as appropriate
+ *         -1 on EOF
+ *         -2 on failure
+ */
+int srf_next_block_details(srf_t *srf, uint64_t *pos, char *name) {
+    int type;
+    *pos = ftell(srf->fp);
+
+    switch(type = srf_next_block_type(srf)) {
+    case -1:
+	/* EOF */
+	return -1;
+
+    case SRFB_NULL_INDEX: {
+	/*
+	 * Maybe the last 8 bytes of a the file (or previously was
+	 * last 8 bytes prior to concatenating SRF files together).
+	 * If so it's the index length and should always be 8 zeros.
+	 */
+	uint64_t ilen;
+	if (1 != fread(&ilen, 8, 1, srf->fp))
+	    return -2;
+	if (ilen != 0)
+	    return -2;
+	break;
+    }
+
+    case SRFB_CONTAINER:
+	if (0 != srf_read_cont_hdr(srf, &srf->ch))
+	    return -2;
+	break;
+
+    case SRFB_TRACE_HEADER:
+	if (0 != srf_read_trace_hdr(srf, &srf->th))
+	    return -2;
+	
+	break;
+
+    case SRFB_TRACE_BODY:
+	/* Inefficient, but it'll do for testing purposes */
+	if (0 != srf_read_trace_body(srf, &srf->tb, 1))
+	    return -2;
+
+	if (name) {
+	     if (-1 == construct_trace_name(srf->th.id_prefix,
+					    (unsigned char *)srf->tb.read_id,
+					    srf->tb.read_id_length,
+					    name, 512)) {
+		 return -2;
+	    }
+	}
+	
+	break;
+
+    case SRFB_INDEX:
+	srf_read_index_hdr(srf, &srf->hdr, 1);
+
+	/* Skip the index body */
+	fseeko(srf->fp, *pos + srf->hdr.size, SEEK_SET);
+	break;
+
+
+    default:
+	fprintf(stderr, "Block of unknown type '%c'. Aborting\n", type);
+	return -2;
+    }
+
+    return type;
+}
+
+/*
+ * Searches through 'nitems' 8-byte values stored in 'srf' at file offset
+ * 'start' onwards for the closest value <= 'query'.
+ *
+ * Returns 0 on success, setting *res
+ *        -1 on failure
+ */
+static int binary_scan(srf_t *srf, int nitems, uint64_t start, uint64_t query,
+		       uint64_t *res) {
+    int min = 0;
+    int max = nitems;
+    int guess, i;
+    uint64_t pos = 0, best = 0;
+
+    if (nitems <= 0)
+	return -1;
+
+    /* Binary search on disk for approx location */
+    while (max - min > 100) {
+	guess = (max - min) / 2 + min;
+
+	if (guess == max)
+	    guess = max-1;
+
+	if (-1 == fseeko(srf->fp, guess * 8 + start, SEEK_SET))
+	    return -1;
+	if (0 != srf_read_uint64(srf, &pos))
+	    return -1;
+	if (pos > query) {
+	    max = guess;
+	} else {
+	    min = guess;
+	}
+    }
+
+    /* Within a small distance => linear scan now to avoid needless disk IO */
+    if (-1 == fseeko(srf->fp, min * 8 + start, SEEK_SET))
+	return -1;
+    for (i = min; i < max; i++) {
+	if (0 != srf_read_uint64(srf, &pos))
+	    return -1;
+	if (pos > query) {
+	    break;
+	} else {
+	    best = pos;
+	}
+    }
+
+    assert(best <= query);
+    *res = best;
+
+    return 0;
+}
+
+/*
+ * Searches in an SRF index for a trace of a given name.
+ * If found it sets the file offsets for the container (cpos), data block
+ * header (hpos) and data block (dpos).
+ *
+ * On a test with 2 containers and 12 headers this averaged at 6.1 reads per
+ * trace fetch and 8.0 seeks.
+ *
+ * Returns 0 on success
+ *        -1 on failure (eg no index)
+ *        -2 on trace not found in index.
+ */
+int srf_find_trace(srf_t *srf, char *tname,
+		   uint64_t *cpos, uint64_t *hpos, uint64_t *dpos) {
+    srf_index_hdr_t hdr;
+    uint64_t hval, bnum;
+    uint64_t bucket_pos;
+    off_t ipos, skip;
+    int item_sz = 8;
+
+    /* Check for valid index */
+    if (0 != srf_read_index_hdr(srf, &hdr, 0)) {
+	return -1;
+    }
+    ipos = ftello(srf->fp);
+    skip = hdr.n_container * 8 + hdr.n_data_block_hdr * 8;
+    if (hdr.dbh_pos_stored_sep)
+	item_sz += 4;
+
+    /* Hash and load the bucket */
+    hval = hash64(HASH_FUNC_JENKINS3, (unsigned char *)tname, strlen(tname));
+    bnum = hval & (hdr.n_buckets - 1);
+    if (-1 == fseeko(srf->fp, ipos + skip + bnum * 8, SEEK_SET))
+	return -1;
+
+    if (0 != srf_read_uint64(srf, &bucket_pos))
+	return -1;
+    if (!bucket_pos)
+	return -2;
+
+    /* Secondary hash is the top 7-bits */
+    hval >>= 57;
+
+    /* Jump to the item list */
+    if (-1 == fseeko(srf->fp, ipos-hdr.index_hdr_sz + bucket_pos, SEEK_SET))
+	return -1;
+    for (;;) {
+	char name[1024];
+	int h = fgetc(srf->fp);
+	off_t saved_pos;
+	uint64_t dbh_ind = 0;
+	
+	if ((h & 0x7f) != hval) {
+	    if (h & 0x80)
+		return -2; /* end of list and not found */
+	    /*
+	     * fseeko(srf->fp, 8, SEEK_CUR);
+	     * Use fread instead as it's likely already cached and linux
+	     * fseeko involves a real system call (lseek).
+	     */
+	    fread(dpos, 1, item_sz, srf->fp);
+	    continue;
+	}
+
+	/* Potential hit - investigate to see if it's the real one: */
+	/* Seek to dpos and get trace id suffix. Compare to see if valid */
+	if (0 != srf_read_uint64(srf, dpos))
+	    return -1;
+	if (hdr.dbh_pos_stored_sep) {
+	    if (0 != srf_read_uint64(srf, &dbh_ind))
+		return -1;
+	}
+	saved_pos = ftello(srf->fp);
+	if (-1 == fseeko(srf->fp, (off_t)*dpos, SEEK_SET))
+	    return -1;
+	if (0 != srf_read_trace_body(srf, &srf->tb, 0))
+	    return -1;
+
+	/* Identify the matching hpos (trace header) for this trace body */
+	if (hdr.dbh_pos_stored_sep) {
+	    /* Hack for now - binary scan through 1 object */
+	    if (0 != binary_scan(srf, 1,
+				 ipos + hdr.n_container * 8 + dbh_ind * 8,
+				 *dpos, hpos))
+		return -1;
+	} else {
+	    if (0 != binary_scan(srf, hdr.n_data_block_hdr,
+				 ipos + hdr.n_container * 8,
+				 *dpos, hpos))
+		return -1;
+	}
+
+	/* Check the trace name matches */
+	if (-1 == fseeko(srf->fp, *hpos, SEEK_SET))
+	    return -1;
+	if (0 != srf_read_trace_hdr(srf, &srf->th))
+	    return -1;
+
+	if (-1 == construct_trace_name(srf->th.id_prefix,
+				       (unsigned char *)srf->tb.read_id,
+				       srf->tb.read_id_length,
+				       name, 1024))
+	    return -1;
+
+	if (strcmp(name, tname)) {
+	    /* Not found, continue with next item in list */
+	    if (h & 0x80)
+		return -2;
+	    if (-1 == fseeko(srf->fp, saved_pos, SEEK_SET))
+		return -1;
+	    continue;
+	}
+	
+	/* Matches, so fetch the container data and return out trace */
+	if (0 != binary_scan(srf, hdr.n_container,
+			     ipos, *dpos, cpos))
+	    return -1;
+
+	/* FIXME: what to do with base-caller and cpos */
+
+	break;
+    }
+
+    return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/srf.h	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,190 @@
+#ifndef _SRF_H_
+#define _SRF_H_
+
+#include "io_lib/hash_table.h"
+#include "io_lib/ztr.h"
+#include "io_lib/mFILE.h"
+
+#define SRF_MAGIC		"SSRF"
+#define SRF_VERSION             "1.3"
+
+#define SRFB_CONTAINER 		'S'
+#define SRFB_XML		'X'
+#define SRFB_TRACE_HEADER	'H'
+#define SRFB_TRACE_BODY		'R'
+#define SRFB_INDEX		'I'
+
+/* Lack of index => 8 zero bytes at end of file to indicate zero length */
+#define SRFB_NULL_INDEX		'\0'
+
+/*--- Public structures */
+
+/* Container header - several per file */
+typedef struct {
+    int block_type;
+    char version[256];
+    char container_type;
+    char base_caller[256];
+    char base_caller_version[256];
+} srf_cont_hdr_t;
+
+/* Trace header - several per container */
+typedef struct {
+    int block_type; 
+    char read_prefix_type;
+    char id_prefix[256];
+    uint32_t trace_hdr_size;
+    unsigned char *trace_hdr;
+} srf_trace_hdr_t;
+
+/* Trace body - several per trace header */
+typedef struct {
+    int block_type;
+    int read_id_length;
+    char read_id[256];
+    unsigned char flags;
+    uint32_t trace_size;
+    unsigned char *trace;
+} srf_trace_body_t;
+
+/* XML - NCBI TraceInfo data block */
+typedef struct {
+    uint32_t xml_len;
+    char *xml;
+} srf_xml_t;
+
+#define SRF_READ_FLAG_BAD_MASK       (1<<0)
+#define SRF_READ_FLAG_WITHDRAWN_MASK (1<<1)
+#define SRF_READ_FLAG_USER_MASK      (7<<5)
+
+/* Indexing */
+typedef struct {
+    char     magic[4];
+    char     version[4];
+    uint64_t size;
+    uint32_t n_container;
+    uint32_t n_data_block_hdr;
+    uint64_t n_buckets;
+    int8_t   index_type;
+    int8_t   dbh_pos_stored_sep;
+    char     dbh_file[256];
+    char     cont_file[256];
+    int      index_hdr_sz; /* size of the above data on disk */
+} srf_index_hdr_t;
+
+/* In-memory index itself */
+#define SRF_INDEX_NAME_BLOCK_SIZE 10000000
+
+typedef struct {
+  size_t  used;
+  size_t  space;
+  char   *names;
+} srf_name_block_t;
+
+typedef struct {
+    char ch_file[PATH_MAX+1];
+    char th_file[PATH_MAX+1];
+    Array ch_pos;
+    Array th_pos;
+    Array name_blocks;
+    int dbh_pos_stored_sep;
+    HashTable *db_hash;
+} srf_index_t;
+
+/* Master SRF object */
+typedef struct {
+    FILE *fp;
+
+    /* Cached copies of each of the most recent chunk types loaded */
+    srf_cont_hdr_t    ch;
+    srf_trace_hdr_t   th;
+    srf_trace_body_t  tb;
+    srf_xml_t         xml;
+    srf_index_hdr_t   hdr;
+
+    /* Private: cached data for use by srf_next_ztr */
+    ztr_t *ztr;
+    mFILE *mf;
+    long mf_pos, mf_end;
+} srf_t;
+
+#define SRF_INDEX_MAGIC    "Ihsh"
+#define SRF_INDEX_VERSION  "1.01"
+
+
+/*--- Initialisation */
+srf_t *srf_create(FILE *fp);
+srf_t *srf_open(char *fn, char *mode);
+void srf_destroy(srf_t *srf, int auto_close);
+
+/*--- Base type I/O methods */
+
+int srf_write_pstring(srf_t *srf, char *str);
+int srf_write_pstringb(srf_t *srf, char *str, int length);
+int srf_read_pstring(srf_t *srf, char *str);
+
+int srf_read_uint32(srf_t *srf, uint32_t *val);
+int srf_write_uint32(srf_t *srf, uint32_t val);
+
+int srf_read_uint64(srf_t *srf, uint64_t *val);
+int srf_write_uint64(srf_t *srf, uint64_t val);
+
+
+/*--- Mid level I/O - srf block */
+srf_cont_hdr_t *srf_construct_cont_hdr(srf_cont_hdr_t *ch,
+				       char *bc,
+				       char *bc_version);
+void srf_destroy_cont_hdr(srf_cont_hdr_t *ch);
+int srf_read_cont_hdr(srf_t *srf, srf_cont_hdr_t *ch);
+int srf_write_cont_hdr(srf_t *srf, srf_cont_hdr_t *ch);
+
+int srf_read_xml(srf_t *srf, srf_xml_t *xml);
+int srf_write_xml(srf_t *srf, srf_xml_t *xml);
+
+srf_trace_hdr_t *srf_construct_trace_hdr(srf_trace_hdr_t *th,
+					 char *prefix,
+					 unsigned char *header,
+					 uint32_t header_sz);
+void srf_destroy_trace_hdr(srf_trace_hdr_t *th);
+int srf_read_trace_hdr(srf_t *srf, srf_trace_hdr_t *th);
+int srf_write_trace_hdr(srf_t *srf, srf_trace_hdr_t *th);
+
+srf_trace_body_t *srf_construct_trace_body(srf_trace_body_t *th,
+					   char *suffix,
+					   int suffix_len,
+					   unsigned char *body,
+					   uint32_t body_size,
+					   unsigned char flags);
+void srf_destroy_trace_body(srf_trace_body_t *th);
+int srf_write_trace_body(srf_t *srf, srf_trace_body_t *th);
+int srf_read_trace_body(srf_t *srf, srf_trace_body_t *th, int no_trace);
+
+int srf_read_index_hdr(srf_t *srf, srf_index_hdr_t *hdr, int no_seek);
+int srf_write_index_hdr(srf_t *srf, srf_index_hdr_t *hdr);
+srf_index_t *srf_index_create(char *ch_file, char *th_file, int dbh_sep);
+void srf_index_destroy(srf_index_t *idx);
+void srf_index_stats(srf_index_t *idx, FILE *fp);
+int srf_index_add_cont_hdr(srf_index_t *idx, uint64_t pos);
+int srf_index_add_trace_hdr(srf_index_t *idx, uint64_t pos);
+int srf_index_add_trace_body(srf_index_t *idx, char *name, uint64_t pos);
+int srf_index_write(srf_t *srf, srf_index_t *idx);
+
+/*--- Higher level I/O functions */
+mFILE *srf_next_trace(srf_t *srf, char *name);
+ztr_t *srf_next_ztr_flags(srf_t *srf, char *name, int filter_mask, int *flags);
+ztr_t *srf_next_ztr(srf_t *srf, char *name, int filter_mask);
+
+ztr_t *partial_decode_ztr(srf_t *srf, mFILE *mf, ztr_t *z);
+ztr_t *ztr_dup(ztr_t *src);
+
+int srf_next_block_type(srf_t *srf); /* peek ahead */
+int srf_next_block_details(srf_t *srf, uint64_t *pos, char *name);
+
+int srf_find_trace(srf_t *srf, char *trace,
+		   uint64_t *cpos, uint64_t *hpos, uint64_t *dpos);
+
+int construct_trace_name(char *fmt,
+			 unsigned char *suffix, int suffix_len,
+			 char *name, int name_len);
+
+#endif /* _SRF_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/stdio_hack.h	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,74 @@
+#ifndef _STDIO_HACK_H_
+#define _STDIO_HACK_H_
+
+#include <stdio.h>
+#include "io_lib/mFILE.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * This file will define many of the stdio functions to use the
+ * in-memory versions here. These are sufficient to allow the abi,
+ * scf, etc reading code (but not writing) to transparently operate by
+ * loading the entire file into memory and then doing in-memory
+ * manipulation instead of on-disk manipulation.
+ *
+ * The key use for this though is to allow generation of fake FILE pointers
+ * so that reading from tar files does not requiring writing to disk and
+ * reading back again.
+ */
+
+#define FILE mFILE
+#define fopen mfopen
+#define fclose mfclose
+#define fseek mfseek
+#define ftell mftell
+#define rewind mrewind
+#ifdef feof
+#    undef feof
+#endif
+#define feof mfeof
+#define fread mfread
+#define fwrite mfwrite
+#define fgetc mfgetc
+#define ungetc mungetc
+#define fgets mfgets
+#define fflush mfflush
+#define fprintf mfprintf
+
+#ifdef stdin
+#    undef stdin
+#    undef stdout
+#    undef stderr
+#endif
+#define stdin mstdin()
+#define stdout mstdout()
+#define stderr mstderr()
+
+#define fread_abi  mfread_abi
+#define fwrite_abi mfwrite_abi
+#define fread_alf  mfread_alf
+#define fwrite_alf mfwrite_alf
+#define fread_ctf  mfread_ctf
+#define fwrite_ctf mfwrite_ctf
+#define fread_pln  mfread_pln
+#define fwrite_pln mfwrite_pln
+#define fread_scf  mfread_scf
+#define fwrite_scf mfwrite_scf
+#define fread_ztr  mfread_ztr
+#define fwrite_ztr mfwrite_ztr
+
+#define exp_fread_info exp_mfread_info
+#define exp_print_file exp_print_mfile
+
+#define open_trace_file open_trace_mfile
+#define fread_reading mfread_reading
+#define fwrite_reading mfwrite_reading
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _STDIO_HACK_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/strings.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,168 @@
+/*
+ * Copyright (c) Medical Research Council 1994. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+#include "io_lib/misc.h"
+#include <stdlib.h>
+#include <ctype.h>
+#include <string.h>
+#include <sys/types.h>
+
+int fstrlen(char *f, int max_f)
+{
+    for (; max_f > 0 && (isspace(f[max_f-1]) || f[max_f-1]=='\0'); max_f--);
+    return max_f;
+}
+
+
+
+
+
+void f2cstr(char *f, int max_f, char *c, int max_c)
+{
+    int i;
+
+    i = min(fstrlen(f,max_f),max_c);
+    strncpy(c,f,i);
+    c[i]='\0';
+}
+
+
+void c2fstr(char *c, int max_c, char *f, int max_f)
+{
+    int i;
+    i = min((int)strlen(c),max_f);
+    strncpy(f,c,i);
+    for( ; i<max_f; i++) f[i]=' ';
+
+}
+
+
+
+
+char *mystrtok(char *s, char *ct)
+/*
+** When strtok isn't good enough
+*/
+{
+    char *this;
+    static char *look;
+    static int last;
+
+    if (s == NULL) {
+	if (last) return NULL;
+    } else {
+	look = s;
+	last = 0;
+    }
+    this = look;
+
+    for ( ; *look && strchr(ct,*look)==NULL; look++ ) ;
+    last = (! *look);
+    *look++ = '\0';
+    
+    return this;
+}
+
+
+void str_tolower (char *s)
+/*
+** Convert string to lower case
+*/
+{
+    if (!s) return;
+    for ( ; *s ; s++ )
+	if (isupper(*s))
+	    *s = tolower(*s);
+}
+
+void str_toupper (char *s)
+/*
+** Convert string to upper case
+*/
+{
+    if (!s) return;
+    for ( ; *s ; s++ )
+	if (islower(*s))
+	    *s = toupper(*s);
+}
+
+#ifdef NOSTRSTR
+/*
+** My routines for nice sun ones.
+*/
+char *strstr(char *cs, char *ct)
+/*
+** ANSI C has the function strstr().
+**
+**     strstr() returns a pointer to the first  occurrence  of  the
+**     pattern  string  s2  in  s1.   For example, if s1 is "string
+**     thing" and s2 is "ing", strstr() returns "ing thing".  If s2
+**     does not occur in s1, strstr() returns NULL.
+**
+** It's not always implemented. Here's my cludge:
+*/
+{
+    int i;
+    int len_ct;
+    int end;
+    len_ct = strlen(ct);
+    end = strlen(cs) - len_ct;
+    for (i=0;i<=end;i++)
+      if (strncmp(&cs[i],ct,len_ct)==0)
+	return &cs[i];
+
+    return NULL;
+}
+#endif
+
+#ifdef NOSTRDUP
+char *strdup(const char *str)
+/*
+** SunOS has a nice strdup() function.
+**
+**     strdup() returns a pointer to a new string which is a dupli-
+**     cate  of the string pointed to by s1.  The space for the new
+**     string is obtained using malloc(3V).  If the new string can-
+**     not be created, a NULL pointer is returned.
+**
+** Other ANSI C libraries don't have this. Here is my kludge:
+*/
+{
+    char *newstr;
+    int i = strlen(str);
+
+    if ((newstr = (char *)malloc((unsigned int)(i+1))) == NULL)
+        return NULL;
+
+    for (; i>=0; i--)
+        newstr[i] = str[i];
+
+    return newstr;
+}
+#endif
+
+#ifdef NOSTRCASECMP
+int strcasecmp(const char *s1, const char *s2) {
+    while (tolower(*s1) == tolower(*s2)) {
+        /* If at the end of the string, then they're equal */
+        if (0 == *s1)
+	    return 0;
+        s1++;
+	s2++;
+    }
+  
+    /* One ended before the other, so return 1 or -1 */
+    return (*(unsigned char *)s1) < (*(unsigned char *)s2) ? -1 : 1;
+}
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/tar_format.h	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,56 @@
+#ifndef _TAR_FORMAT_H
+#define _TAR_FORMAT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Our own tar block defines - we cannot rely on UNIX to provide these for us
+ * as the sun tar.h is minimal and Alliant's does not even exist.
+ */
+#define TBLOCK  512
+#define NAMSIZ  100
+
+/* Values used in typeflag field. */
+#define REGTYPE         '0'             /* Regular File */
+#define AREGTYPE        '\0'            /* Regular File */
+#define LNKTYPE         '1'             /* Hard Link */
+#define SYMTYPE         '2'             /* Symbolic Link */
+#define CHRTYPE         '3'             /* Character Special File */
+#define BLKTYPE         '4'             /* Block Special File */
+#define DIRTYPE         '5'             /* Directory */
+#define FIFOTYPE        '6'             /* FIFO */
+#define CONTTYPE        '7'             /* Reserved */
+
+/*
+ * There will usually be more data than this in a tar header - but we don't
+ * need to concern ourselves with it.
+ */
+typedef union hblock {
+    char data[TBLOCK];
+    struct header {
+	char name[NAMSIZ];
+	char mode[8];
+	char uid[8];
+	char gid[8];
+	char size[12];
+	char mtime[12];
+	char chksum[8];
+	char typeflag;
+	char linkname[NAMSIZ];
+	char magic[6];
+	char version[2];
+	char uname[32];
+	char gname[32];
+	char devmajor[8];
+	char devminor[8];
+	char prefix[155];
+    } header;
+} tar_block;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/traceType.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,240 @@
+/*
+ * Copyright (c) Medical Research Council 1994. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+/*
+  Title:  traceType
+
+  File:   traceType.c
+  Purpose: determining trace format
+
+  Last update: 01/09/94
+
+  Change log : Update for use with the Read library.
+*/
+
+/* ---- Imports ---- */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "io_lib/stdio_hack.h"
+
+#include "io_lib/traceType.h"
+#include "io_lib/Read.h"
+#include "io_lib/open_trace_file.h"
+
+#ifdef USE_BIOLIMS
+#include "spBiolims.h"
+#endif
+
+#ifndef isascii
+#define isascii(c) ((c) >= 0 && (c) <= 0x7f)
+#endif
+
+/* ---- Privates ---- */
+static struct {
+    int type;
+    int offset;
+    char *string;
+} magics[] = {
+	{ TT_SCF, 0,   ".scf" } ,
+	{ TT_CTF, 1,   "\007\375\343\000" } ,   /* mieg */
+	{ TT_ZTR, 0,   "\256ZTR\r\n\032\n" } ,
+	{ TT_ABI, 0,   "ABIF" } ,
+	{ TT_ABI, 128, "ABIF" } ,
+	{ TT_ALF, 518, "ALF " } ,
+	{ TT_SCF, 0,   "\234\330\300\000" }, /* Amersham variant */
+	{ TT_SFF, 0,   ".sff" } ,
+	{ TT_EXP, 0,	"ID   " } ,
+	{ TT_ALF, 0,   "ALF " } , /* Added by newer alfsplit programs */
+	{ TT_ALF, 0,   "\021G\021G" } , /* Pharmacia's alfsplit equiv */
+	{ TT_ALF, 1546,"X-axis" } /* Good guestimation if all else fails */
+};
+
+#define Number(A) ( sizeof(A) / sizeof((A)[0]) )
+
+/* ---- exported ---- */
+
+/* unix specific file deletion routine */
+int remove_file(char *fn) { return unlink(fn); }
+
+
+/*
+ * Determine the trace type for FILE * 'fp'.
+ *
+ * NB - This function should NOT be used when biolims support is required
+ * (as biolims doesn't use files !)
+ *
+ * Returns:
+ *     TT_SCF, TT_CTF, TT_ZTR, TT_ABI, TT_ALF, or TT_PLN for success.
+ *     TT_UNK for unknown type.
+ *     TT_ERR for error.
+ */
+int fdetermine_trace_type(FILE *fp)
+{
+    unsigned int i;
+    size_t len;
+    char buf[512];
+    int ps;
+    int acgt;
+    int c;
+
+    /* check magics */
+    for (i = 0 ; i < Number(magics) ; i++) {
+	if (fseek(fp,magics[i].offset,0) == 0) {
+	    len = strlen(magics[i].string);
+	    if (fread(buf,1,len,fp)==len) {
+		if (strncmp(buf,magics[i].string,len)==0) {
+		    return magics[i].type;
+		}
+	    }
+	}
+    }
+    fseek(fp, 0, 0);
+
+    /* determine if this is a text file */
+    len = 0; ps = 0; acgt = 0;
+    for (i = 0; i < 512; i++) {
+	if ( ( c = fgetc(fp) ) == EOF ) break;
+	switch(c) {
+	case 'a': case 'c': case 'g': case 't':
+	case 'A': case 'C': case 'G': case 'T':
+	/*YUK! need the next line?*/
+	case 'n': case 'N': case '-':
+	    acgt++;
+	default:
+	    len++;
+	    if ( (isprint(c) && isascii(c)) || isspace(c) ) ps++;
+	}
+    }
+    fseek(fp, 0, 0);
+    /*YUK! 75% of characters printable means text*/
+    if ( 100 * (size_t)ps > 75 * len ) {
+	/*YUK! 75% of printables ACGTN means plain*/
+	if (100 * acgt > 75 * ps) {
+	    return TT_PLN;
+	}
+    }
+
+    /* YUK! short files are not traces? */
+    if (len<512) {
+        return TT_UNK;
+    }
+
+    return TT_UNK;
+}
+
+/*
+ * Determine the trace type for file 'fn'.
+ *
+ * Returns:
+ *     TT_SCF, TT_CTF, TT_ZTR, TT_ABI, TT_ALF, TT_BIO, or TT_PLN for success.
+ *     TT_UNK for unknown type.
+ *     TT_ERR for error.
+ */
+int determine_trace_type(char *fn)
+{
+    FILE *fp;
+    int r;
+
+#ifdef USE_BIOLIMS
+    if(IS_BIOLIMS_PATH(fn))
+      return TT_BIO;
+#endif
+
+    if ( (fp = open_trace_file(fn, NULL)) == NULL ) return TT_ERR;
+
+    r = fdetermine_trace_type(fp);
+    fclose(fp);
+
+    return r;
+}
+
+/*
+ * Converts a trace type string to an integer.
+ */
+int trace_type_str2int(char *str) {
+    if (strcmp(str, "SCF") == 0 || strcmp(str, "scf") == 0)
+	return TT_SCF;
+    else if (strcmp(str, "SFF") == 0 || strcmp(str, "sff") == 0)
+        return TT_SFF;   /* 454 */
+    else if (strcmp(str, "CTF") == 0 || strcmp(str, "ctf") == 0)
+        return TT_CTF;   /* mieg */
+    else if (strcmp(str, "ZTR") == 0 || strcmp(str, "ztr") == 0)
+        return TT_ZTR;
+    else if (strcmp(str, "ZTR1") == 0 || strcmp(str, "ztr1") == 0)
+        return TT_ZTR1;
+    else if (strcmp(str, "ZTR2") == 0 || strcmp(str, "ztr2") == 0)
+        return TT_ZTR2;
+    else if (strcmp(str, "ZTR3") == 0 || strcmp(str, "ztr3") == 0)
+        return TT_ZTR3;
+    else if (strcmp(str, "ABI") == 0 || strcmp(str, "abi") == 0)
+	return TT_ABI;
+    else if (strcmp(str, "ALF") == 0 || strcmp(str, "alf") == 0)
+	return TT_ALF;
+    else if (strcmp(str, "PLN") == 0 || strcmp(str, "pln") == 0)
+	return TT_PLN;
+    else if (strcmp(str, "EXP") == 0 || strcmp(str, "exp") == 0)
+	return TT_EXP;
+    else if (strcmp(str, "BIO") == 0 || strcmp(str, "bio") == 0)
+        return TT_BIO;
+    else if (strcmp(str, "ANYTR") == 0 || strcmp(str, "anytr") == 0)
+        return TT_ANYTR;
+    else
+	return TT_UNK;
+}
+
+/*
+ * Converts a trace type integer to a string.
+ */
+char *trace_type_int2str(int type) {
+    char *t;
+
+    switch(type) {
+    case TT_SCF: t = "SCF"; break;
+    case TT_SFF: t = "SFF"; break;  /* 454 */
+    case TT_CTF: t = "CTF"; break;  /* mieg */
+    case TT_ZTR: t = "ZTR";break;
+    case TT_ZTR1: t = "ZTR1";break;
+    case TT_ZTR2: t = "ZTR2";break;
+    case TT_ZTR3: t = "ZTR3";break;
+    case TT_ABI: t = "ABI"; break;
+    case TT_ALF: t = "ALF"; break;
+    case TT_PLN: t = "PLN"; break;
+    case TT_EXP: t = "EXP"; break;
+    case TT_BIO: t = "BIO"; break;
+    case TT_ANYTR: t="ANYTR"; break;
+    default:
+    case TT_UNK: t = "UNK"; break;
+    }
+
+    return t;
+}
+
+/*
+ * Returns a statically declared string containing a 3 character
+ * identifier for the trace type of this file.
+ * "ERR" represents error, and "UNK" for unknown.
+ * Successful values are "SCF", "ABI", "ALF", "PLN", "CTF", "ZTR" and "BIO".
+ */
+char *trace_type_str(char *traceName)
+{
+    int t;
+
+    if ((t = determine_trace_type(traceName)) == TT_ERR)
+	return "ERR";
+    else
+	return trace_type_int2str(t);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/traceType.h	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) Medical Research Council 1994. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+#ifndef _traceType_h
+#define _traceType_h
+
+/*
+ * Title:       traceType.h
+ * 
+ * File:        traceType.h
+ * Purpose:     determining traceType of traces
+ * Last update: Tue Jan 15 1991
+ *
+ * Change log :-
+ */
+
+/* ---- Imports ---- */
+
+#include <stdio.h>      /* IMPORT: fopen, fclose, fseek, ftell, fgetc */
+#include <ctype.h>      
+#include <string.h>     /* IMPORT: isprint*/
+
+#include "io_lib/Read.h"	/* IMPORT: TT_xxx defines */
+#include "io_lib/mFILE.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Determine the trace type for file 'fn'.
+ *
+ * Returns:
+ *     TT_SCF, TT_ABI, TT_ALF, or TT_PLN for success.
+ *     TT_UNK for unknown type.
+ *     TT_ERR for error.
+ */
+extern int determine_trace_type(char *fn);
+
+/*
+ * Determine the trace type for FILE * 'fp'.
+ *
+ * Returns:
+ *     TT_SCF, TT_ABI, TT_ALF, or TT_PLN for success.
+ *     TT_UNK for unknown type.
+ *     TT_ERR for error.
+ */
+extern int fdetermine_trace_type(mFILE *fp);
+
+/*
+ * Returns a statically declared string containing a 3 character
+ * identifier for this trace type.
+ * "ERR" represents error, and "UNK" for unknown.
+ * Successful values are "SCF", "ABI", "ALF" and "PLN".
+ */
+extern char *trace_type_str(char *traceName);
+
+/*
+ * Converts a trace type string to an integer.
+ */
+extern int trace_type_str2int(char *str);
+
+/*
+ * Converts a trace type integer to a string.
+ */
+char *trace_type_int2str(int type);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*_traceType_h*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/translate.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,1005 @@
+/*
+ * Copyright (c) Medical Research Council 1994. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+/*
+ * File:	translate.c
+ * Purpose:	Translates between different reading structures.
+ * Last update:	01/09/94
+ */
+
+#include <stdio.h>
+#ifndef NDEBUG
+#    define NDEBUG /* disable assertions */
+#endif
+#include <assert.h>
+
+#include "io_lib/stdio_hack.h"
+#include "io_lib/misc.h"
+#include "io_lib/scf.h"
+#include "io_lib/Read.h"
+#include "io_lib/expFileIO.h"
+#include "io_lib/traceType.h"
+#include "io_lib/translate.h"
+#include "io_lib/open_trace_file.h"
+#ifdef USE_BIOLIMS
+#include "spBiolims.h"
+#endif
+
+
+
+#ifdef IOLIB_SCF
+/*
+ * Translates an Scf structure into a Read structure.
+ * The Scf structure is left unchanged.
+ *
+ * Returns:
+ *    A pointer to an allocated Read structure upon success.
+ *    NULLRead upon failure.
+ */
+Read *scf2read(Scf *scf) {
+    Read *read;
+    register int i, i_end;
+    TRACE max_val = 0;
+    int sections = read_sections(0);
+    int nsamples = 0;
+    int nbases = 0;
+
+    /* allocate */
+    if (sections & READ_SAMPLES)
+	nsamples = scf->header.samples;
+    if (sections & READ_BASES)
+	nbases = scf->header.bases;
+    read = read_allocate(nsamples, nbases);
+
+    if (NULLRead == read)
+	return NULLRead;
+
+    if (sections & READ_SAMPLES) {
+	/* copy the samples */
+	i_end = scf->header.samples;
+	read->NPoints = i_end;
+	
+	if (scf->header.sample_size == 1) {
+	    for (i = 0; i < i_end; i++) {
+		read->traceA[i] = scf->samples.samples1[i].sample_A;
+		read->traceC[i] = scf->samples.samples1[i].sample_C;
+		read->traceG[i] = scf->samples.samples1[i].sample_G;
+		read->traceT[i] = scf->samples.samples1[i].sample_T;
+		
+		if (read->traceA[i] > max_val) max_val = read->traceA[i];
+		if (read->traceC[i] > max_val) max_val = read->traceC[i];
+		if (read->traceG[i] > max_val) max_val = read->traceG[i];
+		if (read->traceT[i] > max_val) max_val = read->traceT[i];
+	    }
+	} else { /* sample_size == 2 */
+	    for (i = 0; i < i_end; i++) {
+		read->traceA[i] = scf->samples.samples2[i].sample_A;
+		read->traceC[i] = scf->samples.samples2[i].sample_C;
+		read->traceG[i] = scf->samples.samples2[i].sample_G;
+		read->traceT[i] = scf->samples.samples2[i].sample_T;
+		
+		if (read->traceA[i] > max_val) max_val = read->traceA[i];
+		if (read->traceC[i] > max_val) max_val = read->traceC[i];
+		if (read->traceG[i] > max_val) max_val = read->traceG[i];
+		if (read->traceT[i] > max_val) max_val = read->traceT[i];
+	    }
+	}
+	
+	read->maxTraceVal = max_val;
+    }
+    
+    if (sections & READ_BASES) {
+	/* copy the bases */
+	i_end = scf->header.bases;
+	read->NBases = i_end;
+
+	for (i = 0; i < i_end; i++) {
+	    read->basePos[i] = scf->bases[i].peak_index;
+	    read->prob_A[i]  = scf->bases[i].prob_A;
+	    read->prob_C[i]  = scf->bases[i].prob_C;
+	    read->prob_G[i]  = scf->bases[i].prob_G;
+	    read->prob_T[i]  = scf->bases[i].prob_T;
+	    read->base[i]    = scf->bases[i].base;
+	}
+	read->base[i] = 0;
+    }
+    
+    if (sections & READ_COMMENTS) {
+	/* allocate and copy the comments */
+	if (scf->header.comments_size > 0 && scf->comments) {
+	    read->info = (char *)xmalloc(scf->header.comments_size+1);
+	    if (NULL == read->info) {
+		read_deallocate(read);
+		return NULLRead;
+	    }
+
+	    memcpy(read->info, scf->comments, scf->header.comments_size);
+	    read->info[scf->header.comments_size] = '\0';
+	}
+    }
+
+    /* other bits and pieces */
+    read->leftCutoff = scf->header.bases_left_clip;
+    read->rightCutoff = read->NBases - scf->header.bases_right_clip + 1;
+    read->format = TT_SCF;
+
+    if (scf->private_data) {
+	read->private_data = xmalloc(scf->header.private_size);
+	memcpy(read->private_data,scf->private_data, scf->header.private_size);
+    }
+
+    return read;
+}
+
+/*
+ * Translates a Read structure into a Scf structure.
+ * The Read structure is left unchanged.
+ *
+ * Returns:
+ *    A pointer to an allocated Scf structure upon success.
+ *    NULL upon failure.
+ */
+Scf *read2scf(Read *read) {
+    Scf *scf;
+    register int i, i_end;
+    int sample_size;
+
+    /* allocate */
+    sample_size = read->maxTraceVal >= 0x100 ? 2 : 1;
+    scf = scf_allocate(read->NPoints, sample_size, read->NBases, 0, 0);
+    if (NULL == scf)
+	return NULL;
+
+    /* copy the samples */
+    i_end = read->NPoints;
+    scf->header.samples = i_end;
+
+    if (sample_size == 1) {
+	scf->header.sample_size = 1;
+	for (i = 0; i < i_end; i++) {
+	    scf->samples.samples1[i].sample_A = (uint_1)read->traceA[i];
+	    scf->samples.samples1[i].sample_C = (uint_1)read->traceC[i];
+	    scf->samples.samples1[i].sample_G = (uint_1)read->traceG[i];
+	    scf->samples.samples1[i].sample_T = (uint_1)read->traceT[i];
+	}
+    } else {
+	scf->header.sample_size = 2;
+	for (i = 0; i < i_end; i++) {
+	    scf->samples.samples2[i].sample_A = read->traceA[i];
+	    scf->samples.samples2[i].sample_C = read->traceC[i];
+	    scf->samples.samples2[i].sample_G = read->traceG[i];
+	    scf->samples.samples2[i].sample_T = read->traceT[i];
+	}
+    }
+
+    /* copy the bases */    
+    i_end = read->NBases;
+    scf->header.bases = i_end;
+    
+    for (i = 0; i < i_end; i++) {
+	scf->bases[i].peak_index = read->basePos ? read->basePos[i] : i;
+	scf->bases[i].prob_A     = read->prob_A  ? read->prob_A[i] : 0;
+	scf->bases[i].prob_C     = read->prob_A  ? read->prob_C[i] : 0;
+	scf->bases[i].prob_G     = read->prob_A  ? read->prob_G[i] : 0;
+	scf->bases[i].prob_T     = read->prob_A  ? read->prob_T[i] : 0;
+	scf->bases[i].base       = read->base    ? read->base[i] : '-';
+    }
+
+    /* allocate and copy the comments */
+    if (read->info) {
+	scf->header.comments_size = strlen(read->info) + 1;
+	scf->comments = (char *)xmalloc(scf->header.comments_size);
+	if (NULL == scf->comments) {
+	    scf_deallocate(scf);
+	    return NULL;
+	}
+
+	memcpy(scf->comments, read->info, scf->header.comments_size - 1);
+
+	/* just to make sure */
+	scf->comments[scf->header.comments_size-1] = '\0';
+    }
+
+    /* other bits and pieces */
+    scf->header.bases_left_clip = read->leftCutoff;
+    scf->header.bases_right_clip = read->NBases - read->rightCutoff + 1;
+    scf->header.code_set = CSET_DEFAULT;
+    memcpy(scf->header.version, scf_version_float2str(SCF_VERSION), 4);
+
+    return scf;
+}
+#endif /* IOLIB_SCF */
+
+
+#ifdef IOLIB_EXP
+
+#define extend(e, entry, len) \
+do { \
+    (void)ArrayRef(e->entries[entry],e->Nentries[entry]++); \
+    if (NULL == (exp_get_entry(e, entry) = (char *)xmalloc(len))) \
+	return NULL; \
+} while (0)
+
+/*
+ * Translates a Read structure and an Experiment file.
+ * The Read structure is left unchanged.
+ *
+ * Returns:
+ *    A pointer to an allocated Exp_info structure upon success.
+ *    NULL upon failure.
+ */
+Exp_info *read2exp(Read *read, char *EN) {
+    Exp_info *e;
+    char *t = trace_type_int2str(read->format), *p;
+    int l = strlen(EN)+1;
+    char *sq;
+    int i;
+    static char valid_bases[256];
+    static int valid_setup = 0;
+
+    if (!valid_setup) {
+	for (i = 0; i < 256; i++)
+	    valid_bases[i] = '-';
+	/* IUBC codes */
+	for (sq = "acgturymkswbdhvnACGTURYMKSWBDHVN"; *sq; sq++)
+	    valid_bases[(unsigned)*sq] = *sq;
+	valid_setup = 1;
+    }
+
+    if (NULL == (e = exp_create_info()))
+	return NULL;
+
+    /* Copy original exp file if present */
+    if (read->orig_trace && read->orig_trace_format == TT_EXP) {
+	int i, j, k;
+	Exp_info *re = (Exp_info *)read->orig_trace;
+
+	for (i = 0; i < MAXIMUM_EFLTS; i++) {
+	    if (EFLT_SQ == i ||
+		EFLT_QL == i ||
+		EFLT_QR == i)
+		continue;
+
+	    if (0 == (k = exp_Nentries(re, i)))
+		continue;
+
+	    e->Nentries[i] = k;	    
+	    ArrayRef(e->entries[i], e->Nentries[i]);
+	    for (j = 0; j < k; j++) {
+		arr(char *, e->entries[i], j) =
+		    strdup(arr(char *, re->entries[i], j));
+	    }
+	}
+
+    /* Otherwise create our EN, ID, LN and LT lines */
+    } else {
+	/* Entry name and ID lines */
+	if (p = strrchr(EN, '/'))
+	    EN = p+1;
+	extend(e, EFLT_EN, l);
+	sprintf(exp_get_entry(e, EFLT_EN), "%s", EN);
+	extend(e, EFLT_ID, l);
+	sprintf(exp_get_entry(e, EFLT_ID), "%s", EN);
+
+	/* Trace file & type */
+	if (read->trace_name) {
+	    char *cp;
+	    if (cp = strrchr(read->trace_name, '/'))
+		cp++;
+	    else
+		cp = read->trace_name;
+	    extend(e, EFLT_LN, strlen(cp)+1);
+	    strcpy(exp_get_entry(e, EFLT_LN), cp);
+	}
+
+	if (read->format != TT_ANY && read->format != TT_ANYTR) {
+	    extend(e, EFLT_LT, strlen(t)+1);
+	    strcpy(exp_get_entry(e, EFLT_LT), t);
+	}
+    }
+
+    /* Output SQ, QL and QR lines */
+
+    /* Cutoffs */
+    if (read->leftCutoff) {
+	extend(e, EFLT_QL, 15);
+	sprintf(exp_get_entry(e, EFLT_QL), "%d", read->leftCutoff);
+    }
+
+    if (read->rightCutoff && read->rightCutoff != read->NBases+1) {
+	extend(e, EFLT_QR, 15);
+	sprintf(exp_get_entry(e, EFLT_QR), "%d", read->rightCutoff);
+    }
+
+    /* Bases */
+    extend(e, EFLT_SQ, read->NBases+1);
+    sq = exp_get_entry(e, EFLT_SQ);
+    for (i = 0; i < read->NBases; i++) {
+	sq[i] = valid_bases[(unsigned)read->base[i]];
+    }
+    sq[i] = 0;
+
+#ifdef USE_BIOLIMS
+    /*
+     * Johnt:
+     * - Added tags below to allow for biolims update
+     * - This is all a very big bodge to allow BioLIMS
+     *   attributes to be passed through the Read structure
+     *   to the Experiment file
+     * - Any changes to this should also be mirrored in ../biolims/Exp.cpp
+     */
+    {
+	int1 *qa; /* quality array */
+	int i;
+	char tmp[1024];
+	char *line; /* current line from info */
+	char *end;  /* end of current line */
+	
+	/* AV only supports a single prob value for now */
+	qa = (int1 *)malloc((read->NBases+1)*sizeof(int1));
+
+	/* need max 4 bytes per value - see conf2str */
+	extend(e,EFLT_AV,(read->NBases+1)*5);
+
+	/* merge into single quality array */
+	for(i=0;i<read->NBases;i++){
+	    switch(read->base[i]){
+	    case 'a':
+	    case 'A':
+		qa[i] = read->prob_A[i];
+		break;
+	    case 'c':
+	    case 'C':
+		qa[i] = read->prob_C[i];
+		break;
+	    case 'g':
+	    case 'G':
+		qa[i] = read->prob_G[i];
+		break;
+	    case 't':
+	    case 'T':
+		qa[i] = read->prob_T[i];
+		break;
+	    default:
+		qa[i] = 0;
+	    }
+	}
+	conf2str(qa,read->NBases,exp_get_entry(e, EFLT_AV));
+	free(qa);
+	
+	/* Parse the read notes for everything else */
+	if( read->info) {
+	    for(line=read->info;end=strchr(line,'\n');line=end+1){
+		*end='\0'; /* * put back */
+
+		/* look for known tags */
+		if(!strncmp(line,EXP_CHEM,EXP_TAGLEN)){
+		    /* CH */
+		    int chem=0;
+		    extend(e, EFLT_CH, 15);
+		    if( !strcmp(CH_types[1],line+EXP_TAGLEN))
+			chem=1;
+		    sprintf(exp_get_entry(e, EFLT_CH), "%d",chem );
+
+		} else if(!strncmp(line,EXP_PRMR,EXP_TAGLEN)){
+		    /* PR */
+		    int primer=0;
+		    extend(e,EFLT_PR,15);
+		    for(primer=1;primer<nPR_types;primer++)
+			if(!strcmp(PR_types[i],line+EXP_TAGLEN))
+			    break;
+		    if(primer>=nPR_types)
+			primer=1;
+		    sprintf(exp_get_entry(e, EFLT_PR), "%d",primer);
+
+		} else if(!strncmp(line,EXP_VECT,EXP_TAGLEN)){
+		    /* SV */
+		    extend(e,EFLT_SV,strlen(line)-EXP_TAGLEN+1);
+		    strcpy(exp_get_entry(e, EFLT_SV),line+EXP_TAGLEN);
+
+		} else if(!strncmp(line,EXP_CLOV,EXP_TAGLEN)){
+		    /* CV */
+		    extend(e,EFLT_CV,strlen(line)-EXP_TAGLEN+1);
+		    strcpy(exp_get_entry(e, EFLT_CV),line+EXP_TAGLEN);
+
+		} else if(!strncmp(line,EXP_CLON,EXP_TAGLEN)){
+		    /* CN */
+		    extend(e,EFLT_CN,strlen(line)-EXP_TAGLEN+1);
+		    strcpy(exp_get_entry(e, EFLT_CN),line+EXP_TAGLEN);
+
+		} else if(!strncmp(line,EXP_FEAT,EXP_TAGLEN)){
+		    /* FEAT=start stop key\r\rcomment */
+		    /* key and comment have \n encoded as \r */
+		    int start,stop,i;
+		    char *key; /* biolims feature key */
+		    char *comment; /* biolims feature comment */
+		    line+=EXP_TAGLEN;
+		    start=atoi(line);
+		    line=strchr(line,' ')+1;
+		    stop=atoi(line);
+		    key=strchr(line,' ')+1;
+		    comment=strstr(key,"\r\r");
+		    *comment='\0'; /* * put back */
+		    comment+=2;
+		    /* replace \r with \n in key and comment */
+		    for(i=0;key[i];i++)
+			if(key[i]=='\r') key[i]='\n';
+		    for(i=0;comment[i];i++)
+			if(comment[i]=='\r') comment[i]='\n';
+		    /* could possibly be one of a number of EXP tags excoded
+		       as a BioLIMS feature */
+		    if(!strncmp(key,featCLON,STADEN_FKEY_LEN)){
+			/* CS */
+			extend(e, EFLT_CS, 32);
+			exp_create_range(exp_get_entry(e, EFLT_CS),start,stop);
+		    } else if(!strncmp(key,featVECI,STADEN_FKEY_LEN)){
+			/* SI */
+			extend(e, EFLT_SI, 32);
+			exp_create_range(exp_get_entry(e, EFLT_SI),start,stop);
+		    } else if(!strncmp(key,featTEMP,STADEN_FKEY_LEN)){
+			/* TN */
+			extend(e, EFLT_TN, strlen(comment)+1);
+			strcpy(exp_get_entry(e, EFLT_TN),comment);
+		    } else if(!strncmp(key,featSTRD,STADEN_FKEY_LEN)){
+			/* ST */
+			extend(e, EFLT_ST, strlen(comment)+1);
+			strcpy(exp_get_entry(e, EFLT_ST),comment);
+		    } else if( !strncmp(key,featVECT,STADEN_FKEY_LEN)){
+			/* SL and SR */
+			extend(e,EFLT_SL,15);
+			extend(e,EFLT_SR,15);
+			sprintf(exp_get_entry(e, EFLT_SL),"%d",start);
+			sprintf(exp_get_entry(e, EFLT_SR),"%d",stop);
+		    } else if( !strncmp(key,featGELR,STADEN_FKEY_LEN)){
+			/* TG */
+			char tag[5]; /* staden note tag (always 4 chars) */
+			char strand=*comment; /* first char of comment */
+			/* key has format STADEN_GELR:XXXX -
+			   where XXXX is staden note tag */
+			strncpy(tag,key+STADEN_FKEY_LEN+1,4);
+			tag[4]='\0';
+			comment+=2; /* skip over strand */
+			sprintf(tmp,"%s %c %d..%d\n%s",
+				key,strand,start,stop,comment);
+			extend(e,EFLT_TG,strlen(tmp)+1);
+			strcpy(exp_get_entry(e, EFLT_TG),tmp);
+			
+		    } else if( !strncmp(key,featCONS,STADEN_FKEY_LEN)){
+			/* TC */
+			char tag[5]; /* staden note tag (always 4 chars) */
+			/* comment has the format Srstart-rend\ncomment
+			   S is a single character strand indicator
+			   rstart and rend are the real start and end of the
+			   tag
+			*/
+			char strand=*comment; /* first char of comment */
+			char *rangestart = comment+2; /*skip over strand*/
+			char *rangeend;
+			char *emptystring="";
+			
+			/* key has format STADEN_CONS:XXXX -
+			   where XXXX is staden note tag */
+			strncpy(tag,key+STADEN_FKEY_LEN+1,4);
+			tag[4]='\0';
+			/* the REAL range might actually be outside the bases,
+			   so this is recorded in the first line of
+			   the comment. This is merged with the
+			   feature range to allow for complimenting */ 
+			comment=strchr(rangestart,'\n');
+			if( comment )
+			    *(comment++)='\0'; /* *** put back */
+			else
+			    comment=emptystring;
+			
+			/* now special processing of bounds */
+			rangeend=strchr(rangestart,'-');
+			if( rangeend ){
+			    long rstart,rend;
+			    *(rangeend++)='\0'; /* *** put back */
+			    rstart=atol(rangestart);
+			    rend=atol(rangeend);
+			    *(rangeend-1)='-';
+			    
+			    /* if start is the same as rstart, just
+			       need to extend the stop bounds to the
+			       real end If not there has been some
+			       complimenting happening so need to
+			       extend the start bounds, as its now
+			       backwards.  */
+			    if( start==rstart)
+				stop=start+rend-rstart;
+			    else 
+				start=stop-rend+rstart;
+			} else {
+			    /* don't have a range so just use the
+			       feature size */
+			}
+			
+			sprintf(tmp,"%s %c %d..%d\n%s",
+				key,strand,start,stop,comment);
+			extend(e,EFLT_TC,strlen(tmp)+1);
+			strcpy(exp_get_entry(e, EFLT_TC),tmp);
+			if( comment!=emptystring)
+			    *(comment-1)='\n';
+			
+		    } else {
+			/* TG */
+			/* a biolims feature, encode this with tag
+			   BIOL, and the Biolims Feature key in
+			   the first line of the comment*/
+			sprintf(tmp,"%s = %d..%d\n%s%s\n%s",/* use strand = */
+				tagBIOL,start,stop,featKey,key,comment); 
+			extend(e,EFLT_TG,strlen(tmp)+1);
+			strcpy(exp_get_entry(e, EFLT_TG),tmp);
+		    }
+		    *(comment-2)='\r';
+		}
+		/* else unused value */
+		
+		*end='\n';
+	    }
+	}
+    }
+#else /* USE_BIOLIMS */
+    /* Confidence values */
+    if (read->prob_A && read->prob_C && read->prob_G && read->prob_T &&
+	read->NBases > 0) {
+	/* We have some, but are they non zero values? */
+	for (i = 0; i < read->NBases; i++) {
+	    if (read->prob_A[i] || read->prob_C[i] ||
+		read->prob_G[i] || read->prob_T[i])
+		break;
+	}
+	if (i != read->NBases) {
+	    int1 *conf = (int1 *)xmalloc(read->NBases);
+	    char *cstr = (char *)xmalloc(read->NBases * 5 + 2);
+
+	    for (i = 0; i < read->NBases; i++) {
+		switch (read->base[i]) {
+		case 'a':
+		case 'A':
+		    conf[i] = read->prob_A[i];
+		    break;
+		case 'c':
+		case 'C':
+		    conf[i] = read->prob_C[i];
+		    break;
+		case 'g':
+		case 'G':
+		    conf[i] = read->prob_G[i];
+		    break;
+		case 't':
+		case 'T':
+		    conf[i] = read->prob_T[i];
+		    break;
+		default:
+		    conf[i] = (read->prob_A[i] + read->prob_C[i] +
+			       read->prob_G[i] + read->prob_T[i]) / 4;
+		}
+	    }
+
+	    conf2str(conf, read->NBases, cstr);
+	    extend(e, EFLT_AV, strlen(cstr)+1);
+	    sprintf(exp_get_entry(e, EFLT_AV), "%s", cstr);
+	    xfree(conf);
+	    xfree(cstr);
+	}
+    }
+#endif /* if USE_BIOLIMS else ... */
+
+    return e;
+}
+
+
+/*
+ * Controls the use of the SQ and ON lines when loading an experiment file.
+ * The default (value&1 == 1) is to load these into the Read structure.
+ * With value&1 == 0 we load the sequence directly from the trace file
+ * (LT line).
+ * value&2 controls whether to use the SL/SR fields when setting the cutoff.
+ * value&2 == 0 implies to do so, and value&2 == 2 implies to not.
+ *
+ * The default use is to use the SQ and ON lines. Returns the old value.
+ */
+static int use_experiment_sequence = 1;
+int read_experiment_redirect(int value) {
+    int old = use_experiment_sequence;
+
+    use_experiment_sequence = value;
+    return old;
+}
+
+
+/*
+ * Translates an experiment file to a Read structure.
+ * The Exp_info structure is left unchanged.
+ *
+ * Returns:
+ *    A pointer to an allocated Read structure upon success.
+ *    NULLRead upon failure.
+ */
+Read *exp2read(Exp_info *e, char *fn) {
+    Read *r;
+    int q, s, ttype, err = 0;
+    char *str;
+    int use_exp = use_experiment_sequence;
+    FILE *fp;
+
+    if (!exp_Nentries(e, EFLT_LN)) {
+	err = 1;
+    } else {
+	/* Read the trace component of the experiment file */
+	ttype = exp_Nentries(e,EFLT_LT)
+	    ? trace_type_str2int(exp_get_entry(e, EFLT_LT)) : TT_ANYTR;
+
+	if (fp = open_trace_file(exp_get_entry(e, EFLT_LN), fn)) {
+	    if (NULLRead == (r = fread_reading(fp, NULL, ttype)))
+		err = 1;
+	} else {
+	    err = 1;
+	}
+    }
+
+    if (err) {
+	use_exp = 1;
+	r = read_allocate(0, 1);
+    }
+    
+    /* Set the left cutoff (QL / SL) */
+    q=-1;
+    if (exp_Nentries(e, EFLT_QL))
+	q = atoi(exp_get_entry(e, EFLT_QL));
+    if ((use_exp&2) != 2) {
+	s=-1;
+	if (exp_Nentries(e, EFLT_SL))
+	    s = atoi(exp_get_entry(e, EFLT_SL));
+	if (q != -1 || s != -1)
+	    r->leftCutoff = MAX(q, s);
+    } else {
+	r->leftCutoff = q != -1 ? q : 0;
+    }
+
+    /* Set the right cutoff (QR / SR) */
+    q = INT_MAX;
+    if (exp_Nentries(e, EFLT_QR))
+	q = atoi(exp_get_entry(e, EFLT_QR));
+    if ((use_exp&2) != 2) {
+	s = INT_MAX;
+	if (exp_Nentries(e, EFLT_SR))
+	    s = atoi(exp_get_entry(e, EFLT_SR));
+	if (q != INT_MAX || s != INT_MAX)
+	    r->rightCutoff = MIN(q, s);
+    } else {
+	r->rightCutoff = q != INT_MAX ? q : 0;
+    }
+
+    if (r->rightCutoff && r->rightCutoff <= r->leftCutoff)
+      r->rightCutoff = r->leftCutoff+1;
+
+    /* Bases and base positions, if desired */
+    if (use_exp&1) {
+	if (exp_Nentries(e, EFLT_SQ) && (str = exp_get_entry(e, EFLT_SQ))) {
+	    int slen = strlen(str);
+	    
+	    if (NULL == (r->base = (char *)xrealloc(r->base, slen+1)))
+		return NULLRead;
+	    if (NULL == (r->prob_A = (char *)xrealloc(r->prob_A, slen+1)))
+		return NULLRead;
+	    if (NULL == (r->prob_C = (char *)xrealloc(r->prob_C, slen+1)))
+		return NULLRead;
+	    if (NULL == (r->prob_G = (char *)xrealloc(r->prob_G, slen+1)))
+		return NULLRead;
+	    if (NULL == (r->prob_T = (char *)xrealloc(r->prob_T, slen+1)))
+		return NULLRead;
+	    if (r->basePos) {
+		xfree(r->basePos);
+		r->basePos = NULL;
+	    }
+
+	    /* Clear them */
+	    memset(r->prob_A, 0, slen);
+	    memset(r->prob_C, 0, slen);
+	    memset(r->prob_G, 0, slen);
+	    memset(r->prob_T, 0, slen);
+		
+	    strcpy(r->base, str);
+	    r->NBases = slen;
+
+	    /* Copy AV values into prob_* arrays */
+	    if (exp_Nentries(e, EFLT_AV) &&
+		(str = exp_get_entry(e, EFLT_AV))) {
+		int1 *conf = (int1 *)xmalloc((slen+1)*sizeof(*conf));
+		int i;
+
+		str2conf(conf, slen, str);
+		for (i = 0; i < slen ; i++) {
+		    switch(r->base[i]) {
+		    case 'a':
+		    case 'A':
+			r->prob_A[i] = conf[i];
+			r->prob_C[i] = 0;
+			r->prob_G[i] = 0;
+			r->prob_T[i] = 0;
+			break;
+		    case 'c':
+		    case 'C':
+			r->prob_A[i] = 0;
+			r->prob_C[i] = conf[i];
+			r->prob_G[i] = 0;
+			r->prob_T[i] = 0;
+			break;
+		    case 'g':
+		    case 'G':
+			r->prob_A[i] = 0;
+			r->prob_C[i] = 0;
+			r->prob_G[i] = conf[i];
+			r->prob_T[i] = 0;
+			break;
+		    case 't':
+		    case 'T':
+			r->prob_A[i] = 0;
+			r->prob_C[i] = 0;
+			r->prob_G[i] = 0;
+			r->prob_T[i] = conf[i];
+			break;
+		    default:
+			r->prob_A[i] = conf[i];
+			r->prob_C[i] = conf[i];
+			r->prob_G[i] = conf[i];
+			r->prob_T[i] = conf[i];
+			break;
+		    }
+		}
+
+		xfree(conf);
+	    } else {
+		memset(r->prob_A, 0, slen * sizeof(r->prob_A[0]));
+		memset(r->prob_C, 0, slen * sizeof(r->prob_C[0]));
+		memset(r->prob_G, 0, slen * sizeof(r->prob_G[0]));
+		memset(r->prob_T, 0, slen * sizeof(r->prob_T[0]));
+	    }
+	}
+
+	r->format = TT_EXP;
+    }
+
+    r->orig_trace = e;
+    r->orig_trace_format = TT_EXP;
+    r->orig_trace_free = (void (*)(void *))exp_destroy_info;
+
+    return r;
+}
+#endif /* IOLIB_EXP */
+
+
+
+/*
+ * Takes an original read structure and a set of edit change arrays and
+ * produces a new base position array incorporating all the edits. For
+ * insertions, interpolation is used to derive a suitable sample position.
+ *
+ * INPUTS:
+ *
+ * Read   *r       = The original unedited read structure
+ * int     Comp    = 0=Normal sequence, 1=Complemented sequence
+ * int     Ned     = Length of edited arrays to follow
+ * char   *edBases = Sequence of base characters incorporating ins/del edits
+ * uint_2 *edPos   = Corresponding original base numbers, 0 indicates an
+ *		     insertion. Base numbers start at 1.
+ *
+ * OUTPUTS:
+ *
+ * This array is assumed to be empty with an allocated length of Ned elements.
+ *
+ * uint_2* basePos = Base positions in samples
+ */
+
+void read_update_base_positions( Read *r, int Comp, int Ned, char *edBases,
+				 int_2 *edPos, uint_2 *basePos )
+{
+    int     i, j;
+    int     gap;
+    int     delta;
+    int     o_N;
+    int     o_NPoints;
+    uint_2* o_basePos;
+    int     start;
+    int     end;
+
+
+
+    /* Check input */
+    assert(r);
+    assert(edBases);
+    assert(edPos);
+    assert(basePos);
+    assert(Ned>0);
+    if( (Ned<=0) || !r || !edBases || !edPos || !basePos )
+	return;
+
+
+
+    /* Original sequence data */
+    o_N       = r->NBases;
+    o_NPoints = r->NPoints;
+    o_basePos = r->basePos;
+
+
+
+    /* Copy original base positions */
+    for( i=0; i<Ned; i++ )
+    {
+	/* If inserted base, set position to zero */
+	if( edPos[i] == 0 )
+	{
+	    basePos[i] = 0;
+	}
+	else
+	{
+	    /* Get original position taking into account complementation */
+	    basePos[i] = o_basePos[ Comp ? o_N-edPos[i]+1-1 : edPos[i]-1 ];
+	}
+    }
+
+
+
+    /* Do linear interpolation to create positions for inserted bases */
+    for( i=0; i<Ned; i++ )
+    {
+	/* Search for start */
+	while( (basePos[i]!=0) && (i<Ned) )
+	    i++;
+	start = (i==0) ? 0 : basePos[i-1];
+
+
+
+	/* Search for end */
+	gap = 0;
+	while( (basePos[i]==0) && (i<Ned) )
+	{
+	    gap++;
+	    i++;
+	}
+	if( i == Ned )
+	{
+	    if( gap == 0 )
+		return;
+	    end = o_NPoints;
+	}
+	else
+	{
+	    end = basePos[i];
+	}
+
+
+
+	/* Do the interpolation */
+	delta = (end - start) / (gap + 1);
+	for( j=i-gap; j<i; j++ )
+	{
+	    /* Watch out for insertions at start (j==0) */
+	    if( j==0 )
+		basePos[j] = delta;
+	    else
+		basePos[j] = basePos[j-1] + delta;
+	}
+    }
+}
+
+
+
+/*
+ * Takes a set of edit change arrays and produces a new set of confidence
+ * arrays incorporating all the edits.
+ *
+ * INPUTS:
+ *
+ * int    Ned     = Length of edited arrays to follow
+ * char*  edBases = Sequence of base characters incorporating ins/del edits
+ * int1*  edConf  = Corresponding confidence values, 100 for insertions
+ *
+ *
+ * OUTPUTS:
+ *
+ * These output arrays are assumed to be empty with an allocated length
+ * of Ned elements each. The names and types are identical to the same
+ * elements in the Read structure.
+ *
+ * char*  prob_A  = Base confidence A
+ * char*  prob_C  = Base confidence C
+ * char*  prob_G  = Base confidence G
+ * char*  prob_T  = Base confidence T
+ *
+ */
+
+void read_update_confidence_values( int Ned, char* edBases, int1* edConf,
+                                    char* prob_A, char* prob_C, char* prob_G, char* prob_T )
+{
+    int  i;
+    char c;
+
+
+
+    /* Check input */
+    assert(Ned>0);
+    assert(edBases);
+    assert(edConf);
+    assert(prob_A);
+    assert(prob_C);
+    assert(prob_G);
+    assert(prob_T);
+    if( (Ned<=0) || !edBases || !edConf || !prob_A || !prob_C || !prob_G || !prob_T )
+	return;
+
+
+
+    /* Copy over confidence values */
+    for( i=0; i<Ned; i++ )
+    {
+	c = (char) edConf[i];
+	switch( edBases[i] )
+	{
+	    case 'A':
+	    case 'a':
+		prob_A[i] = c;
+		prob_C[i] = 0;
+		prob_G[i] = 0;
+		prob_T[i] = 0;
+		break;
+
+
+	    case 'C':
+	    case 'c':
+		prob_A[i] = 0;
+		prob_C[i] = c;
+		prob_G[i] = 0;
+		prob_T[i] = 0;
+		break;
+
+	    case 'G':
+	    case 'g':
+		prob_A[i] = 0;
+		prob_C[i] = 0;
+		prob_G[i] = c;
+		prob_T[i] = 0;
+		break;
+
+	    case 'T':
+	    case 't':
+		prob_A[i] = 0;
+		prob_C[i] = 0;
+		prob_G[i] = 0;
+		prob_T[i] = c;
+		break;
+
+	    default:
+		prob_A[i] = c;
+		prob_C[i] = c;
+		prob_G[i] = c;
+		prob_T[i] = c;
+		break;
+	}
+    }
+}
+
+
+
+int read_sections(int new_sec) {
+    static int sections = READ_ALL;
+
+    if (new_sec)
+	sections = new_sec;
+
+    return sections;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/translate.h	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,135 @@
+/*
+ * Copyright (c) Medical Research Council 1994. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+#ifndef _TRANSLATE_H_
+#define _TRANSLATE_H_
+
+#include "io_lib/scf.h"
+#include "io_lib/Read.h"
+#include "io_lib/expFileIO.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Translates an Scf structure into a Read structure.
+ * The Scf structure is left unchanged.
+ *
+ * Returns:
+ *    A pointer to an allocated Read structure upon success.
+ *    NULLRead upon failure.
+ */
+Read *scf2read(Scf *scf);
+
+/*
+ * Translates a Read structure into a Scf structure.
+ * The Read structure is left unchanged.
+ *
+ * Returns:
+ *    A pointer to an allocated Scf structure upon success.
+ *    NULL upon failure.
+ */
+Scf *read2scf(Read *read);
+
+/*
+ * Translates a Read structure and an Experiment file.
+ * The Read structure is left unchanged.
+ *
+ * Returns:
+ *    A pointer to an allocated Exp_info structure upon success.
+ *    NULL upon failure (FIXME: need to free memory here)
+ */
+Exp_info *read2exp(Read *read, char *EN);
+
+/*
+ * Controls the use of the SQ and ON lines when loading an experiment file.
+ * The default (value&1 == 1) is to load these into the Read structure.
+ * With value&1 == 0 we load the sequence directly from the trace file
+ * (LT line).
+ * value&2 controls whether to use the SL/SR fields when setting the cutoff.
+ * value&2 == 0 implies to do so, and value&2 == 2 implies to not.
+ *
+ * Returns:
+ *    The old value.
+ */
+int read_experiment_redirect(int value);
+
+/*
+ * Takes an original read structure and a set of edit change arrays and
+ * produces a new base position array incorporating all the edits. For
+ * insertions, interpolation is used to derive a suitable sample position.
+ *
+ * INPUTS:
+ *
+ * Read   *r       = The original unedited read structure
+ * int     Comp    = 0=Normal sequence, 1=Complemented sequence
+ * int     Ned     = Length of edited arrays to follow
+ * char   *edBases = Sequence of base characters incorporating ins/del edits
+ * uint_2 *edPos   = Corresponding original base numbers, 0 indicates an
+ *		     insertion. Base numbers start at 1.
+ *
+ * OUTPUTS:
+ *
+ * This array is assumed to be empty with an allocated length of Ned elements.
+ *
+ * uint_2* basePos = Base positions in samples
+ */
+
+void read_update_base_positions( Read *r, int Comp, int Ned, char *edBases,
+				 int_2 *edPos, uint_2 *basePos );
+
+/*
+ * Takes a set of edit change arrays and produces a new set of confidence
+ * arrays incorporating all the edits.
+ *
+ * INPUTS:
+ *
+ * int    Ned     = Length of edited arrays to follow
+ * char*  edBases = Sequence of base characters incorporating ins/del edits
+ * int1*  edConf  = Corresponding confidence values, 100 for insertions
+ *
+ *
+ * OUTPUTS:
+ *
+ * These output arrays are assumed to be empty with an allocated length
+ * of Ned elements each. The names and types are identical to the same
+ * elements in the Read structure.
+ *
+ * char*  prob_A  = Base confidence A
+ * char*  prob_C  = Base confidence C
+ * char*  prob_G  = Base confidence G
+ * char*  prob_T  = Base confidence T
+ *
+ */
+
+void read_update_confidence_values( int Ned, char* edBases, int1* edConf,
+                                    char* prob_A, char* prob_C, char* prob_G, char* prob_T );
+
+
+/*
+ * Translates an experiment file to a Read structure.
+ * The Exp_Info structure is left unchanged.
+ *
+ * Returns:
+ *    A pointer to an allocated Read structure upon success.
+ *    NULLRead upon failure.
+ */
+Read *exp2read(Exp_info *e, char *fn);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/vlen.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,358 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <sys/types.h>
+#include <string.h>
+
+#include "io_lib/vlen.h"
+#include "io_lib/os.h"
+
+#ifndef MAX
+#define MAX(a,b) ((a)>(b)?(a):(b))
+#endif
+
+#ifndef ABS
+#define ABS(a) ((a)>0?(a):-(a))
+#endif
+
+/* #define DEBUG_printf(a,n) printf(a,n) */
+#define DEBUG_printf(a,n)
+
+/*
+ * vlen: 27/10/95 written by James Bonfield, jkb@mrc-lmb.cam.ac.uk
+ *
+ * Given sprintf style of arguments this routine returns the maximum
+ * size of buffer needed to allocate to use with sprintf. It errs on
+ * the side of caution by being simplistic in its approach: we assume
+ * all numbers are of maximum length.
+ *
+ * Handles the usual type conversions (%[%diuaxXcfeEgGpns]), but not
+ * the 'wide' character conversions (%C and %S).
+ * Precision is handled in the correct formats, including %*.*
+ * notations.
+ * Additionally, some of the more dubious (but probably illegal) cases
+ * are supported (eg "%10%" will expand to "         %" on many
+ * systems).
+ *
+ * We also assume that the largest integer and larger pointer are 64
+ * bits, which at least covers the machines we'll need it for.
+ */
+int flen(char *fmt, ...)
+{
+    va_list args;
+
+    va_start(args, fmt);
+    return vflen(fmt, args);
+}
+
+int vflen(char *fmt, va_list ap)
+{
+    int len = 0;
+    char *cp, c;
+    long l;
+    int i;
+    double d; 
+
+    /*
+     * This code modifies 'ap', but we do not know if va_list is a structure
+     * or a pointer to an array so we do not know if it is a local variable
+     * or not.
+     * C99 gets around this by defining va_copy() to make copies of ap, but
+     * this does not exist on all systems.
+     * For now, I just assume that when va_list is a pointer the system also
+     * provides a va_copy macro to work around this problem. The only system
+     * I have seen needing this so far was Linux on AMD64.
+     */
+#if defined(NEED_VA_COPY)
+    va_list ap_local;
+    va_copy(ap_local, ap);
+    #define ap ap_local
+#endif
+
+    for(cp = fmt; *cp; cp++) {
+	switch(*cp) {
+
+	/* A format specifier */
+	case '%': {
+	    char *endp;
+	    long conv_len1=0, conv_len2=0, conv_len=0;
+	    signed int arg_size;
+
+	    /* Firstly, strip the modifier flags (+-#0 and [space]) */
+	    for(; c=*++cp;) {
+		if ('#' == c)
+		    len+=2; /* Worst case of "0x" */
+		else if ('-' == c || '+' == c || ' ' == c)
+		    len++;
+		else
+		    break;
+	    }
+
+	    /* Width specifier */
+	    l = strtol(cp, &endp, 10);
+	    if (endp != cp) {
+		cp = endp;
+		conv_len = conv_len1 = l;
+	    } else if (*cp == '*') {
+		conv_len = conv_len1 = (int)va_arg(ap, int);
+		cp++;
+	    }
+
+	    /* Precision specifier */
+	    if ('.' == *cp) {
+		cp++;
+		conv_len2 = strtol(cp, &endp, 10);
+		if (endp != cp) {
+		    cp = endp;
+		} else if (*cp == '*') {
+		    conv_len2 = (int)va_arg(ap, int);
+		    cp++;
+		}
+		conv_len = MAX(conv_len1, conv_len2);
+	    }
+
+	    /* Short/long identifier */
+	    if ('h' == *cp) {
+		arg_size = -1; /* short */
+		cp++;
+	    } else if ('l' == *cp) {
+		arg_size = 1; /* long */
+		cp++;
+	    } else {
+		arg_size = 0; /* int */
+	    }
+
+	    /* The actual type */
+	    switch (*cp) {
+	    case '%':
+		/*
+		 * Not real ANSI I suspect, but we'll allow for the
+		 * completely daft "%10%" example.
+		 */
+		len += MAX(conv_len1, 1);
+		break;
+
+	    case 'd':
+	    case 'i':
+	    case 'u':
+	    case 'a':
+	    case 'x':
+	    case 'X':
+		/* Remember: char and short are sent as int on the stack */
+		if (arg_size == -1)
+		    l = (long)va_arg(ap, int);
+		else if (arg_size == 1)
+		    l = va_arg(ap, long); 
+		else 
+		    l = (long)va_arg(ap, int);
+
+		DEBUG_printf("%d", l);
+
+		/*
+		 * No number can be more than 24 characters so we'll take
+		 * the max of conv_len and 24 (23 is len(2^64) in octal).
+		 * All that work above and we then go and estimate ;-),
+		 * but it's needed incase someone does %500d.
+		 */
+		len += MAX(conv_len, 23);
+		break;
+
+	    case 'c':
+		i = va_arg(ap, int);
+		DEBUG_printf("%c", i);
+		/*
+		 * Note that %10c and %.10c act differently.
+		 * Besides, I think precision is not really allowed for %c.
+		 */
+		len += MAX(conv_len1, 1);
+		break;
+
+	    case 'f':
+		d = va_arg(ap, double);
+		DEBUG_printf("%f", d);
+		/*
+		 * Maybe "Inf" or "NaN", but we'll not worry about that.
+		 * Again, err on side of caution and take max of conv_len
+		 * and max length of a double. The worst case I can
+		 * think of is 317 characters (-1[308 zeros].000000)
+		 * without using precision codes. That's horrid. I
+		 * cheat and either use 317 or 15 depending on how
+		 * large the number is as I reckon 99% of floats
+		 * aren't that long.
+		 */
+		l = (ABS(d) > 1000000) ? 317 : 15;
+		l = MAX(l, conv_len1 + 2);
+		if (conv_len2) l += conv_len2 - 6;
+		len += l;
+		break;
+
+	    case 'e':
+	    case 'E':
+	    case 'g':
+	    case 'G':
+		d = va_arg(ap, double);
+		DEBUG_printf("%g", d);
+		/*
+		 * Maybe "Inf" or "NaN", but we'll not worry about that
+		 * Again, err on side of caution and take max of conv_len
+		 * and max length of a double (which defaults to only
+		 * '-' + 6 + '.' + 'E[+-]xxx' == 13.
+		 */
+		len += MAX(conv_len, 13);
+		break;
+
+	    case 'p':
+		l = (long)va_arg(ap, void *);
+		/*
+		 * Max pointer is 64bits == 16 chars (on alpha),
+		 * == 20 with + "0x".
+		 */
+		DEBUG_printf("%p", (void *)l);
+		len += MAX(conv_len, 20);
+		break;
+
+	    case 'n':
+		/* produces no output */
+		break;
+
+	    case 's': {
+		char *s = (char *)va_arg(ap, char *);
+		DEBUG_printf("%s", s);
+
+		if (!conv_len2) {
+		    len += MAX(conv_len, (int)strlen(s));
+		} else {
+		    len += conv_len;
+		}
+		break;
+	    }
+
+	    default:
+		/* wchar_t types of 'C' and 'S' aren't supported */
+		DEBUG_printf("Arg is %c\n", *cp);
+	    }
+	    
+	}
+
+	case '\0':
+	    break;
+
+	default:
+	    DEBUG_printf("%c", *cp);
+	    len++;
+	}
+    }
+
+    va_end(ap);
+
+    return len+1; /* one for the null character */
+}
+
+#if 0
+int main() {
+    int l;
+    char buf[10000];
+
+    sprintf(buf, "d: %d\n", 500);
+    l = flen("d: %d\n", 500);
+    printf("%d %d\n\n", strlen(buf), l);
+
+    sprintf(buf, "");
+    l = flen("");
+    printf("%d %d\n\n", strlen(buf), l);
+
+    sprintf(buf, "%s\n","test");
+    l = flen("%s\n", "test");
+    printf("%d %d\n\n", strlen(buf), l);
+
+    sprintf(buf, "%c\n", 'a');
+    l = flen("%c\n", 'a');
+    printf("%d %d\n\n", strlen(buf), l);
+
+    sprintf(buf, "%31.30f\n", -9999.99);
+    l = flen("%31.30f\n", -9999.99);
+    printf("%d %d\n\n", strlen(buf), l);
+
+    sprintf(buf, "%f\n", -1e308);
+    l = flen("%f\n", -1e308);
+    printf("%d %d\n\n", strlen(buf), l);
+
+    sprintf(buf, "%.9f\n", -1e308);
+    l = flen("%.9f\n", -1e308);
+    printf("%d %d\n\n", strlen(buf), l);
+
+    sprintf(buf, "%10.20f\n", -1.999222333);
+    l = flen("%10.20f\n", -1.999222333);
+    printf("%d %d\n\n", strlen(buf), l);
+
+    sprintf(buf, "%#g\n", -3.14159265358e-222);
+    l = flen("%#g\n", -3.1415927e-222);
+    printf("%d %d\n\n", strlen(buf), l);
+
+    sprintf(buf, "%e\n", -123456789123456789.1);
+    l = flen("%e\n", -123456789123456789.1);
+    printf("%d %d\n\n", strlen(buf), l);
+
+    sprintf(buf, "%c %f %d %s %c %g %ld %s\n", 'a', 3.1, 9, "one", 'b', 4.2, 9, "two");
+    l = flen("%c %f %d %s %c %g %ld %s\n", 'a', 3.1, 9, "one", 'b', 4.2, 9, "two");
+    printf("%d %d\n\n", strlen(buf), l);
+
+    sprintf(buf, "%*.*e %*c\n", 10, 5, 9.0, 20, 'x');
+    l = flen("%*.*e %*c\n", 10, 5, 9.0, 20, 'x');
+    printf("%d %d\n\n", strlen(buf), l);
+
+    sprintf(buf, "%10c\n", 'z');
+    l = flen("%10c\n", 'z');
+    printf("%d %d\n\n", strlen(buf), l);
+
+    sprintf(buf, "%.10c\n", 'z');
+    l = flen("%.10c\n", 'z');
+    printf("%d %d\n\n", strlen(buf), l);
+
+    sprintf(buf, "%10d\n", 'z');
+    l = flen("%10d\n", 'z');
+    printf("%d %d\n\n", strlen(buf), l);
+
+    sprintf(buf, "%.10d\n", 'z');
+    l = flen("%.10d\n", 'z');
+    printf("%d %d\n\n", strlen(buf), l);
+
+    sprintf(buf, "%10%\n");
+    l = flen("%10%\n");
+    printf("%d %d\n\n", strlen(buf), l);
+
+    sprintf(buf, "%.10%\n");
+    l = flen("%.10%\n");
+    printf("%d %d\n\n", strlen(buf), l);
+
+    sprintf(buf, "%s\n", "0123456789");
+    l = flen("%s\n", "0123456789");
+    printf("%d %d\n\n", strlen(buf), l);
+
+    sprintf(buf, "%5s\n", "0123456789");
+    l = flen("%5s\n", "0123456789");
+    printf("%d %d\n\n", strlen(buf), l);
+
+    sprintf(buf, "%50s\n", "0123456789");
+    l = flen("%50s\n", "0123456789");
+    printf("%d %d\n\n", strlen(buf), l);
+
+    sprintf(buf, "%.5s\n", "0123456789");
+    l = flen("%.5s\n", "0123456789");
+    printf("%d %d\n\n", strlen(buf), l);
+
+    sprintf(buf, "%.50s\n", "0123456789");
+    l = flen("%.50s\n", "0123456789");
+    printf("%d %d\n\n", strlen(buf), l);
+
+    sprintf(buf, "%5.50s\n", "0123456789");
+    l = flen("%5.50s\n", "0123456789");
+    printf("%d %d\n\n", strlen(buf), l);
+
+    sprintf(buf, "%50.5s\n", "0123456789");
+    l = flen("%50.5s\n", "0123456789");
+    printf("%d %d\n\n", strlen(buf), l);
+
+    return 0;
+}
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/vlen.h	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,15 @@
+#ifndef _VLEN_H_
+#define _VLEN_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern int vflen(char *fmt, va_list ap);
+extern int flen(char *fmt, ...);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _VLEN_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/write_scf.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,461 @@
+/*
+ * Copyright (c) Medical Research Council 1994. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+/* 
+    Title:       write_scf.c
+
+    Purpose:	 Output of Standard Chromatogram Format sequences
+    Last update: August 18 1994
+
+    Change log:
+    4 Feb 1992, Now draft proposal version 2
+    23 Nov 92,  SCF 2.0 + LaDeana's changes
+    11 Aug 93, Version 2.01 containing confidence values
+    18 Aug 1994  Renamed from  writeSCF.c; now purely SCF IO (no Seq structs)
+
+    Oct 95 major rewrite to make files more easily compressed.
+    gzip now gets files to around 40% of original
+    Version raised to 3.00
+     * We store in order:
+     *     Header
+     *     Samples
+     *     Bases
+     *     Comments
+     *     Private
+
+     Two main types of change: 
+     1: write data in lane order instead of all lanes together
+     eg write Sample values for A, then Sample values for C, etc. 
+
+     2: where appropriate write delta delta values instead of complete ones.
+     ie write the differences in the differences between successive values
+
+*/
+
+
+static int scf_version = 3;
+
+/* ---- Imports ---- */
+
+
+#include <ctype.h>
+#include <stdio.h>    /* IMPORT: fopen, fclose, fseek, ftell, fgetc,
+		                 EOF */
+#include <string.h>
+#include "io_lib/scf.h"      /* IMPORT: scf structures */
+#include "io_lib/mach-io.h"  /* IMPORT: be_write_int_1, be_write_int_2, be_write_int_4 */
+#include "io_lib/xalloc.h"
+
+#include "io_lib/stdio_hack.h"
+
+/* ---- Exports ---- */
+
+
+int write_scf_header(FILE *fp, Header *h)
+{
+    int i;
+
+    if (be_write_int_4(fp,&h->magic_number)==False)     return -1;
+    if (be_write_int_4(fp,&h->samples)==False)          return -1;
+    if (be_write_int_4(fp,&h->samples_offset)==False)   return -1;
+    if (be_write_int_4(fp,&h->bases)==False)            return -1;
+    if (be_write_int_4(fp,&h->bases_left_clip)==False)  return -1;
+    if (be_write_int_4(fp,&h->bases_right_clip)==False) return -1;
+    if (be_write_int_4(fp,&h->bases_offset)==False)     return -1;
+    if (be_write_int_4(fp,&h->comments_size)==False)    return -1;
+    if (be_write_int_4(fp,&h->comments_offset)==False)  return -1;
+    if (fwrite(h->version,sizeof(h->version),1,fp)!=1)  return -1;
+    if (be_write_int_4(fp,&h->sample_size)==False)      return -1;
+    if (be_write_int_4(fp,&h->code_set)==False)         return -1;
+    if (be_write_int_4(fp,&h->private_size)==False)     return -1;
+    if (be_write_int_4(fp,&h->private_offset)==False)   return -1;
+    for (i=0;i<18;i++)
+	if (be_write_int_4(fp,&h->spare[i])==False)     return -1;
+
+    return 0;
+}
+
+
+int write_scf_sample1(FILE *fp, Samples1 *s)
+{
+    uint_1 buf[4];
+
+    buf[0] = s->sample_A;
+    buf[1] = s->sample_C;
+    buf[2] = s->sample_G;
+    buf[3] = s->sample_T;
+    if (4 != fwrite(buf, 1, 4, fp)) return -1;
+
+    return 0;
+}
+
+
+int write_scf_sample2(FILE *fp, Samples2 *s)
+{
+    uint_2 buf[4];
+
+    buf[0] = be_int2(s->sample_A);
+    buf[1] = be_int2(s->sample_C);
+    buf[2] = be_int2(s->sample_G);
+    buf[3] = be_int2(s->sample_T);
+    if (4 != fwrite(buf, 2, 4, fp)) return -1;
+
+    return 0;
+}
+
+
+int write_scf_samples1(FILE *fp, Samples1 *s, size_t num_samples) {
+    size_t i;
+
+    for (i = 0; i < num_samples; i++) {
+	if (-1 == write_scf_sample1(fp, &(s[i])))
+	    return -1;
+    }
+
+    return 0;
+}
+
+
+int write_scf_samples2(FILE *fp, Samples2 *s, size_t num_samples) {
+    size_t i;
+
+    for (i = 0; i < num_samples; i++) {
+	if (-1 == write_scf_sample2(fp, &(s[i])))
+	    return -1;
+    }
+
+    return 0;
+}
+
+
+int write_scf_samples31(FILE *fp, Samples1 *s, size_t num_samples) {
+    size_t i;
+    int1 *samples_out;
+
+    if (!num_samples)
+	return 0;
+
+    if ( ! (samples_out = (int1 *)xmalloc(num_samples * 
+					    sizeof(int1)))) {
+	return -1;
+    }
+
+    for (i = 0; i < num_samples; i++) {
+	samples_out[i] = (&s[i])->sample_A;
+    }
+    scf_delta_samples1 ( samples_out, num_samples, 1);
+    if (num_samples != fwrite(samples_out, 1, num_samples, fp)) {
+	xfree(samples_out);
+	return -1;
+    }
+
+    for (i = 0; i < num_samples; i++) {
+	samples_out[i] = (&s[i])->sample_C;
+    }
+    scf_delta_samples1 ( samples_out, num_samples, 1);
+    if (num_samples != fwrite(samples_out, 1, num_samples, fp)) {
+	xfree(samples_out);
+	return -1;
+    }
+
+    for (i = 0; i < num_samples; i++) {
+	samples_out[i] = (&s[i])->sample_G;
+    }
+    scf_delta_samples1 ( samples_out, num_samples, 1);
+    if (num_samples != fwrite(samples_out, 1, num_samples, fp)) {
+	xfree(samples_out);
+	return -1;
+    }
+
+    for (i = 0; i < num_samples; i++) {
+	samples_out[i] = (&s[i])->sample_T;
+    }
+    scf_delta_samples1 ( samples_out, num_samples, 1);
+    if (num_samples != fwrite(samples_out, 1, num_samples, fp)) {
+	xfree(samples_out);
+	return -1;
+    }
+
+    xfree(samples_out);
+    return 0;
+}
+
+int write_scf_samples32(FILE *fp, Samples2 *s, size_t num_samples) {
+    size_t i;
+    uint2 *samples_out;
+
+    if (!num_samples)
+	return 0;
+
+    if ( ! (samples_out = (uint2 *)xmalloc(num_samples * sizeof(uint2)))) {
+	return -1;
+    }
+
+
+    for (i = 0; i < num_samples; i++) {
+	samples_out[i] = (&s[i])->sample_A;
+    }
+    scf_delta_samples2 ( samples_out, num_samples, 1);
+#ifdef SP_LITTLE_ENDIAN
+    for (i = 0; i < num_samples; i++) {
+	samples_out[i] = be_int2(samples_out[i]);
+    }
+#endif
+    if (num_samples != fwrite(samples_out, 2, num_samples, fp)) return -1;
+
+
+    for (i = 0; i < num_samples; i++) {
+	samples_out[i] = (&s[i])->sample_C;
+    }
+    scf_delta_samples2 ( samples_out, num_samples, 1);
+#ifdef SP_LITTLE_ENDIAN
+    for (i = 0; i < num_samples; i++) {
+	samples_out[i] = be_int2(samples_out[i]);
+    }
+#endif
+    if (num_samples != fwrite(samples_out, 2, num_samples, fp)) return -1;
+
+
+    for (i = 0; i < num_samples; i++) {
+	samples_out[i] = (&s[i])->sample_G;
+    }
+    scf_delta_samples2 ( samples_out, num_samples, 1);
+#ifdef SP_LITTLE_ENDIAN
+    for (i = 0; i < num_samples; i++) {
+	samples_out[i] = be_int2(samples_out[i]);
+    }
+#endif
+    if (num_samples != fwrite(samples_out, 2, num_samples, fp)) return -1;
+
+
+    for (i = 0; i < num_samples; i++) {
+	samples_out[i] = (&s[i])->sample_T;
+    }
+    scf_delta_samples2 ( samples_out, num_samples, 1);
+#ifdef SP_LITTLE_ENDIAN
+    for (i = 0; i < num_samples; i++) {
+	samples_out[i] = be_int2(samples_out[i]);
+    }
+#endif
+    if (num_samples != fwrite(samples_out, 2, num_samples, fp)) return -1;
+
+
+    xfree(samples_out);
+    return 0;
+}
+
+
+int write_scf_base(FILE *fp, Bases *b)
+{
+    uint_1 buf[12];
+
+    ((uint_4 *)buf)[0] = be_int4(b->peak_index);
+    buf[4] = b->prob_A;
+    buf[5] = b->prob_C;
+    buf[6] = b->prob_G;
+    buf[7] = b->prob_T;
+    buf[8] = b->base;
+    buf[9] = b->spare[0];
+    buf[10] = b->spare[1];
+    buf[11] = b->spare[2];
+
+    if (12 != fwrite(buf, 1, 12, fp)) return -1;
+
+    return 0;
+}
+
+
+int write_scf_bases(FILE *fp, Bases *b, size_t num_bases)
+{
+    size_t i;
+
+    for (i = 0; i < num_bases; i++) {
+	if (-1 == write_scf_base(fp, &(b[i])))
+	    return -1;
+    }
+
+    return 0;
+}
+
+int write_scf_bases3(FILE *fp, Bases *b, size_t num_bases)
+{
+    size_t i;
+    uint_4 *buf4;
+    uint_1 *buf1;
+
+    if (NULL == (buf4 = (uint_4 *)xmalloc(1 + 4 * num_bases)))
+	return -1;
+
+    if (NULL == (buf1 = (uint_1 *)xmalloc(1 + 8 * num_bases))) {
+	xfree(buf4);
+	return -1;
+    }
+
+    for (i = 0; i < num_bases; i++) {
+	buf4[i] = be_int4((&b[i])->peak_index);
+    }
+    fwrite(buf4, 4, num_bases, fp);
+    
+    for (i=0; i < num_bases; i++) {
+	buf1[i            ] = (&b[i])->prob_A;
+	buf1[i+  num_bases] = (&b[i])->prob_C;
+	buf1[i+2*num_bases] = (&b[i])->prob_G;
+	buf1[i+3*num_bases] = (&b[i])->prob_T;
+	buf1[i+4*num_bases] = (&b[i])->base;
+	buf1[i+5*num_bases] = (&b[i])->spare[0];
+	buf1[i+6*num_bases] = (&b[i])->spare[1];
+	buf1[i+7*num_bases] = (&b[i])->spare[2];
+    }
+    if (8 * num_bases != (fwrite(buf1, 1, 8 * num_bases, fp))) {
+	xfree(buf1);
+	xfree(buf4);
+	return -1;
+    }
+
+    xfree(buf1);
+    xfree(buf4);
+    return 0;
+}
+
+
+int write_scf_comment(FILE *fp, Comments *c, size_t s)
+{
+    if (fwrite(c, 1, s, fp) != s) return -1;
+
+    return 0;
+}
+
+
+
+/*
+ * Request which (major) version of scf to use when writing.
+ * Defaults to the latest. Currently suitable fields are
+ * 2 and 3.
+ *
+ * Returns 0 for success, -1 for failure.
+ */
+int set_scf_version(int version) {
+    if (version != 2 && version != 3)
+	return -1;
+
+    scf_version = version;
+    return 0;
+}
+
+/*
+ * Write Seq out as a .scf file to the 'fp' FILE *
+ */
+int fwrite_scf(Scf *scf, FILE *fp) {
+    uint_4 size;
+    int err;
+
+    /*
+     * Init header offsets.
+     *
+     * We store in order:
+     *     Header
+     *     Samples
+     *     Bases
+     *     Comments
+     *     Private
+     */
+    scf->header.samples_offset = (uint_4)sizeof(Header);
+    size = scf->header.samples * (scf->header.sample_size == 1 ?
+				  sizeof(Samples1) : sizeof(Samples2));
+    scf->header.bases_offset = (uint_4)(scf->header.samples_offset +
+					 size);
+    size = scf->header.bases * sizeof(Bases);
+    scf->header.comments_offset = (uint_4)(scf->header.bases_offset + size);
+
+    size = scf->header.comments_size;
+    scf->header.private_offset = (uint_4)(scf->header.comments_offset + size);
+
+    /* Init a few other things, such as the magic number */
+    scf->header.magic_number = SCF_MAGIC;
+
+    if (scf_version == 3) {
+	memcpy(scf->header.version, scf_version_float2str(SCF_VERSION), 4);
+    } else {
+	memcpy(scf->header.version, scf_version_float2str(SCF_VERSION_OLD), 4);
+    }
+
+    /* Write header */
+    if (write_scf_header(fp, &scf->header) == -1)
+	return -1;
+
+    if (scf_version == 3) {
+	/* Write Samples */
+	if (scf->header.sample_size == 1)
+	    err = write_scf_samples31(fp, scf->samples.samples1,
+				      scf->header.samples);
+	else
+	    err = write_scf_samples32(fp, scf->samples.samples2,
+				      scf->header.samples);
+	if (-1 == err)
+	    return -1;
+	
+	/* Write Bases */
+	if (-1 == write_scf_bases3(fp, scf->bases, scf->header.bases))
+	    return -1;
+
+    } else {
+	/* Write Samples */
+	if (scf->header.sample_size == 1)
+	    err = write_scf_samples1(fp, scf->samples.samples1,
+				     scf->header.samples);
+	else
+	    err = write_scf_samples2(fp, scf->samples.samples2,
+				     scf->header.samples);
+	if (-1 == err)
+	    return -1;
+	
+	/* Write Bases */
+	if (-1 == write_scf_bases(fp, scf->bases, scf->header.bases))
+	    return -1;
+    }
+
+    /* Write Comments */
+    if (-1 == write_scf_comment(fp, scf->comments,
+				scf->header.comments_size))
+	return -1;
+
+    /* Write private data */
+    if (scf->header.private_size) {
+	if (scf->header.private_size  != fwrite(scf->private_data, 1,
+						scf->header.private_size, fp))
+	    return -1;
+    }
+
+    return 0;
+}
+
+/*
+ * Write Seq out as a .scf file to file 'fn'.
+ */
+int write_scf(Scf *scf, char *fn)
+{
+    FILE *fp;
+
+    /* Open for for write in binary mode */
+    if ((fp = fopen(fn,"wb")) == NULL) 
+	return -1;
+
+    if (fwrite_scf(scf, fp)) {
+	fclose(fp);
+	return -1;
+    }
+
+    fclose(fp);
+    return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/xalloc.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) Medical Research Council 1994. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+/*
+ * Our own memory alloc routines that output error messages as appropriate
+ * for us. Could also be done as macros, but hopefully there are no tight
+ * using malloc many times so efficiency shouldn't be a problem.
+ *
+ * This also allows for dropping in a debugging malloc as we're intercepting
+ * all alloc & free commands.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include "io_lib/error.h"
+
+void *xmalloc(size_t size) {
+    void *c = malloc(size);
+    
+    if (NULL == c) {
+	errout("Not enough memory.\n");
+	return NULL;
+    }
+
+    return c;
+}
+
+void *xrealloc(void *ptr, size_t size) {
+    void *c;
+
+    /*
+     * realloc _should_ allocate memory for us when ptr is NULL.
+     * Unfortunately this is not the case with the non-ANSI conformant
+     * C library provided with SunOS4.1
+     */
+    if (ptr)
+	c = realloc(ptr, size);
+    else
+	c = malloc(size);
+    
+    if (NULL == c) {
+	errout("Not enough memory.\n");
+	return NULL;
+    }
+
+    return c;
+}
+
+void *xcalloc(size_t num, size_t size) {
+    void *c = calloc(num, size);
+
+    if (NULL == c) {
+	errout("Not enough memory.\n");
+	return NULL;
+    }
+
+    return c;
+}
+
+void xfree(void *ptr) {
+    free(ptr);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/xalloc.h	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) Medical Research Council 1994. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+#ifndef _MY_MALLOC_H_
+#define _MY_MALLOC_H_
+
+#include <stdlib.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern void *xmalloc(size_t size);
+extern void *xrealloc(void *ptr, size_t size);
+extern void *xcalloc(size_t num, size_t size);
+extern void xfree(void *ptr);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/ztr.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,1170 @@
+#include <stdio.h>
+#include <string.h>
+#include <math.h>
+
+/* #include <fcntl.h> */
+
+#include "io_lib/ztr.h"
+#include "io_lib/xalloc.h"
+#include "io_lib/Read.h"
+#include "io_lib/compression.h"
+#include "io_lib/stdio_hack.h"
+#include "io_lib/deflate_interlaced.h"
+
+/* Deprecated #define - see solexa2srf for the more up to date code */
+/* #define ILLUMINA_GA */
+
+/*
+ * ---------------------------------------------------------------------------
+ * Trace writing functions.
+ * These consist of several encoding functions, all with the same prototype,
+ * and a single fwrite_ztr function to wrap it all up.
+ * ---------------------------------------------------------------------------
+ */
+
+/*
+ * ztr_write_header
+ *
+ * Writes a ZTR file header.
+ *
+ * Arguments:
+ * 	fp		A FILE pointer
+ *	h		A pointer to the header to write
+ *
+ * Returns:
+ *	Success:  0
+ *	Failure: -1
+ */
+static int ztr_write_header(FILE *fp, ztr_header_t *h) {
+    if (1 != fwrite(h, sizeof(*h), 1, fp))
+	return -1;
+
+    return 0;
+}
+
+/*
+ * ztr_write_chunk
+ *
+ * Writes a ZTR chunk including chunk header and data
+ *
+ * Arguments:
+ * 	fp		A FILE pointer
+ *	chunk		A pointer to the chunk to write
+ *
+ * Returns:
+ *	Success:  0
+ *	Failure: -1
+ */
+static int ztr_write_chunk(FILE *fp, ztr_chunk_t *chunk) {
+    int4 bei4;
+
+    /*
+    {
+	char str[5];
+	fprintf(stderr, "Write chunk %.4s %08x length %d\n",
+		ZTR_BE2STR(chunk->type, str), chunk->type, chunk->dlength);
+    }
+    */
+
+    /* type */
+    bei4 = be_int4(chunk->type);
+    if (1 != fwrite(&bei4, 4, 1, fp))
+	return -1;
+
+    /* metadata length */
+    bei4 = be_int4(chunk->mdlength);
+    if (1 != fwrite(&bei4, 4, 1, fp))
+	return -1;
+
+    /* metadata */
+    if (chunk->mdlength)
+	if (chunk->mdlength != fwrite(chunk->mdata, 1, chunk->mdlength, fp))
+	    return -1;
+
+    /* data length */
+    bei4 = be_int4(chunk->dlength);
+    if (1 != fwrite(&bei4, 4, 1, fp))
+	return -1;
+
+    /* data */
+    if (chunk->dlength != fwrite(chunk->data, 1, chunk->dlength, fp))
+	return -1;
+
+    return 0;
+}
+
+/*
+ * fwrite_ztr
+ *
+ * Writes a ZTR file held in the ztr_t structure.
+ * It is assumed that all the correct lengths, magic numbers, etc in the
+ * ztr_t struct have already been initialised correctly.
+ *
+ * FIXME: Add a 'method' argument which encodes formats? Perhaps store this
+ * in the ztr struct?
+ *
+ * Arguments:
+ *	fp		A writable FILE pointer
+ *	ztr		A pointer to the ztr_t struct to write.
+ *
+ * Returns:
+ *	Success:  0
+ *	Failure: -1
+ */
+int fwrite_ztr(FILE *fp, ztr_t *ztr) {
+    int i;
+
+    /* Write the header record */
+    if (-1 == ztr_write_header(fp, &ztr->header))
+	return -1;
+
+    /* Write the chunks */
+    for (i = 0; i < ztr->nchunks; i++) {
+	if (-1 == ztr_write_chunk(fp, &ztr->chunk[i]))
+	    return -1;
+#if 0
+	{
+	    int fd;
+	    char fname[1024];
+	    sprintf(fname, "chunk.%d", i);
+	    fd = open(fname, O_RDWR|O_CREAT|O_TRUNC, 0666);
+	    write(fd, ztr->chunk[i].data, ztr->chunk[i].dlength);
+	    close(fd);
+	}
+#endif
+    }
+    
+    return 0;
+}
+
+/*
+ * ---------------------------------------------------------------------------
+ * Trace reading functions.
+ * These consist of several decoding functions, all with the same prototype,
+ * and a single fread_ztr function to wrap it all up.
+ * ---------------------------------------------------------------------------
+ */
+
+/*
+ * ztr_read_header
+ *
+ * Reads a ZTR file header.
+ *
+ * Arguments:
+ * 	fp		A FILE pointer
+ *	h		Where to write the header to
+ *
+ * Returns:
+ *	Success:  0
+ *	Failure: -1
+ */
+int ztr_read_header(FILE *fp, ztr_header_t *h) {
+    if (1 != fread(h, sizeof(*h), 1, fp))
+	return -1;
+
+    return 0;
+}
+
+/*
+ * ztr_read_chunk_hdr
+ *
+ * Reads a ZTR chunk header and metadata, but not the main data segment.
+ *
+ * Arguments:
+ * 	fp		A FILE pointer
+ *
+ * Returns:
+ *	Success: a chunk pointer (malloced)
+ *	Failure: NULL
+ */
+ztr_chunk_t *ztr_read_chunk_hdr(FILE *fp) {
+    int4 bei4;
+    ztr_chunk_t *chunk;
+
+    if (NULL == (chunk = (ztr_chunk_t *)xmalloc(sizeof(*chunk))))
+	return NULL;
+
+    /* type */
+    if (1 != fread(&bei4, 4, 1, fp)) {
+	xfree(chunk);
+	return NULL;
+    }
+    chunk->type = be_int4(bei4);
+
+    /* metadata length */
+    if (1 != fread(&bei4, 4, 1, fp)) {
+	xfree(chunk);
+	return NULL;
+    }
+    chunk->mdlength = be_int4(bei4);
+
+    /* metadata */
+    chunk->ztr_owns = 1;
+    if (chunk->mdlength) {
+	if (NULL == (chunk->mdata = (char *)xmalloc(chunk->mdlength))) {
+	    xfree(chunk);
+	    return NULL;
+	}
+	if (chunk->mdlength != fread(chunk->mdata, 1, chunk->mdlength, fp)) {
+	    xfree(chunk->mdata);
+	    xfree(chunk);
+	    return NULL;
+	}
+    } else {
+	chunk->mdata = NULL;
+    }
+
+    /* data length */
+    if (1 != fread(&bei4, 4, 1, fp)) {
+	if (chunk->mdata)
+	    xfree(chunk->mdata);
+	xfree(chunk);
+	return NULL;
+    }
+    chunk->dlength = be_int4(bei4);
+
+    return chunk;
+}
+
+void ztr_process_text(ztr_t *ztr) {
+    int i;
+    ztr_chunk_t **text_chunks = NULL;
+    int ntext_chunks = 0;
+    ztr_text_t *zt = NULL;
+    int nzt = 0;
+    int nalloc = 0;
+    
+    if (ztr->text_segments)
+	/* Already done */
+	return;
+
+    text_chunks = ztr_find_chunks(ztr, ZTR_TYPE_TEXT, &ntext_chunks);
+    if (!text_chunks)
+	return;
+
+    for (i = 0; i < ntext_chunks; i++) {
+	char *data;
+	uint4 length;
+	char *ident, *value;
+
+	/* Make sure it's not compressed */
+	uncompress_chunk(ztr, text_chunks[i]);
+
+	data = text_chunks[i]->data;
+	length = text_chunks[i]->dlength;
+
+	if (!length)
+	    continue;
+	
+	/* Skip RAW header byte */
+	data++;
+	length--;
+
+	while (data - text_chunks[i]->data <= (ptrdiff_t)length &&
+	       *(ident = data)) {
+	    data += strlen(ident)+1;
+	    value = data;
+	    if (value)
+		data += strlen(value)+1;
+
+	    if (nzt + 1 > nalloc) {
+		nalloc += 10;
+		zt = (ztr_text_t *)xrealloc(zt, nalloc * sizeof(*zt));
+	    }
+	    zt[nzt].ident = ident;
+	    zt[nzt].value = value;
+	    nzt++;
+	}
+    }
+
+    ztr->text_segments = zt;
+    ztr->ntext_segments = nzt;
+
+    /*
+    for (i = 0; i < ztr->ntext_segments; i++) {
+	fprintf(stderr, "'%s' = '%s'\n",
+		ztr->text_segments[i].ident,
+		ztr->text_segments[i].value);
+    }
+    */
+
+    xfree(text_chunks);
+}
+
+
+/*
+ * fread_ztr
+ *
+ * Reads a ZTR file from 'fp'. This checks for the correct magic number and
+ * major version number, but not minor version number.
+ *
+ * FIXME: Add automatic uncompression?
+ *
+ * Arguments:
+ *	fp		A readable FILE pointer
+ *
+ * Returns:
+ *	Success: Pointer to a ztr_t structure (malloced)
+ *	Failure: NULL
+ */
+ztr_t *fread_ztr(FILE *fp) {
+    ztr_t *ztr;
+    ztr_chunk_t *chunk;
+    int sections = read_sections(0);
+    
+    /* Allocate */
+    if (NULL == (ztr = new_ztr()))
+	return NULL;
+
+    /* Read the header */
+    if (-1 == ztr_read_header(fp, &ztr->header))
+	return NULL;
+
+    /* Check magic number and version */
+    if (memcmp(ztr->header.magic, ZTR_MAGIC, 8) != 0)
+	return NULL;
+
+    if (ztr->header.version_major != ZTR_VERSION_MAJOR)
+	return NULL;
+
+    /* Load chunks */
+    while (chunk = ztr_read_chunk_hdr(fp)) {
+	/*
+	char str[5];
+
+	fprintf(stderr, "Read chunk %.4s %08x length %d\n",
+		ZTR_BE2STR(chunk->type, str), chunk->type, chunk->dlength);
+	*/
+	switch(chunk->type) {
+	case ZTR_TYPE_HEADER:
+	    /* End of file */
+	    return ztr;
+
+	case ZTR_TYPE_SAMP:
+	case ZTR_TYPE_SMP4:
+	    if (! (sections & READ_SAMPLES)) {
+		fseek(fp, chunk->dlength, SEEK_CUR);
+		xfree(chunk);
+		continue;
+	    }
+	    break;
+
+          
+	case ZTR_TYPE_BASE:
+	case ZTR_TYPE_BPOS:
+	case ZTR_TYPE_CNF4:
+	case ZTR_TYPE_CNF1:
+	case ZTR_TYPE_CSID:
+	    if (! (sections & READ_BASES)) {
+		fseek(fp, chunk->dlength, SEEK_CUR);
+		xfree(chunk);
+		continue;
+	    }
+	    break;
+
+	case ZTR_TYPE_TEXT:
+	    if (! (sections & READ_COMMENTS)) {
+		fseek(fp, chunk->dlength, SEEK_CUR);
+		xfree(chunk);
+		continue;
+	    }
+	    break;
+
+	case ZTR_TYPE_CLIP:
+	case ZTR_TYPE_FLWO:
+	case ZTR_TYPE_FLWC:
+	    break;
+
+	    /*
+	default:
+	    fprintf(stderr, "Unknown chunk type '%s': skipping\n",
+		    ZTR_BE2STR(chunk->type,str));
+	    fseek(fp, chunk->dlength, SEEK_CUR);
+	    xfree(chunk);
+	    continue;
+	    */
+	}
+
+	chunk->ztr_owns = 1;
+	chunk->data = (char *)xmalloc(chunk->dlength);
+	if (chunk->dlength != fread(chunk->data, 1, chunk->dlength, fp)) {
+	    delete_ztr(ztr);
+	    return NULL;
+	}
+            
+	ztr->nchunks++;
+	ztr->chunk = (ztr_chunk_t *)xrealloc(ztr->chunk, ztr->nchunks *
+					     sizeof(ztr_chunk_t));
+	memcpy(&ztr->chunk[ztr->nchunks-1], chunk, sizeof(*chunk));
+	xfree(chunk);
+    }
+
+    return ztr;
+}
+
+/*
+ * ---------------------------------------------------------------------------
+ * Other utility functions
+ * ---------------------------------------------------------------------------
+ */
+/*
+ * new_ztr
+ *
+ * Allocates and initialises a ztr_t structure
+ *
+ * Returns:
+ *	ztr_t pointer on success
+ *	NULL on failure
+ */
+ztr_t *new_ztr(void) {
+    ztr_t *ztr;
+
+    /* Allocate */
+    if (NULL == (ztr = (ztr_t *)xmalloc(sizeof(*ztr))))
+	return NULL;
+
+    ztr->chunk = NULL;
+    ztr->nchunks = 0;
+    ztr->text_segments = NULL;
+    ztr->ntext_segments = 0;
+    ztr->delta_level = 3;
+
+    ztr->nhcodes = 0;
+    ztr->hcodes = NULL;
+    ztr->hcodes_checked = 0;
+
+    return ztr;
+}
+
+void delete_ztr(ztr_t *ztr) {
+    int i;
+
+    if (!ztr)
+	return;
+
+    if (ztr->chunk) {
+	for (i = 0; i < ztr->nchunks; i++) {
+	    if (ztr->chunk[i].data && ztr->chunk[i].ztr_owns)
+		xfree(ztr->chunk[i].data);
+	    if (ztr->chunk[i].mdata && ztr->chunk[i].ztr_owns)
+		xfree(ztr->chunk[i].mdata);
+	}
+	xfree(ztr->chunk);
+    }
+
+    if (ztr->hcodes) {
+	for (i = 0; i < ztr->nhcodes; i++) {
+	    if (ztr->hcodes[i].codes && ztr->hcodes[i].ztr_owns)
+		huffman_codeset_destroy(ztr->hcodes[i].codes);
+	}
+	free(ztr->hcodes);
+    }
+
+    if (ztr->text_segments)
+	xfree(ztr->text_segments);
+
+    xfree(ztr);
+}
+
+/*
+ * ztr_find_chunks
+ *
+ * Searches for chunks of a specific type.
+ *
+ * Returns:
+ *	Array of ztr_chunk_t pointers (into the ztr struct). This is
+ *	  allocated by malloc and it is the callers duty to free this.
+ *	NULL if none found.
+ */
+ztr_chunk_t **ztr_find_chunks(ztr_t *ztr, uint4 type, int *nchunks_p) {
+    ztr_chunk_t **chunks = NULL;
+    int nchunks = 0;
+    int i;
+
+    for (i = 0; i < ztr->nchunks; i++) {
+	if (ztr->chunk[i].type == type) {
+	    chunks = (ztr_chunk_t **)xrealloc(chunks, (nchunks + 1) *
+					      sizeof(*chunks));
+	    chunks[nchunks++] = &ztr->chunk[i];
+	}
+    }
+    *nchunks_p = nchunks;
+    return chunks;
+}
+
+/*
+ * Shannon showed that for storage in base 'b' with alphabet symbols 'a' having
+ * a probability of ocurring in any context of 'Pa' we should encode
+ * symbol 'a' to have a storage width of -logb(Pa).
+ *
+ * Eg. b = 26, P(e) = .22. => width .4647277.
+ *
+ * We use this to calculate the entropy of a signal by summing over all letters
+ * in the signal. In this case, our storage has base 256.
+ */
+#define EBASE 256
+static double entropy(unsigned char *data, int len) {
+    double E[EBASE];
+    double P[EBASE];
+    double e;
+    int i;
+    
+    for (i = 0; i < EBASE; i++)
+        P[i] = 0;
+
+    for (i = 0; i < len; i++)
+        P[data[i]]++;
+
+    for (i = 0; i < EBASE; i++) {
+        if (P[i]) {
+            P[i] /= len;
+            E[i] = -(log(P[i])/log(EBASE));
+        } else {
+            E[i] = 0;
+        }
+    }
+
+    for (e = i = 0; i < len; i++)
+        e += E[data[i]];
+
+    return e;
+}
+
+/*
+ * Adds a user-defined huffman_codeset_t code-set to the available code sets
+ * used by huffman_encode or huffman_decode.
+ *
+ * Note that the 'codes' memory is then "owned" by the ztr object if "ztr_owns"
+ * is true and will be deallocated when the ztr object is destroyed. Otherwise
+ * freeing the ztr object will not touch the passed in codes.
+ */
+ztr_hcode_t *ztr_add_hcode(ztr_t *ztr, huffman_codeset_t *codes,
+			   int ztr_owns) {
+    if (!codes)
+	return NULL;
+
+    ztr->hcodes = realloc(ztr->hcodes, (ztr->nhcodes+1)*sizeof(*ztr->hcodes));
+    ztr->hcodes[ztr->nhcodes].codes = codes;
+    ztr->hcodes[ztr->nhcodes].ztr_owns = ztr_owns;
+
+    return &ztr->hcodes[ztr->nhcodes++];
+}
+
+/*
+ * Searches through the cached huffman_codeset_t tables looking for a stored
+ * huffman code of type 'code_set'.
+ * NB: only code_sets >= CODE_USER will be stored here.
+ *
+ * Returns codes on success,
+ *         NULL on failure
+ */
+ztr_hcode_t *ztr_find_hcode(ztr_t *ztr, int code_set) {
+    int i;
+
+    if (code_set < CODE_USER)
+	return NULL; /* computed on-the-fly or use a hard-coded set */
+
+    /* Check through chunks for undecoded HUFF chunks */
+    if (!ztr->hcodes_checked) {
+	for (i = 0; i < ztr->nchunks; i++) {
+	    if (ztr->chunk[i].type == ZTR_TYPE_HUFF) {
+		block_t *blk;
+		huffman_codeset_t *cs;
+		uncompress_chunk(ztr, &ztr->chunk[i]);
+		blk = block_create((unsigned char *)(ztr->chunk[i].data+2),
+				   ztr->chunk[i].dlength-2);
+		cs = restore_codes(blk, NULL);
+		if (!cs) {
+		    block_destroy(blk, 1);
+		    return NULL;
+		}
+		cs->code_set = (unsigned char)(ztr->chunk[i].data[1]);
+		ztr_add_hcode(ztr, cs, 1);
+		block_destroy(blk, 1);
+	    }
+	}
+	ztr->hcodes_checked = 1;
+    }
+
+    /* Check cached copies */
+    for (i = 0; i < ztr->nhcodes; i++) {
+	if (ztr->hcodes[i].codes->code_set == code_set)
+	    return &ztr->hcodes[i];
+    }
+
+    return NULL;
+}
+
+ztr_chunk_t *ztr_find_hcode_chunk(ztr_t *ztr, int code_set) {
+    int i;
+
+    if (code_set < CODE_USER)
+	return NULL; /* computed on-the-fly or use a hard-coded set */
+
+    /* Check through chunks for undecoded HUFF chunks */
+    for (i = 0; i < ztr->nchunks; i++) {
+	if (ztr->chunk[i].type == ZTR_TYPE_HUFF) {
+	    uncompress_chunk(ztr, &ztr->chunk[i]);
+	    if (ztr->chunk[i].dlength >= 2 &&
+		(unsigned char)ztr->chunk[i].data[1] == code_set)
+		return &ztr->chunk[i];
+	}
+    }
+
+    return NULL;
+}
+
+/*
+ * Adds a new chunk to a ztr file and returns the chunk pointer.
+ * The data and mdata fields can be NULL and the chunk will not be
+ * initialised.
+ *
+ * Returns new chunk ptr on success.
+ *         NULL on failure.
+ */
+ztr_chunk_t *ztr_new_chunk(ztr_t *ztr, uint4 type,
+			   char *data,  uint4 dlength,
+			   char *mdata, uint4 mdlength) {
+    ztr_chunk_t *chunks, *c;
+
+    /* Grow the chunk array */
+    chunks = (ztr_chunk_t *)realloc(ztr->chunk,
+				    (ztr->nchunks+1) * sizeof(*chunks));
+    if (!chunks)
+	return NULL;
+    ztr->chunk = chunks;
+
+    /* Initialise */
+    c = &ztr->chunk[ztr->nchunks++];
+    c->type     = type;
+    c->data     = data;
+    c->dlength  = dlength;
+    c->mdata    = mdata;
+    c->mdlength = mdlength;
+    c->ztr_owns = 1;
+
+    return c;
+}
+
+/*
+ * Adds a key/value pair to a ztr TEXT chunk.
+ * The 'ch' chunk may be explicitly specified in which case the text
+ * is added to that chunk or it may be specified as NULL in which case
+ * the key/value pair are added to the first available TEXT chunk,
+ * possibly creating a new one if required.
+ *
+ * NOTE: If the key already exists in the text chunk this appends a new
+ * copy; it does not overwrite the old one.
+ *
+ * Returns ztr text chunk ptr for success
+ *        NULL for failure
+ */
+ztr_chunk_t *ztr_add_text(ztr_t *z, ztr_chunk_t *ch,
+			  const char *key, const char *value) {
+    ztr_chunk_t **text_chunks = NULL;
+    int ntext_chunks;
+    size_t key_len, value_len;
+    char *cp;
+
+    /* Find/create the appropriate chunk */
+    if (!ch) {
+	text_chunks = ztr_find_chunks(z, ZTR_TYPE_TEXT, &ntext_chunks);
+	if (!text_chunks) {
+	    ch = ztr_new_chunk(z, ZTR_TYPE_TEXT, NULL, 0, NULL, 0);
+	} else {
+	    ch = text_chunks[0];
+	    xfree(text_chunks);
+	}
+    }
+
+    if (ch->type != ZTR_TYPE_TEXT)
+	return NULL;
+
+    /* Make sure it's not compressed */
+    uncompress_chunk(z, ch);
+
+    /* Append key\0value\0 */
+    key_len = strlen(key);
+    value_len = strlen(value);
+    cp = ch->data;
+    if (cp) {
+	/* Set ch->dlength to the last non-nul byte of the previous value */
+	while (ch->dlength && ch->data[ch->dlength-1] == 0)
+	    ch->dlength--;
+    }
+
+    cp = realloc(ch->data, 1 + ch->dlength + key_len + value_len + 3);
+    if (NULL == cp)
+	return NULL;
+    else
+	ch->data = cp;
+
+    cp = &ch->data[ch->dlength];
+
+    /*
+     * Note this is a bit cryptic, but it works.
+     * When appending to an existing text chunk we write a preceeding nul
+     * to mark the end of the previous value (we rewound above specifically
+     * for this case).
+     * When creating a new chunk we still write a nul, but in this case it's
+     * the RAW format byte.  After the value we add an extra nul to
+     * indicate the last entry.
+     */
+    ch->dlength += 1+sprintf(cp, "%c%s%c%s%c", 0, key, 0, value, 0);
+
+    return ch;
+}
+
+
+
+/*
+ * Stores held ztr huffman_codes as ZTR chunks.
+ * Returns 0 for success
+ *        -1 for failure
+ */
+int ztr_store_hcodes(ztr_t *ztr) {
+    int i;
+    ztr_chunk_t *chunks;
+    int nchunks;
+
+    if (ztr->nhcodes == 0)
+	return 0;
+
+    /* Extend chunks array */
+    nchunks = ztr->nchunks + ztr->nhcodes;
+    chunks = (ztr_chunk_t *)realloc(ztr->chunk, nchunks * sizeof(*chunks));
+    if (!chunks)
+	return -1;
+    ztr->chunk = chunks;
+
+    /* Encode */
+    for (i = 0; i < ztr->nhcodes; i++) {
+	block_t *blk = block_create(NULL, 2);
+	int j = ztr->nchunks;
+	unsigned char bytes[2];
+
+	ztr->chunk[j].type = ZTR_TYPE_HUFF;
+	ztr->chunk[j].mdata = 0;
+	ztr->chunk[j].mdlength = 0;
+	ztr->chunk[j].ztr_owns = 1;
+	bytes[0] = 0;
+	bytes[1] = ztr->hcodes[i].codes->code_set;
+	store_bytes(blk, bytes, 2);
+	/* FIXME: Now already cached in ztr_hcode_t */
+	if (0 == store_codes(blk, ztr->hcodes[i].codes, 1)) {
+	    /* Last byte is always merged with first of stream */
+	    if (blk->bit == 0) {
+		unsigned char zero = 0;
+		store_bytes(blk, &zero, 1);
+	    }
+
+	    ztr->chunk[j].data = (char *)blk->data;
+	    ztr->chunk[j].dlength = blk->byte + (blk->bit != 0);
+	    block_destroy(blk, 1);
+	    ztr->nchunks++;
+	}
+    }
+
+    return ztr->nchunks == nchunks ? 0 : -1;
+}
+
+/*
+ * Given a ZTR chunk this searches through the meta-data key/value pairings
+ * to return the corresponding value.
+ *
+ * Returns a pointer into the mdata on success (nul-terminated)
+ *         NULL on failure.
+ */
+char *ztr_lookup_mdata_value(ztr_t *z, ztr_chunk_t *chunk, char *key) {
+    if (z->header.version_major > 1 ||
+	z->header.version_minor >= 2) {
+	/* ZTR format 1.2 onwards */
+	char *cp = chunk->mdata;
+	int32_t dlen = chunk->mdlength;
+
+	/*
+	 * NB: we may wish to rewrite this using a dedicated state machine
+	 * instead of strlen/strcmp as this currently assumes the meta-
+	 * data is correctly formatted, which we cannot assume as the 
+	 * metadata is external and outside of our control.
+	 * Passing in non-nul terminated strings could crash this code.
+	 */
+	while (dlen > 0) {
+	    size_t l;
+	    int found;
+
+	    /* key */
+	    l = strlen(cp);
+	    found = strcmp(cp, key) == 0;
+	    cp += l+1;
+	    dlen -= l+1;
+
+	    /* value */
+	    if (found)
+		return cp;
+	    l = strlen(cp);
+	    cp += l+1;
+	    dlen -= l+1;
+	}
+	return NULL;
+
+    } else {
+	/* v1.1 and before only supported a few types, specifically coded
+	 * per chunk type.
+	 */
+	switch (chunk->type) {
+	case ZTR_TYPE_SAMP:
+	case ZTR_TYPE_SMP4:
+	    if (strcmp(key, "TYPE"))
+		return chunk->mdata;
+	    break;
+
+	default:
+	    break;
+	}
+    }
+
+    return NULL;
+}
+
+/*
+ * Compresses an individual chunk using a specific format. The format is one
+ * of the 'format' fields listed in the spec; one of the ZTR_FORM_ macros.
+ */
+int compress_chunk(ztr_t *ztr, ztr_chunk_t *chunk, int format,
+		   int option, int option2) {
+    char *new_data = NULL;
+    int new_len;
+
+    switch (format) {
+    case ZTR_FORM_RAW:
+	return 0;
+
+    case ZTR_FORM_RLE:
+	new_data = rle(chunk->data, chunk->dlength, option, &new_len);
+	if (entropy((unsigned char *)new_data, new_len) >=
+	    entropy((unsigned char *)chunk->data, chunk->dlength)) {
+	    xfree(new_data);
+	    return 0;
+	}
+	break;
+
+    case ZTR_FORM_XRLE:
+	new_data = xrle(chunk->data, chunk->dlength, option,option2, &new_len);
+	break;
+
+    case ZTR_FORM_XRLE2:
+	new_data = xrle2(chunk->data, chunk->dlength, option, &new_len);
+	break;
+
+    case ZTR_FORM_ZLIB:
+	new_data = zlib_huff(chunk->data, chunk->dlength, option, &new_len);
+	break;
+
+    case ZTR_FORM_DELTA1:
+	new_data = decorrelate1(chunk->data, chunk->dlength, option, &new_len);
+	break;
+
+    case ZTR_FORM_DDELTA1:
+	new_data = decorrelate1dyn(chunk->data, chunk->dlength, &new_len);
+	break;
+
+    case ZTR_FORM_DELTA2:
+	new_data = decorrelate2(chunk->data, chunk->dlength, option, &new_len);
+	break;
+
+    case ZTR_FORM_DDELTA2:
+	new_data = decorrelate2dyn(chunk->data, chunk->dlength, &new_len);
+	break;
+
+    case ZTR_FORM_DELTA4:
+	new_data = decorrelate4(chunk->data, chunk->dlength, option, &new_len);
+	break;
+
+    case ZTR_FORM_16TO8:
+	new_data = shrink_16to8(chunk->data, chunk->dlength, &new_len);
+	break;
+
+    case ZTR_FORM_32TO8:
+	new_data = shrink_32to8(chunk->data, chunk->dlength, &new_len);
+	break;
+
+    case ZTR_FORM_FOLLOW1:
+	new_data = follow1(chunk->data, chunk->dlength, &new_len);
+	break;
+
+    case ZTR_FORM_ICHEB:
+	new_data = ichebcomp(chunk->data, chunk->dlength, &new_len);
+	break;
+
+    case ZTR_FORM_LOG2:
+	new_data = log2_data(chunk->data, chunk->dlength, &new_len);
+	break;
+
+    case ZTR_FORM_STHUFF:
+	new_data = sthuff(ztr, chunk->data, chunk->dlength, 
+			  option, option2, &new_len);
+	break;
+
+    case ZTR_FORM_QSHIFT:
+	new_data = qshift(chunk->data, chunk->dlength, &new_len);
+	break;
+
+    case ZTR_FORM_TSHIFT:
+	new_data = tshift(ztr, chunk->data, chunk->dlength, &new_len);
+	break;
+    }
+
+    if (!new_data) {
+	fprintf(stderr, "!!ERROR!!\n");
+	return -1;
+    }
+
+    /*
+    fprintf(stderr, "Format %d => %d to %d\n", format, chunk->dlength, new_len);
+    */
+
+    chunk->dlength = new_len;
+    xfree(chunk->data);
+    chunk->data = new_data;
+
+    return 0;
+}
+
+/*
+ * Uncompresses an individual chunk from all levels of compression.
+ */
+int uncompress_chunk(ztr_t *ztr, ztr_chunk_t *chunk) {
+    char *new_data = NULL;
+    int new_len;
+
+    while (chunk->dlength > 0 && chunk->data[0] != ZTR_FORM_RAW) {
+	switch (chunk->data[0]) {
+	case ZTR_FORM_RLE:
+	    new_data = unrle(chunk->data, chunk->dlength, &new_len);
+	    break;
+
+	case ZTR_FORM_XRLE:
+	    new_data = unxrle(chunk->data, chunk->dlength, &new_len);
+	    break;
+
+	case ZTR_FORM_XRLE2:
+	    new_data = unxrle2(chunk->data, chunk->dlength, &new_len);
+	    break;
+
+	case ZTR_FORM_ZLIB:
+	    new_data = zlib_dehuff(chunk->data, chunk->dlength, &new_len);
+	    break;
+
+	case ZTR_FORM_DELTA1:
+	    new_data = recorrelate1(chunk->data, chunk->dlength, &new_len);
+	    break;
+
+	case ZTR_FORM_DELTA2:
+	    new_data = recorrelate2(chunk->data, chunk->dlength, &new_len);
+	    break;
+
+	case ZTR_FORM_DELTA4:
+	    new_data = recorrelate4(chunk->data, chunk->dlength, &new_len);
+	    break;
+
+	case ZTR_FORM_16TO8:
+	    new_data = expand_8to16(chunk->data, chunk->dlength, &new_len);
+	    break;
+
+	case ZTR_FORM_32TO8:
+	    new_data = expand_8to32(chunk->data, chunk->dlength, &new_len);
+	    break;
+
+	case ZTR_FORM_FOLLOW1:
+	    new_data = unfollow1(chunk->data, chunk->dlength, &new_len);
+	    break;
+
+	case ZTR_FORM_ICHEB:
+	    new_data = ichebuncomp(chunk->data, chunk->dlength, &new_len);
+	    break;
+
+	case ZTR_FORM_LOG2:
+	    new_data = unlog2_data(chunk->data, chunk->dlength, &new_len);
+	    break;
+
+	case ZTR_FORM_STHUFF:
+	    new_data = unsthuff(ztr, chunk->data, chunk->dlength, &new_len);
+	    break;
+	    
+	case ZTR_FORM_QSHIFT:
+	    new_data = unqshift(chunk->data, chunk->dlength, &new_len);
+	    break;
+
+	case ZTR_FORM_TSHIFT:
+	    new_data = untshift(ztr, chunk->data, chunk->dlength, &new_len);
+	    break;
+
+	default:
+	    fprintf(stderr, "Unknown encoding format %d\n", chunk->data[0]);
+	    return -1;
+	}
+	    
+	if (!new_data)
+	    return -1;
+
+	/*
+	fprintf(stderr, "format %d => %d to %d\n",
+		chunk->data[0], chunk->dlength, new_len);
+	*/
+
+	chunk->dlength = new_len;
+	xfree(chunk->data);
+	chunk->data = new_data;
+    }
+
+    return 0;
+}
+
+/*
+ * Compresses a ztr (in memory).
+ * Level is 0, 1, 2 or 3 (no compression, delta, delta + zlib,
+ * chebyshev + zlib).
+ */
+int compress_ztr(ztr_t *ztr, int level) {
+    int i;
+
+    if (0 == level)
+	return 0;
+
+    for (i = 0; i < ztr->nchunks; i++) {
+	/*
+	{
+	    char str[5];
+	    fprintf(stderr, "---- %.4s ----\n",
+		    ZTR_BE2STR(ztr->chunk[i].type,str));
+	}
+	fprintf(stderr, "Uncomp length=%d\n", ztr->chunk[i].dlength);
+	*/
+
+	switch(ztr->chunk[i].type) {
+	    char *type;
+	case ZTR_TYPE_SAMP:
+	case ZTR_TYPE_SMP4:
+#ifdef ILLUMINA_GA
+	    compress_chunk(ztr, &ztr->chunk[i],
+			   ZTR_FORM_STHUFF, CODE_TRACES, 0);
+#else
+	    type = ztr_lookup_mdata_value(ztr, &ztr->chunk[i], "TYPE");
+	    if (type && 0 == strcmp(type, "PYRW")) {
+		/* Raw data is not really compressable */
+	    } else if (type && 0 == strcmp(type, "PYNO")) {
+		if (level > 1) {
+		    compress_chunk(ztr, &ztr->chunk[i], ZTR_FORM_16TO8,  0, 0);
+		    compress_chunk(ztr, &ztr->chunk[i],
+				   ZTR_FORM_ZLIB, Z_HUFFMAN_ONLY, 0);
+		}
+	    } else {
+		if (level <= 2) {
+		    /*
+		     * Experiments show that typically a double delta does
+		     * better than a single delta for 8-bit data, and the other
+		     * way around for 16-bit data
+		     */
+		    compress_chunk(ztr, &ztr->chunk[i], ZTR_FORM_DELTA2,
+				   ztr->delta_level, 0);
+		} else {
+		    compress_chunk(ztr, &ztr->chunk[i], ZTR_FORM_ICHEB,  0, 0);
+		}
+		
+		compress_chunk(ztr, &ztr->chunk[i], ZTR_FORM_16TO8,  0, 0);
+		if (level > 1) {
+		    compress_chunk(ztr, &ztr->chunk[i], ZTR_FORM_FOLLOW1,0, 0);
+		    /*
+		      compress_chunk(ztr, &ztr->chunk[i],
+		                     ZTR_FORM_ZLIB, Z_HUFFMAN_ONLY);
+		    */
+		    compress_chunk(ztr, &ztr->chunk[i], ZTR_FORM_RLE,  150, 0);
+		    compress_chunk(ztr, &ztr->chunk[i],
+		    		   ZTR_FORM_ZLIB, Z_HUFFMAN_ONLY, 0);
+		}
+	    }
+#endif
+	    break;
+
+	case ZTR_TYPE_BASE:
+#ifdef ILLUMINA_GA
+	    compress_chunk(ztr, &ztr->chunk[i], ZTR_FORM_STHUFF, CODE_DNA, 0);
+#else
+	    if (level > 1) {
+		compress_chunk(ztr, &ztr->chunk[i],
+			       ZTR_FORM_ZLIB, Z_HUFFMAN_ONLY, 0);
+	    }
+#endif
+	    break;
+
+	case ZTR_TYPE_CNF1:
+	case ZTR_TYPE_CNF4:
+	case ZTR_TYPE_CSID:
+#ifdef ILLUMINA_GA
+	    compress_chunk(ztr, &ztr->chunk[i], ZTR_FORM_RLE,  77, 0);
+	    compress_chunk(ztr, &ztr->chunk[i],
+			   ZTR_FORM_STHUFF, CODE_CONF_RLE, 0);
+#else
+	    compress_chunk(ztr, &ztr->chunk[i], ZTR_FORM_DELTA1, 1, 0);
+	    compress_chunk(ztr, &ztr->chunk[i], ZTR_FORM_RLE,  77, 0);
+	    if (level > 1) {
+		compress_chunk(ztr, &ztr->chunk[i],
+			       ZTR_FORM_ZLIB, Z_HUFFMAN_ONLY, 0);
+	    }
+#endif
+	    break;
+
+	case ZTR_TYPE_BPOS:
+	    compress_chunk(ztr, &ztr->chunk[i], ZTR_FORM_DELTA4, 1, 0);
+	    compress_chunk(ztr, &ztr->chunk[i], ZTR_FORM_32TO8,  0, 0);
+	    if (level > 1) {
+		compress_chunk(ztr, &ztr->chunk[i],
+			       ZTR_FORM_ZLIB, Z_HUFFMAN_ONLY, 0);
+	    }
+	    break;
+
+	case ZTR_TYPE_TEXT:
+#ifdef ILLUMINA_GA
+#else
+	    if (level > 1) {
+		compress_chunk(ztr, &ztr->chunk[i],
+			       ZTR_FORM_ZLIB, Z_HUFFMAN_ONLY, 0);
+	    }
+#endif
+	    break;
+
+	case ZTR_TYPE_FLWO:
+	    compress_chunk(ztr, &ztr->chunk[i], ZTR_FORM_XRLE, 0, 4);
+	    break;
+
+	}
+
+	/*
+	fprintf(stderr, "Comp length=%d\n", ztr->chunk[i].dlength);
+	*/
+    }
+
+    return 0;
+}
+
+/*
+ * Uncompresses a ztr (in memory).
+ */
+int uncompress_ztr(ztr_t *ztr) {
+    int i;
+
+    for (i = 0; i < ztr->nchunks; i++) {
+	/*
+	{
+            char str[5];
+	    fprintf(stderr, "---- %.4s ----\n",
+		    ZTR_BE2STR(ztr->chunk[i].type,str));
+	}
+	*/
+	uncompress_chunk(ztr, &ztr->chunk[i]);
+    }
+
+    return 0;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/ztr.h	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,155 @@
+#ifndef _ZTR_H
+#define _ZTR_H
+
+#include "io_lib/Read.h"
+#include "io_lib/deflate_interlaced.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* The header */
+typedef struct {
+    unsigned char  magic[8];	  /* 0xae5a54520d0a1a0a (be) */
+    unsigned char  version_major; /* ZTR_VERSION_MAJOR */
+    unsigned char  version_minor; /* ZTR_VERSION_MINOR */
+} ztr_header_t;
+
+/* The ZTR magic numbers */
+#define ZTR_MAGIC   		"\256ZTR\r\n\032\n"
+#define ZTR_VERSION_MAJOR	1
+#define ZTR_VERSION_MINOR	2
+
+/*
+ * CHUNKS
+ *
+ * Chunks consist of a block length followed by the type, format and data.
+ */
+
+typedef struct {
+    uint4 type;			/* chunk type (be) */
+    uint4 mdlength;		/* length of meta data field (be) */
+    char *mdata;		/* meta data */
+    uint4 dlength;		/* length of data field (be) */
+    char *data;			/* a format byte and the data itself */
+    int   ztr_owns;		/* boolean: true if we can free (meta)data */
+} ztr_chunk_t;
+
+/* Format types */
+#define ZTR_FORM_RAW		0
+#define ZTR_FORM_RLE		1
+#define ZTR_FORM_ZLIB		2
+#define ZTR_FORM_XRLE		3
+#define ZTR_FORM_XRLE2		4
+#define ZTR_FORM_DELTA1		64
+#define ZTR_FORM_DELTA2		65
+#define ZTR_FORM_DELTA4		66
+#define ZTR_FORM_DDELTA1	67
+#define ZTR_FORM_DDELTA2	68
+#define ZTR_FORM_DDELTA4	69
+#define ZTR_FORM_16TO8		70
+#define ZTR_FORM_32TO8		71
+#define ZTR_FORM_FOLLOW1	72
+#define ZTR_FORM_CHEB445	73
+#define ZTR_FORM_ICHEB		74
+#define ZTR_FORM_LOG2		75
+#define ZTR_FORM_STHUFF	        77
+#define ZTR_FORM_QSHIFT		79
+#define ZTR_FORM_TSHIFT		80
+
+/* Converts a C string to a big-endian 4-byte int */
+#define ZTR_STR2BE(str) (((str)[0] << 24) + \
+                         ((str)[1] << 16) + \
+                         ((str)[2] <<  8) + \
+                         ((str)[3] <<  0))
+
+/* Converts a big-endian 4-byte int to a C string */
+#define ZTR_BE2STR(i,str) (((str)[0]=((i)>>24)&0xff),\
+                           ((str)[1]=((i)>>16)&0xff),\
+                           ((str)[2]=((i)>> 8)&0xff),\
+                           ((str)[3]=((i)>> 0)&0xff),\
+			   (str)[4]='\0',str)\
+
+#define ZTR_TYPE_HEADER	0xae5a5452 /* M-. Z T R */
+
+#define ZTR_TYPE_SAMP	0x53414d50
+#define ZTR_TYPE_SMP4	0x534d5034
+#define ZTR_TYPE_BASE	0x42415345
+#define ZTR_TYPE_BPOS	0x42504f53
+#define ZTR_TYPE_CNF4	0x434e4634
+#define ZTR_TYPE_CNF1	0x434e4631
+#define ZTR_TYPE_CSID	0x43534944
+#define ZTR_TYPE_TEXT	0x54455854
+#define ZTR_TYPE_CLIP	0x434c4950
+#define ZTR_TYPE_COMM	0x434f4d4d
+#define ZTR_TYPE_CR32	0x43523332
+#define ZTR_TYPE_FLWO	0x464c574f
+#define ZTR_TYPE_FLWC	0x464c5743
+#define ZTR_TYPE_HUFF   0x48554646
+#define ZTR_TYPE_REGN   0x5245474e
+
+/* A text segment consists of identifier and value */
+typedef struct {
+    char *ident; /* Pointer to identifier */
+    char *value; /* Pointer to value */
+} ztr_text_t;
+
+typedef struct {
+    int ztr_owns; /* true is ZTR is to free the data later */
+    huffman_codeset_t *codes;
+} ztr_hcode_t;
+
+/* The main ZTR structure, which holds the entire file contents */
+typedef struct {
+    /* General bits to do with the ZTR file format */
+    ztr_header_t header;	/* File Header */
+    ztr_chunk_t *chunk;		/* Array of chunks */
+    int nchunks;		/* Number of chunks */
+
+    /* Specifics to do with the standard chunk types */
+    ztr_text_t *text_segments;
+    int ntext_segments;
+
+    /* 'Hint' for delta of SAMP and SMP4 */
+    int delta_level;
+
+    /* Cached huffman encoding/decoding tables for STHUFF format */
+    ztr_hcode_t *hcodes;
+    int nhcodes;
+    int hcodes_checked;
+} ztr_t;
+
+int ztr_read_header(mFILE *fp, ztr_header_t *h);
+ztr_chunk_t *ztr_read_chunk_hdr(mFILE *fp);
+
+int fwrite_ztr(FILE *fp, ztr_t *ztr);
+int mfwrite_ztr(mFILE *fp, ztr_t *ztr);
+ztr_t *fread_ztr(FILE *fp);
+ztr_t *mfread_ztr(mFILE *fp);
+Read *ztr2read(ztr_t *ztr);
+ztr_t *read2ztr(Read *r);
+int compress_ztr(ztr_t *ztr, int level);
+int uncompress_ztr(ztr_t *ztr);
+ztr_t *new_ztr(void);
+void delete_ztr(ztr_t *ztr);
+ztr_chunk_t **ztr_find_chunks(ztr_t *ztr, uint4 type, int *nchunks_p);
+void ztr_process_text(ztr_t *ztr);
+int compress_chunk(ztr_t *ztr, ztr_chunk_t *chunk, int format,
+		   int option, int option2);
+int uncompress_chunk(ztr_t *ztr, ztr_chunk_t *chunk);
+ztr_hcode_t *ztr_add_hcode(ztr_t *ztr, huffman_codeset_t *codes, int ztr_owns);
+int ztr_store_hcodes(ztr_t *ztr);
+ztr_hcode_t *ztr_find_hcode(ztr_t *ztr, int code_set);
+ztr_chunk_t *ztr_find_hcode_chunk(ztr_t *ztr, int code_set);
+char *ztr_lookup_mdata_value(ztr_t *z, ztr_chunk_t *chunk, char *key);
+ztr_chunk_t *ztr_new_chunk(ztr_t *ztr, uint4 type,
+			   char *data,  uint4 dlength,
+			   char *mdata, uint4 mdlength);
+ztr_chunk_t *ztr_add_text(ztr_t *z, ztr_chunk_t *ch,
+			  const char *key, const char *value);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _ZTR_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib/ztr_translate.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,1145 @@
+#include <stdio.h>
+#include <string.h>
+
+#include "io_lib/ztr.h"
+#include "io_lib/xalloc.h"
+#include "io_lib/Read.h"
+
+/* Return the A,C,G,T samples */
+static char *ztr_encode_samples_4(ztr_t *z,
+				  Read *r, int *nbytes, char **mdata,
+				  int *mdbytes) {
+    char *bytes;
+    int i, j, t;
+
+    if (!r->NPoints)
+	return NULL;
+
+    if ((z->header.version_major > 1 ||
+	z->header.version_minor >= 2) && r->baseline) {
+	/* 1.2 onwards */
+	char buf[256];
+	int blen;
+	blen = sprintf(buf, "%d", r->baseline);
+	*mdata = (char *)malloc(6+blen);
+	*mdbytes = sprintf(*mdata, "OFFS%c%s", 0, buf) + 1;
+    } else {
+	*mdata = NULL;
+	*mdbytes = 0;
+    }
+
+    bytes = (char *)xmalloc(r->NPoints * sizeof(TRACE)*4 + 2);
+    for (i = 0, j = 2; i < r->NPoints; i++) {
+	t = r->traceA[i];
+	bytes[j++] = (t >> 8) & 0xff;
+	bytes[j++] = (t >> 0) & 0xff;
+    }
+    for (i = 0; i < r->NPoints; i++) {
+	t = r->traceC[i];
+	bytes[j++] = (t >> 8) & 0xff;
+	bytes[j++] = (t >> 0) & 0xff;
+    }
+    for (i = 0; i < r->NPoints; i++) {
+	t = r->traceG[i];
+	bytes[j++] = (t >> 8) & 0xff;
+	bytes[j++] = (t >> 0) & 0xff;
+    }
+    for (i = 0; i < r->NPoints; i++) {
+	t = r->traceT[i];
+	bytes[j++] = (t >> 8) & 0xff;
+	bytes[j++] = (t >> 0) & 0xff;
+    }
+    *nbytes = 4 * r->NPoints * sizeof(TRACE) + 2;
+
+    bytes[0] = ZTR_FORM_RAW;
+    bytes[1] = 0;
+    return bytes;
+}
+
+static void ztr_decode_samples_4(ztr_t *z, ztr_chunk_t *chunk, Read *r) {
+    int i, j;
+    int maxTraceVal = 0;
+    TRACE sample;
+    unsigned char *bytes = (unsigned char *)chunk->data;
+    int nbytes = chunk->dlength;
+
+    bytes+=2;
+    nbytes-=2;
+
+    /* Store in the Read structure */
+    r->NPoints = nbytes/8;
+    if (r->traceA) xfree(r->traceA);
+    if (r->traceC) xfree(r->traceC);
+    if (r->traceG) xfree(r->traceG);
+    if (r->traceT) xfree(r->traceT);
+    r->traceA = (TRACE *)xmalloc(r->NPoints * sizeof(TRACE));
+    r->traceC = (TRACE *)xmalloc(r->NPoints * sizeof(TRACE));
+    r->traceG = (TRACE *)xmalloc(r->NPoints * sizeof(TRACE));
+    r->traceT = (TRACE *)xmalloc(r->NPoints * sizeof(TRACE));
+
+    for (i = j = 0; i < r->NPoints; i++, j+=2) {
+	sample = (bytes[j] << 8) | bytes[j+1];
+	r->traceA[i] = sample;
+	if (maxTraceVal < sample)
+	    maxTraceVal = sample;
+    }
+    for (i = 0; i < r->NPoints; i++, j+=2) {
+	sample = (bytes[j] << 8) | bytes[j+1];
+	r->traceC[i] = sample;
+	if (maxTraceVal < sample)
+	    maxTraceVal = sample;
+    }
+    for (i = 0; i < r->NPoints; i++, j+=2) {
+	sample = (bytes[j] << 8) | bytes[j+1];
+	r->traceG[i] = sample;
+	if (maxTraceVal < sample)
+	    maxTraceVal = sample;
+    }
+    for (i = 0; i < r->NPoints; i++, j+=2) {
+	sample = (bytes[j] << 8) | bytes[j+1];
+	r->traceT[i] = sample;
+	if (maxTraceVal < sample)
+	    maxTraceVal = sample;
+    }
+
+    r->maxTraceVal = maxTraceVal;
+}
+
+/* Return the [A,C,G,T] samples */
+static char *ztr_encode_samples_common(ztr_t *z,
+				       char ident[4], Read *r,
+				       TRACE *data, int *nbytes,
+				       char **mdata, int *mdbytes) {
+    char *bytes;
+    int i, j, t;
+
+    if (!r->NPoints)
+	return NULL;
+
+    if (z->header.version_major > 1 ||
+	z->header.version_minor >= 2) {
+	/* 1.2 onwards */
+	char buf[256];
+	int blen;
+	if (r->baseline) {
+	    blen = sprintf(buf, "%d", r->baseline);
+	    *mdata = (char *)malloc(16+blen);
+	    *mdbytes = sprintf(*mdata, "TYPE%c%.*s%cOFFS%c%s",
+			       0, 4, ident, 0,
+			       0, buf) + 1;
+	} else {
+	    *mdata = (char *)malloc(10);
+	    *mdbytes = sprintf(*mdata, "TYPE%c%.*s", 0, 4, ident) + 1;
+	}
+    } else {
+	*mdata = (char *)malloc(4);
+	*mdbytes = 4;
+	(*mdata)[0] = ident[0];
+	(*mdata)[1] = ident[1];
+	(*mdata)[2] = ident[2];
+	(*mdata)[3] = ident[3];
+    }
+
+    bytes = (char *)xmalloc(r->NPoints * sizeof(TRACE) + 2);
+    for (i = 0, j = 2; i < r->NPoints; i++) {
+	t = data[i];
+	bytes[j++] = (t >> 8) & 0xff;
+	bytes[j++] = (t >> 0) & 0xff;
+    }
+    *nbytes = r->NPoints * sizeof(TRACE) + 2;
+
+    bytes[0] = ZTR_FORM_RAW;
+    bytes[1] = 0;
+    return bytes;
+}
+
+
+static char *ztr_encode_samples_A(ztr_t *z,
+				  Read *r, int *nbytes, char **mdata,
+				  int *mdbytes) {
+    return ztr_encode_samples_common(z, "A\0\0", r, r->traceA,
+				     nbytes, mdata, mdbytes);
+}
+
+static char *ztr_encode_samples_C(ztr_t *z,
+				  Read *r, int *nbytes, char **mdata,
+				  int *mdbytes) {
+    return ztr_encode_samples_common(z, "C\0\0", r, r->traceC,
+				     nbytes, mdata, mdbytes);
+}
+
+static char *ztr_encode_samples_G(ztr_t *z,
+				  Read *r, int *nbytes, char **mdata,
+				  int *mdbytes) {
+    return ztr_encode_samples_common(z, "G\0\0", r, r->traceG,
+				     nbytes, mdata, mdbytes);
+}
+
+static char *ztr_encode_samples_T(ztr_t *z,
+				  Read *r, int *nbytes, char **mdata,
+				  int *mdbytes) {
+    return ztr_encode_samples_common(z, "T\0\0", r, r->traceT,
+				     nbytes, mdata, mdbytes);
+}
+
+/* ARGSUSED */
+static void ztr_decode_samples(ztr_t *z, ztr_chunk_t *chunk, Read *r) {
+    int i, j;
+    int maxTraceVal = 0;
+    TRACE sample;
+    unsigned char *bytes = (unsigned char *)chunk->data;
+    int dlen = chunk->dlength;
+    TRACE **lane, *lanex;
+    char *type = ztr_lookup_mdata_value(z, chunk, "TYPE");
+    
+    if (!type)
+	return;
+
+    switch(type[0]) {
+    case 'A':
+	lane = &r->traceA;
+	break;
+    case 'C':
+	lane = &r->traceC;
+	break;
+    case 'G':
+	lane = &r->traceG;
+	break;
+    case 'T':
+	lane = &r->traceT;
+	break;
+    default:
+	return;
+    }
+
+    bytes+=2;
+    dlen-=2;
+
+    /* Store in the Read structure */
+    r->NPoints = dlen/2;
+    if (*lane)
+	xfree(*lane);
+    lanex = *lane = (TRACE *)xmalloc(r->NPoints * sizeof(TRACE));
+
+    for (i = j = 0; i < r->NPoints; i++, j+=2) {
+	sample = (bytes[j] << 8) | bytes[j+1];
+	lanex[i] = sample;
+	if (maxTraceVal < sample)
+	    maxTraceVal = sample;
+    }
+
+    if (r->maxTraceVal < maxTraceVal)
+	r->maxTraceVal = maxTraceVal;
+}
+
+/* Encode the the base calls */
+static char *ztr_encode_bases(ztr_t *z,
+			      Read *r, int *nbytes, char **mdata,
+			      int *mdbytes) {
+    char *bytes;
+
+    if (!r->NBases)
+	return NULL;
+    
+    *mdata = NULL;
+    *mdbytes = 0;
+
+    bytes = (char *)xmalloc(r->NBases + 1);
+    memcpy(bytes+1, r->base, r->NBases);
+    *nbytes = r->NBases+1;
+
+    bytes[0] = ZTR_FORM_RAW;
+    return bytes;
+}
+
+static void ztr_decode_bases(ztr_t *z, ztr_chunk_t *chunk, Read *r) {
+    char *bytes = chunk->data;
+    int nbytes = chunk->dlength;
+
+    nbytes--;
+    bytes++;
+
+    r->NBases = nbytes;
+    if (r->base) xfree(r->base);
+    r->base = (char *)xmalloc(r->NBases+1);
+    memcpy(r->base, bytes, r->NBases);
+    r->base[r->NBases] = 0;
+
+    /* Incase there isn't a clip chunk */
+    r->leftCutoff = 0;
+    r->rightCutoff = r->NBases+1;
+}
+
+/* Encode the base positions as 4 byte values */
+static char *ztr_encode_positions(ztr_t *z,
+				  Read *r, int *nbytes, char **mdata,
+				  int *mdbytes) {
+    char *bytes;
+    int i, j;
+    
+    if ((!r->NPoints && !r->nflows) || !r->basePos || !r->NBases)
+	return NULL;
+
+    *mdata = NULL;
+    *mdbytes = 0;
+
+    bytes = (char *)xmalloc(r->NBases * 4 + 4);
+    for (j = 4, i = 0; i < r->NBases; i++) {
+	/*
+	 * First 2 bytes are zero as currently r->basePos is 16-bit.
+	 *
+	 * bytes[j++] = (r->basePos[i] >> 24) & 0xff;
+	 * bytes[j++] = (r->basePos[i] >> 16) & 0xff;
+	 */
+	bytes[j++] = 0;
+	bytes[j++] = 0;
+	bytes[j++] = (r->basePos[i] >>  8) & 0xff;
+	bytes[j++] = (r->basePos[i] >>  0) & 0xff;
+    }
+
+    bytes[0] = ZTR_FORM_RAW;
+    bytes[1] = 0; /* Dummy */
+    bytes[2] = 0; /* Dummy */
+    bytes[3] = 0; /* Dummy */
+
+    *nbytes = j;
+    return (char *)bytes;
+}
+
+static void ztr_decode_positions(ztr_t *z, ztr_chunk_t *chunk, Read *r) {
+    int i, j;
+    unsigned char *bytes = (unsigned char *)chunk->data;
+    int nbytes = chunk->dlength;
+
+    bytes+=4;
+    nbytes-=4;
+
+    r->NBases = nbytes/4;
+    if (r->basePos) xfree(r->basePos);
+    r->basePos = (uint_2 *)xmalloc(r->NBases * sizeof(*r->basePos));
+
+    for (i = j = 0; j < nbytes; i++, j += 4) {
+	r->basePos[i] =
+	    (bytes[j+0] << 24) +
+	    (bytes[j+1] << 16) +
+	    (bytes[j+2] <<  8) +
+	    (bytes[j+3] <<  0);
+    }
+}
+
+/* Encode the main base confidence (called base) */
+static char *ztr_encode_confidence_1(ztr_t *z,
+				     Read *r, int *nbytes, char **mdata,
+				     int *mdbytes)
+{
+    char *bytes;
+    int i;
+
+    /* Check that we have any confidence values first */
+    if (!r->prob_A || !r->prob_C || !r->prob_G || !r->prob_T)
+	return NULL;
+
+    *mdata = NULL;
+    *mdbytes = 0;
+
+    /* Check that they're not all zero - will "normally" be quick */
+    for (i = 0; i < r->NBases; i++) {
+	if (r->prob_A[i]) break;
+	if (r->prob_C[i]) break;
+	if (r->prob_G[i]) break;
+	if (r->prob_T[i]) break;
+    }
+    if (i == r->NBases)
+	return NULL;
+
+    /* Memory allocation */
+    if (NULL == (bytes = xmalloc(r->NBases * sizeof(*bytes) + 1)))
+	return NULL;
+
+    /*
+     * Encode probs for called bases.
+     * Unknown base => average of prob_A, prob_C, prob_G and prob_T.
+     */
+    bytes++;
+    for (i = 0; i < r->NBases; i++) {
+	switch (r->base[i]) {
+	case 'A':
+	case 'a':
+	    bytes[i] = r->prob_A[i];
+	    break;
+	case 'C':
+	case 'c':
+	    bytes[i] = r->prob_C[i];
+	    break;
+	case 'G':
+	case 'g':
+	    bytes[i] = r->prob_G[i];
+	    break;
+	case 'T':
+	case 't':
+	    bytes[i] = r->prob_T[i];
+	    break;
+	default:
+	    bytes[i] = (r->prob_A[i] + r->prob_C[i] +
+			r->prob_G[i] + r->prob_T[i]) / 4;
+	    break;
+	}
+    }
+    bytes--;
+
+    *nbytes = r->NBases + 1;
+
+    bytes[0] = ZTR_FORM_RAW;
+    return bytes;
+}
+
+static int ztr_decode_confidence_1(ztr_t *z, ztr_chunk_t *chunk, Read *r) {
+    char *bytes = chunk->data;
+    int nbytes = chunk->dlength;
+    int i;
+    
+    bytes++;
+    nbytes--;
+
+    /* Unpack confidence values; depends on base calls */
+    if (!r->base)
+	return -1;
+
+    if (r->prob_A) xfree(r->prob_A);
+    if (r->prob_C) xfree(r->prob_C);
+    if (r->prob_G) xfree(r->prob_G);
+    if (r->prob_T) xfree(r->prob_T);
+    r->prob_A = (char *)xmalloc(r->NBases * sizeof(*r->prob_A));
+    r->prob_C = (char *)xmalloc(r->NBases * sizeof(*r->prob_C));
+    r->prob_G = (char *)xmalloc(r->NBases * sizeof(*r->prob_G));
+    r->prob_T = (char *)xmalloc(r->NBases * sizeof(*r->prob_T));
+
+    for (i = 0; i < r->NBases; i++) {
+	switch (r->base[i]) {
+	case 'A':
+	case 'a':
+	    r->prob_A[i] = bytes[i];
+	    r->prob_C[i] = 0;
+	    r->prob_G[i] = 0;
+	    r->prob_T[i] = 0;
+	    break;
+	case 'C':
+	case 'c':
+	    r->prob_A[i] = 0;
+	    r->prob_C[i] = bytes[i];
+	    r->prob_G[i] = 0;
+	    r->prob_T[i] = 0;
+	    break;
+	case 'G':
+	case 'g':
+	    r->prob_A[i] = 0;
+	    r->prob_C[i] = 0;
+	    r->prob_G[i] = bytes[i];
+	    r->prob_T[i] = 0;
+	    break;
+	case 'T':
+	case 't':
+	    r->prob_A[i] = 0;
+	    r->prob_C[i] = 0;
+	    r->prob_G[i] = 0;
+	    r->prob_T[i] = bytes[i];
+	    break;
+	default:
+	    r->prob_A[i] = bytes[i];
+	    r->prob_C[i] = bytes[i];
+	    r->prob_G[i] = bytes[i];
+	    r->prob_T[i] = bytes[i];
+	}
+    }
+
+    return 0;
+}
+
+/* Encode the four main base confidences */
+static char *ztr_encode_confidence_4(ztr_t *z,
+				     Read *r, int *nbytes, char **mdata,
+				     int *mdbytes)
+{
+    char *bytes;
+    int i, j;
+
+    /* Check that we have any confidence values first */
+    if (!r->prob_A || !r->prob_C || !r->prob_G || !r->prob_T)
+	return NULL;
+
+    *mdata = NULL;
+    *mdbytes = 0;
+
+    /* Check that they're not all zero - will "normally" be quick */
+    for (i = 0; i < r->NBases; i++) {
+	if (r->prob_A[i]) break;
+	if (r->prob_C[i]) break;
+	if (r->prob_G[i]) break;
+	if (r->prob_T[i]) break;
+    }
+    if (i == r->NBases)
+	return NULL;
+
+    /* Memory allocation */
+    if (NULL == (bytes = xmalloc(4 * r->NBases * sizeof(*bytes) + 1)))
+	return NULL;
+
+    /*
+     * Encode probs for called bases first
+     * Unknown base = 'T'.
+     */
+    j = r->NBases;
+    bytes++;
+    for (i = 0; i < r->NBases; i++) {
+	switch (r->base[i]) {
+	case 'A':
+	case 'a':
+	    bytes[i  ] = r->prob_A[i];
+	    bytes[j++] = r->prob_C[i];
+	    bytes[j++] = r->prob_G[i];
+	    bytes[j++] = r->prob_T[i];
+	    break;
+	case 'C':
+	case 'c':
+	    bytes[j++] = r->prob_A[i];
+	    bytes[i  ] = r->prob_C[i];
+	    bytes[j++] = r->prob_G[i];
+	    bytes[j++] = r->prob_T[i];
+	    break;
+	case 'G':
+	case 'g':
+	    bytes[j++] = r->prob_A[i];
+	    bytes[j++] = r->prob_C[i];
+	    bytes[i  ] = r->prob_G[i];
+	    bytes[j++] = r->prob_T[i];
+	    break;
+	default:
+	    bytes[j++] = r->prob_A[i];
+	    bytes[j++] = r->prob_C[i];
+	    bytes[j++] = r->prob_G[i];
+	    bytes[i  ] = r->prob_T[i];
+	    break;
+	}
+    }
+    bytes--;
+
+    *nbytes = r->NBases * 4 + 1;
+
+    bytes[0] = ZTR_FORM_RAW;
+    return bytes;
+}
+
+static int ztr_decode_confidence_4(ztr_t *z, ztr_chunk_t *chunk, Read *r) {
+    char *bytes = chunk->data;
+    int nbytes = chunk->dlength;
+    int i, j;
+    
+    bytes++;
+    nbytes--;
+
+    /* Unpack confidence values; depends on base calls */
+    if (!r->base)
+	return -1;
+
+    if (r->prob_A) xfree(r->prob_A);
+    if (r->prob_C) xfree(r->prob_C);
+    if (r->prob_G) xfree(r->prob_G);
+    if (r->prob_T) xfree(r->prob_T);
+    r->prob_A = (char *)xmalloc(r->NBases * sizeof(*r->prob_A));
+    r->prob_C = (char *)xmalloc(r->NBases * sizeof(*r->prob_C));
+    r->prob_G = (char *)xmalloc(r->NBases * sizeof(*r->prob_G));
+    r->prob_T = (char *)xmalloc(r->NBases * sizeof(*r->prob_T));
+
+    j = r->NBases;
+    for (i = 0; i < r->NBases; i++) {
+	switch (r->base[i]) {
+	case 'A':
+	case 'a':
+	    r->prob_A[i] = bytes[i];
+	    r->prob_C[i] = bytes[j++];
+	    r->prob_G[i] = bytes[j++];
+	    r->prob_T[i] = bytes[j++];
+	    break;
+	case 'C':
+	case 'c':
+	    r->prob_A[i] = bytes[j++];
+	    r->prob_C[i] = bytes[i];
+	    r->prob_G[i] = bytes[j++];
+	    r->prob_T[i] = bytes[j++];
+	    break;
+	case 'G':
+	case 'g':
+	    r->prob_A[i] = bytes[j++];
+	    r->prob_C[i] = bytes[j++];
+	    r->prob_G[i] = bytes[i];
+	    r->prob_T[i] = bytes[j++];
+	    break;
+	default:
+	    r->prob_A[i] = bytes[j++];
+	    r->prob_C[i] = bytes[j++];
+	    r->prob_G[i] = bytes[j++];
+	    r->prob_T[i] = bytes[i];
+	    break;
+	}
+    }
+
+    return 0;
+}
+
+/* Encode the textual comments */
+static char *ztr_encode_text(ztr_t *z,
+			     Read *r, int *nbytes, char **mdata,
+			     int *mdbytes) {
+    char *bytes;
+    int len, alen;
+    int ident;
+    int i, j;
+
+    if (!r->info)
+	return NULL;
+
+    *mdata = NULL;
+    *mdbytes = 0;
+
+    /*
+     * traditional Read comments are a single char * of ident=value lines.
+     * The length of ident=valueXident=valueX (X = newline) if the same
+     * as            ident0value0ident0value0 (0 = \0), although ztr has
+     * a double \0 as terminator.
+     */
+    len = strlen(r->info);
+
+    /* Allocate */
+    alen = len + 3;
+    bytes = xmalloc(alen);
+
+    /* Copy */
+    j = 0;
+    bytes[j++] = ZTR_FORM_RAW;
+    ident = 1;
+    for (i = 0; i < len; i++) {
+	switch (r->info[i]) {
+	case '=':
+	    if (ident) {
+		ident = 0;
+		bytes[j++] = 0;
+	    } else {
+		bytes[j++] = '=';
+	    }
+	    break;
+	    
+	case '\n':
+	    if (ident) {
+		/* Invalid Read info, but we'll carry on anyway. */
+		if (j && bytes[j-1] != 0)
+		    bytes[j++] = 0;
+		else
+		    break;
+	    }
+	    bytes[j++] = 0;
+	    ident = 1;
+	    break;
+
+	default:
+	    bytes[j++] = r->info[i];
+	}
+
+	if (j + 3 > alen) {
+	    /* This can happen if we have Read idents without values */
+	    alen += 100;
+	    bytes = xrealloc(bytes, alen);
+	}
+    }
+    if (j && bytes[j-1] != 0)
+	bytes[j++] = 0; /* Must end in two nuls */
+    bytes[j++] = 0;
+    *nbytes = j;
+    
+    return bytes;
+}
+
+static void ztr_decode_text(Read *r, ztr_t *ztr) {
+    int i;
+    int nbytes = 0;
+    char *iptr;
+
+    /* Find length */
+    for (i = 0; i < ztr->ntext_segments; i++) {
+	if (ztr->text_segments[i].ident)
+	    nbytes += strlen(ztr->text_segments[i].ident);
+	if (ztr->text_segments[i].value)
+	    nbytes += strlen(ztr->text_segments[i].value);
+	nbytes += 2;
+    }
+
+    /* Allocate */
+    if (r->info) xfree(r->info);
+    r->info = (char *)xmalloc(nbytes+1);
+
+    /* Convert */
+    iptr = r->info;
+    for (i = 0; i < ztr->ntext_segments; i++) {
+	if (ztr->text_segments[i].ident && ztr->text_segments[i].value) {
+	    int added = sprintf(iptr, "%s=%s\n", 
+				ztr->text_segments[i].ident,
+				ztr->text_segments[i].value);
+	    iptr += added;
+	}
+    }
+    *iptr = 0;
+}
+
+/* Encode the clip points */
+static char *ztr_encode_clips(ztr_t *z,
+			      Read *r, int *nbytes, char **mdata,
+			      int *mdbytes) {
+    char *bytes;
+
+    if (!r->NBases)
+	return NULL;
+
+    if (r->leftCutoff == 0 && r->rightCutoff > r->NBases)
+	return NULL;
+
+    *mdata = NULL;
+    *mdbytes = 0;
+
+    /* Allocate */
+    *nbytes = 9;
+    bytes = xmalloc(9);
+
+    /* Store */
+    bytes[1] = (r->leftCutoff  >> 24) & 0xff;
+    bytes[2] = (r->leftCutoff  >> 16) & 0xff;
+    bytes[3] = (r->leftCutoff  >>  8) & 0xff;
+    bytes[4] = (r->leftCutoff  >>  0) & 0xff;
+    bytes[5] = (r->rightCutoff >> 24) & 0xff;
+    bytes[6] = (r->rightCutoff >> 16) & 0xff;
+    bytes[7] = (r->rightCutoff >>  8) & 0xff;
+    bytes[8] = (r->rightCutoff >>  0) & 0xff;
+
+    bytes[0] = ZTR_FORM_RAW;
+    return bytes;
+}
+
+/* ARGSUSED */
+static void ztr_decode_clips(ztr_t *z, ztr_chunk_t *chunk, Read *r) {
+    char *bytes = chunk->data;
+
+    r->leftCutoff =
+	(((unsigned char)bytes[1]) << 24) +
+	(((unsigned char)bytes[2]) << 16) +
+	(((unsigned char)bytes[3]) <<  8) +
+	(((unsigned char)bytes[4]) <<  0);
+
+    r->rightCutoff =
+	(((unsigned char)bytes[5]) << 24) +
+	(((unsigned char)bytes[6]) << 16) +
+	(((unsigned char)bytes[7]) <<  8) +
+	(((unsigned char)bytes[8]) <<  0);
+}
+
+/* ARGSUSED */
+static char *ztr_encode_flow_order(ztr_t *z,
+				   Read *r, int *nbytes, char **mdata,
+				   int *mdbytes) {
+    char *bytes;
+
+    if (!r->flow_order || !r->nflows)
+	return NULL;
+
+    bytes = (char *)xmalloc(r->nflows+1);
+    *nbytes = r->nflows+1;
+    bytes[0] = ZTR_FORM_RAW;
+
+    memcpy(bytes+1, r->flow_order, r->nflows);
+
+    return bytes;
+}
+
+static void ztr_decode_flow_order(ztr_t *z, ztr_chunk_t *chunk, Read *r) {
+    char *bytes = chunk->data;
+    int nbytes = chunk->dlength;
+
+    nbytes--;
+    bytes++;
+
+    r->nflows = nbytes;
+    r->flow_order = (char *)xmalloc(r->nflows+1);
+    memcpy(r->flow_order, bytes, r->nflows);
+    r->flow_order[r->nflows] = 0;
+}
+
+static char *ztr_encode_flow_proc(ztr_t *z,
+				  Read *r, int *nbytes, char **mdata,
+				  int *mdbytes) {
+    char *bytes;
+    int i, j;
+    float *data;
+
+    if (!r->flow_order || !r->nflows)
+	return NULL;
+
+    data = r->flow;
+
+    /* Meta-data */
+    if (z->header.version_major > 1 ||
+	z->header.version_minor >= 2) {
+	/* 1.2 onwards */
+	*mdata = (char *)malloc(10);
+	*mdbytes = 10;
+	sprintf(*mdata, "TYPE%cPYNO", 0);
+    } else {
+	*mdata = (char *)malloc(4);
+	*mdbytes = 4;
+	(*mdata)[0] = 'P';
+	(*mdata)[1] = 'Y';
+	(*mdata)[2] = 'N';
+	(*mdata)[3] = 'O';
+    }
+
+    /* floats themselves, scaled */
+    bytes = (char *)xmalloc(r->nflows*2+2);
+    *nbytes = r->nflows*2+2;
+    bytes[0] = ZTR_FORM_RAW;
+    bytes[1] = 0;
+
+    for (i = 0, j = 2; i < r->nflows; i++) {
+	signed int t = data[i] * 100 + 0.49999;
+	bytes[j++] = (t >> 8) & 0xff;
+	bytes[j++] = (t >> 0) & 0xff;
+    }
+
+    return bytes;
+}
+
+/* ARGSUSED */
+static void ztr_decode_flow_proc(ztr_t *z, ztr_chunk_t *chunk, Read *r) {
+    int i, j;
+    unsigned char *bytes = (unsigned char *)chunk->data;
+    int dlen = chunk->dlength;
+
+    bytes+=2;
+    dlen-=2;
+
+    /* Store in the Read structure */
+    r->nflows = dlen/2;
+    r->flow = (float *)xcalloc(r->nflows, sizeof(float));
+    for (i = j = 0; i < r->nflows; i++, j+=2) {
+	float sample = ((bytes[j] << 8) | bytes[j+1]) / 100.0;
+	r->flow[i] = sample;
+    }
+}
+
+static char *ztr_encode_flow_raw(ztr_t *z,
+				 Read *r, int *nbytes, char **mdata,
+				 int *mdbytes) {
+    char *bytes;
+    int i, j;
+    unsigned int *data;
+
+    if (!r->flow_raw || !r->nflows)
+	return NULL;
+
+    data = r->flow_raw;
+
+    /* Meta-data */
+    if (z->header.version_major > 1 ||
+	z->header.version_minor >= 2) {
+	/* 1.2 onwards */
+	*mdata = (char *)malloc(10);
+	*mdbytes = 10;
+	sprintf(*mdata, "TYPE%cPYRW", 0);
+    } else {
+	*mdata = (char *)malloc(4);
+	*mdbytes = 4;
+	(*mdata)[0] = 'P';
+	(*mdata)[1] = 'Y';
+	(*mdata)[2] = 'R';
+	(*mdata)[3] = 'W';
+    }
+
+    /* floats themselves, scaled */
+    bytes = (char *)xmalloc(r->nflows*2+2);
+    *nbytes = r->nflows*2+2;
+    bytes[0] = ZTR_FORM_RAW;
+    bytes[1] = 0;
+
+    for (i = 0, j = 2; i < r->nflows; i++) {
+	int t = data[i];
+	bytes[j++] = (t >> 8) & 0xff;
+	bytes[j++] = (t >> 0) & 0xff;
+    }
+
+    return bytes;
+}
+
+/* ARGSUSED */
+static void ztr_decode_flow_raw(ztr_t *z, ztr_chunk_t *chunk, Read *r) {
+    int i, j;
+    unsigned char *bytes = (unsigned char *)chunk->data;
+    int dlen = chunk->dlength;
+
+    bytes+=2;
+    dlen-=2;
+
+    /* Store in the Read structure */
+    r->nflows = dlen/2;
+    r->flow_raw = (unsigned int *)xcalloc(r->nflows, sizeof(*r->flow_raw));
+    for (i = j = 0; i < r->nflows; i++, j+=2) {
+	unsigned int sample = (bytes[j] << 8) | bytes[j+1];
+	r->flow_raw[i] = sample;
+    }
+}
+
+/*
+ * read2ztr
+ *
+ * Converts an io_lib "Read" structure to a ztr_t structure.
+ *
+ * Arguments:
+ *	r		A pointer to the "Read" structure to convert from
+ *
+ * Returns:
+ *	Success:  A pointer to the ztr_t struct.
+ *	Failure:  NULL
+ */
+ztr_t *read2ztr(Read *r) {
+    ztr_t *ztr;
+    int i, j, nbytes, mdbytes;
+    char *bytes;
+    char *mdata;
+
+#define DO_SMP4
+    int chunk_type[] = {
+#ifdef DO_SMP4
+	ZTR_TYPE_SMP4,
+#else
+	ZTR_TYPE_SAMP,
+	ZTR_TYPE_SAMP,
+	ZTR_TYPE_SAMP,
+	ZTR_TYPE_SAMP,
+#endif
+	ZTR_TYPE_BASE,
+	ZTR_TYPE_BPOS,
+	ZTR_TYPE_CNF4,
+	ZTR_TYPE_TEXT,
+	ZTR_TYPE_CLIP,
+	
+	ZTR_TYPE_FLWO,
+	ZTR_TYPE_SAMP,
+	ZTR_TYPE_SAMP,
+    };
+
+    char *(*chunk_func[])(ztr_t *z, Read *r, int *nbytes, char **mdata, int *mdbytes) = {
+#ifdef DO_SMP4
+	ztr_encode_samples_4,
+#else
+	ztr_encode_samples_A,
+	ztr_encode_samples_C,
+	ztr_encode_samples_G,
+	ztr_encode_samples_T,
+#endif
+	ztr_encode_bases,
+	ztr_encode_positions,
+	ztr_encode_confidence_4,
+	ztr_encode_text,
+	ztr_encode_clips,
+
+	ztr_encode_flow_order,
+	ztr_encode_flow_proc,
+	ztr_encode_flow_raw,
+    };
+
+    if (NULL == (ztr = new_ztr()))
+	return NULL;
+
+    /* Create a header record */
+    memcpy(ztr->header.magic, ZTR_MAGIC, 8);
+    ztr->header.version_major = ZTR_VERSION_MAJOR;
+    ztr->header.version_minor = ZTR_VERSION_MINOR;
+
+    /* Alloc chunks (max number) */
+    ztr->nchunks = sizeof(chunk_type)/sizeof(*chunk_type);
+    ztr->chunk = (ztr_chunk_t *)xmalloc(ztr->nchunks *
+					sizeof(ztr_chunk_t));
+    if (NULL == ztr->chunk)
+	return NULL;
+
+    /* Create the chunks */
+    for (j = i = 0; i < ztr->nchunks; i++) {
+	/* char str[5]; */
+
+	bytes = chunk_func[i](ztr, r, &nbytes, &mdata, &mdbytes);
+	if (!bytes)
+	    continue;
+
+	/*
+	fprintf(stderr, "block %.4s length %d\n",
+		ZTR_BE2STR(chunk_type[i], str), nbytes);
+	*/
+	ztr->chunk[j].type     = chunk_type[i];
+	ztr->chunk[j].mdlength = mdbytes;
+	ztr->chunk[j].mdata    = mdata;
+	ztr->chunk[j].dlength  = nbytes;
+	ztr->chunk[j].data     = bytes;
+	ztr->chunk[j].ztr_owns = 1;
+
+	j++;
+    }
+    ztr->nchunks = j;
+
+    /*
+     * Experiments show that typically a double delta does
+     * better than a single delta for 8-bit data, and the other
+     * way around for 16-bit data
+     */
+    ztr->delta_level = r->maxTraceVal < 256 ? 2 : 3;
+    
+    return ztr;
+}
+
+/*
+ * ztr2read
+ *
+ * Converts an ztr_t structure to an io_lib "Read" structure.
+ *
+ * Arguments:
+ *	ztr		A pointer to the ztr structure to convert from
+ *
+ * Returns:
+ *	Success:  A pointer to the Read struct.
+ *	Failure:  NULL
+ */
+Read *ztr2read(ztr_t *ztr) {
+    Read *r;
+    int i;
+    int done_conf = 0, done_pos = 0;
+    int sections = read_sections(0);
+
+    /* Allocate */
+    r = read_allocate(0, 0);
+
+    if (NULLRead == r)
+	return NULLRead;
+
+    /* Proces text chunks - makes conversion easier */
+    if (sections & READ_COMMENTS) {
+	ztr_process_text(ztr);
+	ztr_decode_text(r, ztr);
+    }
+
+    /* Iterate around each known chunk type turning into the Read elements */
+    for (i = 0; i < ztr->nchunks; i++) {
+	switch (ztr->chunk[i].type) {
+	case ZTR_TYPE_SMP4:
+	    if (sections & READ_SAMPLES) {
+		char *offs = ztr_lookup_mdata_value(ztr, &ztr->chunk[i], "OFFS");
+		char *type = ztr_lookup_mdata_value(ztr, &ztr->chunk[i], "TYPE");
+		if (!type || 0 == strcmp(type, "PROC")) {
+		//if (type && 0 == strcmp(type, "SLXI")) {
+		    uncompress_chunk(ztr, &ztr->chunk[i]);
+		    ztr_decode_samples_4(ztr, &ztr->chunk[i], r);
+
+		    if (offs)
+			r->baseline = atoi(offs);
+		}
+	    }
+	    break;
+
+	case ZTR_TYPE_SAMP: 
+	    if (sections & READ_SAMPLES) {
+		char *type = ztr_lookup_mdata_value(ztr, &ztr->chunk[i], "TYPE");
+		char *offs = ztr_lookup_mdata_value(ztr, &ztr->chunk[i], "OFFS");
+		uncompress_chunk(ztr, &ztr->chunk[i]);
+		if (type && 0 == strcmp(type, "PYRW"))
+		    ztr_decode_flow_raw(ztr, &ztr->chunk[i], r);
+		else if (type && 0 == strcmp(type, "PYNO"))
+		    ztr_decode_flow_proc(ztr, &ztr->chunk[i], r);
+		else if (type &&
+			 (0 == strcmp(type, "A") ||
+			  0 == strcmp(type, "C") ||
+			  0 == strcmp(type, "G") ||
+			  0 == strcmp(type, "T"))) {
+		    ztr_decode_samples(ztr, &ztr->chunk[i], r);
+
+		    if (offs)
+			r->baseline = atoi(offs);
+		}
+	    }
+	    break;
+
+	case ZTR_TYPE_BASE:
+	    if (sections & READ_BASES) {
+		uncompress_chunk(ztr, &ztr->chunk[i]);
+		ztr_decode_bases(ztr, &ztr->chunk[i], r);
+	    }
+	    break;
+
+	case ZTR_TYPE_BPOS:
+	    if (sections & READ_BASES) {
+		uncompress_chunk(ztr, &ztr->chunk[i]);
+		ztr_decode_positions(ztr, &ztr->chunk[i], r);
+		done_pos++;
+	    }
+	    break;
+
+	case ZTR_TYPE_CNF4:
+	    if (sections & READ_BASES) {
+		uncompress_chunk(ztr, &ztr->chunk[i]);
+		ztr_decode_confidence_4(ztr, &ztr->chunk[i], r);
+		done_conf++;
+	    }
+	    break;
+
+	case ZTR_TYPE_CNF1:
+	    if (sections & READ_BASES) {
+		uncompress_chunk(ztr, &ztr->chunk[i]);
+		ztr_decode_confidence_1(ztr, &ztr->chunk[i], r);
+		done_conf++;
+	    }
+	    break;
+
+	case ZTR_TYPE_TEXT:
+	    /* Skip - already did this; see ztr_process_text */
+	    break;
+
+	case ZTR_TYPE_CLIP:
+	    if (sections & READ_BASES) {
+		uncompress_chunk(ztr, &ztr->chunk[i]);
+		ztr_decode_clips(ztr, &ztr->chunk[i], r);
+	    }
+	    break;
+
+	case ZTR_TYPE_FLWO:
+	    if (sections & READ_SAMPLES) {
+		uncompress_chunk(ztr, &ztr->chunk[i]);
+		ztr_decode_flow_order(ztr, &ztr->chunk[i], r);
+	    }
+	    break;
+	}
+    }
+
+    /* Handle the case when we have no confidence values */
+    if (!done_conf && r->NBases > 0) {
+	r->prob_A = (char *)xrealloc(r->prob_A, r->NBases);
+	r->prob_C = (char *)xrealloc(r->prob_C, r->NBases);
+	r->prob_G = (char *)xrealloc(r->prob_G, r->NBases);
+	r->prob_T = (char *)xrealloc(r->prob_T, r->NBases);
+	memset(r->prob_A, 0, r->NBases);
+	memset(r->prob_C, 0, r->NBases);
+	memset(r->prob_G, 0, r->NBases);
+	memset(r->prob_T, 0, r->NBases);
+    }
+
+    /* Handle the case when we have no BPOS chunk */
+    if (!done_pos && r->NBases > 0) {
+	r->basePos = (uint_2 *)xrealloc(r->basePos, r->NBases * 2);
+	for (i = 0; i < r->NBases; i++)
+	    r->basePos[i] = i;
+    }
+
+    r->format = TT_ZTR;
+
+    return r;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib_config.h	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,162 @@
+/* io_lib_config.h.  Generated from io_lib_config.h.in by configure.  */
+/* io_lib_config.h.in.  Generated from configure.in by autoheader.  */
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define HAVE_DLFCN_H 1
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#define HAVE_FCNTL_H 1
+
+/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
+#define HAVE_FSEEKO 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have a functional curl library. */
+#define HAVE_LIBCURL 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 <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 `strdup' function. */
+#define HAVE_STRDUP 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/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
+#define HAVE_SYS_WAIT_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define if zlib is installed */
+#define HAVE_ZLIB 1
+
+/* Defined if libcurl supports AsynchDNS */
+/* #undef LIBCURL_FEATURE_ASYNCHDNS */
+
+/* Defined if libcurl supports IDN */
+#define LIBCURL_FEATURE_IDN 1
+
+/* Defined if libcurl supports IPv6 */
+#define LIBCURL_FEATURE_IPV6 1
+
+/* Defined if libcurl supports KRB4 */
+/* #undef LIBCURL_FEATURE_KRB4 */
+
+/* Defined if libcurl supports libz */
+#define LIBCURL_FEATURE_LIBZ 1
+
+/* Defined if libcurl supports NTLM */
+#define LIBCURL_FEATURE_NTLM 1
+
+/* Defined if libcurl supports SSL */
+#define LIBCURL_FEATURE_SSL 1
+
+/* Defined if libcurl supports SSPI */
+/* #undef LIBCURL_FEATURE_SSPI */
+
+/* Defined if libcurl supports DICT */
+#define LIBCURL_PROTOCOL_DICT 1
+
+/* Defined if libcurl supports FILE */
+#define LIBCURL_PROTOCOL_FILE 1
+
+/* Defined if libcurl supports FTP */
+#define LIBCURL_PROTOCOL_FTP 1
+
+/* Defined if libcurl supports FTPS */
+#define LIBCURL_PROTOCOL_FTPS 1
+
+/* Defined if libcurl supports HTTP */
+#define LIBCURL_PROTOCOL_HTTP 1
+
+/* Defined if libcurl supports HTTPS */
+#define LIBCURL_PROTOCOL_HTTPS 1
+
+/* Defined if libcurl supports LDAP */
+#define LIBCURL_PROTOCOL_LDAP 1
+
+/* Defined if libcurl supports TELNET */
+#define LIBCURL_PROTOCOL_TELNET 1
+
+/* Defined if libcurl supports TFTP */
+#define LIBCURL_PROTOCOL_TFTP 1
+
+/* Name of package */
+#define PACKAGE "io_lib"
+
+/* 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 "io_lib"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "io_lib 1.12.2"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "io_lib"
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "1.12.2"
+
+/* The size of `int', as computed by sizeof. */
+#define SIZEOF_INT 4
+
+/* The size of `long', as computed by sizeof. */
+#define SIZEOF_LONG 8
+
+/* The size of `short', as computed by sizeof. */
+#define SIZEOF_SHORT 2
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Version number of package */
+#define VERSION "1.12.2"
+
+/* Define to 1 if your processor stores words with the most significant byte
+   first (like Motorola and SPARC, unlike Intel and VAX). */
+/* #undef WORDS_BIGENDIAN */
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+/* #undef _FILE_OFFSET_BITS */
+
+/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
+#define _LARGEFILE_SOURCE 1
+
+/* Define for large files, on AIX-style hosts. */
+/* #undef _LARGE_FILES */
+
+/* Define curl_free() as free() if our version of curl lacks curl_free. */
+/* #undef curl_free */
+
+/* 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 `int' if <sys/types.h> does not define. */
+/* #undef mode_t */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/io_lib_config.h.in	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,161 @@
+/* io_lib_config.h.in.  Generated from configure.in by autoheader.  */
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
+#undef HAVE_FSEEKO
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have a functional curl library. */
+#undef HAVE_LIBCURL
+
+/* 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 <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 `strdup' function. */
+#undef HAVE_STRDUP
+
+/* 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/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
+#undef HAVE_SYS_WAIT_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define if zlib is installed */
+#undef HAVE_ZLIB
+
+/* Defined if libcurl supports AsynchDNS */
+#undef LIBCURL_FEATURE_ASYNCHDNS
+
+/* Defined if libcurl supports IDN */
+#undef LIBCURL_FEATURE_IDN
+
+/* Defined if libcurl supports IPv6 */
+#undef LIBCURL_FEATURE_IPV6
+
+/* Defined if libcurl supports KRB4 */
+#undef LIBCURL_FEATURE_KRB4
+
+/* Defined if libcurl supports libz */
+#undef LIBCURL_FEATURE_LIBZ
+
+/* Defined if libcurl supports NTLM */
+#undef LIBCURL_FEATURE_NTLM
+
+/* Defined if libcurl supports SSL */
+#undef LIBCURL_FEATURE_SSL
+
+/* Defined if libcurl supports SSPI */
+#undef LIBCURL_FEATURE_SSPI
+
+/* Defined if libcurl supports DICT */
+#undef LIBCURL_PROTOCOL_DICT
+
+/* Defined if libcurl supports FILE */
+#undef LIBCURL_PROTOCOL_FILE
+
+/* Defined if libcurl supports FTP */
+#undef LIBCURL_PROTOCOL_FTP
+
+/* Defined if libcurl supports FTPS */
+#undef LIBCURL_PROTOCOL_FTPS
+
+/* Defined if libcurl supports HTTP */
+#undef LIBCURL_PROTOCOL_HTTP
+
+/* Defined if libcurl supports HTTPS */
+#undef LIBCURL_PROTOCOL_HTTPS
+
+/* Defined if libcurl supports LDAP */
+#undef LIBCURL_PROTOCOL_LDAP
+
+/* Defined if libcurl supports TELNET */
+#undef LIBCURL_PROTOCOL_TELNET
+
+/* Defined if libcurl supports TFTP */
+#undef LIBCURL_PROTOCOL_TFTP
+
+/* 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
+
+/* The size of `int', as computed by sizeof. */
+#undef SIZEOF_INT
+
+/* The size of `long', as computed by sizeof. */
+#undef SIZEOF_LONG
+
+/* The size of `short', as computed by sizeof. */
+#undef SIZEOF_SHORT
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
+
+/* Define to 1 if your processor stores words with the most significant byte
+   first (like Motorola and SPARC, unlike Intel and VAX). */
+#undef WORDS_BIGENDIAN
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
+/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
+#undef _LARGEFILE_SOURCE
+
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
+
+/* Define curl_free() as free() if our version of curl lacks curl_free. */
+#undef curl_free
+
+/* 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 `int' if <sys/types.h> does not define. */
+#undef mode_t
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/ltmain.sh	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,6871 @@
+# 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 Debian 1.5.22-4+etch1"
+TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)"
+
+# 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
+
+# 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.
+if test "${LC_ALL+set}" = set; then
+  save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
+fi
+if test "${LANG+set}" = set; then
+  save_LANG="$LANG"; LANG=C; export LANG
+fi
+
+# 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/"
+
+#####################################
+# 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_xdir="$my_gentop/$my_xlib"
+
+      $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 ;;
+    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)
+	if test "X$arg" = "X-all-static"; then
+	  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
+	else
+	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
+	    dlopen_self=$dlopen_self_static
+	  fi
+	  prefer_static_libs=built
+	fi
+	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)
+	# 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%"
+	  test "X$link_all_deplibs" != Xno && libs="$libs $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 -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)
+	    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"
+	    ;;
+	  *)
+	    $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
+	  ;;
+	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
+	  $LTCC $LTCFLAGS -o conftest conftest.c $deplibs
+	  if test "$?" -eq 0 ; 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" -ne "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
+		$LTCC $LTCFLAGS -o conftest conftest.c $i
+		# Did it work?
+		if test "$?" -eq 0 ; 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
+      wl=
+
+      if test -n "$convenience"; then
+	if test -n "$whole_archive_flag_spec"; then
+	  eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
+	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" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
+              finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
+            else
+              compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+              finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+             fi
+            ;;
+          * )
+            compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+            finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+            ;;
+          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" | $Xsed -e "s% @SYMFILE@%%"`
+	finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
+      fi
+
+      if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
+	# Replace the output file specification.
+	compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+	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" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
+	  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" | $Xsed -e "$sed_quote_subst"`
+      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'
+
+# 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 \${1+\"\$@\"}\"
+      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" | $Xsed -e "$sed_quote_subst"`
+      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" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+	  else
+	    relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
+	  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" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
+
+	      $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
+      if test "${save_LC_ALL+set}" = set; then
+	LC_ALL="$save_LC_ALL"; export LC_ALL
+      fi
+      if test "${save_LANG+set}" = set; then
+	LANG="$save_LANG"; export LANG
+      fi
+
+      # 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 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:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/man/man1/illumina2srf.1	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,280 @@
+.TH illumina2srf 1 "September 29" "" "Staden io_lib"
+
+.SH "NAME"
+
+.PP
+.BR illumina2srf
+\- Builds an SRF file from an Illumina/Solexa GA run folder.
+
+.SH "SYNOPSIS"
+.PP
+\fBillumina2srf\fR  [\fIoptions\fR] \fItile_seq_file\fR ...
+
+.SH "DESCRIPTION"
+.PP
+\fBillumina2srf\fR converts the Illumina GA-pipeline run folder output
+into an SRF file. It should be run from the
+Bustard\fI<version><date>\fR directory.  It has a wealth of options,
+listed below, although many have defaults  and may be ommitted if the
+run folder follows the standard directory layout. The arguments, after
+the options, should be the filenames of the sequence files, eg
+\fIs_8_*_seq.txt\fR. All other filenames are derived from the _seq.txt
+filenames.
+.PP
+The main structure of an SRF file is as a container, much like zip or
+tar. The contents however may be split into variable and common
+components allowing for better compression. For \fBillumina2srf\fR
+that means that we store trace data in ZTR format with common ZTR
+chunks (text identifiers such as base-caller name and version, matrix
+files and compression specifications) in an SRF \fIData Block
+Header\fR and variable components (sequence, quality and traces) in
+ZTR chunks held within an SRF \fIData Block\fR. Typically we have
+10,000 Data Blocks per Data Block Header.
+.PP
+The most major decision in producing the SRF file is what data to put
+in it. By default the program writes the sequence and probability
+values along with the "processed" trace intensities. In GAPipeline
+v1.0 and earlier these are in the \fI_seq.txt\fR, \fI_prb.txt\fR and
+\fI_sig2.txt\fR files held within the main Bustard directory. In
+addition to these the \fB-r\fR option requests storage of the "raw"
+trace intensities, comprising both the pre-processed intensities and
+noise estimates from the Firecrest \fI_int.txt\fR and \fI_nse.txt\fR
+files respectively. To store only raw intensities, skipping processed
+data, specify the \fB-r -P\fR options. Finally the \fB-I\fR option can
+be used to store data from IPAR format files.
+.PP
+Confidence values have been a source of large variation over the
+pipeline releases. In GAPipeline 1.0 and earlier the \fI_prb.txt\fR
+files in the Bustard directory contain four quality values per base
+encoded using a log-odds system: 10*log(P/(1-P)). In addition to this
+there are various calibrated formats in the GERALD directory with one
+Phred scale value per base. See the \fB-qf\fR, \fB-qr\fR and \fB-qc\fR
+parameters.
+.PP
+There are a number of smaller ancillary data files that get stored
+too. As there is no per-lane or per-run storage mechanism in 
+these are added for every SRF Data Block Header of which there may be
+several per tile. However the overhead in duplicating this data is not
+significant given the size of the individual SRF Data Blocks. The
+ancillary data files also stored are \fI.params\fR files (for both Bustard
+and Firecrest), matrices (specified using \fB-mf\fR and \fB-mr\fR) and
+phasing XML files (\fB-pf\fR and \fB-pr\fR).
+
+.SH "OPTIONS"
+.PP
+.SS "Trace data-source options"
+.TP
+\fB-r\fR, \fB-R\fR
+Specifies to store (\fB-r\fR) or not to store (\fB-R\fR - the default)
+"raw" data. This is currently comprised of the contents of the
+\fI_int.txt\fR and \fI_nse.txt\fR files in the Firecrest directory.
+.TP
+\fB-p\fR, \fB-P\fR
+Specifies to store (\fB-p\fR - the default) or not to store (\fB-P\fR)
+the "processed" data. This is the contents of the \fI_sig2.txt\fR
+files in the Bustard directory.
+.TP
+\fB-u\fR
+Deprecated. Older GAPipeline releases created \fI_sig.txt\fR files
+holding semi-processed data with compensation for the dye spectral
+overlap, but before phasing correction steps. The \fB-u\fR argument
+indicates that the processed data should be taken from these files
+instead of \fI_sig2.txt\fR.
+.TP
+\fB-I\fR
+Reads \fIIPAR\fR files instead of the raw trace data files. These are
+a different format used by the incremental processing software when
+the pipeline is run on the instrument control PC itself.
+.SS "Quality value data-source options"
+.TP
+\fB-qf\fR \fIfilename\fR
+Specifies the filename of the calibrated quality values for the
+forward-read or both the forward and reverse read combined if
+appropriate. \fIfilename\fR should be in Illumina's fastq derivative
+format, with quality values stored as ASCII 64 plus the log-odds
+score.
+.TP
+\fB-qr\fR \fIfilename\fR
+If the calibrated fastq files are split into forward and reverse files
+then \fIfilename\fR specifies the reverse sequences. Otherwise we
+assume they are tacked onto the end of the forward sequences specified
+in \fB-qf\fR. Like the former file, this should be in Illumina's
+fastq-like format.
+.TP
+\fB-qc\fR \fIdirectory\fR
+This is an alternative to the \fB-qf\fR and \fB-qr\fR options above
+and is mutually exclusive with them. This specifies that the
+calibrated data should come from files named
+"\fIdirectory\fR/s_%d_qcal.txt" where "%d" is replaced by the current
+tile number.
+
+.SS "Filtering options"
+.TP
+\fB-c\fR \fIvalue\fR
+Only store traces that have a "chastity" score >= \fIValue\fR.
+This is mutually exclusive with the \fB-C\fR option.
+.TP
+\fB-C\fR \fIvalue\fR
+Until the -c option, traces with a "chastity" score < \fIValue\fR are
+still stored in the SRF file but are marked as bad reads
+instead. \fBsrf2fasta\fR and \fBsrf2fastq\fR have options to
+subsequently filter out bad reads using this flag.
+This is mutually exclusive with the \fB-c\fR option.
+.TP
+\fB-s\fR \fIN\fR
+This skips the first \fIN\fR cycles of a trace (including signal,
+sequence and quality values) when writing it to an SRF file. The
+purpose of this is to remove primer bases, but it is not
+recommended. Instead the SRF file should be using the ZTR region chunk
+(REGN) to indicate which potion of a trace is valid.
+.SS "Read naming"
+.PP
+Read names are split into two halves, a prefix and a suffix. One
+common prefix is stored in each and every SRF Data Block Header while
+the suffix is stored in every Data Block. This combination allows for
+removal of repetitive data in order to shrink the SRF file size.
+.TP
+\fB-n\fR \fIformat\fR
+.RS
+Controls the format used for creating the sequence name suffix. This
+uses a printf style system of percent expansions that will be replaced
+with the appropriate data. The list of percent expansions are:
+.TP
+%%
+A literal percent character
+.TP
+%d
+Run date (taken from parsing the current working directory)
+.TP
+%m
+Machine name (taken from parsing the current working directory)
+.TP
+%r
+Run number (taken from parsing the current working directory)
+.TP
+%l
+lane number (%L for hexidecimal encoding)
+.TP
+%t
+tile number (%T for hexidecimal encoding)
+.TP
+%x
+X coordinate (%X for hexidecimal encoding)
+.TP
+%y
+Y coordinate (%Y for hexidecimal encoding)
+.TP
+%c
+Counter; increments by 1 for every sequence in the tile (%C for
+hexidecimal encoding).
+.PP
+All the above format strings have an optional numerical value between
+the percent and the format character. This is used to control the
+field width. For example to print the X and Y coordinates to 3
+hexidecimal places we could use \fB-n "%3X:%3Y"\fR.
+.PP
+The default format is "\fB%x:%y\fR".
+.RE
+.TP
+\fB-N\fR \fIformat\fR
+.RS
+Specifies the format string for encoding the reading name prefix. It
+follows the same formatting rules specified in the \fB-n\fR above.
+.PP
+The default format is "\fB%m_%r:%l:%t:\fR".
+.RE
+.SS "Ancillary data files"
+.PP
+These options govern the extra files stored per tile (or strictly
+speaking per SRF Data Block Header).
+.TP
+\fB-2\fR \fIcycle\fR
+This specifies the cycle number, counting from 1, of the second read
+forming a read-pair. It is used for automatic generation of filenames
+in several of the options below and also for construction of the ZTR
+region (REGN) chunks.
+.TP
+\fB-mf\fR \fIfilename\fR
+The filename of the forward matrix file. If a single printf numerical
+percent rule is used (such as "%d") then it will be replaced by the
+lane number.  When not specified the default \fIfilename\fR will be
+\fI../Matrix/s_%d_02_matrix.txt\fR.
+.TP
+\fB-mr\fR \fIfilename\fR
+The filename of the reverse matrix file - only used on paired end
+runs. If a single printf numerical percent rule is used (such as "%d")
+then it will be replaced by the lane number.  If a second printf
+percent rule is used then it will be replaced with the cycle number
+that the paired read starts on. This is equivalent to the cycle number
+specified in the \fB-2\fR option plus one. (The plus one comes
+from using the second cycle per end for matrix calibration.)
+When \fB-mr\fR is not specified the default \fIfilename\fR will be
+\fI../Matrix/s_%d_%02d_matrix.txt\fR.
+.TP
+\f-pf\fR \fIfilename\fR
+Specifies the filename of the forward-read phasing XML file. As with
+\fR-mf\fR a printf numerical percent rule will be replaced by the lane
+number. The default \fIfilename\fR format is
+\fIPhasing/s_%d_01_phasing.xml\fR.
+.TP
+\f-pr\fR \fIfilename\fR
+Specifies the filename of the reverse-read phasing XML file. As with
+\fR-mr\fR the first two printf numerical percent rules will be
+replaced by the lane number and the cycle number. Unlike \fB-mr\fR
+though the cycle number is the value used in the \fB-c\fR option as-is
+instead of plus one. The default \fIfilename\fR format is
+\fIPhasing/s_%d_%02d_phasing.xml\fR.
+.SS "Other options"
+.TP
+\fB-o\fR \fIsrf_filename\fR
+Specifies the output filename to write the SRF data too. Defaults to
+"traces.srf".
+.TP
+\fB-i\fR
+Indicates that an index should be appended to the SRF file. This
+allows for random access based on the sequence name.
+.TP
+\fB-d\fR
+Enable dots-mode. This outputs a full-stop per input tile. Most useful
+in conjunction with quiet mode. Default is off.
+.TP
+\fB-q\fR
+Quiet mode. Do not output commentary on which tile is being processed
+and the metrics about it. Default off.
+
+.SH "EXAMPLES"
+.PP
+To store a lane 4 from a paired end run with raw traces, no
+processed data and calibrated confidence values.
+.PP
+.nf
+    # From Bustard directory
+    illumina2srf -o all.srf -r -P \\
+	   -qf GERALD*/s_4_1_sequence.txt \\
+	   -qr GERALD*/s_4_2_sequence.txt \\
+	   s_4_*_seq.txt
+.fi
+
+.PP
+To store and index only processed traces with chastity >= 0.6
+.PP
+.nf
+    illumina2srf -o s4.srf -c 0.6 s_4_*_seq.txt
+.fi
+
+.SH "CAVEATS"
+.PP
+There are many mutually exclusive options, some of which may be for
+processing file formats that no longer exist. This is due to the
+history of the program and the rapidly changing nature of the files
+being processed. Some future culling of options and file formats can
+be expected.
+.PP
+Some assumptions are made as to the directory layout and the ability
+to parse the run folder directory name. There are currently no ways to
+override some of this information, including run date, run number and
+GAPipeline program version numbers.
+
+.SH "AUTHOR"
+.PP
+James Bonfield, Wellcome Trust Sanger Institute
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/man/man1/srf2fasta.1	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,35 @@
+.TH srf2fasta 1 "September 19" "" "Staden io_lib"
+
+.SH "NAME"
+
+.PP
+.BR srf2fasta
+\- Converts SRF files to fasta format
+
+.SH "SYNOPSIS"
+.PP
+\fBsrf2fasta\fR  [\fI-C\fR] \fIsrf_archive\fR
+
+.SH "DESCRIPTION"
+.PP
+\fBsrf2fasta\fR extracts sequences from an SRF archive and writes them
+in fasta format to stdout.
+
+.SH "OPTIONS"
+.PP
+.TP
+\fB-C\fR
+Masks out sequences tagged as bad quality.
+
+.SH "EXAMPLES"
+.PP
+To extract only the good quality sequences from runX.srf into
+runX.fasta.
+.PP
+.nf
+    srf2fasta -C runX.srf > runX.fasta
+.fi
+
+.SH "AUTHOR"
+.PP
+James Bonfield, Wellcome Trust Sanger Institute
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/man/man1/srf2fastq.1	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,93 @@
+.TH srf2fastq 1 "December 10" "" "Staden io_lib"
+
+.SH "NAME"
+
+.PP
+.BR srf2fastq
+\- Converts SRF files to Sanger fastq format
+
+.SH "SYNOPSIS"
+.PP
+\fBsrf2fastq\fR  [\fIoptions\fR] \fIsrf_archive\fR ...
+
+.SH "DESCRIPTION"
+.PP
+\fBsrf2fastq\fR extracts sequences and qualities from one or more SRF
+archives and writes them in Sanger fastq format to stdout.
+.PP
+Note that Illumina
+also have a fastq format (used in the GERALD directories) which
+differs slightly in the use of log-odds scores for the quality
+values. The format described here is using the traditional \fIPhred\fR
+style of quality encoding.
+
+.SH "OPTIONS"
+.PP
+.TP
+\fB-c\fR
+Outputs calibrated confidence values using the ZTR \fBCNF1\fR
+chunk type for a single quality per base. Without this use the
+original Illumina \fI_prb.txt\fR files consisting of four quality
+values per base, stored in the ZTR \fBCNF4\fR chunks.
+.TP
+\fB-C\fR
+Masks out sequences tagged as bad quality.
+.TP
+\fB-s\fR \fIroot\fR
+Generates files on disk with filenames starting \fIroot\fR, one file
+per non-explicit element in the SRF/ZTR region (REGN) chunk. Typically
+this results in two files for paired end runs. The filename suffixes
+come from the names listed in the SRF region chunks.  This
+option conflicts with the \fB-S\fR parameter.
+.TP
+\fB-S\fR
+Splits sequences into regions, but sequentially lists each sequence
+region to stdout instead of splitting to separate files on disk. This
+option conflicts with the \fB-s\fR parameter.
+.TP
+\fB-n\FR
+When using -s the filename suffixes are simply numbered (starting with
+1) instead of using the names listed in the SRF region chunks.
+.TP
+\fB-a\fR
+Appends region index to the sequence names. Ie generate "name/1" and
+"name/2" for a paired read.
+.TP
+\fB-e\fR
+Include any explicit sequence (ZTR region chunk of type 'E') in the
+sequence output. The explicit sequence is also included in the quality
+line too. Currently this is utilised by ABI SOLiD to store the last
+base of the primer.
+.TP
+\fB-r\fR \fIregion list\fR
+Reverse complements the sequence and reverses the quality values for
+all regions in the \fIregion list\fR. This is a comma separated list
+of integer values enumerating the regions, starting from 1. Note that
+this option only works when either \fB-s\fR or \fB-S\fR are
+specified.
+
+.SH "EXAMPLES"
+.PP
+To extract only the good quality sequences from all srf files in the
+current directory using calibrated confidence values (if available).
+.PP
+.nf
+    srf2fastq -c -C *.srf > runX.fastq
+.fi
+.PP
+To extract a paired end run into two separate files with sequences
+named \fIname\fR/1 and \fIname\fR/2.
+.PP
+.nf
+    srf2fastq -s runX -a -n runX.srf
+.fi
+.PP
+To extract a paired end run as a single file, alternating forward and
+reverse sequences, with the second read being reverse complemented.
+.PP
+.nf
+    srf2fastq -S -r 2 runX.srf > runX.fastq
+.fi
+.SH "AUTHOR"
+.PP
+James Bonfield, Steven Leonard - Wellcome Trust Sanger Institute
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/man/man1/srf2fastq.1~	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,73 @@
+.TH srf2fastq 1 "December 10" "" "Staden io_lib"
+
+.SH "NAME"
+
+.PP
+.BR srf2fastq
+\- Converts SRF files to Sanger fastq format
+
+.SH "SYNOPSIS"
+.PP
+\fBsrf2fastq\fR  [\fIoptions\fR] \fIsrf_archive\fR ...
+
+.SH "DESCRIPTION"
+.PP
+\fBsrf2fastq\fR extracts sequences and qualities from one or more SRF
+archives and writes them in Sanger fastq format to stdout.
+.PP
+Note that Illumina
+also have a fastq format (used in the GERALD directories) which
+differs slightly in the use of log-odds scores for the quality
+values. The format described here is using the traditional \fIPhred\fR
+style of quality encoding.
+
+.SH "OPTIONS"
+.PP
+.TP
+\fB-c\fR
+Outputs calibrated confidence values using the ZTR \fBCNF1\fR
+chunk type for a single quality per base. Without this use the
+original Illumina \fI_prb.txt\fR files consisting of four quality
+values per base, stored in the ZTR \fBCNF4\fR chunks.
+.TP
+\fB-C\fR
+Masks out sequences tagged as bad quality.
+.TP
+\fB-s\fR \fIroot\fR
+Generates files on disk with filenames starting \fIroot\fR, one file
+per non-explicit element in the SRF/ZTR region (REGN) chunk. Typically
+this results in two files for paired end runs. The filename suffixes
+come from the names listed in the SRF region chunks.
+.TP
+\fB-n\FR
+When using -s the filename suffixes are simply numbered (starting with
+1) instead of using the names listed in the SRF region chunks.
+.TP
+\fB-a\fR
+Appends region index to the sequence names. Ie generate "name/1" and
+"name/2" for a paired read.
+.TP
+\fB-e\fR
+Include any explicit sequence (ZTR region chunk of type 'E') in the
+sequence output. The explicit sequence is also included in the quality
+line too. Currently this is utilised by ABI SOLiD to store the last
+base of the primer.
+
+.SH "EXAMPLES"
+.PP
+To extract only the good quality sequences from all srf files in the
+current directory using calibrated confidence values (if available).
+.PP
+.nf
+    srf2fastq -c -C *.srf > runX.fastq
+.fi
+.PP
+To extract a paired end run into two separate files with sequences
+named \fIname\fR/1 and \fIname\fR/2.
+.PP
+.nf
+    srf2fastq -s runX -a -n runX.srf
+.fi
+.SH "AUTHOR"
+.PP
+James Bonfield, Steven Leonard - Wellcome Trust Sanger Institute
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/man/man1/srf_index_hash.1	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,36 @@
+.TH srf_index_hash 1 "September 29" "" "Staden io_lib"
+
+.SH "NAME"
+
+.PP
+.BR srf_index_hash
+\- Adds a hash-table index to an SRF file.
+
+.SH "SYNOPSIS"
+.PP
+\fBsrf_index_hash\fR  [\fI-c] \fIsrf_archive\fR
+
+.SH "DESCRIPTION"
+.PP
+\fBsrf_index_hash\fR adds and index to an SRF file or replaces an
+existing index with a new one. In the case of concatenated SRF files
+only the index at the end of a file will be replaced, but internal
+indices will not be consulted by SRF tools.
+.PP
+The index is a hash table indexing the sequence names only. The name
+itself does not appear in the index, rather the top 7-bits of a 64-bit
+hash key are held in the index along with N-bits used to determine the
+hash bucket. This reduces the index size to around 10-15 bytes per
+sequence.
+
+.SH "OPTIONS"
+.PP
+.TP
+\fB-c\fR
+Check only. This requests that the index is not produced, but the
+checks performed during the creation of an index (such as looking for
+duplicate sequence names) are still performed.
+
+.SH "AUTHOR"
+.PP
+James Bonfield, Wellcome Trust Sanger Institute
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/man/man1/srf_info.1	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,63 @@
+.TH srf_info 1 "September 19" "" "Staden io_lib"
+
+.SH "NAME"
+
+.PP
+.BR srf_info
+\- Lists information about the contents of an SRF file
+
+.SH "SYNOPSIS"
+.PP
+\fBsrf_info\fR  [\fI-l\fR bitmap] \fIsrf_archive\fR ...
+
+.SH "DESCRIPTION"
+.PP
+\fBsrf_info\fR lists some simple frequency metrics on the contents of
+an SRF file, both in terms of how many traces there are and the sort of
+data held within them.
+.PP
+For efficiencies sake some control is given over which statistics to
+gather and display. This is controlled by the \fI-l\fR level
+parameter. The value is the summation of one or more of the following
+values, representing the data to display.
+
+.TP
+1
+Count of good/bad reads.
+.TP
+2
+Counts and compressed size for selected chunk types.
+.TP
+4
+Trace count and trace name prefix for each trace_header.
+.TP
+8
+Base count.
+
+.SH "OPTIONS"
+.PP
+.TP
+\fB-l\fR bitmap
+Controls which statistics to gather and display. Bitmap is a value
+from 0 to 15 (1+2+4+8) as described in the DESCRIPTION section above.
+
+.SH "EXAMPLES"
+.PP
+To count the total number of good and bad reads along with a break
+down of trace names per SRF data-block-header we would use bitmap
+values 1 and 4 combined.
+.PP
+.nf
+    srf_info -l 5 foo.srf
+.fi
+
+.PP
+To count the total number of reads for all srf files in a directory.
+.PP
+.nf
+    srf_info -l 1 *.srf
+.fi
+
+.SH "AUTHOR"
+.PP
+Steven Leonard, Wellcome Trust Sanger Institute
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/man/man1/srf_list.1	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,61 @@
+.TH srf_list 1 "September 29" "" "Staden io_lib"
+
+.SH "NAME"
+
+.PP
+.BR srf_list
+\- Lists and/or counts the contents of an SRF file
+
+.SH "SYNOPSIS"
+.PP
+\fBsrf_list\fR  [\fIoptions\fR] \fIsrf_archive\fR ...
+
+.SH "DESCRIPTION"
+.PP
+\fBsrf_list\fR lists the filenames held within one or more SRF
+container.  To simply count the contents rather than list them specify
+the \fB-c\fR option. Note that when in count-only mode if an index is
+present it will be used to determine the number of entries in the
+index and hence sequences in the SRF file. The index cannot be used
+when listing the filenames however as the index itself does not
+contain the full filenames.
+.PP
+Note that it is not possible to count sequences matching certain
+patterns or with specific flags set. \fBsrf_info\fR is a more general
+purpose tool that may cover this.
+
+.SH "OPTIONS"
+.PP
+.TP
+\fB-c\fR
+Counts sequences instead of listing them. Note that this may be
+substantially faster than listing if an index exists.
+.TP
+\fB-v\fR
+Verbose mode. This gives summary count information per file rather
+than just the total at the end.
+.TP
+\fB-l\fR
+Long format. When listing sequence names this also provides
+information on the position in the archive and the size of the
+sequence specific \fIdata block\fR and the size of the shared \fIdata
+block header\fR.
+
+.SH "EXAMPLES"
+.PP
+To count the total number of sequences in several SRF files:
+.PP
+.nf
+    srf_list -c *.srf
+.fi
+
+.PP
+To produce a "fofn" (file of filenames) for an SRF file:
+.PP
+.nf
+    srf_list foo.srf > foo.fofn
+.fi
+
+.SH "AUTHOR"
+.PP
+James Bonfield, Wellcome Trust Sanger Institute
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/man/man3/ExperimentFile.3	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,356 @@
+.TH ExperimentFile 3 "" "" "Staden Package"
+
+.SH NAME
+
+.LP
+.BR exp_read_info ,
+.BR exp_fread_info ,
+.BR exp_create_info ,
+.BR exp_destroy_info ,
+.BR exp_create_range ,
+.BR exp_extract_range ,
+.BR exp_get_feature_index ,
+.BR exp_get_int ,
+.BR exp_get_rng ,
+.BR exp_get_str ,
+.BR exp_put_int ,
+.BR exp_put_rng ,
+.BR exp_put_str ,
+.BR exp_print_line ,
+.BR exp_print_seq ,
+.BR exp_print_file ,
+.BR opos2str ,
+.BR str2opos ,
+.BR conf2str ,
+.BR str2conf
+\- Manipulations of the Experiment File format
+
+.IX "exp_read_info()" "" "exp_read_info()"
+.IX "exp_fread_info()" "" "exp_fread_info()"
+.IX "exp_create_info()" "" "exp_create_info()"
+.IX "exp_destroy_info()" "" "exp_destroy_info()"
+.IX "exp_create_range()" "" "exp_create_range()"
+.IX "exp_extract_range()" "" "exp_extract_range()"
+.IX "exp_get_feature_index()" "" "exp_get_feature_index()"
+.IX "exp_get_int()" "" "exp_get_int()"
+.IX "exp_get_rng()" "" "exp_get_rng()"
+.IX "exp_get_str()" "" "exp_get_str()"
+.IX "exp_put_int()" "" "exp_put_int()"
+.IX "exp_put_rng()" "" "exp_put_rng()"
+.IX "exp_put_str()" "" "exp_put_str()"
+.IX "exp_print_line()" "" "exp_print_line()"
+.IX "exp_print_seq()" "" "exp_print_seq()"
+.IX "exp_print_file()" "" "exp_print_file()"
+.IX "opos2str()" "" "opos2str()"
+.IX "str2opos()" "" "str2opos()"
+.IX "conf2str()" "" "conf2str()"
+.IX "str2conf()" "" "str2conf()"
+
+.SH SYNOPSIS
+.LP
+.nf
+.ft B
+#include <expFileIO.h>
+
+.nf
+.ft B
+Exp_info *exp_read_info(
+	char *file);
+.ft
+.fi
+.LP
+.nf
+.ft B
+Exp_info *exp_fread_info(
+	FILE *fp);
+.ft
+.fi
+.LP
+.nf
+.ft B
+Exp_info *exp_create_info();
+.ft
+.fi
+.LP
+.nf
+.ft B
+void exp_destroy_info(
+	Exp_info *e);
+.ft
+.fi
+.LP
+.nf
+.ft B
+char *exp_create_range(
+	char *str,
+	int start,
+	int end);
+.ft
+.fi
+.LP
+.nf
+.ft B
+int exp_extract_range(
+	char *str,
+	int *start,
+	int *end);
+.ft
+.fi
+.LP
+.nf
+.ft B
+int exp_get_feature_index(
+	char *e);
+.ft
+.fi
+.LP
+.nf
+.ft B
+int exp_get_int(
+	Exp_info *e,
+	int id,
+	int *val);
+.ft
+.fi
+.LP
+.nf
+.ft B
+int exp_get_rng(
+	Exp_info *e,
+	int id,
+	int *from,
+	int *to);
+.ft
+.fi
+.LP
+.nf
+.ft B
+int exp_get_str(
+	Exp_info *e,
+	int id,
+	char *s,
+	f_implicit s_l);
+.ft
+.fi
+.LP
+.nf
+.ft B
+int exp_put_int(
+	Exp_info *e,
+	int id,
+	int *val);
+.ft
+.fi
+.LP
+.nf
+.ft B
+int exp_put_rng(
+	Exp_info *e,
+	int id,
+	int *from,
+	int *to);
+.ft
+.fi
+.LP
+.nf
+.ft B
+int exp_put_str(
+	Exp_info *e,
+	int id,
+	char *s,
+	f_implicit s_l);
+.ft
+.fi
+.LP
+.nf
+.ft B
+int exp_print_line(
+	FILE *fp,
+	Exp_info *e,
+	int eflt,
+	int i);
+.ft
+.fi
+.LP
+.nf
+.ft B
+int exp_print_seq(
+	FILE *fp,
+	Exp_info *e,
+	int eflt,
+	int i);
+.ft
+.fi
+.LP
+.nf
+.ft B
+void exp_print_file(
+	FILE *fp,
+	Exp_info *e);
+.ft
+.fi
+.LP
+.nf
+.ft B
+char *opos2str(
+	int2 *opos,
+	int len,
+	char *buf);
+.ft
+.fi
+.LP
+.nf
+.ft B
+int str2opos(
+	int2 *opos,
+	char *buf);
+.ft
+.fi
+.LP
+.nf
+.ft B
+char *conf2str(
+	int1 *conf,
+	int len,
+	char *buf);
+.ft
+.fi
+.LP
+.nf
+.ft B
+int str2conf(
+	int1 *conf,
+	char *buf);
+.ft
+.fi
+
+.SH DESCRIPTION
+.LP
+These functions manipulate Experiment Files. They include functions for
+reading, writing, and editing the files. The principle structure used by the
+routines is the \fBExp_info\fR structure. This is as follows.
+.EX 5
+.ft B
+#define MAXIMUM_EFLT_LENGTH     4
+#define MAXIMUM_EFLTS          48
+#define EXP_FILE_LINE_LENGTH  128
+
+typedef Array Exp_entries;
+
+typedef struct {
+    Array entries[MAXIMUM_EFLTS]; /* array of array of entries */
+    int Nentries[MAXIMUM_EFLTS];  /* array of number of entries */
+    FILE *fp;
+} Exp_info;
+
+#define NULL_Exp_info ( (Exp_info *) NULL )
+.ft
+.EE
+.LP
+For the purposes of simple and efficient coding, each line on an experiment
+file must be smaller than the defined EXP_FILE_LINE_LENGTH, which is 128
+characters.
+.LP
+Many functions take an experiment file line type identifier as an argument.
+These functions are listed in the prototypes as taking \fBint id\fR. Here
+\fBid\fR should be specified using one of the macros defining in the header
+file. They take the form of \fBEFLT_\fRXX where XX is the line type. For
+instance, the \fBID\fR line type identifier should be written as
+\fBEFLT_ID\fR.
+.LP
+The C functions available follow. Some FORTRAN interfaces are also available,
+but these are not documented. See the include file for their prototypes.
+.LP
+.B exp_read_info
+and
+.B exp_fread_info
+read an experiment file into an allocated \fBExp_info\fR structure. If
+successful, the structure pointer is return. Otherwise the null pointer is
+returned.
+.LP
+.B exp_create_info
+allocates and initialises a new, blank, \fBExp_info\fR structure. If
+successful, the structure pointer is return. Otherwise the null pointer is
+returned.
+.LP
+.B exp_destroy_info
+deallocates an \fBExp_info\fR structure.
+.LP
+.B exp_create_range
+creates a string using the experiment file range format of "start..stop". This
+format is used by the AQ, ON, TG and TC line types. The buffer specified
+should be large enough to hold the string. The function returns the \fBstr\fR
+pointer supplied as an argument.
+.LP
+.B exp_extract_range
+extracts the start and end values from the string representation of a range;
+"start..stop". The values are stored in the integer pointers sent as
+arguments. If successful, the function returns 0. Otherwise -1 is returned.
+.LP
+.B exp_get_feature_index
+converts from a string representation of an experiment file line type to the
+integer value. For example, \fBexp_get_feature_index("SQ")\fR returns the
+integer 22, which is the same as the \fBEFLT_SQ\fR definition.
+.LP
+.B exp_get_int
+obtains the integer value held in a specific line type. The value is stored in
+the integer pointer \fBval\fR. If successful, the function returns 0.
+Otherwise 1 is returned.
+.LP
+.B exp_get_rng
+obtains the range values held in a specific line type. The values are stored in
+the integer pointers \fBfrom\fR and \fBto\fR. If successful, the function
+returns 0. Otherwise 1 is returned.
+.LP
+.B exp_get_str
+obtains the string value held in a specific line type. The value is stored in
+the string \fBs\fR. At most \fBs_l\fR characters are copied. If successful,
+the function returns 0. Otherwise 1 is returned.
+.LP
+.B exp_put_int
+writes the integer pointed to by \fBval\fR to the specified line type. If
+successful, the function returns 0. Otherwise 1 is returned.
+.LP
+.B exp_put_rng
+writes the range pointed to by \fBfrom\fR and \fBto\fR to the specified line
+type. If successful, the function returns 0. Otherwise 1 is returned.
+.LP
+.B exp_put_str
+writes the string \fBs\fR of length \fBs_l\fR to the specified line type. If
+successful, the function returns 0. Otherwise 1 is returned.
+.LP
+.B exp_print_line
+outputs all entries of the specified type to the specified file pointer.
+.LP
+.B exp_print_seq
+.LP
+.B exp_print_file
+outputs all entries of all line types to the specified file pointer.
+.LP
+.B opos2str
+converts an array of original positions held in \fBopos\fR with \fBlen\fR
+elements to a string suitable for use in the ON line type. The \fBbuf\fR
+should be large enough to hold the string, which in the worst case will be
+4 * sequence length. Returns \fBbuf\fR.
+.LP
+.B str2opos
+converts the experiment file original position string held in \fBbuf\fR to an
+array of original positions to be stored in \fBopos\fR. \fBopos\fR must be
+large enough to hold the data, hence it should be of the same length as the
+sequence. Returns the number of elements written to the \fBopos\fR array.
+.LP
+.B conf2str
+converts an array of confidence values helf in \fBconf\dR with \fBlen\fR
+elements to a string suitable for use in the AV line type. The \fBbuf\fR
+should be large enough to hold the string, which in the worst case will be
+4 * sequence length. Returns \fBbuf\fR.
+.LP
+.B str2conf
+convers the experiment file confidence values string held in \fBbuf\fR to an
+array of confidence values to be stored in \fBconf\fR. \fBconf\fR must be
+large enough to hold the data, hence it should be of the same length as the
+sequence. Returns the number of elements written to the \fBconf\fR array.
+
+.SH SEE ALSO
+.LP
+.BR ExperimentFile (4)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/man/man3/exp2read.3	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,1 @@
+.so man3/scf2read.3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/man/man3/fread_reading.3	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,1 @@
+.so man3/read_reading.3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/man/man3/fread_scf.3	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,1 @@
+.so man3/read_scf.3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/man/man3/fwrite_reading.3	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,1 @@
+.so man3/write_reading.3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/man/man3/fwrite_scf.3	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,1 @@
+.so man3/write_scf.3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/man/man3/read2exp.3	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,1 @@
+.so man3/scf2read.3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/man/man3/read2scf.3	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,1 @@
+.so man3/scf2read.3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/man/man3/read_allocate.3	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,60 @@
+.TH read_allocate 3 "" "" "Staden Package"
+
+.SH NAME
+
+.LP
+.BR read_allocate ,
+.BR read_deallocate
+\- Allocate and deallocate the \fBRead\fR structure.
+
+.SH SYNOPSIS
+.LP
+.nf
+.ft B
+#include <Read.h>
+
+.nf
+.ft B
+Read *read_allocate(
+	int num_points,
+	int num_bases);
+.ft
+.fi
+.LP
+.nf
+.ft B
+void read_deallocate(
+	Read *read);
+.ft
+.fi
+.IX "read_allocate()" "" "read_allocate()"
+.IX "read_deallocate()" "" "read_deallocate()"
+
+.SH DESCRIPTION
+.LP
+These functions create and destroy \fBRead\fR structures. The \fBRead\fR
+structure is a generalised in-memory data structure used for holding trace
+data information.
+.LP
+.B read_allocate()
+creates a \fBRead\fR structure large enough to hold \fBnum_points\fR trace
+sample points and \fBnum_bases\fR called bases. The allocated data is then
+initialised to appropriate defaults, which are mainly zeros and null pointers.
+.LP
+.B read_deallocate()
+destroys a previously created \fBRead\fR structure. It is not sufficient to
+simply use the \fBfree()\fR call instead.
+
+.SH RETURN VALUES
+.LP
+On successful completion, the \fBread_allocate()\fR function returns a pointer
+to a \fBRead\fR structure. Otherwise this function returns a null pointer.
+.LP
+The \fBread_deallocate()\fR function returns no value.
+
+.SH SEE ALSO
+.LP
+.BR read_reading (3),
+.BR fread_reading (3),
+.BR write_reading (3),
+.BR fwrite_reading (3)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/man/man3/read_deallocate.3	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,1 @@
+.so man3/read_allocate.3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/man/man3/read_reading.3	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,135 @@
+.TH read_reading 3 "" "" "Staden Package"
+
+.SH NAME
+
+.LP
+.BR read_reading ,
+.BR fread_reading
+\- Read a trace file into a \fBRead\fR structure.
+
+.SH SYNOPSIS
+.LP
+.nf
+.ft B
+#include <Read.h>
+
+.nf
+.ft B
+Read *read_reading(
+	char *filename,
+	int format);
+.ft
+.fi
+.LP
+.nf
+.ft B
+Read *fread_reading(
+	FILE *fp,
+	char *filename,
+	int format);
+.ft
+.fi
+.IX "read_reading()" "" "read_reading()"
+.IX "fread_reading()" "" "fread_reading()"
+
+.SH DESCRIPTION
+.LP
+These functions read trace files into a \fBRead\fR structure. A variety of
+formats are supported including ABI, ALF and SCF. (Note that the first two are
+only supported when the library is used as part of the Staden Package.)
+Additionally, support for reading the plain (old) staden format files and
+Experiment files is included. Compressed trace files may also be read.
+Decompression is performed using either \fBgzip -d\fR or \fBuncompress\fR and
+is written to a temporary file for further processing. The temporary file is
+then read and removed.
+.LP
+When reading an experiment file the trace file referenced by the LN and LT
+line types is read. The QL, QR (left and right quality clips), SL and SR
+(left and right vector clips) are taken from the Experiment file to produce
+the cutoff information held within the \fBRead\fR structure. The
+\fBorig_trace\fR field of the \fBRead\fR structure will then contain the
+pointer to the experiment file structure and the \fBorig_trace_format\fR field
+will be set to \fBTT_EXP\fR.
+.LP
+The functions allocate a \fBRead\fR structure which is returned. To deallocate
+this structure use the \fBread_deallocate()\fR function.
+.LP
+.B read_reading()
+reads a trace from the specified filename and format. Formats available are
+.BR TT_SCF ,
+.BR TT_ABI ,
+.BR TT_ALF ,
+.BR TT_PLN ,
+.BR TT_EXP and
+.BR TT_ANY .
+Specifying format \fBTT_ANY\fR will attempt to automatically detect the corret
+format type by analysing the trace file for magic numbers and composition. The
+\fBformat\fR field of the structure can then be used to determine the real
+trace type.
+.LP
+.B fread_reading()
+reads a trace from the specified file pointer. The filename argument is used
+for setting the \fBtrace_name\fR field of the resulting structure, and for
+error messages. Otherwise the function is identical to the
+\fBread_reading()\fR function.
+.LP
+The \fBRead\fR structure itself is as follows.
+.EX 5
+.ft B
+typedef uint_2 TRACE;        /* for trace heights */
+
+typedef struct
+{
+    int         format;      /* Trace file format */
+    char       *trace_name;  /* Trace file name   */
+
+    int         NPoints;     /* No. of points of data */
+    int         NBases;      /* No. of bases          */
+
+    /* Traces */
+    TRACE      *traceA;      /* Array of length `NPoints' */
+    TRACE      *traceC;      /* Array of length `NPoints' */
+    TRACE      *traceG;      /* Array of length `NPoints' */
+    TRACE      *traceT;      /* Array of length `NPoints' */
+    TRACE       maxTraceVal; /* The maximal value in any trace */
+
+    /* Bases */
+    char       *base;        /* Array of length `NBases' */
+    uint_2     *basePos;     /* Array of length `NBases' */
+
+    /* Cutoffs */
+    int         leftCutoff;  /* Number of unwanted bases */
+    int         rightCutoff; /* Number of unwanted bases */
+
+    /* Miscellaneous Sequence Information */
+    char       *info;        /* misc seq info, eg comments */
+
+    /* Probability information */
+    char       *prob_A;      /* Array of length 'NBases' */
+    char       *prob_C;      /* Array of length 'NBases' */
+    char       *prob_G;      /* Array of length 'NBases' */
+    char       *prob_T;      /* Array of length 'NBases' */
+
+    /* The original input format data, or NULL if inapplicable */
+    int orig_trace_format;
+    void *orig_trace;
+
+} Read;
+.EE
+.ft
+.LP
+
+.SH RETURN VALUES
+.LP
+On successful completion, the \fBread_reading()\fR and \fBfread_reading()\fR
+functions return a pointer to a \fBRead\fR structure. Otherwise these
+functions return NULLRead (which is a null pointer).
+
+.SH SEE ALSO
+.LP
+.BR write_reading (3),
+.BR fwrite_reading (3),
+.BR deallocate_reading (3),
+.BR scf (4),
+.br
+.BR ExperimentFile (4)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/man/man3/read_scf.3	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,78 @@
+.TH read_scf 3 "" "" "Staden Package"
+
+.SH NAME
+
+.LP
+.BR read_scf ,
+.BR fread_scf ,
+.BR read_scf_header
+\- Read SCF files
+
+.SH SYNOPSIS
+.LP
+.nf
+.ft B
+#include <scf.h>
+.ft
+.fi
+.LP
+.nf
+.ft B
+Scf *read_scf(
+	char *fn);
+.ft
+.fi
+.LP
+.nf
+.ft B
+Scf *fread_scf(
+	FILE *fp);
+.ft
+.fi
+.LP
+.nf
+.ft B
+int read_scf_header(
+	FILE *fp,
+	Header *h);
+.ft
+.fi
+.IX "read_scf()" "" "read_scf()"
+.IX "fread_scf()" "" "fread_scf()"
+.IX "read_scf_header()" "" "read_scf_header()"
+
+.SH DESCRIPTION
+.LP
+These functions read SCF format trace files. All the functions accepting a
+\fBFILE *\fP as an argument assume that the file pointer is at the correct
+offset within the file.
+.LP
+.B read_scf()
+reads an entire SCF file into the \fBScf\fR structure (see the
+.BR scf (4)
+manual page for the details of this structure). The data is read from the
+specified file name.
+.LP
+.B fread_scf()
+reads an entire SCF file into the \fBScf\fR structure (see the
+.BR scf (4)
+manual page for the details of this structure). The data is read from the
+specified file pointer, which is neither closed or rewound after the
+operation.
+.LP
+.B read_scf_header()
+reads the \fBHeader\fR structure from the specified file pointer.
+
+.SH RETURN VALUES
+.LP
+On successful completion, the \fBread_scf()\fR and \fBfread_scf()\fR functions
+return a pointer to a \fBScf\fR structure. Othewise these functions return a
+null pointer.
+.LP
+On successful completion, the \fBread_scf_header()\fR function returns 0.
+Otherwise the function returns -1.
+
+.SH SEE ALSO
+.LP
+.BR scf (4),
+.BR write_scf (3)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/man/man3/read_scf_header.3	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,1 @@
+.so man3/read_scf.3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/man/man3/scf2read.3	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,100 @@
+.TH scf2read 3 "" "" "Staden Package"
+
+.SH NAME
+
+.LP
+.BR scf2read ,
+.BR read2scf ,
+.BR exp2read ,
+.BR read2exp
+\- Translate to and from the \fBRead\fR structure.
+
+.SH SYNOPSIS
+.LP
+.nf
+.ft
+#include <Read.h>
+
+.nf
+.ft B
+Read *scf2read(
+	Scf *scf);
+.ft
+.fi
+.LP
+.nf
+.ft B
+Scf *read2scf(
+	Read *read);
+.ft
+.fi
+.LP
+.nf
+.ft B
+Exp_info *read2exp(
+	Read *read,
+	char *EN);
+.ft
+.fi
+.LP
+.nf
+.ft B
+Read *exp2read(
+	Exp_info *e);
+.ft
+.fi
+.IX "scf2read()" "" "scf2read()"
+.IX "read2scf()" "" "read2scf()"
+.IX "read2exp()" "" "read2exp()"
+.IX "exp2read()" "" "exp2reead()"
+
+.SH DESCRIPTION
+.LP
+These functions are used internally by the io library for converting between
+the in memory representations of the supported file formats. The \fBRead\fR
+structure is the central format so only conversion to and from this structure
+is available. Conversions consist of to and from the SCF format and to and
+from the Experiment File format.
+.LP
+.B scf2read()
+converts an \fBScf\fR structure into a \fBRead\fR structure. The \fBRead\fR
+structure is allocated by the function. The \fBScf\fR structure is left
+unchanged.
+.LP
+.B read2scf()
+converts a \fBRead\fR structure into an \fBScf\fR structure. The \fBScf\fR
+structure is allocated by the function. The \fBRead\fR structure is left
+unchanged.
+.LP
+.B exp2read()
+converts an \fBExp_info\fR structure into a \fBRead\fR structure. The
+entryname to use in the EN line type of the Experiment File must be specified.
+The \fBRead\fR structure is allocated by the function. The \fBExp_info\fR
+structure is left unchanged.
+.LP
+.B read2exp()
+converts a \fBRead\fR structure into an \fBExp_info\fR structure. The
+\fBExp_info\fR structure is allocated by the function. The \fBRead\fR
+structure is left unchanged.
+
+.SH RETURN VALUES
+.LP
+On successful completion, the \fBscf2read()\fR and \fBexp2read\fR functions
+return a pointer to an allocated \fBRead\fR structure. Otherwise these
+functions return NULLRead.
+.LP
+On successful completion, the \fBread2scf\fR function returns a pointer to an
+allocated \fBScf\fR structure. Otherwise this function returns a null pointer.
+.LP
+On successful completion, the \fBread2exp\fR function returns a pointer to an
+allocated \fBExp_info\fR structure. Otherwise this function returns a null
+pointer.
+
+.SH SEE ALSO
+.LP
+.BR read_reading (3),
+.BR fread_reading (3),
+.BR write_reading (3),
+.BR fwrite_reading (3),
+.BR scf (4),
+.BR ExperimentFile (4)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/man/man3/write_reading.3	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,74 @@
+.TH write_reading 3 "" "" "Staden Package"
+
+.SH NAME
+
+.LP
+.BR write_reading ,
+.BR fwrite_reading
+\- Write a \fBRead\fR structure into a trace file.
+
+.SH SYNOPSIS
+.LP
+.nf
+.ft B
+#include <Read.h>
+
+.nf
+.ft B
+int write_reading(
+	char *filename,
+	Read *read,
+	int format);
+.ft
+.fi
+.LP
+.nf
+.ft B
+int fwrite_reading(
+	FILE *fp,
+	Read *read,
+	int format);
+.ft
+.fi
+.IX "write_reading()" "" "write_reading()"
+.IX "fwrite_reading()" "" "fwrite_reading()"
+
+.SH DESCRIPTION
+.LP
+These functions write a \fBRead\fR structure into a trace file. The principle
+format support is the SCF format. Although reading is supported for ABI and
+ALF, writing is not. Additionally, it is possible to write using the plain
+(old) staden format files or as Experiment files. In both these cases only the
+sequence component of the trace file will be written.
+.LP
+When writing as an experiment file the QL, QR and SQ fields are generated from
+the \fBRead\fR structure. If we previously created the \fBRead\fR structure
+from reading an experiment file then the original experiment file data is also
+written. Otherwise EN, ID, LN and LT lines are also generated.
+.LP
+.B write_reading()
+writes a \fBRead\fR structure to the specified filename in the specified
+format. Formats available are
+.BR TT_SCF ,
+.BR TT_PLN and
+.BR TT_EXP.
+Specifying format \fBTT_ANY\fR will be treated as \fBTT_SCF\fR.
+.LP
+.B fwrite_reading()
+writes a \fBRead\fR structure to the specified FILE pointer in the specified
+format. Apart from writing to FILE pointer instead of a filename, the function
+is identical to \fBwrite_reading()\fR.
+
+.SH RETURN VALUES
+.LP
+On successful completion, the \fBwrite_reading()\fR and \fBfwrite_reading()\fR
+functions return 0. Otherwise these functions return -1.
+
+.SH SEE ALSO
+.LP
+.BR read_reading (3),
+.BR fread_reading (3),
+.BR deallocate_reading (3),
+.BR scf (4),
+.br
+.BR ExperimentFile (4)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/man/man3/write_scf.3	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,77 @@
+.TH write_scf 3 "" "" "Staden Package"
+
+.SH NAME
+
+.LP
+.BR write_scf ,
+.BR fwrite_scf ,
+.BR write_scf_header
+\- Write SCF files
+
+.SH SYNOPSIS
+.LP
+.nf
+.ft B
+#include <scf.h>
+.ft
+.fi
+.LP
+.nf
+.ft B
+int write_scf(
+	Scf *scf,
+	char *fn);
+.ft
+.fi
+.LP
+.nf
+.ft B
+int fwrite_scf(
+	Scf *scf,
+	FILE *fp);
+.ft
+.fi
+.LP
+.nf
+.ft B
+int write_scf_header(
+	FILE *fp,
+	Header *h);
+.ft
+.fi
+.IX "write_scf()" "" "write_scf()"
+.IX "fwrite_scf()" "" "fwrite_scf()"
+.IX "write_scf_header()" "" "write_scf_header()"
+
+.SH DESCRIPTION
+.LP
+These functions write SCF format trace files. All the functions accepting a
+\fBFILE *\fP as an argument assume that the file pointer is at the correct
+offset within the file, which should be the start.
+.LP
+.B write_scf()
+writes an entire SCF file into the \fBScf\fR structure (see the
+.BR scf (4)
+manual page for the details of this structure). The data is written to the
+specified file name.
+.LP
+.B fwrite_scf()
+writesan entire SCF file into the \fBScf\fR structure (see the
+.BR scf (4)
+manual page for the details of this structure). The data is written to the
+specified file pointer, which is neither closed or rewound after the
+operation.
+.LP
+.B write_scf_header()
+writes the \fBHeader\fR structure to the specified file pointer.
+
+.SH RETURN VALUES
+.LP
+On successful completion, the \fBwrite_scf()\fR, \fBfwrite_scf()\fR and
+\fBwrite_scf_header()\fR functions return 0. Otherwise these function returns
+-1.
+
+.SH SEE ALSO
+.LP
+.BR scf (4),
+.BR read_scf (3)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/man/man3/write_scf_header.3	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,1 @@
+.so man3/write_scf.3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/man/man4/Read.4	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,1 @@
+.so man3/read_reading.3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/missing	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,360 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2005-06-08.21
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
+#   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., 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.
+
+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
+
+msg="missing on your system"
+
+case "$1" in
+--run)
+  # Try to run requested program, and just exit if it succeeds.
+  run=
+  shift
+  "$@" && exit 0
+  # Exit code 63 means version mismatch.  This often happens
+  # when the user try to use an ancient version of a tool on
+  # a file that requires a minimum version.  In this case we
+  # we should proceed has if the program had been absent, or
+  # if --run hadn't been passed.
+  if test $? = 63; then
+    run=:
+    msg="probably too old"
+  fi
+  ;;
+
+  -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]
+
+Send bug reports to <bug-automake@gnu.org>."
+    exit $?
+    ;;
+
+  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+    echo "missing $scriptversion (GNU Automake)"
+    exit $?
+    ;;
+
+  -*)
+    echo 1>&2 "$0: Unknown \`$1' option"
+    echo 1>&2 "Try \`$0 --help' for more information"
+    exit 1
+    ;;
+
+esac
+
+# Now exit if we have it, but it failed.  Also exit now if we
+# don't have it and --version was passed (most likely to detect
+# the program).
+case "$1" in
+  lex|yacc)
+    # Not GNU programs, they don't have --version.
+    ;;
+
+  tar)
+    if test -n "$run"; then
+       echo 1>&2 "ERROR: \`tar' requires --run"
+       exit 1
+    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+       exit 1
+    fi
+    ;;
+
+  *)
+    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+       # We have it, but it failed.
+       exit 1
+    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+       # Could not run --version or --help.  This is probably someone
+       # running `$TOOL --version' or `$TOOL --help' to check whether
+       # $TOOL exists and not knowing $TOOL uses missing.
+       exit 1
+    fi
+    ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case "$1" in
+  aclocal*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  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)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  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)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  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*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  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)
+    echo 1>&2 "\
+WARNING: \`$1' is needed, but is $msg.
+         You might have modified some files without having the
+         proper tools for further handling them.
+         You can get \`$1' 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' $msg.  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 $msg.  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)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  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)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  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."
+    # The file to touch is that specified with -o ...
+    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+    if test -z "$file"; then
+      # ... or it is the one specified with @setfilename ...
+      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+      file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
+      # ... or it is derived from the source name (dir/f.texi becomes f.info)
+      test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
+    fi
+    # If the file does not exist, the user really needs makeinfo;
+    # let's fail without touching anything.
+    test -f $file || exit 1
+    touch $file
+    ;;
+
+  tar)
+    shift
+
+    # 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 is $msg.
+         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 prerequisites 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
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/options.mk	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,63 @@
+#-----------------------------------------------------------------------------
+# Optional corba support
+#
+# CORBA=1
+
+# ABI BioLIMS support
+# BIOLIMS=1
+
+# Enable specific library types
+IOLIB_SCF=1
+IOLIB_EXP=1
+IOLIB_PLN=1
+IOLIB_ABI=1
+IOLIB_ALF=1
+IOLIB_CTF=1
+IOLIB_ZTR=1
+IOLIB_SFF=1
+
+#-----------------------------------------------------------------------------
+# Optional defines - do not edit this bit
+ifdef IOLIB_SCF
+DEFINES += -DIOLIB_SCF
+endif
+
+ifdef IOLIB_EXP
+DEFINES += -DIOLIB_EXP
+endif
+
+ifdef IOLIB_PLN
+DEFINES += -DIOLIB_PLN
+endif
+
+ifdef IOLIB_ABI
+DEFINES += -DIOLIB_ABI
+endif
+
+ifdef IOLIB_ALF
+DEFINES += -DIOLIB_ALF
+endif
+
+ifdef IOLIB_CTF
+DEFINES += -DIOLIB_CTF
+endif
+
+ifdef IOLIB_ZTR
+DEFINES += -DIOLIB_ZTR
+RLIBS	+= $(ZLIB_LIB)
+CFLAGS	+= $(ZLIB_INC)
+endif
+
+ifdef IOLIB_SFF
+DEFINES += -DIOLIB_SFF
+endif
+
+ifdef BIOLIMS
+DEFINES += -DUSE_BIOLIMS
+RLIBS	+= $(BIOLIMS_LIB)
+endif
+
+ifdef CORBA
+OBJS	+= $(CORBA_OBJS)
+RLIBS	+= $(CORBA_LIB)
+endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/progs/Makefile.am	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,80 @@
+bin_PROGRAMS = convert_trace makeSCF extract_seq extract_qual extract_fastq index_tar scf_dump scf_info scf_update get_comment hash_tar hash_extract hash_list trace_dump hash_sff append_sff ztr_dump srf_dump_all srf_index_hash srf_extract_linear srf_extract_hash srf2fastq srf2fasta srf_filter srf_info srf_list
+
+convert_trace_SOURCES = convert_trace.c
+convert_trace_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+
+get_comment_SOURCES = get_comment.c
+get_comment_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+
+makeSCF_SOURCES = makeSCF.c
+makeSCF_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+
+extract_seq_SOURCES = extract_seq.c
+extract_seq_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+
+extract_qual_SOURCES = extract_qual.c
+extract_qual_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+
+extract_fastq_SOURCES = extract_fastq.c
+extract_fastq_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+
+index_tar_SOURCES = index_tar.c
+
+scf_dump_SOURCES = scf_dump.c
+scf_dump_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+
+scf_info_SOURCES = scf_info.c
+scf_info_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+
+scf_update_SOURCES = scf_update.c
+scf_update_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+
+hash_tar_SOURCES = hash_tar.c
+hash_tar_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+
+hash_list_SOURCES = hash_list.c
+hash_list_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+
+hash_sff_SOURCES = hash_sff.c
+hash_sff_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+
+append_sff_SOURCES = append_sff.c
+append_sff_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+
+hash_extract_SOURCES = hash_extract.c
+hash_extract_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+
+trace_dump_SOURCES = trace_dump.c
+trace_dump_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+
+ztr_dump_SOURCES = ztr_dump.c
+ztr_dump_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+
+srf2fastq_SOURCES = srf2fastq.c
+srf2fastq_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+
+srf2fasta_SOURCES = srf2fasta.c
+srf2fasta_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+
+srf_dump_all_SOURCES = srf_dump_all.c
+srf_dump_all_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+
+srf_extract_linear_SOURCES = srf_extract_linear.c
+srf_extract_linear_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+
+srf_extract_hash_SOURCES = srf_extract_hash.c
+srf_extract_hash_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+
+srf_index_hash_SOURCES = srf_index_hash.c
+srf_index_hash_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+
+srf_filter_SOURCES = srf_filter.c
+srf_filter_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+
+srf_info_SOURCES = srf_info.c
+srf_info_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+
+srf_list_SOURCES = srf_list.c
+srf_list_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+
+INCLUDES= -I${top_srcdir}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/progs/Makefile.in	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,721 @@
+# 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@
+
+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@
+bin_PROGRAMS = convert_trace$(EXEEXT) makeSCF$(EXEEXT) \
+	extract_seq$(EXEEXT) extract_qual$(EXEEXT) \
+	extract_fastq$(EXEEXT) index_tar$(EXEEXT) scf_dump$(EXEEXT) \
+	scf_info$(EXEEXT) scf_update$(EXEEXT) get_comment$(EXEEXT) \
+	hash_tar$(EXEEXT) hash_extract$(EXEEXT) hash_list$(EXEEXT) \
+	trace_dump$(EXEEXT) hash_sff$(EXEEXT) append_sff$(EXEEXT) \
+	ztr_dump$(EXEEXT) srf_dump_all$(EXEEXT) \
+	srf_index_hash$(EXEEXT) srf_extract_linear$(EXEEXT) \
+	srf_extract_hash$(EXEEXT) srf2fastq$(EXEEXT) \
+	srf2fasta$(EXEEXT) srf_filter$(EXEEXT) srf_info$(EXEEXT) \
+	srf_list$(EXEEXT)
+subdir = progs
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/io_lib_config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am_append_sff_OBJECTS = append_sff.$(OBJEXT)
+append_sff_OBJECTS = $(am_append_sff_OBJECTS)
+append_sff_DEPENDENCIES = $(top_builddir)/io_lib/libstaden-read.la
+am_convert_trace_OBJECTS = convert_trace.$(OBJEXT)
+convert_trace_OBJECTS = $(am_convert_trace_OBJECTS)
+convert_trace_DEPENDENCIES = $(top_builddir)/io_lib/libstaden-read.la
+am_extract_fastq_OBJECTS = extract_fastq.$(OBJEXT)
+extract_fastq_OBJECTS = $(am_extract_fastq_OBJECTS)
+extract_fastq_DEPENDENCIES = $(top_builddir)/io_lib/libstaden-read.la
+am_extract_qual_OBJECTS = extract_qual.$(OBJEXT)
+extract_qual_OBJECTS = $(am_extract_qual_OBJECTS)
+extract_qual_DEPENDENCIES = $(top_builddir)/io_lib/libstaden-read.la
+am_extract_seq_OBJECTS = extract_seq.$(OBJEXT)
+extract_seq_OBJECTS = $(am_extract_seq_OBJECTS)
+extract_seq_DEPENDENCIES = $(top_builddir)/io_lib/libstaden-read.la
+am_get_comment_OBJECTS = get_comment.$(OBJEXT)
+get_comment_OBJECTS = $(am_get_comment_OBJECTS)
+get_comment_DEPENDENCIES = $(top_builddir)/io_lib/libstaden-read.la
+am_hash_extract_OBJECTS = hash_extract.$(OBJEXT)
+hash_extract_OBJECTS = $(am_hash_extract_OBJECTS)
+hash_extract_DEPENDENCIES = $(top_builddir)/io_lib/libstaden-read.la
+am_hash_list_OBJECTS = hash_list.$(OBJEXT)
+hash_list_OBJECTS = $(am_hash_list_OBJECTS)
+hash_list_DEPENDENCIES = $(top_builddir)/io_lib/libstaden-read.la
+am_hash_sff_OBJECTS = hash_sff.$(OBJEXT)
+hash_sff_OBJECTS = $(am_hash_sff_OBJECTS)
+hash_sff_DEPENDENCIES = $(top_builddir)/io_lib/libstaden-read.la
+am_hash_tar_OBJECTS = hash_tar.$(OBJEXT)
+hash_tar_OBJECTS = $(am_hash_tar_OBJECTS)
+hash_tar_DEPENDENCIES = $(top_builddir)/io_lib/libstaden-read.la
+am_index_tar_OBJECTS = index_tar.$(OBJEXT)
+index_tar_OBJECTS = $(am_index_tar_OBJECTS)
+index_tar_LDADD = $(LDADD)
+am_makeSCF_OBJECTS = makeSCF.$(OBJEXT)
+makeSCF_OBJECTS = $(am_makeSCF_OBJECTS)
+makeSCF_DEPENDENCIES = $(top_builddir)/io_lib/libstaden-read.la
+am_scf_dump_OBJECTS = scf_dump.$(OBJEXT)
+scf_dump_OBJECTS = $(am_scf_dump_OBJECTS)
+scf_dump_DEPENDENCIES = $(top_builddir)/io_lib/libstaden-read.la
+am_scf_info_OBJECTS = scf_info.$(OBJEXT)
+scf_info_OBJECTS = $(am_scf_info_OBJECTS)
+scf_info_DEPENDENCIES = $(top_builddir)/io_lib/libstaden-read.la
+am_scf_update_OBJECTS = scf_update.$(OBJEXT)
+scf_update_OBJECTS = $(am_scf_update_OBJECTS)
+scf_update_DEPENDENCIES = $(top_builddir)/io_lib/libstaden-read.la
+am_srf2fasta_OBJECTS = srf2fasta.$(OBJEXT)
+srf2fasta_OBJECTS = $(am_srf2fasta_OBJECTS)
+srf2fasta_DEPENDENCIES = $(top_builddir)/io_lib/libstaden-read.la
+am_srf2fastq_OBJECTS = srf2fastq.$(OBJEXT)
+srf2fastq_OBJECTS = $(am_srf2fastq_OBJECTS)
+srf2fastq_DEPENDENCIES = $(top_builddir)/io_lib/libstaden-read.la
+am_srf_dump_all_OBJECTS = srf_dump_all.$(OBJEXT)
+srf_dump_all_OBJECTS = $(am_srf_dump_all_OBJECTS)
+srf_dump_all_DEPENDENCIES = $(top_builddir)/io_lib/libstaden-read.la
+am_srf_extract_hash_OBJECTS = srf_extract_hash.$(OBJEXT)
+srf_extract_hash_OBJECTS = $(am_srf_extract_hash_OBJECTS)
+srf_extract_hash_DEPENDENCIES =  \
+	$(top_builddir)/io_lib/libstaden-read.la
+am_srf_extract_linear_OBJECTS = srf_extract_linear.$(OBJEXT)
+srf_extract_linear_OBJECTS = $(am_srf_extract_linear_OBJECTS)
+srf_extract_linear_DEPENDENCIES =  \
+	$(top_builddir)/io_lib/libstaden-read.la
+am_srf_filter_OBJECTS = srf_filter.$(OBJEXT)
+srf_filter_OBJECTS = $(am_srf_filter_OBJECTS)
+srf_filter_DEPENDENCIES = $(top_builddir)/io_lib/libstaden-read.la
+am_srf_index_hash_OBJECTS = srf_index_hash.$(OBJEXT)
+srf_index_hash_OBJECTS = $(am_srf_index_hash_OBJECTS)
+srf_index_hash_DEPENDENCIES =  \
+	$(top_builddir)/io_lib/libstaden-read.la
+am_srf_info_OBJECTS = srf_info.$(OBJEXT)
+srf_info_OBJECTS = $(am_srf_info_OBJECTS)
+srf_info_DEPENDENCIES = $(top_builddir)/io_lib/libstaden-read.la
+am_srf_list_OBJECTS = srf_list.$(OBJEXT)
+srf_list_OBJECTS = $(am_srf_list_OBJECTS)
+srf_list_DEPENDENCIES = $(top_builddir)/io_lib/libstaden-read.la
+am_trace_dump_OBJECTS = trace_dump.$(OBJEXT)
+trace_dump_OBJECTS = $(am_trace_dump_OBJECTS)
+trace_dump_DEPENDENCIES = $(top_builddir)/io_lib/libstaden-read.la
+am_ztr_dump_OBJECTS = ztr_dump.$(OBJEXT)
+ztr_dump_OBJECTS = $(am_ztr_dump_OBJECTS)
+ztr_dump_DEPENDENCIES = $(top_builddir)/io_lib/libstaden-read.la
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/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 = $(append_sff_SOURCES) $(convert_trace_SOURCES) \
+	$(extract_fastq_SOURCES) $(extract_qual_SOURCES) \
+	$(extract_seq_SOURCES) $(get_comment_SOURCES) \
+	$(hash_extract_SOURCES) $(hash_list_SOURCES) \
+	$(hash_sff_SOURCES) $(hash_tar_SOURCES) $(index_tar_SOURCES) \
+	$(makeSCF_SOURCES) $(scf_dump_SOURCES) $(scf_info_SOURCES) \
+	$(scf_update_SOURCES) $(srf2fasta_SOURCES) \
+	$(srf2fastq_SOURCES) $(srf_dump_all_SOURCES) \
+	$(srf_extract_hash_SOURCES) $(srf_extract_linear_SOURCES) \
+	$(srf_filter_SOURCES) $(srf_index_hash_SOURCES) \
+	$(srf_info_SOURCES) $(srf_list_SOURCES) $(trace_dump_SOURCES) \
+	$(ztr_dump_SOURCES)
+DIST_SOURCES = $(append_sff_SOURCES) $(convert_trace_SOURCES) \
+	$(extract_fastq_SOURCES) $(extract_qual_SOURCES) \
+	$(extract_seq_SOURCES) $(get_comment_SOURCES) \
+	$(hash_extract_SOURCES) $(hash_list_SOURCES) \
+	$(hash_sff_SOURCES) $(hash_tar_SOURCES) $(index_tar_SOURCES) \
+	$(makeSCF_SOURCES) $(scf_dump_SOURCES) $(scf_info_SOURCES) \
+	$(scf_update_SOURCES) $(srf2fasta_SOURCES) \
+	$(srf2fastq_SOURCES) $(srf_dump_all_SOURCES) \
+	$(srf_extract_hash_SOURCES) $(srf_extract_linear_SOURCES) \
+	$(srf_filter_SOURCES) $(srf_index_hash_SOURCES) \
+	$(srf_info_SOURCES) $(srf_list_SOURCES) $(trace_dump_SOURCES) \
+	$(ztr_dump_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@
+GREP = @GREP@
+HAVE_ZLIB_FALSE = @HAVE_ZLIB_FALSE@
+HAVE_ZLIB_TRUE = @HAVE_ZLIB_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBCURL = @LIBCURL@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBZ = @LIBZ@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+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@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+VERS_AGE = @VERS_AGE@
+VERS_CURRENT = @VERS_CURRENT@
+VERS_REVISION = @VERS_REVISION@
+_libcurl_config = @_libcurl_config@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+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@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+convert_trace_SOURCES = convert_trace.c
+convert_trace_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+get_comment_SOURCES = get_comment.c
+get_comment_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+makeSCF_SOURCES = makeSCF.c
+makeSCF_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+extract_seq_SOURCES = extract_seq.c
+extract_seq_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+extract_qual_SOURCES = extract_qual.c
+extract_qual_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+extract_fastq_SOURCES = extract_fastq.c
+extract_fastq_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+index_tar_SOURCES = index_tar.c
+scf_dump_SOURCES = scf_dump.c
+scf_dump_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+scf_info_SOURCES = scf_info.c
+scf_info_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+scf_update_SOURCES = scf_update.c
+scf_update_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+hash_tar_SOURCES = hash_tar.c
+hash_tar_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+hash_list_SOURCES = hash_list.c
+hash_list_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+hash_sff_SOURCES = hash_sff.c
+hash_sff_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+append_sff_SOURCES = append_sff.c
+append_sff_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+hash_extract_SOURCES = hash_extract.c
+hash_extract_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+trace_dump_SOURCES = trace_dump.c
+trace_dump_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+ztr_dump_SOURCES = ztr_dump.c
+ztr_dump_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+srf2fastq_SOURCES = srf2fastq.c
+srf2fastq_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+srf2fasta_SOURCES = srf2fasta.c
+srf2fasta_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+srf_dump_all_SOURCES = srf_dump_all.c
+srf_dump_all_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+srf_extract_linear_SOURCES = srf_extract_linear.c
+srf_extract_linear_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+srf_extract_hash_SOURCES = srf_extract_hash.c
+srf_extract_hash_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+srf_index_hash_SOURCES = srf_index_hash.c
+srf_index_hash_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+srf_filter_SOURCES = srf_filter.c
+srf_filter_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+srf_info_SOURCES = srf_info.c
+srf_info_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+srf_list_SOURCES = srf_list.c
+srf_list_LDADD = $(top_builddir)/io_lib/libstaden-read.la
+INCLUDES = -I${top_srcdir}
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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  progs/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  progs/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(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
+append_sff$(EXEEXT): $(append_sff_OBJECTS) $(append_sff_DEPENDENCIES) 
+	@rm -f append_sff$(EXEEXT)
+	$(LINK) $(append_sff_LDFLAGS) $(append_sff_OBJECTS) $(append_sff_LDADD) $(LIBS)
+convert_trace$(EXEEXT): $(convert_trace_OBJECTS) $(convert_trace_DEPENDENCIES) 
+	@rm -f convert_trace$(EXEEXT)
+	$(LINK) $(convert_trace_LDFLAGS) $(convert_trace_OBJECTS) $(convert_trace_LDADD) $(LIBS)
+extract_fastq$(EXEEXT): $(extract_fastq_OBJECTS) $(extract_fastq_DEPENDENCIES) 
+	@rm -f extract_fastq$(EXEEXT)
+	$(LINK) $(extract_fastq_LDFLAGS) $(extract_fastq_OBJECTS) $(extract_fastq_LDADD) $(LIBS)
+extract_qual$(EXEEXT): $(extract_qual_OBJECTS) $(extract_qual_DEPENDENCIES) 
+	@rm -f extract_qual$(EXEEXT)
+	$(LINK) $(extract_qual_LDFLAGS) $(extract_qual_OBJECTS) $(extract_qual_LDADD) $(LIBS)
+extract_seq$(EXEEXT): $(extract_seq_OBJECTS) $(extract_seq_DEPENDENCIES) 
+	@rm -f extract_seq$(EXEEXT)
+	$(LINK) $(extract_seq_LDFLAGS) $(extract_seq_OBJECTS) $(extract_seq_LDADD) $(LIBS)
+get_comment$(EXEEXT): $(get_comment_OBJECTS) $(get_comment_DEPENDENCIES) 
+	@rm -f get_comment$(EXEEXT)
+	$(LINK) $(get_comment_LDFLAGS) $(get_comment_OBJECTS) $(get_comment_LDADD) $(LIBS)
+hash_extract$(EXEEXT): $(hash_extract_OBJECTS) $(hash_extract_DEPENDENCIES) 
+	@rm -f hash_extract$(EXEEXT)
+	$(LINK) $(hash_extract_LDFLAGS) $(hash_extract_OBJECTS) $(hash_extract_LDADD) $(LIBS)
+hash_list$(EXEEXT): $(hash_list_OBJECTS) $(hash_list_DEPENDENCIES) 
+	@rm -f hash_list$(EXEEXT)
+	$(LINK) $(hash_list_LDFLAGS) $(hash_list_OBJECTS) $(hash_list_LDADD) $(LIBS)
+hash_sff$(EXEEXT): $(hash_sff_OBJECTS) $(hash_sff_DEPENDENCIES) 
+	@rm -f hash_sff$(EXEEXT)
+	$(LINK) $(hash_sff_LDFLAGS) $(hash_sff_OBJECTS) $(hash_sff_LDADD) $(LIBS)
+hash_tar$(EXEEXT): $(hash_tar_OBJECTS) $(hash_tar_DEPENDENCIES) 
+	@rm -f hash_tar$(EXEEXT)
+	$(LINK) $(hash_tar_LDFLAGS) $(hash_tar_OBJECTS) $(hash_tar_LDADD) $(LIBS)
+index_tar$(EXEEXT): $(index_tar_OBJECTS) $(index_tar_DEPENDENCIES) 
+	@rm -f index_tar$(EXEEXT)
+	$(LINK) $(index_tar_LDFLAGS) $(index_tar_OBJECTS) $(index_tar_LDADD) $(LIBS)
+makeSCF$(EXEEXT): $(makeSCF_OBJECTS) $(makeSCF_DEPENDENCIES) 
+	@rm -f makeSCF$(EXEEXT)
+	$(LINK) $(makeSCF_LDFLAGS) $(makeSCF_OBJECTS) $(makeSCF_LDADD) $(LIBS)
+scf_dump$(EXEEXT): $(scf_dump_OBJECTS) $(scf_dump_DEPENDENCIES) 
+	@rm -f scf_dump$(EXEEXT)
+	$(LINK) $(scf_dump_LDFLAGS) $(scf_dump_OBJECTS) $(scf_dump_LDADD) $(LIBS)
+scf_info$(EXEEXT): $(scf_info_OBJECTS) $(scf_info_DEPENDENCIES) 
+	@rm -f scf_info$(EXEEXT)
+	$(LINK) $(scf_info_LDFLAGS) $(scf_info_OBJECTS) $(scf_info_LDADD) $(LIBS)
+scf_update$(EXEEXT): $(scf_update_OBJECTS) $(scf_update_DEPENDENCIES) 
+	@rm -f scf_update$(EXEEXT)
+	$(LINK) $(scf_update_LDFLAGS) $(scf_update_OBJECTS) $(scf_update_LDADD) $(LIBS)
+srf2fasta$(EXEEXT): $(srf2fasta_OBJECTS) $(srf2fasta_DEPENDENCIES) 
+	@rm -f srf2fasta$(EXEEXT)
+	$(LINK) $(srf2fasta_LDFLAGS) $(srf2fasta_OBJECTS) $(srf2fasta_LDADD) $(LIBS)
+srf2fastq$(EXEEXT): $(srf2fastq_OBJECTS) $(srf2fastq_DEPENDENCIES) 
+	@rm -f srf2fastq$(EXEEXT)
+	$(LINK) $(srf2fastq_LDFLAGS) $(srf2fastq_OBJECTS) $(srf2fastq_LDADD) $(LIBS)
+srf_dump_all$(EXEEXT): $(srf_dump_all_OBJECTS) $(srf_dump_all_DEPENDENCIES) 
+	@rm -f srf_dump_all$(EXEEXT)
+	$(LINK) $(srf_dump_all_LDFLAGS) $(srf_dump_all_OBJECTS) $(srf_dump_all_LDADD) $(LIBS)
+srf_extract_hash$(EXEEXT): $(srf_extract_hash_OBJECTS) $(srf_extract_hash_DEPENDENCIES) 
+	@rm -f srf_extract_hash$(EXEEXT)
+	$(LINK) $(srf_extract_hash_LDFLAGS) $(srf_extract_hash_OBJECTS) $(srf_extract_hash_LDADD) $(LIBS)
+srf_extract_linear$(EXEEXT): $(srf_extract_linear_OBJECTS) $(srf_extract_linear_DEPENDENCIES) 
+	@rm -f srf_extract_linear$(EXEEXT)
+	$(LINK) $(srf_extract_linear_LDFLAGS) $(srf_extract_linear_OBJECTS) $(srf_extract_linear_LDADD) $(LIBS)
+srf_filter$(EXEEXT): $(srf_filter_OBJECTS) $(srf_filter_DEPENDENCIES) 
+	@rm -f srf_filter$(EXEEXT)
+	$(LINK) $(srf_filter_LDFLAGS) $(srf_filter_OBJECTS) $(srf_filter_LDADD) $(LIBS)
+srf_index_hash$(EXEEXT): $(srf_index_hash_OBJECTS) $(srf_index_hash_DEPENDENCIES) 
+	@rm -f srf_index_hash$(EXEEXT)
+	$(LINK) $(srf_index_hash_LDFLAGS) $(srf_index_hash_OBJECTS) $(srf_index_hash_LDADD) $(LIBS)
+srf_info$(EXEEXT): $(srf_info_OBJECTS) $(srf_info_DEPENDENCIES) 
+	@rm -f srf_info$(EXEEXT)
+	$(LINK) $(srf_info_LDFLAGS) $(srf_info_OBJECTS) $(srf_info_LDADD) $(LIBS)
+srf_list$(EXEEXT): $(srf_list_OBJECTS) $(srf_list_DEPENDENCIES) 
+	@rm -f srf_list$(EXEEXT)
+	$(LINK) $(srf_list_LDFLAGS) $(srf_list_OBJECTS) $(srf_list_LDADD) $(LIBS)
+trace_dump$(EXEEXT): $(trace_dump_OBJECTS) $(trace_dump_DEPENDENCIES) 
+	@rm -f trace_dump$(EXEEXT)
+	$(LINK) $(trace_dump_LDFLAGS) $(trace_dump_OBJECTS) $(trace_dump_LDADD) $(LIBS)
+ztr_dump$(EXEEXT): $(ztr_dump_OBJECTS) $(ztr_dump_DEPENDENCIES) 
+	@rm -f ztr_dump$(EXEEXT)
+	$(LINK) $(ztr_dump_LDFLAGS) $(ztr_dump_OBJECTS) $(ztr_dump_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/append_sff.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_trace.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/extract_fastq.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/extract_qual.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/extract_seq.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_comment.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash_extract.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash_list.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash_sff.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash_tar.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/index_tar.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/makeSCF.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scf_dump.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scf_info.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scf_update.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/srf2fasta.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/srf2fastq.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/srf_dump_all.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/srf_extract_hash.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/srf_extract_linear.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/srf_filter.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/srf_index_hash.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/srf_info.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/srf_list.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trace_dump.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ztr_dump.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:
+
+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)
+installdirs:
+	for dir in "$(DESTDIR)$(bindir)"; 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-exec-am: install-binPROGRAMS
+
+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-binPROGRAMS uninstall-info-am
+
+.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-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
+
+# 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:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/progs/append_sff.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,124 @@
+/*
+ * Concatenates multiple SFF files together. It also strips out any indexing
+ * so this will need to be added again afterwards.
+ *
+ * The first argument is the archive to append to. All subsequent arguments
+ * are the archives to append to the first argument.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <io_lib/sff.h>
+#include <io_lib/os.h>
+
+#define BSIZE 1024*1024
+
+int main(int argc, char **argv) {
+    int i;
+    FILE *fpin, *fpout;
+    unsigned char *block;
+    unsigned char chdr[31];
+    sff_common_header *ch;
+
+    block = (unsigned char *)malloc(BSIZE);
+
+    if (argc < 3) {
+	fprintf(stderr, "Usage: append_sff sff_file add_me.sff ...\n");
+	return 1;
+    }
+
+    /* Open and decode the common header of the archive we'll append to */
+    if (NULL == (fpout = fopen(argv[1], "rb+"))) {
+	perror(argv[1]);
+	return 1;
+    }
+
+    if (31 != fread(chdr, 1, 31, fpout)) {
+	fprintf(stderr, "Couldn't read common header\n");
+	return 1;
+    }
+    ch = decode_sff_common_header(chdr);
+
+    /*
+     * Jump to the end of the archive or the start of the index.
+     * NB: If the index is not at the end we cannot use a simple append
+     * method.
+     */
+    fseek(fpout, 0, SEEK_END);
+    if (ch->index_len) {
+	if (ch->index_offset + ch->index_len != ftell(fpout)) {
+	    fprintf(stderr, "Index is not at the end of file => cannot append\n");
+	    return 1;
+	}
+	fseek(fpout, ch->index_offset, SEEK_SET);
+    }
+
+    /* Iterate around other archives, appending to the first one */
+    for (i = 2; i < argc; i++) {
+	sff_common_header *h;
+	uint64_t pos;
+	size_t len;
+	char *sff = argv[i];
+	int skipped;
+
+	printf("Copying %s\n", sff);
+
+	if (NULL == (fpin = fopen(sff, "rb"))) {
+	    perror(sff);
+	    return 1;
+	}
+
+	if (31 != fread(chdr, 1, 31, fpin)) {
+	    fprintf(stderr, "Couldn't read common header\n");
+	    return 1;
+	}
+
+	h = decode_sff_common_header(chdr);
+
+	/* Check if headers are compatible */
+	if (ch->flow_len        != h->flow_len ||
+	    ch->key_len         != h->key_len ||
+	    ch->flowgram_format != h->flowgram_format)
+	    fprintf(stderr, "*** Error: incompatible SFF headers ***\n");
+	fseek(fpin, h->header_len - 31, SEEK_CUR);
+	ch->nreads += h->nreads;
+
+	/* Copy all data from fpin to fpout, skipping index if present */
+	skipped = h->index_len ? 0 : 1;
+	for (pos = ftell(fpin); ; pos += len) {
+	    len = BSIZE;
+	    if (!skipped) {
+		if (pos == h->index_offset) {
+		    fseek(fpin, h->index_len, SEEK_CUR);
+		    pos += h->index_len;
+		    skipped = 1;
+		} else if (pos + BSIZE > h->index_offset) {
+		    len = h->index_offset - pos;
+		}
+	    }
+	    if (0 == (len = fread(block, 1, len, fpin)))
+		break;
+	    fwrite(block, 1, len, fpout);
+	}
+
+	free_sff_common_header(h);
+	fclose(fpin);
+    }
+
+    /* Seek back and update the header with the new nreads */
+    fseek(fpout, 0, SEEK_SET);
+    fread(chdr, 1, 31, fpout);
+    *(uint64_t *)(chdr+8)  = be_int8(0);
+    *(uint32_t *)(chdr+16) = be_int4(0);
+    *(uint32_t *)(chdr+20) = be_int4(ch->nreads);
+    fseek(fpout, 0, SEEK_SET);
+    fwrite(chdr, 1, 31, fpout);
+    fclose(fpout);
+
+    free_sff_common_header(ch);
+    free(block);
+
+    return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/progs/convert_trace.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,794 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#include <io_lib/Read.h>
+#include <io_lib/traceType.h>
+#include <io_lib/seqIOABI.h>
+#include <io_lib/open_trace_file.h>
+
+static char const rcsid[] = "$Id: convert_trace.c,v 1.12 2008-02-20 16:07:44 jkbonfield Exp $";
+
+#define MAX(a,b) ((a)>(b)?(a):(b))
+
+struct opts {
+    char *name;
+    char *fofn;
+    char *passed;
+    char *failed;
+    char *error;
+    int in_format;
+    int out_format;
+    int scale;
+    int sub_background;
+    int subtract;
+    int normalise;
+    int min_normalise;
+    int compress_mode;
+    int dots;
+    int noneg;
+    int signed_trace;
+    int skipx;
+    int start;
+    int end;
+};
+
+/*
+ * Removes any negative values from a trace by moving each channel
+ * independently so that its lowest value is 0.
+ */
+void noneg(Read *r) {
+    int i, j, k;
+    signed int min;
+    TRACE *t;
+
+    /* Find the real end of the data */
+    for (k = r->NPoints-1; k >= 0; k--)
+	if (r->traceA[k] ||
+	    r->traceC[k] ||
+	    r->traceG[k] ||
+	    r->traceT[k])
+	    break;
+
+    for (j = 0; j < 4; j++) {
+	switch(j) {
+	case 0:
+	    t = r->traceA;
+	    break;
+	case 1:
+	    t = r->traceC;
+	    break;
+	case 2:
+	    t = r->traceG;
+	    break;
+	case 3:
+	default:
+	    t = r->traceT;
+	    break;
+	}
+
+	/* Find the lowest -ve value per lane */
+	for (min = i = 0; i <= k; i++) {
+	    if (min > ((int16_t *)t)[i])
+		min = ((int16_t *)t)[i];
+	}
+
+	/* And shift everything back up */
+	for (i = 0; i <= k; i++) {
+	    t[i] -= min;
+	}
+    }
+}
+
+
+/*
+ * Removes any negative values from a trace by moving the trace up so that
+ * the lowest overall value is 0. This differs to noneg above by using
+ * a global shift for all channels and also setting the read 'baseline'.
+ */
+void signed_trace(Read *r) {
+    int i, k;
+    signed int min;
+
+    /* Find the real end of the data */
+    for (k = r->NPoints-1; k >= 0; k--)
+	if (r->traceA[k] ||
+	    r->traceC[k] ||
+	    r->traceG[k] ||
+	    r->traceT[k])
+	    break;
+
+    /* Find the lowest -ve value per lane */
+    for (min = i = 0; i <= k; i++) {
+	if (min > ((int16_t *)(r->traceA))[i])
+	    min = ((int16_t *)(r->traceA))[i];
+	if (min > ((int16_t *)(r->traceC))[i])
+	    min = ((int16_t *)(r->traceC))[i];
+	if (min > ((int16_t *)(r->traceG))[i])
+	    min = ((int16_t *)(r->traceG))[i];
+	if (min > ((int16_t *)(r->traceT))[i])
+	    min = ((int16_t *)(r->traceT))[i];
+    }
+
+    r->baseline = -min;
+
+    /* And shift everything back up */
+    for (i = 0; i <= k; i++) {
+	r->traceA[i] -= min;
+	r->traceC[i] -= min;
+	r->traceG[i] -= min;
+	r->traceT[i] -= min;
+    }
+}
+
+/*
+ * Scales trace values from 0 to scale, but only if they are larger.
+ */
+void rescale_trace(Read *r, int scale) {
+    double s;
+    int i;
+
+    if (r->maxTraceVal <= scale)
+	return;
+    
+    s = ((double)scale)/r->maxTraceVal;
+
+    for (i = 0; i < r->NPoints; i++) {
+	r->traceA[i] = r->traceA[i] * s + 0.5;
+	r->traceC[i] = r->traceC[i] * s + 0.5;
+	r->traceG[i] = r->traceG[i] * s + 0.5;
+	r->traceT[i] = r->traceT[i] * s + 0.5;
+    }
+
+    r->maxTraceVal = scale;
+}
+
+#if 0
+/* OLD method, treats all channels together and assumes the same baseline for
+ * each
+ */
+/*
+ * Here we just take the minimum trace value and subtract this from all others.
+ * The assumption is that the signal will always be 'base line' on at least
+ * one of the four channels.
+ */
+void subtract_background(Read *r) {
+    int i, min;
+    for (i = 0; i < r->NPoints; i++) {
+	min = 999999;
+	if (r->traceA[i] < min) min = r->traceA[i];
+	if (r->traceC[i] < min) min = r->traceC[i];
+	if (r->traceG[i] < min) min = r->traceG[i];
+	if (r->traceT[i] < min) min = r->traceT[i];
+	r->traceA[i] -= min;
+	r->traceC[i] -= min;
+	r->traceG[i] -= min;
+	r->traceT[i] -= min;
+    }
+}
+#endif
+
+static void subtract_background_ch(TRACE *channel, int nchannel) {
+    int i, j, bg;
+    int win_len = 501, win_len2 = win_len/2;
+    TRACE *copy;
+
+    if (NULL == (copy = (TRACE *)malloc(sizeof(*copy) * nchannel)))
+	return;
+
+    if (nchannel < win_len)
+	win_len = nchannel;
+
+    /* Take lowest background over win_len and subtract it */
+    for (i = 0; i < nchannel; i++) {
+	/* Could optimise this considerably */
+	bg = INT_MAX;
+	for (j = -win_len2; j < win_len2; j++) {
+	    if (i+j < 0) continue;
+	    if (i+j >= nchannel) break;
+		
+	    if (channel[i + j] < bg)
+		bg = channel[i + j];
+	}
+	
+	copy[i] = channel[i] - bg;
+    }
+
+    memcpy(channel, copy, nchannel * sizeof(*copy));
+    free(copy);
+}
+
+/*
+ * Find the average background level of a trace, and subtract this from the
+ * peak heights.
+ */
+void subtract_background(Read *r) {
+    subtract_background_ch(r->traceA, r->NPoints);
+    subtract_background_ch(r->traceC, r->NPoints);
+    subtract_background_ch(r->traceG, r->NPoints);
+    subtract_background_ch(r->traceT, r->NPoints);
+}
+
+int int_compar(const void *a, const void *b) {
+    return *(const TRACE *)a - *(const TRACE *)b;
+}
+
+int find_bg(TRACE *data, int ndata) {
+    int i, bg;
+    TRACE *copy = (TRACE *)malloc(ndata * sizeof(TRACE));
+
+    /* Sort the trace samples by amplitude */
+    memcpy(copy, data, ndata * sizeof(TRACE));
+    qsort(copy, ndata, sizeof(TRACE), int_compar);
+
+    /* Find the first non-zero value */
+    for (i = 0; i < ndata && !copy[i]; i++)
+	;
+
+    /*
+     * Now take a slie 0.05 through the remainder of the array and set this
+     * as our background.
+     */
+    bg = copy[(int)((ndata - i) * 0.05 + i)];
+
+    free(copy);
+    return bg;
+}
+
+void trace_freq(TRACE *data, int ndata) {
+    int i, bg;
+    bg = find_bg(data, ndata);
+
+    for (i = 0; i < ndata; i++) {
+	data[i] = MAX(data[i] - bg, 0);
+    }
+}
+
+/*
+ * Separates out the dyes using a deconvolution matrix.
+ * The order of elements in the matrix is C A G T.
+ * A test matrix for the 373. Taken from the BASS distribution.
+ */
+double matrix[5][4] = {
+  { 0.002439782,        -0.0015053751,       0.00011857301,    2.8906948e-06},
+  {-0.00075353298,       0.0032971052,      -0.006198165,      0.00014828549},
+  { 0.00020249287,      -0.0017620348,       0.010530438,     -0.0020235507 },
+  {-0.001144423,        -4.857673e-06,      -0.0018845701,     0.00395431   },
+  {-0.12451385,          0.368916,          -2.928292,        -3.3142638    }
+};
+void separate_dyes(Read *r, double M[][4]) {
+    int i, j;
+
+    for (i = 0; i < r->NPoints; i++) {
+	int C, A, G, T;
+	double sep[4];
+
+	C = r->traceC[i];
+	A = r->traceA[i];
+	G = r->traceG[i];
+	T = r->traceT[i];
+
+	for (j = 0; j < 4; j++)
+	  sep[j] = C*M[0][j] + A*M[1][j] + G*M[2][j] + T*M[3][j] + M[4][j];
+
+	for (j = 0; j < 4; j++)
+	    sep[j] += 10;
+
+	/* hack!
+	   sep[0] += 0.1;
+	   sep[1] += -0.4;
+	   sep[2] += 2.9;
+	   sep[3] += 3.2;
+	*/
+
+	r->traceC[i] = sep[0] < 0 ? 0 : 1000 * sep[0];
+	r->traceA[i] = sep[1] < 0 ? 0 : 1000 * sep[1];
+	r->traceG[i] = sep[2] < 0 ? 0 : 1000 * sep[2];
+	r->traceT[i] = sep[3] < 0 ? 0 : 1000 * sep[3];
+    }
+}
+
+/*
+ * Find the maximum height of traces at the called bases. Use this to clip any
+ * other bases.
+ */
+void reset_max_called_height(Read *r) {
+    int i, max = 0;
+
+    /* Find max */
+    for (i=0; i < r->NBases; i++) {
+	switch(r->base[i]) {
+	case 'a':
+	case 'A':
+	    if (r->traceA[r->basePos[i]] > max)
+		max = r->traceA[r->basePos[i]];
+	    break;
+
+	case 'c':
+	case 'C':
+	    if (r->traceC[r->basePos[i]] > max)
+		max = r->traceC[r->basePos[i]];
+	    break;
+
+	case 'g':
+	case 'G':
+	    if (r->traceG[r->basePos[i]] > max)
+		max = r->traceG[r->basePos[i]];
+	    break;
+
+	case 't':
+	case 'T':
+	    if (r->traceT[r->basePos[i]] > max)
+		max = r->traceT[r->basePos[i]];
+	    break;
+	}
+    }
+
+    /* Clip to max */
+    for (i = 0; i < r->NPoints; i++) {
+	if (r->traceA[i] > max)
+	    r->traceA[i] = max;
+	if (r->traceC[i] > max)
+	    r->traceC[i] = max;
+	if (r->traceG[i] > max)
+	    r->traceG[i] = max;
+	if (r->traceT[i] > max)
+	    r->traceT[i] = max;
+    }
+    if (r->maxTraceVal > max)
+	r->maxTraceVal = max;
+}
+
+/*
+ * Rescales peak heights based on a moving "marker". The marker tracks
+ * up and down (attack and decay) based on the difference between itself and
+ * the trace envelope. We then divide by the marker value to attempt to
+ * normalise peak heights.
+ *
+ * min_marker is used to avoid scaling up noise and represents the minimum
+ * value the marker is allowed to reach. Make sure it is > 0 or divide by
+ * zero may occur.
+ */
+void rescale_heights(Read *r, int min_marker) {
+    double marker = 0;
+    int i, j, max, mtv = 0;
+    TRACE *tx[4];
+
+    tx[0] = r->traceA;
+    tx[1] = r->traceC;
+    tx[2] = r->traceG;
+    tx[3] = r->traceT;
+
+    for (i = 0; i < r->NPoints; i++) {
+	for (max = j = 0; j < 4; j++)
+	    if (max < tx[j][i])
+		max = tx[j][i];
+	if (!marker) {
+	    marker = max;
+	} else {
+	    if (max >= marker) {
+		/* attack */
+		marker += (max - marker) / 20.0;
+	    } else {
+		/* decay */
+		marker -= (marker - max) / 10.0;
+	    }
+	}
+	if (marker < min_marker)
+	    marker = min_marker;
+
+	for (j = 0; j < 4; j++) {
+	    double new = tx[j][i] * 2000.0/marker;
+	    tx[j][i] = new > 32767 ? 32767 : new;
+	    if (mtv < tx[j][i])
+		mtv = tx[j][i];
+	}
+
+    }
+
+    r->maxTraceVal = mtv;
+}
+
+/* Removes every other sample as a crude way to reduce file size */
+void skipx(Read *r) {
+    int i, j;
+    for (i = j = 0; j < r->NPoints/2; i+=2, j++) {
+	r->traceA[j] = (r->traceA[i] + r->traceA[i+1]) / 2;
+	r->traceC[j] = (r->traceC[i] + r->traceC[i+1]) / 2;
+	r->traceG[j] = (r->traceG[i] + r->traceG[i+1]) / 2;
+	r->traceT[j] = (r->traceT[i] + r->traceT[i+1]) / 2;
+    }
+    r->NPoints = j;
+
+    for (i = 0; i < r->NBases; i++) {
+	r->basePos[i] /= 2;
+    }
+}
+
+void clip_range(Read *r, int left, int right) {
+    int i, j;
+    if (left != -1) {
+	for (i = 0, j = left; j < r->NPoints; i++, j++) {
+	    r->traceA[i] = r->traceA[j];
+	    r->traceC[i] = r->traceC[j];
+	    r->traceG[i] = r->traceG[j];
+	    r->traceT[i] = r->traceT[j];
+	}
+	right -= left;
+    }
+    if (right > 0) {
+	r->NPoints = right;
+    }
+}
+
+
+int convert(mFILE *infp, mFILE *outfp, char *infname, char *outfname,
+	    struct opts *opts) {
+    Read *r;
+
+    if (NULL == (r = mfread_reading(infp, infname, opts->in_format))) {
+	fprintf(stderr, "failed to read file %s\n", infname);
+	return 1;
+    }
+
+    if (opts->start != -1 || opts->end != -1)
+	clip_range(r, opts->start, opts->end);
+
+    if (opts->skipx) {
+	skipx(r);
+    }
+
+    if (opts->noneg)
+	noneg(r);
+
+    if (opts->signed_trace)
+	signed_trace(r);
+
+    if (opts->subtract) {
+	int i;
+	for (i = 0; i < r->NPoints; i++) {
+	    r->traceA[i] = MAX(0, r->traceA[i] - opts->subtract);
+	    r->traceC[i] = MAX(0, r->traceC[i] - opts->subtract);
+	    r->traceG[i] = MAX(0, r->traceG[i] - opts->subtract);
+	    r->traceT[i] = MAX(0, r->traceT[i] - opts->subtract);
+	}
+    }
+
+    if (opts->sub_background) { 
+	/*
+	trace_freq(r->traceA, r->NPoints);	
+	trace_freq(r->traceC, r->NPoints);	
+	trace_freq(r->traceG, r->NPoints);	
+	trace_freq(r->traceT, r->NPoints);	
+	*/
+	subtract_background(r);
+	/*
+	separate_dyes(r, matrix);
+	trace_freq(r->traceA, r->NPoints);	
+	trace_freq(r->traceC, r->NPoints);	
+	trace_freq(r->traceG, r->NPoints);	
+	trace_freq(r->traceT, r->NPoints);
+	*/
+	reset_max_called_height(r);
+    }
+
+    if (opts->normalise) {
+	rescale_heights(r, opts->min_normalise);
+    }
+
+    if (opts->scale) {
+	rescale_trace(r, opts->scale);
+    }
+
+    if (opts->name)
+	r->ident = strdup(opts->name);
+    else if (0 == strcmp(outfname, "(stdout)"))
+	r->ident = strdup(infname);
+    else
+	r->ident = strdup(outfname);
+
+    if (opts->compress_mode != -1)
+	set_compression_method(opts->compress_mode);
+
+    if (0 != (mfwrite_reading(outfp, r, opts->out_format))) {
+	fprintf(stderr, "failed to write file %s\n", outfname);
+	read_deallocate(r);
+	return 1;
+    }
+
+    read_deallocate(r);
+    return 0;
+}
+
+
+void usage(void) {
+    puts("Usage: convert_trace [options] [informat outformat] < in > out");
+    puts("Or     convert_trace [options] -fofn file_of_filenames");
+    puts("\nOptions are:");
+    puts("    -in_format format         Format for input (defaults to any");
+    puts("    -out_format format        Format for output (default ztr)");
+    puts("    -fofn file_of_filenames   Get \"Input Output\" names from a fofn");
+    puts("    -passed fofn              Output fofn of passed names");  
+    puts("    -error errs               Redirect stderr to file \"errs\"");
+    puts("    -failed fofn              Output fofn of failed names");  
+    puts("    -name id                  ID line for experiment file output");
+    puts("    -subtract_background      Auto-subtracts the trace background");
+    puts("    -subtract amount          Subtracts a specified background amount");
+    puts("    -normalise                Normalises peak heights");
+    puts("    -min_normalise            Minimum trace amp for normalising");
+    puts("    -scale range              Downscales peaks to 0-range");
+    puts("    -compress mode            Compress file output (not if stdout)");
+    puts("    -abi_data counts          ABI DATA lanes to copy: eg 9,10,11,12");
+    puts("    -signed                   Apply global shift to avoid negative values");
+    puts("    -noneg                    Shift each channel independently to avoid -ve");
+    puts("    --                        Explicitly state end of options");
+    exit(1);
+}
+
+int main(int argc, char **argv) {
+    struct opts opts;
+
+    opts.in_format = TT_ANY;
+    opts.out_format = TT_ZTR;
+    opts.scale = 0;
+    opts.sub_background = 0;
+    opts.subtract = 0;
+    opts.normalise = 0;
+    opts.min_normalise = 100;
+    opts.name = NULL;
+    opts.compress_mode = -1;
+    opts.dots = 0;
+    opts.noneg = 0;
+    opts.signed_trace = 0;
+    opts.fofn = NULL;
+    opts.passed = NULL;
+    opts.failed = NULL;
+    opts.error = NULL;
+    opts.skipx = 0;
+    opts.start = -1;
+    opts.end = -1;
+    
+    for (argc--, argv++; argc > 0; argc--, argv++) {
+	if (**argv != '-')
+	    break;
+
+	if (strcmp(*argv, "-start") == 0) {
+	    opts.start = atoi(*++argv);
+	    argc--;
+
+	} else if (strcmp(*argv, "-end") == 0) {
+	    opts.end = atoi(*++argv);
+	    argc--;
+
+	} else if (strcmp(*argv, "-scale") == 0) {
+	    opts.scale = atoi(*++argv);
+	    argc--;
+
+	} else if (strcmp(*argv, "-fofn") == 0) {
+	    opts.fofn = *++argv;
+	    argc--;
+
+	} else if (strcmp(*argv, "-passed") == 0) {
+	    opts.passed = *++argv;
+	    argc--;
+
+	} else if (strcmp(*argv, "-failed") == 0) {
+	    opts.failed = *++argv;
+	    argc--;
+
+	} else if (strcmp(*argv, "-error") == 0) {
+	    opts.error = *++argv;
+	    argc--;
+
+	} else if (strcmp(*argv, "-subtract_background") == 0) {
+	    opts.sub_background = 1;
+
+	} else if (strcmp(*argv, "-subtract") == 0) {
+	    opts.subtract = atoi(*++argv);
+	    argc--;
+
+	} else if (strcmp(*argv, "-normalise") == 0) {
+	    opts.normalise = 1;
+
+	} else if (strcmp(*argv, "-min_normalise") == 0) {
+	    opts.min_normalise = atoi(*++argv);
+	    argc--;
+
+	} else if (strcmp(*argv, "-dots") == 0) {
+	    opts.dots = 1;
+
+	} else if (strcmp(*argv, "-noneg") == 0) {
+	    opts.noneg = 1;
+
+	} else if (strcmp(*argv, "-signed") == 0) {
+	    opts.signed_trace = 1;
+
+	} else if (strcmp(*argv, "-skipx") == 0) {
+	    opts.skipx = 1;
+
+	} else if (strcmp(*argv, "-in_format") == 0) {
+	    argv++;
+	    argc--;
+	    if (TT_UNK == (opts.in_format = trace_type_str2int(*argv)))
+		opts.in_format = atoi(*argv);
+
+	} else if (strcmp(*argv, "-name") == 0) {
+	    opts.name = *++argv;
+	    argc--;
+
+	} else if (strcmp(*argv, "-out_format") == 0) {
+	    argv++;
+	    argc--;
+	    if (TT_UNK == (opts.out_format = trace_type_str2int(*argv)))
+		opts.out_format = atoi(*argv);
+
+	} else if (strcmp(*argv, "-compress") == 0) {
+	    opts.compress_mode = compress_str2int(*++argv);
+	    argc--;
+
+	} else if (strcmp(*argv, "-abi_data") == 0) {
+	    int c1, c2, c3, c4;
+	    argc--;
+	    if (4 == sscanf(*++argv, "%d,%d,%d,%d", &c1, &c2, &c3, &c4)) {
+		abi_set_data_counts(c1, c2, c3, c4);
+	    } else {
+		usage();
+	    }
+
+	} else if (strcmp(*argv, "--") == 0) {
+	    break;
+
+	} else {
+	    usage();
+	}
+    }
+
+    if (argc == 2) {
+	/* Old syntax, for backwards compatibility */
+
+	if (TT_UNK == (opts.in_format = trace_type_str2int(argv[0])))
+	    opts.in_format = atoi(argv[0]);
+	if (TT_UNK == (opts.out_format = trace_type_str2int(argv[1])))
+	    opts.out_format = atoi(argv[1]);
+    } else if (argc != 0) {
+	usage();
+    }
+
+
+    /*
+     * Added by SAK: Allow redirection of error output to file, due to
+     * problems with Java exec
+     */
+    if (NULL != opts.error) {
+	int fd;
+
+	fprintf(stderr,"* Redirecting stderr to %s\n", opts.error);
+
+	close(2); /* close fd with stderr */
+	if (-1 == (fd = creat(opts.error, 0666))) {
+	    exit(1);
+	}
+    }
+
+    if (!opts.fofn) {
+	return convert(mstdin(), mstdout(), "(stdin)", "(stdout)", &opts);
+    }
+
+    /* else */ {
+	mFILE *fpin, *fpout;
+	FILE *fppassed = NULL, *fpfailed = NULL;
+	char *infname, *outfname;
+	int ret, ret_all = 0;
+	char line[8192], line2[8192];
+
+	FILE *fofn_fp;
+
+	if (NULL == (fofn_fp = fopen(opts.fofn, "r"))) {
+	    perror(opts.fofn);
+	    return -1;
+	}
+
+	if (opts.passed && NULL == (fppassed = fopen(opts.passed, "w"))) {
+	    perror(opts.passed);
+	    return -1;
+	}
+
+	if (opts.failed && NULL == (fpfailed = fopen(opts.failed, "w"))) {
+	    perror(opts.failed);
+	    return -1;
+	}
+
+	while (fgets(line, 8192, fofn_fp) != NULL) {
+	    int i, j, len;
+	    
+	    /* Find input and output name, escaping spaces as needed */
+	    len = strlen(line);
+	    outfname = NULL;
+	    for (i = j = 0; i < len; i++) {
+		if (line[i] == '\\' && i != len-1) {
+		    line2[j++] = line[++i];
+		} else if (line[i] == ' ') {
+		    line2[j++] = 0;
+		    outfname = &line2[j];
+		} else if (line[i] != '\n') {
+		    line2[j++] = line[i];
+		}
+	    }
+	    line2[j] = 0;
+	    infname = line2;
+
+	    /* Don't clobber input */
+	    if (!strcmp(infname, outfname)) {
+		fprintf(stderr,"* Inputfn %s == Outputfn %s ...skipping\n",
+			infname, outfname);
+		if (fpfailed)
+		    fprintf(fpfailed, "%s\n", infname);
+		continue;
+	    }
+
+	    /* Open input and output files */
+	    if (opts.in_format == TT_EXP) {
+		fpin = open_exp_mfile(infname, NULL);
+	    } else {
+		fpin = open_trace_mfile(infname, NULL);
+	    }
+	    if (NULL == fpin) {
+		char buf[2048];
+		sprintf(buf, "ERROR %s", infname);
+		perror(buf);
+		if (opts.dots) {
+		    fputc('!', stdout);
+		    fflush(stdout);
+		}
+		if (fpfailed)
+		    fprintf(fpfailed, "%s\n", infname);
+		continue;
+	    }
+
+	    if (outfname) {
+		if (NULL == (fpout = mfopen(outfname, "wb+"))) {
+		    char buf[2048];
+		    sprintf(buf, "ERROR %s", outfname);
+		    perror(buf);
+		    mfclose(fpin);
+		    if (opts.dots) {
+			fputc('!', stdout);
+			fflush(stdout);
+		    }
+		    if (fpfailed)
+			fprintf(fpfailed, "%s\n", infname);
+		    continue;
+		}
+	    } else {
+		outfname = "(stdout)";
+		fpout = mstdout();
+	    }
+
+	    /* Convert */
+	    ret = convert(fpin, fpout, infname, outfname, &opts);
+	    ret_all |= ret;
+	    if (opts.dots) {
+		fputc(ret ? '!' : '.', stdout);
+		fflush(stdout);
+	    }
+	    if (ret) {
+		if (fpfailed)
+		    fprintf(fpfailed, "%s\n", infname);
+	    } else {
+		if (fppassed)
+		    fprintf(fppassed, "%s\n", infname);
+	    }
+
+	    /* Tidy up */
+	    mfclose(fpin);
+	    if (fpout != mstdout())
+		mfclose(fpout);
+	}
+
+	fclose(fofn_fp);
+
+	return ret_all;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/progs/extract_fastq.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,175 @@
+/*
+ * Copyright (c) Medical Research Council 1994-1999. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
+#include <strings.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <io_lib/Read.h>
+#include <io_lib/traceType.h>
+#include <io_lib/expFileIO.h>
+#include <io_lib/open_trace_file.h>
+
+static int do_trans(mFILE *infp, char *in_file, FILE *outfp, int format) {
+    Read *r;
+    char *p = strrchr(in_file, '/');
+    int i;
+
+    read_sections(READ_BASES);
+    if (NULL == (r = mfread_reading(infp, in_file, format))) {
+	fprintf(stderr, "Failed to read file '%s'\n", in_file);
+	return 1;
+    }
+
+    if (NULL == p)
+	p = in_file;
+    else
+	p++;
+
+    fprintf(outfp, "@%s\n", p);
+    fprintf(outfp, "%.*s\n", r->NBases, r->base);
+    fprintf(outfp, "+%s\n", p);
+    for (i = 0; i < r->NBases; i++) {
+	int qual;
+	switch (r->base[i]) {
+	case 'A':
+	case 'a':
+	    qual = r->prob_A[i];
+	    break;
+	case 'C':
+	case 'c':
+	    qual = r->prob_C[i];
+	    break;
+	case 'G':
+	case 'g':
+	    qual = r->prob_G[i];
+	    break;
+	case 'T':
+	case 't':
+	    qual = r->prob_T[i];
+	    break;
+	default:
+	    qual = 0;
+	}
+	fputc(qual + 33, outfp);
+    }
+    fputc('\n', outfp);
+
+    read_deallocate(r);
+    fflush(outfp);
+
+    return 0;
+}
+
+static void usage(void) {
+    fprintf(stderr, "Usage: extract_fastq [-(abi|alf|scf|exp|pln)]\n"
+	    "                   [-output output_name] [-fofn fofn] [input_name] ...\n");
+    exit(1);
+}
+
+int main(int argc, char **argv) {
+    int from_stdin = 1;
+    mFILE *infp = mstdin();
+    FILE *outfp = stdout;
+    int format = TT_ANY;
+    int ret = 0;
+    char *fofn = NULL;
+
+    for (argc--, argv++; argc > 0; argc--, argv++) {
+	if (strcasecmp(*argv, "-abi") == 0) {
+            format = TT_ABI;
+        } else if (strcasecmp(*argv, "-alf") == 0) {
+            format = TT_ALF;
+        } else if (strcasecmp(*argv, "-scf") == 0) {
+            format = TT_SCF;
+        } else if (strcasecmp(*argv, "-exp") == 0) {
+            format = TT_EXP;
+        } else if (strcasecmp(*argv, "-pln") == 0) {
+            format = TT_PLN;
+        } else if (strcasecmp(*argv, "-ztr") == 0) {
+            format = TT_ZTR;
+        } else if (strcasecmp(*argv, "-ctf") == 0) {
+            format = TT_CTF;
+	} else if (strcmp(*argv, "-fofn") == 0) {
+	    fofn = *++argv;
+	    argc--;
+	    from_stdin = 0;
+        } else if (strcasecmp(*argv, "-output") == 0) {
+	    if (NULL == (outfp = fopen(*++argv, "wb"))) {
+		perror(*argv);
+		return 1;
+	    }
+            argc--;
+	} else if (**argv != '-') {
+	    from_stdin = 0;
+	    break;
+        } else {
+            usage();
+        }
+    }
+
+    if (!from_stdin) {
+	if (fofn) {
+	    FILE *fofn_fp;
+	    char line[8192];
+
+	    if (strcmp(fofn, "stdin") == 0)
+		fofn_fp = stdin;
+	    else
+		fofn_fp = fopen(fofn, "r");
+
+	    if (fofn_fp) {
+		while (fgets(line, 8192, fofn_fp) != NULL) {
+		    char *cp;
+		    if (cp = strchr(line, '\n'))
+			*cp = 0;
+		    if (format == TT_EXP) {
+			infp = open_exp_mfile(line, NULL);
+		    } else {
+			infp = open_trace_mfile(line, NULL);
+		    }
+		    if (NULL == infp) {
+			perror(line);
+			ret = 1;
+		    } else {
+			ret |= do_trans(infp, line, outfp, format);
+			mfclose(infp);
+		    }
+		}
+		fclose(fofn_fp);
+	    }
+	}
+	for (;argc > 0; argc--, argv++) {
+	    if (format == TT_EXP) {
+		infp = open_exp_mfile(*argv, NULL);
+	    } else {
+		infp = open_trace_mfile(*argv, NULL);
+	    }
+	    if (NULL == infp) {
+		perror(*argv);
+		ret = 1;
+	    } else {
+		ret |= do_trans(infp, *argv, outfp, format);
+		mfclose(infp);
+	    }
+	}
+    } else {
+	ret = do_trans(infp, "<stdin>", outfp, format);
+    }
+
+    return ret;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/progs/extract_qual.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,354 @@
+/*
+ * Copyright (c) Medical Research Council 1994-1999. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
+#include <strings.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <io_lib/Read.h>
+#include <io_lib/traceType.h>
+#include <io_lib/expFileIO.h>
+#include <io_lib/open_trace_file.h>
+#include <io_lib/xalloc.h>
+
+/* #include "stdio_hack.h" */
+
+#define LINE_LENGTH 60
+
+/*
+ * Converts the confidence array to the accuracy value string (AV).
+ *
+ * Note no memory overrun checks are performed on buf. It is recommended
+ * that it is allocated to 4*len (worst case of "100 " for each base).
+ *
+ * Returns the buf argument.
+ */
+static char *my_conf2str(int1 *conf, int len, char *buf) {
+    int i;
+    char *ret = buf, *rs = buf;
+
+    for (i = 0; i < len; i++) {
+	sprintf(buf, "%d ", conf[i]);
+	buf += strlen(buf);
+
+	if (buf - rs > LINE_LENGTH) {
+	    *buf++ = '\n';
+	    *buf = '\0';
+	    rs = buf;
+	}
+    }
+
+    return ret;
+}
+
+static int do_trans(mFILE *infp, char *in_file, FILE *outfp, int format,
+		    int good_only, int clip_cosmid, int fasta_out) {
+    Read *r;
+    char *tmp_prob_A, *tmp_prob_C, *tmp_prob_G, *tmp_prob_T;
+    char *cstr = NULL;
+
+    read_sections(READ_BASES);
+    if (NULL == (r = mfread_reading(infp, in_file, format))) {
+	fprintf(stderr, "Failed to read file '%s'\n", in_file);
+	return 1;
+    }
+
+    tmp_prob_A = r->prob_A;
+    tmp_prob_C = r->prob_C;
+    tmp_prob_G = r->prob_G;
+    tmp_prob_T = r->prob_T;
+
+#ifdef IOLIB_EXP
+    if (good_only && r->orig_trace_format == TT_EXP) {
+	int left=0, right=r->NBases + 1, val, lval, rval;
+	Exp_info *e = (Exp_info *)r->orig_trace;
+
+	if (0 == exp_get_int(e, EFLT_SL, &val))
+	    if (val > left)
+		left = val;
+	if (0 == exp_get_int(e, EFLT_QL, &val))
+	    if (val > left)
+		left = val;
+
+	if (0 == exp_get_int(e, EFLT_SR, &val))
+	    if (val < right)
+		right = val;
+	if (0 == exp_get_int(e, EFLT_QR, &val))
+	    if (val < right)
+		right = val;
+
+	/* This is horrid - see gap seqInfo.c file for explaination */
+	if (clip_cosmid) {
+	    int got_cosmid;
+
+	    if (0 == exp_get_rng(e, EFLT_CS, &lval, &rval)) {
+		got_cosmid = 1;
+	    } else if (0 == exp_get_int(e, EFLT_CL, &lval) &&
+		       0 == exp_get_int(e, EFLT_CR, &rval)) {
+		got_cosmid = 1;
+	    } else {
+		got_cosmid = 0;
+	    }
+	
+	    if (got_cosmid) {
+		if      (lval <= left   && rval <= left)    ;
+		else if (lval <= left+1 && rval <  right)   left  = rval;
+		else if (lval <= left+1 && rval >= right)   right = left+1;
+		else if (lval <  right  && rval <  right)   right = lval;
+		else if (lval <  right  && rval >= right)   right = lval;
+	    }
+	}
+
+        r->prob_A += left;
+        r->prob_C += left;
+        r->prob_G += left;
+        r->prob_T += left;
+	r->NBases = right - left - 1;
+    } else
+#endif /* IOLIB_EXP */
+    if (good_only) {
+        r->prob_A += r->leftCutoff;
+        r->prob_C += r->leftCutoff;
+        r->prob_G += r->leftCutoff;
+        r->prob_T += r->leftCutoff;
+	r->NBases = r->rightCutoff - r->leftCutoff - 1;
+    }
+
+    /* Confidence values */
+    if (r->prob_A && r->prob_C && r->prob_G && r->prob_T &&
+	r->NBases > 0) {
+	int i;
+
+	/* We have some, but are they non zero values? */
+        for (i = 0; i < r->NBases; i++) {
+	    if (r->prob_A[i] || r->prob_C[i] ||
+		r->prob_G[i] || r->prob_T[i])
+		break;
+	}
+	if (i != r->NBases) {
+	    int1 *conf = (int1 *)xmalloc(r->NBases);
+	    cstr = (char *)xmalloc(r->NBases * 4 + 2);
+
+	    for (i = 0; i < r->NBases; i++) {
+		switch (r->base[i]) {
+		case 'a':
+		case 'A':
+		    conf[i] = r->prob_A[i];
+		    break;
+		case 'c':
+		case 'C':
+		    conf[i] = r->prob_C[i];
+		    break;
+		case 'g':
+		case 'G':
+		    conf[i] = r->prob_G[i];
+		    break;
+		case 't':
+		case 'T':
+		    conf[i] = r->prob_T[i];
+		    break;
+                case 'b':
+                case 'B':
+		    conf[i] = (r->prob_C[i] + r->prob_G[i] + r->prob_T[i]) / 3;
+                    break;
+                case 'd':
+                case 'D':
+		    conf[i] = (r->prob_A[i] + r->prob_G[i] + r->prob_T[i]) / 3;
+                    break;
+                case 'h':
+                case 'H':
+		    conf[i] = (r->prob_A[i] + r->prob_C[i] + r->prob_T[i]) / 3;
+                    break;
+                case 'v':
+                case 'V':
+		    conf[i] = (r->prob_A[i] + r->prob_C[i] + r->prob_G[i]) / 3;
+                    break;
+                case 'k':
+                case 'K':
+		    conf[i] = (r->prob_G[i] + r->prob_T[i]) / 2;
+                    break;
+                case 'm':
+                case 'M':
+		    conf[i] = (r->prob_A[i] + r->prob_C[i]) / 2;
+                    break;
+                case 'r':
+                case 'R':
+		    conf[i] = (r->prob_A[i] + r->prob_G[i]) / 2;
+                    break;
+                case 's':
+                case 'S':
+		    conf[i] = (r->prob_C[i] + r->prob_G[i]) / 2;
+                    break;
+                case 'w':
+                case 'W':
+		    conf[i] = (r->prob_A[i] + r->prob_T[i]) / 2;
+                    break;
+                case 'y':
+                case 'Y':
+		    conf[i] = (r->prob_C[i] + r->prob_T[i]) / 2;
+                    break;
+		default:
+		    conf[i] = (r->prob_A[i] + r->prob_C[i] + r->prob_G[i] + r->prob_T[i]) / 4;
+		}
+	    }
+
+	    my_conf2str(conf, r->NBases, cstr);
+	    xfree(conf);
+	}
+    }
+
+    if (fasta_out) {
+	char *p = strrchr(in_file, '/');
+	/* Add header */
+	if (NULL == p)
+	    p = in_file;
+	else
+	    p++;
+	fprintf(outfp, ">%s\n", p); 
+    }
+
+    if (cstr) {
+      fprintf(outfp,"%s\n", cstr);
+      xfree(cstr);
+    }
+
+    r->prob_A = tmp_prob_A;
+    r->prob_C = tmp_prob_C;
+    r->prob_G = tmp_prob_G;
+    r->prob_T = tmp_prob_T;
+    read_deallocate(r);
+    fflush(outfp);
+
+    return 0;
+}
+
+static void usage(void) {
+    fprintf(stderr, "Usage: extract_qual [-r] [-(abi|alf|scf|exp|pln|ctf|ztr)]\n"
+	    "                   [-good_only] [-clip_cosmid] [-fasta_out]\n"
+	    "                   [-output output_name] [input_name] ...\n");
+    exit(1);
+}
+
+int main(int argc, char **argv) {
+    int from_stdin = 1;
+    mFILE *infp = mstdin();
+    FILE *outfp = stdout;
+    int format = TT_ANY;
+    int redirect = 1;
+    int good_only = 0;
+    int clip_cosmid = 0;
+    int fasta_out = 0;
+    int ret = 0;
+    char *fofn = NULL;
+
+    for (argc--, argv++; argc > 0; argc--, argv++) {
+	if (strcmp(*argv, "-r") == 0) {
+	    redirect = 0;
+	} else if (strcasecmp(*argv, "-abi") == 0) {
+            format = TT_ABI;
+        } else if (strcasecmp(*argv, "-alf") == 0) {
+            format = TT_ALF;
+        } else if (strcasecmp(*argv, "-scf") == 0) {
+            format = TT_SCF;
+        } else if (strcasecmp(*argv, "-exp") == 0) {
+            format = TT_EXP;
+        } else if (strcasecmp(*argv, "-pln") == 0) {
+            format = TT_PLN;
+        } else if (strcasecmp(*argv, "-ztr") == 0) {
+            format = TT_ZTR;
+        } else if (strcasecmp(*argv, "-ctf") == 0) {
+            format = TT_CTF;
+        } else if (strcasecmp(*argv, "-good_only") == 0) {
+	    good_only = 1;
+        } else if (strcasecmp(*argv, "-clip_cosmid") == 0) {
+	    clip_cosmid = 1;
+	} else if (strcasecmp(*argv, "-fasta_out") == 0) {
+	    fasta_out = 1;
+	} else if (strcmp(*argv, "-fofn") == 0) {
+	    fofn = *++argv;
+	    argc--;
+	    from_stdin = 0;
+        } else if (strcasecmp(*argv, "-output") == 0) {
+	    if (NULL == (outfp = fopen(*++argv, "wb"))) {
+		perror(*argv);
+		return 1;
+	    }
+            argc--;
+	} else if (**argv != '-') {
+	    from_stdin = 0;
+	    break;
+        } else {
+            usage();
+        }
+    }
+
+    read_experiment_redirect(redirect);
+
+    if (!from_stdin) {
+	if (fofn) {
+	    FILE *fofn_fp;
+	    char line[8192];
+
+	    if (strcmp(fofn, "stdin") == 0)
+		fofn_fp = stdin;
+	    else
+		fofn_fp = fopen(fofn, "r");
+
+	    if (fofn_fp) {
+		while (fgets(line, 8192, fofn_fp) != NULL) {
+		    char *cp;
+		    if (cp = strchr(line, '\n'))
+			*cp = 0;
+		    if (format == TT_EXP) {
+			infp = open_exp_mfile(line, NULL);
+		    } else {
+			infp = open_trace_mfile(line, NULL);
+		    }
+		    if (NULL == infp) {
+			perror(line);
+			ret = 1;
+		    } else {
+			ret |= do_trans(infp, line, outfp, format, good_only,
+					clip_cosmid, fasta_out);
+			mfclose(infp);
+		    }
+		}
+		fclose(fofn_fp);
+	    }
+	}
+	for (;argc > 0; argc--, argv++) {
+	    if (format == TT_EXP) {
+		infp = open_exp_mfile(*argv, NULL);
+	    } else {
+		infp = open_trace_mfile(*argv, NULL);
+	    }
+	    if (NULL == infp) {
+		perror(*argv);
+		ret = 1;
+	    } else {
+		ret |= do_trans(infp, *argv, outfp, format, good_only,
+				clip_cosmid, fasta_out);
+		mfclose(infp);
+	    }
+	}
+    } else {
+	ret = do_trans(infp, "<stdin>", outfp, format, good_only, clip_cosmid,
+		       fasta_out);
+    }
+
+    return ret;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/progs/extract_seq.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,236 @@
+/*
+ * Copyright (c) Medical Research Council 1994-1999. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
+#include <strings.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <io_lib/Read.h>
+#include <io_lib/traceType.h>
+#include <io_lib/expFileIO.h>
+#include <io_lib/open_trace_file.h>
+
+/* #include "stdio_hack.h" */
+
+#define LINE_LENGTH 60
+
+static int do_trans(mFILE *infp, char *in_file, FILE *outfp, int format,
+		    int good_only, int clip_cosmid, int fasta_out) {
+    Read *r;
+    char *tmp_base;
+
+    read_sections(READ_BASES);
+    if (NULL == (r = mfread_reading(infp, in_file, format))) {
+	fprintf(stderr, "Failed to read file '%s'\n", in_file);
+	return 1;
+    }
+
+    tmp_base = r->base;
+
+#ifdef IOLIB_EXP
+    if (good_only && r->orig_trace_format == TT_EXP) {
+	int left=0, right=r->NBases + 1, val, lval, rval;
+	Exp_info *e = (Exp_info *)r->orig_trace;
+
+	if (0 == exp_get_int(e, EFLT_SL, &val))
+	    if (val > left)
+		left = val;
+	if (0 == exp_get_int(e, EFLT_QL, &val))
+	    if (val > left)
+		left = val;
+
+	if (0 == exp_get_int(e, EFLT_SR, &val))
+	    if (val < right)
+		right = val;
+	if (0 == exp_get_int(e, EFLT_QR, &val))
+	    if (val < right)
+		right = val;
+
+	/* This is horrid - see gap seqInfo.c file for explaination */
+	if (clip_cosmid) {
+	    int got_cosmid;
+
+	    if (0 == exp_get_rng(e, EFLT_CS, &lval, &rval)) {
+		got_cosmid = 1;
+	    } else if (0 == exp_get_int(e, EFLT_CL, &lval) &&
+		       0 == exp_get_int(e, EFLT_CR, &rval)) {
+		got_cosmid = 1;
+	    } else {
+		got_cosmid = 0;
+	    }
+	
+	    if (got_cosmid) {
+		if      (lval <= left   && rval <= left)    ;
+		else if (lval <= left+1 && rval <  right)   left  = rval;
+		else if (lval <= left+1 && rval >= right)   right = left+1;
+		else if (lval <  right  && rval <  right)   right = lval;
+		else if (lval <  right  && rval >= right)   right = lval;
+	    }
+	}
+
+	r->base += left;
+	r->NBases = right - left - 1;
+    } else
+#endif /* IOLIB_EXP */
+    if (good_only) {
+        r->base += r->leftCutoff;
+	r->NBases = r->rightCutoff - r->leftCutoff - 1;
+    }
+
+    if (fasta_out) {
+	char *p = strrchr(in_file, '/');
+	int i;
+
+	/* Add header */
+	if (NULL == p)
+	    p = in_file;
+	else
+	    p++;
+	fprintf(outfp, ">%s\n", p); 
+
+	/* Replace - with N */
+	for (i = 0; i < r->NBases; i++) {
+	    if (r->base[i] == '-')
+		r->base[i] = 'N';
+	}
+    }
+    set_compression_method(0); /* We don't want to gzip the output */
+    fwrite_reading(outfp, r, TT_PLN);
+
+    r->base = tmp_base;
+    read_deallocate(r);
+    fflush(outfp);
+
+    return 0;
+}
+
+static void usage(void) {
+    fprintf(stderr, "Usage: extract_seq [-r] [-(abi|alf|scf|exp|pln|ctf|ztr)]\n"
+	    "                   [-good_only] [-clip_cosmid] [-fasta_out]\n"
+	    "                   [-output output_name] [input_name] ...\n");
+    exit(1);
+}
+
+int main(int argc, char **argv) {
+    int from_stdin = 1;
+    mFILE *infp = mstdin();
+    FILE *outfp = stdout;
+    int format = TT_ANY;
+    int redirect = 1;
+    int good_only = 0;
+    int clip_cosmid = 0;
+    int fasta_out = 0;
+    int ret = 0;
+    char *fofn = NULL;
+
+    for (argc--, argv++; argc > 0; argc--, argv++) {
+	if (strcmp(*argv, "-r") == 0) {
+	    redirect = 0;
+	} else if (strcasecmp(*argv, "-abi") == 0) {
+            format = TT_ABI;
+        } else if (strcasecmp(*argv, "-alf") == 0) {
+            format = TT_ALF;
+        } else if (strcasecmp(*argv, "-scf") == 0) {
+            format = TT_SCF;
+        } else if (strcasecmp(*argv, "-exp") == 0) {
+            format = TT_EXP;
+        } else if (strcasecmp(*argv, "-pln") == 0) {
+            format = TT_PLN;
+        } else if (strcasecmp(*argv, "-ztr") == 0) {
+            format = TT_ZTR;
+        } else if (strcasecmp(*argv, "-ctf") == 0) {
+            format = TT_CTF;
+        } else if (strcasecmp(*argv, "-good_only") == 0) {
+	    good_only = 1;
+        } else if (strcasecmp(*argv, "-clip_cosmid") == 0) {
+	    clip_cosmid = 1;
+	} else if (strcasecmp(*argv, "-fasta_out") == 0) {
+	    fasta_out = 1;
+	} else if (strcmp(*argv, "-fofn") == 0) {
+	    fofn = *++argv;
+	    argc--;
+	    from_stdin = 0;
+        } else if (strcasecmp(*argv, "-output") == 0) {
+	    if (NULL == (outfp = fopen(*++argv, "wb"))) {
+		perror(*argv);
+		return 1;
+	    }
+            argc--;
+	} else if (**argv != '-') {
+	    from_stdin = 0;
+	    break;
+        } else {
+            usage();
+        }
+    }
+
+    read_experiment_redirect(redirect);
+
+    if (!from_stdin) {
+	if (fofn) {
+	    FILE *fofn_fp;
+	    char line[8192];
+
+	    if (strcmp(fofn, "stdin") == 0)
+		fofn_fp = stdin;
+	    else
+		fofn_fp = fopen(fofn, "r");
+
+	    if (fofn_fp) {
+		while (fgets(line, 8192, fofn_fp) != NULL) {
+		    char *cp;
+		    if (cp = strchr(line, '\n'))
+			*cp = 0;
+		    if (format == TT_EXP) {
+			infp = open_exp_mfile(line, NULL);
+		    } else {
+			infp = open_trace_mfile(line, NULL);
+		    }
+		    if (NULL == infp) {
+			perror(line);
+			ret = 1;
+		    } else {
+			ret |= do_trans(infp, line, outfp, format, good_only,
+					clip_cosmid, fasta_out);
+			mfclose(infp);
+		    }
+		}
+		fclose(fofn_fp);
+	    }
+	}
+	for (;argc > 0; argc--, argv++) {
+	    if (format == TT_EXP) {
+		infp = open_exp_mfile(*argv, NULL);
+	    } else {
+		infp = open_trace_mfile(*argv, NULL);
+	    }
+	    if (NULL == infp) {
+		perror(*argv);
+		ret = 1;
+	    } else {
+		ret |= do_trans(infp, *argv, outfp, format, good_only,
+				clip_cosmid, fasta_out);
+		mfclose(infp);
+	    }
+	}
+    } else {
+	ret = do_trans(infp, "<stdin>", outfp, format, good_only, clip_cosmid,
+		       fasta_out);
+    }
+
+    return ret;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/progs/get_comment.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,158 @@
+/*
+ * Fetches all or several specific comment(s) from a trace file TEXT section.
+ *
+ * Usage:
+ *	get_comment [options] [field ...] < infile
+ *
+ * Options:
+ *	-c	Suppresses display of field-ID
+ *	-h	Help
+ *
+ * Return codes:
+ *	0	Success
+ *	1	At least one field was not found
+ *	2	Failed to read file, or usage message displayed
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <io_lib/Read.h>
+
+/* Nasty Microsoft bits */
+#ifdef _MSC_VER
+#  define DLL_IMPORT __declspec(dllimport)
+#else
+#  define DLL_IMPORT
+#endif
+
+/*
+ * From unistd.h
+extern DLL_IMPORT char *optarg;
+extern DLL_IMPORT int optind;
+*/
+
+void usage(void) {
+    puts("Usage:");
+    puts("    get_comment [options] [field ...] < infile");
+    puts("\nOptions:");
+    puts("    -c	Suppresses display of field-ID");
+    puts("    -h	Help");
+    puts("\nReturn codes:");
+    puts("    0	Success");
+    puts("    1	At least one field was not found");
+    puts("    2	Failed to read file, or usage message displayed");
+    exit(2);
+}
+
+int main(int argc, char **argv) {
+    Read *r;
+    char *ident, *value;
+    int ident_len, value_len;
+    enum state_t {
+	NAME, EQUALS, VALUE, NL
+    } state;
+    size_t len;
+    int i, j, found;
+    int suppress = 0;
+    int *found_args = NULL;
+
+    /* Parse arguments */
+    for (argc--, argv++; argc > 0; argc--, argv++) {
+	if (**argv != '-')
+	    break;
+
+	if (strcmp(*argv, "-c") == 0) {
+	    suppress = 1;
+
+	} else {
+	    usage();
+	}
+    }
+
+    /* Read the file */
+    read_sections(READ_COMMENTS);
+    if (NULL == (r = fread_reading(stdin, "(stdin)", TT_ANY))) {
+	fprintf(stderr, "failed to read trace from stdin\n");
+	return 2;
+    }
+
+    if (!r->info)
+	return 1;
+
+    if (argc == 0) {
+	/* Display all of them */
+	puts(r->info);
+
+    } else {
+	/* Display only the ones listed on the command line */
+
+	found_args = (int *)calloc(argc, sizeof(int));
+
+	len = strlen(r->info);
+	state = NAME;
+	ident = r->info;
+	found = 0;
+	/* Not needed, but avoids "might be used uninitialized" message */
+	value = NULL;
+	ident_len = value_len = 0;
+	for (i = 0; i <= len; i++) {
+	    switch (state) {
+	    case NAME:
+		if (r->info[i] == '=') {
+		    state = EQUALS;
+		    ident_len = &r->info[i] - ident;
+		    value_len = 0;
+		}
+		break;
+
+	    case EQUALS:
+		for (j = 0; j < argc; j++) {
+		    if (strncmp(ident, argv[j], ident_len) == 0) {
+			found = 1;
+			found_args[j] = 1;
+		    }
+		}
+		state = VALUE;
+		value = &r->info[i];
+
+		/* DELIBERATE FLOW THROUGH */
+
+	    case VALUE:
+		if (r->info[i] == '\n' || r->info[i] == 0) {
+		    value_len = &r->info[i] - value;
+		    state = NL;
+		}
+		break;
+
+	    case NL:
+		if (found) {
+		    if (suppress) {
+			printf("%.*s\n",
+			       value_len, value);
+		    } else {
+			printf("%.*s=%.*s\n",
+			       ident_len, ident, value_len, value);
+		    }
+		}
+		state = NAME;
+		ident = &r->info[i];
+		found = 0;
+		break;
+	    }
+	}
+    }
+    
+    read_deallocate(r);
+
+    if (found_args) {
+	for (j = 0; j < argc; j++) {
+	    if (found_args[j] == 0)
+		return 1;
+	}
+    }
+
+    return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/progs/hash_extract.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,89 @@
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <io_lib/hash_table.h>
+
+/*
+ * Copies a single named file to stdout.
+ * Returns 0 on success
+ *         1 on failure
+ */
+int extract(HashFile *hf, char *file) {
+    size_t len;
+    char *data;
+
+    if (data = HashFileExtract(hf, file, &len)) {
+	fwrite(data, len, 1, stdout);
+	free(data);
+	return 0;
+    }
+    return 1;
+}
+
+int main(int argc, char **argv) {
+    char *fofn = NULL;
+    char *hash;
+    HashFile *hf;
+    int ret = 0;
+
+    /* process command line arguments of the form -arg */
+    for (argc--, argv++; argc > 0; argc--, argv++) {
+	if (**argv != '-' || strcmp(*argv, "--") == 0)
+	    break;
+
+	if (strcmp(*argv, "-I") == 0) {
+	    argv++;
+	    fofn = *argv;
+	    argc--;
+	}
+    }
+
+    if (argc < 2 && !fofn) {
+	fprintf(stderr, "Usage: hash_extract [-I fofn] hashfile [name ...]\n");
+	return 1;
+    }
+    hash = argv[0];
+    argc--;
+    argv++;
+
+    if (NULL == (hf = HashFileOpen(hash))) {
+	perror(hash);
+	return 1;
+    }
+
+    if (fofn) {
+	FILE *fofnfp;
+	char file[256];
+
+	if (strcmp(fofn, "-") == 0) {
+	    fofnfp = stdin;
+	} else {
+	    if (NULL == (fofnfp = fopen(fofn, "r"))) {
+		perror(fofn);
+		return 1;
+	    }
+	}
+
+	while (fgets(file, 255, fofnfp)) {
+	    char *c;
+	    if (c = strchr(file, '\n'))
+		*c = 0;
+
+	    ret |= extract(hf, file);
+	}
+
+	fclose(fofnfp);
+    }
+
+#ifdef _WIN32
+    _setmode(_fileno(stdout), _O_BINARY);
+#endif
+    for (; argc; argc--, argv++) {
+	ret |= extract(hf, *argv);
+    }
+
+    HashFileDestroy(hf);
+
+    return ret;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/progs/hash_list.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,67 @@
+#ifdef HAVE_CONFIG_H
+#include "io_lib_config.h"
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <io_lib/hash_table.h>
+#include <io_lib/os.h>
+
+/*
+ * Dumps a textual represenation of the hash table to stdout.
+ */
+void HashTableLongDump(HashTable *h, FILE *fp, int long_format) {
+    int i;
+    for (i = 0; i < h->nbuckets; i++) {
+	HashItem *hi;
+	for (hi = h->bucket[i]; hi; hi = hi->next) {
+	    HashFileItem *hfi;
+	    hfi = (HashFileItem *)hi->data.p;
+	    if (long_format)
+		fprintf(fp, "%10"PRId64" %6"PRId32" %.*s\n",
+			hfi->pos, hfi->size, hi->key_len, hi->key);
+		/*
+		fprintf(fp, "%10ld %6d %.*s\n",
+			hfi->pos, hfi->size, hi->key_len, hi->key);
+		*/
+	    else
+		fprintf(fp, "%.*s\n", hi->key_len, hi->key);
+	}
+    }
+}
+
+
+/*
+ * Lists the contents of a .hash file
+ */
+int main(int argc, char **argv) {
+    FILE *fp;
+    HashFile *hf;
+    int long_format = 0;
+
+    /* process command line arguments of the form -arg */
+    if (argc >= 2 && strcmp(argv[1], "-l") == 0) {
+	long_format = 1;
+	argc--;
+	argv++;
+    }
+    if (argc >= 2) {
+	fp = fopen(argv[1], "rb");
+	if (NULL == fp) {
+	    perror(argv[1]);
+	    return 1;
+	}
+    } else {
+	fp = stdin;
+    }
+
+    hf = HashFileLoad(fp);
+    if (hf) {
+	HashTableLongDump(hf->h, stdout, long_format);
+	HashFileDestroy(hf);
+    }
+
+    return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/progs/hash_sff.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,262 @@
+/*
+ * This adds a hash table index (".hsh" v1.00 format) to an SFF archive.
+ * It does this either inline on the file itself (provided it doesn't already
+ * have an index) or by producing a new indexed SFF archive.
+ *
+ * It has been coded to require only the memory needed to store the index
+ * and so does quite a lot of I/O but with minimised memory. For a 460,000
+ * SFF archive it took about 22 seconds real time on a 1.7GHz P4 when copying
+ * or 10 seconds when updating inline.
+ */
+
+/* ---------------------------------------------------------------------- */
+
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <io_lib/hash_table.h>
+#include <io_lib/sff.h>
+#include <io_lib/os.h>
+#include <io_lib/mFILE.h>
+
+/*
+ * Override the sff.c functions to use FILE pointers instead. This means
+ * we don't have to load the entire archive into memory, which is optimal when
+ * dealing with a single file (ie in sff/sff.c), but not when indexing it.
+ *
+ * Done with minimal error checking I'll admit...
+ */
+static sff_read_header *fread_sff_read_header(FILE *fp) {
+    sff_read_header *h;
+    unsigned char rhdr[16];
+
+    if (16 != fread(rhdr, 1, 16, fp))
+	return NULL;
+    h = decode_sff_read_header(rhdr);
+
+    if (h->name_len != fread(h->name, 1, h->name_len, fp))
+	return free_sff_read_header(h), NULL;
+    
+    /* Pad to 8 chars */
+    fseek(fp, (ftell(fp) + 7)& ~7, SEEK_SET);
+
+    return h;
+}
+
+static sff_common_header *fread_sff_common_header(FILE *fp) {
+    sff_common_header *h;
+    unsigned char chdr[31];
+
+    if (31 != fread(chdr, 1, 31, fp))
+	return NULL;
+    h = decode_sff_common_header(chdr);
+    if (h->flow_len != fread(h->flow, 1, h->flow_len, fp))
+	return free_sff_common_header(h), NULL;
+    if (h->key_len != fread(h->key , 1, h->key_len,  fp))
+	return free_sff_common_header(h), NULL;
+
+    /* Pad to 8 chars */
+    fseek(fp, (ftell(fp) + 7)& ~7, SEEK_SET);
+
+    return h;
+}
+
+void usage(void) {
+    fprintf(stderr, "Usage: hash_sff [-o outfile] [-t] sff_file ...\n");
+    exit(1);
+}
+
+int main(int argc, char **argv) {
+    HashFile *hf;
+    sff_common_header *ch;
+    sff_read_header *rh;
+    int i, dot, arg;
+    char *sff;
+    char hdr[31];
+    uint64_t index_offset = 0;
+    uint32_t index_size, index_skipped;
+    FILE *fp, *fpout = NULL;
+    int copy_archive = 1;
+    
+
+    /* process command line arguments of the form -arg */
+    for (argc--, argv++; argc > 0; argc--, argv++) {
+	if (**argv != '-' || strcmp(*argv, "--") == 0)
+	    break;
+
+	if (strcmp(*argv, "-o") == 0 && argc > 1) {
+	    if (NULL == (fpout = fopen(argv[1], "wb+"))) {
+		perror(argv[1]);
+		return 1;
+	    }
+	    argv++;
+	    argc--;
+
+	} else if (strcmp(*argv, "-t") == 0) {
+	    copy_archive = 0;
+
+	} else if (**argv == '-') {
+	    usage();
+	}
+
+    }
+
+    if (argc < 1)
+	usage();
+
+    if (copy_archive == 0 && argc != 1) {
+	fprintf(stderr, "-t option only supported with a single sff argument\n");
+	return 1;
+    }
+
+    /* Create the hash table */
+    hf = HashFileCreate(0, HASH_DYNAMIC_SIZE);
+    hf->nheaders = 0;
+    hf->headers = NULL;
+
+    for (arg = 0; arg < argc; arg++) {
+	/* open (and read) the entire sff file */
+	sff = argv[arg];
+
+	printf("Indexing %s:\n", sff);
+	if (fpout) {
+	    if (NULL == (fp = fopen(sff, "rb"))) {
+		perror(sff);
+		return 1;
+	    }
+	} else { 
+	    if (NULL == (fp = fopen(sff, "rb+"))) {
+		perror(sff);
+		return 1;
+	    }
+	}
+
+	/* Read the common header */
+	ch = fread_sff_common_header(fp);
+
+	if (ch->index_len && !fpout) {
+	    fprintf(stderr, "Archive already contains index.\nReplacing the"
+		    " index requires the \"-o outfile\" option.\n");
+	    return 1;
+	}
+
+	/* Add the SFF common header as a hash file-header */
+	hf->nheaders++;
+	hf->headers = (HashFileSection *)realloc(hf->headers, hf->nheaders *
+						 sizeof(*hf->headers));
+	hf->headers[hf->nheaders-1].pos = 0;
+	hf->headers[hf->nheaders-1].size = ch->header_len;
+	hf->headers[hf->nheaders-1].cached_data = NULL;
+
+	/* Read the index items, adding to the hash */
+	index_skipped = 0;
+	dot = 0;
+	printf("                                                                       |\r|");
+	for (i = 0; i < ch->nreads; i++) {
+	    int dlen;
+	    uint32_t offset;
+	    HashData hd;
+	    HashFileItem *hfi;
+	    
+	    if (i >= dot * (ch->nreads/69)) {
+		putchar('.');
+		fflush(stdout);
+		dot++;
+	    }
+
+	    /* Skip old index if present */
+	    offset = ftell(fp);
+	    if (offset == ch->index_offset) {
+		fseek(fp, ch->index_len, SEEK_CUR);
+		index_skipped = ch->index_len;
+		continue;
+	    }
+
+	    hfi = (HashFileItem *)calloc(1, sizeof(*hfi));
+	    rh = fread_sff_read_header(fp);
+	    dlen = (2*ch->flow_len + 3*rh->nbases + 7) & ~7;
+	    fseek(fp, dlen, SEEK_CUR);
+	
+	    hfi->header = hf->nheaders;
+	    hfi->footer = 0;
+	    hfi->pos = offset - index_skipped;
+	    hfi->size = (ftell(fp) - index_skipped) - hfi->pos;
+	    hd.p = hfi;
+
+	    HashTableAdd(hf->h, rh->name, rh->name_len, hd, NULL);
+	}
+	printf("\n");
+	HashTableStats(hf->h, stdout);
+
+	index_offset = ftell(fp) - index_skipped;
+
+	/* Copy the archive if needed, minus the old index */
+	if (fpout && copy_archive) {
+	    char block[8192];
+	    size_t len;
+	    uint64_t pos = 0;
+
+	    printf("\nCopying archive\n");
+
+	    fseek(fp, 0, SEEK_SET);
+	    while (len = fread(block, 1, 8192, fp)) {
+		/* Skip previous index */
+		if (pos < ch->index_offset && pos+len > ch->index_offset) {
+		    len = ch->index_offset - pos;
+		    fseek(fp, ch->index_offset + ch->index_len, SEEK_SET);
+		}
+		if (len && len != fwrite(block, 1, len, fpout)) {
+		    fprintf(stderr, "Failed to output new archive\n");
+		    return 1;
+		}
+		pos += len;
+	    }
+	}
+	
+	if (!fpout) {
+	    /* Save the hash */
+	    printf("Saving index\n");
+	    fseek(fp, 0, SEEK_END);
+	    index_size = HashFileSave(hf, fp, 0);
+	    HashFileDestroy(hf);
+
+	    /* Update the common header */
+	    fseek(fp, 0, SEEK_SET);
+	    fread(hdr, 1, 31, fp);
+	    *(uint64_t *)(hdr+8)  = be_int8(index_offset);
+	    *(uint32_t *)(hdr+16) = be_int4(index_size);
+	    fseek(fp, 0, SEEK_SET);
+	    fwrite(hdr, 1, 31, fp);
+	}
+
+	fclose(fp);
+    }
+
+    if (fpout) {
+	/* Save the hash */
+	printf("Saving index\n");
+
+	if (!copy_archive) {
+	    hf->archive = strdup(argv[0]);
+	    index_offset = 0;
+	}
+
+	fseek(fpout, 0, SEEK_END);
+	index_size = HashFileSave(hf, fpout, 0);
+	HashFileDestroy(hf);
+
+	/* Update the common header to indicate index location */
+	if (copy_archive) {
+	    fseek(fpout, 0, SEEK_SET);
+	    fread(hdr, 1, 31, fpout);
+	    *(uint64_t *)(hdr+8)  = be_int8(index_offset);
+	    *(uint32_t *)(hdr+16) = be_int4(index_size);
+	    fseek(fpout, 0, SEEK_SET);
+	    fwrite(hdr, 1, 31, fpout);
+	}
+	fclose(fpout);
+    }
+    
+    return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/progs/hash_tar.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,272 @@
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <io_lib/tar_format.h>
+#include <io_lib/hash_table.h>
+
+typedef struct {
+    char member[256];
+    uint64_t pos;
+    uint32_t size;
+} tar_file;
+
+void seek_forward(FILE *fp, int size) {
+    if (fp != stdin) {
+	fseek(fp, size, SEEK_CUR);
+    } else {
+	/* Seeking on a pipe isn't supported, even for fwd seeks */
+	char buf[8192];
+	while (size) {
+	    size -= fread(buf, 1, size > 8192 ? 8192 : size, fp);
+	}
+    }
+}
+
+int main(int argc, char **argv) {
+    int directories = 0;
+    FILE *fp;
+    tar_block blk;
+    char member[256];
+    size_t size, extra;
+    int LongLink = 0;
+    size_t offset = 0;
+    int verbose = 0;
+    HashFile *hf;
+    tar_file *files = NULL;
+    int nfiles = 1024;
+    int fileno = 0;
+    int i;
+    char *header = NULL, *footer = NULL;
+    int found_header, found_footer;
+    int basename = 0;
+    char *archive = NULL;
+    int append_mode = 0;
+    int prepend_mode = 0;
+
+    files = (tar_file *)malloc(nfiles * sizeof(tar_file));
+
+    hf = HashFileCreate(0, HASH_DYNAMIC_SIZE);
+
+    /* process command line arguments of the form -arg */
+    for (argc--, argv++; argc > 0; argc--, argv++) {
+	if (**argv != '-' || strcmp(*argv, "--") == 0)
+	    break;
+
+	if (strcmp(*argv, "-a") == 0 && argc > 1) {
+	    archive = argv[1];
+	    argv++;
+	    argc--;
+	}
+
+	if (strcmp(*argv, "-A") == 0)
+	    append_mode = 1;
+
+	if (strcmp(*argv, "-O") == 0)
+	    prepend_mode = 1;
+
+	if (strcmp(*argv, "-d") == 0)
+	    directories = 1;
+
+	if (strcmp(*argv, "-v") == 0)
+	    verbose = 1;
+
+	if (strcmp(*argv, "-b") == 0)
+	    basename = 1;
+
+	if (strcmp(*argv, "-h") == 0 && argc > 1) {
+	    /* Common header */
+	    hf->headers = (HashFileSection *)
+		realloc(hf->headers, (hf->nheaders+1) *
+			sizeof(HashFileSection));
+	    header = argv[1];
+	    hf->nheaders++;
+	    argv++;
+	    argc--;
+	}
+
+	if (strcmp(*argv, "-f") == 0 && argc > 1) {
+	    /* Common footer */
+	    hf->footers = (HashFileSection *)
+		realloc(hf->footers, (hf->nfooters+1) *
+			sizeof(HashFileSection));
+	    footer = argv[1];
+	    hf->nfooters++;
+	    argv++;
+	    argc--;
+	}
+    }
+
+    if (argc != 1 && !archive) {
+	fprintf(stderr, "Usage: hash_tar [options] [tarfile] > tarfile.hash\n");
+	fprintf(stderr, "    -a fname  Tar archive filename: use if reading from stdin\n");
+	fprintf(stderr, "    -A        Force no archive name (eg will concat to archive itself)\n");
+	fprintf(stderr, "    -O        Set arc. offset to size of hash (use when prepending)\n");
+	fprintf(stderr, "    -v        Verbose mode\n");
+	fprintf(stderr, "    -d        Index directory names (useless?)\n");
+	fprintf(stderr, "    -h name   Set tar entry 'name' to be a file header\n");
+	fprintf(stderr, "    -f name   Set tar entry 'name' to be a file footer\n");
+	fprintf(stderr, "    -b        Use only the filename portion of a pathname\n");
+	return 1;
+    }
+
+    /* open the tarfile */
+    if (argc >= 1) {
+	archive = argv[0];
+	if (NULL == (fp = fopen(archive, "rb"))) {
+	    perror(archive);
+	    return 1;
+	}
+    } else {
+	fp = stdin;
+	if (!archive) {
+	    fprintf(stderr, "If reading from stdin you must use the "
+		    "\"-a archivename\" option\n");
+	    return 1;
+	}
+    }
+
+    /* Fill out the files[] array with the offsets, size and names */
+    while(fread(&blk, sizeof(blk), 1, fp) == 1) {
+	/*
+	 * If a directory is too large to fit in the name (>100) but short
+	 * enough to fit in the prefix the name field will be empty, this is
+	 * not the cas for ordinary files where the name field is always
+	 * non-empty
+	 */
+	if (!blk.header.name[0] && !blk.header.prefix[0])
+	    break;
+
+        /* get size of member, rounded to a multiple of TBLOCK */
+	size = strtoul(blk.header.size, NULL, 8);
+        extra = TBLOCK*((size+TBLOCK-1)/TBLOCK) - size;
+
+        /* skip directories unless requested */
+        if (directories || blk.header.typeflag != DIRTYPE) {
+
+            /*
+	     * extract member name (prefix + name), unless last member
+	     * was ././@LongLink
+	     */
+            if (LongLink == 0) {
+                (void) strncpy(member, blk.header.prefix, 155);
+	        if (strlen(blk.header.prefix) > 0 && blk.header.name[0])
+		    (void) strcat(member, "/");
+    	        (void) strncat(member, blk.header.name, 100);
+            }
+            
+            /* account for gtar ././@LongLink */
+            if (strcmp(member, "././@LongLink") == 0) {
+                /* still expect filenames to fit into 256 bytes */
+                if (size > 256) {
+                    fread(member, 1, size > 256 ? 256 : size, fp);
+                    fprintf(stderr,"././@LongLink too long size=%ld\n",
+			    (long)size);
+                    fprintf(stderr,"%s...\n", member);
+                    exit(1);
+                }
+                /*
+		 * extract full name of next member then rewind to start
+		 * of header
+		 */
+                fread(member, 1, size > 256 ? 256 : size, fp);
+                fseek(fp, -size, SEEK_CUR);
+                LongLink = 1;
+            } else {
+                /* output offset, member name */
+                /* printf("%lu %.256s\n", (long)offset, member); */
+                LongLink = 0;
+
+		if (fileno >= nfiles) {
+		    nfiles *= 2;
+		    files = (tar_file *)realloc(files,nfiles*sizeof(tar_file));
+		}
+		if (basename) {
+		    char *cp = strrchr(member, '/');
+		    strcpy(files[fileno].member, cp ? cp+1 : member);
+		} else {
+		    strcpy(files[fileno].member, member);
+		}
+		files[fileno].pos = offset+sizeof(blk);
+		files[fileno].size = size;
+		if (verbose)
+		    fprintf(stderr, "File %d: pos %010ld+%06d: %s\n",
+			    fileno,
+			    (long)files[fileno].pos,
+			    files[fileno].size,
+			    files[fileno].member);
+
+		fileno++;
+            }
+        }
+
+        /* increment offset */
+        size += extra;
+	seek_forward(fp, size);
+        offset += sizeof(blk) + size;
+    }
+   
+    /*
+     * Find the header/footer if specified. For now we only support one of
+     * each.
+     */
+    found_header = found_footer = 0;
+    for (i = 0; i < fileno; i++) {
+	if (header && strncmp(header, files[i].member, 256) == 0) {
+	    hf->headers[0].pos  = files[i].pos;
+	    hf->headers[0].size = files[i].size;
+	    hf->headers[0].cached_data = NULL;
+	    found_header++;
+	}
+	if (footer && strncmp(footer, files[i].member, 256) == 0) {
+	    hf->footers[0].pos  = files[i].pos;
+	    hf->footers[0].size = files[i].size;
+	    hf->footers[0].cached_data = NULL;
+	    found_footer++;
+	}
+    }
+    if (header && !found_header) {
+	fprintf(stderr, "Warning: could not find header '%s' in file\n",
+		header);
+	hf->nheaders = 0;
+    }
+    if (footer && !found_footer) {
+	fprintf(stderr, "Warning: could not find footer '%s' in file\n",
+		footer);
+	hf->nfooters = 0;
+    }
+
+    /*
+     * Construct the hash
+     */
+    for (i = 0; i < fileno; i++) {
+	HashData hd;
+	HashFileItem *hfi = (HashFileItem *)calloc(1, sizeof(*hfi));
+
+	/* Just use the last head/foot defined as we only allow 1 at the mo. */
+	hfi->header = hf->nheaders;
+	hfi->footer = hf->nfooters;
+	hfi->pos = files[i].pos;
+	hfi->size = files[i].size;
+	hd.p = hfi;
+	HashTableAdd(hf->h, files[i].member, strlen(files[i].member),
+		     hd, NULL);
+    }
+
+    fclose(fp);
+   
+    HashTableStats(hf->h, stderr);
+    if (!append_mode)
+	hf->archive = strdup(archive);
+	
+#ifdef _WIN32
+    _setmode(_fileno(stdout), _O_BINARY);
+#endif
+    HashFileSave(hf, stdout, prepend_mode ? HASHFILE_PREPEND : 0);
+    HashFileDestroy(hf);
+
+    free(files);
+
+    return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/progs/index_tar.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,96 @@
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <io_lib/tar_format.h>
+
+int main(int argc, char **argv) {
+    int directories = 0;
+    FILE *fp;
+    tar_block blk;
+    char member[256];
+    size_t size, extra;
+    int LongLink = 0;
+    size_t offset = 0;
+    
+    /* process command line arguments of the form -arg */
+    for (argc--, argv++; argc > 0; argc--, argv++) {
+	if (**argv != '-' || strcmp(*argv, "--") == 0)
+	    break;
+
+	if (strcmp(*argv, "-d") == 0)
+	    directories = 1;
+    }
+
+    if (argc != 1) {
+	fprintf(stderr, "Usage: index_tar [-d] tarfile > tarfile.index\n");
+	return 1;
+    }
+
+    /* open the tarfile */
+    if (NULL == (fp = fopen(argv[0], "rb"))) {
+	perror(argv[0]);
+	return 1;
+    }
+
+    while(fread(&blk, sizeof(blk), 1, fp) == 1) {
+	/*
+	 * If a directory is too large to fit in the name (>100) but short
+	 * enough to fit in the prefix the name field will be empty, this is
+	 * not the case for ordinary files where the name field is always
+	 * non-empty
+	 */
+	if (!blk.header.name[0] && !blk.header.prefix[0])
+	    break;
+
+        /* get size of member, rounded to a multiple of TBLOCK */
+	size = strtoul(blk.header.size, NULL, 8);
+        extra = TBLOCK*((size+TBLOCK-1)/TBLOCK) - size;
+
+        /* skip directories unless requested */
+        if (directories || blk.header.typeflag != DIRTYPE || LongLink) {
+
+            /*
+	     * extract member name (prefix + name), unless last member
+	     * was ././@LongLink
+	     */
+            if (LongLink == 0) {
+                (void) strncpy(member, blk.header.prefix, 155);
+	        if (strlen(blk.header.prefix) > 0 && blk.header.name[0])
+		    (void) strcat(member, "/");
+    	        (void) strncat(member, blk.header.name, 100);
+            }
+            
+            /* account for gtar ././@LongLink */
+            if (strcmp(member, "././@LongLink") == 0) {
+                /* still expect filenames to fit into 256 bytes */
+                if (size > 256) {
+                    fread(member, 1, size > 256 ? 256 : size, fp);
+                    fprintf(stderr,"././@LongLink too long size=%ld\n",
+			    (long)size);
+                    fprintf(stderr,"%s...\n", member);
+                    exit(1);
+                }
+                /*
+		 * extract full name of next member then rewind to start
+		 * of header
+		 */
+                fread(member, 1, size > 256 ? 256 : size, fp);
+                fseek(fp, -size, SEEK_CUR);
+                LongLink = 1;
+            } else {
+                /* output offset, member name */
+                printf("%lu %.256s\n", (long)offset, member);
+                LongLink = 0;
+            }
+        }
+
+        /* increment offset */
+        size += extra;
+        fseek(fp, size, SEEK_CUR);
+        offset += sizeof(blk) + size;
+    }
+
+    fclose(fp);
+    return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/progs/makeSCF.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,480 @@
+/*
+ * Copyright (c) Medical Research Council 1994-1998. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+
+/*
+ * makeSCF v3.06, 17/04/2001
+ *
+ * Derived from the older makeSCF; this one has been rewritten to use the new
+ * IO libraries and no longer performs quality clipping itself. It also writes
+ * in a new format that is more easily compressed.
+ */
+
+#include <stdio.h>
+#include <strings.h>
+#include <io_lib/Read.h>
+#include <io_lib/traceType.h>
+#include <io_lib/xalloc.h>
+
+/*
+ * Add our comments.
+ * 1. Work out the comment length - simply add 1K to the current length.
+ * 2. Copy the old comments to our new.
+ * 3. Replace '\n' with ' '.
+ * 4. Add our comments and switch.
+ */
+void add_comments(Read *r, char *name, int format) {
+    Comments *cc;
+    int clen;
+    char *cp;
+    char buf[1024];
+
+    /* 1. */
+    if (r->info) {
+	clen = strlen(r->info) + 1024;
+    } else {
+	clen = 1024;
+    }
+
+    /* 2. */
+    if (NULL == (cc = (char *)xmalloc(clen)))
+	return;
+
+    if (r->info)
+	strcpy(cc, r->info);
+    else
+	*cc = 0;
+    
+    /* 3. */
+    cp = cc;
+/*
+    while (*cp) {
+	if (*cp == '\n')
+	    *cp = ' ';
+	
+	cp++;
+    }
+    *cp++ = '\n';
+*/
+  
+    /* 4. */
+    sprintf(buf, "CONV=makeSCF V3.06\nDATF=%s\nDATN=%s\n",
+	    trace_type_int2str(format), name);
+
+    strcat(cp, buf);
+
+    if (r->info)
+	xfree(r->info);
+
+    r->info = cc;
+}
+
+void scale_trace8(Read *r) {
+    double s;
+    int i;
+
+    if (r->maxTraceVal <= 255)
+	return;
+    
+    s = ((double)255)/r->maxTraceVal;
+
+    for (i = 0; i < r->NPoints; i++) {
+	r->traceA[i] *= s;
+	r->traceC[i] *= s;
+	r->traceG[i] *= s;
+	r->traceT[i] *= s;
+    }
+
+    r->maxTraceVal = 255;
+}
+
+/*
+ * Here we just take the minimum trace value and subtract this from all others.
+ * The assumption is that the signal will always be 'base line' on at least
+ * one of the four channels.
+ */
+void subtract_background(Read *r) {
+    int i, min;
+    for (i = 0; i < r->NPoints; i++) {
+	min = 999999;
+	if (r->traceA[i] < min) min = r->traceA[i];
+	if (r->traceC[i] < min) min = r->traceC[i];
+	if (r->traceG[i] < min) min = r->traceG[i];
+	if (r->traceT[i] < min) min = r->traceT[i];
+	r->traceA[i] -= min;
+	r->traceC[i] -= min;
+	r->traceG[i] -= min;
+	r->traceT[i] -= min;
+    }
+}
+
+/*
+ * Find the average background level of a trace, and subtract this from the
+ * peak heights.
+ *
+ * NB. That method is flawed. For now take the minimum instead of average, but
+ * this also has horrid flaws. See above method.
+ */
+void subtract_background_old(Read *r) {
+    int i, j, min, bg, max = 0;
+    int win_len = 501, win_len2 = win_len/2;
+    int *background;
+
+    if (NULL == (background = (int *)xmalloc((r->NPoints + 2 * win_len)
+					     * sizeof(*background))))
+	return;
+
+    if (r->NPoints < win_len)
+	win_len = r->NPoints;
+
+    /* Find minimum trace levels at each point */
+    for (i = 0, j = win_len2; i < r->NPoints; i++, j++) {
+	min = INT_MAX;
+	if (r->traceA[i] < min)
+	    min = r->traceA[i];
+	if (r->traceC[i] < min)
+	    min = r->traceC[i];
+	if (r->traceG[i] < min)
+	    min = r->traceG[i];
+	if (r->traceT[i] < min)
+	    min = r->traceT[i];
+	background[j] = min;
+    }
+    for (i = 0; i < win_len2; i++) {
+	background[i] = background[i + win_len2];
+	background[i + r->NPoints] = background[i + r->NPoints - win_len2];
+    }
+
+    /* Take lowest background over win_len and subtract it */
+    for (i = 0; i < r->NPoints; i++) {
+	/* Could optimise this considerably */
+	bg = INT_MAX;
+	for (j = 0; j < win_len; j++) {
+	    if (background[i + j] < bg)
+		bg = background[i + j];
+	}
+
+	r->traceA[i] -= bg;
+	r->traceC[i] -= bg;
+	r->traceG[i] -= bg;
+	r->traceT[i] -= bg;
+
+	if (r->traceA[i] > max) max = r->traceA[i];
+	if (r->traceC[i] > max) max = r->traceC[i];
+	if (r->traceG[i] > max) max = r->traceG[i];
+	if (r->traceT[i] > max) max = r->traceT[i];
+    }
+    
+    r->maxTraceVal = max;
+
+    xfree(background);
+}
+
+/*
+ * Find the maximum height of traces at the called bases. Use this to clip any
+ * other bases.
+ */
+void reset_max_called_height(Read *r) {
+    int i, max = 0;
+
+    /* Find max */
+    for (i=0; i < r->NBases; i++) {
+	switch(r->base[i]) {
+	case 'a':
+	case 'A':
+	    if (r->traceA[r->basePos[i]] > max)
+		max = r->traceA[r->basePos[i]];
+	    break;
+
+	case 'c':
+	case 'C':
+	    if (r->traceC[r->basePos[i]] > max)
+		max = r->traceC[r->basePos[i]];
+	    break;
+
+	case 'g':
+	case 'G':
+	    if (r->traceG[r->basePos[i]] > max)
+		max = r->traceG[r->basePos[i]];
+	    break;
+
+	case 't':
+	case 'T':
+	    if (r->traceT[r->basePos[i]] > max)
+		max = r->traceT[r->basePos[i]];
+	    break;
+	}
+    }
+
+    /* Clip to max */
+    for (i = 0; i < r->NPoints; i++) {
+	if (r->traceA[i] > max)
+	    r->traceA[i] = max;
+	if (r->traceC[i] > max)
+	    r->traceC[i] = max;
+	if (r->traceG[i] > max)
+	    r->traceG[i] = max;
+	if (r->traceT[i] > max)
+	    r->traceT[i] = max;
+    }
+    if (r->maxTraceVal > max)
+	r->maxTraceVal = max;
+}
+
+void rescale_heights(Read *r) {
+    int win_len = 1000;
+    int total = 0;
+    int max, max2;
+    int i, j, k;
+    double max_val = 0, rescale = 1.0;
+    TRACE *ta, *tc, *tg, *tt;
+
+    ta = r->traceA;
+    tc = r->traceC;
+    tg = r->traceG;
+    tt = r->traceT;
+
+    if (r->NPoints < 2*win_len + 1)
+	return;
+
+    for (k = 0; k < 2; k++) {
+	max2 = win_len * r->maxTraceVal;
+	
+	for (i = 0; i < win_len; i++) {
+	    max = 0;
+	    if (ta[i] > max) max = ta[i];
+	    if (tc[i] > max) max = tc[i];
+	    if (tg[i] > max) max = tg[i];
+	    if (tt[i] > max) max = tt[i];
+	    total += max;
+	}
+	
+	for (j = 0; i < r->NPoints; i++, j++) {
+	    max = 0;
+	    if (ta[j] > max) max = ta[j];
+	    if (tc[j] > max) max = tc[j];
+	    if (tg[j] > max) max = tg[j];
+	    if (tt[j] > max) max = tt[j];
+	    total -= max;
+	    
+	    max = 0;
+	    if (ta[i] > max) max = ta[i];
+	    if (tc[i] > max) max = tc[i];
+	    if (tg[i] > max) max = tg[i];
+	    if (tt[i] > max) max = tt[i];
+	    total += max;
+	    
+	    if (k == 0) {
+		if (r->traceA[j] * ((double)max2 / total) > max_val)
+		    max_val = r->traceA[j] * ((double)max2 / total);
+		if (r->traceC[j] * ((double)max2 / total) > max_val)
+		    max_val = r->traceC[j] * ((double)max2 / total);
+		if (r->traceG[j] * ((double)max2 / total) > max_val)
+		    max_val = r->traceG[j] * ((double)max2 / total);
+		if (r->traceT[j] * ((double)max2 / total) > max_val)
+		    max_val = r->traceT[j] * ((double)max2 / total);
+	    } else {
+		r->traceA[j] *= (double)max2 / total * rescale;
+		r->traceC[j] *= (double)max2 / total * rescale;
+		r->traceG[j] *= (double)max2 / total * rescale;
+		r->traceT[j] *= (double)max2 / total * rescale;
+	    }
+	}
+
+	for (; j < r->NPoints; j++) {
+	    if (k == 0) {
+		if (r->traceA[j] * ((double)max2 / total) > max_val)
+		    max_val = r->traceA[j] * ((double)max2 / total);
+		if (r->traceC[j] * ((double)max2 / total) > max_val)
+		    max_val = r->traceC[j] * ((double)max2 / total);
+		if (r->traceG[j] * ((double)max2 / total) > max_val)
+		    max_val = r->traceG[j] * ((double)max2 / total);
+		if (r->traceT[j] * ((double)max2 / total) > max_val)
+		    max_val = r->traceT[j] * ((double)max2 / total);
+	    } else {
+		r->traceA[j] *= (double)max2 / total;
+		r->traceC[j] *= (double)max2 / total;
+		r->traceG[j] *= (double)max2 / total;
+		r->traceT[j] *= (double)max2 / total;
+	    }
+	}
+
+	if (max_val > 65535)
+	    rescale = 65535 / max_val;
+	else
+	    rescale = 1.0;
+    }
+}
+
+static int convert(char *in, mFILE *ofp, char *out, int format, int prec,
+		   int comp, int normalise) {
+    Read *r;
+
+    if (NULL == (r = read_reading(in, format))) {
+	fprintf(stderr, "%s: failed to read\n", in);
+	return 1;
+    }
+
+    if (normalise) {
+	subtract_background(r);
+	reset_max_called_height(r);
+	rescale_heights(r);
+    }
+
+    add_comments(r, in, format);
+    if (prec == 1)
+	scale_trace8(r);
+
+    if (comp != -1)
+	set_compression_method(comp);
+    if (0 != (mfwrite_reading(ofp, r, TT_SCF))) {
+	fprintf(stderr, "%s: failed to write\n", out);
+	read_deallocate(r);
+	return 1;
+    }
+
+    read_deallocate(r);
+    return 0;
+}
+
+
+void usage(void) {
+    fprintf(stderr,
+	    "makeSCF [-8] [-2] [-3] [-s] [-compress mode] [-normalise]\n"
+	    "       -(abi|alf|scf|any) input_name [-output output_name]\n"
+	    " or\n"
+	    "makeSCF [-8] [-2] [-3] [-s] [-compress mode] [-normalise]\n"
+	    "       [-(abi|alf|scf|any)] input_name1 output_name1 ... "
+	    "input_nameN output_nameN \n");
+
+    exit(1);
+}
+
+int main(int argc, char **argv) {
+    int format = TT_ANY, r, prec = 0, version = 3, silent = 0;
+    int compress_mode = -1;
+    char *inf = NULL;
+    char *outf = NULL;
+    mFILE *ofp = mstdout();
+    int normalise = 0;
+
+    for (argc--, argv++; argc > 0; argc--, argv++) {
+	if (strcmp(*argv, "-8") == 0) {
+	    prec = 1;
+	} else if (strcmp(*argv, "-2") == 0) {
+	    version = 2;
+	} else if (strcmp(*argv, "-3") == 0) {
+	    version = 3;
+	} else if (strcmp(*argv, "-normalise") == 0) {
+	    normalise = 1;
+	} else if (strcmp(*argv, "-s") == 0) {
+	    silent = 1;
+	} else if (strcasecmp(*argv, "-abi") == 0) {
+	    format = TT_ABI;
+	    inf = *++argv;
+	    argc--;
+	} else if (strcasecmp(*argv, "-alf") == 0) {
+	    format = TT_ALF;
+	    inf = *++argv;
+	    argc--;
+	} else if (strcasecmp(*argv, "-scf") == 0) {
+	    format = TT_SCF;
+	    inf = *++argv;
+	    argc--;
+	} else if (strcasecmp(*argv, "-ztr") == 0) {
+	    format = TT_ZTR;
+	    inf = *++argv;
+	    argc--;
+	} else if (strcasecmp(*argv, "-any") == 0) {
+	    format = TT_ANY;
+	    inf = *++argv;
+	    argc--;
+	} else if (strcasecmp(*argv, "-output") == 0) {
+	    outf = *++argv;
+	    argc--;
+	} else if (strcasecmp(*argv, "-compress") == 0) {
+	    compress_mode = compress_str2int(*++argv);
+	    argc--;
+	} else {
+	    break;
+	}
+    }
+
+    /* if no args left than input file must have been specified */
+    if (!argc && !inf)
+	usage();
+
+    /* if outfile set, then using original syntax, so don't expect
+       any extra args */
+    if (argc && outf)
+      usage();
+
+    if (!silent) {
+	printf("makeSCF v3.06\n");
+	printf("Copyright (c) MRC Laboratory of Molecular Biology, 2001. All rights reserved.\n");
+    }
+
+    set_scf_version(version);
+
+
+    if(!argc) {
+	/* original calling syntax */
+	if (outf) {
+	    ofp = mfopen(outf, "wb+");
+	    if (NULL == ofp) {
+		perror(outf);
+		return 1;
+	    }
+	}
+
+	r = convert(inf, ofp, outf, format, prec, compress_mode, normalise);
+	mfclose(ofp);
+
+	return r;
+
+    }
+
+    /* else */ {
+	/* new calling syntax, handling multiple files */
+	int result=0;
+
+	for (; argc > 0; argc--, argv++) {
+	    if (inf) {
+		/* got infile, so get outfile and process */
+		outf= *argv;
+		ofp = mfopen(outf, "wb+");
+		
+		if (NULL == ofp) {
+		    perror(outf);
+		    if(!result) result=1;
+		    continue;
+		}
+		r = convert(inf, ofp, outf, format, prec, compress_mode,
+			    normalise);
+		mfclose(ofp);
+		if(!result) /* keep track of the first error */
+		    result=r;
+	      
+		/* now need to get another infile */
+		inf=NULL;
+	    } else {
+		/* need infile */
+		inf= *argv;
+	    }
+	}
+
+	return result;
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/progs/scf_dump.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) Medical Research Council 1994. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+#include <stdio.h>
+#include <io_lib/scf.h>
+
+int main(int argc, char **argv) {
+    Scf *scf;
+    int i;
+
+    if (argc != 2) {
+	fprintf(stderr, "Usage: scf_dump scf_filename\n");
+	return 1;
+    }
+
+    scf = read_scf(argv[1]);
+
+    if (scf == NULL) {
+	fprintf(stderr, "read_scf failed\n");
+	return 1;
+    }
+
+    printf("[Header]\n");
+    printf("%d\t# magic_number\n",	scf->header.magic_number);
+    printf("%d\t\t# samples\n",		scf->header.samples);
+    printf("%d\t\t# samples_offset\n",	scf->header.samples_offset);
+    printf("%d\t\t# bases\n",		scf->header.bases);
+    printf("%d\t\t# bases_left_clip\n",	scf->header.bases_left_clip);
+    printf("%d\t\t# bases_right_clip\n",	scf->header.bases_right_clip);
+    printf("%d\t\t# bases_offset\n",	scf->header.bases_offset);
+    printf("%d\t\t# comments_size\n",	scf->header.comments_size);
+    printf("%d\t\t# comments_offset\n",	scf->header.comments_offset);
+    printf("%.4s\t\t# version\n",	        scf->header.version);
+    printf("%d\t\t# sample_size\n",	scf->header.sample_size);
+    printf("%d\t\t# code_set\n",		scf->header.code_set);
+    printf("%d\t\t# private_size\n",	scf->header.private_size);
+    printf("%d\t\t# private_offset\n",	scf->header.private_offset);
+    printf("%d\t\t# spare[0]\n",		scf->header.spare[0]);
+    printf("%d\t\t# spare[1]\n",		scf->header.spare[1]);
+    printf("%d\t\t# spare[2]\n",		scf->header.spare[2]);
+    printf("%d\t\t# spare[3]\n",		scf->header.spare[3]);
+    printf("%d\t\t# spare[4]\n",		scf->header.spare[4]);
+    printf("%d\t\t# spare[5]\n",		scf->header.spare[5]);
+    printf("%d\t\t# spare[6]\n",		scf->header.spare[6]);
+    printf("%d\t\t# spare[7]\n",		scf->header.spare[7]);
+    printf("%d\t\t# spare[8]\n",		scf->header.spare[8]);
+    printf("%d\t\t# spare[9]\n",		scf->header.spare[9]);
+    printf("%d\t\t# spare[10]\n",		scf->header.spare[10]);
+    printf("%d\t\t# spare[11]\n",		scf->header.spare[11]);
+    printf("%d\t\t# spare[12]\n",		scf->header.spare[12]);
+    printf("%d\t\t# spare[13]\n",		scf->header.spare[13]);
+    printf("%d\t\t# spare[14]\n",		scf->header.spare[14]);
+    printf("%d\t\t# spare[15]\n",		scf->header.spare[15]);
+    printf("%d\t\t# spare[16]\n",		scf->header.spare[16]);
+    printf("%d\t\t# spare[17]\n",		scf->header.spare[17]);
+
+    puts("\n[Bases]");
+    for (i = 0; i < scf->header.bases; i++) {
+	printf("%c %05d %03d %03d %03d %03d   %03d %03d %03d  #%3d\n",
+	       scf->bases[i].base,
+	       scf->bases[i].peak_index,
+	       scf->bases[i].prob_A,
+	       scf->bases[i].prob_C,
+	       scf->bases[i].prob_G,
+	       scf->bases[i].prob_T,
+	       scf->bases[i].spare[0],
+	       scf->bases[i].spare[1],
+	       scf->bases[i].spare[2],
+	       i);
+    }
+
+    puts("\n[A_Trace]");
+    if (scf->header.sample_size == 1) {
+	for (i = 0; i < scf->header.samples; i++)
+	    printf("%d\t#%5d\n", scf->samples.samples1[i].sample_A, i);
+    } else {
+	for (i = 0; i < scf->header.samples; i++)
+	    printf("%d\t#%5d\n", scf->samples.samples2[i].sample_A, i);
+    }
+ 
+    puts("\n[C_Trace]");
+    if (scf->header.sample_size == 1) {
+	for (i = 0; i < scf->header.samples; i++)
+	    printf("%d\t#%5d\n", scf->samples.samples1[i].sample_C, i);
+    } else {
+	for (i = 0; i < scf->header.samples; i++)
+	    printf("%d\t#%5d\n", scf->samples.samples2[i].sample_C, i);
+    }
+ 
+    puts("\n[G_Trace]");
+    if (scf->header.sample_size == 1) {
+	for (i = 0; i < scf->header.samples; i++)
+	    printf("%d\t#%5d\n", scf->samples.samples1[i].sample_G, i);
+    } else {
+	for (i = 0; i < scf->header.samples; i++)
+	    printf("%d\t#%5d\n", scf->samples.samples2[i].sample_G, i);
+    }
+ 
+    puts("\n[T_Trace]");
+    if (scf->header.sample_size == 1) {
+	for (i = 0; i < scf->header.samples; i++)
+	    printf("%d\t#%5d\n", scf->samples.samples1[i].sample_T, i);
+    } else {
+	for (i = 0; i < scf->header.samples; i++)
+	    printf("%d\t#%5d\n", scf->samples.samples2[i].sample_T, i);
+    }
+
+    puts("\n[Comments]");
+    printf("%.*s\n", (int)scf->header.comments_size, scf->comments);
+
+    scf_deallocate(scf);
+
+    return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/progs/scf_info.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) Medical Research Council 1994. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+#include <stdio.h>
+#include <io_lib/scf.h>
+
+int main(int argc, char **argv) {
+    Scf *scf;
+
+    if (argc != 2) {
+	fprintf(stderr, "Usage: scf_info scf_filename\n");
+	return 1;
+    }
+
+    scf = read_scf(argv[1]);
+
+    if (scf == NULL) {
+	fprintf(stderr, "read_scf failed\n");
+	return 1;
+    }
+
+    printf("Version_number       %.4s\n", scf->header.version);
+    printf("Number_of_samples    %d\n", scf->header.samples);
+    printf("Samples_offset       %d\n", scf->header.samples_offset);
+    printf("Samples_size         %d\n", scf->header.sample_size);
+    printf("Number_of_bases      %d\n", scf->header.bases);
+    printf("Bases_offset         %d\n", scf->header.bases_offset);
+    printf("Comments_size        %d\n", scf->header.comments_size);
+    printf("Comments_offset      %d\n", scf->header.comments_offset);
+    printf("Left_clip            %d\n", scf->header.bases_left_clip);
+    printf("Right_clip           %d\n", scf->header.bases_right_clip);
+    printf("Code set             %d\n", scf->header.code_set);
+
+    scf_deallocate(scf);
+
+    return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/progs/scf_update.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) Medical Research Council 1994. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * as part of the Staden Package at the MRC Laboratory of Molecular
+ * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <io_lib/scf.h>
+
+/*
+ * Update a v2.x SCF files to a v3.x SCF files.
+ */
+
+int main(int argc, char **argv) {
+    Scf *scf;
+    int version = 3;
+
+    if (argc > 2 && strcmp(argv[1], "-v") == 0) {
+	version = atoi(argv[2]);
+	if (version != 2 && version != 3) {
+	    fprintf(stderr, "Please specify version 2 or version 3\n");
+	    return 1;
+	}
+
+	argc-=2;
+	argv+=2;
+    }
+
+    if (argc != 3) {
+	fprintf(stderr, "Usage: scf_update [-v version] source destination\n");
+	return 1;
+    }
+
+    if (NULL == (scf = read_scf(argv[1]))) {
+	perror(argv[1]);
+	return 1;
+    }
+
+    set_scf_version(version);
+
+    if (-1 == write_scf(scf, argv[2])) {
+	perror(argv[2]);
+	return 1;
+    }
+
+    scf_deallocate(scf);
+    return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/progs/srf2fasta.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,137 @@
+/*
+ * ======================================================================
+ * This software has been created by Genome Research Limited (GRL).
+ *
+ * GRL hereby grants permission to use, copy, modify and distribute
+ * this software and its documentation for non-commercial purposes
+ * without fee at the user's own risk on the basis set out below.
+ *
+ * GRL neither undertakes nor accepts any duty whether contractual or
+ * otherwise in connection with the software, its use or the use of
+ * any derivative, and makes no representations or warranties, express
+ * or implied, concerning the software, its suitability, fitness for
+ * a particular purpose or non-infringement.
+ *
+ * In no event shall the authors of the software or GRL be responsible
+ * or liable for any loss or damage whatsoever arising in any way
+ * directly or indirectly out of the use of this software or its
+ * derivatives, even if advised of the possibility of such damage.
+ *
+ * Our software can be freely distributed under the conditions set out
+ * above, and must contain this copyright notice.
+ * ======================================================================
+ */
+
+/*
+ * This performs a linear (non-indexed) search for a trace in an SRF archive.
+ *
+ * It's not intended as a suitable production program or as a library of code
+ * to use, but as a test and benchmark statistic.
+ */
+
+#include <stdio.h>
+#include <math.h>
+#include <string.h>
+#include <fcntl.h>
+
+#include <io_lib/Read.h>
+#include <io_lib/misc.h>
+#include <io_lib/ztr.h>
+#include <io_lib/srf.h>
+
+/* ------------------------------------------------------------------------ */
+
+#define MAX_READ_LEN 10000
+void ztr2fasta(ztr_t *z, char *name) {
+    int i, nc;
+    char buf[MAX_READ_LEN*2 + 512 + 6];
+    char *seq = buf;
+    ztr_chunk_t **chunks;
+
+    /* Extract the sequence only */
+    chunks = ztr_find_chunks(z, ZTR_TYPE_BASE, &nc);
+    if (nc != 1) {
+	fprintf(stderr, "Zero or greater than one BASE chunks found.\n");
+	if (chunks)
+	    free(chunks);
+	return;
+    }
+
+    uncompress_chunk(z, chunks[0]);
+
+    /* Construct fasta entry */
+    *seq++ = '>';
+    while (*name)
+	*seq++ = *name++;
+    *seq++ = '\n';
+
+    for (i = 1; i < chunks[0]->dlength; i++) {
+	char base = chunks[0]->data[i];
+	switch (base) {
+	case 'A': case 'a':
+	case 'C': case 'c':
+	case 'G': case 'g':
+	case 'T': case 't':
+	    *seq++ = base;
+	    break;
+	default:
+	    *seq++ = 'N';
+	}
+    }
+    *seq++ = '\n';
+
+    fwrite(buf, 1, seq - buf, stdout);
+    free(chunks);
+
+    return;
+}
+
+/* ------------------------------------------------------------------------ */
+void usage(void) {
+    fprintf(stderr, "Usage: srf2fasta [-C] archive_name\n");
+    exit(1);
+}
+
+int main(int argc, char **argv) {
+    char *ar_name;
+    srf_t *srf;
+    char name[512];
+    ztr_t *ztr;
+    int mask = 0, i;
+
+    /* Parse args */
+    for (i = 1; i < argc && argv[i][0] == '-'; i++) {
+	if (!strcmp(argv[i], "-")) {
+	    break;
+	} else if (!strcmp(argv[i], "-C")) {
+	    mask = SRF_READ_FLAG_BAD_MASK;
+	} else {
+	    usage();
+	}
+    }    
+
+    if (i == argc) {
+	usage();
+    }
+    ar_name = argv[i];
+
+    if (NULL == (srf = srf_open(ar_name, "r"))) {
+	perror(ar_name);
+	return 4;
+    }
+
+    read_sections(READ_BASES);
+
+#ifdef _WIN32
+    _setmode(_fileno(stdout), _O_BINARY);
+#endif
+
+    while (NULL != (ztr = srf_next_ztr(srf, name, mask))) {
+	ztr2fasta(ztr, name);
+	delete_ztr(ztr);
+    }
+
+    srf_destroy(srf, 1);
+
+    return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/progs/srf2fastq.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,649 @@
+/*
+ * ======================================================================
+ * This software has been created by Genome Research Limited (GRL).
+ *
+ * GRL hereby grants permission to use, copy, modify and distribute
+ * this software and its documentation for non-commercial purposes
+ * without fee at the user's own risk on the basis set out below.
+ *
+ * GRL neither undertakes nor accepts any duty whether contractual or
+ * otherwise in connection with the software, its use or the use of
+ * any derivative, and makes no representations or warranties, express
+ * or implied, concerning the software, its suitability, fitness for
+ * a particular purpose or non-infringement.
+ *
+ * In no event shall the authors of the software or GRL be responsible
+ * or liable for any loss or damage whatsoever arising in any way
+ * directly or indirectly out of the use of this software or its
+ * derivatives, even if advised of the possibility of such damage.
+ *
+ * Our software can be freely distributed under the conditions set out
+ * above, and must contain this copyright notice.
+ * ======================================================================
+ */
+
+/*
+ * This performs a linear (non-indexed) search for a trace in an SRF archive.
+ *
+ * It's not intended as a suitable production program or as a library of code
+ * to use, but as a test and benchmark statistic.
+ */
+
+#include <stdio.h>
+#include <math.h>
+#include <string.h>
+#include <fcntl.h>
+
+#include <io_lib/Read.h>
+#include <io_lib/misc.h>
+#include <io_lib/ztr.h>
+#include <io_lib/srf.h>
+#include <io_lib/hash_table.h>
+
+#define MAX_REGIONS   40
+
+/* regn chunk */
+typedef struct {
+    char coord;
+    char *region_names;
+    int nregions;
+    char *name[MAX_REGIONS];
+    char code[MAX_REGIONS];
+    int start[MAX_REGIONS];
+    int length[MAX_REGIONS];
+    int index[MAX_REGIONS];
+    FILE *file[MAX_REGIONS];
+    int count;
+} regn_t;
+
+/*
+ * Inline reverse a string
+ */
+static void reverse_string( char *s , int length ) {
+    char temp;
+    char *first = s;
+    char *last  = s + length - 1;
+
+    /* Reverse complement */
+    while ( last > first ) {
+	temp = *first;
+	*first++ = *last;
+	*last-- = temp;
+    }
+}
+
+/*
+ * Reverse complement a DNA string.
+ */
+static void reverse_complement( char *s , int length ) {
+    char temp;
+    char *first = s;
+    char *last  = s + length - 1;
+    static unsigned char cbase[256];
+    static int init = 0;
+
+    /* Initialise cbase[] array on first use */
+    if (!init) {
+	int i;
+	for (i = 0; i < 256; i++)
+	    cbase[i] = i;
+	cbase['A'] = 'T'; cbase['a'] = 't';
+	cbase['C'] = 'G'; cbase['c'] = 'g';
+	cbase['G'] = 'C'; cbase['g'] = 'c';
+	cbase['T'] = 'A'; cbase['t'] = 'a';
+
+	init = 1;
+    }
+
+    /* Reverse complement */
+    while ( last > first ) {
+	temp = *first;
+	*first++ = cbase[(unsigned char)*last];
+	*last-- = cbase[(unsigned char)temp];
+    }
+
+    if (last == first)
+    	*first = cbase[(unsigned char)*first];
+}
+
+static char qlookup[256];
+void init_qlookup(void) {
+    int i;
+    for (i = -128; i < 128; i++) {
+        qlookup[i+128] = '!' + (int)((10*log(1+pow(10, i/10.0))/log(10)+.499));
+    }
+}
+
+/*
+ * Parse the REGN chunk, add to regn HASH
+ *
+ * Returns corresponding HashItem * from regn Hash
+ */
+HashItem *parse_regn(ztr_t *z, ztr_chunk_t *chunk, HashTable *regn_hash) {
+    char key[1024];
+    char *name;
+    HashItem *hi;
+    regn_t *regn;
+    size_t l;
+    
+    uncompress_chunk(z, chunk);
+
+    /* the hash key is a combination of the region names and boundaries */
+    name = ztr_lookup_mdata_value(z, chunk, "NAME");
+    l = snprintf(key, sizeof(key), "names=%s", name);
+    if( chunk->dlength ){
+        int nbndy = (chunk->dlength-1)/4;
+        uint4 *bndy = (uint4 *)(chunk->data+1);
+        int ibndy;
+	for (ibndy=0; ibndy<nbndy; ibndy++) {
+            if( ibndy )
+                l += snprintf(key + l, sizeof(key) - l,
+			      ";%d", be_int4(bndy[ibndy]));
+            else
+                l += snprintf(key + l, sizeof(key) - l,
+			      " boundaries=%d", be_int4(bndy[ibndy]));
+        }
+    }
+
+    if (NULL == (hi = (HashTableSearch(regn_hash, key, strlen(key))))) {
+        int iregion, nregions = 0, index = 1;
+        char *coord;
+	char *cp1;
+        uint4 bndy[MAX_REGIONS];
+        int ibndy, nbndy = 0;
+        HashData hd;
+
+        if( NULL == (regn = (regn_t *)malloc(sizeof(regn_t)))) {
+	    return NULL;
+	}
+
+	coord = ztr_lookup_mdata_value(z, chunk, "COORD");
+	regn->coord = (NULL == coord ? 'B' : *coord );
+
+	regn->region_names = strdup(name);
+
+        cp1 = strtok (regn->region_names,";");
+        while(cp1) {
+            char *cp2;
+            if(NULL == (cp2 = strchr(cp1,':'))) {
+                fprintf(stderr, "Invalid region name/code pair %s\n", cp1);
+                return NULL;
+            }
+            *cp2++ = '\0';
+            regn->name[nregions] = cp1;
+            regn->code[nregions] = *cp2;
+            nregions++;
+            cp1 = strtok (NULL, ";");
+        }
+
+        regn->nregions = nregions;
+
+	if( chunk->dlength ) {
+            nbndy = (chunk->dlength-1)/4;
+            memcpy(bndy, chunk->data+1, chunk->dlength-1);
+	}
+
+        for( iregion=0, ibndy=0; iregion<nregions; iregion++) {
+            /* start = (start + length of previous region) or 0 if no previous region */
+            /* length = (next boundary - start of region) or -1 if no next boundary */
+            if( regn->code[iregion] == 'E' ){
+                /* not in BASE chunk, no boundary, set length = 0 */
+                regn->start[iregion] = (iregion ? (regn->start[iregion-1] + regn->length[iregion-1]) : 0);
+                regn->length[iregion] = 0;
+            } else {
+                if( ibndy > nbndy ){
+                    fprintf(stderr, "More name/code pairs than boundaries\n");
+                    return NULL;
+                }
+                regn->start[iregion] = (iregion ? (regn->start[iregion-1] + regn->length[iregion-1]) : 0);
+                regn->length[iregion] = (ibndy == nbndy ? -1 : (be_int4(bndy[ibndy])-regn->start[iregion]));
+                regn->index[iregion] = index;
+                ibndy++;
+                index++;
+            }
+        }
+
+        regn->count = 1;
+            
+	hd.p = regn;
+	if (NULL == (hi = HashTableAdd(regn_hash, key, strlen(key), hd, NULL))) {
+	    free(regn->region_names);
+	    free(regn);
+	    return NULL;
+	}
+    } else {
+	regn = (regn_t *)(hi->data.p);
+	regn->count++;
+    }
+
+    return hi;
+}
+
+/* ------------------------------------------------------------------------ */
+#define MAX_READ_LEN 10000
+void ztr2fastq(ztr_t *z, char *name, int calibrated, int sequential,
+               int split, char *root, int numeric, int append, int explicit,
+               HashTable *regn_hash, int *nfiles_open, char **filenames,
+	       FILE **files, int *reverse) {
+    int i, nc, seq_len, nfiles = *nfiles_open;
+    char buf[MAX_READ_LEN*2 + 512 + 6];
+    char *seq, *qual, *sdata, *qdata, *key;
+    ztr_chunk_t **chunks;
+    HashItem *hi;
+    regn_t *regn;
+    int logodds;
+
+    if ( sequential || split || explicit ) {
+        chunks = ztr_find_chunks(z, ZTR_TYPE_REGN, &nc);
+        if (nc != 1) {
+            fprintf(stderr, "Zero or greater than one REGN chunks found.\n");
+            if (chunks)
+                free(chunks);
+            return;
+        }
+        if( NULL == (hi = parse_regn(z, chunks[0], regn_hash)) ){
+            fprintf(stderr, "Invalid RGEN chunk\n");
+            if (chunks)
+                free(chunks);
+            return;
+        }
+        regn = (regn_t *)(hi->data.p);
+        if( regn->count == 1 ){
+            int iregion;
+            for (iregion=0; iregion<regn->nregions; iregion++) {
+                if( regn->code[iregion] == 'E' ) {
+                    /* not in BASE chunk, the name of region IS the sequence, set file = NULL */
+                    regn->file[iregion] = NULL;
+                } else if( split ){
+                    char filename[FILENAME_MAX];
+                    int ifile;
+                    if( numeric ){
+                        sprintf(filename, "%s_%d.fastq", root,
+				regn->index[iregion]);
+                    } else {
+                        sprintf(filename, "%s_%s.fastq", root,
+				regn->name[iregion]);
+                    }
+                    for (ifile=0; ifile<nfiles; ifile++) {
+                        if( 0 == strcmp(filename,filenames[ifile]) ){
+                            regn->file[iregion] = files[ifile];
+                            break;
+                        }
+                    }
+                    if( ifile == nfiles ){
+                        FILE *fp;
+                        if (nfiles == MAX_REGIONS) {
+                            fprintf(stderr, "Too many regions.\n");
+                            if (chunks)
+                                free(chunks);
+                            return;
+                        }
+                        printf("Opening file %s\n", filename);
+                        filenames[nfiles] = strdup(filename);
+                        if (NULL == (fp = fopen(filename, "wb+"))) {
+                            perror(filename);
+                            if (chunks)
+                                free(chunks);
+                            return;
+                        }
+                        files[nfiles++] = fp;
+                        regn->file[iregion] = fp;
+                    }
+                } else {
+                    regn->file[iregion] = stdout;
+                }
+            }
+        }
+
+        if (chunks)
+            free(chunks);
+    }
+
+    /* Extract the sequence only */
+    chunks = ztr_find_chunks(z, ZTR_TYPE_BASE, &nc);
+    if (nc != 1) {
+	fprintf(stderr, "Zero or greater than one BASE chunks found.\n");
+	if (chunks)
+	    free(chunks);
+	return;
+    }
+    uncompress_chunk(z, chunks[0]);
+    sdata = chunks[0]->data+1;
+    seq_len = chunks[0]->dlength-1;
+
+    /* Extract the quality */
+    free(chunks);
+    if (calibrated)
+	chunks = ztr_find_chunks(z, ZTR_TYPE_CNF1, &nc);
+    else
+	chunks = ztr_find_chunks(z, ZTR_TYPE_CNF4, &nc);
+
+    if (nc != 1) {
+	fprintf(stderr, "Zero or greater than one CNF chunks found.\n");
+	if (chunks)
+	    free(chunks);
+	return;
+    }
+    uncompress_chunk(z, chunks[0]);
+    qdata = chunks[0]->data+1;
+    key = ztr_lookup_mdata_value(z, chunks[0], "SCALE");
+    logodds = (key && 0 == strcmp(key, "LO")) ? 1 : 0;
+
+    /* Construct fastq entry */
+    if( sequential || split ){
+        int iregion;
+        for (iregion=0;
+	     iregion<regn->nregions && iregion<MAX_REGIONS;
+	     iregion++) {
+            char *cp = name;
+            int start, length;
+
+            if( regn->code[iregion] == 'E' ) {
+                /*
+		 * Not in BASE chunk, the sequence IS the name of the region
+		 * which may be pre-pended to the next region
+		 */
+                continue;
+            }
+            
+
+            start = regn->start[iregion];
+            length = (regn->length[iregion] == -1
+		      ? (seq_len-regn->start[iregion])
+		      : regn->length[iregion]);
+
+            seq = buf;
+            *seq++ = '@';
+            while (*cp)
+                *seq++ = *cp++;
+            if( append ){
+                int n = sprintf(seq,"/%d", regn->index[iregion]);
+                if( n < 0 ){
+                    fprintf(stderr, "Unable to add index to read name\n");
+                    if (chunks)
+                        free(chunks);
+                    return;
+                }
+                seq += n;
+            }
+            *seq++ = '\n';
+            qual = seq + length;
+
+            if( explicit && iregion && regn->code[iregion-1] == 'E' ) {
+                /*
+		 * previous region not in BASE chunk, the name of region
+		 * IS the sequence which is pre-pended to this region
+		 */
+                qual += strlen(regn->name[iregion-1]);
+            }
+
+            *qual++ = '\n';
+            *qual++ = '+';
+            *qual++ = '\n';
+            
+            if( explicit && iregion && regn->code[iregion-1] == 'E' ){
+                /*
+		 * previous region not in BASE chunk, the name of region
+		 * IS the sequence which is pre-pended to this region
+		 *
+		 * The idea of adding the sequence to the quality string
+		 * here seems very odd. However so far we have only seen
+		 * SOLiD files using explicit regions and in these their
+		 * own fastqs appear to have the DNA base prepended to
+		 * both the colour space sequence and quality strings.
+		 *
+		 * NB: we don't allow this to be reversed.
+		 */
+                strcpy(seq, regn->name[iregion-1]);
+                seq += strlen(regn->name[iregion-1]);
+                strcpy(qual, regn->name[iregion-1]);
+                qual += strlen(regn->name[iregion-1]);
+            }
+            
+	    /* If this is a region to be reversed, do so */
+	    if ( reverse[iregion] ) {
+		reverse_complement(sdata ,length);
+		reverse_string(qdata, length);
+            }
+
+            for (i = 0; i < length; i++) {
+                if (*sdata != '.') {
+                    *seq++ = *sdata++;
+                } else {
+                    *seq++ = 'N';
+                    sdata++;
+                }
+                *qual++ = logodds ? qlookup[*qdata++ + 128] : *qdata++ + '!';
+            }
+            *qual++ = '\n';
+
+            fwrite(buf, 1, qual - buf, regn->file[iregion]);
+        }
+    } else {
+        seq = buf;
+        *seq++ = '@';
+        while (*name)
+            *seq++ = *name++;
+        *seq++ = '\n';
+        qual = seq + seq_len;
+
+        if( explicit ){
+            int iregion;
+            for (iregion=0; iregion<regn->nregions; iregion++) {
+                if( regn->code[iregion] == 'E' ) {
+                    /*
+		     * region not in BASE chunk, the name of region IS
+		     * the sequence
+		     */
+                    qual += strlen(regn->name[iregion]);
+                }
+	    }
+        }
+
+        *qual++ = '\n';
+        *qual++ = '+';
+        *qual++ = '\n';
+
+        if( explicit ){
+            int iregion;
+            for (iregion=0; iregion<regn->nregions; iregion++) {
+                int start, length;
+                if( regn->code[iregion] == 'E' ){
+                    /*
+		     * region not in BASE chunk, the name of region IS
+		     * the sequence
+		     *
+		     * The idea of adding the sequence to the quality string
+		     * here seems very odd. However so far we have only seen
+		     * SOLiD files using explicit regions and in these their
+		     * own fastqs appear to have the DNA base prepended to
+		     * both the colour space sequence and quality strings.
+		     */
+                    strcpy(seq, regn->name[iregion]);
+                    seq += strlen(regn->name[iregion]);
+                    strcpy(qual, regn->name[iregion]);
+                    qual += strlen(regn->name[iregion]);
+                } else {
+                    start = regn->start[iregion];
+                    length = (regn->length[iregion] == -1
+			      ? (seq_len-regn->start[iregion])
+			      : regn->length[iregion]);
+
+                    /* If this is a region to be reversed, do so */
+                    if ( reverse[iregion] ) {
+			reverse_complement(sdata, length);
+			reverse_string(qdata, length);
+                    }
+
+                    for (i = 0; i < length; i++) {
+                        if (*sdata != '.') {
+                            *seq++ = *sdata++;
+                        } else {
+                            *seq++ = 'N';
+                            sdata++;
+                        }
+                        *qual++ = logodds
+			    ? qlookup[*qdata++ + 128]
+			    : *qdata++ + '!';
+                    }
+                }
+            }
+        } else {
+	    if ( reverse[0] ) {
+		reverse_complement(sdata, seq_len);
+		reverse_string(qdata, seq_len);
+	    }
+
+            for (i = 0; i < seq_len; i++) {
+                if (*sdata != '.') {
+                    *seq++ = *sdata++;
+                } else {
+                    *seq++ = 'N';
+                    sdata++;
+                }
+                *qual++ = logodds ? qlookup[*qdata++ + 128] : *qdata++ + '!';
+            }
+        }
+
+        *qual++ = '\n';
+
+        fwrite(buf, 1, qual - buf, stdout);
+    }
+    
+    *nfiles_open = nfiles;
+
+    free(chunks);
+}
+
+/* ------------------------------------------------------------------------ */
+void usage(void) {
+    fprintf(stderr, "Usage: srf2fastq [-c] [-C] [-s root] [-n] [-p] archive_name ...\n");
+    fprintf(stderr, "\n");
+    fprintf(stderr, "       -c       Use calibrated quality values (CNF1)\n");
+    fprintf(stderr, "       -C       Ignore bad reads\n");
+    fprintf(stderr, "\n");
+    fprintf(stderr, "       -s root  Split the fastq files, one for each region in the REGN chunk.\n");
+    fprintf(stderr, "                The files are named root_ + the name of the region.\n");
+    fprintf(stderr, "       -S       Sequentially display regions rather than append them into\n");
+    fprintf(stderr, "                one long read. (conflicts with -s)\n");
+    fprintf(stderr, "\n");
+    fprintf(stderr, "       -n       Ignore REGN names: use region index.\n");
+    fprintf(stderr, "                i.e. root_1, root_2 etc.\n");
+    fprintf(stderr, "       -a       Append region index to name\n");
+    fprintf(stderr, "                i.e. name/1, name/2 etc.\n");
+    fprintf(stderr, "       -e       Include explicit sequence: the names of the regions of type 'E'\n");
+    fprintf(stderr, "\n");
+    fprintf(stderr, "       -r 1,2.. In a comma seperated list, specify which regions to reverse,\n");
+    fprintf(stderr, "                counting from 1. This will reverse complement the read and\n");
+    fprintf(stderr, "                reverse the quality scores. (requires -s or -S)\n");
+    exit(1);
+}
+
+int main(int argc, char **argv) {
+    int calibrated = 0;
+    int mask = 0, i;
+    int sequential = 0;
+    int split = 0;
+    int numeric = 0;
+    int append = 0;
+    int explicit = 0;
+    char root[FILENAME_MAX];
+    int nfiles_open = 0;
+    char *filenames[MAX_REGIONS];
+    FILE *files[MAX_REGIONS];
+    int reverse[MAX_REGIONS], reverse_set = 0;
+
+    memset(reverse, 0, MAX_REGIONS * sizeof(int));
+
+    /* Parse args */
+    for (i = 1; i < argc && argv[i][0] == '-'; i++) {
+	if (!strcmp(argv[i], "-")) {
+	    break;
+	} else if (!strcmp(argv[i], "-C")) {
+	    mask = SRF_READ_FLAG_BAD_MASK;
+	} else if (!strcmp(argv[i], "-c")) {
+	    calibrated = 1;
+	} else if (!strcmp(argv[i], "-s")) {
+            split = 1;
+            strcpy(root, argv[++i]);
+	} else if (!strcmp(argv[i], "-S")) {
+            sequential = 1;
+	} else if (!strcmp(argv[i], "-n")) {
+            numeric = 1;
+	} else if (!strcmp(argv[i], "-a")) {
+            append = 1;
+	} else if (!strcmp(argv[i], "-e")) {
+            explicit = 1;
+        } else if (!strcmp(argv[i], "-r")) {
+	    char *cp, *cpend;
+
+            /* Figure out which ends to reverse */
+	    if (++i == argc)
+		usage();
+
+	    cp = argv[i];
+	    do {
+		long l = (int)strtol(cp, &cpend, 10);
+		if (cpend - cp && l >= 1 && l <= MAX_REGIONS)
+		    reverse[l-1] = 1;
+		cp = cpend+1;
+	    } while (*cpend);
+
+	    reverse_set = 1;
+	} else {
+	    usage();
+	}
+    }    
+
+    if (i == argc) {
+	usage();
+    }
+
+    if ( sequential && split ) {
+        fprintf(stderr, "ERROR: Parameters -s and -S conflict!\n");
+        usage();
+    }
+
+    if ( reverse_set && ! (sequential || split) ) {
+	fprintf(stderr, "ERROR: The -r parameter is only supported when "
+		"spliting sequences by region.\n");
+	usage();
+    }
+
+    read_sections(READ_BASES);
+    init_qlookup();
+
+#ifdef _WIN32
+    _setmode(_fileno(stdout), _O_BINARY);
+#endif
+
+    for (; i < argc; i++) {
+	char *ar_name;
+	srf_t *srf;
+        HashTable *regn_hash;
+	char name[512];
+	ztr_t *ztr;
+
+	ar_name = argv[i];
+
+	if (NULL == (srf = srf_open(ar_name, "r"))) {
+	    perror(ar_name);
+	    return 4;
+	}
+
+        if (NULL == (regn_hash = HashTableCreate(0,HASH_DYNAMIC_SIZE|HASH_FUNC_JENKINS3))) {
+	    return 1;
+        }
+    
+	while (NULL != (ztr = srf_next_ztr(srf, name, mask))) {
+            ztr2fastq(ztr, name, calibrated, sequential, split, root, numeric,
+		      append, explicit, regn_hash, &nfiles_open, filenames,
+		      files, reverse);
+	    delete_ztr(ztr);
+	}
+
+	srf_destroy(srf, 1);
+    }
+
+    return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/progs/srf_dump_all.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,1190 @@
+/*
+ * ======================================================================
+ * This software has been created by Genome Research Limited (GRL).
+ *
+ * GRL hereby grants permission to use, copy, modify and distribute
+ * this software and its documentation for non-commercial purposes
+ * without fee at the user's own risk on the basis set out below.
+ *
+ * GRL neither undertakes nor accepts any duty whether contractual or
+ * otherwise in connection with the software, its use or the use of
+ * any derivative, and makes no representations or warranties, express
+ * or implied, concerning the software, its suitability, fitness for
+ * a particular purpose or non-infringement.
+ *
+ * In no event shall the authors of the software or GRL be responsible
+ * or liable for any loss or damage whatsoever arising in any way
+ * directly or indirectly out of the use of this software or its
+ * derivatives, even if advised of the possibility of such damage.
+ *
+ * Our software can be freely distributed under the conditions set out
+ * above, and must contain this copyright notice.
+ * ======================================================================
+ */
+
+/*
+ * This performs a linear (non-indexed) search for a trace in an SRF archive.
+ *
+ * It's not intended as a suitable production program or as a library of code
+ * to use, but as a test and benchmark statistic.
+ */
+
+#include <string.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <ctype.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <io_lib/Read.h>
+#include <io_lib/misc.h>
+#include <io_lib/ztr.h>
+#include <io_lib/srf.h>
+
+/* Fix MinGW's mkdir which only accepts one argument */
+#if defined(__MINGW32__)
+#    define mkdir(filename,mode) mkdir((filename))
+#endif
+
+#define CR 13            /* Decimal code of Carriage Return char */
+#define LF 10            /* Decimal code of Line Feed char */
+#define EOF_MARKER 26    /* Decimal code of DOS end-of-file marker */
+#define MAX_REC_LEN 1024 /* Maximum size of input buffer */
+
+#define SEQ (1 << 0)
+#define PRB (1 << 1)
+#define SIG2 (1 << 2)
+#define INT (1 << 3)
+#define NSE (1 << 4)
+#define ALL (SEQ | PRB | SIG2 | INT | NSE)
+
+#define SEQ_STR "seq"
+#define PRB_STR "prb"
+#define SIG2_STR "sig2"
+#define INT_STR "int"
+#define NSE_STR "nse"
+#define ALL_STR "all"
+
+#define TEXT (1 << 0)
+#define SOLEXA (1 << 1)
+
+#define TEXT_STR "text"
+#define SOLEXA_STR "solexa"
+
+#define CONSOLE_DEST (1 << 0)
+#define FILE_DEST (1 << 1)
+#define NONE_DEST (1 << 2)
+
+#define CONSOLE_STR "console"
+#define FILE_STR "file"
+#define NONE_STR "none"
+
+#define MAX_CYCLES 500
+
+/* ------------------------------------------------------------------------ */
+
+/*
+ * All the reads and prefixes will be used to filter reads in an srf archive.
+ * For reads the match with the reads in the archive must be exact.  Prefixes
+ * need only match to the beginning of the read, so they are a way to filter
+ * several reads that, for example, belong to the same lane and tile.  For
+ * example, if the reads are <Center>:<Run>:<Lane>:<Tile>:<X>:<Y>, then a
+ * prefix can progress from center all the way to y coordinate in terms of
+ * read specificity.
+ */
+typedef struct {
+    int prefixes_size;
+    int reads_size;
+    char** prefixes;  /* Prefixes to filter on. */
+    char** reads;     /* Reads to filter on. */
+} read_filter_t;
+
+/* ------------------------------------------------------------------------ */
+
+/* Find the first non-digit character in the name and make it variable. */
+int parse_int_from_name(const char *name, int *variable, size_t *i, const char *variable_name) {
+    size_t last = *i;
+    while (*i >= 0 && isdigit(name[*i])) {
+	--(*i);
+    }
+
+    if(*i < 0 || last == *i) {
+	fprintf(stderr, "Bad read name \"%s\" for \"%s\".  Read name needs to follow pattern of:\n", name, variable_name);
+	fprintf(stderr, "\"prefix<separator><lane><separator><tile><separator><x><separator><y>\"\n");
+	fprintf(stderr, "where lane, tile, x and y all consist of digits and the separators consist of non-numeric characters.\n");
+	*variable = 0;
+	return -1;
+    }
+
+    *variable = atoi(&name[(*i)+1]);
+    --(*i);
+
+    return 0;
+}
+
+/*
+ * Parses a name assuming it consists of:
+ * prefix<separator><lane><separator><tile><separator><x><separator><y>
+ *
+ * We fill out the supplied lane, tile, x and y parameters, or set them to
+ * 0, 0, 0 and 0 if unknown.
+ *
+ * Returns 0 for success
+ *        -1 for failure (unknown)
+ */
+int parse_name(char *name, int *lane, int *tile, int *x, int *y) {
+    size_t len = strlen(name);
+    size_t i = len-1;
+    int result = 0;
+
+    /* Find the first non-digit character in the name and make it y. */
+    if(result = parse_int_from_name(name, y, &i, "y"))
+	return result;
+    
+    /* Find the second non-digit character in the name and make it x. */
+    if(result = parse_int_from_name(name, x, &i, "x"))
+	return result;
+
+    /* Find the third non-digit character in the name and make it the tile. */
+    if(result = parse_int_from_name(name, tile, &i, "tile"))
+	return result;
+
+    /* Find the fourth non-digit character in the name and make it the lane. */
+    if(result = parse_int_from_name(name, lane, &i, "lane"))
+	return result;
+
+    return 0;
+}
+
+/*
+ * Prints to the given file 4 values for every base in solexa format.  This is
+ * used to output int, nse and sig2 type reads.
+ */
+void dump_samples4_solexa(FILE *fp, int lane, int tile, int x, int y,
+			  int baseline, unsigned char *bytes, int nbytes) {
+    int i, j, nb;
+    int A[MAX_CYCLES], C[MAX_CYCLES], G[MAX_CYCLES], T[MAX_CYCLES];
+
+    nb = nbytes/8;
+
+    for (i = j = 0; i < nb; i++, j+= 2)
+	A[i] = (bytes[j] << 8) | bytes[j+1];
+
+    for (i = 0; i < nb; i++, j+= 2)
+	C[i] = (bytes[j] << 8) | bytes[j+1];
+
+    for (i = 0; i < nb; i++, j+= 2)
+	G[i] = (bytes[j] << 8) | bytes[j+1];
+
+    for (i = 0; i < nb; i++, j+= 2)
+	T[i] = (bytes[j] << 8) | bytes[j+1];
+
+    fprintf(fp, "%d\t%d\t%d\t%d", lane, tile, x, y);
+    for (i = 0; i < nb; i++)
+	fprintf(fp, "\t%d %d %d %d",
+		A[i] - baseline,
+		C[i] - baseline,
+		G[i] - baseline,
+		T[i] - baseline);
+    fprintf(fp, "\n");
+}
+
+/*
+ * Prints to the given file 4 values for every base in solexa format.  This is
+ * used to output prb type reads.
+ */
+void dump_conf4_solexa(FILE *fp, char *seq, signed char *bytes, int nbytes) {
+    int i, j, nb;
+    int A[MAX_CYCLES], C[MAX_CYCLES], G[MAX_CYCLES], T[MAX_CYCLES];
+
+    nb = nbytes/4;
+
+    for (i = 0, j = nb; i < nb; i++) {
+	switch(seq[i]) {
+	case 'A': case 'a':
+	    A[i] = bytes[i];
+	    C[i] = bytes[j++];
+	    G[i] = bytes[j++];
+	    T[i] = bytes[j++];
+	    break;
+	case 'C': case 'c':
+	    A[i] = bytes[j++];
+	    C[i] = bytes[i];
+	    G[i] = bytes[j++];
+	    T[i] = bytes[j++];
+	    break;
+	case 'G': case 'g':
+	    A[i] = bytes[j++];
+	    C[i] = bytes[j++];
+	    G[i] = bytes[i];
+	    T[i] = bytes[j++];
+	    break;
+	default:
+	    A[i] = bytes[j++];
+	    C[i] = bytes[j++];
+	    G[i] = bytes[j++];
+	    T[i] = bytes[i];
+	    break;
+	}
+    }
+
+    for (i = 0; i < nb; i++) {
+	if (i)
+	    fputc('\t', fp);
+	fprintf(fp, "%4d %4d %4d %4d", A[i], C[i], G[i], T[i]);
+    }
+
+    fprintf(fp, "\n");
+}
+
+/*
+ * Prints a read in solexa format.  Depending on the given chunk type mode,
+ * only some of the chunks are printed out for every read.  The files are
+ * given in the following order: seq, prb, sig2, int, nse.  The files must
+ * already be open.
+ */
+void dump_solexa(ztr_t *z, char *name, char mode, FILE **files) {
+    int i, nc;
+    ztr_chunk_t **chunks;
+    char *seq;
+    int lane, tile, x, y;
+    parse_name(name, &lane, &tile, &x, &y);
+
+    uncompress_ztr(z);
+
+    chunks = ztr_find_chunks(z, ZTR_TYPE_BASE, &nc);
+    if (nc != 1) {
+	fprintf(stderr, "Zero or greater than one BASE chunks found.\n");
+	return;
+    }
+    seq = chunks[0]->data+1;
+
+    /* Sequence */
+    if (mode & SEQ) {
+	fprintf(files[0], "%d\t%d\t%d\t%d\t%.*s\n",
+		lane, tile, x, y,
+		chunks[0]->dlength-1,
+		chunks[0]->data+1);
+    }
+
+    /* Confidence */
+    if (mode & PRB) {
+	chunks = ztr_find_chunks(z, ZTR_TYPE_CNF4, &nc);
+	if (nc != 1) {
+	    fprintf(stderr, "Zero or greater than one CNF chunks found.\n");
+	    return;
+	}
+
+	dump_conf4_solexa(files[1], seq, chunks[0]->data+1, chunks[0]->dlength-1);
+    }
+
+    /* Traces */
+    if (mode & SIG2) {
+	chunks = ztr_find_chunks(z, ZTR_TYPE_SMP4, &nc);
+	for (i = 0; i < nc; i++) {
+	    char *key = ztr_lookup_mdata_value(z, chunks[i], "TYPE");
+	    if (!key || 0 == strcmp(key, "PROC")) {
+		key = ztr_lookup_mdata_value(z, chunks[i], "OFFS");
+		dump_samples4_solexa(files[2], lane, tile, x, y, key ? atoi(key) : 0,
+				     chunks[i]->data+2, chunks[i]->dlength-2);
+		break;
+	    }
+	}
+    }
+
+    if (mode & INT) {
+	chunks = ztr_find_chunks(z, ZTR_TYPE_SMP4, &nc);
+	for (i = 0; i < nc; i++) {
+	    char *key = ztr_lookup_mdata_value(z, chunks[i], "TYPE");
+	    if (key && 0 == strcmp(key, "SLXI")) {
+		key = ztr_lookup_mdata_value(z, chunks[i], "OFFS");
+		dump_samples4_solexa(files[3], lane, tile, x, y, key ? atoi(key) : 0,
+				     chunks[i]->data+2, chunks[i]->dlength-2);
+		break;
+	    }
+	}
+    }
+
+    if (mode & NSE) {
+	chunks = ztr_find_chunks(z, ZTR_TYPE_SMP4, &nc);
+	for (i = 0; i < nc; i++) {
+	    char *key = ztr_lookup_mdata_value(z, chunks[i], "TYPE");
+	    if (key && 0 == strcmp(key, "SLXN")) {
+		key = ztr_lookup_mdata_value(z, chunks[i], "OFFS");
+		dump_samples4_solexa(files[4], lane, tile, x, y, key ? atoi(key) : 0,
+				     chunks[i]->data+2, chunks[i]->dlength-2);
+		break;
+	    }
+	}
+    }
+}
+
+/*
+ * Ripped out of io_lib's trace_dump program.
+ * It reformats a trace to as printable ASCII.
+ */
+void dump_text(ztr_t *z, char *name, char mode, FILE **files) {
+    Read *read;
+    int i;
+
+    uncompress_ztr(z);
+    read = ztr2read(z); /* Inefficient; can do direct */
+
+    if (read == NULL) {
+        fprintf(stderr, "Tracedump was unable to open file %s\n", name );
+        return;
+    }
+
+    fprintf(files[0], "[Trace]\n");
+    fprintf(files[0], "%s\n", name);
+
+    fprintf(files[0], "\n[Header]\n");
+    fprintf(files[0], "%d\t\t# format\n",          read->format);
+    fprintf(files[0], "%d\t\t# NPoints\n",         read->NPoints);
+    fprintf(files[0], "%d\t\t# NBases\n",          read->NBases);
+    fprintf(files[0], "%d\t\t# NFlows\n",          read->nflows);
+    fprintf(files[0], "%d\t\t# maxTraceVal\n",     (int)read->maxTraceVal-read->baseline);
+    fprintf(files[0], "%d\t\t# baseline\n",        read->baseline);
+    fprintf(files[0], "%d\t\t# leftCutoff\n",      read->leftCutoff);
+    fprintf(files[0], "%d\t\t# rightCutoff\n",     read->rightCutoff);
+
+    fputs("\n[Bases]\n", files[0]);
+    for (i = 0; i < read->NBases; i++) {
+        fprintf(files[0], "%c %05d %+03d %+03d %+03d %+03d #%3d\n",
+		read->base[i],
+		read->basePos ? read->basePos[i] : 0,
+		(int)read->prob_A[i],
+		(int)read->prob_C[i],
+		(int)read->prob_G[i],
+		(int)read->prob_T[i],
+		i);
+    }
+
+    if (read->NPoints) {
+	fputs("\n[A_Trace]\n", files[0]);
+	for(i = 0; i < read->NPoints; i++)
+	    fprintf(files[0], "%d\t#%5d\n", (int)read->traceA[i] - read->baseline, i);
+
+	fputs("\n[C_Trace]\n", files[0]);
+	for(i = 0; i < read->NPoints; i++)
+	    fprintf(files[0], "%d\t#%5d\n", (int)read->traceC[i] - read->baseline, i);
+
+	fputs("\n[G_Trace]\n", files[0]);
+	for(i = 0; i < read->NPoints; i++)
+	    fprintf(files[0], "%d\t#%5d\n", (int)read->traceG[i] - read->baseline, i);
+
+	fputs("\n[T_Trace]\n", files[0]);
+	for(i = 0; i < read->NPoints; i++)
+	    fprintf(files[0], "%d\t#%5d\n", (int)read->traceT[i] - read->baseline, i);
+    }
+
+    if (read->flow_order) {
+        fputs("\n[Flows]\n", files[0]);
+        for (i = 0; i < read->nflows; i++) {
+            fprintf(files[0], "%c %5.2f  %u\t#%5d\n",
+		    read->flow_order[i],
+		    read->flow ? read->flow[i] : 0,
+		    read->flow_raw ? read->flow_raw[i] : 0,
+		    i);
+        }
+    }
+
+    if (read->info) {
+        fputs("\n[Info]\n", files[0]);
+        fprintf(files[0], "%s\n", read->info);
+    }
+
+    read_deallocate(read);
+}
+
+/*
+ * Print usage message to stderr and exit with the given \"code\".
+ */
+void usage(int code) {
+    fprintf(stderr, "Usage: srf_dump_all [-c chunk_types] [-d destination_types]  [-f read_filter] [-n] [-o] [-t type_of_output] archive_name\n");
+    fprintf(stderr, "Options:\n");
+    fprintf(stderr, "    -c chunk_types\n");
+    fprintf(stderr, "              Chunk types to output given as a comma delimited list of types.\n");
+    fprintf(stderr, "              The following types are allowed: \"all\", \"seq\", \"prb\",\n");
+    fprintf(stderr, "              \"int\", \"nse\", \"sig2\".\n");
+    fprintf(stderr, "              The default is \"all\".\n");
+    fprintf(stderr, "\n    -d destination_types\n");
+    fprintf(stderr, "              Distinations to output to.\n");
+    fprintf(stderr, "              The following types are allowed: \"console\", \"file\", \"none\".\n");
+    fprintf(stderr, "              The default is \"console\".  Console and file can be together, \n"
+	    "              but none is exclusive.\n");
+    fprintf(stderr, "\n    -f read_filter\n");
+    fprintf(stderr, "              The filter to apply to reads in the archive.  If reads match the\n");
+    fprintf(stderr, "              filter they are dumped.\n");
+    fprintf(stderr, "              The filter takes the form of <name>=<value>, where <name> can be\n");
+    fprintf(stderr, "              \"read\", \"prefix\", \"file\".\n");
+    fprintf(stderr, "              If the <name> is \"read\" the value is represents the name of a\n");
+    fprintf(stderr, "              read to dump.  Only the matching read will be dumped.\n");
+    fprintf(stderr, "              If the <name> is \"prefix\" the value is represents the prefix of\n");
+    fprintf(stderr, "              the name of the reads to dump.  Only the matching reads will be\n              dumped.\n");
+    fprintf(stderr, "              If the <name> is \"file\" the value is a file name where any\n");
+    fprintf(stderr, "              number of \"read\" and \"prefix\" name value pairs can be included,\n              one per line.\n");
+    fprintf(stderr, "              The default is no filter, which means all reads are dumped.\n");
+    fprintf(stderr, "\n    -n        Output the total number of reads at the bottom.\n");
+    fprintf(stderr, "\n    -o        Output the total number of reads only.  Nothing else is output.\n");
+    fprintf(stderr, "\n    -t type_of_output\n");
+    fprintf(stderr, "              Type of output.  Only one value allowed.\n");
+    fprintf(stderr, "              Currently \"text\" and \"solexa\" is supported.\n");
+    fprintf(stderr, "              The default is \"text\".\n");
+    fprintf(stderr, "\n    -v        Print verbose messages.\n");
+    fprintf(stderr, "\n");
+
+    exit(code);
+}
+
+/*
+ * Reads the lines from the fiven \"input\" file and creates the reads and prefixes
+ * for the read filter.  The \"read_filter\" given is allocated.
+ *
+ * Returns 0 on success.  Errors cause the usage message and exit. 
+ */
+int read_filter_from_file(FILE *input, read_filter_t *read_filter)
+{
+    int   isNewline;              /* Boolean indicating we've read a CR or LF */
+    long  lFileLen;               /* Length of file */
+    long  lIndex;                 /* Index into cThisLine array */
+    long  lLineCount;             /* Current line number */
+    long  lLineLen;               /* Current line length */
+    long  lStartPos;              /* Offset of start of current line */
+    long  lTotalChars;            /* Total characters read */
+    char  cThisLine[MAX_REC_LEN]; /* Contents of current line */
+    char *cFile;                  /* Dynamically allocated buffer (entire file) */
+    char *cThisPtr;               /* Pointer to current position in cFile */
+
+    char *filter_type;
+    char *prefix;
+    char *read;
+
+    fseek(input, 0L, SEEK_END);  /* Position to end of file */
+    lFileLen = ftell(input);     /* Get file length */
+    rewind(input);               /* Back to start of file */
+
+    cFile = calloc(lFileLen + 1, sizeof(char));
+
+    if(cFile == NULL )
+	{
+	    fprintf(stderr, "\nInsufficient memory to read file.\n");
+	    return 0;
+	}
+
+    fread(cFile, lFileLen, 1, input); /* Read the entire file into cFile */
+
+    lLineCount  = 0L;
+    lTotalChars = 0L;
+
+    cThisPtr    = cFile;              /* Point to beginning of array */
+
+    while (*cThisPtr)                 /* Read until reaching null char */
+	{
+	    lIndex    = 0L;                 /* Reset counters and flags */
+	    isNewline = 0;
+	    lStartPos = lTotalChars;
+
+	    while (*cThisPtr)               /* Read until reaching null char */
+		{
+		    if (!isNewline)               /* Haven't read a CR or LF yet */
+			{
+			    if (*cThisPtr == CR || *cThisPtr == LF) /* This char IS a CR or LF */
+				isNewline = 1;                        /* Set flag */
+			}
+
+		    else if (*cThisPtr != CR && *cThisPtr != LF) /* Already found CR or LF */
+			break;                                     /* Done with line */
+
+		    /* Don't copy LS or CR */
+		    if (*cThisPtr != CR && *cThisPtr != LF) {
+			cThisLine[lIndex++] = *cThisPtr++; /* Add char to output and increment */
+			++lTotalChars;
+		    } else {
+			cThisPtr++;
+		    }
+
+		} /* end while (*cThisPtr) */
+
+	    cThisLine[lIndex] = '\0';     /* Terminate the string */
+	    ++lLineCount;                 /* Increment the line counter */
+	    lLineLen = strlen(cThisLine); /* Get length of line */
+
+	    /* Find the one and only = in the string. */
+	    if(strchr(cThisLine,'=') != NULL && (strchr(cThisLine,'=') == strrchr(cThisLine,'='))) {
+		filter_type = strtok (cThisLine, "=");
+	    } else {
+		fprintf(stderr, "Baddly formatted read filter \"%s\".  Expected an \"=\" character in middle of filter.\n", cThisLine);
+		usage(1);
+	    }
+
+	    if (!strcmp(filter_type, "prefix")) {
+		prefix = strtok (NULL, "=");
+		if(prefix == NULL) {
+		    fprintf(stderr, "Bad prefix \"%s\" in read filter \"%s\".\n", prefix, cThisLine);
+		    usage(1);
+		} else {
+		    ++(read_filter->prefixes_size);
+		    read_filter->prefixes = (char**) realloc (read_filter->prefixes, read_filter->prefixes_size * sizeof(char *));
+		    read_filter->prefixes[read_filter->prefixes_size - 1] =  (char*) calloc (strlen(prefix) + 1,sizeof(char));
+		    strcpy(read_filter->prefixes[read_filter->prefixes_size - 1], prefix);
+		}
+	    } else if (!strcmp(filter_type, "read")) {
+		read = strtok (NULL, "=");
+		if(read == NULL) {
+		    fprintf(stderr, "Bad read \"%s\" in read filter \"%s\".\n", read, cThisLine);
+		    usage(1);
+		} else {
+		    ++(read_filter->reads_size);
+		    read_filter->reads = (char**) realloc (read_filter->reads, read_filter->reads_size * sizeof(char *));
+		    read_filter->reads[read_filter->reads_size - 1] =  (char*) calloc (strlen(read) + 1,sizeof(char));
+		    strcpy(read_filter->reads[read_filter->reads_size - 1], read);
+		}
+	    } else {
+		fprintf(stderr, "Unrecognized filter type \"%s\" given as part of read filter \"%s\".  The valid filter types are \"%s\".\n", filter_type, cThisLine, "prefix or read");
+		usage(1);
+	    }
+
+	}
+
+    free(cFile);
+    return 0;
+}
+
+/*
+ * Parse the given \"filter_value\" string for the filter value.
+ *
+ * Returns a read filter allocated on the heap which needs to be freed by the
+ * calling function. Errors usually cause the usage message and exit.
+ */
+read_filter_t *get_read_filter(char *filter_value)
+{
+    char *filter_type = NULL;
+    char *file_name = NULL;
+    FILE *fp = NULL;
+    char *prefix = NULL;
+    char *read = NULL;
+
+    /* Create read filter. */
+    read_filter_t *read_filter = (read_filter_t *)calloc(1, sizeof(read_filter_t));
+    if(read_filter == NULL) {
+	return NULL;
+    }
+    read_filter->prefixes_size = 0;
+    read_filter->reads_size = 0;
+
+    /* Find the one and only = in the string. */
+    if( strchr(filter_value,'=') != NULL &&
+	(strchr(filter_value,'=') == strrchr(filter_value,'=')) ) {
+	filter_type = strtok (filter_value,"=");
+    } else {
+        fprintf(stderr, "Baddly formatted read filter \"%s\".  Expected an \"=\" character in middle of filter.\n", filter_value);
+        usage(1);
+    }
+
+    /* Check the string before the = is a valid filter type. */
+    if(!strcmp("file", filter_type)) {
+
+        /* Read the file. */
+	file_name = strtok (NULL, "=");
+	if(file_name == NULL) {
+	    fprintf(stderr, "Bad file name \"%s\" in read filter \"%s\".\n", file_name, filter_value);
+	    usage(1);
+	}
+	fp = fopen(file_name, "r");
+	if(fp == NULL) {
+            fprintf(stderr, "Bad file name \"%s\" in read filter \"%s\".\n", file_name, filter_value);
+	    usage(1);
+	}
+
+	/* Read line by line. */
+	if(read_filter_from_file(fp, read_filter)) {
+	    fprintf(stderr, "Bad contents of file %s.\n", file_name);
+	    usage(1);
+	}
+
+    } else if (!strcmp("prefix", filter_type)) {
+	prefix = strtok (NULL, "=");
+	if(prefix == NULL) {
+	    fprintf(stderr, "Bad prefix \"%s\" in read filter \"%s\".\n", prefix, filter_value);
+	    usage(1);
+	} else {
+	    ++(read_filter->prefixes_size);
+	    read_filter->prefixes = (char**) malloc (read_filter->prefixes_size * sizeof(char *));
+	    read_filter->prefixes[read_filter->prefixes_size - 1] =  (char*) calloc (strlen(prefix) + 1,sizeof(char));
+	    strcpy(read_filter->prefixes[read_filter->prefixes_size - 1], prefix);
+	}
+    } else if (!strcmp("read", filter_type)) {
+	read = strtok (NULL, "=");
+	if(read == NULL) {
+	    fprintf(stderr, "Bad read \"%s\" in read filter \"%s\".\n", read, filter_value);
+	    usage(1);
+	} else {
+	    ++(read_filter->reads_size);
+	    read_filter->reads = (char**) malloc (read_filter->reads_size * sizeof(char *));
+	    read_filter->reads[read_filter->reads_size - 1] =  (char*) calloc (strlen(read) + 1, sizeof(char));
+	    strcpy(read_filter->reads[read_filter->reads_size - 1], read);
+	}
+    } else {
+	fprintf(stderr, "Unrecognized filter type \"%s\" given as part of read filter \"%s\".  The valid filter types are \"%s\".\n", filter_type, filter_value, "prefix, read, or file");
+	usage(1);
+    }
+
+    return read_filter;
+}
+
+/*
+ * Parse the comma delimited list of chunk types and put them in the single character \"mode\".
+ *
+ * Returns 0 on success.
+ */
+int get_chunk_types(char *arg, char *mode) {
+    int num_allowed_types = 6;
+    char *allowed_str_types[] = {SEQ_STR, INT_STR, NSE_STR, PRB_STR, SIG2_STR, ALL_STR};
+    char allowed_types[] = {SEQ, INT, NSE, PRB, SIG2, ALL};
+    char *type;
+    int i = 0;
+
+    type = strtok (arg,",");
+    while(type) {
+	for(i = 0; i < num_allowed_types; i++) {
+	    if(!strcmp(type, allowed_str_types[i]) && !(*mode & allowed_types[i])) {
+		*mode += allowed_types[i];
+		break;
+	    }
+	}
+        type = strtok (NULL, ",");
+    }
+
+    return 0;
+}
+
+/*
+ * Parse the output format type and put it in the single character \"mode\".
+ *
+ * Returns 0 on success.
+ */
+int get_type_of_output(char *arg, char *mode) {
+    int num_allowed_types = 2;
+    char *allowed_str_types[] = {TEXT_STR, SOLEXA_STR};
+    char allowed_types[] = {TEXT, SOLEXA};
+    int i = 0;
+
+    for(i = 0; i < num_allowed_types; i++) {
+	if(!strcmp(arg, allowed_str_types[i])) {
+	    *mode = allowed_types[i];
+	    break;
+	}
+    }
+
+    return 0;
+}
+
+/*
+ * Parse the comma delimited list of destination types and put them in the single characted "\mode\".
+ *
+ * Returns 0 on success.
+ */
+int get_destination_types(char *arg, char *mode) {
+    int num_allowed_types = 6;
+    char *allowed_str_types[] = {CONSOLE_STR, FILE_STR, NONE_STR};
+    char allowed_types[] = {CONSOLE_DEST, FILE_DEST, NONE_DEST};
+    char *type;
+    int i = 0;
+
+    type = strtok (arg,",");
+    while(type) {
+	for(i = 0; i < num_allowed_types; i++) {
+	    if(!strcmp(type, allowed_str_types[i]) && !(*mode & allowed_types[i])) {
+		*mode += allowed_types[i];
+		break;
+	    }
+	}
+        type = strtok (NULL, ",");
+    }
+
+    /* NONE_DEST is exclusive, ignore others. */
+    if(*mode & NONE_DEST) {
+	*mode = NONE_DEST;
+    }
+
+    return 0;
+}
+
+/*
+ * Returns 1 is the read \"name\" matches any of the reads or prefixes in the \"read_filter\".
+ */
+int check_read_name(read_filter_t *read_filter, char *name) {
+    int i;
+
+    for(i = 0; i < read_filter->prefixes_size; i++) {
+	if(name == strstr(name, read_filter->prefixes[i])) {
+	    return 1;
+	}
+    }
+
+    for(i = 0; i < read_filter->reads_size; i++) {
+	if(!strcmp(name, read_filter->reads[i])) {
+	    free(read_filter->reads[i]);
+	    read_filter->reads[i] = read_filter->reads[read_filter->reads_size - 1];
+	    read_filter->reads_size--;
+	    return 1;
+	}
+    }
+
+    return 0;
+}
+
+void dump_read_filter(read_filter_t *read_filter) {
+    int i;
+
+    printf("Read filter used:\n");
+
+    for(i = 0; i < read_filter->prefixes_size; i++) {
+	printf("\tprefix[%d] = %s\n", i, read_filter->prefixes[i]);
+    }
+
+    for(i = 0; i < read_filter->reads_size; i++) {
+	printf("\tread[%d] = %s\n", i, read_filter->reads[i]);
+    }
+}
+
+void dump_chunk_mode(char mode) {
+    printf("mode: %d.\n", mode);
+
+    if(mode & SEQ) {
+	printf("SEQ required.\n");
+    }
+    if(mode & INT) {
+	printf("INT required.\n");
+    }
+    if(mode & NSE) {
+	printf("NSE required.\n");
+    }
+    if(mode & PRB) {
+	printf("PRB required.\n");
+    }
+    if(mode & SIG2) {
+	printf("SIG2 required.\n");
+    }
+}
+
+void dump_type_mode(char mode) {
+    printf("mode: %d.\n", mode);
+
+    if(mode & TEXT) {
+	printf("TEXT required.\n");
+    }
+    if(mode & SOLEXA) {
+	printf("SOLEXA required.\n");
+    }
+}
+
+void dump_destination_mode(char mode) {
+    printf("mode: %d.\n", mode);
+
+    if(mode & CONSOLE_DEST) {
+	printf("CONSOLE required.\n");
+    }
+    if(mode & FILE_DEST) {
+	printf("FILE required.\n");
+    }
+    if(mode & NONE_DEST) {
+	printf("NONE required.\n");
+    }
+}
+
+/*
+ * Open the solexa format file given the directory, lane, tile, and file type.
+ * Uses solexa file naming conventions to create the file.
+ *
+ * Returns the successfully opened file or NULL.
+ */
+FILE *fopen_slx(char *dir, char *type, int lane, int tile) {
+    char fn[1024];
+    FILE *fp;
+
+    sprintf(fn, "%s/s_%d_%04d_%s.txt", dir, lane, tile, type);
+    printf("Opening file %s\n", fn);
+    if (NULL == (fp = fopen(fn, "w+"))) {
+	perror(fn);
+	return NULL;
+    }
+
+    return fp;
+}
+
+/*
+ * Given the archive name (ar_name), the chunk types to output (chunk_mode),
+ * and some other parameters such as the read filter, open various files and
+ * dumps solexa formated output to those files.  The number of reads is updated
+ * in the \"num_reads\" parameter.
+ *
+ * Returns 0 on success.
+ */
+int process_srf_to_solexa_files(char *ar_name, char chunk_mode, int num_reads_only_mode, int filter_mode, read_filter_t *read_filter, long *num_reads) {
+    srf_t *srf;
+    char name[1024], dir2[1024];
+    ztr_t *ztr;
+    int last_lane = 0, last_tile = 0;
+    /*               seq   prb   sig2  int   nse */
+    FILE *files[] = {NULL, NULL, NULL, NULL, NULL};
+
+    if (NULL == (srf = srf_open(ar_name, "rb"))) {
+	perror(ar_name);
+	return 1;
+    }
+
+    char *cp = strrchr(ar_name, '.');
+    if (cp) *cp = 0;
+    sprintf(dir2, "%s.run", ar_name);
+    mkdir(dir2, 0777);
+
+    while (NULL != (ztr = srf_next_ztr(srf, name, 0))) {
+	int lane, tile, x, y;
+
+	parse_name(name, &lane, &tile, &x, &y);
+
+	if (last_lane != lane || last_tile != tile) {
+	    fprintf(stderr, "New tile: %d/%d\n", lane, tile);
+	    last_lane = lane;
+	    last_tile = tile;
+
+	    if (files[0]) { fclose(files[0]); files[0] = NULL; }
+	    if (files[1]) { fclose(files[1]); files[1] = NULL; }
+	    if (files[2]) { fclose(files[2]); files[2] = NULL; }
+	    if (files[3]) { fclose(files[3]); files[3] = NULL; }
+	    if (files[4]) { fclose(files[4]); files[4] = NULL; }
+
+	    if (chunk_mode & SEQ) {
+		files[0] = fopen_slx(dir2, "seq", lane, tile);
+	    }
+	    if (chunk_mode & PRB) {
+		files[1] = fopen_slx(dir2, "prb", lane, tile);
+	    }
+	    if (chunk_mode & SIG2) {
+		files[2] = fopen_slx(dir2, "sig2", lane, tile);
+	    }
+	    if (chunk_mode & INT) {
+		files[3] = fopen_slx(dir2, "int", lane, tile);
+	    }
+	    if (chunk_mode & NSE) {
+		files[4] = fopen_slx(dir2, "nse", lane, tile);
+	    }
+	}
+
+	if(!num_reads_only_mode) {
+	    if(!filter_mode || (filter_mode && check_read_name(read_filter, name))) {
+		dump_solexa(ztr, name, chunk_mode, files);
+		++(*num_reads);
+	    }
+	} else {
+	    ++(*num_reads);
+	}
+
+	delete_ztr(ztr);
+    }
+
+    if (files[0]) fclose(files[0]);
+    if (files[1]) fclose(files[1]);
+    if (files[2]) fclose(files[2]);
+    if (files[3]) fclose(files[3]);
+    if (files[4]) fclose(files[4]);
+
+    srf_destroy(srf, 1);
+    return 0;
+}
+
+/*
+ * Open the text format file given the directory, lane and tile.
+ * Uses solexa file naming conventions to create the file, except that the file
+ * has a \"dump.txt\" type.
+ *
+ * Returns the successfully opened file or NULL.
+ */
+FILE *fopen_text(char *dir, int lane, int tile) {
+    char fn[1024];
+    FILE *fp;
+
+    sprintf(fn, "%s/s_%d_%04d_dump.txt", dir, lane, tile);
+    if (NULL == (fp = fopen(fn, "w+"))) {
+	perror(fn);
+	return NULL;
+    }
+
+    return fp;
+}
+
+/*
+ * Given the archive name (ar_name), the chunk types to output (chunk_mode),
+ * and some other parameters such as the read filter, open one file and dumps
+ * text formatted output to that file.  The number of reads is updated in the
+ * \"num_reads\" parameter.
+ *
+ * Returns 0 on success.
+ */
+int process_srf_to_text_files(char *ar_name, char chunk_mode, int num_reads_only_mode, int filter_mode, read_filter_t *read_filter, long *num_reads) {
+    srf_t *srf;
+    char name[1024], dir2[1024];
+    ztr_t *ztr;
+    int last_lane = 0, last_tile = 0;
+    /*               dump */
+    FILE *files[] = {NULL};
+
+    if (NULL == (srf = srf_open(ar_name, "rb"))) {
+	perror(ar_name);
+	return 1;
+    }
+
+    char *cp = strrchr(ar_name, '.');
+    if (cp) *cp = 0;
+    sprintf(dir2, "%s.run", ar_name);
+    mkdir(dir2, 0777);
+
+    while (NULL != (ztr = srf_next_ztr(srf, name, 0))) {
+	int lane, tile, x, y;
+
+	parse_name(name, &lane, &tile, &x, &y);
+
+	if (last_lane != lane || last_tile != tile) {
+	    fprintf(stderr, "New tile: %d/%d\n", lane, tile);
+	    last_lane = lane;
+	    last_tile = tile;
+
+	    if (files[0]) { fclose(files[0]); files[0] = NULL; }
+
+	    if (chunk_mode) {
+		files[0] = fopen_text(dir2, lane, tile);
+	    }
+	}
+
+	if(!num_reads_only_mode) {
+	    if(!filter_mode || (filter_mode && check_read_name(read_filter, name))) {
+		dump_text(ztr, name, chunk_mode, files);
+		++(*num_reads);
+	    }
+	} else {
+	    ++(*num_reads);
+	}
+
+	delete_ztr(ztr);
+    }
+
+    if (files[0]) fclose(files[0]);
+
+    srf_destroy(srf, 1);
+    return 0;
+}
+
+/* ------------------------------------------------------------------------ */
+
+/*
+ * Main method.
+ */
+int main(int argc, char **argv) {
+    int i;
+    long num_reads = 0;
+    int num_reads_mode = 0;
+    int num_reads_only_mode = 0;
+    int filter_mode = 0;
+    char *ar_name = NULL;
+    srf_t *srf = NULL;
+    char name[512];
+    ztr_t *ztr = NULL;
+    read_filter_t *read_filter = NULL;
+    char *filter_value = NULL;
+
+    int c;
+    int errflg = 0;
+    extern char *optarg;
+    extern int optind, optopt;
+
+    char chunk_mode = ALL;
+    char type_mode = TEXT;
+    char destination_mode = CONSOLE_DEST;
+    FILE **files = NULL;
+    int verbose = 0;
+
+    if (argc < 2) {
+	fprintf(stderr, "Please specify an archive name.\n");
+	usage(1);
+    }
+
+    while ((c = getopt(argc, argv, ":c:d:f:not:v")) != -1) {
+        switch (c) {
+        case 'c':
+	    chunk_mode = 0;
+	    if(get_chunk_types(optarg, &chunk_mode) || !chunk_mode) {
+                fprintf(stderr,
+			"Invalid value \"%s\" given to option -%c.\n", optarg, c);
+		errflg++;
+	    }
+	    break;
+        case 'd':
+	    destination_mode = 0;
+	    if(get_destination_types(optarg, &destination_mode) || !destination_mode) {
+                fprintf(stderr,
+			"Invalid value \"%s\" given to option -%c.\n", optarg, c);
+		errflg++;
+	    }
+	    break;
+        case 'f':
+	    if (num_reads_only_mode) {
+		fprintf(stderr,
+			"Option -%c is exclusing with option -o.\n", c);
+                errflg++;
+	    } else {
+		filter_mode++;
+		filter_value = optarg;
+	    }
+            break;
+        case 'n':
+	    if (num_reads_only_mode) {
+		fprintf(stderr,
+			"Option -%c is exclusing with option -o.\n", c);
+                errflg++;
+	    }
+            else
+                num_reads_mode++;
+            break;
+        case 'o':
+	    if (num_reads_mode) {
+		fprintf(stderr,
+			"Option -%c is exclusing with option -n.\n", c);
+                errflg++;
+	    } else if (filter_mode) {
+		fprintf(stderr,
+			"Option -%c is exclusing with option -f.\n", c);
+                errflg++;
+	    } else
+                num_reads_only_mode++;
+            break;
+        case 't':
+	    type_mode=0;
+	    if(get_type_of_output(optarg, &type_mode) || !type_mode) {
+                fprintf(stderr,
+			"Invalid value \"%s\" given to option -%c.\n", optarg, c);
+		errflg++;
+	    }
+	    break;
+        case 'v':
+	    verbose++;
+            break;
+        case ':':       /* -? without operand */
+            fprintf(stderr,
+                    "Option -%c requires an operand\n", optopt);
+            errflg++;
+            break;
+        case '?':
+            fprintf(stderr,
+                    "Unrecognised option: -%c\n", optopt);
+            errflg++;
+        }
+    }
+
+    if (errflg) {
+	usage(1);
+    }
+
+    if(optind + 1 != argc) {
+        fprintf(stderr, "The archive name must be the last argument.\n");
+        usage(1);
+    } else {
+        ar_name = argv[optind];
+    }
+    
+    if(filter_mode) {
+	read_filter = get_read_filter(filter_value);
+	if(verbose) {
+	    dump_read_filter(read_filter);
+	}
+    }
+
+    if(chunk_mode && verbose) {
+	dump_chunk_mode(chunk_mode);
+    }
+
+    if(type_mode && verbose) {
+	dump_type_mode(type_mode);
+    }
+
+    if(destination_mode && verbose) {
+	dump_destination_mode(destination_mode);
+    }
+
+    if (!access(ar_name, R_OK)) {
+	if(verbose) {
+	    printf("Dumping from archive %s.\n", ar_name);
+	}
+    } else {
+        fprintf(stderr, "Archive %s not found.\n", ar_name);
+    }
+
+    if(destination_mode & NONE_DEST) {
+	if (NULL == (srf = srf_open(ar_name, "rb"))) {
+	    perror(ar_name);
+	    return 1;
+	}
+
+	while (NULL != (ztr = srf_next_ztr(srf, name, 0))) {
+	    if(!num_reads_only_mode) {
+		if(!filter_mode || (filter_mode && check_read_name(read_filter, name))) {
+		    ++num_reads;
+		}
+	    } else {
+		++num_reads;
+	    }
+	    delete_ztr(ztr);
+	}
+    }
+
+    if(destination_mode & CONSOLE_DEST) {
+	/* Cosole means stdout. */
+	files = malloc((sizeof(FILE *))*5);
+	for(i = 0; i < 5; i++) {
+	    files[i] = stdout;
+	}
+
+	if (NULL == (srf = srf_open(ar_name, "rb"))) {
+	    perror(ar_name);
+	    return 1;
+	}
+
+	while (NULL != (ztr = srf_next_ztr(srf, name, 0))) {
+	    if(!num_reads_only_mode) {
+		if(!filter_mode || (filter_mode && check_read_name(read_filter, name))) {
+		    if(type_mode & SOLEXA) {
+			dump_solexa(ztr, name, chunk_mode, files);
+		    } else if(type_mode & TEXT) {
+			dump_text(ztr, name, chunk_mode, files);
+		    } else {
+			fprintf(stderr, "Assertion error on type_mode (%c).\nExiting.\n", type_mode);
+			exit(1);
+		    }
+		    ++num_reads;
+		}
+	    } else {
+		++num_reads;
+	    }
+	    delete_ztr(ztr);
+	}
+    }
+
+    if(destination_mode & FILE_DEST) {
+	if(type_mode & SOLEXA) {
+	    process_srf_to_solexa_files(ar_name, chunk_mode, num_reads_only_mode, filter_mode, read_filter, &num_reads);
+	} else if(type_mode & TEXT) {
+	    process_srf_to_text_files(ar_name, chunk_mode, num_reads_only_mode, filter_mode, read_filter, &num_reads);
+	} else {
+	    fprintf(stderr, "Assertion error on type_mode (%c).\nExiting.\n", type_mode);
+	    exit(1);
+	}
+    }
+
+    if(num_reads_mode || num_reads_only_mode) {
+	printf("\nReads: %ld\n", num_reads);
+    }
+
+    srf_destroy(srf, 1);
+
+    return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/progs/srf_extract_hash.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,162 @@
+#ifdef HAVE_CONFIG_H
+#include "io_lib_config.h"
+#endif
+
+#include <stdio.h>
+#include <math.h>
+#include <string.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <io_lib/hash_table.h>
+#include <io_lib/srf.h>
+
+static char qlookup[256];
+void init_qlookup(void) {
+    int i;
+    for (i = -128; i < 128; i++) {
+        qlookup[i+128] = '!' + (int)((10*log(1+pow(10, i/10.0))/log(10)+.499));
+    }
+}
+
+/* ------------------------------------------------------------------------ */
+
+#define MAX_READ_LEN 10000
+void ztr2fastq(ztr_t *z, char *name, int calibrated) {
+    int i, nc, seq_len;
+    char buf[MAX_READ_LEN*2 + 512 + 6];
+    char *seq, *qual, *sdata, *qdata;
+    ztr_chunk_t **chunks;
+
+    /* Extract the sequence only */
+    chunks = ztr_find_chunks(z, ZTR_TYPE_BASE, &nc);
+    if (nc != 1) {
+	fprintf(stderr, "Zero or greater than one BASE chunks found.\n");
+	return;
+    }
+    uncompress_chunk(z, chunks[0]);
+    sdata = chunks[0]->data+1;
+    seq_len = chunks[0]->dlength-1;
+
+    /* Extract the quality */
+    if (calibrated)
+	chunks = ztr_find_chunks(z, ZTR_TYPE_CNF1, &nc);
+    else
+	chunks = ztr_find_chunks(z, ZTR_TYPE_CNF4, &nc);
+
+    if (nc != 1) {
+	fprintf(stderr, "Zero or greater than one CNF chunks found.\n");
+	return;
+    }
+    uncompress_chunk(z, chunks[0]);
+    qdata = chunks[0]->data+1;
+
+    /* Construct fastq entry */
+    seq = buf;
+    *seq++ = '@';
+    while (*name)
+	*seq++ = *name++;
+    *seq++ = '\n';
+
+    qual = seq + seq_len;
+    *qual++ = '\n';
+    *qual++ = '+';
+    *qual++ = '\n';
+
+    for (i = 0; i < seq_len; i++) {
+	if (*sdata != '.') {
+	    *seq++ = *sdata++;
+	} else {
+	    *seq++ = 'N';
+	    sdata++;
+	}
+	*qual++ = calibrated
+	    ? *qdata++ + '!'
+	    : qlookup[*qdata++ + 128];
+    }
+    *qual++ = '\n';
+
+    fwrite(buf, 1, qual - buf, stdout);
+}
+
+/* ------------------------------------------------------------------------ */
+void usage(void) {
+    fprintf(stderr, "Usage: srf_extract [-fastq] [-c] archive_name trace_name ...\n");
+    exit(1);
+}
+
+int main(int argc, char **argv) {
+    FILE *fp;
+    srf_t *srf;
+    char *archive, *trace;
+    uint64_t cpos, hpos, dpos;
+    int fastq = 0, calibrated = 0, i;
+
+    /* Parse args */
+    for (i = 1; i < argc && argv[i][0] == '-'; i++) {
+	if (!strcmp(argv[i], "-")) {
+	    break;
+	} else if (!strcmp(argv[i], "-c")) {
+	    calibrated = 1;
+	} else if (!strcmp(argv[i], "-fastq")) {
+	    fastq = 1;
+	} else {
+	    usage();
+	}
+    }    
+
+    if (argc < (i+2)) {
+      usage();
+    }
+
+    /* the SRF archive */
+    archive = argv[i++];
+    fp = fopen(archive, "rb");
+    if (NULL == fp) {
+        perror(archive);
+        return 1;
+    }
+    srf = srf_create(fp);
+
+    /* the trace */
+    trace = argv[i];
+
+    if( fastq ){
+        read_sections(READ_BASES);
+        init_qlookup();
+    }else{
+#ifdef _WIN32
+        _setmode(_fileno(stdout), _O_BINARY);
+#endif
+    }
+
+    /* Search index */
+    switch (srf_find_trace(srf, trace, &cpos, &hpos, &dpos)) {
+    case -1:
+        fprintf(stderr, "Malformed or missing index hash. "
+                "Consider running srf_index_hash\n");
+        return 1;
+
+    case -2:
+        fprintf(stderr, "%s: not found\n", trace);
+        break;
+
+    default:
+        /* The srf object holds the latest data and trace header blocks */
+        if( fastq ){
+            mFILE *mf = mfcreate(NULL, 0);
+            mfwrite(srf->th.trace_hdr, 1, srf->th.trace_hdr_size, mf);
+            mfwrite(srf->tb.trace,     1, srf->tb.trace_size,     mf);
+            mfseek(mf, 0, SEEK_SET);
+            ztr_t *ztr = partial_decode_ztr(srf, mf, NULL);
+            ztr2fastq(ztr, trace, calibrated);
+            delete_ztr(ztr);
+            mfdestroy(mf);
+        } else {
+            fwrite(srf->th.trace_hdr, 1, srf->th.trace_hdr_size, stdout);
+            fwrite(srf->tb.trace,     1, srf->tb.trace_size,     stdout);
+        }
+        break;
+    }
+	
+    return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/progs/srf_extract_linear.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,166 @@
+/*
+ * ======================================================================
+ * This software has been created by Genome Research Limited (GRL).
+ *
+ * GRL hereby grants permission to use, copy, modify and distribute
+ * this software and its documentation for non-commercial purposes
+ * without fee at the user's own risk on the basis set out below.
+ *
+ * GRL neither undertakes nor accepts any duty whether contractual or
+ * otherwise in connection with the software, its use or the use of
+ * any derivative, and makes no representations or warranties, express
+ * or implied, concerning the software, its suitability, fitness for
+ * a particular purpose or non-infringement.
+ *
+ * In no event shall the authors of the software or GRL be responsible
+ * or liable for any loss or damage whatsoever arising in any way
+ * directly or indirectly out of the use of this software or its
+ * derivatives, even if advised of the possibility of such damage.
+ *
+ * Our software can be freely distributed under the conditions set out
+ * above, and must contain this copyright notice.
+ * ======================================================================
+ */
+
+/*
+ * This performs a linear (non-indexed) search for a trace in an SRF archive.
+ *
+ * It's not intended as a suitable production program or as a library of code
+ * to use, but as a test and benchmark statistic.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "io_lib_config.h"
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <fcntl.h>
+#include <io_lib/Read.h>
+#include <io_lib/misc.h>
+#include <io_lib/ztr.h>
+#include <io_lib/srf.h>
+
+/* ------------------------------------------------------------------------ */
+/*
+ * Looks for a trace name in an SRF archive and returns the binary contents
+ * if found, or NULL if not.
+ */
+mFILE *find_reading(srf_t *srf, char *tr_name) {
+    do {
+	int type;
+
+	switch(type = srf_next_block_type(srf)) {
+	case -1:
+	    /* EOF */
+	    return NULL;
+
+	case SRFB_CONTAINER:
+	    if (0 != srf_read_cont_hdr(srf, &srf->ch))
+		return NULL;
+	    break;
+
+	case SRFB_XML:
+	    if (0 != srf_read_xml(srf, &srf->xml))
+		return NULL;
+	    break;
+	    
+
+	case SRFB_TRACE_HEADER: {
+	    /* off_t pos = ftell(srf->fp); */
+
+	    if (0 != srf_read_trace_hdr(srf, &srf->th))
+		return NULL;
+
+#if 0
+	    /*
+	     * If the name prefix doesn't match tr_name then skip this entire
+	     * block.
+	     */
+	    if (0 != strncmp(tr_name, srf->th.id_prefix,
+			     strlen(srf->th.id_prefix)) &&
+		0 != srf->th.next_block_offset) {
+		fseek(srf->fp, pos + srf->th.next_block_offset, SEEK_SET);
+	    }
+#endif
+	    break;
+	}
+
+	case SRFB_TRACE_BODY: {
+	    mFILE *mf = mfcreate(NULL, 0);
+	    srf_trace_body_t tb;
+	    char name[512];
+
+	    if (!mf || 0 != srf_read_trace_body(srf, &tb, 0))
+		return NULL;
+
+	    sprintf(name, "%s%s", srf->th.id_prefix, tb.read_id);
+	    if (strcmp(name, tr_name)) {
+		mfdestroy(mf);
+		if (tb.trace)
+		    free(tb.trace);
+		continue;
+	    }
+
+	    if (srf->th.trace_hdr_size)
+		mfwrite(srf->th.trace_hdr, 1,
+			srf->th.trace_hdr_size, mf);
+	    if (tb.trace_size)
+		mfwrite(tb.trace, 1, tb.trace_size, mf);
+	    if (tb.trace)
+		free(tb.trace);
+	    mrewind(mf);
+	    return mf;
+	}
+
+	case SRFB_INDEX: {
+	    off_t pos = ftello(srf->fp);
+	    srf_read_index_hdr(srf, &srf->hdr, 1);
+
+	    /* Skip the index body */
+	    fseeko(srf->fp, pos + srf->hdr.size, SEEK_SET);
+	    break;
+	}
+
+ 	case SRFB_NULL_INDEX:
+ 	    break;
+
+	default:
+	    fprintf(stderr, "Block of unknown type '%c'. Aborting\n", type);
+	    return NULL;
+	}
+    } while (1);
+
+    return NULL;
+}
+
+/* ------------------------------------------------------------------------ */
+int main(int argc, char **argv) {
+    char *ar_name, *tr_name;
+    mFILE *mf;
+    srf_t *srf;
+
+    if (argc != 3) {
+	fprintf(stderr, "Usage: extract_linear_srf archive_name trace_name\n");
+	return 1;
+    }
+    ar_name = argv[1];
+    tr_name = argv[2];
+
+    if (NULL == (srf = srf_open(ar_name, "r"))) {
+	perror(ar_name);
+	return 4;
+    }
+
+    if (NULL == (mf = find_reading(srf, tr_name))) {
+	fprintf(stderr, "%s not found in archive\n", tr_name);
+	return 3;
+    }
+
+#ifdef _WIN32
+    _setmode(_fileno(stdout), _O_BINARY);
+#endif
+
+    fwrite(mf->data, 1, mf->size, stdout);
+    return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/progs/srf_filter.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,1146 @@
+/*
+ * ======================================================================
+ * This software has been created by Genome Research Limited (GRL).
+ *
+ * GRL hereby grants permission to use, copy, modify and distribute
+ * this software and its documentation for non-commercial purposes
+ * without fee at the user's own risk on the basis set out below.
+ *
+ * GRL neither undertakes nor accepts any duty whether contractual or
+ * otherwise in connection with the software, its use or the use of
+ * any derivative, and makes no representations or warranties, express
+ * or implied, concerning the software, its suitability, fitness for
+ * a particular purpose or non-infringement.
+ *
+ * In no event shall the authors of the software or GRL be responsible
+ * or liable for any loss or damage whatsoever arising in any way
+ * directly or indirectly out of the use of this software or its
+ * derivatives, even if advised of the possibility of such damage.
+ *
+ * Our software can be freely distributed under the conditions set out
+ * above, and must contain this copyright notice.
+ * ======================================================================
+ */
+
+/*
+ * This performs a linear (non-indexed) search for a trace in an SRF archive.
+ *
+ * It's not intended as a suitable production program or as a library of code
+ * to use, but as a test and benchmark statistic.
+ */
+
+#include <string.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <ctype.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <io_lib/Read.h>
+#include <io_lib/misc.h>
+#include <io_lib/ztr.h>
+#include <io_lib/srf.h>
+#include <io_lib/hash_table.h>
+
+#define CR 13            /* Decimal code of Carriage Return char */
+#define LF 10            /* Decimal code of Line Feed char */
+#define EOF_MARKER 26    /* Decimal code of DOS end-of-file marker */
+#define MAX_REC_LEN 1024 /* Maximum size of input buffer */
+
+#define CHUNK_BASE (1 << 0)
+#define CHUNK_CNF1 (1 << 1)
+#define CHUNK_CNF4 (1 << 2)
+#define CHUNK_SAMP (1 << 3)
+#define CHUNK_SMP4 (1 << 4)
+#define CHUNK_ALL (CHUNK_BASE | CHUNK_CNF1 | CHUNK_CNF4 | CHUNK_SAMP | CHUNK_SMP4)
+
+#define NCHUNKS 6
+
+#define CHUNK_BASE_STR "BASE"
+#define CHUNK_CNF1_STR "CNF1"
+#define CHUNK_CNF4_STR "CNF4"
+#define CHUNK_SAMP_STR "SAMP"
+#define CHUNK_SMP4_STR "SMP4"
+#define CHUNK_ALL_STR  "ALL"
+
+#define TYPE_PROC (1 << 0)
+#define TYPE_SLXI (1 << 1)
+#define TYPE_SLXN (1 << 2)
+#define TYPE_0FAM (1 << 3)
+#define TYPE_1CY3 (1 << 4)
+#define TYPE_2TXR (1 << 5)
+#define TYPE_3CY5 (1 << 6)
+#define TYPE_ALL (TYPE_PROC | TYPE_SLXI | TYPE_SLXN | TYPE_0FAM | TYPE_1CY3 | TYPE_2TXR | TYPE_3CY5)
+
+#define NTYPES 8
+
+#define TYPE_PROC_STR "PROC"
+#define TYPE_SLXI_STR "SLXI"
+#define TYPE_SLXN_STR "SLXN"
+#define TYPE_0FAM_STR "0FAM"
+#define TYPE_1CY3_STR "1CY3"
+#define TYPE_2TXR_STR "2TXR"
+#define TYPE_3CY5_STR "3CY5"
+#define TYPE_ALL_STR  "ALL"
+
+/* ------------------------------------------------------------------------ */
+
+/*
+ * All the reads and prefixes will be used to filter reads in an srf archive.
+ * For reads the match with the reads in the archive must be exact.  Prefixes
+ * need only match to the beginning of the read, so they are a way to filter
+ * several reads that, for example, belong to the same lane and tile.  For
+ * example, if the reads are <Center>:<Run>:<Lane>:<Tile>:<X>:<Y>, then a
+ * prefix can progress from center all the way to y coordinate in terms of
+ * read specificity.
+ */
+typedef struct {
+    int prefixes_size;
+    int reads_size;
+    char** prefixes;  /* Prefixes to filter on. */
+    HashTable *reads_hash;  /* Reads to filter on. */
+} read_filter_t;
+
+/* ------------------------------------------------------------------------ */
+
+/*
+ * Print usage message to stderr and exit with the given \"code\".
+ */
+void usage(int code) {
+    fprintf(stderr, "Usage: srf_filter [-c chunk_types] [-f read_filter] [-C] [-o] [-v] input(s) output\n");
+    fprintf(stderr, "Options:\n");
+    fprintf(stderr, "    -c chunk_types\n");
+    fprintf(stderr, "              Chunk types to output given as a comma delimited list of types.\n");
+    fprintf(stderr, "              The following types are allowed: \"ALL\", \"BASE\", \"CNF1\", \"CNF4\"\n");
+    fprintf(stderr, "              \"SAMP\", \"SMP4\".\n");
+    fprintf(stderr, "              The default is \"ALL\".\n");
+    fprintf(stderr, "\n    -m mdata_types\n");
+    fprintf(stderr, "              SAMP/SMP4 mdata types to output given as a comma delimited list of types.\n");
+    fprintf(stderr, "              The following types are allowed: \"ALL\", \"PROC\", \"SLXI\", \"SLXN\"\n");
+    fprintf(stderr, "              \"0FAM\", \"1CY3\", \"2TXR\", \"3CY5\".\n");
+    fprintf(stderr, "              The default is \"ALL\".\n");
+    fprintf(stderr, "\n    -f read_filter\n");
+    fprintf(stderr, "              The filter to apply to reads in the archive.  If reads match the\n");
+    fprintf(stderr, "              filter they are dumped.\n");
+    fprintf(stderr, "              The filter takes the form of <name>=<value>, where <name> can be\n");
+    fprintf(stderr, "              \"read\", \"prefix\", \"file\".\n");
+    fprintf(stderr, "              If the <name> is \"read\" the value is represents the name of a\n");
+    fprintf(stderr, "              read to dump.  Only the matching read will be dumped.\n");
+    fprintf(stderr, "              If the <name> is \"prefix\" the value is represents the prefix of\n");
+    fprintf(stderr, "              the name of the reads to dump.  Only the matching reads will be\n");
+    fprintf(stderr, "              dumped.\n");
+    fprintf(stderr, "              If the <name> is \"file\" the value is a file name where any\n");
+    fprintf(stderr, "              number of \"read\" and \"prefix\" name value pairs can be included,\n");
+    fprintf(stderr, "              one per line.\n");
+    fprintf(stderr, "              The default is no filter, which means all reads are dumped.\n");
+    fprintf(stderr, "\n    -b      exclude bad reads using readsFlags bitmask in data block header.\n");
+    fprintf(stderr, "\n    -2 cyc  use this option to add a Illumina-style REGN chunk.\n");
+    fprintf(stderr, "\n    -v      Print verbose messages.\n");
+    fprintf(stderr, "\n");
+
+    exit(code);
+}
+
+/*
+ * Reads the lines from the fiven \"input\" file and creates the reads and prefixes
+ * for the read filter.  The \"read_filter\" given is allocated.
+ *
+ * Returns 0 on success.  Errors cause the usage message and exit. 
+ */
+int read_filter_from_file(FILE *input, read_filter_t *read_filter)
+{
+    int   isNewline;              /* Boolean indicating we've read a CR or LF */
+    long  lFileLen;               /* Length of file */
+    long  lIndex;                 /* Index into cThisLine array */
+    long  lLineCount;             /* Current line number */
+    long  lLineLen;               /* Current line length */
+    long  lStartPos;              /* Offset of start of current line */
+    long  lTotalChars;            /* Total characters read */
+    char  cThisLine[MAX_REC_LEN]; /* Contents of current line */
+    char *cFile;                  /* Dynamically allocated buffer (entire file) */
+    char *cThisPtr;               /* Pointer to current position in cFile */
+
+    char *filter_type;
+    char *prefix;
+    char *read;
+
+    fseek(input, 0L, SEEK_END);  /* Position to end of file */
+    lFileLen = ftell(input);     /* Get file length */
+    rewind(input);               /* Back to start of file */
+
+    cFile = calloc(lFileLen + 1, sizeof(char));
+
+    if(cFile == NULL )
+	{
+	    fprintf(stderr, "\nInsufficient memory to read file.\n");
+	    return 0;
+	}
+
+    fread(cFile, lFileLen, 1, input); /* Read the entire file into cFile */
+
+    lLineCount  = 0L;
+    lTotalChars = 0L;
+
+    cThisPtr    = cFile;              /* Point to beginning of array */
+
+    while (*cThisPtr)                 /* Read until reaching null char */
+	{
+	    lIndex    = 0L;                 /* Reset counters and flags */
+	    isNewline = 0;
+	    lStartPos = lTotalChars;
+
+	    while (*cThisPtr)               /* Read until reaching null char */
+		{
+		    if (!isNewline)               /* Haven't read a CR or LF yet */
+			{
+			    if (*cThisPtr == CR || *cThisPtr == LF) /* This char IS a CR or LF */
+				isNewline = 1;                        /* Set flag */
+			}
+
+		    else if (*cThisPtr != CR && *cThisPtr != LF) /* Already found CR or LF */
+			break;                                     /* Done with line */
+
+		    /* Don't copy LS or CR */
+		    if (*cThisPtr != CR && *cThisPtr != LF) {
+			cThisLine[lIndex++] = *cThisPtr++; /* Add char to output and increment */
+			++lTotalChars;
+		    } else {
+			cThisPtr++;
+		    }
+
+		} /* end while (*cThisPtr) */
+
+	    cThisLine[lIndex] = '\0';     /* Terminate the string */
+	    ++lLineCount;                 /* Increment the line counter */
+	    lLineLen = strlen(cThisLine); /* Get length of line */
+
+	    /* Find the one and only = in the string. */
+	    if(strchr(cThisLine,'=') != NULL && (strchr(cThisLine,'=') == strrchr(cThisLine,'='))) {
+		filter_type = strtok (cThisLine, "=");
+	    } else {
+		fprintf(stderr, "Baddly formatted read filter \"%s\".  Expected an \"=\" character in middle of filter.\n", cThisLine);
+		usage(1);
+	    }
+
+	    if (!strcmp(filter_type, "prefix")) {
+		prefix = strtok (NULL, "=");
+		if(prefix == NULL) {
+		    fprintf(stderr, "Bad prefix \"%s\" in read filter \"%s\".\n", prefix, cThisLine);
+		    usage(1);
+		} else {
+		    ++(read_filter->prefixes_size);
+		    read_filter->prefixes = (char**) realloc (read_filter->prefixes, read_filter->prefixes_size * sizeof(char *));
+		    read_filter->prefixes[read_filter->prefixes_size - 1] =  (char*) calloc (strlen(prefix) + 1,sizeof(char));
+		    strcpy(read_filter->prefixes[read_filter->prefixes_size - 1], prefix);
+		}
+	    } else if (!strcmp(filter_type, "read")) {
+		read = strtok (NULL, "=");
+		if(read == NULL) {
+		    fprintf(stderr, "Bad read \"%s\" in read filter \"%s\".\n", read, cThisLine);
+		    usage(1);
+		} else {
+                  char *file;
+                  HashItem *hi;
+                  if( NULL != (file = strchr(read, ' '))) {
+                      *file = '\0';
+                      file++;
+                      printf("read=%s file=%s\n", read, file);
+                  } else {
+                      printf("read=%s\n", read);
+                  }
+                  if (NULL == (hi = (HashTableSearch(read_filter->reads_hash, read, strlen(read))))) {
+                      HashData hd;
+                      hd.i = read_filter->reads_size;
+                      if (NULL == (hi = HashTableAdd(read_filter->reads_hash, read, strlen(read), hd, NULL))) {
+                          fprintf(stderr, "\nUnable to process read filter.\n");
+                          return 0;
+                      }
+  		      ++(read_filter->reads_size);
+                    }
+		}
+	    } else {
+		fprintf(stderr, "Unrecognized filter type \"%s\" given as part of read filter \"%s\".  The valid filter types are \"%s\".\n", filter_type, cThisLine, "prefix or read");
+		usage(1);
+	    }
+
+	}
+
+    free(cFile);
+    return 0;
+}
+
+/*
+ * Parse the given \"filter_value\" string for the filter value.
+ *
+ * Returns a read filter allocated on the heap which needs to be freed by the
+ * calling function. Errors usually cause the usage message and exit.
+ */
+read_filter_t *get_read_filter(char *filter_value)
+{
+    char *filter_type = NULL;
+    char *file_name = NULL;
+    FILE *fp = NULL;
+    char *prefix = NULL;
+    char *read = NULL;
+
+    /* Create read filter. */
+    read_filter_t *read_filter = (read_filter_t *)calloc(1, sizeof(read_filter_t));
+    if(read_filter == NULL) {
+	return NULL;
+    }
+    read_filter->prefixes_size = 0;
+    read_filter->reads_size = 0;
+    if (NULL == (read_filter->reads_hash = HashTableCreate(0, HASH_DYNAMIC_SIZE|HASH_FUNC_JENKINS3))) {
+        return NULL;
+    }
+    
+    /* Find the one and only = in the string. */
+    if( strchr(filter_value,'=') != NULL &&
+	(strchr(filter_value,'=') == strrchr(filter_value,'=')) ) {
+	filter_type = strtok (filter_value,"=");
+    } else {
+        fprintf(stderr, "Baddly formatted read filter \"%s\".  Expected an \"=\" character in middle of filter.\n", filter_value);
+        usage(1);
+    }
+
+    /* Check the string before the = is a valid filter type. */
+    if(!strcmp("file", filter_type)) {
+
+        /* Read the file. */
+	file_name = strtok (NULL, "=");
+	if(file_name == NULL) {
+	    fprintf(stderr, "Bad file name \"%s\" in read filter \"%s\".\n", file_name, filter_value);
+	    usage(1);
+	}
+	fp = fopen(file_name, "r");
+	if(fp == NULL) {
+            fprintf(stderr, "Bad file name \"%s\" in read filter \"%s\".\n", file_name, filter_value);
+	    usage(1);
+	}
+
+	/* Read line by line. */
+	if(read_filter_from_file(fp, read_filter)) {
+	    fprintf(stderr, "Bad contents of file %s.\n", file_name);
+	    usage(1);
+	}
+
+    } else if (!strcmp("prefix", filter_type)) {
+	prefix = strtok (NULL, "=");
+	if(prefix == NULL) {
+	    fprintf(stderr, "Bad prefix \"%s\" in read filter \"%s\".\n", prefix, filter_value);
+	    usage(1);
+	} else {
+	    ++(read_filter->prefixes_size);
+	    read_filter->prefixes = (char**) malloc (read_filter->prefixes_size * sizeof(char *));
+	    read_filter->prefixes[read_filter->prefixes_size - 1] =  (char*) calloc (strlen(prefix) + 1,sizeof(char));
+	    strcpy(read_filter->prefixes[read_filter->prefixes_size - 1], prefix);
+	}
+    } else if (!strcmp("read", filter_type)) {
+	read = strtok (NULL, "=");
+	if(read == NULL) {
+	    fprintf(stderr, "Bad read \"%s\" in read filter \"%s\".\n", read, filter_value);
+	    usage(1);
+	} else {
+            HashItem *hi;
+            if (NULL == (hi = (HashTableSearch(read_filter->reads_hash, read, strlen(read))))) {
+                HashData hd;
+                hd.i = 0;
+                if (NULL == (hi = HashTableAdd(read_filter->reads_hash, read, strlen(read), hd, NULL))) {
+                    return NULL;
+                }
+		++(read_filter->reads_size);
+            }
+	}
+    } else {
+	fprintf(stderr, "Unrecognized filter type \"%s\" given as part of read filter \"%s\".  The valid filter types are \"%s\".\n", filter_type, filter_value, "prefix, read, or file");
+	usage(1);
+    }
+
+    return read_filter;
+}
+
+/*
+ * Parse the comma delimited list of chunk types and put them in the single character \"mode\".
+ *
+ * Returns 0 on success.
+ */
+int get_chunk_types(char *arg, char *mode) {
+    int num_allowed_types = NCHUNKS;
+    char *allowed_str_types[] = {CHUNK_BASE_STR,CHUNK_CNF1_STR,CHUNK_CNF4_STR,CHUNK_SAMP_STR,CHUNK_SMP4_STR,CHUNK_ALL_STR};
+    char allowed_types[] = {CHUNK_BASE,CHUNK_CNF1,CHUNK_CNF4,CHUNK_SAMP,CHUNK_SMP4,CHUNK_ALL};
+    char *type;
+    int i = 0;
+
+    type = strtok (arg,",");
+    while(type) {
+	for(i = 0; i < num_allowed_types; i++) {
+	    if(!strcmp(type, allowed_str_types[i]) && !(*mode & allowed_types[i])) {
+		*mode += allowed_types[i];
+		break;
+	    }
+	}
+        type = strtok (NULL, ",");
+    }
+
+    return 0;
+}
+
+/*
+ * Parse the comma delimited list of mdata types and put them in the single character \"mode\".
+ *
+ * Returns 0 on success.
+ */
+int get_mdata_types(char *arg, char *mode) {
+    int num_allowed_types = NTYPES;
+    char *allowed_str_types[] = {TYPE_PROC_STR, TYPE_SLXI_STR, TYPE_SLXN_STR, TYPE_0FAM_STR, TYPE_1CY3_STR, TYPE_2TXR_STR, TYPE_3CY5_STR, TYPE_ALL_STR};
+    char allowed_types[] = {TYPE_PROC, TYPE_SLXI, TYPE_SLXN, TYPE_0FAM, TYPE_1CY3, TYPE_2TXR, TYPE_3CY5, TYPE_ALL};
+    char *type;
+    int i = 0;
+
+    type = strtok (arg,",");
+    while(type) {
+	for(i = 0; i < num_allowed_types; i++) {
+	    if(!strcmp(type, allowed_str_types[i]) && !(*mode & allowed_types[i])) {
+		*mode += allowed_types[i];
+		break;
+	    }
+	}
+        type = strtok (NULL, ",");
+    }
+
+    return 0;
+}
+
+/*
+ * Returns 1 is the read \"name\" matches any of the reads or prefixes in the \"read_filter\".
+ */
+int check_read_name(read_filter_t *read_filter, char *name) {
+    int i;
+
+    for(i = 0; i < read_filter->prefixes_size; i++) {
+	if(name == strstr(name, read_filter->prefixes[i])) {
+	    return 1;
+	}
+    }
+
+    if( read_filter->reads_size ){
+        HashItem *hi;
+        if (NULL != (hi = (HashTableSearch(read_filter->reads_hash, name, strlen(name))))) {
+	    return 1;
+	}
+    }
+
+    return 0;
+}
+
+void dump_read_filter(read_filter_t *read_filter) {
+    int i;
+
+    printf("Read filter used:\n");
+
+    for(i = 0; i < read_filter->prefixes_size; i++) {
+	printf("\tprefix[%d] = %s\n", i, read_filter->prefixes[i]);
+    }
+
+    if( read_filter->reads_size ){
+        int ibucket;
+        for (ibucket=0; ibucket<read_filter->reads_hash->nbuckets; ibucket++) {
+            HashItem *hi;
+            for (hi = read_filter->reads_hash->bucket[ibucket]; hi; hi = hi->next) {
+                printf("\tread[%d] = %s\n", hi->data.i, hi->key);
+            }
+        }
+    }
+}
+
+void dump_chunk_mode(char mode) {
+    printf("mode: %d.\n", mode);
+
+    if(mode & CHUNK_BASE) {
+	printf("BASE chunk required.\n");
+    }
+    if(mode & CHUNK_CNF1) {
+	printf("CNF1 chunk required.\n");
+    }
+    if(mode & CHUNK_CNF4) {
+	printf("CNF4 chunk required.\n");
+    }
+    if(mode & CHUNK_SAMP) {
+	printf("SAMP chunk required.\n");
+    }
+    if(mode & CHUNK_SMP4) {
+	printf("SMP4 chunk required.\n");
+    }
+}
+
+void dump_mdata_mode(char mode) {
+    printf("mode: %d.\n", mode);
+
+    if(mode & TYPE_PROC) {
+	printf("Illumina PROC SAMP/SMP4 chunk required.\n");
+    }
+    if(mode & TYPE_SLXI) {
+	printf("Illumina SLXI SAMP/SMP4 chunk required.\n");
+    }
+    if(mode & TYPE_SLXN) {
+	printf("Illumina SLXN SAMP/SMP4 chunk required.\n");
+    }
+    if(mode & TYPE_0FAM) {
+	printf("Solid 0FAM SAMP/SMP4 chunk required.\n");
+    }
+    if(mode & TYPE_1CY3) {
+	printf("Solid 1CY3 SAMP/SMP4 chunk required.\n");
+    }
+    if(mode & TYPE_2TXR) {
+	printf("Solid 2TXR SAMP/SMP4 chunk required.\n");
+    }
+    if(mode & TYPE_3CY5) {
+	printf("Solid 3CY3 SAMP/SMP4 chunk required.\n");
+    }
+}
+
+/*
+ * ztr_mwrite_chunk
+ *
+ * Writes a ZTR chunk including chunk header and data
+ *
+ * Arguments:
+ * 	fp		A mFILE pointer
+ *	chunk		A pointer to the chunk to write
+ *
+ * Returns:
+ *	Success:  0
+ *	Failure: -1
+ */
+static int ztr_mwrite_chunk(mFILE *fp, ztr_chunk_t *chunk) {
+    int4 bei4;
+
+    /*
+    {
+	char str[5];
+	fprintf(stderr, "Write chunk %.4s %08x length %d\n",
+		ZTR_BE2STR(chunk->type, str), chunk->type, chunk->dlength);
+    }
+    */
+
+    /* type */
+    bei4 = be_int4(chunk->type);
+    if (1 != mfwrite(&bei4, 4, 1, fp))
+	return -1;
+
+    /* metadata length */
+    bei4 = be_int4(chunk->mdlength);
+    if (1 != mfwrite(&bei4, 4, 1, fp))
+	return -1;
+
+    /* metadata */
+    if (chunk->mdlength)
+	if (chunk->mdlength != mfwrite(chunk->mdata, 1, chunk->mdlength, fp))
+	    return -1;
+
+    /* data length */
+    bei4 = be_int4(chunk->dlength);
+    if (1 != mfwrite(&bei4, 4, 1, fp))
+	return -1;
+
+    /* data */
+    if (chunk->dlength != mfwrite(chunk->data, 1, chunk->dlength, fp))
+	return -1;
+
+    return 0;
+}
+
+/*
+ * Adds a ZTR REGN chunk describing the paired-end structure. Ie which bit
+ * is which. This is a simplified form of the more generic REGN contents.
+ *
+ * Returns 0 for success
+ *        -1 for failure
+ */
+static int add_readpair_region(unsigned int rev_cycle, mFILE *mf) {
+    char *mdata = malloc(100);
+    unsigned char *data = malloc(5);
+    int mdlen;
+    ztr_chunk_t c;
+
+    if (!data || !mdata)
+	return -1;
+
+    data[0] = 0;
+    rev_cycle--; /* we count from 0 */
+    data[1] = (rev_cycle >> 24) & 0xff;
+    data[2] = (rev_cycle >> 16) & 0xff;
+    data[3] = (rev_cycle >>  8) & 0xff;
+    data[4] = (rev_cycle >>  0) & 0xff;
+    
+    mdlen = sprintf(mdata, "NAME%cforward:P;reverse:P%c",0,0);
+
+    /* Initialise */
+    c.type     = ZTR_TYPE_REGN;
+    c.data     = data;
+    c.dlength  = 5;
+    c.mdata    = mdata;
+    c.mdlength = mdlen;
+    c.ztr_owns = 1;
+
+    ztr_mwrite_chunk(mf, &c);
+
+    xfree(data);
+    xfree(mdata);
+    
+    return 0;
+}
+
+/*
+ * Given the input archive name (input), the output archive name (output),
+ * the chunk types to output (chunk_mode) and some other parameters such as
+ * the read filter generates a filtered srf file.
+ *
+ * Note the generated srf file is NOT indexed
+ *
+ * Returns 0 on success.
+ *         1 on failure
+ */
+int srf_filter(char *input, srf_t *out_srf, char chunk_mode, char mdata_mode, int filter_mode, read_filter_t *read_filter, int read_mask, int rev_cycle) {
+    srf_t *in_srf;
+    int output_trace_header;
+    char name[1024];
+
+    if (NULL == (in_srf = srf_open(input, "rb"))) {
+	perror(input);
+        return 1;
+    }
+
+    do {
+	int type;
+	ztr_chunk_t *chunk;
+
+	switch(type = srf_next_block_type(in_srf)) {
+	case SRFB_CONTAINER:
+	    if (0 != srf_read_cont_hdr(in_srf, &in_srf->ch)) {
+		fprintf(stderr, "Error reading container header.\nExiting.\n");
+		exit(1);
+	    }
+	    if (0 != srf_write_cont_hdr(out_srf, &in_srf->ch)) {
+		fprintf(stderr, "Error writing container header.\nExiting.\n");
+		exit(1);
+	    }
+	    break;
+
+	case SRFB_XML:
+	    if (0 != srf_read_xml(in_srf, &in_srf->xml)) {
+		fprintf(stderr, "Error reading XML.\nExiting.\n");
+		exit(1);
+	    }
+	    if (0 != srf_write_xml(out_srf, &in_srf->xml)) {
+		fprintf(stderr, "Error writing XML.\nExiting.\n");
+		exit(1);
+	    }
+	    break;
+
+	case SRFB_TRACE_HEADER:
+	    if (0 != srf_read_trace_hdr(in_srf, &in_srf->th)) {
+		fprintf(stderr, "Error reading trace header.\nExiting.\n");
+		exit(1);
+	    }
+
+#if 1
+	    if (chunk_mode == CHUNK_ALL && mdata_mode == TYPE_ALL) {
+                if (!rev_cycle) {
+                    output_trace_header = 1;
+                    break;
+		}
+	    }
+#endif		
+
+	    /* Decode ZTR chunks in the header */
+	    if (in_srf->mf)
+		mfdestroy(in_srf->mf);
+
+	    in_srf->mf = mfcreate(NULL, 0);
+	    if (in_srf->th.trace_hdr_size)
+		mfwrite(in_srf->th.trace_hdr, 1, in_srf->th.trace_hdr_size, in_srf->mf);
+	    if (in_srf->ztr)
+		delete_ztr(in_srf->ztr);
+	    mrewind(in_srf->mf);
+
+	    /* create the trace header data */
+	    mFILE *mf = mfcreate(NULL, 0);
+
+	    if (NULL != (in_srf->ztr = partial_decode_ztr(in_srf, in_srf->mf, NULL))) {
+		in_srf->mf_pos = mftell(in_srf->mf);
+		mfseek(in_srf->mf, 0, SEEK_END);
+		in_srf->mf_end = mftell(in_srf->mf);
+
+		mfseek(in_srf->mf, 0, SEEK_SET);
+		mfwrite(in_srf->mf->data, 1, sizeof(ztr_header_t), mf);
+		mfseek(in_srf->mf, sizeof(ztr_header_t), SEEK_CUR);
+
+		int pos = mftell(in_srf->mf);
+		while (chunk = ztr_read_chunk_hdr(in_srf->mf)) {
+		    char *key = ztr_lookup_mdata_value(in_srf->ztr, chunk, "TYPE");
+		    int flag = 0;
+
+		    /* filter on chunk type */
+		    switch (chunk->type) {
+		    case ZTR_TYPE_BASE:
+			if (chunk_mode & CHUNK_BASE)
+			    flag = 1;
+			break;
+		    case ZTR_TYPE_CNF1:
+			if (chunk_mode & CHUNK_CNF1)
+			    flag = 1;
+			break;
+		    case ZTR_TYPE_CNF4:
+			if (chunk_mode & CHUNK_CNF4)
+			    flag = 1;
+			break;
+		    case ZTR_TYPE_REGN:
+			if (!rev_cycle)
+			    flag = 1;
+			break;
+		    case ZTR_TYPE_SAMP:
+			if (chunk_mode & CHUNK_SAMP) {
+			    if (mdata_mode == TYPE_ALL)
+				flag = 1;
+			    if ((mdata_mode & TYPE_0FAM) && (key && 0 == strcmp(key, "0FAM")))
+				flag = 1;
+			    if ((mdata_mode & TYPE_1CY3) && (key && 0 == strcmp(key, "1CY3")))
+				flag = 1;
+			    if ((mdata_mode & TYPE_2TXR) && (key && 0 == strcmp(key, "2TXR")))
+				flag = 1;
+			    if ((mdata_mode & TYPE_3CY5) && (key && 0 == strcmp(key, "3CY5")))
+				flag = 1;
+			}
+			break;
+		    case ZTR_TYPE_SMP4:
+			if (chunk_mode & CHUNK_SMP4) {
+			    if (mdata_mode == TYPE_ALL)
+				flag = 1;
+			    if ((mdata_mode & TYPE_PROC) && (NULL == key || 0 == strcmp(key, "PROC")))
+				flag = 1;
+			    if ((mdata_mode & TYPE_SLXI) && (key && 0 == strcmp(key, "SLXI")))
+				flag = 1;
+			    if ((mdata_mode & TYPE_SLXN) && (key && 0 == strcmp(key, "SLXN")))
+				flag = 1;
+			}
+			break;
+		    default:
+			flag = 1;
+			break;
+		    }
+
+		    if (flag)
+			mfwrite(in_srf->mf->data+pos, 1, (4+4+chunk->mdlength+4+chunk->dlength), mf);
+		    mfseek(in_srf->mf, chunk->dlength, SEEK_CUR);
+		    pos = mftell(in_srf->mf);
+
+		    if (chunk->mdata)
+			xfree(chunk->mdata);
+		    xfree(chunk);
+		}
+
+                if (rev_cycle) {
+                    fprintf(stderr, "Adding REGN chunk to trace header\n");
+                    if ( -1 == add_readpair_region(rev_cycle, mf)) {
+                        fprintf(stderr, "Failed to add to REGN chunk\n");
+                        exit(1);
+                    }
+                }
+
+#if 1
+                if (chunk_mode == CHUNK_ALL && mdata_mode == TYPE_ALL) {
+                    mfwrite(in_srf->mf->data+in_srf->mf_pos, 1 , (in_srf->mf_end-in_srf->mf_pos), mf);
+                }
+#endif		
+	    } else {
+		/* Maybe not enough to decode or no headerBlob. */
+		/* So delay until decoding the body. */
+		in_srf->mf_pos = 0;
+	    }
+
+	    mfseek(in_srf->mf, 0, SEEK_END);
+	    in_srf->mf_end = mftell(in_srf->mf);
+
+	    /* construct the new trace header */
+            uint32_t trace_hdr_size = mftell(mf);
+	    char *trace_hdr;
+            if (NULL == (trace_hdr = malloc(trace_hdr_size))) {
+                stderr, "Error making trace header.\nExiting.\n";
+		exit(1);
+            }
+            memcpy(trace_hdr, mf->data, trace_hdr_size);
+ 	    if (out_srf->th.trace_hdr)
+  	        free(out_srf->th.trace_hdr);
+	    srf_construct_trace_hdr(&out_srf->th, in_srf->th.id_prefix, trace_hdr, trace_hdr_size);
+            output_trace_header = 1;
+
+	    mfdestroy(mf);
+
+	    break;
+
+	case SRFB_TRACE_BODY: {
+	    srf_trace_body_t old_tb;
+	    ztr_t *ztr_tmp;
+
+	    if (0 != srf_read_trace_body(in_srf, &old_tb, 0)) {
+		fprintf(stderr, "Error reading trace body.\nExiting.\n");
+		exit(1);
+	    }
+	  
+	    if (-1 == construct_trace_name(in_srf->th.id_prefix,
+					   (unsigned char *)old_tb.read_id,
+					   old_tb.read_id_length,
+					   name, 512)) {
+		fprintf(stderr, "Error constructing trace name.\nExiting.\n");
+		exit(1);
+	    }
+
+	    if (old_tb.flags & read_mask) {
+                if (old_tb.trace_size)
+                    free(old_tb.trace);
+		break;
+	    }
+
+	    if (filter_mode && !check_read_name(read_filter, name)) {
+                if (old_tb.trace_size)
+                    free(old_tb.trace);
+		break;
+	    }
+	  
+#if 1
+            if (chunk_mode == CHUNK_ALL && mdata_mode == TYPE_ALL) {
+                /* output the trace header as required */
+                if( output_trace_header ) {
+                    output_trace_header = 0;
+                    if (!rev_cycle ) {
+                        if (0 != srf_write_trace_hdr(out_srf, &in_srf->th)) {
+                            fprintf(stderr, "Error writing trace header.\nExiting.\n");
+                            exit(1);
+                        }
+                    }else{
+                        if (0 != srf_write_trace_hdr(out_srf, &out_srf->th)) {
+                            fprintf(stderr, "Error writing trace header.\nExiting.\n");
+                            exit(1);
+                        }
+                    }
+                }
+
+                if (!rev_cycle || (rev_cycle && in_srf->mf_pos)) {
+                    if (0 != srf_write_trace_body(out_srf, &old_tb)) {
+                        fprintf(stderr, "Error writing trace body.\nExiting.\n");
+                        exit(1);
+                    }
+		}
+                if (old_tb.trace_size)
+                    free(old_tb.trace);
+		break;
+	    }
+#endif		
+
+	    if (!in_srf->mf) {
+		fprintf(stderr, "Error reading trace body.\nExiting.\n");
+		exit(1);
+	    }
+
+	    mfseek(in_srf->mf, in_srf->mf_end, SEEK_SET);
+	    if (old_tb.trace_size) {
+		mfwrite(old_tb.trace, 1, old_tb.trace_size, in_srf->mf);
+		free(old_tb.trace);
+		old_tb.trace = NULL;
+	    }
+	    mftruncate(in_srf->mf, mftell(in_srf->mf));
+	    mfseek(in_srf->mf, in_srf->mf_pos, SEEK_SET);
+
+	    if (in_srf->ztr)
+		ztr_tmp = ztr_dup(in_srf->ztr); /* inefficient, but simple */
+	    else
+		ztr_tmp = NULL;
+
+	    if ((ztr_tmp = partial_decode_ztr(in_srf, in_srf->mf, ztr_tmp))) {
+
+		/* create the trace body data */
+		mFILE *mf = mfcreate(NULL, 0);
+
+		/* include the ztr header if it wasn't in the trace header block */
+		if( !in_srf->mf_pos ){
+		    mfseek(in_srf->mf, 0, SEEK_SET);
+		    mfwrite(in_srf->mf->data, 1, sizeof(ztr_header_t), mf);
+		    mfseek(in_srf->mf, sizeof(ztr_header_t), SEEK_CUR);
+		}else{
+		    mfseek(in_srf->mf, in_srf->mf_pos, SEEK_SET);
+		}
+
+		int pos = mftell(in_srf->mf);
+		while (chunk = ztr_read_chunk_hdr(in_srf->mf)) {
+		    char *key = ztr_lookup_mdata_value(ztr_tmp, chunk, "TYPE");
+		    int flag = 0;
+
+		    /* filter on chunk type */
+		    switch (chunk->type) {
+		    case ZTR_TYPE_BASE:
+			if (chunk_mode & CHUNK_BASE)
+			    flag = 1;
+			break;
+		    case ZTR_TYPE_CNF1:
+			if (chunk_mode & CHUNK_CNF1)
+			    flag = 1;
+			break;
+		    case ZTR_TYPE_CNF4:
+			if (chunk_mode & CHUNK_CNF4)
+			    flag = 1;
+			break;
+		    case ZTR_TYPE_REGN:
+                        if (rev_cycle && in_srf->mf_pos) {
+                            fprintf(stderr, "Added REGN chunk to trace header but found REGN chunk in trace body\n");
+                            exit(1);
+                        }
+                        if (!rev_cycle)
+			    flag = 1;
+			break;
+		    case ZTR_TYPE_SAMP:
+			if (chunk_mode & CHUNK_SAMP) {
+			    if (mdata_mode == TYPE_ALL)
+				flag = 1;
+			    if ((mdata_mode & TYPE_0FAM) && (key && 0 == strcmp(key, "0FAM")))
+				flag = 1;
+			    if ((mdata_mode & TYPE_1CY3) && (key && 0 == strcmp(key, "1CY3")))
+				flag = 1;
+			    if ((mdata_mode & TYPE_2TXR) && (key && 0 == strcmp(key, "2TXR")))
+				flag = 1;
+			    if ((mdata_mode & TYPE_3CY5) && (key && 0 == strcmp(key, "3CY5")))
+				flag = 1;
+			}
+			break;
+		    case ZTR_TYPE_SMP4:
+			if (chunk_mode & CHUNK_SMP4) {
+			    if (mdata_mode == TYPE_ALL)
+				flag = 1;
+			    if ((mdata_mode & TYPE_PROC) && (NULL == key || 0 == strcmp(key, "PROC")))
+				flag = 1;
+			    if ((mdata_mode & TYPE_SLXI) && (key && 0 == strcmp(key, "SLXI")))
+				flag = 1;
+			    if ((mdata_mode & TYPE_SLXN) && (key && 0 == strcmp(key, "SLXN")))
+				flag = 1;
+			}
+			break;
+		    default:
+			flag = 1;
+			break;
+		    }
+
+		    if (flag)
+			mfwrite(in_srf->mf->data+pos, 1, (4+4+chunk->mdlength+4+chunk->dlength), mf);
+		    mfseek(in_srf->mf, chunk->dlength, SEEK_CUR);
+		    pos = mftell(in_srf->mf);
+
+		    if (chunk->mdata)
+			xfree(chunk->mdata);
+		    xfree(chunk);
+		}
+
+                if (rev_cycle && !in_srf->mf_pos) {
+                    fprintf(stderr, "Adding REGN chunk to trace body\n");
+                    if ( -1 == add_readpair_region(rev_cycle, mf)) {
+                        fprintf(stderr, "Failed to add to REGN chunk\n");
+                        exit(1);
+                    }
+                }
+
+                /* output the trace header as required */
+                if( output_trace_header ) {
+                    output_trace_header = 0;
+                    if (0 != srf_write_trace_hdr(out_srf, &out_srf->th)) {
+                        fprintf(stderr, "Error writing trace header.\nExiting.\n");
+                        exit(1);
+                    }
+                }
+
+                /* construct the new trace body */
+		srf_trace_body_t new_tb;
+		srf_construct_trace_body(&new_tb, name+strlen(in_srf->th.id_prefix), -1, mf->data, mf->size, old_tb.flags);
+
+		if (0 != srf_write_trace_body(out_srf, &new_tb)) {
+		    fprintf(stderr, "Error writing trace body.\nExiting.\n");
+		    exit(1);
+		}
+
+		mfdestroy(mf);
+	    }
+
+	    if( ztr_tmp )
+		delete_ztr(ztr_tmp);
+
+	    break;
+	}
+
+	case -1: {
+	    /* are we really at the end of the srf file */
+	    long pos = ftell(in_srf->fp);
+	    fseek(in_srf->fp, 0, SEEK_END);
+	    if( pos != ftell(in_srf->fp) ){
+		srf_destroy(in_srf, 1);
+		fprintf(stderr, "srf file is corrupt\n");
+ 		return 1;
+	    }
+	    srf_destroy(in_srf, 1);
+	    return 0;
+	}
+
+	case SRFB_NULL_INDEX: {
+	    /*
+	     * Maybe the last 8 bytes of a the file (or previously was
+	     * last 8 bytes prior to concatenating SRF files together).
+	     * If so it's the index length and should always be 8 zeros.
+	     */
+	    uint64_t ilen;
+	    if (1 != fread(&ilen, 8, 1, in_srf->fp)) {
+		srf_destroy(in_srf, 1);
+		fprintf(stderr, "srf file is corrupt\n");
+		return 1;
+	    }
+	    if (ilen != 0) {
+		srf_destroy(in_srf, 1);
+		fprintf(stderr, "srf file is corrupt\n");
+		return 1;
+	    }
+	    break;
+	}
+
+	case SRFB_INDEX: {
+	    long pos = ftell(in_srf->fp);
+	    srf_read_index_hdr(in_srf, &in_srf->hdr, 1);
+
+	    /* Skip the index body */
+	    fseeko(in_srf->fp, pos + in_srf->hdr.size, SEEK_SET);
+	    break;
+	}
+
+	default:
+	    srf_destroy(in_srf, 1);
+	    fprintf(stderr, "Block of unknown type '%c'. Aborting\n", type);
+	    return 1;
+	}
+
+    } while (1);
+
+    srf_destroy(in_srf, 1);
+    return 0;
+}
+
+/* ------------------------------------------------------------------------ */
+
+/*
+ * Main method.
+ */
+int main(int argc, char **argv) {
+    int nfiles, ifile;
+    int filter_mode = 0;
+    char *input = NULL;
+    char *output = NULL;
+    read_filter_t *read_filter = NULL;
+    char *filter_value = NULL;
+    int rev_cycle = 0;
+
+    int c;
+    int errflg = 0;
+    extern char *optarg;
+    extern int optind, optopt;
+
+    char chunk_mode = CHUNK_ALL;
+    char mdata_mode = TYPE_ALL;
+    int verbose = 0;
+    int read_mask = 0;
+
+    srf_t *srf = NULL;
+
+    while ((c = getopt(argc, argv, ":c:m:f:vb2:")) != -1) {
+        switch (c) {
+        case 'c':
+	    chunk_mode = 0;
+	    if(get_chunk_types(optarg, &chunk_mode) || !chunk_mode) {
+                fprintf(stderr,
+			"Invalid value \"%s\" given to option -%c.\n", optarg, c);
+		errflg++;
+	    }
+	    break;
+        case 'm':
+	    mdata_mode = 0;
+	    if(get_mdata_types(optarg, &mdata_mode) || !mdata_mode) {
+                fprintf(stderr,
+			"Invalid value \"%s\" given to option -%c.\n", optarg, c);
+		errflg++;
+	    }
+	    break;
+        case 'f':
+  	    filter_mode++;
+	    filter_value = optarg;
+            break;
+        case 'v':
+	    verbose++;
+            break;
+        case 'b':
+	    read_mask = SRF_READ_FLAG_BAD_MASK;
+            break;
+	case '2':
+  	    rev_cycle = atoi(optarg);
+            break;
+        case ':':       /* -? without operand */
+            fprintf(stderr,
+                    "Option -%c requires an operand\n", optopt);
+            errflg++;
+            break;
+        case '?':
+            fprintf(stderr,
+                    "Unrecognised option: -%c\n", optopt);
+            errflg++;
+        }
+    }
+
+    if (errflg) {
+	usage(1);
+    }
+
+    nfiles = (argc-optind);
+    if( nfiles < 2 ){
+        fprintf(stderr, "Please specify input archive name(s) and an output archive name.\n");
+        usage(1);
+    }
+    output = argv[optind+nfiles-1];
+    nfiles--;
+    
+    if(filter_mode) {
+	read_filter = get_read_filter(filter_value);
+	if(verbose) {
+	    dump_read_filter(read_filter);
+	}
+    }
+
+    if(chunk_mode && verbose) {
+	dump_chunk_mode(chunk_mode);
+    }
+
+    if(mdata_mode && verbose) {
+	dump_mdata_mode(mdata_mode);
+    }
+
+    if (NULL == (srf = srf_open(output, "wb"))) {
+        perror(output);
+        return 1;
+    }
+    
+    for (ifile=0; ifile<nfiles; ifile++) {
+        input = argv[optind+ifile];
+        printf("Reading archive %s.\n", input);
+
+        if (0 != srf_filter(input, srf, chunk_mode, mdata_mode, filter_mode, read_filter, read_mask, rev_cycle)) {
+            srf_destroy(srf, 1);
+            remove(output);
+            return 1;
+	}
+    }
+
+    if(NULL != srf)
+        srf_destroy(srf, 1);
+
+    return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/progs/srf_index_hash.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,144 @@
+/*
+ * This adds a hash table index (".hsh" v1.01 format) to an SRF archive.
+ * It does this either inline on the file itself (provided it doesn't already
+ * have an index) or by producing an external index file.
+ */
+
+/* ---------------------------------------------------------------------- */
+
+#ifdef HAVE_CONFIG_H
+#include "io_lib_config.h"
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <io_lib/hash_table.h>
+#include <io_lib/os.h>
+#include <io_lib/array.h>
+#include <io_lib/srf.h>
+
+/* ------------------------------------------------------------------------ */
+void usage(int code) {
+    printf("Usage: srf_index_hash [-c] srf_file\n");
+    printf(" Options:\n");
+    printf("    -c       check an existing index, don't re-index\n");
+    exit(code);
+}
+
+int main(int argc, char **argv) {
+    srf_t *srf;
+    uint64_t pos;
+    char name[512];
+    int i, type;
+    char *archive;
+    int dbh_pos_stored_sep = 0;
+    int check = 0;
+    off_t old_index = 0;
+    srf_index_t *idx;
+    
+    /* Parse args */
+    for (i = 1; i < argc && argv[i][0] == '-'; i++) {
+	if (!strcmp(argv[i], "-")) {
+	    break;
+	} else if (!strcmp(argv[i], "-c")) {
+	    check = 1;
+	} else if (!strcmp(argv[i], "-h")) {
+	    usage(0);
+	} else {
+	    usage(1);
+	}
+    }
+
+    if (argc != (i+1)) {
+      usage(1);
+    }
+
+    archive = argv[i];
+
+    if( check ){
+        srf = srf_open(archive, "rb");
+    } else {
+        srf = srf_open(archive, "r+b");
+    }
+    if (NULL == srf ){
+ 	perror(argv[i]);
+	return 1;
+    }
+    
+    
+    idx = srf_index_create(NULL, NULL, dbh_pos_stored_sep);
+    if (NULL == idx)
+	return 1;
+
+    /* Scan through file gathering the details to index in memory */
+    while ((type = srf_next_block_details(srf, &pos, name)) >= 0) {
+	/* Only want this set if the last block in the file is an index */
+	old_index = 0;
+
+	switch (type) {
+	case SRFB_CONTAINER:
+	    if (srf_index_add_cont_hdr(idx, pos))
+		return 1;
+	    break;
+
+	case SRFB_TRACE_HEADER:
+	    if (srf_index_add_trace_hdr(idx, pos))
+		return 1;
+	    break;
+
+	case SRFB_TRACE_BODY:
+	    if (srf_index_add_trace_body(idx, name, pos))
+		return 1;
+	    break;
+
+	case SRFB_INDEX:
+	    /* An old index */
+	    old_index = pos;
+	    break;
+
+        case SRFB_NULL_INDEX:
+	    old_index = pos;
+            break;
+
+	default:
+	    abort();
+	}
+    }
+
+    /* the type should be -1 (EOF) */
+    if( type != -1 )
+        abort();
+
+    /* are we really at the end of the srf file */
+    pos = ftell(srf->fp);
+    fseek(srf->fp, 0, SEEK_END);
+    if( pos != ftell(srf->fp) ){
+        fprintf(stderr, "srf file is corrupt\n");
+	return 1;
+    }
+    
+    if (check) {
+	srf_index_destroy(idx);
+	srf_destroy(srf, 1);
+	return 0;
+    }
+
+    /* Write out the index */
+    if (old_index)
+	fseeko(srf->fp, old_index, SEEK_SET);
+
+    srf_index_stats(idx, NULL);
+    srf_index_write(srf, idx);
+
+    /* Truncate incase we've somehow overwritten an old longer index */
+    ftruncate(fileno(srf->fp), ftello(srf->fp));
+
+    srf_index_destroy(idx);
+    srf_destroy(srf, 1);
+    
+    return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/progs/srf_info.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,879 @@
+/*
+ * ======================================================================
+ * This software has been created by Genome Research Limited (GRL).
+ *
+ * GRL hereby grants permission to use, copy, modify and distribute
+ * this software and its documentation for non-commercial purposes
+ * without fee at the user's own risk on the basis set out below.
+ *
+ * GRL neither undertakes nor accepts any duty whether contractual or
+ * otherwise in connection with the software, its use or the use of
+ * any derivative, and makes no representations or warranties, express
+ * or implied, concerning the software, its suitability, fitness for
+ * a particular purpose or non-infringement.
+ *
+ * In no event shall the authors of the software or GRL be responsible
+ * or liable for any loss or damage whatsoever arising in any way
+ * directly or indirectly out of the use of this software or its
+ * derivatives, even if advised of the possibility of such damage.
+ *
+ * Our software can be freely distributed under the conditions set out
+ * above, and must contain this copyright notice.
+ * ======================================================================
+ */
+
+/*
+ * This performs a linear (non-indexed) search for a trace in an SRF archive.
+ *
+ * It's not intended as a suitable production program or as a library of code
+ * to use, but as a test and benchmark statistic.
+ */
+
+#include <string.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <ctype.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <io_lib/Read.h>
+#include <io_lib/misc.h>
+#include <io_lib/ztr.h>
+#include <io_lib/srf.h>
+#include <io_lib/hash_table.h>
+
+#define LEVEL_READ  (1 << 0)
+#define LEVEL_CHUNK (1 << 1)
+#define LEVEL_NAME  (1 << 2)
+#define LEVEL_BASE  (1 << 3)
+#define LEVEL_ALL   (LEVEL_READ | LEVEL_CHUNK | LEVEL_NAME | LEVEL_BASE );
+
+/* only checks the first 10 traces */
+#define LEVEL_CHECK 255 
+
+#define READ_GOOD  0
+#define READ_BAD   1
+#define READ_TOTAL 2
+
+#define NREADS 3
+
+#define READ_GOOD_STR   "GOOD"
+#define READ_BAD_STR    "BAD"
+#define READ_TOTAL_STR  "TOTAL"
+
+/* see ztr.h for a list of all possible ztr chunk types */
+
+#define CHUNK_BASE 0
+#define CHUNK_CNF1 1
+#define CHUNK_CNF4 2
+#define CHUNK_SAMP 3
+#define CHUNK_SMP4 4
+#define CHUNK_REGN 5
+
+#define NCHUNKS 6
+
+#define CHUNK_BASE_TYPE ZTR_TYPE_BASE
+#define CHUNK_CNF1_TYPE ZTR_TYPE_CNF1
+#define CHUNK_CNF4_TYPE ZTR_TYPE_CNF4
+#define CHUNK_SAMP_TYPE ZTR_TYPE_SAMP
+#define CHUNK_SMP4_TYPE ZTR_TYPE_SMP4
+#define CHUNK_REGN_TYPE ZTR_TYPE_REGN
+
+#define KEY_TYPE    0
+#define KEY_VALTYPE 1
+#define KEY_GROUP   2
+#define KEY_OFFS    3
+#define KEY_SCALE   4
+#define KEY_COORD   5
+#define KEY_NAME    6
+
+#define NKEYS 7
+
+#define KEY_TYPE_STR    "TYPE"
+#define KEY_VALTYPE_STR "VALTYPE"
+#define KEY_GROUP_STR   "GROUP"
+#define KEY_OFFS_STR    "OFFS"
+#define KEY_SCALE_STR   "SCALE"
+#define KEY_COORD_STR   "COORD"
+#define KEY_NAME_STR    "NAME"
+
+#define TYPE_PROC 0
+#define TYPE_SLXI 1
+#define TYPE_SLXN 2
+#define TYPE_0FAM 3
+#define TYPE_1CY3 4
+#define TYPE_2TXR 5
+#define TYPE_3CY5 6
+
+#define NTYPES 7
+
+#define TYPE_PROC_STR "PROC"
+#define TYPE_SLXI_STR "SLXI"
+#define TYPE_SLXN_STR "SLXN"
+#define TYPE_0FAM_STR "0FAM"
+#define TYPE_1CY3_STR "1CY3"
+#define TYPE_2TXR_STR "2TXR"
+#define TYPE_3CY5_STR "3CY5"
+
+#define MAX_REGIONS   4
+
+/* regn chunk */
+typedef struct {
+    char coord;
+    char *region_names;
+    int nregions;
+    char *name[MAX_REGIONS];
+    char code[MAX_REGIONS];
+    int start[MAX_REGIONS];
+    int length[MAX_REGIONS];
+    int count;
+} regn_t;
+
+/* ------------------------------------------------------------------------ */
+/*
+ * Print usage message to stderr and exit with the given \"code\".
+ */
+void usage(int code) {
+    fprintf(stderr, "Usage: srf_info [-level level_bitmap] input(s)\n");
+    fprintf(stderr, "Options:\n");
+    fprintf(stderr, "    -l level_bitmap \n");
+    fprintf(stderr, "              1\tCount of good/bad reads.\n");
+    fprintf(stderr, "              2\tCounts for selected chunk types.\n");
+    fprintf(stderr, "              4\tTrace count and trace name prefix for each trace_header.\n");
+    fprintf(stderr, "              8\tBase count.\n");
+    fprintf(stderr, "\n");
+
+    exit(code);
+}
+
+/*
+ * Parse the REGN chunk, add to regn HASH
+ *
+ * Returns corresponding HashItem * from regn Hash
+ */
+HashItem *parse_regn(ztr_t *z, ztr_chunk_t *chunk, HashTable *regn_hash) {
+    char key[1024];
+    char *name;
+    HashItem *hi;
+    regn_t *regn;
+    size_t l;
+    
+    uncompress_chunk(z, chunk);
+
+    /* the hash key is a combination of the region names and boundaries */
+    name = ztr_lookup_mdata_value(z, chunk, "NAME");
+    l = snprintf(key, sizeof(key), "names=%s", name);
+    if( chunk->dlength ){
+        int nbndy = (chunk->dlength-1)/4;
+        uint4 *bndy = (uint4 *)(chunk->data+1);
+        int ibndy;
+	for (ibndy=0; ibndy<nbndy; ibndy++) {
+            if( ibndy )
+                l += snprintf(key + l, sizeof(key) - l,
+			      ";%d", be_int4(bndy[ibndy]));
+            else
+                l += snprintf(key + l, sizeof(key) - l,
+			      " boundaries=%d", be_int4(bndy[ibndy]));
+        }
+    }
+
+    if (NULL == (hi = (HashTableSearch(regn_hash, key, strlen(key))))) {
+        int iregion, nregions = 0;
+        char *coord;
+	char *cp1;
+        uint4 bndy[MAX_REGIONS];
+        int ibndy, nbndy = 0;
+        HashData hd;
+
+        if( NULL == (regn = (regn_t *)malloc(sizeof(regn_t)))) {
+	    return NULL;
+	}
+
+	coord = ztr_lookup_mdata_value(z, chunk, "COORD");
+	regn->coord = (NULL == coord ? 'B' : *coord );
+
+	regn->region_names = strdup(name);
+
+        cp1 = strtok (regn->region_names,";");
+        while(cp1) {
+            char *cp2;
+            if(NULL == (cp2 = strchr(cp1,':'))) {
+                fprintf(stderr, "Invalid region name/code pair %s\n", cp1);
+                return NULL;
+            }
+            *cp2++ = '\0';
+            regn->name[nregions] = cp1;
+            regn->code[nregions] = *cp2;
+            nregions++;
+            cp1 = strtok (NULL, ";");
+        }
+
+        regn->nregions = nregions;
+
+	if( chunk->dlength ) {
+            nbndy = (chunk->dlength-1)/4;
+            memcpy(bndy, chunk->data+1, chunk->dlength-1);
+	}
+
+        for( iregion=0, ibndy=0; iregion<nregions; iregion++) {
+            /* start = (start + length of previous region) or 0 if no previous region */
+            /* length = (next boundary - start of region) or -1 if no next boundary */
+            if( regn->code[iregion] == 'E' ){
+                /* no sequence, length = 0 */
+                regn->start[iregion] = (iregion ? (regn->start[iregion-1] + regn->length[iregion-1]) : 0);
+                regn->length[iregion] = 0;
+            }else{
+                if( ibndy > nbndy ){
+                    fprintf(stderr, "More name/code pairs than boundaries\n");
+                    return NULL;
+                }
+                regn->start[iregion] = (iregion ? (regn->start[iregion-1] + regn->length[iregion-1]) : 0);
+                regn->length[iregion] = (ibndy == nbndy ? -1 : (be_int4(bndy[ibndy])-regn->start[iregion]));
+                ibndy++;
+            }
+        }
+
+        regn->count = 1;
+            
+	hd.p = regn;
+	if (NULL == (hi = HashTableAdd(regn_hash, key, strlen(key), hd, NULL))) {
+	    free(regn->region_names);
+	    free(regn);
+	    return NULL;
+	}
+    } else {
+	regn = (regn_t *)(hi->data.p);
+	regn->count++;
+    }
+
+    return hi;
+}
+
+/*
+ * Parse the sequence
+ *
+ * Returns 0 on success.
+ */
+int parse_base(ztr_t *z, ztr_chunk_t *chunk, uint64_t *base_count) {
+    int i;
+    
+    uncompress_chunk(z, chunk);
+
+    for (i = 1; i < chunk->dlength; i++) {
+	char base = chunk->data[i];
+        uint1 key;
+	switch (base) {
+	case 'A': case 'a':
+            key = 0;
+            break;
+	case 'C': case 'c':
+            key = 1;
+            break;
+	case 'G': case 'g':
+            key = 2;
+            break;
+	case 'T': case 't':
+            key = 3;
+            break;
+	default:
+            key = 4;
+            break;
+	}
+        base_count[key]++;
+    }
+
+    return 0;
+}
+
+/*
+ * count the mdata keys
+ *
+ * Returns 0 on success.
+ */
+int count_mdata_keys(ztr_t *z, ztr_chunk_t *chunk, int ichunk, long key_count[NCHUNKS][NKEYS], long type_count[NCHUNKS][NTYPES]) {
+    char *keys_str[] = {KEY_TYPE_STR, KEY_VALTYPE_STR, KEY_GROUP_STR, KEY_OFFS_STR, KEY_SCALE_STR, KEY_COORD_STR, KEY_NAME_STR};
+    char *types_str[] = {TYPE_PROC_STR, TYPE_SLXI_STR, TYPE_SLXN_STR, TYPE_0FAM_STR, TYPE_1CY3_STR, TYPE_2TXR_STR, TYPE_3CY5_STR};
+    int ikey, itype;
+
+    if (z->header.version_major > 1 ||
+	z->header.version_minor >= 2) {
+	/* ZTR format 1.2 onwards */
+
+	char *cp = chunk->mdata;
+	int32_t dlen = chunk->mdlength;
+
+	/*
+	 * NB: we may wish to rewrite this using a dedicated state machine
+	 * instead of strlen/strcmp as this currently assumes the meta-
+	 * data is correctly formatted, which we cannot assume as the 
+	 * metadata is external and outside of our control.
+	 * Passing in non-nul terminated strings could crash this code.
+	 */
+	while (dlen > 0) {
+	    size_t l;
+
+	    /* key */
+	    l = strlen(cp);
+	    for (ikey=0; ikey<NKEYS; ikey++)
+		if(0 == strcmp(cp, keys_str[ikey]))
+		    break;
+
+	    cp += l+1;
+	    dlen -= l+1;
+
+	    /* value */
+	    if (ikey < NKEYS)
+		key_count[ichunk][ikey]++;
+
+	    /* for the type key check the value */
+	    if (ikey == KEY_TYPE && (ichunk == CHUNK_SAMP || ichunk == CHUNK_SMP4)) {
+		for (itype=0; itype<NTYPES; itype++)
+		    if(0 == strcmp(cp, types_str[itype]))
+			break;
+		if(itype < NTYPES)
+		    type_count[ichunk][itype]++;
+	    }
+
+	    l = strlen(cp);
+	    cp += l+1;
+	    dlen -= l+1;
+	}
+
+    } else {
+	/* v1.1 and before only supported a few types, specifically coded
+	 * per chunk type.
+	 */
+
+	switch (chunk->type) {
+	case ZTR_TYPE_SAMP:
+	case ZTR_TYPE_SMP4:
+	    key_count[ichunk][KEY_TYPE]++;
+	    for (itype=0; itype<NTYPES; itype++)
+		if(0 == strcmp(chunk->mdata, types_str[itype])) {
+		    type_count[ichunk][itype]++;
+		}
+	    break;
+
+	default:
+	    break;
+	}
+    }
+
+    return 0;
+}
+
+/*
+ * As per partial_decode_ztr in srf.c, but without uncompress_ztr.
+ */
+ztr_t *partial_decode_ztr2(srf_t *srf, mFILE *mf, ztr_t *z) {
+    ztr_t *ztr;
+    ztr_chunk_t *chunk;
+    long pos = 0;
+
+    if (z) {
+	/* Use existing ZTR object => already loaded header */
+	ztr = z;
+
+    } else {
+	/* Allocate or use existing ztr */
+	if (NULL == (ztr = new_ztr()))
+	    return NULL;
+
+	/* Read the header */
+	if (-1 == ztr_read_header(mf, &ztr->header)) {
+	    if (!z)
+		delete_ztr(ztr);
+	    mrewind(mf);
+	    return NULL;
+	}
+
+	/* Check magic number and version */
+	if (memcmp(ztr->header.magic, ZTR_MAGIC, 8) != 0) {
+	    if (!z)
+		delete_ztr(ztr);
+	    mrewind(mf);
+	    return NULL;
+	}
+
+	if (ztr->header.version_major != ZTR_VERSION_MAJOR) {
+	    if (!z)
+		delete_ztr(ztr);
+	    mrewind(mf);
+	    return NULL;
+	}
+    }
+
+    /* Load chunks */
+    pos = mftell(mf);
+    while (chunk = ztr_read_chunk_hdr(mf)) {
+	chunk->data = (char *)xmalloc(chunk->dlength);
+	if (chunk->dlength != mfread(chunk->data, 1, chunk->dlength, mf))
+	    break;
+
+	ztr->nchunks++;
+	ztr->chunk = (ztr_chunk_t *)xrealloc(ztr->chunk, ztr->nchunks *
+					     sizeof(ztr_chunk_t));
+	memcpy(&ztr->chunk[ztr->nchunks-1], chunk, sizeof(*chunk));
+	xfree(chunk);
+	pos = mftell(mf);
+    }
+
+    /*
+     * At this stage we're 'pos' into the mFILE mf with any remainder being
+     * a partial block.
+     */
+    if (0 == ztr->nchunks) {
+	if (!z)
+	    delete_ztr(ztr);
+	mrewind(mf);
+	return NULL;
+    }
+
+    /* Ensure we exit at the start of a ztr CHUNK */
+    mfseek(mf, pos, SEEK_SET);
+
+    /* If this is the header part, ensure we uncompress and init. data */
+    if (!z) {
+	/* Force caching of huffman code_sets */
+	ztr_find_hcode(ztr, CODE_USER);
+
+	/* And uncompress the rest */
+	uncompress_ztr(ztr);
+    }
+
+    return ztr;
+}
+
+/*
+ * Given the archive name and the level_mode
+ * generate information about the archive
+ *
+ * Note the generated srf file is NOT indexed
+ *
+ * Returns 0 on success.
+ */
+int srf_info(char *input, int level_mode, long *read_count, long *chunk_count,
+	     uint64_t *chunk_size, long key_count[NCHUNKS][NKEYS],
+	     long type_count[NCHUNKS][NTYPES], HashTable *regn_hash,
+	     uint64_t *base_count) {
+    srf_t *srf;
+    off_t pos;
+    int type;
+    int count = 0;
+    long trace_body_count = 0;
+    char name[1024];
+
+    if (NULL == (srf = srf_open(input, "rb"))) {
+	perror(input);
+	return 1;
+    }
+
+    while ((type = srf_next_block_type(srf)) >= 0) {
+
+      switch (type) {
+	case SRFB_CONTAINER:
+	    if( trace_body_count ){
+		if( level_mode & LEVEL_NAME )
+		    printf( " ... %s x%ld\n", name+strlen(srf->th.id_prefix), trace_body_count);
+		trace_body_count = 0;
+	    }
+	    if (0 != srf_read_cont_hdr(srf, &srf->ch)) {
+		fprintf(stderr, "Error reading container header.\nExiting.\n");
+		exit(1);
+	    }
+	    break;
+
+        case SRFB_XML:
+	    if( trace_body_count ){
+		if( level_mode & LEVEL_NAME )
+		    printf( " ... %s x%ld\n", name+strlen(srf->th.id_prefix), trace_body_count);
+		trace_body_count = 0;
+	    }
+	    if (0 != srf_read_xml(srf, &srf->xml)) {
+		fprintf(stderr, "Error reading XML.\nExiting.\n");
+		exit(1);
+	    }
+	    break;
+
+	case SRFB_TRACE_HEADER:
+	    if( trace_body_count ){
+		if( level_mode & LEVEL_NAME )
+		    printf( " ... %s x%ld\n", name+strlen(srf->th.id_prefix), trace_body_count);
+		trace_body_count = 0;
+	    }
+	    if (0 != srf_read_trace_hdr(srf, &srf->th)) {
+		fprintf(stderr, "Error reading trace header.\nExiting.\n");
+		exit(1);
+	    }
+
+	    if( 0 == (level_mode & (LEVEL_CHUNK | LEVEL_BASE)) )
+		break;
+
+	    /* Decode ZTR chunks in the header */
+	    if (srf->mf)
+		mfdestroy(srf->mf);
+
+	    srf->mf = mfcreate(NULL, 0);
+	    if (srf->th.trace_hdr_size)
+		mfwrite(srf->th.trace_hdr, 1, srf->th.trace_hdr_size, srf->mf);
+	    if (srf->ztr)
+		delete_ztr(srf->ztr);
+	    mrewind(srf->mf);
+
+	    if (NULL != (srf->ztr = partial_decode_ztr(srf, srf->mf, NULL))) {
+		srf->mf_pos = mftell(srf->mf);
+	    } else {
+		/* Maybe not enough to decode or no headerBlob. */
+		/* So delay until decoding the body. */
+		srf->mf_pos = 0;
+	    }
+	    mfseek(srf->mf, 0, SEEK_END);
+	    srf->mf_end = mftell(srf->mf);
+
+	    break;
+
+	case SRFB_TRACE_BODY: {
+	    srf_trace_body_t old_tb;
+	    ztr_t *ztr_tmp;
+            int no_trace = (level_mode & (LEVEL_CHUNK | LEVEL_BASE) ? 0 : 1);
+
+	    if (0 != srf_read_trace_body(srf, &old_tb, no_trace)) {
+		fprintf(stderr, "Error reading trace body.\nExiting.\n");
+		exit(1);
+	    }
+
+	    if (-1 == construct_trace_name(srf->th.id_prefix,
+					   (unsigned char *)old_tb.read_id,
+					   old_tb.read_id_length,
+					   name, 512)) {
+		fprintf(stderr, "Error constructing trace name.\nExiting.\n");
+		exit(1);
+	    }
+
+	    trace_body_count++;
+	    if( 1 == trace_body_count ){
+		if( level_mode & LEVEL_NAME )
+		    printf( "trace_name: %s + %s", srf->th.id_prefix, name+strlen(srf->th.id_prefix));
+	    }
+          
+	    read_count[READ_TOTAL]++;
+
+	    if (old_tb.flags & SRF_READ_FLAG_BAD_MASK ){
+		read_count[READ_BAD]++;
+	    } else {
+		read_count[READ_GOOD]++;
+	    }
+          
+	    if( 0 == (level_mode & (LEVEL_CHUNK | LEVEL_BASE)) )
+		break;
+
+	    if (!srf->mf) {
+		fprintf(stderr, "Error reading trace body.\nExiting.\n");
+		exit(1);
+	    }
+
+	    mfseek(srf->mf, srf->mf_end, SEEK_SET);
+	    if (old_tb.trace_size) {
+		mfwrite(old_tb.trace, 1, old_tb.trace_size, srf->mf);
+		free(old_tb.trace);
+		old_tb.trace = NULL;
+	    }
+          
+	    mftruncate(srf->mf, mftell(srf->mf));
+	    mfseek(srf->mf, srf->mf_pos, SEEK_SET);
+
+	    if (srf->ztr)
+		ztr_tmp = ztr_dup(srf->ztr); /* inefficient, but simple */
+	    else
+		ztr_tmp = NULL;
+
+	    if ((ztr_tmp = partial_decode_ztr(srf, srf->mf, ztr_tmp))) {
+		int i;
+		for (i=0; i<ztr_tmp->nchunks; i++) {
+		    int ichunk = -1;
+
+		    switch (ztr_tmp->chunk[i].type) {
+		    case ZTR_TYPE_BASE:
+			ichunk = CHUNK_BASE;
+			chunk_size[ichunk] += ztr_tmp->chunk[i].dlength;
+			if( parse_base(ztr_tmp, &ztr_tmp->chunk[i], base_count) ){
+			    delete_ztr(ztr_tmp);
+			    return 1;
+			}
+			break;
+		    case ZTR_TYPE_CNF1:
+			ichunk = CHUNK_CNF1;
+			chunk_size[ichunk] += ztr_tmp->chunk[i].dlength;
+			break;
+		    case ZTR_TYPE_CNF4:
+			ichunk = CHUNK_CNF4;
+			chunk_size[ichunk] += ztr_tmp->chunk[i].dlength;
+			break;
+		    case ZTR_TYPE_SAMP:
+			ichunk = CHUNK_SAMP;
+			chunk_size[ichunk] += ztr_tmp->chunk[i].dlength;
+			break;
+		    case ZTR_TYPE_SMP4:
+			ichunk = CHUNK_SMP4;
+			chunk_size[ichunk] += ztr_tmp->chunk[i].dlength;
+			break;
+		    case ZTR_TYPE_REGN:
+			ichunk = CHUNK_REGN;
+			chunk_size[ichunk] += ztr_tmp->chunk[i].dlength;
+			if( NULL == parse_regn(ztr_tmp, &ztr_tmp->chunk[i], regn_hash) ){
+			    delete_ztr(ztr_tmp);
+			    return 1;
+			}
+			break;
+		    default:
+			break;
+		    }
+
+		    if( ichunk > -1 ) {
+			chunk_count[ichunk]++;
+			count_mdata_keys(ztr_tmp, &ztr_tmp->chunk[i], ichunk, key_count, type_count);
+		    }
+		}
+
+	    }
+
+	    if( ztr_tmp )
+		delete_ztr(ztr_tmp);
+
+	    count++;
+	    if( (level_mode == LEVEL_CHECK) && (count == 10) ){
+		printf( " ... %s x%ld\n", name+strlen(srf->th.id_prefix), trace_body_count);
+		srf_destroy(srf, 1);
+		return 0;
+	    }
+          
+	    break;
+        }
+
+	case SRFB_INDEX: {
+            off_t pos = ftell(srf->fp);
+	    if( trace_body_count ){
+		if( level_mode & LEVEL_NAME )
+		    printf( " ... %s x%ld\n", name+strlen(srf->th.id_prefix), trace_body_count);
+		trace_body_count = 0;
+	    }
+            printf( "Reading srf index block\n");
+	    if (0 != srf_read_index_hdr(srf, &srf->hdr, 1)) {
+		srf_destroy(srf, 1);
+		fprintf(stderr, "Error reading srf index block header.\nExiting.\n");
+		exit(1);
+	    }
+            /* Skip the index body */
+	    fseeko(srf->fp, pos + srf->hdr.size, SEEK_SET);
+
+            break;
+        }
+        
+	case SRFB_NULL_INDEX: {
+            uint64_t ilen;
+	    if( trace_body_count ){
+		if( level_mode & LEVEL_NAME )
+		    printf( " ... %s x%ld\n", name+strlen(srf->th.id_prefix), trace_body_count);
+		trace_body_count = 0;
+	    }
+            printf( "Reading srf null index block\n");
+	    /*
+	     * Maybe the last 8 bytes of a the file (or previously was
+	     * last 8 bytes prior to concatenating SRF files together).
+	     * If so it's the index length and should always be 8 zeros.
+	     */
+            if (1 != fread(&ilen, 8, 1, srf->fp)) {
+		srf_destroy(srf, 1);
+		fprintf(stderr, "Error reading srf null index block.\nExiting.\n");
+		exit(1);
+            }
+            if (ilen != 0) {
+		srf_destroy(srf, 1);
+		fprintf(stderr, "Invalid srf null index block.\nExiting.\n");
+		exit(1);
+            }
+
+            break;
+        }
+        
+        default:
+            srf_destroy(srf, 1);
+	    fprintf(stderr, "Block of unknown type '%c'\nExiting.\n", type);
+	    exit(1);
+	}
+
+    }
+
+    if( trace_body_count ){
+        if( level_mode & LEVEL_NAME )
+            printf( " ... %s x%ld\n", name+strlen(srf->th.id_prefix), trace_body_count);
+        trace_body_count = 0;
+    }
+
+    /* the type should be -1 (EOF) */
+    if( type != -1 ) {
+        fprintf(stderr, "Block of unknown type '%c'\nExiting.\n", type);
+	exit(1);
+    }
+
+    /* are we really at the end of the srf file */
+    pos = ftell(srf->fp);
+    fseek(srf->fp, 0, SEEK_END);
+    if( pos != ftell(srf->fp) ){
+        fprintf(stderr, "srf file is corrupt\n");
+	exit(1);
+    }
+    
+    srf_destroy(srf, 1);
+    return 0;
+}
+
+/* ------------------------------------------------------------------------ */
+
+/*
+ * Main method.
+ */
+int main(int argc, char **argv) {
+    int ifile, nfiles;
+    char *input = NULL;
+
+    int c;
+    int errflg = 0;
+    extern char *optarg;
+    extern int optind, optopt;
+
+    int level_mode = LEVEL_ALL;
+
+    long read_count[NREADS];
+    char *read_str[] = {READ_GOOD_STR, READ_BAD_STR, READ_TOTAL_STR};
+    long chunk_count[NCHUNKS];
+    uint64_t chunk_size[NCHUNKS];
+    uint4 chunk_type[] = {CHUNK_BASE_TYPE, CHUNK_CNF1_TYPE, CHUNK_CNF4_TYPE, CHUNK_SAMP_TYPE, CHUNK_SMP4_TYPE, CHUNK_REGN_TYPE};
+    long key_count[NCHUNKS][NKEYS];
+    char *keys_str[] = {KEY_TYPE_STR, KEY_VALTYPE_STR, KEY_GROUP_STR, KEY_OFFS_STR, KEY_SCALE_STR, KEY_COORD_STR, KEY_NAME_STR};
+    long type_count[NCHUNKS][NTYPES];
+    char *types_str[] = {TYPE_PROC_STR, TYPE_SLXI_STR, TYPE_SLXN_STR, TYPE_0FAM_STR, TYPE_1CY3_STR, TYPE_2TXR_STR, TYPE_3CY5_STR};
+    int iread, ichunk, ikey, itype;
+
+    while ((c = getopt(argc, argv, "l:")) != -1) {
+        switch (c) {
+        case 'l':
+            if (1 != sscanf(optarg, "%d", &level_mode)) {
+                fprintf(stderr,
+                        "Otion -%c requires an operand\n", optopt);
+                errflg++;
+            }
+	    break;
+        case ':':       /* -? without operand */
+            fprintf(stderr,
+                    "Option -%c requires an operand\n", optopt);
+            errflg++;
+            break;
+        case '?':
+            fprintf(stderr,
+                    "Unrecognised option: -%c\n", optopt);
+            errflg++;
+        }
+    }
+
+    if (errflg) {
+	usage(1);
+    }
+
+    nfiles = (argc-optind);
+    if( nfiles < 1 ){
+        fprintf(stderr, "Please specify input archive name(s).\n");
+        usage(1);
+    }
+    
+    for (ifile=0; ifile<nfiles; ifile++) {
+        HashTable *regn_hash;
+        char bases[] = "ACGTN";
+        uint64_t base_count[5];
+        char type[5];
+
+        input = argv[optind+ifile];
+        printf("Reading archive %s.\n", input);
+
+        for (iread=0; iread<NREADS; iread++)
+	    read_count[iread] = 0;
+
+        for (ichunk=0; ichunk<NCHUNKS; ichunk++) {
+	    chunk_count[ichunk] = 0;
+	    chunk_size[ichunk] = 0;
+	}
+
+        for (ichunk=0; ichunk<NCHUNKS; ichunk++)
+            for (ikey=0; ikey<NKEYS; ikey++)
+                key_count[ichunk][ikey] = 0;
+
+        for (ichunk=0; ichunk<NCHUNKS; ichunk++)
+            for (itype=0; itype<NTYPES; itype++)
+                type_count[ichunk][itype] = 0;
+
+        if (NULL == (regn_hash = HashTableCreate(0, HASH_DYNAMIC_SIZE|HASH_FUNC_JENKINS3))) {
+	    return 1;
+        }
+    
+        memset(base_count, 0, 5 * sizeof(uint64_t));
+
+        if( 0 == srf_info(input, level_mode, read_count,
+			  chunk_count, chunk_size,
+			  key_count, type_count, regn_hash, base_count) ){
+
+            /* read counts */
+            if( level_mode & LEVEL_READ ) {
+                for (iread=0; iread<NREADS; iread++) {
+                    if( read_count[iread] )
+			printf("Reads: %s : %ld\n", read_str[iread], read_count[iread]);
+                }
+            }
+
+            /* chunk, key and type counts */
+            if( level_mode & LEVEL_CHUNK ) {
+                for (ichunk=0; ichunk<NCHUNKS; ichunk++) {
+                    if( chunk_count[ichunk] ) {
+                        printf("Chunk: %s : %ld %"PRId64"\n",
+			       ZTR_BE2STR(chunk_type[ichunk], type),
+			       chunk_count[ichunk], chunk_size[ichunk]);
+                        for (ikey=0; ikey<NKEYS; ikey++) {
+                            if(key_count[ichunk][ikey]) {
+                                printf("  Mdata key: %s : %ld\n", keys_str[ikey], key_count[ichunk][ikey]);
+                                if (ikey == KEY_TYPE && (ichunk == CHUNK_SAMP || ichunk == CHUNK_SMP4)) {
+                                    for (itype=0; itype<NTYPES; itype++)
+                                        if(type_count[ichunk][itype])
+                                            printf("    types: %s : %ld\n", types_str[itype], type_count[ichunk][itype]);
+                                }
+                                if (ikey == KEY_NAME && (ichunk == CHUNK_REGN)) {
+                                    int ibucket;
+                                    for (ibucket=0; ibucket<regn_hash->nbuckets; ibucket++) {
+                                        HashItem *hi;
+                                        for (hi = regn_hash->bucket[ibucket]; hi; hi = hi->next) {
+                                            regn_t *regn = (regn_t *)hi->data.p;
+                                            printf("    %s x%d\n", hi->key, regn->count);
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+
+            /* base counts */
+            if( level_mode & LEVEL_BASE ) {
+                uint64_t total = 0;
+                int i;
+                for (i=0; i<5; i++) {
+                    if( base_count[i] ){
+                        printf("Bases: %c: %"PRId64"\n",
+			       bases[i], base_count[i]);
+                        total += base_count[i];
+                    }
+                }
+                printf("Bases: TOTAL: %"PRId64"\n", total);
+            }
+        }
+    }
+
+    return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/progs/srf_list.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,166 @@
+#ifdef HAVE_CONFIG_H
+#include "io_lib_config.h"
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <unistd.h>
+#include <inttypes.h>
+
+#include <io_lib/os.h>
+#include <io_lib/hash_table.h>
+#include <io_lib/srf.h>
+
+/* Command line options */
+typedef struct {
+    int long_format;
+    int count_only;
+    int verbose;
+} opts;
+
+/*
+ * Lists the contents of an SRF file.
+ *
+ * Returns num_reads for success
+ *        -1 for failure
+ */
+int64_t list_file(char *fname, opts *opts) {
+    srf_t *srf;
+    char name[512];
+    int64_t count = 0;
+    int type;
+    uint64_t pos;
+
+    if (NULL == (srf = srf_open(fname, "r"))) {
+	perror(fname);
+	return -1;
+    }
+
+    /* Scan through file gathering the details to index in memory */
+    while ((type = srf_next_block_details(srf, &pos, name)) >= 0) {
+	if (type == SRFB_TRACE_BODY) {
+	    count++;
+	    if (!opts->count_only) {
+		if (opts->long_format)
+		    printf("%-30s %10"PRId64" + %4d + %5d\n",
+			   name, pos,
+			   srf->tb.trace_size,
+			   srf->th.trace_hdr_size);
+		else
+		    puts(name);
+	    }
+	}
+    }
+
+    srf_destroy(srf, 1);
+
+    return count;
+}
+
+/*
+ * Counts the contents of an SRF file.
+ * If the hash index exists it uses this instead.
+ *
+ * Returns num_reads for success
+ *        -1 for failure
+ */
+int64_t count_file(char *fname, opts *opts) {
+    srf_t *srf;
+    srf_index_hdr_t hdr;
+    int64_t count = 0;
+    off_t ipos, skip;
+    int item_sz = 9, i;
+    unsigned char data[16];
+
+    if (NULL == (srf = srf_open(fname, "r"))) {
+	perror(fname);
+	return -1;
+    }
+
+    /* Read the index header */
+    if (0 != srf_read_index_hdr(srf, &hdr, 0)) {
+	srf_destroy(srf, 1);
+	return list_file(fname, opts);
+    }
+    ipos = ftello(srf->fp);
+
+    /* Compute the remaining size of the index and divide by item_sz */
+    if (hdr.dbh_pos_stored_sep)
+	item_sz += 4;
+    skip = hdr.index_hdr_sz 
+	 + hdr.n_container * 8
+	 + hdr.n_data_block_hdr * 8
+	 + hdr.n_buckets * 8;
+
+    srf_destroy(srf, 1);
+
+    return (hdr.size - skip - 16/* footer*/) / item_sz;
+}
+
+void usage(int error) {
+    printf("Usage: srf_list [options] srf_file ...\n");
+    printf("Options:  -c\tCount only - do not list filenames\n");
+    printf("          -v\tVerbose - gives summary data per file too\n");
+    printf("          -l\tList in long format. Lines contain:\n");
+    printf("            \t    name position body-size header-size\n");
+
+    exit(error);
+}
+
+/*
+ * Lists the contents of a .hash file
+ */
+int main(int argc, char **argv) {
+    opts opts;
+    int i, c;
+    int64_t count = 0;
+
+    opts.long_format = 0;
+    opts.count_only = 0;
+    opts.verbose = 0;
+
+    while ((c = getopt(argc, argv, "lcvh")) != -1) {
+	switch (c) {
+	case 'l':
+	    opts.long_format = 1;
+	    break;
+
+	case 'c':
+	    opts.count_only = 1;
+	    break;
+
+	case 'v':
+	    opts.verbose = 1;
+	    break;
+
+	case 'h':
+	    usage(0);
+
+	default:
+	    usage(1);
+	}
+    }
+
+    for (i = optind; i < argc; i++) {
+	int64_t c;
+
+	if (opts.count_only)
+	    c = count_file(argv[i], &opts);
+	else
+	    c = list_file(argv[i], &opts);
+
+	if (c < 0)
+	    return 1;
+
+	if (opts.verbose)
+	    printf("%s: %d sequences\n", argv[i], c);
+	count += c;
+    }
+    
+    if (opts.count_only)
+	printf("%"PRId64"\n", count);
+
+    return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/progs/trace_dump.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) Medical Research Council 2002. All rights reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * this copyright and notice appears in all copies.
+ *
+ * This file was written by James Bonfield, Simon Dear, Rodger Staden,
+ * Mark Jordan as part of the Staden Package at the MRC Laboratory of
+ * Molecular Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
+ *
+ * MRC disclaims all warranties with regard to this software.
+ */
+
+#include <stdio.h>
+#include <io_lib/Read.h>
+
+int main(int argc, char **argv)
+{
+    Read* read;
+    int i;
+
+    if (argc != 2) {
+    fprintf(stderr, "Usage: trace_dump <trace file>\n");
+    return 1;
+    }
+
+
+    read = read_reading( argv[1], TT_ANY );
+
+
+    if (read == NULL) {
+    fprintf(stderr, "Tracedump was unable to open file %s\n", argv[1] );
+    return 1;
+    }
+
+    printf("[Trace]\n");
+    printf("%s\n", read->trace_name );
+
+    printf("\n[Header]\n");
+    printf("%d\t\t# format\n",          read->format);
+    printf("%d\t\t# NPoints\n",         read->NPoints);
+    printf("%d\t\t# NBases\n",          read->NBases);
+    printf("%d\t\t# NFlows\n",          read->nflows);
+    printf("%d\t\t# maxTraceVal\n",     (int)read->maxTraceVal-read->baseline);
+    printf("%d\t\t# baseline\n",        read->baseline);
+    printf("%d\t\t# leftCutoff\n",      read->leftCutoff);
+    printf("%d\t\t# rightCutoff\n",     read->rightCutoff);
+
+    puts("\n[Bases]");
+    for (i = 0; i < read->NBases; i++) {
+    printf("%c %05d %+03d %+03d %+03d %+03d #%3d\n",
+           read->base[i],
+           read->basePos ? read->basePos[i] : 0,
+           (int)read->prob_A[i],
+           (int)read->prob_C[i],
+           (int)read->prob_G[i],
+           (int)read->prob_T[i],
+           i);
+    }
+
+    if (read->NPoints) {
+	puts("\n[A_Trace]");
+	for(i = 0; i < read->NPoints; i++)
+	    printf("%d\t#%5d\n", (int)read->traceA[i] - read->baseline, i);
+
+	puts("\n[C_Trace]");
+	for(i = 0; i < read->NPoints; i++)
+	    printf("%d\t#%5d\n", (int)read->traceC[i] - read->baseline, i);
+
+	puts("\n[G_Trace]");
+	for(i = 0; i < read->NPoints; i++)
+	    printf("%d\t#%5d\n", (int)read->traceG[i] - read->baseline, i);
+
+	puts("\n[T_Trace]");
+	for(i = 0; i < read->NPoints; i++)
+	    printf("%d\t#%5d\n", (int)read->traceT[i] - read->baseline, i);
+    }
+
+    if (read->flow_order) {
+	puts("\n[Flows]");
+	for (i = 0; i < read->nflows; i++) {
+	    printf("%c %5.2f  %u\t#%5d\n",
+		   read->flow_order[i],
+		   read->flow ? read->flow[i] : 0,
+		   read->flow_raw ? read->flow_raw[i] : 0,
+		   i);
+	}
+    }
+
+    if (read->info) {
+	puts("\n[Info]");
+	printf("%s\n", read->info);
+    }
+
+    read_deallocate(read);
+
+    return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/progs/ztr_dump.c	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,217 @@
+#include <stdio.h>
+#include <errno.h>
+#include <math.h>
+#include <io_lib/ztr.h>
+#include <io_lib/compression.h>
+#include <io_lib/xalloc.h>
+
+static char *format2str(int format) {
+    static char unk[100];
+
+    switch (format) {
+    case ZTR_FORM_RAW:     return "raw";
+    case ZTR_FORM_RLE:     return "rle";
+    case ZTR_FORM_XRLE:    return "xrle";
+    case ZTR_FORM_XRLE2:   return "xrle2";
+    case ZTR_FORM_ZLIB:    return "zlib";
+    case ZTR_FORM_DELTA1:  return "delta1";
+    case ZTR_FORM_DELTA2:  return "delta2";
+    case ZTR_FORM_DELTA4:  return "delta4";
+    case ZTR_FORM_DDELTA1: return "ddelta1";
+    case ZTR_FORM_DDELTA2: return "ddelta2";
+    case ZTR_FORM_DDELTA4: return "ddelta4";
+    case ZTR_FORM_16TO8:   return "16to8";
+    case ZTR_FORM_32TO8:   return "32to8";
+    case ZTR_FORM_FOLLOW1: return "follow1";
+    case ZTR_FORM_CHEB445: return "cheb445";
+    case ZTR_FORM_ICHEB:   return "icheb";
+    case ZTR_FORM_LOG2:    return "log2";
+    case ZTR_FORM_STHUFF:  return "sthuff";
+    case ZTR_FORM_QSHIFT:  return "qshift";
+    case ZTR_FORM_TSHIFT:  return "tshift";
+    }
+
+    sprintf(unk, "?%d?\n", format);
+    return unk;
+}
+
+/*
+ * Shannon showed that for storage in base 'b' with alphabet symbols 'a' having
+ * a probability of ocurring in any context of 'Pa' we should encode
+ * symbol 'a' to have a storage width of -logb(Pa).
+ *
+ * Eg. b = 26, P(e) = .22. => width .4647277.
+ *
+ * We use this to calculate the entropy of a signal by summing over all letters
+ * in the signal. In this case, our storage has base 256.
+ */
+#define EBASE 256
+double entropy(unsigned char *data, int len) {
+    double E[EBASE];
+    double P[EBASE];
+    double e;
+    int i;
+    
+    for (i = 0; i < EBASE; i++)
+        P[i] = 0;
+
+    for (i = 0; i < len; i++)
+        P[data[i]]++;
+
+    for (i = 0; i < EBASE; i++) {
+        if (P[i]) {
+            P[i] /= len;
+            E[i] = -(log(P[i])/log(EBASE));
+        } else {
+            E[i] = 0;
+        }
+    }
+
+    for (e = i = 0; i < len; i++)
+        e += E[data[i]];
+
+    return e;
+}
+
+/* Debug version of the ztr.c uncompress_chunk function. */
+static int explode_chunk(ztr_t *ztr, ztr_chunk_t *chunk) {
+    char *new_data = NULL;
+    int new_len;
+
+    while (chunk->dlength > 0 && chunk->data[0] != ZTR_FORM_RAW) {
+	double ent = entropy((unsigned char *)chunk->data, chunk->dlength);
+
+	switch (chunk->data[0]) {
+	case ZTR_FORM_RLE:
+	    new_data = unrle(chunk->data, chunk->dlength, &new_len);
+	    break;
+
+	case ZTR_FORM_XRLE:
+	    new_data = unxrle(chunk->data, chunk->dlength, &new_len);
+	    break;
+
+	case ZTR_FORM_XRLE2:
+	    new_data = unxrle2(chunk->data, chunk->dlength, &new_len);
+	    break;
+
+	case ZTR_FORM_ZLIB:
+	    new_data = zlib_dehuff(chunk->data, chunk->dlength, &new_len);
+	    break;
+
+	case ZTR_FORM_DELTA1:
+	    new_data = recorrelate1(chunk->data, chunk->dlength, &new_len);
+	    break;
+
+	case ZTR_FORM_DELTA2:
+	    new_data = recorrelate2(chunk->data, chunk->dlength, &new_len);
+	    break;
+
+	case ZTR_FORM_DELTA4:
+	    new_data = recorrelate4(chunk->data, chunk->dlength, &new_len);
+	    break;
+
+	case ZTR_FORM_16TO8:
+	    new_data = expand_8to16(chunk->data, chunk->dlength, &new_len);
+	    break;
+
+	case ZTR_FORM_32TO8:
+	    new_data = expand_8to32(chunk->data, chunk->dlength, &new_len);
+	    break;
+
+	case ZTR_FORM_FOLLOW1:
+	    new_data = unfollow1(chunk->data, chunk->dlength, &new_len);
+	    break;
+
+	case ZTR_FORM_ICHEB:
+	    new_data = ichebuncomp(chunk->data, chunk->dlength, &new_len);
+	    break;
+
+	case ZTR_FORM_LOG2:
+	    new_data = unlog2_data(chunk->data, chunk->dlength, &new_len);
+	    break;
+
+	case ZTR_FORM_STHUFF:
+	    new_data = unsthuff(ztr, chunk->data, chunk->dlength, &new_len);
+	    break;
+	    
+	case ZTR_FORM_QSHIFT:
+	    new_data = unqshift(chunk->data, chunk->dlength, &new_len);
+	    break;
+
+	case ZTR_FORM_TSHIFT:
+	    new_data = untshift(ztr, chunk->data, chunk->dlength, &new_len);
+	    break;
+
+	default:
+	    fprintf(stderr, "Unknown encoding format %d\n", chunk->data[0]);
+	    return -1;
+	}
+	    
+	if (!new_data) {
+	    fprintf(stderr, "Failed to decode chunk with format %s\n",
+		    format2str(chunk->data[0]));
+	    return -1;
+	}
+
+	printf("    format %8s => %6d to %6d, entropy %8.1f to %8.1f\n",
+	       format2str(chunk->data[0]), chunk->dlength, new_len,
+	       ent, entropy((unsigned char *)new_data, new_len));
+
+	chunk->dlength = new_len;
+	xfree(chunk->data);
+	chunk->data = new_data;
+    }
+
+    return 0;
+}
+
+int main(int argc, char **argv) {
+    ztr_t *ztr;
+    mFILE *fp;
+    int i;
+
+    if (argc >= 2) {
+	if (NULL == (fp = mfopen(argv[1], "rb"))) {
+	    perror(argv[1]);
+	    return 1;
+	}
+    } else {
+	fp = mstdin();
+    }
+
+    if (NULL == (ztr = mfread_ztr(fp))) {
+	perror("fread_ztr");
+	return 1;
+    }
+
+    printf("Nchunks = %d\n", ztr->nchunks);
+    for (i = 0; i < ztr->nchunks; i++) {
+	char str[5];
+	int complen;
+	int rawlen;
+	char *val;
+
+	(void)ZTR_BE2STR(ztr->chunk[i].type, str);
+	complen = ztr->chunk[i].dlength;
+	val = ztr_lookup_mdata_value(ztr, &ztr->chunk[i], "TYPE");
+	if (val)
+	    printf("-- %s (%s) --\n", str, val);
+	else
+	    printf("-- %s --\n", str);
+	explode_chunk(ztr, &ztr->chunk[i]);
+	rawlen = ztr->chunk[i].dlength;
+	printf("SUMMARY %s  mlen %3d, dlen %6d, rawlen %6d, ratio %f\n",
+	       str, ztr->chunk[i].mdlength,
+	       complen, rawlen, (double)complen/rawlen);
+#if 0
+	fflush(stdout);
+	puts("\n========================================");
+	write(1, ztr->chunk[i].data, ztr->chunk[i].dlength);
+	puts("\n========================================");
+#endif
+    }
+
+    delete_ztr(ztr);
+    
+    return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/tests/Makefile.am	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,24 @@
+## Makefile.am -- Process this file with automake to produce Makefile.in
+
+EXTRA_DIST              = $(TESTS) data
+MAINTAINERCLEANFILES    = Makefile.in
+
+test_outdir              = test.out
+
+TESTS_ENVIRONMENT       = \
+			top_builddir=$(top_builddir) \
+			outdir=$(test_outdir)
+
+TESTS                   = \
+                        srf2fasta.test \
+                        srf2fastq.test \
+			srf_info.test \
+			srf_filter.test \
+			srf_index.test
+
+dist-hook:
+	rm -rf `find $(distdir)/data -name .svn`
+
+distclean-local:
+	-rm -rf $(test_outdir)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/tests/Makefile.in	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,426 @@
+# 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@
+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@
+subdir = tests
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/io_lib_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@
+GREP = @GREP@
+HAVE_ZLIB_FALSE = @HAVE_ZLIB_FALSE@
+HAVE_ZLIB_TRUE = @HAVE_ZLIB_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBCURL = @LIBCURL@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBZ = @LIBZ@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+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@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+VERS_AGE = @VERS_AGE@
+VERS_CURRENT = @VERS_CURRENT@
+VERS_REVISION = @VERS_REVISION@
+_libcurl_config = @_libcurl_config@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+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@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+EXTRA_DIST = $(TESTS) data
+MAINTAINERCLEANFILES = Makefile.in
+test_outdir = test.out
+TESTS_ENVIRONMENT = \
+			top_builddir=$(top_builddir) \
+			outdir=$(test_outdir)
+
+TESTS = \
+                        srf2fasta.test \
+                        srf2fastq.test \
+			srf_info.test \
+			srf_filter.test \
+			srf_index.test
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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  tests/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  tests/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(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:
+
+
+check-TESTS: $(TESTS)
+	@failed=0; all=0; xfail=0; xpass=0; skip=0; \
+	srcdir=$(srcdir); export srcdir; \
+	list='$(TESTS)'; \
+	if test -n "$$list"; then \
+	  for tst in $$list; do \
+	    if test -f ./$$tst; then dir=./; \
+	    elif test -f $$tst; then dir=; \
+	    else dir="$(srcdir)/"; fi; \
+	    if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+	      all=`expr $$all + 1`; \
+	      case " $(XFAIL_TESTS) " in \
+	      *" $$tst "*) \
+		xpass=`expr $$xpass + 1`; \
+		failed=`expr $$failed + 1`; \
+		echo "XPASS: $$tst"; \
+	      ;; \
+	      *) \
+		echo "PASS: $$tst"; \
+	      ;; \
+	      esac; \
+	    elif test $$? -ne 77; then \
+	      all=`expr $$all + 1`; \
+	      case " $(XFAIL_TESTS) " in \
+	      *" $$tst "*) \
+		xfail=`expr $$xfail + 1`; \
+		echo "XFAIL: $$tst"; \
+	      ;; \
+	      *) \
+		failed=`expr $$failed + 1`; \
+		echo "FAIL: $$tst"; \
+	      ;; \
+	      esac; \
+	    else \
+	      skip=`expr $$skip + 1`; \
+	      echo "SKIP: $$tst"; \
+	    fi; \
+	  done; \
+	  if test "$$failed" -eq 0; then \
+	    if test "$$xfail" -eq 0; then \
+	      banner="All $$all tests passed"; \
+	    else \
+	      banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
+	    fi; \
+	  else \
+	    if test "$$xpass" -eq 0; then \
+	      banner="$$failed of $$all tests failed"; \
+	    else \
+	      banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
+	    fi; \
+	  fi; \
+	  dashes="$$banner"; \
+	  skipped=""; \
+	  if test "$$skip" -ne 0; then \
+	    skipped="($$skip tests were not run)"; \
+	    test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+	      dashes="$$skipped"; \
+	  fi; \
+	  report=""; \
+	  if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+	    report="Please report to $(PACKAGE_BUGREPORT)"; \
+	    test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+	      dashes="$$report"; \
+	  fi; \
+	  dashes=`echo "$$dashes" | sed s/./=/g`; \
+	  echo "$$dashes"; \
+	  echo "$$banner"; \
+	  test -z "$$skipped" || echo "$$skipped"; \
+	  test -z "$$report" || echo "$$report"; \
+	  echo "$$dashes"; \
+	  test "$$failed" -eq 0; \
+	else :; fi
+
+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
+	$(MAKE) $(AM_MAKEFLAGS) \
+	  top_distdir="$(top_distdir)" distdir="$(distdir)" \
+	  dist-hook
+check-am: all-am
+	$(MAKE) $(AM_MAKEFLAGS) check-TESTS
+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."
+	-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-local
+
+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-TESTS check-am clean clean-generic \
+	clean-libtool dist-hook distclean distclean-generic \
+	distclean-libtool distclean-local 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
+
+
+dist-hook:
+	rm -rf `find $(distdir)/data -name .svn`
+
+distclean-local:
+	-rm -rf $(test_outdir)
+# 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:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/tests/data/both.info	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,20 @@
+Reading archive both.srf.
+trace_name: test_run:4:133: + 593:417 ... 539:484 x10
+trace_name: test_run:4:134: + 548:359 ... 529:256 x10
+Reading srf null index block
+Reads: GOOD : 18
+Reads: BAD : 2
+Reads: TOTAL : 20
+Chunk: BASE : 20 475
+Chunk: CNF4 : 20 842
+  Mdata key: SCALE : 20
+Chunk: SMP4 : 60 27126
+  Mdata key: TYPE : 40
+    types: SLXI : 20
+    types: SLXN : 20
+  Mdata key: OFFS : 60
+Bases: A: 411
+Bases: C: 296
+Bases: G: 367
+Bases: T: 406
+Bases: TOTAL: 1480
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/tests/data/both.run/4_ILLUMINA_GA_BUSTARD_PARAMS.txt	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,196 @@
+<?xml version="1.0"?>
+<BaseCallAnalysis>
+  <Run Name="Bustard1.9.5_28-08-2008_auto">
+    <BaseCallParameters>
+      <Matrix Path="">
+        <AutoFlag>1</AutoFlag>
+        <AutoLane>4</AutoLane>
+        <Cycle>2</Cycle>
+        <CycleOffset>1</CycleOffset>
+        <FirstCycle>1</FirstCycle>
+        <LastCycle>37</LastCycle>
+        <Read>1</Read>
+      </Matrix>
+      <Matrix Path="">
+        <AutoFlag>1</AutoFlag>
+        <AutoLane>4</AutoLane>
+        <Cycle>39</Cycle>
+        <CycleOffset>1</CycleOffset>
+        <FirstCycle>38</FirstCycle>
+        <LastCycle>74</LastCycle>
+        <Read>2</Read>
+      </Matrix>
+      <MatrixElements />
+      <Phasing Path="">
+        <AutoFlag>1</AutoFlag>
+        <AutoLane>4</AutoLane>
+        <Cycle>1</Cycle>
+        <CycleOffset>0</CycleOffset>
+        <FirstCycle>1</FirstCycle>
+        <LastCycle>37</LastCycle>
+        <Read>1</Read>
+      </Phasing>
+      <Phasing Path="">
+        <AutoFlag>1</AutoFlag>
+        <AutoLane>4</AutoLane>
+        <Cycle>38</Cycle>
+        <CycleOffset>0</CycleOffset>
+        <FirstCycle>38</FirstCycle>
+        <LastCycle>74</LastCycle>
+        <Read>2</Read>
+      </Phasing>
+      <PhasingRestarts />
+    </BaseCallParameters>
+    <Cycles First="1" Last="74" Number="74" />
+    <Input Path="C1-74_Firecrest1.9.5_28-08-2008_auto" />
+    <RunParameters>
+      <AutoCycleFlag>0</AutoCycleFlag>
+      <BasecallFlag>1</BasecallFlag>
+      <Compression>gzip</Compression>
+      <CompressionSuffix>.gz</CompressionSuffix>
+      <Deblocked>0</Deblocked>
+      <DebugFlag>0</DebugFlag>
+      <FirstRunOnlyFlag>0</FirstRunOnlyFlag>
+      <ImagingReads Index="1">
+        <FirstCycle>1</FirstCycle>
+        <LastCycle>37</LastCycle>
+        <RunFolder>/staging/IL9/analysis/080813_IL9_1213</RunFolder>
+      </ImagingReads>
+      <ImagingReads Index="2">
+        <FirstCycle>38</FirstCycle>
+        <LastCycle>74</LastCycle>
+        <RunFolder>/staging/IL9/analysis/080818_IL9_1232</RunFolder>
+      </ImagingReads>
+      <Instrument>HWI-EAS130</Instrument>
+      <MakeFlag>1</MakeFlag>
+      <MaxCycle>-1</MaxCycle>
+      <MinCycle>-1</MinCycle>
+      <Reads Index="1">
+        <FirstCycle>1</FirstCycle>
+        <LastCycle>37</LastCycle>
+        <RunFolder>/staging/IL9/analysis/080813_IL9_1213</RunFolder>
+      </Reads>
+      <Reads Index="2">
+        <FirstCycle>38</FirstCycle>
+        <LastCycle>74</LastCycle>
+        <RunFolder>/staging/IL9/analysis/080818_IL9_1232</RunFolder>
+      </Reads>
+      <RunFolder>/staging/IL9/analysis/080813_IL9_1213</RunFolder>
+      <SelectedCycles>1</SelectedCycles>
+      <SelectedCycles>2</SelectedCycles>
+      <SelectedCycles>3</SelectedCycles>
+      <SelectedCycles>4</SelectedCycles>
+      <SelectedCycles>5</SelectedCycles>
+      <SelectedCycles>6</SelectedCycles>
+      <SelectedCycles>7</SelectedCycles>
+      <SelectedCycles>8</SelectedCycles>
+      <SelectedCycles>9</SelectedCycles>
+      <SelectedCycles>10</SelectedCycles>
+      <SelectedCycles>11</SelectedCycles>
+      <SelectedCycles>12</SelectedCycles>
+      <SelectedCycles>13</SelectedCycles>
+      <SelectedCycles>14</SelectedCycles>
+      <SelectedCycles>15</SelectedCycles>
+      <SelectedCycles>16</SelectedCycles>
+      <SelectedCycles>17</SelectedCycles>
+      <SelectedCycles>18</SelectedCycles>
+      <SelectedCycles>19</SelectedCycles>
+      <SelectedCycles>20</SelectedCycles>
+      <SelectedCycles>21</SelectedCycles>
+      <SelectedCycles>22</SelectedCycles>
+      <SelectedCycles>23</SelectedCycles>
+      <SelectedCycles>24</SelectedCycles>
+      <SelectedCycles>25</SelectedCycles>
+      <SelectedCycles>26</SelectedCycles>
+      <SelectedCycles>27</SelectedCycles>
+      <SelectedCycles>28</SelectedCycles>
+      <SelectedCycles>29</SelectedCycles>
+      <SelectedCycles>30</SelectedCycles>
+      <SelectedCycles>31</SelectedCycles>
+      <SelectedCycles>32</SelectedCycles>
+      <SelectedCycles>33</SelectedCycles>
+      <SelectedCycles>34</SelectedCycles>
+      <SelectedCycles>35</SelectedCycles>
+      <SelectedCycles>36</SelectedCycles>
+      <SelectedCycles>37</SelectedCycles>
+      <SelectedCycles>38</SelectedCycles>
+      <SelectedCycles>39</SelectedCycles>
+      <SelectedCycles>40</SelectedCycles>
+      <SelectedCycles>41</SelectedCycles>
+      <SelectedCycles>42</SelectedCycles>
+      <SelectedCycles>43</SelectedCycles>
+      <SelectedCycles>44</SelectedCycles>
+      <SelectedCycles>45</SelectedCycles>
+      <SelectedCycles>46</SelectedCycles>
+      <SelectedCycles>47</SelectedCycles>
+      <SelectedCycles>48</SelectedCycles>
+      <SelectedCycles>49</SelectedCycles>
+      <SelectedCycles>50</SelectedCycles>
+      <SelectedCycles>51</SelectedCycles>
+      <SelectedCycles>52</SelectedCycles>
+      <SelectedCycles>53</SelectedCycles>
+      <SelectedCycles>54</SelectedCycles>
+      <SelectedCycles>55</SelectedCycles>
+      <SelectedCycles>56</SelectedCycles>
+      <SelectedCycles>57</SelectedCycles>
+      <SelectedCycles>58</SelectedCycles>
+      <SelectedCycles>59</SelectedCycles>
+      <SelectedCycles>60</SelectedCycles>
+      <SelectedCycles>61</SelectedCycles>
+      <SelectedCycles>62</SelectedCycles>
+      <SelectedCycles>63</SelectedCycles>
+      <SelectedCycles>64</SelectedCycles>
+      <SelectedCycles>65</SelectedCycles>
+      <SelectedCycles>66</SelectedCycles>
+      <SelectedCycles>67</SelectedCycles>
+      <SelectedCycles>68</SelectedCycles>
+      <SelectedCycles>69</SelectedCycles>
+      <SelectedCycles>70</SelectedCycles>
+      <SelectedCycles>71</SelectedCycles>
+      <SelectedCycles>72</SelectedCycles>
+      <SelectedCycles>73</SelectedCycles>
+      <SelectedCycles>74</SelectedCycles>
+      <SelectedFolders />
+      <SelectedTiles />
+    </RunParameters>
+    <Software Name="Bustard" Version="1.9.5" />
+    <TileSelection>
+      <Lane Index="1">
+        <Sample>s</Sample>
+        <TileRange Max="330" Min="1" />
+      </Lane>
+      <Lane Index="2">
+        <Sample>s</Sample>
+        <TileRange Max="330" Min="1" />
+      </Lane>
+      <Lane Index="3">
+        <Sample>s</Sample>
+        <TileRange Max="330" Min="1" />
+      </Lane>
+      <Lane Index="4">
+        <Sample>s</Sample>
+        <TileRange Max="330" Min="1" />
+      </Lane>
+      <Lane Index="5">
+        <Sample>s</Sample>
+        <TileRange Max="330" Min="1" />
+      </Lane>
+      <Lane Index="6">
+        <Sample>s</Sample>
+        <TileRange Max="330" Min="1" />
+      </Lane>
+      <Lane Index="7">
+        <Sample>s</Sample>
+        <TileRange Max="330" Min="1" />
+      </Lane>
+      <Lane Index="8">
+        <Sample>s</Sample>
+        <TileRange Max="330" Min="1" />
+      </Lane>
+    </TileSelection>
+    <Time>
+      <Start>28-08-08 10:36:31 BST</Start>
+    </Time>
+    <User Name="auto" />
+  </Run>
+</BaseCallAnalysis>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/tests/data/both.run/4_ILLUMINA_GA_CHASTITY.txt	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,1 @@
+0.600000
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/tests/data/both.run/4_ILLUMINA_GA_FIRECREST_PARAMS.txt	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,1043 @@
+<?xml version="1.0"?>
+<ImageAnalysis>
+  <Run Name="C2-37_Firecrest1.9.2_19-08-2008_single">
+    <Cycles First="2" Last="37" Number="36" />
+    <ImageParameters>
+      <AutoOffsetFlag>1</AutoOffsetFlag>
+      <AutoSizeFlag>0</AutoSizeFlag>
+      <DataOffsetFile>/staging/IL9/analysis/080813_IL9_1213/Data/default_offsets.txt</DataOffsetFile>
+      <Fwhm>2.700000</Fwhm>
+      <InstrumentOffsetFile>/staging/IL9/analysis/Instruments/HWI-EAS130/default_offsets.txt</InstrumentOffsetFile>
+      <OffsetFile>/staging/IL9/analysis/Instruments/HWI-EAS130/default_offsets.txt</OffsetFile>
+      <Offsets X="0.000000" Y="0.000000" />
+      <Offsets X="-1.840000" Y="0.950000" />
+      <Offsets X="-0.010000" Y="0.800000" />
+      <Offsets X="1.330000" Y="3.170000" />
+      <RemappingDistance>1.500000</RemappingDistance>
+      <SizeFile />
+      <Threshold>4.000000</Threshold>
+    </ImageParameters>
+    <RunParameters>
+      <AutoCycleFlag>1</AutoCycleFlag>
+      <BasecallFlag>1</BasecallFlag>
+      <Compression>gzip</Compression>
+      <CompressionSuffix>.gz</CompressionSuffix>
+      <Deblocked>0</Deblocked>
+      <DebugFlag>0</DebugFlag>
+      <ImagingReads Index="1">
+        <FirstCycle>1</FirstCycle>
+        <LastCycle>37</LastCycle>
+        <RunFolder>/staging/IL9/analysis/080813_IL9_1213</RunFolder>
+      </ImagingReads>
+      <Instrument>HWI-EAS130</Instrument>
+      <MakeFlag>1</MakeFlag>
+      <MaxCycle>-1</MaxCycle>
+      <MinCycle>-1</MinCycle>
+      <Reads Index="1">
+        <FirstCycle>1</FirstCycle>
+        <LastCycle>36</LastCycle>
+        <RunFolder>/staging/IL9/analysis/080813_IL9_1213</RunFolder>
+      </Reads>
+      <RunFolder>/staging/IL9/analysis/080813_IL9_1213</RunFolder>
+      <SelectedCycles>2</SelectedCycles>
+      <SelectedCycles>3</SelectedCycles>
+      <SelectedCycles>4</SelectedCycles>
+      <SelectedCycles>5</SelectedCycles>
+      <SelectedCycles>6</SelectedCycles>
+      <SelectedCycles>7</SelectedCycles>
+      <SelectedCycles>8</SelectedCycles>
+      <SelectedCycles>9</SelectedCycles>
+      <SelectedCycles>10</SelectedCycles>
+      <SelectedCycles>11</SelectedCycles>
+      <SelectedCycles>12</SelectedCycles>
+      <SelectedCycles>13</SelectedCycles>
+      <SelectedCycles>14</SelectedCycles>
+      <SelectedCycles>15</SelectedCycles>
+      <SelectedCycles>16</SelectedCycles>
+      <SelectedCycles>17</SelectedCycles>
+      <SelectedCycles>18</SelectedCycles>
+      <SelectedCycles>19</SelectedCycles>
+      <SelectedCycles>20</SelectedCycles>
+      <SelectedCycles>21</SelectedCycles>
+      <SelectedCycles>22</SelectedCycles>
+      <SelectedCycles>23</SelectedCycles>
+      <SelectedCycles>24</SelectedCycles>
+      <SelectedCycles>25</SelectedCycles>
+      <SelectedCycles>26</SelectedCycles>
+      <SelectedCycles>27</SelectedCycles>
+      <SelectedCycles>28</SelectedCycles>
+      <SelectedCycles>29</SelectedCycles>
+      <SelectedCycles>30</SelectedCycles>
+      <SelectedCycles>31</SelectedCycles>
+      <SelectedCycles>32</SelectedCycles>
+      <SelectedCycles>33</SelectedCycles>
+      <SelectedCycles>34</SelectedCycles>
+      <SelectedCycles>35</SelectedCycles>
+      <SelectedCycles>36</SelectedCycles>
+      <SelectedCycles>37</SelectedCycles>
+      <SelectedFolders />
+      <SelectedTiles>s_[12345678]_[0-9][0-9][02468]1</SelectedTiles>
+    </RunParameters>
+    <Software Name="Firecrest" Version="1.9.2" />
+    <TileSelection>
+      <Lane Index="1">
+        <Sample>s</Sample>
+        <Tile>1</Tile>
+        <Tile>21</Tile>
+        <Tile>41</Tile>
+        <Tile>61</Tile>
+        <Tile>81</Tile>
+        <Tile>101</Tile>
+        <Tile>121</Tile>
+        <Tile>141</Tile>
+        <Tile>161</Tile>
+        <Tile>181</Tile>
+        <Tile>201</Tile>
+        <Tile>221</Tile>
+        <Tile>241</Tile>
+        <Tile>261</Tile>
+        <Tile>281</Tile>
+        <Tile>301</Tile>
+        <Tile>321</Tile>
+      </Lane>
+      <Lane Index="2">
+        <Sample>s</Sample>
+        <Tile>1</Tile>
+        <Tile>21</Tile>
+        <Tile>41</Tile>
+        <Tile>61</Tile>
+        <Tile>81</Tile>
+        <Tile>101</Tile>
+        <Tile>121</Tile>
+        <Tile>141</Tile>
+        <Tile>161</Tile>
+        <Tile>181</Tile>
+        <Tile>201</Tile>
+        <Tile>221</Tile>
+        <Tile>241</Tile>
+        <Tile>261</Tile>
+        <Tile>281</Tile>
+        <Tile>301</Tile>
+        <Tile>321</Tile>
+      </Lane>
+      <Lane Index="3">
+        <Sample>s</Sample>
+        <Tile>1</Tile>
+        <Tile>21</Tile>
+        <Tile>41</Tile>
+        <Tile>61</Tile>
+        <Tile>81</Tile>
+        <Tile>101</Tile>
+        <Tile>121</Tile>
+        <Tile>141</Tile>
+        <Tile>161</Tile>
+        <Tile>181</Tile>
+        <Tile>201</Tile>
+        <Tile>221</Tile>
+        <Tile>241</Tile>
+        <Tile>261</Tile>
+        <Tile>281</Tile>
+        <Tile>301</Tile>
+        <Tile>321</Tile>
+      </Lane>
+      <Lane Index="4">
+        <Sample>s</Sample>
+        <Tile>1</Tile>
+        <Tile>21</Tile>
+        <Tile>41</Tile>
+        <Tile>61</Tile>
+        <Tile>81</Tile>
+        <Tile>101</Tile>
+        <Tile>121</Tile>
+        <Tile>141</Tile>
+        <Tile>161</Tile>
+        <Tile>181</Tile>
+        <Tile>201</Tile>
+        <Tile>221</Tile>
+        <Tile>241</Tile>
+        <Tile>261</Tile>
+        <Tile>281</Tile>
+        <Tile>301</Tile>
+        <Tile>321</Tile>
+      </Lane>
+      <Lane Index="5">
+        <Sample>s</Sample>
+        <Tile>1</Tile>
+        <Tile>21</Tile>
+        <Tile>41</Tile>
+        <Tile>61</Tile>
+        <Tile>81</Tile>
+        <Tile>101</Tile>
+        <Tile>121</Tile>
+        <Tile>141</Tile>
+        <Tile>161</Tile>
+        <Tile>181</Tile>
+        <Tile>201</Tile>
+        <Tile>221</Tile>
+        <Tile>241</Tile>
+        <Tile>261</Tile>
+        <Tile>281</Tile>
+        <Tile>301</Tile>
+        <Tile>321</Tile>
+      </Lane>
+      <Lane Index="6">
+        <Sample>s</Sample>
+        <Tile>1</Tile>
+        <Tile>21</Tile>
+        <Tile>41</Tile>
+        <Tile>61</Tile>
+        <Tile>81</Tile>
+        <Tile>101</Tile>
+        <Tile>121</Tile>
+        <Tile>141</Tile>
+        <Tile>161</Tile>
+        <Tile>181</Tile>
+        <Tile>201</Tile>
+        <Tile>221</Tile>
+        <Tile>241</Tile>
+        <Tile>261</Tile>
+        <Tile>281</Tile>
+        <Tile>301</Tile>
+        <Tile>321</Tile>
+      </Lane>
+      <Lane Index="7">
+        <Sample>s</Sample>
+        <Tile>1</Tile>
+        <Tile>21</Tile>
+        <Tile>41</Tile>
+        <Tile>61</Tile>
+        <Tile>81</Tile>
+        <Tile>101</Tile>
+        <Tile>121</Tile>
+        <Tile>141</Tile>
+        <Tile>161</Tile>
+        <Tile>181</Tile>
+        <Tile>201</Tile>
+        <Tile>221</Tile>
+        <Tile>241</Tile>
+        <Tile>261</Tile>
+        <Tile>281</Tile>
+        <Tile>301</Tile>
+        <Tile>321</Tile>
+      </Lane>
+      <Lane Index="8">
+        <Sample>s</Sample>
+        <Tile>1</Tile>
+        <Tile>21</Tile>
+        <Tile>41</Tile>
+        <Tile>61</Tile>
+        <Tile>81</Tile>
+        <Tile>101</Tile>
+        <Tile>121</Tile>
+        <Tile>141</Tile>
+        <Tile>161</Tile>
+        <Tile>181</Tile>
+        <Tile>201</Tile>
+        <Tile>221</Tile>
+        <Tile>241</Tile>
+        <Tile>261</Tile>
+        <Tile>281</Tile>
+        <Tile>301</Tile>
+        <Tile>321</Tile>
+      </Lane>
+    </TileSelection>
+    <Time>
+      <Start>19-08-08 09:15:06 BST</Start>
+    </Time>
+    <UsedCycleFolders>C2.1,C3.1,C4.1,C5.1,C6.1,C7.1,C8.1,C9.1,C10.1,C11.1,C12.1,C13.1,C14.1,C15.1,C16.1,C17.1,C18.1,C19.1,C20.1,C21.1,C22.1,C23.1,C24.1,C25.1,C26.1,C27.1,C28.1,C29.1,C30.1,C31.1,C32.1,C33.1,C34.1,C35.1,C36.1,C37.1</UsedCycleFolders>
+    <User Name="single" />
+  </Run>
+  <Run Name="C2-37_Firecrest1.9.2_22-08-2008_single">
+    <Cycles First="2" Last="37" Number="36" />
+    <ImageParameters>
+      <AutoOffsetFlag>1</AutoOffsetFlag>
+      <AutoSizeFlag>0</AutoSizeFlag>
+      <DataOffsetFile>/staging/IL9/analysis/080813_IL9_1213/Data/default_offsets.txt</DataOffsetFile>
+      <Fwhm>2.700000</Fwhm>
+      <InstrumentOffsetFile />
+      <OffsetFile>/staging/IL9/analysis/080813_IL9_1213/Data/default_offsets.txt</OffsetFile>
+      <Offsets X="0.000000" Y="0.000000" />
+      <Offsets X="-1.830000" Y="0.950000" />
+      <Offsets X="-0.070000" Y="0.800000" />
+      <Offsets X="1.260000" Y="3.170000" />
+      <RemappingDistance>1.500000</RemappingDistance>
+      <SizeFile />
+      <Threshold>4.000000</Threshold>
+    </ImageParameters>
+    <RunParameters>
+      <AutoCycleFlag>1</AutoCycleFlag>
+      <BasecallFlag>1</BasecallFlag>
+      <Compression>gzip</Compression>
+      <CompressionSuffix>.gz</CompressionSuffix>
+      <Deblocked>0</Deblocked>
+      <DebugFlag>0</DebugFlag>
+      <ImagingReads Index="1">
+        <FirstCycle>1</FirstCycle>
+        <LastCycle>37</LastCycle>
+        <RunFolder>/staging/IL9/analysis/080813_IL9_1213</RunFolder>
+      </ImagingReads>
+      <Instrument>HWI-EAS130</Instrument>
+      <MakeFlag>1</MakeFlag>
+      <MaxCycle>-1</MaxCycle>
+      <MinCycle>-1</MinCycle>
+      <Reads Index="1">
+        <FirstCycle>1</FirstCycle>
+        <LastCycle>36</LastCycle>
+        <RunFolder>/staging/IL9/analysis/080813_IL9_1213</RunFolder>
+      </Reads>
+      <RunFolder>/staging/IL9/analysis/080813_IL9_1213</RunFolder>
+      <SelectedCycles>2</SelectedCycles>
+      <SelectedCycles>3</SelectedCycles>
+      <SelectedCycles>4</SelectedCycles>
+      <SelectedCycles>5</SelectedCycles>
+      <SelectedCycles>6</SelectedCycles>
+      <SelectedCycles>7</SelectedCycles>
+      <SelectedCycles>8</SelectedCycles>
+      <SelectedCycles>9</SelectedCycles>
+      <SelectedCycles>10</SelectedCycles>
+      <SelectedCycles>11</SelectedCycles>
+      <SelectedCycles>12</SelectedCycles>
+      <SelectedCycles>13</SelectedCycles>
+      <SelectedCycles>14</SelectedCycles>
+      <SelectedCycles>15</SelectedCycles>
+      <SelectedCycles>16</SelectedCycles>
+      <SelectedCycles>17</SelectedCycles>
+      <SelectedCycles>18</SelectedCycles>
+      <SelectedCycles>19</SelectedCycles>
+      <SelectedCycles>20</SelectedCycles>
+      <SelectedCycles>21</SelectedCycles>
+      <SelectedCycles>22</SelectedCycles>
+      <SelectedCycles>23</SelectedCycles>
+      <SelectedCycles>24</SelectedCycles>
+      <SelectedCycles>25</SelectedCycles>
+      <SelectedCycles>26</SelectedCycles>
+      <SelectedCycles>27</SelectedCycles>
+      <SelectedCycles>28</SelectedCycles>
+      <SelectedCycles>29</SelectedCycles>
+      <SelectedCycles>30</SelectedCycles>
+      <SelectedCycles>31</SelectedCycles>
+      <SelectedCycles>32</SelectedCycles>
+      <SelectedCycles>33</SelectedCycles>
+      <SelectedCycles>34</SelectedCycles>
+      <SelectedCycles>35</SelectedCycles>
+      <SelectedCycles>36</SelectedCycles>
+      <SelectedCycles>37</SelectedCycles>
+      <SelectedFolders />
+      <SelectedTiles>s_[12345678]_[0-9][0-9][02468]1</SelectedTiles>
+    </RunParameters>
+    <Software Name="Firecrest" Version="1.9.2" />
+    <TileSelection>
+      <Lane Index="1">
+        <Sample>s</Sample>
+        <Tile>1</Tile>
+        <Tile>21</Tile>
+        <Tile>41</Tile>
+        <Tile>61</Tile>
+        <Tile>81</Tile>
+        <Tile>101</Tile>
+        <Tile>121</Tile>
+        <Tile>141</Tile>
+        <Tile>161</Tile>
+        <Tile>181</Tile>
+        <Tile>201</Tile>
+        <Tile>221</Tile>
+        <Tile>241</Tile>
+        <Tile>261</Tile>
+        <Tile>281</Tile>
+        <Tile>301</Tile>
+        <Tile>321</Tile>
+      </Lane>
+      <Lane Index="2">
+        <Sample>s</Sample>
+        <Tile>1</Tile>
+        <Tile>21</Tile>
+        <Tile>41</Tile>
+        <Tile>61</Tile>
+        <Tile>81</Tile>
+        <Tile>101</Tile>
+        <Tile>121</Tile>
+        <Tile>141</Tile>
+        <Tile>161</Tile>
+        <Tile>181</Tile>
+        <Tile>201</Tile>
+        <Tile>221</Tile>
+        <Tile>241</Tile>
+        <Tile>261</Tile>
+        <Tile>281</Tile>
+        <Tile>301</Tile>
+        <Tile>321</Tile>
+      </Lane>
+      <Lane Index="3">
+        <Sample>s</Sample>
+        <Tile>1</Tile>
+        <Tile>21</Tile>
+        <Tile>41</Tile>
+        <Tile>61</Tile>
+        <Tile>81</Tile>
+        <Tile>101</Tile>
+        <Tile>121</Tile>
+        <Tile>141</Tile>
+        <Tile>161</Tile>
+        <Tile>181</Tile>
+        <Tile>201</Tile>
+        <Tile>221</Tile>
+        <Tile>241</Tile>
+        <Tile>261</Tile>
+        <Tile>281</Tile>
+        <Tile>301</Tile>
+        <Tile>321</Tile>
+      </Lane>
+      <Lane Index="4">
+        <Sample>s</Sample>
+        <Tile>1</Tile>
+        <Tile>21</Tile>
+        <Tile>41</Tile>
+        <Tile>61</Tile>
+        <Tile>81</Tile>
+        <Tile>101</Tile>
+        <Tile>121</Tile>
+        <Tile>141</Tile>
+        <Tile>161</Tile>
+        <Tile>181</Tile>
+        <Tile>201</Tile>
+        <Tile>221</Tile>
+        <Tile>241</Tile>
+        <Tile>261</Tile>
+        <Tile>281</Tile>
+        <Tile>301</Tile>
+        <Tile>321</Tile>
+      </Lane>
+      <Lane Index="5">
+        <Sample>s</Sample>
+        <Tile>1</Tile>
+        <Tile>21</Tile>
+        <Tile>41</Tile>
+        <Tile>61</Tile>
+        <Tile>81</Tile>
+        <Tile>101</Tile>
+        <Tile>121</Tile>
+        <Tile>141</Tile>
+        <Tile>161</Tile>
+        <Tile>181</Tile>
+        <Tile>201</Tile>
+        <Tile>221</Tile>
+        <Tile>241</Tile>
+        <Tile>261</Tile>
+        <Tile>281</Tile>
+        <Tile>301</Tile>
+        <Tile>321</Tile>
+      </Lane>
+      <Lane Index="6">
+        <Sample>s</Sample>
+        <Tile>1</Tile>
+        <Tile>21</Tile>
+        <Tile>41</Tile>
+        <Tile>61</Tile>
+        <Tile>81</Tile>
+        <Tile>101</Tile>
+        <Tile>121</Tile>
+        <Tile>141</Tile>
+        <Tile>161</Tile>
+        <Tile>181</Tile>
+        <Tile>201</Tile>
+        <Tile>221</Tile>
+        <Tile>241</Tile>
+        <Tile>261</Tile>
+        <Tile>281</Tile>
+        <Tile>301</Tile>
+        <Tile>321</Tile>
+      </Lane>
+      <Lane Index="7">
+        <Sample>s</Sample>
+        <Tile>1</Tile>
+        <Tile>21</Tile>
+        <Tile>41</Tile>
+        <Tile>61</Tile>
+        <Tile>81</Tile>
+        <Tile>101</Tile>
+        <Tile>121</Tile>
+        <Tile>141</Tile>
+        <Tile>161</Tile>
+        <Tile>181</Tile>
+        <Tile>201</Tile>
+        <Tile>221</Tile>
+        <Tile>241</Tile>
+        <Tile>261</Tile>
+        <Tile>281</Tile>
+        <Tile>301</Tile>
+        <Tile>321</Tile>
+      </Lane>
+      <Lane Index="8">
+        <Sample>s</Sample>
+        <Tile>1</Tile>
+        <Tile>21</Tile>
+        <Tile>41</Tile>
+        <Tile>61</Tile>
+        <Tile>81</Tile>
+        <Tile>101</Tile>
+        <Tile>121</Tile>
+        <Tile>141</Tile>
+        <Tile>161</Tile>
+        <Tile>181</Tile>
+        <Tile>201</Tile>
+        <Tile>221</Tile>
+        <Tile>241</Tile>
+        <Tile>261</Tile>
+        <Tile>281</Tile>
+        <Tile>301</Tile>
+        <Tile>321</Tile>
+      </Lane>
+    </TileSelection>
+    <Time>
+      <Start>22-08-08 11:11:01 BST</Start>
+    </Time>
+    <UsedCycleFolders>C2.1,C3.1,C4.1,C5.1,C6.1,C7.1,C8.1,C9.1,C10.1,C11.1,C12.1,C13.1,C14.1,C15.1,C16.1,C17.1,C18.1,C19.1,C20.1,C21.1,C22.1,C23.1,C24.1,C25.1,C26.1,C27.1,C28.1,C29.1,C30.1,C31.1,C32.1,C33.1,C34.1,C35.1,C36.1,C37.1</UsedCycleFolders>
+    <User Name="single" />
+  </Run>
+  <Run Name="C2-37,39-74_Firecrest1.9.2_22-08-2008_auto">
+    <Cycles First="2" Last="74" Number="72" />
+    <ImageParameters>
+      <AutoOffsetFlag>1</AutoOffsetFlag>
+      <AutoSizeFlag>0</AutoSizeFlag>
+      <DataOffsetFile>/staging/IL9/analysis/080813_IL9_1213/Data/default_offsets.txt</DataOffsetFile>
+      <Fwhm>2.700000</Fwhm>
+      <InstrumentOffsetFile />
+      <OffsetFile>/staging/IL9/analysis/080813_IL9_1213/Data/default_offsets.txt</OffsetFile>
+      <Offsets X="0.000000" Y="0.000000" />
+      <Offsets X="-1.830000" Y="0.950000" />
+      <Offsets X="-0.070000" Y="0.800000" />
+      <Offsets X="1.260000" Y="3.170000" />
+      <RemappingDistance>1.500000</RemappingDistance>
+      <SizeFile />
+      <Threshold>4.000000</Threshold>
+    </ImageParameters>
+    <RunParameters>
+      <AutoCycleFlag>1</AutoCycleFlag>
+      <BasecallFlag>1</BasecallFlag>
+      <Compression>gzip</Compression>
+      <CompressionSuffix>.gz</CompressionSuffix>
+      <Deblocked>0</Deblocked>
+      <DebugFlag>0</DebugFlag>
+      <ImagingReads Index="1">
+        <FirstCycle>1</FirstCycle>
+        <LastCycle>37</LastCycle>
+        <RunFolder>/staging/IL9/analysis/080813_IL9_1213</RunFolder>
+      </ImagingReads>
+      <ImagingReads Index="2">
+        <FirstCycle>38</FirstCycle>
+        <LastCycle>74</LastCycle>
+        <RunFolder>/staging/IL9/analysis/080818_IL9_1232</RunFolder>
+      </ImagingReads>
+      <Instrument>HWI-EAS130</Instrument>
+      <MakeFlag>1</MakeFlag>
+      <MaxCycle>-1</MaxCycle>
+      <MinCycle>-1</MinCycle>
+      <Reads Index="1">
+        <FirstCycle>1</FirstCycle>
+        <LastCycle>36</LastCycle>
+        <RunFolder>/staging/IL9/analysis/080813_IL9_1213</RunFolder>
+      </Reads>
+      <Reads Index="2">
+        <FirstCycle>37</FirstCycle>
+        <LastCycle>72</LastCycle>
+        <RunFolder>/staging/IL9/analysis/080818_IL9_1232</RunFolder>
+      </Reads>
+      <RunFolder>/staging/IL9/analysis/080813_IL9_1213</RunFolder>
+      <SelectedCycles>2</SelectedCycles>
+      <SelectedCycles>3</SelectedCycles>
+      <SelectedCycles>4</SelectedCycles>
+      <SelectedCycles>5</SelectedCycles>
+      <SelectedCycles>6</SelectedCycles>
+      <SelectedCycles>7</SelectedCycles>
+      <SelectedCycles>8</SelectedCycles>
+      <SelectedCycles>9</SelectedCycles>
+      <SelectedCycles>10</SelectedCycles>
+      <SelectedCycles>11</SelectedCycles>
+      <SelectedCycles>12</SelectedCycles>
+      <SelectedCycles>13</SelectedCycles>
+      <SelectedCycles>14</SelectedCycles>
+      <SelectedCycles>15</SelectedCycles>
+      <SelectedCycles>16</SelectedCycles>
+      <SelectedCycles>17</SelectedCycles>
+      <SelectedCycles>18</SelectedCycles>
+      <SelectedCycles>19</SelectedCycles>
+      <SelectedCycles>20</SelectedCycles>
+      <SelectedCycles>21</SelectedCycles>
+      <SelectedCycles>22</SelectedCycles>
+      <SelectedCycles>23</SelectedCycles>
+      <SelectedCycles>24</SelectedCycles>
+      <SelectedCycles>25</SelectedCycles>
+      <SelectedCycles>26</SelectedCycles>
+      <SelectedCycles>27</SelectedCycles>
+      <SelectedCycles>28</SelectedCycles>
+      <SelectedCycles>29</SelectedCycles>
+      <SelectedCycles>30</SelectedCycles>
+      <SelectedCycles>31</SelectedCycles>
+      <SelectedCycles>32</SelectedCycles>
+      <SelectedCycles>33</SelectedCycles>
+      <SelectedCycles>34</SelectedCycles>
+      <SelectedCycles>35</SelectedCycles>
+      <SelectedCycles>36</SelectedCycles>
+      <SelectedCycles>37</SelectedCycles>
+      <SelectedFolders />
+      <SelectedTiles />
+    </RunParameters>
+    <Software Name="Firecrest" Version="1.9.2" />
+    <TileSelection>
+      <Lane Index="1">
+        <Sample>s</Sample>
+        <TileRange Max="330" Min="1" />
+      </Lane>
+      <Lane Index="2">
+        <Sample>s</Sample>
+        <TileRange Max="330" Min="1" />
+      </Lane>
+      <Lane Index="3">
+        <Sample>s</Sample>
+        <TileRange Max="330" Min="1" />
+      </Lane>
+      <Lane Index="4">
+        <Sample>s</Sample>
+        <TileRange Max="330" Min="1" />
+      </Lane>
+      <Lane Index="5">
+        <Sample>s</Sample>
+        <TileRange Max="330" Min="1" />
+      </Lane>
+      <Lane Index="6">
+        <Sample>s</Sample>
+        <TileRange Max="330" Min="1" />
+      </Lane>
+      <Lane Index="7">
+        <Sample>s</Sample>
+        <TileRange Max="330" Min="1" />
+      </Lane>
+      <Lane Index="8">
+        <Sample>s</Sample>
+        <TileRange Max="330" Min="1" />
+      </Lane>
+    </TileSelection>
+    <Time>
+      <Start>22-08-08 12:20:16 BST</Start>
+    </Time>
+    <UsedCycleFolders>C2.1,C3.1,C4.1,C5.1,C6.1,C7.1,C8.1,C9.1,C10.1,C11.1,C12.1,C13.1,C14.1,C15.1,C16.1,C17.1,C18.1,C19.1,C20.1,C21.1,C22.1,C23.1,C24.1,C25.1,C26.1,C27.1,C28.1,C29.1,C30.1,C31.1,C32.1,C33.1,C34.1,C35.1,C36.1,C37.1</UsedCycleFolders>
+    <User Name="auto" />
+  </Run>
+  <Run Name="C1-37_Firecrest1.9.5_27-08-2008_single">
+    <Cycles First="1" Last="37" Number="37" />
+    <ImageParameters>
+      <AutoOffsetFlag>1</AutoOffsetFlag>
+      <AutoSizeFlag>0</AutoSizeFlag>
+      <DataOffsetFile>/staging/IL9/analysis/080813_IL9_1213/Data/default_offsets.txt</DataOffsetFile>
+      <Fwhm>2.700000</Fwhm>
+      <InstrumentOffsetFile />
+      <OffsetFile>/staging/IL9/analysis/080813_IL9_1213/Data/default_offsets.txt</OffsetFile>
+      <Offsets X="0.000000" Y="0.000000" />
+      <Offsets X="-1.820000" Y="0.950000" />
+      <Offsets X="-0.080000" Y="0.810000" />
+      <Offsets X="1.250000" Y="3.180000" />
+      <RemappingDistance>1.500000</RemappingDistance>
+      <SizeFile />
+      <Threshold>4.000000</Threshold>
+    </ImageParameters>
+    <RunParameters>
+      <AutoCycleFlag>0</AutoCycleFlag>
+      <BasecallFlag>1</BasecallFlag>
+      <Compression>gzip</Compression>
+      <CompressionSuffix>.gz</CompressionSuffix>
+      <Deblocked>0</Deblocked>
+      <DebugFlag>0</DebugFlag>
+      <FirstRunOnlyFlag>0</FirstRunOnlyFlag>
+      <ImagingReads Index="1">
+        <FirstCycle>1</FirstCycle>
+        <LastCycle>37</LastCycle>
+        <RunFolder>/staging/IL9/analysis/080813_IL9_1213</RunFolder>
+      </ImagingReads>
+      <Instrument>HWI-EAS130</Instrument>
+      <MakeFlag>1</MakeFlag>
+      <MaxCycle>-1</MaxCycle>
+      <MinCycle>-1</MinCycle>
+      <Reads Index="1">
+        <FirstCycle>1</FirstCycle>
+        <LastCycle>37</LastCycle>
+        <RunFolder>/staging/IL9/analysis/080813_IL9_1213</RunFolder>
+      </Reads>
+      <RunFolder>/staging/IL9/analysis/080813_IL9_1213</RunFolder>
+      <SelectedCycles>1</SelectedCycles>
+      <SelectedCycles>2</SelectedCycles>
+      <SelectedCycles>3</SelectedCycles>
+      <SelectedCycles>4</SelectedCycles>
+      <SelectedCycles>5</SelectedCycles>
+      <SelectedCycles>6</SelectedCycles>
+      <SelectedCycles>7</SelectedCycles>
+      <SelectedCycles>8</SelectedCycles>
+      <SelectedCycles>9</SelectedCycles>
+      <SelectedCycles>10</SelectedCycles>
+      <SelectedCycles>11</SelectedCycles>
+      <SelectedCycles>12</SelectedCycles>
+      <SelectedCycles>13</SelectedCycles>
+      <SelectedCycles>14</SelectedCycles>
+      <SelectedCycles>15</SelectedCycles>
+      <SelectedCycles>16</SelectedCycles>
+      <SelectedCycles>17</SelectedCycles>
+      <SelectedCycles>18</SelectedCycles>
+      <SelectedCycles>19</SelectedCycles>
+      <SelectedCycles>20</SelectedCycles>
+      <SelectedCycles>21</SelectedCycles>
+      <SelectedCycles>22</SelectedCycles>
+      <SelectedCycles>23</SelectedCycles>
+      <SelectedCycles>24</SelectedCycles>
+      <SelectedCycles>25</SelectedCycles>
+      <SelectedCycles>26</SelectedCycles>
+      <SelectedCycles>27</SelectedCycles>
+      <SelectedCycles>28</SelectedCycles>
+      <SelectedCycles>29</SelectedCycles>
+      <SelectedCycles>30</SelectedCycles>
+      <SelectedCycles>31</SelectedCycles>
+      <SelectedCycles>32</SelectedCycles>
+      <SelectedCycles>33</SelectedCycles>
+      <SelectedCycles>34</SelectedCycles>
+      <SelectedCycles>35</SelectedCycles>
+      <SelectedCycles>36</SelectedCycles>
+      <SelectedCycles>37</SelectedCycles>
+      <SelectedFolders />
+      <SelectedTiles>s_[12345678]_[0-9][0-9][02468]1</SelectedTiles>
+    </RunParameters>
+    <Software Name="Firecrest" Version="1.9.5" />
+    <TileSelection>
+      <Lane Index="1">
+        <Sample>s</Sample>
+        <Tile>1</Tile>
+        <Tile>21</Tile>
+        <Tile>41</Tile>
+        <Tile>61</Tile>
+        <Tile>81</Tile>
+        <Tile>101</Tile>
+        <Tile>121</Tile>
+        <Tile>141</Tile>
+        <Tile>161</Tile>
+        <Tile>181</Tile>
+        <Tile>201</Tile>
+        <Tile>221</Tile>
+        <Tile>241</Tile>
+        <Tile>261</Tile>
+        <Tile>281</Tile>
+        <Tile>301</Tile>
+        <Tile>321</Tile>
+      </Lane>
+      <Lane Index="2">
+        <Sample>s</Sample>
+        <Tile>1</Tile>
+        <Tile>21</Tile>
+        <Tile>41</Tile>
+        <Tile>61</Tile>
+        <Tile>81</Tile>
+        <Tile>101</Tile>
+        <Tile>121</Tile>
+        <Tile>141</Tile>
+        <Tile>161</Tile>
+        <Tile>181</Tile>
+        <Tile>201</Tile>
+        <Tile>221</Tile>
+        <Tile>241</Tile>
+        <Tile>261</Tile>
+        <Tile>281</Tile>
+        <Tile>301</Tile>
+        <Tile>321</Tile>
+      </Lane>
+      <Lane Index="3">
+        <Sample>s</Sample>
+        <Tile>1</Tile>
+        <Tile>21</Tile>
+        <Tile>41</Tile>
+        <Tile>61</Tile>
+        <Tile>81</Tile>
+        <Tile>101</Tile>
+        <Tile>121</Tile>
+        <Tile>141</Tile>
+        <Tile>161</Tile>
+        <Tile>181</Tile>
+        <Tile>201</Tile>
+        <Tile>221</Tile>
+        <Tile>241</Tile>
+        <Tile>261</Tile>
+        <Tile>281</Tile>
+        <Tile>301</Tile>
+        <Tile>321</Tile>
+      </Lane>
+      <Lane Index="4">
+        <Sample>s</Sample>
+        <Tile>1</Tile>
+        <Tile>21</Tile>
+        <Tile>41</Tile>
+        <Tile>61</Tile>
+        <Tile>81</Tile>
+        <Tile>101</Tile>
+        <Tile>121</Tile>
+        <Tile>141</Tile>
+        <Tile>161</Tile>
+        <Tile>181</Tile>
+        <Tile>201</Tile>
+        <Tile>221</Tile>
+        <Tile>241</Tile>
+        <Tile>261</Tile>
+        <Tile>281</Tile>
+        <Tile>301</Tile>
+        <Tile>321</Tile>
+      </Lane>
+      <Lane Index="5">
+        <Sample>s</Sample>
+        <Tile>1</Tile>
+        <Tile>21</Tile>
+        <Tile>41</Tile>
+        <Tile>61</Tile>
+        <Tile>81</Tile>
+        <Tile>101</Tile>
+        <Tile>121</Tile>
+        <Tile>141</Tile>
+        <Tile>161</Tile>
+        <Tile>181</Tile>
+        <Tile>201</Tile>
+        <Tile>221</Tile>
+        <Tile>241</Tile>
+        <Tile>261</Tile>
+        <Tile>281</Tile>
+        <Tile>301</Tile>
+        <Tile>321</Tile>
+      </Lane>
+      <Lane Index="6">
+        <Sample>s</Sample>
+        <Tile>1</Tile>
+        <Tile>21</Tile>
+        <Tile>41</Tile>
+        <Tile>61</Tile>
+        <Tile>81</Tile>
+        <Tile>101</Tile>
+        <Tile>121</Tile>
+        <Tile>141</Tile>
+        <Tile>161</Tile>
+        <Tile>181</Tile>
+        <Tile>201</Tile>
+        <Tile>221</Tile>
+        <Tile>241</Tile>
+        <Tile>261</Tile>
+        <Tile>281</Tile>
+        <Tile>301</Tile>
+        <Tile>321</Tile>
+      </Lane>
+      <Lane Index="7">
+        <Sample>s</Sample>
+        <Tile>1</Tile>
+        <Tile>21</Tile>
+        <Tile>41</Tile>
+        <Tile>61</Tile>
+        <Tile>81</Tile>
+        <Tile>101</Tile>
+        <Tile>121</Tile>
+        <Tile>141</Tile>
+        <Tile>161</Tile>
+        <Tile>181</Tile>
+        <Tile>201</Tile>
+        <Tile>221</Tile>
+        <Tile>241</Tile>
+        <Tile>261</Tile>
+        <Tile>281</Tile>
+        <Tile>301</Tile>
+        <Tile>321</Tile>
+      </Lane>
+      <Lane Index="8">
+        <Sample>s</Sample>
+        <Tile>1</Tile>
+        <Tile>21</Tile>
+        <Tile>41</Tile>
+        <Tile>61</Tile>
+        <Tile>81</Tile>
+        <Tile>101</Tile>
+        <Tile>121</Tile>
+        <Tile>141</Tile>
+        <Tile>161</Tile>
+        <Tile>181</Tile>
+        <Tile>201</Tile>
+        <Tile>221</Tile>
+        <Tile>241</Tile>
+        <Tile>261</Tile>
+        <Tile>281</Tile>
+        <Tile>301</Tile>
+        <Tile>321</Tile>
+      </Lane>
+    </TileSelection>
+    <Time>
+      <Start>27-08-08 17:03:52 BST</Start>
+    </Time>
+    <UsedCycleFolders>C1.1,C2.1,C3.1,C4.1,C5.1,C6.1,C7.1,C8.1,C9.1,C10.1,C11.1,C12.1,C13.1,C14.1,C15.1,C16.1,C17.1,C18.1,C19.1,C20.1,C21.1,C22.1,C23.1,C24.1,C25.1,C26.1,C27.1,C28.1,C29.1,C30.1,C31.1,C32.1,C33.1,C34.1,C35.1,C36.1,C37.1</UsedCycleFolders>
+    <User Name="single" />
+  </Run>
+  <Run Name="C1-74_Firecrest1.9.5_28-08-2008_auto">
+    <Cycles First="1" Last="74" Number="74" />
+    <ImageParameters>
+      <AutoOffsetFlag>1</AutoOffsetFlag>
+      <AutoSizeFlag>0</AutoSizeFlag>
+      <DataOffsetFile>/staging/IL9/analysis/080813_IL9_1213/Data/default_offsets.txt</DataOffsetFile>
+      <Fwhm>2.700000</Fwhm>
+      <InstrumentOffsetFile></InstrumentOffsetFile>
+      <OffsetFile>/staging/IL9/analysis/080813_IL9_1213/Data/default_offsets.txt</OffsetFile>
+      <Offsets X="0.000000" Y="0.000000" />
+      <Offsets X="-1.830000" Y="0.950000" />
+      <Offsets X="-0.070000" Y="0.800000" />
+      <Offsets X="1.260000" Y="3.190000" />
+      <RemappingDistance>1.500000</RemappingDistance>
+      <SizeFile></SizeFile>
+      <Threshold>4.000000</Threshold>
+    </ImageParameters>
+    <RunParameters>
+      <AutoCycleFlag>0</AutoCycleFlag>
+      <BasecallFlag>1</BasecallFlag>
+      <Compression>gzip</Compression>
+      <CompressionSuffix>.gz</CompressionSuffix>
+      <Deblocked>0</Deblocked>
+      <DebugFlag>0</DebugFlag>
+      <FirstRunOnlyFlag>0</FirstRunOnlyFlag>
+      <ImagingReads Index="1">
+        <FirstCycle>1</FirstCycle>
+        <LastCycle>37</LastCycle>
+        <RunFolder>/staging/IL9/analysis/080813_IL9_1213</RunFolder>
+      </ImagingReads>
+      <ImagingReads Index="2">
+        <FirstCycle>38</FirstCycle>
+        <LastCycle>74</LastCycle>
+        <RunFolder>/staging/IL9/analysis/080818_IL9_1232</RunFolder>
+      </ImagingReads>
+      <Instrument>HWI-EAS130</Instrument>
+      <MakeFlag>1</MakeFlag>
+      <MaxCycle>-1</MaxCycle>
+      <MinCycle>-1</MinCycle>
+      <Reads Index="1">
+        <FirstCycle>1</FirstCycle>
+        <LastCycle>37</LastCycle>
+        <RunFolder>/staging/IL9/analysis/080813_IL9_1213</RunFolder>
+      </Reads>
+      <Reads Index="2">
+        <FirstCycle>38</FirstCycle>
+        <LastCycle>74</LastCycle>
+        <RunFolder>/staging/IL9/analysis/080818_IL9_1232</RunFolder>
+      </Reads>
+      <RunFolder>/staging/IL9/analysis/080813_IL9_1213</RunFolder>
+      <SelectedCycles>1</SelectedCycles>
+      <SelectedCycles>2</SelectedCycles>
+      <SelectedCycles>3</SelectedCycles>
+      <SelectedCycles>4</SelectedCycles>
+      <SelectedCycles>5</SelectedCycles>
+      <SelectedCycles>6</SelectedCycles>
+      <SelectedCycles>7</SelectedCycles>
+      <SelectedCycles>8</SelectedCycles>
+      <SelectedCycles>9</SelectedCycles>
+      <SelectedCycles>10</SelectedCycles>
+      <SelectedCycles>11</SelectedCycles>
+      <SelectedCycles>12</SelectedCycles>
+      <SelectedCycles>13</SelectedCycles>
+      <SelectedCycles>14</SelectedCycles>
+      <SelectedCycles>15</SelectedCycles>
+      <SelectedCycles>16</SelectedCycles>
+      <SelectedCycles>17</SelectedCycles>
+      <SelectedCycles>18</SelectedCycles>
+      <SelectedCycles>19</SelectedCycles>
+      <SelectedCycles>20</SelectedCycles>
+      <SelectedCycles>21</SelectedCycles>
+      <SelectedCycles>22</SelectedCycles>
+      <SelectedCycles>23</SelectedCycles>
+      <SelectedCycles>24</SelectedCycles>
+      <SelectedCycles>25</SelectedCycles>
+      <SelectedCycles>26</SelectedCycles>
+      <SelectedCycles>27</SelectedCycles>
+      <SelectedCycles>28</SelectedCycles>
+      <SelectedCycles>29</SelectedCycles>
+      <SelectedCycles>30</SelectedCycles>
+      <SelectedCycles>31</SelectedCycles>
+      <SelectedCycles>32</SelectedCycles>
+      <SelectedCycles>33</SelectedCycles>
+      <SelectedCycles>34</SelectedCycles>
+      <SelectedCycles>35</SelectedCycles>
+      <SelectedCycles>36</SelectedCycles>
+      <SelectedCycles>37</SelectedCycles>
+      <SelectedCycles>38</SelectedCycles>
+      <SelectedCycles>39</SelectedCycles>
+      <SelectedCycles>40</SelectedCycles>
+      <SelectedCycles>41</SelectedCycles>
+      <SelectedCycles>42</SelectedCycles>
+      <SelectedCycles>43</SelectedCycles>
+      <SelectedCycles>44</SelectedCycles>
+      <SelectedCycles>45</SelectedCycles>
+      <SelectedCycles>46</SelectedCycles>
+      <SelectedCycles>47</SelectedCycles>
+      <SelectedCycles>48</SelectedCycles>
+      <SelectedCycles>49</SelectedCycles>
+      <SelectedCycles>50</SelectedCycles>
+      <SelectedCycles>51</SelectedCycles>
+      <SelectedCycles>52</SelectedCycles>
+      <SelectedCycles>53</SelectedCycles>
+      <SelectedCycles>54</SelectedCycles>
+      <SelectedCycles>55</SelectedCycles>
+      <SelectedCycles>56</SelectedCycles>
+      <SelectedCycles>57</SelectedCycles>
+      <SelectedCycles>58</SelectedCycles>
+      <SelectedCycles>59</SelectedCycles>
+      <SelectedCycles>60</SelectedCycles>
+      <SelectedCycles>61</SelectedCycles>
+      <SelectedCycles>62</SelectedCycles>
+      <SelectedCycles>63</SelectedCycles>
+      <SelectedCycles>64</SelectedCycles>
+      <SelectedCycles>65</SelectedCycles>
+      <SelectedCycles>66</SelectedCycles>
+      <SelectedCycles>67</SelectedCycles>
+      <SelectedCycles>68</SelectedCycles>
+      <SelectedCycles>69</SelectedCycles>
+      <SelectedCycles>70</SelectedCycles>
+      <SelectedCycles>71</SelectedCycles>
+      <SelectedCycles>72</SelectedCycles>
+      <SelectedCycles>73</SelectedCycles>
+      <SelectedCycles>74</SelectedCycles>
+      <SelectedFolders />
+      <SelectedTiles />
+    </RunParameters>
+    <Software Name="Firecrest" Version="1.9.5" />
+    <TileSelection>
+      <Lane Index="1">
+        <Sample>s</Sample>
+        <TileRange Max="330" Min="1" />
+      </Lane>
+      <Lane Index="2">
+        <Sample>s</Sample>
+        <TileRange Max="330" Min="1" />
+      </Lane>
+      <Lane Index="3">
+        <Sample>s</Sample>
+        <TileRange Max="330" Min="1" />
+      </Lane>
+      <Lane Index="4">
+        <Sample>s</Sample>
+        <TileRange Max="330" Min="1" />
+      </Lane>
+      <Lane Index="5">
+        <Sample>s</Sample>
+        <TileRange Max="330" Min="1" />
+      </Lane>
+      <Lane Index="6">
+        <Sample>s</Sample>
+        <TileRange Max="330" Min="1" />
+      </Lane>
+      <Lane Index="7">
+        <Sample>s</Sample>
+        <TileRange Max="330" Min="1" />
+      </Lane>
+      <Lane Index="8">
+        <Sample>s</Sample>
+        <TileRange Max="330" Min="1" />
+      </Lane>
+    </TileSelection>
+    <Time>
+      <Start>28-08-08 10:20:44 BST</Start>
+    </Time>
+    <UsedCycleFolders>C1.1,C2.1,C3.1,C4.1,C5.1,C6.1,C7.1,C8.1,C9.1,C10.1,C11.1,C12.1,C13.1,C14.1,C15.1,C16.1,C17.1,C18.1,C19.1,C20.1,C21.1,C22.1,C23.1,C24.1,C25.1,C26.1,C27.1,C28.1,C29.1,C30.1,C31.1,C32.1,C33.1,C34.1,C35.1,C36.1,C37.1</UsedCycleFolders>
+    <User Name="auto" />
+  </Run>
+</ImageAnalysis>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/tests/data/both.run/4_ILLUMINA_GA_MATRIX_FWD.txt	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,9 @@
+# Auto-generated frequency response matrix
+> A
+> C
+> G
+> T
+0.85 0.13 -0.02 -0.02 
+0.86 0.94 -0.00 -0.01 
+-0.01 -0.01 1.22 0.02 
+0.00 -0.00 0.81 1.22 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/tests/data/both.run/4_ILLUMINA_GA_PHASING_FWD.txt	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,4 @@
+<Parameters>
+  <Phasing>0.004400</Phasing>
+  <Prephasing>0.003000</Prephasing>
+</Parameters>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/tests/data/both.run/4_PROGRAM_ID.txt	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,1 @@
+illumina2srf v1.12
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/tests/data/both.run/s_4_0133_int.txt	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,10 @@
+4	133	593	417	-1575 -3114 23632 14569	-1592 -4133 929 17252	14021 11200 -772 -76	516 -564 -3951 18840	12439 10967 187 -144	10751 10218 840 -215	-210 -766 20073 11883	308 248 1231 9199	1801 13147 425 -1397	11255 11927 -590 -328	13358 14378 279 -3480	12872 10907 -15 -470	700 -238 14971 10163	2353 12720 709 -848	11616 13087 -3 -2947	3727 15570 669 -2503	2829 16298 -610 -2414	-19 176 312 17992	-418 1305 -826 14512	499 430 673 15153	10800 10527 1252 2958	1711 2324 11888 10892	2811 14238 2284 -585	269 1890 13061 12829	57 750 1497 15324	1242 725 463 17906	10197 10101 79 2626	9769 11031 1379 381	1782 2565 14181 10596	1127 1345 11110 12541	1503 562 2260 10541	8316 8808 2091 1607	1888 8908 1183 2713	828 2231 2584 14164	1044 1501 12067 11444	8667 9175 985 2057	7858 8423 1925 4740	-523 -3738 -1189 18547	19 10175 -1804 -426	-3514 -4781 648 16445	-2218 -5087 16027 15433	-1121 -3549 1237 11313	-1844 -1649 14886 11059	-640 9182 434 -548	-323 8179 -112 474	-1282 -1493 14321 10704	-257 6529 972 961	-943 -3497 15090 13134	-2115 -3120 1196 13188	-2247 -2465 1035 14565	-273 -297 438 12521	-305 4652 876 3778	-1383 -1967 318 15863	-923 -1515 609 14125	-889 -1663 1441 13711	-269 -893 10659 10580	-1514 -2400 995 11847	-832 -51 884 11827	322 6305 -1039 1791	136 6362 -895 1925	-1230 -1818 1542 14263	-673 -1278 9500 12432	4321 5433 2364 1520	552 948 9438 6875	859 5853 1561 1686	4002 4592 1223 2103	-743 -459 2421 10307	-6 -797 9039 9214	-179 -1021 8729 9356	-153 3143 2473 3634	3259 3940 1385 3093	616 4580 1498 2464	151 922 750 9387	2836 3231 1309 4249
+4	133	587	382	-893 -1087 22807 19153	201 1115 -779 15561	570 1033 -177 22260	547 153 20064 15393	9659 11375 987 97	547 1435 19213 14306	775 1544 1091 14409	546 1636 -387 20658	2447 12866 1605 2922	939 1518 18113 13647	8472 9205 1493 3294	1262 1786 1621 19498	10757 12352 1156 841	9993 10621 1337 3784	704 558 2505 21424	966 1666 19039 21734	1143 854 20010 21594	697 1878 3104 14555	1733 2479 19287 18928	9718 11235 2582 4323	2169 2846 2951 22786	9590 10689 1362 6300	1315 1765 4665 26119	1281 1757 17733 20692	1703 2466 2315 17306	8494 8976 2828 9211	912 1704 4694 24600	1320 2148 16273 18761	1044 2028 3849 19074	655 169 4635 23954	915 2067 12363 20565	6678 8074 4965 9392	3083 10172 4415 7184	1449 3729 12733 15623	1238 1991 14345 17674	2228 9278 4546 8873	2544 9345 3832 8128	-721 -1583 17688 15516	-241 -1693 17332 13810	431 423 14031 9647	78 -235 14520 11689	-901 -571 12877 10671	5426 5980 1727 2027	-326 -660 12978 9484	1699 8500 587 588	7647 7717 1183 1841	1245 7673 1560 1533	7745 9011 1603 777	1179 1825 1653 12445	842 1308 419 12778	852 1577 10268 8946	927 1902 412 9142	6664 7420 2064 3583	1120 1858 10117 9482	1830 7632 8068 7149	5098 6399 2384 3400	1200 1921 2037 11031	673 760 2148 12266	-38 -144 9370 10949	206 816 2838 8793	101 870 8366 9760	833 5628 2374 3442	1337 6332 2021 2861	4489 6120 1809 2893	5470 5621 1362 3124	1300 2042 1029 11013	901 1194 1703 11462	1902 5338 1458 4105	4430 5789 1318 3438	1089 1659 1659 9900	1500 6258 1703 2796	1432 6039 1460 3878	4307 5408 1257 3951	1285 2176 1156 10703
+4	133	505	428	-1970 -2096 22136 13335	-114 -1175 18772 11011	5 -159 1031 8335	-1778 -1945 622 15233	-1827 -1665 13355 10212	-1377 -1717 13678 9417	8578 7200 775 -1276	-36 8827 -1435 -646	-489 -1047 -953 14563	-559 -1214 1005 14757	-96 -1407 15069 8985	-1211 -3111 10253 11649	-340 -176 -2865 6716	-775 -1807 11408 10097	-1361 -1552 12051 9949	1010 10115 -259 929	11680 12844 -3746 -2183	9335 9857 2200 787	1402 1556 12854 8414	-1036 -60 2264 8773	342 7210 257 4307	-502 452 2408 12752	-167 532 13739 9469	1200 8845 140 907	693 6974 2576 2842	115 1781 11167 8428	523 7399 -289 1826	-614 200 3451 14511	1046 1415 9198 10144	4893 5729 591 4202	1567 1770 330 10149	5663 6436 1194 2920	7467 8532 535 1052	5219 6660 1567 2511	932 1009 10766 9147	1714 1936 9159 5733	5266 6165 2401 1452	2205 11083 -1828 -3721	9365 9984 -39 -3113	453 312 13830 7528	-2498 -2831 15375 12549	7311 7339 -1347 -1038	11219 10308 -3213 -1430	10884 9727 -1792 -2964	-230 -1510 -499 12894	-802 -727 12485 7982	1637 10523 -1215 -2625	6238 6848 473 -282	675 755 10208 5407	2397 9877 -1026 -2073	8474 8839 288 -1134	1420 1787 8421 4518	2139 10338 1342 -3588	7543 8420 -1058 -2198	7114 8282 581 -2372	1378 666 11438 5842	7023 5416 64 425	293 -387 -311 9950	7284 6414 -303 1063	6644 8095 307 -1577	767 951 788 7634	1477 6805 -95 -489	5746 6515 146 -1522	1203 6876 -698 -370	-246 474 7476 7396	3943 3974 1725 1141	-18 633 8438 6624	147 525 960 5155	5330 4736 954 1696	709 830 1028 6008	610 3998 635 2581	980 4799 755 2061	278 533 189 8113	-200 -346 796 10300
+4	133	548	808	-1113 -1090 17668 13979	8869 9716 -1561 -906	-996 -1113 660 16842	20 -279 737 17279	359 346 14047 10629	9837 11760 -41 -232	11215 12108 -89 424	410 99 634 16092	2131 10121 -78 419	180 834 13132 10813	1457 8727 1211 1616	795 1040 10805 10698	6829 7263 1537 1398	906 1357 11684 8493	293 470 1027 8964	423 650 10854 11620	375 187 10593 10988	182 343 1384 11243	1430 7963 2346 3507	690 1992 10660 9532	517 646 10823 10782	1803 8195 2565 2402	6265 7756 2553 2810	1342 2134 11089 9580	5206 6524 2020 3874	1196 1926 2155 13681	732 798 2650 14646	766 1615 9307 10930	1268 6999 3579 4009	1080 2427 10052 10283	4764 5285 2855 5278	1747 2077 2277 11882	6456 6577 1709 4876	7453 8181 1995 4139	6397 7770 2202 3813	2562 6772 2665 4088	1127 2764 8538 9644	-118 -755 377 15156	-613 -1445 524 15943	-331 -269 13581 11299	1896 9928 431 102	6461 7676 -1 485	406 -26 13484 11355	199 -324 1299 9404	-89 -713 12164 11244	-40 183 12819 10090	6068 6265 1176 182	7043 6840 151 999	554 448 547 12831	6709 7247 1203 1062	864 1108 9991 7916	145 327 1143 8928	1175 7604 405 1500	6077 6749 1515 1661	942 1341 11219 8253	480 679 10979 8664	-30 99 2466 10237	41 144 1681 12569	7121 7292 1320 2499	7611 7827 812 1715	6450 6599 1078 2644	841 810 1284 12832	729 628 1313 11975	1097 1223 1291 11527	5586 6158 559 3067	5548 5942 968 2660	1211 1179 1905 10992	644 298 7669 11050	-68 -23 3262 9752	675 488 7538 9811	4190 4415 2094 3909	1248 5064 1843 3335	1319 5484 2318 3303	239 1109 7094 9421
+4	133	568	418	-1129 -157 21949 13523	290 -756 2457 14736	3192 13282 324 532	1881 12678 869 -892	622 12682 405 3189	2036 12443 -899 613	-42 1060 664 15850	55 4563 689 15435	5336 14411 -616 4050	3331 3493 16472 11581	2079 1160 16679 12774	-209 741 14439 13902	-2149 2273 14555 11818	-461 8967 3154 4135	2325 2577 15246 10539	-96 682 15791 12335	346 4027 1960 9715	2642 5048 11276 11138	-324 1991 14888 14366	-604 3175 5892 13449	507 4938 3115 6636	3655 2057 2706 15311	4941 6793 -581 5985	2207 3070 2394 11884	4669 6591 2757 6862	4233 6825 9823 12748	223 1998 4150 11430	3670 5726 10074 12749	141 394 4943 14017	25 1079 2774 16659	6467 4826 1396 10177	2641 3191 2121 14364	1710 2591 2131 15483	5222 6098 -733 8071	5862 7468 5221 6617	2795 3811 1027 12255	4427 5413 3834 7348	12456 11873 -2076 1343	-1176 -2410 18102 14196	-1862 -2368 18300 12680	2371 13153 -1393 1815	506 815 5716 13215	-441 192 16205 13718	1992 10687 2460 -622	-1272 79 848 18286	150 745 -2654 14724	1325 8456 339 2222	-696 84 845 18616	630 2143 11432 13369	6560 6903 1928 4393	1139 9179 1568 -245	1713 3545 12319 10948	604 2146 2185 11547	604 1533 126 13893	1836 8029 1186 5281	298 1973 10349 11646	368 1036 3056 12488	710 1369 11260 11931	5243 5220 4223 5369	1047 1006 2649 13918	885 1179 10567 9493	4163 5956 4188 3738	801 645 11040 10486	2169 175 2784 9912	474 1115 2831 11803	-476 275 2231 14655	527 2760 9524 12134	1152 -115 2457 11051	4103 5570 1592 6389	852 2231 1227 11417	1263 5299 1421 6128	464 886 1751 12961	-671 466 7589 13373	-42 475 3098 10831
+4	133	587	489	-444 -1199 21810 18178	-571 -1109 699 15102	569 936 19584 13417	253 493 877 11773	-3 -178 657 16720	2880 12723 74 1105	9981 11637 197 847	11881 14642 -572 -1154	3081 13783 -2260 -309	8620 11694 963 1721	1404 1929 13612 10393	10045 11927 -651 -78	1359 10959 178 1133	2202 12553 -1497 1255	385 1297 818 17105	12297 13140 774 4613	1521 2071 884 20705	14576 15540 -82 805	15941 18603 -2229 746	16627 18248 380 1504	3945 13711 542 2435	11827 14722 -1405 1859	2281 3573 178 17881	1921 4256 775 17171	3456 14647 584 2728	1373 3573 881 16460	1025 1491 14219 15449	-178 1413 3220 14912	724 2784 13336 13026	3079 13039 1134 4443	2556 13421 2597 3848	1107 4165 14237 11023	1551 11321 3281 4214	338 2665 14942 14458	630 2083 3400 16131	729 2101 1166 18267	868 2723 1237 17094	12370 13071 -858 -1162	493 661 15537 9643	2201 13931 -975 -1027	369 -397 16159 12346	2627 13554 -2656 143	11496 13145 34 -363	10989 12367 496 -1095	1481 1754 15125 7471	6639 8107 2182 1209	907 1099 14266 7244	881 1104 -886 7825	9418 9916 -228 85	9350 11223 106 -491	8779 10261 658 599	2945 9538 796 -363	9757 10866 -679 -138	1845 1479 87 10007	8300 10160 912 349	1604 2373 8115 5778	464 836 938 7547	-254 187 10687 9771	1846 8638 1729 1087	2431 9557 958 -674	7046 8703 607 22	1395 2392 1156 9228	1239 3007 7623 6560	1538 7869 1832 2387	553 1841 1145 9999	1807 8660 -323 1194	6022 7747 765 1459	810 1620 9004 8538	916 1943 8916 6700	4470 5608 2429 2138	6491 7348 1242 1620	2997 7659 1091 1477	6763 7720 1027 1232	7545 8270 1255 968
+4	133	511	464	134 790 21290 11979	3086 17878 -831 -2787	15762 17987 -11 -2172	13280 16171 -796 -565	13981 16070 318 -1369	953 1382 -1920 15793	3147 15087 95 -1755	12518 14416 268 -768	2269 14568 131 -882	3140 15486 -2118 -2571	12387 14047 -1770 -1075	789 929 14156 10551	10487 12211 -270 -1327	11777 12276 132 263	825 1363 15294 8170	-125 1081 18546 13697	3952 16514 1257 -1377	675 1935 17580 10985	951 1875 16691 10482	445 593 1714 11888	447 909 1691 14704	2667 12984 -300 -521	2513 12439 196 136	549 1069 1243 15653	1250 2267 12938 11865	9090 10642 517 1244	8779 10203 1412 2062	1545 2220 1940 14143	1687 2828 11636 11631	7993 9620 1902 1567	8238 9193 1273 886	2002 2280 2412 14611	1236 1572 13013 12862	1201 1606 13150 11646	1521 1401 11645 11297	7437 8320 3173 2859	8077 9467 2993 2415	-2392 -2807 451 21255	-3120 -3203 615 21820	2280 14623 -1510 -1222	-861 -1801 17907 15436	-1659 -2485 1283 14472	1507 9689 182 2038	-1437 -2336 799 19520	9304 10514 170 -1688	9970 9287 903 432	-461 -1134 15673 14168	7101 6311 1220 1702	8605 8042 1422 310	907 879 12833 10086	461 666 1748 9772	188 -202 -961 16519	-150 -617 870 17544	7163 7810 944 2645	8505 9519 1505 -162	1345 1604 10286 10917	6734 5154 1043 3895	541 -166 909 15623	-591 -602 1643 16907	438 367 10983 12797	1133 6743 2058 4990	391 877 469 14413	967 1176 8851 12060	4447 5263 2763 4145	523 826 9891 12055	396 552 8911 11713	9 -536 10373 12412	349 899 1876 9431	1701 6734 836 3750	4707 5136 2501 3961	889 843 9163 10777	579 1030 3474 9467	203 100 9216 11334	267 506 8815 10099
+4	133	507	435	-47 -805 21226 14469	11699 12416 7967 3731	55 -925 815 17842	11096 13080 264 -176	212 934 -354 18214	663 537 14234 16611	12435 11242 544 1776	10867 11271 -399 846	8080 8164 -417 15351	10754 12673 4289 7481	12265 13361 685 -139	2608 11386 -153 3116	10461 11671 6774 6845	2042 12331 -264 1075	595 1545 679 13836	13073 15215 389 9713	9909 10198 -1888 15741	12264 12843 -1154 10365	2631 2910 14316 14051	8538 11479 1574 4127	3134 13541 1054 8470	8938 16059 712 274	11253 14281 880 2563	3518 12758 382 11121	2061 13143 -335 11357	1041 3824 12142 15033	1792 11234 8937 7775	2386 11938 1445 2666	6245 11382 298 2588	2064 11440 907 10215	3495 9223 9148 8349	5558 8973 1975 3895	5613 8675 1455 13219	1010 2447 11195 13551	4943 6560 11696 11200	2446 7563 11567 9468	2381 6895 10211 7861	430 7185 14232 10831	10079 10040 796 -1015	8580 5535 15773 7862	-588 -1615 14957 12412	-623 -1067 12059 9321	7635 9390 1389 473	1720 7271 12830 8304	4642 9045 1211 10550	414 565 7469 10839	2225 10741 10212 4663	7779 10015 -36 222	605 8712 8786 7181	2115 9534 6141 6124	8859 9488 6439 7085	936 1730 10053 7565	1657 9265 1818 10721	2247 10185 8020 4765	8122 9282 1689 6632	914 5451 12003 5867	5550 6130 2151 2660	-244 558 6008 10702	416 5512 777 11345	267 513 10418 8798	583 6682 2959 2702	814 3006 10067 8879	4793 4915 9860 8049	1482 5690 1729 7052	6284 7534 623 884	6398 6557 1547 2293	6093 6701 4159 3510	5483 6425 1899 1924	2066 5321 4644 5507	555 136 4023 8442	568 431 8160 8386	1213 5350 3231 5421	519 602 8217 11018	536 280 3005 9695
+4	133	561	484	-310 285 21180 17657	2301 17529 402 204	2793 17202 191 1343	12189 14388 135 975	396 1390 1017 23692	11524 13633 392 1528	11671 14181 269 1670	997 1296 962 24599	781 2015 873 22950	2901 16393 482 2379	14393 16155 407 1705	14145 17647 401 1783	13210 17133 382 1422	3186 14209 71 2108	1148 2281 1003 20995	1533 2559 1232 28744	938 2100 1291 28519	1114 2257 1171 29367	1076 2215 1297 30270	1072 2348 1080 28743	780 2564 1417 27501	3399 17468 909 7215	1189 2898 2375 26179	1835 3067 17792 23651	13975 15660 2124 6607	3183 5141 1277 25162	16055 18261 1359 5881	14347 17385 2255 6376	2651 5065 15136 18907	3835 15535 2353 7881	1955 4098 3276 23615	1430 2771 16832 20238	1141 2990 15592 20710	1037 2295 3639 20127	1127 2941 2559 25022	2626 12152 2096 9701	1172 3801 2078 23333	433 486 16887 14230	2849 15388 796 1060	11262 14024 480 938	645 1495 777 19695	885 1101 443 19779	13242 14688 -53 2071	12712 14364 593 595	3192 13114 575 596	2529 13369 1103 1725	698 1547 14713 13362	397 1689 1591 12043	2732 12688 401 1961	10638 13229 687 1491	10270 12072 795 1614	10659 12008 743 1190	2976 11576 480 2153	1793 3068 776 14187	8335 9666 679 4001	1457 2943 1033 14080	2941 11644 649 3045	9029 11326 561 2261	9738 10977 867 1707	8995 10817 499 2235	8531 9880 703 3993	2631 3598 776 13741	7973 9694 477 4631	2817 4070 1008 12941	9501 10314 990 3487	8808 10153 1410 3355	3104 9193 2040 4462	1752 3189 9537 12304	1580 2243 2038 12199	1394 1924 2874 15001	2055 2523 8649 11572	5417 7454 2715 4935	2847 8150 2938 5431	2424 3668 8335 9843
+4	133	539	484	244 -1008 21151 14738	-1335 2131 -78 15057	9600 13112 278 185	10520 9733 741 15953	-313 10508 -233 14290	9906 8721 15207 11477	1902 3249 15125 10320	122 10645 12218 7570	-261 674 672 15009	2111 10484 1437 15325	1194 1522 7616 14409	8738 9695 753 5603	6449 4909 11813 11053	2472 10562 -2592 11001	445 4943 884 14738	290 1435 9920 18059	1331 10994 11843 17236	2733 11470 4895 14863	10720 12239 2077 4054	11794 10466 71 14478	10611 11735 3044 7360	10198 9054 11762 13774	551 7195 10473 14627	5227 4355 13089 8665	8839 10252 3111 6394	9846 13301 1227 2594	2591 3966 11167 14580	8002 8907 7949 8168	10360 11164 4081 5464	4898 11951 0 8983	5459 10756 1542 3169	3270 7603 8834 13088	5976 8678 4852 11244	2610 7115 6756 8008	5455 8431 2601 7229	6044 7569 7645 9533	5125 7536 7893 7999	9712 9486 12904 12213	8440 8048 14166 10403	2200 13229 -1339 -892	-765 -998 12243 10040	2002 9992 1616 6849	1927 9991 11803 6302	8043 9423 7227 3582	2143 10000 -4034 7933	5114 8030 828 14286	155 6826 -1693 13372	5095 7148 698 14872	8584 8821 123 2426	7336 10907 -873 -543	85 7157 11004 11607	7081 8964 1276 -789	7422 8421 9917 5742	5741 7652 11102 5192	2079 2086 9197 9457	7255 4482 10329 10226	1521 873 952 9463	6313 7010 903 7082	6789 7344 5699 2606	7501 9029 -988 11860	8475 9449 -1063 4102	6222 6149 5781 6042	1083 5881 8023 8132	5580 6819 2072 1173	6760 7573 4936 3649	5301 6522 1197 1736	5531 6892 7887 3772	5039 8018 819 -1024	6277 6025 5847 1359	2178 7202 153 153	5011 6213 1303 1476	5916 6859 1363 807	6581 6757 960 6107	6551 6307 1056 902
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/tests/data/both.run/s_4_0133_nse.txt	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,10 @@
+4	133	593	417	308 1160 51 1530	125 1180 76 1310	642 1160 110 1430	230 380 75 1290	323 1090 146 1250	292 457 142 1230	227 450 130 1370	192 385 138 1330	360 1000 167 1230	200 502 185 1230	524 447 159 564	323 940 158 604	252 934 162 595	252 565 218 657	338 574 208 554	415 887 269 916	447 784 297 926	330 1040 214 588	440 965 263 1340	343 1005 350 1260	382 1060 391 1094	464 960 381 1270	498 1130 352 1290	441 975 443 1200	355 930 422 1370	454 961 407 1220	473 1067 399 1320	463 1298 402 1230	500 1045 404 1380	447 958 486 1523	529 1019 490 1524	572 964 525 1435	208 1055 525 1160	546 1162 465 1373	425 828 467 1240	473 1107 480 1370	396 786 446 1842	273 441 63 1370	299 1060 115 1330	237 1020 151 455	247 1070 155 1170	672 371 156 1190	623 980 188 1190	246 440 235 440	621 1020 225 494	235 974 227 496	279 422 223 401	272 452 258 574	212 809 240 596	303 645 314 1070	316 842 275 640	314 812 297 622	339 796 333 792	323 683 302 1000	337 771 299 1038	250 632 306 632	239 525 318 791	248 834 283 840	354 593 341 941	348 588 406 1010	348 556 362 1121	241 759 314 1044	367 804 390 983	318 560 392 1039	331 821 393 953	274 511 404 998	210 429 406 1264	331 654 453 916	333 611 442 752	388 769 474 910	276 606 450 1121	365 763 457 1101	393 560 455 973	340 443 457 1202
+4	133	587	382	308 1160 51 1530	281 1180 94 1310	657 1080 95 1430	318 1000 99 1290	172 1020 103 1250	289 1020 140 1120	658 990 146 1290	255 980 117 1220	186 512 153 1160	595 523 139 471	252 517 218 564	246 537 217 1170	583 575 652 595	223 617 649 657	697 619 250 554	257 597 264 916	447 784 297 926	271 1040 377 588	427 1080 338 1340	343 1005 350 1260	382 1060 391 1094	526 767 399 1270	456 1112 524 1290	451 1109 538 1200	394 638 514 1370	454 961 407 1220	469 1095 437 1320	436 865 491 1230	428 912 435 1380	469 794 580 1523	462 982 476 1524	487 899 447 1435	450 838 509 1160	479 1026 538 1373	552 737 644 1240	343 890 595 1370	444 680 534 1842	273 441 63 1370	269 369 153 1330	604 394 137 1180	197 854 155 1210	214 892 169 1150	623 911 685 476	225 440 243 440	270 439 247 494	235 414 226 496	221 908 220 401	325 614 220 509	283 461 282 1090	571 312 279 1070	365 796 290 938	307 463 297 589	336 574 194 780	210 495 348 858	207 810 344 535	177 425 296 948	398 705 361 1532	270 502 365 828	292 457 400 941	293 611 396 1010	381 613 186 1068	334 590 379 903	338 579 417 992	320 932 349 1034	374 569 272 953	315 725 329 998	328 438 335 1264	383 664 437 1406	259 642 446 1280	318 889 477 953	340 724 448 1367	314 560 514 1217	420 555 451 973	397 674 403 1270
+4	133	505	428	308 1160 51 1530	125 1180 76 1310	642 1110 110 1430	230 391 74 1290	323 990 146 1250	292 457 142 1230	227 450 130 1370	495 365 107 400	532 940 144 1090	165 423 143 470	469 465 148 1060	530 391 124 647	202 882 179 628	314 931 98 1050	318 969 212 590	217 1070 254 1330	447 970 313 1410	464 1012 295 1290	517 864 345 645	350 970 280 872	527 950 419 1310	373 984 430 1310	460 1040 403 1120	513 957 460 1180	477 957 422 1320	419 847 444 1230	400 977 439 1150	468 851 496 1180	428 995 481 1430	357 1156 448 1724	451 869 454 721	393 728 452 1597	489 1043 508 1852	446 1096 490 1660	519 966 531 1812	571 1251 377 1263	484 990 558 1615	660 980 81 1320	159 332 108 1190	200 881 119 1180	255 897 144 1110	189 875 167 1150	173 294 208 427	226 403 610 393	246 438 591 404	241 376 204 1130	206 453 194 1010	521 771 196 517	163 277 256 582	233 410 257 950	251 760 272 548	215 502 240 485	245 543 304 602	210 499 278 930	221 669 279 880	332 465 294 1009	308 564 293 1001	326 615 294 913	264 690 308 971	198 664 389 940	299 626 317 986	210 613 179 908	308 600 187 906	256 604 416 987	327 619 172 978	348 559 185 1004	344 650 452 1057	365 640 410 868	361 506 368 962	342 546 441 488	274 590 464 1406	321 671 478 1229	307 572 399 1307	368 725 419 1044
+4	133	548	808	80 703 41 961	64 726 55 875	90 715 59 863	140 707 85 798	132 280 96 776	164 732 80 779	149 331 78 858	405 722 89 302	146 223 109 387	121 334 106 319	173 254 98 428	346 289 120 450	214 397 148 425	411 599 98 568	99 273 135 345	133 400 174 431	155 522 127 606	200 346 171 831	233 631 158 584	254 777 159 380	248 335 192 532	266 719 208 774	247 531 245 598	241 539 240 769	249 581 279 782	316 633 236 812	258 561 278 772	316 545 264 770	170 505 308 760	248 606 286 806	238 557 288 980	253 437 312 887	223 470 296 1153	281 585 335 966	303 650 303 878	266 573 251 926	265 570 349 1013	186 560 68 893	415 250 67 756	186 576 92 759	132 224 70 767	350 220 107 786	190 599 105 706	160 213 138 785	126 303 409 303	194 544 137 364	317 185 389 298	105 270 139 377	147 366 127 763	186 480 137 688	145 352 158 329	301 335 167 391	141 470 155 346	152 491 166 578	160 497 193 643	139 221 187 618	182 350 220 481	140 353 217 656	184 451 209 618	183 260 175 481	185 409 254 530	230 460 257 645	167 370 217 697	243 386 228 675	219 353 256 589	219 396 236 416	222 415 276 597	204 438 255 691	224 422 285 797	222 452 255 640	206 382 280 817	208 404 290 744	223 490 183 755	233 478 282 603
+4	133	568	418	308 1160 51 1530	125 1180 76 1310	642 1160 110 1430	230 380 75 1290	323 1090 146 1250	292 457 142 1230	227 450 130 1370	192 385 138 1330	360 1000 167 1230	200 502 185 1230	524 447 159 564	323 940 158 604	252 934 162 595	252 565 218 657	338 574 208 554	415 887 269 916	447 784 297 926	330 1040 214 588	440 965 263 1340	343 1005 350 1260	382 1060 391 1094	464 960 381 1270	498 1130 352 1290	441 975 443 1200	355 930 422 1370	454 961 407 1220	473 1067 399 1320	463 1298 402 1230	500 1045 404 1380	447 958 486 1523	529 1019 490 1524	572 964 525 1435	208 1055 525 1160	546 1162 465 1373	425 828 467 1240	473 1107 480 1370	396 786 446 1842	273 441 63 1370	299 1060 115 1330	237 1020 151 455	247 1070 155 1170	672 371 156 1190	623 980 188 1190	246 440 235 440	621 1020 225 494	235 974 227 496	279 422 223 401	272 452 258 574	212 809 240 596	303 645 314 1070	316 842 275 640	314 812 297 622	339 796 333 792	323 683 302 1000	337 771 299 1038	250 632 306 632	239 525 318 791	248 834 283 840	354 593 341 941	348 588 406 1010	348 556 362 1121	241 759 314 1044	367 804 390 983	318 560 392 1039	331 821 393 953	274 511 404 998	210 429 406 1264	331 654 453 916	333 611 442 752	388 769 474 910	276 606 450 1121	365 763 457 1101	393 560 455 973	340 443 457 1202
+4	133	587	489	308 1160 51 1530	125 1180 76 1310	642 1160 110 1430	230 380 75 1290	323 1090 146 1250	292 457 142 1230	227 450 130 1370	192 385 138 1330	360 1000 167 1230	200 502 185 1230	524 447 159 564	323 940 158 604	252 934 162 595	252 565 218 657	338 574 208 554	415 887 269 916	447 784 297 926	330 1040 214 588	440 965 263 1340	343 1005 350 1260	382 1060 391 1094	464 960 381 1270	498 1130 352 1290	441 975 443 1200	355 930 422 1370	454 961 407 1220	473 1067 399 1320	463 1298 402 1230	500 1045 404 1380	447 958 486 1523	529 1019 490 1524	572 964 525 1435	208 1055 525 1160	546 1162 465 1373	425 828 467 1240	473 1107 480 1370	396 786 446 1842	273 441 63 1370	299 1060 115 1330	237 1020 151 455	247 1070 155 1170	672 371 156 1190	623 980 188 1190	246 440 235 440	621 1020 225 494	235 974 227 496	279 422 223 401	272 452 258 574	212 809 240 596	303 645 314 1070	316 842 275 640	314 812 297 622	339 796 333 792	323 683 302 1000	337 771 299 1038	250 632 306 632	239 525 318 791	248 834 283 840	354 593 341 941	348 588 406 1010	348 556 362 1121	241 759 314 1044	367 804 390 983	318 560 392 1039	331 821 393 953	274 511 404 998	210 429 406 1264	331 654 453 916	333 611 442 752	388 769 474 910	276 606 450 1121	365 763 457 1101	393 560 455 973	340 443 457 1202
+4	133	511	464	308 1160 51 1530	125 1180 76 1310	642 1160 110 1430	230 380 75 1290	323 1090 146 1250	292 457 142 1230	227 450 130 1370	192 365 138 1330	532 940 144 1090	165 423 143 470	469 465 148 1060	530 391 124 647	202 882 179 628	314 931 98 1050	318 969 212 590	217 1070 254 1330	447 970 313 1410	464 1012 295 1290	517 864 345 645	350 970 280 872	527 950 419 1310	373 984 430 1310	460 1040 403 1120	513 957 460 1180	477 957 422 1320	419 847 444 1230	400 977 439 1150	468 851 496 1180	428 995 481 1430	357 1156 448 1724	451 869 454 721	393 728 452 1597	489 1043 508 1852	446 1096 490 1660	519 966 531 1812	571 1251 377 1263	484 990 558 1615	660 980 81 1320	159 332 108 1190	200 881 119 1180	255 897 144 1110	189 875 167 1150	173 294 208 427	226 403 610 393	246 438 591 404	241 376 204 1130	206 453 194 1010	521 771 196 517	163 277 256 582	233 410 257 950	251 760 272 548	215 502 240 485	245 543 304 602	210 499 278 930	221 669 279 880	332 465 294 1009	308 564 293 1001	326 615 294 913	264 690 308 971	198 664 389 940	299 626 317 986	210 613 179 908	308 600 187 906	256 604 416 987	327 619 172 978	348 559 185 1004	344 650 452 1057	365 640 410 868	361 506 368 962	342 546 441 488	274 590 464 1406	321 671 478 1229	307 572 399 1307	368 725 419 1044
+4	133	507	435	308 1160 51 1530	125 1180 76 1310	642 1160 110 1430	230 380 75 1290	323 1090 146 1250	292 457 142 1230	227 450 130 1370	495 365 107 400	532 940 144 1090	165 423 143 470	469 465 148 1060	530 391 124 647	202 882 179 628	314 931 98 1050	318 969 212 590	217 1070 254 1330	447 970 313 1410	464 1012 295 1290	517 864 345 645	350 970 280 872	527 950 419 1310	373 984 430 1310	460 1040 403 1120	513 957 460 1180	477 957 422 1320	419 847 444 1230	400 977 439 1150	468 851 496 1180	428 995 481 1430	357 1156 448 1724	451 869 454 721	393 728 452 1597	489 1043 508 1852	446 1096 490 1660	519 966 531 1812	571 1251 377 1263	484 990 558 1615	660 980 81 1320	159 332 108 1190	200 881 119 1180	255 897 144 1110	189 875 167 1150	173 294 208 427	226 403 610 393	246 438 591 404	241 376 204 1130	206 453 194 1010	521 771 196 517	163 277 256 582	233 410 257 950	251 760 272 548	215 502 240 485	245 543 304 602	210 499 278 930	221 669 279 880	332 465 294 1009	308 564 293 1001	326 615 294 913	264 690 308 971	198 664 389 940	299 626 317 986	210 613 179 908	308 600 187 906	256 604 416 987	327 619 172 978	348 559 185 1004	344 650 452 1057	365 640 410 868	361 506 368 962	342 546 441 488	274 590 464 1406	321 671 478 1229	307 572 399 1307	368 725 419 1044
+4	133	561	484	308 1160 51 1530	125 1180 76 1310	642 1160 110 1430	230 380 75 1290	323 1090 146 1250	292 457 142 1230	227 450 130 1370	192 385 138 1330	360 1000 167 1230	200 502 185 1230	524 447 159 564	323 940 158 604	252 934 162 595	252 565 218 657	338 574 208 554	415 887 269 916	447 784 297 926	330 1040 214 588	440 965 263 1340	343 1005 350 1260	382 1060 391 1094	464 960 381 1270	498 1130 352 1290	441 957 443 1200	355 930 422 1370	454 961 407 1220	473 1067 399 1320	463 1298 402 1230	500 1045 404 1380	447 958 486 1523	529 1019 490 1524	572 964 525 1435	208 1055 525 1160	546 1162 465 1373	425 828 467 1240	473 1107 480 1370	396 786 446 1842	273 441 63 1370	299 1060 115 1330	237 1020 151 455	247 1070 155 1170	672 371 156 1190	623 980 188 1190	246 440 235 440	621 1020 225 494	235 974 227 496	279 422 223 401	272 452 258 574	212 809 240 596	303 645 314 1070	316 842 275 640	314 812 297 622	339 796 333 792	323 683 302 1000	337 771 299 1038	250 632 306 632	239 525 318 791	248 834 283 840	354 593 341 941	348 588 406 1010	348 556 362 1121	241 759 314 1044	367 804 390 983	318 560 392 1039	331 821 393 953	274 511 404 998	210 429 406 1264	331 654 453 916	333 611 442 752	388 769 474 910	276 606 450 1121	365 763 457 1101	393 560 455 973	340 443 457 1202
+4	133	539	484	308 1160 51 1530	125 1180 76 1310	642 1160 110 1430	230 380 75 1290	323 1090 146 1250	292 457 142 1230	227 450 130 1370	192 385 138 1330	360 1000 167 1230	200 502 185 1230	524 447 159 564	323 940 158 604	202 882 179 628	314 931 98 1050	318 969 212 590	217 1070 254 1330	447 970 313 1410	464 1012 295 1290	517 864 345 645	350 970 280 872	527 950 419 1310	373 984 430 1310	460 1040 403 1120	513 957 460 1180	477 957 422 1320	419 847 444 1230	400 977 439 1150	468 851 496 1180	428 995 481 1430	357 1156 448 1724	451 869 454 721	393 728 452 1597	489 1043 508 1852	446 1096 490 1660	519 966 531 1812	571 1251 377 1263	484 990 558 1615	660 980 81 1320	299 332 115 1330	237 881 151 455	247 1070 155 1170	672 371 156 1190	623 294 188 1190	246 440 235 440	621 1020 225 494	235 974 227 496	279 422 223 401	272 452 258 574	212 809 240 596	303 645 314 1070	316 842 275 640	314 812 297 622	339 796 333 792	323 683 302 1000	337 771 299 1038	250 632 306 632	239 525 318 791	248 834 283 840	354 593 341 941	348 588 406 1010	348 556 362 1121	241 759 314 1044	367 804 390 983	318 560 392 1039	331 821 393 953	274 511 404 998	210 429 406 1264	331 654 453 916	333 611 442 752	388 769 474 910	276 606 450 1121	365 763 457 1101	393 560 455 973	340 443 457 1202
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/tests/data/both.run/s_4_0133_prb.txt	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,10 @@
+ -40  -40   40  -40	 -40  -40  -40   40	  40  -40  -40  -40	 -40  -40  -40   40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40   40  -40	 -40  -40  -40   40	 -40   40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40   40  -40	 -40   40  -40  -40	  40  -40  -40  -40	 -40   40  -40  -40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40  -40   40	  40  -40  -40  -40	 -40  -40   40  -40	 -40   40  -40  -40	 -40  -40   40  -40	 -40  -40  -40   40	 -40  -40  -40   40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40   40  -40	 -40  -40   25  -25	 -40  -40  -40   40	  40  -40  -40  -40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40   40  -40	  40  -40  -40  -40	  30  -40  -40  -30	 -40  -40  -40   40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40   40  -40	 -40  -40  -40   40	 -40  -40   40  -40	 -40   40  -40  -40	 -40   40  -40  -40	 -40  -40   40  -40	 -40   40  -40  -40	 -40  -40   40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40  -40   40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40   40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40   40  -40  -40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40   40  -40	  17  -17  -40  -40	 -40  -40   40  -40	 -40   40  -40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40   40  -40	 -40  -40   40  -40	 -38   20  -26  -22	  20  -34  -40  -21	 -39   31  -35  -36	 -40  -40  -40   40	  11  -21  -40  -12
+ -40  -40   40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40   40  -40	  40  -40  -40  -40	 -40  -40   40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40   40  -40  -40	 -40  -40   40  -40	  40  -40  -40  -40	 -40  -40  -40   40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40   40  -40	 -40  -40   40  -40	 -40  -40  -40   40	 -40  -40   40  -40	  40  -40  -40  -40	 -40  -40  -40   40	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40   40  -40	 -40  -40  -40   40	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40   40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40    8   -8	  27  -40  -40  -27	 -40   39  -40  -40	 -40  -40   26  -26	 -40  -40   31  -31	 -40   22  -40  -22	 -35   12  -40  -12	 -40  -40   40  -40	 -40  -40   40  -40	 -40  -40   40  -40	 -40  -40   40  -40	 -40  -40   40  -40	  22  -22  -40  -40	 -40  -40   40  -40	 -40   40  -40  -40	  40  -40  -40  -40	 -40   40  -40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40   40  -40	 -40  -40  -40   40	  40  -40  -40  -40	 -40  -40   40  -40	 -40   12  -12  -40	  40  -40  -40  -40	 -40  -39  -40   39	 -40  -40  -40   40	 -40  -40   40  -40	 -40  -33  -40   33	 -40  -40   40  -40	 -40   40  -40  -40	 -40   40  -40  -40	  13  -13  -40  -34	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -21   15  -32  -17	  25  -26  -40  -33	 -40  -40  -40   40	 -34   32  -40  -36	 -40   20  -40  -20	  25  -26  -40  -35	 -40  -40  -40   40
+ -40  -40   40  -40	 -40  -40   40  -40	 -40  -34  -40   33	 -40  -40  -40   40	 -40  -40   40  -40	 -40  -40   40  -40	  40  -40  -40  -40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40   40  -40	 -40  -40   40  -40	 -40  -40  -40   40	 -40  -40   40  -40	 -40  -40   40  -40	 -40   40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40   40  -40	 -40  -36  -40   36	 -40   35  -40  -35	 -40  -40  -40   40	 -40  -40   40  -40	 -40   40  -40  -40	 -39   32  -40  -33	 -40  -40   40  -40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40   40  -40	  16  -20  -40  -19	 -40  -40  -40   40	  31  -32  -40  -35	  30  -30  -40  -40	  12  -12  -40  -21	 -40  -40   39  -39	 -40  -35   35  -40	  22  -22  -40  -40	 -40   40  -40  -40	  40  -40  -40  -40	 -40  -40   40  -40	 -40  -40   40  -40	  40  -40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40   40  -40	 -40   40  -40  -40	  40  -40  -40  -40	 -40  -40   40  -40	 -40   40  -40  -40	  40  -40  -40  -40	 -40  -40   40  -40	 -40   40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40   40  -40	  40  -40  -40  -40	 -40  -40  -40   40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40   40  -40  -40	  40  -40  -40  -40	 -40   40  -40  -40	 -40  -40   40  -40	  40  -40  -40  -40	 -40  -40   40  -40	 -40  -20  -40   20	  40  -40  -40  -40	 -40  -40  -40   40	 -33   16  -40  -16	 -28   25  -38  -27	 -40  -40  -40   40	 -40  -40  -40   40
+ -40  -40   40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40   40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40   40  -40  -40	 -40  -40   40  -40	 -40   40  -40  -40	 -40  -40   40  -40	  40  -40  -40  -40	 -40  -40   40  -40	 -40  -40  -40   40	 -40  -40   40  -40	 -40  -40   40  -40	 -40  -40  -40   40	 -40   40  -40  -40	 -40  -40   40  -40	 -40  -40   40  -40	 -40   40  -40  -40	  40  -40  -40  -40	 -40  -40   40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40   40  -40	 -40   40  -40  -40	 -40  -40   40  -40	  40  -40  -40  -40	 -40  -40  -40   40	  40  -40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -31   27  -40  -29	 -40  -40   39  -39	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40   40  -40	 -40   40  -40  -40	  40  -40  -40  -40	 -40  -40   40  -40	 -40  -40  -40   40	 -40  -40   40  -40	 -40  -40   40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40  -40   40	  40  -40  -40  -40	 -40  -40   40  -40	 -40  -40  -40   40	 -40   40  -40  -40	  40  -40  -40  -40	 -40  -40   40  -40	 -40  -40   40  -40	 -40  -40  -40   40	 -40  -40  -40   40	  40  -40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40  -40   40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40   40  -40	 -40  -40  -40   40	 -40  -40   40  -40	  40  -40  -40  -40	 -40   37  -40  -37	 -40   40  -40  -40	 -40  -40   32  -32
+ -40  -40   40  -40	 -40  -40  -40   40	 -40   40  -40  -40	 -40   40  -40  -40	 -40   40  -40  -40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40   40  -40  -40	 -40  -40   40  -40	 -40  -40   40  -40	 -40  -40   40  -40	 -40  -40   40  -40	 -40   40  -40  -40	 -40  -40   40  -40	 -40  -40   40  -40	 -40  -14  -40   14	 -40  -40   40  -40	 -40  -40   40  -40	 -40  -16  -32   16	 -28   11  -18  -13	 -40  -40  -40   40	   5   -9  -40   -8	 -40  -40  -40   40	   9  -13  -40  -11	 -40  -39   27  -27	 -40  -22  -37   22	 -40  -31   30  -36	 -40  -40  -35   35	 -40  -40  -40   40	  15  -40  -40  -15	 -40  -40  -40   40	 -40  -40  -40   40	   0  -20  -40    0	  12  -21  -13  -40	 -40  -40  -40   40	  10  -22  -22  -11	  40  -40  -40  -40	 -40  -40   40  -40	 -40  -40   40  -40	 -40   40  -40  -40	 -40  -40  -29   29	 -40  -40   40  -40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40   40  -40	  40  -40  -40  -40	 -40   40  -40  -40	 -40  -40   40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40   40  -40  -40	 -40  -40   40  -40	 -40  -40  -40   40	 -40  -40   40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40   40  -40	  11  -11  -40  -40	 -40  -40   40  -40	 -22  -40  -40   22	 -40  -35  -40   35	 -40  -40  -40   40	 -40  -40   40  -40	 -40  -40  -40   40	  12  -13  -40  -22	 -40  -40  -40   40	 -40   22  -40  -22	 -40  -40  -40   40	 -40  -40   10  -10	 -40  -40  -40   40
+ -40  -40   40  -40	 -40  -40  -40   40	 -40  -40   40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40   40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40   40  -40  -40	  40  -40  -40  -40	 -40  -40   40  -40	  40  -40  -40  -40	 -40   40  -40  -40	 -40   40  -40  -40	 -40  -40  -40   40	  40  -40  -40  -40	 -40  -40  -40   40	  40  -40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40   40  -40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40   40  -40	 -40  -40  -40   40	 -40  -40   40  -40	 -40   40  -40  -40	 -40   40  -40  -40	 -40  -40   40  -40	 -40   40  -40  -40	 -40  -40   40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40  -40   40	  40  -40  -40  -40	 -40  -40   40  -40	 -40   40  -40  -40	 -40  -40   40  -40	 -40   40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40   40  -40	  34  -34  -40  -40	 -40  -40   40  -40	 -40  -40  -40   40	  40  -40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40   40  -40  -40	  40  -40  -40  -40	 -40  -40  -40   40	  40  -40  -40  -40	 -40  -40   40  -40	 -40  -40  -40   40	 -40  -40   40  -40	 -40   40  -40  -40	 -40   40  -40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -39   39  -40	 -40   40  -40  -40	 -40  -40  -40   40	 -40   40  -40  -40	  40  -40  -40  -40	 -40  -40   40  -40	 -40  -40   40  -40	  14  -14  -40  -40	  40  -40  -40  -40	 -35   34  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40
+ -40  -40   40  -40	 -40   40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40   40  -40  -40	  40  -40  -40  -40	 -40   40  -40  -40	 -40   40  -40  -40	  40  -40  -40  -40	 -40  -40   40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40   40  -40	 -40  -40   40  -40	 -40   40  -40  -40	 -40  -40   40  -40	 -40  -40   40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40   40  -40  -40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40   40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40   40  -40	  34  -34  -40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40   40  -40	 -40  -40   40  -40	 -40  -40   29  -29	  26  -26  -40  -40	  35  -35  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40   40  -40  -40	 -40  -40   40  -40	 -40  -40  -40   40	 -40   40  -40  -40	 -40  -40  -40   40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40   40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40   40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40  -40   40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40   40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40   40  -40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40   40  -40	  33  -33  -40  -40	 -40  -40   40  -40	 -40  -40   18  -18	 -40  -40   40  -40	 -40  -40  -40   40	 -40   40  -40  -40	  40  -40  -40  -40	 -40  -40   32  -32	 -39  -25  -31   24	 -40  -40   26  -26	 -40  -40   33  -33
+ -40  -40   40  -40	  40  -40  -40  -40	 -40  -40  -40   40	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40   40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -32  -40  -40   32	  40  -40  -40  -40	  40  -40  -40  -40	 -40   40  -40  -40	  40  -40  -40  -40	 -40   40  -40  -40	 -40  -40  -40   40	  40  -40  -40  -40	 -18  -40  -40   18	  40  -40  -40  -40	 -40  -40   40  -40	  40  -40  -40  -40	 -40   32  -40  -32	   4   -4  -40  -40	  40  -40  -40  -40	 -40    8  -40   -8	 -40   19  -40  -19	 -40  -40   40  -40	 -40   27  -27  -40	 -40   40  -40  -40	  10  -10  -40  -40	 -40    9  -40   -9	 -40  -14   14  -40	  10  -10  -40  -26	 -20  -28  -40   19	 -40  -40   28  -28	 -16  -40   16  -29	 -40   -9    9  -40	 -40  -14   14  -40	 -40  -12   12  -40	  40  -40  -40  -40	 -40  -40   40  -40	 -40  -40   40  -40	 -40  -40   40  -40	  40  -40  -40  -40	 -40  -40   40  -40	 -40  -19  -40   19	 -40  -40   11  -11	 -40   40  -40  -40	  38  -38  -40  -40	 -40   40  -40  -40	 -40   40  -40  -40	  40  -40  -40  -40	 -40  -40   40  -40	 -40   18  -40  -18	 -40   40  -40  -40	  40  -40  -40  -40	 -40  -40   40  -40	  40  -40  -40  -40	 -40  -40    1   -1	 -40   -8  -40    8	 -40  -40   40  -40	 -40   40  -40  -40	 -40  -40   40  -40	 -29  -40   29  -40	 -40    6  -40   -6	  40  -40  -40  -40	  40  -40  -40  -40	  35  -35  -40  -40	  31  -31  -40  -40	 -24    9   -9  -25	 -40  -40  -25   25	 -40  -40   37  -37	 -40   24  -40  -24	 -40  -40   21  -21	 -40  -40  -40   40
+ -40  -40   40  -40	 -40   40  -40  -40	 -40   40  -40  -40	  40  -40  -40  -40	 -40  -40  -40   40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40   40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40  -40   40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40   40  -40	  40  -40  -40  -40	 -40  -40  -40   40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40   40  -40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40   40  -40	 -40  -40   36  -36	 -40  -40  -40   40	 -40  -40  -40   40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40   40  -40	 -40   40  -40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	  40  -40  -40  -40	  40  -40  -40  -40	 -40   40  -40  -40	 -40   40  -40  -40	 -40  -40   40  -40	 -40  -40  -40   40	 -40   40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40   40  -40  -40	 -40  -40  -40   40	  40  -40  -40  -40	 -40  -40  -40   40	 -40   40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40  -40   40	  40  -40  -40  -40	 -40  -40  -40   40	  40  -40  -40  -40	  40  -40  -40  -40	 -40   40  -40  -40	 -40  -40   40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40   32  -32	  20  -20  -40  -38	 -40   38  -40  -39	 -40  -40   29  -29
+ -40  -40   40  -40	 -40  -40  -40   40	  25  -25  -40  -40	   1  -40  -40   -1	 -40    7  -40   -7	  -1  -40    1  -40	 -40  -40   40  -40	 -40   40  -40  -40	 -40  -40  -40   40	 -40   -6  -40    6	 -40  -40  -16   16	  40  -40  -40  -40	 -40  -40   40  -40	 -40    0  -40    0	 -40  -40  -40   40	 -40  -40   -4    4	 -40   11  -12  -22	 -40    3  -40   -3	  40  -40  -40  -40	  10  -40  -40  -10	  40  -40  -40  -40	  40  -40  -40  -40	 -40    4   -6  -10	 -40  -40   40  -40	  40  -40  -40  -40	  36  -36  -40  -40	 -40  -40   22  -22	  39  -40  -39  -40	  40  -40  -40  -40	 -26    3  -40   -3	  -1    1  -32  -33	 -40  -21    7   -7	   2  -18  -40   -3	 -40   -1    1  -17	   3   -9  -40   -5	   1  -16   -2  -17	  -7  -17    6  -21	   9  -40   -9  -40	 -29  -40   29  -40	 -40   40  -40  -40	 -40  -40   40  -40	 -40   40  -40  -40	 -40    9   -9  -40	  40  -40  -40  -40	 -40    9  -40   -9	 -40  -40  -40   40	 -40  -26  -40   26	 -40  -40  -40   40	  40  -40  -40  -40	  22  -22  -40  -40	 -40    1   -1  -40	  40  -40  -40  -40	   3  -40   -3  -40	 -40  -40   40  -40	 -40  -40   40  -40	  23  -40  -23  -40	 -40  -40  -40   40	  22  -40  -40  -22	  33  -40  -33  -40	 -25  -40  -40   25	  40  -40  -40  -40	  40  -40  -40  -40	 -40    3   -3  -30	  40  -40  -40  -40	  38  -38  -40  -40	  26  -26  -40  -40	 -24  -40   24  -40	   0    0  -40  -40	  32  -40  -32  -40	 -40   40  -40  -40	  35  -35  -40  -40	  23  -23  -40  -40	  12  -40  -40  -12	  40  -40  -40  -40
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/tests/data/both.run/s_4_0133_seq.txt	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,10 @@
+4	133	593	417	GTATAAGTCAAAGCACCTTTAGCGTTAAGGTACTGAATCTGTGCCGCGTTTCTTTGTTCCTGAGCATGGCACTA
+4	133	587	382	GTTGAGTTCGATAATGGTGATATGTATGTTGACGGCCGGGGGAGCACATTGTAGCATTGTGCCAATTCATCCAT
+4	133	505	428	GGTTGGACTTGGTGGCAAGTCTGCCGCTGATAAAGGACAGGAAATGCAGCAGCAAGATAATCACGAGTATCCTT
+4	133	548	808	GATTGAATCGCGAGTGGTCGGCAGATTGCGATAAACGTTGCAGTGGAATAGTCAGGTTAAATTTAATGTGACCG
+4	133	568	418	GTCCCCTTCGGGGCGGTGGTCTATAGTGTTATTTATAAGGCTGCTTCTGACGTTCGTGATGAGTTTGTATCTGT
+4	133	587	489	GTGTTCAACAGACCTATAAACATTCTGTGCCGCGTTTAGCGCAAGAGTAAACATAGTGCCATGCTCAGGAACAA
+4	133	511	464	GCAAATCACCAGAAGGCGGTTCCTGAATGAATGGGAATTCGTCTAAGAAGTTTAAGATTGCTGAGGGTCAGTGG
+4	133	507	435	GATATGAATAACACTATAGACAACCGCCACGATGGGGGAGGGAGTGCACCAGCCAGAGTGCGGCAAAACTGCGT
+4	133	561	484	GCCATAATTCAAACTTTTTTTCTGATAAGCTGGTTCTGCATTAACCGTCAAACTATCAAAATATAACGTTGACG
+4	133	539	484	GTAACGGCTTTAGTTTCCAAAACGAAGAACCGAGAAGAGCGCCACTTTAACAAGGATAATAACAAAGCACAAAA
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/tests/data/both.run/s_4_0133_sig2.txt	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,10 @@
+4	133	593	417	-1066 -2372 19502 -917	-1046 -3357 507 14017	17440 -3767 -540 295	790 -1451 -3636 18328	15286 -2040 325 -613	13018 -798 516 -709	-78 -1113 17314 -1394	604 -537 407 7452	-466 14985 500 -1826	13666 111 -433 137	15634 1252 466 -3383	16126 -2863 -411 -334	568 -2042 13504 281	169 14238 4 -1191	14829 398 103 -2643	1132 15424 825 -2537	651 17814 -432 -2660	333 -1512 103 16279	-697 2327 -1031 12292	204 -453 423 12875	14851 -648 520 566	1164 -536 11245 2893	1103 16612 439 -2745	305 267 12508 3302	101 690 -92 12674	1140 -1101 27 16007	13515 -391 11 607	12036 1709 280 -1045	991 595 13413 818	1455 16 9365 4382	1340 -1731 612 8832	12081 -262 1990 -1249	-661 10863 756 712	1096 396 1096 12806	334 105 12499 1572	11893 515 -1017 645	10134 578 2095 3524	52 -4074 -1218 15585	-2232 13534 -1488 589	-3997 -1543 181 13043	-2044 -3635 13266 3192	-776 -3154 445 8616	-2285 176 12554 366	-2954 13301 72 -825	-2255 11499 -471 401	-1468 -878 12373 556	-1858 9788 -88 77	-461 -3836 13180 1805	-2389 -1166 241 10209	-2794 -124 674 11198	-138 -257 142 10078	-1523 7419 735 1374	-1587 -1130 -5 13284	-954 -630 287 10855	-956 -916 455 10620	-36 -635 9848 1331	-1791 -1281 -97 9460	-1155 735 689 9536	-870 8495 -1025 1204	-1217 9105 -923 1130	-1435 -1684 582 12067	-1240 -891 8969 4388	6074 1929 494 -809	44 -214 9098 211	-775 8103 353 376	6015 65 801 216	-1966 604 1200 8329	352 -1116 8064 1479	43 -1808 7622 2823	-1776 5811 1324 1292	5124 -349 983 1854	-868 6716 1342 -12	-502 385 268 8878	4373 670 1273 2101
+4	133	587	382	-424 -741 18769 3355	385 996 -858 13517	1068 348 -447 18957	1095 -987 16913 1531	11458 2047 415 -606	709 652 16431 1131	1089 776 337 11517	855 842 -682 17991	984 13646 1079 890	1192 -218 15905 1318	10657 761 629 1401	939 336 1089 16609	13082 1927 1062 -983	12220 545 1136 1814	616 -551 1279 17880	1599 505 16440 6636	2123 -1091 17209 6646	732 1494 330 10953	2014 285 17864 4780	12708 1847 864 710	1442 374 2236 19723	12839 1272 839 1819	1013 110 2889 21668	1964 52 16801 5412	1562 818 51 14378	11953 254 2233 3815	238 698 2752 20465	2026 536 15646 4110	1403 1209 1314 14268	1372 -1434 2822 18485	595 1300 11680 9692	9563 649 3126 4465	1559 10553 2739 2912	1641 1582 11385 6264	1866 -862 12861 7092	1402 10076 2316 4449	2236 9099 3561 5136	-710 -930 14337 2506	-2 -1736 14177 1348	499 149 11459 -180	149 -259 11758 1217	-1339 584 10554 1328	6661 874 981 585	-536 -588 11010 307	294 9553 151 37	9718 -383 950 773	-635 9104 1269 290	9683 1524 1308 -804	868 973 1234 9403	861 728 -307 10454	829 1097 9220 534	447 1424 -404 7742	8673 1124 1306 1229	660 646 8741 1953	478 8726 6687 1033	6552 1393 1548 840	848 1078 1467 8107	781 199 1060 9088	-143 -112 8592 2736	126 978 1182 5845	-88 596 7688 2970	-130 6910 1325 1175	24 7116 1585 1032	5364 1884 1453 1195	7244 -66 1052 868	652 1294 563 9041	844 -140 1326 8875	1059 5574 1120 1505	6049 1565 976 1136	579 -52 1250 8662	766 7255 1410 41	-21 6758 1132 2516	6227 767 973 1440	784 1520 897 10047
+4	133	505	428	-1844 -572 18279 -1124	464 -1706 15628 -1214	223 -308 757 6484	-1775 -349 151 12568	-1876 -46 11146 943	-1457 -680 11443 305	10986 -2155 482 -1626	-2184 11751 -1170 -68	-119 -1250 -1044 13125	-245 -945 317 12102	528 -1946 13099 -1623	-820 -2742 8537 4170	-291 411 -3597 7565	-377 -1683 10033 1806	-1360 -910 10403 1642	-1220 12669 -882 808	14750 618 -3462 163	11269 428 1775 -721	1301 -223 11922 -471	-1532 688 1006 6795	-786 9736 -61 2668	-489 257 1231 10563	40 -204 13233 -753	15 10598 -1340 635	-358 7992 1776 936	217 330 10930 731	-758 10135 -1769 872	-742 -244 2540 12000	1282 42 8950 2314	6743 1104 -613 2459	832 -96 70 9783	7152 907 1218 793	9208 1172 301 306	6082 1982 480 1245	444 -529 10294 1993	1825 0 7968 -690	7588 1284 1259 -119	690 11736 -1453 -2056	11169 940 10 -2592	594 -52 11311 -1793	-3159 -306 12643 1499	8821 165 -1290 -185	13692 -1068 -2670 621	13588 -1396 -1419 -1839	-394 -1618 -878 11315	-1063 -140 10883 -988	-238 12585 -1453 -1583	7912 428 108 -473	419 -303 9108 -1461	776 10870 -1363 -1155	11014 45 -59 -1151	1088 -58 7597 -962	156 12125 872 -4046	9426 486 -1080 -975	8623 1837 -75 -2411	693 -931 10750 -1862	10016 -2201 -802 -239	-1091 -645 -434 9499	9781 -1334 -298 441	8109 2482 302 -2478	79 -583 639 7073	-136 8446 -168 -1020	8151 -438 248 -1632	-599 9049 -1446 18	-1223 221 7464 2159	6034 -130 -29 -444	-961 1124 8400 228	-806 663 -284 4408	8287 -1004 820 -245	-30 -225 811 5189	-149 5087 419 1332	402 5849 706 323	327 -340 -132 7017	-347 -126 689 9107
+4	133	548	808	-880 -344 14550 1884	10416 963 -1206 47	-815 -317 316 13908	459 -565 236 14144	610 -360 11931 872	11478 2330 -179 -286	13433 936 29 55	486 -889 327 13772	1034 10546 -313 -174	405 -140 11552 1832	357 9687 312 488	974 -461 9549 3147	8719 428 546 103	868 300 10538 324	449 103 -200 7497	803 25 9444 3324	822 -569 9079 2950	389 -392 271 9435	534 9151 1607 908	883 811 9350 1992	898 -855 9330 3253	495 9141 1441 238	8328 1076 1571 834	676 518 10524 1908	6909 1650 756 1360	987 685 1552 11073	1130 -320 1487 11385	1076 264 8817 3179	356 8479 1687 726	930 597 9635 3232	6714 426 1441 1994	1025 233 1766 10222	8485 -156 1318 2114	9062 745 1706 2276	7782 1163 1812 1832	1563 6210 1587 1677	1337 1337 8748 3957	-27 -686 114 11955	-583 -951 226 12610	-450 127 11187 1448	402 10886 219 -279	7688 1595 -221 302	408 -442 11356 1415	339 -588 441 7052	-2 -703 10069 2069	-388 482 10701 877	7436 377 621 -680	8821 -177 65 295	-86 -30 257 10867	8626 892 632 -464	587 432 8900 420	68 -177 368 7194	-495 9552 216 538	8040 450 728 383	547 651 9667 243	511 382 9402 328	-146 270 1256 7110	-753 260 1155 9984	9182 367 1061 381	9188 437 577 740	8107 336 859 632	180 93 877 10481	800 -43 916 8679	668 275 957 9124	7171 972 297 1192	7115 664 709 590	715 69 842 8980	842 -433 7309 3724	-394 290 1352 6514	340 -187 7317 3489	6287 -204 916 1694	-175 5786 1473 1626	807 6267 1244 837	-24 656 7218 4478
+4	133	568	418	-1052 785 18138 -875	880 -1504 1858 11027	1911 12704 388 188	164 13374 860 -1364	-1543 14992 414 2444	490 13076 -688 676	78 778 373 13147	-615 5410 427 12644	4868 11701 -886 3392	4324 -622 14170 357	3089 -1680 13768 1370	-55 789 11685 3764	-3212 5167 12376 1684	-2418 12558 1576 1696	3558 -859 13310 193	-123 458 13386 1310	-263 4834 192 7621	3461 2520 9702 2599	-652 2375 12922 3490	-1236 4580 4149 8567	-352 6019 2344 2768	5424 -3388 2205 12426	5900 2764 -981 4288	2108 602 2091 9248	5668 2304 1783 3484	5185 3022 9194 4986	-851 1873 2142 7651	5258 2456 9334 4197	-103 -330 3434 9060	-762 1630 1879 13202	9964 -3105 860 6468	2629 884 1699 11197	1512 901 1855 12278	6775 831 -1707 6868	7293 1998 5729 804	2446 944 -369 11735	6283 1158 4038 3266	15040 -570 -1722 2131	-1180 -1454 14810 1230	-2190 -670 15126 -132	490 14659 -1457 2064	534 327 4441 7544	-752 790 13528 1846	558 12022 1777 -2511	-1974 1690 497 14663	92 584 -2554 13612	50 10104 347 543	-1142 786 76 15412	101 2300 9977 3824	8558 -13 1114 2442	-1013 11653 779 -1534	1820 2080 10992 1614	262 2182 1162 8189	477 826 -275 11740	907 9209 395 2836	-134 1974 9414 3111	261 886 1164 9068	204 1120 10178 2812	7254 25 2897 948	715 73 1182 11212	540 370 9745 798	5352 2976 2094 266	257 -80 10300 1867	3564 -3201 1231 6679	171 1444 2197 7568	-1036 884 728 11515	32 4008 9250 2895	1423 -2773 998 8303	5546 2674 1221 2893	64 1351 780 9876	650 6727 1155 2429	660 -332 498 10838	-1496 2024 7484 5678	-23 748 1998 8053
+4	133	587	489	187 -1423 17949 3094	-256 -832 370 12318	1072 41 16420 345	500 172 375 9376	363 -605 317 13830	1402 12650 155 518	11746 1580 279 542	13875 3052 -302 -820	910 13925 -1884 972	10254 3369 669 814	1174 109 12099 1160	12477 1899 -1077 147	-886 12390 326 767	707 13416 -1312 1287	70 148 563 15118	16138 801 728 1569	304 376 479 18677	18189 881 146 -853	18336 3363 -1982 1882	20559 870 672 789	379 13660 666 1664	15370 2633 -1297 1267	1671 1042 9 16163	2111 1832 497 14643	2037 16138 596 -661	1468 1173 -564 15329	1735 -268 13976 3264	-537 1939 215 12062	889 1183 13189 2391	2078 13547 -759 3019	922 14557 1342 1528	1215 861 14323 1191	-111 14713 -159 1391	392 916 15257 3081	882 1542 980 12380	1003 1390 521 15048	1175 2472 967 14928	14658 1106 -688 -575	531 387 12745 -1025	45 15797 -943 -414	582 -1268 13480 813	494 14926 -2478 1532	13628 2095 73 -456	13090 2007 108 -1258	1161 418 12975 -2634	8026 2170 1033 -186	760 323 12461 -2645	540 366 -1426 7430	11621 734 -167 -202	10731 2729 87 -624	10544 1686 551 94	942 9578 738 -936	12617 1230 -668 -281	1047 -706 -77 9080	10614 2922 347 -1035	1173 1043 7520 -351	407 510 -587 6284	-608 -29 10000 1622	756 9721 693 -287	731 10141 756 -1338	9437 1515 421 -1072	650 1200 257 8144	1092 1838 7316 214	359 9910 912 2	302 -105 839 8951	-148 10900 -552 179	8479 1491 -189 441	-231 946 8212 2111	257 1482 7859 104	5362 1729 1284 269	8749 387 914 572	806 7852 877 513	8641 477 778 364	10224 1261 1199 -72
+4	133	511	464	470 398 17618 -1805	787 18564 -500 -1986	18524 2600 196 -1951	15105 3436 -522 -92	16381 2412 489 -1687	1021 65 -1888 14848	1132 15474 291 -2057	15222 1422 378 -853	-211 15714 300 -887	927 15784 -1676 -1102	15381 1332 -1770 11	107 -338 12777 1082	12583 2190 -765 -1192	14528 344 -346 219	373 326 13446 -1905	-156 344 15961 1546	2521 17470 -652 -2254	797 -25 15598 -466	1380 806 14472 -1127	702 -67 55 9629	726 -506 1305 12346	1228 14056 -302 -1614	1096 13144 269 -1064	787 -1017 24 14559	943 925 12698 1672	11566 1876 -950 374	10872 1656 1313 -99	779 447 586 12764	1348 1090 11534 2408	10144 2045 413 -275	10364 1006 1045 -1353	1649 5 872 13422	1706 77 12033 2218	1636 284 10852 2250	1301 -752 10190 3376	9785 1080 1435 162	10534 1826 2940 317	-2810 -364 95 16828	-3784 69 224 17329	21 16621 -1403 -290	-854 -1259 14869 2213	-1874 -1186 644 11198	72 11355 102 916	-1927 -1386 416 15984	11176 1883 138 -2099	12507 -828 325 -305	-1284 -685 13579 2730	8960 -931 428 579	10901 -619 716 -762	583 150 11340 618	464 439 887 6776	291 -385 -1241 14157	-700 -534 572 14276	8902 1065 722 769	10622 1576 714 -1582	276 619 9456 3315	9599 -2251 102 1588	158 -721 461 12773	-1004 258 416 13366	681 -659 10331 3261	37 8963 900 1678	274 17 -756 12895	686 307 8462 4124	6159 1361 850 1021	-123 491 8728 4311	431 452 6764 4369	30 -880 9352 3678	209 190 385 7326	286 8458 368 1897	6916 -231 1398 1415	304 -36 9025 3435	601 945 1091 6228	184 -196 8298 3646	284 611 7989 3460
+4	133	507	435	576 -1387 17516 319	14008 576 6770 -1391	641 -1437 436 14666	13075 2368 357 -768	258 704 -741 15778	1037 -539 12112 5832	15410 -1768 247 974	12795 417 -253 524	9670 -251 -606 13660	12623 2213 3852 3535	14829 783 586 -903	350 11705 -341 2802	13477 139 6226 1877	-286 13992 -515 424	242 176 432 12035	16446 2563 439 6956	11560 -122 -1883 14829	15449 507 -1714 9039	2056 -308 13537 3348	10731 3114 380 2075	573 13954 841 7243	9669 8609 708 -1122	13980 2319 885 1139	1573 11924 265 9720	256 14776 -1304 9917	1234 805 11421 5590	436 12516 7649 878	562 12247 457 1253	7827 4792 128 1330	-308 12685 -19 9469	3377 6359 9309 782	6399 3777 737 1225	6959 3740 19 12064	-175 1100 10454 4396	7238 1087 9534 2640	1465 6943 9650 1299	2539 5796 9271 873	-1002 9105 11558 614	12173 99 674 -1371	11100 -3806 12934 -2688	-652 -1161 12107 1613	-852 -501 9877 705	9102 2386 730 -512	502 7641 10896 -854	4792 6116 405 8024	275 -259 6064 4580	471 12102 8720 -2443	9568 2340 -729 177	-1667 11202 7547 734	479 10295 4811 1365	11502 520 5017 2081	330 618 8715 -152	198 10740 524 8488	368 11188 7241 -1763	10773 646 196 5145	-1215 6868 11089 -2858	7637 351 678 763	-1156 692 5437 5259	-740 7989 -744 9574	427 -990 9829 460	-868 9427 1029 243	10 2682 8751 1590	6836 -618 8644 329	-590 6771 527 5595	7959 1348 276 -422	7596 44 1042 1046	7058 970 3890 327	6752 953 888 211	1156 5565 4133 1509	639 -1244 2556 5288	718 -843 7815 1656	491 7353 1144 2317	566 -696 8050 4135	794 -262 1827 7262
+4	133	561	484	72 271 17444 3000	-161 19073 492 -157	611 18165 299 927	14381 2359 231 408	348 922 544 19766	13559 2451 435 551	13635 3000 330 735	1276 -30 484 20552	1165 856 429 19050	412 17803 520 930	17503 1157 467 1062	16078 4197 477 1161	15425 4297 473 814	888 14739 118 948	1564 335 599 17790	2282 893 651 23325	1422 1135 716 22908	1733 1078 578 23643	1694 1055 705 24503	1651 1224 490 23123	1090 794 856 23091	1524 20111 739 2353	1578 117 668 22915	1453 841 17046 8944	19128 1848 323 2073	705 2089 567 23647	20799 2342 1204 1796	17440 3664 920 3520	1238 1109 14960 8011	2357 17406 232 3276	2457 478 1220 20923	1996 1080 15676 5638	1494 2029 13559 8004	1408 1098 1213 15109	1539 686 1776 21723	1525 14640 1747 2767	1538 1549 1573 22816	472 282 13695 1905	648 16781 648 267	13071 3888 386 186	381 1316 386 15479	703 459 107 15822	15794 2162 -85 1278	15133 2096 495 -35	1251 13428 451 19	595 14830 500 598	631 780 12729 2240	108 1360 685 9317	569 14191 250 875	12708 3124 552 648	11775 2520 638 749	13066 1325 604 340	878 12665 343 775	1287 1117 454 12134	10851 1903 494 1412	673 1408 691 11991	846 13058 478 1163	10942 2478 399 1375	11427 1566 740 639	10216 2698 332 1337	10437 1909 543 1986	1319 1272 460 12153	10524 2609 274 1636	1255 1804 683 11419	12230 1064 724 1044	10973 1188 1079 1645	1203 9792 828 2093	1622 1220 9377 4118	1726 941 362 8824	1417 912 1594 11518	1865 525 8472 3653	7247 2451 1281 2038	1397 8704 1652 2578	3098 1025 8477 3713
+4	133	539	484	1020 -2008 17449 585	-1947 4217 -254 12696	10900 4292 359 -83	13165 -1563 508 12985	-2628 13806 -514 12117	12840 -2355 12880 861	2151 1163 12518 203	-1752 13491 10330 -869	-157 294 -18 12575	1285 10900 950 12027	1434 -382 6588 7686	10791 1167 -22 4040	8430 -2997 10755 2208	1246 10893 -3093 10932	-147 5329 461 12003	652 96 8434 9243	73 12508 10167 7475	1397 10996 3589 10165	13275 1088 1708 822	14753 -2531 -396 13348	12240 1656 2254 3535	13635 -2972 10471 4809	-2228 9787 8225 7000	7082 -2810 11706 -1140	10700 1646 1689 4158	11752 4657 100 634	1471 1037 10407 6869	10040 728 6463 1806	13373 -142 3294 1614	3241 9967 -723 8768	5973 6145 852 249	2636 5133 8565 6622	7947 2422 3074 7094	1184 6039 6342 2018	6574 3364 891 4953	7418 1107 7056 3660	6295 3302 7303 2268	11649 24 10449 2443	10246 -233 11601 295	218 14847 -1214 -94	-922 -532 10166 1133	648 10819 928 4653	302 10966 9846 -1813	9735 1545 6026 -1536	416 10912 -3809 8742	5831 3659 709 10916	-1840 9356 -1715 11614	5704 2765 483 11816	10492 133 93 1385	8330 4794 -1254 -310	-2584 10131 9860 3476	8592 2187 102 -1744	8772 1366 8445 -949	6498 2957 9176 -2544	1578 241 7143 2737	10377 -3909 8999 1962	752 -623 -84 7567	7791 1283 283 5431	7882 717 5550 -2922	8494 2465 -1560 11713	10177 1488 -1503 3248	7853 -804 5076 1190	-1427 7744 7185 2243	6964 1155 752 -628	8183 1073 4648 52	5664 1727 -233 1016	6358 1668 7945 -1794	4794 4865 -844 -1178	8731 -1948 6134 -2711	-86 8559 -791 266	6343 799 1248 572	6844 1498 1170 -1047	7873 337 604 5791	9003 -335 1011 -769
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/tests/data/both.run/s_4_0134_int.txt	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,10 @@
+4	134	548	359	-1571 -1440 23458 19308	11799 12614 -732 546	10477 11925 346 1297	11591 11789 472 681	53 -758 19919 14894	9890 10067 565 692	278 498 854 20434	486 1133 943 19738	257 159 19185 14494	-743 -1549 19381 15243	349 667 1064 11278	-1301 -1260 20014 19288	451 712 267 13399	85 -393 1462 19917	-16 -653 1615 20636	-638 25 1575 26869	1684 11635 1671 3692	2835 13759 1209 1977	9632 11193 812 3218	1459 1053 1814 24304	10316 10893 1518 4138	10240 11299 1106 4061	2124 2912 1195 19438	10552 11330 2431 5124	1793 2415 14858 16280	9414 11806 1652 4233	2750 9952 2697 4614	1795 2959 15476 14499	2823 11709 2714 3688	8820 11099 2104 3518	9569 11534 1677 3638	2651 9247 2884 5240	1791 3833 14813 13860	2439 10152 3221 5269	1665 3638 14074 13869	6155 7320 4815 6673	1829 3786 12181 11363	10387 10742 -100 -856	1607 10146 -1607 -650	98 627 429 14357	1693 10196 -715 -189	8583 8802 -1448 -1364	8347 8920 301 -373	7815 8088 172 167	7799 8718 13 -54	8797 8658 316 557	807 962 13181 9132	7564 8379 249 -635	398 552 11973 9686	6103 6813 886 861	800 673 -205 11196	311 -482 638 12739	532 887 10919 9355	1665 6950 1061 1652	361 444 1144 9379	249 814 9985 8405	443 672 10979 8683	1397 5379 1975 2405	5304 5623 992 1889	1034 1659 679 8617	606 1435 416 10060	1684 6264 363 2279	5316 6497 592 2073	1191 2058 6762 7186	665 1505 909 6737	1553 6133 722 1738	827 2015 7322 6196	576 1500 7676 7615	1036 5002 2314 2836	1588 2877 6741 6066	3473 4662 2041 2167	1399 4681 1739 2222	828 1750 1567 7541	791 1832 1511 7594
+4	134	594	276	-3915 -3514 22937 16949	3172 16003 -806 -4661	701 10639 -289 757	-2749 -1023 721 20742	-160 -89 -2363 17499	289 9187 -256 748	-2534 -2103 605 22769	-1030 -548 17603 14503	-944 -2804 19063 15581	151 409 -2077 7883	639 928 13693 12280	10238 8413 60 949	-1311 -1556 1022 16439	25 -822 -1072 17071	-1387 -903 1160 18953	-1111 -80 15859 13138	3550 15177 -1291 -1289	12524 13157 693 618	11293 12263 -182 -465	1556 1248 13261 12505	8955 8030 2072 3023	9405 9633 1261 2654	3048 11687 -927 533	956 1622 12790 10212	2286 10142 1553 1295	902 1899 14426 10690	505 1389 1242 10870	6794 7729 1566 4043	1006 8447 1405 2984	-1847 -551 1655 17605	-745 -932 1657 18019	7571 9408 -1516 3474	8 651 1046 14383	-736 63 883 16109	1346 6675 1911 6590	397 1448 8917 12488	1201 8407 2505 3972	13231 11996 106 -1717	9865 10720 111 -1912	837 10566 -481 -1485	2456 13035 -3872 -729	708 1455 -1776 10068	99 -1101 13312 11156	10478 9975 902 -1794	400 6887 366 757	392 1247 -1434 9797	7748 8095 -1377 291	-1721 -1877 357 14438	-1066 -527 -20 11926	598 8517 -1454 -29	2122 10722 -182 -2019	8350 10300 -223 -1478	950 6954 86 651	99 -760 1036 13090	216 169 10580 7453	1006 8301 -629 97	6651 8132 62 12	8589 7574 363 1155	1484 7268 207 1275	8058 8108 -38 224	8737 9865 -699 -699	2149 7728 -1454 389	-2 1548 980 9354	1208 1856 8916 5898	6581 7323 -396 25	5871 7026 124 900	2356 7481 46 594	246 1088 6833 7685	528 -230 8852 8283	4248 3828 1826 2165	1777 6049 149 1509	886 1713 1767 8797	817 374 8516 8559	797 214 7970 8432
+4	134	369	182	1 427 18963 15097	-1405 -1092 16685 12347	188 625 -1561 9117	9950 10985 -1770 610	201 -496 14878 11524	8328 7694 921 1646	738 1243 12060 9385	7908 8566 883 -28	671 1131 835 11841	327 959 821 12659	2041 9437 -1149 1768	-354 787 792 15569	965 8036 744 2472	607 1567 794 12755	357 1010 -513 13818	427 1128 15039 14039	419 1164 1898 11851	389 914 399 18431	521 1316 13104 15664	7784 8452 1970 3587	2534 10053 909 1275	7532 9448 394 1704	1233 2200 822 15195	343 1397 1492 18361	1045 1618 1548 17146	1111 1854 -194 17636	6801 7823 1045 4769	7138 8037 960 3553	8026 8143 1111 3619	7107 7693 2158 4235	2110 2744 9949 10811	4937 5808 3487 4977	1138 2430 9924 12664	1887 7005 3754 4295	232 1318 10854 12771	-189 383 3931 11413	588 1116 9550 12801	-1177 -840 447 15841	1413 7415 133 1268	206 632 694 14109	374 489 10711 10133	212 -704 12589 10564	6936 7097 853 -273	7769 6922 536 927	7591 7933 458 -857	1657 6326 801 1275	742 1165 8802 8015	767 1164 965 7041	6375 7329 -520 432	1647 6024 1165 1617	583 1217 11340 7588	651 315 10710 9138	4637 5257 703 1151	691 961 1055 9685	416 511 1452 11889	499 740 7738 8179	453 650 1959 10008	584 1315 1304 10523	1804 6260 1080 2219	4643 4833 1580 2829	1004 1384 6989 7771	1181 1577 1733 7087	5207 5777 1158 2005	4848 5996 438 1223	1501 5204 775 2680	800 1705 112 8649	735 1163 545 9942	937 1674 6491 7993	3715 4214 1929 3199	1586 4805 1075 2395	945 2289 598 7214	1601 4703 640 3486	3503 4709 351 2619	1348 1930 1529 8012
+4	134	354	230	-301 7 18763 11198	9638 9808 -243 -1272	-262 271 -329 15189	1529 11395 187 -104	163 523 15432 9106	277 440 12605 10033	9446 9442 -485 -434	13009 12673 521 -1177	828 387 10789 8247	8195 8843 874 -155	610 1009 9414 6959	1661 9236 1195 912	590 597 12225 8175	205 -45 12648 9611	922 403 1210 10349	436 1123 1016 11665	2397 9437 497 650	8846 9623 1560 -875	951 1871 11406 8221	2095 8400 2018 850	7315 8461 1166 1367	1052 1696 10126 8881	994 1234 11621 8069	5371 6332 2252 1275	6863 7544 1257 894	1297 469 1997 11107	689 1603 9835 7774	1632 7643 895 3137	1147 7116 1409 1881	883 1505 9898 7924	5431 6025 1202 3035	1670 2293 8993 6598	5023 5982 2416 1931	2084 7097 1534 191	1884 7564 1756 1160	1478 7332 593 1724	1791 7503 1963 1393	-607 6479 13330 10105	5246 13662 1557 1240	-404 1687 565 21827	2666 14737 1428 2505	548 1843 10595 19160	7957 7998 11548 8668	6728 13965 2971 3420	5996 6535 11109 8994	2661 8559 9668 7526	3817 4389 13284 10398	5746 7211 7676 5910	1633 6086 2671 12017	190 1301 8547 19180	296 1575 2661 16984	1947 11051 2679 4047	6171 8379 6176 7035	420 1449 3742 17678	5433 6710 8103 8621	478 1305 10141 15004	2945 2513 4783 12379	849 657 14559 15769	701 13 16889 16844	4773 4561 8739 9185	2852 2650 11339 11076	3185 3707 10299 10405	4878 8572 5287 3823	2680 6359 6551 6827	2479 3991 4491 9808	1756 5637 6836 7461	1792 6122 4969 6420	3695 5425 7100 7017	1923 3197 9550 10013	3666 6945 4640 4492	3524 5175 6945 6939	5277 6595 3884 5020	2386 2826 2293 12112	1837 6093 1499 6974
+4	134	614	269	-384 3399 22554 13017	10973 11777 436 1369	-218 -1909 503 19621	251 1461 478 20441	9630 13220 192 1427	12576 13898 182 -1197	3944 3267 12956 10153	332 11579 800 1459	-978 -538 1011 19216	246 11606 650 2138	8187 9307 555 1896	-1032 3091 936 20589	708 1340 31 15050	7541 10254 953 2055	430 645 15339 11589	-896 2061 16989 15668	-1005 -608 14518 15667	-749 817 2189 15731	458 -672 1899 19541	12035 11134 2076 4396	-201 297 12762 13122	2611 11361 2565 3982	1994 11466 1871 3777	470 1179 1465 16775	3848 9960 2750 5329	-1405 4156 13993 14133	697 1144 9691 12356	-567 573 3048 12210	5115 7207 3603 5262	2391 9424 2967 4126	885 1627 12041 12507	448 521 11073 12779	655 2211 1291 10439	3822 8020 2911 5760	5183 9265 3053 5201	1664 2820 10907 9822	845 1711 9672 11580	1070 13481 -84 -1014	101 1049 14445 9206	-41 8779 898 277	-23 1040 -513 13964	308 504 451 15030	321 1074 -1026 14391	-165 -1024 471 16004	2316 11159 -106 -396	-1019 3442 -1325 12124	-1543 2381 676 13381	591 1000 10301 10199	179 3655 9583 9720	2254 11137 829 404	8424 10117 397 -2153	1973 10316 -1483 1481	-260 554 12155 11157	6873 7161 1079 2115	792 1460 443 11255	1068 1378 844 12034	7744 8514 -643 2619	8414 9592 -783 2153	2512 9235 549 1006	2309 10204 477 145	1654 7814 2281 2432	102 692 1731 11665	906 1298 8973 7934	5251 6240 1663 3396	661 2137 1277 9811	6473 7962 -208 1117	2623 7525 517 2565	1803 7309 1583 2574	5987 6842 540 3466	5450 6118 791 3275	1752 2037 804 10227	6214 6927 -121 2425	7003 7693 1117 2133	6653 7187 374 3315
+4	134	368	209	-20 -500 18743 9941	9129 8599 37 221	-181 -568 463 14008	-1239 -862 -193 14142	243 -1201 -1195 12545	-992 -278 14227 10706	-182 -1388 13538 9316	-1795 187 745 11059	974 8047 -105 -291	6245 6779 492 2860	524 -801 -407 16006	-1115 -1189 -1102 16584	-1657 1063 13533 11693	351 392 13021 10708	-362 -706 572 10383	8539 8409 678 692	9533 8347 901 815	8766 9076 59 -1681	9319 8733 1667 -65	671 568 624 12786	8016 7605 329 -259	2448 8867 1033 -84	896 1617 619 10079	567 2336 9239 8317	6512 6851 1173 1278	1922 7130 854 2807	2637 9739 -582 531	5840 7737 661 -279	609 941 8856 7601	1061 6465 1660 2243	1176 6992 1454 1742	-673 -191 10118 9279	118 57 1163 9161	-69 -489 822 11364	371 489 482 11323	277 313 6958 9796	3734 3531 1705 5518	66 -971 470 13836	-555 -1002 -1547 13098	7286 8095 -467 -2111	517 -713 -757 11545	2960 6659 -732 -308	6263 5917 -801 -575	6879 5847 63 -330	1016 6281 -788 -1497	5825 5587 609 -520	834 -1429 10890 8170	4858 5005 1204 -299	6355 5989 -862 -350	751 -683 10703 8229	710 1471 8883 5679	4371 3339 1120 1040	684 484 8089 6832	657 142 713 5121	1959 4213 343 1890	-280 194 664 8903	4274 4567 2728 1112	1261 4012 532 2330	332 -146 644 8609	1339 930 6104 5965	589 3778 961 1970	463 1268 447 6561	599 4372 202 2061	201 1664 6190 5755	1234 4326 1951 1089	-303 659 6170 6039	202 131 1700 6639	11 291 1624 6471	321 935 4958 5064	693 3736 2125 1709	193 792 6513 5692	-1 262 1877 6111	-558 2099 1162 3593	262 103 1192 7917
+4	134	621	345	146 292 22447 13382	-1792 -1520 731 15770	848 -464 -142 19570	3219 13620 -416 946	13603 14462 324 -270	12280 13801 -685 -2429	2644 12305 -1060 2032	10206 12537 658 1159	1002 1119 13446 9778	10393 11072 -451 -561	2011 11927 -53 204	2707 12137 915 -1103	935 409 655 17006	9683 10604 353 1447	1639 3167 -331 15540	13082 14310 417 411	12282 13813 549 1720	13793 15566 -429 -606	3979 14642 -2086 -462	10210 10677 61 1153	544 1603 -883 19830	1077 1777 1074 19123	1333 11295 413 4901	1332 2318 1950 17494	76 996 16259 16184	-933 -185 3249 16745	124 2055 13212 14329	1360 10091 2224 5013	1089 9841 2538 4389	689 3129 14031 11546	562 8247 3593 4939	110 901 15958 14997	341 2060 1477 13709	299 850 1782 18287	-254 1329 1751 20450	1447 8609 1069 5697	144 911 1668 19403	-63 -112 17728 9633	1832 11675 -939 -2625	11431 13763 -209 -2352	1553 9835 82 2954	1983 9381 138 2613	-692 -633 654 17699	-503 -1295 178 18270	-314 -722 371 16716	8651 9966 709 -471	913 26 12974 11439	1878 8118 1270 1579	595 1285 13075 11027	446 608 1343 11310	853 1221 842 12753	8601 8997 87 -1321	7402 7031 1220 2120	928 97 13126 11774	701 826 13367 9563	789 764 1624 8246	6418 6363 1352 2496	2341 7863 1025 670	898 1680 312 12957	16 428 11516 11786	7646 8305 249 1818	7287 7665 1186 3648	1242 1537 1451 12616	2111 7322 1103 2533	814 2018 94 11258	1587 7017 138 3568	613 1476 574 13260	87 480 559 14232	1027 1330 1266 13814	5553 6933 1658 3799	763 1153 9025 10641	616 1015 2040 8997	1771 6997 1652 3647	858 2367 8000 9315
+4	134	538	358	-369 -1837 22367 17650	-596 -217 19209 13724	-840 -1679 917 13261	12894 14336 616 27	642 289 17567 13979	2972 14183 1146 -551	700 1582 1168 17743	220 1278 1127 19310	499 161 1182 20781	11569 11355 970 3117	9926 11410 1477 2761	95 -346 15814 14926	3120 13601 351 1937	499 686 15221 13424	-165 1152 13761 12633	1029 9639 2944 4990	532 1566 2680 19546	1989 10468 1741 4852	9811 12367 -370 2655	2805 10290 1595 3568	1362 11226 2006 5113	1267 3323 1117 18986	872 2794 -271 18304	1383 3005 2249 17233	8590 10676 2302 5066	1922 3693 13371 13810	2872 9815 3640 5889	7663 9419 2340 5415	1605 3430 1237 15344	2516 10213 1855 6263	8656 11670 1201 3395	7298 9743 1934 4998	4185 11597 1999 2934	7322 10350 2795 3099	1443 3464 11519 12159	1573 3589 11962 10945	2537 9490 2996 4993	513 583 511 15087	9707 10031 673 1554	-441 99 17451 12544	2255 11715 -819 51	698 1137 795 17057	267 -119 1113 19582	-749 -193 16681 15231	1608 9099 1369 2212	10391 9956 876 1929	9956 10029 733 1671	10247 11357 632 -110	10138 10253 639 2036	865 752 1119 17287	9137 10527 -1146 1570	2388 9295 1215 2175	-283 848 13824 13723	457 328 2353 12710	500 892 13467 11911	11 541 12615 11704	823 7710 2429 3531	1685 7876 1685 4081	380 1193 1794 16687	952 1798 1538 13879	6239 7524 1324 3728	1423 1657 1382 13881	588 683 11860 13150	678 1112 9895 12130	-14 698 2821 12328	1139 1801 1368 13756	5879 6883 1857 4816	3315 7480 1829 4219	4776 6192 2730 4666	2007 3056 8448 10174	1684 2417 3444 9924	4772 5671 2486 5874	1926 1966 2808 12041	1314 2377 7288 10139
+4	134	557	250	1573 2329 22214 16949	13029 14560 501 818	435 1042 863 22406	12647 14166 411 1214	1081 1432 827 21599	859 1197 208 21959	446 1097 913 21361	2698 14072 387 1642	421 1251 1425 21530	389 907 16868 17309	9858 10961 1209 3323	1003 1828 1242 21046	1186 1798 15215 17536	10239 12287 1899 3164	1250 2222 15428 16081	1095 2765 2245 15766	3491 15966 2313 4061	1793 3678 16783 16360	10748 12062 2225 4488	12869 14055 1648 3673	12021 15011 1435 3364	12273 14379 1505 3247	11248 13120 1181 3804	2655 3449 1764 19956	2858 3948 1610 20916	11186 12474 1442 6243	2467 4628 1521 18176	3237 13267 1097 7039	1773 3619 1411 19570	1253 2603 2735 21115	1867 3035 13831 18204	9344 10917 2926 8505	2997 4029 2250 19572	11097 12763 1920 7661	12210 13906 1929 5551	10668 12691 3107 6589	3477 5517 11387 14215	11427 12799 -203 1453	794 1327 15175 12236	292 602 15006 11731	8835 9183 444 1379	849 1159 266 15167	9952 10559 905 1634	685 869 13885 12358	601 901 13497 9895	587 986 1077 8941	1812 10792 1198 2026	808 1534 13117 11806	8330 9623 1903 2330	8385 9392 1291 2151	1222 1854 1438 14869	627 1240 1436 16627	675 1169 1398 15376	482 1164 1279 15411	2045 9326 1075 4588	638 2043 1241 12694	2031 9528 1147 3703	7701 9547 2455 3895	1305 2405 1386 14301	891 1875 1074 14032	758 1429 1181 14275	913 2115 954 13955	1957 9118 1182 4302	1976 9288 1713 3908	1025 3316 8228 10499	1890 8542 1796 3652	2585 9715 1515 3208	6517 8667 1750 4094	1553 3396 7725 9096	2130 7773 2304 4314	5211 7638 2312 4110	1342 2904 7534 9366	1342 3002 2448 9099	2014 7247 2011 4923
+4	134	529	256	153 375 22045 18047	-664 -147 770 16633	2401 14696 391 1480	12679 13558 555 487	1004 1024 18946 14078	12342 13327 513 709	11922 13444 723 875	12324 13914 777 740	11520 12872 669 1739	1430 2086 979 15683	2547 11446 1606 2294	1231 1863 15973 14980	9317 10718 1312 2075	11485 13492 292 1044	10165 11442 910 2038	2143 3418 1198 17208	4288 16028 921 3033	12743 14457 852 2457	2355 4414 1265 17538	3889 14290 577 4075	1158 3059 1344 19712	1538 3359 1416 17994	2939 12745 2001 4477	1285 3557 15613 15775	1210 2494 15988 15530	1012 2291 3747 15792	1829 3244 2519 16386	8210 10224 1800 5667	9494 10339 1701 5053	9397 10092 1654 5228	2056 4091 1590 15514	2736 11257 1453 5581	3890 12520 1468 5417	9298 11474 1407 4409	10485 12110 1517 3776	9816 12077 1465 3409	8994 11118 1590 4055	629 393 6 16777	-103 -70 249 16212	2641 13121 -27 862	11743 12741 271 572	454 -135 15114 11944	72 250 15668 11259	1777 11136 879 1641	-116 188 858 15671	-291 -344 816 17774	1850 11088 434 1774	455 1727 994 13321	-58 599 11777 13141	1198 9962 1959 1493	1738 10362 1305 1164	325 1786 12529 12574	176 1004 1665 12224	353 996 1581 14348	-4 215 1388 17583	129 703 2121 15320	78 664 11107 15628	726 1087 9957 13565	5678 5996 2365 5526	748 1337 1683 13105	444 553 1446 15400	1356 1724 1178 14811	7276 8103 1332 4804	6612 8182 1282 4163	2679 8198 1700 4044	2066 7164 2077 4309	1737 3264 8953 10288	5507 6381 2457 4275	5333 6729 2201 4430	2248 2888 8552 9189	4357 5393 2617 5246	1378 2050 2693 11154	1439 2202 7406 11203	4501 5024 2813 5992
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/tests/data/both.run/s_4_0134_nse.txt	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,10 @@
+4	134	548	359	316 1100 55 1520	679 1100 88 1290	119 1050 96 1240	229 1030 110 1150	582 465 121 1150	291 420 85 1170	318 517 126 1290	199 1040 154 1260	205 510 149 1250	242 448 143 1220	635 978 593 529	217 437 206 854	297 597 166 523	298 779 189 622	300 872 247 735	385 930 283 693	395 913 294 1065	347 792 316 1205	365 948 313 1334	466 701 375 983	383 1008 411 1385	541 1001 380 1431	411 1141 373 1041	433 1113 461 1242	337 805 435 1265	530 957 448 1567	403 766 448 1384	297 661 486 1580	379 833 503 1356	423 925 537 1531	405 821 510 1500	354 784 543 1634	406 956 577 1794	357 1071 583 1563	478 973 526 1738	391 960 541 1690	365 963 604 1643	304 359 96 1300	189 940 140 447	225 967 107 1120	162 956 124 1200	583 385 164 1170	295 911 195 1100	250 362 625 1100	269 892 207 572	257 830 206 823	198 370 225 914	353 802 239 646	293 740 252 681	248 776 254 706	269 653 252 594	305 654 281 629	228 631 298 900	284 498 329 953	280 538 305 990	223 751 309 693	335 940 327 736	312 735 313 785	258 670 312 1162	285 808 387 624	296 734 352 1066	373 504 313 1209	234 641 343 1116	327 633 367 912	329 572 359 905	319 677 359 929	323 666 357 1164	305 662 385 1341	288 455 405 1168	251 617 386 1241	296 679 381 1186	339 579 405 1232	330 741 435 1069	322 666 356 1111
+4	134	594	276	316 1100 55 1520	679 1100 88 1290	119 1050 96 1240	229 1030 110 1150	582 465 121 1150	291 420 85 1170	318 517 126 1290	199 1040 154 1260	205 510 149 1250	242 448 143 1220	635 978 593 529	217 437 206 854	297 597 166 523	298 943 189 622	278 633 217 472	373 980 271 677	432 1020 257 1390	351 1050 299 1042	391 653 206 1370	413 1234 320 760	367 940 489 811	439 1068 325 901	370 970 343 924	345 938 447 1100	461 878 335 1220	437 951 382 1301	386 983 382 1106	365 944 304 1170	445 749 538 1140	419 776 453 1490	351 725 560 1058	460 731 482 1440	288 888 517 1382	525 1021 490 1543	420 1058 385 1638	474 904 535 1621	417 919 492 1550	304 1040 96 1300	189 940 140 447	225 967 107 1120	162 956 124 1200	583 385 164 1170	295 911 195 1100	250 362 625 1100	269 892 207 572	257 830 206 823	198 370 225 914	353 802 239 646	293 740 252 681	248 776 254 706	269 653 252 594	305 654 281 629	228 631 298 900	284 498 329 953	280 538 305 990	223 751 309 693	335 940 327 736	312 735 313 785	258 670 312 1162	285 808 387 624	296 734 352 1066	373 504 313 1209	234 641 343 1116	327 633 367 912	329 572 359 905	319 677 359 929	323 666 357 1164	305 662 385 1341	288 455 405 1168	251 617 386 1241	296 679 381 1186	339 579 405 1232	330 741 435 1069	322 666 356 1111
+4	134	369	182	78 784 45 1060	211 769 51 901	89 691 73 922	117 754 76 800	170 275 59 791	187 763 93 903	144 716 78 862	379 228 115 926	138 263 81 838	124 262 119 791	148 249 131 833	160 321 137 493	154 363 104 286	349 241 107 807	152 239 131 779	193 416 191 339	190 493 163 366	245 268 123 316	251 578 163 446	260 551 285 398	186 480 276 301	273 456 261 557	255 396 218 543	165 393 306 487	238 451 434 453	219 402 171 317	393 617 245 398	158 231 237 740	220 433 308 639	246 420 337 852	233 403 224 872	160 397 445 801	257 589 214 961	239 365 437 842	215 396 478 858	187 289 421 850	183 474 275 883	187 660 63 926	209 278 88 884	200 645 84 794	195 276 77 846	186 239 111 315	137 237 131 322	172 244 445 289	150 242 144 264	178 263 103 324	137 204 141 381	150 241 187 309	125 316 162 443	320 343 175 467	110 257 146 439	130 299 153 340	155 348 169 458	123 216 241 374	176 252 235 572	135 477 235 465	206 333 237 640	119 340 192 381	169 447 165 632	162 345 269 645	205 389 275 649	219 450 253 647	184 289 321 676	179 339 302 606	146 286 205 653	137 316 249 616	186 362 259 462	195 331 267 684	181 309 269 757	187 412 272 704	178 310 268 739	185 277 299 905	155 473 277 643	162 329 295 777
+4	134	354	230	78 784 45 1060	211 769 51 901	89 691 73 922	117 754 76 800	170 275 59 791	187 763 93 903	144 716 78 862	379 228 115 926	138 263 81 838	124 262 119 791	148 249 131 833	160 321 137 493	154 363 104 286	349 241 107 807	152 239 131 779	193 416 191 339	190 493 163 366	245 268 123 316	251 578 163 446	260 551 285 398	186 480 276 301	273 456 261 557	255 396 218 543	165 393 306 487	238 451 434 453	219 402 171 317	393 617 245 398	158 231 237 740	220 433 308 639	246 420 337 852	233 403 224 872	160 397 445 801	257 589 214 961	239 365 437 842	215 396 478 858	187 289 421 850	183 474 275 883	187 660 63 926	209 278 88 884	200 645 84 794	195 276 77 846	186 239 111 315	137 237 131 322	172 244 445 289	150 242 144 264	178 263 103 324	137 204 141 381	150 241 187 309	125 316 162 443	320 343 175 467	110 257 146 439	130 299 153 340	155 348 169 458	123 216 241 374	176 252 235 572	135 477 235 465	206 333 237 640	119 340 192 381	169 447 165 632	162 345 269 645	205 389 275 649	219 450 253 647	184 289 321 676	179 339 302 606	146 286 205 653	137 316 249 616	186 362 259 462	195 331 267 684	181 309 269 757	187 412 272 704	178 310 268 739	185 277 299 905	155 473 277 643	162 329 295 777
+4	134	614	269	316 1100 55 1520	679 1100 88 1290	119 1050 96 1240	229 1030 110 1150	582 465 121 1150	291 420 85 1170	318 517 126 1290	199 1040 154 1260	205 510 149 1250	242 448 143 1220	635 978 593 529	217 437 206 854	297 597 166 523	298 943 189 622	278 633 217 472	373 980 271 677	432 1020 257 1390	351 1050 299 1042	391 653 206 1370	413 1234 320 760	367 940 489 811	439 1068 325 901	370 970 343 924	345 938 447 1100	461 878 335 1220	437 951 382 1301	386 983 382 1106	365 944 304 1170	445 749 538 1140	419 776 453 1490	351 725 560 1058	460 731 482 1440	288 888 517 1382	525 1021 490 1543	420 1058 385 1638	474 904 535 1621	417 919 492 1550	304 1040 96 1300	189 940 140 447	225 967 107 1120	162 956 124 1200	583 385 164 1170	295 911 195 1100	250 362 625 1100	269 892 207 572	257 830 206 823	198 370 225 914	353 802 239 646	293 740 252 681	248 776 254 706	269 653 252 594	305 654 281 629	228 631 298 900	284 498 329 953	280 538 305 990	223 751 309 693	335 940 327 736	312 735 313 785	258 670 312 1162	285 808 387 624	296 734 352 1066	373 504 313 1209	234 641 343 1116	327 633 367 912	329 572 359 905	319 677 359 929	323 666 357 1164	305 662 385 1341	288 455 405 1168	251 617 386 1241	296 679 381 1186	339 579 405 1232	330 741 435 1069	322 666 356 1111
+4	134	368	209	78 784 45 1060	211 769 51 901	89 691 73 922	117 754 76 800	170 275 59 791	187 763 93 903	144 716 78 862	379 228 115 926	138 263 81 838	124 262 119 791	148 249 131 833	160 321 137 493	154 363 104 286	349 241 107 807	152 239 131 779	193 416 191 339	190 493 163 366	245 268 123 316	251 578 163 446	260 551 285 398	186 480 276 301	273 456 261 557	255 396 218 543	165 393 306 487	238 451 434 453	219 402 171 317	393 617 245 398	158 231 237 740	220 433 308 639	246 420 337 852	233 403 224 872	160 397 445 801	257 589 214 961	239 365 437 842	215 396 478 858	187 289 421 850	183 474 275 883	187 660 63 926	209 278 88 884	200 645 84 794	195 276 77 846	186 239 111 315	137 237 131 322	172 244 445 289	150 242 144 264	178 263 103 324	137 204 141 381	150 241 187 309	125 316 162 443	320 343 175 467	110 257 146 439	130 299 153 340	155 348 169 458	123 216 241 374	176 252 235 572	135 477 235 465	206 333 237 640	119 340 192 381	169 447 165 632	162 345 269 645	205 389 275 649	219 450 253 647	184 289 321 676	179 339 302 606	146 286 205 653	137 316 249 616	186 362 259 462	195 331 267 684	181 309 269 757	187 412 272 704	178 310 268 739	185 277 299 905	155 473 277 643	162 329 295 777
+4	134	621	345	316 1100 55 1520	679 1100 88 1290	119 1050 96 1240	229 1030 110 1150	582 465 121 1150	291 420 85 1170	318 517 126 1290	199 1040 154 1260	205 510 149 1250	242 448 143 1220	635 978 593 529	217 437 206 854	297 597 166 523	298 943 189 622	278 633 217 472	373 980 271 677	432 1020 257 1390	351 1050 299 1042	391 653 206 1370	413 1234 320 760	367 940 489 811	439 1068 325 901	370 970 343 924	345 938 447 1100	461 878 335 1220	437 951 382 1301	386 983 382 1106	365 944 304 1170	445 749 538 1140	419 776 453 1490	351 725 560 1058	460 731 482 1440	288 888 517 1382	525 1021 490 1543	420 1058 385 1638	474 904 535 1621	417 919 492 1550	304 1040 96 1300	189 940 140 447	225 967 107 1120	162 956 124 1200	583 385 164 1170	295 911 195 1100	250 362 625 1100	269 892 207 572	257 830 206 823	198 370 225 914	353 802 239 646	293 740 252 681	248 776 254 706	269 653 252 594	305 654 281 629	228 631 298 900	284 498 329 953	280 538 305 990	223 751 309 693	335 940 327 736	312 735 313 785	258 670 312 1162	285 808 387 624	296 734 352 1066	373 504 313 1209	234 641 343 1116	327 633 367 912	329 572 359 905	319 677 359 929	323 666 357 1164	305 662 385 1341	288 455 405 1168	251 617 386 1241	296 679 381 1186	339 579 405 1232	330 741 435 1069	322 666 356 1111
+4	134	538	358	316 1100 55 1520	679 1100 88 1290	119 1050 96 1240	229 1030 110 1150	582 465 121 1150	291 420 85 1170	318 517 126 1290	199 1040 154 1260	205 510 149 1250	242 448 143 1220	635 978 593 529	217 437 206 854	342 795 245 789	318 779 231 506	300 872 247 735	385 930 283 693	395 913 294 1065	347 792 316 1205	365 948 313 1334	466 701 375 983	383 1008 411 1385	541 1001 380 1431	411 1141 373 1041	433 1113 461 1242	337 805 435 1265	530 957 448 1567	403 766 448 1384	297 661 486 1580	379 833 503 1356	423 925 537 1531	405 821 510 1500	354 784 543 1634	406 956 577 1794	357 1071 583 1563	478 973 526 1738	391 960 541 1690	365 963 604 1643	319 359 93 460	248 893 108 447	225 820 107 1120	162 956 124 1200	583 385 164 1170	295 433 195 1100	250 737 625 1100	269 553 207 572	257 496 206 823	198 370 225 914	353 802 239 646	293 740 252 681	248 776 254 706	269 653 252 594	305 654 281 629	228 631 298 900	284 498 329 953	280 538 305 990	223 751 309 693	335 940 327 736	312 735 313 785	258 670 312 1162	285 808 387 624	296 734 352 1066	373 504 313 1209	234 641 343 1116	327 633 367 912	329 572 359 905	319 677 359 929	323 666 357 1164	305 662 385 1341	288 455 405 1168	251 617 386 1241	296 679 381 1186	339 579 405 1232	330 741 435 1069	322 666 356 1111
+4	134	557	250	91 1100 55 1520	594 980 87 1130	540 1000 100 1220	562 337 97 1110	549 428 112 1100	326 352 142 396	234 316 130 1100	315 980 139 447	226 423 609 1120	219 321 571 432	220 475 174 446	269 836 176 657	294 534 189 1260	283 478 171 529	288 861 209 538	337 747 301 883	267 1059 242 1390	364 694 233 658	460 671 286 1067	351 733 316 983	415 994 374 887	446 961 347 739	327 571 276 721	451 965 437 571	426 1015 302 1206	414 860 376 1485	339 849 385 1112	278 841 455 1266	449 821 381 919	352 704 428 1275	411 810 499 1316	489 801 417 1221	444 797 424 1313	461 942 487 1419	447 647 505 1262	381 820 560 1312	375 709 543 1300	275 912 103 1300	218 845 125 1120	251 850 132 425	267 313 115 1020	210 431 170 1100	281 387 221 420	151 365 199 1150	192 295 220 575	195 288 223 511	191 305 245 392	334 398 288 1220	262 512 260 375	240 467 245 433	277 729 279 569	248 460 321 765	270 692 259 685	270 380 282 597	304 470 310 1083	285 467 264 696	242 571 312 1028	287 648 378 672	233 543 318 1217	230 514 320 953	172 366 309 1000	337 701 317 888	324 689 364 825	297 449 425 1124	295 799 422 925	259 817 426 1093	330 627 387 893	326 817 357 1177	265 636 397 986	303 664 412 1021	260 809 385 886	332 660 343 1023	350 752 385 1072	358 718 366 1157
+4	134	529	256	316 1100 55 1520	594 1100 87 1290	540 1000 100 1240	562 337 97 1150	549 428 112 1100	326 352 142 396	234 316 130 1100	315 980 139 447	226 423 609 1120	219 321 571 432	220 475 174 446	269 836 176 657	310 850 212 549	377 677 220 506	190 861 191 735	278 783 255 693	395 913 294 1065	276 792 316 1205	355 493 298 1334	466 701 375 983	480 921 411 1385	464 1059 360 1431	425 895 325 1041	451 965 437 1242	443 1015 347 1265	477 957 448 1567	386 907 405 1384	315 750 418 1580	304 935 381 1356	400 706 372 1531	390 1088 431 1151	406 759 510 1634	496 820 445 1794	414 831 517 1563	360 641 517 1233	389 753 440 1038	446 709 422 1171	319 359 93 460	277 275 95 431	481 747 122 348	251 718 115 329	215 262 177 896	269 297 538 844	213 366 162 1030	160 365 554 462	201 401 214 980	208 736 168 537	250 578 241 459	149 315 251 697	164 660 233 515	274 691 238 481	240 567 271 852	141 305 283 655	194 514 273 831	167 589 287 794	185 609 301 696	205 565 286 1028	287 497 378 672	233 532 318 1162	230 725 320 953	172 419 309 1000	337 701 317 888	324 689 364 825	297 449 425 1124	295 799 422 905	259 817 426 929	330 627 387 1164	326 817 357 1177	265 636 397 986	303 664 412 1021	260 809 385 886	332 660 343 1023	350 752 385 1072	358 718 366 1157
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/tests/data/both.run/s_4_0134_prb.txt	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,10 @@
+ -40  -40   40  -40	  40  -40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40   40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40   40  -40	 -40  -40   40  -40	 -40  -40  -40   40	 -40  -40   40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40  -40   40	 -40   40  -40  -40	 -40   40  -40  -40	  40  -40  -40  -40	 -40  -40  -40   40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40  -40   40	  40  -40  -40  -40	 -40  -40   40  -40	  40  -40  -40  -40	 -40   40  -40  -40	 -40  -40   40  -40	 -40   40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40   29  -40  -29	 -40  -40   40  -40	 -40   39  -40  -39	 -40  -40   40  -40	  28  -35  -40  -30	 -40  -40   40  -40	  40  -40  -40  -40	 -40   40  -40  -40	 -40  -40  -40   40	 -40   40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40   40  -40	  40  -40  -40  -40	 -40  -40   40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40   40  -40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40   40  -40	 -40  -40   40  -40	 -36   34  -40  -39	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40   40  -40  -40	  40  -40  -40  -40	 -40  -40   40  -40	 -40  -37  -40   37	 -40   39  -40  -40	 -40  -40   40  -40	 -40  -40   29  -29	 -40   37  -40  -38	 -40  -40   38  -38	  16  -16  -40  -28	 -26   23  -29  -27	 -39  -25  -32   24	 -40  -20  -34   20
+ -40  -40   40  -40	 -40   40  -40  -40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40   40  -40	 -40  -40   40  -40	 -40  -40  -40   40	 -40  -40   40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40   40  -40	 -40   40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40   40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40   40  -40  -40	 -40  -40   40  -40	 -40   40  -40  -40	 -40  -40   40  -40	 -40  -40  -40   40	  40  -40  -40  -40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -27   17  -40  -18	 -40  -40   10  -10	 -40   40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40   40  -40  -40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40   40  -40	  40  -40  -40  -40	 -40   40  -40  -40	 -40  -40  -40   40	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40   40  -40  -40	 -40   40  -40  -40	  40  -40  -40  -40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40   40  -40	 -40   40  -40  -40	  32  -32  -40  -40	  40  -40  -40  -40	 -40   40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40   40  -40	  40  -40  -40  -40	  38  -38  -40  -40	 -40   40  -40  -40	 -40  -40   18  -18	 -40  -40   40  -40	  40  -40  -40  -40	 -40   39  -40  -40	 -40  -40  -40   40	 -40  -40   40  -40	 -40  -40   32  -32
+ -40  -40   40  -40	 -40  -40   40  -40	 -40  -40  -40   40	  40  -40  -40  -40	 -40  -40   40  -40	  40  -40  -40  -40	 -40  -40   40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40   40  -40  -40	 -40  -40  -40   40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40   40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40   40  -40	  40  -40  -40  -40	 -40   40  -40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40  -40   40	  40  -40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40   40  -40	  40  -40  -40  -40	 -40  -40   32  -32	 -40   40  -40  -40	 -40  -40   40  -40	 -40  -40  -40   40	 -40  -40   39  -39	 -40  -40  -40   40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40   40  -40	 -40  -40   40  -40	  40  -40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40   40  -40  -40	 -40  -40   40  -40	 -40  -40  -40   40	  40  -40  -40  -40	 -40   40  -40  -40	 -40  -40   40  -40	 -40  -40   40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40   40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40   40  -40  -40	  40  -40  -40  -40	 -40  -40   40  -40	 -40  -40  -40   40	  40  -40  -40  -40	  40  -40  -40  -40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40   40  -40	  40  -40  -40  -40	 -40   40  -40  -40	 -40  -40  -40   40	 -40   24  -40  -24	  29  -29  -40  -40	 -40  -40  -40   40
+ -40  -40   40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40   40  -40  -40	 -40  -40   40  -40	 -40  -40   40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40   40  -40	  40  -40  -40  -40	 -40  -40   40  -40	 -40   40  -40  -40	 -40  -40   40  -40	 -40  -40   40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40   40  -40  -40	  40  -40  -40  -40	 -40  -40   40  -40	 -40   40  -40  -40	  40  -40  -40  -40	 -40  -40   40  -40	 -40  -40   40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40   40  -40	 -40   40  -40  -40	 -40   40  -40  -40	 -40  -40   40  -40	  40  -40  -40  -40	 -40  -40   40  -40	  40  -40  -40  -40	 -40   40  -40  -40	 -40   40  -40  -40	 -40   40  -40  -40	 -40   40  -40  -40	 -40  -11   11  -40	 -40   40  -40  -40	 -40  -40  -40   40	 -40   40  -40  -40	 -40  -40  -39   39	   6  -40   -6  -40	 -40   40  -40  -40	 -40  -40   40  -40	 -40   13  -13  -40	 -40  -40   40  -40	  20  -40  -20  -40	 -40  -28  -40   28	 -40  -40  -40   40	 -40  -40  -40   40	 -40   40  -40  -40	  40  -40  -40  -40	 -40  -40  -40   40	   8  -40   -8  -40	 -40  -40   36  -36	 -40  -40  -40   40	 -40  -40   40  -40	 -40  -40   40  -40	   6  -40   -6  -40	 -40  -40   40  -40	 -40  -40   40  -40	   0    0  -27  -40	 -40   -3    3  -40	 -40  -40  -40   40	 -40   -4    4  -40	 -40   40  -40  -40	 -16  -40   16  -40	 -40  -40   40  -40	  -9    8  -26  -40	 -40  -40   40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40   25  -40  -25
+ -40  -40   40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40   40  -40	 -40   40  -40  -40	 -40  -40  -40   40	 -40   40  -40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	  33  -33  -40  -40	 -40  -40   40  -40	 -40  -40   40  -40	 -40  -40   40  -40	 -40  -40  -40   40	 -40  -40  -40   40	  40  -40  -40  -40	 -40  -40   40  -40	 -40   40  -40  -40	 -40   40  -40  -40	 -40  -40  -40   40	 -15   15  -40  -36	 -40  -38   38  -40	 -40  -40   21  -21	 -40  -40  -40   40	  23  -24  -40  -40	 -40   40  -40  -40	 -40  -40   40  -40	 -40  -40   31  -31	 -40  -34  -40   34	  -4    0  -11   -9	   2   -2  -40  -14	 -40  -40   40  -40	 -40  -40   13  -13	 -40   40  -40  -40	 -40  -40   40  -40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40  -40   40	 -40   40  -40  -40	 -40  -36  -40   36	 -40  -40  -40   40	 -40  -40   40  -40	 -40  -28   28  -40	 -40   40  -40  -40	  40  -40  -40  -40	 -40   40  -40  -40	 -40  -40   40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	  40  -40  -40  -40	  40  -40  -40  -40	 -40   40  -40  -40	 -40   40  -40  -40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40   40  -40	  37  -37  -40  -40	 -40  -40  -40   40	  40  -40  -40  -40	 -32   26  -40  -28	 -40   40  -40  -40	  40  -40  -40  -40	  39  -40  -40  -40	 -40  -40  -40   40	  40  -40  -40  -40	  39  -39  -40  -40	  40  -40  -40  -40
+ -40  -40   40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40   40  -40	 -40  -40   40  -40	 -40  -40  -40   40	 -40   40  -40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40   40  -40	 -40  -40   40  -40	 -40  -40  -40   40	  40  -40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40  -40   40	  40  -40  -40  -40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40   40  -40	  40  -40  -40  -40	 -40   40  -40  -40	 -40   40  -40  -40	  40  -40  -40  -40	 -40  -40   40  -40	 -40   40  -40  -40	 -40   40  -40  -40	 -40  -40   40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40   29  -29	  15  -40  -40  -15	 -40  -40  -40   40	 -40  -40  -40   40	  40  -40  -40  -40	 -40  -40  -40   40	 -40   40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40   40  -40  -40	  40  -40  -40  -40	 -40  -40   40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40   40  -40	 -40  -40   40  -40	  40  -40  -40  -40	 -40  -40   40  -40	 -40  -40  -40   40	 -16   16  -40  -40	 -40  -40  -40   40	  40  -40  -40  -40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40   40  -40	 -40   40  -40  -40	 -40  -40  -40   40	 -40   40  -40  -40	 -40  -40   40  -40	 -40   40  -40  -40	 -40  -40   40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40   40  -40	 -40   40  -40  -40	 -40  -40   40  -40	 -40  -40  -34   34	 -40   28  -40  -29	 -40  -40  -40   40
+ -40  -40   40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40   40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40   40  -40  -40	  40  -40  -40  -40	 -40  -40   40  -40	  40  -40  -40  -40	 -40   40  -40  -40	 -40   40  -40  -40	 -40  -40  -40   40	  40  -40  -40  -40	 -40  -40  -40   40	  40  -40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40   40  -40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40   40  -40	 -40  -40  -40   40	 -40  -40   40  -40	 -40   40  -40  -40	 -40   40  -40  -40	 -40  -40   40  -40	 -40   40  -40  -40	 -40  -40   40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40  -40   40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40   40  -40	 -40   40  -40  -40	  40  -40  -40  -40	 -40   40  -40  -40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40  -40   40	  40  -40  -40  -40	 -40  -40   40  -40	 -40   40  -40  -40	 -40  -40   40  -40	 -40  -40  -40   40	 -40  -40  -40   40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40   40  -40	 -40  -40   40  -40	 -40  -40  -40   40	  40  -40  -40  -40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40   40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40   40  -40  -40	 -40  -40  -40   40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40  -40   40	  38  -38  -40  -40	 -40  -40   40  -40	 -40  -40  -40   40	 -40   40  -40  -40	 -40  -40   35  -35
+ -40  -40   40  -40	 -40  -40   40  -40	 -40  -40  -40   40	  40  -40  -40  -40	 -40  -40   40  -40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40  -40   40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40   40  -40	 -40   40  -40  -40	 -40  -40   40  -40	 -40  -40   40  -40	 -40   40  -40  -40	 -40  -40  -40   40	 -40   40  -40  -40	  40  -40  -40  -40	 -40   40  -40  -40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40  -40   40	  40  -40  -40  -40	 -40  -40   40  -40	 -40   39  -40  -39	  40  -40  -40  -40	 -40  -40  -40   40	 -40   36  -40  -36	  40  -40  -40  -40	  25  -35  -40  -25	 -40   37  -40  -40	  29  -29  -40  -40	 -40  -40   26  -26	 -40  -40   40  -40	 -40   30  -40  -31	 -40  -40  -40   40	  40  -40  -40  -40	 -40  -40   40  -40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40   40  -40	 -40   40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40  -40   40	  40  -40  -40  -40	 -40   40  -40  -40	 -40  -40   40  -40	 -40  -40  -40   40	 -40  -40   40  -40	 -40  -40   40  -40	 -40   40  -40  -40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40   40  -40	 -40  -40   40  -40	 -40  -40  -40   40	 -40  -40  -40   40	  40  -40  -40  -40	 -25   19  -40  -21	  29  -35  -40  -30	 -40  -40   33  -33	 -40  -32  -33   29	  25  -27  -40  -30	 -40  -40  -40   40	 -40  -40   23  -23
+ -40  -40   40  -40	  40  -40  -40  -40	 -40  -40  -40   40	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40  -40   40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40   40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40   40  -40	  40  -40  -40  -40	 -40  -40   40  -40	 -40  -40  -40   40	 -40   40  -40  -40	 -40  -40   40  -40	  40  -40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	  40  -40  -40  -40	 -40  -40  -40   40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40   40  -40	  40  -40  -40  -40	 -40  -40  -40   40	  40  -40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40   28  -28	  40  -40  -40  -40	 -40  -40   40  -40	 -40  -40   40  -40	  40  -40  -40  -40	 -40  -40  -40   40	  40  -40  -40  -40	 -40  -40   40  -40	 -40  -40   40  -40	 -40  -40  -40   40	 -40   40  -40  -40	 -40  -40   40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40  -40   40	 -40   40  -40  -40	 -40  -40  -40   40	 -40   40  -40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40  -40   40	 -40   40  -40  -40	 -40   40  -40  -40	 -40  -40   30  -30	 -40   40  -40  -40	 -40   40  -40  -40	  36  -36  -40  -40	 -40  -40   36  -36	 -40   40  -40  -40	  19  -19  -40  -40	 -40  -40   34  -35	 -40  -25  -40   25	 -40   33  -40  -34
+ -40  -40   40  -40	 -40  -40  -40   40	 -40   40  -40  -40	  40  -40  -40  -40	 -40  -40   40  -40	  40  -40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40   40  -40  -40	 -40  -40   40  -40	  40  -40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40   40  -40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40   40  -40  -40	 -40  -40   40  -40	 -40  -40   40  -40	 -40  -40  -40   40	 -40  -40  -40   40	  40  -40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40   40  -40  -40	 -40   29  -40  -29	  40  -40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40   40  -40  -40	  40  -40  -40  -40	 -40  -40   40  -40	 -40  -40   40  -40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40   40  -40  -40	 -40  -40  -40   40	 -40  -40   40  -40	 -40   40  -40  -40	 -40   40  -40  -40	 -40  -40   40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40   36  -36	 -40  -40   35  -35	  40  -40  -40  -40	 -40  -40  -40   40	 -40  -40  -40   40	 -40  -40  -40   40	  40  -40  -40  -40	  40  -40  -40  -40	 -39   34  -40  -36	 -33   27  -40  -28	 -40  -40   40  -40	  29  -29  -40  -40	  23  -23  -40  -36	 -40  -40   40  -40	  19  -19  -40  -36	 -40  -40  -40   40	 -40  -40   16  -16	  19  -28  -40  -19
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/tests/data/both.run/s_4_0134_seq.txt	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,10 @@
+4	134	548	359	GAAAGATTGGTGTTTTCCATAATAGACGCAACGCGAGACTCAAAAAGAGATTGCTGGCATTCAGTCGGCGACTT
+4	134	594	276	GCCTTCTGGTGATTTGCAAGAACGCGTACTTATTCGCAACCTGACTATTCCACTGCAACAACTGAACGGACTGG
+4	134	369	182	GGTAGAGATTCTCTTGTTGACATTTTAAAAGAGCGTGTCTGGAAACGTACGGATTGTTCAGTAACTTGACTCAT
+4	134	354	230	GATCGGAAGAGCGGTTCAGCAGGAATGCCGAGACCCCGCTCTACGCGATTTCATAGTGGAGGCGTGCGGCGATC
+4	134	614	269	GATTAAGCTCATTAGGGTTAGCCTCGGTACGGTCAGGCGCTTTTCTTGGCACGATTAACCCTGATACCAATAAA
+4	134	368	209	GATTTGGTCATTGGTAAAATACTGACCAGCCGTTTGATTATCAACAGAAGGAGTCTACTGCTCGCGTTGCGTCT
+4	134	621	345	GTTCAACAGACCTATAAACATTCTGTGCCGCGTTTCTGCACCTTTAGCGTTAAGGTACTGAATCTCTTTAGTCG
+4	134	538	358	GGTAGCTTTAAGCGGCTCACCTTTAGCATCAACAGGCTAGCTTGCAAAATACGTGGCCTTATGGTTACAGTATG
+4	134	557	250	GATATTTCTGATGAGTCGAAAAATTATCTTGATAAAGAGGATAGGTCGAATTTTCTCATTTTCCGCCAGCAGTC
+4	134	529	256	GTCAGAAAATCGAAATCATCTTCGGTTAAATCCAAAATTCAGGCTTCTGCCGTTTTGGATTTAACCGAAGATGA
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/tests/data/both.run/s_4_0134_sig2.txt	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,10 @@
+4	134	548	359	-1283 -336 19307 3126	13966 852 -500 787	12380 1656 391 828	13892 59 300 208	290 -1485 16903 1433	12151 94 201 -140	414 37 433 16989	878 628 129 16238	820 -554 16312 914	-311 -1504 16408 1792	692 364 -552 9243	-1124 -461 17825 4533	869 253 -910 11121	612 -869 992 16007	580 -1109 1077 16195	-407 14 890 22611	169 13101 1500 627	798 14246 1088 707	12609 863 674 1138	743 -1133 1218 21927	13142 582 1342 818	12647 1193 947 1655	945 689 624 17903	14405 748 1339 1066	381 104 14311 5833	12629 2452 -93 2159	757 10354 1301 2112	2421 -1136 15169 3840	754 13197 788 1166	11174 1285 1735 1659	12106 1527 1274 1974	587 9711 1390 2749	2329 82 14932 3481	1400 11729 -208 2245	1343 743 14251 4060	8901 1033 1543 2663	1356 2561 12498 3020	12359 623 -70 -734	44 11401 -1321 295	-27 742 175 11451	-1 11527 -582 21	10369 211 -1204 -368	9828 902 286 -567	9253 451 140 -25	9042 1399 1 -146	10898 -102 -118 206	221 340 11497 -90	9558 1258 -691 -830	-338 273 10566 1151	7799 1136 280 -394	613 -56 -411 9530	492 -1055 -122 10367	514 291 9914 784	871 7952 238 171	377 -397 235 7754	109 958 8615 653	453 -29 9491 737	318 6176 930 748	7264 -18 731 353	575 943 429 6926	401 710 175 8526	462 7108 251 811	7228 1139 -107 1136	623 1197 6633 1648	466 532 -27 5706	883 7302 -170 351	713 1009 6602 667	435 683 6754 2011	145 6375 586 751	1439 1281 6646 1150	4697 1223 997 475	422 5345 1435 111	787 679 1149 5866	791 1755 1299 5907
+4	134	594	276	-4171 66 18884 1459	1227 16119 -470 -3566	-1063 12554 -160 741	-3214 1854 345 17100	223 -266 -2282 16088	-1343 11498 -102 24	-2675 39 -136 19479	-813 296 14863 1812	-269 -2915 16181 2294	274 397 -2973 8089	709 111 12247 2466	13608 -2631 -500 89	-1994 -324 716 13742	729 -1332 -1324 14859	-1475 504 307 15796	-1227 223 14637 1117	1458 16246 -2103 -683	15828 -646 876 116	13708 1199 -812 -627	588 -838 12511 3509	11638 -1505 878 1123	11843 -604 1171 1499	991 12665 -1786 776	1245 -1499 12582 1583	1232 11561 -805 -75	1263 -261 14207 270	-158 956 -649 9887	9784 114 1379 1651	-1158 11159 1183 223	-2508 361 1101 15428	-1309 -949 1404 15154	11134 2770 -1820 1112	-1265 310 1050 12485	-905 127 325 14202	1017 8239 939 2612	624 -1191 9004 6266	94 11496 1303 1410	16117 -1446 111 -1554	11717 1276 119 -1713	-1166 12921 -346 -1047	631 14165 -3217 1388	671 924 -1793 9304	60 -1495 11250 1377	13293 -735 518 -2191	-1412 9069 325 157	-17 987 -1361 9182	9955 577 -1172 222	-2588 -152 175 11892	-1393 387 -133 9864	-1091 10901 -1299 358	237 11866 -55 -1769	10685 1777 -177 -1217	-907 8870 38 -109	321 -1745 166 11268	295 -613 9857 -817	-1082 11028 -1324 421	8055 1585 86 -210	11575 -2304 315 698	-1447 9237 157 919	10468 -753 0 84	11071 1148 -551 -443	431 8592 -1470 535	-762 1603 143 8432	717 780 8936 -1328	8596 1007 -1451 184	7187 984 158 662	1101 8263 -743 76	-265 604 6041 2663	205 -1198 8129 1667	6452 -1322 779 517	506 7380 -187 356	824 590 689 7524	1081 -655 7867 1219	1211 -745 7179 2692
+4	134	369	182	400 114 15629 2090	-1334 53 13854 1074	321 478 -1443 8601	11868 1195 -1546 1325	396 -1238 12646 1380	10401 -959 386 792	649 382 10371 1185	9716 706 529 -883	669 413 535 9721	505 376 565 10367	1109 9832 -1011 1287	-383 518 517 13474	-175 9484 674 611	878 573 544 10606	561 656 -1232 12311	809 474 13855 2246	595 809 651 8854	744 411 -699 16145	371 652 12215 5191	10458 33 843 1541	302 10623 771 312	9838 1573 336 307	895 869 467 13175	397 1148 1053 14689	1591 396 1200 12973	893 713 -696 15900	8727 1161 1049 1852	8181 1035 796 2209	9787 -236 873 2327	8726 638 1197 2096	1396 441 9711 3797	6910 925 1371 1621	650 720 9620 5954	1556 7744 1455 395	319 113 10705 4827	-282 543 1266 8008	1258 410 9705 5617	-1510 592 162 12467	369 8040 94 884	126 724 299 11075	401 313 8718 1981	280 -1101 10379 1418	8372 380 504 -838	9498 -1061 422 440	9205 434 378 -1108	664 6584 413 532	765 468 7611 1358	525 574 448 5428	8017 1174 -553 338	674 6304 570 632	491 738 9692 -451	562 -458 9083 1445	6003 1015 -26 -26	410 450 729 7511	421 225 642 9248	533 456 7038 1278	466 307 1048 7211	458 710 879 8284	798 6917 800 392	6365 -269 857 1250	548 645 6529 2110	772 582 830 5340	6689 791 932 441	5944 1282 231 519	333 5798 708 1108	693 822 -156 7386	733 517 -320 8314	461 1187 6441 2089	5275 132 995 1287	714 5267 855 624	765 1038 314 6578	845 4970 546 1924	4781 1316 54 1143	1181 891 1485 7020
+4	134	354	230	-18 13 15512 -1052	11471 86 -91 -997	-99 525 -486 13054	-71 12540 111 -418	455 -77 12985 -1001	419 -83 10505 1464	11363 -125 -620 -169	15936 -613 382 -1445	564 -844 9409 1027	10208 747 260 -774	460 -56 8309 663	521 10202 334 15	1013 -777 10553 3	537 -597 10841 742	1513 -862 233 8411	507 390 680 9563	1078 9759 419 -382	11589 129 965 -1939	395 436 10588 786	807 8838 1038 -615	9689 678 403 427	626 511 8935 2037	1001 -102 10303 160	6602 1217 1035 -303	8719 838 949 -720	1215 -1633 905 9815	740 527 9660 -59	912 8243 -345 2337	88 8023 519 500	711 -587 9943 1076	7665 695 -971 2074	892 489 9167 328	7012 461 1101 327	800 6923 1266 -981	1247 6966 1676 -67	525 7231 181 1402	1299 7846 2119 -177	-2314 9516 10826 547	4456 11325 1275 -6	-1005 2861 173 17443	546 16359 1039 730	152 1743 8534 9669	9722 50 9521 166	6336 10169 2036 955	7182 441 9214 905	1579 8411 7655 490	4424 648 11042 849	6841 1982 6163 -10	712 6422 1584 8296	-114 1445 7250 10561	31 1300 1655 12726	-75 13263 1972 911	7736 2554 5290 1444	-684 1410 2400 13416	7073 1942 6647 1145	-385 1367 8583 6562	4078 -566 2615 7436	766 64 12247 4169	462 -782 14306 4057	6430 -19 6083 2205	3088 -168 9379 2446	3487 513 8542 2760	5426 5476 3619 -503	1966 5270 5561 1507	2773 1308 2995 6117	1012 5540 5909 1547	748 6286 3446 2385	4692 1936 5621 1284	1355 1356 8490 3017	3944 5192 2824 554	3479 1997 6330 1788	6873 2072 2868 705	2340 -319 1590 10133	1194 7483 1215 4570
+4	134	614	269	-708 4273 18681 -1654	13008 825 462 832	484 -2345 138 16356	369 1293 132 16952	10872 4399 267 748	14879 1452 104 -1281	5011 -1593 11181 1350	-1948 14771 429 299	-770 -558 567 16385	-2219 15061 618 775	10451 489 520 659	-2265 5266 552 17531	853 266 -249 12757	9271 3535 371 398	412 -438 13435 1070	-1322 3701 13903 3713	-783 -193 12270 4725	-962 2109 736 12177	476 -1953 1247 16306	16755 -1456 1190 1078	-1526 -310 11883 4142	1753 11712 1327 1579	546 12629 1587 1149	558 -1246 808 15267	4379 8301 1600 1383	-3381 7018 12918 4020	1704 -675 7910 4638	-1530 1257 1479 9535	7161 1906 3116 1468	935 10387 1533 1381	1301 -610 11027 3933	845 -481 9843 4205	256 1697 -642 9074	4197 5605 2754 2345	6174 5297 1637 2587	1501 512 10247 1726	1189 904 8577 5220	-1455 16428 -54 -886	-113 1411 11846 -761	-2023 11843 754 -492	-272 1427 -629 11584	310 387 212 11757	197 1207 -1079 12056	-65 -1361 218 12898	941 12250 -52 -1095	-2301 5792 -1339 10773	-2875 5442 140 10607	795 295 8673 1989	-693 4561 8015 2483	333 12611 308 -288	10715 1273 424 -2368	-24 12176 -2015 2167	-1161 573 11146 2172	9276 419 214 385	135 1078 139 9264	604 467 648 9694	9668 1161 -650 1724	10522 1093 -774 2175	687 9417 553 300	1000 10781 237 -396	629 8595 2047 -137	-222 32 497 9988	499 513 8623 350	7329 1439 556 1111	-1255 2117 989 8553	9017 1447 -420 -89	1347 7000 352 1863	-129 8198 1508 803	7899 317 215 2624	6921 1113 658 1189	501 348 622 9534	8078 1165 -413 1013	8293 1060 1182 671	8854 927 172 2982
+4	134	368	209	439 -960 15508 -2087	11029 -804 113 109	158 -639 194 11613	-1290 386 -358 11902	877 -1988 -1393 11250	-1029 699 11992 837	418 -1934 11346 70	-2400 2328 137 9295	-348 9250 -43 -631	7869 270 486 1795	978 -1978 -589 14053	-1037 -278 -1679 14903	-2305 3427 11811 1587	963 -438 11133 1364	-639 -569 -391 9175	10797 -204 641 -585	11695 -1845 872 217	10049 509 17 -1648	11860 -1029 1660 -1734	-506 -190 240 12085	10960 -1309 305 -1512	874 9355 1041 -1421	1119 -129 -259 9489	-91 2250 8975 1147	9087 -490 188 49	455 6896 802 2101	1335 9691 -661 684	7766 1513 54 -1054	101 -801 8842 1781	183 7525 447 847	464 7946 406 369	-873 -626 10321 1794	539 -138 -497 7433	155 -806 606 9264	737 172 -553 9737	-20 -163 7249 3472	5905 -474 658 4020	283 -1227 207 10846	-592 -473 -1453 11481	8675 1196 -352 -1639	737 -1629 -776 9947	2657 5127 -591 -55	7625 -460 -664 -65	8682 -1499 93 -352	-421 7411 -681 -824	7434 -387 244 -855	1090 -3076 9446 538	5861 444 697 -1073	8052 -356 -1243 180	864 -1981 9229 657	359 1408 7452 -553	6015 -1499 137 164	512 -45 7307 785	820 -903 74 4059	2081 3477 220 640	-1074 539 304 7781	5862 170 2526 -1584	519 4342 224 1283	320 -977 -30 7482	1959 -891 5795 805	-237 5067 317 530	459 300 236 5799	-180 5795 -450 1089	-197 1333 6004 1216	1080 4701 634 -664	-892 1103 5890 1177	410 -289 730 4754	-151 443 817 4608	295 441 4727 943	148 5029 781 -81	86 402 6466 569	109 -159 827 4637	-1734 4710 856 1246	695 -864 1002 7143
+4	134	621	345	621 -268 18561 -1272	-1858 196 383 12866	1689 -1873 -394 16666	1679 13214 -243 754	16218 633 437 -503	14395 1567 -416 -1833	743 12437 -843 2349	12259 2497 423 462	791 -287 11779 736	12981 367 -740 -343	-97 12850 46 206	1434 12102 949 -2198	1149 -1631 285 15197	12349 1060 418 -442	781 1797 -557 14556	16207 1240 548 -1205	14092 1703 616 1199	16857 1313 -176 -553	836 15023 -1833 761	13645 -881 386 -282	-341 1217 -1221 18635	1755 -356 843 15941	-565 14476 261 1691	2116 -369 499 15304	327 713 15694 2554	-1131 583 185 13751	349 1347 12766 3720	94 11854 527 2671	-413 11555 1148 2108	1017 582 13853 1720	-1014 11572 283 1902	625 -1012 16250 3075	312 2483 -1175 11125	799 29 1438 14513	-400 984 1210 17831	614 11202 792 211	481 -811 1323 19363	-91 93 14446 -2251	27 13125 -742 -1695	13385 3169 -142 -1955	-156 11083 32 2285	779 9972 77 1695	-913 71 321 14017	-450 -905 -105 14576	-631 -422 78 13540	10697 2046 245 -1470	927 -1464 11237 2029	860 8998 158 367	515 748 11485 1180	450 285 451 8563	411 647 523 10392	10823 702 5 -2037	9289 -379 393 1017	706 -1041 11269 2259	726 439 11502 -455	420 49 427 6490	8754 -568 1071 841	1031 8545 869 -1167	891 570 -895 11839	-1112 619 11125 2341	9976 1069 -965 919	9261 614 993 1454	480 -226 1046 10988	1433 8344 955 -655	577 234 -219 10666	708 8715 56 743	556 440 333 11147	-256 573 181 11108	492 327 869 11342	7968 2371 450 580	-164 509 9129 3333	617 -411 570 7141	1059 8889 439 952	710 1439 8317 3611
+4	134	538	358	406 -2316 18416 2348	-328 75 15966 818	-561 -1199 579 10732	15377 1659 478 -581	1020 -1110 14891 2016	1397 14450 790 -1538	1043 525 737 14498	435 1151 685 15432	739 -725 699 17107	14417 -543 869 1398	11796 1840 907 1298	11 -1619 14044 3889	1842 14288 -847 1143	964 -1013 13280 2833	-123 1033 11647 2948	-366 11738 1658 1698	953 -249 1967 16391	199 11641 1531 2018	12675 1923 -484 2287	1231 9522 1493 1907	-476 13119 1797 2256	1717 1266 683 16319	936 2201 -749 15517	1071 1672 1885 13562	11531 2477 1128 1409	1324 1098 12818 4316	1525 9955 2037 2601	10465 1007 1901 2205	843 1272 604 14151	676 11137 1692 2994	11106 2621 899 1720	8567 2057 1721 3421	2184 10773 1628 973	9875 2749 1555 577	389 2007 10586 4380	1922 1292 10798 2189	2034 10734 1434 2755	573 259 224 11812	11638 605 539 778	-697 774 14413 239	626 12828 -881 201	715 589 445 13360	395 -350 362 15345	-1123 726 14127 2558	-70 10519 716 858	12919 -782 682 959	11835 245 579 877	11945 1738 517 -689	12573 280 486 664	-81 -71 790 14416	11668 1689 -1164 1153	831 10069 462 777	-831 1250 12442 2981	641 -204 395 9715	520 734 11583 1351	-151 232 10762 2370	-674 9916 1184 1219	789 8720 1265 1402	133 511 1249 13448	369 1218 1060 10741	8391 2023 1030 335	1032 327 -52 11897	519 237 10717 2974	791 750 8344 3631	-496 1110 1441 8470	622 958 682 11346	8057 937 1517 1616	2039 6677 1311 2186	6214 1431 1539 1901	1703 1595 8144 3170	1228 993 2062 6885	6629 1564 1899 1927	1779 -221 1527 9570	1371 2040 7365 3749
+4	134	557	250	2272 437 18337 1822	15317 1712 552 315	890 515 431 18495	15062 1717 463 255	1437 161 416 17800	1416 173 -136 18178	837 281 498 17596	1084 14837 411 120	789 315 536 18056	532 174 14761 4681	12395 1231 457 1353	920 770 272 17981	1364 243 13560 5777	12892 2525 453 1051	1106 668 13929 4805	1232 1172 649 12805	1886 17174 1357 1100	1614 770 15455 4609	13304 1357 865 2276	15333 1035 1415 2016	13490 3772 1262 1895	14239 2267 1364 1699	13660 2178 1006 1414	2200 513 1252 17011	2728 1084 1049 17521	15250 1263 1255 1675	1563 1561 1041 16403	1930 14694 906 2687	2213 557 820 16837	1492 1317 1095 16831	1548 906 13712 6330	13184 1879 1035 4007	1163 763 1599 17792	14484 1938 1615 3681	14481 1765 1521 3212	13161 2312 1798 3464	3100 2429 11728 6517	13377 2008 -184 1159	809 903 12412 1271	142 589 12371 966	10732 614 196 590	549 572 3 12369	12218 995 489 420	467 411 11492 2165	623 553 11218 83	609 223 394 6948	146 12757 594 581	413 599 11403 2176	10058 1915 1093 623	10213 1486 1004 379	818 980 982 11566	530 999 957 12579	690 793 948 11375	345 475 839 12157	892 10910 811 1739	369 731 852 10537	106 11251 796 1564	10175 1948 2144 763	539 1518 859 11459	776 1475 659 10522	705 914 804 10649	804 918 535 11343	741 10381 893 1749	738 10427 764 1774	667 1453 7909 4169	689 9455 673 1554	788 10330 1121 1487	8947 1951 688 2165	444 1765 7563 3097	654 8963 1144 2001	7101 2740 1215 1732	400 2094 7445 3015	1263 1514 1112 6827	1428 8865 1817 2517
+4	134	529	256	709 -217 18162 2845	-537 476 418 13561	551 15494 444 946	15216 723 400 -15	1200 -440 16093 1279	14743 1046 200 198	13817 1712 722 247	14331 1783 774 69	13724 1496 653 683	1444 254 595 13350	1345 11829 1029 298	1436 -226 14172 3868	11214 1595 530 796	13427 2393 283 577	12203 1351 879 632	1777 601 772 15138	2248 16199 877 1025	16511 774 801 648	1688 1664 876 15650	2786 14501 497 1004	1260 1037 901 16939	1904 1197 906 14842	1720 13926 888 1079	1511 1332 14030 4711	1673 1009 13933 3327	1164 1349 1640 11733	1632 1459 1787 13142	10205 2536 1450 2421	11371 627 1428 3084	11903 417 1400 2357	1075 1553 1090 14251	1590 11736 1251 2420	2282 11429 1253 3751	11771 1220 1199 2763	12368 1657 1339 2146	11136 2772 1257 1826	11449 2697 1559 2816	776 -129 -213 13455	-159 212 -5 12971	712 14121 -34 597	14149 1373 35 165	432 -651 12416 1102	5 144 12966 179	69 13013 397 430	-237 206 496 12333	-389 -346 439 14245	192 13114 318 230	263 1368 267 10737	-253 480 10277 3761	-549 12157 1182 -210	224 11900 505 -53	31 1535 11204 2827	-13 1174 577 9091	296 1023 1112 10471	-117 391 836 13558	12 958 1019 11237	-146 994 9588 5817	296 634 8384 5312	7824 522 1271 2130	123 1023 1154 9966	333 202 971 11636	818 630 708 11899	9397 1206 1056 2022	7995 1704 941 2478	1230 8049 1329 2120	1170 7241 921 2055	1093 1554 8666 3435	7054 1026 1115 1715	6411 2218 938 2222	1589 772 8448 2605	5951 1667 1249 1960	864 917 1467 8610	925 1249 7211 4482	6691 885 1803 3358
Binary file srf2fastq/io_lib-1.12.2/tests/data/both.srf has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/tests/data/proc.info	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,17 @@
+Reading archive proc.srf.
+trace_name: test_run:4:133: + 593:417 ... 539:484 x10
+trace_name: test_run:4:134: + 548:359 ... 529:256 x10
+Reading srf null index block
+Reads: GOOD : 18
+Reads: BAD : 2
+Reads: TOTAL : 20
+Chunk: BASE : 20 475
+Chunk: CNF4 : 20 842
+  Mdata key: SCALE : 20
+Chunk: SMP4 : 20 9467
+  Mdata key: OFFS : 20
+Bases: A: 411
+Bases: C: 296
+Bases: G: 367
+Bases: T: 406
+Bases: TOTAL: 1480
Binary file srf2fastq/io_lib-1.12.2/tests/data/proc.srf has changed
Binary file srf2fastq/io_lib-1.12.2/tests/data/proc.srf.indexed has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/tests/data/raw.info	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,20 @@
+Reading archive raw.srf.
+trace_name: test_run:4:133: + 593:417 ... 539:484 x10
+trace_name: test_run:4:134: + 548:359 ... 529:256 x10
+Reading srf null index block
+Reads: GOOD : 18
+Reads: BAD : 2
+Reads: TOTAL : 20
+Chunk: BASE : 20 475
+Chunk: CNF4 : 20 842
+  Mdata key: SCALE : 20
+Chunk: SMP4 : 40 17659
+  Mdata key: TYPE : 40
+    types: SLXI : 20
+    types: SLXN : 20
+  Mdata key: OFFS : 40
+Bases: A: 411
+Bases: C: 296
+Bases: G: 367
+Bases: T: 406
+Bases: TOTAL: 1480
Binary file srf2fastq/io_lib-1.12.2/tests/data/raw.srf has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/tests/data/slx-C.fasta	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,36 @@
+>test_run:4:133:593:417
+GTATAAGTCAAAGCACCTTTAGCGTTAAGGTACTGAATCTGTGCCGCGTTTCTTTGTTCCTGAGCATGGCACTA
+>test_run:4:133:587:382
+GTTGAGTTCGATAATGGTGATATGTATGTTGACGGCCGGGGGAGCACATTGTAGCATTGTGCCAATTCATCCAT
+>test_run:4:133:505:428
+GGTTGGACTTGGTGGCAAGTCTGCCGCTGATAAAGGACAGGAAATGCAGCAGCAAGATAATCACGAGTATCCTT
+>test_run:4:133:548:808
+GATTGAATCGCGAGTGGTCGGCAGATTGCGATAAACGTTGCAGTGGAATAGTCAGGTTAAATTTAATGTGACCG
+>test_run:4:133:568:418
+GTCCCCTTCGGGGCGGTGGTCTATAGTGTTATTTATAAGGCTGCTTCTGACGTTCGTGATGAGTTTGTATCTGT
+>test_run:4:133:587:489
+GTGTTCAACAGACCTATAAACATTCTGTGCCGCGTTTAGCGCAAGAGTAAACATAGTGCCATGCTCAGGAACAA
+>test_run:4:133:511:464
+GCAAATCACCAGAAGGCGGTTCCTGAATGAATGGGAATTCGTCTAAGAAGTTTAAGATTGCTGAGGGTCAGTGG
+>test_run:4:133:561:484
+GCCATAATTCAAACTTTTTTTCTGATAAGCTGGTTCTGCATTAACCGTCAAACTATCAAAATATAACGTTGACG
+>test_run:4:134:548:359
+GAAAGATTGGTGTTTTCCATAATAGACGCAACGCGAGACTCAAAAAGAGATTGCTGGCATTCAGTCGGCGACTT
+>test_run:4:134:594:276
+GCCTTCTGGTGATTTGCAAGAACGCGTACTTATTCGCAACCTGACTATTCCACTGCAACAACTGAACGGACTGG
+>test_run:4:134:369:182
+GGTAGAGATTCTCTTGTTGACATTTTAAAAGAGCGTGTCTGGAAACGTACGGATTGTTCAGTAACTTGACTCAT
+>test_run:4:134:354:230
+GATCGGAAGAGCGGTTCAGCAGGAATGCCGAGACCCCGCTCTACGCGATTTCATAGTGGAGGCGTGCGGCGATC
+>test_run:4:134:614:269
+GATTAAGCTCATTAGGGTTAGCCTCGGTACGGTCAGGCGCTTTTCTTGGCACGATTAACCCTGATACCAATAAA
+>test_run:4:134:368:209
+GATTTGGTCATTGGTAAAATACTGACCAGCCGTTTGATTATCAACAGAAGGAGTCTACTGCTCGCGTTGCGTCT
+>test_run:4:134:621:345
+GTTCAACAGACCTATAAACATTCTGTGCCGCGTTTCTGCACCTTTAGCGTTAAGGTACTGAATCTCTTTAGTCG
+>test_run:4:134:538:358
+GGTAGCTTTAAGCGGCTCACCTTTAGCATCAACAGGCTAGCTTGCAAAATACGTGGCCTTATGGTTACAGTATG
+>test_run:4:134:557:250
+GATATTTCTGATGAGTCGAAAAATTATCTTGATAAAGAGGATAGGTCGAATTTTCTCATTTTCCGCCAGCAGTC
+>test_run:4:134:529:256
+GTCAGAAAATCGAAATCATCTTCGGTTAAATCCAAAATTCAGGCTTCTGCCGTTTTGGATTTAACCGAAGATGA
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/tests/data/slx-C.fastq	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,72 @@
+@test_run:4:133:593:417
+GTATAAGTCAAAGCACCTTTAGCGTTAAGGTACTGAATCTGTGCCGCGTTTCTTTGTTCCTGAGCATGGCACTA
++
+IIIIIIIIIIIIIIIIIIIIIIIIIIIII:IIIIII?IIIIIIIIIIIIIIIIIIIIIIIII2IIIIII55@I,
+@test_run:4:133:587:382
+GTTGAGTTCGATAATGGTGATATGTATGTTGACGGCCGGGGGAGCACATTGTAGCATTGTGCCAATTCATCCAT
++
+IIIIIIIIIIIIIIIIIIIIIIIIIIIIII*<H;@7-IIIII7IIIIIIIIIII-IHIIBIII.III0:IA5:I
+@test_run:4:133:505:428
+GGTTGGACTTGGTGGCAAGTCTGCCGCTGATAAAGGACAGGAAATGCAGCAGCAAGATAATCACGAGTATCCTT
++
+IIBIIIIIIIIIIIIIIIIEDIIIAIIII1I@?-HD7IIIIIIIIIIIIIIIIIIIIIIIIIIIIII5II1:II
+@test_run:4:133:548:808
+GATTGAATCGCGAGTGGTCGGCAGATTGCGATAAACGTTGCAGTGGAATAGTCAGGTTAAATTTAATGTGACCG
++
+IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII<HIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIFIA
+@test_run:4:133:568:418
+GTCCCCTTCGGGGCGGTGGTCTATAGTGTTATTTATAAGGCTGCTTCTGACGTTCGTGATGAGTTTGTATCTGT
++
+IIIIIIIIIIIIIIII/II1,I'I+<7?DI0II$-I+IIII>IIIIIIIIIIIIIIIIIII,I7DIII-I7I+I
+@test_run:4:133:587:489
+GTGTTCAACAGACCTATAAACATTCTGTGCCGCGTTTAGCGCAAGAGTAAACATAGTGCCATGCTCAGGAACAA
++
+IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIICIIIIIIIIIIIIIIIIHIIIIII/ICII
+@test_run:4:133:511:464
+GCAAATCACCAGAAGGCGGTTCCTGAATGAATGGGAATTCGTCTAAGAAGTTTAAGATTGCTGAGGGTCAGTGG
++
+IIIIIIIIIIIIIIIIIIIIIIIIIIIIICIIII>;DIIIIIIIIIIIIIIIIIIIIIIIIIIBI3IIIIA9;B
+@test_run:4:133:561:484
+GCCATAATTCAAACTTTTTTTCTGATAAGCTGGTTCTGCATTAACCGTCAAACTATCAAAATATAACGTTGACG
++
+IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIEIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA5G>
+@test_run:4:134:548:359
+GAAAGATTGGTGTTTTCCATAATAGACGCAACGCGAGACTCAAAAAGAGATTGCTGGCATTCAGTCGGCGACTT
++
+IIIIIIIIIIIIIIIIIIIIIIIIIIIIIII>IHI=IIIIIIIIIIIIIIIIIIIIICIIIIIIFHI>FG1895
+@test_run:4:134:594:276
+GCCTTCTGGTGATTTGCAAGAACGCGTACTTATTCGCAACCTGACTATTCCACTGCAACAACTGAACGGACTGG
++
+IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII2+IIIIIIIIIIIIIIIIIIIIAIIIIIIIIGI3IIHIIA
+@test_run:4:134:369:182
+GGTAGAGATTCTCTTGTTGACATTTTAAAAGAGCGTGTCTGGAAACGTACGGATTGTTCAGTAACTTGACTCAT
++
+IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIAIIIHIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII9>I
+@test_run:4:134:354:230
+GATCGGAAGAGCGGTTCAGCAGGAATGCCGAGACCCCGCTCTACGCGATTTCATAGTGGAGGCGTGCGGCGATC
++
+IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII,IIIH(II.I5=IIIII*EIII(II$&I&I1I*III:
+@test_run:4:134:614:269
+GATTAAGCTCATTAGGGTTAGCCTCGGTACGGTCAGGCGCTTTTCTTGGCACGATTAACCCTGATACCAATAAA
++
+IIIIIIIIIIIIIBIIIIIIIIII0G6I8II@C$%I.IIIIIIIIEII=IIIIIIIIIIIIIIFII;IIHIIHI
+@test_run:4:134:368:209
+GATTTGGTCATTGGTAAAATACTGACCAGCCGTTTGATTATCAACAGAAGGAGTCTACTGCTCGCGTTGCGTCT
++
+IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII>0IIIIIIIIIIIIIIIII1IIIIIIIIIIIIIIIIC=I
+@test_run:4:134:621:345
+GTTCAACAGACCTATAAACATTCTGTGCCGCGTTTCTGCACCTTTAGCGTTAAGGTACTGAATCTCTTTAGTCG
++
+IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIGIIID
+@test_run:4:134:538:358
+GGTAGCTTTAAGCGGCTCACCTTTAGCATCAACAGGCTAGCTTGCAAAATACGTGGCCTTATGGTTACAGTATG
++
+IIIIIIIIIIIIIIIIIIIIIIIIIIHIIEI:F>;I?IIIIIIIIIIIIIIIIIIIIIIIIIIIIII4>B>:I8
+@test_run:4:134:557:250
+GATATTTCTGATGAGTCGAAAAATTATCTTGATAAAGAGGATAGGTCGAATTTTCTCATTTTCCGCCAGCAGTC
++
+IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII=IIIIIIIIIIIIIIIIIIIIIIIIIII?IIEEI4C:B
+@test_run:4:134:529:256
+GTCAGAAAATCGAAATCATCTTCGGTTAAATCCAAAATTCAGGCTTCTGCCGTTTTGGATTTAACCGAAGATGA
++
+IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII>IIIIIIIIIIIIIIIIIIIIIIIEDIIIIIIC<I>8I4I14
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/tests/data/slx.fasta	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,40 @@
+>test_run:4:133:593:417
+GTATAAGTCAAAGCACCTTTAGCGTTAAGGTACTGAATCTGTGCCGCGTTTCTTTGTTCCTGAGCATGGCACTA
+>test_run:4:133:587:382
+GTTGAGTTCGATAATGGTGATATGTATGTTGACGGCCGGGGGAGCACATTGTAGCATTGTGCCAATTCATCCAT
+>test_run:4:133:505:428
+GGTTGGACTTGGTGGCAAGTCTGCCGCTGATAAAGGACAGGAAATGCAGCAGCAAGATAATCACGAGTATCCTT
+>test_run:4:133:548:808
+GATTGAATCGCGAGTGGTCGGCAGATTGCGATAAACGTTGCAGTGGAATAGTCAGGTTAAATTTAATGTGACCG
+>test_run:4:133:568:418
+GTCCCCTTCGGGGCGGTGGTCTATAGTGTTATTTATAAGGCTGCTTCTGACGTTCGTGATGAGTTTGTATCTGT
+>test_run:4:133:587:489
+GTGTTCAACAGACCTATAAACATTCTGTGCCGCGTTTAGCGCAAGAGTAAACATAGTGCCATGCTCAGGAACAA
+>test_run:4:133:511:464
+GCAAATCACCAGAAGGCGGTTCCTGAATGAATGGGAATTCGTCTAAGAAGTTTAAGATTGCTGAGGGTCAGTGG
+>test_run:4:133:507:435
+GATATGAATAACACTATAGACAACCGCCACGATGGGGGAGGGAGTGCACCAGCCAGAGTGCGGCAAAACTGCGT
+>test_run:4:133:561:484
+GCCATAATTCAAACTTTTTTTCTGATAAGCTGGTTCTGCATTAACCGTCAAACTATCAAAATATAACGTTGACG
+>test_run:4:133:539:484
+GTAACGGCTTTAGTTTCCAAAACGAAGAACCGAGAAGAGCGCCACTTTAACAAGGATAATAACAAAGCACAAAA
+>test_run:4:134:548:359
+GAAAGATTGGTGTTTTCCATAATAGACGCAACGCGAGACTCAAAAAGAGATTGCTGGCATTCAGTCGGCGACTT
+>test_run:4:134:594:276
+GCCTTCTGGTGATTTGCAAGAACGCGTACTTATTCGCAACCTGACTATTCCACTGCAACAACTGAACGGACTGG
+>test_run:4:134:369:182
+GGTAGAGATTCTCTTGTTGACATTTTAAAAGAGCGTGTCTGGAAACGTACGGATTGTTCAGTAACTTGACTCAT
+>test_run:4:134:354:230
+GATCGGAAGAGCGGTTCAGCAGGAATGCCGAGACCCCGCTCTACGCGATTTCATAGTGGAGGCGTGCGGCGATC
+>test_run:4:134:614:269
+GATTAAGCTCATTAGGGTTAGCCTCGGTACGGTCAGGCGCTTTTCTTGGCACGATTAACCCTGATACCAATAAA
+>test_run:4:134:368:209
+GATTTGGTCATTGGTAAAATACTGACCAGCCGTTTGATTATCAACAGAAGGAGTCTACTGCTCGCGTTGCGTCT
+>test_run:4:134:621:345
+GTTCAACAGACCTATAAACATTCTGTGCCGCGTTTCTGCACCTTTAGCGTTAAGGTACTGAATCTCTTTAGTCG
+>test_run:4:134:538:358
+GGTAGCTTTAAGCGGCTCACCTTTAGCATCAACAGGCTAGCTTGCAAAATACGTGGCCTTATGGTTACAGTATG
+>test_run:4:134:557:250
+GATATTTCTGATGAGTCGAAAAATTATCTTGATAAAGAGGATAGGTCGAATTTTCTCATTTTCCGCCAGCAGTC
+>test_run:4:134:529:256
+GTCAGAAAATCGAAATCATCTTCGGTTAAATCCAAAATTCAGGCTTCTGCCGTTTTGGATTTAACCGAAGATGA
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/tests/data/slx.fastq	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,80 @@
+@test_run:4:133:593:417
+GTATAAGTCAAAGCACCTTTAGCGTTAAGGTACTGAATCTGTGCCGCGTTTCTTTGTTCCTGAGCATGGCACTA
++
+IIIIIIIIIIIIIIIIIIIIIIIIIIIII:IIIIII?IIIIIIIIIIIIIIIIIIIIIIIII2IIIIII55@I,
+@test_run:4:133:587:382
+GTTGAGTTCGATAATGGTGATATGTATGTTGACGGCCGGGGGAGCACATTGTAGCATTGTGCCAATTCATCCAT
++
+IIIIIIIIIIIIIIIIIIIIIIIIIIIIII*<H;@7-IIIII7IIIIIIIIIII-IHIIBIII.III0:IA5:I
+@test_run:4:133:505:428
+GGTTGGACTTGGTGGCAAGTCTGCCGCTGATAAAGGACAGGAAATGCAGCAGCAAGATAATCACGAGTATCCTT
++
+IIBIIIIIIIIIIIIIIIIEDIIIAIIII1I@?-HD7IIIIIIIIIIIIIIIIIIIIIIIIIIIIII5II1:II
+@test_run:4:133:548:808
+GATTGAATCGCGAGTGGTCGGCAGATTGCGATAAACGTTGCAGTGGAATAGTCAGGTTAAATTTAATGTGACCG
++
+IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII<HIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIFIA
+@test_run:4:133:568:418
+GTCCCCTTCGGGGCGGTGGTCTATAGTGTTATTTATAAGGCTGCTTCTGACGTTCGTGATGAGTTTGTATCTGT
++
+IIIIIIIIIIIIIIII/II1,I'I+<7?DI0II$-I+IIII>IIIIIIIIIIIIIIIIIII,I7DIII-I7I+I
+@test_run:4:133:587:489
+GTGTTCAACAGACCTATAAACATTCTGTGCCGCGTTTAGCGCAAGAGTAAACATAGTGCCATGCTCAGGAACAA
++
+IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIICIIIIIIIIIIIIIIIIHIIIIII/ICII
+@test_run:4:133:511:464
+GCAAATCACCAGAAGGCGGTTCCTGAATGAATGGGAATTCGTCTAAGAAGTTTAAGATTGCTGAGGGTCAGTGG
++
+IIIIIIIIIIIIIIIIIIIIIIIIIIIIICIIII>;DIIIIIIIIIIIIIIIIIIIIIIIIIIBI3IIIIA9;B
+@test_run:4:133:507:435
+GATATGAATAACACTATAGACAACCGCCACGATGGGGGAGGGAGTGCACCAGCCAGAGTGCGGCAAAACTGCGT
++
+IIIIIIIIAIIIIIII3IIIA&I*4I<I++/+4=1+/-IIIIII4,IGIIII3IIII%*III>(IID@+:F96I
+@test_run:4:133:561:484
+GCCATAATTCAAACTTTTTTTCTGATAAGCTGGTTCTGCATTAACCGTCAAACTATCAAAATATAACGTTGACG
++
+IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIEIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIA5G>
+@test_run:4:133:539:484
+GTAACGGCTTTAGTTTCCAAAACGAAGAACCGAGAAGAGCGCCACTTTAACAAGGATAATAACAAAGCACAAAA
++
+II:%)%III(1II$I&,&I+II&IIE7HI&%)%%&%(+>III+I+I;II7%I&II8I7B:II&IG;9$AID8-I
+@test_run:4:134:548:359
+GAAAGATTGGTGTTTTCCATAATAGACGCAACGCGAGACTCAAAAAGAGATTGCTGGCATTCAGTCGGCGACTT
++
+IIIIIIIIIIIIIIIIIIIIIIIIIIIIIII>IHI=IIIIIIIIIIIIIIIIIIIIICIIIIIIFHI>FG1895
+@test_run:4:134:594:276
+GCCTTCTGGTGATTTGCAAGAACGCGTACTTATTCGCAACCTGACTATTCCACTGCAACAACTGAACGGACTGG
++
+IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII2+IIIIIIIIIIIIIIIIIIIIAIIIIIIIIGI3IIHIIA
+@test_run:4:134:369:182
+GGTAGAGATTCTCTTGTTGACATTTTAAAAGAGCGTGTCTGGAAACGTACGGATTGTTCAGTAACTTGACTCAT
++
+IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIAIIIHIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII9>I
+@test_run:4:134:354:230
+GATCGGAAGAGCGGTTCAGCAGGAATGCCGAGACCCCGCTCTACGCGATTTCATAGTGGAGGCGTGCGGCGATC
++
+IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII,IIIH(II.I5=IIIII*EIII(II$&I&I1I*III:
+@test_run:4:134:614:269
+GATTAAGCTCATTAGGGTTAGCCTCGGTACGGTCAGGCGCTTTTCTTGGCACGATTAACCCTGATACCAATAAA
++
+IIIIIIIIIIIIIBIIIIIIIIII0G6I8II@C$%I.IIIIIIIIEII=IIIIIIIIIIIIIIFII;IIHIIHI
+@test_run:4:134:368:209
+GATTTGGTCATTGGTAAAATACTGACCAGCCGTTTGATTATCAACAGAAGGAGTCTACTGCTCGCGTTGCGTCT
++
+IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII>0IIIIIIIIIIIIIIIII1IIIIIIIIIIIIIIIIC=I
+@test_run:4:134:621:345
+GTTCAACAGACCTATAAACATTCTGTGCCGCGTTTCTGCACCTTTAGCGTTAAGGTACTGAATCTCTTTAGTCG
++
+IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIGIIID
+@test_run:4:134:538:358
+GGTAGCTTTAAGCGGCTCACCTTTAGCATCAACAGGCTAGCTTGCAAAATACGTGGCCTTATGGTTACAGTATG
++
+IIIIIIIIIIIIIIIIIIIIIIIIIIHIIEI:F>;I?IIIIIIIIIIIIIIIIIIIIIIIIIIIIII4>B>:I8
+@test_run:4:134:557:250
+GATATTTCTGATGAGTCGAAAAATTATCTTGATAAAGAGGATAGGTCGAATTTTCTCATTTTCCGCCAGCAGTC
++
+IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII=IIIIIIIIIIIIIIIIIIIIIIIIIII?IIEEI4C:B
+@test_run:4:134:529:256
+GTCAGAAAATCGAAATCATCTTCGGTTAAATCCAAAATTCAGGCTTCTGCCGTTTTGGATTTAACCGAAGATGA
++
+IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII>IIIIIIIIIIIIIIIIIIIIIIIEDIIIIIIC<I>8I4I14
Binary file srf2fastq/io_lib-1.12.2/tests/data/test_run_4_134_369_182.srf has changed
Binary file srf2fastq/io_lib-1.12.2/tests/data/traces.srf has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/tests/srf2fasta.test	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,20 @@
+#!/bin/sh
+if ! test -e $outdir
+then
+    mkdir $outdir
+fi
+
+$top_builddir/progs/srf2fasta $srcdir/data/proc.srf > $outdir/slx.fasta
+cmp $outdir/slx.fasta $srcdir/data/slx.fasta || exit 1
+$top_builddir/progs/srf2fasta -C $srcdir/data/proc.srf > $outdir/slx.fasta
+cmp $outdir/slx.fasta $srcdir/data/slx-C.fasta || exit 1
+
+$top_builddir/progs/srf2fasta $srcdir/data/raw.srf > $outdir/slx.fasta
+cmp $outdir/slx.fasta $srcdir/data/slx.fasta || exit 1
+$top_builddir/progs/srf2fasta -C $srcdir/data/raw.srf > $outdir/slx.fasta
+cmp $outdir/slx.fasta $srcdir/data/slx-C.fasta || exit 1
+
+$top_builddir/progs/srf2fasta $srcdir/data/both.srf > $outdir/slx.fasta
+cmp $outdir/slx.fasta $srcdir/data/slx.fasta || exit 1
+$top_builddir/progs/srf2fasta -C $srcdir/data/both.srf > $outdir/slx.fasta
+cmp $outdir/slx.fasta $srcdir/data/slx-C.fasta || exit 1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/tests/srf2fastq.test	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,15 @@
+#!/bin/sh
+$top_builddir/progs/srf2fastq $srcdir/data/proc.srf > $outdir/slx.fastq
+cmp $outdir/slx.fastq $srcdir/data/slx.fastq || exit 1
+$top_builddir/progs/srf2fastq -C $srcdir/data/proc.srf > $outdir/slx.fastq
+cmp $outdir/slx.fastq $srcdir/data/slx-C.fastq || exit 1
+
+$top_builddir/progs/srf2fastq $srcdir/data/raw.srf > $outdir/slx.fastq
+cmp $outdir/slx.fastq $srcdir/data/slx.fastq || exit 1
+$top_builddir/progs/srf2fastq -C $srcdir/data/raw.srf > $outdir/slx.fastq
+cmp $outdir/slx.fastq $srcdir/data/slx-C.fastq || exit 1
+
+$top_builddir/progs/srf2fastq $srcdir/data/both.srf > $outdir/slx.fastq
+cmp $outdir/slx.fastq $srcdir/data/slx.fastq || exit 1
+$top_builddir/progs/srf2fastq -C $srcdir/data/both.srf > $outdir/slx.fastq
+cmp $outdir/slx.fastq $srcdir/data/slx-C.fastq || exit 1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/tests/srf_filter.test	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# Filter out raw data from both.srf and we should get something similar to
+# proc.srf. Hard to verify this fully.
+$top_builddir/progs/srf_filter -m PROC $srcdir/data/both.srf $outdir/f_proc.srf
+$top_builddir/progs/srf_dump_all $srcdir/data/proc.srf > $outdir/proc.dump
+$top_builddir/progs/srf_dump_all $outdir/f_proc.srf > $outdir/f_proc.dump
+cmp $outdir/proc.dump $outdir/f_proc.dump || exit 1
+
+# Also check with srf_info to see that we have the expected number of
+# ZTR chunks
+$top_builddir/progs/srf_info $srcdir/data/proc.srf|tail -n +2|grep -v 'null index' > $outdir/proc.info
+$top_builddir/progs/srf_info $outdir/f_proc.srf|tail -n +2|grep -v 'null index' > $outdir/f_proc.info
+cmp $outdir/proc.info $outdir/f_proc.info || exit 1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/tests/srf_index.test	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,23 @@
+#!/bin/sh
+# Extract an entry using srf_extract_linear
+chmod u+w $outdir/proc.srf
+$top_builddir/progs/srf_extract_linear $outdir/proc.srf test_run:4:134:369:182 > $outdir/_.srf
+cmp $outdir/_.srf $srcdir/data/test_run_4_134_369_182.srf || exit 1
+
+# Extract using the hash table method - should fail
+echo "NB: The next line is expected to be an error message" 1>&2
+$top_builddir/progs/srf_extract_hash $outdir/proc.srf test_run:4:134:369:182 > $outdir/_.srf
+[ $? = 1 ] || exit 1
+
+# Index it
+$top_builddir/progs/srf_index_hash $outdir/proc.srf
+cmp $outdir/proc.srf $srcdir/data/proc.srf.indexed || exit 1
+
+# Extract using the hash table method
+$top_builddir/progs/srf_extract_hash $outdir/proc.srf test_run:4:134:369:182 > $outdir/_.srf
+[ $? = 0 ] || exit 1
+
+# Check the archive/name access method too
+seq=`$top_builddir/progs/extract_seq $outdir/proc.srf/test_run:4:134:369:182 | tr -d '\012\015'`
+[ "$seq" = "GGTAGAGATTCTCTTGTTGACATTTTAAAAGAGCGTGTCTGGAAACGTACGGATTGTTCAGTAACTTGACTCAT" ] || exit 1
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/io_lib-1.12.2/tests/srf_info.test	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,16 @@
+#!/bin/sh
+(cd $outdir
+cp ../$srcdir/data/proc.srf .
+../$top_builddir/progs/srf_info proc.srf | tr -d '\015' > proc.info)
+cmp $outdir/proc.info $srcdir/data/proc.info || exit 1
+
+(cd $outdir
+cp ../$srcdir/data/raw.srf .
+../$top_builddir/progs/srf_info raw.srf | tr -d '\015' > raw.info)
+cmp $outdir/raw.info $srcdir/data/raw.info || exit 1
+
+(cd $outdir
+cp ../$srcdir/data/both.srf .
+../$top_builddir/progs/srf_info both.srf | tr -d '\015' > both.info)
+cmp $outdir/both.info $srcdir/data/both.info || exit 1
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/srf2fastq.sh	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+#change this if the path is different 
+convert=/usr/local/bin/srf2fastq
+
+srf_file=$1
+use_filter=$2
+use_paired=$3
+fastq_file1=$4
+fastq_file2=$5
+options='-c '
+
+if [ $use_filter == 'Y' ]
+then
+  options="$options -C"
+fi
+
+if [ $use_paired == 'Y' ]
+then
+  options="$options -n -a -s ${fastq_file1}"
+  ${convert} ${options} ${srf_file}
+  #after conversion rename files
+  mv ${fastq_file1}_1.fastq ${fastq_file1}
+  mv ${fastq_file1}_2.fastq ${fastq_file2}
+else
+  ${convert} ${options} ${srf_file} > ${fastq_file1}
+fi
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srf2fastq/srf2fastq.xml	Tue Jun 07 17:48:05 2011 -0400
@@ -0,0 +1,37 @@
+<tool id="srf2fastq" name="SRF to FASTQ" version="1.0.1">
+  <description>conversion</description>
+  <command interpreter="sh">srf2fastq.sh $input1 $filter $paired $out_file1 $out_file2
+  </command>
+  <inputs>
+    <param name="input1" type="data" format="srf" label="Select SRF Archive"/>
+    <param name="filter" label="Filter out bad reads (QC fail)?" type="select">
+      <option value="Y" selected="True">Yes</option>
+      <option value="N">No</option>
+    </param>
+    <param name="paired" label="Is this Paired-end run?" type="select">
+      <option value="Y">Yes</option>
+      <option value="N" selected="True">No</option>
+    </param>
+  </inputs>
+  <outputs>
+      <data format="fastqsanger" name="out_file1"/>
+      <data format="fastqsanger" name="out_file2">
+         <filter>paired == "Y"</filter>
+      </data>
+  </outputs>
+<help>
+
+**What it does**
+
+Converts SRF Archives into fastq files
+
+--------
+
+**Explanation of parameters**
+
+**Filter out bad reads (QC fail)?** - QC failing reads are marked in SRF file and can be excluded in fastq generation.
+
+**Is this Paired-end run?** - Select Yes if the SRF contains paired-end data. This creates two separate fastq files.
+
+</help>
+</tool>