annotate src/flac-1.2.1/README @ 44:9894b839b0cb

Updated MSVC
author Chris Cannam
date Tue, 18 Oct 2016 15:58:42 +0100
parents 05aa0afa9217
children
rev   line source
Chris@1 1 /* FLAC - Free Lossless Audio Codec
Chris@1 2 * Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson
Chris@1 3 *
Chris@1 4 * This file is part the FLAC project. FLAC is comprised of several
Chris@1 5 * components distributed under difference licenses. The codec libraries
Chris@1 6 * are distributed under Xiph.Org's BSD-like license (see the file
Chris@1 7 * COPYING.Xiph in this distribution). All other programs, libraries, and
Chris@1 8 * plugins are distributed under the LGPL or GPL (see COPYING.LGPL and
Chris@1 9 * COPYING.GPL). The documentation is distributed under the Gnu FDL (see
Chris@1 10 * COPYING.FDL). Each file in the FLAC distribution contains at the top the
Chris@1 11 * terms under which it may be distributed.
Chris@1 12 *
Chris@1 13 * Since this particular file is relevant to all components of FLAC,
Chris@1 14 * it may be distributed under the Xiph.Org license, which is the least
Chris@1 15 * restrictive of those mentioned above. See the file COPYING.Xiph in this
Chris@1 16 * distribution.
Chris@1 17 */
Chris@1 18
Chris@1 19
Chris@1 20 FLAC (http://flac.sourceforge.net/) is an Open Source lossless audio
Chris@1 21 codec developed by Josh Coalson.
Chris@1 22
Chris@1 23 FLAC is comprised of
Chris@1 24 * `libFLAC', a library which implements reference encoders and
Chris@1 25 decoders for native FLAC and Ogg FLAC, and a metadata interface
Chris@1 26 * `libFLAC++', a C++ object wrapper library around libFLAC
Chris@1 27 * `flac', a command-line program for encoding and decoding files
Chris@1 28 * `metaflac', a command-line program for viewing and editing FLAC
Chris@1 29 metadata
Chris@1 30 * player plugins for XMMS and Winamp
Chris@1 31 * user and API documentation
Chris@1 32
Chris@1 33 The libraries (libFLAC, libFLAC++) are
Chris@1 34 licensed under Xiph.org's BSD-like license (see COPYING.Xiph). All other
Chris@1 35 programs and plugins are licensed under the GNU General Public License
Chris@1 36 (see COPYING.GPL). The documentation is licensed under the GNU Free
Chris@1 37 Documentation License (see COPYING.FDL).
Chris@1 38
Chris@1 39
Chris@1 40 ===============================================================================
Chris@1 41 FLAC - 1.2.1 - Contents
Chris@1 42 ===============================================================================
Chris@1 43
Chris@1 44 - Introduction
Chris@1 45 - Prerequisites
Chris@1 46 - Note to embedded developers
Chris@1 47 - Building in a GNU environment
Chris@1 48 - Building with Makefile.lite
Chris@1 49 - Building with MSVC
Chris@1 50 - Building on Mac OS X
Chris@1 51
Chris@1 52
Chris@1 53 ===============================================================================
Chris@1 54 Introduction
Chris@1 55 ===============================================================================
Chris@1 56
Chris@1 57 This is the source release for the FLAC project. See
Chris@1 58
Chris@1 59 doc/html/index.html
Chris@1 60
Chris@1 61 for full documentation.
Chris@1 62
Chris@1 63 A brief description of the directory tree:
Chris@1 64
Chris@1 65 doc/ the HTML documentation
Chris@1 66 include/ public include files for libFLAC and libFLAC++
Chris@1 67 man/ the man page for `flac'
Chris@1 68 src/ the source code and private headers
Chris@1 69 test/ the test scripts
Chris@1 70
Chris@1 71
Chris@1 72 ===============================================================================
Chris@1 73 Prerequisites
Chris@1 74 ===============================================================================
Chris@1 75
Chris@1 76 To build FLAC with support for Ogg FLAC you must have built and installed
Chris@1 77 libogg according to the specific instructions below. You must have
Chris@1 78 libogg 1.1.2 or greater, or there will be seeking problems with Ogg FLAC.
Chris@1 79
Chris@1 80 If you are building on x86 and want the assembly optimizations, you will
Chris@1 81 need to have NASM >= 0.98.30 installed according to the specific instructions
Chris@1 82 below.
Chris@1 83
Chris@1 84
Chris@1 85 ===============================================================================
Chris@1 86 Note to embedded developers
Chris@1 87 ===============================================================================
Chris@1 88
Chris@1 89 libFLAC has grown larger over time as more functionality has been
Chris@1 90 included, but much of it may be unnecessary for a particular embedded
Chris@1 91 implementation. Unused parts may be pruned by some simple editing of
Chris@1 92 configure.in and src/libFLAC/Makefile.am; the following dependency
Chris@1 93 graph shows which modules may be pruned without breaking things
Chris@1 94 further down:
Chris@1 95
Chris@1 96 metadata.h
Chris@1 97 stream_decoder.h
Chris@1 98 format.h
Chris@1 99
Chris@1 100 stream_encoder.h
Chris@1 101 stream_decoder.h
Chris@1 102 format.h
Chris@1 103
Chris@1 104 stream_decoder.h
Chris@1 105 format.h
Chris@1 106
Chris@1 107 In other words, for pure decoding applications, both the stream encoder
Chris@1 108 and metadata editing interfaces can be safely removed.
Chris@1 109
Chris@1 110 There is a section dedicated to embedded use in the libFLAC API
Chris@1 111 HTML documentation (see doc/html/api/index.html).
Chris@1 112
Chris@1 113 Also, there are several places in the libFLAC code with comments marked
Chris@1 114 with "OPT:" where a #define can be changed to enable code that might be
Chris@1 115 faster on a specific platform. Experimenting with these can yield faster
Chris@1 116 binaries.
Chris@1 117
Chris@1 118
Chris@1 119 ===============================================================================
Chris@1 120 Building in a GNU environment
Chris@1 121 ===============================================================================
Chris@1 122
Chris@1 123 FLAC uses autoconf and libtool for configuring and building.
Chris@1 124 Better documentation for these will be forthcoming, but in
Chris@1 125 general, this should work:
Chris@1 126
Chris@1 127 ./configure && make && make check && make install
Chris@1 128
Chris@1 129 The 'make check' step is optional; omit it to skip all the tests,
Chris@1 130 which can take several hours and use around 70-80 megs of disk space.
Chris@1 131 Even though it will stop with an explicit message on any failure, it
Chris@1 132 does print out a lot of stuff so you might want to capture the output
Chris@1 133 to a file if you're having a problem. Also, don't run 'make check'
Chris@1 134 as root because it confuses some of the tests.
Chris@1 135
Chris@1 136 NOTE: Despite our best efforts it's entirely possible to have
Chris@1 137 problems when using older versions of autoconf, automake, or
Chris@1 138 libtool. If you have the latest versions and still can't get it
Chris@1 139 to work, see the next section on Makefile.lite.
Chris@1 140
Chris@1 141 There are a few FLAC-specific arguments you can give to
Chris@1 142 `configure':
Chris@1 143
Chris@1 144 --enable-debug : Builds everything with debug symbols and some
Chris@1 145 extra (and more verbose) error checking.
Chris@1 146
Chris@1 147 --disable-asm-optimizations : Disables the compilation of the
Chris@1 148 assembly routines. Many routines have assembly versions for
Chris@1 149 speed and `configure' is pretty good about knowing what is
Chris@1 150 supported, but you can use this option to build only from the
Chris@1 151 C sources. May be necessary for building on OS X (Intel)
Chris@1 152
Chris@1 153 --enable-sse : If you are building for an x86 CPU that supports
Chris@1 154 SSE instructions, you can enable some of the faster routines
Chris@1 155 if your operating system also supports SSE instructions. flac
Chris@1 156 can tell if the CPU supports the instructions but currently has
Chris@1 157 no way to test if the OS does, so if it does, you must pass
Chris@1 158 this argument to configure to use the SSE routines. If flac
Chris@1 159 crashes when built with this option you will have to go back and
Chris@1 160 configure without --enable-sse. Note that
Chris@1 161 --disable-asm-optimizations implies --disable-sse.
Chris@1 162
Chris@1 163 --enable-local-xmms-plugin : Installs the FLAC XMMS plugin in
Chris@1 164 $HOME/.xmms/Plugins, instead of the global XMMS plugin area
Chris@1 165 (usually /usr/lib/xmms/Input).
Chris@1 166
Chris@1 167 --with-ogg=
Chris@1 168 --with-xmms-prefix=
Chris@1 169 --with-libiconv-prefix=
Chris@1 170 Use these if you have these packages but configure can't find them.
Chris@1 171
Chris@1 172 If you want to build completely from scratch (i.e. starting with just
Chris@1 173 configure.in and Makefile.am) you should be able to just run 'autogen.sh'
Chris@1 174 but make sure and read the comments in that file first.
Chris@1 175
Chris@1 176
Chris@1 177 ===============================================================================
Chris@1 178 Building with Makefile.lite
Chris@1 179 ===============================================================================
Chris@1 180
Chris@1 181 There is a more lightweight build system for do-it-yourself-ers.
Chris@1 182 It is also useful if configure isn't working, which may be the
Chris@1 183 case since lately we've had some problems with different versions
Chris@1 184 of automake and libtool. The Makefile.lite system should work
Chris@1 185 on GNU systems with few or no adjustments.
Chris@1 186
Chris@1 187 From the top level just 'make -f Makefile.lite'. You can
Chris@1 188 specify zero or one optional target from 'release', 'debug',
Chris@1 189 'test', or 'clean'. The default is 'release'. There is no
Chris@1 190 'install' target but everything you need will end up in the
Chris@1 191 obj/ directory.
Chris@1 192
Chris@1 193 If you are not on an x86 system or you don't have nasm, you
Chris@1 194 may have to change the DEFINES in src/libFLAC/Makefile.lite. If
Chris@1 195 you don't have nasm, remove -DFLAC__HAS_NASM. If your target is
Chris@1 196 not an x86, change -DFLAC__CPU_IA32 to -DFLAC__CPU_UNKNOWN.
Chris@1 197
Chris@1 198
Chris@1 199 ===============================================================================
Chris@1 200 Building with MSVC
Chris@1 201 ===============================================================================
Chris@1 202
Chris@1 203 There are .dsp projects and a master FLAC.dsw workspace to build all
Chris@1 204 the libraries and executables with MSVC6. There are also .vcproj
Chris@1 205 projects and a master FLAC.sln solution to build all the libraries and
Chris@1 206 executables with VC++ 2005.
Chris@1 207
Chris@1 208 Prerequisite: you must have the Ogg libraries installed as described
Chris@1 209 later.
Chris@1 210
Chris@1 211 Prerequisite: you must have nasm installed, and nasmw.exe must be in
Chris@1 212 your PATH, or the path to nasmw.exe must be added to the list of
Chris@1 213 directories for executable files in the MSVC global options.
Chris@1 214
Chris@1 215 MSVC6:
Chris@1 216 To build everything, run Developer Studio, do File|Open Workspace,
Chris@1 217 and open FLAC.dsw. Select "Build | Set active configuration..."
Chris@1 218 from the menu, then in the dialog, select "All - Win32 Release" (or
Chris@1 219 Debug if you prefer). Click "Ok" then hit F7 to build.
Chris@1 220
Chris@1 221 VC++ 2005:
Chris@1 222 To build everything, run Visual Studio, do File|Open and open FLAC.sln.
Chris@1 223 From the dropdown in the toolbar, select "Release" instead of "Debug",
Chris@1 224 then hit F7 to build.
Chris@1 225
Chris@1 226 Either way, this will build all libraries both statically (e.g.
Chris@1 227 obj\release\lib\libFLAC_static.lib) and as DLLs (e.g.
Chris@1 228 obj\release\lib\libFLAC.dll), and it will build all binaries, statically
Chris@1 229 linked (e.g. obj\release\bin\flac.exe).
Chris@1 230
Chris@1 231 Everything will end up in the "obj" directory. DLLs and .exe files
Chris@1 232 are all that are needed and can be copied to an installation area and
Chris@1 233 added to the PATH. The plugins have to be copied to their appropriate
Chris@1 234 place in the player area. For Winamp2 this is <winamp2-dir>\Plugins.
Chris@1 235
Chris@1 236 By default the code is configured with Ogg support. Before building FLAC
Chris@1 237 you will need to get the Ogg source distribution
Chris@1 238 (see http://xiph.org/ogg/vorbis/download/), build ogg_static.lib (load and
Chris@1 239 build win32\ogg_static.dsp), copy ogg_static.lib into FLAC's
Chris@1 240 'obj\release\lib' directory, and copy the entire include\ogg tree into
Chris@1 241 FLAC's 'include' directory (so that there is an 'ogg' directory in FLAC's
Chris@1 242 'include' directory with the files ogg.h, os_types.h and config_types.h).
Chris@1 243
Chris@1 244 If you want to build without Ogg support, instead edit all .dsp or
Chris@1 245 .vcproj files and remove any occurrences of "/D FLAC__HAS_OGG".
Chris@1 246
Chris@1 247
Chris@1 248 ===============================================================================
Chris@1 249 Building on Mac OS X
Chris@1 250 ===============================================================================
Chris@1 251
Chris@1 252 If you have Fink or a recent version of OS X with the proper autotooles,
Chris@1 253 the GNU flow above should work. The Project Builder project has been
Chris@1 254 deprecated but we are working on replacing it with an Xcode equivalent.