changeset 1713:318f6b6153bd

merge
author Volker Grabsch <vog@notjusthosting.com>
date Sun, 27 Mar 2011 23:36:16 +0200
parents 775149ce54a1 (current diff) 9b89021c4418 (diff)
children 8aba3acd6389
files doc/index.html src/libsndfile-1-sed.patch
diffstat 32 files changed, 2568 insertions(+), 97 deletions(-) [+]
line wrap: on
line diff
--- a/doc/index.html	Sun Mar 27 23:32:27 2011 +0200
+++ b/doc/index.html	Sun Mar 27 23:36:16 2011 +0200
@@ -442,44 +442,16 @@
 
     <dl>
 
-    <dt>2011-03-19 &ndash; Release <span id="latest-version">2.19</span></dt>
+    <dt>2011-xx-xx &ndash; Release <span id="latest-version">2.20</span></dt>
     <dd>
         <p>
-        <a href="https://bitbucket.org/vog/mingw-cross-env/downloads/mingw-cross-env-2.19.tar.gz">Download</a> |
-        <a href="http://hg.savannah.nongnu.org/hgweb/mingw-cross-env/log/2.19">Changelog</a>
-        </p>
-
-        <p>
-        The download mechanisms are improved.
-        </p>
-
-        <p>
-        A CMake toolchain file is provided
-        to simplify cross-compiling projects which use CMake.
-        </p>
-
-        <p>
-        Support for Debian/Lenny is dropped.
-        </p>
-
-        <p>
-        Package gtk is renamed to gtk2.
+        <a href="https://bitbucket.org/vog/mingw-cross-env/downloads/mingw-cross-env-2.20.tar.gz">Download</a> |
+        <a href="http://hg.savannah.nongnu.org/hgweb/mingw-cross-env/log/2.20">Changelog</a>
         </p>
 
         <p>
         Almost all packages are updated to their latest version.
         </p>
-
-        <p>
-        New packages are supported:
-        dbus, graphicsmagick, libical, liboauth, physfs, and vigra.
-        </p>
-
-        <p>
-        Note for <code>boost::filesystem</code> users:
-        <a href="http://beta.boost.org/doc/libs/1_46_1/libs/filesystem/v3/doc/index.htm">Version 3 is a major revision</a>
-        and now the default in 1.46.
-        </p>
     </dd>
 
     <dt>Old Releases</dt>
@@ -726,7 +698,7 @@
     <pre>sudo port install autoconf automake bison cmake flex \
                   gsed intltool libtool openssl \
                   p5-xml-parser pkgconfig scons \
-                  wget xz-devel yasm</pre>
+                  wget xz yasm</pre>
     <p>
     On Mac OS X ≤ 10.5, also select a more recent GCC:
     </p>
@@ -1147,6 +1119,46 @@
 
     <dl>
 
+    <dt>2011-03-19 &ndash; Release 2.19</dt>
+    <dd>
+        <p>
+        <a href="https://bitbucket.org/vog/mingw-cross-env/downloads/mingw-cross-env-2.19.tar.gz">Download</a> |
+        <a href="http://hg.savannah.nongnu.org/hgweb/mingw-cross-env/log/2.19">Changelog</a>
+        </p>
+
+        <p>
+        The download mechanisms are improved.
+        </p>
+
+        <p>
+        A CMake toolchain file is provided
+        to simplify cross-compiling projects which use CMake.
+        </p>
+
+        <p>
+        Support for Debian/Lenny is dropped.
+        </p>
+
+        <p>
+        Package gtk is renamed to gtk2.
+        </p>
+
+        <p>
+        Almost all packages are updated to their latest version.
+        </p>
+
+        <p>
+        New packages are supported:
+        dbus, graphicsmagick, libical, liboauth, physfs, and vigra.
+        </p>
+
+        <p>
+        Note for <code>boost::filesystem</code> users:
+        <a href="http://beta.boost.org/doc/libs/1_46_1/libs/filesystem/v3/doc/index.htm">Version 3 is a major revision</a>
+        and now the default in 1.46.
+        </p>
+    </dd>
+
     <dt>2010-12-15 &ndash; Release 2.18</dt>
     <dd>
         <p>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/exiv2-r2469.patch	Sun Mar 27 23:36:16 2011 +0200
@@ -0,0 +1,79 @@
+# This file is part of mingw-cross-env.
+# See doc/index.html for further information.
+
+This patch has been taken from:
+http://dev.exiv2.org/issues/764
+
+Index: trunk/src/psdimage.cpp
+===================================================================
+--- trunk/src/psdimage.cpp	(revision 2468)
++++ trunk/src/psdimage.cpp	(revision 2469)
+@@ -400,7 +400,7 @@
+             uint32_t resourceType = getULong(buf, bigEndian);
+ 
+             if (resourceType != kPhotoshopResourceType) {
+-                break; // bad resource type
++                throw Error(3, "Photoshop"); // bad resource type
+             }
+             uint16_t resourceId = getUShort(buf + 4, bigEndian);
+             uint32_t resourceNameLength = buf[6];
+@@ -416,13 +416,13 @@
+             if (io_->read(buf, 4) != 4) throw Error(3, "Photoshop");
+ 
+             uint32_t resourceSize = getULong(buf, bigEndian);
++            uint32_t pResourceSize = (resourceSize + 1) & ~1;    // padded resource size
+             uint32_t curOffset = io_->tell();
+ 
+             // Write IPTC_NAA resource block
+             if ((resourceId == kPhotoshopResourceID_IPTC_NAA  ||
+                  resourceId >  kPhotoshopResourceID_IPTC_NAA) && iptcDone == false) {
+                 newResLength += writeIptcData(iptcData_, outIo);
+-                resourceSize = (resourceSize + 1) & ~1;    // adjust for padding
+                 iptcDone = true;
+             }
+ 
+@@ -430,7 +430,6 @@
+             else if ((resourceId == kPhotoshopResourceID_ExifInfo  ||
+                       resourceId >  kPhotoshopResourceID_ExifInfo) && exifDone == false) {
+                 newResLength += writeExifData(exifData_, outIo);
+-                resourceSize = (resourceSize + 1) & ~1;    // adjust for padding
+                 exifDone = true;
+             }
+ 
+@@ -438,7 +437,6 @@
+             else if ((resourceId == kPhotoshopResourceID_XMPPacket  ||
+                       resourceId >  kPhotoshopResourceID_XMPPacket) && xmpDone == false) {
+                 newResLength += writeXmpData(xmpData_, outIo);
+-                resourceSize = (resourceSize + 1) & ~1;    // adjust for padding
+                 xmpDone = true;
+             }
+ 
+@@ -467,10 +465,9 @@
+ 
+                 readTotal = 0;
+                 toRead = 0;
+-                resourceSize = (resourceSize + 1) & ~1;        // pad to even
+-                while (readTotal < resourceSize) {
+-                    toRead =   static_cast<long>(resourceSize - readTotal) < lbuf.size_
+-                             ? static_cast<long>(resourceSize - readTotal) : lbuf.size_;
++                while (readTotal < pResourceSize) {
++                    toRead =   static_cast<long>(pResourceSize - readTotal) < lbuf.size_
++                             ? static_cast<long>(pResourceSize - readTotal) : lbuf.size_;
+                     if (io_->read(lbuf.pData_, toRead) != toRead) {
+                         throw Error(3, "Photoshop");
+                     }
+@@ -478,11 +475,11 @@
+                     if (outIo.write(lbuf.pData_, toRead) != toRead) throw Error(21);
+                 }
+                 if (outIo.error()) throw Error(21);
+-                newResLength += resourceSize + adjResourceNameLen + 12;
++                newResLength += pResourceSize + adjResourceNameLen + 12;
+             }
+ 
+-            io_->seek(curOffset + resourceSize, BasicIo::beg);
+-            oldResLength -= (12 + adjResourceNameLen + resourceSize);
++            io_->seek(curOffset + pResourceSize, BasicIo::beg);
++            oldResLength -= (12 + adjResourceNameLen + pResourceSize);
+         }
+ 
+         // Append IPTC_NAA resource block, if not yet written
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/exiv2-r2472.patch	Sun Mar 27 23:36:16 2011 +0200
@@ -0,0 +1,41 @@
+# This file is part of mingw-cross-env.
+# See doc/index.html for further information.
+
+This patch has been taken from:
+http://dev.exiv2.org/issues/767
+
+Index: trunk/config/configure.ac
+===================================================================
+--- trunk/config/configure.ac	(revision 2471)
++++ trunk/config/configure.ac	(revision 2472)
+@@ -31,12 +31,6 @@
+ AC_PROG_LN_S
+ AC_PROG_MAKE_SET
+ AC_CANONICAL_HOST
+-# Add flag for DLL on Windows
+-case "$host_os" in
+-*mingw* | *cygwin*)
+-    LDFLAGS="$LDFLAGS -no-undefined"
+-    ;;
+-esac
+ 
+ # ---------------------------------------------------------------------------
+ # i18n support
+@@ -204,6 +198,17 @@
+ fi
+ AC_SUBST(EXV_LIB_STATIC)
+ 
++# Add flag for DLL on Windows
++#
++# This must happen after all other configure checks, because
++# the "-no-undefined" flag is only for libtool and may not be
++# passed to GCC by accident.
++case "$host_os" in
++*mingw* | *cygwin*)
++    LDFLAGS="$LDFLAGS -no-undefined"
++    ;;
++esac
++
+ # ---------------------------------------------------------------------------
+ # Create output files.
+ # ---------------------------------------------------------------------------
--- a/src/exiv2.mk	Sun Mar 27 23:32:27 2011 +0200
+++ b/src/exiv2.mk	Sun Mar 27 23:36:16 2011 +0200
@@ -20,8 +20,8 @@
 endef
 
 define $(PKG)_BUILD
-    # workaround for the missing snprintf() in the <cstdio> of GCC-4.4.0
-    $(SED) -i 's,#include <cstdio>,#include <stdio.h>,' '$(1)/xmpsdk/src/XMPMeta.cpp'
+    # rebuild configure script as one of the patches modifies configure.ac
+    $(MAKE) -C '$(1)/config' -f config.make
     # wine confuses the cross-compiling detection, so set it explicitly
     $(SED) -i 's,cross_compiling=no,cross_compiling=yes,' '$(1)/configure'
     cd '$(1)' && ./configure \
--- a/src/ffmpeg.mk	Sun Mar 27 23:32:27 2011 +0200
+++ b/src/ffmpeg.mk	Sun Mar 27 23:36:16 2011 +0200
@@ -4,8 +4,8 @@
 # ffmpeg
 PKG             := ffmpeg
 $(PKG)_IGNORE   :=
-$(PKG)_VERSION  := 0.6.1
-$(PKG)_CHECKSUM := 24ada1d35fc000980090e773101e101ca45f85e5
+$(PKG)_VERSION  := 0.6.2
+$(PKG)_CHECKSUM := d4e464d4111971b9cef10be7a1efa3677a899338
 $(PKG)_SUBDIR   := $(PKG)-$($(PKG)_VERSION)
 $(PKG)_FILE     := $(PKG)-$($(PKG)_VERSION).tar.bz2
 $(PKG)_WEBSITE  := http://www.ffmpeg.org/
--- a/src/fltk.mk	Sun Mar 27 23:32:27 2011 +0200
+++ b/src/fltk.mk	Sun Mar 27 23:36:16 2011 +0200
@@ -22,6 +22,7 @@
     $(SED) -i 's,\$$uname,MINGW,g' '$(1)/configure'
     # wine confuses the cross-compiling detection, so set it explicitly
     $(SED) -i 's,cross_compiling=no,cross_compiling=yes,' '$(1)/configure'
+    $(SED) -i 's,-mno-cygwin,,' '$(1)/configure'
     cd '$(1)' && ./configure \
         --host='$(TARGET)' \
         --disable-shared \
--- a/src/freetds-1-fastforward.patch	Sun Mar 27 23:32:27 2011 +0200
+++ b/src/freetds-1-fastforward.patch	Sun Mar 27 23:36:16 2011 +0200
@@ -176870,3 +176870,1518 @@
  	if (pdata->Aflag && pdata->packetsize > 0) {
  		DBSETLPACKET(login, pdata->packetsize);
  	}
+
+commit 76772b234cde83105f6f897f1370bee35edec619
+Author: jklowden <jklowden>
+Date:   Tue Mar 22 00:23:23 2011 +0000
+
+    updated for upcoming release
+
+diff --git a/ChangeLog b/ChangeLog
+index d330b3f..ac8e369 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,6 @@
++Mon Mar 21 20:21:51 EDT 2011	JK Lowden <jklowden@freetds.org>
++	* doc/userguide.sgml updated for upcoming release
++
+ Sun Mar 13 14:40:55 EDT 2011	JK Lowden <jklowden@freetds.org>
+ 	* doc/bsqldb.txt doc/freebcp.txt doc/tsql.txt
+ 	- doc/userguide.sgml
+@@ -3180,4 +3183,4 @@ Wed Jan  9 19:54:43 EST 2008	JK Lowden <jklowden@freetds.org>
+ 	* ChangeLog-0.82 added because of release
+ 	
+ $FreeTDS$
+-$Id: ChangeLog,v 1.3201 2011/03/13 21:32:39 jklowden Exp $
++$Id: ChangeLog,v 1.3202 2011/03/22 00:23:23 jklowden Exp $
+diff --git a/doc/userguide.sgml b/doc/userguide.sgml
+index ac19ae9..80f95bc 100644
+--- a/doc/userguide.sgml
++++ b/doc/userguide.sgml
+@@ -13,8 +13,8 @@
+ ]>
+ <book>
+ <bookinfo>
+-	<date>$Date: 2011/03/12 12:54:01 $</date>
+-	<releaseinfo>$Revision: 1.134 $</releaseinfo>
++	<date>$Date: 2011/03/22 00:23:24 $</date>
++	<releaseinfo>$Revision: 1.135 $</releaseinfo>
+ 	<title>&freetds; User Guide</title>
+ 	<subtitle>A Guide to Installing, Configuring, and Running &freetds;</subtitle>
+ 	<author>
+@@ -63,9 +63,9 @@
+ 
+ <para>The version you're reading is:</para>
+ 			<simplelist type='vert'>
+-				<member>$Revision: 1.134 $</>
+-				<member>$Date: 2011/03/12 12:54:01 $</>
+-				<member>CVS control number $Id: userguide.sgml,v 1.134 2011/03/12 12:54:01 jklowden Exp $.</>
++				<member>$Revision: 1.135 $</>
++				<member>$Date: 2011/03/22 00:23:24 $</>
++				<member>CVS control number $Id: userguide.sgml,v 1.135 2011/03/22 00:23:24 jklowden Exp $.</>
+ 				</simplelist>
+ 			</footnote>
+ 		can be found on the &freetds;
+@@ -83,17 +83,18 @@
+ 	<title>What is &freetds;?</title>
+ 	
+ 
+-<para>&freetds; is re-implementation of C libraries originally implmented by Sybase and Microsoft SQL Server.  It includes drop-in replacements for 
++<para>&freetds; is re-implementation of C libraries originally marketed by Sybase and Microsoft SQL Server.  It allows many open source applications such as <productname>Perl</productname> and <productname>PHP</productname> (or your own C or C++ program) to connect to Sybase or Microsoft <productname>SQL Server</productname>.  </para>
++
++<para>&freetds; provides drop-in replacements for 
+ 
+ <itemizedlist>
+-	<listitem><para>Sybase's <systemitem class="library">DB-Library</systemitem> or <systemitem class="library">CT-Library</systemitem></para></listitem>
+-	<listitem><para>Microsoft's <systemitem class="library">DB-Library</systemitem> (which differs in small details from Sybase's)</para></listitem>
+-	<listitem><para>an <systemitem class="library">ODBC library</systemitem> similar that provided by the vendors</para></listitem>
++	<listitem><para>Sybase's &dblib; and &ctlib;</para></listitem>
++	<listitem><para>Microsoft's &dblib; (which differs in small details from Sybase's)</para></listitem>
++	<listitem><para>the &odbc; drivers from both vendors</para></listitem>
++	<listitem><para>interactive SQL and BCP utilities</para></listitem>
+ </itemizedlist>
+ 
+-The <quote>TDS</quote> part of the name comes from name of the protocol used to communicate with such servers: the Tabular Data Stream.   
+-
+-&freetds; allows many open source applications such as <productname>Perl</productname> and <productname>PHP</productname> (or your own C or C++ program) to connect to Sybase or Microsoft <productname>SQL Server</productname>.</para>
++The <quote>TDS</quote> part of the name comes from name of the protocol used to communicate with such servers: the Tabular Data Stream.  </para>
+ 
+ <para>&freetds; is distributed in source code form, and is expected to compile on just about any operating system.  That means every form of Unix&reg; and Unix-like&trade; system (including notable variants such as Interix&reg; and QNX&reg;), as well as Win32&reg;, VMS&reg;, and OS X&reg;.  If it doesn't compile on your system &mdash; and you're not using MS-DOS&reg; &mdash; it's probably considered a bug.</para>
+ 
+@@ -104,17 +105,17 @@ The <quote>TDS</quote> part of the name comes from name of the protocol used to
+ 
+ <para><acronym>TDS</> is a <firstterm>protocol</firstterm>, a set of rules describing how to transmit data between two computers.  Like any protocol, it defines the types of messages that can be sent, and the order in which they may be sent.  Protocols describe the <quote>bits on the wire</quote>, how data flow.</para>
+ 
+-<para>In reading this manual, it may be helpful to keep in mind that a protocol is not an <acronym>API</>, although the two are related.  The server recognizes and speaks a protocol; anything that can send it the correct combination of bytes in the right order can communicate with it.  But programmers aren't generally in the business of sending bytes; that's the job of a library.  Over the years, there have been a few libraries &mdash; each with its own <acronym>API</> &mdash; that do the work of moving SQL through a <acronym>TDS</> pipe.  <systemitem class="library">ODBC</systemitem>, &dblib;, and &ctlib; have very different <acronym>API</>s, but they're all one to the server, because on the wire they speak <acronym>TDS</>.</para>
++<para>In reading this manual, it may be helpful to keep in mind that a protocol is not an <acronym>API</>, although the two are related.  The server recognizes and speaks a protocol; anything that can send it the correct combination of bytes in the right order can communicate with it.  But programmers aren't generally in the business of sending bytes; that's the job of a library.  Over the years, there have been a few libraries &mdash; each with its own <acronym>API</> &mdash; that do the work of moving SQL through a <acronym>TDS</> pipe.  &odbc;, &dblib;, and &ctlib; have very different <acronym>API</>s, but they're all one to the server, because on the wire they speak <acronym>TDS</>.</para>
+ 
+-<para>The <acronym>TDS</> protocol was designed and developed by Sybase Inc. for their Sybase <productname>SQL Server</productname> relational database engine in 1984.  The problem Sybase faced then still exists: There was no commonly accepted application-level protocol to transfer data between a database server and its client.  To encourage the use of their product, Sybase came up with <systemitem class="library">DB-Library</systemitem>.</para>
++<para>The <acronym>TDS</> protocol was designed and developed by Sybase Inc. for their Sybase <productname>SQL Server</productname> relational database engine in 1984.  The problem Sybase faced then still exists: There was no commonly accepted application-level protocol to transfer data between a database server and its client.  To encourage the use of their product, Sybase came up with &dblib;.</para>
+ 
+-<para><systemitem class="library">DB-Library</systemitem> provided an <acronym>API</> to the client program, and communicated with the server.  What it sent to the server took the form of a stream of bytes meant for tables of data, a Tabular Data Stream.</para>
++<para>&dblib; provided an <acronym>API</> to the client program, and communicated with the server.  What it sent to the server took the form of a stream of bytes meant for tables of data, a Tabular Data Stream.</para>
+ 
+-<para>In 1990 Sybase entered into a technology sharing agreement with Microsoft which resulted in Microsoft marketing its own <productname>SQL Server</productname>. Microsoft kept the <systemitem class="library">DB-Library</systemitem> <acronym>API</> and added <systemitem class="library">ODBC</systemitem>.  (Microsoft has since added other <acronym>API</>s, too.  It no longer supports its own <systemitem class="library">DB-Library</systemitem> implementation.) At about the same time, Sybase introduced a more powerful <quote>successor</quote> to <systemitem class="library">DB-Library</systemitem>, called <systemitem class="library">CT-Library</systemitem>, and called the pair <productname><firstterm>OpenClient</firstterm></productname>.</para>
++<para>In 1990 Sybase entered into a technology sharing agreement with Microsoft which resulted in Microsoft marketing its own <productname>SQL Server</productname>. Microsoft kept the &dblib; <acronym>API</> and added &odbc;.  (Microsoft has since added other <acronym>API</>s, too.  It no longer supports its own &dblib; implementation.) At about the same time, Sybase introduced a more powerful <quote>successor</quote> to &dblib;, called &ctlib;, and called the pair <productname><firstterm>OpenClient</firstterm></productname>.</para>
+ 
+-<para><systemitem class="library">CT-Library</systemitem>, <systemitem class="library">DB-Library</systemitem>, and <systemitem class="library">ODBC</systemitem> are <acronym>API</>s that &mdash; however different their programming style may be &mdash; all communicate with the server in the same way.  The language they use is <acronym>TDS</>.</para>
++<para>&ctlib;, &dblib;, and &odbc; are <acronym>API</>s that &mdash; however different their programming style may be &mdash; all communicate with the server in the same way.  The language they use is <acronym>TDS</>.</para>
+ 
+-<para>The <acronym>TDS</> protocol comes in several flavors, most of which have never been openly documented.  If anything, it's probably considered to be something like a trade secret, or at least proprietary technology.  The exception is <acronym>TDS</> 5.0, used exclusively by Sybase, for which documentation is available <ulink url="http://crm.sybase.com/sybase/www/ESD/tds_spec_download.jsp">from Sybase</ulink>.</para>
++<para>The <acronym>TDS</> protocol comes in several flavors, most of which were not openly documented.  If anything, it was considered to be something like a trade secret, or at least proprietary technology.  The exception is <acronym>TDS</> 5.0, used exclusively by Sybase, for which documentation is available <ulink url="http://crm.sybase.com/sybase/www/ESD/tds_spec_download.jsp">from Sybase</ulink>.</para>
+ 		</sect1>
+ 	
+ 	<sect1 id="tdshistory">
+@@ -132,46 +133,43 @@ The <quote>TDS</quote> part of the name comes from name of the protocol used to
+ <para>The version in use at the time of the Sybase/Microsoft split.</para>
+ 					</listitem></varlistentry>
+ 			
+-			<varlistentry><term><acronym>TDS 5.0</acronym>
+-					Sybase</term>
+-				<listitem>
+-
+-<para>Introduced for Sybase.  Because TDS 5.0 includes negotiated capabilities through which protocol features can be expanded, we are unlikely to see a new <acronym>TDS</> version from Sybase.</para>
+-					</listitem></varlistentry>
++			<varlistentry>
++				<term><acronym>TDS 5.0</acronym> Sybase</term>
++				<listitem><para>Introduced for Sybase.  Because TDS 5.0 includes negotiated capabilities through which protocol features can be expanded, we are unlikely to see a new <acronym>TDS</> version from Sybase.</para></listitem>
++				</varlistentry>
+ 			
+-			<varlistentry><term><acronym>TDS 7.0</acronym>
+-					Microsoft</term>
+-				<listitem>
+-
+-<para>Introduced for <productname>SQL Server 7.0</productname>.  Includes support for the extended datatypes in <productname>SQL Server 7.0</productname> (such as <structname>char</structname>/<structname>varchar</structname> fields of more than 255 characters).  It also includes support for Unicode.</para>
+-					</listitem></varlistentry>
++			<varlistentry>
++				<term><acronym>TDS 7.0</acronym> Microsoft</term>
++				<listitem><para>Introduced for <productname>SQL Server 7.0</productname>.  Includes support for the extended datatypes in <productname>SQL Server 7.0</productname> (such as <structname>char</structname>/<structname>varchar</structname> fields of more than 255 characters).  It also includes support for Unicode.</para></listitem>
++				</varlistentry>
+ 			
+-			<varlistentry><term>TDS 7.1
+-					Microsoft</term>
+-				<listitem>
+-
+-<para>Introduced for <productname>SQL Server 2000</productname>.  Includes support for big integer (64-bit <structname>int</structname>) and <quote>variant</quote> datatypes.</para>
+-					</listitem></varlistentry>
++			<varlistentry>
++				<term>TDS 7.1 Microsoft</term> 
++				<term><emphasis>was</emphasis> 8.0
++					<footnote><para>Earlier &freetds; documentation referred to versions 7, 8 and 9.  Microsoft subsequently published a protocol specification document denoting 7.1 and 7.2, and one finds scattered references using that scheme elsewhere, too.  For that reason, &freetds; switched to Microsoft's nomenclature.  </para></footnote>
++					</term>
++				<listitem><para>Introduced for <productname>SQL Server 2000</productname>.  Includes support for big integer (64-bit <structname>int</structname>) and <quote>variant</quote> datatypes.</para></listitem>
++				</varlistentry>
+ 			
+-			<varlistentry><term>TDS 7.2
+-					Microsoft</term>
+-				<listitem>
++			<varlistentry>
++				<term>TDS 7.2 Microsoft</term>
++				<term><emphasis>was</emphasis> 9.0</term>
++				<listitem><para>Introduced for <productname>SQL Server 2005</productname>.  Includes support for varchar(max), varbinary(max), xml datatypes and MARS.</para></listitem>
++				</varlistentry>
+ 
+-<para>Introduced for <productname>SQL Server 2005</productname>.  Includes support for varchar(max), varbinary(max), xml datatypes and MARS.</para>
+-					</listitem></varlistentry>
+-			
+ 			</variablelist>
+ 		</sect1>
+ 	
+-	<sect1 id="FreeTDShistory"> <title>History of &freetds;</title>
++	<sect1 id="FreeTDShistory">
++		<title>History of &freetds;</title>
+ 
+ <para>&freetds; was and is developed by observation and experimentation, which is to say, by trial and error.</para>
+ 
+ <para>In early 1997, the only option for connecting to a Sybase server from Linux or other free systems was an aging Sybase-released version of <productname>OpenClient</productname>.  Unfortunately it had a few problems.  The original release was <symbol>a.out</>-based, although Greg Thain did a great service in converting the library to ELF.  Secondly, it included only the newer &ctlib; <acronym>API</>.  The older &dblib; <acronym>API</> was missing.</para>
+ 
+-<para>Brian Bruns, a Sybase DBA and originator of the &freetds; project, had some &dblib; programs he wanted to run under Linux, and thus began the &freetds; project. The original work focused on &dblib; and version 5.0 of the protocol, but quickly expanded to include a &ctlib; compatible layer and <acronym>TDS</> version 4.2.  Later support for <systemitem class="library">ODBC</systemitem> and <acronym>TDS 7.0 and 7.1</> was added. Craig Spannring wrote a Java  <acronym>JDBC</> driver which became <productname>FreeTDS/JDBC</productname>.</para>
++<para>Brian Bruns, a Sybase DBA and originator of the &freetds; project, had some &dblib; programs he wanted to run under Linux, and thus began the &freetds; project. The original work focused on &dblib; and version 5.0 of the protocol, but quickly expanded to include a &ctlib; compatible layer and <acronym>TDS</> version 4.2.  Later support for &odbc; and <acronym>TDS 7.0 and 7.1</> was added. Craig Spannring wrote a Java  <acronym>JDBC</> driver which became <productname>FreeTDS/JDBC</productname>.</para>
+ 
+-<para>As the project matured, it gained new participants.  Frediano Ziglio greatly expanded the <systemitem class="library">ODBC</systemitem> driver, and continues to improve both it and the underlying TDS library.  Bill Thompson wrote most of the present BCP system and added cursors to our &ctlib;.  Your humble author joined the project to add documentation, and wound up as the project's maintainer.  Such are the rewards for doing a good deed.</para>
++<para>As the project matured, it gained new participants.  Frediano Ziglio greatly expanded the &odbc; driver, and continues to improve both it and the underlying TDS library.  Bill Thompson wrote most of the present BCP system and added cursors to our &ctlib;.  Your humble author joined the project to add documentation, and in 2002 became its maintainer.  Such are the rewards for doing a good deed.</para>
+ 
+ <para>There have been many other contributions.  Please see the <filename>AUTHORS</> in the distribution for a (we hope) complete list.</para>
+ 		</sect1>
+@@ -182,7 +180,7 @@ The <quote>TDS</quote> part of the name comes from name of the protocol used to
+ 
+ <para>&freetds; consists of two projects.  The &freetds; C libraries and &freetds;/ <acronym>JDBC</>.</para>
+ 			<itemizedlist mark=opencircle>
+-				<listitem><para>The &freetds; C libraries support three separate <acronym>API</>s: &dblib;, &ctlib;, and <systemitem class="library">ODBC</systemitem>.  Underlying these three is libtds, which handles the low-level details of the <acronym>TDS</> protocol, such as sending, receiving, and datatype conversion.  This document and the <ulink url="http://www.freetds.org/">FreeTDS</ulink> website are dedicated to these libraries.
++				<listitem><para>The &freetds; C libraries support three separate <acronym>API</>s: &dblib;, &ctlib;, and &odbc;.  Underlying these three is libtds, which handles the low-level details of the <acronym>TDS</> protocol, such as sending, receiving, and datatype conversion.  This document and the <ulink url="http://www.freetds.org/">FreeTDS</ulink> website are dedicated to these libraries.
+ </para></listitem>
+ 				<listitem><para>If Java is your game, we refer you to the
+ 						<ulink url="http://sourceforge.net/projects/jtds/">jTDS</ulink>
+@@ -194,7 +192,7 @@ The <quote>TDS</quote> part of the name comes from name of the protocol used to
+ 		<sect2 id="Status">
+ 			<title>Status</title>
+ 
+-<para>The libraries are portable, mature, and stable.  They're expected to compile readily and normally do not crash or corrupt data.  There is a logging feature to aid in diagnosing problems.  While they do not include every feature provided by the vendors' libaries, they do faithfully implement a useful &mdash; and widely used &mdash; subset of their <acronym>API</>s.</para>
++<para>The libraries are portable, mature, and stable.  They're expected to compile readily and normally do not crash or corrupt data.  Extensive logging  aids in diagnosing problems.  While they do not include every feature provided by the vendors' libraries, they do faithfully implement a useful &mdash; and widely used &mdash; subset of their <acronym>API</>s.</para>
+ 
+ <para>The &dblib; and &ctlib; <acronym>API</>s have been usable for several years.  They have been successfully  substituted for Sybase's own libraries in a variety of venues, including <productname>Perl</productname> and <productname>PHP</productname>.</para>
+ 
+@@ -202,11 +200,13 @@ The <quote>TDS</quote> part of the name comes from name of the protocol used to
+ 
+ <para>Basic <link linkend="apireference">API coverage</link> information for all libraries may be found in this manual.  It is maintained in <filename>doc/api_status.txt</>, included in the source distribution.</para>
+ 
++<para><note><para>For Microsoft servers, &freetds; now offers the best &dblib; for any OS on the planet (including Windows!) thanks not only to the hard work of its contributors, but also to Microsoft's<footnote><para>Microsoft ceased enhancing &dblib; in 2001, advising customers to <quote>avoid using &dblib;</quote>.  For Microsoft's unmaintained product, that's good advice.  But if the &dblib; specification meets your needs, &freetds; permits you to keep using it with little loss (and some gain) of functionality. </para></footnote> strategy.   It is the only Win64 implementation of &dblib;, and the only  Win32 implementation to support modern versions of the protocol.  (SQL Server 2008 still accepts the TDS 4.2 connections that Microsoft's old library uses, but rejects BCP uploads with a spurious permission-denied message.) </para></note></para>
++
+ <para>In addition to the core &dblib; <acronym>API</>, &freetds;  includes a full implementation of &dblib;'s <acronym>bcp</> functions, as well as <command>freebcp</>, a replacement for Sybase's <application>bcp</application> utility.</para>
+ 
+-<para>How big is it?  &freetds; has over 90,000 lines of C code, maintained by a handful of developers.  Patches arrive irregularly, varying in size from one-liners to thousand-line monsters.  Almost all are applied or used in some way.  The mailing list has some 700 or so subscribers at this writing.  Safe to say, &freetds;'s success so far lies somewhere between the Beetle and the Edsel.</para>
++<para>How big is it?  &freetds; has over 100,000 lines of C code, maintained by a handful of developers.  Patches arrive irregularly, varying in size from one-liners to thousand-line monsters.  Almost all are applied or used in some way.  The mailing list has some 700 or so subscribers at this writing.  Safe to say, &freetds;'s success so far lies somewhere between the Beetle and the Edsel.</para>
+ 
+-<para>Who uses it?  Oh, pretty much everyone.  &freetds; users almost certainly number in the tens of thousands.  It's used by large corporations, by the U.S. federal government (e.g. <ulink url="http://www.ncbi.nlm.nih.gov/books/bv.fcgi?rid=toolkit.chapter.ch_dbapi">Database Access Library</ulink> at the National Center for Biotechnology Information) and, judging by the mailing list, by many webservers running Apache and PHP.  Microsoft recommends &freetds; to their customers who want access to Microsoft SQL Server from non-Win32 clients. So do we.</para>
++<para>Who uses it?  Oh, pretty much everyone.  &freetds; users number in the tens of thousands.  It's used by large corporations, by the U.S. federal government (e.g. <ulink url="http://www.ncbi.nlm.nih.gov/books/bv.fcgi?rid=toolkit.chapter.ch_dbapi">Database Access Library</ulink> at the National Center for Biotechnology Information) and, judging by the mailing list, by many webservers running Apache and PHP.  Sybase recommends &freetds; for their EAServer product.  Microsoft recommends &freetds; to their customers who want access to Microsoft SQL Server from non-Win32 clients.  So do we.</para>
+ 			</sect2>
+ 		<sect2 id="Languages">
+ 			<title>Languages besides C and Java</title>
+@@ -227,19 +227,19 @@ The <quote>TDS</quote> part of the name comes from name of the protocol used to
+ 						</listitem>
+ 					</varlistentry>
+ 				<varlistentry>
+-					<term><systemitem class="library">ODBC</systemitem> bridge products</term>
+-					<listitem><para>They use the <systemitem class="library">ODBC</systemitem> driver on the NT box where your <productname>SQL Server</productname> runs so you'll never have trouble with new protocols and the like.  On the downside, they can be costly and may be inefficient.  We know of <productname>EasySoft ODBC-ODBC Bridge</productname> from <ulink url="http://www.easysoft.com">EasySoft</ulink>, <productname>Universal Data Access Driver</productname> from <ulink url="http://www.openlinksw.com">OpenLink Software</ulink>, <productname>SequeLink</productname> from <ulink url="http://www.merant.com/">Merant</ulink>, and
+-							<Application><systemitem class="library">ODBC</systemitem> Router</Application> from <ulink url="http://www.augsoft.com/">August Software</ulink> Corporation.</para>
++					<term>&odbc; bridge products</term>
++					<listitem><para>They use the &odbc; driver on the NT box where your <productname>SQL Server</productname> runs so you'll never have trouble with new protocols and the like.  On the downside, they can be costly and may be inefficient.  We know of <productname>EasySoft ODBC-ODBC Bridge</productname> from <ulink url="http://www.easysoft.com">EasySoft</ulink>, <productname>Universal Data Access Driver</productname> from <ulink url="http://www.openlinksw.com">OpenLink Software</ulink>, <productname>SequeLink</productname> from <ulink url="http://www.merant.com/">Merant</ulink>, and
++							<Application>&odbc; Router</Application> from <ulink url="http://www.augsoft.com/">August Software</ulink> Corporation.</para>
+ 						</listitem>
+ 					</varlistentry>
+ 				<varlistentry>
+-					<term>Inline <systemitem class="library">ODBC</systemitem> driver</term>
+-					<listitem><para>Based on <systemitem class="library">libtds</systemitem>, this is a native <systemitem class="library">ODBC</systemitem> driver for i386 *nix. It is free in price, but comes only as a binary at the present time.</para>
++					<term>Inline &odbc; driver</term>
++					<listitem><para>Based on <systemitem class="library">libtds</systemitem>, this is a native &odbc; driver for i386 *nix. It is free in price, but comes only as a binary at the present time.</para>
+ 						</listitem>
+ 					</varlistentry>
+ 				<varlistentry>
+ 					<term>DBD::Proxy</term>
+-					<listitem><para>We have no direct experience with this Perl-only option.  It has the same caveats as an <systemitem class="library">ODBC</systemitem> bridge except it's free.</para>
++					<listitem><para>We have no direct experience with this Perl-only option.  It has the same caveats as an &odbc; bridge except it's free.</para>
+ 						</listitem>
+ 					</varlistentry>
+ 				</variablelist>
+@@ -257,7 +257,14 @@ The <quote>TDS</quote> part of the name comes from name of the protocol used to
+ 	<sect1 id="gnu">
+ 		<title>The <acronym>GNU</> World</title>
+ 
+-<para>&freetds; uses <acronym>GNU</> <application>Automake</application>, <application>Autoconf</application>, and <application>libtool</application> to increase portability.</para>
++<para>&freetds; uses <acronym>GNU</> <application>Autoconf</application>, <application>Automake</application>, and <application>libtool</application><footnote>
++		<itemizedlist spacing="compact">
++			<title>Versions used for this release</title>
++			<listitem><para>autoconf (GNU Autoconf) 2.65</para></listitem>
++			<listitem><para>automake (GNU automake) 1.11.1</para></listitem>
++			<listitem><para>ltmain.sh (GNU libtool) 2.2.6b</para></listitem>
++			</itemizedlist>
++	</footnote> to increase portability.</para>
+ 
+ <para>For many people, the preceding sentence says it all (good or bad).  If you're familiar with the <acronym>GNU</> system, you can probably just download the tarball and get away with scanning the <filename>README</filename> impatiently and then following your instincts.  Because everyone is a beginner once and no one is an expert at everything, we'll try to explain things in plain English where possible, and to define our terms as we go along.</para>
+ 
+@@ -278,7 +285,7 @@ The <quote>TDS</quote> part of the name comes from name of the protocol used to
+ 	<prompt>$ </prompt><userinput>cvs -d:pserver:anonymous@freetds.cvs.sourceforge.net:/cvsroot/freetds login</userinput>
+ 	<prompt>$ </prompt><userinput>cvs -z3 -d:pserver:anonymous@freetds.cvs.sourceforge.net:/cvsroot/freetds checkout -P freetds</userinput>
+ 	<prompt>Password: </prompt>
+-	<prompt>$ </prompt><userinput>make install</userinput></screen></para>
++	<prompt>$ </prompt></screen></para>
+ 
+ <para>For those behind firewalls or otherwise unable to access <productname>CVS</productname>, nightly snapshots of <productname>CVS</productname> are rolled up into tarballs for your convenience.  They can be downloaded from
+ 			<ulink url="ftp://ftp.ibiblio.org/pub/Linux/ALPHA/freetds/freetds-current.tgz">ibiblio.org</ulink>.  Tarballs are generated around 3am EST (GMT-5).</para>
+@@ -295,14 +302,14 @@ The <quote>TDS</quote> part of the name comes from name of the protocol used to
+ </para></note>
+ 		<sect2 id="Experts"><title>For Experts</title>
+ <screen>
+-	<prompt>$ </prompt><userinput>./configure --prefix=/usr/local/freetds</userinput>
++	<prompt>$ </prompt><userinput>./configure --prefix=/usr/local</userinput>
+ 	<prompt>$ </prompt><userinput>make</userinput>
+ 	<prompt>$ </prompt><userinput>su root</userinput>
+ 	<prompt>Password: </prompt>
+ 	<prompt>$ </prompt><userinput>make install</userinput></screen>
+ 	
+ 
+-<para>Building from CVS is described in the file INSTALL.CVS.</para>
++<para>Building from CVS is described in the file <filename>INSTALL.CVS</filename>.</para>
+ 			
+ 			</sect2>
+ 		<sect2 id="Everyone"><title>For Everyone Else </title>
+@@ -321,9 +328,9 @@ The <quote>TDS</quote> part of the name comes from name of the protocol used to
+ <para>The simplest form of running <Command>configure</> is:
+ <screen>
+ 	<prompt>$ </prompt><userinput>./configure</userinput></screen>
+-	and sometimes that's enough.  <Command>configure</> accepts some command-line arguments, too, and you may need to provide some, depending on what your environment looks like.</para>
++	and sometimes that's enough.  <command>configure</> accepts command-line arguments, too, and you may need to provide some, depending on what your environment looks like.</para>
+ 
+-<para>There are a few optional arguments to <Command>configure</> that may be important to you.  For a complete list, see <command>configure --help</command>.</para>
++<para>There are a few optional arguments to <command>configure</> that may be important to you.  For a complete list, see <command>configure --help</command>.</para>
+ 			<sect3 id="Configure.Options" XrefLabel="Options to configure">
+ 				<title><command>configure</> options</title>
+ 				<variablelist id="tab.configure.Directories">
+@@ -428,7 +435,7 @@ The <quote>TDS</quote> part of the name comes from name of the protocol used to
+ 				<variablelist id="tab.turnon"><title>Things you can turn on</title>
+ 					<varlistentry>
+ 						<term><Option>--enable-msdblib</Option></term>
+-						<listitem><para>Enable Microsoft behavior in the &dblib; <acronym>API</> where it diverges from Sybase's.  (For instance, Microsoft uses different names for the members of its date structure.)  Typically needed only for porting Win32 applications to Unix.</para>
++						<listitem><para>Enable Microsoft behavior in the &dblib; <acronym>API</> where it diverges from Sybase's.  Use this option if you are replacing Microsoft's libraries with &freetds;</para>
+ 
+ <para>This option specifies default behavior. Programs can change the default at compile time by defining MSDBLIB or SYBDBLIB (for Microsoft or Sybase behavior, respectively).</para>
+ 							</listitem>
+@@ -548,9 +555,11 @@ and, sure enough, <filename>asprintf.c</filename> earlier includes <filename>win
+ 
+ Which shouldn't be defined unless <filename>inttypes.h</filename> exists on your system.  </para>
+ 
+-<para>Let's review: <filename>config.h</filename> defines a bunch of preprocessor definitions that (try to) describe your build environment to the compiler.  In this example, it got one wrong, causing the compiler to look for a file that isn't present, creating the error.  The solution is <emphasis> not</emphasis> to change the &freetds; source code, but merely to comment out line 92 in <filename>config.h</filename>.   </para>
++<para>Let's review: <filename>config.h</filename> has preprocessor definitions that (try to) describe the build environment to the compiler.  In this example, it got one wrong, causing the compiler to look for a file that isn't present, creating the error.  The solution is <emphasis> not</emphasis> to change the &freetds; source code, but merely to comment out line 92 in <filename>config.h</filename>.   </para>
+ 
+-<note><para>Perhaps you're shaking your head at such an <quote>old school</quote> approach.  Over the years, Microsoft's proprietary project-configuration files have proved difficult to support.  Every version is different, and there are a great many versions in use <quote>in the wild</quote> at any one time.  As the project changes, it becomes impossible to maintain these kinds of files.  </para></note>
++<note><para>Perhaps you're shaking your head at such an <quote>old school</quote> approach.  Over the years, Microsoft's proprietary project-configuration files have proved difficult to support.  Every version is different, and there are a great many versions in use <quote>in the wild</quote> at any one time.  As the project changes, it becomes impossible to maintain these kinds of files.  </para>
++
++	<para>For Windows applications that use &freetds; the hard-won wisdom is <emphasis>just use the <filename>NMakefile</filename>, please, thanks!</emphasis>  If you like a visual environment and visual debugging, no problem: Microsoft's tools support <quote>Makefile projects</quote>.  The author has direct knowledge of developers for whom that arrangement works quite well. </para></note>
+ 
+ 			<sect3><title>Other ways to build under Windows&reg;</title>
+ 				
+@@ -607,7 +616,7 @@ Which shouldn't be defined unless <filename>inttypes.h</filename> exists on your
+ 			</sect2>
+ 		<sect2 id="osx"><title>OS X&reg;</title>
+ 
+-<para>As of this writing ($Date: 2011/03/12 12:54:01 $), the regular distribution compiles on OS X.  Releases prior to 0.63 either did not compile or required patching.</para>
++<para>As of this writing ($Date: 2011/03/22 00:23:24 $), the regular distribution compiles on OS X.  </para>
+ 			
+ <![ %comment [
+ 	<!-- cf http://www.is-thought.co.uk/book/sgml-8.htm -->
+@@ -740,21 +749,17 @@ Which shouldn't be defined unless <filename>inttypes.h</filename> exists on your
+ 					</tgroup>
+ 				</table></para>
+ 
+-<para>For best results, use the highest version of hte protocol supported by your server.  If you encounter problems, try a lower version.  If that works, though, please report it to the mailing list!</para>
++<para>For best results, use the highest version of the protocol supported by your server.  If you encounter problems, try a lower version.  If that works, though, please report it to the mailing list!
++	<footnote><para>Want to help?  Try out the auto-protocol feature.   &freetds; has experimental support for iteratively trying protocol connections until it finds one the server accepts.  This is suitable when query responses are non-trivial (because the tiny delay in connecting is thus insignificant).  Try setting your TDS version to <literal>0</> and report your results.  </para></footnote></para>
+ 
+-<para><ItemizedList><title>TDS 4.2 has limitations</title>
+-				<listitem><para><acronym>ASCII</> only, of course.
+-</para></listitem>
+-				<listitem><para><acronym>RPC</> is not supported.
+-</para></listitem>
+-				<listitem><para><acronym>BCP</> is not supported.
+-</para></listitem>
+-				<listitem><para><structname>varchar</structname> fields are limited to 255 characters.  If your table defines longer fields, they'll be truncated.
+-</para></listitem>
+-				<listitem><para>dynamic queries (also called <firstterm>prepared statements</>) are not supported.
+-</para></listitem>
+-				</ItemizedList></para>
+-		
++<para><ItemizedList>
++			<title>TDS 4.2 has limitations</title>
++			<listitem><para><acronym>ASCII</> only, of course.</para></listitem>
++			<listitem><para><acronym>RPC</> is not supported.</para></listitem>
++			<listitem><para><acronym>BCP</> is not supported.</para></listitem>
++			<listitem><para><structname>varchar</structname> fields are limited to 255 characters.  If your table defines longer fields, they'll be truncated.</para></listitem>
++			<listitem><para>dynamic queries (also called <firstterm>prepared statements</>) are not supported.</para></listitem>
++			</ItemizedList></para>
+ 
+ <para> The protocol version may also affect how database servers interpret
+ 			commands.  For example, Microsoft SQL Server 2000 is known to behave differently with versions 4.2
+@@ -1690,8 +1695,7 @@ Which shouldn't be defined unless <filename>inttypes.h</filename> exists on your
+ 							</row>
+ 						<row>
+ 							<entry><literal>ClientCharset</></entry>
+-							<entry>A name recognized by the iconv library linked to FreeTDS.
+-								This correspond to <literal>client charset</> in &freetdsconf;.</entry>
++							<entry>A name recognized by the iconv library linked to FreeTDS.  Corresponds to <literal>client charset</> in &freetdsconf;.</entry>
+ 							<entry>ISO 8859-1</entry>
+ 							<entry>Character set (encoding) used by the client.</entry>
+ 							</row>
+@@ -1722,21 +1726,20 @@ Which shouldn't be defined unless <filename>inttypes.h</filename> exists on your
+ 						<row>
+ 							<entry><literal>TextSize</></entry>
+ 							<entry>Any</entry>
+-							<entry>DB dependent</entry>
++							<entry>Server-dependent</entry>
+ 							<entry>Maximum size returned from server for blobs.</entry>
+ 							</row>
+ 						<row>
+ 							<entry><literal>PacketSize</></entry>
+ 							<entry>Any</entry>
+-							<entry>DB dependent</entry>
++							<entry>Server-dependent</entry>
+ 							<entry>Size of packets to server.  Some users saw some performance gain by increasing this value.  Normally you shouldn't set it.  </entry>
+ 							</row>
+ 						<row>
+ 							<entry><literal>Trusted_Connection</></entry>
+ 							<entry>Yes/No</entry>
+ 							<entry>No</entry>
+-							<entry>Use your current account instead of <literal>UID</>/<literal>PWD</> attributes.
+-								This option require SSPI or Kerberos. This superceed <literal>UID</>/<literal>PWD</> attributes.</entry>
++							<entry>Use your current account instead of <literal>UID</>/<literal>PWD</> attributes.  This option require SSPI or Kerberos and supersedes any <literal>UID</>/<literal>PWD</> attributes passed from the application.</entry>
+ 							</row>
+ 						</tbody>
+ 					</tgroup>
+@@ -1885,9 +1888,11 @@ Which shouldn't be defined unless <filename>inttypes.h</filename> exists on your
+ <para>If <command>tsql</> works and <command>isql</> doesn't, you've isolated the problem to the ODBC setup.  &freetds; might have some interoperability problems, but mere connection to the database isn't one of them!  If <command>tsql</>
+ 			doesn't work, turn on logging with <envar>TDSDUMP</>.  The log will tell you what TCP/IP name (and address) <productname>FreeTDS</> is attempting to connect to, and what version of the TDS protocol it's using.</para>
+ 		
+-		<sect2 id="with.iodbc"><title>With iODBC</title>	
++		<sect2 id="with.iodbc">
++			<title>With iODBC</title>	
+ 
+-<para>	<productname>iODBC</productname> comes with a sample command line query program called <command>odbctest</> that is located in the <filename>iodbc/samples</filename> directory.  Using this program you can get a listing of DSNs, connect, and issue queries.  It is often useful to compile a program such as this directly against the &freetds; driver instead of using a driver manager.  This makes it simpler to debug if something goes wrong.  To do so, simply compile and install the <systemitem class="library">ODBC</systemitem> driver with <productname>iODBC</productname> as normal <footnote><para>When compiling directly to &freetds; you still need the Driver Manager's header files.</para></footnote>, then compile and link the program directly:
++<para>	<productname>iODBC</productname> comes with a sample command line query program called <command>odbctest</>, located in the <filename>iodbc/samples</filename> directory.  Using this program you can get a listing of DSNs, connect, and issue queries.  
++	<tip><para>For debugging purposes, you may wish to link a program such as <command>odbctest</> directly to &freetds; instead of to the driver manager.  <footnote><para>Why?  Once the program is started in the debugger, the driver entry points become viable breakpoints.  Because the DM loads the driver dynamically with <function>dlopen(3)</function>, no driver addresses even <emphasis>exist</emphasis> until the runtime linker loads it. </para></footnote>  To do so, compile and install the &odbc; driver with <productname>iODBC</productname> as normal <footnote><para>When linking directly to &freetds; you still need the Driver Manager's header files.</para></footnote>, then compile and link the program:
+ 				
+ 				<example id="e.g.odbctest.nodm">
+ 					<title>Compile <filename>odbctest</> without a driver manager.</title>
+@@ -1896,7 +1901,7 @@ Which shouldn't be defined unless <filename>inttypes.h</filename> exists on your
+ 	<prompt>$ </prompt><userinput>gcc -g -o odbctest odbctest.o /usr/local/freetds/lib/libtdsodbc.a</userinput></screen>
+ 	</example>
+ 	
+-				The <option>-g</> is important to keep the symbol tables for debugging purposes.  Now you can run <command>gdb</> or another debugger and set breakpoints on functions in the library without the driver manager getting in the way.</para>
++				Now you can run <command>gdb</> or another debugger and set breakpoints on functions in the library without the driver manager getting in the way.</para></tip></para>
+ 			</sect2>
+ 		
+ 		<sect2 id="with.unixODBC"><title>With unixODBC</title>
+@@ -1961,8 +1966,10 @@ Which shouldn't be defined unless <filename>inttypes.h</filename> exists on your
+ 	|                                       |
+ 	+---------------------------------------+
+ 	SQL></screen>
+-						</example>					</para>
+-				
++						</example></para>
++
++<para>The reader is here advised that the <command>isql</command> that comes with many versions of unixODBC will truncate text and surprise in other ways without warning.  If it behaves strangely, try &freetds;'s <command>bsqlodbc</command> before you decide you've found a &freetds; bug.  </para>
++
+ 				</sect3>
+ 			
+ 			</sect2>
+@@ -2067,11 +2074,16 @@ Which shouldn't be defined unless <filename>inttypes.h</filename> exists on your
+ 		<title>Domain Logins</title>
+ 		<Note><para>Domain logins can be used only with TDS protocol versions 7.0 or above.</para></Note>
+ 
+-<para>As mentioned in the installation chapter, <productname>Microsoft SQL Server</productname> includes the ability to use domain logins instead of standard server logins.  The advantage of doing this is that the passwords are encrypted on the wire using a challenge-response protocol.</para>
++<para>As mentioned in the installation chapter, <productname>Microsoft SQL Server</productname> includes the ability to use domain
++	<footnote><para>The term <firstterm>domain</> in this context is a Microsoft term.  It refers to what's sometimes called an <firstterm>NT domain</firstterm>.  It's unrelated to the DNS domain.  DNS domains are used for name resolution.  NT domains are used for authentication.  Authentication is done by the domain controller, often the <firstterm>Primary Domain Controller</firstterm> (PDC).</para>
++	<para>The SQL Server machine may belong to an NT domain.  &freetds; provides an encrypted password &mdash; a domain password, known to the domain controller &mdash; that the server will ask the domain controller to verify.</para></footnote> 
++logins instead of standard server logins.  Passwords are encrypted on the wire using a challenge-response protocol.  &freetds; plays nice with such logins.  </para>
++
++<para>&freetds; supports single sign-on (connecting without prompting for a username &amp; password) or not, depending on how it was configured.  For Windows hosts (both 32- and 64-bit), if SSPI is enabled, &freetds; will log in using so-called <quote>trusted authentication</quote>.  For non-Windows hosts, enabling Kerberos provides similar functionality.  </para>
+ 
+-<para>Domain logins may or may not support single sign-on (connecting without prompting for a password) depending on how &freetds; was configured.  For Windows hosts (both 32- and 64-bit), if SSPI is enabled, &freetds; will log in using so-called "trusted authentication".  For Linux (and similar) hosts, enabling Kerberos provides similar functionality.  If neither option is enabled, &freetds; can <emphasis>still</> log in using the domain account, but the user must re-enter the password, as described next.</para>
++<para>When neither option is enabled, &freetds; can <emphasis>still</> log in using the domain account, but the user must supply the username &amp; password.</para>
+ 
+-<para>To use domain logins, use the <literal>'DOMAIN\username'</> syntax for the username and use the domain password.</para>
++<para>To use domain logins without SSPI or Kerberos, use the <literal>'DOMAIN\username'</> syntax for the username and use the domain password.</para>
+ 		<example id="e.g.domainlogin"><title>Logging in with a domain login</title>
+ <screen>
+ 	<computeroutput>$ </computeroutput><userinput>tsql -S camelot -U 'NOTTINGHAM\lancelot' -P roundtable</userinput>
+@@ -2082,10 +2094,7 @@ Which shouldn't be defined unless <filename>inttypes.h</filename> exists on your
+ 	1></screen>
+ 	</example>
+ 	
+-
+ <para>When &freetds; sees the <quote><literal>\</></quote> character, it automatically chooses a domain login.</para>
+-		<Note><para>The term <firstterm>domain</> in this context is a Microsoft term.  It refers to what's sometimes called an <firstterm>NT domain</firstterm>.  It's unrelated to the DNS domain.  DNS domains are used for name resolution.  NT domains are used for authentication.  Authentication is done by the domain controller, often the <firstterm>Primary Domain Controller</firstterm> (PDC).
+-</para><para>The SQL Server machine may belong to an NT domain.  &freetds; provides an encrypted password &mdash; a domain password, known to the domain controller &mdash; that the server will ask the domain controller to verify.</para></Note>
+ 		
+ 		<sect2 id="domaindetails">
+ 			<title>Implementation details</title>
+@@ -2099,13 +2108,15 @@ Which shouldn't be defined unless <filename>inttypes.h</filename> exists on your
+ 		</sect1>
+ 	<sect1 id="kerberos">
+ 		<title>Kerberos Support</title>
+-<para>Perhaps surprisingly, Kerberos can be used to authenticate to Microsoft SQL Servers.  This affords single-signon (or, at most, <quote>double-signon</quote>) capability in non-Windows environment. <footnote><para>The reason this works is that much of Active Directory is based on Kerberos. </para></footnote></para>
++<para>Perhaps surprisingly,
++	<footnote><para>It works because much of Active Directory is based on Kerberos.  <emphasis>From each according to his ability; to each according to his needs. </emphasis></para></footnote>
++Kerberos can be used to authenticate to Microsoft SQL Servers.  This affords single-signon (or, at most, <quote>double-signon</quote>) capability in non-Windows environment. </para>
+ 
+-<para>To take advantage of Kerberos you have to set up your machine with keytab from your Active Directory.
+-			To configure your stuff you could use <ulink url="http://www.samba.org/">Samba</ulink> or configure Kerberos directly (<filename>/etc/krb5.conf</>).  <command>configure</command> includes options to define the location of your Kerberos installation  (cf. <xref linkend="Configure.Options">).  </para>
++<para>To take advantage of Kerberos you have to set up your machine with keytab
++	<footnote><para>No, the author does not really know what he's talking about.</para></footnote> 
++from your Active Directory.  You could use <ulink url="http://www.samba.org/">Samba</ulink> or configure Kerberos directly (<filename>/etc/krb5.conf</>).  <command>configure</command> includes options to define the location of your Kerberos installation  (cf. <xref linkend="Configure.Options">).  </para>
+ 
+-<para>By default UNIX does not initialize a Kerberos ticket with your login account. You have to use <command>kinit</command> to initialize a ticket.
+-			You could also configure Kerberos in PAM in order to initialize Kerberos ticket at login time.</para>
++<para>By default UNIX does not initialize a Kerberos ticket with your login account. You must use <command>kinit</command> to initialize a ticket.  You could also configure Kerberos in PAM to initialize a Kerberos ticket at login time.</para>
+ 		</sect1>
+ 	
+ 	<sect1 id="uothread">
+@@ -2159,19 +2170,20 @@ Which shouldn't be defined unless <filename>inttypes.h</filename> exists on your
+ 	<sect1 id="tdspool">
+ 		<title>TDS Connection Pooling</title>
+ 
+-<para>&freetds; 0.52 was the first to include a <acronym>TDS</> Connection Pooling server.  It lives in the <filename>src/pool</filename> directory.</para>
++<para>The Connection Pooling server swims in the <filename>src/pool</filename> directory.</para>
+ 
+-<para>The &freetds; connection pool is a server process, it acts just like a <productname>SQL Server</productname>.  You can use any program to attach to it that you could use to attach to a real <productname>SQL Server</productname>.  The pool in turn connects to the <productname>SQL Server</productname> and database you specify, and attempts to share these connections.  See the <filename>README</filename> in the pool directory for a more detailed description of its inner workings.</para>
++<para>The &freetds; connection pool is a server process; it emulates a <productname>SQL Server</productname>.  Any program that can attach to a real <productname>SQL Server</productname> may instead elect to attach to the pool server.  The pool in turn connects to the <productname>SQL Server</productname> and database you specify, and attempts to share these connections.  See the <filename>src/pool/README</filename> for a more detailed description of its inner workings.</para>
+ 
+-<para>To configure the pooling server, first make sure &freetds; has a working entry for the real <productname>SQL Server</productname> by connecting to it with <application>SQSH</application> or another program.</para>
+-		<Note><para>The &freetds; connection pool currently only supports <acronym>TDS</> version 4.2.  <emphasis>This restriction applies to both the client-to-pool and pool-to-server connections!</emphasis>
++<para>To configure the pool server, first make sure &freetds; has a working entry for the real <productname>SQL Server</productname> by connecting to it with <application>SQSH</application> or another program.</para>
++		
++<Note><para>The &freetds; connection pool currently only supports <acronym>TDS</> version 4.2.  <emphasis>This restriction applies to both the client-to-pool and pool-to-server connections!</emphasis>
+ </para></Note>
+ 
+ <para>After FreeTDS has been installed, you will find an executable named <command>tdspool</command> in the <filename>/usr/local/bin</filename> directory (or whatever directory was specified with the <command>configure</> <option>--with-prefix flag</> option).</para>
+ 
+-<para>Next, edit the <filename>pool.conf</filename> file in the &freetds;'s <filename>etc</filename> directory.  The <filename>pool.conf</filename> file is formatted like the &freetdsconf; with a section name in brackets and options for each section in key/value pairs.</para>
++<para>Edit <filename>pool.conf</filename> in the &freetds;'s <filename>etc</filename> directory.  The <filename>pool.conf</filename> file is formatted like &freetdsconf;, with a section name in brackets and options for each section in key/value pairs.</para>
+ 
+-<para>Just like the &freetdsconf; file there are two types of sections, a <literal>[global]</literal> section whose options affect all pools, and a section with the name of the pool for pool-specific options.  The following options are supported and may appear in either section.</para>
++<para>Just as in &freetdsconf; there are two types of sections, a <literal>[global]</literal> section whose options affect all pools, and a section with the name of the pool for pool-specific options.  The following options are supported and may appear in either section.</para>
+ 
+ <para><table id="tab.pool.conf">
+ 				<title>pool.conf settings</title>
+@@ -2260,7 +2272,7 @@ Which shouldn't be defined unless <filename>inttypes.h</filename> exists on your
+ 
+ <para>The <literal>[mypool]</literal> section defines a pool named <literal>mypool</literal> that will listen on port 5000.  It will login to a <productname>SQL Server</productname> named <literal>fooserv</literal> using the user <literal>webuser</literal> and the ever so clever password of <literal>secret</literal>.  Once logged in, the connections will use the database <literal>ebiz</literal> instead of webuser's default database.  Also, since this <productname>SQL Server</productname> has a limited number of <acronym>CAL</>s (Client Access Licenses), we are restricting the maximum number of connections to 7, which overrides the <literal>global</literal> setting of 10.</para>
+ 
+-<para>Now you can run <Command>tdspool</Command> with the name of the pool you are serving.
++<para>Run <Command>tdspool</Command> with the name of the pool you are serving.
+ <screen>
+ 	<prompt>$ </prompt><userinput> tdspool mypool</userinput></screen></para>
+ 
+@@ -2349,17 +2361,17 @@ Which shouldn't be defined unless <filename>inttypes.h</filename> exists on your
+ <para>  A non-interactive equivalent of the <symbol>isql</> utility programs distributed by Sybase and Microsoft. Like them, <command>bsqldb</> uses the command <quote>go</> on a line by itself as a separator between batches. The last batch need not be followed by <quote>go</>.</para>
+ 					
+ 
+-<para><command>bsqldb</> makes use of the <symbol>db-lib</> <acronym>API</>. Intended for production use.</para>
++<para><command>bsqldb</> makes use of the &dblib; <acronym>API</>. Intended for production use.</para>
+ 					</listitem>
+ 				</varlistentry>
+ 			<varlistentry>
+ 				<term>bsqlodbc</term>
+ 				<listitem>
+ 
+-<para>A non-interactive equivalent of the <symbol>isql</> utility programs distributed by Sybase and Microsoft. Like them, <command>bsqlodbc</> uses the command <quote>go</> on a line by itself as a separator between batches. The last batch need not be followed by <quote>go</>.  It uses the <acronym>ODBC</> <acronym>API</>.</para>
++<para>A non-interactive equivalent of the <symbol>isql</> utility programs distributed by Sybase and Microsoft. Like them, <command>bsqlodbc</> uses the command <quote>go</> on a line by itself as a separator between batches. The last batch need not be followed by <quote>go</>.  It uses the &odbc; <acronym>API</>.</para>
+ 					
+ 
+-<para><command>bsqlodbc</> is a demonstration project, but can also aid in isolating problems.  <acronym>ODBC</> applications typically have many layers, and it can be difficult to know if a problem arises in a layer, or in the interface between layers.  By executing a query in <command>bsqlodbc</>, you can see if the functionality of the <acronym>ODBC</> driver works when used as the folks who wrote the driver thought it would be used.</para>
++<para><command>bsqlodbc</> is a demonstration project, but can also aid in isolating problems.  &odbc; applications typically have many layers, and it can be difficult to know if a problem arises in a layer, or in the interface between layers.  By executing a query in <command>bsqlodbc</>, you can see if the functionality of the &odbc; driver works when used as the folks who wrote the driver thought it would be used.</para>
+ 					</listitem>
+ 				</varlistentry>
+ 									
+@@ -2372,7 +2384,7 @@ Which shouldn't be defined unless <filename>inttypes.h</filename> exists on your
+ 
+ <para><command>datacopy</> will move table data from one server to another without the need for intermediate files. <command>datacopy</> is much faster and more efficient than is <command>freebcp</> out/in.</para>
+ 
+-<para><command>datacopy</> makes use of the <symbol>db-lib</> bcp <acronym>API</>.</para>
++<para><command>datacopy</> makes use of the &dblib; bcp <acronym>API</>.</para>
+ 					</listitem>
+ 				</varlistentry>
+ 			
+@@ -2401,7 +2413,7 @@ Which shouldn't be defined unless <filename>inttypes.h</filename> exists on your
+ 
+ <para>Replicates the functionality of the <symbol>bcp</> utility programs distributed by Sybase and Microsoft.</para>
+ 
+-<para><command>freebcp</> makes use of the <symbol>db-lib</> bcp <acronym>API</>.</para>
++<para><command>freebcp</> makes use of the &dblib; bcp <acronym>API</>.</para>
+ 
+ <para>The manual pages or online help for Sybase or SQL Server can be referenced for more detailed information on bcp functionality.</para>
+ 					</listitem>
+@@ -2419,7 +2431,7 @@ Which shouldn't be defined unless <filename>inttypes.h</filename> exists on your
+ 				<term>tsql</term>
+ 				<listitem>
+ 
+-<para>A diagnostic tool that uses uses the lowest level <productname>FreeTDS</> library, <symbol>libtds</>, as a way to isolate potential  bugs  in  the  protocol implementation.</para>
++<para>A diagnostic tool that uses uses the lowest level &freetds; library, <symbol>libtds</>, as a way to isolate potential  bugs  in  the  protocol implementation.</para>
+ 
+ <para><command>tsql</> is <emphasis>not</> a replacement for a complete <symbol>isql</>.</para>
+ 					</listitem>
+@@ -2484,7 +2496,7 @@ Which shouldn't be defined unless <filename>inttypes.h</filename> exists on your
+ 		
+ 		<sect2 id="DBD.ODBC"><title>DBD::ODBC</title>
+ 
+-<para>You may also use <systemitem class="library">DBD::ODBC</systemitem> with the &freetds; <systemitem class="library">ODBC</systemitem> driver.  You may find this attractive if you're familiar with <systemitem class="library">DBD::ODBC</systemitem>.</para>
++<para>You may also use <systemitem class="library">DBD::ODBC</systemitem> with the &freetds; &odbc; driver.  You may find this attractive if you're familiar with <systemitem class="library">DBD::ODBC</systemitem>.</para>
+ 			</sect2>
+ 		<sect2 id="Sybperl"><title>Sybperl</title>
+ 
+@@ -2578,7 +2590,7 @@ Which shouldn't be defined unless <filename>inttypes.h</filename> exists on your
+ 	<sect1 id="php">
+ 		<title>PHP</title>
+ 
+-<para>There are three options for building PHP with support for &freetds; corresponding to the three <acronym>API</>s that &freetds; supports: &dblib;, &ctlib;, and <systemitem class="library">ODBC</systemitem>.
++<para>There are three options for building PHP with support for &freetds; corresponding to the three <acronym>API</>s that &freetds; supports: &dblib;, &ctlib;, and &odbc;.
+ 			<note><para>All these examples build the CGI version.  Consult <ulink url="http://www.php.net/docs.php">PHP's documentation</ulink> for building the Apache module and including other extensions.</para></note></para>
+ 		<sect2 id="phpDblib">
+ 			<title>&dblib;</title>
+@@ -2624,9 +2636,9 @@ Which shouldn't be defined unless <filename>inttypes.h</filename> exists on your
+ 	We hope an upcoming version of PHP will automatically detect the presence of &freetds; and include only the <literal>-lct</literal> library.</para>
+ 	</sect2>
+ 	<sect2 id="ODBC">
+-	<title><systemitem class="library">ODBC</systemitem></title>
++	<title>&odbc;</title>
+ 
+-<para>The third and newest option is to use the &freetds; <systemitem class="library">ODBC</systemitem> driver with PHP.  First build the <productname>iODBC</productname> or <productname>unixODBC</productname> driver manager and &freetds; as detailed in <xref linkend="prepodbc">.  Then build PHP with support for ODBC.
++<para>The third and newest option is to use the &freetds; &odbc; driver with PHP.  First build the <productname>iODBC</productname> or <productname>unixODBC</productname> driver manager and &freetds; as detailed in <xref linkend="prepodbc">.  Then build PHP with support for ODBC.
+ <screen>
+ 	<prompt>$ </prompt><userinput>cd php</userinput>
+ 	<prompt>$ </prompt><userinput>./configure --with-iodbc=/usr/local</userinput>
+@@ -2690,24 +2702,24 @@ Which shouldn't be defined unless <filename>inttypes.h</filename> exists on your
+ 	<sect1 id="uodbc">
+ 		<title>ODBC on Unix</title>
+ 
+-<para><productname>ODBC</> have many issues under Unix mainly due to lack of specifications.</para>
+-		<sect2 id="uodbc64">
++<para>&odbc; has some issues on Unix, mainly due to lack of clean specifications.</para>
++		<sect2 id="uodbc.64">
+ 			<title>ODBC and 64-bit</title>
+ 
+-<para>ODBC was originally specified as 32-bit<footnote><para>In fact, the earliest versions were 16-bit.</para></footnote>.  Its evolution to 64-bit took place in the absence of a good specification which led to conflicting declarations and associated problems.  For instance, some parameters are defined as SQLINTEGER but are used for pointer offsets.   But SQLINTEGER was (and remains) 32-bit, while pointer offsets must be 64-bit.  Also row numbers and some other formerly 32-bity quantities are now 64-bit.</para>
++<para>ODBC was originally specified as 32-bit<footnote><para>In fact, the earliest versions were 16-bit.</para></footnote>.  Its evolution to 64-bit took place in the absence of a good specification which led to conflicting declarations and associated problems.  For instance, some parameters are defined as SQLINTEGER but are used for pointer offsets.   But SQLINTEGER was (and remains) 32-bit, while pointer offsets must be 64-bit.  Also row numbers and some other formerly 32-bit quantities are now 64-bit.</para>
+ 
+ <para>If you use <productname>unixODBC</> Frediano would recommend at least version 2.2.14. Earlier versions have issues if used on 64-bit environments.</para>
+ 			</sect2>
+-		<sect2 id="uodbcwchar">
++		<sect2 id="uodbc.wchar">
+ 			<title>sizeof(SQLWCHAR)</title>
+ 
+-<para>Under Windows <literal>sizeof(wchar_t) == sizeof(SQLWCHAR) == 2</literal> but on many Unix systems you have <literal>sizeof(wchar_t) == 4</literal>.  And some DMs decided to keep <literal>sizeof(SQLWCHAR) == 2</literal> (including <productname>unixODBC</>) while in other DM <literal>sizeof(SQLWCHAR) == sizeof(wchar_t) == 4</literal> (namely <productname>iODBC</>). This leads to incompatibile ABIs between applications and drivers. If you compile the &freetds; ODBC driver using <productname>iODBC</> take care to ensure all drivers are compiled with the same header files.</para>
++<para>Under Windows <literal>sizeof(wchar_t) == sizeof(SQLWCHAR) == 2</literal> but on many Unix systems you have <literal>sizeof(wchar_t) == 4</literal>.  And some DMs decided to keep <literal>sizeof(SQLWCHAR) == 2</literal> (including <productname>unixODBC</>) while in other DM <literal>sizeof(SQLWCHAR) == sizeof(wchar_t) == 4</literal> (namely <productname>iODBC</>). This leads to incompatible ABIs between applications and drivers. If you compile the &freetds; ODBC driver using <productname>iODBC</> take care to ensure all drivers are compiled with the same header files.</para>
+ 
+ <para>Alternatively, compile &freetds; with both includes and rename the library to use two ABIs (for instance having a <filename>libtdsiodbc.so</> and a <filename>libtdsuodbc.so</>).</para>
+ 
+-<para>As of the time of writing <productname>Ubuntu</> compiled Qt using <productname>iODBC</> but most packages use <productname>unixODBC</>. If you plan to use Qt with the &freetds; ODBC driver, you should have an <productname>iODBC</>-compatible driver. Also be aware that the QODBC Qt driver has problems with <productname>iODBC</> and <literal>SQLWCHAR</literal> (see <link linkend="qt">Qt</link>). Due to these problems Frediano suggests not to use this configuration (Qt database) on <productname>Ubuntu</> at this time.</para>
++<para>At the time of writing <productname>Ubuntu</> compiled Qt using <productname>iODBC</> but most packages use <productname>unixODBC</>. If you plan to use Qt with the &freetds; &odbc; driver, you should have an <productname>iODBC</>-compatible driver. Also be aware that the QODBC Qt driver has problems with <productname>iODBC</> and <literal>SQLWCHAR</literal> (see <link linkend="qt">Qt</link>). Due to these problems Frediano suggests not using this configuration (Qt database) on <productname>Ubuntu</> at this time.</para>
+ 			</sect2>
+-		<sect2 id="uodbcchar">
++		<sect2 id="uodbc.char">
+ 			<title>Default charset</title>
+ 
+ <para>Character encoding is yet another trap.  ODBC makes no provision for specifying client character encoding. By default many DM converting from multi-byte to wide characters assume the client uses ISO 8859-1.  Even the &freetds; driver assumes ISO 8859-1 by default.  Also some DM have problems converting multi-byte encodings (like UTF-8), by assuming a byte can be converted to a single wide character (and vice versa). That creates problems if you use multi-byte encoding for &freetds; driver.</para>
+@@ -2725,6 +2737,26 @@ Which shouldn't be defined unless <filename>inttypes.h</filename> exists on your
+ 		</epigraph>
+ 	<sect1 id="knownissues">
+ 		<title>Known Issues</title>
++
++		<sect2 id="known.porting">
++			<title>Porting Issues</title>
++
++			<sect3 id="known.dates">
++				<title>Date Structures and Offsets</title>
++
++<para>Microsoft and Sybase use different &dblib; date structures <emphasis>and conventions</emphasis>.  Notably months can by [0,11] or [1,12].  Pay careful attention to the results of <function>dbdatecrack()</function>.  </para>
++				</sect3>
++	
++			<sect3 id="known.float">
++				<title>Floating Point</title>
++
++<para>Precision may surprise you if you pay attention.  Microsoft's &dblib; promotes single-precision to double in <function>dbbind()</function> by appending zeros; C promotes it to the nearest double.  &freetds; relies on the C compiler.  </para>
++
++<para>Math libraries vary, too.  If porting an application whose output uses functions such at <function>log(3)</function>, expect differences in different implementations.  Perfectly consistent results between OSes will require the use of a single math library.  </para>
++				</sect3>
++		
++		</sect2>
++			
+ 		<sect2 id="Textfields">
+ 			<title><type>Text</type> Fields</title>
+ 
+@@ -2746,8 +2778,9 @@ Which shouldn't be defined unless <filename>inttypes.h</filename> exists on your
+ 	
+ 				Another way to handle control the default <envar>TEXTSIZE</envar> is to use the setting in <link linkend="freetdsconfformat">&freetdsconf;</link>.</para>
+ 			</sect2>
+-		<sect2 id="Endianism">
+-			<title>Endianism</title>
++
++			<sect2 id="Endianism">
++				<title>Endianism</title>
+ 
+ <para>If either your server or your client is a big endian system, pay careful attention to all references to endianism anywhere near &freetds;.  See the section on <link linkend="emulle">Little Endian Emulation</link> for details.</para>
+ 			</sect2>
+@@ -2761,7 +2794,7 @@ Which shouldn't be defined unless <filename>inttypes.h</filename> exists on your
+ 		<sect2 id="IntegratedSecurity">
+ 			<title>Microsoft's <quote>Integrated Security</quote></title>
+ 
+-<para>&freetds; may be unable to connect to the server.  The error message that appears will be <computeroutput>"Login failed for user 'example'.  Reason: Not associated with a trusted SQL Server connection"</computeroutput>.  To solve this, turn on <productname>SQL Server</productname> authentication:</para>
++<para>&freetds; may be unable to connect to the server.  The error message will be <computeroutput>"Login failed for user 'example'.  Reason: Not associated with a trusted SQL Server connection"</computeroutput>.  To solve this, turn on <productname>SQL Server</productname> authentication:</para>
+ 			<ItemizedList>
+ 				<listitem><para>Open the <emphasis><productname>SQL Server</productname> Enterprise Manager</emphasis>,
+ </para></listitem>
+@@ -2778,46 +2811,16 @@ Which shouldn't be defined unless <filename>inttypes.h</filename> exists on your
+ 				</ItemizedList>
+ 
+ <para>These instructions apply to Microsoft <productname>SQL Server 7</productname> and <productname>SQL Server 2000</productname>.</para>
+-			<sect3 id="Background">
+-				<title><productname>SQL Server</productname>'s Security Model</title>
+ 
+-<para>Microsoft supports two security models in three permutations:
+-					
+-					<ItemizedList>
+-						<listitem><para><firstterm>Windows NT Authentication Mode</>.  The operating system performs authentication; users will <emphasis>not</emphasis> have explicit <productname>SQL Server</productname> accounts.
+-</para></listitem>
+-						<listitem><para><firstterm>Standard Mode</>.  <productname>SQL Server</productname> authenticates connections itself without consulting the operating system.  Users of course need <productname>SQL Server</productname> accounts to log in.
+-</para></listitem>
+-						<listitem><para><firstterm>Mixed Mode</> Combines the above two.
+-</para></listitem>
+-						</ItemizedList>
+-					For normal operation, you need either Standard or Mixed mode.</para>
+-
+-<para><quote>Windows NT Authentication</quote>, often called <quote>integrated security</quote>,
+-					relies on Microsoft's <emphasis>domain login</emphasis>. In it, a user's network security attributes are established at network login time. When connecting to the database server, <productname>SQL
+-						Server</productname> uses the facilities of the host operating system (<productname>Windows NT </productname> or similar) to determine the authenticated network username.
+-					<productname>SQL Server</productname> then permits or denies login access based on that network
+-					username alone, without requiring a separate login name and password.</para>
+-				<Note><para>The &freetds; supports integrated security mode.  If you have <productname>SQL Server</productname> running in integrated (domain) mode along with a Windows PDC, and wish to try it, see <link linkend="domains">Domain Logins</link> in the <link linkend="configs">Advanced Configurations</link> chapter. If you have Active Directory you can also use Kerberos, see <link linkend="kerberos">Kerberos support</link>.
++<Note><para>&freetds; supports integrated security mode, too.  If you have <productname>SQL Server</productname> running in integrated (domain) mode along with a Windows PDC, and wish to try it, see <link linkend="domains">Domain Logins</link> in the <link linkend="configs">Advanced Configurations</link> chapter. If you have Active Directory you can also use Kerberos, see <link linkend="kerberos">Kerberos support</link>.
+ </para></Note>
+ 
+-<para>&freetds; supports the traditional database
+-					security model, which Microsoft terms <quote>SQL Server
+-						Authentication</quote> but is frequently known as <quote>standard
+-						security</quote>. Username+Password pairs have to be passed to the
+-					server explicitly.</para>
+-
+-<para>Mixed Mode allows users to connect using either authentication
+-					method. Users who connect through a <productname>Windows NT</productname> account can make use
+-					of trusted connections in either Windows NT Authentication Mode or
+-					Mixed Mode. After successful connection to <productname>SQL
+-						Server</productname>, the security mechanism is the same for both
+-					modes.</para>
+-				</sect3>
+ 			</sect2>
+ 		</sect1>
++
+ 	<sect1 id="serverthere">
+ 		<title>Is the server there?</title>
++
+ 		<sect2 id="serverthere.ping">
+ 			<title>Start with <command>ping</></title>
+ 
+@@ -2829,13 +2832,13 @@ Which shouldn't be defined unless <filename>inttypes.h</filename> exists on your
+ 	<prompt>$ </prompt><userinput>ping -c1 <replaceable>myhost</replaceable></userinput>
+ 	<computeroutput>
+ 	PING myhost (127.0.0.1) from 127.0.0.1 : 56(84) bytes of data.
+-	64 bytes from myhost (127.0.0.1): icmp_seq=0 ttl=255 time=250 usec
+-	</computeroutput></screen>
++	64 bytes from myhost (127.0.0.1): icmp_seq=0 ttl=255 time=250 usec</computeroutput></screen>
+ 	</example>
+ 	A successful ping shows that your network isn't preventing you from reaching the machine hosting the server.</para>
+ 	</sect2>
++	
+ 	<sect2 id="serverthere.telnet">
+-	<title>Test with <command>telnet</></title>
++		<title>Test with <command>telnet</></title>
+ 
+ <para>Attempt to <command>telnet</> to the port, to verify that the servername is listening.
+ 				<example id="e.g.troubleshooting.telnet">
+@@ -2845,16 +2848,15 @@ Which shouldn't be defined unless <filename>inttypes.h</filename> exists on your
+ 	<computeroutput>
+ 	Trying 127.0.0.1...
+ 	Connected to myhost.
+-	Escape character is '^]'.
+-	</computeroutput></screen>
++	Escape character is '^]'. </computeroutput></screen>
+ 	</example>
+-	If you get output as above, the servername is listening.  If you get a 'Connection Refused' message, you're talking to the wrong host, wrong port, or the servername is down.
+-	<footnote><para>To exit <command>telnet</>:  When connected, telnet's command mode may be entered by
+-	typing the telnet <firstterm>escape character</firstterm> (initially <keysym>Ctrl</keysym>-<keysym>]</keysym>, as above).  Once in command mode, <command>telnet</> may be exited with the command <command>quit</>.
++If you get output as above, the servername is listening.  If you get a 'Connection Refused' message, you're talking to the wrong host, wrong port, or the servername is down.
++	<footnote><para>To exit <command>telnet</>:  When connected, telnet's command mode may be entered by typing the telnet <firstterm>escape character</firstterm> (initially <keysym>Ctrl</keysym>-<keysym>]</keysym>, as above).  Once in command mode, <command>telnet</> may be exited with the command <command>quit</>.
+ </para></footnote></para>
++
+ 	</sect2>
+ 	<sect2 id="serverthere.tsql">
+-	<title>Test with <command>tsql</></title>
++		<title>Test with <command>tsql</></title>
+ 
+ <para><command>tsql</> can be run in two ways, one which uses &freetdsconf; and one which connects directly using the host and port.  First attempt a connection using host and port.
+ 				<example id="e.g.troubleshooting.tsql.noconf">
+@@ -2867,9 +2869,9 @@ Which shouldn't be defined unless <filename>inttypes.h</filename> exists on your
+ 
+ <para>If you receive a message like
+ <screen>
+-	<computeroutput>
+-	Msg. No.: 18450 Severity: 14 State: 1 Login failed- User: loginid Reason: Not defined as a valid user of a trusted SQL Server connection
+-	</computeroutput></screen>
++	<computeroutput>Msg. No.: 18450 Severity: 14 State: 1 Login failed- User: loginid 
++	Reason: Not defined as a valid user of a trusted SQL Server connection </computeroutput></screen>
++	
+ 	<productname>SQL Server</productname> is accepting only <quote>domain</quote> logins.  This applies only to Microsoft <productname>SQL Server</productname> and you'll need to have your DBA verify that <quote>server logins</quote> are allowed, or use a <link linkend="domains">domain login</link>.				</para>
+ 
+ <para>Finally, if you received a prompt, then try <command>tsql</> using the servername.
+@@ -2881,8 +2883,9 @@ Which shouldn't be defined unless <filename>inttypes.h</filename> exists on your
+ 	If this fails, FreeTDS is either not finding your &freetdsconf; file, finding the wrong one, or there is an error in the file.</para>
+ 	</sect2>
+ 	</sect1>
++
+ 	<sect1 id="Logging">
+-	<title>Logging</title>
++		<title>Logging</title>
+ 
+ <para>&freetds; has quite extensive logging capabilities.  These are often invaluable in setting up new configurations, when it's hard to be sure precisely what configuration information is being used, and what communication is (not) working.   Often such questions can be quickly resolved by turning on logging and examining the logs.</para>
+ 		<sect2 id="Environment"><title>Environment Variables that Control Logging</title>
+@@ -2895,7 +2898,7 @@ Which shouldn't be defined unless <filename>inttypes.h</filename> exists on your
+ <screen>
+ 	<prompt>$ </prompt><userinput>export TDSDUMP=/tmp/freetds.log</userinput></screen>
+ 	Will generate a log file named <filename>freetds.log</filename> in the <filename>/tmp</filename> directory.
+-	<tip><para> The filenames <filename>stdout</> and <filename>stderr</> are also supported.  They can be handy if you want to intersperse the log output with your application's output, or if your application opens more than one connection.  (The logfile is otherwise normally truncatated each time the library connects to the server.)</para></tip></para>
++	<tip><para> The filenames <filename>stdout</> and <filename>stderr</> are also supported.  They can be handy if you want to intersperse the log output with your application's output, or if your application opens more than one connection.  (The logfile is otherwise normally truncated each time the library connects to the server.)</para></tip></para>
+ 	</listitem>
+ 	</varlistentry>
+ 	<varlistentry>
+@@ -3054,13 +3057,14 @@ Which shouldn't be defined unless <filename>inttypes.h</filename> exists on your
+ <programlisting>
+ 	#define NOREVERSELOOKUPS
+ 	</programlisting>
+-					in <filename>src/tds/config.c</>, rebuilding, and reinstalling.
+-					<Note><para> Reverse lookup code has been removed as of version 0.62 due to wrong implementation.</para></Note></para>
++
++in <filename>src/tds/config.c</>, rebuilding, and reinstalling.
++
++	<Note><para> Reverse lookup code has been removed as of version 0.62 because it was poorly implemented.</para></Note></para>
+ 				</listitem>
+ 			<listitem>
+ 
+-<para>Packet size.  Check packet size setting on &freetdsconf; (see <literal>initial block size</>). Default value (no configuration) is usually fine. The slowness is due to multiple packet to use.
+-					Under <productname><acronym>GNU</>/Linux</productname> system we use an optimization to reduce network traffic so you shouldn't see much difference using this system.</para>
++<para>Packet size.  The default packet size setting in &freetdsconf; (see <literal>initial block size</>) is usually fine. Slowness can potentially be due to multiple packet to use.  Under <productname><acronym>GNU</>/Linux</productname> system we use an optimization to reduce network traffic; you shouldn't see much difference using this system.</para>
+ 				</listitem>
+ 			</itemizedlist>
+ 				
+@@ -3101,8 +3105,7 @@ Compile-time settings (established with the "configure" script)
+                               iODBC: no
+                            unixodbc: no
+               SSPI "trusted" logins: no
+-                            Keberos: no
+-      </computeroutput></screen>
++                            Keberos: no </computeroutput></screen>
+       
+ For &odbc; setup issues, the <command>osql</command> script is intended to confirm the configuration files are all sane.  If it fails to report a problem, please post a message describing the problem to the mailing list.  Thanks.  </para>
+ 
+@@ -3236,7 +3239,7 @@ For &odbc; setup issues, the <command>osql</command> script is intended to confi
+ 
+ <para>We have just begun an independent reference manual to &freetds;; the main <acronym>API</> documents are the work of the server vendors.  We're using <ulink url="http://www.stack.nl/~dimitri/doxygen/">Doxygen</>, which extracts documentation directly from comments in the source code, and we're maybe 25% done.</para>
+ 
+-<para>The <acronym>TDS</> protocol is partly documented, as are the <acronym>API</>s to <filename>libtds</filename> and <systemitem class="library">db-lib</>, but much remains.</para>
++<para>The <acronym>TDS</> protocol is partly documented, as are the <acronym>API</>s to <filename>libtds</filename> and &dblib;, but much remains.</para>
+ 			</sect2>
+ 		<sect2 id="webmaster">
+ 			<title>Be the Webmaster</title>
+@@ -3289,7 +3292,8 @@ For &odbc; setup issues, the <command>osql</command> script is intended to confi
+ <para>What can &freetds; do that can't be done any other way?  Glad you asked.  &freetds; can</para>
+ 		<ItemizedList>
+ 			<listitem><para>Connect to every version of either vendor's server, using the same binaries.</para></listitem>
+-			<listitem><para>Provide a &ctlib; interface to Microsoft <productname>SQL Server</productname>.  This feature alone allows <productname>DBD::Sybase</> and <command>sqsh</>, among others, to connect to Microsoft's product.</para></listitem>
++			<listitem><para>Provide a &ctlib; for Microsoft <productname>SQL Server</>.  This feature alone allows <productname>DBD::Sybase</> and <command>sqsh</>, among others, to connect to Microsoft's product.</para></listitem>
++			<listitem><para>Provide a modern &dblib; for Microsoft <productname>SQL Server</>: Win32/64, and TDS 7+.  </para></listitem>
+ 			<listitem><para>Provide a bcp-capable interface and command-line utility on unix-like operating systems for  Microsoft <productname>SQL Server</productname>.</para></listitem>
+ 			<listitem><para>Run on many more operating systems than either vendor's libraries do.</para></listitem>
+ 			<listitem><para>Get fixed, instead of telling you to get stuffed.</para></listitem>
+@@ -3313,7 +3317,7 @@ For &odbc; setup issues, the <command>osql</command> script is intended to confi
+ 
+ <para>The <ulink url="../reference/index.html">reference manual</ulink> is installed as part of <productname>FreeTDS</>.  It can be regenerated at any time using <productname>Doxygen</productname> with <command>cd <filename>doc</>; make doc</command>.</para>
+ 
+-<para>The reference manual is a work in progress: only the db-lib library is completely documented, and quite minimally at that.  Should you find it inadequate, you may be interested to learn it's not hard to add to, technically.  <productname>Doxygen</productname> generates a manual from encoded comments in the source code.  Its markup syntax is not hard to learn.  You can read more about it at the <ulink url="http://www.stack.nl/~dimitri/doxygen/">Doxygen website</>.</para>
++<para>The reference manual is a work in progress: only &dblib; is completely documented, and quite minimally at that.  Should you find it inadequate, you may be interested to learn it's not hard to add to, technically.  <productname>Doxygen</productname> generates a manual from encoded comments in the source code.  Its markup syntax is not hard to learn.  You can read more about it at the <ulink url="http://www.stack.nl/~dimitri/doxygen/">Doxygen website</>.</para>
+ 
+ <para>Basic API coverage information for the db-lib, ct-lib, and ODBC client libraries is maintained in <filename>doc/api_status.txt</>, included in the source distribution.  For your convenience and enjoyment, we include that file in the following sections.  In each table, we note for the function
+ 			<footnote><para>Sybase and Microsoft sometimes use slightly different names for the same function.  It is the intention of the <option>--enable-msdblib</> option to align
+@@ -3321,7 +3325,7 @@ For &odbc; setup issues, the <command>osql</command> script is intended to confi
+ 			the extent to which it is implemented.  The <emphasis>Status</> field may be:
+ 			
+ 			<variablelist id="dblib.api.status">
+-				<title>db-lib API function status domain</title>
++				<title>&dblib; API function status domain</title>
+ 				<varlistentry>
+ 					<term>(blank)</term>
+ 					<listitem>
+@@ -3354,9 +3358,9 @@ For &odbc; setup issues, the <command>osql</command> script is intended to confi
+ 		</sect1>
+ 	
+ 	<sect1 id="dblib.api.summary">
+-		<title>db-lib API Implementation Summary</title>
++		<title>&dblib; API Implementation Summary</title>
+ 
+-<para>Microsoft's version of db-lib is
++<para>Microsoft's version of &dblib; is
+ 			<ulink url="http://msdn.microsoft.com/en-us/library/aa936988(SQL.80).aspx">online</ulink>.
+ 			Sybase's is both
+ 			<ulink url="http://manuals.sybase.com/onlinebooks/group-cnarc/cng1110e/dblib/@Generic__BookTextView;pt=4602;nh=1">online</ulink>
+@@ -3394,7 +3398,7 @@ For &odbc; setup issues, the <command>osql</command> script is intended to confi
+ 
+ <para>Few things are harder to put up with than the annoyance of a good example.</para> </epigraph>
+ 		
+-		<abstract><para>Below is a complete sample working db-lib program, presented as a series of examples.
++		<abstract><para>Below is a complete sample working &dblib; program, presented as a series of examples.
+ 				<itemizedlist><title>Features of sample code</title>
+ 					<listitem><para>Processes command-line options to select the server, database, username, and password</para></listitem>
+ 					<listitem><para>Remaining arguments on the command line comprise the SQL query to execute</para></listitem>
+@@ -3409,7 +3413,7 @@ For &odbc; setup issues, the <command>osql</command> script is intended to confi
+ 
+ <para>Correct handling of errors is extremely important in database applications because they involve two systems most others don't: the network and the database server.  Both can give rise to errors that, if not detected and reported when they occur, let the application proceed blithely on until something truly mysterious happens.  In the worst case, in the absence of a properly reported error, the application may <emphasis>seem</> to have updated the data, when in fact it did not.</para>
+ 
+-<para>Every db-lib application uses the network, making it subject to network failures.  Database programs also almost always have very high data integrity requirements.  It is necessary to know the row was absolutely, positively committed, once and only once, without error or exception.  Without taking great care to trap and handle all error conditions, no statement about the program's reliability can be made with confidence.</para></sidebar></important></para>
++<para>Every &dblib; application uses the network, making it subject to network failures.  Database programs also almost always have very high data integrity requirements.  It is necessary to know the row was absolutely, positively committed, once and only once, without error or exception.  Without taking great care to trap and handle all error conditions, no statement about the program's reliability can be made with confidence.</para></sidebar></important></para>
+ 		
+ 
+ <para><orderedlist><title>How to Get and Build the sample code</title>
+@@ -3438,11 +3442,11 @@ For &odbc; setup issues, the <command>osql</command> script is intended to confi
+ <para>We now proceed to the code proper.</para>
+ 				
+ 		<sect2 id="samplecode.include"><title>Header files</title>
+-			<abstract><para>We need two header files to use db-lib.  We need a few others to deal with I/O in C, as you know.  Also declare the error and message handler functions, more about which later.</para></abstract>
++			<abstract><para>We need two header files to use &dblib;.  We need a few others to deal with I/O in C, as you know.  Also declare the error and message handler functions, more about which later.</para></abstract>
+ 			
+ 
+ <para><example id="e.g.samplecode.dblib.include">
+-					<title>Sample Code: <symbol>db-lib</> header files</title>
++					<title>Sample Code: &dblib; header files</title>
+ 					<programlisting linenumbering="unnumbered">
+ <![CDATA[
+ #include <stdio.h>
+@@ -3467,7 +3471,7 @@ int msg_handler(DBPROCESS*, DBINT, int, int, char*, char*, char*, int);
+ 			
+ 
+ <para><example id="e.g.samplecode.dblib.prolog">
+-					<title>Sample Code: <symbol>db-lib</> prolog</title>
++					<title>Sample Code: &dblib; prolog</title>
+ <programlisting linenumbering="unnumbered">
+ 	extern char *optarg;
+ 	extern int optind;
+@@ -3528,7 +3532,7 @@ int msg_handler(DBPROCESS*, DBINT, int, int, char*, char*, char*, int);
+ <para><symbol>DBPROCESS</> is a structure that describes the connection.  It is returned by <function>dbopen()</>.</para></callout>
+ 					<callout arearefs="samplecode.init.retcode">
+ 
+-<para><symbol>RETCODE</> is the most common return code type for <symbol>db-lib</> functions.</para></callout>
++<para><symbol>RETCODE</> is the most common return code type for &dblib; functions.</para></callout>
+ 					</calloutlist></para>
+ 			</sect2>
+ 		
+@@ -3537,7 +3541,7 @@ int msg_handler(DBPROCESS*, DBINT, int, int, char*, char*, char*, int);
+ 			
+ 
+ <para><example id="e.g.samplecode.dblib.Initialize">
+-					<title>Sample Code: <symbol>db-lib</> Initialize</title>
++					<title>Sample Code: &dblib; Initialize</title>
+ <programlisting linenumbering="unnumbered">
+ 	
+ 	<co id="samplecode.init.dbinit" label="initialize">
+@@ -3585,7 +3589,7 @@ int msg_handler(DBPROCESS*, DBINT, int, int, char*, char*, char*, int);
+ 			
+ 
+ <para><example id="e.g.samplecode.dblib.Connect">
+-					<title>Sample Code: <symbol>db-lib</> Connect to the server</title>
++					<title>Sample Code: &dblib; Connect to the server</title>
+ <programlisting>
+ 	if ((dbproc = dbopen(login, options.servername)) == NULL) {
+ 	fprintf(stderr, "%s:%d: unable to connect to %s as %s\n",
+@@ -3604,13 +3608,13 @@ int msg_handler(DBPROCESS*, DBINT, int, int, char*, char*, char*, int);
+ 			</sect2>
+ 		
+ 		<sect2 id="samplecode.query"><title>Send a query</title>
+-			<abstract><para><symbol>db-lib</> maintains a <firstterm>command buffer</> to hold the SQL to be sent to the server.  Two functions &mdash; <function>dbcmd()</> and <function>dbfcmd()</> &mdash; build up the query from strings of text. The command buffer is reset after the query is sent to the server.</para>
++			<abstract><para>&dblib; maintains a <firstterm>command buffer</> to hold the SQL to be sent to the server.  Two functions &mdash; <function>dbcmd()</> and <function>dbfcmd()</> &mdash; build up the query from strings of text. The command buffer is reset after the query is sent to the server.</para>
+ 
+ <para>We left the SQL on the command line.  We fetch it now and send it to the server.</para></abstract>
+ 			
+ 
+ <para><example id="e.g.samplecode.dblib.send">
+-					<title>Sample Code: <symbol>db-lib</> Send a query</title>
++					<title>Sample Code: &dblib; Send a query</title>
+ <programlisting>
+ 	for (i=0; i < argc; i++) {
+ 	assert(argv[i]);
+@@ -3637,7 +3641,7 @@ int msg_handler(DBPROCESS*, DBINT, int, int, char*, char*, char*, int);
+ 			</sect2>
+ 		
+ 		<sect2 id="samplecode.results"><title>Fetch Results</title>
+-			<abstract><para>A query may produce zero, one, or more results.  Broadly, that entails providing buffers to <symbol>db-lib</> to fill, and iterating over the results a row (and column) at a time.</para></abstract>
++			<abstract><para>A query may produce zero, one, or more results.  Broadly, that entails providing buffers to &dblib; to fill, and iterating over the results a row (and column) at a time.</para></abstract>
+ 			
+ 			<bridgehead id="samplecode.results.kinds.of.results" renderas="sect3">Kinds of Results</>
+ 			
+@@ -3747,16 +3751,16 @@ int msg_handler(DBPROCESS*, DBINT, int, int, char*, char*, char*, int);
+ 			<bridgehead id="samplecode.results.binding" renderas="sect3">Binding</>
+ 			
+ 
+-<para>Each time <symbol>dbresults()</> returns <symbol>SUCCEED</>, there is something to retrieve. <symbol>db-lib</> has different functions to deal with the different kinds of results.  The functions are of two kinds: those that convert the data into a form desired by the application, known as <firstterm>binding</>, and those that return the data in <quote>native</> form.</para>
++<para>Each time <symbol>dbresults()</> returns <symbol>SUCCEED</>, there is something to retrieve. &dblib; has different functions to deal with the different kinds of results.  The functions are of two kinds: those that convert the data into a form desired by the application, known as <firstterm>binding</>, and those that return the data in <quote>native</> form.</para>
+ 			
+ 
+ <para>To understand binding, it may be easiest to examine two primitive functions, <function>dbdata()</> and <function>dbconvert()</>.  <function>dbdata()</> returns a pointer to the column's data.  The data to which it points are in <quote>native</> form, 4 bytes for an <symbol>INT</>, 8 bytes for a <symbol>DATETIME</> and so on.  <function>dbconvert()</> converts between datatypes; you can hand it an integer and get back a character array (or a <symbol>C double</>.  You might think of  <function>dbconvert()</> as <function>atoi(3)</> on steroids). <function>dbbind()</> combines these two functions.  The application indicates in what form it would like to use each column, and the library converts them  on the fly as each row is read.</para>
+ 			
+ 
+-<para>To <emphasis>bind a column</> is to provide a buffer to <symbol>db-lib</> to fill and indicate which datatype the buffer is meant to hold. <footnote><para>This is the sort of thing <symbol>C++</>'s type system does so much better</para></footnote></para>
++<para>To <emphasis>bind a column</> is to provide a buffer to &dblib; to fill and indicate which datatype the buffer is meant to hold. <footnote><para>This is the sort of thing <symbol>C++</>'s type system does so much better</para></footnote></para>
+ 			
+ 
+-<para>It may be well to pause here to observe the three ways a datatype is described in a <symbol>db-lib</> program.
++<para>It may be well to pause here to observe the three ways a datatype is described in a &dblib; program.
+ 				<variablelist id="list.datatypes"><title><function>db-lib</> Datatype Descriptors</title>
+ 					<varlistentry>
+ 						<term>Sever Datatype</term>
+@@ -3782,7 +3786,7 @@ int msg_handler(DBPROCESS*, DBINT, int, int, char*, char*, char*, int);
+ 					</variablelist></para>
+ 						
+ 
+-<para>Typically it's more convenient to have <symbol>db-lib</> convert the data into the desired form.  The function that does that is <function>dbind()</>.  So: after fetching the metadata, and before fetching the data, we usually prepare the bound columns.</para>
++<para>Typically it's more convenient to have &dblib; convert the data into the desired form.  The function that does that is <function>dbind()</>.  So: after fetching the metadata, and before fetching the data, we usually prepare the bound columns.</para>
+ 			
+ 			<bridgehead id="samplecode.results.fetching.data" renderas="sect3">Fetching Data</>
+ 			
+@@ -3896,14 +3900,14 @@ int msg_handler(DBPROCESS*, DBINT, int, int, char*, char*, char*, int);
+ 			
+ 
+ <para><important><title>Fetch All Rows!</title>
+-					<sidebar><para><symbol>db-lib</> doesn't insist every column &mdash; or even any column &mdash; be bound or otherwise retrieved into the application's variables.  There is, however, one absolutely <emphasis>crucial, inflexible, unalterable</emphasis> requirement: the application must <emphasis>process all rows produced by the query</>.  Before the <symbol>DBPROCESS</> can be used for another query, the application must either fetch all rows, or cancel the results and receive an acknowledgement from the server. Cancelling is beyond the scope of this document, so for now  <emphasis> fetch all rows</>.</para></sidebar></important></para>
++					<sidebar><para>&dblib; doesn't insist every column &mdash; or even any column &mdash; be bound or otherwise retrieved into the application's variables.  There is, however, one absolutely <emphasis>crucial, inflexible, unalterable</emphasis> requirement: the application must <emphasis>process all rows produced by the query</>.  Before the <symbol>DBPROCESS</> can be used for another query, the application must either fetch all rows, or cancel the results and receive an acknowledgement from the server. Cancelling is beyond the scope of this document, so for now  <emphasis> fetch all rows</>.</para></sidebar></important></para>
+ 			
+ 
+ <para>Now, at last, some sample code that fetches data.  In the interest of simplicity, we don't bind anything except regular rows.</para>
+ 			
+ 
+ <para><example id="e.g.samplecode.dblib.fetch">
+-					<title>Sample Code: <symbol>db-lib</> Fetch Results</title>
++					<title>Sample Code: &dblib; Fetch Results</title>
+ <programlisting>
+ 	while ((erc = dbresults(dbproc)) != NO_MORE_RESULTS) {
+ 	struct COL 						<co id="samplecode.results.dbresults">
+@@ -4023,7 +4027,7 @@ int msg_handler(DBPROCESS*, DBINT, int, int, char*, char*, char*, int);
+ 	</programlisting></example>
+ 				<calloutlist id="co.fetching"><title>Data-fetching Notes</title>
+ 					<callout arearefs="samplecode.results.dbresults"><para>As soon as <function>dbresults()</> reports <symbol>SUCCESS</>, the row's metadata are available.</para></callout>
+-					<callout arearefs="samplecode.results.c"><para><symbol>db-lib</> columns start with 1.</para></callout>
++					<callout arearefs="samplecode.results.c"><para>&dblib; columns start with 1.</para></callout>
+ 					<callout arearefs="samplecode.results.dbcollen"><para><function>dbcollen()</> returns the sizeof the native data (e.g. 4 bytes for a T-SQL <symbol>INT</>).  We'll use <function>dbbind()</> to convert everything to strings.  If the column is <symbol>[VAR]CHAR</>, we want the column's defined size, otherwise we want its maximum size when represented as a string, which FreeTDS's <function>dbwillconvert()</> returns (for fixed-length datatypes).  <footnote><para>For IMAGE data, we need to multiply by 2, because <function>dbbind()</> will convert each byte to a hexadecimal pair.  The example program will report an error with IMAGE data.</para></footnote></para></callout>
+ 					<callout arearefs="samplecode.results.dbbind"><para><symbol>NTBSTRINGBIND</> null-terminates the character array for us.  <quote>NTB</> might perhaps stand for <quote>null terminating byte</>.</para></callout>
+ 					<callout arearefs="samplecode.results.dbnullbind"><para>A zero-length string is not a NULL!  <function>dbnullbind()</> arranges for the passed buffer to be set to -1 whenever that column is NULL for a particular row.</para></callout>
+@@ -4033,7 +4037,7 @@ int msg_handler(DBPROCESS*, DBINT, int, int, char*, char*, char*, int);
+ 			</sect2>
+ 		
+ 		<sect2 id="samplecode.errors"><title>Messages and Errors</title>
+-			<abstract><para>Errors may originate on the server or in the library itself.  The former are known as <firstterm>messages</> (because they are: they arrive as messages from the server); the latter are termed <firstterm>errors</>.  Their handling is a little intimidating.  It requires writing and installing a callback function (whose parameters are predefined by <symbol>db-lib</>), and thinking about how to handle different types of errors.</para></abstract>
++			<abstract><para>Errors may originate on the server or in the library itself.  The former are known as <firstterm>messages</> (because they are: they arrive as messages from the server); the latter are termed <firstterm>errors</>.  Their handling is a little intimidating.  It requires writing and installing a callback function (whose parameters are predefined by &dblib;), and thinking about how to handle different types of errors.</para></abstract>
+ 			
+ 			<variablelist><title>Kinds of Errors</title>
+ 				<varlistentry>
+@@ -4047,7 +4051,7 @@ int msg_handler(DBPROCESS*, DBINT, int, int, char*, char*, char*, int);
+ 					<term>Errors</term>
+ 					<listitem>
+ 
+-<para><emphasis>Errors</> arise either because the application has misused <symbol>db-lib</> in some way &mdash; say, passed a NULL <symbol>DBPROCESS</> pointer or tried to issue a query while results were pending &mdash; or because some trouble cropped up in communicating with the server (couldn't find it, say, or didn't hear back from it).</para>
++<para><emphasis>Errors</> arise either because the application has misused &dblib; in some way &mdash; say, passed a NULL <symbol>DBPROCESS</> pointer or tried to issue a query while results were pending &mdash; or because some trouble cropped up in communicating with the server (couldn't find it, say, or didn't hear back from it).</para>
+ 						</listitem>
+ 					</varlistentry>
+ 				</variablelist>
+@@ -4055,11 +4059,11 @@ int msg_handler(DBPROCESS*, DBINT, int, int, char*, char*, char*, int);
+ <para>Why these two require distinct handling is lost in the mists of time. But it does help to keep them distinct in your mind, especially while reading the documentation.</para>
+ 			
+ 
+-<para>To have <symbol>db-lib</> use your handler, pass its name to the appropriate  <function>dberrhandle()</> or <function>dbmsghandle()</> function immediately after calling <function>dbinit()</>.</para>
++<para>To have &dblib; use your handler, pass its name to the appropriate  <function>dberrhandle()</> or <function>dbmsghandle()</> function immediately after calling <function>dbinit()</>.</para>
+ 			
+ 
+ <para><example id="e.g.samplecode.dblib.errors">
+-					<title>Sample Code: <symbol>db-lib</> Error and Message handlers</title>
++					<title>Sample Code: &dblib; Error and Message handlers</title>
+ <programlisting>
+ 	int
+ 	msg_handler(DBPROCESS *dbproc, DBINT msgno, int msgstate, int severity,
+@@ -4119,8 +4123,8 @@ int msg_handler(DBPROCESS*, DBINT, int, int, char*, char*, char*, int);
+ 					<callout arearefs="samplecode.errors.msghandler.severity"><para>Severities are defined in the <emphasis>server</> documentation, and can be set by the <symbol>T-SQL RAISERROR</> statement.</para></callout>
+ 					<callout arearefs="samplecode.errors.msghandler.return"><para>Message handlers <emphasis>always and only ever</> return zero.</para></callout>
+ 					<callout arearefs="samplecode.errors.errhandler.args"><para>When first writing the handler, pay careful attention to the precise type of each parameter.  Only by carefully matching them will you convince a modern <symbol>C</> compiler that the address of your function is of the type accepted by <function>dberrhandle()</>. <footnote><para>If that 					advice sounds familiar, it's because it bears repeating.</para></footnote></para></callout>
+-					<callout arearefs="samplecode.errors.errhandler.msgs"><para>Some messages are so severe they provoke <symbol>db-lib</> into calling the error handler, too!  If you have both installed &mdash; and of course you do, right? &mdash; then you can skip those lacking an error number.</para></callout>
+-					<callout arearefs="samplecode.errors.errhandler.return"><para>While <symbol>INT_CANCEL</> is the most common return code, it's not the only one.  For one thing, the error handler's return code can control how long <symbol>db-lib</> keeps retrying timeout errors.  See the documentation for details.</para></callout>
++					<callout arearefs="samplecode.errors.errhandler.msgs"><para>Some messages are so severe they provoke &dblib; into calling the error handler, too!  If you have both installed &mdash; and of course you do, right? &mdash; then you can skip those lacking an error number.</para></callout>
++					<callout arearefs="samplecode.errors.errhandler.return"><para>While <symbol>INT_CANCEL</> is the most common return code, it's not the only one.  For one thing, the error handler's return code can control how long &dblib; keeps retrying timeout errors.  See the documentation for details.</para></callout>
+ 					</calloutlist></para>
+ 			
+ 
+@@ -4135,13 +4139,13 @@ int msg_handler(DBPROCESS*, DBINT, int, int, char*, char*, char*, int);
+ 							<function>getuserdata()</>.</para></listitem>
+ 					</orderedlist>
+ 				
+-				<tip><para>If your application is written in <symbol>C++</>, you may be tempted to use <function>throw()</>. Don't!  Your handler is a <symbol>C</> function and, more important, <emphasis>it's an extension of <symbol>db-lib</></emphasis>.  You can put a <function>throw()</> in your handler and it will compile. But when it executes, it's going to rip through <symbol>db-lib</>'s stack.  Your application will be unuseable at that point, if it doesn't cause a segment fault.</para></tip></para>
++				<tip><para>If your application is written in <symbol>C++</>, you may be tempted to use <function>throw()</>. Don't!  Your handler is a <symbol>C</> function and, more important, <emphasis>it's an extension of &dblib;</emphasis>.  You can put a <function>throw()</> in your handler and it will compile. But when it executes, it's going to rip through &dblib;'s stack.  Your application will be unuseable at that point, if it doesn't cause a segment fault.</para></tip></para>
+ 			
+ 			</sect2>
+ 		
+ 		<sect2 id="samplecode.wrapup"><title>Last Remarks</title>
+ 
+-<para>We've reached the end of our <symbol>db-lib</> tour.  The almost 300 lines of <symbol>C</> above constitute program with these features:
++<para>We've reached the end of our &dblib; tour.  The almost 300 lines of <symbol>C</> above constitute program with these features:
+ 				<itemizedlist><title> Sample Code features</>
+ 					<listitem><para>Accepts command-line parameters and SQL.</para></listitem>
+ 					<listitem><para>Checks for errors and server messages.</para></listitem>
+@@ -4529,6 +4533,7 @@ Important to understand: <command>ldd</command> is <emphasis>not</emphasis> figu
+ <para>The linker, static or runtime, uses only the function's name to resolve references.  Function parameters and semantics are invisible to it.  </para>
+ 
+ <para>The programmer and, to a lesser degree, the sysadmin direct the choice of which library to link to an executable.  A missing function will prevent execution.  A wrong function will promote wrong execution.  Don't do that.  </para>
++
+ 		</section>
+ 	</Appendix>
+ 
+
+commit 89d5fb43106ee5fb41168ea5839f76a96e313142
+Author: jklowden <jklowden>
+Date:   Tue Mar 22 00:41:31 2011 +0000
+
+    updated for upcoming release
+
+diff --git a/doc/userguide.sgml b/doc/userguide.sgml
+index 80f95bc..6eb480a 100644
+--- a/doc/userguide.sgml
++++ b/doc/userguide.sgml
+@@ -8,13 +8,13 @@
+ 	<!ENTITY dblib '<systemitem class="library">DB-Library</systemitem>'>
+ 	<!ENTITY ctlib '<systemitem class="library">CT-Library</systemitem>'>
+ 	<!ENTITY odbc  '<systemitem class="library">ODBC</systemitem>'> 
+-	<!ENTITY version "0.92"> <!--  echo '0.84 + 0.5 * (1.0 - 0.84)' -->
++	<!ENTITY version "0.91"> <!--  echo  $(( (100 - 82)/2 + 82))-->
+ 	<!ENTITY freetdsconf "<filename>freetds.conf</filename>">
+ ]>
+ <book>
+ <bookinfo>
+-	<date>$Date: 2011/03/22 00:23:24 $</date>
+-	<releaseinfo>$Revision: 1.135 $</releaseinfo>
++	<date>$Date: 2011/03/22 00:41:31 $</date>
++	<releaseinfo>$Revision: 1.136 $</releaseinfo>
+ 	<title>&freetds; User Guide</title>
+ 	<subtitle>A Guide to Installing, Configuring, and Running &freetds;</subtitle>
+ 	<author>
+@@ -63,9 +63,9 @@
+ 
+ <para>The version you're reading is:</para>
+ 			<simplelist type='vert'>
+-				<member>$Revision: 1.135 $</>
+-				<member>$Date: 2011/03/22 00:23:24 $</>
+-				<member>CVS control number $Id: userguide.sgml,v 1.135 2011/03/22 00:23:24 jklowden Exp $.</>
++				<member>$Revision: 1.136 $</>
++				<member>$Date: 2011/03/22 00:41:31 $</>
++				<member>CVS control number $Id: userguide.sgml,v 1.136 2011/03/22 00:41:31 jklowden Exp $.</>
+ 				</simplelist>
+ 			</footnote>
+ 		can be found on the &freetds;
+@@ -616,7 +616,7 @@ Which shouldn't be defined unless <filename>inttypes.h</filename> exists on your
+ 			</sect2>
+ 		<sect2 id="osx"><title>OS X&reg;</title>
+ 
+-<para>As of this writing ($Date: 2011/03/22 00:23:24 $), the regular distribution compiles on OS X.  </para>
++<para>As of this writing ($Date: 2011/03/22 00:41:31 $), the regular distribution compiles on OS X.  </para>
+ 			
+ <![ %comment [
+ 	<!-- cf http://www.is-thought.co.uk/book/sgml-8.htm -->
+
+commit ef6aecb2f6ebec3e23546e34fb02168b91eb8e32
+Author: jklowden <jklowden>
+Date:   Tue Mar 22 13:11:14 2011 +0000
+
+    updated for upcoming release
+
+diff --git a/doc/userguide.sgml b/doc/userguide.sgml
+index 6eb480a..b154ca1 100644
+--- a/doc/userguide.sgml
++++ b/doc/userguide.sgml
+@@ -13,8 +13,8 @@
+ ]>
+ <book>
+ <bookinfo>
+-	<date>$Date: 2011/03/22 00:41:31 $</date>
+-	<releaseinfo>$Revision: 1.136 $</releaseinfo>
++	<date>$Date: 2011/03/22 13:11:14 $</date>
++	<releaseinfo>$Revision: 1.137 $</releaseinfo>
+ 	<title>&freetds; User Guide</title>
+ 	<subtitle>A Guide to Installing, Configuring, and Running &freetds;</subtitle>
+ 	<author>
+@@ -63,9 +63,9 @@
+ 
+ <para>The version you're reading is:</para>
+ 			<simplelist type='vert'>
+-				<member>$Revision: 1.136 $</>
+-				<member>$Date: 2011/03/22 00:41:31 $</>
+-				<member>CVS control number $Id: userguide.sgml,v 1.136 2011/03/22 00:41:31 jklowden Exp $.</>
++				<member>$Revision: 1.137 $</>
++				<member>$Date: 2011/03/22 13:11:14 $</>
++				<member>CVS control number $Id: userguide.sgml,v 1.137 2011/03/22 13:11:14 jklowden Exp $.</>
+ 				</simplelist>
+ 			</footnote>
+ 		can be found on the &freetds;
+@@ -616,7 +616,7 @@ Which shouldn't be defined unless <filename>inttypes.h</filename> exists on your
+ 			</sect2>
+ 		<sect2 id="osx"><title>OS X&reg;</title>
+ 
+-<para>As of this writing ($Date: 2011/03/22 00:41:31 $), the regular distribution compiles on OS X.  </para>
++<para>As of this writing ($Date: 2011/03/22 13:11:14 $), the regular distribution compiles on OS X.  </para>
+ 			
+ <![ %comment [
+ 	<!-- cf http://www.is-thought.co.uk/book/sgml-8.htm -->
+@@ -745,6 +745,10 @@ Which shouldn't be defined unless <filename>inttypes.h</filename> exists on your
+ 							<entry>7.2</entry>
+ 							<entry>Includes support for varchar(max), varbinary(max), xml datatypes and MARS<footnote><para><emphasis>Multiple Active Result Sets</>. &freetds; does not support MARS.</para></footnote>.</entry>
+ 							</row>
++						<row>
++							<entry>Microsoft SQL Server 2008</entry>
++							<entry>7.2 (unchanged)</entry>
++							</row>
+ 						</tbody>
+ 					</tgroup>
+ 				</table></para>
+
+commit dfab441387bc2cac0d51f37a836ac1e0d9a7360c
+Author: jklowden <jklowden>
+Date:   Tue Mar 22 16:00:44 2011 +0000
+
+    updated for upcoming release
+
+diff --git a/doc/userguide.sgml b/doc/userguide.sgml
+index b154ca1..de05057 100644
+--- a/doc/userguide.sgml
++++ b/doc/userguide.sgml
+@@ -13,8 +13,8 @@
+ ]>
+ <book>
+ <bookinfo>
+-	<date>$Date: 2011/03/22 13:11:14 $</date>
+-	<releaseinfo>$Revision: 1.137 $</releaseinfo>
++	<date>$Date: 2011/03/22 16:00:44 $</date>
++	<releaseinfo>$Revision: 1.138 $</releaseinfo>
+ 	<title>&freetds; User Guide</title>
+ 	<subtitle>A Guide to Installing, Configuring, and Running &freetds;</subtitle>
+ 	<author>
+@@ -63,9 +63,9 @@
+ 
+ <para>The version you're reading is:</para>
+ 			<simplelist type='vert'>
+-				<member>$Revision: 1.137 $</>
+-				<member>$Date: 2011/03/22 13:11:14 $</>
+-				<member>CVS control number $Id: userguide.sgml,v 1.137 2011/03/22 13:11:14 jklowden Exp $.</>
++				<member>$Revision: 1.138 $</>
++				<member>$Date: 2011/03/22 16:00:44 $</>
++				<member>CVS control number $Id: userguide.sgml,v 1.138 2011/03/22 16:00:44 jklowden Exp $.</>
+ 				</simplelist>
+ 			</footnote>
+ 		can be found on the &freetds;
+@@ -328,7 +328,7 @@ The <quote>TDS</quote> part of the name comes from name of the protocol used to
+ <para>The simplest form of running <Command>configure</> is:
+ <screen>
+ 	<prompt>$ </prompt><userinput>./configure</userinput></screen>
+-	and sometimes that's enough.  <command>configure</> accepts command-line arguments, too, and you may need to provide some, depending on what your environment looks like.</para>
++	and sometimes that's enough.  <command>configure</> accepts command-line arguments, too, and you may need to provide some, depending on your environment.</para>
+ 
+ <para>There are a few optional arguments to <command>configure</> that may be important to you.  For a complete list, see <command>configure --help</command>.</para>
+ 			<sect3 id="Configure.Options" XrefLabel="Options to configure">
+@@ -449,14 +449,13 @@ The <quote>TDS</quote> part of the name comes from name of the protocol used to
+ 					
+ 					<varlistentry>
+ 						<term><Option>--enable-krb5</Option></term>
+-						<listitem><para>Enable Kerberos support. With Kerberos you can connect to server using your stored Kerberos ticket.
+-								This require you to configure Kerberos support on your machine.
++						<listitem><para>Enable Kerberos support. With Kerberos you can connect to server using your stored Kerberos ticket.  Obviously requires Kerberos be configured on the machine.
+ </para></listitem>
+ 						</varlistentry>
+ 					
+ 					<varlistentry>
+ 						<term><Option>--enable-sspi</Option></term>
+-						<listitem><para>Enable SSPI support. SSPI is a Micrsoft library that allows you to use your current logged account for authentication.  With this option enabled, FreeTDS supports "trusted logins" for Win32/64, just as Microsoft's own implmentations do.
++						<listitem><para>Enable SSPI support. SSPI is a Micrsoft library that allows you to use your current logged-in account for authentication.  With this option enabled, FreeTDS supports "trusted logins" for Win32/64, just as Microsoft's own implementations do.
+ </para></listitem>
+ 						</varlistentry>
+ 					
+@@ -512,6 +511,17 @@ The <quote>TDS</quote> part of the name comes from name of the protocol used to
+ <para>You normally need to be root to <command>make install</command>, unless you used the <option>--prefix</> option during configuration to install into your own directory.</para>
+ 
+ <para>With any luck, you've built and installed the &freetds; libraries.</para>
++
++<para><tip>
++	<title>Two bits of advice, if you like to keep things tidy and keep track of what you did. </title>
++
++	<para>Create a file to hold your configure options called, say, <filename>.build_options</>.</para>
++
++	<para>Create a build directory for the binaries, and invoke <command>../configure $(cat ../.build_options)</>. </para>
++	
++	<para>This approach lets you remove the binaries at any time and rebuild from scratch using the same options</para>
++	
++	</tip></para>
+ 				</sect3>
+ 			</sect2>
+ 		</sect1>
+@@ -616,7 +626,7 @@ Which shouldn't be defined unless <filename>inttypes.h</filename> exists on your
+ 			</sect2>
+ 		<sect2 id="osx"><title>OS X&reg;</title>
+ 
+-<para>As of this writing ($Date: 2011/03/22 13:11:14 $), the regular distribution compiles on OS X.  </para>
++<para>As of this writing ($Date: 2011/03/22 16:00:44 $), the regular distribution compiles on OS X.  </para>
+ 			
+ <![ %comment [
+ 	<!-- cf http://www.is-thought.co.uk/book/sgml-8.htm -->
+
+commit d796ef604f8988874b91b8e6719663a38d9b1f05
+Author: jklowden <jklowden>
+Date:   Tue Mar 22 16:03:44 2011 +0000
+
+    updated for upcoming release
+
+diff --git a/doc/userguide.sgml b/doc/userguide.sgml
+index de05057..de9133f 100644
+--- a/doc/userguide.sgml
++++ b/doc/userguide.sgml
+@@ -13,8 +13,8 @@
+ ]>
+ <book>
+ <bookinfo>
+-	<date>$Date: 2011/03/22 16:00:44 $</date>
+-	<releaseinfo>$Revision: 1.138 $</releaseinfo>
++	<date>$Date: 2011/03/22 16:03:44 $</date>
++	<releaseinfo>$Revision: 1.139 $</releaseinfo>
+ 	<title>&freetds; User Guide</title>
+ 	<subtitle>A Guide to Installing, Configuring, and Running &freetds;</subtitle>
+ 	<author>
+@@ -63,9 +63,9 @@
+ 
+ <para>The version you're reading is:</para>
+ 			<simplelist type='vert'>
+-				<member>$Revision: 1.138 $</>
+-				<member>$Date: 2011/03/22 16:00:44 $</>
+-				<member>CVS control number $Id: userguide.sgml,v 1.138 2011/03/22 16:00:44 jklowden Exp $.</>
++				<member>$Revision: 1.139 $</>
++				<member>$Date: 2011/03/22 16:03:44 $</>
++				<member>CVS control number $Id: userguide.sgml,v 1.139 2011/03/22 16:03:44 jklowden Exp $.</>
+ 				</simplelist>
+ 			</footnote>
+ 		can be found on the &freetds;
+@@ -519,7 +519,7 @@ The <quote>TDS</quote> part of the name comes from name of the protocol used to
+ 
+ 	<para>Create a build directory for the binaries, and invoke <command>../configure $(cat ../.build_options)</>. </para>
+ 	
+-	<para>This approach lets you remove the binaries at any time and rebuild from scratch using the same options</para>
++	<para>This approach lets you remove the binaries at any time and rebuild from scratch using the same options.</para>
+ 	
+ 	</tip></para>
+ 				</sect3>
+@@ -626,7 +626,7 @@ Which shouldn't be defined unless <filename>inttypes.h</filename> exists on your
+ 			</sect2>
+ 		<sect2 id="osx"><title>OS X&reg;</title>
+ 
+-<para>As of this writing ($Date: 2011/03/22 16:00:44 $), the regular distribution compiles on OS X.  </para>
++<para>As of this writing ($Date: 2011/03/22 16:03:44 $), the regular distribution compiles on OS X.  </para>
+ 			
+ <![ %comment [
+ 	<!-- cf http://www.is-thought.co.uk/book/sgml-8.htm -->
+
+commit 820de48076d626c32f80503a756cc5c1fd93da0e
+Author: jklowden <jklowden>
+Date:   Tue Mar 22 17:54:04 2011 +0000
+
+    neater output
+
+diff --git a/ChangeLog b/ChangeLog
+index ac8e369..7efbb19 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,8 @@
++Tue Mar 22 13:51:32 EDT 2011	JK Lowden <jklowden@freetds.org>
++	* autogen.sh neater output
++	* src/apps/tsql.c spell Kerberos correctly
++	* src/dblib/bcp.c initialize bcp_terminator
++
+ Mon Mar 21 20:21:51 EDT 2011	JK Lowden <jklowden@freetds.org>
+ 	* doc/userguide.sgml updated for upcoming release
+ 
+@@ -3183,4 +3188,4 @@ Wed Jan  9 19:54:43 EST 2008	JK Lowden <jklowden@freetds.org>
+ 	* ChangeLog-0.82 added because of release
+ 	
+ $FreeTDS$
+-$Id: ChangeLog,v 1.3202 2011/03/22 00:23:23 jklowden Exp $
++$Id: ChangeLog,v 1.3203 2011/03/22 17:54:04 jklowden Exp $
+diff --git a/autogen.sh b/autogen.sh
+index 13f0052..8111ee3 100755
+--- a/autogen.sh
++++ b/autogen.sh
+@@ -1,7 +1,7 @@
+ #!/bin/sh
+ # Run this to generate all the initial makefiles, etc.
+ 
+-# $Id: autogen.sh,v 1.9 2006/10/21 12:23:07 freddy77 Exp $
++# $Id: autogen.sh,v 1.10 2011/03/22 17:54:04 jklowden Exp $
+ 
+ # From automake.info:
+ #
+@@ -34,7 +34,9 @@ PKG_NAME="FreeTDS."
+ #conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
+ 
+ if test x$NOCONFIGURE = x; then
+-  echo Running $srcdir/configure $conf_flags "$@" ...
++  echo Running $srcdir/configure $conf_flags "$@" '...' \
++  	| tr ' ' \\n \
++  	| sed  's/^-/	&/'
+   $srcdir/configure $conf_flags "$@" \
+   && echo Now type \`make\' to compile $PKG_NAME
+ else
+
+commit 596ea4c77e9652eb16082f26da68ef333ec4a252
+Author: jklowden <jklowden>
+Date:   Tue Mar 22 17:54:09 2011 +0000
+
+    spell Kerberos correctly
+
+diff --git a/src/apps/tsql.c b/src/apps/tsql.c
+index 43c9029..c2e9ee6 100644
+--- a/src/apps/tsql.c
++++ b/src/apps/tsql.c
+@@ -87,7 +87,7 @@
+ #include "tdsconvert.h"
+ #include "replacements.h"
+ 
+-TDS_RCSID(var, "$Id: tsql.c,v 1.139 2010/12/21 16:55:24 jklowden Exp $");
++TDS_RCSID(var, "$Id: tsql.c,v 1.140 2011/03/22 17:54:09 jklowden Exp $");
+ 
+ #define TDS_ISSPACE(c) isspace((unsigned char) (c))
+ 
+@@ -459,7 +459,7 @@ populate_login(TDSLOGIN * login, int argc, char **argv)
+ 			       "iODBC", settings->iodbc ? "yes" : "no", 
+ 			       "unixodbc", settings->unixodbc ? "yes" : "no", 
+ 			       "SSPI \"trusted\" logins", have_sspi, 
+-			       "Keberos", enable_krb5);
++			       "Kerberos", enable_krb5);
+ 			exit(0);
+ 			break;
+ 		default:
+
+commit 8b182a2cf698b9be27c6ad8cd37bc6b2b4934a4e
+Author: jklowden <jklowden>
+Date:   Tue Mar 22 17:54:13 2011 +0000
+
+    initialize bcp_terminator
+
+diff --git a/src/dblib/bcp.c b/src/dblib/bcp.c
+index 728e364..1fb35d9 100644
+--- a/src/dblib/bcp.c
++++ b/src/dblib/bcp.c
+@@ -62,7 +62,7 @@
+ #define MAX(a,b) ( (a) > (b) ? (a) : (b) )
+ #endif
+ 
+-TDS_RCSID(var, "$Id: bcp.c,v 1.196 2011/01/14 14:18:15 freddy77 Exp $");
++TDS_RCSID(var, "$Id: bcp.c,v 1.197 2011/03/22 17:54:13 jklowden Exp $");
+ 
+ #ifdef HAVE_FSEEKO
+ typedef off_t offset_type;
+@@ -2352,6 +2352,9 @@ bcp_bind(DBPROCESS * dbproc, BYTE * varaddr, int prefixlen, DBINT varlen,
+ 	colinfo->column_varaddr  = (char *)varaddr;
+ 	colinfo->column_bindtype = vartype;
+ 	colinfo->column_bindlen  = varlen;
++
++	TDS_ZERO_FREE(colinfo->bcp_terminator);
++	colinfo->bcp_term_len = 0;
+ 	if((colinfo->bcp_terminator =  malloc(termlen)) == NULL) {
+ 		dbperror(dbproc, SYBEMEM, errno);
+ 		return FAIL;
+
+commit 8ff71bacd4413441c34861a323dafe70a2c51678
+Author: jklowden <jklowden>
+Date:   Sun Mar 27 16:36:53 2011 +0000
+
+    src/dblib/dblib.c src/tds/config.c src/tds/login.c Support DBSETLDBNAME
+
+diff --git a/ChangeLog b/ChangeLog
+index 7efbb19..79e2ed8 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,8 @@
++Sun Mar 27 12:34:23 EDT 2011	JK Lowden <jklowden@freetds.org>
++	* include/sybdb.h include/tds.h
++	- src/dblib/dblib.c src/tds/config.c src/tds/login.c
++	- Support DBSETLDBNAME
++
+ Tue Mar 22 13:51:32 EDT 2011	JK Lowden <jklowden@freetds.org>
+ 	* autogen.sh neater output
+ 	* src/apps/tsql.c spell Kerberos correctly
+@@ -3188,4 +3193,4 @@ Wed Jan  9 19:54:43 EST 2008	JK Lowden <jklowden@freetds.org>
+ 	* ChangeLog-0.82 added because of release
+ 	
+ $FreeTDS$
+-$Id: ChangeLog,v 1.3203 2011/03/22 17:54:04 jklowden Exp $
++$Id: ChangeLog,v 1.3204 2011/03/27 16:36:53 jklowden Exp $
+diff --git a/include/sybdb.h b/include/sybdb.h
+index 63be6a2..99fe81a 100644
+--- a/include/sybdb.h
++++ b/include/sybdb.h
+@@ -42,7 +42,7 @@ extern "C"
+ #define TDS_STATIC_CAST(type, a) ((type)(a))
+ #endif
+ 
+-static const char rcsid_sybdb_h[] = "$Id: sybdb.h,v 1.99 2011/02/17 15:55:36 jklowden Exp $";
++static const char rcsid_sybdb_h[] = "$Id: sybdb.h,v 1.100 2011/03/27 16:36:53 jklowden Exp $";
+ static const void *const no_unused_sybdb_h_warn[] = { rcsid_sybdb_h, no_unused_sybdb_h_warn };
+ 
+ #ifdef FALSE
+@@ -1165,6 +1165,8 @@ RETCODE dbsetlversion (LOGINREC * login, BYTE version);
+ #define DBSETLABELED		13
+ #define DBSETLLABELED(x,y)	dbsetlbool((x), (y), DBSETLABELED)
+ #define BCP_SETLABELED(x,y)	dbsetlbool((x), (y), DBSETLABELED)
++#define DBSETDBNAME		14
++#define DBSETLDBNAME(x,y)	dbsetlname((x), (y), DBSETDBNAME)
+ #define DBSETLVERSION(login, version) dbsetlversion((login), (version))
+ 
+ RETCODE bcp_init(DBPROCESS * dbproc, const char *tblname, const char *hfile, const char *errfile, int direction);
+diff --git a/include/tds.h b/include/tds.h
+index 026b6e3..a0ebb12 100644
+--- a/include/tds.h
++++ b/include/tds.h
+@@ -21,7 +21,7 @@
+ #ifndef _tds_h_
+ #define _tds_h_
+ 
+-/* $Id: tds.h,v 1.350 2011/02/17 15:55:36 jklowden Exp $ */
++/* $Id: tds.h,v 1.351 2011/03/27 16:36:53 jklowden Exp $ */
+ 
+ #include <stdarg.h>
+ #include <stdio.h>
+@@ -844,6 +844,7 @@ typedef struct tds_login
+ 	TDS_INT query_timeout;
+ 	unsigned char capabilities[TDS_MAX_CAPABILITY];
+ 	DSTR client_charset;
++	DSTR database;
+ 	unsigned int bulk_copy:1;
+ 	unsigned int suppress_language:1;
+ } TDSLOGIN;
+@@ -1468,6 +1469,7 @@ void tds_set_library(TDSLOGIN * tds_login, const char *library);
+ void tds_set_server(TDSLOGIN * tds_login, const char *server);
+ void tds_set_client_charset(TDSLOGIN * tds_login, const char *charset);
+ void tds_set_language(TDSLOGIN * tds_login, const char *language);
++void tds_set_database_name(TDSLOGIN * tds_login, const char *dbname);
+ void tds_set_version(TDSLOGIN * tds_login, TDS_TINYINT major_ver, TDS_TINYINT minor_ver);
+ void tds_set_capabilities(TDSLOGIN * tds_login, unsigned char *capabilities, int size);
+ int tds_connect_and_login(TDSSOCKET * tds, TDSCONNECTION * connection);
--- a/src/freetds.mk	Sun Mar 27 23:32:27 2011 +0200
+++ b/src/freetds.mk	Sun Mar 27 23:36:16 2011 +0200
@@ -10,7 +10,7 @@
 $(PKG)_FILE     := freetds-$($(PKG)_VERSION).tar.gz
 $(PKG)_WEBSITE  := http://www.freetds.org/
 $(PKG)_URL      := http://ibiblio.org/pub/Linux/ALPHA/$(PKG)/stable/$($(PKG)_FILE)
-$(PKG)_DEPS     := gcc libiconv
+$(PKG)_DEPS     := gcc libiconv gnutls
 
 define $(PKG)_UPDATE
     wget -q -O- 'http://freetds.cvs.sourceforge.net/viewvc/freetds/freetds/' | \
@@ -27,7 +27,6 @@
     # wine confuses the cross-compiling detection, so set it explicitly
     $(SED) -i 's,cross_compiling=no,cross_compiling=yes,' '$(1)/configure'
 
-    # beware --with-gnutls broken detection
     cd '$(1)' && ./configure \
         --prefix='$(PREFIX)/$(TARGET)' \
         --host='$(TARGET)' \
@@ -39,6 +38,8 @@
         --enable-msdblib \
         --enable-sspi \
         --disable-threadsafe \
-        --with-tdsver=8.0
+        --with-tdsver=7.2 \
+        --with-gnutls \
+        PKG_CONFIG='$(TARGET)-pkg-config'
     $(MAKE) -C '$(1)' -j '$(JOBS)' install man_MANS=
 endef
--- a/src/gcc.mk	Sun Mar 27 23:32:27 2011 +0200
+++ b/src/gcc.mk	Sun Mar 27 23:36:16 2011 +0200
@@ -4,8 +4,8 @@
 # GCC
 PKG             := gcc
 $(PKG)_IGNORE   :=
-$(PKG)_VERSION  := 4.5.2
-$(PKG)_CHECKSUM := ad5c440526c98fd17a74eab80c031af6b64d9c90
+$(PKG)_VERSION  := 4.6.0
+$(PKG)_CHECKSUM := dcbb5ce724c4bf87b9ec93473d16b71e9ebac483
 $(PKG)_SUBDIR   := gcc-$($(PKG)_VERSION)
 $(PKG)_FILE     := gcc-$($(PKG)_VERSION).tar.bz2
 $(PKG)_WEBSITE  := http://gcc.gnu.org/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/geos-1-fixes.patch	Sun Mar 27 23:36:16 2011 +0200
@@ -0,0 +1,632 @@
+This file is part of mingw-cross-env.
+See doc/index.html for further information.
+
+Patches for GCC 4.6 compatibility.
+Backported from 3 patches from this thread:
+http://lists.osgeo.org/pipermail/geos-devel/2011-March/005156.html
+
+From d63201ebcc9c6e186660a70973e2fb485fb2c681 Mon Sep 17 00:00:00 2001
+From: mingw-cross-env
+Date: Sat, 26 Mar 2011 10:13:26 +0100
+Subject: [PATCH 1/3] fix missing size_t
+
+
+diff --git a/source/headers/geos/geom/CoordinateArraySequenceFactory.h b/source/headers/geos/geom/CoordinateArraySequenceFactory.h
+index 1f19e09..9bcf835 100644
+--- a/source/headers/geos/geom/CoordinateArraySequenceFactory.h
++++ b/source/headers/geos/geom/CoordinateArraySequenceFactory.h
+@@ -51,10 +51,10 @@ public:
+ 	 */
+ 	CoordinateSequence *create(std::vector<Coordinate> *coords) const;
+ 
+-	CoordinateSequence *create(std::vector<Coordinate> *coords, size_t dims) const;
++	CoordinateSequence *create(std::vector<Coordinate> *coords, std::size_t dims) const;
+ 
+    	/** @see CoordinateSequenceFactory::create(size_t, int) */
+-	CoordinateSequence *create(size_t size, size_t dimension=3) const;
++	CoordinateSequence *create(std::size_t size, std::size_t dimension=3) const;
+ 
+ 	/** \brief
+ 	 * Returns the singleton instance of CoordinateArraySequenceFactory
+diff --git a/source/headers/geos/geom/CoordinateSequence.h b/source/headers/geos/geom/CoordinateSequence.h
+index fd1da03..c9f1277 100644
+--- a/source/headers/geos/geom/CoordinateSequence.h
++++ b/source/headers/geos/geom/CoordinateSequence.h
+@@ -95,7 +95,7 @@ public:
+ 	 * Coordinate or merely a copy depends on the implementation.
+ 	 */
+ 	//virtual const Coordinate& getCoordinate(int i) const=0;
+-	virtual const Coordinate& getAt(size_t i) const=0;
++	virtual const Coordinate& getAt(std::size_t i) const=0;
+ 
+ 	/// Return last Coordinate in the sequence
+ 	const Coordinate& back() const {
+diff --git a/source/headers/geos/geom/CoordinateSequenceFactory.h b/source/headers/geos/geom/CoordinateSequenceFactory.h
+index 6441d94..50ddc48 100644
+--- a/source/headers/geos/geom/CoordinateSequenceFactory.h
++++ b/source/headers/geos/geom/CoordinateSequenceFactory.h
+@@ -75,8 +75,8 @@ public:
+ 	 * @param dimension the dimension of the coordinates in the sequence
+ 	 * 	(if user-specifiable, otherwise ignored)
+ 	 */
+-	virtual CoordinateSequence *create(size_t size,
+-			size_t dimension) const=0;
++	virtual CoordinateSequence *create(std::size_t size,
++			std::size_t dimension) const=0;
+ 
+ 	virtual ~CoordinateSequenceFactory();
+ };
+diff --git a/source/headers/geos/index/chain/MonotoneChainBuilder.h b/source/headers/geos/index/chain/MonotoneChainBuilder.h
+index 7c27e83..e227559 100644
+--- a/source/headers/geos/index/chain/MonotoneChainBuilder.h
++++ b/source/headers/geos/index/chain/MonotoneChainBuilder.h
+@@ -97,8 +97,8 @@ private:
+ 	 *
+ 	 * NOTE: aborts if 'start' is >= pts.getSize()
+ 	 */
+-	static size_t findChainEnd(const geom::CoordinateSequence& pts,
+-	                                                   size_t start);
++	static std::size_t findChainEnd(const geom::CoordinateSequence& pts,
++	                                                   std::size_t start);
+ };
+ 
+ } // namespace geos::index::chain
+diff --git a/source/headers/geos/planargraph/DirectedEdgeStar.h b/source/headers/geos/planargraph/DirectedEdgeStar.h
+index cc36ca7..c15b0a0 100644
+--- a/source/headers/geos/planargraph/DirectedEdgeStar.h
++++ b/source/headers/geos/planargraph/DirectedEdgeStar.h
+@@ -86,7 +86,7 @@ public:
+ 	 * \brief Returns the number of edges around the Node associated
+ 	 * with this DirectedEdgeStar.
+ 	 */
+-	size_t getDegree() const { return outEdges.size(); }
++	std::size_t getDegree() const { return outEdges.size(); }
+ 
+ 	/**
+ 	 * \brief Returns the coordinate for the node at wich this
+diff --git a/source/headers/geos/simplify/DouglasPeuckerLineSimplifier.h b/source/headers/geos/simplify/DouglasPeuckerLineSimplifier.h
+index 5dd0412..f6fd1ef 100644
+--- a/source/headers/geos/simplify/DouglasPeuckerLineSimplifier.h
++++ b/source/headers/geos/simplify/DouglasPeuckerLineSimplifier.h
+@@ -81,7 +81,7 @@ private:
+ 	BoolVectAutoPtr usePt;
+ 	double distanceTolerance;
+ 
+-	void simplifySection(size_t i, size_t j);
++	void simplifySection(std::size_t i, std::size_t j);
+ 
+     // Declare type as noncopyable
+     DouglasPeuckerLineSimplifier(const DouglasPeuckerLineSimplifier& other);
+diff --git a/source/headers/geos/simplify/TaggedLineString.h b/source/headers/geos/simplify/TaggedLineString.h
+index 49af2ba..8078eb3 100644
+--- a/source/headers/geos/simplify/TaggedLineString.h
++++ b/source/headers/geos/simplify/TaggedLineString.h
+@@ -66,11 +66,11 @@ public:
+ 	typedef std::auto_ptr<geom::CoordinateSequence> CoordSeqPtr;
+ 
+ 	TaggedLineString(const geom::LineString* nParentLine,
+-			size_t minimumSize=2);
++			std::size_t minimumSize=2);
+ 
+ 	~TaggedLineString();
+ 
+-	size_t getMinimumSize() const;
++	std::size_t getMinimumSize() const;
+ 
+ 	const geom::LineString* getParent() const;
+ 
+@@ -78,11 +78,11 @@ public:
+ 
+ 	CoordSeqPtr getResultCoordinates() const;
+ 
+-	size_t getResultSize() const;
++	std::size_t getResultSize() const;
+ 
+-	TaggedLineSegment* getSegment(size_t);
++	TaggedLineSegment* getSegment(std::size_t x);
+ 
+-	const TaggedLineSegment* getSegment(size_t) const;
++	const TaggedLineSegment* getSegment(std::size_t x) const;
+ 
+ 	std::vector<TaggedLineSegment*>& getSegments();
+ 
+@@ -104,7 +104,7 @@ private:
+ 	// TaggedLineSegments owned by this object
+ 	std::vector<TaggedLineSegment*> resultSegs;
+ 
+-	size_t minimumSize;
++	std::size_t minimumSize;
+ 
+ 	void init();
+ 
+diff --git a/source/headers/geos/simplify/TaggedLineStringSimplifier.h b/source/headers/geos/simplify/TaggedLineStringSimplifier.h
+index 8ab8507..e54f3e5 100644
+--- a/source/headers/geos/simplify/TaggedLineStringSimplifier.h
++++ b/source/headers/geos/simplify/TaggedLineStringSimplifier.h
+@@ -92,20 +92,20 @@ private:
+ 
+ 	double distanceTolerance;
+ 
+-	void simplifySection(size_t i, size_t j,
+-			size_t depth);
++	void simplifySection(std::size_t i, std::size_t j,
++			std::size_t depth);
+ 
+-	static size_t findFurthestPoint(
++	static std::size_t findFurthestPoint(
+ 			const geom::CoordinateSequence* pts,
+-			size_t i, size_t j,
++			std::size_t i, std::size_t j,
+ 			double& maxDistance);
+ 
+ 	bool hasBadIntersection(const TaggedLineString* parentLine,
+-                       const std::vector<size_t>& sectionIndex,
++                       const std::vector<std::size_t>& sectionIndex,
+                        const geom::LineSegment& candidateSeg);
+ 
+ 	bool hasBadInputIntersection(const TaggedLineString* parentLine,
+-                       const std::vector<size_t>& sectionIndex,
++                       const std::vector<std::size_t>& sectionIndex,
+                        const geom::LineSegment& candidateSeg);
+ 
+ 	bool hasBadOutputIntersection(const geom::LineSegment& candidateSeg);
+@@ -114,7 +114,7 @@ private:
+ 			const geom::LineSegment& seg1) const;
+ 
+ 	std::auto_ptr<TaggedLineSegment> flatten(
+-			size_t start, size_t end);
++			std::size_t start, std::size_t end);
+ 
+ 	/** \brief
+ 	 * Tests whether a segment is in a section of a TaggedLineString
+@@ -126,7 +126,7 @@ private:
+ 	 */
+ 	static bool isInLineSection(
+ 		const TaggedLineString* parentLine,
+-		const std::vector<size_t>& sectionIndex,
++		const std::vector<std::size_t>& sectionIndex,
+ 		const TaggedLineSegment* seg);
+ 
+ 	/** \brief
+@@ -138,8 +138,8 @@ private:
+ 	 * @param sectionEndIndex
+ 	 */
+ 	void remove(const TaggedLineString* line,
+-			size_t start,
+-			size_t end);
++			std::size_t start,
++			std::size_t end);
+  
+ };
+ 
+diff --git a/source/index/chain/MonotoneChainBuilder.cpp b/source/index/chain/MonotoneChainBuilder.cpp
+index 8448431..4dcc571 100644
+--- a/source/index/chain/MonotoneChainBuilder.cpp
++++ b/source/index/chain/MonotoneChainBuilder.cpp
+@@ -56,13 +56,13 @@ void
+ MonotoneChainBuilder::getChains(const CoordinateSequence* pts, void* context,
+                                 vector<MonotoneChain*>& mcList)
+ {
+-	vector<size_t> startIndex;
++	vector<std::size_t> startIndex;
+ 	getChainStartIndices(*pts, startIndex);
+-	size_t nindexes = startIndex.size();
++	std::size_t nindexes = startIndex.size();
+ 	if (nindexes > 0)
+ 	{
+-		size_t n = nindexes - 1;
+-		for(size_t i = 0; i < n; i++)
++		std::size_t n = nindexes - 1;
++		for(std::size_t i = 0; i < n; i++)
+ 		{
+ 			MonotoneChain* mc = new MonotoneChain(*pts, startIndex[i], startIndex[i+1], context);
+ 			mcList.push_back(mc);
+@@ -73,16 +73,16 @@ MonotoneChainBuilder::getChains(const CoordinateSequence* pts, void* context,
+ /* static public */
+ void
+ MonotoneChainBuilder::getChainStartIndices(const CoordinateSequence& pts,
+-                                           vector<size_t>& startIndexList)
++                                           vector<std::size_t>& startIndexList)
+ {
+ 	// find the startpoint (and endpoints) of all monotone chains
+ 	// in this edge
+-	size_t start = 0;
++	std::size_t start = 0;
+ 	startIndexList.push_back(start);
+-	const size_t n = pts.getSize() - 1;
++	const std::size_t n = pts.getSize() - 1;
+ 	do
+ 	{
+-		size_t last = findChainEnd(pts, start);
++		std::size_t last = findChainEnd(pts, start);
+ 		startIndexList.push_back(last);
+ 		start = last;
+ 	} while (start < n);
+@@ -90,17 +90,17 @@ MonotoneChainBuilder::getChainStartIndices(const CoordinateSequence& pts,
+ }
+ 
+ /* private static */
+-size_t
+-MonotoneChainBuilder::findChainEnd(const CoordinateSequence& pts, size_t start)
++std::size_t
++MonotoneChainBuilder::findChainEnd(const CoordinateSequence& pts, std::size_t start)
+ {
+ 
+-	const size_t npts = pts.getSize(); // cache
++	const std::size_t npts = pts.getSize(); // cache
+ 
+ 	assert(start < npts);
+ 	assert(npts); // should be implied by the assertion above,
+ 	              // 'start' being unsigned
+ 
+-	size_t safeStart = start;
++	std::size_t safeStart = start;
+ 
+         // skip any zero-length segments at the start of the sequence
+         // (since they cannot be used to establish a quadrant)
+@@ -119,7 +119,7 @@ MonotoneChainBuilder::findChainEnd(const CoordinateSequence& pts, size_t start)
+ 	// (which is the starting quadrant)
+ 	int chainQuad = Quadrant::quadrant(pts[safeStart],
+ 	                                   pts[safeStart + 1]);
+-	size_t last = start + 1;
++	std::size_t last = start + 1;
+ 	while (last < npts)
+ 	{
+ 		// skip zero-length segments, but include them in the chain
+diff --git a/source/simplify/DouglasPeuckerLineSimplifier.cpp b/source/simplify/DouglasPeuckerLineSimplifier.cpp
+index 29761c2..67cbae9 100644
+--- a/source/simplify/DouglasPeuckerLineSimplifier.cpp
++++ b/source/simplify/DouglasPeuckerLineSimplifier.cpp
+@@ -68,7 +68,7 @@ DouglasPeuckerLineSimplifier::simplify()
+ 	usePt = BoolVectAutoPtr(new BoolVect(pts.size(), true));
+ 	simplifySection(0, pts.size() - 1);
+ 
+-	for (size_t i=0, n=pts.size(); i<n; ++i)
++	for (std::size_t i=0, n=pts.size(); i<n; ++i)
+ 	{
+ 		if ( usePt->operator[](i) )
+ 		{
+@@ -84,17 +84,17 @@ DouglasPeuckerLineSimplifier::simplify()
+ /*private*/
+ void
+ DouglasPeuckerLineSimplifier::simplifySection(
+-		size_t i,
+-		size_t j)
++		std::size_t i,
++		std::size_t j)
+ {
+ 	if ( (i+1) == j ) return;
+ 
+ 	geos::geom::LineSegment seg(pts[i], pts[j]);
+ 	double maxDistance = -1.0;
+ 
+-	size_t maxIndex = i;
++	std::size_t maxIndex = i;
+ 
+-	for (size_t k=i+1; k<j; k++)
++	for (std::size_t k=i+1; k<j; k++)
+ 	{
+ 		double distance = seg.distance(pts[k]);
+ 		if (distance > maxDistance) {
+@@ -103,7 +103,7 @@ DouglasPeuckerLineSimplifier::simplifySection(
+ 		}
+ 	}
+ 	if (maxDistance <= distanceTolerance) {
+-		for(size_t k =i+1; k<j; k++)
++		for(std::size_t k =i+1; k<j; k++)
+ 		{
+ 			usePt->operator[](k) = false;
+ 		}
+diff --git a/source/simplify/TaggedLineString.cpp b/source/simplify/TaggedLineString.cpp
+index 3d1fcbc..bbf3c9d 100644
+--- a/source/simplify/TaggedLineString.cpp
++++ b/source/simplify/TaggedLineString.cpp
+@@ -44,7 +44,7 @@ namespace simplify { // geos::simplify
+ 
+ /*public*/
+ TaggedLineString::TaggedLineString(const geom::LineString* nParentLine,
+-			size_t nMinimumSize)
++			std::size_t nMinimumSize)
+ 	:
+ 	parentLine(nParentLine),
+ 	minimumSize(nMinimumSize)
+@@ -60,10 +60,10 @@ TaggedLineString::~TaggedLineString()
+ 	     << endl;
+ #endif
+ 
+-	for (size_t i=0, n=segs.size(); i<n; i++)
++	for (std::size_t i=0, n=segs.size(); i<n; i++)
+ 		delete segs[i];
+ 
+-	for (size_t i=0, n=resultSegs.size(); i<n; i++)
++	for (std::size_t i=0, n=resultSegs.size(); i<n; i++)
+ 		delete resultSegs[i];
+ }
+ 
+@@ -81,7 +81,7 @@ TaggedLineString::init()
+ 
+ 	segs.reserve(pts->size()-1);
+ 
+-	for (size_t i=0, n=pts->size()-1; i<n; i++)
++	for (std::size_t i=0, n=pts->size()-1; i<n; i++)
+ 	{
+ 		TaggedLineSegment* seg = new TaggedLineSegment(
+ 				pts->getAt(i),
+@@ -100,7 +100,7 @@ TaggedLineString::init()
+ }
+ 
+ /*public*/
+-size_t
++std::size_t
+ TaggedLineString::getMinimumSize() const
+ {
+ 	return minimumSize;
+@@ -155,7 +155,7 @@ TaggedLineString::extractCoordinates(
+ 	cerr << __FUNCTION__ << " segs.size: " << segs.size() << endl;
+ #endif
+ 
+-	size_t i=0, size=segs.size();
++	std::size_t i=0, size=segs.size();
+ 
+ 	assert(size);
+ 
+@@ -173,7 +173,7 @@ TaggedLineString::extractCoordinates(
+ }
+ 
+ /*public*/
+-size_t
++std::size_t
+ TaggedLineString::getResultSize() const
+ {
+ 	unsigned resultSegsSize = resultSegs.size();
+@@ -182,14 +182,14 @@ TaggedLineString::getResultSize() const
+ 
+ /*public*/
+ TaggedLineSegment*
+-TaggedLineString::getSegment(size_t i) 
++TaggedLineString::getSegment(std::size_t i) 
+ {
+ 	return segs[i];
+ }
+ 
+ /*public*/
+ const TaggedLineSegment*
+-TaggedLineString::getSegment(size_t i) const
++TaggedLineString::getSegment(std::size_t i) const
+ {
+ 	return segs[i];
+ }
+diff --git a/source/simplify/TaggedLineStringSimplifier.cpp b/source/simplify/TaggedLineStringSimplifier.cpp
+index 5981b7a..025e41d 100644
+--- a/source/simplify/TaggedLineStringSimplifier.cpp
++++ b/source/simplify/TaggedLineStringSimplifier.cpp
+@@ -83,8 +83,8 @@ TaggedLineStringSimplifier::simplify(TaggedLineString* nLine)
+ 
+ /*private*/
+ void
+-TaggedLineStringSimplifier::simplifySection(size_t i,
+-		size_t j, size_t depth)
++TaggedLineStringSimplifier::simplifySection(std::size_t i,
++		std::size_t j, std::size_t depth)
+ {
+ 	depth += 1;
+ 
+@@ -94,7 +94,7 @@ TaggedLineStringSimplifier::simplifySection(size_t i,
+ 	          << std::endl;
+ #endif
+ 
+-	vector<size_t> sectionIndex(2);
++	vector<std::size_t> sectionIndex(2);
+ 
+ 	if((i+1) == j)
+ 	{
+@@ -124,7 +124,7 @@ TaggedLineStringSimplifier::simplifySection(size_t i,
+ 	 */
+ 	if (line->getResultSize() < line->getMinimumSize())
+ 	{
+-		size_t worstCaseSize = depth + 1;
++		std::size_t worstCaseSize = depth + 1;
+ 		if (worstCaseSize < line->getMinimumSize())
+ 			isValidToSimplify = false;
+ 	}
+@@ -132,7 +132,7 @@ TaggedLineStringSimplifier::simplifySection(size_t i,
+ 	double distance;
+ 
+ 	// pass distance by ref
+-	size_t furthestPtIndex = findFurthestPoint(linePts, i, j, distance);
++	std::size_t furthestPtIndex = findFurthestPoint(linePts, i, j, distance);
+ 
+ #if GEOS_DEBUG
+ 	std::cerr << "furthest point " << furthestPtIndex 
+@@ -176,7 +176,7 @@ TaggedLineStringSimplifier::simplifySection(size_t i,
+ 
+ /*private*/
+ auto_ptr<TaggedLineSegment>
+-TaggedLineStringSimplifier::flatten(size_t start, size_t end)
++TaggedLineStringSimplifier::flatten(std::size_t start, std::size_t end)
+ {
+ 	// make a new segment for the simplified geometry
+ 	const Coordinate& p0 = linePts->getAt(start);
+@@ -192,7 +192,7 @@ TaggedLineStringSimplifier::flatten(size_t start, size_t end)
+ bool
+ TaggedLineStringSimplifier::hasBadIntersection(
+ 		const TaggedLineString* parentLine,
+-		const vector<size_t>& sectionIndex,
++		const vector<std::size_t>& sectionIndex,
+ 		const LineSegment& candidateSeg)
+ {
+ 	if (hasBadOutputIntersection(candidateSeg))
+@@ -242,7 +242,7 @@ TaggedLineStringSimplifier::hasInteriorIntersection(
+ bool
+ TaggedLineStringSimplifier::hasBadInputIntersection(
+ 		const TaggedLineString* parentLine,
+-		const vector<size_t>& sectionIndex,
++		const vector<std::size_t>& sectionIndex,
+ 		const LineSegment& candidateSeg)
+ {
+ 	auto_ptr< vector<LineSegment*> > querySegs =
+@@ -278,14 +278,14 @@ TaggedLineStringSimplifier::hasBadInputIntersection(
+ bool
+ TaggedLineStringSimplifier::isInLineSection(
+ 		const TaggedLineString* line,
+-		const vector<size_t>& sectionIndex,
++		const vector<std::size_t>& sectionIndex,
+ 		const TaggedLineSegment* seg)
+ {
+ 	// not in this line
+ 	if (seg->getParent() != line->getParent())
+ 		return false;
+ 
+-	size_t segIndex = seg->getIndex();
++	std::size_t segIndex = seg->getIndex();
+ 	if (segIndex >= sectionIndex[0] && segIndex < sectionIndex[1])
+ 		return true;
+ 
+@@ -295,13 +295,13 @@ TaggedLineStringSimplifier::isInLineSection(
+ /*private*/
+ void
+ TaggedLineStringSimplifier::remove(const TaggedLineString* line,
+-		size_t start,
+-		size_t end)
++		std::size_t start,
++		std::size_t end)
+ {
+ 	assert(end <= line->getSegments().size() );
+ 	assert(start < end); // I'm not sure this should always be true
+ 
+-	for (size_t i = start; i < end; i++)
++	for (std::size_t i = start; i < end; i++)
+ 	{
+ 		const TaggedLineSegment* seg = line->getSegment(i);
+ 		inputIndex->remove(seg);
+@@ -309,10 +309,10 @@ TaggedLineStringSimplifier::remove(const TaggedLineString* line,
+ }
+ 
+ /*private static*/
+-size_t
++std::size_t
+ TaggedLineStringSimplifier::findFurthestPoint(
+ 		const geom::CoordinateSequence* pts,
+-		size_t i, size_t j,
++		std::size_t i, std::size_t j,
+ 		double& maxDistance)
+ {
+ 	LineSegment seg(pts->getAt(i), pts->getAt(j));
+@@ -321,8 +321,8 @@ TaggedLineStringSimplifier::findFurthestPoint(
+ 	          << std::endl;
+ #endif
+ 	double maxDist = -1.0;
+-	size_t maxIndex = i;
+-	for (size_t k = i + 1; k < j; k++)
++	std::size_t maxIndex = i;
++	for (std::size_t k = i + 1; k < j; k++)
+ 	{
+ 		const Coordinate& midPt = pts->getAt(k);
+ 		double distance = seg.distance(midPt);
+-- 
+1.7.4.1
+
+
+From bc687db602e42b4620ec9605db89ad49ee1951bb Mon Sep 17 00:00:00 2001
+From: mingw-cross-env
+Date: Sat, 26 Mar 2011 10:23:03 +0100
+Subject: [PATCH 2/3] fix missing NULL
+
+
+diff --git a/source/headers/geos/index/chain/MonotoneChainBuilder.h b/source/headers/geos/index/chain/MonotoneChainBuilder.h
+index e227559..3cd11e6 100644
+--- a/source/headers/geos/index/chain/MonotoneChainBuilder.h
++++ b/source/headers/geos/index/chain/MonotoneChainBuilder.h
+@@ -22,6 +22,7 @@
+ 
+ #include <geos/export.h>
+ #include <vector>
++#include <cstddef>
+ 
+ // Forward declarations
+ namespace geos {
+diff --git a/source/headers/geos/operation/valid/SimpleNestedRingTester.h b/source/headers/geos/operation/valid/SimpleNestedRingTester.h
+index b8888ac..d9436ff 100644
+--- a/source/headers/geos/operation/valid/SimpleNestedRingTester.h
++++ b/source/headers/geos/operation/valid/SimpleNestedRingTester.h
+@@ -23,6 +23,7 @@
+ 
+ #include <geos/export.h>
+ 
++#include <cstddef>
+ #include <vector>
+ 
+ // Forward declarations
+diff --git a/source/index/bintree/Bintree.cpp b/source/index/bintree/Bintree.cpp
+index 66a5ebc..3bd9ce1 100644
+--- a/source/index/bintree/Bintree.cpp
++++ b/source/index/bintree/Bintree.cpp
+@@ -14,6 +14,7 @@
+  *
+  **********************************************************************/
+ 
++#include <cstddef>
+ #include <geos/index/bintree/Bintree.h>
+ #include <geos/index/bintree/Root.h>
+ #include <geos/index/bintree/Interval.h>
+diff --git a/source/index/bintree/Node.cpp b/source/index/bintree/Node.cpp
+index a879bc9..59bd95d 100644
+--- a/source/index/bintree/Node.cpp
++++ b/source/index/bintree/Node.cpp
+@@ -14,6 +14,7 @@
+  *
+  **********************************************************************/
+ 
++#include <cstddef>
+ #include <cassert>
+ 
+ #include <geos/index/bintree/Node.h>
+diff --git a/source/index/bintree/Root.cpp b/source/index/bintree/Root.cpp
+index 0f2de89..b3419c5 100644
+--- a/source/index/bintree/Root.cpp
++++ b/source/index/bintree/Root.cpp
+@@ -19,6 +19,7 @@
+ #include <geos/index/bintree/Interval.h>
+ #include <geos/index/quadtree/IntervalSize.h>
+ 
++#include <cstddef>
+ #include <cassert>
+ 
+ namespace geos {
+diff --git a/source/index/strtree/AbstractNode.cpp b/source/index/strtree/AbstractNode.cpp
+index bd07cf4..00267d0 100644
+--- a/source/index/strtree/AbstractNode.cpp
++++ b/source/index/strtree/AbstractNode.cpp
+@@ -17,6 +17,7 @@
+ #include <geos/index/strtree/AbstractNode.h>
+ 
+ #include <vector>
++#include <cstddef>
+ #include <cassert>
+ 
+ using namespace std;
+-- 
+1.7.4.1
+
+
+From febd67da3fdf6afa19b33bf50b544b4fa911f4b9 Mon Sep 17 00:00:00 2001
+From: mingw-cross-env
+Date: Sat, 26 Mar 2011 10:53:53 +0100
+Subject: [PATCH 3/3] fix uninitialized const caused by missing constructor
+
+
+diff --git a/source/headers/geos/operation/overlay/OverlayNodeFactory.h b/source/headers/geos/operation/overlay/OverlayNodeFactory.h
+index 12fb81c..186c9b2 100644
+--- a/source/headers/geos/operation/overlay/OverlayNodeFactory.h
++++ b/source/headers/geos/operation/overlay/OverlayNodeFactory.h
+@@ -46,6 +46,7 @@ namespace overlay { // geos::operation::overlay
+  */
+ class GEOS_DLL OverlayNodeFactory: public geomgraph::NodeFactory {
+ public:
++	OverlayNodeFactory():geomgraph::NodeFactory() {}
+ 	geomgraph::Node* createNode(const geom::Coordinate &coord) const;
+ 	static const geomgraph::NodeFactory &instance();
+ };
+-- 
+1.7.4.1
+
--- a/src/glib.mk	Sun Mar 27 23:32:27 2011 +0200
+++ b/src/glib.mk	Sun Mar 27 23:36:16 2011 +0200
@@ -4,8 +4,8 @@
 # GLib
 PKG             := glib
 $(PKG)_IGNORE   :=
-$(PKG)_VERSION  := 2.28.3
-$(PKG)_CHECKSUM := 77d070832ac35e4b0d3b8edd8e1b4b96ee509d3b
+$(PKG)_VERSION  := 2.28.4
+$(PKG)_CHECKSUM := 46b4e9eca27a936c686c32a768d5e352d1275673
 $(PKG)_SUBDIR   := glib-$($(PKG)_VERSION)
 $(PKG)_FILE     := glib-$($(PKG)_VERSION).tar.bz2
 $(PKG)_WEBSITE  := http://www.gtk.org/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/gnutls-1-fixes.patch	Sun Mar 27 23:36:16 2011 +0200
@@ -0,0 +1,60 @@
+This file is part of mingw-cross-env.
+See doc/index.html for further information.
+
+Contains ad hoc patches for cross building.
+
+From e0633729f352fd3ca1dc31e11db0e03b0ec39132 Mon Sep 17 00:00:00 2001
+From: mingw-cross-env
+Date: Fri, 25 Mar 2011 16:09:35 +0100
+Subject: [PATCH 1/2] C++ compatibility fix
+
+
+diff --git a/lib/includes/gnutls/compat.h b/lib/includes/gnutls/compat.h
+index af02d92..6f200db 100644
+--- a/lib/includes/gnutls/compat.h
++++ b/lib/includes/gnutls/compat.h
+@@ -114,6 +114,10 @@
+ #define LIBGNUTLS_VERSION_NUMBER GNUTLS_VERSION_NUMBER
+ #define LIBGNUTLS_EXTRA_VERSION GNUTLS_VERSION
+ 
++#ifdef __cplusplus
++extern "C" {
++#endif
++
+ /* The gnutls_retr_st was deprecated by gnutls_certificate_retrieve_function()
+  * and gnutls_retr2_st.
+  */
+@@ -345,4 +349,7 @@ gnutls_sign_callback_get (gnutls_session_t session, void **userdata)
+ 
+   void gnutls_transport_set_lowat (gnutls_session_t session, int num) _GNUTLS_GCC_ATTR_DEPRECATED;
+ 
++#ifdef  __cplusplus
++}
++#endif
+ #endif /* _GNUTLS_COMPAT_H */
+-- 
+1.7.4.1
+
+
+From 4e2d2db1c9ca65ddfd59eefa6802177559676328 Mon Sep 17 00:00:00 2001
+From: mingw-cross-env
+Date: Fri, 25 Mar 2011 16:10:53 +0100
+Subject: [PATCH 2/2] add parameter vaiable to avoid gcc error
+
+
+diff --git a/lib/system.c b/lib/system.c
+index f3bed5f..b795fca 100644
+--- a/lib/system.c
++++ b/lib/system.c
+@@ -50,7 +50,7 @@
+ #ifdef _WIN32
+ 
+ int
+-system_errno (gnutls_transport_ptr)
++system_errno (gnutls_transport_ptr p)
+ {
+   int tmperr = WSAGetLastError ();
+   int ret = 0;
+-- 
+1.7.4.1
+
--- a/src/gnutls.mk	Sun Mar 27 23:32:27 2011 +0200
+++ b/src/gnutls.mk	Sun Mar 27 23:36:16 2011 +0200
@@ -4,8 +4,8 @@
 # GnuTLS
 PKG             := gnutls
 $(PKG)_IGNORE   :=
-$(PKG)_VERSION  := 2.10.5
-$(PKG)_CHECKSUM := 4530657082a0e754356de89a5529d1ad7a18e777
+$(PKG)_VERSION  := 2.12.0
+$(PKG)_CHECKSUM := 48f27df66c7a721c5ce2b690ab936a3c9162c40a
 $(PKG)_SUBDIR   := gnutls-$($(PKG)_VERSION)
 $(PKG)_FILE     := gnutls-$($(PKG)_VERSION).tar.bz2
 $(PKG)_WEBSITE  := http://www.gnu.org/software/gnutls/
@@ -23,17 +23,19 @@
 
 define $(PKG)_BUILD
     echo '/* DEACTIVATED */' > '$(1)/gl/gai_strerror.c'
+    $(SED) -i 's/^\(SUBDIRS.*\) tests/\1/;' '$(1)/Makefile.in'
+    $(SED) -i 's/^\(SUBDIRS.*\) doc/\1/;' '$(1)/Makefile.in'
     $(SED) -i 's, sed , $(SED) ,g' '$(1)/gl/tests/Makefile.in'
     cd '$(1)' && ./configure \
         --host='$(TARGET)' \
+        --enable-static \
         --disable-shared \
         --prefix='$(PREFIX)/$(TARGET)' \
-        --with-libgcrypt-prefix='$(PREFIX)/$(TARGET)' \
         --disable-nls \
-        --with-included-opencdk \
         --with-included-libtasn1 \
         --with-included-libcfg \
-        --with-included-lzo \
+        --with-libgcrypt \
+        --with-lzo \
         LIBS='-lz'
     $(MAKE) -C '$(1)' -j 1 install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= defexec_DATA=
 endef
--- a/src/guile.mk	Sun Mar 27 23:32:27 2011 +0200
+++ b/src/guile.mk	Sun Mar 27 23:36:16 2011 +0200
@@ -30,7 +30,8 @@
         --disable-shared \
         --without-threads \
         scm_cv_struct_timespec=no \
-        LIBS='-lunistring -lintl -liconv'
+        LIBS='-lunistring -lintl -liconv' \
+        CFLAGS='-Wno-unused-but-set-variable'
     $(MAKE) -C '$(1)' -j '$(JOBS)' schemelib_DATA=
     $(MAKE) -C '$(1)' -j 1 install schemelib_DATA=
 
--- a/src/imagemagick.mk	Sun Mar 27 23:32:27 2011 +0200
+++ b/src/imagemagick.mk	Sun Mar 27 23:36:16 2011 +0200
@@ -4,8 +4,8 @@
 # ImageMagick
 PKG             := imagemagick
 $(PKG)_IGNORE   :=
-$(PKG)_VERSION  := 6.6.8-4
-$(PKG)_CHECKSUM := fba39fe8ee749f6265dc6c92b968f084861908d5
+$(PKG)_VERSION  := 6.6.8-6
+$(PKG)_CHECKSUM := f0eebc7a89aa1bfd087530e781647b3075faa443
 $(PKG)_SUBDIR   := ImageMagick-$($(PKG)_VERSION)
 $(PKG)_FILE     := ImageMagick-$($(PKG)_VERSION).tar.bz2
 $(PKG)_WEBSITE  := http://www.imagemagick.org/
--- a/src/jpeg-test.c	Sun Mar 27 23:32:27 2011 +0200
+++ b/src/jpeg-test.c	Sun Mar 27 23:36:16 2011 +0200
@@ -16,6 +16,9 @@
 
     test_boolean = TRUE;
     test_int32 = 1;
+    (void)test_boolean;
+    (void)test_int32;
+
     jpeg_create_decompress(&cinfo);
     jpeg_destroy_decompress(&cinfo);
 
--- a/src/jpeg.mk	Sun Mar 27 23:32:27 2011 +0200
+++ b/src/jpeg.mk	Sun Mar 27 23:36:16 2011 +0200
@@ -26,7 +26,7 @@
     $(MAKE) -C '$(1)' -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= man_MANS=
 
     '$(TARGET)-gcc' \
-        -W -Wall -Werror -ansi -pedantic \
+        -W -Wall -Werror -ansi -pedantic -Werror \
         '$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-jpeg.exe' \
         -ljpeg
 endef
--- a/src/libdnet.mk	Sun Mar 27 23:32:27 2011 +0200
+++ b/src/libdnet.mk	Sun Mar 27 23:36:16 2011 +0200
@@ -28,6 +28,7 @@
     $(SED) -i 's,-lpacket,-lpacket -lws2_32,g'               '$(1)/configure'
     $(SED) -i 's,/usr/include,$(PREFIX)/$(TARGET)/include,g' '$(1)/configure'
     $(SED) -i 's,#include <Ntddndis.h>,#include <ddk/ntddndis.h>,' '$(1)/src/eth-win32.c'
+    $(SED) -i 's,-mno-cygwin,,' '$(1)/configure'
     cd '$(1)' && ./configure \
         --host='$(TARGET)' \
         --disable-shared \
--- a/src/libgsf.mk	Sun Mar 27 23:32:27 2011 +0200
+++ b/src/libgsf.mk	Sun Mar 27 23:36:16 2011 +0200
@@ -4,8 +4,8 @@
 # libgsf
 PKG             := libgsf
 $(PKG)_IGNORE   :=
-$(PKG)_VERSION  := 1.14.19
-$(PKG)_CHECKSUM := 125dac2939f9ecc8041c5cb5cbf74a00fd14b6ca
+$(PKG)_VERSION  := 1.14.20
+$(PKG)_CHECKSUM := d172b454c1b98f9c111df11e000b1ced050bdac9
 $(PKG)_SUBDIR   := libgsf-$($(PKG)_VERSION)
 $(PKG)_FILE     := libgsf-$($(PKG)_VERSION).tar.bz2
 $(PKG)_WEBSITE  := http://ftp.gnome.org/pub/gnome/sources/libgsf/
--- a/src/libsndfile-1-sed.patch	Sun Mar 27 23:32:27 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-# This file is part of mingw-cross-env.
-# See doc/index.html for further information.
-
-This patch has been derived from:
-http://lists.gnu.org/archive/html/mingw-cross-env-list/2010-10/msg00153.html
-
-Here we don't mess with configure.ac, autotools and shaver - simply patch configure
-
---- libsndfile-1.0.23/configure.orig	2010-10-13 02:08:53.000000000 +1100
-+++ libsndfile-1.0.23/configure	2010-10-13 02:14:19.000000000 +1100
-@@ -18485,7 +18485,7 @@
- 	OS_SPECIFIC_LINKS=" -static-libgcc $OS_SPECIFIC_LINKS"
- 	fi
- 
--WIN_RC_VERSION=`echo $PACKAGE_VERSION | sed -re "s/p.*//" -e "s/\./,/g"`
-+WIN_RC_VERSION=`echo $PACKAGE_VERSION | $SED -re "s/p.*//" -e "s/\./,/g"`
- 
- #-------------------------------------------------------------------------------
- 
--- a/src/libsndfile.mk	Sun Mar 27 23:32:27 2011 +0200
+++ b/src/libsndfile.mk	Sun Mar 27 23:36:16 2011 +0200
@@ -4,8 +4,8 @@
 # libsndfile
 PKG             := libsndfile
 $(PKG)_IGNORE   :=
-$(PKG)_VERSION  := 1.0.23
-$(PKG)_CHECKSUM := dee36861b503fe7754f0131364523f45720a0914
+$(PKG)_VERSION  := 1.0.24
+$(PKG)_CHECKSUM := ade2dad272b52f61bb58aca3a4004b28549ee0f8
 $(PKG)_SUBDIR   := libsndfile-$($(PKG)_VERSION)
 $(PKG)_FILE     := libsndfile-$($(PKG)_VERSION).tar.gz
 $(PKG)_WEBSITE  := http://www.mega-nerd.com/libsndfile/
--- a/src/pfstools.mk	Sun Mar 27 23:32:27 2011 +0200
+++ b/src/pfstools.mk	Sun Mar 27 23:36:16 2011 +0200
@@ -4,8 +4,8 @@
 # pfstools
 PKG             := pfstools
 $(PKG)_IGNORE   :=
-$(PKG)_VERSION  := 1.8.2
-$(PKG)_CHECKSUM := 6109587b0f8e53d1d963e9e02f7298bf0d197d5d
+$(PKG)_VERSION  := 1.8.3
+$(PKG)_CHECKSUM := b13d1863944afc4a88eb6ec92954677995399ab7
 $(PKG)_SUBDIR   := $(PKG)-$($(PKG)_VERSION)
 $(PKG)_FILE     := $(PKG)-$($(PKG)_VERSION).tar.gz
 $(PKG)_WEBSITE  := http://$(PKG).sourceforge.net/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/physfs-1-fix-gcc46-warnings.patch	Sun Mar 27 23:36:16 2011 +0200
@@ -0,0 +1,30 @@
+This file is part of mingw-cross-env.
+See doc/index.html for further information.
+
+This patch has been taken from:
+http://icculus.org/pipermail/physfs/2011-March/000990.html
+
+diff -ru physfs-2.0.2.orig/archivers/wad.c physfs-2.0.2/archivers/wad.c
+--- physfs-2.0.2.orig/archivers/wad.c	2011-02-18 22:17:31.000000000 +0100
++++ physfs-2.0.2/archivers/wad.c	2011-03-27 14:55:10.000000000 +0200
+@@ -245,9 +245,6 @@
+     PHYSFS_uint32 fileCount;
+     PHYSFS_uint32 directoryOffset;
+     WADentry *entry;
+-    char lastDirectory[9];
+-
+-    lastDirectory[8] = 0; /* Make sure lastDirectory stays null-terminated. */
+ 
+     BAIL_IF_MACRO(!wad_open(name, forWriting, &fh, &fileCount,&directoryOffset), NULL, 0);
+     info->entryCount = fileCount;
+diff -ru physfs-2.0.2.orig/platform/windows.c physfs-2.0.2/platform/windows.c
+--- physfs-2.0.2.orig/platform/windows.c	2011-02-18 22:17:31.000000000 +0100
++++ physfs-2.0.2/platform/windows.c	2011-03-27 14:54:17.000000000 +0200
+@@ -462,6 +462,7 @@
+              */	
+     		rc = pGetUserProfileDirectoryW(accessToken, &dummy, &psize);
+             assert(!rc);  /* !!! FIXME: handle this gracefully. */
++            (void)rc;
+ 
+             /* Allocate memory for the profile directory */
+             wstr = (LPWSTR) __PHYSFS_smallAlloc(psize * sizeof (WCHAR));
--- a/src/qt-1-cherrypicks.patch	Sun Mar 27 23:32:27 2011 +0200
+++ b/src/qt-1-cherrypicks.patch	Sun Mar 27 23:36:16 2011 +0200
@@ -7,7 +7,7 @@
 From 8f36bff28b648f65845cd56255a6c5b2cb7f8e42 Mon Sep 17 00:00:00 2001
 From: Mark Brand <mabrand@mabrand.nl>
 Date: Fri, 15 Oct 2010 14:56:03 +0200
-Subject: [PATCH 01/12] removed obsolete -qt-gif configure option
+Subject: [PATCH 01/14] removed obsolete -qt-gif configure option
 
 Since "-system-gif" is not offered, offering "-qt-gif" is unnecessary
 and perhaps misleading. By default the GIF handler is built from code
@@ -90,7 +90,7 @@
 From 6f97b6dab051bc2899907ac794495bc7542d4337 Mon Sep 17 00:00:00 2001
 From: Mark Brand <mabrand@mabrand.nl>
 Date: Mon, 10 Jan 2011 16:41:54 +0100
-Subject: [PATCH 02/12] qmake: fix double directory separator
+Subject: [PATCH 02/14] qmake: fix double directory separator
 
 Merge-request: 2543
 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
@@ -126,7 +126,7 @@
 From da69fe08f058ac49788559d333bcec747b94d208 Mon Sep 17 00:00:00 2001
 From: Mark Brand <mabrand@mabrand.nl>
 Date: Mon, 10 Jan 2011 16:41:55 +0100
-Subject: [PATCH 03/12] qmake: don't limit pkg-config writing to unix generator
+Subject: [PATCH 03/14] qmake: don't limit pkg-config writing to unix generator
 
 Move pkg-config related methods from unix generator to base class
 so they can be used by other generators too.
@@ -553,7 +553,7 @@
 From c870095011276897127ed801570d0b4cce79d552 Mon Sep 17 00:00:00 2001
 From: Mark Brand <mabrand@mabrand.nl>
 Date: Mon, 10 Jan 2011 16:41:56 +0100
-Subject: [PATCH 04/12] qmake: write and install pkg-config files for mingw
+Subject: [PATCH 04/14] qmake: write and install pkg-config files for mingw
 
 Merge-request: 2543
 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
@@ -607,7 +607,7 @@
 From 8414d5630e66546be5d5eb0e832c80dcddea5d77 Mon Sep 17 00:00:00 2001
 From: Mark Brand <mabrand@mabrand.nl>
 Date: Mon, 10 Jan 2011 16:41:57 +0100
-Subject: [PATCH 05/12] qt project files: create pkg-config files for mingw
+Subject: [PATCH 05/14] qt project files: create pkg-config files for mingw
 
 This is mostly the same as for unix.
 
@@ -940,7 +940,7 @@
 From 1cf4420ae5221d649880cc0d2e1b1895a19ad106 Mon Sep 17 00:00:00 2001
 From: Mark Brand <mabrand@mabrand.nl>
 Date: Mon, 10 Jan 2011 20:21:05 +0100
-Subject: [PATCH 06/12] Fix static build on Windows with MinGW.
+Subject: [PATCH 06/14] Fix static build on Windows with MinGW.
 
 Q_DECL_IMPORT is still __declspec(dllimport), which is unsuitable for
 static code.
@@ -1127,7 +1127,7 @@
 From e285e9993d4f2c6823782840d89f44c1bab74afa Mon Sep 17 00:00:00 2001
 From: Bernhard Rosenkraenzer <br@blankpage.ch>
 Date: Thu, 27 Jan 2011 13:48:13 +0100
-Subject: [PATCH 07/12] Allow the user to select imageformats to be built as plugin vs internal
+Subject: [PATCH 07/14] Allow the user to select imageformats to be built as plugin vs internal
 
 This adds what is already there for different plugin types to
 imageformats plugins -- allowing the user to configure which
@@ -1235,7 +1235,7 @@
 From 095583fb68a8ae02fd16790eaaa922693d268443 Mon Sep 17 00:00:00 2001
 From: Mark Brand <mabrand@mabrand.nl>
 Date: Tue, 16 Nov 2010 20:06:28 +0100
-Subject: [PATCH 08/12] explicitly include -llcms for -lmng (mingw-cross-env specific)
+Subject: [PATCH 08/14] explicitly include -llcms for -lmng (mingw-cross-env specific)
 
 ---
  src/gui/image/qmnghandler.pri |    2 +-
@@ -1261,7 +1261,7 @@
 From 3baf871e135d70edbc2431038708886d2795b8b3 Mon Sep 17 00:00:00 2001
 From: Mark Brand <mabrand@mabrand.nl>
 Date: Sat, 5 Jun 2010 23:41:04 +0200
-Subject: [PATCH 09/12] added missing INSTALLS to JavaScriptCore.pro for static libjscore (mingw-cross-env specific)
+Subject: [PATCH 09/14] added missing INSTALLS to JavaScriptCore.pro for static libjscore (mingw-cross-env specific)
 
 For static build of Qt on win32-g++*, applications using webkit
 link to libjscore.a.
@@ -1293,7 +1293,7 @@
 From 9e5d4702daa1168ab14ba936014dd6a7bb5671c9 Mon Sep 17 00:00:00 2001
 From: Mark Brand <mabrand@mabrand.nl>
 Date: Tue, 9 Nov 2010 20:09:45 +0100
-Subject: [PATCH 10/12] Partially restored support for static linking of QtWebKit (mingw-cross-env specific)
+Subject: [PATCH 10/14] Partially restored support for static linking of QtWebKit (mingw-cross-env specific)
 
 Support was removed by 4221d629e2cf37ee8c5ba7cb595b05ab8c82f113.
 Static QtWebkit might be supported by mingw-cross-env.
@@ -1325,7 +1325,7 @@
 From 61064254a0c5c2c3785909acf60cabdbdcb18d5b Mon Sep 17 00:00:00 2001
 From: Mark Brand <mabrand@mabrand.nl>
 Date: Thu, 6 Jan 2011 14:21:32 +0100
-Subject: [PATCH 11/12] pkg-config file for jscore (mingw-cross-env specific)
+Subject: [PATCH 11/14] pkg-config file for jscore (mingw-cross-env specific)
 
 ---
  .../webkit/JavaScriptCore/JavaScriptCore.pro       |    8 ++++++++
@@ -1354,7 +1354,7 @@
 From 0ad5aac2fdc0f2e81f94c92867bb4e15b3da3ddf Mon Sep 17 00:00:00 2001
 From: Tony Theodore <tonyt@logyst.com>
 Date: Mon, 21 Feb 2011 22:22:04 +0100
-Subject: [PATCH 12/12] workaround for native build on OSX (mingw-cross-env specific)
+Subject: [PATCH 12/14] workaround for native build on OSX (mingw-cross-env specific)
 
 The native build complains about:
 "You are building a 64-bit application, but using a 32-bit version of
@@ -1381,3 +1381,69 @@
 -- 
 1.7.4.1
 
+
+From db85d5c4df98ee12261f62fa637e629b120680a6 Mon Sep 17 00:00:00 2001
+From: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
+Date: Mon, 10 Jan 2011 20:09:24 +0100
+Subject: [PATCH 13/14] fix -enable-stdcall-fixup usage
+
+the leading "-Wl," was apparently accidentally split off to the wrong
+line.
+
+Task-number: QTBUG-15391
+Reviewed-by: mariusSO
+(cherry picked from commit 0953ee31dba532603fb7dfbde78c99aafb048bef)
+---
+ mkspecs/win32-g++/qmake.conf |    4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/mkspecs/win32-g++/qmake.conf b/mkspecs/win32-g++/qmake.conf
+index ec216aa..2d9833b 100644
+--- a/mkspecs/win32-g++/qmake.conf
++++ b/mkspecs/win32-g++/qmake.conf
+@@ -52,8 +52,8 @@ QMAKE_RUN_CXX_IMP	= $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
+ 
+ QMAKE_LINK		= g++
+ QMAKE_LINK_C		= gcc
+-QMAKE_LFLAGS		= -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc
+-QMAKE_LFLAGS_EXCEPTIONS_ON = -mthreads -Wl
++QMAKE_LFLAGS		= -Wl,-enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc
++QMAKE_LFLAGS_EXCEPTIONS_ON = -mthreads
+ QMAKE_LFLAGS_EXCEPTIONS_OFF =
+ QMAKE_LFLAGS_RELEASE	= -Wl,-s
+ QMAKE_LFLAGS_DEBUG	=
+-- 
+1.7.4.1
+
+
+From ed4c5f0a04a90da94c1b9ea9cd504b7ad1e14ae1 Mon Sep 17 00:00:00 2001
+From: Mark Brand <mabrand@mabrand.nl>
+Date: Sun, 27 Mar 2011 20:55:48 +0200
+Subject: [PATCH 14/14] fix -enable-stdcall-fixup usage
+
+the leading "-Wl," was apparently accidentally split off to the wrong
+line.
+
+Originally done in 0953ee3 for mkspecs/win32-g++.
+---
+ mkspecs/unsupported/win32-g++-cross/qmake.conf |    4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/mkspecs/unsupported/win32-g++-cross/qmake.conf b/mkspecs/unsupported/win32-g++-cross/qmake.conf
+index 7e077a1..efc3de2 100644
+--- a/mkspecs/unsupported/win32-g++-cross/qmake.conf
++++ b/mkspecs/unsupported/win32-g++-cross/qmake.conf
+@@ -52,8 +52,8 @@ QMAKE_RUN_CXX_IMP	= $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
+ 
+ QMAKE_LINK		= i686-pc-mingw32-g++
+ QMAKE_LINK_C		= i686-pc-mingw32-gcc
+-QMAKE_LFLAGS		= -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc
+-QMAKE_LFLAGS_EXCEPTIONS_ON = -mthreads -Wl
++QMAKE_LFLAGS		= -Wl,-enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc
++QMAKE_LFLAGS_EXCEPTIONS_ON = -mthreads
+ QMAKE_LFLAGS_EXCEPTIONS_OFF =
+ QMAKE_LFLAGS_RELEASE	= -Wl,-s
+ QMAKE_LFLAGS_DEBUG	=
+-- 
+1.7.4.1
+
--- a/src/sdl-test.c	Sun Mar 27 23:32:27 2011 +0200
+++ b/src/sdl-test.c	Sun Mar 27 23:36:16 2011 +0200
@@ -13,6 +13,7 @@
     if (SDL_Init(SDL_INIT_EVERYTHING) < 0) return 1;
 
     screen = SDL_SetVideoMode(640, 480, 32, SDL_HWSURFACE);
+    (void)screen;
 
     SDL_Quit();
     return 0;
--- a/src/sdl_mixer-test.c	Sun Mar 27 23:32:27 2011 +0200
+++ b/src/sdl_mixer-test.c	Sun Mar 27 23:36:16 2011 +0200
@@ -11,6 +11,7 @@
     (void)argv;
 
     initted = Mix_Init(MIX_INIT_FLAC | MIX_INIT_OGG | MIX_INIT_MOD);
+    (void)initted;
     Mix_Quit();
     return 0;
 }
--- a/src/vmime-1-fixes.patch	Sun Mar 27 23:32:27 2011 +0200
+++ b/src/vmime-1-fixes.patch	Sun Mar 27 23:36:16 2011 +0200
@@ -510,11 +510,13 @@
 1.7.4.1
 
 
-From 720396d3bf9803f2cd5651ed9ee27b8b39d60145 Mon Sep 17 00:00:00 2001
-From: Mark Brand <mabrand@mabrand.nl>
-Date: Tue, 15 Mar 2011 15:59:05 +0100
-Subject: [PATCH 8/8] add dependencies to .pc file
+From 1c0648c2a3ee4072869446755c8a7604614752e1 Mon Sep 17 00:00:00 2001
+From: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
+Date: Sun, 27 Mar 2011 11:26:55 +0000
+Subject: [PATCH 8/8] Allow static linking in mingw-cross-env. Added 'iconv' and uses 'ws2_32' instead of 'winsock32' (#3213487).
 
+git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@585 5301114d-f842-0410-bbdd-996ee0417009
+(cherry picked from commit 22ca7dc23b6bbbc8cc6aedd569ec938ecae96e92)
 
 diff --git a/SConstruct b/SConstruct
 index fb01edf..6e8aba2 100644
--- a/src/winpcap.mk	Sun Mar 27 23:32:27 2011 +0200
+++ b/src/winpcap.mk	Sun Mar 27 23:36:16 2011 +0200
@@ -36,6 +36,7 @@
     $(SED) -i 's,(char\*)tUstr +=,tUstr +=,' '$(1)/wpcap/libpcap/inet.c'
     $(SED) -i 's,-DHAVE_AIRPCAP_API,,'    '$(1)/wpcap/PRJ/GNUmakefile'
     $(SED) -i 's,/common,/Common,'        '$(1)/wpcap/PRJ/GNUmakefile'
+    $(SED) -i 's,-mno-cygwin,,' '$(1)/wpcap/PRJ/GNUmakefile'
     echo -e 'libwpcap.a: $${OBJS}'     >> '$(1)/wpcap/PRJ/GNUmakefile'
     echo -e '\t$${AR} rc $$@ $${OBJS}' >> '$(1)/wpcap/PRJ/GNUmakefile'
     echo -e '\t$${RANLIB} $$@'         >> '$(1)/wpcap/PRJ/GNUmakefile'
--- a/src/x264.mk	Sun Mar 27 23:32:27 2011 +0200
+++ b/src/x264.mk	Sun Mar 27 23:36:16 2011 +0200
@@ -4,8 +4,8 @@
 # x264
 PKG             := x264
 $(PKG)_IGNORE   :=
-$(PKG)_VERSION  := 20110312-2245
-$(PKG)_CHECKSUM := 22b06e8b090da9b35dba688575e5a61ce0985f2e
+$(PKG)_VERSION  := 20110323-2245
+$(PKG)_CHECKSUM := c5921d53016382eeb7f2e873583eb3074e5eabc2
 $(PKG)_SUBDIR   := $(PKG)-snapshot-$($(PKG)_VERSION)
 $(PKG)_FILE     := $(PKG)-snapshot-$($(PKG)_VERSION).tar.bz2
 $(PKG)_WEBSITE  := http://www.videolan.org/developers/x264.html
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/xine-lib-2-fix-no-undefined.patch	Sun Mar 27 23:36:16 2011 +0200
@@ -0,0 +1,38 @@
+# This file is part of mingw-cross-env.
+# See doc/index.html for further information.
+
+This patch has been taken from:
+https://bugs.xine-project.org/show_bug.cgi?id=411
+
+diff --git a/configure.ac b/configure.ac
+index dc53a73..90f23a8 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -281,7 +281,6 @@ case "$host_os" in
+       GOOM_LIBS="-liberty"
+       LDFLAGS="-Wl,--enable-stdcall-fixup $LDFLAGS"
+     fi
+-    LDFLAGS="-no-undefined $LDFLAGS"
+     ;;
+ esac
+ AC_SUBST(GOOM_LIBS)
+@@ -2877,6 +2876,19 @@ mv -f libtool.tmp libtool
+ chmod +x libtool
+ 
+ dnl ---------------------------------------------
++dnl Libtool flag for Windows:
++dnl
++dnl The "-no-undefined" flag must be added after all other
++dnl configure checks, because it is only for libtool and
++dnl must not be passed to GCC by accident.
++dnl ---------------------------------------------
++case "$host_os" in
++  mingw* | cygwin*)
++    LDFLAGS="-no-undefined $LDFLAGS"
++    ;;
++esac
++
++dnl ---------------------------------------------
+ dnl Some infos:
+ dnl ---------------------------------------------
+ 
--- a/src/xine-lib.mk	Sun Mar 27 23:32:27 2011 +0200
+++ b/src/xine-lib.mk	Sun Mar 27 23:36:16 2011 +0200
@@ -20,6 +20,8 @@
 endef
 
 define $(PKG)_BUILD
+    # rebuild configure script as one of the patches modifies configure.ac
+    cd '$(1)' && ./autogen.sh
     cd '$(1)' && ./configure \
         --host='$(TARGET)' \
         --prefix='$(PREFIX)/$(TARGET)' \
--- a/src/xvidcore.mk	Sun Mar 27 23:32:27 2011 +0200
+++ b/src/xvidcore.mk	Sun Mar 27 23:36:16 2011 +0200
@@ -4,8 +4,8 @@
 # xvidcore
 PKG             := xvidcore
 $(PKG)_IGNORE   :=
-$(PKG)_VERSION  := 1.3.0
-$(PKG)_CHECKSUM := 2a5b505159245fad1d3d236dc855ca6949ead4c1
+$(PKG)_VERSION  := 1.3.1
+$(PKG)_CHECKSUM := 68c73b9a00dfb830083f619335eb876b0f845bec
 $(PKG)_SUBDIR   := xvidcore/build/generic
 $(PKG)_FILE     := xvidcore-$($(PKG)_VERSION).tar.gz
 $(PKG)_WEBSITE  := http://www.xvid.org/
@@ -21,6 +21,7 @@
 define $(PKG)_BUILD
     # wine confuses the cross-compiling detection, so set it explicitly
     $(SED) -i 's,cross_compiling=no,cross_compiling=yes,' '$(1)/configure'
+    $(SED) -i 's,-mno-cygwin,,' '$(1)/configure'
     cd '$(1)' && ./configure \
         --host='$(TARGET)' \
         --prefix='$(PREFIX)/$(TARGET)'