From: <man...@us...> - 2013-12-17 13:13:02
|
Revision: 3487 http://sourceforge.net/p/modplug/code/3487 Author: manxorist Date: 2013-12-17 13:12:53 +0000 (Tue, 17 Dec 2013) Log Message: ----------- [New] libopenmpt: Add openmpt::string::library_features . [Doc] libopenmpt: Small cleanups. [Ref] openmpt123: Small cleanups. Modified Paths: -------------- trunk/OpenMPT/README.md trunk/OpenMPT/common/version.cpp trunk/OpenMPT/common/version.h trunk/OpenMPT/libopenmpt/dox/dependencies.md trunk/OpenMPT/libopenmpt/dox/quickstart.md trunk/OpenMPT/libopenmpt/dox/tests.md trunk/OpenMPT/libopenmpt/libopenmpt.h trunk/OpenMPT/libopenmpt/libopenmpt.hpp trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp trunk/OpenMPT/openmpt123/openmpt123.cpp Modified: trunk/OpenMPT/README.md =================================================================== --- trunk/OpenMPT/README.md 2013-12-17 12:11:22 UTC (rev 3486) +++ trunk/OpenMPT/README.md 2013-12-17 13:12:53 UTC (rev 3487) @@ -98,7 +98,7 @@ make CONFIG=mingw64-win64 # for win64 - - gcc or clang (on unix, including Mac OS X with MacPorts): + - gcc or clang (on Unix-like systems, including Mac OS X with MacPorts): The minimum required compiler versions are: @@ -106,7 +106,7 @@ - clang 3.0 - The Makefile requires pkg-config for native unix builds. + The Makefile requires pkg-config for native builds. For sound output in openmpt123, PortAudio or SDL is required. openmpt123 can optionally use libflac, libwavpack and libsndfile to render PCM files to disk. @@ -194,14 +194,14 @@ - Do not use ANY locale-dependant C functions. For locale-dependant C++ functionaly (especially iostream), always imbue the `std::locale::classic()` locale. - - Prefer unix_style_names over CamelCaseNames. + - Prefer kernel_style_names over CamelCaseNames. - Indentation: - `{` are placed at the end of the opening line. - Enclose even single statements in curly braces. - Avoid placing single statements on the same line as the `if`. - - Opening brackets are separated from keywords with a space. - - Opening brackets are not separated from function names. - - Place spaces around operators and inside brackets. + - Opening parentheses are separated from keywords with a space. + - Opening parentheses are not separated from function names. + - Place spaces around operators and inside parentheses. - Align `:` and `,` when inheriting or initialiasing members in a constructor. - The pointer `*` is separated from both the type and the variable name. Modified: trunk/OpenMPT/common/version.cpp =================================================================== --- trunk/OpenMPT/common/version.cpp 2013-12-17 12:11:22 UTC (rev 3486) +++ trunk/OpenMPT/common/version.cpp 2013-12-17 13:12:53 UTC (rev 3487) @@ -177,6 +177,44 @@ { retval += " DEBUG"; } + return retval; +} + +std::string GetBuildFeaturesString() +{ + std::string retval; + #ifdef LIBOPENMPT_BUILD + #if MPT_COMPILER_GENERIC + retval += "*C++11"; + #elif MPT_COMPILER_MSVC + retval += mpt::String::Print("*MSVC-%1.%2", MPT_COMPILER_MSVC_VERSION / 100, MPT_COMPILER_MSVC_VERSION % 100); + #elif MPT_COMPILER_GCC + retval += mpt::String::Print("*GCC-%1.%2.%3", MPT_COMPILER_GCC_VERSION / 10000, (MPT_COMPILER_GCC_VERSION / 100) % 100, MPT_COMPILER_GCC_VERSION % 100); + #elif MPT_COMPILER_CLANG + retval += mpt::String::Print("*Clang-%1.%2.%3", MPT_COMPILER_CLANG_VERSION / 10000, (MPT_COMPILER_CLANG_VERSION / 100) % 100, MPT_COMPILER_CLANG_VERSION % 100); + #else + retval += "*unknown"; + #endif + #if defined(WIN32) + retval += " +WINAPI"; + #elif defined(MPT_CHARSET_CPP) + retval += " +CODECVT"; + #else + retval += " +ICONV"; + #endif + #if !defined(NO_ZLIB) + retval += " +ZLIB"; + #elif !defined(NO_MINIZ) + retval += " +MINIZ"; + #else + retval += " -INFLATE"; + #endif + #if !defined(NO_MO3) + retval += " +UNMO3"; + #else + retval += " -UNMO3"; + #endif + #endif #ifdef MODPLUG_TRACKER #ifdef NO_VST retval += " NO_VST"; @@ -221,6 +259,9 @@ { retval += GetRevisionString(); retval += GetBuildFlagsString(); + #ifdef MODPLUG_TRACKER + retval += GetBuildFeaturesString(); + #endif } return retval; } Modified: trunk/OpenMPT/common/version.h =================================================================== --- trunk/OpenMPT/common/version.h 2013-12-17 12:11:22 UTC (rev 3486) +++ trunk/OpenMPT/common/version.h 2013-12-17 13:12:53 UTC (rev 3487) @@ -69,9 +69,12 @@ // Return a string decribing the time of the build process (if built from a svn working copy and tsvn was available during build, otherwise it returns the time version.cpp was last rebuild which could be unreliable as it does not get rebuild every time without tsvn) std::string GetBuildDateString(); - // Return a string decribing some of the buidl features and/or flags - std::string GetBuildFlagsString(); // e.g. " TEST DEBUG NO_VST" + // Return a string decribing some of the build flags + std::string GetBuildFlagsString(); // e.g. " TEST DEBUG" + // Return a string decribing some of the build features + std::string GetBuildFeaturesString(); // e.g. " NO_VST NO_DSOUND" + // Return a string decribing the revision of the svn working copy and if it was dirty (+) or had mixed revisions (!) (if built from a svn working copy and tsvn was available during build) std::string GetRevisionString(); // e.g. "-r1234+" Modified: trunk/OpenMPT/libopenmpt/dox/dependencies.md =================================================================== --- trunk/OpenMPT/libopenmpt/dox/dependencies.md 2013-12-17 12:11:22 UTC (rev 3486) +++ trunk/OpenMPT/libopenmpt/dox/dependencies.md 2013-12-17 13:12:53 UTC (rev 3487) @@ -23,7 +23,7 @@ * **J2B** support requires a inflate (deflate decompression) implementation: * **zlib** * **miniz** can be used internally if no zlib is available. - * Building on unix systems requires: + * Building on Unix-like systems requires: * **GNU make** * **pkg-config** Modified: trunk/OpenMPT/libopenmpt/dox/quickstart.md =================================================================== --- trunk/OpenMPT/libopenmpt/dox/quickstart.md 2013-12-17 12:11:22 UTC (rev 3486) +++ trunk/OpenMPT/libopenmpt/dox/quickstart.md 2013-12-17 13:12:53 UTC (rev 3487) @@ -3,40 +3,44 @@ =========== -### Unix +### Unix-like 1. Get dependencies: - - *GNU make* - - *gcc >= 4.4* or *clang >= 3.0* - - *pkg-config* - - *portaudio-v19* - - *zlib* + - **GNU make** + - **gcc >= 4.4** or **clang >= 3.0** + - **pkg-config** + - **portaudio-v19** + - **zlib** 2. *Optional*: - - *doxygen >= 1.8* - - *help2man* - - *libSDL* - - *libFLAC* - - *libsndfile* + - **doxygen >= 1.8** + - **help2man** + - **libSDL** + - **libFLAC** + - **libsndfile** + - **WavPack** 3. Run: svn checkout http://svn.code.sf.net/p/modplug/code/trunk/OpenMPT/ openmpt-trunk cd openmpt-trunk + make TEST=1 clean make TEST=1 make TEST=1 check make clean make make doc - sudo make install - sudo make install-doc + sudo make install # installs into /usr/local by default + sudo make install-doc # installs into /usr/local by default openmpt123 $SOMEMODULE ### Windows - 1. Checkout `http://svn.code.sf.net/p/modplug/code/trunk/OpenMPT/` . - 2. *Optional*: Get dependencies: - - *Winamp SDK* - - *XMPlay SDK* - 3. Open `openmpt123\openmpt123.sln` or `libopenmpt\libopenmpt.sln` in *Microsoft Visual Studio 2010*. - 4. Select appropriate configuration and build. Binaries are generated in `bin\` - 5. Drag a module onto `openmpt123.exe` or copy the player plugin DLLs (`in_openmpt.dll`, `xmp-openmpt.dll` or `foo_openmpt.dll`) and `libopenmpt_settings.dll` into the respective player directory. + 1. Get dependencies: + - **Microsoft Visual Studio 2010** + 2. *Optionally* get dependencies: + - **Winamp SDK** + - **XMPlay SDK** + 3. Checkout `http://svn.code.sf.net/p/modplug/code/trunk/OpenMPT/` . + 4. Open `openmpt123\openmpt123.sln` or `libopenmpt\libopenmpt.sln` in *Microsoft Visual Studio 2010*. + 5. Select appropriate configuration and build. Binaries are generated in `bin\` + 6. Drag a module onto `openmpt123.exe` or copy the player plugin DLLs (`in_openmpt.dll`, `xmp-openmpt.dll` or `foo_openmpt.dll`) and `libopenmpt_settings.dll` into the respective player directory. Modified: trunk/OpenMPT/libopenmpt/dox/tests.md =================================================================== --- trunk/OpenMPT/libopenmpt/dox/tests.md 2013-12-17 12:11:22 UTC (rev 3486) +++ trunk/OpenMPT/libopenmpt/dox/tests.md 2013-12-17 13:12:53 UTC (rev 3487) @@ -10,7 +10,7 @@ ### Running Tests -#### On Unix +#### On Unix-like systems Compile with Modified: trunk/OpenMPT/libopenmpt/libopenmpt.h =================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt.h 2013-12-17 12:11:22 UTC (rev 3486) +++ trunk/OpenMPT/libopenmpt/libopenmpt.h 2013-12-17 13:12:53 UTC (rev 3487) @@ -79,13 +79,15 @@ LIBOPENMPT_API uint32_t openmpt_get_core_version(void); /*! Return a verbose library version string from openmpt_string_get(). */ -#define OPENMPT_STRING_LIBRARY_VERSION "library_version" +#define OPENMPT_STRING_LIBRARY_VERSION "library_version" +/*! Return a verbose library features string from openmpt_string_get(). */ +#define OPENMPT_STRING_LIBRARY_FEATURES "library_features" /*! Return a verbose OpenMPT core version string from openmpt_string_get(). */ -#define OPENMPT_STRING_CORE_VERSION "core_version" +#define OPENMPT_STRING_CORE_VERSION "core_version" /*! Return information about the current build (e.g. the build date or compiler used) from openmpt_string_get(). */ -#define OPENMPT_STRING_BUILD "build" +#define OPENMPT_STRING_BUILD "build" /*! Return all contributors from openmpt_string_get(). */ -#define OPENMPT_STRING_CREDITS "credits" +#define OPENMPT_STRING_CREDITS "credits" /*! Return contact infromation about libopenmpt from openmpt_string_get(). */ #define OPENMPT_STRING_CONTACT "contact" Modified: trunk/OpenMPT/libopenmpt/libopenmpt.hpp =================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt.hpp 2013-12-17 12:11:22 UTC (rev 3486) +++ trunk/OpenMPT/libopenmpt/libopenmpt.hpp 2013-12-17 13:12:53 UTC (rev 3487) @@ -86,15 +86,17 @@ namespace string { //! Return a verbose library version string from openmpt::string::get(). -static const char library_version[] = "library_version"; +static const char library_version [] = "library_version"; +//! Return a verbose library features string from openmpt::string::get(). +static const char library_features[] = "library_features"; //! Return a verbose OpenMPT core version string from openmpt::string::get(). -static const char core_version [] = "core_version"; +static const char core_version [] = "core_version"; //! Return information about the current build (e.g. the build date or compiler used) from openmpt::string::get(). -static const char build [] = "build"; +static const char build [] = "build"; //! Return all contributors from openmpt::string::get(). -static const char credits [] = "credits"; +static const char credits [] = "credits"; //! Return contact infromation about libopenmpt from openmpt::string::get(). -static const char contact [] = "contact"; +static const char contact [] = "contact"; //! Get library related metadata. /*! Modified: trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp =================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp 2013-12-17 12:11:22 UTC (rev 3486) +++ trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp 2013-12-17 13:12:53 UTC (rev 3487) @@ -76,6 +76,10 @@ return str; } +static std::string get_library_features_string() { + return MptVersion::GetBuildFeaturesString(); +} + static std::string get_core_version_string() { return MptVersion::GetVersionStringExtended(); } @@ -97,6 +101,8 @@ return std::string(); } else if ( key == string::library_version ) { return get_library_version_string(); + } else if ( key == string::library_features ) { + return get_library_features_string(); } else if ( key == string::core_version ) { return get_core_version_string(); } else if ( key == string::build ) { Modified: trunk/OpenMPT/openmpt123/openmpt123.cpp =================================================================== --- trunk/OpenMPT/openmpt123/openmpt123.cpp 2013-12-17 12:11:22 UTC (rev 3486) +++ trunk/OpenMPT/openmpt123/openmpt123.cpp 2013-12-17 13:12:53 UTC (rev 3487) @@ -325,23 +325,43 @@ static void show_info( std::ostream & log, bool verbose ) { log << "openmpt123" << " v" << OPENMPT123_VERSION_STRING << ", libopenmpt " << openmpt::string::get( openmpt::string::library_version ) << " (" << "OpenMPT " << openmpt::string::get( openmpt::string::core_version ) << ")" << std::endl; - log << "Copyright (c) 2013 OpenMPT developers (http://openmpt.org/)" << std::endl; + log << "Copyright (c) 2013 OpenMPT developers <http://openmpt.org/>" << std::endl; if ( !verbose ) { log << std::endl; return; } - log << " (built " << openmpt::string::get( openmpt::string::build ) << ")" << std::endl; + log << " libopenmpt Features: " << openmpt::string::get( openmpt::string::library_features ) << std::endl; + log << " libopenmpt Build: " << openmpt::string::get( openmpt::string::build ) << std::endl; #ifdef MPT_WITH_PORTAUDIO - log << " " << Pa_GetVersionText() << " (http://portaudio.com/)" << std::endl; + log << " " << Pa_GetVersionText() << " (" << Pa_GetVersion() << ") <http://portaudio.com/>" << std::endl; #endif +#ifdef MPT_WITH_SDL + const SDL_version * linked_sdlver = SDL_Linked_Version(); + log << " libSDL "; + if ( linked_sdlver ) { + log << (int)linked_sdlver->major << "." << (int)linked_sdlver->minor << "." << (int)linked_sdlver->patch << " "; + } + SDL_version sdlver; + std::memset( &sdlver, 0, sizeof( SDL_version ) ); + SDL_VERSION( &sdlver ); + log << "(API: " << (int)sdlver.major << "." << (int)sdlver.minor << "." << (int)sdlver.patch << ")"; + log << " <https://libsdl.org/>" << std::endl; +#endif #ifdef MPT_WITH_FLAC - log << " FLAC " << FLAC__VERSION_STRING << ", " << FLAC__VENDOR_STRING << ", API " << FLAC_API_VERSION_CURRENT << "." << FLAC_API_VERSION_REVISION << "." << FLAC_API_VERSION_AGE << " (https://xiph.org/flac/)" << std::endl; + log << " FLAC " << FLAC__VERSION_STRING << ", " << FLAC__VENDOR_STRING << ", API " << FLAC_API_VERSION_CURRENT << "." << FLAC_API_VERSION_REVISION << "." << FLAC_API_VERSION_AGE << " <https://xiph.org/flac/>" << std::endl; #endif #ifdef MPT_WITH_SNDFILE char sndfile_info[128]; + std::memset( sndfile_info, 0, sizeof( sndfile_info ) ); sf_command( 0, SFC_GET_LIB_VERSION, sndfile_info, sizeof( sndfile_info ) ); - log << " libsndfile " << sndfile_info << " (http://mega-nerd.com/libsndfile/)" << std::endl; + sndfile_info[127] = '\0'; + log << " libsndfile " << sndfile_info << " <http://mega-nerd.com/libsndfile/>" << std::endl; #endif +#ifdef MPT_WITH_WAVPACK + std::ostringstream wpver; + wpver << std::hex << std::setfill('0') << std::setw(8) << WavpackGetLibraryVersion(); + log << " WavPack " << WavpackGetLibraryVersionString() << " (" << wpver.str() << ") (http://wavpack.com/)" << std::endl; +#endif log << std::endl; } @@ -390,8 +410,8 @@ return str.str(); } -static void show_help( textout & log, bool longhelp = false, const std::string & message = std::string(), bool verbose = false ) { - show_info( log, verbose ); +static void show_help( textout & log, bool longhelp = false, const std::string & message = std::string() ) { + show_info( log, false ); { log << "Usage: openmpt123 [options] [--] file1 [file2] ..." << std::endl; log << std::endl; @@ -1627,7 +1647,7 @@ show_help( std_out ); return 1; } catch ( show_help_exception & e ) { - show_help( std_out, e.longhelp, e.message, flags.verbose ); + show_help( std_out, e.longhelp, e.message ); if ( flags.verbose ) { show_credits( std_out ); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |