Add NO_X11 option at compiletime to disable X11 specific stuff with SDL driver

just compile with
$ NO_X11=1 make
This commit is contained in:
Thomas Bernard 2018-07-20 12:26:52 +02:00
parent 6ec72f6b71
commit 88430bb92f
No known key found for this signature in database
GPG Key ID: 0FF11B67A5C0863C
4 changed files with 15 additions and 8 deletions

View File

@ -511,12 +511,19 @@ endif
LOPT = -lm LOPT = -lm
ifeq ($(API),sdl) ifeq ($(API),sdl)
LOPT += $(shell sdl-config --libs) -lSDL_image LOPT += $(shell sdl-config --libs) -lSDL_image
ifneq ($(NO_X11),1)
LOPT += -lX11 LOPT += -lX11
endif endif
endif
ifeq ($(API),sdl2) ifeq ($(API),sdl2)
LOPT += $(shell sdl2-config --libs) -lSDL2_image LOPT += $(shell sdl2-config --libs) -lSDL2_image
ifneq ($(NO_X11),1)
LOPT += -lX11 LOPT += -lX11
endif endif
endif
ifeq ($(NO_X11),1)
COPT += -DNO_X11
endif
LOPT += $(TTFLOPT) LOPT += $(TTFLOPT)
LOPT += $(shell pkg-config --libs libpng) LOPT += $(shell pkg-config --libs libpng)
LOPT += $(LUALOPT) LOPT += $(LUALOPT)

View File

@ -83,7 +83,7 @@ int Snap_axis_origin_Y;
char * Drop_file_name = NULL; char * Drop_file_name = NULL;
#if defined(USE_X11) || defined(SDL_VIDEO_DRIVER_X11) #if defined(USE_X11) || (defined(SDL_VIDEO_DRIVER_X11) && !defined(NO_X11))
char * X11_clipboard = NULL; char * X11_clipboard = NULL;
#endif #endif
@ -319,7 +319,7 @@ int Move_cursor_with_constraints()
// WM events management // WM events management
#if defined(USE_X11) || defined(SDL_VIDEO_DRIVER_X11) #if defined(USE_X11) || (defined(SDL_VIDEO_DRIVER_X11) && !defined(NO_X11))
static int xdnd_version = 5; static int xdnd_version = 5;
static Window xdnd_source = None; static Window xdnd_source = None;
@ -1295,7 +1295,7 @@ int Get_input(int sleep_time)
// Drop of zero files. Thanks for the information, Bill. // Drop of zero files. Thanks for the information, Bill.
} }
} }
#elif defined(SDL_VIDEO_DRIVER_X11) #elif defined(SDL_VIDEO_DRIVER_X11) && !defined(NO_X11)
#if defined(USE_SDL) #if defined(USE_SDL)
#define xevent event.syswm.msg->event.xevent #define xevent event.syswm.msg->event.xevent
#else #else

View File

@ -73,7 +73,7 @@ extern Window X11_window;
#elif defined(__macosx__) #elif defined(__macosx__)
const char * get_paste_board(void); const char * get_paste_board(void);
#endif #endif
#if defined(USE_X11) || defined(SDL_VIDEO_DRIVER_X11) #if defined(USE_X11) || (defined(SDL_VIDEO_DRIVER_X11) && !defined(NO_X11))
extern char * X11_clipboard; extern char * X11_clipboard;
#endif #endif
@ -409,7 +409,7 @@ bye:
if (unicode) if (unicode)
*unicode = NULL; *unicode = NULL;
return haiku_get_clipboard(); return haiku_get_clipboard();
#elif defined(USE_X11) || defined(__macosx__) || defined(USE_SDL2) || (defined(USE_SDL) && defined(SDL_VIDEO_DRIVER_X11)) #elif defined(USE_X11) || defined(__macosx__) || defined(USE_SDL2) || (defined(USE_SDL) && defined(SDL_VIDEO_DRIVER_X11) && !defined(NO_X11))
if (unicode) if (unicode)
*unicode = NULL; *unicode = NULL;
#if defined(USE_SDL2) #if defined(USE_SDL2)

View File

@ -581,7 +581,7 @@ void Allow_drag_and_drop(int flag)
#ifdef __WIN32__ #ifdef __WIN32__
DragAcceptFiles(GFX2_Get_Window_Handle(), flag?TRUE:FALSE); DragAcceptFiles(GFX2_Get_Window_Handle(), flag?TRUE:FALSE);
SDL_EventState (SDL_SYSWMEVENT, flag?SDL_ENABLE:SDL_DISABLE); SDL_EventState (SDL_SYSWMEVENT, flag?SDL_ENABLE:SDL_DISABLE);
#elif defined(SDL_VIDEO_DRIVER_X11) #elif defined(SDL_VIDEO_DRIVER_X11) && !defined(NO_X11)
Atom version = flag ? 5 : 0; Atom version = flag ? 5 : 0;
Display * display; Display * display;
Window window; Window window;