Project

General

Profile

Bug #8153

openal build on oi_151a8 stops with pthread.h - not found

Added by Gary Mills almost 3 years ago. Updated almost 3 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
OI-Userland
Target version:
-
Start date:
2017-05-04
Due date:
% Done:

90%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

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:

-D_POSIX_C_SOURCE=200112L
-D_XOPEN_SOURCE=600

This can be done in a small patch. With that, the component should build on both oi_151a8 SPARC and hipster x86.

History

#1

Updated by Alexander Pyhalov almost 3 years ago

  • Status changed from Feedback to Resolved

Also available in: Atom PDF