This commit was manufactured by cvs2svn to create tag
'STRIKER_2_0_51_RC1'.

git-svn-id: https://svn.apache.org/repos/asf/apr/apr-iconv/tags/STRIKER_2_0_51_RC1@57735 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/CHANGES b/CHANGES
index 2cd7f2d..6de7794 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,13 @@
+Changes with APR-ICONV 0.9.5
+
 Changes with APR-ICONV 0.9.4
 
+  *) Add -v option to iconv program. [Justin Erenkrantz]
+
+  *) Add api_version.h. [Justin Erenkrantz]
+
+  *) A fourth pass at a build system. [Justin Erenkrantz]
+
   *) A third pass at a build system. [Justin Erenkrantz]
 
 Changes with APR-ICONV 0.9.3
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..5677ddc
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,467 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+
+APACHE PORTABLE RUNTIME SUBCOMPONENTS: 
+
+The Apache Portable Runtime includes a number of subcomponents with
+separate copyright notices and license terms. Your use of the source
+code for the these subcomponents is subject to the terms and
+conditions of the following licenses. 
+
+For the include\apr_md5.h component: 
+/*
+ * This is work is derived from material Copyright RSA Data Security, Inc.
+ *
+ * The RSA copyright statement and Licence for that original material is
+ * included below. This is followed by the Apache copyright statement and
+ * licence for the modifications made to that material.
+ */
+
+/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
+   rights reserved.
+
+   License to copy and use this software is granted provided that it
+   is identified as the "RSA Data Security, Inc. MD5 Message-Digest
+   Algorithm" in all material mentioning or referencing this software
+   or this function.
+
+   License is also granted to make and use derivative works provided
+   that such works are identified as "derived from the RSA Data
+   Security, Inc. MD5 Message-Digest Algorithm" in all material
+   mentioning or referencing the derived work.
+
+   RSA Data Security, Inc. makes no representations concerning either
+   the merchantability of this software or the suitability of this
+   software for any particular purpose. It is provided "as is"
+   without express or implied warranty of any kind.
+
+   These notices must be retained in any copies of any part of this
+   documentation and/or software.
+ */
+
+For the passwd\apr_md5.c component:
+
+/*
+ * This is work is derived from material Copyright RSA Data Security, Inc.
+ *
+ * The RSA copyright statement and Licence for that original material is
+ * included below. This is followed by the Apache copyright statement and
+ * licence for the modifications made to that material.
+ */
+
+/* MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm
+ */
+
+/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
+   rights reserved.
+
+   License to copy and use this software is granted provided that it
+   is identified as the "RSA Data Security, Inc. MD5 Message-Digest
+   Algorithm" in all material mentioning or referencing this software
+   or this function.
+
+   License is also granted to make and use derivative works provided
+   that such works are identified as "derived from the RSA Data
+   Security, Inc. MD5 Message-Digest Algorithm" in all material
+   mentioning or referencing the derived work.
+
+   RSA Data Security, Inc. makes no representations concerning either
+   the merchantability of this software or the suitability of this
+   software for any particular purpose. It is provided "as is"
+   without express or implied warranty of any kind.
+
+   These notices must be retained in any copies of any part of this
+   documentation and/or software.
+ */
+/*
+ * The apr_md5_encode() routine uses much code obtained from the FreeBSD 3.0
+ * MD5 crypt() function, which is licenced as follows:
+ * ----------------------------------------------------------------------------
+ * "THE BEER-WARE LICENSE" (Revision 42):
+ * <phk@login.dknet.dk> wrote this file.  As long as you retain this notice you
+ * can do whatever you want with this stuff. If we meet some day, and you think
+ * this stuff is worth it, you can buy me a beer in return.  Poul-Henning Kamp
+ * ----------------------------------------------------------------------------
+ */
+
+For the crypto\apr_md4.c component:
+
+ * This is derived from material copyright RSA Data Security, Inc.
+ * Their notice is reproduced below in its entirety.
+ *
+ * Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
+ * rights reserved.
+ *
+ * License to copy and use this software is granted provided that it
+ * is identified as the "RSA Data Security, Inc. MD4 Message-Digest
+ * Algorithm" in all material mentioning or referencing this software
+ * or this function.
+ *
+ * License is also granted to make and use derivative works provided
+ * that such works are identified as "derived from the RSA Data
+ * Security, Inc. MD4 Message-Digest Algorithm" in all material
+ * mentioning or referencing the derived work.
+ *
+ * RSA Data Security, Inc. makes no representations concerning either
+ * the merchantability of this software or the suitability of this
+ * software for any particular purpose. It is provided "as is"
+ * without express or implied warranty of any kind.
+ *
+ * These notices must be retained in any copies of any part of this
+ * documentation and/or software.
+ */
+
+For the include\apr_md4.h component:
+
+ *
+ * This is derived from material copyright RSA Data Security, Inc.
+ * Their notice is reproduced below in its entirety.
+ *
+ * Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
+ * rights reserved.
+ *
+ * License to copy and use this software is granted provided that it
+ * is identified as the "RSA Data Security, Inc. MD4 Message-Digest
+ * Algorithm" in all material mentioning or referencing this software
+ * or this function.
+ *
+ * License is also granted to make and use derivative works provided
+ * that such works are identified as "derived from the RSA Data
+ * Security, Inc. MD4 Message-Digest Algorithm" in all material
+ * mentioning or referencing the derived work.
+ *
+ * RSA Data Security, Inc. makes no representations concerning either
+ * the merchantability of this software or the suitability of this
+ * software for any particular purpose. It is provided "as is"
+ * without express or implied warranty of any kind.
+ *
+ * These notices must be retained in any copies of any part of this
+ * documentation and/or software.
+ */
+
+
+For the test\testdbm.c component:
+
+/* ====================================================================
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Apache" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ * This file came from the SDBM package (written by oz@nexus.yorku.ca).
+ * That package was under public domain. This file has been ported to
+ * APR, updated to ANSI C and other, newer idioms, and added to the Apache
+ * codebase under the above copyright and license.
+ */
+
+
+For the test\testmd4.c component:
+
+ *
+ * This is derived from material copyright RSA Data Security, Inc.
+ * Their notice is reproduced below in its entirety.
+ *
+ * Copyright (C) 1990-2, RSA Data Security, Inc. Created 1990. All
+ * rights reserved.
+ *
+ * RSA Data Security, Inc. makes no representations concerning either
+ * the merchantability of this software or the suitability of this
+ * software for any particular purpose. It is provided "as is"
+ * without express or implied warranty of any kind.
+ *
+ * These notices must be retained in any copies of any part of this
+ * documentation and/or software.
+ */
+
+For the xml\expat\conftools\install-sh component:
+
+#
+# install - install a program, script, or datafile
+# This comes from X11R5 (mit/util/scripts/install.sh).
+#
+# Copyright 1991 by the Massachusetts Institute of Technology
+#
+# Permission to use, copy, modify, distribute, and sell this software and its
+# documentation for any purpose is hereby granted without fee, provided that
+# the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of M.I.T. not be used in advertising or
+# publicity pertaining to distribution of the software without specific,
+# written prior permission.  M.I.T. makes no representations about the
+# suitability of this software for any purpose.  It is provided "as is"
+# without express or implied warranty.
+#
+
+For the expat xml parser component:
+
+Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
+                               and Clark Cooper
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+	
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+	
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+====================================================================
diff --git a/Makefile.in b/Makefile.in
index bedbd50..914bce0 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,20 +1,19 @@
 #
 # Top-level Makefile for APRICONV
 #
-abs_srcdir=@abs_srcdir@
-abs_builddir=@abs_builddir@
+abs_srcdir=@api_srcdir@
+abs_builddir=@api_builddir@
 VPATH = @srcdir@
 
 # bring in rules.mk for standard functionality
 @INCLUDE_RULES@
 
-SUBDIRS = lib ccs ces
-CLEAN_SUBDIRS = . lib ccs ces
+SUBDIRS = lib ccs ces util
+CLEAN_SUBDIRS = . lib ccs ces util
 
-TARGET_LIB = lib/libapriconv.la
+TARGET_LIB = libapriconv.la
 
-CLEAN_TARGETS = $(TARGET_EXPORTS)
-DISTCLEAN_TARGETS = config.cache config.log config.status export_vars.sh
+DISTCLEAN_TARGETS = config.cache config.log config.status
 EXTRACLEAN_TARGETS = configure libtool aclocal.m4
 
 ### install location
@@ -26,26 +25,17 @@
 
 MKINSTALLDIRS=$(abs_srcdir)/build/mkdir.sh
 
-delete-lib:
-	@if test -f $(TARGET_LIB); then \
-	    objects="`find $(SUBDIRS) -name '*.lo' -a -newer $(TARGET_LIB)`" ; \
-	    if test -n "$$objects"; then \
-		echo Found newer objects. Will relink $(TARGET_LIB). ; \
-		echo $(RM) -f $(TARGET_LIB) ; \
-		$(RM) -f $(TARGET_LIB) ; \
-	    fi \
-	fi
-
-install: $(TARGET_LIB)
+install:
 	if [ ! -d $(includedir) ]; then \
 	    $(MKINSTALLDIRS) $(includedir); \
 	fi; \
+	cp -p $(abs_srcdir)/include/*.h $(includedir); \
 	cp -p $(abs_srcdir)/lib/*.h $(includedir); \
 	cp -p $(abs_builddir)/lib/*.h $(includedir); \
 	if [ ! -d $(lib_prefix) ]; then \
 	    $(MKINSTALLDIRS) $(lib_prefix); \
-	fi; \
-	$(LIBTOOL) --mode=install cp $(TARGET_LIB) $(lib_prefix)
+	fi;
+	(cd lib; $(LIBTOOL) --mode=install cp $(TARGET_LIB) $(lib_prefix))
 	if [ ! -d $(libdir) ]; then \
 	    $(MKINSTALLDIRS) $(libdir); \
 	fi; \
@@ -54,23 +44,10 @@
 	if [ ! -d $(exec_prefix) ]; then \
 	    $(MKINSTALLDIRS) $(exec_prefix); \
 	fi; \
-	(cd util/.libs; $(LIBTOOL) --mode=install cp iconv $(exec_prefix))
-
-delete-exports:
-	@if test -f $(TARGET_EXPORTS); then \
-	    headers="`find lib/*.h -newer $(TARGET_EXPORTS)`" ; \
-	    if test -n "$$headers"; then \
-		echo Found newer headers. Will rebuild $(TARGET_EXPORTS). ; \
-		echo $(RM) -f $(TARGET_EXPORTS) ; \
-		$(RM) -f $(TARGET_EXPORTS) ; \
-	    fi \
-	fi
-
-$(TARGET_EXPORTS):
-	$(AWK) -f @APR_SOURCE_DIR@/build/make_export.awk lib/*.h > $@ ;
+	(cd util; $(LIBTOOL) --mode=install cp iconv $(exec_prefix))
 
 docs:
 	mkdir ./docs
-	perl @APR_SOURCE_DIR@/build/scandoc.pl -i./build/default.pl -p./docs/ ./lib/*.h
+	perl $(abs_srcdir)/build/scandoc.pl -i./build/default.pl -p./docs/ ./lib/*.h
 
-.PHONY: delete-lib delete-exports
+.PHONY: delete-lib
diff --git a/NOTICE b/NOTICE
new file mode 100644
index 0000000..9ccc9d7
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,11 @@
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+
+Portions of this software were developed at the National Center
+for Supercomputing Applications (NCSA) at the University of
+Illinois at Urbana-Champaign.
+
+This software contains code derived from the RSA Data Security
+Inc. MD5 Message-Digest Algorithm, including various
+modifications by Spyglass Inc., Carnegie Mellon University, and
+Bell Communications Research, Inc (Bellcore).
diff --git a/build/.cvsignore b/build/.cvsignore
index b24a5b8..e6644cb 100644
--- a/build/.cvsignore
+++ b/build/.cvsignore
@@ -4,3 +4,5 @@
 find_apr.m4
 install.sh
 mkdir.sh
+make_exports.awk
+make_var_export.awk
diff --git a/build/BaseAddr.ref b/build/BaseAddr.ref
index 95281cd..7bf724a 100644
--- a/build/BaseAddr.ref
+++ b/build/BaseAddr.ref
@@ -223,3 +223,5 @@
 windows-1256.so      0x6e020000 0x00010000
 windows-1257.so      0x6e010000 0x00010000
 windows-1258.so      0x6e000000 0x00010000
+osd_ebcdic_df04_1.so  0x6dff0000 0x00010000
+osd_ebcdic_df04_15.so 0x6dfe0000 0x00010000
diff --git a/buildconf b/buildconf
index a0d8192..7576694 100755
--- a/buildconf
+++ b/buildconf
@@ -35,10 +35,13 @@
 
 # Remove some files, then copy them from apr source tree
 rm -f build/apr_common.m4 build/find_apr.m4 build/install.sh \
-      build/config.guess build/config.sub build/mkdir.sh
+      build/config.guess build/config.sub build/mkdir.sh \
+      build/make_exports.awk build/make_var_export.awk
 cp $apr_src_dir/build/apr_common.m4 $apr_src_dir/build/find_apr.m4 \
    $apr_src_dir/build/install.sh $apr_src_dir/build/config.guess  \
-   $apr_src_dir/build/config.sub $apr_src_dir/build/mkdir.sh build
+   $apr_src_dir/build/config.sub $apr_src_dir/build/mkdir.sh \
+   $apr_src_dir/build/make_exports.awk $apr_src_dir/build/make_var_export.awk \
+   build
 
 # Remove aclocal.m4 as it'll break some builds...
 rm -rf aclocal.m4 autom4te*.cache
diff --git a/configure.in b/configure.in
index bb036c9..8ea166b 100644
--- a/configure.in
+++ b/configure.in
@@ -17,15 +17,13 @@
 AC_PROG_AWK
 
 dnl compute the top directory of the build
-abs_srcdir=`(cd $srcdir && pwd)`
-abs_builddir=`pwd`
-top_builddir="$abs_builddir"
+# Absolute source/build directory
+api_srcdir=`(cd $srcdir && pwd)`
+api_builddir=`pwd`
+AC_SUBST(api_srcdir)
+AC_SUBST(api_builddir)
 
-AC_SUBST(abs_srcdir)
-AC_SUBST(abs_builddir)
-AC_SUBST(top_builddir)
-
-if test "$abs_builddir" != "$abs_srcdir"; then
+if test "$api_builddir" != "$api_srcdir"; then
   USE_VPATH=1
 fi
 
@@ -33,17 +31,17 @@
 API_FIND_APR
 
 dnl copy apr's rules.mk into our build directory.
-if test ! -d $abs_builddir/build ; then
-  mkdir $abs_builddir/build
+if test ! -d $api_builddir/build ; then
+  mkdir $api_builddir/build
 fi
-cp $APR_BUILD_DIR/apr_rules.mk $abs_builddir/build/rules.mk
+cp $APR_BUILD_DIR/apr_rules.mk $api_builddir/build/rules.mk
 
 dnl
 dnl set up the compilation flags and stuff
 dnl
-API_INCLUDES="-I$abs_builddir/lib -I$abs_builddir/include"
+API_INCLUDES="-I$api_builddir/lib -I$api_builddir/include"
 if test -n "$USE_VPATH"; then
-  API_INCLUDES="$API_INCLUDES -I$abs_srcdir/lib -I$abs_srcdir/include"
+  API_INCLUDES="$API_INCLUDES -I$api_srcdir/lib -I$api_srcdir/include"
 fi
 
 AC_SUBST(API_INCLUDES)
@@ -61,10 +59,10 @@
 dnl
 case "$host_alias" in
 *bsdi*)
-    INCLUDE_RULES=".include \"$abs_builddir/build/rules.mk\""
+    INCLUDE_RULES=".include \"$api_builddir/build/rules.mk\""
     ;;
 *)
-    INCLUDE_RULES="include $abs_builddir/build/rules.mk"
+    INCLUDE_RULES="include $api_builddir/build/rules.mk"
     ;;
 esac
 AC_SUBST(INCLUDE_RULES)
diff --git a/include/api_version.h b/include/api_version.h
new file mode 100644
index 0000000..3c7b26d
--- /dev/null
+++ b/include/api_version.h
@@ -0,0 +1,105 @@
+/* Copyright 2000-2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef API_VERSION_H
+#define API_VERSION_H
+
+#include "apr.h"
+#include "apr_version.h"
+
+#include "apr_iconv.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @file api_version.h
+ * @brief 
+ * 
+ * APR-iconv's Version
+ *
+ * There are several different mechanisms for accessing the version. There
+ * is a string form, and a set of numbers; in addition, there are constants
+ * which can be compiled into your application, and you can query the library
+ * being used for its actual version.
+ *
+ * Note that it is possible for an application to detect that it has been
+ * compiled against a different version of API by use of the compile-time
+ * constants and the use of the run-time query function.
+ *
+ * API version numbering follows the guidelines specified in:
+ *
+ *     http://apr.apache.org/versioning.html
+ */
+
+/* The numeric compile-time version constants. These constants are the
+ * authoritative version numbers for API. 
+ */
+
+/** major version 
+ * Major API changes that could cause compatibility problems for older
+ * programs such as structure size changes.  No binary compatibility is
+ * possible across a change in the major version.
+ */
+#define API_MAJOR_VERSION       0
+
+/** 
+ * Minor API changes that do not cause binary compatibility problems.
+ * Should be reset to 0 when upgrading API_MAJOR_VERSION
+ */
+#define API_MINOR_VERSION       9
+
+/** patch level */
+#define API_PATCH_VERSION       5
+
+/** 
+ *  This symbol is defined for internal, "development" copies of API. This
+ *  symbol will be #undef'd for releases. 
+ */
+#define API_IS_DEV_VERSION
+
+
+/** The formatted string of API's version */
+#define API_VERSION_STRING \
+     APR_STRINGIFY(API_MAJOR_VERSION) "." \
+     APR_STRINGIFY(API_MINOR_VERSION) "." \
+     APR_STRINGIFY(API_PATCH_VERSION) \
+     API_IS_DEV_STRING
+
+/**
+ * Return APR-util's version information information in a numeric form.
+ *
+ *  @param pvsn Pointer to a version structure for returning the version
+ *              information.
+ */
+API_DECLARE(void) api_version(apr_version_t *pvsn);
+
+/** Return API's version information as a string. */
+API_DECLARE(const char *) api_version_string(void);
+
+
+/** Internal: string form of the "is dev" flag */
+#ifdef API_IS_DEV_VERSION
+#define API_IS_DEV_STRING "-dev"
+#else
+#define API_IS_DEV_STRING ""
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* API_VERSION_H */
diff --git a/lib/.cvsignore b/lib/.cvsignore
index e4614ad..eeebabc 100644
--- a/lib/.cvsignore
+++ b/lib/.cvsignore
@@ -3,5 +3,6 @@
 *.lo
 *.slo
 apriconv.exports
+exports.c
 apr_iconv_private.h.in
 apr_iconv_private.h
diff --git a/lib/Makefile.in b/lib/Makefile.in
index 0e0ba56..f92b4a8 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -1,14 +1,26 @@
 # Generated automatically from Makefile.in by configure.
+abs_srcdir=@api_srcdir@
+abs_builddir=@api_builddir@
 VPATH = @srcdir@
 
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+
 INCLUDES = @API_INCLUDES@ @APR_INCLUDES@
 
 TARGET_LIB = libapriconv.la
 SUBDIRS = .
 
+EXPORT_FILES = $(abs_srcdir)/include/*.h $(abs_srcdir)/lib/*.h
+TARGET_EXPORTS = apriconv.exports
+
+CLEAN_TARGETS = exports.c
+
 # May need to do something for apriconv.exports
 TARGETS = iconv_module.lo iconv.lo iconv_int.lo iconv_uc.lo \
-	iconv_ces.lo iconv_ces_euc.lo iconv_ces_iso2022.lo $(TARGET_LIB)
+	iconv_ces.lo iconv_ces_euc.lo iconv_ces_iso2022.lo api_version.lo \
+	exports.lo $(TARGET_LIB)
 
 #OBJECTS=
 
@@ -20,3 +32,16 @@
 	tmpcmd="$(LINK) @APR_LIB_TARGET@"; \
 	echo $$tmpcmd; \
 	$$tmpcmd && touch $@
+
+exports.c:
+	$(AWK) -f $(abs_srcdir)/build/make_exports.awk $(EXPORT_FILES) > $@
+
+export_vars.h:
+	$(AWK) -f $(abs_srcdir)/build/make_var_export.awk $(EXPORT_FILES) > $@
+
+$(TARGET_EXPORTS): exports.c export_vars.h
+	@echo "#! lib@APR_LIBNAME@.so" > $@
+	@echo "* This file was AUTOGENERATED at build time." >> $@
+	@echo "* Please do not edit by hand." >> $@
+	$(CPP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) exports.c | grep "ap_hack_" | sed -e 's/^.*[)]\(.*\);$$/\1/' >> $@
+	$(CPP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) export_vars.h | sed -e 's/^\#[^!]*//' | sed -e '/^$$/d' >> $@
diff --git a/lib/api_version.c b/lib/api_version.c
new file mode 100644
index 0000000..5b90924
--- /dev/null
+++ b/lib/api_version.c
@@ -0,0 +1,36 @@
+/* Copyright 2000-2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "apr_general.h" /* for APR_STRINGIFY */
+
+#include "apr_iconv.h"
+#include "api_version.h"
+
+API_DECLARE(void) api_version(apr_version_t *pvsn)
+{
+    pvsn->major = API_MAJOR_VERSION;
+    pvsn->minor = API_MINOR_VERSION;
+    pvsn->patch = API_PATCH_VERSION;
+#ifdef API_IS_DEV_VERSION
+    pvsn->is_dev = 1;
+#else
+    pvsn->is_dev = 0;
+#endif
+}
+
+API_DECLARE(const char *) api_version_string(void)
+{
+    return API_VERSION_STRING;
+}
diff --git a/util/iconv.c b/util/iconv.c
index 2703dc7..82f654e 100644
--- a/util/iconv.c
+++ b/util/iconv.c
@@ -31,6 +31,9 @@
  */
 
 #include "apr.h"
+#include "apr_getopt.h"
+
+#include "api_version.h"
 
 #include <stdarg.h>	/* va_end, va_list, va_start */
 #include <stdio.h>	/* FILE, fclose, ferror, fopen, fread, stdin,
@@ -79,31 +82,55 @@
 }
 
 int
-main(int argc, char * const *argv)
+main(int argc, const char **argv)
 {
 	apr_iconv_t cd;
 	iconv_stream *is;
-	char *from = NULL, *to = NULL, *input = NULL;
-	int opt;
+	const char *from = NULL, *to = NULL, *input = NULL;
+	char opt;
 	apr_pool_t *ctx; 
 	apr_status_t status;
+    apr_getopt_t *options;
+    const char *opt_arg;
 
-	while ((opt = getopt(argc, argv, "f:s:t:")) > 0) {
-		switch (opt) {
-		    case 'f':
-			from = optarg;
-			break;
-		    case 't':
-			to = optarg;
-			break;
-		    case 's':
-			input = optarg;
-			break;
-		    default:
-			fprintf(stderr, "Usage: iconv -f <name> -t <name> [-s <input>]\n");
-			exit(3);
-		}
-	}
+    /* Initialize APR */
+    apr_initialize();
+    atexit(closeapr);
+    if (apr_pool_create(&ctx, NULL) != APR_SUCCESS) {
+        fprintf(stderr, "Couldn't allocate context.\n");
+        exit(-1);
+    }
+
+    apr_getopt_init(&options, ctx, argc, argv);
+
+    status = apr_getopt(options, "f:s:t:v", &opt, &opt_arg);
+
+    while (status == APR_SUCCESS) {
+        switch (opt) {
+        case 'f':
+            from = opt_arg;
+            break;
+        case 't':
+            to = opt_arg;
+            break;
+        case 's':
+            input = opt_arg;
+            break;
+        case 'v':
+            fprintf(stderr, "APR-iconv version " API_VERSION_STRING "\n");
+            exit(0);
+        default:
+            fprintf(stderr, "Usage: iconv -f <name> -t <name> [-s <input>]\n");
+            exit(3);
+        }
+
+        status = apr_getopt(options, "f:s:t:v",&opt, &opt_arg);
+    }
+
+    if (status == APR_BADCH || status == APR_BADARG) {
+        fprintf(stderr, "Usage: iconv -f <name> -t <name> [-s <input>]\n");
+        exit(3);
+    }
 	if (from == NULL) {
 		fprintf(stderr, "missing source charset (-f <name>)\n");
 		exit(4);
@@ -113,14 +140,6 @@
 		exit(5);
 	}
 
-	/* Initialize APR */
-	apr_initialize();
-	atexit(closeapr);
-	if (apr_pool_create(&ctx, NULL) != APR_SUCCESS) {
-		fprintf(stderr, "Couldn't allocate context.\n");
-		exit(-1);
-	}
-
 	/* Use it */
 	status = apr_iconv_open(to, from, ctx, &cd);
 	if (status) {