Solaris 11에 .net Mono(소스에서 컴파일)를 설치하는 방법은 무엇입니까?

Solaris 11에 .net Mono(소스에서 컴파일)를 설치하는 방법은 무엇입니까?

마지막 모노 tar를 Solaris 11에 다운로드하고 필요한 패키지를 설치했습니다.

# pkg install autoconf
# pkg install automake
# pkg install libtool
# pkg install gcc

gcc 4.8.2를 사용하여 64비트 Solaris 11/x86(x86_64-pc-solaris2.11)에서 모노 5.18.0.268을 구성하려고 하면 다음과 같이 실패합니다. $ ./configure.sh

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

configure.ac에서 "D_XOPEN_SOURCE=500"을 "D_XOPEN_SOURCE=600"으로 변경했지만 개선되지 않았습니다.

        dnl *****************************
        dnl *** Checks for libxnet    ***
        dnl *****************************
        case "${host}" in
                *solaris* )
                        AC_MSG_CHECKING(for Solaris XPG4 support)
                        if test -f /usr/lib/libxnet.so; then
                                CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=600"
                                CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
                                CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED=1"
                                LIBS="$LIBS -lxnet"
                                AC_MSG_RESULT(yes)
                        else
                                AC_MSG_RESULT(no)
                        fi

autogen.sh를 실행하면 구성이 호출되므로 동일한 문제가 발생합니다.

Bug 31999 - C99와 XPG5가 Solaris 10+에서 일치하지 않음을 알고 있습니다. https://bugzilla.xamarin.com/show_bug.cgi?id=31999

7일 전에 모노 github에 이슈/버그(268)를 생성했습니다. https://github.com/mono/gtk-sharp/issues/268

또한 Solaris에서의 모노 설치에 대한 다른 페이지도 읽었습니다. gcc를 업데이트해야겠어요

답변1

설정한 정확한 값은 _XOPEN_SOURCE중요하지 않습니다. Mono가 매크로를 잘못 정의합니다 _XOPEN_SOURCE_EXTENDED.

case "${host}" in
        *solaris* )
                AC_MSG_CHECKING(for Solaris XPG4 support)
                if test -f /usr/lib/libxnet.so; then
                        CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=600"
                        CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
                        CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED=1" <-- WRONG
                        LIBS="$LIBS -lxnet"

_XOPEN_SOURCE_EXTENDED매크로는 다음에 존재하지 않습니다.POSIX 6또는POSIX 7 표준.

심지어 Linux도 _XOPEN_SOURCE_EXTENDED여기서 정의해서는 안 된다는 점에 동의합니다. 모든리눅스 feature_test_macros매뉴얼 페이지:

_XOPEN_SOURCE_EXTENDED

이 매크로가 정의되어 _XOPEN_SOURCE정의되면 XPG4v2(SUSv1) UNIX 확장(UNIX 95)에 해당하는 정의가 노출됩니다. _XOPEN_SOURCE500 이상의 값으로 정의하면 동일한 효과가 나타납니다 _XOPEN_SOURCE_EXTENDED. _XOPEN_SOURCE_EXTENDED새로운 소스 코드에 사용하는 것은 피해야 합니다.

_XOPEN_SOURCE500 이상의 값으로 정의하면 정의하는 것과 동일한 효과가 있으므로 후자 _XOPEN_SOURCE_EXTENDED(구식) 기능 테스트 매크로는 일반적으로 매뉴얼 페이지의 개요에 설명되어 있지 않습니다.

정확한 표현을 참고하세요.

_XOPEN_SOURCE_EXTENDED이 매크로( )를 정의하고 _XOPEN_SOURCE정의하면 XPG4v2(SUSv1) UNIX 확장(UNIX 95)에 해당하는 정의가 노출된다. ...

정의_XOPEN_SOURCE 어떤 가치에도동시에 결과는 _XOPEN_SOURCE_EXTENDEDXPG4v2에도 정의되어 있습니다.아니요재귀적 뮤텍스를 얻으려면 XPG6이 필요합니다.

당신은 만날 수 있습니다이 확인은 Solaris 11에서/usr/include/sys/feature_tests.h:

/*
 * It is invalid to compile an XPG3, XPG4, XPG4v2, or XPG5 application
 * using c99.  The same is true for POSIX.1-1990, POSIX.2-1992, POSIX.1b,
 * and POSIX.1c applications. Likewise, it is invalid to compile an XPG6
 * or a POSIX.1-2001 application with anything other than a c99 or later
 * compiler.  Therefore, we force an error in both cases.
 */
#if defined(_STDC_C99) && (defined(__XOPEN_OR_POSIX) && !defined(_XPG6))
#error "Compiler or options invalid for pre-UNIX 03 X/Open applications \
 and pre-2001 POSIX applications"
#elif !defined(_STDC_C99) && \
 (defined(__XOPEN_OR_POSIX) && defined(_XPG6))
#error "Compiler or options invalid; UNIX 03 and POSIX.1-2001 applications \
 require the use of c99"
#endif

_XPG6정의된다파일 앞부분, 이 블록에서:

/*
 * Use of _XOPEN_SOURCE
 *
 * The following X/Open specifications are supported:
 *
 * X/Open Portability Guide, Issue 3 (XPG3)
 * X/Open CAE Specification, Issue 4 (XPG4)
 * X/Open CAE Specification, Issue 4, Version 2 (XPG4v2)
 * X/Open CAE Specification, Issue 5 (XPG5)
 * Open Group Technical Standard, Issue 6 (XPG6), also referred to as
 *    IEEE Std. 1003.1-2001 and ISO/IEC 9945:2002.
 *
 * XPG4v2 is also referred to as UNIX 95 (SUS or SUSv1).
 * XPG5 is also referred to as UNIX 98 or the Single Unix Specification,
 *     Version 2 (SUSv2)
 * XPG6 is the result of a merge of the X/Open and POSIX specifications
 *     and as such is also referred to as IEEE Std. 1003.1-2001 in
 *     addition to UNIX 03 and SUSv3.
 *
 * When writing a conforming X/Open application, as per the specification
 * requirements, the appropriate feature test macros must be defined at
 * compile time. These are as follows. For more info, see standards(5).
 *
 * Feature Test Macro                    Specification
 * ------------------------------------------------  -------------
 * _XOPEN_SOURCE                                         XPG3
 * _XOPEN_SOURCE && _XOPEN_VERSION = 4                   XPG4
 * _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED = 1           XPG4v2
 * _XOPEN_SOURCE = 500                                   XPG5
 * _XOPEN_SOURCE = 600  (or POSIX_C_SOURCE=200112L)      XPG6
 *
 * In order to simplify the guards within the headers, the following
 * implementation private test macros have been created. Applications
 * must NOT use these private test macros as unexpected results will
 * occur.
 *
 * Note that in general, the use of these private macros is cumulative.
 * For example, the use of _XPG3 with no other restrictions on the X/Open
 * namespace will make the symbols visible for XPG3 through XPG6
 * compilation environments. The use of _XPG4_2 with no other X/Open
 * namespace restrictions indicates that the symbols were introduced in
 * XPG4v2 and are therefore visible for XPG4v2 through XPG6 compilation
 * environments, but not for XPG3 or XPG4 compilation environments.
 *
 * _XPG3    X/Open Portability Guide, Issue 3 (XPG3)
 * _XPG4    X/Open CAE Specification, Issue 4 (XPG4)
 * _XPG4_2  X/Open CAE Specification, Issue 4, Version 2 (XPG4v2/UNIX 95/SUS)
 * _XPG5    X/Open CAE Specification, Issue 5 (XPG5/UNIX 98/SUSv2)
 * _XPG6    Open Group Technical Standard, Issue 6 (XPG6/UNIX 03/SUSv3)
 */

/* X/Open Portability Guide, Issue 3 */
#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE - 0 < 500) && \
    (_XOPEN_VERSION - 0 < 4) && !defined(_XOPEN_SOURCE_EXTENDED)
#define _XPG3
/* X/Open CAE Specification, Issue 4 */
#elif   (defined(_XOPEN_SOURCE) && _XOPEN_VERSION - 0 == 4)
#define _XPG4
#define _XPG3
/* X/Open CAE Specification, Issue 4, Version 2 */
#elif (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE_EXTENDED - 0 == 1)
#define _XPG4_2
#define _XPG4
#define _XPG3
/* X/Open CAE Specification, Issue 5 */
#elif   (_XOPEN_SOURCE - 0 == 500)
#define _XPG5
#define _XPG4_2
#define _XPG4
#define _XPG3
#undef  _POSIX_C_SOURCE
#define _POSIX_C_SOURCE         199506L
/* Open Group Technical Standard , Issue 6 */
#elif   (_XOPEN_SOURCE - 0 == 600) || (_POSIX_C_SOURCE - 0 == 200112L)
#define _XPG6
#define _XPG5
#define _XPG4_2
#define _XPG4
#define _XPG3
#undef  _POSIX_C_SOURCE
#define _POSIX_C_SOURCE         200112L
#undef  _XOPEN_SOURCE
#define _XOPEN_SOURCE           600
#endif

관련 정보