Allow Custom Locations of OpenAL-Soft in CMakeCache.txt
Moderator: GZDoom Developers
Allow Custom Locations of OpenAL-Soft in CMakeCache.txt
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.
- Graf Zahl
- 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
Can't you update it, then?Csonicgo wrote:The version of OpenAL-Soft on my distro is outdated,
- 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
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.
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.
Re: Allow Custom Locations of OpenAL-Soft in CMakeCache.txt
Ah, thanks. I knew there was some way to do it, I just forgot how.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.