
AHI version 5

This is AHI version 5.  Yeah, really.  It's nowhere near what I wanted for
version 5, but I figured a release was better than no release, no matter
what.  The deadline of AmigaOS 3.9 requires some slight change of plans as
well.

If you have installed earlier beta versions of the AHI preference program,
MUST install the new one, go to the "advanced" page, reset the default
anti-click time and save your preferences; a data structure has changed.

Developers, take care with the new include files!  A couple of things have
changed there as well:

* In the audio mode requester structure, ahiam_UserData has been moved to
  become 32-bit aligned.  AHI still works with old programs, of course, but
  NEW programs will not work with the old device, unless you use the tag
  AHIR_ObsoleteUserData instead of AHIR_UserData.

* In the preference file structure, ahigp_AntiClickTime has been 32-bit
  aligned as well.  Since this was added in a beta version, this
  modification is not backward compatible.

I'd estimate that exactly one program is affected by these changes (the AHI
preferences program), but maybe there are a few more.  Sorry about that.


Things I'd still like to do

  Write assembler echo and master volume (m68k and ppc).
  Add non-mixing modes for so-called "serious" music software and fast
   streaming.
  Finish the packaging.  This includes installer script, updated
   documentation, proper source archive that includes the drivers and a
   proper developer archive with header files et cetera.
  I need to update the BGUI and ClassAct preferences programs to support
   the global anti-click settings.  Or even better, ditch them all for a OS
   3.5 version.  We'll see.
  Fix all the bugs you find.

Take your pick!  Any help is wecome, and the more help I get, the sooner
the "real" release will come.

How to make your very own version of AHI

To configure on an Amiga (for building the AmigaOS version):

sh configure --host=m68k-amigaos


To configure on an Amiga (for building the MorphOS version):

sh configure --host=ppc-morphos


To configure on a PC running Linux (for building the AmigaOS version):

./configure --host=m68k-amigaos --build=i686-pc-linux-gnu


You can build in separate directories, which is very useful when building
several versions from the same source tree (note:  this requires
UnixDirs3!):

mkdir build060
cd build060
sh ../ahisrc/configure --host=m68k-amigaos --with-cpu=68060


There are also a few configure options to set:

  --with-os-includedir    Path to AmigaOS include directory [/gg/os-include]
  --with-cpu              The CPU to optimize for
  --enable-warpup         Enable WarpUp support

--with-os-includedir specifies where the AmigaOS include files are located.
If unspecified, /gg/os-include is assumed.

--with-cpu lets you specify what CPU to generate code and optimize for. Some
legal values include 68020, 68030, 68040 or 68060 for m68k and 603 or 604
for PPC. The default is either 68020 or 603, depending on the host.

--enable-warpup adds code (that doesn't work, by the way) to support WarpUp.


The following make targets are available:

all:
	Makes all binaries, but only one version of the device.

clean:
	Removes all binaries and temporary files.

distclean:
	Like clean, but also removes files created by 'configure'.

maintainer-clean:
	Removes all machine-generated files, including the autoconf files.

bindist:
	Builds the binary distribution.  You can change the directory in
	which the binary distribution will be created, by setting the
	variable DISTDIR. The default is '/tmp/ahi'. This will build all
	possible versions of the device, including the PowerPC version.

revup:
	Increases the revision of the distribution.


When you add code, please remember a few things:

   Avoid TAB characters, if possible.
   The TAB size is 8.
   The indent level is 2.
   Compiler warnings are NOT acceptable.


Required programs/packages

Here is a short list of required tools that I'm aware of:

From GeekGadgets:

autoconf	autoconf-2.13-bin.tgz
gcc/egcs	gcc-2.95.1-bin020.tgz
make		make-3.77-bin.tgz
unixtex		unixtex-6.1b-bin?.tgz
texinfo		texinfo-3.12-bin.tgz

Other tools from Aminet:

FD2Pragma	dev/misc/fd2pragma.lha
FlexCat		dev/misc/FlexCat.lha
PhxAss		dev/asm/PhxAss.lha
RoboDoc		dev/misc/robodoc.lha
UnixDirs3	util/boot/UnixDirs3.lha	(when using separate build directories)


Building a libgcc.a for ppctools-bin

In order to build an ahi.device.elf that works with WarpUp, you'll need to
build libgcc.a.  Here is how I did that on a Linux box.  I suppose it works
under AmigaOS as well.

1) Get binutils-2.7.tar.gz and gcc-2.7.2.1.tar.gz from your local GNU
   mirror.

2) mkdir source; mkdir build; mkdir build/ppc-gcc; mkdir build/ppc-binutils

3) Unpack the sources into the "source" directory.

4) Go to build/ppc-binutils and write (change prefix and host to fit your
   system):

   $ ../../source/binutils-2.7/configure --target=ppc-unknown-elf \
   > --host=i386-unknown-linux --prefix=/home/lcs/gg
   $ make
   $ make install

   If you get errors from bad prototypes, just uncomment them and retry
   (I had problems with strdup and a few more).

5) Go to build/ppc-gcc and write (change prefix and host to fit your
   system):

   $ ../../source/gcc-2.7.2.1/configure --target=ppc-unknown-elf \
   > --host=i386-unknown-linux --prefix=/home/lcs/gg
   $ make LIBGCC2_INCLUDES=-Dinhibit_libc libgcc.a

6) Copy the file libgcc.a to ade:ppc-amigaos/lib/libgcc.a or
   gg:ppc-amigaos/lib/libgcc.a.
