Re: [xml] Using libiconv



On Mon,  2 July 20:06 xml thewrittenword com wrote:

I also think the patches address different problems.

I believe http://mail.gnome.org/archives/xml/2001-July/msg00002.html
is wrong for the following reasons (I have not tried it):
  1. Using AC_CHECK_LIB before AC_TRY_FUNC is just wrong. The
     fact that the library exists doesn't mean it should be used.

A very sweeping statement.  You are not allowing for the fact that
libiconv is something of a special case.

     Link with a library *only* if the function is not already
     found by linking with $LIBS (which AC_TRY_FUNC does).

and AC_TRY_FUNC just plain gets it wrong in the case of libiconv.

  2. If you have both libiconv in /usr/lib and /usr/local/lib
     and you wish the one in /usr/local/lib to win, set
     LDFLAGS="-L/usr/local/lib" before running configure.

I know this but this has nothing to do with the point.  You have
misunderstood the problem.  libiconv *replaces* the iconv.h from glibc.
The replacement iconv.h redefines the iconv_xxx functions to libiconv_xxx.  
Since AC_TRY_FUNC finds iconv in glibc but the compiler includes
the replacement iconv.h linking is guaranteed to fail.  But as you say,
you haven't tried it so you wouldn't know.

Personally I'd prefer a pragmatic approach to a philosophical one
on this one.

Brian Stafford




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]