Re: [xml] libxml2 fails to compile on gentoo - please help!



Jacob said:
Hi,

I am trying to compile libxml2-2.6.4 on Gentoo Linux using portage
as
part of a gnome install. I am unable to compile as I receive the
error(s) below. I've also tried versions 2.5.8, and 2.6.3 of
libxml2.
I'm not a developer and don't understand much of what this all
means.

I've looked on the FAQ, and searched the archives for this list. The
only thing I found was somebody had this problem over a year ago on
a
sun box, but I didn't see any resolution posted. I'm hopping
somebody
here can help me out. I've attached the full output of emerge
libxml2.

I'd really appreciate any advice. Thanks in advance,

Jake

Last 20 lines of terminal output:
source='nanohttp.c' object='nanohttp.lo' libtool=yes \

   <snip>

 gcc -DHAVE_CONFIG_H -I. -I. -I. -I./include -I./include
-D_REENTRANT
-march=athlon-tbird -03 -pipe -Wall -c nanohttp.c -MT nanohttp.lo
-MD
-MP -MF .deps/nanohttp.TPlo  -DPIC
gcc: unrecognized option `-03'

First problem - in your /etc/make.conf you have set CFLAGS to
include the option "-03" (that's zero-three) instead of "-O3"
(that's oh-three).  I assume you made that mistake early on, so it
is likely that *all* of the software on your system is compiled
*without* optimization.

nanohttp.c: In function `xmlNanoHTTPConnectAttempt':
nanohttp.c:973: `len' undeclared (first use in this function)
nanohttp.c:973: (Each undeclared identifier is reported only once
nanohttp.c:973: for each function it appears in.)

   <snip>

Here is the snipit of code from nanohttp.c:
    if ( FD_ISSET(s, &wfd) ) {
        SOCKLEN_T len;               <-- line 973

So, the error you are getting is because the macro SOCKLEN_T is not
defined.  That much is certain.  Unfortunately, from this point on
I'm afraid the underlying problem is something to do with other
software on *your* system (on the multiple Gentoo systems I work on,
as well as on many thousands of other Gentoo users, this compiles
without problem).

When libxml2 is configured, the configure script tries to determine
where socklen_t is defined (within /usr/include), and sets the
#define'd variable SOCKLEN_T appropriately.  Apparently, on your
system this check failed.  If you capture the logfile during the
emerge (e.g. "emerge -u libxml2 > logfile 2>&1") you should see
something like this during the configuration phase:

checking for gethostent... yes
checking for setsockopt... yes
checking for connect... yes
checking for type of socket length (socklen_t)... socklen_t *
checking whether to enable IPv6... yes
checking for getaddrinfo... yes
checking for isnan... yes

(but I suspect your system produced an error message at about this
point).  To go one step further, after the emerge fails, you can go
to the directory /var/tmp/portage/libxml2-2.6.4/work/libxml2-2.6.4/
and look at the file config.log - that should have something like

configure:24499: checking for type of socket length (socklen_t)
configure:24519: gcc -c -g -O2  conftest.c >&5
configure:24516: result: socklen_t *
configure:24585: checking whether to enable IPv6
configure:24622: gcc -c -g -O2  conftest.c >&5
configure:24625: $? = 0
configure:24628: test -s conftest.o
configure:24631: $? = 0
configure:24642: result: yes

but, again, I assume your system reported a problem at this point.

HTH - if you still can't figure out where things went wrong, email
the two logs (the "logfile" created during the emerge, and the
config.log) to me directly and I'll try to make a better guess.

Regards,

Bill



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