winpthreads: Regenerate configure and Makefile.in

Signed-off-by: LIU Hao <lh_mouse@126.com>
diff --git a/mingw-w64-libraries/winpthreads/Makefile.in b/mingw-w64-libraries/winpthreads/Makefile.in
index 758e45e..bc9fd2e 100644
--- a/mingw-w64-libraries/winpthreads/Makefile.in
+++ b/mingw-w64-libraries/winpthreads/Makefile.in
@@ -90,11 +90,7 @@
 POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
-@MSVC_TRUE@am__append_1 = -W3
-@MSVC_TRUE@am__append_2 = -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_DECLARE_NONSTDC_NAMES -D_CRT_SECURE_NO_WARNINGS
-@MSVC_FALSE@am__append_3 = -Wall
-@MSVC_FALSE@am__append_4 = -D__USE_MINGW_ANSI_STDIO=0
-@MSVC_FALSE@am__append_5 = -L$(builddir)/fakelib -Wc,-no-pthread
+@MSVC_FALSE@am__append_1 = -L$(builddir)/fakelib -Wc,-no-pthread
 subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
@@ -164,12 +160,13 @@
 am_fakelib_libgcc_s_a_OBJECTS =
 fakelib_libgcc_s_a_OBJECTS = $(am_fakelib_libgcc_s_a_OBJECTS)
 libwinpthread_la_LIBADD =
-am_libwinpthread_la_OBJECTS = src/libwinpthread_la-barrier.lo \
-	src/libwinpthread_la-cond.lo src/libwinpthread_la-misc.lo \
-	src/libwinpthread_la-mutex.lo src/libwinpthread_la-rwlock.lo \
-	src/libwinpthread_la-sem.lo src/libwinpthread_la-spinlock.lo \
-	src/libwinpthread_la-sched.lo src/libwinpthread_la-time.lo \
-	src/libwinpthread_la-thread.lo src/version.lo
+am_libwinpthread_la_OBJECTS = src/libwinpthread_la-affinity.lo \
+	src/libwinpthread_la-barrier.lo src/libwinpthread_la-cond.lo \
+	src/libwinpthread_la-misc.lo src/libwinpthread_la-mutex.lo \
+	src/libwinpthread_la-rwlock.lo src/libwinpthread_la-sem.lo \
+	src/libwinpthread_la-spinlock.lo src/libwinpthread_la-sched.lo \
+	src/libwinpthread_la-time.lo src/libwinpthread_la-thread.lo \
+	src/version.lo
 libwinpthread_la_OBJECTS = $(am_libwinpthread_la_OBJECTS)
 AM_V_lt = $(am__v_lt_@AM_V@)
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
@@ -177,8 +174,8 @@
 am__v_lt_1 = 
 libwinpthread_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
 	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
-	$(AM_CFLAGS) $(CFLAGS) $(libwinpthread_la_LDFLAGS) $(LDFLAGS) \
-	-o $@
+	$(libwinpthread_la_CFLAGS) $(CFLAGS) \
+	$(libwinpthread_la_LDFLAGS) $(LDFLAGS) -o $@
 AM_V_P = $(am__v_P_@AM_V@)
 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
 am__v_P_0 = false
@@ -194,7 +191,8 @@
 DEFAULT_INCLUDES = -I.@am__isrc@
 depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
 am__maybe_remake_depfiles = depfiles
-am__depfiles_remade = src/$(DEPDIR)/libwinpthread_la-barrier.Plo \
+am__depfiles_remade = src/$(DEPDIR)/libwinpthread_la-affinity.Plo \
+	src/$(DEPDIR)/libwinpthread_la-barrier.Plo \
 	src/$(DEPDIR)/libwinpthread_la-cond.Plo \
 	src/$(DEPDIR)/libwinpthread_la-misc.Plo \
 	src/$(DEPDIR)/libwinpthread_la-mutex.Plo \
@@ -352,9 +350,11 @@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
 CPPFLAGS = @CPPFLAGS@
+CRT_DEFINES = @CRT_DEFINES@
 CSCOPE = @CSCOPE@
 CTAGS = @CTAGS@
 CYGPATH_W = @CYGPATH_W@
+DEFAULT_WARNINGS = @DEFAULT_WARNINGS@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DLLTOOL = @DLLTOOL@
@@ -379,6 +379,7 @@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LINKER_SUBSYSTEM = @LINKER_SUBSYSTEM@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
@@ -463,8 +464,12 @@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 SUBDIRS = . tests
-AM_CFLAGS = $(am__append_1) $(am__append_3)
 ACLOCAL_AMFLAGS = -I m4
+
+# Global compiler and linker flags are set in configure.ac
+AM_CPPFLAGS = @CRT_DEFINES@
+AM_CFLAGS = @DEFAULT_WARNINGS@
+AM_LDFLAGS = @LINKER_SUBSYSTEM@
 lib_LTLIBRARIES = libwinpthread.la
 include_HEADERS = \
   include/pthread.h        \
@@ -476,6 +481,7 @@
   include/semaphore.h
 
 libwinpthread_la_SOURCES = \
+  src/affinity.c                \
   src/barrier.c   src/barrier.h \
   src/cond.c      src/cond.h    \
   src/misc.c      src/misc.h    \
@@ -489,10 +495,10 @@
   src/wpth_ver.h                \
   src/version.rc
 
-libwinpthread_la_CPPFLAGS = -I$(srcdir)/include -DIN_WINPTHREAD \
-	$(am__append_2) $(am__append_4)
-libwinpthread_la_LDFLAGS = -no-undefined -version-info 1:0:0 \
-	$(am__append_5)
+libwinpthread_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/include -DIN_WINPTHREAD
+libwinpthread_la_CFLAGS = $(AM_CFLAGS)
+libwinpthread_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined -version-info \
+	1:0:0 $(am__append_1)
 @MSVC_FALSE@EXTRA_libwinpthread_la_DEPENDENCIES = fakelib/libgcc.a  fakelib/libgcc_eh.a  fakelib/libgcc_s.a
 
 # Break circular dep on bootstrap
@@ -634,6 +640,8 @@
 src/$(DEPDIR)/$(am__dirstamp):
 	@$(MKDIR_P) src/$(DEPDIR)
 	@: > src/$(DEPDIR)/$(am__dirstamp)
+src/libwinpthread_la-affinity.lo: src/$(am__dirstamp) \
+	src/$(DEPDIR)/$(am__dirstamp)
 src/libwinpthread_la-barrier.lo: src/$(am__dirstamp) \
 	src/$(DEPDIR)/$(am__dirstamp)
 src/libwinpthread_la-cond.lo: src/$(am__dirstamp) \
@@ -668,6 +676,7 @@
 distclean-compile:
 	-rm -f *.tab.c
 
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libwinpthread_la-affinity.Plo@am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libwinpthread_la-barrier.Plo@am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libwinpthread_la-cond.Plo@am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libwinpthread_la-misc.Plo@am__quote@ # am--include-marker
@@ -735,75 +744,82 @@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
 
+src/libwinpthread_la-affinity.lo: src/affinity.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(libwinpthread_la_CFLAGS) $(CFLAGS) -MT src/libwinpthread_la-affinity.lo -MD -MP -MF src/$(DEPDIR)/libwinpthread_la-affinity.Tpo -c -o src/libwinpthread_la-affinity.lo `test -f 'src/affinity.c' || echo '$(srcdir)/'`src/affinity.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) src/$(DEPDIR)/libwinpthread_la-affinity.Tpo src/$(DEPDIR)/libwinpthread_la-affinity.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='src/affinity.c' object='src/libwinpthread_la-affinity.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(libwinpthread_la_CFLAGS) $(CFLAGS) -c -o src/libwinpthread_la-affinity.lo `test -f 'src/affinity.c' || echo '$(srcdir)/'`src/affinity.c
+
 src/libwinpthread_la-barrier.lo: src/barrier.c
-@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/libwinpthread_la-barrier.lo -MD -MP -MF src/$(DEPDIR)/libwinpthread_la-barrier.Tpo -c -o src/libwinpthread_la-barrier.lo `test -f 'src/barrier.c' || echo '$(srcdir)/'`src/barrier.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(libwinpthread_la_CFLAGS) $(CFLAGS) -MT src/libwinpthread_la-barrier.lo -MD -MP -MF src/$(DEPDIR)/libwinpthread_la-barrier.Tpo -c -o src/libwinpthread_la-barrier.lo `test -f 'src/barrier.c' || echo '$(srcdir)/'`src/barrier.c
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) src/$(DEPDIR)/libwinpthread_la-barrier.Tpo src/$(DEPDIR)/libwinpthread_la-barrier.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='src/barrier.c' object='src/libwinpthread_la-barrier.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/libwinpthread_la-barrier.lo `test -f 'src/barrier.c' || echo '$(srcdir)/'`src/barrier.c
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(libwinpthread_la_CFLAGS) $(CFLAGS) -c -o src/libwinpthread_la-barrier.lo `test -f 'src/barrier.c' || echo '$(srcdir)/'`src/barrier.c
 
 src/libwinpthread_la-cond.lo: src/cond.c
-@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/libwinpthread_la-cond.lo -MD -MP -MF src/$(DEPDIR)/libwinpthread_la-cond.Tpo -c -o src/libwinpthread_la-cond.lo `test -f 'src/cond.c' || echo '$(srcdir)/'`src/cond.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(libwinpthread_la_CFLAGS) $(CFLAGS) -MT src/libwinpthread_la-cond.lo -MD -MP -MF src/$(DEPDIR)/libwinpthread_la-cond.Tpo -c -o src/libwinpthread_la-cond.lo `test -f 'src/cond.c' || echo '$(srcdir)/'`src/cond.c
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) src/$(DEPDIR)/libwinpthread_la-cond.Tpo src/$(DEPDIR)/libwinpthread_la-cond.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='src/cond.c' object='src/libwinpthread_la-cond.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/libwinpthread_la-cond.lo `test -f 'src/cond.c' || echo '$(srcdir)/'`src/cond.c
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(libwinpthread_la_CFLAGS) $(CFLAGS) -c -o src/libwinpthread_la-cond.lo `test -f 'src/cond.c' || echo '$(srcdir)/'`src/cond.c
 
 src/libwinpthread_la-misc.lo: src/misc.c
-@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/libwinpthread_la-misc.lo -MD -MP -MF src/$(DEPDIR)/libwinpthread_la-misc.Tpo -c -o src/libwinpthread_la-misc.lo `test -f 'src/misc.c' || echo '$(srcdir)/'`src/misc.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(libwinpthread_la_CFLAGS) $(CFLAGS) -MT src/libwinpthread_la-misc.lo -MD -MP -MF src/$(DEPDIR)/libwinpthread_la-misc.Tpo -c -o src/libwinpthread_la-misc.lo `test -f 'src/misc.c' || echo '$(srcdir)/'`src/misc.c
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) src/$(DEPDIR)/libwinpthread_la-misc.Tpo src/$(DEPDIR)/libwinpthread_la-misc.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='src/misc.c' object='src/libwinpthread_la-misc.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/libwinpthread_la-misc.lo `test -f 'src/misc.c' || echo '$(srcdir)/'`src/misc.c
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(libwinpthread_la_CFLAGS) $(CFLAGS) -c -o src/libwinpthread_la-misc.lo `test -f 'src/misc.c' || echo '$(srcdir)/'`src/misc.c
 
 src/libwinpthread_la-mutex.lo: src/mutex.c
-@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/libwinpthread_la-mutex.lo -MD -MP -MF src/$(DEPDIR)/libwinpthread_la-mutex.Tpo -c -o src/libwinpthread_la-mutex.lo `test -f 'src/mutex.c' || echo '$(srcdir)/'`src/mutex.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(libwinpthread_la_CFLAGS) $(CFLAGS) -MT src/libwinpthread_la-mutex.lo -MD -MP -MF src/$(DEPDIR)/libwinpthread_la-mutex.Tpo -c -o src/libwinpthread_la-mutex.lo `test -f 'src/mutex.c' || echo '$(srcdir)/'`src/mutex.c
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) src/$(DEPDIR)/libwinpthread_la-mutex.Tpo src/$(DEPDIR)/libwinpthread_la-mutex.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='src/mutex.c' object='src/libwinpthread_la-mutex.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/libwinpthread_la-mutex.lo `test -f 'src/mutex.c' || echo '$(srcdir)/'`src/mutex.c
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(libwinpthread_la_CFLAGS) $(CFLAGS) -c -o src/libwinpthread_la-mutex.lo `test -f 'src/mutex.c' || echo '$(srcdir)/'`src/mutex.c
 
 src/libwinpthread_la-rwlock.lo: src/rwlock.c
-@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/libwinpthread_la-rwlock.lo -MD -MP -MF src/$(DEPDIR)/libwinpthread_la-rwlock.Tpo -c -o src/libwinpthread_la-rwlock.lo `test -f 'src/rwlock.c' || echo '$(srcdir)/'`src/rwlock.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(libwinpthread_la_CFLAGS) $(CFLAGS) -MT src/libwinpthread_la-rwlock.lo -MD -MP -MF src/$(DEPDIR)/libwinpthread_la-rwlock.Tpo -c -o src/libwinpthread_la-rwlock.lo `test -f 'src/rwlock.c' || echo '$(srcdir)/'`src/rwlock.c
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) src/$(DEPDIR)/libwinpthread_la-rwlock.Tpo src/$(DEPDIR)/libwinpthread_la-rwlock.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='src/rwlock.c' object='src/libwinpthread_la-rwlock.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/libwinpthread_la-rwlock.lo `test -f 'src/rwlock.c' || echo '$(srcdir)/'`src/rwlock.c
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(libwinpthread_la_CFLAGS) $(CFLAGS) -c -o src/libwinpthread_la-rwlock.lo `test -f 'src/rwlock.c' || echo '$(srcdir)/'`src/rwlock.c
 
 src/libwinpthread_la-sem.lo: src/sem.c
-@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/libwinpthread_la-sem.lo -MD -MP -MF src/$(DEPDIR)/libwinpthread_la-sem.Tpo -c -o src/libwinpthread_la-sem.lo `test -f 'src/sem.c' || echo '$(srcdir)/'`src/sem.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(libwinpthread_la_CFLAGS) $(CFLAGS) -MT src/libwinpthread_la-sem.lo -MD -MP -MF src/$(DEPDIR)/libwinpthread_la-sem.Tpo -c -o src/libwinpthread_la-sem.lo `test -f 'src/sem.c' || echo '$(srcdir)/'`src/sem.c
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) src/$(DEPDIR)/libwinpthread_la-sem.Tpo src/$(DEPDIR)/libwinpthread_la-sem.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='src/sem.c' object='src/libwinpthread_la-sem.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/libwinpthread_la-sem.lo `test -f 'src/sem.c' || echo '$(srcdir)/'`src/sem.c
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(libwinpthread_la_CFLAGS) $(CFLAGS) -c -o src/libwinpthread_la-sem.lo `test -f 'src/sem.c' || echo '$(srcdir)/'`src/sem.c
 
 src/libwinpthread_la-spinlock.lo: src/spinlock.c
-@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/libwinpthread_la-spinlock.lo -MD -MP -MF src/$(DEPDIR)/libwinpthread_la-spinlock.Tpo -c -o src/libwinpthread_la-spinlock.lo `test -f 'src/spinlock.c' || echo '$(srcdir)/'`src/spinlock.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(libwinpthread_la_CFLAGS) $(CFLAGS) -MT src/libwinpthread_la-spinlock.lo -MD -MP -MF src/$(DEPDIR)/libwinpthread_la-spinlock.Tpo -c -o src/libwinpthread_la-spinlock.lo `test -f 'src/spinlock.c' || echo '$(srcdir)/'`src/spinlock.c
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) src/$(DEPDIR)/libwinpthread_la-spinlock.Tpo src/$(DEPDIR)/libwinpthread_la-spinlock.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='src/spinlock.c' object='src/libwinpthread_la-spinlock.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/libwinpthread_la-spinlock.lo `test -f 'src/spinlock.c' || echo '$(srcdir)/'`src/spinlock.c
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(libwinpthread_la_CFLAGS) $(CFLAGS) -c -o src/libwinpthread_la-spinlock.lo `test -f 'src/spinlock.c' || echo '$(srcdir)/'`src/spinlock.c
 
 src/libwinpthread_la-sched.lo: src/sched.c
-@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/libwinpthread_la-sched.lo -MD -MP -MF src/$(DEPDIR)/libwinpthread_la-sched.Tpo -c -o src/libwinpthread_la-sched.lo `test -f 'src/sched.c' || echo '$(srcdir)/'`src/sched.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(libwinpthread_la_CFLAGS) $(CFLAGS) -MT src/libwinpthread_la-sched.lo -MD -MP -MF src/$(DEPDIR)/libwinpthread_la-sched.Tpo -c -o src/libwinpthread_la-sched.lo `test -f 'src/sched.c' || echo '$(srcdir)/'`src/sched.c
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) src/$(DEPDIR)/libwinpthread_la-sched.Tpo src/$(DEPDIR)/libwinpthread_la-sched.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='src/sched.c' object='src/libwinpthread_la-sched.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/libwinpthread_la-sched.lo `test -f 'src/sched.c' || echo '$(srcdir)/'`src/sched.c
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(libwinpthread_la_CFLAGS) $(CFLAGS) -c -o src/libwinpthread_la-sched.lo `test -f 'src/sched.c' || echo '$(srcdir)/'`src/sched.c
 
 src/libwinpthread_la-time.lo: src/time.c
-@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/libwinpthread_la-time.lo -MD -MP -MF src/$(DEPDIR)/libwinpthread_la-time.Tpo -c -o src/libwinpthread_la-time.lo `test -f 'src/time.c' || echo '$(srcdir)/'`src/time.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(libwinpthread_la_CFLAGS) $(CFLAGS) -MT src/libwinpthread_la-time.lo -MD -MP -MF src/$(DEPDIR)/libwinpthread_la-time.Tpo -c -o src/libwinpthread_la-time.lo `test -f 'src/time.c' || echo '$(srcdir)/'`src/time.c
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) src/$(DEPDIR)/libwinpthread_la-time.Tpo src/$(DEPDIR)/libwinpthread_la-time.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='src/time.c' object='src/libwinpthread_la-time.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/libwinpthread_la-time.lo `test -f 'src/time.c' || echo '$(srcdir)/'`src/time.c
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(libwinpthread_la_CFLAGS) $(CFLAGS) -c -o src/libwinpthread_la-time.lo `test -f 'src/time.c' || echo '$(srcdir)/'`src/time.c
 
 src/libwinpthread_la-thread.lo: src/thread.c
-@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/libwinpthread_la-thread.lo -MD -MP -MF src/$(DEPDIR)/libwinpthread_la-thread.Tpo -c -o src/libwinpthread_la-thread.lo `test -f 'src/thread.c' || echo '$(srcdir)/'`src/thread.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(libwinpthread_la_CFLAGS) $(CFLAGS) -MT src/libwinpthread_la-thread.lo -MD -MP -MF src/$(DEPDIR)/libwinpthread_la-thread.Tpo -c -o src/libwinpthread_la-thread.lo `test -f 'src/thread.c' || echo '$(srcdir)/'`src/thread.c
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) src/$(DEPDIR)/libwinpthread_la-thread.Tpo src/$(DEPDIR)/libwinpthread_la-thread.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='src/thread.c' object='src/libwinpthread_la-thread.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/libwinpthread_la-thread.lo `test -f 'src/thread.c' || echo '$(srcdir)/'`src/thread.c
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwinpthread_la_CPPFLAGS) $(CPPFLAGS) $(libwinpthread_la_CFLAGS) $(CFLAGS) -c -o src/libwinpthread_la-thread.lo `test -f 'src/thread.c' || echo '$(srcdir)/'`src/thread.c
 
 mostlyclean-libtool:
 	-rm -f *.lo
@@ -1188,7 +1204,8 @@
 
 distclean: distclean-recursive
 	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-		-rm -f src/$(DEPDIR)/libwinpthread_la-barrier.Plo
+		-rm -f src/$(DEPDIR)/libwinpthread_la-affinity.Plo
+	-rm -f src/$(DEPDIR)/libwinpthread_la-barrier.Plo
 	-rm -f src/$(DEPDIR)/libwinpthread_la-cond.Plo
 	-rm -f src/$(DEPDIR)/libwinpthread_la-misc.Plo
 	-rm -f src/$(DEPDIR)/libwinpthread_la-mutex.Plo
@@ -1248,7 +1265,8 @@
 maintainer-clean: maintainer-clean-recursive
 	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
 	-rm -rf $(top_srcdir)/autom4te.cache
-		-rm -f src/$(DEPDIR)/libwinpthread_la-barrier.Plo
+		-rm -f src/$(DEPDIR)/libwinpthread_la-affinity.Plo
+	-rm -f src/$(DEPDIR)/libwinpthread_la-barrier.Plo
 	-rm -f src/$(DEPDIR)/libwinpthread_la-cond.Plo
 	-rm -f src/$(DEPDIR)/libwinpthread_la-misc.Plo
 	-rm -f src/$(DEPDIR)/libwinpthread_la-mutex.Plo
diff --git a/mingw-w64-libraries/winpthreads/config.h.in b/mingw-w64-libraries/winpthreads/config.h.in
index 7b26283..080feaf 100644
--- a/mingw-w64-libraries/winpthreads/config.h.in
+++ b/mingw-w64-libraries/winpthreads/config.h.in
@@ -62,6 +62,9 @@
 /* Version number of package */
 #undef VERSION
 
+/* Minimal Windows NT version to be supported by the library */
+#undef WINPTHREADS_WINNT
+
 #ifdef DLL_EXPORT
 #define WINPTHREAD_API __declspec(dllexport)
 #else
diff --git a/mingw-w64-libraries/winpthreads/configure b/mingw-w64-libraries/winpthreads/configure
index 19d4d35..f4e3076 100755
--- a/mingw-w64-libraries/winpthreads/configure
+++ b/mingw-w64-libraries/winpthreads/configure
@@ -657,6 +657,9 @@
 am__EXEEXT_TRUE
 LTLIBOBJS
 LIBOBJS
+LINKER_SUBSYSTEM
+DEFAULT_WARNINGS
+CRT_DEFINES
 RC
 LT_SYS_LIBRARY_PATH
 OTOOL64
@@ -804,6 +807,7 @@
 with_gnu_ld
 with_sysroot
 enable_libtool_lock
+with_winnt
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1474,6 +1478,7 @@
   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
   --with-sysroot[=DIR]    Search for dependent libraries within DIR (or the
                           compiler's sysroot if not specified).
+  --with-winnt=VERSION    Minimal Windows NT version to support
 
 Some influential environment variables:
   CC          C compiler command
@@ -3287,7 +3292,25 @@
 
 
 
-# Checks for programs.
+# Validate $host_cpu and simplify it for use in later checks
+winpthreads_host=$host_cpu
+
+case $winpthreads_host in #(
+  i?86) :
+    winpthreads_host=x86 ;; #(
+  x86_64) :
+    winpthreads_host=x64 ;; #(
+  arm | armv7) :
+    winpthreads_host=arm32 ;; #(
+  aarch64) :
+    winpthreads_host=arm64 ;; #(
+  arm64ec) :
+    winpthreads_host=arm64ec ;; #(
+  *) :
+          as_fn_error $? "Unsupported host '$host'" "$LINENO" 5
+ ;;
+esac
+
 
 
 
@@ -14556,13 +14579,283 @@
 CFLAGS=$lt_save_CFLAGS
 
 
-# Checks for libraries.
 
-# Checks for header files.
+# Check whether --with-winnt was given.
+if test ${with_winnt+y}
+then :
+  withval=$with_winnt;   case $withval in #(
+  win10 | win8 | win8.1 | win7 | winvista | winxp | win2000 | nt4.0 | nt3.51 | nt3.5 | nt3.1) :
+    : ;; #(
+  *) :
+            as_fn_error $? "Invalid value '$withval' passed to --with-winnt option" "$LINENO" 5
+   ;;
+esac
+else case e in #(
+  e)   case $winpthreads_host in #(
+  x86) :
+    if test $msvc = yes
+then :
+  with_winnt=winxp
+else case e in #(
+  e)             with_winnt=nt3.1
+         ;;
+esac
+fi ;; #(
+  x64) :
+    with_winnt=winxp ;; #(
+  arm32) :
+    with_winnt=win8 ;; #(
+  arm64 | arm64ec) :
+    with_winnt=win10
+   ;; #(
+  *) :
+     ;;
+esac
+ ;;
+esac
+fi
 
-# Checks for typedefs, structures, and compiler characteristics.
 
-# Checks for library functions.
+# Major and minor subsystem versions corresponding to --with-winnt option
+subsystem_major=
+subsystem_minor=
+
+# `WINPTHREADS_WINNT_*` value corresponding to --with-winnt option;
+# see misc.h for valid values
+winpthreads_winnt=
+
+case $with_winnt in #(
+  win10) :
+    if # FIXME: mingw-w64 tools produce broken binaries when subsystem
+        # version is set to 6.3 or higher.
+        test $msvc = yes
+then :
+  subsystem_major=10
+          subsystem_minor=0
+else case e in #(
+  e)           subsystem_major=6
+          subsystem_minor=2
+       ;;
+esac
+fi
+      winpthreads_winnt=WINPTHREADS_WINNT_WIN10 ;; #(
+  win8.1) :
+    case $winpthreads_host in #(
+  x86 | x64 | arm32) :
+    # FIXME: mingw-w64 tools produce broken binaries when subsystem
+            # version is set to 6.3 or higher.
+            if test $msvc = yes
+then :
+  subsystem_major=6
+                subsystem_minor=3
+else case e in #(
+  e)                 subsystem_major=6
+                subsystem_minor=2
+             ;;
+esac
+fi
+            winpthreads_winnt=WINPTHREADS_WINNT_WIN8_1 ;; #(
+  *) :
+                as_fn_error $? "Windows 8.1 does not support running '$host_cpu' binaries" "$LINENO" 5
+       ;;
+esac ;; #(
+  win8) :
+    case $winpthreads_host in #(
+  x86 | x64 | arm32) :
+    subsystem_major=6
+            subsystem_minor=2
+            winpthreads_winnt=WINPTHREADS_WINNT_WIN8 ;; #(
+  *) :
+                as_fn_error $? "Windows 8 does not support running '$host_cpu' binaries" "$LINENO" 5
+       ;;
+esac ;; #(
+  win7) :
+    case $winpthreads_host in #(
+  x86 | x64) :
+    subsystem_major=6
+            subsystem_minor=1
+            winpthreads_winnt=WINPTHREADS_WINNT_WIN7 ;; #(
+  *) :
+                as_fn_error $? "Windows 7 does not support running '$host_cpu' binaries" "$LINENO" 5
+       ;;
+esac ;; #(
+  winvista) :
+    case $winpthreads_host in #(
+  x86 | x64) :
+    subsystem_major=6
+            subsystem_minor=0
+            winpthreads_winnt=WINPTHREADS_WINNT_VISTA ;; #(
+  *) :
+                as_fn_error $? "Windows Vista does not support running '$host_cpu' binaries" "$LINENO" 5
+       ;;
+esac ;; #(
+  winxp) :
+    case $winpthreads_host in #(
+  x86) :
+    subsystem_major=5
+            subsystem_minor=1
+            winpthreads_winnt=WINPTHREADS_WINNT_XP ;; #(
+  x64) :
+    subsystem_major=5
+            subsystem_minor=2
+            winpthreads_winnt=WINPTHREADS_WINNT_2003 ;; #(
+  *) :
+                as_fn_error $? "Windows XP does not support running '$host_cpu' binaries" "$LINENO" 5
+       ;;
+esac ;; #(
+  win2000) :
+    if test $winpthreads_host = x86
+then :
+  subsystem_major=5
+          subsystem_minor=0
+          winpthreads_winnt=WINPTHREADS_WINNT_2000
+else case e in #(
+  e)           as_fn_error $? "Windows 2000 does not support running '$host_cpu' binaries" "$LINENO" 5
+       ;;
+esac
+fi ;; #(
+  nt4.0) :
+    if test $winpthreads_host = x86
+then :
+  subsystem_major=4
+          subsystem_minor=0
+          winpthreads_winnt=WINPTHREADS_WINNT_NT_4
+else case e in #(
+  e)           as_fn_error $? "Windows NT 4.0 does not support running '$host_cpu' binaries" "$LINENO" 5
+       ;;
+esac
+fi ;; #(
+  nt3.51) :
+    if test $winpthreads_host = x86
+then :
+  subsystem_major=3
+          subsystem_minor=51
+          winpthreads_winnt=WINPTHREADS_WINNT_NT_3_51
+else case e in #(
+  e)           as_fn_error $? "Windows NT 3.51 does not support running '$host_cpu' binaries" "$LINENO" 5
+       ;;
+esac
+fi ;; #(
+  nt3.5) :
+    if test $winpthreads_host = x86
+then :
+  subsystem_major=3
+          subsystem_minor=50
+          winpthreads_winnt=WINPTHREADS_WINNT_NT_3_5
+else case e in #(
+  e)           as_fn_error $? "Windows NT 3.5 does not support running '$host_cpu' binaries" "$LINENO" 5
+       ;;
+esac
+fi ;; #(
+  nt3.1) :
+    if test $winpthreads_host = x86
+then :
+  subsystem_major=3
+          subsystem_minor=10
+          winpthreads_winnt=WINPTHREADS_WINNT_NT_3_1
+else case e in #(
+  e)           as_fn_error $? "Windows NT 3.1 does not support running '$host_cpu' binaries" "$LINENO" 5
+       ;;
+esac
+fi
+ ;; #(
+  *) :
+     ;;
+esac
+
+
+printf "%s\n" "#define WINPTHREADS_WINNT $winpthreads_winnt" >>confdefs.h
+
+
+CRT_DEFINES=
+DEFAULT_WARNINGS=
+LINKER_SUBSYSTEM=
+
+
+
+
+
+if test $msvc = yes
+then :
+  # Do not warn about using non-standard function names such as `strdup`
+    CRT_DEFINES="$CRT_DEFINES -D_CRT_NONSTDC_NO_WARNINGS"
+    # Make Windows SDK headers declare non-standard names;
+    # required if -Zc:__STDC__ option is used
+    CRT_DEFINES="$CRT_DEFINES -D_CRT_DECLARE_NONSTDC_NAMES"
+    # Do not warn about using "unsafe" functions
+    CRT_DEFINES="$CRT_DEFINES -D_CRT_SECURE_NO_WARNINGS"
+    # MSVC's -Wall enables _all_ warnings, which is too much
+    DEFAULT_WARNINGS='-W3'
+else case e in #(
+  e)     # Do not use mingw-w64 stdio functions
+    CRT_DEFINES="$CRT_DEFINES -D__USE_MINGW_ANSI_STDIO=0"
+    DEFAULT_WARNINGS='-Wall'
+ ;;
+esac
+fi
+
+# Figure out how to tell linker to set subsystem version
+winpthreads_subsystem=
+
+if test $msvc = yes
+then :
+  # The MSVC option has syntax
+    #
+    #   "/SUBSYSTEM:CONSOLE,major.minor"
+    #
+    # and must be passed as a single argument. We cannot pass it as
+    #
+    #   "-Wl,-SUBSYSTEM:CONSOLE,major.minor"
+    #
+    # because it will separate "major,minor" part, resulting in an error.
+    # A solution is to use -Xlinker option for the check.
+    #
+    # The /WX switch makes the linker treat warnings as errors; passing invalid
+    # subsystem version to /SUBSYSTEM switch results in a warning and linker
+    # simply uses the default subsystem version, which is not what we want.
+    winpthreads_subsystem="-Xlinker -WX -Xlinker -SUBSYSTEM:CONSOLE,$subsystem_major.$subsystem_minor"
+else case e in #(
+  e)     winpthreads_subsystem="-Wl,--subsystem,console:$subsystem_major.$subsystem_minor"
+ ;;
+esac
+fi
+
+if test $ac_no_link = no
+then :
+  save_LDFLAGS=$LDFLAGS
+    LDFLAGS="$LDFLAGS $winpthreads_subsystem"
+    if test x$ac_no_link = xyes; then
+  as_fn_error $? "link tests are not allowed after AC_NO_EXECUTABLES" "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int main (void) {return 0;}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+        LDFLAGS=$save_LDFLAGS
+else case e in #(
+  e)       as_fn_error $? "Linker cannot create binaries for '$with_winnt'" "$LINENO" 5
+     ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+
+fi
+
+# We cannot use "-Xlinker -SUBSYSTEM:CONSOLE,major.minor" when libtool is
+# involved because it converts it to -Wl switch. Use a hack to make it pass
+# "-Xlinker" and "-SUBSYSTEM:CONSOLE,major.minor" as two separate options to
+# the `compile` wrapper, which will then pass the option to the linker.
+if test $msvc = yes
+then :
+  winpthreads_subsystem="-Xcompiler -Xlinker -Xcompiler -SUBSYSTEM:CONSOLE,$subsystem_major.$subsystem_minor"
+
+fi
+
+LINKER_SUBSYSTEM="$LINKER_SUBSYSTEM $winpthreads_subsystem"
 
 # config.h
 
diff --git a/mingw-w64-libraries/winpthreads/tests/Makefile.in b/mingw-w64-libraries/winpthreads/tests/Makefile.in
index dea2f15..22b3ee3 100644
--- a/mingw-w64-libraries/winpthreads/tests/Makefile.in
+++ b/mingw-w64-libraries/winpthreads/tests/Makefile.in
@@ -87,9 +87,7 @@
 POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
-@MSVC_TRUE@am__append_1 = -W3 -D_CRT_SECURE_NO_WARNINGS
-@MSVC_FALSE@am__append_2 = -Wall
-@MSVC_FALSE@am__append_3 = -L$(top_builddir)/fakelib
+@MSVC_FALSE@am__append_1 = -L$(top_builddir)/fakelib
 check_PROGRAMS = benchtests/benchtest1$(EXEEXT) \
 	benchtests/benchtest2$(EXEEXT) benchtests/benchtest3$(EXEEXT) \
 	benchtests/benchtest4$(EXEEXT) benchtests/benchtest5$(EXEEXT) \
@@ -2039,9 +2037,11 @@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
 CPPFLAGS = @CPPFLAGS@
+CRT_DEFINES = @CRT_DEFINES@
 CSCOPE = @CSCOPE@
 CTAGS = @CTAGS@
 CYGPATH_W = @CYGPATH_W@
+DEFAULT_WARNINGS = @DEFAULT_WARNINGS@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DLLTOOL = @DLLTOOL@
@@ -2066,6 +2066,7 @@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LINKER_SUBSYSTEM = @LINKER_SUBSYSTEM@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
@@ -2149,9 +2150,11 @@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-AM_CPPFLAGS = -I. -I$(top_srcdir)/src -I$(top_srcdir)/include
-AM_CFLAGS = $(am__append_1) $(am__append_2)
-AM_LDFLAGS = -L$(top_builddir) $(am__append_3)
+
+# Global compiler and linker flags are set in configure.ac
+AM_CPPFLAGS = @CRT_DEFINES@ -I. -I$(top_srcdir)/src -I$(top_srcdir)/include
+AM_CFLAGS = @DEFAULT_WARNINGS@
+AM_LDFLAGS = @LINKER_SUBSYSTEM@ -L$(top_builddir) $(am__append_1)
 LDADD = $(top_builddir)/libwinpthread.la
 check_LIBRARIES = \
 	libbenchlib.a