|
[A4, Linux] Bundling A4's audio .so files with game |
SimonN
Member #8,272
January 2007
|
Hi, I want to bundle the shared objects of Allegro 4.2 or 4.4 with a game, so people don't have to install the lib to their system first. (Static linking doesn't solve the problem, see last paragraph.) I made fine progress with liballeg-4.2.2.so respective its symlink liballeg.so.4.2. I put those in ./bin/lib, with . being the game's root directory, and linked like so: The game finds the lib at runtime, plays normally, but sound will not work. Apparently, I also need the shared objects usually installed in /usr/lib/allegro/4.2.2, i.e. things like alleg-alsadigi.so, alleg-dga2.so, ..., modules.lst. I had no luck whatsoever with putting them in subdirectories of the game. Neither ./bin/lib/allegro/4.2.2 seemed to work, nor ./bin/lib, nor anything else. ldd gameexecutable won't even display a need for these libs, unlike for the main A4 lib. Apparently Allegro does some magic in locating them, or just assumes a normal installation. This also sheds light on (but not solves) this: If you build the static version of Allegro 4, link (statically) against it, and don't install any Allegro-related files into the system, sound will not work. Old topic with this issue: http://www.allegro.cc/forums/thread/608589 -- Simon |
Arthur Kalliokoski
Second in Command
February 2005
|
I just checked my system, and there are no static libraries for ALSA. They all watch too much MSNBC... they get ideas. |
SimonN
Member #8,272
January 2007
|
Same here, building the static liballeg.a will still make shared objects for ALSA etc. The problem is how to place these shared objects in the game's tree. -- Simon |
Arthur Kalliokoski
Second in Command
February 2005
|
You might be able to do it if you recompile ALSA for a static library, but Quote: Due to bug in libtool script it is no longer possible to build shared and static libraries together. http://www.linuxfromscratch.org/blfs/view/svn/multimedia/alsa-lib.html That's more work than I want to mess with. They all watch too much MSNBC... they get ideas. |
Peter Wang
Member #23
April 2000
|
Set the ALLEGRO_MODULES environment variable in a shell script then launch your executable.
|
SimonN
Member #8,272
January 2007
|
Peter Wang: Perfect, thanks! This did it. I read your A4 source (src/unix/umodules.c) to get the exact details right. For other people who might want to do this: 1. Do everything I wrote in the original post. (Linking statically didn't work for some reason with steps 2 + 3 here.) #!/bin/sh if [ ! -e bin/gameexecutable ]; then echo "This script should be run from the game's root dir." exit fi export ALLEGRO_MODULES=bin/lib/allegro bin/gameexecutable Basically, make sure you point ALLEGRO_MODULES to the exact relative directory in which modules.lst resides. -- Simon |
|