diff --git a/Makefile.common b/Makefile.common
index cdb530b15c..52da673179 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -110,6 +110,7 @@ OBJ += frontend/frontend.o \
ui/drivers/ui_null.o \
libretro_version_1.o \
retroarch.o \
+ input/keyboard_line.o \
system.o \
retroarch_info.o \
command_event.o \
@@ -151,7 +152,6 @@ OBJ += frontend/frontend.o \
gfx/video_pixel_converter.o \
gfx/video_viewport.o \
camera/camera_driver.o \
- menu/menu_driver.o \
location/location_driver.o \
driver.o \
configuration.o \
@@ -168,7 +168,6 @@ OBJ += frontend/frontend.o \
input/input_keymaps.o \
input/input_remapping.o \
input/input_sensor.o \
- input/keyboard_line.o \
tasks/task_overlay.o \
input/input_overlay.o \
patch.o \
@@ -416,6 +415,7 @@ ifeq ($(HAVE_MENU_COMMON), 1)
endif
OBJ += menu/menu.o \
menu/menu_hash.o \
+ menu/menu_driver.o \
menu/intl/menu_hash_de.o \
menu/intl/menu_hash_es.o \
menu/intl/menu_hash_eo.o \
diff --git a/command_event.c b/command_event.c
index 3361bcedb8..6de574c3bb 100644
--- a/command_event.c
+++ b/command_event.c
@@ -13,6 +13,8 @@
* If not, see .
*/
+#include
+
#include
#include "command_event.h"
@@ -981,6 +983,7 @@ static void event_main_state(unsigned cmd)
RARCH_LOG("%s\n", msg);
}
+#ifdef HAVE_MENU
static bool event_update_system_info(struct retro_system_info *_info,
bool *load_no_content)
{
@@ -1003,6 +1006,7 @@ static bool event_update_system_info(struct retro_system_info *_info,
return true;
}
+#endif
/**
* event_command:
@@ -1052,7 +1056,9 @@ bool event_command(enum event_command cmd)
break;
case EVENT_CMD_LOAD_CORE_DEINIT:
#ifdef HAVE_DYNAMIC
+#ifdef HAVE_MENU
libretro_free_system_info(&global->menu.info);
+#endif
#endif
break;
case EVENT_CMD_LOAD_CORE_PERSIST:
diff --git a/configuration.c b/configuration.c
index 4f0499c7bb..2b8fa1be55 100644
--- a/configuration.c
+++ b/configuration.c
@@ -487,7 +487,7 @@ static void config_set_defaults(void)
settings->video.threaded = g_defaults.settings.video_threaded_enable;
#ifdef HAVE_THREADS
- settings->menu.threaded_data_runloop_enable = threaded_data_runloop_enable;
+ settings->threaded_data_runloop_enable = threaded_data_runloop_enable;
#endif
settings->video.shared_context = video_shared_context;
settings->video.force_srgb_disable = false;
@@ -1255,7 +1255,7 @@ static bool config_load_file(const char *path, bool set_defaults)
#ifdef HAVE_MENU
#ifdef HAVE_THREADS
- CONFIG_GET_BOOL_BASE(conf, settings, menu.threaded_data_runloop_enable,
+ CONFIG_GET_BOOL_BASE(conf, settings, threaded_data_runloop_enable,
"threaded_data_runloop_enable");
#endif
@@ -2506,7 +2506,7 @@ bool config_save_file(const char *path)
#ifdef HAVE_MENU
#ifdef HAVE_THREADS
config_set_bool(conf,"threaded_data_runloop_enable",
- settings->menu.threaded_data_runloop_enable);
+ settings->threaded_data_runloop_enable);
#endif
config_set_bool(conf, "dpi_override_enable", settings->menu.dpi.override_enable);
diff --git a/configuration.h b/configuration.h
index 10a4873a87..e049525e0e 100644
--- a/configuration.h
+++ b/configuration.h
@@ -151,9 +151,6 @@ typedef struct settings
} dpi;
bool show_advanced_settings;
-#ifdef HAVE_THREADS
- bool threaded_data_runloop_enable;
-#endif
unsigned entry_normal_color;
unsigned entry_hover_color;
@@ -161,6 +158,10 @@ typedef struct settings
} menu;
#endif
+#ifdef HAVE_THREADS
+ bool threaded_data_runloop_enable;
+#endif
+
struct
{
char driver[32];
diff --git a/driver.c b/driver.c
index 27f35a2813..535aac50b9 100644
--- a/driver.c
+++ b/driver.c
@@ -320,6 +320,7 @@ bool driver_update_system_av_info(const struct retro_system_av_info *info)
return true;
}
+#ifdef HAVE_MENU
/**
* menu_update_libretro_info:
*
@@ -328,7 +329,10 @@ bool driver_update_system_av_info(const struct retro_system_av_info *info)
static void menu_update_libretro_info(void)
{
global_t *global = global_get_ptr();
- struct retro_system_info *info = global ? &global->menu.info : NULL;
+ struct retro_system_info *info = NULL;
+
+ if (global)
+ info = &global->menu.info;
if (!global || !info)
return;
@@ -340,6 +344,7 @@ static void menu_update_libretro_info(void)
event_command(EVENT_CMD_CORE_INFO_INIT);
event_command(EVENT_CMD_LOAD_CORE_PERSIST);
}
+#endif
/**
* init_drivers:
diff --git a/gfx/drivers/gl.c b/gfx/drivers/gl.c
index d9735f6063..df14b84dcf 100644
--- a/gfx/drivers/gl.c
+++ b/gfx/drivers/gl.c
@@ -3341,6 +3341,7 @@ static void gl_apply_state_changes(void *data)
gl->should_resize = true;
}
+#ifdef HAVE_MENU
static void gl_set_osd_msg(void *data, const char *msg,
const struct font_params *params, void *font)
{
@@ -3368,6 +3369,7 @@ static struct video_shader *gl_get_current_shader(void *data)
gl_t *gl = (gl_t*)data;
return (gl && gl->shader) ? gl->shader->get_current_shader() : NULL;
}
+#endif
static void gl_get_video_output_size(void *data,
unsigned *width, unsigned *height)
@@ -3402,13 +3404,19 @@ static const video_poke_interface_t gl_poke_interface = {
#if defined(HAVE_MENU)
gl_set_texture_frame,
gl_set_texture_enable,
-#endif
gl_set_osd_msg,
-
gl_show_mouse,
+#else
NULL,
+ NULL,
+ NULL,
+ NULL,
+#endif
+ NULL,
+#ifdef HAVE_MENU
gl_get_current_shader,
+#endif
};
static void gl_get_poke_interface(void *data,
diff --git a/gfx/drivers/sdl2_gfx.c b/gfx/drivers/sdl2_gfx.c
index f93ccdbe23..52bac26505 100644
--- a/gfx/drivers/sdl2_gfx.c
+++ b/gfx/drivers/sdl2_gfx.c
@@ -691,6 +691,7 @@ static void sdl2_poke_apply_state_changes(void *data)
vid->should_resize = true;
}
+#ifdef HAVE_MENU
static void sdl2_poke_set_texture_frame(void *data, const void *frame, bool rgb32,
unsigned width, unsigned height, float alpha)
{
@@ -738,6 +739,7 @@ static void sdl2_grab_mouse_toggle(void *data)
sdl2_video_t *vid = (sdl2_video_t*)data;
SDL_SetWindowGrab(vid->window, SDL_GetWindowGrab(vid->window));
}
+#endif
static video_poke_interface_t sdl2_video_poke_interface = {
NULL,
@@ -752,10 +754,16 @@ static video_poke_interface_t sdl2_video_poke_interface = {
#ifdef HAVE_MENU
sdl2_poke_set_texture_frame,
sdl2_poke_texture_enable,
-#endif
sdl2_poke_set_osd_msg,
sdl2_show_mouse,
sdl2_grab_mouse_toggle,
+#else
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL<
+#endif
NULL,
};
diff --git a/gfx/video_thread_wrapper.c b/gfx/video_thread_wrapper.c
index 8f5245f47d..5a73af48f3 100644
--- a/gfx/video_thread_wrapper.c
+++ b/gfx/video_thread_wrapper.c
@@ -963,7 +963,6 @@ static void thread_set_texture_enable(void *data, bool state, bool full_screen)
thr->texture.full_screen = full_screen;
slock_unlock(thr->frame.lock);
}
-#endif
static void thread_set_osd_msg(void *data, const char *msg,
const struct font_params *params, void *font)
@@ -978,6 +977,7 @@ static void thread_set_osd_msg(void *data, const char *msg,
if (thr->poke && thr->poke->set_osd_msg)
thr->poke->set_osd_msg(thr->driver_data, msg, params, font);
}
+#endif
static void thread_apply_state_changes(void *data)
{
@@ -1014,9 +1014,12 @@ static const video_poke_interface_t thread_poke = {
#if defined(HAVE_MENU)
thread_set_texture_frame,
thread_set_texture_enable,
+ thread_set_osd_msg,
+#else
+ NULL,
+ NULL,
#endif
- thread_set_osd_msg,
NULL,
NULL,
diff --git a/input/keyboard_line.c b/input/keyboard_line.c
index 56371fe4d4..dc0d9c1a25 100644
--- a/input/keyboard_line.c
+++ b/input/keyboard_line.c
@@ -19,6 +19,7 @@
#include
#include "../general.h"
+#include "keyboard_line.h"
struct input_keyboard_line
{
diff --git a/menu/menu_setting.c b/menu/menu_setting.c
index 47ab7bea8c..44f96d5655 100644
--- a/menu/menu_setting.c
+++ b/menu/menu_setting.c
@@ -5363,7 +5363,7 @@ static bool setting_append_list_menu_options(
#ifdef HAVE_THREADS
CONFIG_BOOL(
- settings->menu.threaded_data_runloop_enable,
+ settings->threaded_data_runloop_enable,
menu_hash_to_str(MENU_LABEL_THREADED_DATA_RUNLOOP_ENABLE),
menu_hash_to_str(MENU_LABEL_VALUE_THREADED_DATA_RUNLOOP_ENABLE),
threaded_data_runloop_enable,
diff --git a/retroarch.c b/retroarch.c
index e9488b3243..07f93ca937 100644
--- a/retroarch.c
+++ b/retroarch.c
@@ -50,6 +50,8 @@
#include "git_version.h"
+#include "retroarch.h"
+
#ifdef HAVE_MENU
#include "menu/menu.h"
#include "menu/menu_hash.h"
@@ -337,8 +339,11 @@ void set_paths_redirect(const char *path)
global->dir.savestate,
sizeof(current_savestate_dir));
- if(global_library_name_hash != 0 &&
- (global_library_name_hash != MENU_VALUE_NO_CORE))
+ if(global_library_name_hash != 0
+#ifdef HAVE_MENU
+ && (global_library_name_hash != MENU_VALUE_NO_CORE)
+#endif
+ )
{
/* per-core saves: append the library_name to the save location */
if (settings->sort_savefiles_enable && global->dir.savefile[0] != '\0')
@@ -1491,8 +1496,10 @@ void rarch_playlist_load_content(void *data, unsigned idx)
char *path_tolower = NULL;
RFILE *fp = NULL;
content_playlist_t *playlist = (content_playlist_t*)data;
- menu_handle_t *menu = menu_driver_get_ptr();
settings_t *settings = config_get_ptr();
+#ifdef HAVE_MENU
+ menu_handle_t *menu = menu_driver_get_ptr();
+#endif
if (!playlist)
return;
@@ -1529,8 +1536,10 @@ void rarch_playlist_load_content(void *data, unsigned idx)
strlcpy(settings->libretro, core_path, sizeof(settings->libretro));
+#ifdef HAVE_MENU
if (menu)
menu->load_no_content = (path) ? false : true;
+#endif
rarch_environment_cb(RETRO_ENVIRONMENT_EXEC, (void*)path);
@@ -1562,7 +1571,9 @@ int rarch_defer_core(core_info_list_t *core_info, const char *dir,
size_t supported = 0;
settings_t *settings = config_get_ptr();
global_t *global = global_get_ptr();
+#ifdef HAVE_MENU
uint32_t menu_label_hash = msg_hash_calculate(menu_label);
+#endif
fill_pathname_join(s, dir, path, len);
@@ -1580,6 +1591,7 @@ int rarch_defer_core(core_info_list_t *core_info, const char *dir,
core_info_list_get_supported_cores(core_info, s, &info,
&supported);
+#ifdef HAVE_MENU
if (menu_label_hash == MENU_LABEL_LOAD_CONTENT)
{
info = (const core_info_t*)&global->core_info.current;
@@ -1591,6 +1603,7 @@ int rarch_defer_core(core_info_list_t *core_info, const char *dir,
}
}
else
+#endif
strlcpy(new_core_path, info->path, sizeof(new_core_path));
/* There are multiple deferred cores and a
diff --git a/runloop.c b/runloop.c
index 6d112631e0..b159d0e9c0 100644
--- a/runloop.c
+++ b/runloop.c
@@ -746,6 +746,7 @@ FILE *retro_main_log_file(void)
return global->log_file;
}
+#ifdef HAVE_MENU
static bool rarch_main_cmd_get_state_menu_toggle_button_combo(
driver_t *driver, settings_t *settings,
retro_input_t input, retro_input_t old_input,
@@ -776,6 +777,7 @@ static bool rarch_main_cmd_get_state_menu_toggle_button_combo(
driver->flushing_input = true;
return true;
}
+#endif
static void rarch_main_cmd_get_state(driver_t *driver,
settings_t *settings, event_cmd_state_t *cmd,
@@ -946,7 +948,11 @@ int rarch_main_iterate(unsigned *sleep_ms)
if (cmd.overlay_next_pressed)
event_command(EVENT_CMD_OVERLAY_NEXT);
- if (!main_is_paused || menu_driver_alive())
+ if (!main_is_paused
+#ifdef HAVE_MENU
+ || menu_driver_alive()
+#endif
+ )
{
if (cmd.fullscreen_toggle)
event_command(EVENT_CMD_FULLSCREEN_TOGGLE);
diff --git a/runloop_data.c b/runloop_data.c
index bbcf683ed5..2c11e31a71 100644
--- a/runloop_data.c
+++ b/runloop_data.c
@@ -105,9 +105,11 @@ void rarch_main_data_free(void)
static void data_runloop_iterate(bool is_thread)
{
rarch_main_data_nbio_iterate (is_thread);
+#ifdef HAVE_MENU
#ifdef HAVE_RPNG
rarch_main_data_nbio_image_iterate (is_thread);
#endif
+#endif
#ifdef HAVE_NETWORKING
rarch_main_data_http_iterate (is_thread);
#endif
@@ -226,7 +228,7 @@ void rarch_main_data_iterate(void)
(void)settings;
#ifdef HAVE_THREADS
- if (settings->menu.threaded_data_runloop_enable)
+ if (settings->threaded_data_runloop_enable)
{
switch (g_data_runloop.thread_code)
{
@@ -244,8 +246,10 @@ void rarch_main_data_iterate(void)
rarch_main_data_overlay_image_upload_iterate(false);
#endif
#ifdef HAVE_RPNG
+#ifdef HAVE_MENU
rarch_main_data_nbio_image_upload_iterate(false);
#endif
+#endif
#ifdef HAVE_OVERLAY
rarch_main_data_overlay_iterate (false);
#endif
@@ -261,7 +265,7 @@ void rarch_main_data_iterate(void)
}
#ifdef HAVE_THREADS
- if (settings->menu.threaded_data_runloop_enable && g_data_runloop.alive)
+ if (settings->threaded_data_runloop_enable && g_data_runloop.alive)
return;
#endif
@@ -355,7 +359,7 @@ void rarch_main_data_msg_queue_push(unsigned type,
msg_queue_push(queue, new_msg, prio, duration);
#ifdef HAVE_THREADS
- if (settings->menu.threaded_data_runloop_enable)
+ if (settings->threaded_data_runloop_enable)
{
if (!g_data_runloop.thread_inited)
rarch_main_data_thread_init();
diff --git a/tasks/task_file_transfer.c b/tasks/task_file_transfer.c
index 788ea1134f..d3b27acc86 100644
--- a/tasks/task_file_transfer.c
+++ b/tasks/task_file_transfer.c
@@ -413,6 +413,7 @@ static int cb_nbio_default(void *data, size_t len)
}
#ifdef HAVE_RPNG
+#ifdef HAVE_MENU
static int cb_nbio_generic(nbio_handle_t *nbio, size_t *len)
{
void *ptr = NULL;
@@ -477,6 +478,7 @@ static int cb_nbio_image_menu_boxart(void *data, size_t len)
return cb_nbio_generic(nbio, &len);
}
#endif
+#endif
static int rarch_main_data_nbio_iterate_poll(nbio_handle_t *nbio)
{
diff --git a/tasks/task_http.c b/tasks/task_http.c
index 96b54fac0d..0367e8549f 100644
--- a/tasks/task_http.c
+++ b/tasks/task_http.c
@@ -74,6 +74,7 @@ int cb_core_content_list(void *data_, size_t len);
static http_handle_t *http_ptr;
#ifdef HAVE_ZLIB
+#ifdef HAVE_MENU
static int zlib_extract_core_callback(const char *name, const char *valid_exts,
const uint8_t *cdata, unsigned cmode, uint32_t csize, uint32_t size,
uint32_t crc32, void *userdata)
@@ -106,7 +107,9 @@ error:
return 0;
}
#endif
+#endif
+#ifdef HAVE_MENU
static int cb_generic_download(void *data, size_t len,
const char *dir_path)
{
@@ -226,6 +229,7 @@ static int cb_update_cheats(void *data, size_t len)
settings_t *settings = config_get_ptr();
return cb_generic_download(data, len, settings->cheat_database);
}
+#endif
static int rarch_main_data_http_con_iterate_transfer(http_handle_t *http)
{
@@ -292,6 +296,7 @@ static int cb_http_conn_default(void *data_, size_t len)
switch (label_hash)
{
+#ifdef HAVE_MENU
case CB_CORE_UPDATER_DOWNLOAD:
http->cb = &cb_core_updater_download;
break;
@@ -328,6 +333,9 @@ static int cb_http_conn_default(void *data_, size_t len)
case CB_UPDATE_OVERLAYS:
http->cb = &cb_update_overlays;
break;
+#endif
+ default:
+ break;
}
}