[DebianGIS-dev] r1077 - in packages/geotiff: . libgeotiff-dfsg libgeotiff-dfsg/trunk libgeotiff-dfsg/trunk/bin libgeotiff-dfsg/trunk/debian libgeotiff-dfsg/trunk/debian/patches libgeotiff-dfsg/trunk/docs libgeotiff-dfsg/trunk/docs/api libgeotiff-dfsg/trunk/libxtiff

frankie at alioth.debian.org frankie at alioth.debian.org
Wed Sep 19 11:39:06 UTC 2007


Author: frankie
Date: 2007-09-19 11:39:06 +0000 (Wed, 19 Sep 2007)
New Revision: 1077

Added:
   packages/geotiff/libgeotiff-dfsg/
   packages/geotiff/libgeotiff-dfsg/tags/
   packages/geotiff/libgeotiff-dfsg/trunk/
   packages/geotiff/libgeotiff-dfsg/trunk/.cvsignore
   packages/geotiff/libgeotiff-dfsg/trunk/ChangeLog
   packages/geotiff/libgeotiff-dfsg/trunk/Doxyfile
   packages/geotiff/libgeotiff-dfsg/trunk/HOWTO-RELEASE
   packages/geotiff/libgeotiff-dfsg/trunk/LICENSE
   packages/geotiff/libgeotiff-dfsg/trunk/Makefile.in
   packages/geotiff/libgeotiff-dfsg/trunk/README
   packages/geotiff/libgeotiff-dfsg/trunk/README.WIN
   packages/geotiff/libgeotiff-dfsg/trunk/README_BIN
   packages/geotiff/libgeotiff-dfsg/trunk/aclocal.m4
   packages/geotiff/libgeotiff-dfsg/trunk/bin/
   packages/geotiff/libgeotiff-dfsg/trunk/bin/.cvsignore
   packages/geotiff/libgeotiff-dfsg/trunk/bin/Makefile.in
   packages/geotiff/libgeotiff-dfsg/trunk/bin/csv2html.c
   packages/geotiff/libgeotiff-dfsg/trunk/bin/geotifcp.c
   packages/geotiff/libgeotiff-dfsg/trunk/bin/getopt.c
   packages/geotiff/libgeotiff-dfsg/trunk/bin/listgeo.c
   packages/geotiff/libgeotiff-dfsg/trunk/bin/makefile.mpw
   packages/geotiff/libgeotiff-dfsg/trunk/bin/makegeo.c
   packages/geotiff/libgeotiff-dfsg/trunk/config.guess
   packages/geotiff/libgeotiff-dfsg/trunk/config.sub
   packages/geotiff/libgeotiff-dfsg/trunk/configure
   packages/geotiff/libgeotiff-dfsg/trunk/configure.in
   packages/geotiff/libgeotiff-dfsg/trunk/cpl_csv.c
   packages/geotiff/libgeotiff-dfsg/trunk/cpl_csv_incode.c
   packages/geotiff/libgeotiff-dfsg/trunk/cpl_serv.c
   packages/geotiff/libgeotiff-dfsg/trunk/cpl_serv.h
   packages/geotiff/libgeotiff-dfsg/trunk/debian/
   packages/geotiff/libgeotiff-dfsg/trunk/debian/README.Debian
   packages/geotiff/libgeotiff-dfsg/trunk/debian/changelog
   packages/geotiff/libgeotiff-dfsg/trunk/debian/compat
   packages/geotiff/libgeotiff-dfsg/trunk/debian/control
   packages/geotiff/libgeotiff-dfsg/trunk/debian/copyright
   packages/geotiff/libgeotiff-dfsg/trunk/debian/geotiff-bin.dirs
   packages/geotiff/libgeotiff-dfsg/trunk/debian/geotiff-bin.docs
   packages/geotiff/libgeotiff-dfsg/trunk/debian/geotiff-bin.install
   packages/geotiff/libgeotiff-dfsg/trunk/debian/libgeotiff-dev.dirs
   packages/geotiff/libgeotiff-dfsg/trunk/debian/libgeotiff-dev.docs
   packages/geotiff/libgeotiff-dfsg/trunk/debian/libgeotiff-dev.install
   packages/geotiff/libgeotiff-dfsg/trunk/debian/libgeotiff1.2.dirs
   packages/geotiff/libgeotiff-dfsg/trunk/debian/libgeotiff1.2.docs
   packages/geotiff/libgeotiff-dfsg/trunk/debian/libgeotiff1.2.install
   packages/geotiff/libgeotiff-dfsg/trunk/debian/patches/
   packages/geotiff/libgeotiff-dfsg/trunk/debian/patches/00list
   packages/geotiff/libgeotiff-dfsg/trunk/debian/patches/Makefile.in.dpatch
   packages/geotiff/libgeotiff-dfsg/trunk/debian/patches/soname.dpatch
   packages/geotiff/libgeotiff-dfsg/trunk/debian/rules
   packages/geotiff/libgeotiff-dfsg/trunk/debian/watch
   packages/geotiff/libgeotiff-dfsg/trunk/defs.h
   packages/geotiff/libgeotiff-dfsg/trunk/docs/
   packages/geotiff/libgeotiff-dfsg/trunk/docs/api/
   packages/geotiff/libgeotiff-dfsg/trunk/docs/api/.cvsignore
   packages/geotiff/libgeotiff-dfsg/trunk/docs/geotifcp.html
   packages/geotiff/libgeotiff-dfsg/trunk/docs/index.dox
   packages/geotiff/libgeotiff-dfsg/trunk/docs/listgeo.html
   packages/geotiff/libgeotiff-dfsg/trunk/docs/manual.txt
   packages/geotiff/libgeotiff-dfsg/trunk/epsg_datum.inc
   packages/geotiff/libgeotiff-dfsg/trunk/epsg_ellipse.inc
   packages/geotiff/libgeotiff-dfsg/trunk/epsg_gcs.inc
   packages/geotiff/libgeotiff-dfsg/trunk/epsg_pcs.inc
   packages/geotiff/libgeotiff-dfsg/trunk/epsg_pm.inc
   packages/geotiff/libgeotiff-dfsg/trunk/epsg_proj.inc
   packages/geotiff/libgeotiff-dfsg/trunk/epsg_units.inc
   packages/geotiff/libgeotiff-dfsg/trunk/epsg_vertcs.inc
   packages/geotiff/libgeotiff-dfsg/trunk/geo_config.h.in
   packages/geotiff/libgeotiff-dfsg/trunk/geo_config.h.vc
   packages/geotiff/libgeotiff-dfsg/trunk/geo_ctrans.inc
   packages/geotiff/libgeotiff-dfsg/trunk/geo_extra.c
   packages/geotiff/libgeotiff-dfsg/trunk/geo_free.c
   packages/geotiff/libgeotiff-dfsg/trunk/geo_get.c
   packages/geotiff/libgeotiff-dfsg/trunk/geo_keyp.h
   packages/geotiff/libgeotiff-dfsg/trunk/geo_names.c
   packages/geotiff/libgeotiff-dfsg/trunk/geo_new.c
   packages/geotiff/libgeotiff-dfsg/trunk/geo_normalize.c
   packages/geotiff/libgeotiff-dfsg/trunk/geo_normalize.h
   packages/geotiff/libgeotiff-dfsg/trunk/geo_print.c
   packages/geotiff/libgeotiff-dfsg/trunk/geo_set.c
   packages/geotiff/libgeotiff-dfsg/trunk/geo_tiffp.c
   packages/geotiff/libgeotiff-dfsg/trunk/geo_tiffp.h
   packages/geotiff/libgeotiff-dfsg/trunk/geo_trans.c
   packages/geotiff/libgeotiff-dfsg/trunk/geo_write.c
   packages/geotiff/libgeotiff-dfsg/trunk/geokeys.h
   packages/geotiff/libgeotiff-dfsg/trunk/geokeys.inc
   packages/geotiff/libgeotiff-dfsg/trunk/geonames.h
   packages/geotiff/libgeotiff-dfsg/trunk/geotiff.h
   packages/geotiff/libgeotiff-dfsg/trunk/geotiff_proj4.c
   packages/geotiff/libgeotiff-dfsg/trunk/geotiffio.h
   packages/geotiff/libgeotiff-dfsg/trunk/geovalues.h
   packages/geotiff/libgeotiff-dfsg/trunk/install-sh
   packages/geotiff/libgeotiff-dfsg/trunk/libtiff_private/
   packages/geotiff/libgeotiff-dfsg/trunk/libxtiff/
   packages/geotiff/libgeotiff-dfsg/trunk/libxtiff/xtiff.c
   packages/geotiff/libgeotiff-dfsg/trunk/libxtiff/xtiffio.h
   packages/geotiff/libgeotiff-dfsg/trunk/makefile.mpw
   packages/geotiff/libgeotiff-dfsg/trunk/makefile.vc
   packages/geotiff/libgeotiff-dfsg/trunk/mkbindist.sh
   packages/geotiff/libgeotiff-dfsg/trunk/mkdist.sh
Log:
[svn-inject] Installing original source of libgeotiff-dfsg

Added: packages/geotiff/libgeotiff-dfsg/trunk/.cvsignore
===================================================================
--- packages/geotiff/libgeotiff-dfsg/trunk/.cvsignore	                        (rev 0)
+++ packages/geotiff/libgeotiff-dfsg/trunk/.cvsignore	2007-09-19 11:39:06 UTC (rev 1077)
@@ -0,0 +1,13 @@
+config.log
+geo_config.h
+config.cache
+config.status
+Makefile
+*.lib
+*.ilk
+*.pdb
+*.exp
+*.dll
+libgeotiff-*.so
+libgeotiff.so*
+

Added: packages/geotiff/libgeotiff-dfsg/trunk/ChangeLog
===================================================================
--- packages/geotiff/libgeotiff-dfsg/trunk/ChangeLog	                        (rev 0)
+++ packages/geotiff/libgeotiff-dfsg/trunk/ChangeLog	2007-09-19 11:39:06 UTC (rev 1077)
@@ -0,0 +1,660 @@
+2007-07-28  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* Issue libgeotiff 1.2.4 release.
+
+	* geo_normalize.c: Fix name for GCS_WGS_72 per gdal bug #1715.
+
+2007-07-20  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* csv/*.csv,*.c: Upgrade to EPSG 6.13.  Avoid applying pcs.override.csv
+	and gcs.override.csv to pcs.csv and gcs.csv as this sort of dataset
+	change is discouraged by the EPSG folks.
+
+	* geo_normalize.c: Pre-search pcs.override.csv and gcs.override.csv.
+
+	* cpl_csv_incode.c: Handle unexpected .csv files, and missing
+	records more gracefully.
+
+2007-06-05  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* Modified GTIFGetUOMLengthInfo() (for normalization) to have
+	built in known values for foot and us survey foot.
+
+2007-03-13  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* geotiff_proj4.c, geo_normalize.c: Added support for new zealand
+	map grid per http://bugzilla.remotesensing.org/show_bug.cgi?id=1519
+
+2007-02-04  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* Makefile.in: Fix Progs dependency so parallel makes work properly.
+	http://bugzilla.remotesensing.org/show_bug.cgi?id=1475
+
+2006-12-18  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* bin/listgeo.c: Don't report hemispheres *and* signs when using -d.
+
+2006-11-11  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* xtiff.c, xtiffio.h: Made XTIFFInitialize() public so that 
+	applications can call it themselves when using alternate opens.
+	http://bugzilla.remotesensing.org/show_bug.cgi?id=1296
+
+2006-10-18  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* Upgraded csv files to EPSG 6.11.1.
+
+2006-10-13  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* Makefile.in: Avoid running configure or autoconf automatically.
+	It is nothing but heartache.
+
+2006-07-20  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* bin/Makefile.in: Fix prefix handling.
+	http://bugzilla.remotesensing.org/show_bug.cgi?id=1245
+
+2006-06-26  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* geo_new.c: If the ascii parameters list is too short for the declared
+	  size of an ascii parameter, but it doesn't start off the end of the
+          available string then just trim the length.  This is to make the
+          ESRI sample data file 34105h2.tif work properly.  I wish we had
+          a way of issuing warnings!
+
+==============================================================================
+
+2006-03-02  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* Issuing libgeotif 1.2.3 release.
+
+2005-08-16  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* Makefile.in: Include @C_PIC@ in CFLAGS so -fPIC will be used.
+
+2005-03-15  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* geo_normalize.c: If a zero inverse flattening is encountered, 
+	interprete this as implying a semiminor axis equal to the semimajor.
+
+2005-03-03  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* geotiff_proj4.c: added CT_CylindricalEqualArea support.
+
+	* geo_normalize.c: Added CT_CylindricalEqualArea support.
+
+	* geo_ctrans.c: added CT_CyldricalEqualArea.
+
+2005-02-16  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* geo_normalize.c: check for ProjFalseOriginEastingGeoKey and
+	ProjFalseOriginNorthingGeoKey in GTIFFetchProjParms().  Otherwise
+	we miss the false easting/northing for LCC2SP when reading with
+	normalization.
+
+2004-12-16  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* aclocal.m4, Makefile.in: added MacOSX/Darwin related logic for
+	shared libraries.
+
+	* bin/Makefile.in: fixed problem in setting libdir.
+
+2004-12-01  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* geo_normalize.c: GTIFGetGCSInfo() changed to work even if an 
+	illegal PM code encountered ... as long as pm info not requested.
+	http://bugzilla.remotesensing.org/show_bug.cgi?id=698
+
+2004-11-21  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* configure.in: bug 649 - add LDFLAGS into LIBS, and ensure we
+	can link against libproj.so even if no libproj.a is provided.
+
+2004-10-19  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* geo_print.c: fixed serious bug with reporting large numbers of
+	GCPs.  Patch from Oliver Colin (ESA). 
+
+2004-07-09  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* geo_normalize.c: added 9122 as a simple degree alias in 
+	GTIFGetUOMAngleInfo().
+
+2004-06-07  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* geo_normalize.c: fallback to using gdal_datum.csv if datum.csv 
+	not found.
+
+==============================================================================
+
+2004-04-30  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* Prepare 1.2.2 release.
+
+2004-04-29  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* xtiffio.h: Avoid including cpl_serv.h, moved to geo_tiffp.h 
+	so that only libgeotiff code will end up seeing cpl_serv defines.
+
+2004-04-27  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* geo_new.c, geo_write.c, geo_print.c: Make it possible to 
+	create a GTIF information object *without* an associated TIFF *. 
+
+2004-03-23  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* cpl_csv_incode.c: include dummy version on CPLReadParseLine().
+
+	* Reconvert the EPSG 6.5 files to C.
+
+	* Wrote csv/csv2c.py for converting .csv file to .c. 
+
+	* Capture EPSG 6.5 csv files.
+
+2003-10-21  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* geo_print.c: fixed bug with long message text with embedded newlines
+	which happen to straddle the end of the message buffer when expanded
+	with escape characters.  (as reported by Leica - not in bugzilla).
+
+2003-09-23  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* geo_print.c: fixed PrintKey() to work for constant names longer
+	than the message buffer.  
+	http://bugzilla.remotesensing.org/show_bug.cgi?id=399
+
+2003-09-02  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* geo_new.c: various hacks so that with improperly terminated ascii
+	parameters such as "34737 (0x87b1) ASCII (2) 9<Mercator\0>" will 
+	still work.  eg. 1164-0.tif
+
+2003-07-08  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* geo_normalize.c, geo_print.c, geo_set.c, geo_tiffp.c, geo_trans.c, 
+	geo_write.c, geotiff_proj4.c: fix various warnings.
+
+==============================================================================
+
+2003-06-20  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* bin/Makefile.in: Removed the "prep" target for copying the geotiff
+	shared library ... not necessary with -L.. (I hope).
+
+	* configure.in: don't let -ltiff get added to LIBS multiple times. 
+
+	* Prepared 1.2.1 release
+
+2003-06-19  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* geo_new.c: Fixed bug that can corrupt memory when an invalid 
+	GeoTIFF file with a zero length ascii parms strings is read (like 
+	bruce.tif).
+
+2003-06-03  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* bin/Makefile: added -L${libdir} before $(LIBS) per suggestion by
+	Tommy Andreassen.
+
+2003-02-25  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* bin/Makefile.in: Replace $< with the object file names.  Apparently
+	this makes the makefile be compatible with Sun's make.
+
+2003-01-28  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* geo_normalize.c: Default dfInDegrees in GTIFAngleToDD().
+
+2003-01-26  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* bin/geotifcp.c: fixed bug if the metadata file specified does not
+	exist.
+
+	http://bugzilla.remotesensing.org/show_bug.cgi?id=258
+
+2003-01-20  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* cpl_csv_incode.c: fixed bug CSVGetField() which could cause
+	a crash if a missing record was requested.
+
+	* cpl_csv_incode.c, Makefile.in, csv/*: Reincorporated "incode"
+	support as per patches from Derrick. 
+
+	* cpl_serv.h: added #define for gtGetFileFieldId.
+
+	* cpl_csv.c: changed CSVFilename() to search for pcs.csv, not
+	horiz_cs.csv.
+	
+2003-01-19  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* Makefile.in, bin/Makefile.in: added dist-clean target.
+
+==============================================================================
+
+2003-01-15  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* Preparing 1.2.0 libgeotiff release.
+
+	* removed libtiff_private contents.
+
+	* geotiff.h: added LIBGEOTIFF_VERSION macro.
+
+	* geo_normalize.c/h: Added GTIFFreeMemory() for freeing memory
+	allocated by GTIF CSV lookup functions.  Added GTIFDeaccessCSV()
+	call for applications to force all CSV files to be de-cached.
+
+	* cpl_serv.h: renamed lots of CPL functions with gt prefixes using
+	macros. 
+
+2003-01-07  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* configure.in: fixed some stuff with last changes.  The --with-libtiff
+	option can now be used to give a base directory with libtiff installed
+	into /include and /lib directories under that.
+
+2003-01-02  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* configure.in: Remove logic to insert /usr/local/ in include and lib
+	path.  Remove configure switch for in-code EPSG tables since that 
+	option is broken for now.
+
+2002-12-01  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* cpl_csv.c: rewritten to support in memory caching of tables, and
+	fast searches. 
+
+	* geo_extra.c: tweaked to favor fixed EPSG codes for Kentucky North
+	(NAD83), and Tennesse (NAD27).  The original entries have incorrect
+	values. Also modified epsg_pcs.inc and epsg_proj.inc.
+
+	* geo_normalize.c: Major restructuring to use EPSG 6.2.2 database.
+
+2002-11-23  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* geo_free.c: don't read past end of keys list. Introduced by 
+	changes from Rainer.
+
+	* geo_new.c: fix memory leak of tempData.tk_asciiParams.  Introduced
+	by changes from Rainer. 
+
+2002-09-27  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* libxtiff/{xtiff.c,xtiffio.h}: Added XTIFFClientOpen() function
+	as per supplied implementation from John Novak.
+
+	http://bugzilla.remotesensing.org/show_bug.cgi?id=204
+
+	* geo_free.c, geo_names.c, geo_keyp.h, geo_new.c, geo_set.c, 
+	geo_write.c: Rainer Wiesenfarth (wiesi at ngi dot de) submitted
+	patches to support deletion, and changes to ascii tags.  To accomplish
+	this the ASCII tags are now allocated dynamically.  The
+	GTIFF_ASCIIPARAMS are split up when read, and recombined when written.
+
+2002-09-21  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* geo_names.c: added support for VerticalUnitsGeoKey as per bug 203.
+
+2002-07-19  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* bin/listgeo.c: Added -d (report corners in decimal degrees) flag
+	to listgeo as submitted by Derrick Brashear. 
+
+2002-07-09  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* geotiff_proj4.c: Fixed translation of polar stereographic to PROJ.4
+	as per http://bugzilla.remotesensing.org/show_bug.cgi?id=172.
+
+2002-06-18  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* cpl_csv.h, cpl_serv.h, cpl_csv.c, cpl_csv_incode.c, geo_normalize.c:
+	Removed the cpl_csv.h file, and merged it into cpl_serv.h.  Modified
+	all modules including cpl_csv.h to include cpl_serv.h instead.  This
+	is to avoid a conflict with the cpl_csv.h in GDAL.
+
+2002-05-31  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* geo_print.c: modified to using backslash escaping for backslashes,
+	and newlines handle newlines in citations (as occur in Erdas generated
+	files, for instance).  Also resolved some problems with processing
+	long string values though very long strings will still blow up
+	GTIFImport().
+
+	http://bugzilla.remotesensing.org/show_bug.cgi?id=139
+
+2002-02-25  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* configure.in: added setting of EXEEXT macro - allow .exe files on
+	Cygwin.
+
+	* libxtiff/xtiff.c: Rewrote to use new "custom field" interface to
+	libtiff (requires libtiff 3.6.x).   Removed xtiffiop.h.  No longer
+	a dependence on private libtiff include files.
+
+2002-02-12  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* configure.in, Makefile.in, bin/Makefile.in: extensive updates to
+	support building libgeotiff as a DLL on Cygwin.
+
+2002-02-11  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* Added CSVDeaccess() stub ... submitted by Derrick Brashear.
+
+	* README: Fixed url.
+
+2002-02-04  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* configure.in: fixed up zip/jpeg arg so that --with-jpeg will work
+	as reported by Julien Demaria.
+
+2002-01-03  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* Prepare 1.1.5 release.
+
+	* geo_normalize.c: call CSVDeaccess() at end of GTIFPrintDefn() so that
+	listgeo has closed all file handles by the end. 
+
+2001-11-28  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* geo_trans.c: fixed memory leak of transform in GTIFPCSToImage()
+	as reported by Ng Lay Keow (Nicole).
+
+2001-07-09  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* cpl_serv.c: Another bug with pszRLBuffer being freed but not set
+	to NULL.  
+
+2001-06-28  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* cpl_csv_incode.c: Use EQUAL instead of strcasecmp() to ensure code 
+	builds on windows.  As per 
+
+	http://bugzilla.remotesensing.org/show_bug.cgi?id=59
+
+2001-05-02  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* geo_set.c: modified so that a count of -1 means to delete
+	the tag from the list.
+
+2001-04-17  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* geo_normalize.c: fixed memory leaks in GTIFGetDefn().
+
+	* cpl_serv.c: Fixed failure to set pointer to NULL when freeing
+	line buffer in CPLReadLine(). 
+
+	* geo_normalize.c: added support for reading custom ellipsoid 
+	definitions.
+	
+	http://bugzilla.remotesensing.org/show_bug.cgi?id=42
+
+2001-04-06  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* listgeo.c: added -i flag to report inverse transformation results,
+	testing the PCSToImage() function.  Not documented for user though.
+
+	* GTIFPCSToImage(): added support for inverting matrix transformations.
+
+	* Fixed GTIFGetDefn() to support custom ellipsoid definition.
+
+2001-03-04  Frank Warmerdam  <warmerdam at pobox.com>
+
+	Fixed various memory leaks bugs thanks to Alan Gray. 
+	
+	* GTIFGetDefn() now calls CSVDeaccess() to avoid memory/file leaks.
+
+	* Added docs/api, and related for Doxygen generated API docs.
+
+	* Fixed memory leaks in GTIFPrintDefn() (geo_normalize.c), and
+	GTIFImageToPCS(), GTIFPCSToImage() (geo_trans.c).  
+
+2001-03-01  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* Added PCS_GGRS87_Greek_Grid for Dr. Irwin Scollar.
+
+2001-02-28  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* Added PCS_HD72_EOV to epsg_pcs.inc, and added GCS_GGRS87 to 
+	epsg_gcs.inc at the request of Prof. Dr. Irwin Scollar. 
+
+2001-02-23  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* Fixed GTIFPrintDefn() to use fprintf( fp ), instead of printf(), 
+	as per fixes from Alan Gray.
+
+2001-01-19  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* Added tiffconf.h to libtiff_private.  Secretly reissue 1.1.4 source
+	release.
+
+2001-01-17  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* Prepare 1.1.4 final release.
+
+	* Added README_BIN, and mkbindist.sh.
+
+	* Modified csv search code to include a search of 
+	share/epsg_csv and /usr/share/epsg_csv
+
+2001-01-02  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* Added support for .tfw files with rotatational coefficents in
+	geotifcp.c.
+
+	* Updated README.WIN to mention VCVARS32.BAT.
+
+2000-12-28  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* Prepare 1.1.4beta release.
+
+	* Added HOWTO-RELEASE file. 
+
+	* Removed getopt.h from geotifcp.c to build on windows.
+
+2000-12-12  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* Fix geotifcp.c to avoid u_char problems, include getopt.h.
+
+	* Made configure use "-L... -llibname" for libproj and libtiff
+	so we will use the shared library when possible.
+
+	* Fixed up Makefile.in so it works if . is not in the path.
+
+	* Added CSV_DATA_DIR define to control where to look for csv files.
+
+	Todays fixes courtesy of Dave Johnson, ddj at cascv.brown.edu and 
+	are summarized in:
+	
+	http://bugzilla.remotesensing.org/show_bug.cgi?id=29
+
+2000-12-05  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* Added cassini support in geotiff_proj4.c.
+
+	* modified geotiff_proj4.c to use +R_A to use spherical radius
+	of equal area, similar to other systems like GCTP for the
+	Miller Cylindrical and VanDerGrinten.  Should also do for any
+	other spherical projections as identified.
+
+2000-11-30  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* Fixed Makefile.in to install all the .inc files with the include
+	files.
+
+2000-11-24  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* Added configure/makefile logic to build a shared library, 
+	currently libgeotiff.so.1.1.5, and intall it with appropriate links.
+
+	* Modified configure to use --with-libtiff, and to ignore TIFF_HOME.
+	Now it is preferred to use an installed libtiff instead of one sitting
+	in a build directory.  
+
+	* Added libtiff_private directory with required libtiff include
+	files, to make it easier to build libgeotiff if only the standard
+	libtiff development environment was installed.
+
+2000-11-23  Frank Warmerdam  <warmerdam at pobox.com>
+
+	* Based loosely on suggestions from Curt Mills, I have reworked
+	the configure.in logic for PROJ.4.  I add -I/usr/local/include to 
+	CFLAGS and -L/usr/local/lib to LIBS right off the start so /usr/local
+	is included in the default search path.  The user no longer 
+	specifies the PROJ_HOME environment variable, and instead uses
+	the --with-proj configure switch.  Updated notes for building 
+	PROJ_HOME set in README.
+
+2000-10-13  Frank Warmerdam  <warmerda at cs46980-c>
+
+	* Added EquidistantConic support in PROJ.4 translation.
+
+	* Fixed order of parameters for LCC when read directly from a 
+	file to match that when read from EPSG tables.  This is now
+	always: 0-NatOriginLat, 1-NatOriginLong, 2-StdParallel1, 3-StdParallel2
+	This change is only in geo_normalize.c.
+
+2000-09-29  Frank Warmerdam  <warmerda at cs46980-c>
+
+	* Fixed bug in CPLReadLine() that primarily affects windows, and
+	SunOS 4.x.  Bug fix courtesy of shumilin at scanex.ru.
+
+2000-09-15  Frank Warmerdam  <warmerda at cs46980-c>
+
+	* Added the -proj4 option to listgeo to report it's selected
+	PROJ.4 string.
+
+	* Fixed order of parameters for LCC 2SP.  When parameters
+	were read from EPSG CSV files the standard parallels and origin
+	were mixed up.  This affects alot of state plane zones!
+
+==============================================================================
+
+2000-08-22  Frank Warmerdam  <warmerda at cs46980-c>
+
+	* Prepare 1.1.3 release.
+
+	* Added install target to makefile.  Defaults to /usr/local/...
+
+	* Added libjpeg to configure, and fixed up libjpeg/libz ordering.
+
+2000-08-21  Frank Warmerdam  <warmerda at cs46980-c>
+
+	* Removed the GTIFTiepointTranslate() code because it it badly
+	broken.
+
+2000-06-09    <warmerda at CS46980-B>
+
+	* Added knowledge of NAD27, NAD83, WGS72, WGS84, their datums,
+	  and ellipsoids. 
+
+2000-05-21  Frank Warmerdam  <warmerda at cs46980-c>
+
+	* Added -e option to geotifcp to intialize tiepoint+pixelscale
+	based on an ESRI world file. 
+
+==============================================================================
+
+Sun Feb 20 16:43:03 2000  Frank Warmerdam  <warmerda at gdal.velocet.ca>
+
+	* Prepare 1.1.2 release.
+
+Tue Jan  4 10:59:48 2000  Frank Warmerdam  <warmerda at gdal.velocet.ca>
+
+	* Fixed inclusion of geoparms in object file list at Derricks
+	  suggestion.
+
+	* Added --with-zip support to configure and makefiles at the 
+	  suggestion of Derrick Brashear.
+
+Fri Dec 10 13:24:21 1999  Frank Warmerdam  <warmerda at gdal.velocet.ca>
+
+	* Upgraded .csv and .c files to EPSG 4.4.
+
+	* Fixed bug setting the false northing for files with 
+	ProjCenterNorthingGeoKey set in GTIFGetDefn().
+
+	* Added "--with-incode-epsg" support to configure, added 
+	cpl_csv_incode.c and csv/*.c tables.
+
+Wed Sep 29 10:10:39 1999  Frank Warmerdam  <warmerda at gdal.velocet.ca>
+
+	* Upgraded CSV files to EPSG 4.3 from EPSG 4.2.  
+
+Fri Sep 17 10:53:52 1999  Frank Warmerdam  <warmerda at gdal.velocet.ca>
+
+	* Added ProjRectifiedGridAngleGeoKey(3096) and support for it's
+	  use with Oblique Mercator in geo_normalize.c.
+
+Thu Sep 16 17:22:55 1999  Frank Warmerdam  <warmerda at gdal.velocet.ca>
+
+	* Added support for pure tiepoints, and the transformation
+	matrix in GTIFImageToPCS(), and GTIFPCSToImage(). 
+
+Wed Sep 15 10:19:34 1999  Frank Warmerdam  <warmerda at gdal.velocet.ca>
+
+	* CT_TransvMercator_SouthOriented now CT_TransvMercator_SouthOrientated
+	  to match EPSG.  SouthOriented name remains as an alias.
+
+	* Fixed serious bug in geo_normalize.c with translation of
+	DD.MMSSsss values.  Return value was seriously off if any 
+	fraction of a second was included in the string.
+
+Tue Sep  7 15:57:47 1999  Frank Warmerdam  <warmerda at gdal.velocet.ca>
+
+	* Fixed count/tiepoint_count mixup in GTIFPCSToImage().  Thanks
+	  to Eric Brown of Universal Systems.
+
+Mon Jul 12 12:56:51 1999  Frank Warmerdam  <warmerda at gdal.velocet.ca>
+
+	* Made scale a parameter of CT_Stereographic.
+
+	* geotifcp modified to copy existing geotiff information by default.
+
+==============================================================================
+
+Tue May  4 09:25:12 1999  Frank Warmerdam  <warmerda at gdal.velocet.ca>
+
+	* Prepared Version 1.1.1 release.
+
+Mon May  3 14:10:30 1999  Frank Warmerdam  <warmerda at gdal.velocet.ca>
+
+	* Added corner coordinate reporting to listgeo, and made full
+	  report the default.
+
+	* Added geo_trans.c with image<->PCS transformations.
+
+	* Fixed serious bug with parsing DMSmmsss.ss coordinates from
+	  CSV files which could make many results wrong.
+
+	* Cleaned up warnings with gcc -Wall, and IRIX native compiler. 
+
+	* Added support for -Wall for GCC in when running configure. This
+	also resulted in the addition of aclocal.m4 to the dist.
+
+Wed Apr 28 14:12:25 1999  Frank Warmerdam  <warmerda at gdal.velocet.ca>
+
+	* Added geo_extra.c, for special handling of UTM and state plane 
+	map systems. 
+
+	* Changed to have api help inline with the code, and extracted with 
+	doxygen.
+
+Thu Mar 25 23:25:22 1999  Frank Warmerdam  <warmerda at gdal.velocet.ca>
+
+	* Added ChangeLog and LICENSE file to distribution.
+
+March 18
+	
+	* Added support for PROJ.4 in configure.  Added cover functions
+	for Proj.4 in geotiff_proj.c, added lat/long reporting to listgeo.c. 
+
+
+==============================================================================
+
+-- 1.1.0a Release (circa March 10, 1999) --
+
+	* This release is considered alpha (not release) quality. 
+	
+	* Includes new CSV files, ``geo_normalize'' support, and a new
+	configure script (using autoconf). 
+
+-- 1.02 Release (1995 or so) 	

Added: packages/geotiff/libgeotiff-dfsg/trunk/Doxyfile
===================================================================
--- packages/geotiff/libgeotiff-dfsg/trunk/Doxyfile	                        (rev 0)
+++ packages/geotiff/libgeotiff-dfsg/trunk/Doxyfile	2007-09-19 11:39:06 UTC (rev 1077)
@@ -0,0 +1,255 @@
+# This file describes the settings to be used by doxygen for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+#       TAG = value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# General configuration options
+#---------------------------------------------------------------------------
+
+# The PROJECT_NAME tag is a single word (or a sequence of word surrounded
+# by quotes) that should identify the project. 
+
+PROJECT_NAME         =	libgeotiff
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or 
+# if some version control system is used.
+
+PROJECT_NUMBER       =	
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
+# base path where the generated documentation will be put. 
+# If a relative path is entered, it will be relative to the location 
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY     =
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT          = docs/api
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT          =
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard header.
+
+HTML_HEADER          =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard footer.
+
+HTML_FOOTER          =
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET                = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS             = NO
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each page. A value of NO (the default) enables the index and the
+# value YES disables it.
+
+DISABLE_INDEX        = NO
+
+# If the EXTRACT_ALL tag is set to YES all classes and functions will be
+# included in the documentation, even if no documentation was available.
+
+EXTRACT_ALL          = NO
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE      = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members inside documented classes or files.
+
+HIDE_UNDOC_MEMBERS   = YES
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX       = NO
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output
+
+GENERATE_HTML        = YES
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in 
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the FULL_PATH_NAMES tag is set to YES Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used
+
+FULL_PATH_NAMES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag is used to specify the files and/or directories that contain 
+# documented source files. You may enter file names like "myfile.cpp" or 
+# directories like "/usr/src/myproject". Separate the files or directories 
+# with spaces.
+
+INPUT            =	. libxtiff/xtiff.c docs/index.dox
+
+# If the value of the INPUT tag contains directories, you can use the 
+# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank all files are included.
+
+FILE_PATTERNS    =	*.h *.cpp *.c *.dox 
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or 
+# directories that contain example code fragments that are included (see 
+# the \include command).
+
+EXAMPLE_PATH     = .
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE        = NO
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program 
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output.
+
+INPUT_FILTER     = 
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor 
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional 
+# compilation will be performed.
+
+MACRO_EXPANSION = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). In the former case 1 is used as the
+# definition.
+
+PREDEFINED =
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED tag.
+
+EXPAND_ONLY_PREDEF = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to external references 
+#---------------------------------------------------------------------------
+
+# The TAGFILES tag can be used to specify one or more tagfiles. 
+
+TAGFILES         =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS     = NO
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH        = /usr/local/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the search engine 
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be 
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE     = NO
+
+# The CGI_NAME tag should be the name of the CGI script that
+# starts the search engine (doxysearch) with the correct parameters.
+# A script with this name will be generated by doxygen.
+
+CGI_NAME         = search.cgi
+
+# The CGI_URL tag should be the absolute URL to the directory where the
+# cgi binaries are located. See the documentation of your http daemon for 
+# details.
+
+CGI_URL          =
+
+# The DOC_URL tag should be the absolute URL to the directory where the
+# documentation is located. If left blank the absolute path to the 
+# documentation, with file:// prepended to it, will be used.
+
+DOC_URL          =
+
+# The DOC_ABSPATH tag should be the absolute path to the directory where the
+# documentation is located. If left blank the directory on the local machine
+# will be used.
+
+DOC_ABSPATH      =
+
+# The BIN_ABSPATH tag must point to the directory where the doxysearch binary
+# is installed.
+
+BIN_ABSPATH      = /usr/local/bin/
+
+# The EXT_DOC_PATHS tag can be used to specify one or more paths to 
+# documentation generated for other projects. This allows doxysearch to search
+# the documentation for these projects as well.
+
+EXT_DOC_PATHS    =

Added: packages/geotiff/libgeotiff-dfsg/trunk/HOWTO-RELEASE
===================================================================
--- packages/geotiff/libgeotiff-dfsg/trunk/HOWTO-RELEASE	                        (rev 0)
+++ packages/geotiff/libgeotiff-dfsg/trunk/HOWTO-RELEASE	2007-09-19 11:39:06 UTC (rev 1077)
@@ -0,0 +1,42 @@
+	Preparing a libgeotiff Release
+	==============================
+
+ 1) Update the VERSION_MAJOR/MINOR/POINT information in configure.in.
+
+ 2) Update the LIBGEOTIFF_VERSION macro in geotiff.h.
+
+ 3) Add a note to the ChangeLog that a new release is being issued, and what
+    the release number is.
+
+ 4) Tag the release with a command like "cvs tag libgeotiff_1_1_4" from the
+    libgeotiff directory.
+
+ 5) Prepare a zip and tar.gz file using a command like "mkdist.sh 1.1.5" 
+    from within the geotiff/libgeotiff directory. 
+
+ 6) Test build and install on at least one Unix platform.  Test build on a
+    Windows system.
+
+ 7) The resulting files (eg. libgeotiff-1.1.5.tar.gz and libgeotiff115.zip) 
+    should be copied to the distribution directory (geotiff/libgeotiff on 
+    ftp.remotesensing.org).  Update the README file in that directory to 
+    indicate the new current release.
+
+ 8) Build binary distributions of libgeotiff, and utilities for various
+    Unix platforms (usually Linux, Solaris and IRIX).  This can be accomplished
+    using a command like "mkbindist.sh 1.1.5 linux -install".  The -install
+    option only works if you have scp locally, and a matching account on 
+    remotesensing.org.
+
+ 9) Build binary distribution for Windows.  Normally prepared by downloading
+    the last distribution, and overlaying the most recent .exe files, and 
+    csv files over the ones from the last distribution, and renaming things
+    based on the version number.
+
+10) Announce on GeoTIFF mailing list: geotiff at lists.maptools.org
+    Include a summary of the ChangeLog items for the most recent release.
+
+11) Update entry at http://www.freshmeat.net/projects/libgeotiff
+
+12) Update html/geotiff.html to point to most recent release, including
+    the most recent release version number.

Added: packages/geotiff/libgeotiff-dfsg/trunk/LICENSE
===================================================================
--- packages/geotiff/libgeotiff-dfsg/trunk/LICENSE	                        (rev 0)
+++ packages/geotiff/libgeotiff-dfsg/trunk/LICENSE	2007-09-19 11:39:06 UTC (rev 1077)
@@ -0,0 +1,83 @@
+
+	libgeotiff Licensing
+	====================
+
+All the source code in this toolkit are either in the public domain, or under 
+an X style license.  In any event it is all considered to be free to use
+for any purpose (including commercial software).  No credit is required 
+though some of the code requires that the specific source code modules 
+retain their existing copyright statements.  The CSV files, and other tables
+derived from the EPSG coordinate system database are also free to use.  In 
+particular, no part of this code is "copyleft", nor does it imply any 
+requirement for users to disclose this or their own source code.
+
+All components not carrying their own copyright message, but distributed
+with libgeotiff should be considered to be under the same license as
+Niles' code.
+
+---------
+
+Code by Frank Warmerdam has this copyright notice (directly copied from
+X Consortium licence):
+
+ * Copyright (c) 1999, Frank Warmerdam
+ *
+ * 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 AUTHORS OR COPYRIGHT HOLDERS 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 OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+
+-----------
+
+Code by Niles Ritter is under this licence:
+
+ *    Written By: Niles D. Ritter.
+ *
+ *  copyright (c) 1995   Niles D. Ritter
+ *
+ *  Permission granted to use this software, so long as this copyright
+ *  notice accompanies any products derived therefrom.
+
+-----------
+
+The EPSG Tables (from which the CSV files, and .inc files are derived)
+carried this statement on use of the data (from the EPSG web site):
+
+  Use of the Data 
+
+  The user assumes the entire risk as to the accuracy and the use of this 
+  data. The data may be copied and distributed subject to the following 
+  conditions: 
+
+      1.All data pertinent to a specific coordinate system must be copied 
+        without modification and all related pages must be included; 
+
+      2.All components of this data set pertinent to any given coordinate 
+        system must be distributed together (complete distribution of all 
+        components of the data set is preferred, but the EPSG recognises 
+        the need for a more limited distribution); 
+
+      3.The data may not be distributed for profit by any third party; and 
+      4.The original source [EPSG] must be acknowledged.
+
+      INFORMATION PROVIDED IN THIS DOCUMENT IS PROVIDED "AS
+      IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
+      IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+      WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
+      PARTICULAR PURPOSE. 
+
+
+

Added: packages/geotiff/libgeotiff-dfsg/trunk/Makefile.in
===================================================================
--- packages/geotiff/libgeotiff-dfsg/trunk/Makefile.in	                        (rev 0)
+++ packages/geotiff/libgeotiff-dfsg/trunk/Makefile.in	2007-09-19 11:39:06 UTC (rev 1077)
@@ -0,0 +1,214 @@
+#
+# GeoTIFF Library source for Makefile
+#
+DEPTH   = .
+
+SRCDIR  = ${DEPTH}
+
+#
+SHELL   = /bin/sh
+NULL    =
+CD      = cd
+CC      = @CC@
+AR      = ar
+LN      = @LN_S@
+AROPTS  = r
+RANLIB  = @RANLIB@
+INSTALL = @INSTALL@
+RM      = rm -f
+MAKE    = make
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+bindir	= @bindir@
+libdir	= @libdir@
+includedir = @includedir@
+datadir = @datadir@/epsg_csv
+
+BIN=${SRCDIR}/bin
+LIB_XTIFF=${SRCDIR}/libxtiff
+XTIFF=xtiff.o
+XTIFFINC= xtiffio.h
+EXEEXT=@EXEEXT@
+
+VERSION_MAJOR	=	@VERSION_MAJOR@
+VERSION_MINOR	=	@VERSION_MINOR@
+VERSION_POINT	=	@VERSION_POINT@
+
+LIBS=   @LIBS@
+GEOTIFF_SO=@GEOTIFF_SO@
+GEOTIFF_DLL=@GEOTIFF_DLL@
+GEOTIFF_IMP=@GEOTIFF_IMP@
+LD_SHARED=@LD_SHARED@
+SO_EXT=@SO_EXT@
+
+GT_INCLUDE_FILES = xtiffio.h geotiff.h geotiffio.h geovalues.h \
+	geonames.h geokeys.h geo_tiffp.h geo_config.h geo_keyp.h \
+	geo_normalize.h cpl_serv.h \
+	epsg_datum.inc epsg_gcs.inc epsg_pm.inc epsg_units.inc geo_ctrans.inc\
+	epsg_ellipse.inc epsg_pcs.inc epsg_proj.inc epsg_vertcs.inc geokeys.inc
+
+
+#
+IPATH   = -I. -I${SRCDIR} @TIFF_INC@ @PROJ_INC@
+#
+CONF_LIBRARY=\
+	${NULL}
+COPTS	= @CFLAGS@ @C_PIC@ -DCSV_DATA_DIR=\"$(datadir)\"
+CFLAGS  = ${COPTS} ${IPATH} ${CONF_LIBRARY}
+#
+SRCS    = \
+	${NULL}
+CORE_OBJS    = \
+	${XTIFF} \
+	geo_free.o \
+	geo_get.o \
+	geo_names.o \
+	geo_new.o \
+	geo_print.o \
+	geo_set.o \
+	geo_tiffp.o \
+	geo_write.o \
+	geo_trans.o \
+	geo_normalize.o \
+	geotiff_proj4.o \
+	geo_extra.o \
+	cpl_serv.o \
+	${NULL}
+
+CSV_INCODE_OBJS = \
+	cpl_csv_incode.o \
+	csv/pcs.o \
+	csv/gcs.o \
+	csv/ellipsoid.o \
+	csv/prime_meridian.o \
+	csv/datum.o \
+	csv/unit_of_measure.o \
+	csv/projop_wparm.o
+
+CSV_FILE_OBJS = \
+	cpl_csv.o
+
+# CSV_SOURCE can be either $(CSV_FILE_OBJS) or $(CSV_INCODE_OBJS)
+OBJS  =	$(CORE_OBJS) @CSV_SOURCE@
+
+TARGETS = libgeotiff.a
+
+all:    Makefile ${TARGETS} ${GEOTIFF_SO} Progs
+
+libgeotiff.a: ${OBJS}
+	${AR} ${AROPTS} libgeotiff.a $?
+	${RANLIB} libgeotiff.a
+
+$(GEOTIFF_SO): ${OBJS}
+	${LD_SHARED} ${OBJS} ${LIBS} -o $(GEOTIFF_SO)
+	rm -f libgeotiff.$(SO_EXT)
+	${LN} $(GEOTIFF_SO) libgeotiff.$(SO_EXT)
+
+Progs:	$(GEOTIFF_SO)
+	${CD} ${BIN};\
+	${MAKE}
+
+${OBJS}: ${SRCDIR}/geotiff.h ${SRCDIR}/geotiffio.h ${SRCDIR}/geo_config.h
+
+${XTIFFINC}:
+	${RM} ${XTIFFINC}
+	${LN} ${LIB_XTIFF}/*.h .
+
+${XTIFF}: ${LIB_XTIFF}/xtiff.c  ${XTIFFINC}
+	${CC} -c ${CFLAGS}  ${LIB_XTIFF}/xtiff.c
+
+geo_free.o: ${SRCDIR}/geo_free.c
+	${CC} -c ${CFLAGS} ${SRCDIR}/geo_free.c
+
+geo_get.o: ${SRCDIR}/geo_get.c
+	${CC} -c ${CFLAGS} ${SRCDIR}/geo_get.c
+
+geo_names.o: ${SRCDIR}/geo_names.c
+	${CC} -c ${CFLAGS} ${SRCDIR}/geo_names.c
+
+geo_new.o: ${SRCDIR}/geo_new.c
+	${CC} -c ${CFLAGS} ${SRCDIR}/geo_new.c
+
+geo_print.o: ${SRCDIR}/geo_print.c
+	${CC} -c ${CFLAGS} ${SRCDIR}/geo_print.c
+
+geo_set.o: ${SRCDIR}/geo_set.c
+	${CC} -c ${CFLAGS} ${SRCDIR}/geo_set.c
+
+geo_tiffp.o: ${SRCDIR}/geo_tiffp.c
+	${CC} -c ${CFLAGS} ${SRCDIR}/geo_tiffp.c
+
+geo_write.o: ${SRCDIR}/geo_write.c
+	${CC} -c ${CFLAGS} ${SRCDIR}/geo_write.c
+
+geo_trans.o: ${SRCDIR}/geo_trans.c
+	${CC} -c ${CFLAGS} ${SRCDIR}/geo_trans.c
+
+geo_normalize.o: ${SRCDIR}/geo_normalize.c
+	${CC} -c ${CFLAGS} ${SRCDIR}/geo_normalize.c
+
+geo_extra.o: ${SRCDIR}/geo_extra.c
+	${CC} -c ${CFLAGS} ${SRCDIR}/geo_extra.c
+
+cpl_csv.o: ${SRCDIR}/cpl_csv.c
+	${CC} -c ${CFLAGS} ${SRCDIR}/cpl_csv.c
+
+cpl_serv.o: ${SRCDIR}/cpl_serv.c
+	${CC} -c ${CFLAGS} ${SRCDIR}/cpl_serv.c
+
+geotiff_proj4.o: ${SRCDIR}/geotiff_proj4.c
+	${CC} -c ${CFLAGS} ${SRCDIR}/geotiff_proj4.c
+
+${SRCDIR}/csv/%.o:	${SRCDIR}/csv/%.c
+	${CC} -c ${CFLAGS} ${SRCDIR}/csv/$*.c -o ${SRCDIR}/csv/$*.o
+
+clean:
+	(cd bin; $(MAKE) clean)
+	rm -f ${TARGETS} ${OBJS} ${XTIFFINC} core a.out libgeotiff.$(SO_EXT)*
+	rm -f ${GEOTIFF_IMP} ${GEOTIFF_SO}
+
+dist-clean: clean
+	(cd bin; $(MAKE) dist-clean)
+	rm -rf config.log config.status config.cache geo_config.h
+	rm -f Makefile
+
+geo_config.h: geo_config.h.in config.status
+	./config.status
+	touch geo_config.h
+
+Makefile:	Makefile.in config.status
+	./config.status
+
+dox:
+	doxygen
+	if test -d ../../geotiff-ht/api ; then \
+	  cp docs/api/*.* ../../geotiff-ht/api; \
+	  cp docs/*.html ../../geotiff-ht; \
+	fi
+
+install:
+	$(INSTALL) -d $(DESTDIR)$(libdir)
+	$(INSTALL) libgeotiff.a $(GEOTIFF_IMP) $(DESTDIR)${libdir}
+	$(INSTALL) -d $(DESTDIR)$(includedir)
+	$(INSTALL) $(GT_INCLUDE_FILES) $(DESTDIR)$(includedir)
+	$(INSTALL) -d $(DESTDIR)$(datadir)
+	$(INSTALL) csv/*.csv $(DESTDIR)$(datadir)
+	$(INSTALL) -d $(DESTDIR)$(bindir)
+	$(INSTALL) bin/listgeo$(EXEEXT) bin/geotifcp$(EXEEXT) $(DESTDIR)$(bindir)
+	if test ! -z "$(GEOTIFF_SO)" ; then \
+		if test ! -z "$(GEOTIFF_DLL)" ; then \
+			$(INSTALL) $(GEOTIFF_SO) $(DESTDIR)${bindir}; \
+		else \
+			$(INSTALL) $(GEOTIFF_SO) $(DESTDIR)${libdir}; \
+			(cd $(DESTDIR)${libdir} ; \
+			rm -f libgeotiff.$(SO_EXT).$(VERSION_MAJOR).$(VERSION_MINOR); \
+			${LN} $(GEOTIFF_SO) libgeotiff.$(SO_EXT).$(VERSION_MAJOR).$(VERSION_MINOR); \
+			rm -f libgeotiff.$(SO_EXT).$(VERSION_MAJOR); \
+			${LN} libgeotiff.$(SO_EXT).$(VERSION_MAJOR).$(VERSION_MINOR) \
+			libgeotiff.$(SO_EXT).$(VERSION_MAJOR); \
+			rm -f libgeotiff.$(SO_EXT); \
+			${LN} libgeotiff.$(SO_EXT).$(VERSION_MAJOR) libgeotiff.$(SO_EXT); );\
+		fi;\
+	fi
+
+

Added: packages/geotiff/libgeotiff-dfsg/trunk/README
===================================================================
--- packages/geotiff/libgeotiff-dfsg/trunk/README	                        (rev 0)
+++ packages/geotiff/libgeotiff-dfsg/trunk/README	2007-09-19 11:39:06 UTC (rev 1077)
@@ -0,0 +1,192 @@
+About LIBGEOTIFF:
+-----------------
+
+This library is designed to permit the extraction and parsing of the
+"GeoTIFF" Key directories, as well as definition and installation
+of GeoTIFF keys in new files. For more information about GeoTIFF
+specifications, projection codes and use, see the WWW web page at:
+
+   http://www.remotesensing.org/geotiff/geotiff.html
+
+or at:
+
+   http://www.geotiff.org/
+   
+or the FTP archive at:
+
+   ftp://ftp.remotesensing.org/pub/geotiff
+
+or the older FTP archive at:
+
+   ftp://ftpmcmc.cr.usgs.gov/release/geotiff/jpl_mirror/
+
+
+Use of LIBTIFF
+--------------
+
+The default configuration assumes that the public-domain LIBTIFF
+package for reading and writing TIFF files has been installed, with
+the development kit (include files).  The latest version of libtiff may 
+be found at:
+
+   http://www.libtiff.org/
+   
+For this build to work you must use libtiff version v3.6.0 alpha or newer.
+
+
+Building LIBGEOTIFF:
+--------------------
+
+Assuming that whatever TIFF library you use has been built, and installed
+may now build the rest of the geotiff library with:
+
+   % cd libgeotiff
+   % ./configure
+   % make 
+
+Common Configuration Issues:
+
+ o If you want to alter the compiler used, set the CC environment variable
+   before running configure.  
+
+   % setenv CC cc
+   % rm config.status
+   % ./configure
+   % make clean 
+   % make 
+
+ o If you want to control the compiler files, set the CFLAGS environment 
+   variable.  This can be used to override the default optimization/debug
+   flags for instance.
+
+   % setenv CFLAGS -O4
+   % rm config.status
+   % ./configure
+   % make clean 
+   % make
+
+ o If you want to force use of a locally built libtiff that was never 
+   "installed" you can point to the directory like this:
+
+   % rm config.status
+   % ./configure --with-libtiff=/u/contrib/libtiff-3.6.0/libtiff
+   % make clean 
+   % make
+
+ o If you have installed libtiff in a location other than /usr, then you can
+   point to the install tree like this:
+
+   % rm config.status
+   % ./configure --with-libtiff=/usr/local
+   % make clean 
+   % make
+
+ o If you want to use EPSG tables compiled into the code, use the
+   --enable-incode-epsg configure switch.  It will make the library and
+   resulting executables substantially larger (~600K), but will avoid any 
+   configuration issues with finding the .csv files. 
+
+   % rm config.status
+   % ./configure --enable-incode-epsg
+   % make clean
+   % make
+
+ o If you want to build in support for the PROJ.4 library, so that listgeo
+   can report corner coordinates in lat/long, it may be necessary to 
+   specify the directory containing the libproj include files, and library.
+   (PROJ.4 can also be disabled by passing --without-proj).  PROJ.4 info 
+   can be found at http://www.remotesensing.org/proj .
+
+   % rm config.status
+   % ./configure --with-proj=/contrib/proj-4.4.1
+   % make clean
+   % make
+
+ o The logic to build shared libraries is pretty weak, and is likely to
+   only work on systems with the GNU tool chain (gcc, and ld) installed. 
+   On other systems you can try hacking on Makefile after running configure.
+   It may be necessary to set the GEOTIFF_SO macro to "libgeotiff.1.2.x"
+   as it is made empty by default on systems configure doesn't think can 
+   build shared libraries.
+
+
+Test Programs:
+
+There are two demonstration test programs "makegeo" and "listgeo"
+that create and list-out the GeoTIFF tags and keys associated 
+with a small TIFF file, as well as a full-featured utility called
+"geotifcp". These will all be built in the bin/ directory as a matter of 
+course, though may require modification if you are not using LIBTIFF, as they
+make explicit calls to LIBTIFF for opening the files and setting the
+tags. To run them simply call:
+
+  % bin/makegeo
+  % bin/listgeo newgeo.tif
+
+to generate and list an example GeoTIFF file. To see the
+"geotifcp" utility in action, first call:
+
+  %  bin/listgeo newgeo.tif > metadata.txt
+ 
+to create a GeoTIFF metadata file "metadata.txt", and then
+
+  %  bin/geotifcp  -g  metadata.txt  newgeo.tif  newer.tif
+ 
+to copy the TIFF file newgeo.tif to newer.tif, using the
+GeoTIFF metadata as stored in "metadata.txt". See "docs/manual.txt"
+for further uses of geotifcp.
+
+To use the new normalization capability of listgeo, the program needs
+to be able to find the CSV files.  Use something like the following, 
+but indicating the correct path to the CSV directory (libgeotiff/csv). 
+
+  % bin/listgeo -t csv -norm newgeo.tif
+
+To convert a projection metafile, an ESRI world file, and a raw TIFF file
+into a GeoTIFF file do something like the following:
+
+  % bin/tiffcp -g metadata.txt -e abc.tfw abc.tif geo_abc.tif
+
+
+ 
+Non-Standard Configuration:
+---------------------------
+
+If you are using a TIFF software package other than libtiff, then you
+must override the TIFF file methods used in LIBGEOTIFF. To do this, 
+go into directory libgeotiff and edit the files:
+
+    "geo_tiffp.h"
+    "geo_tiffp.c"
+    
+which contain all of the TIFF externals. You will need to define your
+own versions of the TIFF tag reading, writing, and memory allocation
+calls. See the comments of those two files to see what needs to be
+changed. Also, whatever software package you use will have to 
+recognize the GeoTIFF tags listed in the include files, and permit
+variable-length arrays to be passed in to those tags.
+
+
+Credits
+-------
+
+ o This library was originally written by Niles Ritter (also the primary
+   author of the GeoTIFF specification).  
+
+ o It is currently being maintained by Frank Warmerdam (warmerdam at pobox.com),
+   who also added the "normalization" capability of GTIFGetDefn() using 
+   EPSG CSV files. 
+
+ o Support for "incode" CSV files was submitted by Derrick J Brashear 
+   <shadow at dementia.org>. 
+
+ o Eric Brown of Universal Systems, who contributed a bug fix to 
+   GTIFPCSToImage().
+
+ o Safe Software (www.safe.com) who supported by upgrade to use the 
+   EPSG 6.2.2 database for libgeotiff 1.2.0.
+
+ o Many others who contributed before it occured to me to maintain credits.
+
+
+

Added: packages/geotiff/libgeotiff-dfsg/trunk/README.WIN
===================================================================
--- packages/geotiff/libgeotiff-dfsg/trunk/README.WIN	                        (rev 0)
+++ packages/geotiff/libgeotiff-dfsg/trunk/README.WIN	2007-09-19 11:39:06 UTC (rev 1077)
@@ -0,0 +1,17 @@
+    Windows Build
+    -------------
+
+Most of the notes in the README apply on Windows as well; however, to 
+configure and build follow the following steps:
+
+ o Make sure you have the required environment variables set for VC++.  Often
+   this is accomplished by running the VCVARS32.BAT file from the VC++ bin
+   directory.
+
+ o Edit makefile.vc, updating the TIFF_DIR (or TIFF_LIB and TIFF_INC) variable
+   to point to the location of the tiff build tree.
+
+ o Build using the command ``nmake -f makefile.vc''
+
+If you don't use makefile.vc, you will need to copy geo_config.h.vc to
+geo_config.h by hand. 

Added: packages/geotiff/libgeotiff-dfsg/trunk/README_BIN
===================================================================
--- packages/geotiff/libgeotiff-dfsg/trunk/README_BIN	                        (rev 0)
+++ packages/geotiff/libgeotiff-dfsg/trunk/README_BIN	2007-09-19 11:39:06 UTC (rev 1077)
@@ -0,0 +1,42 @@
+	libgeotiff Binary Distribution for Unix
+	---------------------------------------
+
+This tree contains a binary distribution of libgeotiff, and related
+utilities (listgeo, and geotifcp) for a Unix platform (as indicated in 
+the distribution filename).  
+
+The distribution should consist of:
+
+README: this file
+bin/listgeo: utility program
+bin/geotifcp: utility program
+lib/libgeotiff.a: static library for libgeotiff, applications also have
+                  to link against libtiff.
+lib/libgeotiff-$VERSION.so: Shared library version of the above.
+lib/libgeotiff.so: link to the specific shared library.
+include: The include files for libgeotiff.
+share/epsg_csv: The EPSG CSV files used to decompose projection systems.
+
+This distribution is intended to be suitable to untar directly under
+/usr/local or /usr to give a rough equivelent to having done a "make install" 
+from the libgeotiff source, though this README should be removed.
+
+If this distribution is not installed under /usr/local, it will likely be
+necessary to define the GEOTIFF_CSV environment variable to point at
+the share/epsg_csv directory.  For reporting of lat/long equivelents of
+
+
+User documentation for listgeo and geotifcp can be found at:
+
+  http://www.remotesensing.org/geotiff/listgeo.html
+  http://www.remotesensing.org/geotiff/geotifcp.html
+
+General information on libgeotiff, and GeoTIFF can be found at:
+
+  http://www.remotesensing.org/geotiff/geotiff.html 
+
+or 
+
+  http://www.geotiff.org/
+
+

Added: packages/geotiff/libgeotiff-dfsg/trunk/aclocal.m4
===================================================================
--- packages/geotiff/libgeotiff-dfsg/trunk/aclocal.m4	                        (rev 0)
+++ packages/geotiff/libgeotiff-dfsg/trunk/aclocal.m4	2007-09-19 11:39:06 UTC (rev 1077)
@@ -0,0 +1,184 @@
+AC_DEFUN(AC_COMPILER_WFLAGS,
+[
+	# Remove -g from compile flags, we will add via CFG variable if
+	# we need it.
+	CXXFLAGS=`echo "$CXXFLAGS " | sed "s/-g //"`
+	CFLAGS=`echo "$CFLAGS " | sed "s/-g //"`
+
+	# check for GNU compiler, and use -Wall
+	if test "$GCC" = "yes"; then
+		C_WFLAGS="-Wall"
+		CFLAGS="$CFLAGS -Wall"
+		AC_DEFINE(USE_GNUCC)
+	fi
+	if test "$GXX" = "yes"; then
+		CXX_WFLAGS="-Wall"
+		CXXFLAGS="$CXXFLAGS -Wall"
+		AC_DEFINE(USE_GNUCC)
+	fi
+	AC_SUBST(CXX_WFLAGS,$CXX_WFLAGS)
+	AC_SUBST(C_WFLAGS,$C_WFLAGS)
+])
+
+AC_DEFUN(AC_COMPILER_PIC,
+[
+	echo 'void f(){}' > conftest.c
+	if test -z "`${CC-cc} -fPIC -c conftest.c 2>&1`"; then
+	  C_PIC=-fPIC
+	else
+	  C_PIC=
+	fi
+	if test -z "`${CXX-g++} -fPIC -c conftest.c 2>&1`"; then
+	  CXX_PIC=-fPIC
+	else
+	  CXX_PIC=
+	fi
+	rm -f conftest*
+
+	AC_SUBST(CXX_PIC,$CXX_PIC)
+	AC_SUBST(C_PIC,$C_PIC)
+])
+
+dnl
+dnl Try to find something to link shared libraries with.  Use "c++ -shared"
+dnl in preference to "ld -shared" because it will link in required c++
+dnl run time support for us. 
+dnl
+AC_DEFUN(AC_LD_SHARED,
+[
+  echo 'void g(); int main(){ g(); return 0; }' > conftest1.c
+
+  echo '#include <stdio.h>' > conftest2.c
+  echo 'void g(); void g(){printf("");}' >> conftest2.c
+  ${CC} ${C_PIC} -c conftest2.c
+
+  SO_EXT="so"
+  export SO_EXT
+  LD_SHARED="/bin/true"
+  if test ! -z "`uname -a | grep IRIX`" ; then
+    IRIX_ALL=-all
+  else
+    IRIX_ALL=
+  fi
+
+  AC_ARG_WITH(ld-shared,[  --without-ld-shared   Disable shared library support],,)
+
+  if test "$with_ld_shared" != "" ; then
+    if test "$with_ld_shared" = "no" ; then
+      echo "user disabled shared library support."	
+    else
+      echo "using user supplied .so link command ... $with_ld_shared"	
+    fi
+    LD_SHARED="$with_ld_shared"
+  fi
+
+  dnl Check For Cygwin case.  Actually verify that the produced DLL works.
+
+  if test ! -z "`uname -a | grep CYGWIN`" \
+        -a "$LD_SHARED" = "/bin/true" \
+	-a -z "`gcc -shared conftest2.o -o libconftest.dll`" ; then
+    if test -z "`${CC} conftest1.c -L./ -lconftest -o conftest1 2>&1`"; then
+      LD_LIBRARY_PATH_OLD="$LD_LIBRARY_PATH"
+      if test -z "$LD_LIBRARY_PATH" ; then
+        LD_LIBRARY_PATH="`pwd`"
+      else
+        LD_LIBRARY_PATH="`pwd`:$LD_LIBRARY_PATH"
+      fi
+      export LD_LIBRARY_PATH
+      if test -z "`./conftest1 2>&1`" ; then
+        echo "checking for Cygwin gcc -shared ... yes"
+        LD_SHARED="c++ -shared"
+        SO_EXT="dll"
+      fi
+      LD_LIBRARY_PATH="$LD_LIBRARY_PATH_OLD"
+    fi
+  fi
+
+  dnl Test special MacOS (Darwin) case. 
+
+  if test ! -z "`uname | grep Darwin`" \
+          -a "$LD_SHARED" = "/bin/true" \
+          -a -z "`${CXX} -dynamiclib conftest2.o -o libconftest.so 2>&1`" ; then
+    ${CC} -c conftest1.c
+    if test -z "`${CXX} conftest1.o libconftest.so -o conftest1 2>&1`"; then
+      DYLD_LIBRARY_PATH_OLD="$DYLD_LIBRARY_PATH"
+      if test -z "$DYLD_LIBRARY_PATH" ; then
+        DYLD_LIBRARY_PATH="`pwd`"
+      else
+        DYLD_LIBRARY_PATH="`pwd`:$DYLD_LIBRARY_PATH"
+      fi
+      export DYLD_LIBRARY_PATH
+      if test -z "`./conftest1 2>&1`" ; then
+        echo "checking for ${CXX} -dynamiclib ... yes"
+        LD_SHARED="${CXX} -dynamiclib"
+	SO_EXT=dylib
+      fi
+      DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH_OLD"
+    fi
+    rm -f conftest1.o
+  fi
+
+  if test "$LD_SHARED" = "/bin/true" \
+	-a -z "`${CXX} -shared $IRIX_ALL conftest2.o -o libconftest.so 2>&1|grep -v WARNING`" ; then
+    if test -z "`${CC} conftest1.c libconftest.so -o conftest1 2>&1`"; then
+      LD_LIBRARY_PATH_OLD="$LD_LIBRARY_PATH"
+      if test -z "$LD_LIBRARY_PATH" ; then
+        LD_LIBRARY_PATH="`pwd`"
+      else
+        LD_LIBRARY_PATH="`pwd`:$LD_LIBRARY_PATH"
+      fi
+      export LD_LIBRARY_PATH
+      if test -z "`./conftest1 2>&1`" ; then
+        echo "checking for ${CXX} -shared ... yes"
+        LD_SHARED="${CXX} -shared $IRIX_ALL"
+      else
+        echo "checking for ${CXX} -shared ... no(3)"
+      fi
+      LD_LIBRARY_PATH="$LD_LIBRARY_PATH_OLD"
+    else
+      echo "checking for ${CXX} -shared ... no(2)"
+    fi
+  else 
+    if test "$LD_SHARED" = "/bin/true" ; then
+      echo "checking for ${CXX} -shared ... no(1)"
+    fi
+  fi
+
+  if test "$LD_SHARED" = "/bin/true" \
+          -a -z "`ld -shared conftest2.o -o libconftest.so 2>&1`" ; then
+    if test -z "`${CC} conftest1.c libconftest.so -o conftest1 2>&1`"; then
+      LD_LIBRARY_PATH_OLD="$LD_LIBRARY_PATH"
+      if test -z "$LD_LIBRARY_PATH" ; then
+        LD_LIBRARY_PATH="`pwd`"
+      else
+        LD_LIBRARY_PATH="`pwd`:$LD_LIBRARY_PATH"
+      fi
+      export LD_LIBRARY_PATH
+      if test -z "`./conftest1 2>&1`" ; then
+        echo "checking for ld -shared ... yes"
+        LD_SHARED="ld -shared"
+      fi
+      LD_LIBRARY_PATH="$LD_LIBRARY_PATH_OLD"
+    fi
+  fi
+
+  if test "$LD_SHARED" = "/bin/true" ; then
+    echo "checking for ld -shared ... no"
+    if test ! -x /bin/true ; then
+      LD_SHARED=/usr/bin/true
+    fi
+  fi
+  if test "$LD_SHARED" = "no" ; then
+    if test -x /bin/true ; then
+      LD_SHARED=/bin/true
+    else
+      LD_SHARED=/usr/bin/true
+    fi
+  fi
+
+  rm -f conftest* libconftest* 
+
+  AC_SUBST(LD_SHARED,$LD_SHARED)
+  AC_SUBST(SO_EXT,$SO_EXT)
+])
+

Added: packages/geotiff/libgeotiff-dfsg/trunk/bin/.cvsignore
===================================================================
--- packages/geotiff/libgeotiff-dfsg/trunk/bin/.cvsignore	                        (rev 0)
+++ packages/geotiff/libgeotiff-dfsg/trunk/bin/.cvsignore	2007-09-19 11:39:06 UTC (rev 1077)
@@ -0,0 +1,4 @@
+Makefile
+makegeo
+listgeo
+geotifcp

Added: packages/geotiff/libgeotiff-dfsg/trunk/bin/Makefile.in
===================================================================
--- packages/geotiff/libgeotiff-dfsg/trunk/bin/Makefile.in	                        (rev 0)
+++ packages/geotiff/libgeotiff-dfsg/trunk/bin/Makefile.in	2007-09-19 11:39:06 UTC (rev 1077)
@@ -0,0 +1,64 @@
+#
+# GeoTIFF Library source for Makefile
+#
+DEPTH	= ..
+
+GEOTIFFDIR	= $(DEPTH)
+GEOTIFF_SO=@GEOTIFF_SO@
+
+LIBS=   -L$(GEOTIFFDIR) -lgeotiff @LIBS@
+
+#
+SHELL	= /bin/sh
+NULL	=
+CC	= @CC@
+AR	= ar
+LN	= @LN_S@
+AROPTS	= r
+RANLIB	= @RANLIB@
+INSTALL	= @INSTALL@
+
+EXEEXT=@EXEEXT@
+
+prefix = @prefix@
+libdir  = @libdir@
+
+PROGS=${BIN}/makegeo$(EXEEXT) ${BIN}/listgeo$(EXEEXT) ${BIN}/geotifcp$(EXEEXT)
+
+#
+IPATH	= -I. -I${GEOTIFFDIR} @TIFF_INC@ @ZIP_INC@
+
+#
+
+COPTS	= @CFLAGS@
+CFLAGS  = ${COPTS} ${IPATH}
+#
+SRCS	= \
+	${NULL}
+OBJS	= \
+	makegeo.o \
+	listgeo.o \
+	geotifcp.o \
+	${NULL}
+
+ALL=	makegeo$(EXEEXT) listgeo$(EXEEXT) geotifcp$(EXEEXT)
+  
+all:	${ALL} 
+  
+makegeo$(EXEEXT): makegeo.o  ${GEOTIFFDIR}/libgeotiff.a
+	${CC} ${COPTS} makegeo.o -L${libdir} ${LIBS} -o $@
+  
+geotifcp$(EXEEXT): geotifcp.o  ${GEOTIFFDIR}/libgeotiff.a
+	${CC} ${COPTS} geotifcp.o -L${libdir} ${LIBS} -o $@
+  
+listgeo$(EXEEXT): listgeo.o  ${GEOTIFFDIR}/libgeotiff.a
+	${CC} ${COPTS} listgeo.o -L${libdir} ${LIBS} -o $@
+  
+csv2html$(EXEEXT): csv2html.o  ${GEOTIFFDIR}/libgeotiff.a
+	${CC} ${COPTS} csv2html.o -L${libdir} ${LIBS} -o $@
+
+clean:
+	rm -f ${ALL} ${OBJS} core a.out newgeo.tif ${GEOTIFF_SO}
+
+dist-clean: clean
+	rm -f Makefile

Added: packages/geotiff/libgeotiff-dfsg/trunk/bin/csv2html.c
===================================================================
--- packages/geotiff/libgeotiff-dfsg/trunk/bin/csv2html.c	                        (rev 0)
+++ packages/geotiff/libgeotiff-dfsg/trunk/bin/csv2html.c	2007-09-19 11:39:06 UTC (rev 1077)
@@ -0,0 +1,279 @@
+/******************************************************************************
+ * $Id: csv2html.c,v 1.3 2000/12/28 23:26:56 warmerda Exp $
+ *
+ * Project:  libgeotiff
+ * Purpose:  CGI BIN to view CSV files on the web.
+ * Author:   Frank Warmerdam, warmerda at home.com
+ *
+ ******************************************************************************
+ * Copyright (c) 1999, Frank Warmerdam
+ *
+ * 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 AUTHORS OR COPYRIGHT HOLDERS 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 OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ ******************************************************************************
+ *
+ * $Log: csv2html.c,v $
+ * Revision 1.3  2000/12/28 23:26:56  warmerda
+ * Changed to default csv path.
+ *
+ * Revision 1.2  1999/07/28 22:11:31  warmerda
+ * lots more changes
+ *
+ * Revision 1.1  1999/06/25 05:50:24  warmerda
+ * New
+ *
+ */
+
+#include "cpl_csv.h"
+
+static void
+CSV2HTML( const char * pszFilename, int nColumns, int * panColumns, char**,
+          int );
+
+/************************************************************************/
+/*                                main()                                */
+/************************************************************************/
+int main( int nArgc, char ** papszArgv )
+
+{
+    int		nColumns = 0;
+    int		*panColumnList = NULL;
+    const char *pszTable = "horiz_cs";
+    const char *pszTablePath = "/usr/local/share/epsg_csv";
+    char	**papszOptions = NULL;
+    char	szFilename[1024];
+    int		i, bSingletons = FALSE;
+
+    printf( "Content-type: text/html\n\n" );
+    
+/* -------------------------------------------------------------------- */
+/*      Parse the PATH_INFO.                                            */
+/* -------------------------------------------------------------------- */
+    if( getenv( "PATH_INFO" ) != NULL )
+    {
+        papszOptions = CSLTokenizeStringComplex( getenv("PATH_INFO") + 1,
+                                                 "/", TRUE, TRUE );
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Add commandline switch to the option list.                      */
+/* -------------------------------------------------------------------- */
+    for( i = 1; i < nArgc; i++ )
+        papszOptions = CSLAddString( papszOptions, papszArgv[i] );
+
+/* -------------------------------------------------------------------- */
+/*      Process program options.                                        */
+/* -------------------------------------------------------------------- */
+    for( i = 0; papszOptions != NULL && papszOptions[i] != NULL; i++ )
+    {
+        if( EQUALN(papszOptions[i],"FIELDS=",7) )
+        {
+            char	**papszList;
+            int		j;
+
+            papszList = CSLTokenizeStringComplex( papszOptions[i]+7, ",",
+                                                TRUE, TRUE );
+            nColumns = CSLCount( papszList );
+            panColumnList = (int *) CPLRealloc(panColumnList,
+                                               sizeof(int) * nColumns);
+
+            for( j = 0; j < nColumns; j++ )
+                panColumnList[j] = atoi(papszList[j]);
+
+            CSLDestroy( papszList );
+        }
+
+        else if( EQUALN(papszOptions[i],"TABLE=",6) )
+        {
+            pszTable = papszOptions[i] + 6;
+        }
+
+        else if( EQUALN(papszOptions[i],"CODE=",5) )
+        {
+            bSingletons = TRUE;
+        }
+
+        else if( EQUALN(papszOptions[i],"SINGLETON",6) )
+        {
+            bSingletons = TRUE;
+        }
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Derive the full filename.                                       */
+/* -------------------------------------------------------------------- */
+    sprintf( szFilename, "%s/%s.csv", pszTablePath, pszTable );
+
+/* -------------------------------------------------------------------- */
+/*      Call function to translate to HTML.                             */
+/* -------------------------------------------------------------------- */
+    CSV2HTML( szFilename, nColumns, panColumnList, papszOptions,
+              bSingletons );
+
+    return 0;
+}
+
+/************************************************************************/
+/*                              CSV2HTML()                              */
+/*                                                                      */
+/*      Translate file to HTML.                                         */
+/************************************************************************/
+
+static void
+CSV2HTML( const char * pszFilename, int nColumns, int * panColumns,
+          char ** papszOptions, int bSingletons )
+
+{
+    FILE	*fp;
+    char	**papszFields, **papszFieldNames;
+    int		iCol, nColCount;
+
+/* -------------------------------------------------------------------- */
+/*      Open the source file.                                           */
+/* -------------------------------------------------------------------- */
+    fp = VSIFOpen( pszFilename, "rt" );
+
+    if( fp == NULL )
+    {
+        perror( "fopen" );
+        return;
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Read and emit the title line specially.                         */
+/* -------------------------------------------------------------------- */
+    papszFieldNames = CSVReadParseLine( fp );
+    nColCount = CSLCount( papszFieldNames );
+
+    if( nColumns == 0 )
+    {
+        nColumns = nColCount;
+        panColumns = (int *) CPLMalloc(sizeof(int) * nColCount);
+        for( iCol = 0; iCol < nColCount; iCol++ )
+            panColumns[iCol] = iCol;
+    }
+
+    printf( "<table border>\n" );
+
+    if( !bSingletons )
+    {
+        for( iCol = 0; iCol < nColumns; iCol++ )
+        {
+            if( panColumns[iCol] < nColCount )
+            {
+                printf( "<th>%s\n", papszFieldNames[panColumns[iCol]] );
+            }
+        }
+        printf( "<tr>\n" );
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Read and emit normal records.                                   */
+/* -------------------------------------------------------------------- */
+    while( (papszFields = CSVReadParseLine( fp )) != NULL )
+    {
+        int	bDisplay=TRUE, i;
+        
+        nColCount = CSLCount( papszFields );
+
+        for( i = 0; papszOptions != NULL && papszOptions[i] != NULL; i++ )
+        {
+            if( EQUALN(papszOptions[i],"CODE=",5) )
+            {
+                if( atoi(papszOptions[i]+5) != atoi(papszFields[0]) )
+                    bDisplay = FALSE;
+            }
+            else if( EQUALN(papszOptions[i],"CODE<",5) )
+            {
+                if( atoi(papszOptions[i]+5) <= atoi(papszFields[0]) )
+                    bDisplay = FALSE;
+            }
+            else if( EQUALN(papszOptions[i],"CODE>",5) )
+            {
+                if( atoi(papszOptions[i]+5) >= atoi(papszFields[0]) )
+                    bDisplay = FALSE;
+            }
+            else if( EQUALN(papszOptions[i],"NAMEKEY=",8) )
+            {
+                if( strstr(papszFields[1],papszOptions[i]+8) == NULL )
+                    bDisplay = FALSE;
+            }
+        }
+
+        if( bDisplay )
+        {
+            for( iCol = 0; iCol < nColumns; iCol++ )
+            {
+                const char	*pszSubTable = NULL;
+                const char  *pszFieldName;
+                
+                if( panColumns[iCol] < 0
+                    || panColumns[iCol] >= nColCount )
+                    continue;
+                
+                pszFieldName = papszFieldNames[panColumns[iCol]];
+
+                if( bSingletons )
+                {
+                    printf( "<td>%s\n", pszFieldName );
+                }
+                
+
+                if( EQUAL(pszFieldName,"PRIME_MERIDIAN_CODE") )
+                    pszSubTable = "p_meridian";
+                else if( EQUAL(pszFieldName,"GEOD_DATUM_CODE") )
+                    pszSubTable = "geod_datum";
+                else if( EQUAL(pszFieldName,"UOM_LENGTH_CODE") )
+                    pszSubTable = "uom_length";
+                else if( EQUAL(pszFieldName,"UOM_ANGLE_CODE") )
+                    pszSubTable = "uom_angle";
+                else if( EQUAL(pszFieldName,"SOURCE_GEOGCS_CODE") )
+                    pszSubTable = "horiz_cs";
+                else if( EQUAL(pszFieldName,"PROJECTION_TRF_CODE") )
+                    pszSubTable = "trf_nonpolynomial";
+                else if( EQUAL(pszFieldName,"ELLIPSOID_CODE") )
+                    pszSubTable = "ellipsoid";
+                else if( EQUAL(pszFieldName,"COORD_TRF_METHOD_CODE") )
+                    pszSubTable = "trf_method";
+                
+                if( pszSubTable != NULL )
+                    printf( "<td><a href="
+                            "\"/cgi-bin/csv2html/TABLE=%s/CODE=%s/\">"
+                            "%s</a>\n",
+                            pszSubTable,papszFields[panColumns[iCol]],
+                            papszFields[panColumns[iCol]] );
+                else
+                    printf( "<td>%s\n", papszFields[panColumns[iCol]] );
+
+                if( bSingletons )
+                    printf( "<tr>\n" );
+            }
+
+            if( !bSingletons )
+                printf( "<tr>\n" );
+        }
+
+        CSLDestroy( papszFields );
+    }
+
+    printf( "</table>\n" );
+
+    CSLDestroy( papszFieldNames );
+
+    VSIFClose( fp );
+}

Added: packages/geotiff/libgeotiff-dfsg/trunk/bin/geotifcp.c
===================================================================
--- packages/geotiff/libgeotiff-dfsg/trunk/bin/geotifcp.c	                        (rev 0)
+++ packages/geotiff/libgeotiff-dfsg/trunk/bin/geotifcp.c	2007-09-19 11:39:06 UTC (rev 1077)
@@ -0,0 +1,1419 @@
+/* geotifcp.c -- based on Sam Leffler's "tiffcp" code */
+
+/*
+ *  Original code had this copyright notice: 
+ *
+ * Copyright (c) 1988-1995 Sam Leffler
+ * Copyright (c) 1991-1995 Silicon Graphics, Inc.
+ *
+ * and a lot of legal stuff denying liability for anything.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+
+/* GeoTIFF overrides */
+
+#include "geotiff.h"
+#include "geo_tiffp.h"
+#include "geo_keyp.h"
+#include "xtiffio.h"
+#include "cpl_serv.h"
+
+#define TIFFOpen XTIFFOpen
+#define TIFFClose XTIFFClose
+
+#if defined(VMS)
+#define unlink delete
+#endif
+
+#define	streq(a,b)	(strcmp(a,b) == 0)
+#define	strneq(a,b,n)	(strncmp(a,b,n) == 0)
+
+#define	TRUE	1
+#define	FALSE	0
+
+int getopt();
+
+static  int outtiled = -1;
+static  uint32 tilewidth;
+static  uint32 tilelength;
+static  int convert_8_to_4 = 0;
+
+static	uint16 config;
+static	uint16 compression;
+static	uint16 predictor;
+static	uint16 fillorder;
+static	uint32 rowsperstrip;
+static	uint32 g3opts;
+static	int ignore = FALSE;		/* if true, ignore read errors */
+static	uint32 defg3opts = (uint32) -1;
+static	int quality = 75;		/* JPEG quality */
+static	int jpegcolormode = JPEGCOLORMODE_RGB;
+static	uint16 defcompression = (uint16) -1;
+static	uint16 defpredictor = (uint16) -1;
+static 	char *geofile=(char *)0;
+static  char *worldfile=(char *)0;
+
+static  void ApplyWorldFile(const char *worldfile, TIFF *out);
+static	int tiffcp(TIFF*, TIFF*);
+static	int processCompressOptions(char*);
+static	void usage(void);
+
+
+int
+main(int argc, char* argv[])
+{
+	uint16 defconfig = (uint16) -1;
+	uint16 deffillorder = 0;
+	uint32 deftilewidth = (uint32) -1;
+	uint32 deftilelength = (uint32) -1;
+	uint32 defrowsperstrip = (uint32) -1;
+	uint32 diroff = 0;
+	TIFF* in;
+	TIFF* out;
+	const char* mode = "w";
+	int c;
+	extern int optind;
+	extern char* optarg;
+
+	while ((c = getopt(argc, argv, "c:f:l:o:p:r:w:e:g:aistd")) != -1)
+		switch (c) {
+		case 'a':		/* append to output */
+			mode = "a";
+			break;
+		case 'd':		/* down cast 8bit to 4bit */
+                        convert_8_to_4 = 1;
+			break;
+		case 'c':		/* compression scheme */
+			if (!processCompressOptions(optarg))
+				usage();
+			break;
+                case 'e':
+                        worldfile = optarg;
+                        break;
+		case 'f':		/* fill order */
+			if (streq(optarg, "lsb2msb"))
+				deffillorder = FILLORDER_LSB2MSB;
+			else if (streq(optarg, "msb2lsb"))
+				deffillorder = FILLORDER_MSB2LSB;
+			else
+				usage();
+			break;
+		case 'i':		/* ignore errors */
+			ignore = TRUE;
+			break;
+		case 'g':		/* GeoTIFF metadata file */
+			geofile = optarg;
+			break;
+		case 'l':		/* tile length */
+			outtiled = TRUE;
+			deftilelength = atoi(optarg);
+			break;
+		case 'o':		/* initial directory offset */
+			diroff = strtoul(optarg, NULL, 0);
+			break;
+		case 'p':		/* planar configuration */
+			if (streq(optarg, "separate"))
+				defconfig = PLANARCONFIG_SEPARATE;
+			else if (streq(optarg, "contig"))
+				defconfig = PLANARCONFIG_CONTIG;
+			else
+				usage();
+			break;
+		case 'r':		/* rows/strip */
+			defrowsperstrip = atoi(optarg);
+			break;
+		case 's':		/* generate stripped output */
+			outtiled = FALSE;
+			break;
+		case 't':		/* generate tiled output */
+			outtiled = TRUE;
+			break;
+		case 'w':		/* tile width */
+			outtiled = TRUE;
+			deftilewidth = atoi(optarg);
+			break;
+		case '?':
+			usage();
+			/*NOTREACHED*/
+		}
+	if (argc - optind < 2)
+		usage();
+	out = TIFFOpen(argv[argc-1], mode);
+	if (out == NULL)
+		return (-2);
+	for (; optind < argc-1 ; optind++) {
+		in = TIFFOpen(argv[optind], "r");
+		if (in == NULL)
+			return (-3);
+		if (diroff != 0 && !TIFFSetSubDirectory(in, diroff)) {
+			TIFFError(TIFFFileName(in),
+			    "Error, setting subdirectory at %#x", diroff);
+			(void) TIFFClose(out);
+			return (1);
+		}
+		do {
+			config = defconfig;
+			compression = defcompression;
+			predictor = defpredictor;
+			fillorder = deffillorder;
+			rowsperstrip = defrowsperstrip;
+			tilewidth = deftilewidth;
+			tilelength = deftilelength;
+			g3opts = defg3opts;
+			if (!tiffcp(in, out) || !TIFFWriteDirectory(out)) {
+				(void) TIFFClose(out);
+				return (1);
+			}
+		} while (TIFFReadDirectory(in));
+		(void) TIFFClose(in);
+	}
+	(void) TIFFClose(out);
+	return (0);
+}
+
+static void ApplyWorldFile(const char *worldfilename, TIFF *out)
+
+{
+    FILE	*tfw;
+    double	pixsize[3], xoff, yoff, tiepoint[6], x_rot, y_rot;
+
+    /* 
+     * Read the world file.  Note we currently ignore rotational coefficients!
+     */
+    tfw = fopen( worldfilename, "rt" );
+    if( tfw == NULL )
+    {
+        perror( worldfilename );
+        return;
+    }
+
+    fscanf( tfw, "%lf", pixsize + 0 );
+    fscanf( tfw, "%lf", &y_rot );
+    fscanf( tfw, "%lf", &x_rot );
+    fscanf( tfw, "%lf", pixsize + 1 );
+    fscanf( tfw, "%lf", &xoff );
+    fscanf( tfw, "%lf", &yoff );
+
+    fclose( tfw );
+
+    /*
+     * Write out pixel scale, and tiepoint information.
+     */
+    if( x_rot == 0.0 && y_rot == 0.0 )
+    {
+        pixsize[1] = ABS(pixsize[1]);
+        pixsize[2] = 0.0;
+        TIFFSetField(out, GTIFF_PIXELSCALE, 3, pixsize);
+
+        tiepoint[0] = 0.5;
+        tiepoint[1] = 0.5;
+        tiepoint[2] = 0.0;
+        tiepoint[3] = xoff;
+        tiepoint[4] = yoff;
+        tiepoint[5] = 0.0;
+        TIFFSetField(out, GTIFF_TIEPOINTS, 6, tiepoint);
+    }
+    else
+    {
+        double	adfMatrix[16];
+        
+        memset(adfMatrix,0,sizeof(double) * 16);
+        
+        adfMatrix[0] = pixsize[0];
+        adfMatrix[1] = x_rot;
+        adfMatrix[3] = xoff - (pixsize[0]+x_rot) * 0.5;
+        adfMatrix[4] = y_rot;
+        adfMatrix[5] = pixsize[1];
+        adfMatrix[7] = yoff - (pixsize[1]+y_rot) * 0.5;
+        adfMatrix[15] = 1.0;
+        
+        TIFFSetField( out, TIFFTAG_GEOTRANSMATRIX, 16, adfMatrix );
+    }
+}
+
+static void InstallGeoTIFF(TIFF *out)
+{
+    GTIF *gtif=(GTIF*)0; /* GeoKey-level descriptor */
+    FILE *fd;
+
+    gtif = GTIFNew(out);
+    if (!gtif)
+    {
+        printf("failed in GTIFNew\n");
+        return;
+    }
+
+    /* Install keys and tags */
+    fd = fopen(geofile,"r");
+    if( fd == NULL )
+    {
+        perror( geofile );
+        exit( -1 );
+    }
+    if (!GTIFImport(gtif,0,fd)) goto bad;
+    fclose(fd);
+    GTIFWriteKeys(gtif);
+    GTIFFree(gtif);
+    return;
+  bad:
+    fprintf(stderr,"Failure in GTIFImport\n");
+    exit (-1);
+}
+
+static void CopyGeoTIFF(TIFF * in, TIFF *out)
+{
+    GTIF *gtif=(GTIF*)0; /* GeoKey-level descriptor */
+    double *d_list = NULL;
+    int16   d_list_count;
+
+    /* read definition from source file. */
+    gtif = GTIFNew(in);
+    if (!gtif)
+        return;
+
+    if (TIFFGetField(in, GTIFF_TIEPOINTS, &d_list_count, &d_list))
+        TIFFSetField(out, GTIFF_TIEPOINTS, d_list_count, d_list);
+    if (TIFFGetField(in, GTIFF_PIXELSCALE, &d_list_count, &d_list))
+        TIFFSetField(out, GTIFF_PIXELSCALE, d_list_count, d_list);
+    if (TIFFGetField(in, GTIFF_TRANSMATRIX, &d_list_count, &d_list))
+        TIFFSetField(out, GTIFF_TRANSMATRIX, d_list_count, d_list);
+            
+    /* Here we violate the GTIF abstraction to retarget on another file.
+       We should just have a function for copying tags from one GTIF object
+       to another. */
+    gtif->gt_tif = out;
+    gtif->gt_flags |= FLAG_FILE_MODIFIED;
+
+    /* Install keys and tags */
+    GTIFWriteKeys(gtif);
+    GTIFFree(gtif);
+    return;
+}
+
+static void
+processG3Options(char* cp)
+{
+    if( (cp = strchr(cp, ':')) != NULL ) {
+        if (defg3opts == (uint32) -1)
+            defg3opts = 0;
+        do {
+            cp++;
+            if (strneq(cp, "1d", 2))
+                defg3opts &= ~GROUP3OPT_2DENCODING;
+            else if (strneq(cp, "2d", 2))
+                defg3opts |= GROUP3OPT_2DENCODING;
+            else if (strneq(cp, "fill", 4))
+                defg3opts |= GROUP3OPT_FILLBITS;
+            else
+                usage();
+        } while( (cp = strchr(cp, ':')) != NULL );
+    }
+}
+
+static int
+processCompressOptions(char* opt)
+{
+    if (streq(opt, "none"))
+        defcompression = COMPRESSION_NONE;
+    else if (streq(opt, "packbits"))
+        defcompression = COMPRESSION_PACKBITS;
+    else if (strneq(opt, "jpeg", 4)) {
+        char* cp = strchr(opt, ':');
+        if (cp && isdigit(cp[1]))
+            quality = atoi(cp+1);
+        if (cp && strchr(cp, 'r'))
+            jpegcolormode = JPEGCOLORMODE_RAW;
+        defcompression = COMPRESSION_JPEG;
+    } else if (strneq(opt, "g3", 2)) {
+        processG3Options(opt);
+        defcompression = COMPRESSION_CCITTFAX3;
+    } else if (streq(opt, "g4"))
+        defcompression = COMPRESSION_CCITTFAX4;
+    else if (strneq(opt, "lzw", 3)) {
+        char* cp = strchr(opt, ':');
+        if (cp)
+            defpredictor = atoi(cp+1);
+        defcompression = COMPRESSION_LZW;
+    } else if (strneq(opt, "zip", 3)) {
+        char* cp = strchr(opt, ':');
+        if (cp)
+            defpredictor = atoi(cp+1);
+        defcompression = COMPRESSION_DEFLATE;
+    } else
+        return (0);
+    return (1);
+}
+
+char* stuff[] = {
+"usage: gtiffcp [options] input... output",
+"where options are:",
+" -g file	install GeoTIFF metadata from <file>",
+" -e file	install positioning info from ESRI Worldfile <file>",
+" -a		append to output instead of overwriting",
+" -o offset	set initial directory offset",
+" -p contig	pack samples contiguously (e.g. RGBRGB...)",
+" -p separate	store samples separately (e.g. RRR...GGG...BBB...)",
+" -s		write output in strips",
+" -t		write output in tiles",
+" -i		ignore read errors",
+" -d		truncate 8 bitspersample to 4bitspersample",
+"",
+" -r #		make each strip have no more than # rows",
+" -w #		set output tile width (pixels)",
+" -l #		set output tile length (pixels)",
+"",
+" -f lsb2msb	force lsb-to-msb FillOrder for output",
+" -f msb2lsb	force msb-to-lsb FillOrder for output",
+"",
+" -c lzw[:opts]	compress output with Lempel-Ziv & Welch encoding",
+" -c zip[:opts]	compress output with deflate encoding",
+" -c jpeg[:opts]compress output with JPEG encoding",
+" -c packbits	compress output with packbits encoding",
+" -c g3[:opts]	compress output with CCITT Group 3 encoding",
+" -c g4		compress output with CCITT Group 4 encoding",
+" -c none	use no compression algorithm on output",
+"",
+"Group 3 options:",
+" 1d		use default CCITT Group 3 1D-encoding",
+" 2d		use optional CCITT Group 3 2D-encoding",
+" fill		byte-align EOL codes",
+"For example, -c g3:2d:fill to get G3-2D-encoded data with byte-aligned EOLs",
+"",
+"JPEG options:",
+" #		set compression quality level (0-100, default 75)",
+" r		output color image as RGB rather than YCbCr",
+"For example, -c jpeg:r:50 to get JPEG-encoded RGB data with 50% comp. quality",
+"",
+"LZW and deflate options:",
+" #		set predictor value",
+"For example, -c lzw:2 to get LZW-encoded data with horizontal differencing",
+NULL
+};
+
+static void
+usage(void)
+{
+	char buf[BUFSIZ];
+	int i;
+
+	setbuf(stderr, buf);
+	for (i = 0; stuff[i] != NULL; i++)
+		fprintf(stderr, "%s\n", stuff[i]);
+	exit(-1);
+}
+
+static void
+CheckAndCorrectColormap(TIFF* tif, int n, uint16* r, uint16* g, uint16* b)
+{
+	int i;
+
+	for (i = 0; i < n; i++)
+		if (r[i] >= 256 || g[i] >= 256 || b[i] >= 256)
+			return;
+	TIFFWarning(TIFFFileName(tif), "Scaling 8-bit colormap");
+#define	CVT(x)		(((x) * ((1L<<16)-1)) / 255)
+	for (i = 0; i < n; i++) {
+		r[i] = CVT(r[i]);
+		g[i] = CVT(g[i]);
+		b[i] = CVT(b[i]);
+	}
+#undef CVT
+}
+
+#define	CopyField(tag, v) \
+    if (TIFFGetField(in, tag, &v)) TIFFSetField(out, tag, v)
+#define	CopyField2(tag, v1, v2) \
+    if (TIFFGetField(in, tag, &v1, &v2)) TIFFSetField(out, tag, v1, v2)
+#define	CopyField3(tag, v1, v2, v3) \
+    if (TIFFGetField(in, tag, &v1, &v2, &v3)) TIFFSetField(out, tag, v1, v2, v3)
+#define	CopyField4(tag, v1, v2, v3, v4) \
+    if (TIFFGetField(in, tag, &v1, &v2, &v3, &v4)) TIFFSetField(out, tag, v1, v2, v3, v4)
+
+static struct cpTag {
+	uint16	tag;
+	uint16	count;
+	TIFFDataType type;
+} tags[] = {
+	{ TIFFTAG_SUBFILETYPE,		1, TIFF_LONG },
+	{ TIFFTAG_THRESHHOLDING,	1, TIFF_SHORT },
+	{ TIFFTAG_DOCUMENTNAME,		1, TIFF_ASCII },
+	{ TIFFTAG_IMAGEDESCRIPTION,	1, TIFF_ASCII },
+	{ TIFFTAG_MAKE,			1, TIFF_ASCII },
+	{ TIFFTAG_MODEL,		1, TIFF_ASCII },
+	{ TIFFTAG_ORIENTATION,		1, TIFF_SHORT },
+	{ TIFFTAG_MINSAMPLEVALUE,	1, TIFF_SHORT },
+	{ TIFFTAG_MAXSAMPLEVALUE,	1, TIFF_SHORT },
+	{ TIFFTAG_XRESOLUTION,		1, TIFF_RATIONAL },
+	{ TIFFTAG_YRESOLUTION,		1, TIFF_RATIONAL },
+	{ TIFFTAG_PAGENAME,		1, TIFF_ASCII },
+	{ TIFFTAG_XPOSITION,		1, TIFF_RATIONAL },
+	{ TIFFTAG_YPOSITION,		1, TIFF_RATIONAL },
+	{ TIFFTAG_GROUP4OPTIONS,	1, TIFF_LONG },
+	{ TIFFTAG_RESOLUTIONUNIT,	1, TIFF_SHORT },
+	{ TIFFTAG_PAGENUMBER,		2, TIFF_SHORT },
+	{ TIFFTAG_SOFTWARE,		1, TIFF_ASCII },
+	{ TIFFTAG_DATETIME,		1, TIFF_ASCII },
+	{ TIFFTAG_ARTIST,		1, TIFF_ASCII },
+	{ TIFFTAG_HOSTCOMPUTER,		1, TIFF_ASCII },
+	{ TIFFTAG_WHITEPOINT,		1, TIFF_RATIONAL },
+	{ TIFFTAG_PRIMARYCHROMATICITIES,(uint16) -1,TIFF_RATIONAL },
+	{ TIFFTAG_HALFTONEHINTS,	2, TIFF_SHORT },
+	{ TIFFTAG_BADFAXLINES,		1, TIFF_LONG },
+	{ TIFFTAG_CLEANFAXDATA,		1, TIFF_SHORT },
+	{ TIFFTAG_CONSECUTIVEBADFAXLINES,1, TIFF_LONG },
+	{ TIFFTAG_INKSET,		1, TIFF_SHORT },
+	{ TIFFTAG_INKNAMES,		1, TIFF_ASCII },
+	{ TIFFTAG_DOTRANGE,		2, TIFF_SHORT },
+	{ TIFFTAG_TARGETPRINTER,	1, TIFF_ASCII },
+	{ TIFFTAG_SAMPLEFORMAT,		1, TIFF_SHORT },
+	{ TIFFTAG_YCBCRCOEFFICIENTS,	(uint16) -1,TIFF_RATIONAL },
+	{ TIFFTAG_YCBCRSUBSAMPLING,	2, TIFF_SHORT },
+	{ TIFFTAG_YCBCRPOSITIONING,	1, TIFF_SHORT },
+	{ TIFFTAG_REFERENCEBLACKWHITE,	(uint16) -1,TIFF_RATIONAL },
+	{ TIFFTAG_EXTRASAMPLES,		(uint16) -1, TIFF_SHORT },
+	{ TIFFTAG_SMINSAMPLEVALUE,	1, TIFF_DOUBLE },
+	{ TIFFTAG_SMAXSAMPLEVALUE,	1, TIFF_DOUBLE },
+};
+#define	NTAGS	(sizeof (tags) / sizeof (tags[0]))
+
+static void
+cpOtherTags(TIFF* in, TIFF* out)
+{
+	struct cpTag *p;
+
+	for (p = tags; p < &tags[NTAGS]; p++)
+		switch (p->type) {
+		case TIFF_SHORT:
+			if (p->count == 1) {
+				uint16 shortv;
+				CopyField(p->tag, shortv);
+			} else if (p->count == 2) {
+				uint16 shortv1, shortv2;
+				CopyField2(p->tag, shortv1, shortv2);
+			} else if (p->count == (uint16) -1) {
+				uint16 shortv1;
+				uint16* shortav;
+				CopyField2(p->tag, shortv1, shortav);
+			}
+			break;
+		case TIFF_LONG:
+			{ uint32 longv;
+			  CopyField(p->tag, longv);
+			}
+			break;
+		case TIFF_RATIONAL:
+			if (p->count == 1) {
+				float floatv;
+				CopyField(p->tag, floatv);
+			} else if (p->count == (uint16) -1) {
+				float* floatav;
+				CopyField(p->tag, floatav);
+			}
+			break;
+		case TIFF_ASCII:
+			{ char* stringv;
+			  CopyField(p->tag, stringv);
+			}
+			break;
+		case TIFF_DOUBLE:
+			if (p->count == 1) {
+				double doublev;
+				CopyField(p->tag, doublev);
+			} else if (p->count == (uint16) -1) {
+				double* doubleav;
+				CopyField(p->tag, doubleav);
+			}
+			break;
+                default:
+	                break;
+		}
+}
+
+typedef int (*copyFunc)
+    (TIFF* in, TIFF* out, uint32 l, uint32 w, uint16 samplesperpixel);
+static	copyFunc pickCopyFunc(TIFF*, TIFF*, uint16, uint16);
+
+static int
+tiffcp(TIFF* in, TIFF* out)
+{
+	uint16 bitspersample, samplesperpixel, shortv;
+	copyFunc cf;
+	uint32 w, l;
+
+	CopyField(TIFFTAG_IMAGEWIDTH, w);
+	CopyField(TIFFTAG_IMAGELENGTH, l);
+        if( convert_8_to_4 )
+        {
+            TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, 4);
+        }
+        else
+        {
+            CopyField(TIFFTAG_BITSPERSAMPLE, bitspersample);
+        }
+	if (compression != (uint16)-1)
+		TIFFSetField(out, TIFFTAG_COMPRESSION, compression);
+	else
+		CopyField(TIFFTAG_COMPRESSION, compression);
+	if (compression == COMPRESSION_JPEG && jpegcolormode == JPEGCOLORMODE_RGB)
+		TIFFSetField(out, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_YCBCR);
+	else
+		CopyField(TIFFTAG_PHOTOMETRIC, shortv);
+	if (fillorder != 0)
+		TIFFSetField(out, TIFFTAG_FILLORDER, fillorder);
+	else
+		CopyField(TIFFTAG_FILLORDER, shortv);
+	CopyField(TIFFTAG_SAMPLESPERPIXEL, samplesperpixel);
+	/*
+	 * Choose tiles/strip for the output image according to
+	 * the command line arguments (-tiles, -strips) and the
+	 * structure of the input image.
+	 */
+	if (outtiled == -1)
+		outtiled = TIFFIsTiled(in);
+	if (outtiled) {
+		/*
+		 * Setup output file's tile width&height.  If either
+		 * is not specified, use either the value from the
+		 * input image or, if nothing is defined, use the
+		 * library default.
+		 */
+		if (tilewidth == (uint32) -1)
+			TIFFGetField(in, TIFFTAG_TILEWIDTH, &tilewidth);
+		if (tilelength == (uint32) -1)
+			TIFFGetField(in, TIFFTAG_TILELENGTH, &tilelength);
+		TIFFDefaultTileSize(out, &tilewidth, &tilelength);
+		TIFFSetField(out, TIFFTAG_TILEWIDTH, tilewidth);
+		TIFFSetField(out, TIFFTAG_TILELENGTH, tilelength);
+	} else {
+		/*
+		 * RowsPerStrip is left unspecified: use either the
+		 * value from the input image or, if nothing is defined,
+		 * use the library default.
+		 */
+		if (rowsperstrip == (uint32) -1)
+			TIFFGetField(in, TIFFTAG_ROWSPERSTRIP, &rowsperstrip);
+		rowsperstrip = TIFFDefaultStripSize(out, rowsperstrip);
+		TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, rowsperstrip);
+	}
+	if (config != (uint16) -1)
+		TIFFSetField(out, TIFFTAG_PLANARCONFIG, config);
+	else
+		CopyField(TIFFTAG_PLANARCONFIG, config);
+	if (g3opts != (uint32) -1)
+		TIFFSetField(out, TIFFTAG_GROUP3OPTIONS, g3opts);
+	else
+		CopyField(TIFFTAG_GROUP3OPTIONS, g3opts);
+	if (samplesperpixel <= 4) {
+		uint16 *tr, *tg, *tb, *ta;
+		CopyField4(TIFFTAG_TRANSFERFUNCTION, tr, tg, tb, ta);
+	}
+	{ uint16 *red, *green, *blue;
+	  if (TIFFGetField(in, TIFFTAG_COLORMAP, &red, &green, &blue)) {
+		CheckAndCorrectColormap(in, 1<<bitspersample, red, green, blue);
+		TIFFSetField(out, TIFFTAG_COLORMAP, red, green, blue);
+	  }
+	}
+/* SMinSampleValue & SMaxSampleValue */
+	switch (compression) {
+	case COMPRESSION_JPEG:
+		TIFFSetField(out, TIFFTAG_JPEGQUALITY, quality);
+		TIFFSetField(out, TIFFTAG_JPEGCOLORMODE, jpegcolormode);
+		break;
+	case COMPRESSION_LZW:
+	case COMPRESSION_DEFLATE:
+		if (predictor != (uint16)-1)
+			TIFFSetField(out, TIFFTAG_PREDICTOR, predictor);
+		else
+			CopyField(TIFFTAG_PREDICTOR, predictor);
+		break;
+	}
+	cpOtherTags(in, out);
+
+	if (geofile)
+            InstallGeoTIFF(out);
+        else
+            CopyGeoTIFF(in,out);
+
+        if( worldfile )
+            ApplyWorldFile( worldfile, out);
+
+	cf = pickCopyFunc(in, out, bitspersample, samplesperpixel);
+	return (cf ? (*cf)(in, out, l, w, samplesperpixel) : FALSE);
+}
+
+/*
+ * Copy Functions.
+ */
+#define	DECLAREcpFunc(x) \
+static int x(TIFF* in, TIFF* out, \
+    uint32 imagelength, uint32 imagewidth, tsample_t spp)
+
+#define	DECLAREreadFunc(x) \
+static void x(TIFF* in, \
+    unsigned char* buf, uint32 imagelength, uint32 imagewidth, tsample_t spp)
+typedef void (*readFunc)(TIFF*, unsigned char*, uint32, uint32, tsample_t);
+
+#define	DECLAREwriteFunc(x) \
+static int x(TIFF* out, \
+    unsigned char* buf, uint32 imagelength, uint32 imagewidth, tsample_t spp)
+typedef int (*writeFunc)(TIFF*, unsigned char*, uint32, uint32, tsample_t);
+
+/*
+ * Contig -> contig by scanline for rows/strip change.
+ */
+DECLAREcpFunc(cpContig2ContigByRow)
+{
+	unsigned char *buf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(in));
+	uint32 row;
+
+	(void) imagewidth; (void) spp;
+	for (row = 0; row < imagelength; row++) {
+		if (TIFFReadScanline(in, buf, row, 0) < 0 && !ignore)
+			goto done;
+		if (TIFFWriteScanline(out, buf, row, 0) < 0)
+			goto bad;
+	}
+done:
+	_TIFFfree(buf);
+	return (TRUE);
+bad:
+	_TIFFfree(buf);
+	return (FALSE);
+}
+
+/*
+ * Contig -> contig by scanline for rows/strip change.
+ */
+DECLAREcpFunc(cpContig2ContigByRow_8_to_4)
+{
+    unsigned char *buf_in = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(in));
+    unsigned char *buf_out = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(out));
+    uint32 row;
+
+    printf( "Downsample\n" );
+
+    (void) imagewidth; (void) spp;
+    for (row = 0; row < imagelength; row++) {
+        int i_in, i_out_byte;
+            
+        if (TIFFReadScanline(in, buf_in, row, 0) < 0 && !ignore)
+            goto done;
+
+        for( i_in = 0, i_out_byte = 0;
+             i_in < imagewidth;
+             i_in += 2, i_out_byte++ )
+        {
+            buf_out[i_out_byte] =
+                (buf_in[i_in] & 0xf)*16 + (buf_in[i_in+1] & 0xf);
+        }
+        
+        if (TIFFWriteScanline(out, buf_out, row, 0) < 0)
+            goto bad;
+    }
+  done:
+    _TIFFfree(buf_in);
+    _TIFFfree(buf_out);
+    return (TRUE);
+  bad:
+    _TIFFfree(buf_in);
+    _TIFFfree(buf_out);
+    return (FALSE);
+}
+
+/*
+ * Strip -> strip for change in encoding.
+ */
+DECLAREcpFunc(cpDecodedStrips)
+{
+	tsize_t stripsize  = TIFFStripSize(in);
+	unsigned char *buf = (unsigned char *)_TIFFmalloc(stripsize);
+
+	(void) imagewidth; (void) spp;
+	if (buf) {
+		tstrip_t s, ns = TIFFNumberOfStrips(in);
+		uint32 row = 0;
+		for (s = 0; s < ns; s++) {
+			tsize_t cc = (row + rowsperstrip > imagelength) ?
+			    TIFFVStripSize(in, imagelength - row) : stripsize;
+			if (TIFFReadEncodedStrip(in, s, buf, cc) < 0 && !ignore)
+				break;
+			if (TIFFWriteEncodedStrip(out, s, buf, cc) < 0) {
+				_TIFFfree(buf);
+				return (FALSE);
+			}
+			row += rowsperstrip;
+		}
+		_TIFFfree(buf);
+		return (TRUE);
+	}
+	return (FALSE);
+}
+
+/*
+ * Separate -> separate by row for rows/strip change.
+ */
+DECLAREcpFunc(cpSeparate2SeparateByRow)
+{
+	unsigned char *buf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(in));
+	uint32 row;
+	tsample_t s;
+
+	(void) imagewidth;
+	for (s = 0; s < spp; s++) {
+		for (row = 0; row < imagelength; row++) {
+			if (TIFFReadScanline(in, buf, row, s) < 0 && !ignore)
+				goto done;
+			if (TIFFWriteScanline(out, buf, row, s) < 0)
+				goto bad;
+		}
+	}
+done:
+	_TIFFfree(buf);
+	return (TRUE);
+bad:
+	_TIFFfree(buf);
+	return (FALSE);
+}
+
+/*
+ * Contig -> separate by row.
+ */
+DECLAREcpFunc(cpContig2SeparateByRow)
+{
+	unsigned char *inbuf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(in));
+	unsigned char *outbuf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(out));
+	register unsigned char *inp, *outp;
+	register uint32 n;
+	uint32 row;
+	tsample_t s;
+
+	/* unpack channels */
+	for (s = 0; s < spp; s++) {
+		for (row = 0; row < imagelength; row++) {
+			if (TIFFReadScanline(in, inbuf, row, 0) < 0 && !ignore)
+				goto done;
+			inp = inbuf + s;
+			outp = outbuf;
+			for (n = imagewidth; n-- > 0;) {
+				*outp++ = *inp;
+				inp += spp;
+			}
+			if (TIFFWriteScanline(out, outbuf, row, s) < 0)
+				goto bad;
+		}
+	}
+done:
+	if (inbuf) _TIFFfree(inbuf);
+	if (outbuf) _TIFFfree(outbuf);
+	return (TRUE);
+bad:
+	if (inbuf) _TIFFfree(inbuf);
+	if (outbuf) _TIFFfree(outbuf);
+	return (FALSE);
+}
+
+/*
+ * Separate -> contig by row.
+ */
+DECLAREcpFunc(cpSeparate2ContigByRow)
+{
+	unsigned char *inbuf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(in));
+	unsigned char *outbuf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(out));
+	register unsigned char *inp, *outp;
+	register uint32 n;
+	uint32 row;
+	tsample_t s;
+
+	for (row = 0; row < imagelength; row++) {
+		/* merge channels */
+		for (s = 0; s < spp; s++) {
+			if (TIFFReadScanline(in, inbuf, row, s) < 0 && !ignore)
+				goto done;
+			inp = inbuf;
+			outp = outbuf + s;
+			for (n = imagewidth; n-- > 0;) {
+				*outp = *inp++;
+				outp += spp;
+			}
+		}
+		if (TIFFWriteScanline(out, outbuf, row, 0) < 0)
+			goto bad;
+	}
+done:
+	if (inbuf) _TIFFfree(inbuf);
+	if (outbuf) _TIFFfree(outbuf);
+	return (TRUE);
+bad:
+	if (inbuf) _TIFFfree(inbuf);
+	if (outbuf) _TIFFfree(outbuf);
+	return (FALSE);
+}
+
+static void
+cpStripToTile(unsigned char* out, unsigned char* in,
+	uint32 rows, uint32 cols, int outskew, int inskew)
+{
+	while (rows-- > 0) {
+		uint32 j = cols;
+		while (j-- > 0)
+			*out++ = *in++;
+		out += outskew;
+		in += inskew;
+	}
+}
+
+static void
+cpContigBufToSeparateBuf(unsigned char* out, unsigned char* in,
+	uint32 rows, uint32 cols, int outskew, int inskew, tsample_t spp)
+{
+	while (rows-- > 0) {
+		uint32 j = cols;
+		while (j-- > 0)
+			*out++ = *in, in += spp;
+		out += outskew;
+		in += inskew;
+	}
+}
+
+static void
+cpSeparateBufToContigBuf(unsigned char* out, unsigned char* in,
+	uint32 rows, uint32 cols, int outskew, int inskew, tsample_t spp)
+{
+	while (rows-- > 0) {
+		uint32 j = cols;
+		while (j-- > 0)
+			*out = *in++, out += spp;
+		out += outskew;
+		in += inskew;
+	}
+}
+
+static int
+cpImage(TIFF* in, TIFF* out, readFunc fin, writeFunc fout,
+	uint32 imagelength, uint32 imagewidth, tsample_t spp)
+{
+	int status = FALSE;
+	unsigned char* buf = (unsigned char *)
+	    _TIFFmalloc(TIFFRasterScanlineSize(in) * imagelength);
+	if (buf) {
+		(*fin)(in, buf, imagelength, imagewidth, spp);
+		status = (fout)(out, buf, imagelength, imagewidth, spp);
+		_TIFFfree(buf);
+	}
+	return (status);
+}
+
+DECLAREreadFunc(readContigStripsIntoBuffer)
+{
+	tsize_t scanlinesize = TIFFScanlineSize(in);
+     	unsigned char *bufp = buf;
+	uint32 row;
+
+	(void) imagewidth; (void) spp;
+	for (row = 0; row < imagelength; row++) {
+		if (TIFFReadScanline(in, bufp, row, 0) < 0 && !ignore)
+			break;
+		bufp += scanlinesize;
+	}
+}
+
+DECLAREreadFunc(readSeparateStripsIntoBuffer)
+{
+	tsize_t scanlinesize = TIFFScanlineSize(in);
+	unsigned char* scanline = (unsigned char *) _TIFFmalloc(scanlinesize);
+
+	(void) imagewidth;
+	if (scanline) {
+		unsigned char *bufp = buf;
+		uint32 row;
+		tsample_t s;
+
+		for (row = 0; row < imagelength; row++) {
+			/* merge channels */
+			for (s = 0; s < spp; s++) {
+				unsigned char* sp = scanline;
+				unsigned char* bp = bufp + s;
+				tsize_t n = scanlinesize;
+
+				if (TIFFReadScanline(in, sp, row, s) < 0 && !ignore)
+					goto done;
+				while (n-- > 0)
+					*bp = *bufp++, bp += spp;
+			}
+			bufp += scanlinesize;
+		}
+done:
+		_TIFFfree(scanline);
+	}
+}
+
+DECLAREreadFunc(readContigTilesIntoBuffer)
+{
+	unsigned char* tilebuf = (unsigned char *) _TIFFmalloc(TIFFTileSize(in));
+	uint32 imagew = TIFFScanlineSize(in);
+	uint32 tilew  = TIFFTileRowSize(in);
+	int iskew = imagew - tilew;
+	unsigned char *bufp = buf;
+	uint32 tw, tl;
+	uint32 row;
+
+	(void) spp;
+	if (tilebuf == 0)
+		return;
+	(void) TIFFGetField(in, TIFFTAG_TILEWIDTH, &tw);
+	(void) TIFFGetField(in, TIFFTAG_TILELENGTH, &tl);
+	for (row = 0; row < imagelength; row += tl) {
+		uint32 nrow = (row+tl > imagelength) ? imagelength-row : tl;
+		uint32 colb = 0;
+		uint32 col;
+
+		for (col = 0; col < imagewidth; col += tw) {
+			if (TIFFReadTile(in, tilebuf, col, row, 0, 0) < 0 &&
+			    !ignore)
+				goto done;
+			if (colb + tilew > imagew) {
+				uint32 width = imagew - colb;
+				uint32 oskew = tilew - width;
+				cpStripToTile(bufp + colb,
+					tilebuf, nrow, width,
+					oskew + iskew, oskew);
+			} else
+				cpStripToTile(bufp + colb,
+					tilebuf, nrow, tilew,
+					iskew, 0);
+			colb += tilew;
+		}
+		bufp += imagew * nrow;
+	}
+done:
+	_TIFFfree(tilebuf);
+}
+
+DECLAREreadFunc(readSeparateTilesIntoBuffer)
+{
+	uint32 imagew = TIFFScanlineSize(in);
+	uint32 tilew = TIFFTileRowSize(in);
+	int iskew  = imagew - tilew;
+	unsigned char* tilebuf = (unsigned char *) _TIFFmalloc(TIFFTileSize(in));
+	unsigned char *bufp = buf;
+	uint32 tw, tl;
+	uint32 row;
+
+	if (tilebuf == 0)
+		return;
+	(void) TIFFGetField(in, TIFFTAG_TILEWIDTH, &tw);
+	(void) TIFFGetField(in, TIFFTAG_TILELENGTH, &tl);
+	for (row = 0; row < imagelength; row += tl) {
+		uint32 nrow = (row+tl > imagelength) ? imagelength-row : tl;
+		uint32 colb = 0;
+		uint32 col;
+
+		for (col = 0; col < imagewidth; col += tw) {
+			tsample_t s;
+
+			for (s = 0; s < spp; s++) {
+				if (TIFFReadTile(in, tilebuf, col, row, 0, s) < 0 && !ignore)
+					goto done;
+				/*
+				 * Tile is clipped horizontally.  Calculate
+				 * visible portion and skewing factors.
+				 */
+				if (colb + tilew > imagew) {
+					uint32 width = imagew - colb;
+					int oskew = tilew - width;
+					cpSeparateBufToContigBuf(bufp+colb+s,
+					    tilebuf, nrow, width,
+					    oskew + iskew, oskew, spp);
+				} else
+					cpSeparateBufToContigBuf(bufp+colb+s,
+					    tilebuf, nrow, tw,
+					    iskew, 0, spp);
+			}
+			colb += tilew;
+		}
+		bufp += imagew * nrow;
+	}
+done:
+	_TIFFfree(tilebuf);
+}
+
+DECLAREwriteFunc(writeBufferToContigStrips)
+{
+	tsize_t scanline = TIFFScanlineSize(out);
+	uint32 row;
+
+	(void) imagewidth; (void) spp;
+	for (row = 0; row < imagelength; row++) {
+		if (TIFFWriteScanline(out, buf, row, 0) < 0)
+			return (FALSE);
+		buf += scanline;
+	}
+	return (TRUE);
+}
+
+DECLAREwriteFunc(writeBufferToSeparateStrips)
+{
+	unsigned char *obuf = (unsigned char *) _TIFFmalloc(TIFFScanlineSize(out));
+	tsample_t s;
+
+	if (obuf == NULL)
+		return (0);
+	for (s = 0; s < spp; s++) {
+		uint32 row;
+		for (row = 0; row < imagelength; row++) {
+			unsigned char* inp = buf + s;
+			unsigned char* outp = obuf;
+			uint32 n = imagewidth;
+
+			while (n-- > 0)
+				*outp++ = *inp, inp += spp;
+			if (TIFFWriteScanline(out, obuf, row, s) < 0) {
+				_TIFFfree(obuf);
+				return (FALSE);
+			}
+		}
+	}
+	_TIFFfree(obuf);
+	return (TRUE);
+
+}
+
+DECLAREwriteFunc(writeBufferToContigTiles)
+{
+	uint32 imagew = TIFFScanlineSize(out);
+	uint32 tilew  = TIFFTileRowSize(out);
+	int iskew = imagew - tilew;
+	unsigned char* obuf = (unsigned char *) _TIFFmalloc(TIFFTileSize(out));
+	unsigned char* bufp = buf;
+	uint32 tl, tw;
+	uint32 row;
+
+	(void) spp;
+	if (obuf == NULL)
+		return (FALSE);
+	(void) TIFFGetField(out, TIFFTAG_TILELENGTH, &tl);
+	(void) TIFFGetField(out, TIFFTAG_TILEWIDTH, &tw);
+	for (row = 0; row < imagelength; row += tilelength) {
+		uint32 nrow = (row+tl > imagelength) ? imagelength-row : tl;
+		uint32 colb = 0;
+		uint32 col;
+
+		for (col = 0; col < imagewidth; col += tw) {
+			/*
+			 * Tile is clipped horizontally.  Calculate
+			 * visible portion and skewing factors.
+			 */
+			if (colb + tilew > imagew) {
+				uint32 width = imagew - colb;
+				int oskew = tilew - width;
+				cpStripToTile(obuf, bufp + colb, nrow, width,
+				    oskew, oskew + iskew);
+			} else
+				cpStripToTile(obuf, bufp + colb, nrow, tilew,
+				    0, iskew);
+			if (TIFFWriteTile(out, obuf, col, row, 0, 0) < 0) {
+				_TIFFfree(obuf);
+				return (FALSE);
+			}
+			colb += tilew;
+		}
+		bufp += nrow * imagew;
+	}
+	_TIFFfree(obuf);
+	return (TRUE);
+}
+
+DECLAREwriteFunc(writeBufferToSeparateTiles)
+{
+	uint32 imagew = TIFFScanlineSize(out);
+	tsize_t tilew  = TIFFTileRowSize(out);
+	int iskew = imagew - tilew;
+	unsigned char *obuf = (unsigned char*) _TIFFmalloc(TIFFTileSize(out));
+	unsigned char *bufp = buf;
+	uint32 tl, tw;
+	uint32 row;
+
+	if (obuf == NULL)
+		return (FALSE);
+	(void) TIFFGetField(out, TIFFTAG_TILELENGTH, &tl);
+	(void) TIFFGetField(out, TIFFTAG_TILEWIDTH, &tw);
+	for (row = 0; row < imagelength; row += tl) {
+		uint32 nrow = (row+tl > imagelength) ? imagelength-row : tl;
+		uint32 colb = 0;
+		uint32 col;
+
+		for (col = 0; col < imagewidth; col += tw) {
+			tsample_t s;
+			for (s = 0; s < spp; s++) {
+				/*
+				 * Tile is clipped horizontally.  Calculate
+				 * visible portion and skewing factors.
+				 */
+				if (colb + tilew > imagew) {
+					uint32 width = imagew - colb;
+					int oskew = tilew - width;
+
+					cpContigBufToSeparateBuf(obuf,
+					    bufp + colb + s,
+					    nrow, width,
+					    oskew/spp, oskew + imagew, spp);
+				} else
+					cpContigBufToSeparateBuf(obuf,
+					    bufp + colb + s,
+					    nrow, tilewidth,
+					    0, iskew, spp);
+				if (TIFFWriteTile(out, obuf, col, row, 0, s) < 0) {
+					_TIFFfree(obuf);
+					return (FALSE);
+				}
+			}
+			colb += tilew;
+		}
+		bufp += nrow * imagew;
+	}
+	_TIFFfree(obuf);
+	return (TRUE);
+}
+
+/*
+ * Contig strips -> contig tiles.
+ */
+DECLAREcpFunc(cpContigStrips2ContigTiles)
+{
+	return cpImage(in, out,
+	    readContigStripsIntoBuffer,
+	    writeBufferToContigTiles,
+	    imagelength, imagewidth, spp);
+}
+
+/*
+ * Contig strips -> separate tiles.
+ */
+DECLAREcpFunc(cpContigStrips2SeparateTiles)
+{
+	return cpImage(in, out,
+	    readContigStripsIntoBuffer,
+	    writeBufferToSeparateTiles,
+	    imagelength, imagewidth, spp);
+}
+
+/*
+ * Separate strips -> contig tiles.
+ */
+DECLAREcpFunc(cpSeparateStrips2ContigTiles)
+{
+	return cpImage(in, out,
+	    readSeparateStripsIntoBuffer,
+	    writeBufferToContigTiles,
+	    imagelength, imagewidth, spp);
+}
+
+/*
+ * Separate strips -> separate tiles.
+ */
+DECLAREcpFunc(cpSeparateStrips2SeparateTiles)
+{
+	return cpImage(in, out,
+	    readSeparateStripsIntoBuffer,
+	    writeBufferToSeparateTiles,
+	    imagelength, imagewidth, spp);
+}
+
+/*
+ * Contig strips -> contig tiles.
+ */
+DECLAREcpFunc(cpContigTiles2ContigTiles)
+{
+	return cpImage(in, out,
+	    readContigTilesIntoBuffer,
+	    writeBufferToContigTiles,
+	    imagelength, imagewidth, spp);
+}
+
+/*
+ * Contig tiles -> separate tiles.
+ */
+DECLAREcpFunc(cpContigTiles2SeparateTiles)
+{
+	return cpImage(in, out,
+	    readContigTilesIntoBuffer,
+	    writeBufferToSeparateTiles,
+	    imagelength, imagewidth, spp);
+}
+
+/*
+ * Separate tiles -> contig tiles.
+ */
+DECLAREcpFunc(cpSeparateTiles2ContigTiles)
+{
+	return cpImage(in, out,
+	    readSeparateTilesIntoBuffer,
+	    writeBufferToContigTiles,
+	    imagelength, imagewidth, spp);
+}
+
+/*
+ * Separate tiles -> separate tiles (tile dimension change).
+ */
+DECLAREcpFunc(cpSeparateTiles2SeparateTiles)
+{
+	return cpImage(in, out,
+	    readSeparateTilesIntoBuffer,
+	    writeBufferToSeparateTiles,
+	    imagelength, imagewidth, spp);
+}
+
+/*
+ * Contig tiles -> contig tiles (tile dimension change).
+ */
+DECLAREcpFunc(cpContigTiles2ContigStrips)
+{
+	return cpImage(in, out,
+	    readContigTilesIntoBuffer,
+	    writeBufferToContigStrips,
+	    imagelength, imagewidth, spp);
+}
+
+/*
+ * Contig tiles -> separate strips.
+ */
+DECLAREcpFunc(cpContigTiles2SeparateStrips)
+{
+	return cpImage(in, out,
+	    readContigTilesIntoBuffer,
+	    writeBufferToSeparateStrips,
+	    imagelength, imagewidth, spp);
+}
+
+/*
+ * Separate tiles -> contig strips.
+ */
+DECLAREcpFunc(cpSeparateTiles2ContigStrips)
+{
+	return cpImage(in, out,
+	    readSeparateTilesIntoBuffer,
+	    writeBufferToContigStrips,
+	    imagelength, imagewidth, spp);
+}
+
+/*
+ * Separate tiles -> separate strips.
+ */
+DECLAREcpFunc(cpSeparateTiles2SeparateStrips)
+{
+	return cpImage(in, out,
+	    readSeparateTilesIntoBuffer,
+	    writeBufferToSeparateStrips,
+	    imagelength, imagewidth, spp);
+}
+
+/*
+ * Select the appropriate copy function to use.
+ */
+static copyFunc
+pickCopyFunc(TIFF* in, TIFF* out, uint16 bitspersample, uint16 samplesperpixel)
+{
+	uint16 shortv;
+	uint32 w, l, tw, tl;
+	int bychunk;
+
+	(void) TIFFGetField(in, TIFFTAG_PLANARCONFIG, &shortv);
+	if (shortv != config && bitspersample != 8 && samplesperpixel > 1) {
+		fprintf(stderr,
+"%s: Can not handle different planar configuration w/ bits/sample != 8\n",
+		    TIFFFileName(in));
+		return (NULL);
+	}
+	TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &w);
+	TIFFGetField(in, TIFFTAG_IMAGELENGTH, &l);
+	if (TIFFIsTiled(out)) {
+		if (!TIFFGetField(in, TIFFTAG_TILEWIDTH, &tw))
+			tw = w;
+		if (!TIFFGetField(in, TIFFTAG_TILELENGTH, &tl))
+			tl = l;
+		bychunk = (tw == tilewidth && tl == tilelength);
+	} else if (TIFFIsTiled(in)) {
+		TIFFGetField(in, TIFFTAG_TILEWIDTH, &tw);
+		TIFFGetField(in, TIFFTAG_TILELENGTH, &tl);
+		bychunk = (tw == w && tl == rowsperstrip);
+	} else {
+		uint32 irps = (uint32) -1L;
+		TIFFGetField(in, TIFFTAG_ROWSPERSTRIP, &irps);
+		bychunk = (rowsperstrip == irps);
+	}
+#define	T 1
+#define	F 0
+#define pack(a,b,c,d,e)	((long)(((a)<<11)|((b)<<3)|((c)<<2)|((d)<<1)|(e)))
+	switch(pack(shortv,config,TIFFIsTiled(in),TIFFIsTiled(out),bychunk)) {
+/* Strips -> Tiles */
+	case pack(PLANARCONFIG_CONTIG,   PLANARCONFIG_CONTIG,   F,T,F):
+	case pack(PLANARCONFIG_CONTIG,   PLANARCONFIG_CONTIG,   F,T,T):
+		return cpContigStrips2ContigTiles;
+	case pack(PLANARCONFIG_CONTIG,   PLANARCONFIG_SEPARATE, F,T,F):
+	case pack(PLANARCONFIG_CONTIG,   PLANARCONFIG_SEPARATE, F,T,T):
+		return cpContigStrips2SeparateTiles;
+        case pack(PLANARCONFIG_SEPARATE, PLANARCONFIG_CONTIG,   F,T,F):
+        case pack(PLANARCONFIG_SEPARATE, PLANARCONFIG_CONTIG,   F,T,T):
+		return cpSeparateStrips2ContigTiles;
+	case pack(PLANARCONFIG_SEPARATE, PLANARCONFIG_SEPARATE, F,T,F):
+	case pack(PLANARCONFIG_SEPARATE, PLANARCONFIG_SEPARATE, F,T,T):
+		return cpSeparateStrips2SeparateTiles;
+/* Tiles -> Tiles */
+	case pack(PLANARCONFIG_CONTIG,   PLANARCONFIG_CONTIG,   T,T,F):
+	case pack(PLANARCONFIG_CONTIG,   PLANARCONFIG_CONTIG,   T,T,T):
+		return cpContigTiles2ContigTiles;
+	case pack(PLANARCONFIG_CONTIG,   PLANARCONFIG_SEPARATE, T,T,F):
+	case pack(PLANARCONFIG_CONTIG,   PLANARCONFIG_SEPARATE, T,T,T):
+		return cpContigTiles2SeparateTiles;
+        case pack(PLANARCONFIG_SEPARATE, PLANARCONFIG_CONTIG,   T,T,F):
+        case pack(PLANARCONFIG_SEPARATE, PLANARCONFIG_CONTIG,   T,T,T):
+		return cpSeparateTiles2ContigTiles;
+	case pack(PLANARCONFIG_SEPARATE, PLANARCONFIG_SEPARATE, T,T,F):
+	case pack(PLANARCONFIG_SEPARATE, PLANARCONFIG_SEPARATE, T,T,T):
+		return cpSeparateTiles2SeparateTiles;
+/* Tiles -> Strips */
+	case pack(PLANARCONFIG_CONTIG,   PLANARCONFIG_CONTIG,   T,F,F):
+	case pack(PLANARCONFIG_CONTIG,   PLANARCONFIG_CONTIG,   T,F,T):
+		return cpContigTiles2ContigStrips;
+	case pack(PLANARCONFIG_CONTIG,   PLANARCONFIG_SEPARATE, T,F,F):
+	case pack(PLANARCONFIG_CONTIG,   PLANARCONFIG_SEPARATE, T,F,T):
+		return cpContigTiles2SeparateStrips;
+        case pack(PLANARCONFIG_SEPARATE, PLANARCONFIG_CONTIG,   T,F,F):
+        case pack(PLANARCONFIG_SEPARATE, PLANARCONFIG_CONTIG,   T,F,T):
+		return cpSeparateTiles2ContigStrips;
+	case pack(PLANARCONFIG_SEPARATE, PLANARCONFIG_SEPARATE, T,F,F):
+	case pack(PLANARCONFIG_SEPARATE, PLANARCONFIG_SEPARATE, T,F,T):
+		return cpSeparateTiles2SeparateStrips;
+/* Strips -> Strips */
+	case pack(PLANARCONFIG_CONTIG,   PLANARCONFIG_CONTIG,   F,F,F):
+          if( convert_8_to_4 )
+              return cpContig2ContigByRow_8_to_4;
+          else
+              return cpContig2ContigByRow;
+          
+	case pack(PLANARCONFIG_CONTIG,   PLANARCONFIG_CONTIG,   F,F,T):
+          if( convert_8_to_4 )
+              return cpContig2ContigByRow_8_to_4;
+          else
+              return cpDecodedStrips;
+	case pack(PLANARCONFIG_CONTIG, PLANARCONFIG_SEPARATE,   F,F,F):
+	case pack(PLANARCONFIG_CONTIG, PLANARCONFIG_SEPARATE,   F,F,T):
+		return cpContig2SeparateByRow;
+	case pack(PLANARCONFIG_SEPARATE, PLANARCONFIG_CONTIG,   F,F,F):
+	case pack(PLANARCONFIG_SEPARATE, PLANARCONFIG_CONTIG,   F,F,T):
+		return cpSeparate2ContigByRow;
+	case pack(PLANARCONFIG_SEPARATE, PLANARCONFIG_SEPARATE, F,F,F):
+	case pack(PLANARCONFIG_SEPARATE, PLANARCONFIG_SEPARATE, F,F,T):
+		return cpSeparate2SeparateByRow;
+	}
+#undef pack
+#undef F
+#undef T
+	fprintf(stderr, "tiffcp: %s: Don't know how to copy/convert image.\n",
+	    TIFFFileName(in));
+	return (NULL);
+}

Added: packages/geotiff/libgeotiff-dfsg/trunk/bin/getopt.c
===================================================================
--- packages/geotiff/libgeotiff-dfsg/trunk/bin/getopt.c	                        (rev 0)
+++ packages/geotiff/libgeotiff-dfsg/trunk/bin/getopt.c	2007-09-19 11:39:06 UTC (rev 1077)
@@ -0,0 +1,116 @@
+/*
+ * Copyright (c) 1987 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *	This product includes software developed by the University of
+ *	California, Berkeley and its contributors.
+ * 4. Neither the name of the University 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 THE REGENTS AND CONTRIBUTORS ``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 THE REGENTS OR CONTRIBUTORS 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.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)getopt.c	4.13 (Berkeley) 2/23/91";
+#endif /* LIBC_SCCS and not lint */
+
+#include <stdio.h>
+#include <string.h>
+
+/*
+ * get option letter from argument vector
+ */
+int	opterr = 1,		/* if error message should be printed */
+	optind = 1,		/* index into parent argv vector */
+	optopt;			/* character checked for validity */
+char	*optarg;		/* argument associated with option */
+
+#define	BADCH	(int)'?'
+#define	EMSG	""
+
+int
+getopt(int nargc, char** nargv, char* ostr)
+{
+	static char *place = EMSG;		/* option letter processing */
+	register char *oli;			/* option letter list index */
+	char *p;
+
+	if (!*place) {				/* update scanning pointer */
+		if (optind >= nargc || *(place = nargv[optind]) != '-') {
+			place = EMSG;
+			return(EOF);
+		}
+		if (place[1] && *++place == '-') {	/* found "--" */
+			++optind;
+			place = EMSG;
+			return(EOF);
+		}
+	}					/* option letter okay? */
+	if ((optopt = (int)*place++) == (int)':' ||
+	    !(oli = strchr(ostr, optopt))) {
+		/*
+		 * if the user didn't specify '-' as an option,
+		 * assume it means EOF.
+		 */
+		if (optopt == (int)'-')
+			return(EOF);
+		if (!*place)
+			++optind;
+		if (opterr) {
+			if (!(p = strrchr(*nargv, '/')))
+				p = *nargv;
+			else
+				++p;
+			(void)fprintf(stderr, "%s: illegal option -- %c\n",
+			    p, optopt);
+		}
+		return(BADCH);
+	}
+	if (*++oli != ':') {			/* don't need argument */
+		optarg = NULL;
+		if (!*place)
+			++optind;
+	}
+	else {					/* need an argument */
+		if (*place)			/* no white space */
+			optarg = place;
+		else if (nargc <= ++optind) {	/* no arg */
+			place = EMSG;
+			if (!(p = strrchr(*nargv, '/')))
+				p = *nargv;
+			else
+				++p;
+			if (opterr)
+				(void)fprintf(stderr,
+				    "%s: option requires an argument -- %c\n",
+				    p, optopt);
+			return(BADCH);
+		}
+	 	else				/* white space */
+			optarg = nargv[optind];
+		place = EMSG;
+		++optind;
+	}
+	return(optopt);				/* dump back option letter */
+}

Added: packages/geotiff/libgeotiff-dfsg/trunk/bin/listgeo.c
===================================================================
--- packages/geotiff/libgeotiff-dfsg/trunk/bin/listgeo.c	                        (rev 0)
+++ packages/geotiff/libgeotiff-dfsg/trunk/bin/listgeo.c	2007-09-19 11:39:06 UTC (rev 1077)
@@ -0,0 +1,310 @@
+/*
+ * listgeo.c -- example client code for LIBGEO geographic
+ *     TIFF tag support. Dumps info to GeoTIFF metadata file.
+ *
+ *  Author: Niles D. Ritter
+ *
+ */
+
+#include "geotiff.h"
+#include "xtiffio.h"
+#include "geo_normalize.h"
+#include "geovalues.h"
+#include "tiffio.h"
+#include "cpl_serv.h"
+#include <stdio.h>
+
+static void WriteTFWFile( GTIF * gtif, const char * tif_filename );
+static void GTIFPrintCorners( GTIF *, GTIFDefn *, FILE *, int, int, int, int );
+static const char *CSVFileOverride( const char * );
+static const char *CSVDirName = NULL;
+
+void Usage()
+
+{
+    printf( 
+        "%s", 
+        "Usage: listgeo [-d] [-tfw] [-proj4] [-no_norm] [-t tabledir] filename\n"
+        "\n"
+        "  -d: report lat/long corners in decimal degrees instead of DMS.\n"
+        "  -tfw: Generate a .tfw (ESRI TIFF World) file for the target file.\n"
+        "  -proj4: Report PROJ.4 equivelent projection definition.\n"
+        "  -no_norm: Don't report 'normalized' parameter values.\n"
+        "  filename: Name of the GeoTIFF file to report on.\n" );
+        
+    exit( 1 );
+}
+
+int main(int argc, char *argv[])
+{
+    char	*fname = NULL;
+    TIFF 	*tif=(TIFF*)0;  /* TIFF-level descriptor */
+    GTIF	*gtif=(GTIF*)0; /* GeoKey-level descriptor */
+    int		i, norm_print_flag = 1, proj4_print_flag = 0;
+    int		tfw_flag = 0, inv_flag = 0, dec_flag = 0;
+
+    /*
+     * Handle command line options.
+     */
+    for( i = 1; i < argc; i++ )
+    {
+        if( strcmp(argv[i],"-no_norm") == 0 )
+            norm_print_flag = 0;
+        else if( strcmp(argv[i],"-t") == 0 )
+        {
+            CSVDirName = argv[++i];
+            SetCSVFilenameHook( CSVFileOverride );
+        }
+        else if( strcmp(argv[i],"-tfw") == 0 )
+            tfw_flag = 1;
+        else if( strcmp(argv[i],"-proj4") == 0 )
+            proj4_print_flag = 1;
+        else if( strcmp(argv[i],"-i") == 0 )
+            inv_flag = 1;
+        else if( strcmp(argv[i],"-d") == 0 )
+            dec_flag = 1;
+        else if( fname == NULL && argv[i][0] != '-' )
+            fname = argv[i];
+        else
+        {
+            Usage();
+        }
+    }
+
+    if( fname == NULL )
+        Usage();
+
+    /*
+     * Open the file, read the GeoTIFF information, and print to stdout. 
+     */
+
+    tif=XTIFFOpen(fname,"r");
+    if (!tif) goto failure;
+	
+    gtif = GTIFNew(tif);
+    if (!gtif)
+    {
+        fprintf(stderr,"failed in GTIFNew\n");
+        goto failure;
+    }
+
+    if( tfw_flag )
+    {
+        WriteTFWFile( gtif, fname );
+
+        goto Success;
+    }
+	
+    /* dump the GeoTIFF metadata to std out */
+
+    GTIFPrint(gtif,0,0);
+
+    /*
+     * Capture, and report normalized information if requested.
+     */
+
+    if( norm_print_flag )
+    {
+        GTIFDefn	defn;
+        
+        if( GTIFGetDefn( gtif, &defn ) )
+        {
+            int		xsize, ysize;
+            
+            printf( "\n" );
+            GTIFPrintDefn( &defn, stdout );
+
+            if( proj4_print_flag )
+            {
+                printf( "\n" );
+                printf( "PROJ.4 Definition: %s\n", GTIFGetProj4Defn(&defn));
+            }
+            
+            TIFFGetField( tif, TIFFTAG_IMAGEWIDTH, &xsize );
+            TIFFGetField( tif, TIFFTAG_IMAGELENGTH, &ysize );
+            GTIFPrintCorners( gtif, &defn, stdout, xsize, ysize, inv_flag, dec_flag );
+        }
+
+    }
+
+  Success:
+    GTIFFree(gtif);
+    XTIFFClose(tif);
+    return 0;
+		
+  failure:
+    fprintf(stderr,"failure in listgeo\n");
+    if (tif) XTIFFClose(tif);
+    if (gtif) GTIFFree(gtif);
+    return 1;
+}
+
+static const char *CSVFileOverride( const char * pszInput )
+
+{
+    static char		szPath[1024];
+
+#ifdef WIN32
+    sprintf( szPath, "%s\\%s", CSVDirName, pszInput );
+#else    
+    sprintf( szPath, "%s/%s", CSVDirName, pszInput );
+#endif    
+
+    return( szPath );
+}
+
+/*
+ * Report the file(s) corner coordinates in projected coordinates, and
+ * if possible lat/long.
+ */
+
+static int GTIFReportACorner( GTIF *gtif, GTIFDefn *defn, FILE * fp_out,
+                              const char * corner_name,
+                              double x, double y, int inv_flag, int dec_flag )
+
+{
+    double	x_saved, y_saved;
+
+    /* Try to transform the coordinate into PCS space */
+    if( !GTIFImageToPCS( gtif, &x, &y ) )
+        return FALSE;
+    
+    x_saved = x;
+    y_saved = y;
+
+    fprintf( fp_out, "%-13s ", corner_name );
+
+    if( defn->Model == ModelTypeGeographic )
+    {
+	if (dec_flag) 
+	{
+	    fprintf( fp_out, "(%.7f,", x );
+	    fprintf( fp_out, "%.7f)\n", y );
+	} 
+	else 
+	{
+	    fprintf( fp_out, "(%s,", GTIFDecToDMS( x, "Long", 2 ) );
+	    fprintf( fp_out, "%s)\n", GTIFDecToDMS( y, "Lat", 2 ) );
+	}
+    }
+    else
+    {
+        fprintf( fp_out, "(%12.3f,%12.3f)", x, y );
+
+        if( GTIFProj4ToLatLong( defn, 1, &x, &y ) )
+        {
+	    if (dec_flag) 
+	    {
+                fprintf( fp_out, "  (%.7f,", x );
+                fprintf( fp_out, "%.7f)", y );
+	    } 
+	    else 
+	    {
+		fprintf( fp_out, "  (%s,", GTIFDecToDMS( x, "Long", 2 ) );
+		fprintf( fp_out, "%s)", GTIFDecToDMS( y, "Lat", 2 ) );
+	    }
+        }
+
+        fprintf( fp_out, "\n" );
+    }
+
+    if( inv_flag && GTIFPCSToImage( gtif, &x_saved, &y_saved ) )
+    {
+        fprintf( fp_out, "      inverse (%11.3f,%11.3f)\n", x_saved, y_saved );
+    }
+    
+    return TRUE;
+}
+
+static void GTIFPrintCorners( GTIF *gtif, GTIFDefn *defn, FILE * fp_out,
+                              int xsize, int ysize, int inv_flag, int dec_flag )
+
+{
+    printf( "\nCorner Coordinates:\n" );
+    if( !GTIFReportACorner( gtif, defn, fp_out,
+                            "Upper Left", 0.0, 0.0, inv_flag, dec_flag ) )
+    {
+        printf( " ... unable to transform points between pixel/line and PCS space\n" );
+        return;
+    }
+
+    GTIFReportACorner( gtif, defn, fp_out, "Lower Left", 0.0, ysize, 
+                       inv_flag, dec_flag );
+    GTIFReportACorner( gtif, defn, fp_out, "Upper Right", xsize, 0.0,
+                       inv_flag, dec_flag );
+    GTIFReportACorner( gtif, defn, fp_out, "Lower Right", xsize, ysize,
+                       inv_flag, dec_flag );
+    GTIFReportACorner( gtif, defn, fp_out, "Center", xsize/2.0, ysize/2.0,
+                       inv_flag, dec_flag );
+}
+
+/*
+ * Write the defining matrix for this file to a .tfw file with the same
+ * basename.
+ */
+
+static void WriteTFWFile( GTIF * gtif, const char * tif_filename )
+
+{
+    char	tfw_filename[1024];
+    int		i;
+    double	adfCoeff[6], x, y;
+    FILE	*fp;
+
+    /*
+     * form .tfw filename
+     */
+    strncpy( tfw_filename, tif_filename, sizeof(tfw_filename)-4 );
+    for( i = strlen(tfw_filename)-1; i > 0; i-- )
+    {
+        if( tfw_filename[i] == '.' )
+        {
+            strcpy( tfw_filename + i, ".tfw" );
+            break;
+        }
+    }
+
+    if( i <= 0 )
+        strcat( tfw_filename, ".tfw" );
+
+    /*
+     * Compute the coefficients.
+     */
+    x = 0.5;
+    y = 0.5;
+    if( !GTIFImageToPCS( gtif, &x, &y ) )
+        return;
+    adfCoeff[4] = x;
+    adfCoeff[5] = y;
+
+    x = 1.5;
+    y = 0.5;
+    if( !GTIFImageToPCS( gtif, &x, &y ) )
+        return;
+    adfCoeff[0] = x - adfCoeff[4];
+    adfCoeff[1] = y - adfCoeff[5];
+
+    x = 0.5;
+    y = 1.5;
+    if( !GTIFImageToPCS( gtif, &x, &y ) )
+        return;
+    adfCoeff[2] = x - adfCoeff[4];
+    adfCoeff[3] = y - adfCoeff[5];
+
+    /*
+     * Write out the coefficients.
+     */
+
+    fp = fopen( tfw_filename, "wt" );
+    if( fp == NULL )
+    {
+        perror( "fopen" );
+        fprintf( stderr, "Failed to open TFW file `%s'\n", tfw_filename );
+        return;
+    }
+
+    for( i = 0; i < 6; i++ )
+        fprintf( fp, "%24.10f\n", adfCoeff[i] );
+
+    fclose( fp );
+}

Added: packages/geotiff/libgeotiff-dfsg/trunk/bin/makefile.mpw
===================================================================
--- packages/geotiff/libgeotiff-dfsg/trunk/bin/makefile.mpw	                        (rev 0)
+++ packages/geotiff/libgeotiff-dfsg/trunk/bin/makefile.mpw	2007-09-19 11:39:06 UTC (rev 1077)
@@ -0,0 +1,58 @@
+#***********************************************************************
+#
+#  MPW build file for example GeoTIFF utilities
+#
+#  written by Niles D. Ritter.
+#
+CC = c
+AR = lib -o
+RM = delete -y
+LN = duplicate -y
+
+#debug option
+#DEBUG= -sym full
+DEBUG=
+
+# data/code model options
+#MODEL=
+MODEL= -model far
+
+TIFFLIB = :::libtiff:
+GEOTIFFLIB = ::
+PORT = :::port:
+
+LINK.c = Link   {LDFLAGS}
+.o Ä .c
+	{CC} {DEBUG} {CFLAGS} {CPPFLAGS}     {Default}.c -o {Default}.o
+LDFLAGS = {DEBUG} {MODEL} -c 'MPS ' -t MPST -w 
+CFLAGS = {MODEL}
+CPPFLAGS =  -I {TIFFLIB}  -I {GEOTIFFLIB}               
+OBJS = makegeo.o  listgeo.o geotifcp.o
+CLEANOBJS = makegeo.o      
+CLEANOTHER = newtif.tif 
+CLEANINC =
+LIBS =          {TIFFLIB}libtiff.o ¶
+		{GEOTIFFLIB}libgeotiff.o ¶
+		"{CLibraries}"StdClib.o ¶
+		"{Libraries}"Stubs.o ¶
+		"{Libraries}"Runtime.o ¶
+		"{Libraries}"Interface.o
+
+ALL = makegeo listgeo geotifcp
+
+all Ä {ALL} 
+
+compile Ä  {OBJS}
+
+makegeo Ä  makegeo.o {GEOTIFFLIB}libgeotiff.o
+	{LINK.c} -o makegeo makegeo.o {LIBS}
+	
+listgeo Ä  listgeo.o {GEOTIFFLIB}libgeotiff.o
+	{LINK.c} -o listgeo listgeo.o {LIBS}
+
+geotifcp Ä  geotifcp.o {GEOTIFFLIB}libgeotiff.o {PORT}libport.o
+	{LINK.c} -o geotifcp geotifcp.o {LIBS} {PORT}libport.o
+
+clean Ä 
+	{RM} {ALL} {CLEANOBJS} {CLEANOTHER}
+	

Added: packages/geotiff/libgeotiff-dfsg/trunk/bin/makegeo.c
===================================================================
--- packages/geotiff/libgeotiff-dfsg/trunk/bin/makegeo.c	                        (rev 0)
+++ packages/geotiff/libgeotiff-dfsg/trunk/bin/makegeo.c	2007-09-19 11:39:06 UTC (rev 1077)
@@ -0,0 +1,102 @@
+/*
+ * makegeo.c -- example client code for LIBGEO geographic
+ *     TIFF tag support.
+ *
+ *  Author: Niles D. Ritter
+ *
+ * Revision History:
+ *   31 October, 1995    Fixed reversed lat-long coordinates   NDR
+ *
+ */
+
+#include "geotiffio.h"
+#include "xtiffio.h"
+#include <stdlib.h>
+#include <string.h>
+
+void SetUpTIFFDirectory(TIFF *tif);
+void SetUpGeoKeys(GTIF *gtif);
+void WriteImage(TIFF *tif);
+
+#define WIDTH 20L
+#define HEIGHT 20L
+
+int main()
+{
+	char *fname = "newgeo.tif";
+	TIFF *tif=(TIFF*)0;  /* TIFF-level descriptor */
+	GTIF *gtif=(GTIF*)0; /* GeoKey-level descriptor */
+	
+	tif=XTIFFOpen(fname,"w");
+	if (!tif) goto failure;
+	
+	gtif = GTIFNew(tif);
+	if (!gtif)
+	{
+		printf("failed in GTIFNew\n");
+		goto failure;
+	}
+	
+	SetUpTIFFDirectory(tif);
+	SetUpGeoKeys(gtif);
+	WriteImage(tif);
+	
+	GTIFWriteKeys(gtif);
+	GTIFFree(gtif);
+	XTIFFClose(tif);
+	return 0;
+	
+failure:
+	printf("failure in makegeo\n");
+	if (tif) TIFFClose(tif);
+	if (gtif) GTIFFree(gtif);
+	return -1;
+}
+
+
+void SetUpTIFFDirectory(TIFF *tif)
+{
+	double tiepoints[6]={0,0,0,130.0,32.0,0.0};
+	double pixscale[3]={1,1,0};
+	
+	TIFFSetField(tif,TIFFTAG_IMAGEWIDTH,    WIDTH);
+	TIFFSetField(tif,TIFFTAG_IMAGELENGTH,   HEIGHT);
+	TIFFSetField(tif,TIFFTAG_COMPRESSION,   COMPRESSION_NONE);
+	TIFFSetField(tif,TIFFTAG_PHOTOMETRIC,   PHOTOMETRIC_MINISBLACK);
+	TIFFSetField(tif,TIFFTAG_PLANARCONFIG,  PLANARCONFIG_CONTIG);
+	TIFFSetField(tif,TIFFTAG_BITSPERSAMPLE, 8);
+	TIFFSetField(tif,TIFFTAG_ROWSPERSTRIP,  20L);
+	
+	TIFFSetField(tif,TIFFTAG_GEOTIEPOINTS, 6,tiepoints);
+	TIFFSetField(tif,TIFFTAG_GEOPIXELSCALE, 3,pixscale);
+}
+
+void SetUpGeoKeys(GTIF *gtif)
+{
+	GTIFKeySet(gtif, GTModelTypeGeoKey, TYPE_SHORT, 1, ModelGeographic);
+	GTIFKeySet(gtif, GTRasterTypeGeoKey, TYPE_SHORT, 1, RasterPixelIsArea);
+	GTIFKeySet(gtif, GTCitationGeoKey, TYPE_ASCII, 0, "Just An Example");
+	GTIFKeySet(gtif, GeographicTypeGeoKey, TYPE_SHORT,  1, KvUserDefined);
+	GTIFKeySet(gtif, GeogCitationGeoKey, TYPE_ASCII, 0, "Everest Ellipsoid Used.");
+	GTIFKeySet(gtif, GeogAngularUnitsGeoKey, TYPE_SHORT,  1, Angular_Degree);
+	GTIFKeySet(gtif, GeogLinearUnitsGeoKey, TYPE_SHORT,  1, Linear_Meter);
+	GTIFKeySet(gtif, GeogGeodeticDatumGeoKey, TYPE_SHORT,     1, KvUserDefined);
+	GTIFKeySet(gtif, GeogEllipsoidGeoKey, TYPE_SHORT,     1, Ellipse_Everest_1830_1967_Definition);
+	GTIFKeySet(gtif, GeogSemiMajorAxisGeoKey, TYPE_DOUBLE, 1, (double)6377298.556);
+	GTIFKeySet(gtif, GeogInvFlatteningGeoKey, TYPE_DOUBLE, 1, (double)300.8017);
+}
+
+void WriteImage(TIFF *tif)
+{
+	int i;
+	char buffer[WIDTH];
+	
+	memset(buffer,0,(size_t)WIDTH);
+	for (i=0;i<HEIGHT;i++)
+		if (!TIFFWriteScanline(tif, buffer, i, 0))
+			TIFFError("WriteImage","failure in WriteScanline\n");
+}
+
+
+
+

Added: packages/geotiff/libgeotiff-dfsg/trunk/config.guess
===================================================================
--- packages/geotiff/libgeotiff-dfsg/trunk/config.guess	                        (rev 0)
+++ packages/geotiff/libgeotiff-dfsg/trunk/config.guess	2007-09-19 11:39:06 UTC (rev 1077)
@@ -0,0 +1,1516 @@
+#! /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='2007-07-22'
+
+# 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 at bothner.com>.
+# Please send patches to <config-patches at 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 at 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 at 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 ;;
+	    sh5el) machine=sh5le-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 at 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.*:* | i86xen: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 ;;
+    *: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 ;;
+    *:Interix*:[3456]*)
+    	case ${UNAME_MACHINE} in
+	    x86)
+		echo i586-pc-interix${UNAME_RELEASE}
+		exit ;;
+	    EM64T | authenticamd)
+		echo x86_64-unknown-interix${UNAME_RELEASE}
+		exit ;;
+	esac ;;
+    [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 ;;
+    xtensa:Linux:*:*)
+    	echo xtensa-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 at ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit ;;
+    *:UNIX_System_V:4*:FTX*)
+	# From Gerald Hewes <hewes at openmarket.com>.
+	# How about differentiating between stratus architectures? -djm
+	echo hppa1.1-stratus-sysv4
+	exit ;;
+    *:*:*:FTX*)
+	# From seanf at swdc.stratus.com.
+	echo i860-stratus-sysv4
+	exit ;;
+    i*86:VOS:*:*)
+	# From Paul.Green at stratus.com.
+	echo ${UNAME_MACHINE}-stratus-vos
+	exit ;;
+    *:VOS:*:*)
+	# From Paul.Green at 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 ;;
+    SX-7:SUPER-UX:*:*)
+	echo sx7-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-8:SUPER-UX:*:*)
+	echo sx8-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-8R:SUPER-UX:*:*)
+	echo sx8r-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 at 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:

Added: packages/geotiff/libgeotiff-dfsg/trunk/config.sub
===================================================================
--- packages/geotiff/libgeotiff-dfsg/trunk/config.sub	                        (rev 0)
+++ packages/geotiff/libgeotiff-dfsg/trunk/config.sub	2007-09-19 11:39:06 UTC (rev 1077)
@@ -0,0 +1,1626 @@
+#! /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='2007-06-28'
+
+# 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 at 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 at 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 \
+	| fido | 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 | mep \
+	| 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 \
+	| score \
+	| 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 | xc16x | 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-* | fido-* | 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-* | xc16x-* | 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
+		;;
+	cr16)
+		basic_machine=cr16-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
+		;;
+	mingw32ce)
+		basic_machine=arm-unknown
+		os=-mingw32ce
+		;;
+	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
+		;;
+	sde)
+		basic_machine=mipsisa32-sde
+		os=-elf
+		;;
+	sei)
+		basic_machine=mips-sei
+		os=-seiux
+		;;
+	sequent)
+		basic_machine=i386-sequent
+		;;
+	sh)
+		basic_machine=sh-hitachi
+		os=-hms
+		;;
+	sh5el)
+		basic_machine=sh5le-unknown
+		;;
+	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* | -drops*)
+	# 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
+        score-*)
+		os=-elf
+		;;
+        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
+		;;
+        mep-*)
+		os=-elf
+		;;
+	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:

Added: packages/geotiff/libgeotiff-dfsg/trunk/configure
===================================================================
--- packages/geotiff/libgeotiff-dfsg/trunk/configure	                        (rev 0)
+++ packages/geotiff/libgeotiff-dfsg/trunk/configure	2007-09-19 11:39:06 UTC (rev 1077)
@@ -0,0 +1,5585 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.59.
+#
+# Copyright (C) 2003 Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)$' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\/\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
+  # Find who we are.  Look in the path if we contain no path at all
+  # relative or not.
+  case $0 in
+    *[\\/]* ) as_myself=$0 ;;
+    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+       ;;
+  esac
+  # We did not find ourselves, most probably we were run as `sh COMMAND'
+  # in which case we are not to be found in the path.
+  if test "x$as_myself" = x; then
+    as_myself=$0
+  fi
+  if test ! -f "$as_myself"; then
+    { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+   { (exit 1); exit 1; }; }
+  fi
+  case $CONFIG_SHELL in
+  '')
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for as_base in sh bash ksh sh5; do
+	 case $as_dir in
+	 /*)
+	   if ("$as_dir/$as_base" -c '
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
+	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+	     CONFIG_SHELL=$as_dir/$as_base
+	     export CONFIG_SHELL
+	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+	   fi;;
+	 esac
+       done
+done
+;;
+  esac
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line before each line; the second 'sed' does the real
+  # work.  The second script uses 'N' to pair each line-number line
+  # with the numbered line, and appends trailing '-' during
+  # substitution so that $LINENO is not a special case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
+  sed '=' <$as_myself |
+    sed '
+      N
+      s,$,-,
+      : loop
+      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      t loop
+      s,-$,,
+      s,^['$as_cr_digits']*\n,,
+    ' >$as_me.lineno &&
+  chmod +x $as_me.lineno ||
+    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensible to this).
+  . ./$as_me.lineno
+  # Exit status is that of the last command.
+  exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+  *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T='	' ;;
+  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more generic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conf$$.exe; then
+    # Don't use ln at all; we don't have any links
+    as_ln_s='cp -p'
+  else
+    as_ln_s='ln -s'
+  fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" 	$as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+exec 6>&1
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_config_libobj_dir=.
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Maximum number of lines to put in a shell here document.
+# This variable seems obsolete.  It should probably be removed, and
+# only ac_max_sed_lines should be used.
+: ${ac_max_here_lines=38}
+
+# Identity of this package.
+PACKAGE_NAME=
+PACKAGE_TARNAME=
+PACKAGE_VERSION=
+PACKAGE_STRING=
+PACKAGE_BUGREPORT=
+
+ac_unique_file="geotiff.h"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#else
+# if HAVE_STDINT_H
+#  include <stdint.h>
+# endif
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os VERSION_MAJOR VERSION_MINOR VERSION_POINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX_WFLAGS C_WFLAGS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S RANLIB ac_ct_RANLIB CXX_PIC C_PIC LD_SHARED SO_EXT GEOTIFF_SO GEOTIFF_IMP GEOTIFF_DLL CPP EGREP ZIP_INC TIFF_INC PROJ_INC CSV_SOURCE LIBOBJS LTLIBOBJS'
+ac_subst_files=''
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+ac_prev=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval "$ac_prev=\$ac_option"
+    ac_prev=
+    continue
+  fi
+
+  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_option in
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias=$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+  | --da=*)
+    datadir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    eval "enable_$ac_feature=no" ;;
+
+  -enable-* | --enable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "enable_$ac_feature='$ac_optarg'" ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst \
+  | --locals | --local | --loca | --loc | --lo)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix=$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix=$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name=$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site=$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias=$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "with_$ac_package='$ac_optarg'" ;;
+
+  -without-* | --without-*)
+    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package | sed 's/-/_/g'`
+    eval "with_$ac_package=no" ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes=$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries=$ac_optarg ;;
+
+  -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; }
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+   { (exit 1); exit 1; }; }
+    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+    eval "$ac_envvar='$ac_optarg'"
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  { echo "$as_me: error: missing argument to $ac_option" >&2
+   { (exit 1); exit 1; }; }
+fi
+
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
+do
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+	      localstatedir libdir includedir oldincludedir infodir mandir
+do
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* ) ;;
+    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used." >&2
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then its parent.
+  ac_confdir=`(dirname "$0") 2>/dev/null ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$0" : 'X\(//\)[^/]' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$0" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+  srcdir=$ac_confdir
+  if test ! -r $srcdir/$ac_unique_file; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+  if test "$ac_srcdir_defaulted" = yes; then
+    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+   { (exit 1); exit 1; }; }
+  else
+    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+  fi
+fi
+(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
+  { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+   { (exit 1); exit 1; }; }
+srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+ac_env_build_alias_set=${build_alias+set}
+ac_env_build_alias_value=$build_alias
+ac_cv_env_build_alias_set=${build_alias+set}
+ac_cv_env_build_alias_value=$build_alias
+ac_env_host_alias_set=${host_alias+set}
+ac_env_host_alias_value=$host_alias
+ac_cv_env_host_alias_set=${host_alias+set}
+ac_cv_env_host_alias_value=$host_alias
+ac_env_target_alias_set=${target_alias+set}
+ac_env_target_alias_value=$target_alias
+ac_cv_env_target_alias_set=${target_alias+set}
+ac_cv_env_target_alias_value=$target_alias
+ac_env_CC_set=${CC+set}
+ac_env_CC_value=$CC
+ac_cv_env_CC_set=${CC+set}
+ac_cv_env_CC_value=$CC
+ac_env_CFLAGS_set=${CFLAGS+set}
+ac_env_CFLAGS_value=$CFLAGS
+ac_cv_env_CFLAGS_set=${CFLAGS+set}
+ac_cv_env_CFLAGS_value=$CFLAGS
+ac_env_LDFLAGS_set=${LDFLAGS+set}
+ac_env_LDFLAGS_value=$LDFLAGS
+ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
+ac_cv_env_LDFLAGS_value=$LDFLAGS
+ac_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_env_CPPFLAGS_value=$CPPFLAGS
+ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_cv_env_CPPFLAGS_value=$CPPFLAGS
+ac_env_CPP_set=${CPP+set}
+ac_env_CPP_value=$CPP
+ac_cv_env_CPP_set=${CPP+set}
+ac_cv_env_CPP_value=$CPP
+
+#
+# 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 this package to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+_ACEOF
+
+  cat <<_ACEOF
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+			  [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+			  [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR           user executables [EPREFIX/bin]
+  --sbindir=DIR          system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR       program executables [EPREFIX/libexec]
+  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
+  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
+  --libdir=DIR           object code libraries [EPREFIX/lib]
+  --includedir=DIR       C header files [PREFIX/include]
+  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
+  --infodir=DIR          info documentation [PREFIX/info]
+  --mandir=DIR           man documentation [PREFIX/man]
+_ACEOF
+
+  cat <<\_ACEOF
+
+System types:
+  --build=BUILD     configure for building on BUILD [guessed]
+  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
+  --target=TARGET   configure for building compilers for TARGET [HOST]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --enable-incode-epsg	  Use C code EPSG tables
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --without-ld-shared   Disable shared library support
+  --with-zip=dir          Use ZIP library in directory dir
+  --with-jpeg=dir         Use JPEG library in directory dir
+  --with-libtiff=dir      Use libtiff in directory dir
+  --with-proj=ARG       Use PROJ.4 library (ARG=no or path)
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
+              headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+_ACEOF
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  ac_popdir=`pwd`
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d $ac_dir || continue
+    ac_builddir=.
+
+if test "$ac_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+  .)  # No --srcdir option.  We are building in place.
+    ac_srcdir=.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
+
+    cd $ac_dir
+    # Check for guested configure; otherwise get Cygnus style configure.
+    if test -f $ac_srcdir/configure.gnu; then
+      echo
+      $SHELL $ac_srcdir/configure.gnu  --help=recursive
+    elif test -f $ac_srcdir/configure; then
+      echo
+      $SHELL $ac_srcdir/configure  --help=recursive
+    elif test -f $ac_srcdir/configure.ac ||
+	   test -f $ac_srcdir/configure.in; then
+      echo
+      $ac_configure --help
+    else
+      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi
+    cd "$ac_popdir"
+  done
+fi
+
+test -n "$ac_init_help" && exit 0
+if $ac_init_version; then
+  cat <<\_ACEOF
+
+Copyright (C) 2003 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit 0
+fi
+exec 5>config.log
+cat >&5 <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by $as_me, which was
+generated by GNU Autoconf 2.59.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  echo "PATH: $as_dir"
+done
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_sep=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    2)
+      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+	ac_must_keep_next=false # Got value, back to normal.
+      else
+	case $ac_arg in
+	  *=* | --config-cache | -C | -disable-* | --disable-* \
+	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+	  | -with-* | --with-* | -without-* | --without-* | --x)
+	    case "$ac_configure_args0 " in
+	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+	    esac
+	    ;;
+	  -* ) ac_must_keep_next=true ;;
+	esac
+      fi
+      ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+      # Get rid of the leading space.
+      ac_sep=" "
+      ;;
+    esac
+  done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Be sure not to use single quotes in there, as some shells,
+# such as our DU 5.0 friend, will then `close' the trap.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+{
+  (set) 2>&1 |
+    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+    *ac_space=\ *)
+      sed -n \
+	"s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+      ;;
+    *)
+      sed -n \
+	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      ;;
+    esac;
+}
+    echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=$`echo $ac_var`
+      echo "$ac_var='"'"'$ac_val'"'"'"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------- ##
+## Output files. ##
+## ------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+	eval ac_val=$`echo $ac_var`
+	echo "$ac_var='"'"'$ac_val'"'"'"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      sed "/^$/d" confdefs.h | sort
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      echo "$as_me: caught signal $ac_signal"
+    echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core &&
+  rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+     ' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo >confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+  if test "x$prefix" != xNONE; then
+    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+  else
+    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+  fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+  if test -r "$ac_site_file"; then
+    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special
+  # files actually), so we avoid doing that.
+  if test -f "$cache_file"; then
+    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . $cache_file;;
+      *)                      . ./$cache_file;;
+    esac
+  fi
+else
+  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in `(set) 2>&1 |
+	       sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+  eval ac_new_val="\$ac_env_${ac_var}_value"
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
+echo "$as_me:   former value:  $ac_old_val" >&2;}
+	{ echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
+echo "$as_me:   current value: $ac_new_val" >&2;}
+	ac_cache_corrupted=:
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+      ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+          ac_config_headers="$ac_config_headers geo_config.h"
+
+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
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"
+ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
+
+# Make sure we can run config.sub.
+$ac_config_sub sun4 >/dev/null 2>&1 ||
+  { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
+echo "$as_me: error: cannot run $ac_config_sub" >&2;}
+   { (exit 1); exit 1; }; }
+
+echo "$as_me:$LINENO: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6
+if test "${ac_cv_build+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_build_alias=$build_alias
+test -z "$ac_cv_build_alias" &&
+  ac_cv_build_alias=`$ac_config_guess`
+test -z "$ac_cv_build_alias" &&
+  { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+   { (exit 1); exit 1; }; }
+ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
+  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6
+build=$ac_cv_build
+build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+echo "$as_me:$LINENO: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6
+if test "${ac_cv_host+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_host_alias=$host_alias
+test -z "$ac_cv_host_alias" &&
+  ac_cv_host_alias=$ac_cv_build_alias
+ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
+  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6
+host=$ac_cv_host
+host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+echo "$as_me:$LINENO: checking target system type" >&5
+echo $ECHO_N "checking target system type... $ECHO_C" >&6
+if test "${ac_cv_target+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_target_alias=$target_alias
+test "x$ac_cv_target_alias" = "x" &&
+  ac_cv_target_alias=$ac_cv_host_alias
+ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
+  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_target" >&5
+echo "${ECHO_T}$ac_cv_target" >&6
+target=$ac_cv_target
+target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+test -n "$target_alias" &&
+  test "$program_prefix$program_suffix$program_transform_name" = \
+    NONENONEs,x,x, &&
+  program_prefix=${target_alias}-
+
+VERSION_MAJOR=1
+VERSION_MINOR=2
+VERSION_POINT=4
+VERSION_MAJOR=$VERSION_MAJOR
+
+VERSION_MINOR=$VERSION_MINOR
+
+VERSION_POINT=$VERSION_POINT
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  CC=$ac_ct_CC
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  CC=$ac_ct_CC
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$ac_ct_CC" && break
+done
+
+  CC=$ac_ct_CC
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+     "checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+  (eval $ac_compiler --version </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+  (eval $ac_compiler -v </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+  (eval $ac_compiler -V </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
+  (eval $ac_link_default) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Find the output, starting from the most likely.  This scheme is
+# not robust to junk in `.', hence go to wildcards (a.*) only as a last
+# resort.
+
+# Be careful to initialize this variable, since it used to be cached.
+# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
+ac_cv_exeext=
+# b.out is created by i960 compilers.
+for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+	;;
+    conftest.$ac_ext )
+	# This is the source file.
+	;;
+    [ab].out )
+	# We found the default executable, but exeext='' is most
+	# certainly right.
+	break;;
+    *.* )
+	ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	# FIXME: I believe we export ac_cv_exeext for Libtool,
+	# but it would be cool to find out if it's true.  Does anybody
+	# maintain Libtool? --akim.
+	export ac_cv_exeext
+	break;;
+    * )
+	break;;
+  esac
+done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6
+
+# Check the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+  if { ac_try='./$ac_file'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6
+
+echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	  export ac_cv_exeext
+	  break;;
+    * ) break;;
+  esac
+done
+else
+  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+if test "${ac_cv_objext+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+CFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cc_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std1 is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std1.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX			-qlanglvl=ansi
+# Ultrix and OSF/1	-std1
+# HP-UX 10.20 and later	-Ae
+# HP-UX older versions	-Aa -D_HPUX_SOURCE
+# SVR4			-Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+  x|xno)
+    echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+  *)
+    echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+    CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+
+# Some people use a C++ compiler to compile C.  Since we use `exit',
+# in C++ we need to declare it.  In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+#ifndef __cplusplus
+  choke me
+#endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  for ac_declaration in \
+   '' \
+   'extern "C" void std::exit (int) throw (); using std::exit;' \
+   'extern "C" void std::exit (int); using std::exit;' \
+   'extern "C" void exit (int) throw ();' \
+   'extern "C" void exit (int);' \
+   'void exit (int);'
+do
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_declaration
+#include <stdlib.h>
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+  echo '#ifdef __cplusplus' >>confdefs.h
+  echo $ac_declaration      >>confdefs.h
+  echo '#endif'             >>confdefs.h
+fi
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+	# Remove -g from compile flags, we will add via CFG variable if
+	# we need it.
+	CXXFLAGS=`echo "$CXXFLAGS " | sed "s/-g //"`
+	CFLAGS=`echo "$CFLAGS " | sed "s/-g //"`
+
+	# check for GNU compiler, and use -Wall
+	if test "$GCC" = "yes"; then
+		C_WFLAGS="-Wall"
+		CFLAGS="$CFLAGS -Wall"
+		cat >>confdefs.h <<\_ACEOF
+#define USE_GNUCC 1
+_ACEOF
+
+	fi
+	if test "$GXX" = "yes"; then
+		CXX_WFLAGS="-Wall"
+		CXXFLAGS="$CXXFLAGS -Wall"
+		cat >>confdefs.h <<\_ACEOF
+#define USE_GNUCC 1
+_ACEOF
+
+	fi
+	CXX_WFLAGS=$CXX_WFLAGS
+
+	C_WFLAGS=$C_WFLAGS
+
+
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+  ./ | .// | /cC/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+	if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+	  if test $ac_prog = install &&
+	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  elif test $ac_prog = install &&
+	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # program-specific install script used by HP pwplus--don't use.
+	    :
+	  else
+	    ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	    break 3
+	  fi
+	fi
+      done
+    done
+    ;;
+esac
+done
+
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  We don't cache a
+    # path for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the path is relative.
+    INSTALL=$ac_install_sh
+  fi
+fi
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+echo "$as_me:$LINENO: checking whether 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
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  RANLIB=$ac_ct_RANLIB
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+
+	echo 'void f(){}' > conftest.c
+	if test -z "`${CC-cc} -fPIC -c conftest.c 2>&1`"; then
+	  C_PIC=-fPIC
+	else
+	  C_PIC=
+	fi
+	if test -z "`${CXX-g++} -fPIC -c conftest.c 2>&1`"; then
+	  CXX_PIC=-fPIC
+	else
+	  CXX_PIC=
+	fi
+	rm -f conftest*
+
+	CXX_PIC=$CXX_PIC
+
+	C_PIC=$C_PIC
+
+
+
+  echo 'void g(); int main(){ g(); return 0; }' > conftest1.c
+
+  echo '#include <stdio.h>' > conftest2.c
+  echo 'void g(); void g(){printf("");}' >> conftest2.c
+  ${CC} ${C_PIC} -c conftest2.c
+
+  SO_EXT="so"
+  export SO_EXT
+  LD_SHARED="/bin/true"
+  if test ! -z "`uname -a | grep IRIX`" ; then
+    IRIX_ALL=-all
+  else
+    IRIX_ALL=
+  fi
+
+
+# Check whether --with-ld-shared or --without-ld-shared was given.
+if test "${with_ld_shared+set}" = set; then
+  withval="$with_ld_shared"
+
+fi;
+
+  if test "$with_ld_shared" != "" ; then
+    if test "$with_ld_shared" = "no" ; then
+      echo "user disabled shared library support."
+    else
+      echo "using user supplied .so link command ... $with_ld_shared"
+    fi
+    LD_SHARED="$with_ld_shared"
+  fi
+
+
+  if test ! -z "`uname -a | grep CYGWIN`" \
+        -a "$LD_SHARED" = "/bin/true" \
+	-a -z "`gcc -shared conftest2.o -o libconftest.dll`" ; then
+    if test -z "`${CC} conftest1.c -L./ -lconftest -o conftest1 2>&1`"; then
+      LD_LIBRARY_PATH_OLD="$LD_LIBRARY_PATH"
+      if test -z "$LD_LIBRARY_PATH" ; then
+        LD_LIBRARY_PATH="`pwd`"
+      else
+        LD_LIBRARY_PATH="`pwd`:$LD_LIBRARY_PATH"
+      fi
+      export LD_LIBRARY_PATH
+      if test -z "`./conftest1 2>&1`" ; then
+        echo "checking for Cygwin gcc -shared ... yes"
+        LD_SHARED="c++ -shared"
+        SO_EXT="dll"
+      fi
+      LD_LIBRARY_PATH="$LD_LIBRARY_PATH_OLD"
+    fi
+  fi
+
+
+  if test ! -z "`uname | grep Darwin`" \
+          -a "$LD_SHARED" = "/bin/true" \
+          -a -z "`${CXX} -dynamiclib conftest2.o -o libconftest.so 2>&1`" ; then
+    ${CC} -c conftest1.c
+    if test -z "`${CXX} conftest1.o libconftest.so -o conftest1 2>&1`"; then
+      DYLD_LIBRARY_PATH_OLD="$DYLD_LIBRARY_PATH"
+      if test -z "$DYLD_LIBRARY_PATH" ; then
+        DYLD_LIBRARY_PATH="`pwd`"
+      else
+        DYLD_LIBRARY_PATH="`pwd`:$DYLD_LIBRARY_PATH"
+      fi
+      export DYLD_LIBRARY_PATH
+      if test -z "`./conftest1 2>&1`" ; then
+        echo "checking for ${CXX} -dynamiclib ... yes"
+        LD_SHARED="${CXX} -dynamiclib"
+	SO_EXT=dylib
+      fi
+      DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH_OLD"
+    fi
+    rm -f conftest1.o
+  fi
+
+  if test "$LD_SHARED" = "/bin/true" \
+	-a -z "`${CXX} -shared $IRIX_ALL conftest2.o -o libconftest.so 2>&1|grep -v WARNING`" ; then
+    if test -z "`${CC} conftest1.c libconftest.so -o conftest1 2>&1`"; then
+      LD_LIBRARY_PATH_OLD="$LD_LIBRARY_PATH"
+      if test -z "$LD_LIBRARY_PATH" ; then
+        LD_LIBRARY_PATH="`pwd`"
+      else
+        LD_LIBRARY_PATH="`pwd`:$LD_LIBRARY_PATH"
+      fi
+      export LD_LIBRARY_PATH
+      if test -z "`./conftest1 2>&1`" ; then
+        echo "checking for ${CXX} -shared ... yes"
+        LD_SHARED="${CXX} -shared $IRIX_ALL"
+      else
+        echo "checking for ${CXX} -shared ... no(3)"
+      fi
+      LD_LIBRARY_PATH="$LD_LIBRARY_PATH_OLD"
+    else
+      echo "checking for ${CXX} -shared ... no(2)"
+    fi
+  else
+    if test "$LD_SHARED" = "/bin/true" ; then
+      echo "checking for ${CXX} -shared ... no(1)"
+    fi
+  fi
+
+  if test "$LD_SHARED" = "/bin/true" \
+          -a -z "`ld -shared conftest2.o -o libconftest.so 2>&1`" ; then
+    if test -z "`${CC} conftest1.c libconftest.so -o conftest1 2>&1`"; then
+      LD_LIBRARY_PATH_OLD="$LD_LIBRARY_PATH"
+      if test -z "$LD_LIBRARY_PATH" ; then
+        LD_LIBRARY_PATH="`pwd`"
+      else
+        LD_LIBRARY_PATH="`pwd`:$LD_LIBRARY_PATH"
+      fi
+      export LD_LIBRARY_PATH
+      if test -z "`./conftest1 2>&1`" ; then
+        echo "checking for ld -shared ... yes"
+        LD_SHARED="ld -shared"
+      fi
+      LD_LIBRARY_PATH="$LD_LIBRARY_PATH_OLD"
+    fi
+  fi
+
+  if test "$LD_SHARED" = "/bin/true" ; then
+    echo "checking for ld -shared ... no"
+    if test ! -x /bin/true ; then
+      LD_SHARED=/usr/bin/true
+    fi
+  fi
+  if test "$LD_SHARED" = "no" ; then
+    if test -x /bin/true ; then
+      LD_SHARED=/bin/true
+    else
+      LD_SHARED=/usr/bin/true
+    fi
+  fi
+
+  rm -f conftest* libconftest*
+
+  LD_SHARED=$LD_SHARED
+
+  SO_EXT=$SO_EXT
+
+
+
+#
+#	If we have shared library support define that we want to build
+# 	the libgeotiff.so
+
+GEOTIFF_SO=
+GEOTIFF_DLL=
+GEOTIFF_IMP=
+EXEEXT=
+if test "$LD_SHARED" != "/bin/true" ; then
+  case $host in
+    *-pc-cygwin*) EXEEXT=.exe
+		  GEOTIFF_SO=cyggeotiff-1.dll
+	          GEOTIFF_DLL=cyggeotiff-1.dll
+	          GEOTIFF_IMP=libgeotiff.dll.a
+                  LD_SHARED="gcc -shared -Wl,--export-all -Wl,--out-implib=\$(GEOTIFF_IMP)" ;;
+    *) GEOTIFF_SO=libgeotiff.${SO_EXT}.$VERSION_MAJOR.$VERSION_MINOR.$VERSION_POINT ;;
+  esac
+fi
+GEOTIFF_SO=$GEOTIFF_SO
+
+GEOTIFF_IMP=$GEOTIFF_IMP
+
+GEOTIFF_DLL=$GEOTIFF_DLL
+
+EXEEXT=$EXEEXT
+
+
+
+
+echo "$as_me:$LINENO: checking for exp in -lm" >&5
+echo $ECHO_N "checking for exp in -lm... $ECHO_C" >&6
+if test "${ac_cv_lib_m_exp+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char exp ();
+int
+main ()
+{
+exp ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_m_exp=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_m_exp=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_m_exp" >&5
+echo "${ECHO_T}$ac_cv_lib_m_exp" >&6
+if test $ac_cv_lib_m_exp = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+  LIBS="-lm $LIBS"
+
+fi
+
+
+LIBS="$LDFLAGS $LIBS"
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6
+if test "${ac_cv_prog_egrep+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+    then ac_cv_prog_egrep='grep -E'
+    else ac_cv_prog_egrep='egrep'
+    fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
+echo "${ECHO_T}$ac_cv_prog_egrep" >&6
+ EGREP=$ac_cv_prog_egrep
+
+
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_header_stdc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_stdc=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then
+  :
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+		   (('a' <= (c) && (c) <= 'i') \
+		     || ('j' <= (c) && (c) <= 'r') \
+		     || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+	|| toupper (i) != TOUPPER (i))
+      exit(2);
+  exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+		  inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+for ac_header in string.h strings.h stdlib.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+# Check whether --with-zip or --without-zip was given.
+if test "${with_zip+set}" = set; then
+  withval="$with_zip"
+  ZIP=$withval
+else
+  ZIP=yes
+fi;
+if test "$ZIP" = "yes" ; then
+
+echo "$as_me:$LINENO: checking for inflateInit_ in -lz" >&5
+echo $ECHO_N "checking for inflateInit_ in -lz... $ECHO_C" >&6
+if test "${ac_cv_lib_z_inflateInit_+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lz -lm $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char inflateInit_ ();
+int
+main ()
+{
+inflateInit_ ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_z_inflateInit_=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_z_inflateInit_=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_z_inflateInit_" >&5
+echo "${ECHO_T}$ac_cv_lib_z_inflateInit_" >&6
+if test $ac_cv_lib_z_inflateInit_ = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBZ 1
+_ACEOF
+
+  LIBS="-lz $LIBS"
+
+fi
+
+
+for ac_header in zlib.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+  cat >>confdefs.h <<\_ACEOF
+#define HAVE_ZIP 1
+_ACEOF
+
+else
+  if test "$ZIP" != "no" ; then
+    LIBS="${LIBS} -L${ZIP}/lib -lz"
+    ZIP_INC="-I${ZIP}/include"
+    ZIP_INC=$ZIP_INC
+
+    cat >>confdefs.h <<\_ACEOF
+#define HAVE_ZIP 1
+_ACEOF
+
+    echo "Using user supplied libzip directory: "$ZIP
+  fi
+fi
+
+
+# Check whether --with-jpeg or --without-jpeg was given.
+if test "${with_jpeg+set}" = set; then
+  withval="$with_jpeg"
+  JPEG=$withval
+else
+  JPEG=yes
+fi;
+if test "$JPEG" = "yes" ; then
+
+echo "$as_me:$LINENO: checking for jinit_compress_master in -ljpeg" >&5
+echo $ECHO_N "checking for jinit_compress_master in -ljpeg... $ECHO_C" >&6
+if test "${ac_cv_lib_jpeg_jinit_compress_master+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ljpeg -lm $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char jinit_compress_master ();
+int
+main ()
+{
+jinit_compress_master ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_jpeg_jinit_compress_master=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_jpeg_jinit_compress_master=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_jpeg_jinit_compress_master" >&5
+echo "${ECHO_T}$ac_cv_lib_jpeg_jinit_compress_master" >&6
+if test $ac_cv_lib_jpeg_jinit_compress_master = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBJPEG 1
+_ACEOF
+
+  LIBS="-ljpeg $LIBS"
+
+fi
+
+  cat >>confdefs.h <<\_ACEOF
+#define HAVE_JPEG 1
+_ACEOF
+
+else
+  if test "$JPEG" != "no" ; then
+    LIBS="${LIBS} -L${JPEG} -ljpeg"
+    cat >>confdefs.h <<\_ACEOF
+#define HAVE_JPEG 1
+_ACEOF
+
+    echo "Using user supplied libjpeg directory: "$JPEG
+  fi
+fi
+
+
+# Check whether --with-libtiff or --without-libtiff was given.
+if test "${with_libtiff+set}" = set; then
+  withval="$with_libtiff"
+
+fi;
+
+if test "$with_libtiff" != "" ; then
+  if test -f $with_libtiff/include/tiffio.h -a -d $with_libtiff/lib ; then
+    LIBS="-L$with_libtiff/lib -ltiff $LIBS"
+    TIFF_INC=-I$with_libtiff/include
+  else
+    LIBS="-L$with_libtiff -ltiff $LIBS"
+    TIFF_INC=-I$with_libtiff
+  fi
+  LIBS_SAVED="$LIBS"
+
+echo "$as_me:$LINENO: checking for TIFFOpen in -ltiff" >&5
+echo $ECHO_N "checking for TIFFOpen in -ltiff... $ECHO_C" >&6
+if test "${ac_cv_lib_tiff_TIFFOpen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ltiff -lm $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char TIFFOpen ();
+int
+main ()
+{
+TIFFOpen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_tiff_TIFFOpen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_tiff_TIFFOpen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_tiff_TIFFOpen" >&5
+echo "${ECHO_T}$ac_cv_lib_tiff_TIFFOpen" >&6
+if test $ac_cv_lib_tiff_TIFFOpen = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBTIFF 1
+_ACEOF
+
+  LIBS="-ltiff $LIBS"
+
+else
+  { { echo "$as_me:$LINENO: error: failed to link with -ltiff to find TIFFOpen" >&5
+echo "$as_me: error: failed to link with -ltiff to find TIFFOpen" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+echo "$as_me:$LINENO: checking for TIFFMergeFieldInfo in -ltiff" >&5
+echo $ECHO_N "checking for TIFFMergeFieldInfo in -ltiff... $ECHO_C" >&6
+if test "${ac_cv_lib_tiff_TIFFMergeFieldInfo+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ltiff -lm $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char TIFFMergeFieldInfo ();
+int
+main ()
+{
+TIFFMergeFieldInfo ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_tiff_TIFFMergeFieldInfo=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_tiff_TIFFMergeFieldInfo=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_tiff_TIFFMergeFieldInfo" >&5
+echo "${ECHO_T}$ac_cv_lib_tiff_TIFFMergeFieldInfo" >&6
+if test $ac_cv_lib_tiff_TIFFMergeFieldInfo = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBTIFF 1
+_ACEOF
+
+  LIBS="-ltiff $LIBS"
+
+else
+  { { echo "$as_me:$LINENO: error: Libtiff 3.6.0 Beta or later required for this version of
+libgeotiff. Please upgrade or use an older version of libgeotiff." >&5
+echo "$as_me: error: Libtiff 3.6.0 Beta or later required for this version of
+libgeotiff. Please upgrade or use an older version of libgeotiff." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+  LIBS="$LIBS_SAVED"
+else
+
+echo "$as_me:$LINENO: checking for TIFFOpen in -ltiff" >&5
+echo $ECHO_N "checking for TIFFOpen in -ltiff... $ECHO_C" >&6
+if test "${ac_cv_lib_tiff_TIFFOpen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ltiff -lm $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char TIFFOpen ();
+int
+main ()
+{
+TIFFOpen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_tiff_TIFFOpen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_tiff_TIFFOpen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_tiff_TIFFOpen" >&5
+echo "${ECHO_T}$ac_cv_lib_tiff_TIFFOpen" >&6
+if test $ac_cv_lib_tiff_TIFFOpen = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBTIFF 1
+_ACEOF
+
+  LIBS="-ltiff $LIBS"
+
+else
+  { { echo "$as_me:$LINENO: error: You will need to substantially rewrite libxtiff to
+build libgeotiff without libtiff" >&5
+echo "$as_me: error: You will need to substantially rewrite libxtiff to
+build libgeotiff without libtiff" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+  LIBS_SAVED="$LIBS"
+
+echo "$as_me:$LINENO: checking for TIFFMergeFieldInfo in -ltiff" >&5
+echo $ECHO_N "checking for TIFFMergeFieldInfo in -ltiff... $ECHO_C" >&6
+if test "${ac_cv_lib_tiff_TIFFMergeFieldInfo+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ltiff -lm $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char TIFFMergeFieldInfo ();
+int
+main ()
+{
+TIFFMergeFieldInfo ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_tiff_TIFFMergeFieldInfo=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_tiff_TIFFMergeFieldInfo=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_tiff_TIFFMergeFieldInfo" >&5
+echo "${ECHO_T}$ac_cv_lib_tiff_TIFFMergeFieldInfo" >&6
+if test $ac_cv_lib_tiff_TIFFMergeFieldInfo = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBTIFF 1
+_ACEOF
+
+  LIBS="-ltiff $LIBS"
+
+else
+  { { echo "$as_me:$LINENO: error: Libtiff 3.6.0 Beta or later required for this version of
+libgeotiff. Please upgrade libtiff or use an older version of libgeotiff." >&5
+echo "$as_me: error: Libtiff 3.6.0 Beta or later required for this version of
+libgeotiff. Please upgrade libtiff or use an older version of libgeotiff." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+  LIBS="$LIBS_SAVED"
+  TIFF_INC=
+fi
+
+TIFF_INC=$TIFF_INC
+
+
+
+
+# Check whether --with-proj or --without-proj was given.
+if test "${with_proj+set}" = set; then
+  withval="$with_proj"
+  PROJ_HOME=$withval
+else
+  PROJ_HOME=
+fi;
+
+if test "$PROJ_HOME" != "" -a "$PROJ_HOME" != "no" ; then
+  if test -d "$PROJ_HOME/src/pj_init.c" ; then
+    PROJ_HOME=$PROJ_HOME/src
+  fi
+
+    if test -f "$PROJ_HOME/libproj.a" -a -f "$PROJ_HOME/projects.h" ; then
+    PROJ_LIB=$PROJ_HOME/libproj.a
+    PROJ_INC=$PROJ_HOME
+
+    elif test -f "$PROJ_HOME/.libs/libproj.a" -a -f "$PROJ_HOME/projects.h" ; then
+    PROJ_LIB=$PROJ_HOME/.libs/libproj.a
+    PROJ_INC=$PROJ_HOME
+
+    elif test \( -f "$PROJ_HOME/lib/libproj.a" -o -f "$PROJ_HOME/lib/libproj.so" \) -a -f "$PROJ_HOME/include/proj_api.h"; then
+    PROJ_LIB="-L$PROJ_HOME/lib -lproj"
+    PROJ_INC=$PROJ_HOME/include
+  else
+    echo "PROJ_HOME=$PROJ_HOME, but either projects.h or libproj.a not found!"
+  fi
+fi
+
+if test "$PROJ_HOME" = "no" ; then
+  echo "PROJ.4 support disabled."
+
+elif test "$PROJ_LIB" != "" -a "$PROJ_INC" != "" ; then
+  echo "Found $PROJ_LIB"
+  echo "Found $PROJ_INC/projects.h"
+
+  LIBS="$PROJ_LIB $LIBS"
+  PROJ_INC=-I$PROJ_INC
+
+  PROJ_INC=$PROJ_INC
+
+  cat >>confdefs.h <<\_ACEOF
+#define HAVE_PROJECTS_H 1
+_ACEOF
+
+  cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBPROJ 1
+_ACEOF
+
+else
+
+echo "$as_me:$LINENO: checking for pj_init in -lproj" >&5
+echo $ECHO_N "checking for pj_init in -lproj... $ECHO_C" >&6
+if test "${ac_cv_lib_proj_pj_init+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lproj -lm $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char pj_init ();
+int
+main ()
+{
+pj_init ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_proj_pj_init=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_proj_pj_init=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_proj_pj_init" >&5
+echo "${ECHO_T}$ac_cv_lib_proj_pj_init" >&6
+if test $ac_cv_lib_proj_pj_init = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBPROJ 1
+_ACEOF
+
+  LIBS="-lproj $LIBS"
+
+fi
+
+
+for ac_header in projects.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+fi
+
+
+# Check whether --enable-incode-epsg or --disable-incode-epsg was given.
+if test "${enable_incode_epsg+set}" = set; then
+  enableval="$enable_incode_epsg"
+
+else
+  enable_incode_epsg=no
+fi;
+
+if test "$enable_incode_epsg" != "yes" ; then
+   echo "EPSG tables will be read from .csv files."
+   CSV_SOURCE="\$(CSV_FILE_OBJS)"
+else
+   echo "EPSG tables will be linked into library."
+   CSV_SOURCE="\$(CSV_INCODE_OBJS)"
+fi
+CSV_SOURCE=$CSV_SOURCE
+
+
+
+
+
+                    ac_config_files="$ac_config_files Makefile bin/Makefile"
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+{
+  (set) 2>&1 |
+    case `(ac_space=' '; set | grep ac_space) 2>&1` in
+    *ac_space=\ *)
+      # `set' does not quote correctly, so add quotes (double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \).
+      sed -n \
+	"s/'/'\\\\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;;
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n \
+	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      ;;
+    esac;
+} |
+  sed '
+     t clear
+     : clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     : end' >>confcache
+if diff $cache_file confcache >/dev/null 2>&1; then :; else
+  if test -w $cache_file; then
+    test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+    cat confcache >$cache_file
+  else
+    echo "not updating unwritable cache $cache_file"
+  fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@srcdir@:*/:/;
+s/^\([^=]*=[	 ]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[	 ]*$//;
+}'
+fi
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_i=`echo "$ac_i" |
+	 sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+  # 2. Add them.
+  ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)$' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\/\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
+  # Find who we are.  Look in the path if we contain no path at all
+  # relative or not.
+  case $0 in
+    *[\\/]* ) as_myself=$0 ;;
+    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+       ;;
+  esac
+  # We did not find ourselves, most probably we were run as `sh COMMAND'
+  # in which case we are not to be found in the path.
+  if test "x$as_myself" = x; then
+    as_myself=$0
+  fi
+  if test ! -f "$as_myself"; then
+    { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
+echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+  case $CONFIG_SHELL in
+  '')
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for as_base in sh bash ksh sh5; do
+	 case $as_dir in
+	 /*)
+	   if ("$as_dir/$as_base" -c '
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
+	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+	     CONFIG_SHELL=$as_dir/$as_base
+	     export CONFIG_SHELL
+	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+	   fi;;
+	 esac
+       done
+done
+;;
+  esac
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line before each line; the second 'sed' does the real
+  # work.  The second script uses 'N' to pair each line-number line
+  # with the numbered line, and appends trailing '-' during
+  # substitution so that $LINENO is not a special case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
+  sed '=' <$as_myself |
+    sed '
+      N
+      s,$,-,
+      : loop
+      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      t loop
+      s,-$,,
+      s,^['$as_cr_digits']*\n,,
+    ' >$as_me.lineno &&
+  chmod +x $as_me.lineno ||
+    { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
+echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensible to this).
+  . ./$as_me.lineno
+  # Exit status is that of the last command.
+  exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+  *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T='	' ;;
+  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more generic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conf$$.exe; then
+    # Don't use ln at all; we don't have any links
+    as_ln_s='cp -p'
+  else
+    as_ln_s='ln -s'
+  fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" 	$as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+exec 6>&1
+
+# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.  Logging --version etc. is OK.
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+} >&5
+cat >&5 <<_CSEOF
+
+This file was extended by $as_me, which was
+generated by GNU Autoconf 2.59.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+_CSEOF
+echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
+echo >&5
+_ACEOF
+
+# Files that config.status was made for.
+if test -n "$ac_config_files"; then
+  echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_headers"; then
+  echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_links"; then
+  echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_commands"; then
+  echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number, then exit
+  -q, --quiet      do not print progress messages
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+  --file=FILE[:TEMPLATE]
+		   instantiate the configuration file FILE
+  --header=FILE[:TEMPLATE]
+		   instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Report bugs to <bug-autoconf at gnu.org>."
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+config.status
+configured by $0, generated by GNU Autoconf 2.59,
+  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2003 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+srcdir=$srcdir
+INSTALL="$INSTALL"
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value.  By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=*)
+    ac_option=`expr "x$1" : 'x\([^=]*\)='`
+    ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  -*)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  *) # This is not an option, so the user has probably given explicit
+     # arguments.
+     ac_option=$1
+     ac_need_defaults=false;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --vers* | -V )
+    echo "$ac_cs_version"; exit 0 ;;
+  --he | --h)
+    # Conflict between --help and --header
+    { { echo "$as_me:$LINENO: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2;}
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    echo "$ac_cs_usage"; exit 0 ;;
+  --debug | --d* | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+    ac_need_defaults=false;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2;}
+   { (exit 1); exit 1; }; } ;;
+
+  *) ac_config_targets="$ac_config_targets $1" ;;
+
+  esac
+  shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+  echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+  exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
+
+_ACEOF
+
+
+
+
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_config_target in $ac_config_targets
+do
+  case "$ac_config_target" in
+  # Handling of arguments.
+  "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+  "bin/Makefile" ) CONFIG_FILES="$CONFIG_FILES bin/Makefile" ;;
+  "geo_config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS geo_config.h" ;;
+  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason to put it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+  trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./confstat$$-$RANDOM
+  (umask 077 && mkdir $tmp)
+} ||
+{
+   echo "$me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+
+#
+# CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "\$CONFIG_FILES"; then
+  # Protect against being on the right side of a sed subst in config.status.
+  sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
+   s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
+s, at SHELL@,$SHELL,;t t
+s, at PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s, at PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s, at PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s, at PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s, at PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s, at PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s, at exec_prefix@,$exec_prefix,;t t
+s, at prefix@,$prefix,;t t
+s, at program_transform_name@,$program_transform_name,;t t
+s, at bindir@,$bindir,;t t
+s, at sbindir@,$sbindir,;t t
+s, at libexecdir@,$libexecdir,;t t
+s, at datadir@,$datadir,;t t
+s, at sysconfdir@,$sysconfdir,;t t
+s, at sharedstatedir@,$sharedstatedir,;t t
+s, at localstatedir@,$localstatedir,;t t
+s, at libdir@,$libdir,;t t
+s, at includedir@,$includedir,;t t
+s, at oldincludedir@,$oldincludedir,;t t
+s, at infodir@,$infodir,;t t
+s, at mandir@,$mandir,;t t
+s, at build_alias@,$build_alias,;t t
+s, at host_alias@,$host_alias,;t t
+s, at target_alias@,$target_alias,;t t
+s, at DEFS@,$DEFS,;t t
+s, at ECHO_C@,$ECHO_C,;t t
+s, at ECHO_N@,$ECHO_N,;t t
+s, at ECHO_T@,$ECHO_T,;t t
+s, at LIBS@,$LIBS,;t t
+s, at build@,$build,;t t
+s, at build_cpu@,$build_cpu,;t t
+s, at build_vendor@,$build_vendor,;t t
+s, at build_os@,$build_os,;t t
+s, at host@,$host,;t t
+s, at host_cpu@,$host_cpu,;t t
+s, at host_vendor@,$host_vendor,;t t
+s, at host_os@,$host_os,;t t
+s, at target@,$target,;t t
+s, at target_cpu@,$target_cpu,;t t
+s, at target_vendor@,$target_vendor,;t t
+s, at target_os@,$target_os,;t t
+s, at VERSION_MAJOR@,$VERSION_MAJOR,;t t
+s, at VERSION_MINOR@,$VERSION_MINOR,;t t
+s, at VERSION_POINT@,$VERSION_POINT,;t t
+s, at CC@,$CC,;t t
+s, at CFLAGS@,$CFLAGS,;t t
+s, at LDFLAGS@,$LDFLAGS,;t t
+s, at CPPFLAGS@,$CPPFLAGS,;t t
+s, at ac_ct_CC@,$ac_ct_CC,;t t
+s, at EXEEXT@,$EXEEXT,;t t
+s, at OBJEXT@,$OBJEXT,;t t
+s, at CXX_WFLAGS@,$CXX_WFLAGS,;t t
+s, at C_WFLAGS@,$C_WFLAGS,;t t
+s, at INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
+s, at INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
+s, at INSTALL_DATA@,$INSTALL_DATA,;t t
+s, at LN_S@,$LN_S,;t t
+s, at RANLIB@,$RANLIB,;t t
+s, at ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
+s, at CXX_PIC@,$CXX_PIC,;t t
+s, at C_PIC@,$C_PIC,;t t
+s, at LD_SHARED@,$LD_SHARED,;t t
+s, at SO_EXT@,$SO_EXT,;t t
+s, at GEOTIFF_SO@,$GEOTIFF_SO,;t t
+s, at GEOTIFF_IMP@,$GEOTIFF_IMP,;t t
+s, at GEOTIFF_DLL@,$GEOTIFF_DLL,;t t
+s, at CPP@,$CPP,;t t
+s, at EGREP@,$EGREP,;t t
+s, at ZIP_INC@,$ZIP_INC,;t t
+s, at TIFF_INC@,$TIFF_INC,;t t
+s, at PROJ_INC@,$PROJ_INC,;t t
+s, at CSV_SOURCE@,$CSV_SOURCE,;t t
+s, at LIBOBJS@,$LIBOBJS,;t t
+s, at LTLIBOBJS@,$LTLIBOBJS,;t t
+CEOF
+
+_ACEOF
+
+  cat >>$CONFIG_STATUS <<\_ACEOF
+  # Split the substitutions into bite-sized pieces for seds with
+  # small command number limits, like on Digital OSF/1 and HP-UX.
+  ac_max_sed_lines=48
+  ac_sed_frag=1 # Number of current file.
+  ac_beg=1 # First line for current file.
+  ac_end=$ac_max_sed_lines # Line after last line for current file.
+  ac_more_lines=:
+  ac_sed_cmds=
+  while $ac_more_lines; do
+    if test $ac_beg -gt 1; then
+      sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+    else
+      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+    fi
+    if test ! -s $tmp/subs.frag; then
+      ac_more_lines=false
+    else
+      # The purpose of the label and of the branching condition is to
+      # speed up the sed processing (if there are no `@' at all, there
+      # is no need to browse any of the substitutions).
+      # These are the two extra sed commands mentioned above.
+      (echo ':t
+  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+      if test -z "$ac_sed_cmds"; then
+	ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+      else
+	ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+      fi
+      ac_sed_frag=`expr $ac_sed_frag + 1`
+      ac_beg=$ac_end
+      ac_end=`expr $ac_end + $ac_max_sed_lines`
+    fi
+  done
+  if test -z "$ac_sed_cmds"; then
+    ac_sed_cmds=cat
+  fi
+fi # test -n "$CONFIG_FILES"
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case $ac_file in
+  - | *:- | *:-:* ) # input from stdin
+	cat >$tmp/stdin
+	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  * )   ac_file_in=$ac_file.in ;;
+  esac
+
+  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+  ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+  { if $as_mkdir_p; then
+    mkdir -p "$ac_dir"
+  else
+    as_dir="$ac_dir"
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+  ac_builddir=.
+
+if test "$ac_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+  .)  # No --srcdir option.  We are building in place.
+    ac_srcdir=.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
+
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
+  esac
+
+  # Let's still pretend it is `configure' which instantiates (i.e., don't
+  # use $as_me), people would be surprised to read:
+  #    /* config.h.  Generated by config.status.  */
+  if test x"$ac_file" = x-; then
+    configure_input=
+  else
+    configure_input="$ac_file.  "
+  fi
+  configure_input=$configure_input"Generated from `echo $ac_file_in |
+				     sed 's,.*/,,'` by configure."
+
+  # First look for the input files in the build tree, otherwise in the
+  # src tree.
+  ac_file_inputs=`IFS=:
+    for f in $ac_file_in; do
+      case $f in
+      -) echo $tmp/stdin ;;
+      [\\/$]*)
+	 # Absolute (can't be DOS-style, as IFS=:)
+	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+	 echo "$f";;
+      *) # Relative
+	 if test -f "$f"; then
+	   # Build tree
+	   echo "$f"
+	 elif test -f "$srcdir/$f"; then
+	   # Source tree
+	   echo "$srcdir/$f"
+	 else
+	   # /dev/null tree
+	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+	 fi;;
+      esac
+    done` || { (exit 1); exit 1; }
+
+  if test x"$ac_file" != x-; then
+    { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    rm -f "$ac_file"
+  fi
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+  sed "$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s, at configure_input@,$configure_input,;t t
+s, at srcdir@,$ac_srcdir,;t t
+s, at abs_srcdir@,$ac_abs_srcdir,;t t
+s, at top_srcdir@,$ac_top_srcdir,;t t
+s, at abs_top_srcdir@,$ac_abs_top_srcdir,;t t
+s, at builddir@,$ac_builddir,;t t
+s, at abs_builddir@,$ac_abs_builddir,;t t
+s, at top_builddir@,$ac_top_builddir,;t t
+s, at abs_top_builddir@,$ac_abs_top_builddir,;t t
+s, at INSTALL@,$ac_INSTALL,;t t
+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+  rm -f $tmp/stdin
+  if test x"$ac_file" != x-; then
+    mv $tmp/out $ac_file
+  else
+    cat $tmp/out
+    rm -f $tmp/out
+  fi
+
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_HEADER section.
+#
+
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s,^\([	 ]*\)#\([	 ]*define[	 ][	 ]*\)'
+ac_dB='[	 ].*$,\1#\2'
+ac_dC=' '
+ac_dD=',;t'
+# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_uA='s,^\([	 ]*\)#\([	 ]*\)undef\([	 ][	 ]*\)'
+ac_uB='$,\1#\2define\3'
+ac_uC=' '
+ac_uD=',;t'
+
+for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case $ac_file in
+  - | *:- | *:-:* ) # input from stdin
+	cat >$tmp/stdin
+	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  * )   ac_file_in=$ac_file.in ;;
+  esac
+
+  test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+
+  # First look for the input files in the build tree, otherwise in the
+  # src tree.
+  ac_file_inputs=`IFS=:
+    for f in $ac_file_in; do
+      case $f in
+      -) echo $tmp/stdin ;;
+      [\\/$]*)
+	 # Absolute (can't be DOS-style, as IFS=:)
+	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+	 # Do quote $f, to prevent DOS paths from being IFS'd.
+	 echo "$f";;
+      *) # Relative
+	 if test -f "$f"; then
+	   # Build tree
+	   echo "$f"
+	 elif test -f "$srcdir/$f"; then
+	   # Source tree
+	   echo "$srcdir/$f"
+	 else
+	   # /dev/null tree
+	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+	 fi;;
+      esac
+    done` || { (exit 1); exit 1; }
+  # Remove the trailing spaces.
+  sed 's/[	 ]*$//' $ac_file_inputs >$tmp/in
+
+_ACEOF
+
+# Transform confdefs.h into two sed scripts, `conftest.defines' and
+# `conftest.undefs', that substitutes the proper values into
+# config.h.in to produce config.h.  The first handles `#define'
+# templates, and the second `#undef' templates.
+# And first: Protect against being on the right side of a sed subst in
+# config.status.  Protect against being in an unquoted here document
+# in config.status.
+rm -f conftest.defines conftest.undefs
+# Using a here document instead of a string reduces the quoting nightmare.
+# Putting comments in sed scripts is not portable.
+#
+# `end' is used to avoid that the second main sed command (meant for
+# 0-ary CPP macros) applies to n-ary macro definitions.
+# See the Autoconf documentation for `clear'.
+cat >confdef2sed.sed <<\_ACEOF
+s/[\\&,]/\\&/g
+s,[\\$`],\\&,g
+t clear
+: clear
+s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*\)\(([^)]*)\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
+t end
+s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 ][^	 ]*\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
+: end
+_ACEOF
+# If some macros were called several times there might be several times
+# the same #defines, which is useless.  Nevertheless, we may not want to
+# sort them, since we want the *last* AC-DEFINE to be honored.
+uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
+sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
+rm -f confdef2sed.sed
+
+# This sed command replaces #undef with comments.  This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+cat >>conftest.undefs <<\_ACEOF
+s,^[	 ]*#[	 ]*undef[	 ][	 ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
+_ACEOF
+
+# Break up conftest.defines because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo '  # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
+echo '  if grep "^[	 ]*#[	 ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
+echo '  # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
+echo '  :' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.defines >/dev/null
+do
+  # Write a limited-size here document to $tmp/defines.sed.
+  echo '  cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
+  # Speed up: don't consider the non `#define' lines.
+  echo '/^[	 ]*#[	 ]*define/!b' >>$CONFIG_STATUS
+  # Work around the forget-to-reset-the-flag bug.
+  echo 't clr' >>$CONFIG_STATUS
+  echo ': clr' >>$CONFIG_STATUS
+  sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
+  echo 'CEOF
+  sed -f $tmp/defines.sed $tmp/in >$tmp/out
+  rm -f $tmp/in
+  mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+  sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
+  rm -f conftest.defines
+  mv conftest.tail conftest.defines
+done
+rm -f conftest.defines
+echo '  fi # grep' >>$CONFIG_STATUS
+echo >>$CONFIG_STATUS
+
+# Break up conftest.undefs because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo '  # Handle all the #undef templates' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.undefs >/dev/null
+do
+  # Write a limited-size here document to $tmp/undefs.sed.
+  echo '  cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
+  # Speed up: don't consider the non `#undef'
+  echo '/^[	 ]*#[	 ]*undef/!b' >>$CONFIG_STATUS
+  # Work around the forget-to-reset-the-flag bug.
+  echo 't clr' >>$CONFIG_STATUS
+  echo ': clr' >>$CONFIG_STATUS
+  sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
+  echo 'CEOF
+  sed -f $tmp/undefs.sed $tmp/in >$tmp/out
+  rm -f $tmp/in
+  mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+  sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
+  rm -f conftest.undefs
+  mv conftest.tail conftest.undefs
+done
+rm -f conftest.undefs
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+  # Let's still pretend it is `configure' which instantiates (i.e., don't
+  # use $as_me), people would be surprised to read:
+  #    /* config.h.  Generated by config.status.  */
+  if test x"$ac_file" = x-; then
+    echo "/* Generated by configure.  */" >$tmp/config.h
+  else
+    echo "/* $ac_file.  Generated by configure.  */" >$tmp/config.h
+  fi
+  cat $tmp/in >>$tmp/config.h
+  rm -f $tmp/in
+  if test x"$ac_file" != x-; then
+    if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
+      { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+      { if $as_mkdir_p; then
+    mkdir -p "$ac_dir"
+  else
+    as_dir="$ac_dir"
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+      rm -f $ac_file
+      mv $tmp/config.h $ac_file
+    fi
+  else
+    cat $tmp/config.h
+    rm -f $tmp/config.h
+  fi
+done
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || { (exit 1); exit 1; }
+fi
+


Property changes on: packages/geotiff/libgeotiff-dfsg/trunk/configure
___________________________________________________________________
Name: svn:executable
   + 

Added: packages/geotiff/libgeotiff-dfsg/trunk/configure.in
===================================================================
--- packages/geotiff/libgeotiff-dfsg/trunk/configure.in	                        (rev 0)
+++ packages/geotiff/libgeotiff-dfsg/trunk/configure.in	2007-09-19 11:39:06 UTC (rev 1077)
@@ -0,0 +1,194 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(geotiff.h)
+AC_CONFIG_HEADER(geo_config.h)
+AC_CANONICAL_HOST
+AC_CANONICAL_TARGET
+
+VERSION_MAJOR=1
+VERSION_MINOR=2
+VERSION_POINT=4
+AC_SUBST(VERSION_MAJOR,$VERSION_MAJOR)
+AC_SUBST(VERSION_MINOR,$VERSION_MINOR)
+AC_SUBST(VERSION_POINT,$VERSION_POINT)
+
+dnl Checks for programs.
+AC_PROG_CC
+AC_COMPILER_WFLAGS
+
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_PROG_RANLIB
+AC_COMPILER_PIC
+AC_LD_SHARED
+
+#
+#	If we have shared library support define that we want to build
+# 	the libgeotiff.so
+
+GEOTIFF_SO=
+GEOTIFF_DLL=
+GEOTIFF_IMP=
+EXEEXT=
+if test "$LD_SHARED" != "/bin/true" ; then
+  case $host in
+    *-pc-cygwin*) EXEEXT=.exe
+		  GEOTIFF_SO=cyggeotiff-1.dll
+	          GEOTIFF_DLL=cyggeotiff-1.dll
+	          GEOTIFF_IMP=libgeotiff.dll.a
+                  LD_SHARED="gcc -shared -Wl,--export-all -Wl,--out-implib=\$(GEOTIFF_IMP)" ;;
+    *) GEOTIFF_SO=libgeotiff.${SO_EXT}.$VERSION_MAJOR.$VERSION_MINOR.$VERSION_POINT ;;
+  esac
+fi
+AC_SUBST(GEOTIFF_SO,$GEOTIFF_SO)
+AC_SUBST(GEOTIFF_IMP,$GEOTIFF_IMP)
+AC_SUBST(GEOTIFF_DLL,$GEOTIFF_DLL)
+AC_SUBST(EXEEXT,$EXEEXT)
+
+dnl Checks for libraries.
+AC_CHECK_LIB(m,exp,,,)
+
+dnl We want to honor the users wishes with regard to linking.
+LIBS="$LDFLAGS $LIBS"
+
+dnl We check for headers
+AC_HEADER_STDC
+AC_CHECK_HEADERS(string.h strings.h stdlib.h)
+ 
+dnl
+dnl Add option to include libz in library list for use of libtiff.
+dnl
+AC_ARG_WITH(zip, [  --with-zip=dir          Use ZIP library in directory dir],[ZIP=$withval],[ZIP=yes])
+if test "$ZIP" = "yes" ; then
+  AC_CHECK_LIB(z,inflateInit_,,,-lm)
+  AC_CHECK_HEADERS(zlib.h,,)
+  AC_DEFINE(HAVE_ZIP)
+else
+  if test "$ZIP" != "no" ; then 
+    LIBS="${LIBS} -L${ZIP}/lib -lz"       
+    ZIP_INC="-I${ZIP}/include"            
+    AC_SUBST(ZIP_INC,$ZIP_INC)
+    AC_DEFINE(HAVE_ZIP)
+    echo "Using user supplied libzip directory: "$ZIP
+  fi
+fi
+
+dnl
+dnl Add option to include libjpeg in library list for use of libtiff.
+dnl
+AC_ARG_WITH(jpeg, [  --with-jpeg=dir         Use JPEG library in directory dir],[JPEG=$withval],[JPEG=yes])
+if test "$JPEG" = "yes" ; then
+  AC_CHECK_LIB(jpeg,jinit_compress_master,,,-lm)
+  AC_DEFINE(HAVE_JPEG)
+else
+  if test "$JPEG" != "no" ; then 
+    LIBS="${LIBS} -L${JPEG} -ljpeg"       
+    AC_DEFINE(HAVE_JPEG)
+    echo "Using user supplied libjpeg directory: "$JPEG
+  fi
+fi
+
+dnl
+dnl Special logic to try and find a user specified libtiff tree.  If not
+dnl available check if the system directories have the library, _and_ the
+dnl required private include files.  Normally these private include files
+dnl (tiffiop.h) are not installed with the public interface.
+dnl
+AC_ARG_WITH(libtiff, [  --with-libtiff=dir      Use libtiff in directory dir],,)
+
+if test "$with_libtiff" != "" ; then
+  if test -f $with_libtiff/include/tiffio.h -a -d $with_libtiff/lib ; then
+    LIBS="-L$with_libtiff/lib -ltiff $LIBS"
+    TIFF_INC=-I$with_libtiff/include
+  else
+    LIBS="-L$with_libtiff -ltiff $LIBS"
+    TIFF_INC=-I$with_libtiff
+  fi
+  LIBS_SAVED="$LIBS"
+  AC_CHECK_LIB(tiff,TIFFOpen,,
+               AC_MSG_ERROR([failed to link with -ltiff to find TIFFOpen]),-lm)
+  AC_CHECK_LIB(tiff,TIFFMergeFieldInfo,,
+               AC_MSG_ERROR([Libtiff 3.6.0 Beta or later required for this version of
+libgeotiff. Please upgrade or use an older version of libgeotiff.]),-lm)
+  LIBS="$LIBS_SAVED"
+else
+  AC_CHECK_LIB(tiff,TIFFOpen,,
+               AC_MSG_ERROR([You will need to substantially rewrite libxtiff to
+build libgeotiff without libtiff]),-lm)
+  LIBS_SAVED="$LIBS"
+  AC_CHECK_LIB(tiff,TIFFMergeFieldInfo,,
+               AC_MSG_ERROR([Libtiff 3.6.0 Beta or later required for this version of
+libgeotiff. Please upgrade libtiff or use an older version of libgeotiff.]),-lm)
+  LIBS="$LIBS_SAVED"
+  TIFF_INC=
+fi
+
+AC_SUBST(TIFF_INC,$TIFF_INC)
+
+dnl
+dnl Try and find libproj.a, and projects.h
+dnl
+
+AC_ARG_WITH(proj, [  --with-proj[=ARG]       Use PROJ.4 library (ARG=no or path)],[PROJ_HOME=$withval],[PROJ_HOME=])
+
+if test "$PROJ_HOME" != "" -a "$PROJ_HOME" != "no" ; then
+  if test -d "$PROJ_HOME/src/pj_init.c" ; then
+    PROJ_HOME=$PROJ_HOME/src
+  fi
+
+  dnl Old PROJ.4 build tree, without automake
+  if test -f "$PROJ_HOME/libproj.a" -a -f "$PROJ_HOME/projects.h" ; then
+    PROJ_LIB=$PROJ_HOME/libproj.a
+    PROJ_INC=$PROJ_HOME
+
+  dnl New PROJ.4 build tree, with automake
+  elif test -f "$PROJ_HOME/.libs/libproj.a" -a -f "$PROJ_HOME/projects.h" ; then
+    PROJ_LIB=$PROJ_HOME/.libs/libproj.a
+    PROJ_INC=$PROJ_HOME
+
+  dnl Installed tree in an odd place
+  elif test \( -f "$PROJ_HOME/lib/libproj.a" -o -f "$PROJ_HOME/lib/libproj.so" \) -a -f "$PROJ_HOME/include/proj_api.h"; then
+    PROJ_LIB="-L$PROJ_HOME/lib -lproj"
+    PROJ_INC=$PROJ_HOME/include 
+  else
+    echo "PROJ_HOME=$PROJ_HOME, but either projects.h or libproj.a not found!"
+  fi
+fi
+
+if test "$PROJ_HOME" = "no" ; then
+  echo "PROJ.4 support disabled."
+
+elif test "$PROJ_LIB" != "" -a "$PROJ_INC" != "" ; then
+  echo "Found $PROJ_LIB"
+  echo "Found $PROJ_INC/projects.h"
+
+  LIBS="$PROJ_LIB $LIBS"
+  PROJ_INC=-I$PROJ_INC
+
+  AC_SUBST(PROJ_INC,$PROJ_INC)
+  AC_DEFINE(HAVE_PROJECTS_H)
+  AC_DEFINE(HAVE_LIBPROJ)
+else
+  AC_CHECK_LIB(proj,pj_init,,,-lm)
+  AC_CHECK_HEADERS(projects.h,,)
+fi
+
+dnl
+dnl Has the user requested "incode" EPSG tables, overriding the
+dnl default use of EPSG tables in csv files?  Temporarily unvailable.
+dnl
+
+AC_ARG_ENABLE(incode-epsg, [  --enable-incode-epsg	  Use C code EPSG tables],, enable_incode_epsg=no)
+
+if test "$enable_incode_epsg" != "yes" ; then
+   echo "EPSG tables will be read from .csv files."
+   CSV_SOURCE="\$(CSV_FILE_OBJS)"
+else
+   echo "EPSG tables will be linked into library."
+   CSV_SOURCE="\$(CSV_INCODE_OBJS)"
+fi
+AC_SUBST(CSV_SOURCE,$CSV_SOURCE)
+
+
+
+
+AC_OUTPUT(Makefile bin/Makefile)

Added: packages/geotiff/libgeotiff-dfsg/trunk/cpl_csv.c
===================================================================
--- packages/geotiff/libgeotiff-dfsg/trunk/cpl_csv.c	                        (rev 0)
+++ packages/geotiff/libgeotiff-dfsg/trunk/cpl_csv.c	2007-09-19 11:39:06 UTC (rev 1077)
@@ -0,0 +1,1016 @@
+/******************************************************************************
+ * Copyright (c) 1999, Frank Warmerdam
+ *
+ * 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 AUTHORS OR COPYRIGHT HOLDERS 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 OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ ******************************************************************************
+ *
+ * cpl_csv.c: Support functions for accessing CSV files.
+ *
+ * $Log: cpl_csv.c,v $
+ * Revision 1.16  2003/07/10 18:03:28  warmerda
+ * don't crash if NULL passed to gtCSVAccess()
+ *
+ * Revision 1.15  2003/01/20 06:46:35  warmerda
+ * search for pcs.csv, not horiz_cs.csv
+ *
+ * Revision 1.14  2003/01/15 04:39:58  warmerda
+ * change internal name of CSVAccess
+ *
+ * Revision 1.13  2002/11/28 22:26:41  warmerda
+ * upgraded to proper CSV formatting, and in-memory caching
+ *
+ * Revision 1.12  2002/06/19 03:51:15  warmerda
+ * migrated cpl_csv.h into cpl_serv.h
+ *
+ * Revision 1.11  2001/03/05 04:49:56  warmerda
+ * try to clear CPLReadLine buffer on deaccess
+ *
+ * Revision 1.10  2001/01/17 15:32:19  warmerda
+ * Include /usr/share/epsg_csv and share/epsg_csv in csv search path.
+ *
+ * Revision 1.9  2000/12/12 19:34:36  warmerda
+ * Use CSV_DATA_DIR if defined.
+ *
+ * Revision 1.8  2000/08/22 04:33:33  warmerda
+ * added support for /usr/local/shared/epsg_csv
+ *
+ * Revision 1.7  1999/12/03 14:42:59  warmerda
+ * Passing a NULL filename into CSVAccess() now results in a graceful
+ * failure to open the file.
+ *
+ * Revision 1.6  1999/06/26 17:28:51  warmerda
+ * Fixed reading of records with newlines embedded in quoted strings.
+ *
+ * Revision 1.5  1999/05/04 03:07:24  warmerda
+ * avoid warning
+ *
+ * Revision 1.4  1999/04/28 19:59:56  warmerda
+ * added some doxygen style documentation
+ *
+ * Revision 1.3  1999/03/17 19:53:15  geotiff
+ * sys includes moved to cpl_serv.h
+ *
+ * Revision 1.2  1999/03/10 16:54:42  geotiff
+ * Added use of the GEOTIFF_CSV environment variable to locate CSV files.
+ *
+ * Revision 1.1  1999/03/09 15:57:04  geotiff
+ * New
+ *
+ * Revision 1.2  1999/02/24 16:23:21  warmerda
+ * added lots
+ *
+ * Revision 1.1  1999/01/05 16:52:36  warmerda
+ * New
+ *
+ */
+
+#include "cpl_serv.h"
+#include "geo_tiffp.h"
+
+/* ==================================================================== */
+/*      The CSVTable is a persistant set of info about an open CSV      */
+/*      table.  While it doesn't currently maintain a record index,     */
+/*      or in-memory copy of the table, it could be changed to do so    */
+/*      in the future.                                                  */
+/* ==================================================================== */
+typedef struct ctb {
+    FILE        *fp;
+
+    struct ctb *psNext;
+
+    char        *pszFilename;
+
+    char        **papszFieldNames;
+
+    char        **papszRecFields;
+
+    int         iLastLine;
+
+    /* Cache for whole file */
+    int         nLineCount;
+    char        **papszLines;
+    int         *panLineIndex;
+    char        *pszRawData;
+} CSVTable;
+
+static CSVTable *psCSVTableList = NULL;
+
+/************************************************************************/
+/*                             CSVAccess()                              */
+/*                                                                      */
+/*      This function will fetch a handle to the requested table.       */
+/*      If not found in the ``open table list'' the table will be       */
+/*      opened and added to the list.  Eventually this function may     */
+/*      become public with an abstracted return type so that            */
+/*      applications can set options about the table.  For now this     */
+/*      isn't done.                                                     */
+/************************************************************************/
+
+static CSVTable *gtCSVAccess( const char * pszFilename )
+
+{
+    CSVTable    *psTable;
+    FILE        *fp;
+
+    if( pszFilename == NULL )
+        return NULL;
+
+/* -------------------------------------------------------------------- */
+/*      Is the table already in the list.                               */
+/* -------------------------------------------------------------------- */
+    for( psTable = psCSVTableList; psTable != NULL; psTable = psTable->psNext )
+    {
+        if( EQUAL(psTable->pszFilename,pszFilename) )
+        {
+            /*
+             * Eventually we should consider promoting to the front of
+             * the list to accelerate frequently accessed tables.
+             */
+            
+            return( psTable );
+        }
+    }
+
+/* -------------------------------------------------------------------- */
+/*      If not, try to open it.                                         */
+/* -------------------------------------------------------------------- */
+    fp = VSIFOpen( pszFilename, "rb" );
+    if( fp == NULL )
+        return NULL;
+
+/* -------------------------------------------------------------------- */
+/*      Create an information structure about this table, and add to    */
+/*      the front of the list.                                          */
+/* -------------------------------------------------------------------- */
+    psTable = (CSVTable *) CPLCalloc(sizeof(CSVTable),1);
+
+    psTable->fp = fp;
+    psTable->pszFilename = CPLStrdup( pszFilename );
+    psTable->psNext = psCSVTableList;
+    
+    psCSVTableList = psTable;
+
+/* -------------------------------------------------------------------- */
+/*      Read the table header record containing the field names.        */
+/* -------------------------------------------------------------------- */
+    psTable->papszFieldNames = CSVReadParseLine( fp );
+
+    return( psTable );
+}
+
+/************************************************************************/
+/*                            CSVDeaccess()                             */
+/************************************************************************/
+
+void CSVDeaccess( const char * pszFilename )
+
+{
+    CSVTable    *psLast, *psTable;
+    
+/* -------------------------------------------------------------------- */
+/*      A NULL means deaccess all tables.                               */
+/* -------------------------------------------------------------------- */
+    if( pszFilename == NULL )
+    {
+        while( psCSVTableList != NULL )
+            CSVDeaccess( psCSVTableList->pszFilename );
+        
+        return;
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Find this table.                                                */
+/* -------------------------------------------------------------------- */
+    psLast = NULL;
+    for( psTable = psCSVTableList;
+         psTable != NULL && !EQUAL(psTable->pszFilename,pszFilename);
+         psTable = psTable->psNext )
+    {
+        psLast = psTable;
+    }
+
+    if( psTable == NULL )
+    {
+        return;
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Remove the link from the list.                                  */
+/* -------------------------------------------------------------------- */
+    if( psLast != NULL )
+        psLast->psNext = psTable->psNext;
+    else
+        psCSVTableList = psTable->psNext;
+
+/* -------------------------------------------------------------------- */
+/*      Free the table.                                                 */
+/* -------------------------------------------------------------------- */
+    if( psTable->fp != NULL )
+        VSIFClose( psTable->fp );
+
+    CSLDestroy( psTable->papszFieldNames );
+    CSLDestroy( psTable->papszRecFields );
+    CPLFree( psTable->pszFilename );
+    CPLFree( psTable->panLineIndex );
+    CPLFree( psTable->pszRawData );
+    CPLFree( psTable->papszLines );
+
+    CPLFree( psTable );
+
+    CPLReadLine( NULL );
+}
+
+/************************************************************************/
+/*                            CSVSplitLine()                            */
+/*                                                                      */
+/*      Tokenize a CSV line into fields in the form of a string         */
+/*      list.  This is used instead of the CPLTokenizeString()          */
+/*      because it provides correct CSV escaping and quoting            */
+/*      semantics.                                                      */
+/************************************************************************/
+
+static char **CSVSplitLine( const char *pszString )
+
+{
+    char        **papszRetList = NULL;
+    char        *pszToken;
+    int         nTokenMax, nTokenLen;
+
+    pszToken = (char *) CPLCalloc(10,1);
+    nTokenMax = 10;
+    
+    while( pszString != NULL && *pszString != '\0' )
+    {
+        int     bInString = FALSE;
+
+        nTokenLen = 0;
+        
+        /* Try to find the next delimeter, marking end of token */
+        for( ; *pszString != '\0'; pszString++ )
+        {
+
+            /* End if this is a delimeter skip it and break. */
+            if( !bInString && *pszString == ',' )
+            {
+                pszString++;
+                break;
+            }
+            
+            if( *pszString == '"' )
+            {
+                if( !bInString || pszString[1] != '"' )
+                {
+                    bInString = !bInString;
+                    continue;
+                }
+                else  /* doubled quotes in string resolve to one quote */
+                {
+                    pszString++;
+                }
+            }
+
+            if( nTokenLen >= nTokenMax-2 )
+            {
+                nTokenMax = nTokenMax * 2 + 10;
+                pszToken = (char *) CPLRealloc( pszToken, nTokenMax );
+            }
+
+            pszToken[nTokenLen] = *pszString;
+            nTokenLen++;
+        }
+
+        pszToken[nTokenLen] = '\0';
+        papszRetList = CSLAddString( papszRetList, pszToken );
+
+        /* If the last token is an empty token, then we have to catch
+         * it now, otherwise we won't reenter the loop and it will be lost. 
+         */
+        if ( *pszString == '\0' && *(pszString-1) == ',' )
+        {
+            papszRetList = CSLAddString( papszRetList, "" );
+        }
+    }
+
+    if( papszRetList == NULL )
+        papszRetList = (char **) CPLCalloc(sizeof(char *),1);
+
+    CPLFree( pszToken );
+
+    return papszRetList;
+}
+
+/************************************************************************/
+/*                          CSVFindNextLine()                           */
+/*                                                                      */
+/*      Find the start of the next line, while at the same time zero    */
+/*      terminating this line.  Take into account that there may be     */
+/*      newline indicators within quoted strings, and that quotes       */
+/*      can be escaped with a backslash.                                */
+/************************************************************************/
+
+static char *CSVFindNextLine( char *pszThisLine )
+
+{
+    int  nQuoteCount = 0, i;
+
+    for( i = 0; pszThisLine[i] != '\0'; i++ )
+    {
+        if( pszThisLine[i] == '\"'
+            && (i == 0 || pszThisLine[i-1] != '\\') )
+            nQuoteCount++;
+
+        if( (pszThisLine[i] == 10 || pszThisLine[i] == 13)
+            && (nQuoteCount % 2) == 0 )
+            break;
+    }
+
+    while( pszThisLine[i] == 10 || pszThisLine[i] == 13 )
+        pszThisLine[i++] = '\0';
+
+    if( pszThisLine[i] == '\0' )
+        return NULL;
+    else
+        return pszThisLine + i;
+}
+
+/************************************************************************/
+/*                             CSVIngest()                              */
+/*                                                                      */
+/*      Load entire file into memory and setup index if possible.       */
+/************************************************************************/
+
+static void CSVIngest( const char *pszFilename )
+
+{
+    CSVTable *psTable = gtCSVAccess( pszFilename );
+    int       nFileLen, i, nMaxLineCount, iLine = 0;
+    char *pszThisLine;
+
+    if( psTable->pszRawData != NULL )
+        return;
+
+/* -------------------------------------------------------------------- */
+/*      Ingest whole file.                                              */
+/* -------------------------------------------------------------------- */
+    VSIFSeek( psTable->fp, 0, SEEK_END );
+    nFileLen = VSIFTell( psTable->fp );
+    VSIRewind( psTable->fp );
+
+    psTable->pszRawData = (char *) CPLMalloc(nFileLen+1);
+    if( (int) VSIFRead( psTable->pszRawData, 1, nFileLen, psTable->fp ) 
+        != nFileLen )
+    {
+        CPLFree( psTable->pszRawData );
+        psTable->pszRawData = NULL;
+
+        CPLError( CE_Failure, CPLE_FileIO, "Read of file %s failed.", 
+                  psTable->pszFilename );
+        return;
+    }
+
+    psTable->pszRawData[nFileLen] = '\0';
+
+/* -------------------------------------------------------------------- */
+/*      Get count of newlines so we can allocate line array.            */
+/* -------------------------------------------------------------------- */
+    nMaxLineCount = 0;
+    for( i = 0; i < nFileLen; i++ )
+    {
+        if( psTable->pszRawData[i] == 10 )
+            nMaxLineCount++;
+    }
+
+    psTable->papszLines = (char **) CPLCalloc(sizeof(char*),nMaxLineCount);
+    
+/* -------------------------------------------------------------------- */
+/*      Build a list of record pointers into the raw data buffer        */
+/*      based on line terminators.  Zero terminate the line             */
+/*      strings.                                                        */
+/* -------------------------------------------------------------------- */
+    /* skip header line */
+    pszThisLine = CSVFindNextLine( psTable->pszRawData );
+
+    while( pszThisLine != NULL && iLine < nMaxLineCount )
+    {
+        psTable->papszLines[iLine++] = pszThisLine;
+        pszThisLine = CSVFindNextLine( pszThisLine );
+    }
+
+    psTable->nLineCount = iLine;
+
+/* -------------------------------------------------------------------- */
+/*      Allocate and populate index array.  Ensure they are in          */
+/*      ascending order so that binary searches can be done on the      */
+/*      array.                                                          */
+/* -------------------------------------------------------------------- */
+    psTable->panLineIndex = (int *) CPLMalloc(sizeof(int)*psTable->nLineCount);
+    for( i = 0; i < psTable->nLineCount; i++ )
+    {
+        psTable->panLineIndex[i] = atoi(psTable->papszLines[i]);
+
+        if( i > 0 && psTable->panLineIndex[i] < psTable->panLineIndex[i-1] )
+        {
+            CPLFree( psTable->panLineIndex );
+            psTable->panLineIndex = NULL;
+            break;
+        }
+    }
+
+    psTable->iLastLine = -1;
+
+/* -------------------------------------------------------------------- */
+/*      We should never need the file handle against, so close it.      */
+/* -------------------------------------------------------------------- */
+    VSIFClose( psTable->fp );
+    psTable->fp = NULL;
+}
+
+/************************************************************************/
+/*                          CSVReadParseLine()                          */
+/*                                                                      */
+/*      Read one line, and return split into fields.  The return        */
+/*      result is a stringlist, in the sense of the CSL functions.      */
+/************************************************************************/
+
+char **CSVReadParseLine( FILE * fp )
+
+{
+    const char  *pszLine;
+    char        *pszWorkLine;
+    char        **papszReturn;
+
+    CPLAssert( fp != NULL );
+    if( fp == NULL )
+        return( NULL );
+    
+    pszLine = CPLReadLine( fp );
+    if( pszLine == NULL )
+        return( NULL );
+
+/* -------------------------------------------------------------------- */
+/*      If there are no quotes, then this is the simple case.           */
+/*      Parse, and return tokens.                                       */
+/* -------------------------------------------------------------------- */
+    if( strchr(pszLine,'\"') == NULL )
+        return CSVSplitLine( pszLine );
+
+/* -------------------------------------------------------------------- */
+/*      We must now count the quotes in our working string, and as      */
+/*      long as it is odd, keep adding new lines.                       */
+/* -------------------------------------------------------------------- */
+    pszWorkLine = CPLStrdup( pszLine );
+
+    while( TRUE )
+    {
+        int             i, nCount = 0;
+
+        for( i = 0; pszWorkLine[i] != '\0'; i++ )
+        {
+            if( pszWorkLine[i] == '\"'
+                && (i == 0 || pszWorkLine[i-1] != '\\') )
+                nCount++;
+        }
+
+        if( nCount % 2 == 0 )
+            break;
+
+        pszLine = CPLReadLine( fp );
+        if( pszLine == NULL )
+            break;
+
+        pszWorkLine = (char *)
+            CPLRealloc(pszWorkLine,
+                       strlen(pszWorkLine) + strlen(pszLine) + 1);
+        strcat( pszWorkLine, pszLine );
+    }
+    
+    papszReturn = CSVSplitLine( pszWorkLine );
+
+    CPLFree( pszWorkLine );
+
+    return papszReturn;
+}
+
+/************************************************************************/
+/*                             CSVCompare()                             */
+/*                                                                      */
+/*      Compare a field to a search value using a particular            */
+/*      criteria.                                                       */
+/************************************************************************/
+
+static int CSVCompare( const char * pszFieldValue, const char * pszTarget,
+                       CSVCompareCriteria eCriteria )
+
+{
+    if( eCriteria == CC_ExactString )
+    {
+        return( strcmp( pszFieldValue, pszTarget ) == 0 );
+    }
+    else if( eCriteria == CC_ApproxString )
+    {
+        return( EQUAL( pszFieldValue, pszTarget ) );
+    }
+    else if( eCriteria == CC_Integer )
+    {
+        return( atoi(pszFieldValue) == atoi(pszTarget) );
+    }
+
+    return FALSE;
+}
+
+/************************************************************************/
+/*                            CSVScanLines()                            */
+/*                                                                      */
+/*      Read the file scanline for lines where the key field equals     */
+/*      the indicated value with the suggested comparison criteria.     */
+/*      Return the first matching line split into fields.               */
+/************************************************************************/
+
+char **CSVScanLines( FILE *fp, int iKeyField, const char * pszValue,
+                     CSVCompareCriteria eCriteria )
+
+{
+    char        **papszFields = NULL;
+    int         bSelected = FALSE, nTestValue;
+
+    CPLAssert( pszValue != NULL );
+    CPLAssert( iKeyField >= 0 );
+    CPLAssert( fp != NULL );
+    
+    nTestValue = atoi(pszValue);
+    
+    while( !bSelected ) {
+        papszFields = CSVReadParseLine( fp );
+        if( papszFields == NULL )
+            return( NULL );
+
+        if( CSLCount( papszFields ) < iKeyField+1 )
+        {
+            /* not selected */
+        }
+        else if( eCriteria == CC_Integer
+                 && atoi(papszFields[iKeyField]) == nTestValue )
+        {
+            bSelected = TRUE;
+        }
+        else
+        {
+            bSelected = CSVCompare( papszFields[iKeyField], pszValue,
+                                    eCriteria );
+        }
+
+        if( !bSelected )
+        {
+            CSLDestroy( papszFields );
+            papszFields = NULL;
+        }
+    }
+    
+    return( papszFields );
+}
+
+/************************************************************************/
+/*                        CSVScanLinesIndexed()                         */
+/*                                                                      */
+/*      Read the file scanline for lines where the key field equals     */
+/*      the indicated value with the suggested comparison criteria.     */
+/*      Return the first matching line split into fields.               */
+/************************************************************************/
+
+static char **
+CSVScanLinesIndexed( CSVTable *psTable, int nKeyValue )
+
+{
+    int         iTop, iBottom, iMiddle, iResult = -1;
+
+    CPLAssert( psTable->panLineIndex != NULL );
+
+/* -------------------------------------------------------------------- */
+/*      Find target record with binary search.                          */
+/* -------------------------------------------------------------------- */
+    iTop = psTable->nLineCount-1;
+    iBottom = 0;
+
+    while( iTop >= iBottom )
+    {
+        iMiddle = (iTop + iBottom) / 2;
+        if( psTable->panLineIndex[iMiddle] > nKeyValue )
+            iTop = iMiddle - 1;
+        else if( psTable->panLineIndex[iMiddle] < nKeyValue )
+            iBottom = iMiddle + 1;
+        else
+        {
+            iResult = iMiddle;
+            break;
+        }
+    }
+
+    if( iResult == -1 )
+        return NULL;
+
+/* -------------------------------------------------------------------- */
+/*      Parse target line, and update iLastLine indicator.              */
+/* -------------------------------------------------------------------- */
+    psTable->iLastLine = iResult;
+    
+    return CSVSplitLine( psTable->papszLines[iResult] );
+}
+
+/************************************************************************/
+/*                        CSVScanLinesIngested()                        */
+/*                                                                      */
+/*      Read the file scanline for lines where the key field equals     */
+/*      the indicated value with the suggested comparison criteria.     */
+/*      Return the first matching line split into fields.               */
+/************************************************************************/
+
+static char **
+CSVScanLinesIngested( CSVTable *psTable, int iKeyField, const char * pszValue,
+                      CSVCompareCriteria eCriteria )
+
+{
+    char        **papszFields = NULL;
+    int         bSelected = FALSE, nTestValue;
+
+    CPLAssert( pszValue != NULL );
+    CPLAssert( iKeyField >= 0 );
+
+    nTestValue = atoi(pszValue);
+    
+/* -------------------------------------------------------------------- */
+/*      Short cut for indexed files.                                    */
+/* -------------------------------------------------------------------- */
+    if( iKeyField == 0 && eCriteria == CC_Integer 
+        && psTable->panLineIndex != NULL )
+        return CSVScanLinesIndexed( psTable, nTestValue );
+    
+/* -------------------------------------------------------------------- */
+/*      Scan from in-core lines.                                        */
+/* -------------------------------------------------------------------- */
+    while( !bSelected && psTable->iLastLine+1 < psTable->nLineCount ) {
+        psTable->iLastLine++;
+        papszFields = CSVSplitLine( psTable->papszLines[psTable->iLastLine] );
+
+        if( CSLCount( papszFields ) < iKeyField+1 )
+        {
+            /* not selected */
+        }
+        else if( eCriteria == CC_Integer
+                 && atoi(papszFields[iKeyField]) == nTestValue )
+        {
+            bSelected = TRUE;
+        }
+        else
+        {
+            bSelected = CSVCompare( papszFields[iKeyField], pszValue,
+                                    eCriteria );
+        }
+
+        if( !bSelected )
+        {
+            CSLDestroy( papszFields );
+            papszFields = NULL;
+        }
+    }
+    
+    return( papszFields );
+}
+
+/************************************************************************/
+/*                            CSVScanFile()                             */
+/*                                                                      */
+/*      Scan a whole file using criteria similar to above, but also     */
+/*      taking care of file opening and closing.                        */
+/************************************************************************/
+
+char **CSVScanFile( const char * pszFilename, int iKeyField,
+                    const char * pszValue, CSVCompareCriteria eCriteria )
+
+{
+    CSVTable    *psTable;
+
+/* -------------------------------------------------------------------- */
+/*      Get access to the table.                                        */
+/* -------------------------------------------------------------------- */
+    CPLAssert( pszFilename != NULL );
+
+    if( iKeyField < 0 )
+        return NULL;
+
+    psTable = gtCSVAccess( pszFilename );
+    if( psTable == NULL )
+        return NULL;
+    
+    CSVIngest( pszFilename );
+
+/* -------------------------------------------------------------------- */
+/*      Does the current record match the criteria?  If so, just        */
+/*      return it again.                                                */
+/* -------------------------------------------------------------------- */
+    if( iKeyField >= 0
+        && iKeyField < CSLCount(psTable->papszRecFields)
+        && CSVCompare(pszValue,psTable->papszRecFields[iKeyField],eCriteria) )
+    {
+        return psTable->papszRecFields;
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Scan the file from the beginning, replacing the ``current       */
+/*      record'' in our structure with the one that is found.           */
+/* -------------------------------------------------------------------- */
+    psTable->iLastLine = -1;
+    CSLDestroy( psTable->papszRecFields );
+
+    if( psTable->pszRawData != NULL )
+        psTable->papszRecFields = 
+            CSVScanLinesIngested( psTable, iKeyField, pszValue, eCriteria );
+    else
+    {
+        VSIRewind( psTable->fp );
+        CPLReadLine( psTable->fp );         /* throw away the header line */
+    
+        psTable->papszRecFields =
+            CSVScanLines( psTable->fp, iKeyField, pszValue, eCriteria );
+    }
+
+    return( psTable->papszRecFields );
+}
+
+/************************************************************************/
+/*                           CPLGetFieldId()                            */
+/*                                                                      */
+/*      Read the first record of a CSV file (rewinding to be sure),     */
+/*      and find the field with the indicated name.  Returns -1 if      */
+/*      it fails to find the field name.  Comparison is case            */
+/*      insensitive, but otherwise exact.  After this function has      */
+/*      been called the file pointer will be positioned just after      */
+/*      the first record.                                               */
+/************************************************************************/
+
+int CSVGetFieldId( FILE * fp, const char * pszFieldName )
+
+{
+    char        **papszFields;
+    int         i;
+    
+    CPLAssert( fp != NULL && pszFieldName != NULL );
+
+    VSIRewind( fp );
+
+    papszFields = CSVReadParseLine( fp );
+    for( i = 0; papszFields != NULL && papszFields[i] != NULL; i++ )
+    {
+        if( EQUAL(papszFields[i],pszFieldName) )
+        {
+            CSLDestroy( papszFields );
+            return i;
+        }
+    }
+
+    CSLDestroy( papszFields );
+
+    return -1;
+}
+
+/************************************************************************/
+/*                         CSVGetFileFieldId()                          */
+/*                                                                      */
+/*      Same as CPLGetFieldId(), except that we get the file based      */
+/*      on filename, rather than having an existing handle.             */
+/************************************************************************/
+
+int CSVGetFileFieldId( const char * pszFilename, const char * pszFieldName )
+
+{
+    CSVTable    *psTable;
+    int         i;
+    
+/* -------------------------------------------------------------------- */
+/*      Get access to the table.                                        */
+/* -------------------------------------------------------------------- */
+    CPLAssert( pszFilename != NULL );
+
+    psTable = gtCSVAccess( pszFilename );
+    if( psTable == NULL )
+        return -1;
+
+/* -------------------------------------------------------------------- */
+/*      Find the requested field.                                       */
+/* -------------------------------------------------------------------- */
+    for( i = 0;
+         psTable->papszFieldNames != NULL
+             && psTable->papszFieldNames[i] != NULL;
+         i++ )
+    {
+        if( EQUAL(psTable->papszFieldNames[i],pszFieldName) )
+        {
+            return i;
+        }
+    }
+
+    return -1;
+}
+
+
+/************************************************************************/
+/*                         CSVScanFileByName()                          */
+/*                                                                      */
+/*      Same as CSVScanFile(), but using a field name instead of a      */
+/*      field number.                                                   */
+/************************************************************************/
+
+char **CSVScanFileByName( const char * pszFilename,
+                          const char * pszKeyFieldName,
+                          const char * pszValue, CSVCompareCriteria eCriteria )
+
+{
+    int         iKeyField;
+
+    iKeyField = CSVGetFileFieldId( pszFilename, pszKeyFieldName );
+    if( iKeyField == -1 )
+        return NULL;
+
+    return( CSVScanFile( pszFilename, iKeyField, pszValue, eCriteria ) );
+}
+
+/************************************************************************/
+/*                            CSVGetField()                             */
+/*                                                                      */
+/*      The all-in-one function to fetch a particular field value       */
+/*      from a CSV file.  Note this function will return an empty       */
+/*      string, rather than NULL if it fails to find the desired        */
+/*      value for some reason.  The caller can't establish that the     */
+/*      fetch failed.                                                   */
+/************************************************************************/
+
+const char *CSVGetField( const char * pszFilename,
+                         const char * pszKeyFieldName,
+                         const char * pszKeyFieldValue,
+                         CSVCompareCriteria eCriteria,
+                         const char * pszTargetField )
+
+{
+    CSVTable    *psTable;
+    char        **papszRecord;
+    int         iTargetField;
+    
+/* -------------------------------------------------------------------- */
+/*      Find the table.                                                 */
+/* -------------------------------------------------------------------- */
+    psTable = gtCSVAccess( pszFilename );
+    if( psTable == NULL )
+        return "";
+
+/* -------------------------------------------------------------------- */
+/*      Find the correct record.                                        */
+/* -------------------------------------------------------------------- */
+    papszRecord = CSVScanFileByName( pszFilename, pszKeyFieldName,
+                                     pszKeyFieldValue, eCriteria );
+
+    if( papszRecord == NULL )
+        return "";
+
+/* -------------------------------------------------------------------- */
+/*      Figure out which field we want out of this.                     */
+/* -------------------------------------------------------------------- */
+    iTargetField = CSVGetFileFieldId( pszFilename, pszTargetField );
+    if( iTargetField < 0 )
+        return "";
+
+    if( iTargetField >= CSLCount( papszRecord ) )
+        return "";
+
+    return( papszRecord[iTargetField] );
+}
+
+/************************************************************************/
+/*                            CSVFilename()                             */
+/*                                                                      */
+/*      Return the full path to a particular CSV file.  This will       */
+/*      eventually be something the application can override.           */
+/************************************************************************/
+
+static const char *(*pfnCSVFilenameHook)(const char *) = NULL;
+
+const char * CSVFilename( const char *pszBasename )
+
+{
+    static char		szPath[512];
+
+    if( pfnCSVFilenameHook == NULL )
+    {
+        FILE	*fp = NULL;
+
+        if( getenv("GEOTIFF_CSV") != NULL )
+        {
+            sprintf( szPath, "%s/%s", getenv("GEOTIFF_CSV"), pszBasename );
+        }
+#ifdef CSV_DATA_DIR
+        else 
+        {
+            sprintf( szPath, "%s/%s", CSV_DATA_DIR, pszBasename );
+        }
+#else
+        else if( (fp = fopen( "/usr/local/share/epsg/csv/pcs.csv", "rt" )) != NULL )
+        {
+            sprintf( szPath, "/usr/local/share/epsg/csv/%s", pszBasename );
+        }
+        else if( (fp = fopen( "csv/pcs.csv", "rt" )) != NULL )
+        {
+            sprintf( szPath, "csv/%s", pszBasename );
+        }
+        else if( (fp = fopen( "share/epsg_csv/pcs.csv", "rt" )) != NULL )
+        {
+            sprintf( szPath, "share/epsg_csv/%s", pszBasename );
+        }
+        else if( (fp = fopen( "/usr/share/epsg_csv/pcs.csv", "rt" )) != NULL )
+        {
+            sprintf( szPath, "/usr/share/epsg_csv/%s", pszBasename );
+        }
+        else
+        {
+            sprintf( szPath, "/usr/local/share/epsg_csv/%s", pszBasename );
+        }
+#endif
+
+        if( fp != NULL )
+            fclose( fp );
+        
+        return( szPath );
+    }
+    else
+        return( pfnCSVFilenameHook( pszBasename ) );
+}
+
+/************************************************************************/
+/*                         SetCSVFilenameHook()                         */
+/*                                                                      */
+/*      Applications can use this to set a function that will           */
+/*      massage CSV filenames.                                          */
+/************************************************************************/
+
+/**
+ * Override CSV file search method.
+ *
+ * @param CSVFileOverride The pointer to a function which will return the
+ * full path for a given filename.
+  *
+
+This function allows an application to override how the GTIFGetDefn() and related function find the CSV (Comma Separated
+Value) values required. The pfnHook argument should be a pointer to a function that will take in a CSV filename and return a
+full path to the file. The returned string should be to an internal static buffer so that the caller doesn't have to free the result.
+
+<b>Example:</b><br>
+
+The listgeo utility uses the following override function if the user
+specified a CSV file directory with the -t commandline switch (argument
+put into CSVDirName).  <p>
+
+<pre>
+
+    ...
+
+
+    SetCSVFilenameHook( CSVFileOverride );
+
+    ...
+
+
+static const char *CSVFileOverride( const char * pszInput )
+
+{
+    static char         szPath[1024];
+
+#ifdef WIN32
+    sprintf( szPath, "%s\\%s", CSVDirName, pszInput );
+#else    
+    sprintf( szPath, "%s/%s", CSVDirName, pszInput );
+#endif    
+
+    return( szPath );
+}
+</pre>
+
+*/
+
+void SetCSVFilenameHook( const char *(*pfnNewHook)( const char * ) )
+
+{
+    pfnCSVFilenameHook = pfnNewHook;
+}

Added: packages/geotiff/libgeotiff-dfsg/trunk/cpl_csv_incode.c
===================================================================
--- packages/geotiff/libgeotiff-dfsg/trunk/cpl_csv_incode.c	                        (rev 0)
+++ packages/geotiff/libgeotiff-dfsg/trunk/cpl_csv_incode.c	2007-09-19 11:39:06 UTC (rev 1077)
@@ -0,0 +1,230 @@
+/**********************************************************************
+ * $Id: cpl_csv_incode.c,v 1.8 2007/07/20 18:08:29 fwarmerdam Exp $
+ *
+ * Name:     cpl_struct.c
+ * Project:  libgeotiff
+ * Purpose:  Provide "CSV API" interface to in-code EPSG CSV tables.
+ * Author:   Derrick J Brashear <shadow at dementia.org>
+ *
+ ******************************************************************************
+ * Copyright (c) 1999, Frank Warmerdam
+ *
+ * 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 AUTHORS OR COPYRIGHT HOLDERS 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 OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ ******************************************************************************
+ *
+ * $Log: cpl_csv_incode.c,v $
+ * Revision 1.8  2007/07/20 18:08:29  fwarmerdam
+ * Handle unexpected .csv files, and missing records more gracefully.
+ *
+ * Revision 1.7  2004/03/23 18:21:56  warmerda
+ * Added CSVReadParseLine() stub
+ *
+ * Revision 1.6  2003/01/20 21:42:52  warmerda
+ * Ensure CSVGetField() does not crash if record not found.
+ *
+ * Revision 1.5  2003/01/20 07:11:04  warmerda
+ * updated csv-incode support to 6.2.2
+ *
+ * Revision 1.4  2002/06/19 03:51:15  warmerda
+ * migrated cpl_csv.h into cpl_serv.h
+ *
+ * Revision 1.3  2002/02/11 14:22:22  warmerda
+ * Added stub CSVDeaccess().
+ *
+ * Revision 1.2  2001/06/28 17:53:20  warmerda
+ * Use EQUAL instead of strcasecmp() to ensure code builds on windows.
+ * As per http://bugzilla.remotesensing.org/show_bug.cgi?id=59
+ *
+ * Revision 1.1  1999/12/10 18:00:58  warmerda
+ * New
+ *
+ */
+
+#include "cpl_serv.h"
+
+#include "defs.h"
+
+extern const datafile_rows_t *pcs_rows[];
+extern const datafile_rows_t *gcs_rows[];
+extern const datafile_rows_t *ellipsoid_rows[];
+extern const datafile_rows_t *prime_meridian_rows[];
+extern const datafile_rows_t *datum_rows[];
+extern const datafile_rows_t *unit_of_measure_rows[];
+extern const datafile_rows_t *projop_wparm_rows[];
+
+
+/* Pointers to data */
+static const datafile_t files[] = {
+  { "pcs", pcs_rows },
+  { "gcs", gcs_rows },
+  { "ellipsoid", ellipsoid_rows },
+  { "prime_meridian", prime_meridian_rows },
+  { "datum", datum_rows },
+  { "unit_of_measure", unit_of_measure_rows },
+  { "projop_wparm", projop_wparm_rows },
+  { NULL, NULL }
+};
+
+#if 0
+main()
+{
+  datafile_t *csvfile;
+  char **papszRecord;
+  int i, row, col;
+
+  papszRecord = CSVScanFileByName( "horiz_cs.csv", "HORIZCS_CODE",
+				   "2200", CC_Integer );
+
+  printf ("%s %s\n", papszRecord[0], papszRecord[1]);
+  csvfile = &files[0];
+  while (csvfile->name != NULL) {
+    printf("file name is %s\n", csvfile->name);
+    for (i = 0; csvfile->cols[i]; i++) {
+      printf("column name is %s\n", csvfile->cols[i]);
+      row = 1; col = 0;
+      if (csvfile->rows[row] && csvfile->rows[row][col])
+	printf("value %d,%d is %s\n", row, col, csvfile->rows[row][col]);
+    }
+    csvfile++;
+  }
+}
+#endif
+
+const char * CSVFilename( const char *pszBasename )
+{
+  return pszBasename;
+}
+
+static int CSVCompare( const char * pszFieldValue, const char * pszTarget,
+                       CSVCompareCriteria eCriteria )
+{
+    if( eCriteria == CC_ExactString )
+    {
+        return( !EQUAL( pszFieldValue, pszTarget ) == 0 );
+    }
+    else if( eCriteria == CC_ApproxString )
+    {
+        return( !EQUAL( pszFieldValue, pszTarget ) );
+    }
+    else if( eCriteria == CC_Integer )
+    {
+        return( atoi(pszFieldValue) == atoi(pszTarget) );
+    }
+    return FALSE;
+}
+
+void CSVDeaccess( const char *pszFilename )
+{
+}
+
+static int __CSVGetFileId( const char * pszFilename)
+{
+  datafile_t *csvfile;
+  int i = 0;
+
+  csvfile = (datafile_t *)&files[i];
+  for (i = 0; csvfile->name; i++, csvfile = (datafile_t *)&files[i])
+  {
+    if (!strncmp(csvfile->name,pszFilename,(strlen(pszFilename)-4)))
+      return i;
+  }
+
+  return -1;
+}
+
+char **CSVScanFileByName( const char * pszFilename,
+                          const char * pszKeyFieldName,
+                          const char * pszValue, 
+                          CSVCompareCriteria eCriteria )
+{
+  datafile_t *csvfile;
+  int row, col, iFile;
+
+  iFile = __CSVGetFileId(pszFilename);
+  if( iFile == -1 )
+      return NULL;
+
+  col = CSVGetFileFieldId(pszFilename, pszKeyFieldName);
+
+  csvfile = (datafile_t *)&files[iFile];
+  for (row = 1; ((csvfile->rows[row] != 0) && (csvfile->rows[row][col] != 0));
+       row++) {
+    if (CSVCompare(csvfile->rows[row][col], pszValue, eCriteria))
+      return ((char **)csvfile->rows[row]);
+  }
+
+  return NULL;
+}
+
+int CSVGetFileFieldId( const char * pszFilename, const char * pszFieldName)
+{
+    datafile_t *csvfile;
+    int i, iFile;
+
+    iFile = __CSVGetFileId(pszFilename);
+    if( iFile == -1 )
+        return -1;
+
+    csvfile = (datafile_t *)&files[iFile];
+    if (!strncmp(csvfile->name,pszFilename,(strlen(pszFilename)-4)))
+    {
+        for (i = 0; csvfile->rows[0][i]; i++) 
+            if (EQUAL(pszFieldName, csvfile->rows[0][i]))
+                return i;
+    }
+
+    return -1;
+}
+
+const char *CSVGetField( const char * pszFilename,
+                         const char * pszKeyFieldName,
+                         const char * pszKeyFieldValue,
+                         CSVCompareCriteria eCriteria,
+                         const char * pszTargetField )
+{
+  char **papszRecord;
+  int  iField;
+
+  papszRecord = CSVScanFileByName( pszFilename, pszKeyFieldName,
+				   pszKeyFieldValue, CC_Integer );
+
+  if( papszRecord == NULL )
+      return "";
+
+  iField = CSVGetFileFieldId(pszFilename, pszTargetField);
+
+  if( iField == -1 )
+      return "";
+  else
+      return (papszRecord[iField]);
+}
+
+/* Dummy function */
+void SetCSVFilenameHook( const char *(*pfnNewHook)( const char * ) )
+
+{
+}
+
+/* dummy function */
+
+char **CSVReadParseLine( FILE * fp )
+
+{
+    return NULL;
+}

Added: packages/geotiff/libgeotiff-dfsg/trunk/cpl_serv.c
===================================================================
--- packages/geotiff/libgeotiff-dfsg/trunk/cpl_serv.c	                        (rev 0)
+++ packages/geotiff/libgeotiff-dfsg/trunk/cpl_serv.c	2007-09-19 11:39:06 UTC (rev 1077)
@@ -0,0 +1,596 @@
+/******************************************************************************
+ * Copyright (c) 1998, Frank Warmerdam
+ *
+ * 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 AUTHORS OR COPYRIGHT HOLDERS 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 OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ ******************************************************************************
+ *
+ * cpl_serv.c: Various Common Portability Library derived convenience functions
+ *
+ * $Log: cpl_serv.c,v $
+ * Revision 1.8  2001/07/09 20:14:37  warmerda
+ * Another problem freeing pszRLBuffer and not setting to NULL.
+ *
+ * Revision 1.7  2001/04/17 13:40:43  warmerda
+ * fixed freeing of line buffer in CPLReadLine(), init ptr to NULL
+ *
+ * Revision 1.6  2001/03/05 04:56:17  warmerda
+ * make it possible to deallocate CPLReadLine buffer
+ *
+ * Revision 1.5  2000/09/30 03:35:05  warmerda
+ * Fixed CPLReadLine() to use avoid calling VSIRealloc() on a NULL pointer.
+ *
+ * Revision 1.4  1999/06/25 04:35:26  warmerda
+ * Fixed to actually support long lines.
+ *
+ * Revision 1.3  1999/03/17 20:43:03  geotiff
+ * Avoid use of size_t keyword
+ *
+ * Revision 1.2  1999/03/10 18:22:39  geotiff
+ * Added string.h, fixed backslash escaping
+ *
+ * Revision 1.1  1999/03/09 15:57:04  geotiff
+ * New
+ *
+ */
+
+#include "cpl_serv.h"
+#include "geo_tiffp.h"
+
+#ifdef HAVE_STRING_H
+#  include <string.h>
+#endif
+#if defined(HAVE_STRINGS_H) && !defined(HAVE_STRING_H)
+#  include <strings.h>
+#endif
+
+/************************************************************************/
+/*                             CPLCalloc()                              */
+/************************************************************************/
+
+void *CPLCalloc( int nCount, int nSize )
+
+{
+    void	*pReturn;
+
+    if( nSize == 0 )
+        return NULL;
+    
+    pReturn = VSICalloc( nCount, nSize );
+    if( pReturn == NULL )
+    {
+        CPLError( CE_Fatal, CPLE_OutOfMemory,
+                  "CPLCalloc(): Out of memory allocating %d bytes.\n",
+                  nSize * nCount );
+    }
+
+    return pReturn;
+}
+
+/************************************************************************/
+/*                             CPLMalloc()                              */
+/************************************************************************/
+
+void *CPLMalloc( int nSize )
+
+{
+    void	*pReturn;
+
+    if( nSize == 0 )
+        return NULL;
+    
+    pReturn = VSIMalloc( nSize );
+    if( pReturn == NULL )
+    {
+        CPLError( CE_Fatal, CPLE_OutOfMemory,
+                  "CPLMalloc(): Out of memory allocating %d bytes.\n",
+                  nSize );
+    }
+
+    return pReturn;
+}
+
+/************************************************************************/
+/*                             CPLRealloc()                             */
+/************************************************************************/
+
+void * CPLRealloc( void * pData, int nNewSize )
+
+{
+    void	*pReturn;
+
+    if( pData == NULL )
+        pReturn = VSIMalloc( nNewSize );
+    else
+        pReturn = VSIRealloc( pData, nNewSize );
+    
+    if( pReturn == NULL )
+    {
+        CPLError( CE_Fatal, CPLE_OutOfMemory,
+                  "CPLRealloc(): Out of memory allocating %d bytes.\n",
+                  nNewSize );
+    }
+
+    return pReturn;
+}
+
+/************************************************************************/
+/*                             CPLStrdup()                              */
+/************************************************************************/
+
+char *CPLStrdup( const char * pszString )
+
+{
+    char	*pszReturn;
+
+    if( pszString == NULL )
+        pszString = "";
+
+    pszReturn = VSIMalloc( strlen(pszString)+1 );
+        
+    if( pszReturn == NULL )
+    {
+        CPLError( CE_Fatal, CPLE_OutOfMemory,
+                  "CPLStrdup(): Out of memory allocating %d bytes.\n",
+                  strlen(pszString) );
+        
+    }
+
+    strcpy( pszReturn, pszString );
+    
+    return( pszReturn );
+}
+
+/************************************************************************/
+/*                            CPLReadLine()                             */
+/*                                                                      */
+/*      Read a line of text from the given file handle, taking care     */
+/*      to capture CR and/or LF and strip off ... equivelent of         */
+/*      DKReadLine().  Pointer to an internal buffer is returned.       */
+/*      The application shouldn't free it, or depend on it's value      */
+/*      past the next call to CPLReadLine()                             */
+/************************************************************************/
+
+const char *CPLReadLine( FILE * fp )
+
+{
+    static char	*pszRLBuffer = NULL;
+    static int	nRLBufferSize = 0;
+    int		nLength, nReadSoFar = 0;
+
+/* -------------------------------------------------------------------- */
+/*      Cleanup case.                                                   */
+/* -------------------------------------------------------------------- */
+    if( fp == NULL )
+    {
+        CPLFree( pszRLBuffer );
+        pszRLBuffer = NULL;
+        nRLBufferSize = 0;
+        return NULL;
+    }
+
+/* -------------------------------------------------------------------- */
+/*      Loop reading chunks of the line till we get to the end of       */
+/*      the line.                                                       */
+/* -------------------------------------------------------------------- */
+    do {
+/* -------------------------------------------------------------------- */
+/*      Grow the working buffer if we have it nearly full.  Fail out    */
+/*      of read line if we can't reallocate it big enough (for          */
+/*      instance for a _very large_ file with no newlines).             */
+/* -------------------------------------------------------------------- */
+        if( nRLBufferSize-nReadSoFar < 128 )
+        {
+            nRLBufferSize = nRLBufferSize*2 + 128;
+            if( pszRLBuffer == NULL )
+                pszRLBuffer = (char *) VSIMalloc(nRLBufferSize);
+            else
+                pszRLBuffer = (char *) VSIRealloc(pszRLBuffer, nRLBufferSize);
+            if( pszRLBuffer == NULL )
+            {
+                nRLBufferSize = 0;
+                return NULL;
+            }
+        }
+
+/* -------------------------------------------------------------------- */
+/*      Do the actual read.                                             */
+/* -------------------------------------------------------------------- */
+        if( VSIFGets( pszRLBuffer+nReadSoFar, nRLBufferSize-nReadSoFar, fp )
+            == NULL )
+        {
+            CPLFree( pszRLBuffer );
+            pszRLBuffer = NULL;
+            nRLBufferSize = 0;
+
+            return NULL;
+        }
+
+        nReadSoFar = strlen(pszRLBuffer);
+
+    } while( nReadSoFar == nRLBufferSize - 1
+             && pszRLBuffer[nRLBufferSize-2] != 13
+             && pszRLBuffer[nRLBufferSize-2] != 10 );
+
+/* -------------------------------------------------------------------- */
+/*      Clear CR and LF off the end.                                    */
+/* -------------------------------------------------------------------- */
+    nLength = strlen(pszRLBuffer);
+    if( nLength > 0
+        && (pszRLBuffer[nLength-1] == 10 || pszRLBuffer[nLength-1] == 13) )
+    {
+        pszRLBuffer[--nLength] = '\0';
+    }
+    
+    if( nLength > 0
+        && (pszRLBuffer[nLength-1] == 10 || pszRLBuffer[nLength-1] == 13) )
+    {
+        pszRLBuffer[--nLength] = '\0';
+    }
+
+    return( pszRLBuffer );
+}
+
+
+/*=====================================================================
+                    StringList manipulation functions.
+ =====================================================================*/
+
+/**********************************************************************
+ *                       CSLAddString()
+ *
+ * Append a string to a StringList and return a pointer to the modified
+ * StringList.
+ * If the input StringList is NULL, then a new StringList is created.
+ **********************************************************************/
+char **CSLAddString(char **papszStrList, const char *pszNewString)
+{
+    int nItems=0;
+
+    if (pszNewString == NULL)
+        return papszStrList;    /* Nothing to do!*/
+
+    /* Allocate room for the new string */
+    if (papszStrList == NULL)
+        papszStrList = (char**) CPLCalloc(2,sizeof(char*));
+    else
+    {
+        nItems = CSLCount(papszStrList);
+        papszStrList = (char**)CPLRealloc(papszStrList, 
+                                          (nItems+2)*sizeof(char*));
+    }
+
+    /* Copy the string in the list */
+    papszStrList[nItems] = CPLStrdup(pszNewString);
+    papszStrList[nItems+1] = NULL;
+
+    return papszStrList;
+}
+
+/**********************************************************************
+ *                       CSLCount()
+ *
+ * Return the number of lines in a Stringlist.
+ **********************************************************************/
+int CSLCount(char **papszStrList)
+{
+    int nItems=0;
+
+    if (papszStrList)
+    {
+        while(*papszStrList != NULL)
+        {
+            nItems++;
+            papszStrList++;
+        }
+    }
+
+    return nItems;
+}
+
+
+/************************************************************************/
+/*                            CSLGetField()                             */
+/*                                                                      */
+/*      Fetches the indicated field, being careful not to crash if      */
+/*      the field doesn't exist within this string list.  The           */
+/*      returned pointer should not be freed, and doesn't               */
+/*      necessarily last long.                                          */
+/************************************************************************/
+
+const char * CSLGetField( char ** papszStrList, int iField )
+
+{
+    int         i;
+
+    if( papszStrList == NULL || iField < 0 )
+        return( "" );
+
+    for( i = 0; i < iField+1; i++ )
+    {
+        if( papszStrList[i] == NULL )
+            return "";
+    }
+
+    return( papszStrList[iField] );
+}
+
+/**********************************************************************
+ *                       CSLDestroy()
+ *
+ * Free all memory used by a StringList.
+ **********************************************************************/
+void CSLDestroy(char **papszStrList)
+{
+    char **papszPtr;
+
+    if (papszStrList)
+    {
+        papszPtr = papszStrList;
+        while(*papszPtr != NULL)
+        {
+            CPLFree(*papszPtr);
+            papszPtr++;
+        }
+
+        CPLFree(papszStrList);
+    }
+}
+
+
+/**********************************************************************
+ *                       CSLDuplicate()
+ *
+ * Allocate and return a copy of a StringList.
+ **********************************************************************/
+char    **CSLDuplicate(char **papszStrList)
+{
+    char **papszNewList, **papszSrc, **papszDst;
+    int  nLines;
+
+    nLines = CSLCount(papszStrList);
+
+    if (nLines == 0)
+        return NULL;
+
+    papszNewList = (char **)CPLMalloc((nLines+1)*sizeof(char*));
+    papszSrc = papszStrList;
+    papszDst = papszNewList;
+
+    while(*papszSrc != NULL)
+    {
+        *papszDst = CPLStrdup(*papszSrc);
+
+        papszSrc++;
+        papszDst++;
+    }
+    *papszDst = NULL;
+
+    return papszNewList;
+}
+
+/**********************************************************************
+ *                       CSLTokenizeString()
+ *
+ * Tokenizes a string and returns a StringList with one string for
+ * each token.
+ **********************************************************************/
+char    **CSLTokenizeString( const char *pszString )
+{
+    return CSLTokenizeStringComplex( pszString, " ", TRUE, FALSE );
+}
+
+/************************************************************************/
+/*                      CSLTokenizeStringComplex()                      */
+/*                                                                      */
+/*      The ultimate tokenizer?                                         */
+/************************************************************************/
+
+char ** CSLTokenizeStringComplex( const char * pszString,
+                                  const char * pszDelimiters,
+                                  int bHonourStrings, int bAllowEmptyTokens )
+
+{
+    char	**papszRetList = NULL;
+    char 	*pszToken;
+    int		nTokenMax, nTokenLen;
+
+    pszToken = (char *) CPLCalloc(10,1);
+    nTokenMax = 10;
+    
+    while( pszString != NULL && *pszString != '\0' )
+    {
+        int	bInString = FALSE;
+
+        nTokenLen = 0;
+        
+        /* Try to find the next delimeter, marking end of token */
+        for( ; *pszString != '\0'; pszString++ )
+        {
+
+            /* End if this is a delimeter skip it and break. */
+            if( !bInString && strchr(pszDelimiters, *pszString) != NULL )
+            {
+                pszString++;
+                break;
+            }
+            
+            /* If this is a quote, and we are honouring constant
+               strings, then process the constant strings, with out delim
+               but don't copy over the quotes */
+            if( bHonourStrings && *pszString == '"' )
+            {
+                if( bInString )
+                {
+                    bInString = FALSE;
+                    continue;
+                }
+                else
+                {
+                    bInString = TRUE;
+                    continue;
+                }
+            }
+
+            /* Within string constants we allow for escaped quotes, but
+               in processing them we will unescape the quotes */
+            if( bInString && pszString[0] == '\\' && pszString[1] == '"' )
+            {
+                pszString++;
+            }
+
+            /* Within string constants a \\ sequence reduces to \ */
+            else if( bInString
+                     && pszString[0] == '\\' && pszString[1] == '\\' )
+            {
+                pszString++;
+            }
+
+            if( nTokenLen >= nTokenMax-1 )
+            {
+                nTokenMax = nTokenMax * 2 + 10;
+                pszToken = (char *) CPLRealloc( pszToken, nTokenMax );
+            }
+
+            pszToken[nTokenLen] = *pszString;
+            nTokenLen++;
+        }
+
+        pszToken[nTokenLen] = '\0';
+
+        if( pszToken[0] != '\0' || bAllowEmptyTokens )
+        {
+            papszRetList = CSLAddString( papszRetList, pszToken );
+        }
+    }
+
+    if( papszRetList == NULL )
+        papszRetList = (char **) CPLCalloc(sizeof(char *),1);
+
+    CPLFree( pszToken );
+
+    return papszRetList;
+}
+
+/* static buffer to store the last error message.  We'll assume that error
+ * messages cannot be longer than 2000 chars... which is quite reasonable
+ * (that's 25 lines of 80 chars!!!)
+ */
+static char gszCPLLastErrMsg[2000] = "";
+static int  gnCPLLastErrNo = 0;
+
+static void (*gpfnCPLErrorHandler)(CPLErr, int, const char *) = NULL;
+
+/**********************************************************************
+ *                          CPLError()
+ *
+ * This function records an error code and displays the error message
+ * to stderr.
+ *
+ * The error code can be accessed later using CPLGetLastErrNo()
+ **********************************************************************/
+void    CPLError(CPLErr eErrClass, int err_no, const char *fmt, ...)
+{
+    va_list args;
+
+    /* Expand the error message 
+     */
+    va_start(args, fmt);
+    vsprintf(gszCPLLastErrMsg, fmt, args);
+    va_end(args);
+
+    /* If the user provided his own error handling function, then call
+     * it, otherwise print the error to stderr and return.
+     */
+    gnCPLLastErrNo = err_no;
+
+    if (gpfnCPLErrorHandler != NULL)
+    {
+        gpfnCPLErrorHandler(eErrClass, err_no, gszCPLLastErrMsg);
+    }
+    else
+    {
+        fprintf(stderr, "ERROR %d: %s\n", gnCPLLastErrNo, gszCPLLastErrMsg);
+    }
+
+    if( eErrClass == CE_Fatal )
+        abort();
+}
+
+/**********************************************************************
+ *                          CPLErrorReset()
+ *
+ * Erase any traces of previous errors.
+ **********************************************************************/
+void    CPLErrorReset()
+{
+    gnCPLLastErrNo = 0;
+    gszCPLLastErrMsg[0] = '\0';
+}
+
+
+/**********************************************************************
+ *                          CPLGetLastErrorNo()
+ *
+ **********************************************************************/
+int     CPLGetLastErrorNo()
+{
+    return gnCPLLastErrNo;
+}
+
+/**********************************************************************
+ *                          CPLGetLastErrorMsg()
+ *
+ **********************************************************************/
+const char* CPLGetLastErrorMsg()
+{
+    return gszCPLLastErrMsg;
+}
+
+/**********************************************************************
+ *                          CPLSetErrorHandler()
+ *
+ * Allow the library's user to specify his own error handler function.
+ *
+ * A valid error handler is a C function with the following prototype:
+ *
+ *     void MyErrorHandler(int errno, const char *msg)
+ *
+ * Pass NULL to come back to the default behavior.
+ **********************************************************************/
+
+void     CPLSetErrorHandler(void (*pfnErrorHandler)(CPLErr, int, const char *))
+{
+    gpfnCPLErrorHandler = pfnErrorHandler;
+}
+
+/************************************************************************/
+/*                             _CPLAssert()                             */
+/*                                                                      */
+/*      This function is called only when an assertion fails.           */
+/************************************************************************/
+
+void _CPLAssert( const char * pszExpression, const char * pszFile,
+                 int iLine )
+
+{
+    CPLError( CE_Fatal, CPLE_AssertionFailed,
+              "Assertion `%s' failed\n"
+              "in file `%s', line %d\n",
+              pszExpression, pszFile, iLine );
+}

Added: packages/geotiff/libgeotiff-dfsg/trunk/cpl_serv.h
===================================================================
--- packages/geotiff/libgeotiff-dfsg/trunk/cpl_serv.h	                        (rev 0)
+++ packages/geotiff/libgeotiff-dfsg/trunk/cpl_serv.h	2007-09-19 11:39:06 UTC (rev 1077)
@@ -0,0 +1,276 @@
+/******************************************************************************
+ * Copyright (c) 1998, Frank Warmerdam
+ *
+ * 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 AUTHORS OR COPYRIGHT HOLDERS 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 OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ ******************************************************************************
+ *
+ * cpl_serv.h
+ *
+ * This include file derived and simplified from the GDAL Common Portability
+ * Library.
+ */
+
+#ifndef CPL_SERV_H_INCLUDED
+#define CPL_SERV_H_INCLUDED
+
+/* ==================================================================== */
+/*	Standard include files.						*/
+/* ==================================================================== */
+
+#include "geo_config.h"
+#include <stdio.h>
+
+#include <math.h>
+
+#ifdef HAVE_STRING_H
+#  include <string.h>
+#endif
+#if defined(HAVE_STRINGS_H) && !defined(HAVE_STRING_H)
+#  include <strings.h>
+#endif
+#ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+#endif
+
+/**********************************************************************
+ * Do we want to build as a DLL on windows?
+ **********************************************************************/
+#if !defined(CPL_DLL)
+#  if defined(_WIN32) && defined(BUILD_AS_DLL)
+#    define CPL_DLL     __declspec(dllexport)
+#  else
+#    define CPL_DLL
+#  endif
+#endif
+
+/* ==================================================================== */
+/*      Other standard services.                                        */
+/* ==================================================================== */
+#ifdef __cplusplus
+#  define CPL_C_START		extern "C" {
+#  define CPL_C_END		}
+#else
+#  define CPL_C_START
+#  define CPL_C_END
+#endif
+
+#ifndef NULL
+#  define NULL	0
+#endif
+
+#ifndef FALSE
+#  define FALSE	0
+#endif
+
+#ifndef TRUE
+#  define TRUE	1
+#endif
+
+#ifndef MAX
+#  define MIN(a,b)      ((a<b) ? a : b)
+#  define MAX(a,b)      ((a>b) ? a : b)
+#endif
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+#ifndef ABS
+#  define ABS(x)        ((x<0) ? (-1*(x)) : x)
+#endif
+
+#ifndef EQUAL
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#  define EQUALN(a,b,n)           (strnicmp(a,b,n)==0)
+#  define EQUAL(a,b)              (stricmp(a,b)==0)
+#else
+#  define EQUALN(a,b,n)           (strncasecmp(a,b,n)==0)
+#  define EQUAL(a,b)              (strcasecmp(a,b)==0)
+#endif
+#endif
+
+/* ==================================================================== */
+/*      VSI Services (just map directly onto Standard C services.       */
+/* ==================================================================== */
+
+#define VSIFOpen	fopen
+#define VSIFClose	fclose
+#define VSIFEof		feof
+#define VSIFPrintf	fprintf
+#define VSIFPuts	fputs
+#define VSIFPutc	fputc
+#define VSIFGets	fgets
+#define VSIRewind	rewind
+#define VSIFSeek        fseek
+#define VSIFTell        ftell
+#define VSIFRead        fread
+
+#ifndef notdef
+#define VSICalloc(x,y)	_GTIFcalloc(x*y)
+#define VSIMalloc	_GTIFcalloc
+#define VSIFree	        _GTIFFree
+#define VSIRealloc      _GTIFrealloc
+#else
+#define VSICalloc(x,y)	(((char *) _GTIFcalloc(x*y+4)) + 4)
+#define VSIMalloc(x)	(((char *) _GTIFcalloc((x)+4)) + 4)
+#define VSIFree(x)      _GTIFFree(((char *) (x)) - 4)
+#define VSIRealloc(p,n) (((char *) _GTIFrealloc(((char *)p)-4,(n)+4)) + 4)
+#endif
+
+/* -------------------------------------------------------------------- */
+/*      Safe malloc() API.  Thin cover over VSI functions with fatal    */
+/*      error reporting if memory allocation fails.                     */
+/* -------------------------------------------------------------------- */
+CPL_C_START
+
+#define CPLMalloc  gtCPLMalloc
+#define CPLCalloc  gtCPLCalloc
+#define CPLRealloc gtCPLRealloc
+#define CPLStrdup  gtCPLStrdup
+
+void CPL_DLL *CPLMalloc( int );
+void CPL_DLL *CPLCalloc( int, int );
+void CPL_DLL *CPLRealloc( void *, int );
+char CPL_DLL *CPLStrdup( const char * );
+
+#define CPLFree(x)	{ if( x != NULL ) VSIFree(x); }
+
+/* -------------------------------------------------------------------- */
+/*      Read a line from a text file, and strip of CR/LF.               */
+/* -------------------------------------------------------------------- */
+
+#define CPLReadLine gtCPLReadLine
+
+const char CPL_DLL *CPLReadLine( FILE * );
+
+/*=====================================================================
+                   Error handling functions (cpl_error.c)
+ =====================================================================*/
+
+typedef enum
+{
+    CE_None = 0,
+    CE_Log = 1,
+    CE_Warning = 2,
+    CE_Failure = 3,
+    CE_Fatal = 4
+} CPLErr;
+
+#define CPLError      gtCPLError
+#define CPLErrorReset gtCPLErrorReset
+#define CPLGetLastErrorNo gtCPLGetLastErrorNo
+#define CPLGetLastErrorMsg gtCPLGetLastErrorMsg
+#define CPLSetErrorHandler gtCPLSetErrorHandler
+#define _CPLAssert    gt_CPLAssert
+
+void CPL_DLL CPLError(CPLErr eErrClass, int err_no, const char *fmt, ...);
+void CPL_DLL CPLErrorReset();
+int  CPL_DLL CPLGetLastErrorNo();
+const char CPL_DLL * CPLGetLastErrorMsg();
+void CPL_DLL CPLSetErrorHandler(void(*pfnErrorHandler)(CPLErr,int,
+                                                       const char *));
+void CPL_DLL _CPLAssert( const char *, const char *, int );
+
+#ifdef DEBUG
+#  define CPLAssert(expr)  ((expr) ? (void)(0) : _CPLAssert(#expr,__FILE__,__LINE__))
+#else
+#  define CPLAssert(expr)
+#endif
+
+CPL_C_END
+
+/* ==================================================================== */
+/*      Well known error codes.                                         */
+/* ==================================================================== */
+
+#define CPLE_AppDefined			1
+#define CPLE_OutOfMemory		2
+#define CPLE_FileIO			3
+#define CPLE_OpenFailed			4
+#define CPLE_IllegalArg			5
+#define CPLE_NotSupported		6
+#define CPLE_AssertionFailed		7
+#define CPLE_NoWriteAccess		8
+
+/*=====================================================================
+                   Stringlist functions (strlist.c)
+ =====================================================================*/
+CPL_C_START
+
+#define CSLAddString gtCSLAddString
+#define CSLCount     gtCSLCount
+#define CSLGetField  gtCSLGetField
+#define CSLDestroy   gtCSLDestroy
+#define CSLDuplicate gtCSLDuplicate
+#define CSLTokenizeString gtCSLTokenizeString
+#define CSLTokenizeStringComplex gtCSLTokenizeStringComplex
+
+char CPL_DLL   **CSLAddString(char **papszStrList, const char *pszNewString);
+int  CPL_DLL   CSLCount(char **papszStrList);
+const char CPL_DLL *CSLGetField( char **, int );
+void CPL_DLL   CSLDestroy(char **papszStrList);
+char CPL_DLL   **CSLDuplicate(char **papszStrList);
+
+char CPL_DLL   **CSLTokenizeString(const char *pszString );
+char CPL_DLL   **CSLTokenizeStringComplex(const char *pszString,
+                                   const char *pszDelimiter,
+                                   int bHonourStrings, int bAllowEmptyTokens );
+
+/* ==================================================================== */
+/*      .csv file related functions (from cpl_csv.c)                    */
+/* ==================================================================== */
+
+typedef enum {
+    CC_ExactString,
+    CC_ApproxString,
+    CC_Integer
+} CSVCompareCriteria;
+
+#define CSVFilename gtCSVFilename
+#define CSVReadParseLine gtCSVReadParseLine
+#define CSVScanLines gtCSVScanLines
+#define CSVScanFile gtCSVScanFile
+#define CSVScanFileByName gtCSVScanFileByName
+#define CSVGetFieldId gtCSVGetFieldId
+#define CSVDeaccess gtCSVDeaccess
+#define CSVGetField gtCSVGetField
+#define SetCSVFilenameHook gtSetCSVFilenameHook
+#define CSVGetFileFieldId gtCSVGetFileFieldId
+
+const char CPL_DLL *CSVFilename( const char * );
+
+char CPL_DLL **CSVReadParseLine( FILE * );
+char CPL_DLL **CSVScanLines( FILE *, int, const char *, CSVCompareCriteria );
+char CPL_DLL **CSVScanFile( const char *, int, const char *,
+                            CSVCompareCriteria );
+char CPL_DLL **CSVScanFileByName( const char *, const char *, const char *,
+                                  CSVCompareCriteria );
+int CPL_DLL CSVGetFieldId( FILE *, const char * );
+int CPL_DLL CSVGetFileFieldId( const char *, const char * );
+
+void CPL_DLL CSVDeaccess( const char * );
+
+const char CPL_DLL *CSVGetField( const char *, const char *, const char *,
+                                 CSVCompareCriteria, const char * );
+
+void CPL_DLL SetCSVFilenameHook( const char *(*)(const char *) );
+
+CPL_C_END
+
+#endif /* ndef CPL_SERV_H_INCLUDED */

Added: packages/geotiff/libgeotiff-dfsg/trunk/debian/README.Debian
===================================================================
--- packages/geotiff/libgeotiff-dfsg/trunk/debian/README.Debian	                        (rev 0)
+++ packages/geotiff/libgeotiff-dfsg/trunk/debian/README.Debian	2007-09-19 11:39:06 UTC (rev 1077)
@@ -0,0 +1,13 @@
+libgeotiff for Debian
+---------------------
+
+** IMPORTANT ** IMPORTANT ** IMPORTANT ** IMPORTANT **
+
+This version of the GeoTIFF library lacks the EPSG data files which are distributed
+in a separate non-free package libgeotiff-epsg due to license limitations. 
+The library is anyway working and usable also without those files. If you need 
+to have reference information for standard projections, you have to install 
+that additional package.
+
+ -- Francesco Paolo Lovergine <frankie at debian.org>  Wed, 19 Sep 2007 10:51:31