@@ -62,15 +62,15 @@ TOYBOX_SRC := $(TOYBOX_ROOT)/toybox-$(TOYBOX_VER)
6262
6363# ------------------------------------------------------------------------
6464# Detect the host system.
65- # On Windows the environment already sets OS = Windows_NT .
65+ # On Windows uname -s might return MINGW_NT-* or CYGWIN_NT-* .
6666# Otherwise let it default to the kernel name returned by uname -s
6767# (Linux, Darwin, FreeBSD, …).
6868# ------------------------------------------------------------------------
69- OS ? = $(shell uname -s)
69+ OS : = $(shell uname -s)
7070
7171# Windows does not allow symlink by default.
7272# Allow to override LN for AppArmor.
73- ifeq ( $( OS ),Windows_NT )
73+ ifneq (, $( findstring _NT, $( OS )) )
7474 LN ?= ln -f
7575endif
7676LN ?= ln -sf
@@ -195,7 +195,7 @@ HASHSUM_PROGS := \
195195
196196$(info Detected OS = $(OS))
197197
198- ifneq ( $( OS ),Windows_NT )
198+ ifeq (, $( findstring MINGW, $( OS )) )
199199 PROGS += $(UNIX_PROGS)
200200endif
201201ifeq ($(SELINUX_ENABLED ) ,1)
@@ -450,8 +450,12 @@ install: build install-manpages install-completions install-locales
450450 mkdir -p $(INSTALLDIR_BIN )
451451ifneq (,$(and $(findstring stdbuf,$(UTILS ) ) ,$(findstring feat_external_libstdbuf,$(CARGOFLAGS ) ) ) )
452452 mkdir -p $(DESTDIR)$(LIBSTDBUF_DIR)
453+ ifneq (,$(findstring CYGWIN,$(OS ) ) )
454+ $(INSTALL) -m 755 $(BUILDDIR)/deps/stdbuf.dll $(DESTDIR)$(LIBSTDBUF_DIR)/libstdbuf.dll
455+ else
453456 $(INSTALL) -m 755 $(BUILDDIR)/deps/libstdbuf.* $(DESTDIR)$(LIBSTDBUF_DIR)/
454457endif
458+ endif
455459ifeq (${MULTICALL}, y)
456460 $(INSTALL) -m 755 $(BUILDDIR)/coreutils $(INSTALLDIR_BIN)/$(PROG_PREFIX)coreutils
457461 $(foreach prog, $(filter-out coreutils, $(INSTALLEES)), \
472476endif
473477
474478uninstall :
475- ifneq ( $( OS ),Windows_NT )
479+ ifeq (, $( findstring MINGW, $( OS )) )
476480 rm -f $(DESTDIR)$(LIBSTDBUF_DIR)/libstdbuf.*
477481 -rm -d $(DESTDIR)$(LIBSTDBUF_DIR) 2>/dev/null || true
478482endif
0 commit comments