[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] link againt iconv on bsd

From: Branko Čibej <brane_at_xbc.nu>
Date: 2002-07-20 00:29:46 CEST

Justin Erenkrantz wrote:

>On Fri, Jul 19, 2002 at 03:28:04PM -0500, Ben Collins-Sussman wrote:
>
>
>>So this patch just adds -liconv to the main set of $APRUTIL_LIBS.
>>Don't ask me how many hours it took me to figure this out. >:-(
>>
>>Is there a better way to do this?
>>
>>Index: apu-iconv.m4
>>===================================================================
>>RCS file: /home/cvs/apr-util/build/apu-iconv.m4,v
>>retrieving revision 1.3
>>diff -u -r1.3 apu-iconv.m4
>>--- apu-iconv.m4 19 Jul 2002 17:08:40 -0000 1.3
>>+++ apu-iconv.m4 19 Jul 2002 20:27:49 -0000
>>@@ -19,7 +19,8 @@
>> fi
>> AC_SUBST(have_iconv)
>> APR_FLAG_HEADERS(iconv.h)
>>-
>>+APR_ADDTO(APRUTIL_EXPORT_LIBS,[-liconv])
>>+APR_ADDTO(APRUTIL_LIBS,[-liconv])
>>
>>
>
>The correct thing to do is to replace the AC_CHECK_LIB and
>AC_CHECK_FUNCS with:
>
>AC_CHECK_LIB(iconv, iconv, [
> APR_ADDTO(APRUTIL_EXPORT_LIBS,[-liconv])
> APR_ADDTO(APRUTIL_LIBS,[-liconv])
> have_iconv="1"
>], [
> AC_CHECK_FUNCS(iconv, [ have_iconv="1" ], [ have_iconv="0" ]
>])
>
>No need to check the funcs when we know we have a separate library.
>We might need to wrap all this with a AC_CHECK_HEADER to ensure we
>have an iconv.h, but I'm not 100% sure if all libc impls have an
>iconv.h.
>
>

Probably should check for the libc iconv first, and have_iconv must
always have a value; so tis would become:

AC_CHECK_FUNCS(iconv, [ have_iconv="1" ], [
  AC_CHECK_LIB(iconv, iconv, [
    APR_ADDTO(APRUTIL_EXPORT_LIBS,[-liconv])
    APR_ADDTO(APRUTIL_LIBS,[-liconv])
    have_iconv="1"
  ],
  [ have_iconv="0" ]
])

-- 
Brane Čibej   <brane_at_xbc.nu>   http://www.xbc.nu/brane/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Jul 20 00:30:17 2002

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.