[Mapserver-users] dynamic libraries and LDPATH

Madere, Colin colin.madere at ieminc.com
Thu Feb 20 18:18:11 EST 2003


So I get an error trying to use Mapscript because when the .so is loaded by
PHP it can't find the libwwwxml.so.0 (turning error output on shows the
typical ld.so error when it can't find a library).  I've been through _tons_
of these issues and have made things work by setting LD_LIBRARY_PATH (yes, I
know this isn't the best solution but for my testing environment I was ok
with it).

This does not, however, work for things that don't get the shell or user
environment variables like CGIs or in this case a cgi that loads a library
that loads a library :)

So I found out that setting LDFLAGS = -R<location of libs> would instruct
the linker to link in the library paths so that runtime resolution wasn't
necessary.  Considering the likely situation this stuff is to be used, I
won't be changing where the libraries reside so this works for me.
Unfortunately the configure/Makefile setup for Mapserver appears to use this
variable only when checking compiler options for configuring and doesn't
actually include it (LDFLAGS) when it compiles and links the project
libraries and executables.

Looking at Makefile.in I see an LDFLAGS being set but it does not appear to
check (or I couldn't find it in configure or the Makefile.in) for an
environment LDFLAGS to add to this so any environment set LDFLAGS gets
ignored.

Editing the Makefile after running configure to include my "-R<lib dir>"
option in the LDFLAGS variable gets it in the linking commands and moves me
to the next library error because another .so (not in that dir) can be
found.  If I add that dir to the end prefixed with the separating :, the
error remains so I'm a bit stuck.  Someone who knows a lot about the build
process might check into the use of the environment LDFLAGS var in the
configure/build for when the actual build process is happening, rather than
just for the configure compiler checks...

It seems that LDFLAGS isn't being checked or used at all in the Mapscript
stuff (which is my current problem).. is that maintained solely by the
MapLab people?  Should I use that mailing list for compile/build issues with
Mapscript?

Fighting to get all this running,

Colin




More information about the mapserver-users mailing list