Always compile in config file support.

This commit is contained in:
Themaister 2012-12-23 13:55:59 +01:00
parent 143b5addc9
commit 9b58fac354
11 changed files with 4 additions and 84 deletions

View File

@ -18,6 +18,7 @@ OBJ = retroarch.o \
compat/compat.o \
audio/null.o \
gfx/null.o \
conf/config_file.o \
input/null.o \
screenshot.o \
gfx/scaler/scaler.o \
@ -73,10 +74,6 @@ ifeq ($(HAVE_THREADS), 1)
endif
endif
ifeq ($(HAVE_CONFIGFILE), 1)
OBJ += conf/config_file.o
endif
ifeq ($(HAVE_BSV_MOVIE), 1)
OBJ += movie.o
endif

View File

@ -71,7 +71,7 @@ endif
libretro ?= -lretro
LIBS = -lm
DEFINES = -I. -DHAVE_CONFIGFILE -DHAVE_SCREENSHOTS -DHAVE_BSV_MOVIE -DPACKAGE_VERSION=\"0.9.8-beta3\"
DEFINES = -I. -DHAVE_SCREENSHOTS -DHAVE_BSV_MOVIE -DPACKAGE_VERSION=\"0.9.8-beta3\"
LDFLAGS = -L. -static-libgcc
ifeq ($(TDM_GCC),)

View File

@ -24,9 +24,7 @@
#include "config.h"
#endif
#ifdef HAVE_CONFIGFILE
#include "conf/config_file.h"
#endif
#include <stdlib.h>
#include <stddef.h>
@ -151,7 +149,6 @@ static void cheat_manager_apply_cheats(cheat_manager_t *handle)
static void cheat_manager_load_config(cheat_manager_t *handle, const char *path, const char *sha256)
{
#ifdef HAVE_CONFIGFILE
if (!(*path))
return;
@ -181,17 +178,10 @@ static void cheat_manager_load_config(cheat_manager_t *handle, const char *path,
config_file_free(conf);
cheat_manager_apply_cheats(handle);
#else
(void)handle;
(void)path;
(void)sha256;
#endif
}
static void cheat_manager_save_config(cheat_manager_t *handle, const char *path, const char *sha256)
{
#ifdef HAVE_CONFIGFILE
if (!(*path))
return;
@ -226,12 +216,6 @@ static void cheat_manager_save_config(cheat_manager_t *handle, const char *path,
RARCH_ERR("Failed to write XML cheat settings to \"%s\". Check permissions.\n", path);
config_file_free(conf);
#else
(void)handle;
(void)path;
(void)sha256;
#endif
}
cheat_manager_t *cheat_manager_new(const char *path)

View File

@ -152,12 +152,6 @@ static const bool _ffmpeg_supp = true;
static const bool _ffmpeg_supp = false;
#endif
#ifdef HAVE_CONFIGFILE
static const bool _configfile_supp = true;
#else
static const bool _configfile_supp = false;
#endif
#ifdef HAVE_FREETYPE
static const bool _freetype_supp = true;
#else

View File

@ -57,9 +57,7 @@ default_paths_t default_paths;
#include "../rarch_console_rsound.c"
#endif
#ifdef HAVE_CONFIGFILE
#include "../rarch_console_config.c"
#endif
#ifdef HAVE_DEFAULT_RETROPAD_INPUT
#include "../rarch_console_input.c"
@ -101,9 +99,7 @@ CONFIG FILE
#undef strcasecmp
#endif
#ifdef HAVE_CONFIGFILE
#include "../../conf/config_file.c"
#endif
/*============================================================
CHEATS

View File

@ -270,10 +270,8 @@ struct global
bool has_set_save_path;
bool has_set_state_path;
#ifdef HAVE_CONFIGFILE
char config_path[PATH_MAX];
char append_config_path[PATH_MAX];
#endif
#ifdef HAVE_FILE_LOGGER
char default_log_file[PATH_MAX];
@ -596,12 +594,10 @@ const char *config_get_default_video(void);
const char *config_get_default_audio(void);
const char *config_get_default_input(void);
#ifdef HAVE_CONFIGFILE
#include "conf/config_file.h"
bool config_load_file(const char *path);
bool config_read_keybinds(const char *path);
bool config_save_keybinds(const char *path);
#endif
void rarch_game_reset(void);
void rarch_main_clear_state(void);

View File

@ -30,9 +30,7 @@
#include "../compat/posix_string.h"
#include "../file.h"
#ifdef HAVE_CONFIGFILE
#include "state_tracker.h"
#endif
//#define RARCH_CG_DEBUG
@ -150,9 +148,7 @@ static char lut_textures_uniform[MAX_TEXTURES][64];
static CGparameter cg_attribs[PREV_TEXTURES + 1 + 4 + RARCH_CG_MAX_SHADERS];
static unsigned cg_attrib_index;
#ifdef HAVE_CONFIGFILE
static state_tracker_t *state_tracker = NULL;
#endif
static void gl_cg_reset_attrib(void)
{
@ -306,7 +302,6 @@ void gl_cg_set_params(unsigned width, unsigned height,
}
}
#ifdef HAVE_CONFIGFILE
// Set state parameters
if (state_tracker)
{
@ -325,7 +320,6 @@ void gl_cg_set_params(unsigned width, unsigned height,
set_param_1f(param_f, info[i].value);
}
}
#endif
}
static void gl_cg_deinit_progs(void)
@ -366,13 +360,11 @@ static void gl_cg_deinit_state(void)
glDeleteTextures(lut_textures_num, lut_textures);
lut_textures_num = 0;
#ifdef HAVE_CONFIGFILE
if (state_tracker)
{
state_tracker_free(state_tracker);
state_tracker = NULL;
}
#endif
}
// Final deinit.
@ -513,7 +505,6 @@ static bool load_menu_shader(void)
#define print_buf(buf, ...) snprintf(buf, sizeof(buf), __VA_ARGS__)
#ifdef HAVE_CONFIGFILE
static void load_texture_data(GLuint *obj, const struct texture_image *img, bool smooth)
{
glGenTextures(1, obj);
@ -766,7 +757,6 @@ end:
free(imports);
return ret;
}
#endif
static bool load_shader(const char *cgp_path, unsigned i, config_file_t *conf)
{
@ -933,7 +923,6 @@ end:
static bool load_preset(const char *path)
{
#ifdef HAVE_CONFIGFILE
bool ret = true;
if (!load_stock())
@ -1021,12 +1010,6 @@ end:
if (conf)
config_file_free(conf);
return ret;
#else
(void)path;
RARCH_ERR("No config file support compiled in.\n");
return false;
#endif
}
static void set_program_base_attrib(unsigned i)

View File

@ -205,6 +205,6 @@ check_macro NEON __ARM_NEON__
add_define_make OS "$OS"
# Creates config.mk and config.h.
VARS="ALSA OSS OSS_BSD OSS_LIB AL RSOUND ROAR JACK COREAUDIO PULSE SDL OPENGL GLES VG EGL KMS GBM DRM DYLIB GETOPT_LONG THREADS CG XML SDL_IMAGE LIBPNG DYNAMIC FFMPEG AVCODEC AVFORMAT AVUTIL SWSCALE CONFIGFILE FREETYPE XVIDEO X11 XEXT XF86VM XINERAMA NETPLAY NETWORK_CMD STDIN_CMD COMMAND SOCKET_LEGACY FBO STRL PYTHON FFMPEG_ALLOC_CONTEXT3 FFMPEG_AVCODEC_OPEN2 FFMPEG_AVIO_OPEN FFMPEG_AVFORMAT_WRITE_HEADER FFMPEG_AVFORMAT_NEW_STREAM FFMPEG_AVCODEC_ENCODE_AUDIO2 FFMPEG_AVCODEC_ENCODE_VIDEO2 SINC BSV_MOVIE VIDEOCORE NEON"
VARS="ALSA OSS OSS_BSD OSS_LIB AL RSOUND ROAR JACK COREAUDIO PULSE SDL OPENGL GLES VG EGL KMS GBM DRM DYLIB GETOPT_LONG THREADS CG XML SDL_IMAGE LIBPNG DYNAMIC FFMPEG AVCODEC AVFORMAT AVUTIL SWSCALE FREETYPE XVIDEO X11 XEXT XF86VM XINERAMA NETPLAY NETWORK_CMD STDIN_CMD COMMAND SOCKET_LEGACY FBO STRL PYTHON FFMPEG_ALLOC_CONTEXT3 FFMPEG_AVCODEC_OPEN2 FFMPEG_AVIO_OPEN FFMPEG_AVFORMAT_WRITE_HEADER FFMPEG_AVFORMAT_NEW_STREAM FFMPEG_AVCODEC_ENCODE_AUDIO2 FFMPEG_AVCODEC_ENCODE_VIDEO2 SINC BSV_MOVIE VIDEOCORE NEON"
create_config_make config.mk $VARS
create_config_header config.h $VARS

View File

@ -6,7 +6,6 @@ HAVE_THREADS=auto # Threading support
HAVE_FFMPEG=auto # Enable FFmpeg recording support
HAVE_DYLIB=auto # Enable dynamic loading support
HAVE_NETPLAY=auto # Enable netplay support
HAVE_CONFIGFILE=yes # Disable support for config file
HAVE_OPENGL=yes # Disable OpenGL support
HAVE_GLES=no # Use GLESv2 instead of desktop GL
HAVE_X11=auto # Disable everything X11.

View File

@ -571,7 +571,6 @@ static void print_features(void)
_PSUPP(fbo, "FBO", "OpenGL render-to-texture (multi-pass shaders)");
_PSUPP(dynamic, "Dynamic", "Dynamic run-time loading of libretro library");
_PSUPP(ffmpeg, "FFmpeg", "On-the-fly recording of gameplay with libavcodec");
_PSUPP(configfile, "Config file", "Configuration file support");
_PSUPP(freetype, "FreeType", "TTF font rendering with FreeType");
_PSUPP(netplay, "Netplay", "Peer-to-peer netplay");
_PSUPP(python, "Python", "Script support in shaders");
@ -614,11 +613,9 @@ static void print_help(void)
puts("\t-s/--save: Path for save file (*.srm). Required when rom is input from stdin.");
puts("\t-f/--fullscreen: Start RetroArch in fullscreen regardless of config settings.");
puts("\t-S/--savestate: Path to use for save states. If not selected, *.state will be assumed.");
#ifdef HAVE_CONFIGFILE
puts("\t-c/--config: Path for config file." RARCH_DEFAULT_CONF_PATH_STR);
puts("\t--appendconfig: Extra config files are loaded in, and take priority over config selected in -c (or default).");
puts("\t\tMultiple configs are delimited by ','.");
#endif
#ifdef HAVE_DYNAMIC
puts("\t-L/--libretro: Path to libretro implementation. Overrides any config setting.");
#endif
@ -716,7 +713,6 @@ static void set_paths(const char *path)
if (!*g_settings.system_directory)
fill_pathname_basedir(g_settings.system_directory, path, sizeof(g_settings.system_directory));
#ifdef HAVE_CONFIGFILE
if (*g_extern.config_path && path_is_directory(g_extern.config_path))
{
fill_pathname_dir(g_extern.config_path, g_extern.basename, ".cfg", sizeof(g_extern.config_path));
@ -727,7 +723,6 @@ static void set_paths(const char *path)
RARCH_LOG("Did not find config file. Using system default.\n");
}
}
#endif
}
static void verify_stdin_paths(void)
@ -757,15 +752,12 @@ static void verify_stdin_paths(void)
print_help();
rarch_fail(1, "verify_stdin_paths()");
}
#ifdef HAVE_CONFIGFILE
else if (path_is_directory(g_extern.config_path))
{
RARCH_ERR("Cannot specify directory for config file (--config) when reading from stdin.\n");
print_help();
rarch_fail(1, "verify_stdin_paths()");
}
#endif
driver.stdin_claimed = true;
}
@ -797,10 +789,8 @@ static void parse_input(int argc, char *argv[])
#endif
{ "verbose", 0, NULL, 'v' },
{ "gameboy", 1, NULL, 'g' },
#ifdef HAVE_CONFIGFILE
{ "config", 1, NULL, 'c' },
{ "appendconfig", 1, &val, 'C' },
#endif
{ "mouse", 1, NULL, 'm' },
{ "nodevice", 1, NULL, 'N' },
{ "scope", 0, NULL, 'p' },
@ -845,12 +835,6 @@ static void parse_input(int argc, char *argv[])
#define FFMPEG_RECORD_ARG
#endif
#ifdef HAVE_CONFIGFILE
#define CONFIG_FILE_ARG "c:"
#else
#define CONFIG_FILE_ARG
#endif
#ifdef HAVE_DYNAMIC
#define DYNAMIC_ARG "L:"
#else
@ -869,7 +853,7 @@ static void parse_input(int argc, char *argv[])
#define BSV_MOVIE_ARG
#endif
const char *optstring = "hs:fvS:m:p4jJA:g:b:B:Y:Z:U:DN:X:" BSV_MOVIE_ARG NETPLAY_ARG DYNAMIC_ARG FFMPEG_RECORD_ARG CONFIG_FILE_ARG;
const char *optstring = "hs:fvS:m:p4jJA:g:b:c:B:Y:Z:U:DN:X:" BSV_MOVIE_ARG NETPLAY_ARG DYNAMIC_ARG FFMPEG_RECORD_ARG;
for (;;)
{
val = 0;
@ -977,11 +961,9 @@ static void parse_input(int argc, char *argv[])
g_extern.has_scope = true;
break;
#ifdef HAVE_CONFIGFILE
case 'c':
strlcpy(g_extern.config_path, optarg, sizeof(g_extern.config_path));
break;
#endif
#ifdef HAVE_FFMPEG
case 'r':

View File

@ -245,9 +245,7 @@ void config_set_defaults(void)
rarch_init_msg_queue();
}
#ifdef HAVE_CONFIGFILE
static void parse_config_file(void);
#endif
void config_load(void)
{
@ -256,14 +254,10 @@ void config_load(void)
#endif
{
config_set_defaults();
#ifdef HAVE_CONFIGFILE
parse_config_file();
#endif
}
}
#ifdef HAVE_CONFIGFILE
static config_file_t *open_default_config_file(void)
{
config_file_t *conf = NULL;
@ -368,10 +362,7 @@ static config_file_t *open_default_config_file(void)
return conf;
}
#endif
#ifdef HAVE_CONFIGFILE
static void config_read_keybinds_conf(config_file_t *conf);
static void parse_config_file(void)
@ -1026,5 +1017,3 @@ bool config_save_keybinds(const char *path)
return true;
}
#endif