LAME build options


=======================================================================
Compile time options
=======================================================================
There are several targets which can be built from this
source code:

lame, lame.exe  The command line encoder

mp3x            A GTK 4 based graphical MP3 frame analyzer.  For debugging,
                development, and studying MP3 frames produced by any
                encoder.

mp3rtp          The command line encoder that streams the MP3 with RTP.

lame_enc.dll    a Windows DLL used by many GUIs which support lame.
                Built with MSVC: Makefile.MSVC or vc_solution/vs_lame.slnx.

lameACM.acm     a Windows ACM codec which can be used by many Windows
                programs.  Built from vc_solution/vs_lame_clients.slnx.
                Right click on ACM/LameACM.inf to install.

lame.ax         a Windows DirectShow filter for lame.  Built from
                vc_solution/vs_lame_clients.slnx, which needs the
                DirectShow base classes; see vc_solution/README.vs.txt.

libmp3lame.a    the static encoding library used by all platforms, required
                by all the above targets.

libmp3lame.so   shared version of libmp3lame.a for *NIX platforms
                (libmp3lame.dll on Windows)


The following compile time options can be used.  For libmp3lame.a and 
lame_enc.dll, none are required.  On non-unix systems, these options must 
be set in config.h or in the IDE.  
On unix systems, they are set via ./configure.  


#define HAVE_MPG123   compile in MPEG *decoding* with libmpg123
                      (you need libmpg123 1.26.0 or newer)
#define NOANALYSIS    do not compile in hooks used by the 
                      MP3 frame analyzer.

Options for the command line encoder:
#define LIBSNDFILE    to use Erik de Castro Lopo's libsndfile
                      for input.


=======================================================================
Building the software on *NIX platforms using configure:
=======================================================================
Run the following commands:

% ./configure
% make
% make install

For a complete list of options, try "./configure --help"
Some of the more useful options:

  --disable-decoder           Build without the MPEG decoder (libmpg123)

  --enable-mp3x               Build the mp3 frame analyzer, 'mp3x'
                              (needs GTK 4.10 or newer and the decoder)

  --enable-mp3rtp             Build the encode-to-RTP program, 'mp3rtp'


For the LAME front end encoder:

  --with-fileio=lame          Use lame's internal file io routines [default]
               =sndfile       Use Erik de Castro Lopo's libsndfile (supports
                              many more input formats; standard input is
                              read by lame's internal routines).  configure
                              finds libsndfile 1.0.2 or newer with pkg-config.


Other useful configure options:

  --enable-debug              Build a debug version

  --enable-expopt             Enable some more optimizations flags for
                              the compiler, may or may not produce
                              faster code

  --enable-native             Tune the build for the exact machine it is
                              compiled on.  May be faster, but the binary
                              is not guaranteed to run on other CPUs of
                              the same architecture.

  --disable-hardening         Do not add the compiler/linker security
                              hardening flags enabled by default (stack and
                              control-flow protection, fortified library
                              calls, read-only relocations, ...).

  --disable-dynamic-frontends The front end tools (lame, ...) are linked
                              dynamically against libmp3lame by default, so
                              they can be built as position-independent
                              executables.  Use this to link them statically
                              into self-contained binaries instead.
                              The lame program uses internal data of the
                              decoder in libmp3lame.  A dynamically linked
                              lame needs the libmp3lame of the same build.

  --prefix=PATH               default is /usr/local
                              (LAME installs, among others:
                                /usr/local/bin/lame
                                /usr/local/lib/libmp3lame.a
                                /usr/local/lib/libmp3lame.so
                                /usr/local/include/lame/lame.h
                                /usr/local/lib/pkgconfig/lame.pc
                                /usr/local/share/man/man1/lame.1
                                /usr/local/share/doc/lame/html/)


Some more advanced ways to influence the build procedure
(experienced users only, use it at your own risk):

  - If you want to use some custom defines for building (e.g. some out
    of the file "DEFINES") use:

     * bourne shell or compatible (ash, bash, zsh, ...):
       CONFIG_DEFS="-Dmy_define" ./configure

     * C shell or compatible (csh, tcsh, ...):
       setenv CONFIG_DEFS "-Dmy_define"
       ./configure

  - If you want to use some additional options for the compiler:

    * bourne shell or compatible (ash, bash, zsh, ...):
      CFLAGS="--my_flag" ./configure

    * C shell or compatible (csh, tcsh, ...):
      setenv CFLAGS "--my_flag"
      ./configure

  Or some combination of the above.

  Note:
    On x86 processors LAME builds vectorized (SSE2) versions of a few hot
    routines into every binary and uses them when the processor running it
    supports them, so no assembler and no special configure option are
    needed.  "lame --verbose" reports what the machine it runs on got, and
    "--noasm sse" turns the vectorized code off.


=======================================================================
Building the software on Windows with MSVC:
(or MSVC + 3rd party C compiler such as ICL)
=======================================================================
There are Visual Studio solutions in vc_solution (see
vc_solution/README.vs.txt) and a Makefile.MSVC included with the
project.  For production use, be sure to build a "Release" configuration.

The GTK frame analyzer mp3x is built from the Visual Studio solution in
vc_solution, which needs GTK 4; see vc_solution/README.vs.txt. Makefile.MSVC
does not build it.

Various build options can be set in configMS.h

To build lame.exe from the command line, open a developer command prompt
of Visual Studio and run:

nmake -f Makefile.MSVC

Makefile.MSVC copies configMS.h to config.h itself.  The comment at its
top lists the arguments it takes.


=======================================================================
Building the software on Windows with free compilers:
=======================================================================
With MSYS2 (MinGW-w64), use the configure script as on any other
platform.

Cygwin users should use the unix configure script (explained above). If
you have problems with the configure script try:
      CC=gcc ./configure
Patches to enable the build of the lame_enc.dll with Cygwin and autoconf /
automake / libtool are welcome!

lame_enc.dll, the ACM codec and the DirectShow filter are built with MSVC.
