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   <[EMAIL PROTECTED]>   http://www.xbc.nu/brane/



Reply via email to