mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-25 14:54:39 +02:00
Fix build 32-bit binary failure under unix-like shell (Git Bash)
Read Windows environment variables correct also for unix-like shell. Fix #10885, close #10886
This commit is contained in:
parent
6df3db124f
commit
3d5aa49cdd
@ -64,6 +64,9 @@ endif
|
|||||||
# preparations
|
# preparations
|
||||||
#
|
#
|
||||||
|
|
||||||
|
# detect Windows directory
|
||||||
|
WIN_DIR := $(or $(windir),$(WINDIR))
|
||||||
|
|
||||||
# detect target CPU
|
# detect target CPU
|
||||||
TARGET_CPU := $(firstword $(subst -, ,$(shell $(CXX) -dumpmachine)))
|
TARGET_CPU := $(firstword $(subst -, ,$(shell $(CXX) -dumpmachine)))
|
||||||
ifeq "$(TARGET_CPU)" ""
|
ifeq "$(TARGET_CPU)" ""
|
||||||
@ -75,7 +78,7 @@ endif
|
|||||||
ifeq "$(TARGET_CPU)" "i686"
|
ifeq "$(TARGET_CPU)" "i686"
|
||||||
# for some reason i686 versions of MinGW-w64 GCC don't include a linking library for SensApi.dll
|
# for some reason i686 versions of MinGW-w64 GCC don't include a linking library for SensApi.dll
|
||||||
# thus it is generated on the fly, but first check if the DLL is available
|
# thus it is generated on the fly, but first check if the DLL is available
|
||||||
ifeq "$(wildcard $(windir)/system32/SensApi.dll)" ""
|
ifeq "$(wildcard $(WIN_DIR)/system32/SensApi.dll)" ""
|
||||||
$(error $(TARGET_CPU) build requires "%windir%/system32/SensApi.dll" to be present)
|
$(error $(TARGET_CPU) build requires "%windir%/system32/SensApi.dll" to be present)
|
||||||
endif
|
endif
|
||||||
# detect explicit definition of TARGET_CPU via command line to force a 32-bit build
|
# detect explicit definition of TARGET_CPU via command line to force a 32-bit build
|
||||||
@ -123,7 +126,7 @@ AT := @
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# detect the current operating system
|
# detect the current operating system
|
||||||
ifeq "$(windir)" ""
|
ifeq "$(WIN_DIR)" ""
|
||||||
# not a Windows system
|
# not a Windows system
|
||||||
MKDIR := mkdir -p
|
MKDIR := mkdir -p
|
||||||
CPDIR := cp -r
|
CPDIR := cp -r
|
||||||
@ -133,11 +136,14 @@ RM := rm -f
|
|||||||
normalize-path = $1
|
normalize-path = $1
|
||||||
else ifneq "$(wildcard $(dir $(SHELL))ls.exe)" ""
|
else ifneq "$(wildcard $(dir $(SHELL))ls.exe)" ""
|
||||||
# a Windows system with a proper shell
|
# a Windows system with a proper shell
|
||||||
MKDIR := $(dir $(SHELL))mkdir.exe -p
|
NULL :=
|
||||||
CPDIR := $(dir $(SHELL))cp.exe -r
|
SPACE := $(NULL) $(NULL)
|
||||||
RMDIR := $(dir $(SHELL))rm.exe -rf
|
SHELL_DIRECTORY := $(subst _,$(SPACE),$(dir $(subst $(SPACE),_,$(SHELL))))
|
||||||
CP := $(dir $(SHELL))cp.exe
|
MKDIR := $(SHELL_DIRECTORY)mkdir.exe -p
|
||||||
RM := $(dir $(SHELL))rm.exe -f
|
CPDIR := $(SHELL_DIRECTORY)cp.exe -r
|
||||||
|
RMDIR := $(SHELL_DIRECTORY)rm.exe -rf
|
||||||
|
CP := $(SHELL_DIRECTORY)cp.exe
|
||||||
|
RM := $(SHELL_DIRECTORY)rm.exe -f
|
||||||
normalize-path = $1
|
normalize-path = $1
|
||||||
else
|
else
|
||||||
# a standard Windows system
|
# a standard Windows system
|
||||||
@ -207,7 +213,7 @@ ifeq "$(TARGET_CPU)" "i686"
|
|||||||
$(TARGET_BINARY): $(BUILD_DIRECTORY)/libsensapi.a
|
$(TARGET_BINARY): $(BUILD_DIRECTORY)/libsensapi.a
|
||||||
$(BUILD_DIRECTORY)/libsensapi.a: | $(BUILD_DIRECTORY)
|
$(BUILD_DIRECTORY)/libsensapi.a: | $(BUILD_DIRECTORY)
|
||||||
@echo * generating $@
|
@echo * generating $@
|
||||||
$(AT)gendef $(call normalize-path,$(firstword $(wildcard $(windir)/syswow64/SensApi.dll $(windir)/system32/SensApi.dll)))
|
$(AT)gendef $(call normalize-path,$(firstword $(wildcard $(WIN_DIR)/syswow64/SensApi.dll $(WIN_DIR)/system32/SensApi.dll)))
|
||||||
$(AT)dlltool -mi386 -f--32 -d SensApi.def -k -l $(call normalize-path,$@)
|
$(AT)dlltool -mi386 -f--32 -d SensApi.def -k -l $(call normalize-path,$@)
|
||||||
$(AT)$(RM) SensApi.def
|
$(AT)$(RM) SensApi.def
|
||||||
endif
|
endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user