From 6979188381ba0bd7519afdd264e8d028326ab7dd Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sun, 19 Mar 2023 20:59:16 -0700 Subject: [PATCH] Use native Windows threads on Windows This makes building wimlib for Windows easier, as it no longer depends on winpthreads. --- .gitignore | 1 - Makefile.am | 2 + NEWS | 2 + README.WINDOWS | 8 +- configure.ac | 4 +- include/wimlib/threads.h | 44 +++++++ src/compress_parallel.c | 65 +++++------ src/mount_image.c | 13 +-- src/threads.c | 244 +++++++++++++++++++++++++++++++++++++++ src/wim.c | 12 +- src/win32_vss.c | 12 +- tools/windeps/Makefile | 42 +------ tools/windeps/sha256sums | 1 - 13 files changed, 343 insertions(+), 107 deletions(-) create mode 100644 include/wimlib/threads.h create mode 100644 src/threads.c diff --git a/.gitignore b/.gitignore index c472377c..41a0f844 100644 --- a/.gitignore +++ b/.gitignore @@ -50,7 +50,6 @@ /tools/windeps/libxml2* /tools/windeps/mingw* /tools/windeps/sysroot_* -/tools/windeps/winpthreads* /wimlib-*-bin/ /wimlib-*.tar /wimlib-*.tar.* diff --git a/Makefile.am b/Makefile.am index 3579651a..bb801a52 100644 --- a/Makefile.am +++ b/Makefile.am @@ -83,6 +83,7 @@ libwim_la_SOURCES = \ src/tagged_items.c \ src/template.c \ src/textfile.c \ + src/threads.c \ src/timestamp.c \ src/update_image.c \ src/util.c \ @@ -144,6 +145,7 @@ libwim_la_SOURCES = \ include/wimlib/solid.h \ include/wimlib/tagged_items.h \ include/wimlib/textfile.h \ + include/wimlib/threads.h \ include/wimlib/timestamp.h \ include/wimlib/types.h \ include/wimlib/unaligned.h \ diff --git a/NEWS b/NEWS index 23003c0d..7447e5e5 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,8 @@ Version 1.14.0-BETA1: Removed support for Windows XP. + On Windows, wimlib no longer depends on winpthreads. + Fixed a bug in 'wimsplit' where it didn't accept part sizes of 4 GiB or larger on Windows and on 32-bit platforms. diff --git a/README.WINDOWS b/README.WINDOWS index 5a9bd3b1..0308a2ed 100644 --- a/README.WINDOWS +++ b/README.WINDOWS @@ -104,7 +104,6 @@ packages from category "Devel": - mingw64-x86_64-binutils - mingw64-x86_64-gcc-g++ - mingw64-x86_64-libxml2 - - mingw64-x86_64-winpthreads - pkg-config Download wimlib's source code from https://wimlib.net/downloads/wimlib-1.13.6.tar.gz. @@ -125,7 +124,6 @@ x86_64-w64-mingw32-strip to strip them. libwim-15.dll will be linked to several other DLLs which you will need as well: - - libwinpthread-1.dll - libxml2-2.dll, which also requires: - iconv.dll - liblzma-5.dll @@ -165,8 +163,8 @@ bootstrap the repository, and run the Windows release script: ./bootstrap ./tools/make-windows-release x86_64 -The release script will download and build libxml2 and winpthreads as static -libraries, then build wimlib, then do some final tasks and bundle the resulting -files up into a ZIP archive. If successful you'll end up with a file like +The release script will download and build libxml2 as a static library, then +build wimlib, then do some final tasks and bundle the resulting files up into a +ZIP archive. If successful you'll end up with a file like "wimlib-1.13.6-windows-x86_64-bin.zip", just like the official releases. For 32-bit binaries just use "i686" instead of "x86_64". diff --git a/configure.ac b/configure.ac index afeffd8c..3028f88d 100644 --- a/configure.ac +++ b/configure.ac @@ -106,7 +106,9 @@ AC_CHECK_DECL([__NR_getrandom], ############################################################################### # ------------------------------ pthreads ------------------------------------- -AX_PTHREAD([], [AC_MSG_ERROR(["cannot find pthreads library"])]) +if test "$WINDOWS_NATIVE_BUILD" != "yes"; then + AX_PTHREAD([], [AC_MSG_ERROR(["cannot find pthreads library"])]) +fi # ------------------------------ libxml2 -------------------------------------- PKG_CHECK_MODULES([LIBXML2], [libxml-2.0]) diff --git a/include/wimlib/threads.h b/include/wimlib/threads.h new file mode 100644 index 00000000..2e624a49 --- /dev/null +++ b/include/wimlib/threads.h @@ -0,0 +1,44 @@ +#ifndef _WIMLIB_THREADS_H +#define _WIMLIB_THREADS_H + +#include + +#ifdef _WIN32 + +struct thread { + void *win32_thread; + void *(*thrproc)(void *); + void *arg; +}; + +struct mutex { void *win32_crit; }; +#define MUTEX_INITIALIZER { NULL } + +struct condvar { void *win32_cond; }; + +#else /* _WIN32 */ + +#include + +struct thread { pthread_t pthread; }; + +struct mutex { pthread_mutex_t pthread_mutex; }; +#define MUTEX_INITIALIZER { PTHREAD_MUTEX_INITIALIZER } + +struct condvar { pthread_cond_t pthread_cond; }; + +#endif /* !_WIN32 */ + +bool thread_create(struct thread *t, void *(*thrproc)(void *), void *arg); +void thread_join(struct thread *t); +bool mutex_init(struct mutex *m); +void mutex_destroy(struct mutex *m); +void mutex_lock(struct mutex *m); +void mutex_unlock(struct mutex *m); +bool condvar_init(struct condvar *c); +void condvar_destroy(struct condvar *c); +void condvar_wait(struct condvar *c, struct mutex *m); +void condvar_signal(struct condvar *c); +void condvar_broadcast(struct condvar *c); + +#endif /* _WIMLIB_THREADS_H */ diff --git a/src/compress_parallel.c b/src/compress_parallel.c index 4c295906..159b9ce5 100644 --- a/src/compress_parallel.c +++ b/src/compress_parallel.c @@ -26,7 +26,6 @@ #endif #include -#include #include #include @@ -34,18 +33,19 @@ #include "wimlib/chunk_compressor.h" #include "wimlib/error.h" #include "wimlib/list.h" +#include "wimlib/threads.h" #include "wimlib/util.h" struct message_queue { struct list_head list; - pthread_mutex_t lock; - pthread_cond_t msg_avail_cond; - pthread_cond_t space_avail_cond; + struct mutex lock; + struct condvar msg_avail_cond; + struct condvar space_avail_cond; bool terminating; }; struct compressor_thread_data { - pthread_t thread; + struct thread thread; struct message_queue *chunks_to_compress_queue; struct message_queue *compressed_chunks_queue; struct wimlib_compressor *compressor; @@ -89,25 +89,19 @@ struct parallel_chunk_compressor { static int message_queue_init(struct message_queue *q) { - if (pthread_mutex_init(&q->lock, NULL)) { - ERROR_WITH_ERRNO("Failed to initialize mutex"); + if (!mutex_init(&q->lock)) goto err; - } - if (pthread_cond_init(&q->msg_avail_cond, NULL)) { - ERROR_WITH_ERRNO("Failed to initialize condition variable"); + if (!condvar_init(&q->msg_avail_cond)) goto err_destroy_lock; - } - if (pthread_cond_init(&q->space_avail_cond, NULL)) { - ERROR_WITH_ERRNO("Failed to initialize condition variable"); + if (!condvar_init(&q->space_avail_cond)) goto err_destroy_msg_avail_cond; - } INIT_LIST_HEAD(&q->list); return 0; err_destroy_msg_avail_cond: - pthread_cond_destroy(&q->msg_avail_cond); + condvar_destroy(&q->msg_avail_cond); err_destroy_lock: - pthread_mutex_destroy(&q->lock); + mutex_destroy(&q->lock); err: return WIMLIB_ERR_NOMEM; } @@ -116,19 +110,19 @@ static void message_queue_destroy(struct message_queue *q) { if (q->list.next != NULL) { - pthread_mutex_destroy(&q->lock); - pthread_cond_destroy(&q->msg_avail_cond); - pthread_cond_destroy(&q->space_avail_cond); + mutex_destroy(&q->lock); + condvar_destroy(&q->msg_avail_cond); + condvar_destroy(&q->space_avail_cond); } } static void message_queue_put(struct message_queue *q, struct message *msg) { - pthread_mutex_lock(&q->lock); + mutex_lock(&q->lock); list_add_tail(&msg->list, &q->list); - pthread_cond_signal(&q->msg_avail_cond); - pthread_mutex_unlock(&q->lock); + condvar_signal(&q->msg_avail_cond); + mutex_unlock(&q->lock); } static struct message * @@ -136,25 +130,25 @@ message_queue_get(struct message_queue *q) { struct message *msg; - pthread_mutex_lock(&q->lock); + mutex_lock(&q->lock); while (list_empty(&q->list) && !q->terminating) - pthread_cond_wait(&q->msg_avail_cond, &q->lock); + condvar_wait(&q->msg_avail_cond, &q->lock); if (!q->terminating) { msg = list_entry(q->list.next, struct message, list); list_del(&msg->list); } else msg = NULL; - pthread_mutex_unlock(&q->lock); + mutex_unlock(&q->lock); return msg; } static void message_queue_terminate(struct message_queue *q) { - pthread_mutex_lock(&q->lock); + mutex_lock(&q->lock); q->terminating = true; - pthread_cond_broadcast(&q->msg_avail_cond); - pthread_mutex_unlock(&q->lock); + condvar_broadcast(&q->msg_avail_cond); + mutex_unlock(&q->lock); } static int @@ -248,7 +242,7 @@ parallel_chunk_compressor_destroy(struct chunk_compressor *_ctx) message_queue_terminate(&ctx->chunks_to_compress_queue); for (i = 0; i < ctx->num_started_threads; i++) - pthread_join(ctx->thread_data[i].thread, NULL); + thread_join(&ctx->thread_data[i].thread); } message_queue_destroy(&ctx->chunks_to_compress_queue); @@ -475,15 +469,10 @@ new_parallel_chunk_compressor(int out_ctype, u32 out_chunk_size, ctx->num_started_threads < num_threads; ctx->num_started_threads++) { - ret = pthread_create(&ctx->thread_data[ctx->num_started_threads].thread, - NULL, - compressor_thread_proc, - &ctx->thread_data[ctx->num_started_threads]); - if (ret) { - errno = ret; - WARNING_WITH_ERRNO("Failed to create compressor thread %u of %u", - ctx->num_started_threads + 1, - num_threads); + if (!thread_create(&ctx->thread_data[ctx->num_started_threads].thread, + compressor_thread_proc, + &ctx->thread_data[ctx->num_started_threads])) + { ret = WIMLIB_ERR_NOMEM; if (ctx->num_started_threads >= 2) break; diff --git a/src/mount_image.c b/src/mount_image.c index 8ad4fdc8..c90911e2 100644 --- a/src/mount_image.c +++ b/src/mount_image.c @@ -46,7 +46,6 @@ #include #include #include -#include #include #include #include @@ -61,6 +60,7 @@ #include "wimlib/paths.h" #include "wimlib/progress.h" #include "wimlib/reparse.h" +#include "wimlib/threads.h" #include "wimlib/timestamp.h" #include "wimlib/unix_data.h" #include "wimlib/write.h" @@ -2390,7 +2390,7 @@ do_unmount_commit(const char *dir, int unmount_flags, struct wimfs_unmount_info unmount_info; mqd_t mq; struct commit_progress_thread_args args; - pthread_t commit_progress_tid; + struct thread commit_progress_tid; int ret; memset(&unmount_info, 0, sizeof(unmount_info)); @@ -2409,11 +2409,8 @@ do_unmount_commit(const char *dir, int unmount_flags, args.mq = mq; args.progfunc = progfunc; args.progctx = progctx; - ret = pthread_create(&commit_progress_tid, NULL, - commit_progress_thread_proc, &args); - if (ret) { - errno = ret; - ERROR_WITH_ERRNO("Can't create thread"); + if (!thread_create(&commit_progress_tid, + commit_progress_thread_proc, &args)) { ret = WIMLIB_ERR_NOMEM; goto out_delete_mq; } @@ -2427,7 +2424,7 @@ do_unmount_commit(const char *dir, int unmount_flags, /* Terminate the progress thread. */ char empty[1]; mq_send(mq, empty, 0, 1); - pthread_join(commit_progress_tid, NULL); + thread_join(&commit_progress_tid); } out_delete_mq: if (progfunc) { diff --git a/src/threads.c b/src/threads.c new file mode 100644 index 00000000..8de7dcba --- /dev/null +++ b/src/threads.c @@ -0,0 +1,244 @@ +/* + * thread.c - Thread, mutex, and condition variable support. Wraps around + * pthreads or Windows native threads. + */ + +/* + * Copyright 2016-2023 Eric Biggers + * + * This file is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this file; if not, see http://www.gnu.org/licenses/. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#ifdef _WIN32 +# include "wimlib/win32_common.h" +#else +# include +# include +#endif + +#include "wimlib/assert.h" +#include "wimlib/error.h" +#include "wimlib/threads.h" +#include "wimlib/util.h" + +#ifdef _WIN32 + +static WINAPI DWORD +win32_thrproc(LPVOID lpParameter) +{ + struct thread *t = (struct thread *)lpParameter; + + (*t->thrproc)(t->arg); + return 0; +} + +bool thread_create(struct thread *t, void *(*thrproc)(void *), void *arg) +{ + HANDLE h; + + t->thrproc = thrproc; + t->arg = arg; + h = CreateThread(NULL, 0, win32_thrproc, (LPVOID)t, 0, NULL); + if (h == NULL) { + win32_error(GetLastError(), L"Failed to create thread"); + return false; + } + t->win32_thread = (void *)h; + return true; +} + +void thread_join(struct thread *t) +{ + DWORD res = WaitForSingleObject((HANDLE)t->win32_thread, INFINITE); + + wimlib_assert(res == WAIT_OBJECT_0); +} + +bool mutex_init(struct mutex *m) +{ + CRITICAL_SECTION *crit = MALLOC(sizeof(*crit)); + + if (!crit) + return false; + InitializeCriticalSection(crit); + m->win32_crit = crit; + return true; +} + +void mutex_destroy(struct mutex *m) +{ + DeleteCriticalSection(m->win32_crit); + FREE(m->win32_crit); + m->win32_crit = NULL; +} + +void mutex_lock(struct mutex *m) +{ + CRITICAL_SECTION *crit = m->win32_crit; + + if (unlikely(!crit)) { + CRITICAL_SECTION *old; + + crit = MALLOC(sizeof(*crit)); + wimlib_assert(crit != NULL); + InitializeCriticalSection(crit); + old = InterlockedCompareExchangePointer(&m->win32_crit, crit, + NULL); + if (old) { + DeleteCriticalSection(crit); + FREE(crit); + crit = old; + } + } + EnterCriticalSection(crit); +} + +void mutex_unlock(struct mutex *m) +{ + LeaveCriticalSection(m->win32_crit); +} + +bool condvar_init(struct condvar *c) +{ + CONDITION_VARIABLE *cond = MALLOC(sizeof(*cond)); + + if (!cond) + return false; + InitializeConditionVariable(cond); + c->win32_cond = cond; + return true; +} + +void condvar_destroy(struct condvar *c) +{ + FREE(c->win32_cond); + c->win32_cond = NULL; +} + +void condvar_wait(struct condvar *c, struct mutex *m) +{ + BOOL ok = SleepConditionVariableCS(c->win32_cond, m->win32_crit, + INFINITE); + wimlib_assert(ok); +} + +void condvar_signal(struct condvar *c) +{ + WakeConditionVariable(c->win32_cond); +} + +void condvar_broadcast(struct condvar *c) +{ + WakeAllConditionVariable(c->win32_cond); +} + +#else /* _WIN32 */ + +bool thread_create(struct thread *t, void *(*thrproc)(void *), void *arg) +{ + int err = pthread_create(&t->pthread, NULL, thrproc, arg); + + if (err) { + errno = err; + ERROR_WITH_ERRNO("Failed to create thread"); + return false; + } + return true; +} + +void thread_join(struct thread *t) +{ + int err = pthread_join(t->pthread, NULL); + + wimlib_assert(err == 0); +} + +bool mutex_init(struct mutex *m) +{ + int err = pthread_mutex_init(&m->pthread_mutex, NULL); + + if (err) { + errno = err; + ERROR_WITH_ERRNO("Failed to initialize mutex"); + return false; + } + return true; +} + +void mutex_destroy(struct mutex *m) +{ + int err = pthread_mutex_destroy(&m->pthread_mutex); + + wimlib_assert(err == 0); +} + +void mutex_lock(struct mutex *m) +{ + int err = pthread_mutex_lock(&m->pthread_mutex); + + wimlib_assert(err == 0); +} + +void mutex_unlock(struct mutex *m) +{ + int err = pthread_mutex_unlock(&m->pthread_mutex); + + wimlib_assert(err == 0); +} + +bool condvar_init(struct condvar *c) +{ + int err = pthread_cond_init(&c->pthread_cond, NULL); + + if (err) { + errno = err; + ERROR_WITH_ERRNO("Failed to initialize condition variable"); + return false; + } + return true; +} + +void condvar_destroy(struct condvar *c) +{ + int err = pthread_cond_destroy(&c->pthread_cond); + + wimlib_assert(err == 0); +} + +void condvar_wait(struct condvar *c, struct mutex *m) +{ + int err = pthread_cond_wait(&c->pthread_cond, &m->pthread_mutex); + + wimlib_assert(err == 0); +} + +void condvar_signal(struct condvar *c) +{ + int err = pthread_cond_signal(&c->pthread_cond); + + wimlib_assert(err == 0); +} + +void condvar_broadcast(struct condvar *c) +{ + int err = pthread_cond_broadcast(&c->pthread_cond); + + wimlib_assert(err == 0); +} + +#endif /* !_WIN32 */ diff --git a/src/wim.c b/src/wim.c index 69001122..b1902f41 100644 --- a/src/wim.c +++ b/src/wim.c @@ -25,7 +25,6 @@ #include #include -#include #include #include @@ -39,6 +38,7 @@ #include "wimlib/integrity.h" #include "wimlib/metadata.h" #include "wimlib/security.h" +#include "wimlib/threads.h" #include "wimlib/wim.h" #include "wimlib/xml.h" #include "wimlib/win32.h" @@ -943,7 +943,7 @@ wimlib_get_version_string(void) } static bool lib_initialized = false; -static pthread_mutex_t lib_initialization_mutex = PTHREAD_MUTEX_INITIALIZER; +static struct mutex lib_initialization_mutex = MUTEX_INITIALIZER; /* API function documented in wimlib.h */ WIMLIBAPI int @@ -954,7 +954,7 @@ wimlib_global_init(int init_flags) if (lib_initialized) goto out; - pthread_mutex_lock(&lib_initialization_mutex); + mutex_lock(&lib_initialization_mutex); if (lib_initialized) goto out_unlock; @@ -993,7 +993,7 @@ wimlib_global_init(int init_flags) lib_initialized = true; ret = 0; out_unlock: - pthread_mutex_unlock(&lib_initialization_mutex); + mutex_unlock(&lib_initialization_mutex); out: return ret; } @@ -1005,7 +1005,7 @@ wimlib_global_cleanup(void) if (!lib_initialized) return; - pthread_mutex_lock(&lib_initialization_mutex); + mutex_lock(&lib_initialization_mutex); if (!lib_initialized) goto out_unlock; @@ -1019,5 +1019,5 @@ wimlib_global_cleanup(void) lib_initialized = false; out_unlock: - pthread_mutex_unlock(&lib_initialization_mutex); + mutex_unlock(&lib_initialization_mutex); } diff --git a/src/win32_vss.c b/src/win32_vss.c index 0c146b4a..04e81acb 100644 --- a/src/win32_vss.c +++ b/src/win32_vss.c @@ -29,9 +29,9 @@ #include "wimlib/win32_common.h" #include -#include #include "wimlib/error.h" +#include "wimlib/threads.h" #include "wimlib/util.h" #include "wimlib/win32_vss.h" @@ -215,7 +215,7 @@ struct IVssBackupComponentsVTable { *----------------------------------------------------------------------------*/ static bool vss_initialized; -static pthread_mutex_t vss_initialization_mutex = PTHREAD_MUTEX_INITIALIZER; +static struct mutex vss_initialization_mutex = MUTEX_INITIALIZER; /* vssapi.dll */ static HANDLE hVssapi; @@ -285,10 +285,10 @@ vss_global_init(void) if (vss_initialized) return true; - pthread_mutex_lock(&vss_initialization_mutex); + mutex_lock(&vss_initialization_mutex); if (!vss_initialized) vss_initialized = vss_global_init_impl(); - pthread_mutex_unlock(&vss_initialization_mutex); + mutex_unlock(&vss_initialization_mutex); if (vss_initialized) return true; @@ -303,14 +303,14 @@ vss_global_cleanup(void) if (!vss_initialized) return; - pthread_mutex_lock(&vss_initialization_mutex); + mutex_lock(&vss_initialization_mutex); if (vss_initialized) { (*func_CoUninitialize)(); FreeLibrary(hOle32); FreeLibrary(hVssapi); vss_initialized = false; } - pthread_mutex_unlock(&vss_initialization_mutex); + mutex_unlock(&vss_initialization_mutex); } /*----------------------------------------------------------------------------* diff --git a/tools/windeps/Makefile b/tools/windeps/Makefile index 732e3174..8e883275 100644 --- a/tools/windeps/Makefile +++ b/tools/windeps/Makefile @@ -10,13 +10,9 @@ # ARCHITECTURES := i686 x86_64 -LIBXML2_VERSION := 2.10.3 -WINPTHREADS_VERSION := 10.0.0 +LIBXML2_VERSION := 2.10.3 LIBXML_URL := https://download.gnome.org/sources/libxml2/2.10/libxml2-$(LIBXML2_VERSION).tar.xz -WINPTHREADS_URL := http://downloads.sourceforge.net/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v$(WINPTHREADS_VERSION).tar.bz2 - - LIBXML_SRCDIR := libxml2-$(LIBXML2_VERSION) LIBXML_DIST := $(LIBXML_SRCDIR).tar.xz SRCDIR_TARGETS += $(LIBXML_SRCDIR) @@ -28,18 +24,6 @@ $(LIBXML_SRCDIR):$(LIBXML_DIST) checksums_verified cp $@/Copyright COPYING.libxml2 MAKE_CLEAN_FILES += $(LIBXML_SRCDIR) COPYING.libxml2 -WINPTHREADS_DIST := mingw-w64-v$(WINPTHREADS_VERSION).tar.bz2 -WINPTHREADS_SRCDIR := winpthreads-$(WINPTHREADS_VERSION) -SRCDIR_TARGETS += $(WINPTHREADS_SRCDIR) -DIST_TARGETS += $(WINPTHREADS_DIST) -$(WINPTHREADS_DIST): - wget $(WINPTHREADS_URL) -$(WINPTHREADS_SRCDIR):$(WINPTHREADS_DIST) checksums_verified - tar xvf $< - cp -aT mingw-w64-v$(WINPTHREADS_VERSION)/mingw-w64-libraries/winpthreads $@ - cp $@/COPYING COPYING.winpthreads -MAKE_CLEAN_FILES += $(WINPTHREADS_SRCDIR) mingw-w64-v$(WINPTHREADS_VERSION) COPYING.winpthreads - checksums_verified:$(DIST_TARGETS) sha256sum -c sha256sums @@ -69,35 +53,11 @@ $(1)_BUILD_TARGETS += libxml_$(1) MAKE_CLEAN_FILES += build_libxml_$(1) endef -# -# declare_winpthreads_target(arch) -# -define declare_winpthreads_target -winpthreads_$(1):$(WINPTHREADS_SRCDIR) - builddir=build_winpthreads_$(1); \ - rm -rf $$$$builddir; \ - cp -r $(WINPTHREADS_SRCDIR) $$$$builddir; \ - cd $$$$builddir; \ - ./configure \ - --host=$(1)-w64-mingw32 \ - --enable-static \ - --disable-shared \ - --prefix=$$$$PWD/../sysroot_$(1) \ - CFLAGS=-O2; \ - $(MAKE) install; \ - sed -i -e 's/if defined DLL_EXPORT/if 0/' \ - ../sysroot_$(1)/include/pthread.h; - -$(1)_BUILD_TARGETS += winpthreads_$(1) -MAKE_CLEAN_FILES += build_winpthreads_$(1) -endef - # # declare_arch_targets(arch) # define declare_arch_targets $(eval $(call declare_libxml_target,$(1))) -$(eval $(call declare_winpthreads_target,$(1))) sysroot_$(1): $($(1)_BUILD_TARGETS) diff --git a/tools/windeps/sha256sums b/tools/windeps/sha256sums index 33e9f34e..2318951c 100644 --- a/tools/windeps/sha256sums +++ b/tools/windeps/sha256sums @@ -1,2 +1 @@ 5d2cc3d78bec3dbe212a9d7fa629ada25a7da928af432c93060ff5c17ee28a9c libxml2-2.10.3.tar.xz -ba6b430aed72c63a3768531f6a3ffc2b0fde2c57a3b251450dcf489a894f0894 mingw-w64-v10.0.0.tar.bz2 -- 2.43.0