mpg123 install hints
--------------------

(This file has very long lines - die-hard terminal nostalgists can be satisfied by `fmt -s -w 75 < INSTALL | less`. I think it's better to let the reader's preference rule than to preformat the stuff to some arbitrary width.)

There are now two basic ways to get your mpg123 installation consisting of

	a) the mpg123 binary file
	    - with libmpg123 as shared library or statically linked (shared lib only with autotools)
	    - with audio output plugins, or one statically linked (plugins only with autotools)
	b) a man page

(you may want to copy some of the documentation - README, etc - to /usr/share/doc/mpg123 or the like, too)


0. Prerequesites

You really need:

- a C compiler; we try to keep the code ANSI C89/ISO C90 compatible
  gcc from 2.95 on should work, others, too - please report any issues
  Actually, we have a confirmed working build (svn trunk leading to release 0.67) on SunOS 4.1.4 with gcc-2.7.0 .

- an (UNIX-like) operating system with standard tools; MinGW32 and Cygwin are working for Microsoft Windows, too.

You want:

- working assembler (recent GNU binutils) if using certain CPU optimizations

- headers and lib for certain audio output drivers (libasound for alsa, sdl for sdl...)


1. New installation via GNU autotools

The GNU 3-step procedure:

	./configure
	make
	make install

Run

	./configure --help

for a list of possible parameters you can specify. The obvious are --prefix and the normal GNU autotool bunch, but others include what audio subsystem to use and what CPU optimizations to build in.
For the optimizations (decoder choice), the default on 32bit x86 systems since version 0.66 is a build that combines all possible optimizations and chooses one at runtime (see --cpu, --list-cpu and --test-cpu parameters).
Update: x86 build includes all but i586_dither, which is a bit bigger due to the dither noise; use x86_dither to get it into the bunch, too.

Another posibly important choice is --with-seektable=<number> for setting the size for the table of stored frame addresses to make seeking faster. When you want a minimal memory footprint, you can set number to 0. Seeking will always start from the beginning, then - being accurate, but rather slow, what doesn't matter if you don't use interactive seeking forth and back.


2. The classic way via the provided Makefile

WARNING: The autotool build is the default and most tested one.
We try to keep the legacy Makefile workable, but be prepared to add some missing bits like defines in config.h.legacy .
We are thankful for your input on occuring problems... we perhaps just didn't notice.
Also, the legacy build results always in one mpg123 binary with one audio output linked in (no libmpg123, no plugins).

This is basically the known mpg123 Makefile with some mods and additions.
For coexistence with the autotools setup, a wrapper script for generating a fake config.h is needed. Run

	./MakeLegacy.sh

to create a default src/config.h and print a list of Make targets. Examine src/config.h and change any incorrect settings.
Compiler flags (CFLAGS) are defined in Makefile, your shell variables for CFLAGS and CPPFLAGS are also used.
Next, run

	./MakeLegacy.sh TARGET

or, if you prefer,

	cd src
	make -f Makefile.legacy TARGET
	cd ..

to build.  Finally,

	./MakeLegacy.sh install

will install the binary and man page to the dirs specified by these make variables (with default values):

PREFIX=/usr/local
BINDIR=$(PREFIX)/bin
MANDIR=$(PREFIX)/man

So, if you want it in /usr; just run

	./MakeLegacy.sh PREFIX=/usr install


Please note that the Makefile itself does not contain any x86 cpu specific CFLAGS (except for i486) or explicit `strip` calls anymore; mpg123 will be built and installed with debugging symbols - so if you want to conserve some space, please specify the -s in CFLAGS or strip the binary yourself.


3. Do something different on a special platform/compiler/...

Look into the ports/ directory for some traces of "porting" mpg123 or usually libmpg123 alone to different systems and compilers.


4. Have fun!


These are some remarks from Michael that could still bear some relevance:

 - There is currently no direct audio hardware support for the
   "dec" and "generic" targets.  That means that you have to use
   the "-s" commandline option to write the decoded audio data
   to stdout.

 - On Solaris, use Sun's SparcWorks compiler ("make solaris")
   if at all possible.  It generates faster code than gcc, so
   use gcc only if there's no other way.

 - The macro "htons" causes a compiler warning in httpget.c
   (at least on FreeBSD 2.1.x).  This can be safely ignored.

 - For Solaris 2.4:  append the options "-L/usr/ucblib -lucb"
   at the end of the link command line.  Do this ONLY for
   Solaris 2.4, NOT for Solaris 2.5 or newer versions.

 - The HP-UX port might be broken.  I was able to compile it
   on an HP-UX 9 account, but there were some problems with
   libraries on HP-UX 10.  I'm not an HP expert, but perhaps
   someone else can fix it.
   [note: some people report NO problems also with HP-UX 10]

 - IRIX: some people reported compile problems on IRIX 5.x (5.3)
         but 6.x seems to compile without problems

