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




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

Nathanael Noblet wrote:


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

Well, I could if I wanted to write my own makefile. All this stuff is set up by ./configure, but there doesn't appear to be a --with-static-binaries (or equivalent) flag. One of my goals is to use the package as distributed to build and install, then do what I need to do to make it usable in my situation. I don't want to maintain my own xmllint project, for example. (I know it's pretty simple in this case, but I have an identical problem with xsltproc, which has more complicated dependencies...)


You don't need to create your own makefiles. Set the flags before you call configure or make so for example:
LD_FLAGS=..... CFLAGS=... ./configure
and then
LD_FLAGS=.... CFLAGS=... make

Oh, sorry. Yes, that's true if it were a command line flag. However, the link line looks like this: gcc -g -O2 -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -o .libs/xmllint xmllint.o ./.libs/libxml2.dylib -lpthread -lm

and I need it to look like this:
gcc -g -O2 -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -o .libs/xmllint xmllint.o ./.libs/libxml2.a -lpthread -lm

I don't know of a way to change this with the environment variables.

I'm no expert in this area, that is for sure, but I'm pretty sure you can tell it during the configure stage what to do, using either configure flags or environment variables to use the static compilation, which would propagate to the makefile and change that for you. The exact method to do this, well I don't know it. I've seen places where I used configure and environment variables to affect these things. For example when compiling your program, after you've compiled libxml2.a you could do
LD_FLAGS=-L./path/to/parent/of./.libs/libxml2.a ./configure
or use ./configure --with-libxml2-dir=/path....

??

--
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]