[physfs] Packaging programs using PhysFS + ...

Edward Rudd eddie at omegaware.com
Thu May 15 18:18:47 EDT 2003

LGPL allows dynamic linked.. ie. Shared Libraries.. Not statically
linked in..
Loki was able to statically link in libraries into their games only
because they statically linked in libraries they owned/write that were
LGPL'd (ie openal)  which is actually very annoying as I can't replace
the openal library in certain games (fakk2).. But that's another issue..

The way most games do it on linux w/ distributing libraries is via
LD_LIBRARY_PATH and LD_PRELOAD. for example.. the latest NWN includes
precompiled SDL libraries they use..
export LD_LIBRARY_PATH=./lib:./miles:$LD_LIBRARY_PATH
./nwmain &@
This tells the ld linker to look for shared libraries in ./lib and
./miles FIRST before looking in the rest of the default LD_LIBRARY_PATH
variable (usually empty) and looking in the system paths

This is actually how most games I know that include their own pre
compiled shared libs do so..
either that or they use dlopen/dlsyms.

On Thu, 2003-05-15 at 15:19, Gaetan de Menten wrote:
> On Tue, 2003-05-13 at 19:07, Ryan C. Gordon wrote:
> > On 13 May 2003, Gaetan de Menten wrote:
> > 
> > > I'm using physfs in a game but since physfs is not that well-known, it
> > > seems like binary packages for it are not widespread. Even on the
> > > official page, the binaries are out of date. As I don't want my users
> > > to have to compile the library themselves, what should I do? "Copy"
> > > its source in my source tree (in a subdirectory) and statically link
> > > to it? or build those binary packages myself and distribute them "on
> > > the same page" as my game?
> > Currently, your best bet would be to include the physfs shared library
> > with your app and not concern yourself with what the user has installed.
> That's usual practice on windows anyway, but what about other OSes?
> Namely, how could I achieve that "cleanly" on Linux? Does it depend on
> the package system used?
> > I'm considering changing the license to something like the BSD license,
> > which would allow static linking.
> Isn't this already allowed with the LGPL? I thought I could do it as
> long as I provide a mean for the user to recompile my stuff wh any new
> version of the library. And as my game is a GPL one, that wouldn't be a
> problem.
> > > While I'm at it... I hope it'll be included in SDL2.0... Any hope for
> > > this?
> > 
> > No.
> Why not?
> > > One more thing:
> > > It would be nice (and easy to do) to have a function returning the
> > > number of files in a directory and another one to read a "text" line
> > > (read until a \n).
> > 
> > Untested code follows: 
> > [...]
> Thanks a lot for the trouble, but... Well... In fact... I didn't mean to
> say I needed to know how to do that. I already got my own version of
> those functions, but I just thought it would be a nice addition to the
> lib.
> Thanks for your answers,
> Gaetan.
Edward Rudd <eddie at omegaware.com>

More information about the physfs mailing list