Mercurial > mxe-octave
changeset 3808:c7c1065c12e0
pthreads: use mingw-w64 threads
* src/pthreads.mk: use pthreads from mingw-w64 source tree
* src/pthreads-1-fixes.patch: removed
* dist-files.mk: remove pthreads-1-fixes.patch
author | John Donoghue |
---|---|
date | Wed, 25 Feb 2015 13:18:35 -0500 |
parents | c6dd0518f31b |
children | b854e159f3e3 |
files | dist-files.mk src/pthreads-1-fixes.patch src/pthreads.mk |
diffstat | 3 files changed, 15 insertions(+), 102 deletions(-) [+] |
line wrap: on
line diff
--- a/dist-files.mk Mon Feb 23 20:22:40 2015 -0500 +++ b/dist-files.mk Wed Feb 25 13:18:35 2015 -0500 @@ -524,7 +524,6 @@ pstoedit-3-nosecapi.patch \ pstoedit.mk \ pthread-stubs.mk \ - pthreads-1-fixes.patch \ pthreads-test.c \ pthreads.mk \ qdbm-test.c \
--- a/src/pthreads-1-fixes.patch Mon Feb 23 20:22:40 2015 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ -This file is part of MXE. -See index.html for further information. - -From e951f784c852f4cd8298864190936fded1efceba Mon Sep 17 00:00:00 2001 -From: Mark Brand <mabrand@mabrand.nl> -Date: Sun, 27 May 2012 22:00:19 +0200 -Subject: [PATCH] force static for convenience - ---- - pthread.h | 4 ++++ - sched.h | 4 ++++ - semaphore.h | 4 ++++ - 3 files changed, 12 insertions(+) - -diff --git a/pthread.h b/pthread.h -index b4072f7..c88c886 100755 ---- a/pthread.h -+++ b/pthread.h -@@ -547,6 +547,10 @@ extern "C" - * do NOT define PTW32_BUILD, and then the variables/functions will - * be imported correctly. - */ -+ -+// MXE: Set this for convenience here since MXE only does static. -+#define PTW32_STATIC_LIB -+ - #if !defined(PTW32_STATIC_LIB) - # if defined(PTW32_BUILD) - # define PTW32_DLLPORT __declspec (dllexport) -diff --git a/sched.h b/sched.h -index f36a97a..1f4f401 100755 ---- a/sched.h -+++ b/sched.h -@@ -76,6 +76,10 @@ - * do NOT define PTW32_BUILD, and then the variables/functions will - * be imported correctly. - */ -+ -+// MXE: Set this for convenience here since MXE only does static. -+#define PTW32_STATIC_LIB -+ - #if !defined(PTW32_STATIC_LIB) - # if defined(PTW32_BUILD) - # define PTW32_DLLPORT __declspec (dllexport) -diff --git a/semaphore.h b/semaphore.h -index c6e9407..2b64173 100755 ---- a/semaphore.h -+++ b/semaphore.h -@@ -75,6 +75,10 @@ - * do NOT define PTW32_BUILD, and then the variables/functions will - * be imported correctly. - */ -+ -+// MXE: Set this for convenience here since MXE only does static. -+#define PTW32_STATIC_LIB -+ - #if !defined(PTW32_STATIC_LIB) - # if defined(PTW32_BUILD) - # define PTW32_DLLPORT __declspec (dllexport) --- -1.7.9.2 -
--- a/src/pthreads.mk Mon Feb 23 20:22:40 2015 -0500 +++ b/src/pthreads.mk Wed Feb 25 13:18:35 2015 -0500 @@ -2,53 +2,29 @@ # See index.html for further information. PKG := pthreads -$(PKG)_IGNORE := -$(PKG)_VERSION := 2-9-1 -$(PKG)_CHECKSUM := 24d40e89c2e66a765733e8c98d6f94500343da86 -$(PKG)_SUBDIR := pthreads-w32-$($(PKG)_VERSION)-release -$(PKG)_FILE := pthreads-w32-$($(PKG)_VERSION)-release.tar.gz -$(PKG)_URL := ftp://sourceware.org/pub/pthreads-win32/$($(PKG)_FILE) -$(PKG)_DEPS := +$(PKG)_IGNORE := $(mingw-w64_IGNORE) +$(PKG)_VERSION := $(mingw-w64_VERSION) +$(PKG)_CHECKSUM := $(mingw-w64_CHECKSUM) +$(PKG)_SUBDIR := $(mingw-w64_SUBDIR) +$(PKG)_FILE := $(mingw-w64_FILE) +$(PKG)_URL := $(mingw-w64_URL) +$(PKG)_DEPS := define $(PKG)_UPDATE - $(WGET) -q -O- 'ftp://sourceware.org/pub/pthreads-win32/dll-latest/include/pthread.h' | \ - $(SED) -n 's/^#define PTW32_VERSION \([^,]*\),\([^,]*\),\([^,]*\),.*/\1-\2-\3/p;' + echo $(mingw-w64_VERSION) endef -ifeq ($(MXE_NATIVE_MINGW_BUILD),yes) -define $(PKG)_BUILD - $(MAKE) -C '$(1)' -j 1 GC-static - $(INSTALL) -d '$(HOST_LIBDIR)' - $(INSTALL) -m644 '$(1)/libpthreadGC2.a' '$(HOST_LIBDIR)/libpthread.a' - - if [ $(BUILD_SHARED) = yes ]; then \ - $(MAKE_SHARED_FROM_STATIC) --ar '$(MXE_AR)' --ld '$(MXE_CC)' '$(HOST_LIBDIR)/libpthread.a' --install '$(INSTALL)' --libdir '$(HOST_LIBDIR)' --bindir '$(HOST_BINDIR)'; \ - fi - - $(INSTALL) -d '$(HOST_INCDIR)' - $(INSTALL) -m644 '$(1)/pthread.h' '$(HOST_INCDIR)' - $(INSTALL) -m644 '$(1)/sched.h' '$(HOST_INCDIR)' - $(INSTALL) -m644 '$(1)/semaphore.h' '$(HOST_INCDIR)' -endef - -else ifeq ($(MXE_SYSTEM),mingw) define $(PKG)_BUILD - $(MAKE) -C '$(1)' -j 1 GC-static CROSS='$(MXE_TOOL_PREFIX)' - $(INSTALL) -d '$(HOST_LIBDIR)' - $(INSTALL) -m644 '$(1)/libpthreadGC2.a' '$(HOST_LIBDIR)/libpthread.a' - - if [ $(BUILD_SHARED) = yes ]; then \ - $(MAKE_SHARED_FROM_STATIC) --ar '$(MXE_AR)' --ld '$(MXE_CC)' '$(HOST_LIBDIR)/libpthread.a' --install '$(INSTALL)' --libdir '$(HOST_LIBDIR)' --bindir '$(HOST_BINDIR)'; \ - fi - - $(INSTALL) -d '$(HOST_INCDIR)' - $(INSTALL) -m644 '$(1)/pthread.h' '$(HOST_INCDIR)' - $(INSTALL) -m644 '$(1)/sched.h' '$(HOST_INCDIR)' - $(INSTALL) -m644 '$(1)/semaphore.h' '$(HOST_INCDIR)' + cd '$(1)/mingw-w64-libraries/winpthreads' && ./configure \ + $(HOST_AND_BUILD_CONFIGURE_OPTIONS) \ + --prefix='$(HOST_PREFIX)' \ + $(ENABLE_SHARED_OR_STATIC) + + $(MAKE) -C '$(1)/mingw-w64-libraries/winpthreads' -j '$(JOBS)' + $(MAKE) -C '$(1)/mingw-w64-libraries/winpthreads' -j 1 install endef else define $(PKG)_BUILD endef endif -endif