Subject | Re: [firebird-support] Re: FB2.5 How does FBClient locate firebird.conf and firebird.msg |
---|---|
Author | Cosmin Apreutesei |
Post date | 2010-10-15T21:47:06Z |
> Having to set the environment variable "FIREBIRD" programatically to make fbclient.dll locate the correct files is simply horrible and the reason I am seeking specific documnetation on the algorithm used to determine which files to use.Why is setting FIREBIRD env. var horrible?
I think an API call is needed for this, something like init(root_dir)
on fbclient and fbembed. the root_dir set this way will be used to
find firebird.conf/msg but _also, and more importantly_ to load its
dependent dlls. The problem is that there's no easy and cross-platform
solution for the problem of loading dependent dlls.
For instance, to load a dll with dependencies from a certain
directory, in Windows you have SetDllDirectory(), but this is only
available since WinXP SP2 or something. In Unix you have to set
LD_LIBRARY_PATH environment variable, and you can't even set it on the
current process, you have to set it on a _parent_ process because
LD_LIBRARY_PATH is only read once when ldd.so is loaded at process
startup. Both fixes suck some way or another.
On the other side, to implement init(root_dir) the ICU library might
also need to be patched to load its own dependent dlls from an
arbitrary path (this scrapes the option of having a system-wide ICU
lib, which I think is a good thing anyway).
I wonder what the Firebird devs have to say about this, so I'm sending
this to the dev list too, hope they don't mind.