diff options
author | jfclere <jfclere@13f79535-47bb-0310-9956-ffa450edef68> | 2004-10-07 08:16:45 +0000 |
---|---|---|
committer | jfclere <jfclere@13f79535-47bb-0310-9956-ffa450edef68> | 2004-10-07 08:16:45 +0000 |
commit | 44446e59aabf4e2ad2ac93c2fc167ed48eb9cca0 (patch) | |
tree | 44cee1f2d333b407f198cdd72b5cd178b92fa54b | |
parent | 8fe9a7d1079f2b243be1a702a06662346dd5717f (diff) | |
download | libapr-util-44446e59aabf4e2ad2ac93c2fc167ed48eb9cca0.tar.gz |
Allow to use apr-iconv.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr-util/trunk@59147 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | Makefile.in | 6 | ||||
-rw-r--r-- | build/apu-iconv.m4 | 36 | ||||
-rwxr-xr-x | buildconf | 24 | ||||
-rw-r--r-- | configure.in | 15 | ||||
-rw-r--r-- | include/apu.h.in | 2 |
5 files changed, 67 insertions, 16 deletions
diff --git a/Makefile.in b/Makefile.in index 2a0fdf36..a18d21fa 100644 --- a/Makefile.in +++ b/Makefile.in @@ -15,8 +15,8 @@ APRUTIL_LDFLAGS = @APRUTIL_LDFLAGS@ APRUTIL_LIBS = @APRUTIL_LIBS@ TARGET_LIB = lib@APRUTIL_LIBNAME@.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@ EXTRA_OS_LINK=@EXTRA_OS_LINK@ APRUTIL_PCFILE = apr-util-$(APRUTIL_MAJOR_VERSION).pc APU_CONFIG = apu-$(APRUTIL_MAJOR_VERSION)-config @@ -29,7 +29,7 @@ TARGETS = $(TARGET_LIB) aprutil.exp @INCLUDE_RULES@ @INCLUDE_OUTPUTS@ -CLEAN_SUBDIRS = test +CLEAN_SUBDIRS = test @APR_ICONV_DIR@ CLEAN_TARGETS = exports.c export_vars.c aprutil.exp .make.dirs apu-config.out DISTCLEAN_TARGETS = config.cache config.log config.status libtool \ diff --git a/build/apu-iconv.m4 b/build/apu-iconv.m4 index bd64b6c8..080278f8 100644 --- a/build/apu-iconv.m4 +++ b/build/apu-iconv.m4 @@ -22,33 +22,44 @@ dnl 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" ], [ +if test "$have_apr_iconv" != "1"; then + AC_CHECK_HEADER(iconv.h, [ + APU_TRY_ICONV([ have_iconv="1" ], [ - APR_ADDTO(LIBS,[-liconv]) + APR_ADDTO(LIBS,[-liconv]) - APU_TRY_ICONV([ - APR_ADDTO(APRUTIL_LIBS,[-liconv]) - APR_ADDTO(APRUTIL_EXPORT_LIBS,[-liconv]) - have_iconv="1" ], - [ have_iconv="0" ]) + 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_FLAG_FUNCS(nl_langinfo) APR_CHECK_DEFINE(CODESET, langinfo.h, [CODESET defined in langinfo.h]) AC_SUBST(have_iconv) +AC_SUBST(have_apr_iconv) ])dnl dnl @@ -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] @@ -65,6 +81,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 # if test -d xml/expat; then diff --git a/configure.in b/configure.in index 13868711..238dbd4e 100644 --- a/configure.in +++ b/configure.in @@ -96,6 +96,21 @@ APR_SETIFNULL(CPP, `$apr_config --cpp`) 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 diff --git a/include/apu.h.in b/include/apu.h.in index 09731b67..ac4001e4 100644 --- a/include/apu.h.in +++ b/include/apu.h.in @@ -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) |