if check lo-cflag -pthread; then lo_cflags="$lo_cflags -pthread" fi if check include pthread.h; then cfg:set 'working semaphores' "$(c++:compile " #include int main() { sem_t semaphore; return sem_init(&semaphore, 0, 0) == -1 ? $no : $yes; } ")" cfg:set 'cross-thread wait' "$(c++:compile " #include #include #include #include #include int child; extern \"C\" void *start(void *) { return waitpid(child, 0, 0) == -1 ? &child : 0; } int main() { void *status(0); if (child = fork()) { ::pthread_t thread; ::pthread_create(&thread, 0, &start, 0); ::pthread_join(thread, &status); } return status == 0 ? $yes : $no; } ")" fi