From 3063b354e77ec53e1f260e6a9aeeac3333441285 Mon Sep 17 00:00:00 2001 From: David Voswinkel Date: Tue, 12 May 2009 23:17:44 +0200 Subject: [PATCH] o mac compiles --- tools/bsnes/Makefile | 63 +++++++++++-------- tools/bsnes/lib/ruby/audio/openal.cpp | 10 ++- tools/bsnes/lib/ruby/video/sdl.cpp | 2 +- tools/bsnes/ui_qt/Makefile | 22 ++++--- tools/bsnes/ui_qt/base/about.moc | 2 +- tools/bsnes/ui_qt/base/htmlviewer.moc | 2 +- tools/bsnes/ui_qt/base/loader.moc | 2 +- tools/bsnes/ui_qt/base/main.moc | 2 +- tools/bsnes/ui_qt/resource/resource.rcc | 12 ++-- tools/bsnes/ui_qt/settings/advanced.moc | 2 +- tools/bsnes/ui_qt/settings/audio.moc | 2 +- tools/bsnes/ui_qt/settings/cheateditor.moc | 2 +- tools/bsnes/ui_qt/settings/input.moc | 2 +- tools/bsnes/ui_qt/settings/paths.moc | 2 +- tools/bsnes/ui_qt/settings/settings.moc | 2 +- .../ui_qt/settings/utility/codeeditor.moc | 2 +- .../ui_qt/settings/utility/inputcapture.moc | 2 +- tools/bsnes/ui_qt/settings/video.moc | 2 +- 18 files changed, 75 insertions(+), 60 deletions(-) diff --git a/tools/bsnes/Makefile b/tools/bsnes/Makefile index 47cda8e..f1be501 100755 --- a/tools/bsnes/Makefile +++ b/tools/bsnes/Makefile @@ -2,7 +2,7 @@ include lib/nall/Makefile ui = ui_qt -platform=x +platform=mac compiler=gcc enable_gzip=false @@ -12,26 +12,46 @@ enable_gzip=false c := $(compiler) cpp := $(subst cc,++,$(compiler)) -flags := -ggdb -O3 -fomit-frame-pointer -Ilib \ --I/Developer/SDKs/Qt/include \ --I/Developer/SDKs/Qt/include/QtCore \ --I/Developer/SDKs/Qt/include/QtGui \ --I/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers \ --I/System/Library/Frameworks/AGL.framework/Headers \ --I/Developer/SDKs/Qt/include/QtOpenGL -I/usr/X11R6/include +flags := -ggdb -O3 -fomit-frame-pointer -Ilib + link := -# profile-guided instrumentation: -# flags += -fprofile-generate -# link += -lgcov - -# profile-guided optimization: -#flags += -fprofile-use - ################ ### platform ### ################ +ifeq ($(platform),mac) + flags +=-I/Developer/SDKs/Qt/include \ + -I/Developer/SDKs/Qt/include/QtCore \ + -I/Developer/SDKs/Qt/include/QtGui \ + -I/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers \ + -I/System/Library/Frameworks/AGL.framework/Headers \ + -I/System/Library/Frameworks/OpenAL.framework/Versions/A/Headers \ + -I/usr/X11R6/include \ + -I/opt/local/include + + link += -lz \ + -lm \ + -lao \ + -framework ApplicationServices \ + -framework OpenGL \ + -framework OpenAL \ + -framework AGL \ + -L/opt/local/lib \ + -lSDL -Wl,-framework,Cocoa \ + -lXext \ + -lgl \ + -lX11 + #ruby := video.glx video.sdl + #ruby += audio.openal audio.ao + #ruby += input.sdl + #-DVIDEO_GLX -DVIDEO_XV -DVIDEO_SDL -DAUDIO_ALS + #-DAUDIO_OPENAL -DAUDIO_OSS -DAUDIO_PULSEAUDIO + #-DAUDIO_AO -DINPUT_SDL -DINPUT_X + flags += -DVIDEO_SDL -DINPUT_SDL -DVIDEO_GLX -DAUDIO_AO -DAUDIO_OPENAL + +endif + ifeq ($(platform),x) ruby := video.glx video.xv video.sdl ruby += audio.alsa audio.openal audio.oss audio.pulseaudio audio.ao @@ -42,12 +62,9 @@ else ifeq ($(platform),win) ruby += input.rawinput input.directinput link += -mwindows -# link += -mconsole link += -luuid -lkernel32 -luser32 -lgdi32 -lshell32 # statically link Qt for Windows build link += -enable-stdcall-fixup -Wl,-s -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -else - unknown_platform: help; endif ############ @@ -110,8 +127,6 @@ all: build; include $(ui)/Makefile objects := $(patsubst %,obj/%.o,$(objects)) rubydef := $(foreach c,$(subst .,_,$(call strupper,$(ruby))),-D$c) -#-DVIDEO_GLX -DVIDEO_XV -DVIDEO_SDL -DAUDIO_ALSA -DAUDIO_OPENAL -DAUDIO_OSS -DAUDIO_PULSEAUDIO -DAUDIO_AO -DINPUT_SDL -DINPUT_X -rubydef =-DVIDEO_SDL -DINPUT_SDL ################# ### libraries ### ################# @@ -236,13 +251,7 @@ install: install -D -m 644 data/bsnes.desktop $(DESTDIR)$(prefix)/share/applications/bsnes.desktop clean: ui_clean - -@$(call delete,obj/*.o) - -@$(call delete,*.res) - -@$(call delete,*.pgd) - -@$(call delete,*.pgc) - -@$(call delete,*.ilk) - -@$(call delete,*.pdb) - -@$(call delete,*.manifest) + rm obj/*.o help: @echo "Usage: $(MAKE) platform=(os) compiler=(cc) [options]" diff --git a/tools/bsnes/lib/ruby/audio/openal.cpp b/tools/bsnes/lib/ruby/audio/openal.cpp index 69d811e..552fba1 100755 --- a/tools/bsnes/lib/ruby/audio/openal.cpp +++ b/tools/bsnes/lib/ruby/audio/openal.cpp @@ -1,6 +1,10 @@ -#include -#include - +#ifdef __APPLE__ + #include + #include +#else + #include + #include +#endif namespace ruby { #include "openal.hpp" diff --git a/tools/bsnes/lib/ruby/video/sdl.cpp b/tools/bsnes/lib/ruby/video/sdl.cpp index 3d80515..f91cac0 100755 --- a/tools/bsnes/lib/ruby/video/sdl.cpp +++ b/tools/bsnes/lib/ruby/video/sdl.cpp @@ -97,7 +97,7 @@ public: } bool init() { - display = XOpenDisplay(0); + //display = XOpenDisplay(0); char env[512]; sprintf(env, "SDL_WINDOWID=%ld", settings.handle); diff --git a/tools/bsnes/ui_qt/Makefile b/tools/bsnes/ui_qt/Makefile index e5d9e42..49678d7 100755 --- a/tools/bsnes/ui_qt/Makefile +++ b/tools/bsnes/ui_qt/Makefile @@ -7,18 +7,20 @@ endif ifeq ($(rcc),) rcc := rcc endif - -ifeq ($(platform),x) + +ifeq ($(platform),x) #qtflags = `pkg-config --cflags QtCore QtGui` link += `pkg-config --libs QtCore QtGui` - qtflags = -I/Developer/SDKs/Qt/include -I/Developer/SDKs/Qt/include/QtCore -I/Developer/SDKs/Qt/include/QtGui -I/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers -I/System/Library/Frameworks/AGL.framework/Headers -I/Developer/SDKs/Qt/include/QtOpenGL - - link = -F/Developer/SDKs/Qt/lib -L/Developer/SDKs/Qt/lib -framework QtOpenGL -L/Developer/SDKs/Qt/lib -F/Developer/SDKs/Qt/lib -framework QtGui -framework Carbon -framework AppKit -framework QtCore -lz -lm -framework ApplicationServices -framework OpenGL -framework AGL -L/opt/local/lib -lSDLmain -lSDL -Wl,-framework,Cocoa -lXext -lX11 -lz - - link = -F/Developer/SDKs/Qt/lib -L/Developer/SDKs/Qt/lib -framework QtOpenGL -L/Developer/SDKs/Qt/lib -F/Developer/SDKs/Qt/lib -framework QtGui -framework Carbon -framework AppKit -framework QtCore -lz -lm -framework ApplicationServices -framework OpenGL -framework AGL -L/opt/local/lib -lSDL -Wl,-framework,Cocoa -lXext -lX11 -lz -lgl - - - +else ifeq ($(platform),mac) + qtflags = -I/Developer/SDKs/Qt/include \ + -I/Developer/SDKs/Qt/include/QtCore \ + -I/Developer/SDKs/Qt/include/QtGui + link += -F/Developer/SDKs/Qt/lib \ + -L/Developer/SDKs/Qt/lib \ + -framework QtGui \ + -framework Carbon \ + -framework AppKit \ + -framework QtCore else ifeq ($(platform),win) ifeq ($(qtpath),) # find Qt install directory from PATH environment variable diff --git a/tools/bsnes/ui_qt/base/about.moc b/tools/bsnes/ui_qt/base/about.moc index 71b34ee..d909a86 100644 --- a/tools/bsnes/ui_qt/base/about.moc +++ b/tools/bsnes/ui_qt/base/about.moc @@ -1,7 +1,7 @@ /**************************************************************************** ** Meta object code from reading C++ file 'about.mh' ** -** Created: Sun May 10 13:18:12 2009 +** Created: Tue May 12 22:50:12 2009 ** by: The Qt Meta Object Compiler version 59 (Qt 4.4.3) ** ** WARNING! All changes made in this file will be lost! diff --git a/tools/bsnes/ui_qt/base/htmlviewer.moc b/tools/bsnes/ui_qt/base/htmlviewer.moc index 1be63ce..4c963e3 100644 --- a/tools/bsnes/ui_qt/base/htmlviewer.moc +++ b/tools/bsnes/ui_qt/base/htmlviewer.moc @@ -1,7 +1,7 @@ /**************************************************************************** ** Meta object code from reading C++ file 'htmlviewer.mh' ** -** Created: Sun May 10 13:18:12 2009 +** Created: Tue May 12 22:50:12 2009 ** by: The Qt Meta Object Compiler version 59 (Qt 4.4.3) ** ** WARNING! All changes made in this file will be lost! diff --git a/tools/bsnes/ui_qt/base/loader.moc b/tools/bsnes/ui_qt/base/loader.moc index 97b99f6..01809e7 100644 --- a/tools/bsnes/ui_qt/base/loader.moc +++ b/tools/bsnes/ui_qt/base/loader.moc @@ -1,7 +1,7 @@ /**************************************************************************** ** Meta object code from reading C++ file 'loader.mh' ** -** Created: Sun May 10 13:18:12 2009 +** Created: Tue May 12 22:50:12 2009 ** by: The Qt Meta Object Compiler version 59 (Qt 4.4.3) ** ** WARNING! All changes made in this file will be lost! diff --git a/tools/bsnes/ui_qt/base/main.moc b/tools/bsnes/ui_qt/base/main.moc index 48e76fc..54bafe9 100644 --- a/tools/bsnes/ui_qt/base/main.moc +++ b/tools/bsnes/ui_qt/base/main.moc @@ -1,7 +1,7 @@ /**************************************************************************** ** Meta object code from reading C++ file 'main.mh' ** -** Created: Sun May 10 13:18:12 2009 +** Created: Tue May 12 22:50:12 2009 ** by: The Qt Meta Object Compiler version 59 (Qt 4.4.3) ** ** WARNING! All changes made in this file will be lost! diff --git a/tools/bsnes/ui_qt/resource/resource.rcc b/tools/bsnes/ui_qt/resource/resource.rcc index d7db447..67a169a 100644 --- a/tools/bsnes/ui_qt/resource/resource.rcc +++ b/tools/bsnes/ui_qt/resource/resource.rcc @@ -1,7 +1,7 @@ /**************************************************************************** ** Resource object code ** -** Created: Sun May 10 13:18:11 2009 +** Created: Tue May 12 22:50:12 2009 ** by: The Resource Compiler for Qt version 4.4.3 ** ** WARNING! All changes made in this file will be lost! @@ -10,7 +10,7 @@ #include static const unsigned char qt_resource_data[] = { - // /Users/david/Devel/arch/snes/tools/bsnes_v046/data/bsnes.png + // /Users/david/Devel/arch/avr/code/snesram/tools/bsnes/data/bsnes.png 0x0,0x0,0x5,0x58, 0x89, 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, @@ -99,7 +99,7 @@ static const unsigned char qt_resource_data[] = { 0xc4,0x61,0x33,0x7e,0x6,0x76,0x38,0x47,0x2d,0x59,0x64,0x91,0x45,0x16,0x59,0x74, 0x4,0xfe,0x5,0x58,0xa9,0xdf,0x6f,0x25,0x7,0x15,0xfd,0x0,0x0,0x0,0x0,0x49, 0x45,0x4e,0x44,0xae,0x42,0x60,0x82, - // /Users/david/Devel/arch/snes/tools/bsnes_v046/data/logo.png + // /Users/david/Devel/arch/avr/code/snesram/tools/bsnes/data/logo.png 0x0,0x0,0x41,0x5d, 0x89, 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, @@ -1148,7 +1148,7 @@ static const unsigned char qt_resource_data[] = { 0x17,0x2e,0x5c,0xb8,0x70,0xe1,0xc2,0x85,0xb,0x17,0x2e,0x5c,0xb8,0x70,0xe1,0xc2, 0x85,0xb,0x17,0x2e,0xa1,0x90,0xff,0x3,0x15,0x25,0x67,0x62,0x74,0x7b,0xa4,0xa3, 0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, - // /Users/david/Devel/arch/snes/tools/bsnes_v046/data/documentation.html + // /Users/david/Devel/arch/avr/code/snesram/tools/bsnes/data/documentation.html 0x0,0x0,0x9,0xc0, 0x3c, 0x21,0x44,0x4f,0x43,0x54,0x59,0x50,0x45,0x20,0x68,0x74,0x6d,0x6c,0x3e,0xa,0x3c, @@ -1307,7 +1307,7 @@ static const unsigned char qt_resource_data[] = { 0x6c,0x6c,0x3b,0x20,0x54,0x52,0x41,0x43,0x3c,0x62,0x72,0x3e,0xa,0x26,0x62,0x75, 0x6c,0x6c,0x3b,0x20,0x7a,0x6f,0x6e,0x65,0x73,0x3c,0x62,0x72,0x3e,0xa,0xa,0x3c, 0x2f,0x62,0x6f,0x64,0x79,0x3e,0xa,0x3c,0x2f,0x68,0x74,0x6d,0x6c,0x3e,0xa, - // /Users/david/Devel/arch/snes/tools/bsnes_v046/data/license.html + // /Users/david/Devel/arch/avr/code/snesram/tools/bsnes/data/license.html 0x0,0x0,0xf,0x51, 0x3c, 0x21,0x44,0x4f,0x43,0x54,0x59,0x50,0x45,0x20,0x68,0x74,0x6d,0x6c,0x3e,0xa,0x3c, @@ -1556,7 +1556,7 @@ static const unsigned char qt_resource_data[] = { 0x3c,0x2f,0x74,0x72,0x3e,0xa,0x3c,0x2f,0x74,0x61,0x62,0x6c,0x65,0x3e,0xa,0xa, 0x3c,0x2f,0x62,0x6f,0x64,0x79,0x3e,0xa,0x3c,0x2f,0x68,0x74,0x6d,0x6c,0x3e,0xa, - // /Users/david/Devel/arch/snes/tools/bsnes_v046/data/joypad.png + // /Users/david/Devel/arch/avr/code/snesram/tools/bsnes/data/joypad.png 0x0,0x1,0x91,0x7a, 0x89, 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, diff --git a/tools/bsnes/ui_qt/settings/advanced.moc b/tools/bsnes/ui_qt/settings/advanced.moc index 0d00572..ca9f93d 100644 --- a/tools/bsnes/ui_qt/settings/advanced.moc +++ b/tools/bsnes/ui_qt/settings/advanced.moc @@ -1,7 +1,7 @@ /**************************************************************************** ** Meta object code from reading C++ file 'advanced.mh' ** -** Created: Sun May 10 13:18:12 2009 +** Created: Tue May 12 22:50:12 2009 ** by: The Qt Meta Object Compiler version 59 (Qt 4.4.3) ** ** WARNING! All changes made in this file will be lost! diff --git a/tools/bsnes/ui_qt/settings/audio.moc b/tools/bsnes/ui_qt/settings/audio.moc index e9775cd..dae3d26 100644 --- a/tools/bsnes/ui_qt/settings/audio.moc +++ b/tools/bsnes/ui_qt/settings/audio.moc @@ -1,7 +1,7 @@ /**************************************************************************** ** Meta object code from reading C++ file 'audio.mh' ** -** Created: Sun May 10 13:18:12 2009 +** Created: Tue May 12 22:50:12 2009 ** by: The Qt Meta Object Compiler version 59 (Qt 4.4.3) ** ** WARNING! All changes made in this file will be lost! diff --git a/tools/bsnes/ui_qt/settings/cheateditor.moc b/tools/bsnes/ui_qt/settings/cheateditor.moc index cde1948..792ca5d 100644 --- a/tools/bsnes/ui_qt/settings/cheateditor.moc +++ b/tools/bsnes/ui_qt/settings/cheateditor.moc @@ -1,7 +1,7 @@ /**************************************************************************** ** Meta object code from reading C++ file 'cheateditor.mh' ** -** Created: Sun May 10 13:18:13 2009 +** Created: Tue May 12 22:50:12 2009 ** by: The Qt Meta Object Compiler version 59 (Qt 4.4.3) ** ** WARNING! All changes made in this file will be lost! diff --git a/tools/bsnes/ui_qt/settings/input.moc b/tools/bsnes/ui_qt/settings/input.moc index 6052261..687d6de 100644 --- a/tools/bsnes/ui_qt/settings/input.moc +++ b/tools/bsnes/ui_qt/settings/input.moc @@ -1,7 +1,7 @@ /**************************************************************************** ** Meta object code from reading C++ file 'input.mh' ** -** Created: Sun May 10 13:18:13 2009 +** Created: Tue May 12 22:50:12 2009 ** by: The Qt Meta Object Compiler version 59 (Qt 4.4.3) ** ** WARNING! All changes made in this file will be lost! diff --git a/tools/bsnes/ui_qt/settings/paths.moc b/tools/bsnes/ui_qt/settings/paths.moc index 1745b99..efa9845 100644 --- a/tools/bsnes/ui_qt/settings/paths.moc +++ b/tools/bsnes/ui_qt/settings/paths.moc @@ -1,7 +1,7 @@ /**************************************************************************** ** Meta object code from reading C++ file 'paths.mh' ** -** Created: Sun May 10 13:18:13 2009 +** Created: Tue May 12 22:50:12 2009 ** by: The Qt Meta Object Compiler version 59 (Qt 4.4.3) ** ** WARNING! All changes made in this file will be lost! diff --git a/tools/bsnes/ui_qt/settings/settings.moc b/tools/bsnes/ui_qt/settings/settings.moc index e9d0dad..d41f586 100644 --- a/tools/bsnes/ui_qt/settings/settings.moc +++ b/tools/bsnes/ui_qt/settings/settings.moc @@ -1,7 +1,7 @@ /**************************************************************************** ** Meta object code from reading C++ file 'settings.mh' ** -** Created: Sun May 10 13:18:13 2009 +** Created: Tue May 12 22:50:12 2009 ** by: The Qt Meta Object Compiler version 59 (Qt 4.4.3) ** ** WARNING! All changes made in this file will be lost! diff --git a/tools/bsnes/ui_qt/settings/utility/codeeditor.moc b/tools/bsnes/ui_qt/settings/utility/codeeditor.moc index 45bda96..21226b0 100644 --- a/tools/bsnes/ui_qt/settings/utility/codeeditor.moc +++ b/tools/bsnes/ui_qt/settings/utility/codeeditor.moc @@ -1,7 +1,7 @@ /**************************************************************************** ** Meta object code from reading C++ file 'codeeditor.mh' ** -** Created: Sun May 10 13:18:13 2009 +** Created: Tue May 12 22:50:12 2009 ** by: The Qt Meta Object Compiler version 59 (Qt 4.4.3) ** ** WARNING! All changes made in this file will be lost! diff --git a/tools/bsnes/ui_qt/settings/utility/inputcapture.moc b/tools/bsnes/ui_qt/settings/utility/inputcapture.moc index be9ed80..52627b7 100644 --- a/tools/bsnes/ui_qt/settings/utility/inputcapture.moc +++ b/tools/bsnes/ui_qt/settings/utility/inputcapture.moc @@ -1,7 +1,7 @@ /**************************************************************************** ** Meta object code from reading C++ file 'inputcapture.mh' ** -** Created: Sun May 10 13:18:14 2009 +** Created: Tue May 12 22:50:12 2009 ** by: The Qt Meta Object Compiler version 59 (Qt 4.4.3) ** ** WARNING! All changes made in this file will be lost! diff --git a/tools/bsnes/ui_qt/settings/video.moc b/tools/bsnes/ui_qt/settings/video.moc index f303109..f9d3f40 100644 --- a/tools/bsnes/ui_qt/settings/video.moc +++ b/tools/bsnes/ui_qt/settings/video.moc @@ -1,7 +1,7 @@ /**************************************************************************** ** Meta object code from reading C++ file 'video.mh' ** -** Created: Sun May 10 13:18:14 2009 +** Created: Tue May 12 22:50:12 2009 ** by: The Qt Meta Object Compiler version 59 (Qt 4.4.3) ** ** WARNING! All changes made in this file will be lost!