2017-06-19 99 views
1

我試圖在Solaris 10上編譯單聲道。我已經嘗試了很多從2.11.4到今天最新的5.xx版本的版本。但我總是失敗。Solaris上的單聲道編譯

我正在使用Sun-Fire-v240具有SPARC處理器的硬件。 此外,OS版本是的Oracle Solaris 10 1/13 s10s_u11wos_24a SPARC

是我收到的問題是這樣的:

checking for PTHREAD_MUTEX_RECURSIVE... no 
configure: error: Posix system lacks support for recursive mutexes 

有沒有辦法編譯單用於Solaris,我一直在尋找這個問題有一段時間了,但是我的案子沒有任何工作成果。我對UNIX系統並不擅長,所以我想我錯過了一些東西...

謝謝。最好的問候,奧爾罕。

回答

1

這似乎是一個two-year-old Mono bug

Bug 31999 - C99 and XPG5 don't match on Solaris 10+

...

checking for PTHREAD_MUTEX_RECURSIVE... no configure: error: Posix system lacks support for recursive mutexes

which is wrong. In config.log I find

configure:22190: checking for PTHREAD_MUTEX_RECURSIVE 
configure:22206: gcc -m64 -R/vol/gnu/lib/amd64 -c -g -O2 -std=gnu99 -fno-strict-aliasing -fwrapv -DMONO_DLL_EXPORT -Wno-unused-but-set-variable -g -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wwrite-strings -Wno-switch -Wno-switch-enum -Wno-unused-value -mno-tls-direct-seg-refs -Wno-char-subscripts -I/vol/mono-4.0/include -DGC_SOLARIS_THREADS -DGC_SOLARIS_PTHREADS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_MMAP -DUSE_MUNMAP -DPLATFORM_SOLARIS -g -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wwrite-strings -Wno-switch -Wno-switch-enum -Wno-unused-value -DLARGE_CONFIG -D_XOPEN_SOURCE=500 -D__EXTENSIONS__ -D_XOPEN_SOURCE_EXTENDED=1 conftest.c >&5 
In file included from /usr/include/pthread.h:8:0, 
       from conftest.c:106: 
/vol/gcc-4.8/lib/gcc/i386-pc-solaris2.11/4.8.0/include-fixed/sys/feature_tests.h:363:2: 

error: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications and pre-2001 POSIX applications" #error "Compiler or options invalid for pre-UNIX 03 X/Open applications \ ^ conftest.c:108:1: warning: function declaration isn't a prototype [-Wstrict-prototypes] ^ conftest.c:108:1: warning: function declaration isn't a prototype [-Wstrict-prototypes] main() ^ configure:22206: $? = 1 configure: failed program was: [...] configure:22213: result: no configure:22215: error: Posix system lacks support for recursive mutexes

This error is an artefact of the fact that configure.ac has

CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500"

while on Solaris 10 and up C99 can only be used with XPG6/_XOPEN_SOURCE=600. Completely omitting the _XOPEN_SOURCE definition isn't an option since without it, struct msghdr lacks the msg_flags member

+0

恐怕要告訴你,這並沒有奏效。它仍然給出同樣的錯誤。 – OrhanT

+0

@OrhanT如果你運行'grep PTHREAD_MUTEX_RECURSIVE/usr/include/*',你會看到什麼? –

+0

它打印'/usr/include/pthread.h:#define PTHREAD_MUTEX_RECURSIVE 0x4' – OrhanT