Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Cross-Platform Development => Topic started by: rsaxvc on November 24, 2013, 06:49:36 pm
-
configure's OpenAL test fails on OpenBSD due to not linking in libpthread. The attached patch just adds -lpthread to the OpenAL test. It doesn't currently not limit itself to OpenBSD, but I don't think it'll hurt any other unix-based systems to have it on there.
[attachment deleted by an evil time traveler]
-
Perhaps this is an OpenAL problem? Should libopenal be specifying that it needs libpthreads? Is there a way to do that?
-
hmm... I think we'll need to update configure.ac rather than the acinclude.m4? Although I'm not 100% sure why the following statement isn't working for OpenBSD, when it seems so be working for FreeBSD...
dnl Posix Threads
AC_SEARCH_LIBS([pthread_mutex_timedlock], [pthread])
FS2_LIBS=$FS2_LIBS" -lpthread"
-
so, fs2 builds fine once the configure check passes(-lpthreads applied correctly). My patch only adds '-lpthreads' to the OpenAL test case. Should the OpenAL test case be affected by FS2_LIBS? The OpenAL test case also uses $LIBS, but I'm not sure where that comes from.
-
I have OpenAL Soft installed on my FreeBSD environment, but apparently they also provide openal-20060211_12 in the ports system, which I don't have installed. If this is the newest OpenBSD, the only OpenAL package I'm seeing is openal-1.15.1v0, which should be OpenAL Soft. So I'm not sure why the same config isn't working on both platforms. If it's an older system or somehow the older OpenAL reference library, I'm not sure what kinds of differences there are between those releases.
-
chief, can you run ldd against yours?
-
Here ya go.
[cliff@ghostbsd ~]$ ldd /usr/local/lib/libopenal.so.1.15.1
/usr/local/lib/libopenal.so.1.15.1:
libthr.so.3 => /lib/libthr.so.3 (0x80124b000)
libm.so.5 => /lib/libm.so.5 (0x80146e000)
libc.so.7 => /lib/libc.so.7 (0x80081b000)
-
Ah-ha! I suspect on FreeBSD that the OpenAL test program is linking against libthr, and I think that's a pthread implementation.
OpenBSD 5.2's libopenal.so doesn't have that listed, so we'll want to add -lpthread to the build flags for that test.