README 10 KB

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