At 06:38 PM 10/4/2004, Justin Erenkrantz wrote:
I have some issues with the proposed patch in that it moves some configure logic that really belongs in apr-util over to httpd: i.e. configuration of apr-iconv should be done by apr-util not by httpd, httpd should only be aware of iconv via the apu-*-config scripts, etc. -- justin
100% agreed - if you look at the doxygen, these interfaces are private to apr-util, users aren't to count on apr-iconv itself.
I have now moved all the logic to apr-util. Find enclosed the new patch.
To get it working checkout apr-iconv in srclib and add "--with-iconv=`pwd`/srclib/apr-iconv".
More comments?
Bill
Index: srclib/apr-util/Makefile.in =================================================================== RCS file: /home/cvspublic/apr-util/Makefile.in,v retrieving revision 1.97 diff -u -r1.97 Makefile.in --- srclib/apr-util/Makefile.in 23 Aug 2004 20:22:18 -0000 1.97 +++ srclib/apr-util/Makefile.in 5 Oct 2004 08:40:12 -0000 @@ -15,8 +15,8 @@ APRUTIL_LIBS = @APRUTIL_LIBS@ TARGET_LIB = [EMAIL PROTECTED]@.la -INSTALL_SUBDIRS = @APR_XML_DIR@ -EXTRA_SOURCE_DIRS = @APR_XML_DIR@ +INSTALL_SUBDIRS = @APR_ICONV_DIR@ @APR_XML_DIR@ +EXTRA_SOURCE_DIRS = @APR_ICONV_DIR@ @APR_XML_DIR@ [EMAIL PROTECTED]@ APRUTIL_PCFILE = apr-util-$(APRUTIL_MAJOR_VERSION).pc APU_CONFIG = apu-$(APRUTIL_MAJOR_VERSION)-config Index: srclib/apr-util/buildconf =================================================================== RCS file: /home/cvspublic/apr-util/buildconf,v retrieving revision 1.13 diff -u -r1.13 buildconf --- srclib/apr-util/buildconf 1 Jul 2004 22:45:06 -0000 1.13 +++ srclib/apr-util/buildconf 5 Oct 2004 08:40:12 -0000 @@ -1,4 +1,20 @@ #!/bin/sh +# +# Copyright 1999-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. +# +# # Default place to look for apr source. Can be overridden with # --with-apr=[directory] @@ -63,6 +79,14 @@ # echo "Generating 'make' outputs ..." $apr_src_dir/build/gen-build.py make + +# +# If apr-iconv, then go and configure it. +# +if test -d ../apr-iconv; then + echo "Invoking ../apr-iconv/buildconf.sh ..." + (cd ../apr-iconv; ./buildconf) +fi # # If Expat has been bundled, then go and configure the thing Index: srclib/apr-util/configure.in =================================================================== RCS file: /home/cvspublic/apr-util/configure.in,v retrieving revision 1.79 diff -u -r1.79 configure.in --- srclib/apr-util/configure.in 2 Sep 2004 13:50:28 -0000 1.79 +++ srclib/apr-util/configure.in 5 Oct 2004 08:40:12 -0000 @@ -96,6 +96,21 @@ APR_ADDTO(CFLAGS, `$apr_config --cflags`) APR_ADDTO(CPPFLAGS, `$apr_config --cppflags`) +dnl +dnl Find the APR-ICONV directory. +dnl +if test -d ../apr-iconv; then + APR_SUBDIR_CONFIG(../apr-iconv, + [$apache_apr_flags --prefix=$prefix --exec-prefix=$exec_prefix --libdir=$libdir --includedir=$includedir --bindir=$bindir --datadir=$datadir --with-installbuilddir=$installbuilddir], + [--enable-layout=*|\'--enable-layout=*]) + APRUTIL_EXPORT_LIBS="$abs_srcdir/../apr-iconv/lib/libapriconv.la $APRUTIL_EXPORT_LIBS" + APRUTIL_INCLUDES="-I$abs_srcdir/../apr-iconv/include $APRUTIL_INCLUDES" + APR_ICONV_DIR=../apr-iconv +else + APR_ICONV_DIR="" +fi +AC_SUBST(APR_ICONV_DIR) + dnl Find LDAP library dnl Determine what DBM backend type to use. dnl Find Expat Index: srclib/apr-util/build/apu-iconv.m4 =================================================================== RCS file: /home/cvspublic/apr-util/build/apu-iconv.m4,v retrieving revision 1.5 diff -u -r1.5 apu-iconv.m4 --- srclib/apr-util/build/apu-iconv.m4 21 Jul 2002 11:09:12 -0000 1.5 +++ srclib/apr-util/build/apu-iconv.m4 5 Oct 2004 08:40:12 -0000 @@ -22,33 +22,44 @@ AC_DEFUN(APU_FIND_ICONV,[ apu_iconv_dir="unknown" +have_apr_iconv="0" AC_ARG_WITH(iconv,[ --with-iconv[=DIR] path to iconv installation], [ apu_iconv_dir="$withval" if test "$apu_iconv_dir" != "yes"; then APR_ADDTO(CPPFLAGS,[-I$apu_iconv_dir/include]) APR_ADDTO(LDFLAGS,[-L$apu_iconv_dir/lib]) fi + if test -f "$apu_iconv_dir/include/api_version.h"; then + have_apr_iconv="1" + have_iconv="0" + APR_REMOVEFROM(LIBS,[-lapriconv]) + AC_MSG_RESULT("Using apr-iconv") + fi ]) -AC_CHECK_HEADER(iconv.h, [ - APU_TRY_ICONV([ have_iconv="1" ], [ - - APR_ADDTO(LIBS,[-liconv]) - - APU_TRY_ICONV([ - APR_ADDTO(APRUTIL_LIBS,[-liconv]) - APR_ADDTO(APRUTIL_EXPORT_LIBS,[-liconv]) - have_iconv="1" ], - [ have_iconv="0" ]) +if test "$have_apr_iconv" != "1"; then + AC_CHECK_HEADER(iconv.h, [ + APU_TRY_ICONV([ have_iconv="1" ], [ + + APR_ADDTO(LIBS,[-liconv]) + + APU_TRY_ICONV([ + APR_ADDTO(APRUTIL_LIBS,[-liconv]) + APR_ADDTO(APRUTIL_EXPORT_LIBS,[-liconv]) + have_iconv="1" ], + [ have_iconv="0" ]) - APR_REMOVEFROM(LIBS,[-liconv]) + APR_REMOVEFROM(LIBS,[-liconv]) - ]) -], [ have_iconv="0" ]) + ]) + ], [ have_iconv="0" ]) +fi if test "$apu_iconv_dir" != "unknown"; then if test "$have_iconv" != "1"; then - AC_MSG_ERROR([iconv support requested, but not found]) + if test "$have_apr_iconv" != "1"; then + AC_MSG_ERROR([iconv support requested, but not found]) + fi fi APR_REMOVEFROM(CPPFLAGS,[-I$apu_iconv_dir/include]) APR_REMOVEFROM(LDFLAGS,[-L$apu_iconv_dir/lib]) @@ -65,6 +76,7 @@ APR_CHECK_DEFINE(CODESET, langinfo.h, [CODESET defined in langinfo.h]) AC_SUBST(have_iconv) +AC_SUBST(have_apr_iconv) ])dnl dnl Index: srclib/apr-util/include/apu.h.in =================================================================== RCS file: /home/cvspublic/apr-util/include/apu.h.in,v retrieving revision 1.20 diff -u -r1.20 apu.h.in --- srclib/apr-util/include/apu.h.in 26 Feb 2004 21:55:12 -0000 1.20 +++ srclib/apr-util/include/apu.h.in 5 Oct 2004 08:40:12 -0000 @@ -77,7 +77,7 @@ #define APU_HAVE_DB_VERSION @apu_db_version@ #endif /* APU_HAVE_DB */ -#define APU_HAVE_APR_ICONV 0 +#define APU_HAVE_APR_ICONV @have_apr_iconv@ #define APU_HAVE_ICONV @have_iconv@ #define APR_HAS_XLATE (APU_HAVE_APR_ICONV || APU_HAVE_ICONV)
