Allow Custom Locations of OpenAL-Soft in CMakeCache.txt

Moderator: GZDoom Developers

Post Reply
User avatar
Csonicgo
Posts: 1193
Joined: Thu Apr 15, 2004 3:28 pm
Location: Leeds

Allow Custom Locations of OpenAL-Soft in CMakeCache.txt

Post by Csonicgo »

Once upon a time, CMakeCache.txt had entries for OpenAL includes and libraries, which has disappeared relatively recently. The version of OpenAL-Soft on my distro is outdated, and I would like to link the git version to (g)zdoom. I mean, I can do this manually, but it's still a pain.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Allow Custom Locations of OpenAL-Soft in CMakeCache.txt

Post by Graf Zahl »

Csonicgo wrote:The version of OpenAL-Soft on my distro is outdated,
Can't you update it, then?
User avatar
Chris
Posts: 2940
Joined: Thu Jul 17, 2003 12:07 am
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Re: Allow Custom Locations of OpenAL-Soft in CMakeCache.txt

Post by Chris »

If you've built the Git version of OpenAL Soft, installing it with make install should be enough. GZDoom doesn't explicitly link against OpenAL at build time (unless dynamic loading is turned off), it gets loaded a runtime with dlopen("libopenal.so.1", ...) and will use whatever the system's search paths are for shared libraries. On (almost?) all Linux systems /usr/local/lib (where manually installed libraries go by default) is searched before /usr/lib (where libraries installed by the package manager go), and so should be picked up automatically.

Alternatively, you can set the LD_LIBRARY_PATH environment variable to where libopenal.so.1 is, and it will search there first. Or set LD_PRELOAD to /path/to/my/libopenal.so.1 which will make the system load the library first, making the later call to dlopen return the already-loaded instance.
User avatar
Csonicgo
Posts: 1193
Joined: Thu Apr 15, 2004 3:28 pm
Location: Leeds

Re: Allow Custom Locations of OpenAL-Soft in CMakeCache.txt

Post by Csonicgo »

Chris wrote:If you've built the Git version of OpenAL Soft, installing it with make install should be enough. GZDoom doesn't explicitly link against OpenAL at build time (unless dynamic loading is turned off), it gets loaded a runtime with dlopen("libopenal.so.1", ...) and will use whatever the system's search paths are for shared libraries. On (almost?) all Linux systems /usr/local/lib (where manually installed libraries go by default) is searched before /usr/lib (where libraries installed by the package manager go), and so should be picked up automatically.

Alternatively, you can set the LD_LIBRARY_PATH environment variable to where libopenal.so.1 is, and it will search there first. Or set LD_PRELOAD to /path/to/my/libopenal.so.1 which will make the system load the library first, making the later call to dlopen return the already-loaded instance.
Ah, thanks. I knew there was some way to do it, I just forgot how.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”