diff options
author | Dmitry Pankratov <dp@ubiquitech.com> | 2016-03-07 23:57:29 +0100 |
---|---|---|
committer | Dmitry Pankratov <dp@ubiquitech.com> | 2016-03-07 23:57:29 +0100 |
commit | 6e3e735680c3dd9bf0084d78d82a09fccaabc5be (patch) | |
tree | 1f3affd4b5c7339514b3d85a1ec9dbfa3101efe3 | |
parent | d7339f50a2e83a5a267551c2b798f0f53a545f08 (diff) | |
download | crosstool-ng-6e3e735680c3dd9bf0084d78d82a09fccaabc5be.tar.gz crosstool-ng-6e3e735680c3dd9bf0084d78d82a09fccaabc5be.tar.bz2 crosstool-ng-6e3e735680c3dd9bf0084d78d82a09fccaabc5be.zip |
MinGW: add C++11 posix threads support
-rw-r--r-- | config/libc.in | 10 | ||||
-rw-r--r-- | config/libc/mingw.in | 4 | ||||
-rw-r--r-- | scripts/build/libc/mingw.sh | 27 |
3 files changed, 40 insertions, 1 deletions
diff --git a/config/libc.in b/config/libc.in index 4cc75300..e018634c 100644 --- a/config/libc.in +++ b/config/libc.in @@ -35,6 +35,10 @@ config LIBC_SUPPORT_THREADS_LT config LIBC_SUPPORT_THREADS_NONE bool +config LIBC_SUPPORT_THREADS_POSIX + bool + select LIBC_SUPPORT_THREADS_ANY + config LIBC_PROVIDES_CXA_ATEXIT bool @@ -52,6 +56,7 @@ choice prompt "Threading implementation to use:" default THREADS_NATIVE if LIBC_SUPPORT_THREADS_NATIVE default THREADS_THREADS_LT if LIBC_SUPPORT_THREADS_LT && ! LIBC_SUPPORT_THREADS_NATIVE + default THREADS_THREADS_POSIX if LIBC_SUPPORT_THREADS_POSIX && ! LIBC_SUPPORT_THREADS_NATIVE && ! LIBC_SUPPORT_THREADS_LT default THREADS_NONE if ! LIBC_SUPPORT_THREADS_ANY config THREADS_NATIVE @@ -70,6 +75,11 @@ config THREADS_LT prompt "linuxthreads" depends on LIBC_SUPPORT_THREADS_LT +config THREADS_POSIX + bool + prompt "posix" + depends on LIBC_SUPPORT_THREADS_POSIX + config THREADS_NONE bool prompt "none" diff --git a/config/libc/mingw.in b/config/libc/mingw.in index 88088e9b..45b69715 100644 --- a/config/libc/mingw.in +++ b/config/libc/mingw.in @@ -3,12 +3,14 @@ ## depends on WINDOWS ## ## select LIBC_SUPPORT_THREADS_NATIVE +## select LIBC_SUPPORT_THREADS_POSIX ## select CC_CORE_PASS_2_NEEDED ## ## help The de-facto standard for Mingw distributions. config THREADS - default "win32" + default "win32" if THREADS_NATIVE + default "posix" if THREADS_POSIX choice bool diff --git a/scripts/build/libc/mingw.sh b/scripts/build/libc/mingw.sh index 964a11d9..a22c2baa 100644 --- a/scripts/build/libc/mingw.sh +++ b/scripts/build/libc/mingw.sh @@ -114,8 +114,35 @@ do_libc() { CT_DoExecLog ALL ${make} install DESTDIR=${CT_SYSROOT_DIR} CT_EndStep + + if [ "${CT_THREADS}" = "posix" ]; then + do_pthreads + fi } do_libc_post_cc() { : } + +do_pthreads() { + CT_DoStep INFO "Building mingw-w64-winpthreads files" + + CT_DoLog EXTRA "Configuring mingw-w64-winpthreads" + + CT_mkdir_pushd "${CT_BUILD_DIR}/build-mingw-w64-winpthreads" + + CT_DoExecLog CFG \ + "${CT_SRC_DIR}/mingw-w64-${CT_WINAPI_VERSION_DOWNLOADED}/mingw-w64-libraries/winpthreads/configure" \ + --with-sysroot=${CT_SYSROOT_DIR} \ + --prefix=${MINGW_INSTALL_PREFIX} \ + --build=${CT_BUILD} \ + --host=${CT_TARGET} \ + + CT_DoLog EXTRA "Building mingw-w64-winpthreads" + CT_DoExecLog ALL ${make} ${JOBSFLAGS} + + CT_DoLog EXTRA "Installing mingw-w64-winpthreads" + CT_DoExecLog ALL ${make} install DESTDIR=${CT_SYSROOT_DIR} + + CT_EndStep +} |