You are not logged in.

#1 2004-08-08 23:27:12

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

/usr/include/libxml2/libxml ???

I'm trying to compile a little contrib package in postgresql and I found something strange.
The package requires libxml2 headers to compile. Default installation path for arch libxml2 package is under /usr/include/libxml2/libxml.
Application tries to include (for example) libxml/xpath.h and it fails to find the file. Of course I can change it to libxml2/libxml/xpath.h, but then in xpath.h there is "#include <libxml/xmlversion.h>" which (of course :-)) fails again.
I made a link /usr/include/libxml which points to /usr/include/libxml2/libxml and then I can compile the application without errors.

Now, I don't know much about libxml2 and I'm just not sure if the default config is ok or is it a bug?
Should the libxml2 package make a link mentioned above during installation or it needs recompiling with other options? Or....

Any ideas?

Offline

#2 2004-08-09 04:45:25

sarah31
Member
From: Middle of Canada
Registered: 2002-08-20
Posts: 2,975
Website

Re: /usr/include/libxml2/libxml ???

My guess is that the libxml2 path in the arch package is a generic result from the compiling process. Have you looked to see if libxml2 has any special patches or configuration options?

The only things I can think of is patching the source for the package you are trying to build to make tha paths conform to arch's libxml2 package or it may actually be looking for libxml v1.


AKA uknowme

I am not your friend

Offline

#3 2004-08-09 10:25:09

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

Re: /usr/include/libxml2/libxml ???

Patching the source package will not solve the problem. Only changing libxml2 package or making a symbolic link from /usr/lib/libxml to /usr/lib/libxml2/libxml (workaround) will work. And the package needs libxml2 not v1

Prerequisite:
pgxml_dom.c:
libxml2 (http://xmlsoft.org)

It compiles fine with a link. I think the problem is within libxml2 package but I'm not 100% sure since I couldn't find anybody complaining about these paths when making other packages which depend on libxml2 (or I just poorly searched).

I did take a look at libxml2 pkgbuild and sources. It's quite standard. No special options (I think). The library orignally has a directory /include/libxml and it gets installed in /usr/include/libxml2/libxml. And that's the problem. Some of the libxml2 header files are referencing to other libxml2 header files. For example xpath.h wants to include libxml/xmlerror.h that of course can't be found.
Now, there are several options:
1. Adding a link creation command to libxml2 package build function.
2. Forcing the installation directory for include files to /usr/lib/libxml (no other subdirs inside and forgetting about /usr/lib/lixml2)
3. Patching libxml2 header files (and maybe some other files too) to fully conform arch standards. This is the hardest way because it may require a lot of other things to be done for all dependent packages etc. This could also be done in two ways: change libxml/something.h to libxml2/libxml/something.h or (to make it perfect) libxml2/something.h
4. Other options that didn't come to my mind :-)

Did anybody else has problems with paths when building some package that depends on libxml2 ? I think I should report a bug for arch libxml2 package (or to libxml team if this is just error in makefiles etc, or both) but I'm trying to make sure I'm right before I do this.

Offline

#4 2004-08-09 15:33:30

sarah31
Member
From: Middle of Canada
Registered: 2002-08-20
Posts: 2,975
Website

Re: /usr/include/libxml2/libxml ???

well, do whatever you want but it i would say that unless the libxml2 package is patched or configured in some other way then the paths that exist for it are exactly the way they should be. Since i know of no other packages requiring libxml2 having troubles I again have to assume the source you are working with is following old libxml paths in their headers. I think it is silly to file a bug so that one package not existing in the trees cureently can compile properly when there are no other apparent problems linking to libxml2 with other packages.

have you checked all the README for the source you are compiling? Have you looked a configure options for it? i would check gentoo ebuilds and crux build files first then where ever from there.


AKA uknowme

I am not your friend

Offline

#5 2004-08-10 10:40:25

farphel
Forum Fellow
From: New Hampshire - USA
Registered: 2003-09-18
Posts: 250
Website

Re: /usr/include/libxml2/libxml ???

lanrat wrote:

Now, there are several options:
1. Adding a link creation command to libxml2 package build function.
2. Forcing the installation directory for include files to /usr/lib/libxml (no other subdirs inside and forgetting about /usr/lib/lixml2)
3. Patching libxml2 header files (and maybe some other files too) to fully conform arch standards. This is the hardest way because it may require a lot of other things to be done for all dependent packages etc. This could also be done in two ways: change libxml/something.h to libxml2/libxml/something.h or (to make it perfect) libxml2/something.h
4. Other options that didn't come to my mind :-)

Did you try adding a -I/usr/include/libxml2 to your Makefile?  That should correct your build problem with your postgresql app.

My guess (without doing any research) is that our version of libxml2 uses the /usr/include/libxml2 directory so that it can coexist with libxml1 (which probably lives in /usr/include/libxml by default).

HTH,
farphel


Follow the link below, sign up, and accept one promotional offer.  If I can get five suckers (err... friends) to do this, I'll get a free iPod.  Then you too can try to get a free iPod. Thanks! http://www.freeiPods.com/?r=11363142

Offline

#6 2004-08-10 17:11:08

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

Re: /usr/include/libxml2/libxml ???

@sarah31
I agree with you about bug report  - that's why I didn't do it in the first place. And about all your other suggestions: I really really always do all the things you mentioned and more (like browsing mailinglists, web, usenet, etc.). Pgxml is a small contrib package (adds xml functionality) from postgresql and it doesn't have a separate configure script. Farphel suggestion should fix all problems with pgxml and libxml2 include files without any additional patching.
Anyway, thank you for your response.

@farphel
Big thank you. I really should thought about it myself :-) I think this is the answer for pgxml.
Libxml2 package also has xml-config app which when run with xml2-config --cflags returns -I/usr/include/libxml2 - that's exactly what pgxml is missing, I think.
Since pgxml readme says it needs libxml v2 I guess pgxml author uses a distro which places libxml2 include files in usr/include/libxml or something like that.

Thank you all again. I'm sure it will also help others building packages which depend on libxml2.

EDIT: I've just found that for postgresql it is easier to add --with-includes=/usr/include/libxml2 to main configure script options and it will pass it down to all other makefiles for contrib apps (thanks to the excellent postgresql developers team).

Offline

Board footer

Powered by FluxBB