Skip to content

Commit

Permalink
Add more flags to ./configure (libretro#14756)
Browse files Browse the repository at this point in the history
* Allow disabling "Update Core Info" from Online Updater

* Add ASSETS_DIR as an alternative to DEFAULT_DIR_ASSETS

* Add FILTERS_DIR configuration option

* Fix other platform_unix.c platforms

* Conditionally use ASSETS_DIR/FILTERS_DIR
  • Loading branch information
thiagokokada authored Dec 23, 2022
1 parent 0993324 commit 894c44c
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ DEF_FLAGS := -I.
ASFLAGS :=
DEFINES := -DHAVE_CONFIG_H -DRARCH_INTERNAL -D_FILE_OFFSET_BITS=64
DEFINES += -DGLOBAL_CONFIG_DIR='"$(GLOBAL_CONFIG_DIR)"'
DEFINES += -DASSETS_DIR='"$(DESTDIR)$(ASSETS_DIR)"'
DEFINES += -DFILTERS_DIR='"$(DESTDIR)$(FILTERS_DIR)"'

OBJDIR_BASE := obj-unix

Expand Down
21 changes: 21 additions & 0 deletions frontend/drivers/platform_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -1778,6 +1778,13 @@ static void frontend_unix_get_env(int *argc,
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_AUTOCONFIG], base_path,
"autoconfig", sizeof(g_defaults.dirs[DEFAULT_DIR_AUTOCONFIG]));

#ifdef ASSETS_DIR
if (path_is_directory(ASSETS_DIR "/assets"))
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_ASSETS],
ASSETS_DIR,
"assets", sizeof(g_defaults.dirs[DEFAULT_DIR_ASSETS]));
else
#endif
if (path_is_directory("/usr/local/share/retroarch/assets"))
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_ASSETS],
"/usr/local/share/retroarch",
Expand All @@ -1804,6 +1811,13 @@ static void frontend_unix_get_env(int *argc,
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_VIDEO_FILTER], base_path,
"filters/video", sizeof(g_defaults.dirs[DEFAULT_DIR_VIDEO_FILTER]));
#else
#ifdef FILTERS_DIR
if (path_is_directory(FILTERS_DIR "/filters/audio"))
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_AUDIO_FILTER],
FILTERS_DIR,
"filters/audio", sizeof(g_defaults.dirs[DEFAULT_DIR_AUDIO_FILTER]));
else
#endif
if (path_is_directory("/usr/local/share/retroarch/filters/audio"))
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_AUDIO_FILTER],
"/usr/local/share/retroarch",
Expand All @@ -1824,6 +1838,13 @@ static void frontend_unix_get_env(int *argc,
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_AUDIO_FILTER], base_path,
"filters/audio", sizeof(g_defaults.dirs[DEFAULT_DIR_AUDIO_FILTER]));

#ifdef FILTERS_DIR
if (path_is_directory(FILTERS_DIR "/filters/video"))
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_VIDEO_FILTER],
FILTERS_DIR,
"filters/video", sizeof(g_defaults.dirs[DEFAULT_DIR_VIDEO_FILTER]));
else
#endif
if (path_is_directory("/usr/local/share/retroarch/filters/video"))
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_VIDEO_FILTER],
"/usr/local/share/retroarch",
Expand Down
2 changes: 2 additions & 0 deletions menu/menu_displaylist.c
Original file line number Diff line number Diff line change
Expand Up @@ -13289,6 +13289,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
count++;

#ifdef HAVE_COMPRESSION
#ifdef HAVE_UPDATE_CORE_INFO
if (settings->bools.menu_show_core_updater)
{
if (menu_entries_append(info->list,
Expand All @@ -13298,6 +13299,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
MENU_SETTING_ACTION, 0, 0, NULL))
count++;
}
#endif

#ifdef HAVE_UPDATE_ASSETS
if (menu_entries_append(info->list,
Expand Down
4 changes: 3 additions & 1 deletion qb/config.params.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
HAVE_LIBRETRO= # Libretro library used
HAVE_ASSETS_DIR= # Assets install directory
HAVE_FILTERS_DIR= # Audio/video filters directory
HAVE_CORE_INFO_CACHE=yes # Core info cache support
HAVE_BLUETOOTH=no # Bluetooth support
HAVE_NVDA=yes # NVDA support
Expand Down Expand Up @@ -141,7 +142,8 @@ HAVE_FLAC=auto # Compile in flac support
HAVE_DR_MP3=yes # Compile in Dr. MP3 support
HAVE_BUILTINFLAC=auto # Bake in flac support
HAVE_ONLINE_UPDATER=yes # Disable the online updater
HAVE_UPDATE_CORES=yes # Disable downloading cores with online updater
HAVE_UPDATE_CORES=yes # Disable downloading cores with online updater
HAVE_UPDATE_CORE_INFO=yes # Disable downloading cores info with online updater
HAVE_UPDATE_ASSETS=yes # Disable downloading assets with online updater
HAVE_PRESERVE_DYLIB=no # Enable dlclose() for Valgrind support
HAVE_PARPORT=auto # Parallel port joypad support
Expand Down

0 comments on commit 894c44c

Please sign in to comment.