Chris@1: /* FLAC - Free Lossless Audio Codec Chris@1: * Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson Chris@1: * Chris@1: * This file is part the FLAC project. FLAC is comprised of several Chris@1: * components distributed under difference licenses. The codec libraries Chris@1: * are distributed under Xiph.Org's BSD-like license (see the file Chris@1: * COPYING.Xiph in this distribution). All other programs, libraries, and Chris@1: * plugins are distributed under the LGPL or GPL (see COPYING.LGPL and Chris@1: * COPYING.GPL). The documentation is distributed under the Gnu FDL (see Chris@1: * COPYING.FDL). Each file in the FLAC distribution contains at the top the Chris@1: * terms under which it may be distributed. Chris@1: * Chris@1: * Since this particular file is relevant to all components of FLAC, Chris@1: * it may be distributed under the Xiph.Org license, which is the least Chris@1: * restrictive of those mentioned above. See the file COPYING.Xiph in this Chris@1: * distribution. Chris@1: */ Chris@1: Chris@1: Chris@1: FLAC (http://flac.sourceforge.net/) is an Open Source lossless audio Chris@1: codec developed by Josh Coalson. Chris@1: Chris@1: FLAC is comprised of Chris@1: * `libFLAC', a library which implements reference encoders and Chris@1: decoders for native FLAC and Ogg FLAC, and a metadata interface Chris@1: * `libFLAC++', a C++ object wrapper library around libFLAC Chris@1: * `flac', a command-line program for encoding and decoding files Chris@1: * `metaflac', a command-line program for viewing and editing FLAC Chris@1: metadata Chris@1: * player plugins for XMMS and Winamp Chris@1: * user and API documentation Chris@1: Chris@1: The libraries (libFLAC, libFLAC++) are Chris@1: licensed under Xiph.org's BSD-like license (see COPYING.Xiph). All other Chris@1: programs and plugins are licensed under the GNU General Public License Chris@1: (see COPYING.GPL). The documentation is licensed under the GNU Free Chris@1: Documentation License (see COPYING.FDL). Chris@1: Chris@1: Chris@1: =============================================================================== Chris@1: FLAC - 1.2.1 - Contents Chris@1: =============================================================================== Chris@1: Chris@1: - Introduction Chris@1: - Prerequisites Chris@1: - Note to embedded developers Chris@1: - Building in a GNU environment Chris@1: - Building with Makefile.lite Chris@1: - Building with MSVC Chris@1: - Building on Mac OS X Chris@1: Chris@1: Chris@1: =============================================================================== Chris@1: Introduction Chris@1: =============================================================================== Chris@1: Chris@1: This is the source release for the FLAC project. See Chris@1: Chris@1: doc/html/index.html Chris@1: Chris@1: for full documentation. Chris@1: Chris@1: A brief description of the directory tree: Chris@1: Chris@1: doc/ the HTML documentation Chris@1: include/ public include files for libFLAC and libFLAC++ Chris@1: man/ the man page for `flac' Chris@1: src/ the source code and private headers Chris@1: test/ the test scripts Chris@1: Chris@1: Chris@1: =============================================================================== Chris@1: Prerequisites Chris@1: =============================================================================== Chris@1: Chris@1: To build FLAC with support for Ogg FLAC you must have built and installed Chris@1: libogg according to the specific instructions below. You must have Chris@1: libogg 1.1.2 or greater, or there will be seeking problems with Ogg FLAC. Chris@1: Chris@1: If you are building on x86 and want the assembly optimizations, you will Chris@1: need to have NASM >= 0.98.30 installed according to the specific instructions Chris@1: below. Chris@1: Chris@1: Chris@1: =============================================================================== Chris@1: Note to embedded developers Chris@1: =============================================================================== Chris@1: Chris@1: libFLAC has grown larger over time as more functionality has been Chris@1: included, but much of it may be unnecessary for a particular embedded Chris@1: implementation. Unused parts may be pruned by some simple editing of Chris@1: configure.in and src/libFLAC/Makefile.am; the following dependency Chris@1: graph shows which modules may be pruned without breaking things Chris@1: further down: Chris@1: Chris@1: metadata.h Chris@1: stream_decoder.h Chris@1: format.h Chris@1: Chris@1: stream_encoder.h Chris@1: stream_decoder.h Chris@1: format.h Chris@1: Chris@1: stream_decoder.h Chris@1: format.h Chris@1: Chris@1: In other words, for pure decoding applications, both the stream encoder Chris@1: and metadata editing interfaces can be safely removed. Chris@1: Chris@1: There is a section dedicated to embedded use in the libFLAC API Chris@1: HTML documentation (see doc/html/api/index.html). Chris@1: Chris@1: Also, there are several places in the libFLAC code with comments marked Chris@1: with "OPT:" where a #define can be changed to enable code that might be Chris@1: faster on a specific platform. Experimenting with these can yield faster Chris@1: binaries. Chris@1: Chris@1: Chris@1: =============================================================================== Chris@1: Building in a GNU environment Chris@1: =============================================================================== Chris@1: Chris@1: FLAC uses autoconf and libtool for configuring and building. Chris@1: Better documentation for these will be forthcoming, but in Chris@1: general, this should work: Chris@1: Chris@1: ./configure && make && make check && make install Chris@1: Chris@1: The 'make check' step is optional; omit it to skip all the tests, Chris@1: which can take several hours and use around 70-80 megs of disk space. Chris@1: Even though it will stop with an explicit message on any failure, it Chris@1: does print out a lot of stuff so you might want to capture the output Chris@1: to a file if you're having a problem. Also, don't run 'make check' Chris@1: as root because it confuses some of the tests. Chris@1: Chris@1: NOTE: Despite our best efforts it's entirely possible to have Chris@1: problems when using older versions of autoconf, automake, or Chris@1: libtool. If you have the latest versions and still can't get it Chris@1: to work, see the next section on Makefile.lite. Chris@1: Chris@1: There are a few FLAC-specific arguments you can give to Chris@1: `configure': Chris@1: Chris@1: --enable-debug : Builds everything with debug symbols and some Chris@1: extra (and more verbose) error checking. Chris@1: Chris@1: --disable-asm-optimizations : Disables the compilation of the Chris@1: assembly routines. Many routines have assembly versions for Chris@1: speed and `configure' is pretty good about knowing what is Chris@1: supported, but you can use this option to build only from the Chris@1: C sources. May be necessary for building on OS X (Intel) Chris@1: Chris@1: --enable-sse : If you are building for an x86 CPU that supports Chris@1: SSE instructions, you can enable some of the faster routines Chris@1: if your operating system also supports SSE instructions. flac Chris@1: can tell if the CPU supports the instructions but currently has Chris@1: no way to test if the OS does, so if it does, you must pass Chris@1: this argument to configure to use the SSE routines. If flac Chris@1: crashes when built with this option you will have to go back and Chris@1: configure without --enable-sse. Note that Chris@1: --disable-asm-optimizations implies --disable-sse. Chris@1: Chris@1: --enable-local-xmms-plugin : Installs the FLAC XMMS plugin in Chris@1: $HOME/.xmms/Plugins, instead of the global XMMS plugin area Chris@1: (usually /usr/lib/xmms/Input). Chris@1: Chris@1: --with-ogg= Chris@1: --with-xmms-prefix= Chris@1: --with-libiconv-prefix= Chris@1: Use these if you have these packages but configure can't find them. Chris@1: Chris@1: If you want to build completely from scratch (i.e. starting with just Chris@1: configure.in and Makefile.am) you should be able to just run 'autogen.sh' Chris@1: but make sure and read the comments in that file first. Chris@1: Chris@1: Chris@1: =============================================================================== Chris@1: Building with Makefile.lite Chris@1: =============================================================================== Chris@1: Chris@1: There is a more lightweight build system for do-it-yourself-ers. Chris@1: It is also useful if configure isn't working, which may be the Chris@1: case since lately we've had some problems with different versions Chris@1: of automake and libtool. The Makefile.lite system should work Chris@1: on GNU systems with few or no adjustments. Chris@1: Chris@1: From the top level just 'make -f Makefile.lite'. You can Chris@1: specify zero or one optional target from 'release', 'debug', Chris@1: 'test', or 'clean'. The default is 'release'. There is no Chris@1: 'install' target but everything you need will end up in the Chris@1: obj/ directory. Chris@1: Chris@1: If you are not on an x86 system or you don't have nasm, you Chris@1: may have to change the DEFINES in src/libFLAC/Makefile.lite. If Chris@1: you don't have nasm, remove -DFLAC__HAS_NASM. If your target is Chris@1: not an x86, change -DFLAC__CPU_IA32 to -DFLAC__CPU_UNKNOWN. Chris@1: Chris@1: Chris@1: =============================================================================== Chris@1: Building with MSVC Chris@1: =============================================================================== Chris@1: Chris@1: There are .dsp projects and a master FLAC.dsw workspace to build all Chris@1: the libraries and executables with MSVC6. There are also .vcproj Chris@1: projects and a master FLAC.sln solution to build all the libraries and Chris@1: executables with VC++ 2005. Chris@1: Chris@1: Prerequisite: you must have the Ogg libraries installed as described Chris@1: later. Chris@1: Chris@1: Prerequisite: you must have nasm installed, and nasmw.exe must be in Chris@1: your PATH, or the path to nasmw.exe must be added to the list of Chris@1: directories for executable files in the MSVC global options. Chris@1: Chris@1: MSVC6: Chris@1: To build everything, run Developer Studio, do File|Open Workspace, Chris@1: and open FLAC.dsw. Select "Build | Set active configuration..." Chris@1: from the menu, then in the dialog, select "All - Win32 Release" (or Chris@1: Debug if you prefer). Click "Ok" then hit F7 to build. Chris@1: Chris@1: VC++ 2005: Chris@1: To build everything, run Visual Studio, do File|Open and open FLAC.sln. Chris@1: From the dropdown in the toolbar, select "Release" instead of "Debug", Chris@1: then hit F7 to build. Chris@1: Chris@1: Either way, this will build all libraries both statically (e.g. Chris@1: obj\release\lib\libFLAC_static.lib) and as DLLs (e.g. Chris@1: obj\release\lib\libFLAC.dll), and it will build all binaries, statically Chris@1: linked (e.g. obj\release\bin\flac.exe). Chris@1: Chris@1: Everything will end up in the "obj" directory. DLLs and .exe files Chris@1: are all that are needed and can be copied to an installation area and Chris@1: added to the PATH. The plugins have to be copied to their appropriate Chris@1: place in the player area. For Winamp2 this is \Plugins. Chris@1: Chris@1: By default the code is configured with Ogg support. Before building FLAC Chris@1: you will need to get the Ogg source distribution Chris@1: (see http://xiph.org/ogg/vorbis/download/), build ogg_static.lib (load and Chris@1: build win32\ogg_static.dsp), copy ogg_static.lib into FLAC's Chris@1: 'obj\release\lib' directory, and copy the entire include\ogg tree into Chris@1: FLAC's 'include' directory (so that there is an 'ogg' directory in FLAC's Chris@1: 'include' directory with the files ogg.h, os_types.h and config_types.h). Chris@1: Chris@1: If you want to build without Ogg support, instead edit all .dsp or Chris@1: .vcproj files and remove any occurrences of "/D FLAC__HAS_OGG". Chris@1: Chris@1: Chris@1: =============================================================================== Chris@1: Building on Mac OS X Chris@1: =============================================================================== Chris@1: Chris@1: If you have Fink or a recent version of OS X with the proper autotooles, Chris@1: the GNU flow above should work. The Project Builder project has been Chris@1: deprecated but we are working on replacing it with an Xcode equivalent.