openal build on oi_151a8 stops with pthread.h - not found
The build of the openal component of oi-userland on oi_151a8 SPARC stops with the following error:
-- Looking for pthread.h -- Looking for pthread.h - not found CMake Error at CMakeLists.txt:497 (MESSAGE): PThreads is required for non-Windows builds!
The CMakeError.log provides more details:
/usr/local/bin/gcc -std=c99 -m32 -O3 -mno-app-regs -D_GNU_SOURCE=1 -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES -o CMakeFiles/cmTC_bbc09.dir/CheckIncludeFile.c.o -c /dpool/export/home/mills/Downloads/code/oi-userland/components/openal/build/sparcv7/CMakeFiles/CMakeTmp/CheckIncludeFile.c In file included from /usr/include/pthread.h:30:0, from /dpool/export/home/mills/Downloads/code/oi-userland/components/openal/build/sparcv7/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1: /dpool/opt/local/lib/gcc/sparc-sun-solaris2.11/4.9.4/include-fixed/sys/feature_tests.h:360:2: error: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications and pre-2001 POSIX applications"
This happened because the sys/feature_tests.h header on oi_151a8 only knows about 200112L and 600. Fortunately, nothing in the code requires the higher POSIX levels. The solution is simply to modify CMakeLists.txt to read:
This can be done in a small patch. With that, the component should build on both oi_151a8 SPARC and hipster x86.