libsdl: config tweaks, remove sdlmain lib
This patch contains changes to the libSDL port that were needed to build the Hatari emulator using cmake. - Since SDL programs cannot use the posix library (because sdl's init function needs a way to get hold of the Genode env), the sdl_main library must be used instead of the posix library. The sdl_main code implements the Libc::Component::construct function for the final binary. However, 3rd-party build systems are not aware of this Genode-specific peculiarity and thereby create binaries that leave libsdl uninitialized. This patch adds the sdl_main to libsdl by default and thereby eliminates the need for specifying the extra sdl_main library. Customizing the Libc::Component::construct is still possible by overriding the library-provided implementation in the main program. - A few missing config definitions are added to compile Hatari successfully. - Avoid reliance on the include/SDL convention in SDL_config.h - Cmake relies on the upper-case naming of the library with no way to tweak this convention. So we install an symlink named `SDL.lib.so` when installing the library into the <build-dir>/bin/ directory. Fixes #161
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
#ifndef _SDL_config_h
|
||||
#define _SDL_config_h
|
||||
|
||||
#include <SDL/SDL_platform.h>
|
||||
#include <SDL_platform.h>
|
||||
#include "SDL_config_genode.h"
|
||||
|
||||
#endif /* _SDL_config_h */
|
||||
|
||||
@@ -61,6 +61,8 @@
|
||||
|
||||
#define SDL_VIDEO_OPENGL 1
|
||||
|
||||
#define SDL_HAS_64BIT_TYPE 1
|
||||
|
||||
/* #define HAVE_MREMAP 0 */
|
||||
#define HAVE_MALLOC
|
||||
#define HAVE_CALLOC
|
||||
@@ -77,7 +79,9 @@
|
||||
#define HAVE_SNPRINTF
|
||||
#define HAVE_VSNPRINTF
|
||||
|
||||
#define HAVE_STDIO_H 1
|
||||
#define HAVE_STDIO_H 1
|
||||
#define HAVE_INTTYPES_H 1
|
||||
#define HAVE_MATH_H 1
|
||||
|
||||
/* #define SDL_malloc malloc */
|
||||
/* #define SDL_calloc calloc */
|
||||
|
||||
Reference in New Issue
Block a user