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

Title: OpenBSD OpenAL configure test fix
Post 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]
Title: Re: OpenBSD OpenAL configure test fix
Post by: rsaxvc on November 24, 2013, 07:27:01 pm
Perhaps this is an OpenAL problem? Should libopenal be specifying that it needs libpthreads? Is there a way to do that?
Title: Re: OpenBSD OpenAL configure test fix
Post by: niffiwan on November 24, 2013, 08:05:20 pm
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...

Code: (configure.ac:456) [Select]
dnl Posix Threads
AC_SEARCH_LIBS([pthread_mutex_timedlock], [pthread])
FS2_LIBS=$FS2_LIBS" -lpthread"
Title: Re: OpenBSD OpenAL configure test fix
Post by: rsaxvc on November 24, 2013, 08:58:46 pm
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.
Title: Re: OpenBSD OpenAL configure test fix
Post by: chief1983 on November 25, 2013, 12:30:07 am
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.
Title: Re: OpenBSD OpenAL configure test fix
Post by: rsaxvc on November 25, 2013, 10:15:36 pm
chief, can you run ldd against yours?
Title: Re: OpenBSD OpenAL configure test fix
Post by: chief1983 on November 26, 2013, 11:22:22 am
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)
Title: Re: OpenBSD OpenAL configure test fix
Post by: rsaxvc on November 26, 2013, 08:54:37 pm
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.