Blame README

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