--- dev-util/mingw64-runtime/mingw64-runtime-3.2.0-r1.ebuild 2015-02-27 09:31:09.000000000 +0100 +++ dev-util/mingw64-runtime/mingw64-runtime-3.2.0-r1.ebuild 2015-04-30 02:57:01.020000000 +0200 @@ -21,7 +21,7 @@ LICENSE="BSD" SLOT="0" KEYWORDS="~amd64 ~x86" -IUSE="crosscompile_opts_headers-only idl" +IUSE="crosscompile_opts_headers-only idl threads" RESTRICT="strip" S="${WORKDIR}/mingw-w64-v${PV}" @@ -62,11 +62,41 @@ --enable-sdk \ $(use_enable idl) \ "${extra_conf[@]}" + + if use threads && ! just_headers ; then + pushd mingw-w64-libraries/winpthreads >&/dev/null || die + # Use crt{begin,end}.o from the WORKDIR + _oLDFLAGS="${LDFLAGS}" + append-ldflags "-Wc,-B${S}/mingw-w64-crt/lib64" + + CHOST=${CTARGET} econf \ + --prefix=/usr/${CTARGET} \ + --includedir=/usr/${CTARGET}/usr/include + + LDFLAGS="${_oLDFLAGS}" + popd >&/dev/null || die + fi +} + +src_compile() { + default + + if use threads && ! just_headers ; then + pushd mingw-w64-libraries/winpthreads >&/dev/null || die + emake + popd >&/dev/null || die + fi } src_install() { default + if use threads && ! just_headers ; then + pushd mingw-w64-libraries/winpthreads >&/dev/null || die + default + popd >&/dev/null || die + fi + if is_crosscompile ; then # gcc is configured to look at specific hard-coded paths for mingw #419601 dosym usr /usr/${CTARGET}/mingw