Re: [xml] Mac OS-X: Why are binaries linked against libxml2.dylib?




On Jun 3, 2005, at 10:17 AM, Rush Manbert wrote:

Hello,

I have built the 2.6.19 version of thew library and installed it in a non-standard location. I need to do this because I'm building an application that uses this library version, and I can't use whatever happens to be installed with the OS on my customer's machines. I want to keep my OS installation as it was (2.6.16) but link statically against the library version of my choice (2.6.19).

Because of the way I did this, I discovered that xmllint has been linked against libxml2.dylib. I see that the library contains a string that specifies the path where it will be installed (i.e. prefix/lib/libxml2.dylib). When xmllint gets linked against the library, xmllint ends up containing the same path string. As long as I go ahead and run the make install, I can run the xmllint that the build created and it will find the dylib.

My problem is that I'm using the make install locations as a staging area, then moving files to their final locations in my development tree. Needless to say, this makes it so that I no longer link against 2.6.19, but it tries the other default paths and finds 2.6.16 in /usr/lib.

I have two questions:
1) Is there some way to force the binary utilities to be linked statically against libxml2.a? The configure help doesn't mention anything, but the Windows version does this. I have also done it by hand by capturing the make output, copying the link line, and changing libxml2.dylib to libxml2.a. It works just fine and the resulting xmllint always tells me 2.6.19.

2) Doesn't linking statically to libxml2 make more sense than linking dynamically? You downloaded a specific package, so I would assume that you would want to use it. I certainly do.

Can't you use the appropriate LD flags during various build stages to set where the compiler & link look for particular libraries and thus make it find the right ones at the right time?
--
Nathanael D. Noblet
Gnat Solutions
204 - 131 Gorge Road E
Victoria, BC V9A 1L1

T 250.385.4613
C 250.893.4613
http://www.gnat.ca/




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