Some testing fixes for OSX.
This commit is contained in:
parent
af010712f3
commit
96389ef83b
16
Makefile
16
Makefile
|
@ -9,6 +9,14 @@ HEADERS = $(wildcard */*.h) $(wildcard *.h)
|
||||||
LIBS =
|
LIBS =
|
||||||
DEFINES = -DHAVE_CONFIG_H
|
DEFINES = -DHAVE_CONFIG_H
|
||||||
|
|
||||||
|
ifneq ($(findstring Darwin,$(shell uname -a)),)
|
||||||
|
OSX := 1
|
||||||
|
LIBS += -framework AppKit
|
||||||
|
OBJ += osx-glue.o
|
||||||
|
else
|
||||||
|
OSX := 0
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(HAVE_SRC), 1)
|
ifeq ($(HAVE_SRC), 1)
|
||||||
LIBS += $(SRC_LIBS)
|
LIBS += $(SRC_LIBS)
|
||||||
DEFINES += $(SRC_CFLAGS)
|
DEFINES += $(SRC_CFLAGS)
|
||||||
|
@ -36,7 +44,7 @@ ifeq ($(HAVE_ROAR), 1)
|
||||||
endif
|
endif
|
||||||
ifeq ($(HAVE_AL), 1)
|
ifeq ($(HAVE_AL), 1)
|
||||||
OBJ += audio/openal.o
|
OBJ += audio/openal.o
|
||||||
ifneq ($(findstring Darwin,$(shell uname -a)),)
|
ifeq ($(OSX),1)
|
||||||
LIBS += -framework OpenAL
|
LIBS += -framework OpenAL
|
||||||
else
|
else
|
||||||
LIBS += -lopenal
|
LIBS += -lopenal
|
||||||
|
@ -56,7 +64,7 @@ ifeq ($(HAVE_SDL), 1)
|
||||||
OBJ += gfx/gl.o input/sdl.o audio/sdl.o audio/buffer.o
|
OBJ += gfx/gl.o input/sdl.o audio/sdl.o audio/buffer.o
|
||||||
DEFINES += $(SDL_CFLAGS)
|
DEFINES += $(SDL_CFLAGS)
|
||||||
LIBS += $(SDL_LIBS)
|
LIBS += $(SDL_LIBS)
|
||||||
ifneq ($(findstring Darwin,$(shell uname -a)),)
|
ifeq ($(OSX),1)
|
||||||
LIBS += -framework OpenGL
|
LIBS += -framework OpenGL
|
||||||
else
|
else
|
||||||
LIBS += -lGL
|
LIBS += -lGL
|
||||||
|
@ -124,6 +132,10 @@ tools/ssnes-joyconfig: $(JOYCONFIG_OBJ)
|
||||||
$(Q)$(CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
|
$(Q)$(CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
|
||||||
@$(if $(Q), $(shell echo echo CC $<),)
|
@$(if $(Q), $(shell echo echo CC $<),)
|
||||||
|
|
||||||
|
%.o: %.m
|
||||||
|
$(Q)$(CC) -c -o $@ $<
|
||||||
|
@$(if $(Q), $(shell echo echo CC $<),)
|
||||||
|
|
||||||
install: $(TARGET)
|
install: $(TARGET)
|
||||||
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
||||||
mkdir -p $(DESTDIR)/etc
|
mkdir -p $(DESTDIR)/etc
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
static NSAutoreleasePool * pool;
|
||||||
|
void init_ns_pool()
|
||||||
|
{
|
||||||
|
pool = [[NSAutoreleasePool alloc] init];
|
||||||
|
}
|
||||||
|
|
||||||
|
void deinit_ns_pool()
|
||||||
|
{
|
||||||
|
[pool release];
|
||||||
|
}
|
||||||
|
|
18
ssnes.c
18
ssnes.c
|
@ -35,6 +35,12 @@
|
||||||
#include <samplerate.h>
|
#include <samplerate.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __APPLE__
|
||||||
|
void NSApplicationLoad(void);
|
||||||
|
void init_ns_pool(void);
|
||||||
|
void deinit_ns_pool(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
struct global g_extern = {
|
struct global g_extern = {
|
||||||
.video_active = true,
|
.video_active = true,
|
||||||
.audio_active = true,
|
.audio_active = true,
|
||||||
|
@ -945,6 +951,11 @@ static void do_state_checks(void)
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
#ifdef __APPLE__ // Very unix-y indeed...
|
||||||
|
NSApplicationLoad();
|
||||||
|
init_ns_pool();
|
||||||
|
#endif
|
||||||
|
|
||||||
parse_input(argc, argv);
|
parse_input(argc, argv);
|
||||||
parse_config();
|
parse_config();
|
||||||
init_dlsym();
|
init_dlsym();
|
||||||
|
@ -1015,6 +1026,10 @@ int main(int argc, char *argv[])
|
||||||
uninit_drivers();
|
uninit_drivers();
|
||||||
uninit_dlsym();
|
uninit_dlsym();
|
||||||
|
|
||||||
|
#ifdef __APPLE__
|
||||||
|
deinit_ns_pool();
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
|
@ -1023,6 +1038,9 @@ error:
|
||||||
uninit_drivers();
|
uninit_drivers();
|
||||||
uninit_dlsym();
|
uninit_dlsym();
|
||||||
|
|
||||||
|
#ifdef __APPLE__
|
||||||
|
deinit_ns_pool();
|
||||||
|
#endif
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue