From 69647d48d8de3c4e9584fe563a4c35eae56eaac4 Mon Sep 17 00:00:00 2001 From: Dimitris Panokostas Date: Sat, 21 Jan 2017 14:54:08 +0100 Subject: [PATCH] SDL2 fixes --- Amiberry/Amiberry/Amiberry-Debug.vgdbsettings | 1 + Amiberry/Amiberry/Amiberry-Release-rpi1.vgdbsettings | 1 + Amiberry/Amiberry/Amiberry-Release-rpi2.vgdbsettings | 1 + Amiberry/Amiberry/Amiberry-Release.vgdbsettings | 1 + Amiberry/Amiberry/Amiberry.vcxproj | 12 ++++++------ Makefile | 3 ++- src/include/guisan/sdl/sdltruetypefont.hpp | 2 +- src/jit/compemu_support.cpp | 2 +- src/main.cpp | 2 +- src/osdep/gui/CreateFilesysHardfile.cpp | 2 +- src/osdep/keyboard.cpp | 2 +- src/osdep/pandora.cpp | 2 +- src/osdep/pandora_gfx.cpp | 6 +++--- src/osdep/pandora_gui.cpp | 2 +- src/osdep/pandora_input.cpp | 2 +- src/osdep/pandora_mem.cpp | 2 +- src/osdep/picasso96.cpp | 2 +- src/osdep/sigsegv_handler.cpp | 2 +- src/osdep/target.h | 2 +- src/sounddep/sound_sdl_new.cpp | 2 +- src/threaddep/thread.h | 2 +- 21 files changed, 29 insertions(+), 24 deletions(-) diff --git a/Amiberry/Amiberry/Amiberry-Debug.vgdbsettings b/Amiberry/Amiberry/Amiberry-Debug.vgdbsettings index a3e8c88c..30c09b1b 100644 --- a/Amiberry/Amiberry/Amiberry-Debug.vgdbsettings +++ b/Amiberry/Amiberry/Amiberry-Debug.vgdbsettings @@ -90,6 +90,7 @@ Auto true + false diff --git a/Amiberry/Amiberry/Amiberry-Release-rpi1.vgdbsettings b/Amiberry/Amiberry/Amiberry-Release-rpi1.vgdbsettings index bf1dbcde..5c9b6812 100644 --- a/Amiberry/Amiberry/Amiberry-Release-rpi1.vgdbsettings +++ b/Amiberry/Amiberry/Amiberry-Release-rpi1.vgdbsettings @@ -101,6 +101,7 @@ false Auto true + false diff --git a/Amiberry/Amiberry/Amiberry-Release-rpi2.vgdbsettings b/Amiberry/Amiberry/Amiberry-Release-rpi2.vgdbsettings index 510da6ec..da6d9fc0 100644 --- a/Amiberry/Amiberry/Amiberry-Release-rpi2.vgdbsettings +++ b/Amiberry/Amiberry/Amiberry-Release-rpi2.vgdbsettings @@ -101,6 +101,7 @@ false Auto true + false diff --git a/Amiberry/Amiberry/Amiberry-Release.vgdbsettings b/Amiberry/Amiberry/Amiberry-Release.vgdbsettings index 85b7343f..21508f76 100644 --- a/Amiberry/Amiberry/Amiberry-Release.vgdbsettings +++ b/Amiberry/Amiberry/Amiberry-Release.vgdbsettings @@ -101,6 +101,7 @@ false Auto true + false diff --git a/Amiberry/Amiberry/Amiberry.vcxproj b/Amiberry/Amiberry/Amiberry.vcxproj index b65bb16c..52d94241 100644 --- a/Amiberry/Amiberry/Amiberry.vcxproj +++ b/Amiberry/Amiberry/Amiberry.vcxproj @@ -51,7 +51,7 @@ ;%(Link.AdditionalLinkerInputs) =/opt/vc/lib;=/usr/local/lib;../../src/guisan;%(Link.LibrarySearchDirectories) - bcm_host;SDL2;pthread;m;z;SDL2_image;png;rt;xml2;FLAC;mpg123;dl;SDL2_ttf;guisan;%(Link.AdditionalLibraryNames) + SDL2;pthread;m;z;SDL2_image;png;rt;xml2;FLAC;mpg123;dl;SDL2_ttf;guisan;%(Link.AdditionalLibraryNames) =/usr/local/lib;%(ExtraRPATH) @@ -66,9 +66,9 @@ true - ;%(Link.AdditionalLinkerInputs) - =/opt/vc/lib;=/usr/local/lib;../../src/guisan;%(Link.LibrarySearchDirectories) - bcm_host;SDL2;pthread;m;z;SDL2_image;png;rt;xml2;FLAC;mpg123;dl;SDL2_ttf;guisan;%(Link.AdditionalLibraryNames) + -Wl,-gc-sections,-rpath,/usr/local/lib;%(Link.AdditionalLinkerInputs) + ../../src/guisan;=/opt/vc/lib;=/usr/local/lib;%(Link.LibrarySearchDirectories) + SDL2;SDL2_image;SDL2_ttf;pthread;m;z;png;rt;xml2;FLAC;mpg123;dl;guisan;%(Link.AdditionalLibraryNames) =/usr/local/lib;%(ExtraRPATH) @@ -85,7 +85,7 @@ ;%(Link.AdditionalLinkerInputs) =/opt/vc/lib;=/usr/local/lib;../../src/guisan;%(Link.LibrarySearchDirectories) - bcm_host;SDL2;pthread;m;z;SDL2_image;png;rt;xml2;FLAC;mpg123;dl;SDL2_ttf;guisan;%(Link.AdditionalLibraryNames) + SDL2;pthread;m;z;SDL2_image;png;rt;xml2;FLAC;mpg123;dl;SDL2_ttf;guisan;%(Link.AdditionalLibraryNames) =/usr/local/lib;%(ExtraRPATH) @@ -103,7 +103,7 @@ ;%(Link.AdditionalLinkerInputs) =/opt/vc/lib;=/usr/local/lib;../../src/guisan;%(Link.LibrarySearchDirectories) - bcm_host;SDL2;pthread;m;z;SDL2_image;png;rt;xml2;FLAC;mpg123;dl;SDL2_ttf;guisan;%(Link.AdditionalLibraryNames) + SDL2;pthread;m;z;SDL2_image;png;rt;xml2;FLAC;mpg123;dl;SDL2_ttf;guisan;%(Link.AdditionalLibraryNames) =/usr/local/lib;%(ExtraRPATH) diff --git a/Makefile b/Makefile index 61d780da..85dd42b2 100644 --- a/Makefile +++ b/Makefile @@ -41,7 +41,8 @@ MORE_CFLAGS += -Wno-unused -Wno-format -DGCCCONSTFUNC="__attribute__((const))" MORE_CFLAGS += -fexceptions -fpermissive LDFLAGS += -lSDL2 -lpthread -lm -lz -lSDL2_image -lpng -lrt -lxml2 -lFLAC -lmpg123 -ldl -LDFLAGS += -lSDL2_ttf -lguisan -lbcm_host -L/opt/vc/lib -Lsrc/guisan +LDFLAGS += -lSDL2_ttf -lguisan -L/opt/vc/lib -Lsrc/guisan +LDFLAGS += -Wl,-gc-sections,-rpath,/usr/local/lib ifndef DEBUG MORE_CFLAGS += -Ofast -fomit-frame-pointer diff --git a/src/include/guisan/sdl/sdltruetypefont.hpp b/src/include/guisan/sdl/sdltruetypefont.hpp index c2061028..49163c23 100644 --- a/src/include/guisan/sdl/sdltruetypefont.hpp +++ b/src/include/guisan/sdl/sdltruetypefont.hpp @@ -47,7 +47,7 @@ #include #include -#include +#include "SDL_ttf.h" #include "guisan/font.hpp" #include "guisan/platform.hpp" diff --git a/src/jit/compemu_support.cpp b/src/jit/compemu_support.cpp index e57f64d3..14d89870 100644 --- a/src/jit/compemu_support.cpp +++ b/src/jit/compemu_support.cpp @@ -44,7 +44,7 @@ #include "custom.h" #include "comptbl.h" #include "compemu.h" -#include +#include "SDL.h" #define DEBUG 0 #include "debug.h" diff --git a/src/main.cpp b/src/main.cpp index db7ee4de..a8c69959 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -41,7 +41,7 @@ #include "jit/compemu.h" #endif #ifdef USE_SDL -#include +#include "SDL.h" #include #include "pandora_gfx.h" SDL_Window* sdlWindow; diff --git a/src/osdep/gui/CreateFilesysHardfile.cpp b/src/osdep/gui/CreateFilesysHardfile.cpp index 4e0fe654..a341e33e 100644 --- a/src/osdep/gui/CreateFilesysHardfile.cpp +++ b/src/osdep/gui/CreateFilesysHardfile.cpp @@ -1,5 +1,5 @@ #include -#include +#include "SDL.h" #include #include #include "guisan/sdl/sdltruetypefont.hpp" diff --git a/src/osdep/keyboard.cpp b/src/osdep/keyboard.cpp index b95e0fd7..2e566bec 100644 --- a/src/osdep/keyboard.cpp +++ b/src/osdep/keyboard.cpp @@ -12,7 +12,7 @@ #include "keyboard.h" #include "keybuf.h" #include "gui.h" -#include +#include "SDL.h" char keyboard_type = 0; diff --git a/src/osdep/pandora.cpp b/src/osdep/pandora.cpp index 8b08be0d..a0057573 100644 --- a/src/osdep/pandora.cpp +++ b/src/osdep/pandora.cpp @@ -41,7 +41,7 @@ #include "uaeresource.h" #include "rommgr.h" #include "akiko.h" -#include +#include "SDL.h" #include "pandora_rp9.h" extern void signal_segv(int signum, siginfo_t* info, void*ptr); diff --git a/src/osdep/pandora_gfx.cpp b/src/osdep/pandora_gfx.cpp index 1251cd24..aed9336f 100644 --- a/src/osdep/pandora_gfx.cpp +++ b/src/osdep/pandora_gfx.cpp @@ -15,12 +15,12 @@ #include "pandora_gfx.h" #include -#include -#include +#include "SDL.h" +#include "SDL_image.h" //#ifndef ANDROID //#include //#endif -#include +#include "SDL_ttf.h" #ifdef ANDROID #include diff --git a/src/osdep/pandora_gui.cpp b/src/osdep/pandora_gui.cpp index 0548ffd1..a1508c85 100644 --- a/src/osdep/pandora_gui.cpp +++ b/src/osdep/pandora_gui.cpp @@ -30,7 +30,7 @@ #include "filesys.h" #include "autoconf.h" #include "blkdev.h" -#include +#include "SDL.h" #include "threaddep/thread.h" #ifdef RASPBERRY diff --git a/src/osdep/pandora_input.cpp b/src/osdep/pandora_input.cpp index 2c1da567..ab54445a 100644 --- a/src/osdep/pandora_input.cpp +++ b/src/osdep/pandora_input.cpp @@ -4,7 +4,7 @@ #include "options.h" #include "keyboard.h" #include "inputdevice.h" -#include +#include "SDL.h" static int joyXviaCustom = 0; diff --git a/src/osdep/pandora_mem.cpp b/src/osdep/pandora_mem.cpp index 568ebba8..2c9ab4c7 100644 --- a/src/osdep/pandora_mem.cpp +++ b/src/osdep/pandora_mem.cpp @@ -10,7 +10,7 @@ #include "custom.h" #include "akiko.h" #include -#include +#include "SDL.h" uae_u8* natmem_offset = 0; diff --git a/src/osdep/picasso96.cpp b/src/osdep/picasso96.cpp index ccb65434..e81a0651 100644 --- a/src/osdep/picasso96.cpp +++ b/src/osdep/picasso96.cpp @@ -57,7 +57,7 @@ #include "native2amiga.h" #include "picasso96.h" -#include +#include "SDL.h" #define NOBLITTER 0 #define NOBLITTER_BLIT 0 diff --git a/src/osdep/sigsegv_handler.cpp b/src/osdep/sigsegv_handler.cpp index b9339e9c..1bce6c7d 100644 --- a/src/osdep/sigsegv_handler.cpp +++ b/src/osdep/sigsegv_handler.cpp @@ -37,7 +37,7 @@ #include #include #include -#include +#include "SDL.h" #define DEBUG 0 #include "debug.h" diff --git a/src/osdep/target.h b/src/osdep/target.h index 1150b1e7..66988840 100644 --- a/src/osdep/target.h +++ b/src/osdep/target.h @@ -6,7 +6,7 @@ * Copyright 1997 Bernd Schmidt */ -#include +#include "SDL.h" #define TARGET_NAME "pandora" diff --git a/src/sounddep/sound_sdl_new.cpp b/src/sounddep/sound_sdl_new.cpp index 595e1461..e8d7194c 100644 --- a/src/sounddep/sound_sdl_new.cpp +++ b/src/sounddep/sound_sdl_new.cpp @@ -22,7 +22,7 @@ #include "audio.h" #include "gensound.h" #include "sounddep/sound.h" -#include +#include "SDL.h" #ifdef ANDROIDSDL #include diff --git a/src/threaddep/thread.h b/src/threaddep/thread.h index 4d62fb4c..d8e539af 100644 --- a/src/threaddep/thread.h +++ b/src/threaddep/thread.h @@ -6,7 +6,7 @@ * Copyright 1997, 2001 Bernd Schmidt */ -#include +#include "SDL.h" #include /* Sempahores. We use POSIX semaphores; if you are porting this to a machine