After some more fiddling, I've come to these conclusions:

The code in the Linux version of XMLPlatformUtils::platformInit()
explicitly searches for the environment variable LD_LIBRARY_PATH, and
panics if it's not set. It then searches all the directories specified
in LD_LIBRARY_PATH, and panics if it can't find "libxerces-c1_0.so"
(that string is constructed dynamically from the current version of the
Xerces library). It then sets XMLPlatformUtils::fgLibLocation to the
location of the discovered .so library.

This behaviour seems a bit weird to me, because if my system can't find
the .so (either by LD_LIBRARY_PATH or having it in /lib or similar) it
won't even run my executable, so the code in platformInit() won't get
run either. I came across this because I wanted to put an executable
behind Apache and use it for CGI, and couldn't persuade it not to panic,
even though the .so was in /lib. A fix is to hack platformInit() so it
just creates its mutex and then returns.

I figure if I keep this hack and then create a static library, I should
be able to link against it and avoid having to distribute any separate
libraries.

Can anyone explain the rationale behind this behaviour, and comment on
whether I'm doing the right thing? If I am, should I go about creating a
patch to add a "static" option to the runConfigure script (or somewhere
else more appropriate) and submit it to the list?

Best regards,
Mike.

-- 
Mike Mason, Software Engineer
XML Script Development Team                    Office: 44-1865-203192
http://www.xmlscript.org/                      Mobile: 44-7050-288923

Reply via email to