= Contents =

- Building OpenAL with autotools
- Building OpenAL with CMake


= Building OpenAL with autotools =

If this is your first time retrieving CVS, you will need to build the
configure script and config.h.in dependency.  Just run

	sh ./autogen.sh

and you should be okay.

Compilation / installation goes something like this:

	./configure --prefix=/usr/local
	make
	cd test
	[run tests]
	make install

If you are on x86(_64) if may be wise to send your CFLAGS along to
configure, as dependening on them, SIMD code will be activated, ie:

	CFLAGS="-march=athlon-xp" ./configure --prefix=/usr/local

configure will detect that "-march=athlon-xp" activates MMX, SSE,
3dNOW!, SSE-MMX and 3dNOW! extended. You can also explicitly enable a
specific SIMD instruction set via CFLAGS, ie -mmmx activates MMX on the
GCC compiler. Refer to its manual. Currently OpenAL only features some
MMX code though, so other SIMD instruction set are ignored.
On x86 (32 bit) it is advised to have nasm installed. Then it is safe
to activate all SIMD instruction sets at compile time, as at runtime the
detection will only activate supported SIMD routines.
(Above example shouldn't be used as such though, as it doesn't do any
optimization, so send more flags and/or use the optimization configure
option.)


configure options:
	--enable-debug        Enable debugging info.
	--enable-optimization Enables optimization.

etc...  Use --help to determine the rest.  Most people will be fine with
--enable-optimization.

Debugging options are now in the form:

	--enable-debug-blah

in general, this will give you too much information to be useful on a
particular topic.  Use --enable-debug-maximus to get all debugging
messages possible.

If this is your first time installing openal, you'll probably need to
run ldconfig.

ATTENTION:

The following changes have taken place that may alter the manner in
which an installation works on your machine.  Please be advised:

	- SDL is no longer required to build --- the conversion code
	  has been copied into the audioconvert directory.

If you experience any problems building or with the test code, please
email me: jvalenzu@linuxgames.com.  Thanks.

jv.


= Building OpenAL with CMake =

The CMake build files are maintained by prakash@punnoor.de, so
if you have troubles building OpenAL using CMake, please contact
me and not the OpenAL devs, as the official build system is still
the one using autoconf/make. The CMake build files are currenty
meant as an additional possibility to build OpenAL.

The aim of using CMake is making portable development easier, as
CMake containg generators for various build systems. On eg. Unix
Makefiles will be built, and on Windows MS VC++ project files, if
you wish. You can get CMake at cmake.org.

Current status:
The build system is feature complete, so it (should) build every-
thing as the (old) default one has done.

(+,o,- indicates feature more/same/less then default OpenAL
build system.)

o builds shared OpenAL lib
o builds static OpenAL lib; can be deactivated
o builds the test-suite, if specified
o all backends and vorbis/mp3/SDL support should be handled by CMake

+ out of tree builds are supported
+ correct dependency tracking of source files
+ prepared for adding support for non GNU compiler
  (setting link libraries probably needs cleaning up)

- only native, alsa backends and vorbis support compile tested yet
  (so please report back if it works for you! :-)


This document explains briefly how to build with CMake on Linux via out-
of-tree build:

- Change to the linux dir.
- Create a dir, eg "default", and change into it.
- Now (eg.) run:

cmake .. -DCMAKE_INSTALL_PREFIX:STRING="/usr" -DCMAKE_C_FLAGS:STRING="-march=athlon-xp -O2"
make
make install

  If you exported your CFLAGS, there is no need to specify them
  explicitly, as CMake will pick them up.

- OpenAL should get installed as you got used to it.


I really would like to get CMake building OpenAL on every
supported platform. So please contact me if it doesn't build
on yours. I'll try to fix this with your help.


Some Tips:

- You can use a console GUI named ccmake for configuring cmake.
  This also comes in handy, to find out about available options.
  You can also set options via command-line:

ccmake .. -DCMAKE_INSTALL_PREFIX:STRING="/usr" -DCMAKE_C_FLAGS:STRING="-march=athlon-xp -O2"

  sets the two variables defined on command line and then starts
  the GUI. Press 'c' the first time and every time you want to commit
  changes in the config. Finally press 'g' to run the generator.
  Btw, to set boolean vars from the command line, use -DVAR:BOOL=X,
  where X is eg. ON or OFF.

- If you want more output at compile time, use

make VERBOSE=1

- If you want to install to a different directory (using same prefix),
  use

make install DESTDIR=/foo/bar

- CMake doesn't has a distclean target by default, so you better
  really do an out-of-tree build, then you can simply delete its
  content when you want a distclean... Furthermore it is easier to
  have different builds using different parameters via out-of-tree
  builds.

- If you are interested in variables to set, take a look into
  CMakeCache.txt after having run the configuring stage.

- If you update your source tree via cvs and want to rebuild an pre-
  viously built lib without cleaning, you better at least clear the 
  CMake cache (remove CMakeCache.txt) otherwise a modified CMake project
  file could result to unwanted behaviour.


Cheers,

Prakash
