Merge pull request #209 from coltongit/mxe-build-fix

Yet another MXE build fix
This commit is contained in:
zerocloude 2020-05-19 23:25:15 +09:00 committed by GitHub
commit da295dd349
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 40 additions and 9 deletions

View file

@ -35,21 +35,46 @@ NODRAWINGDISTANCE ?= 0
TEXTURE_FIX ?= 0 TEXTURE_FIX ?= 0
# Enable extended options menu by default # Enable extended options menu by default
EXT_OPTIONS_MENU ?= 1 EXT_OPTIONS_MENU ?= 1
# Disable no bzero/bcopy workaround by default
# Enable by default for MXE builds
ifeq ($(WINDOWS_BUILD),1)
ifeq ($(CROSS),i686-w64-mingw32.static-)
NO_BZERO_BCOPY := 1
else ifeq ($(CROSS),x86_64-w64-mingw32.static-)
NO_BZERO_BCOPY := 1
else
NO_BZERO_BCOPY ?= 0
endif
else
NO_BZERO_BCOPY ?= 0
endif
# Build for Emscripten/WebGL # Build for Emscripten/WebGL
TARGET_WEB ?= 0 TARGET_WEB ?= 0
# Specify the target you are building for, 0 means native # Specify the target you are building for, 0 means native
TARGET_ARCH ?= native ifeq ($(WINDOWS_BUILD),1)
ifeq ($(CROSS),i686-w64-mingw32.static-)
ifeq ($(CROSS),i686-w64-mingw32.static-)
TARGET_ARCH = i386pe TARGET_ARCH = i386pe
else ifeq ($(CROSS),x86_64-w64-mingw32.static-) else ifeq ($(CROSS),x86_64-w64-mingw32.static-)
TARGET_ARCH = i386pe TARGET_ARCH = i386pe
else
TARGET_ARCH ?= native
endif
else else
TARGET_ARCH = native TARGET_ARCH ?= native
endif endif
TARGET_BITS ?= 0 ifeq ($(WINDOWS_BUILD),1)
ifeq ($(CROSS),i686-w64-mingw32.static-)
TARGET_BITS = 32
else ifeq ($(CROSS),x86_64-w64-mingw32.static-)
TARGET_BITS = 64
else
TARGET_BITS ?= 0
endif
else
TARGET_BITS ?= 0
endif
ifneq ($(TARGET_BITS),0) ifneq ($(TARGET_BITS),0)
BITS := -m$(TARGET_BITS) BITS := -m$(TARGET_BITS)
@ -508,6 +533,12 @@ ifeq ($(EXT_OPTIONS_MENU),1)
CFLAGS += -DEXT_OPTIONS_MENU CFLAGS += -DEXT_OPTIONS_MENU
endif endif
# Check for no bzero/bcopy workaround option
ifeq ($(NO_BZERO_BCOPY),1)
CC_CHECK += -DNO_BZERO_BCOPY
CFLAGS += -DNO_BZERO_BCOPY
endif
ASFLAGS := -I include -I $(BUILD_DIR) $(VERSION_ASFLAGS) ASFLAGS := -I include -I $(BUILD_DIR) $(VERSION_ASFLAGS)
ifeq ($(TARGET_WEB),1) ifeq ($(TARGET_WEB),1)

View file

@ -10,7 +10,7 @@
// macOS libc has them // macOS libc has them
#include <strings.h> #include <strings.h>
#elif defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200809L) #elif defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200809L) || defined(NO_BZERO_BCOPY)
// there's no way that shit's defined, use memcpy/memset // there's no way that shit's defined, use memcpy/memset
#include <string.h> #include <string.h>