OS X: fix build under Leopard/Xcode 3.1.4

git-svn-id: https://svn.eduke32.com/eduke32@2432 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2012-03-09 07:43:49 +00:00
parent 8b25714262
commit 92b49b6938
5 changed files with 29 additions and 12 deletions

View file

@ -292,7 +292,7 @@ ifeq (1,$(RELEASE))
endif endif
endif endif
ifeq ($(PLATFORM),DARWIN) ifeq ($(PLATFORM),DARWIN)
cp -rf "Apple/bundles/EDuke32.app" "./" cp -RPf "Apple/bundles/EDuke32.app" "./"
mkdir -p "EDuke32.app/Contents/MacOS" mkdir -p "EDuke32.app/Contents/MacOS"
cp -f "eduke32$(EXESUFFIX)" "EDuke32.app/Contents/MacOS/" cp -f "eduke32$(EXESUFFIX)" "EDuke32.app/Contents/MacOS/"
endif endif
@ -306,7 +306,7 @@ ifeq (1,$(RELEASE))
endif endif
endif endif
ifeq ($(PLATFORM),DARWIN) ifeq ($(PLATFORM),DARWIN)
cp -rf "Apple/bundles/Mapster32.app" "./" cp -RPf "Apple/bundles/Mapster32.app" "./"
mkdir -p "Mapster32.app/Contents/MacOS" mkdir -p "Mapster32.app/Contents/MacOS"
cp -f "mapster32$(EXESUFFIX)" "Mapster32.app/Contents/MacOS/" cp -f "mapster32$(EXESUFFIX)" "Mapster32.app/Contents/MacOS/"
endif endif

View file

@ -147,18 +147,24 @@ else
W_NO_UNUSED_RESULT := W_NO_UNUSED_RESULT :=
endif 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 \ BASECFLAGS=$(debug) -W -Wall -Wimplicit -Werror-implicit-function-declaration \
-funsigned-char -fno-strict-aliasing -DNO_GCC_BUILTINS -D_FORTIFY_SOURCE=2 \ -funsigned-char -fno-strict-aliasing -DNO_GCC_BUILTINS -D_FORTIFY_SOURCE=2 \
$(F_JUMP_TABLES) $(W_NO_UNUSED_RESULT) $(ARCH) \ $(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) ifeq ($(CC),clang)
BASECFLAGS+= -Wno-unused-value -Wno-parentheses BASECFLAGS+= -Wno-unused-value -Wno-parentheses
endif endif
ifneq (3,$(GCC_MAJOR))
BASECFLAGS+= -Wstrict-overflow=1
endif
ifneq (0,$(USE_LIBPNG)) ifneq (0,$(USE_LIBPNG))
BASECFLAGS+= -DUSE_LIBPNG BASECFLAGS+= -DUSE_LIBPNG
endif endif

View file

@ -95,11 +95,22 @@ ifeq ($(PLATFORM),LINUX)
endif endif
endif endif
ifeq ($(PLATFORM),DARWIN) ifeq ($(PLATFORM),DARWIN)
DARWINVERSION?=$(strip $(shell uname -r | cut -d . -f 1))
ifeq (1,$(strip $(shell expr $(DARWINVERSION) \< 10)))
DARWIN9 = 1
endif
RENDERTYPE = SDL RENDERTYPE = SDL
STDCPPLIB = -lstdc++ STDCPPLIB = -lstdc++
BUILDCFLAGS += -DHAVE_INTTYPES #-fno-leading-underscore BUILDCFLAGS += -DHAVE_INTTYPES #-fno-leading-underscore
GTKCOMPAT32 = 0 GTKCOMPAT32 = 0
SDL_FRAMEWORK = 1 SDL_FRAMEWORK = 1
ifeq (1,$(DARWIN9))
BUILDCFLAGS += -DDARWIN9
F_JUMP_TABLES :=
endif
ifeq (1,$(BUILD32_ON_64)) ifeq (1,$(BUILD32_ON_64))
BUILDCFLAGS += $(F_NO_STACK_PROTECTOR) -arch i386 BUILDCFLAGS += $(F_NO_STACK_PROTECTOR) -arch i386
else else

View file

@ -106,10 +106,10 @@ fi
# Duplicating .app bundles for debug build: # Duplicating .app bundles for debug build:
# if [ -d "Mapster32.app" ]; then # if [ -d "Mapster32.app" ]; then
# cp "Mapster32.app" "Mapster32.debug.app" # cp -RP "Mapster32.app" "Mapster32.debug.app"
# fi # fi
# if [ -d "EDuke32.app" ]; then # if [ -d "EDuke32.app" ]; then
# cp "EDuke32.app" "EDuke32.debug.app" # cp -RP "EDuke32.app" "EDuke32.debug.app"
# fi # fi
# Almost done... # Almost done...

View file

@ -179,15 +179,15 @@ int32_t MUSIC_Init(int32_t SoundCard, int32_t Address)
sz = (numargs+2)*sizeof(char *) + (c-command+1); sz = (numargs+2)*sizeof(char *) + (c-command+1);
sz = ((sz+pagesize-1)/pagesize)*pagesize; sz = ((sz+pagesize-1)/pagesize)*pagesize;
# ifdef NEDMALLOC #if defined(NEDMALLOC) || (defined(__APPLE__) && defined(DARWIN9))
external_midi_argv = Bcalloc(1,sz+pagesize); external_midi_argv = Bcalloc(1,sz+pagesize);
if (!external_midi_argv) if (!external_midi_argv)
goto fallback; goto fallback;
external_midi_argv = (char **)((intptr_t)external_midi_argv + (pagesize-(((intptr_t)external_midi_argv)&(pagesize-1)))); 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)) if (posix_memalign((void **)&external_midi_argv, pagesize, sz))
goto fallback; goto fallback;
# endif #endif
cmd = (char *)external_midi_argv + (numargs+2)*sizeof(char *); cmd = (char *)external_midi_argv + (numargs+2)*sizeof(char *);
Bmemcpy(cmd, command, c-command+1); Bmemcpy(cmd, command, c-command+1);