diff options
| author | Samuli Piippo <samuli.piippo@qt.io> | 2018-10-30 13:07:47 +0200 |
|---|---|---|
| committer | Joshua Watt <JPEWhacker@gmail.com> | 2018-11-20 14:33:47 -0600 |
| commit | 7a9657c7dd2f6e40ab162af8ebc785ad54774e10 (patch) | |
| tree | 45aacd7eb9a397dfb0bf3283ceb71515f5fa07be /recipes-devtools | |
| parent | b067aae507eab0f3ff5d4a4e9f9af289e30a95e3 (diff) | |
| download | meta-mingw-7a9657c7dd2f6e40ab162af8ebc785ad54774e10.tar.gz | |
winpthreads: use posix threads library from mingw64
Use the winpthreads library available in the mingw64 and
change the thread model from win32 to posix to get access
to c++11 features.
Signed-off-by: Samuli Piippo <samuli.piippo@qt.io>
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Diffstat (limited to 'recipes-devtools')
5 files changed, 39 insertions, 48 deletions
diff --git a/recipes-devtools/gcc/gcc-runtime_%.bbappend b/recipes-devtools/gcc/gcc-runtime_%.bbappend index 1641cb9..f14edf1 100644 --- a/recipes-devtools/gcc/gcc-runtime_%.bbappend +++ b/recipes-devtools/gcc/gcc-runtime_%.bbappend | |||
| @@ -11,4 +11,4 @@ RUNTIMETARGET_remove_mingw32 = "libitm" | |||
| 11 | # mingw builds | 11 | # mingw builds |
| 12 | RUNTIMETARGET_remove_mingw32 = "libmpx" | 12 | RUNTIMETARGET_remove_mingw32 = "libmpx" |
| 13 | 13 | ||
| 14 | DEPENDS_append_mingw32 = " pthreads-win32" | 14 | DEPENDS_append_mingw32 = " nativesdk-mingw-w64-winpthreads" |
diff --git a/recipes-devtools/gcc/libgcc_%.bbappend b/recipes-devtools/gcc/libgcc_%.bbappend index 2a95d02..f542cfc 100644 --- a/recipes-devtools/gcc/libgcc_%.bbappend +++ b/recipes-devtools/gcc/libgcc_%.bbappend | |||
| @@ -1,3 +1,5 @@ | |||
| 1 | DEPENDS_append_mingw32 = " nativesdk-mingw-w64-winpthreads" | ||
| 2 | |||
| 1 | FILES_${PN}_append_mingw32 = " ${bindir}/libgcc*.dll" | 3 | FILES_${PN}_append_mingw32 = " ${bindir}/libgcc*.dll" |
| 2 | FILES_${PN}-dev_append_mingw32 = " ${base_libdir}/libgcc*.a" | 4 | FILES_${PN}-dev_append_mingw32 = " ${base_libdir}/libgcc*.a" |
| 3 | 5 | ||
diff --git a/recipes-devtools/mingw-w64/nativesdk-mingw-w64-headers_5.0.3.bb b/recipes-devtools/mingw-w64/nativesdk-mingw-w64-headers_5.0.3.bb index e129c32..009e5af 100644 --- a/recipes-devtools/mingw-w64/nativesdk-mingw-w64-headers_5.0.3.bb +++ b/recipes-devtools/mingw-w64/nativesdk-mingw-w64-headers_5.0.3.bb | |||
| @@ -31,4 +31,9 @@ do_compile() { | |||
| 31 | : | 31 | : |
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | do_install_append() { | ||
| 35 | # install correct pthread headers | ||
| 36 | install -m 0644 -t ${D}${includedir} ${S}/../mingw-w64-libraries/winpthreads/include/*.h | ||
| 37 | } | ||
| 38 | |||
| 34 | FILES_${PN} += "${exec_prefix}/${TARGET_SYS}" | 39 | FILES_${PN} += "${exec_prefix}/${TARGET_SYS}" |
diff --git a/recipes-devtools/mingw-w64/nativesdk-mingw-w64-winpthreads_5.0.3.bb b/recipes-devtools/mingw-w64/nativesdk-mingw-w64-winpthreads_5.0.3.bb new file mode 100644 index 0000000..1308760 --- /dev/null +++ b/recipes-devtools/mingw-w64/nativesdk-mingw-w64-winpthreads_5.0.3.bb | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | DESCRIPTION = "Winpthreads runtime libraries from MinGW-w64 project" | ||
| 2 | LICENSE = "ZPL-2.1" | ||
| 3 | LIC_FILES_CHKSUM = "file://../../COPYING;md5=bb936f0e04d8f1e19ad545100cee9654" | ||
| 4 | |||
| 5 | COMPATIBLE_HOST = ".*-mingw.*" | ||
| 6 | |||
| 7 | SRC_URI = "${SOURCEFORGE_MIRROR}/project/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v${PV}.tar.bz2" | ||
| 8 | SRC_URI[md5sum] = "5524c20312560cc8683b7d8ee292cb8c" | ||
| 9 | SRC_URI[sha256sum] = "2a601db99ef579b9be69c775218ad956a24a09d7dabc9ff6c5bd60da9ccc9cb4" | ||
| 10 | |||
| 11 | S = "${WORKDIR}/mingw-w64-v${PV}/mingw-w64-libraries/winpthreads" | ||
| 12 | B = "${WORKDIR}/build-${TARGET_SYS}" | ||
| 13 | |||
| 14 | inherit autotools nativesdk | ||
| 15 | |||
| 16 | INHIBIT_DEFAULT_DEPS = "1" | ||
| 17 | DEPENDS = "nativesdk-mingw-w64-runtime virtual/${TARGET_PREFIX}gcc-initial" | ||
| 18 | |||
| 19 | do_configure() { | ||
| 20 | oe_runconf | ||
| 21 | } | ||
| 22 | |||
| 23 | STAGINGCC = "gcc-cross-initial-${TARGET_ARCH}" | ||
| 24 | STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${SDK_SYS}" | ||
| 25 | TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TARGET}" | ||
| 26 | PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:" | ||
| 27 | |||
| 28 | do_install_append() { | ||
| 29 | # headers are already installed by mingw-w64-headers | ||
| 30 | rm -rf ${D}${includedir} | ||
| 31 | } | ||
diff --git a/recipes-devtools/pthreads-win32/pthreads-win32_2.9.1.bb b/recipes-devtools/pthreads-win32/pthreads-win32_2.9.1.bb deleted file mode 100644 index e4a0f80..0000000 --- a/recipes-devtools/pthreads-win32/pthreads-win32_2.9.1.bb +++ /dev/null | |||
| @@ -1,47 +0,0 @@ | |||
| 1 | DESCRIPTION = "A Win32 implementation of the POSIX standard threads API" | ||
| 2 | HOMEPAGE = "http://www.sourceware.org/pthreads-win32" | ||
| 3 | LICENSE = "LGPLv2.1" | ||
| 4 | LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=7fbc338309ac38fefcd64b04bb903e34" | ||
| 5 | |||
| 6 | BBCLASSEXTEND = "nativesdk" | ||
| 7 | |||
| 8 | COMPATIBLE_HOST = ".*-mingw.*" | ||
| 9 | |||
| 10 | ## Replace dots with dashes | ||
| 11 | PVdash = "2-9-1" | ||
| 12 | |||
| 13 | ## cvs -d :pserver:anonymous@sourceware.org:/cvs/pthreads-win32 checkout pthreads | ||
| 14 | SRC_URI = "ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-${PVdash}-release.tar.gz" | ||
| 15 | SRC_URI[md5sum] = "36ba827d6aa0fa9f9ae740a35626e2e3" | ||
| 16 | SRC_URI[sha256sum] = "e6aca7aea8de33d9c8580bcb3a0ea3ec0a7ace4ba3f4e263ac7c7b66bc95fb4d" | ||
| 17 | |||
| 18 | ## Reference: http://sourceware.org/ml/pthreads-win32/2009/msg00030/w64sup.patch | ||
| 19 | #SRC_URI += "file://w64sup.patch" | ||
| 20 | |||
| 21 | S = "${WORKDIR}/pthreads-w32-${PVdash}-release" | ||
| 22 | |||
| 23 | INHIBIT_DEFAULT_DEPS = "1" | ||
| 24 | DEPENDS = "virtual/${SDK_PREFIX}gcc libgcc virtual/libc" | ||
| 25 | |||
| 26 | do_configure_prepend() { | ||
| 27 | ## First reset all permissions because all are executable | ||
| 28 | find . -type f -exec chmod 644 {} \; | ||
| 29 | ## Make a copy of config.h | ||
| 30 | cp config.h pthreads_win32_config.h | ||
| 31 | } | ||
| 32 | |||
| 33 | do_compile() { | ||
| 34 | make -f GNUmakefile CROSS=${SDK_PREFIX} CC="${CC}" RC="${WINDRES}" clean GC | ||
| 35 | } | ||
| 36 | |||
| 37 | do_install() { | ||
| 38 | install -d -m 0755 ${D}${bindir} | ||
| 39 | install -d -m 0755 ${D}${includedir} | ||
| 40 | install -d -m 0755 ${D}${libdir} | ||
| 41 | |||
| 42 | install -m 0644 ${S}/pthread.h ${S}/sched.h ${S}/semaphore.h ${D}${includedir}/ | ||
| 43 | |||
| 44 | install -m 0644 ${S}/libpthreadGC2.a ${D}${libdir}/libpthread.dll.a | ||
| 45 | install -m 0644 ${S}/pthreadGC2.dll ${D}${bindir}/libpthread-2.dll | ||
| 46 | install -m 0644 ${S}/pthreadGC2.dll ${D}${bindir}/pthreadGC2.dll | ||
| 47 | } | ||
