diff --git a/polymer/eduke32/Makefile b/polymer/eduke32/Makefile index 29d608d9f..f0b2bf3cf 100644 --- a/polymer/eduke32/Makefile +++ b/polymer/eduke32/Makefile @@ -292,7 +292,7 @@ ifeq (1,$(RELEASE)) endif endif ifeq ($(PLATFORM),DARWIN) - cp -rf "Apple/bundles/EDuke32.app" "./" + cp -RPf "Apple/bundles/EDuke32.app" "./" mkdir -p "EDuke32.app/Contents/MacOS" cp -f "eduke32$(EXESUFFIX)" "EDuke32.app/Contents/MacOS/" endif @@ -306,7 +306,7 @@ ifeq (1,$(RELEASE)) endif endif ifeq ($(PLATFORM),DARWIN) - cp -rf "Apple/bundles/Mapster32.app" "./" + cp -RPf "Apple/bundles/Mapster32.app" "./" mkdir -p "Mapster32.app/Contents/MacOS" cp -f "mapster32$(EXESUFFIX)" "Mapster32.app/Contents/MacOS/" endif diff --git a/polymer/eduke32/Makefile.common b/polymer/eduke32/Makefile.common index 2017a6d5d..18054564a 100644 --- a/polymer/eduke32/Makefile.common +++ b/polymer/eduke32/Makefile.common @@ -147,18 +147,24 @@ else W_NO_UNUSED_RESULT := endif +W_STRICT_OVERFLOW := -Wstrict-overflow=1 +ifeq (3,$(GCC_MAJOR)) + W_STRICT_OVERFLOW := +endif +ifeq ($(PLATFORM),DARWIN) + ifeq (1,$(DARWIN9)) + W_STRICT_OVERFLOW := + endif +endif + BASECFLAGS=$(debug) -W -Wall -Wimplicit -Werror-implicit-function-declaration \ -funsigned-char -fno-strict-aliasing -DNO_GCC_BUILTINS -D_FORTIFY_SOURCE=2 \ $(F_JUMP_TABLES) $(W_NO_UNUSED_RESULT) $(ARCH) \ - -Wextra #-Wwrite-strings -Waddress -Wlogical-op + -Wextra $(W_STRICT_OVERFLOW) #-Wwrite-strings -Waddress -Wlogical-op ifeq ($(CC),clang) BASECFLAGS+= -Wno-unused-value -Wno-parentheses endif -ifneq (3,$(GCC_MAJOR)) - BASECFLAGS+= -Wstrict-overflow=1 -endif - ifneq (0,$(USE_LIBPNG)) BASECFLAGS+= -DUSE_LIBPNG endif diff --git a/polymer/eduke32/build/Makefile.shared b/polymer/eduke32/build/Makefile.shared index fec4d87a0..e3cb99be8 100644 --- a/polymer/eduke32/build/Makefile.shared +++ b/polymer/eduke32/build/Makefile.shared @@ -95,11 +95,22 @@ ifeq ($(PLATFORM),LINUX) endif endif ifeq ($(PLATFORM),DARWIN) + DARWINVERSION?=$(strip $(shell uname -r | cut -d . -f 1)) + ifeq (1,$(strip $(shell expr $(DARWINVERSION) \< 10))) + DARWIN9 = 1 + endif + RENDERTYPE = SDL STDCPPLIB = -lstdc++ BUILDCFLAGS += -DHAVE_INTTYPES #-fno-leading-underscore GTKCOMPAT32 = 0 SDL_FRAMEWORK = 1 + + ifeq (1,$(DARWIN9)) + BUILDCFLAGS += -DDARWIN9 + F_JUMP_TABLES := + endif + ifeq (1,$(BUILD32_ON_64)) BUILDCFLAGS += $(F_NO_STACK_PROTECTOR) -arch i386 else diff --git a/polymer/eduke32/osxbuild.sh b/polymer/eduke32/osxbuild.sh index 4ef7ea4d3..25e62c01a 100755 --- a/polymer/eduke32/osxbuild.sh +++ b/polymer/eduke32/osxbuild.sh @@ -106,10 +106,10 @@ fi # Duplicating .app bundles for debug build: # if [ -d "Mapster32.app" ]; then - # cp "Mapster32.app" "Mapster32.debug.app" + # cp -RP "Mapster32.app" "Mapster32.debug.app" # fi # if [ -d "EDuke32.app" ]; then - # cp "EDuke32.app" "EDuke32.debug.app" + # cp -RP "EDuke32.app" "EDuke32.debug.app" # fi # Almost done... diff --git a/polymer/eduke32/source/sdlmusic.c b/polymer/eduke32/source/sdlmusic.c index 63b9c4af6..58c52f7d4 100644 --- a/polymer/eduke32/source/sdlmusic.c +++ b/polymer/eduke32/source/sdlmusic.c @@ -179,15 +179,15 @@ int32_t MUSIC_Init(int32_t SoundCard, int32_t Address) sz = (numargs+2)*sizeof(char *) + (c-command+1); sz = ((sz+pagesize-1)/pagesize)*pagesize; -# ifdef NEDMALLOC +#if defined(NEDMALLOC) || (defined(__APPLE__) && defined(DARWIN9)) external_midi_argv = Bcalloc(1,sz+pagesize); if (!external_midi_argv) goto fallback; external_midi_argv = (char **)((intptr_t)external_midi_argv + (pagesize-(((intptr_t)external_midi_argv)&(pagesize-1)))); -# else +#else if (posix_memalign((void **)&external_midi_argv, pagesize, sz)) goto fallback; -# endif +#endif cmd = (char *)external_midi_argv + (numargs+2)*sizeof(char *); Bmemcpy(cmd, command, c-command+1);