Display features compiled in with --help.

This commit is contained in:
Themaister 2011-01-25 13:03:53 +01:00
parent fcba18e564
commit b8aa08de8b
2 changed files with 128 additions and 0 deletions

101
config.features.h Normal file
View File

@ -0,0 +1,101 @@
#ifndef __SSNES_FEATURES_H
#define __SSNES_FEATURES_H
#include <stddef.h>
#include <stdbool.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef HAVE_SDL
static const bool _sdl_supp = true;
#else
static const bool _sdl_supp = false;
#endif
#ifdef HAVE_ALSA
static const bool _alsa_supp = true;
#else
static const bool _alsa_supp = false;
#endif
#ifdef HAVE_OSS
static const bool _oss_supp = true;
#else
static const bool _oss_supp = false;
#endif
#ifdef HAVE_AL
static const bool _al_supp = true;
#else
static const bool _al_supp = false;
#endif
#ifdef HAVE_RSOUND
static const bool _rsound_supp = true;
#else
static const bool _rsound_supp = false;
#endif
#ifdef HAVE_ROAR
static const bool _roar_supp = true;
#else
static const bool _roar_supp = false;
#endif
#ifdef HAVE_JACK
static const bool _jack_supp = true;
#else
static const bool _jack_supp = false;
#endif
#ifdef HAVE_FILTER
static const bool _filter_supp = true;
#else
static const bool _filter_supp = false;
#endif
#ifdef HAVE_CG
static const bool _cg_supp = true;
#else
static const bool _cg_supp = false;
#endif
#ifdef HAVE_XML
static const bool _xml_supp = true;
#else
static const bool _xml_supp = false;
#endif
#ifdef HAVE_DYNAMIC
static const bool _dynamic_supp = true;
#else
static const bool _dynamic_supp = false;
#endif
#ifdef HAVE_FFMPEG
static const bool _ffmpeg_supp = true;
#else
static const bool _ffmpeg_supp = false;
#endif
#ifdef HAVE_SRC
static const bool _src_supp = true;
#else
static const bool _src_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
static const bool _freetype_supp = false;
#endif
#endif

27
ssnes.c
View File

@ -244,6 +244,31 @@ static void fill_pathname(char *out_path, char *in_path, const char *replace)
#define PACKAGE_VERSION "0.2"
#endif
#include "config.features.h"
#define _PSUPP(var, name, desc) printf("\t%s:\n\t\t%s: %s\n", name, desc, _##var##_supp ? "yes" : "no")
static void print_features(void)
{
puts("");
puts("Features:");
_PSUPP(sdl, "SDL", "SDL drivers");
_PSUPP(alsa, "ALSA", "audio driver");
_PSUPP(oss, "OSS", "audio driver");
_PSUPP(jack, "Jack", "audio driver");
_PSUPP(rsound, "RSound", "audio driver");
_PSUPP(roar, "RoarAudio", "audio driver");
_PSUPP(al, "OpenAL", "audio driver");
_PSUPP(filter, "Filter", "CPU based video filters");
_PSUPP(cg, "Cg", "Cg pixel shaders");
_PSUPP(xml, "XML", "bSNES XML pixel shaders");
_PSUPP(dynamic, "Dynamic", "Dynamic run-time loading of libsnes library");
_PSUPP(ffmpeg, "FFmpeg", "On-the-fly recording of gameplay with libavcodec");
_PSUPP(src, "SRC", "libsamplerate audio resampling");
_PSUPP(configfile, "Config file", "Configuration file support");
_PSUPP(freetype, "FreeType", "TTF font rendering with FreeType");
}
#undef _PSUPP
static void print_help(void)
{
puts("=============================================================");
@ -272,6 +297,8 @@ static void print_help(void)
puts("\t-r/--record: Path to record video file. Settings for video/audio codecs are found in config file.");
#endif
puts("\t-v/--verbose: Verbose logging");
print_features();
}
static void parse_input(int argc, char *argv[])