use gcc 7.4.0 for LEGACY_OSX_BUILD

This commit is contained in:
alex-free 2020-12-08 12:36:12 -05:00
parent 84a3e6e953
commit 5e182e0ac9
2 changed files with 23 additions and 3 deletions

View File

@ -30,6 +30,9 @@ TARGET_WEB ?= 0
# Makeflag to enable OSX fixes
OSX_BUILD ?= 0
# Makeflag to enable OSX fixes on older versions
LEGACY_OSX_BUILD ?= 0
# Specify the target you are building for, TARGET_BITS=0 means native
TARGET_ARCH ?= native
TARGET_BITS ?= 0
@ -191,7 +194,7 @@ ifeq ($(TARGET_RPI),1) # Define RPi to change SDL2 title & GLES2 hints
VERSION_CFLAGS += -DUSE_GLES
endif
ifeq ($(OSX_BUILD),1) # Modify GFX & SDL2 for OSX GL
ifeq (,$(filter 1,$(OSX_BUILD)$(LEGACY_OSX_BUILD))) # Modify GFX & SDL2 for OSX GL
VERSION_CFLAGS += -DOSX_BUILD
endif
@ -433,7 +436,7 @@ ENDIAN_BITWIDTH := $(BUILD_DIR)/endian-and-bitwidth
AS := $(CROSS)as
ifeq ($(OSX_BUILD),1)
ifeq (,$(filter 1,$(OSX_BUILD)$(LEGACY_OSX_BUILD)))
AS := i686-w64-mingw32-as
endif
@ -467,6 +470,12 @@ else ifeq ($(OSX_BUILD),1)
CPP := cpp-9 -P
OBJDUMP := i686-w64-mingw32-objdump
OBJCOPY := i686-w64-mingw32-objcopy
else ifeq ($(LEGACY_OSX_BUILD),1)
CC := gcc
LD := $(CC)
CPP := cpp -P
OBJDUMP := i686-w64-mingw32-objdump
OBJCOPY := i686-w64-mingw32-objcopy
else # Linux & other builds
CPP := $(CROSS)cpp -P
OBJCOPY := $(CROSS)objcopy
@ -499,7 +508,7 @@ else ifeq ($(findstring SDL,$(WINDOW_API)),SDL)
BACKEND_LDFLAGS += -lglew32 -lglu32 -lopengl32
else ifeq ($(TARGET_RPI),1)
BACKEND_LDFLAGS += -lGLESv2
else ifeq ($(OSX_BUILD),1)
else ifeq (,$(filter 1,$(OSX_BUILD)$(LEGACY_OSX_BUILD)))
BACKEND_LDFLAGS += -framework OpenGL `pkg-config --libs glew`
else
BACKEND_LDFLAGS += -lGL
@ -537,6 +546,10 @@ ifneq ($(SDL1_USED)$(SDL2_USED),00)
endif
endif
ifeq ($(LEGACY_OSX_BUILD),1)
BACKEND_CFLAGS += -I/usr/local/include
endif
ifeq ($(WINDOWS_BUILD),1)
CC_CHECK := $(CC) -fsyntax-only -fsigned-char $(BACKEND_CFLAGS) $(INCLUDE_CFLAGS) -Wall -Wextra -Wno-format-security $(VERSION_CFLAGS) $(GRUCODE_CFLAGS)
CFLAGS := $(OPT_FLAGS) $(INCLUDE_CFLAGS) $(BACKEND_CFLAGS) $(VERSION_CFLAGS) $(GRUCODE_CFLAGS) -fno-strict-aliasing -fwrapv
@ -636,6 +649,9 @@ else ifeq ($(TARGET_RPI),1)
else ifeq ($(OSX_BUILD),1)
LDFLAGS := -lm $(BACKEND_LDFLAGS) -no-pie -lpthread
else ifeq ($(LEGACY_OSX_BUILD),1)
LDFLAGS := -lm $(BACKEND_LDFLAGS) -fno-pie -lpthread
else
LDFLAGS := $(BITS) -march=$(TARGET_ARCH) -lm $(BACKEND_LDFLAGS) -no-pie -lpthread

View File

@ -266,7 +266,11 @@ void main_func(void) {
#endif
}
#if defined(WAPI_SDL1) && defined(__APPLE__)
int SDL_main(int argc, char *argv[]) {
#else
int main(int argc, char *argv[]) {
#endif
parse_cli_opts(argc, argv);
main_func();
return 0;