/******************************************************************************

                              Copyright (c) 2014
                            Lantiq Deutschland GmbH

  For licensing information, see the file 'LICENSE' in the root folder of
  this software module.

******************************************************************************/

HOW TO COMPILE
--------------

TAPI drivers are build using the commonly used configure, make, make install
process. The first step is to create a Makefile for your specific system
using the provided configure script and adapt the parameters according
to your paths and required features. Most important in this step is to
define the TAPI API version that is used. Use --enable-tapi3 for CPE products
and --enable-tapi4 for AN products.

If the Autoconf/Automake tools are not used to configure the driver the file
"include/drv_tapi_if_version.h" has to be generated manually. To facilitate
this two template files are placed in the include subdirectory. Copy one of
these files to "drv_tapi_if_version.h". Use "drv_tapi_if_version.v3" for CPE
products and "drv_tapi_if_version.v4" for AN products.

For Linux 2.6 or later (also Linux 3.x) several differences apply as
the complete build process in these versions is controlled by the kbuild
system. The kbuild system knows already the architecture specific CFLAGS.
The following configure options must be provided for Linux 2.6:
--enable-linux-26, --enable-kernelincl=<path>, --enable-kernelbuild=<path>
If the kernel has been built inside the source directory (which is not nice),
the kernelbuild path is optional.


--1-- Configure TAPI
First create a separate build directory, e.g. below the sources. For Linux 2.6
this step is mandantory(!).

mkdir build_dir
cd build_dir

Example for MPC and Linux 2.4:
../configure --build=i686-pc-linux --host=powerpc-linux-uclibc --enable-tapi3 --enable-warnings --enable-kernelincl=/home/${USER}/linux/include --prefix=/home/${USER}/easy3332_24/opt/ifx --with-cflags="-fno-strict-aliasing -fno-common -fomit-frame-pointer"

Example for MPC and Linux 2.6:
../configure --build=x86_64-pc-linux-gnu --host=powerpc-linux --enable-tapi3 --enable-warnings --enable-trace --enable-lt --enable-kernelincl=<yourPath>/buildroot/build_powerpc_nofpu/linux-2.6.13/include --prefix=/home/${USER}/easy3332_26/opt/ifx --enable-linux-26 --enable-kernelbuild=<yourPath>/buildroot/build_powerpc_nofpu/build.26/linux.tqm860.2.6.13

Example for MIPS, e.g. Danube, TwinPass, INCA-IP2 and Linux 2.4
../configure --build=i686-pc-linux --host=mips-linux --enable-tapi3 --enable-warnings --enable-kernelincl=<yourPath>/linux/include --with-cflags="-fno-pic -mno-abicalls -mlong-calls -mips32 -G 0 -DMODVERSIONS"

Example for MIPS, e.g. Danube, TwinPass, INCA-IP2 and Linux 2.6
../configure --build=i686-pc-linux --host=mips-linux --enable-tapi3 --enable-warnings --enable-trace --enable-log --enable-lt --enable-linux-26 --enable-kernelincl=<yourPath>/linux_danube26/include --enable-kernelbuild=<yourPath>/linux_danube26 --prefix=/home/${USER}/danube_26/opt/ifx

Note: One important parameter to adapt to a specific controller platform is
      --with-clags="" - this parameter gives you the option to add platform
     specific compiler flags easily. For Linux 2.6 it's not required to pass
     specific compiler options as the kernel build process will take care
     of this.

--1.1--

Additional compiler flags:

To add UDP redirection or QoS add flag "--enable-udp-redirect". But its only
used on LINUX OS. To test it with local loop, there is folder
"drv_udp_redirect_test" with module which simulates local loop.

--2-- Build TAPI

make clean install

--3-- Strip your binary

Stripping of the device driver binary is implicitly done on make install. If you
want to strip the binary manually, please make sure not to use different options
than "--strip-debug" - otherwise the binary might be unusable.


TAPI DEVELOPMENT
----------------

To add, remove or change TAPI ioctl interface please manage drv_tapi_io.xml
and use 'make ioctl' command to update the sources. For detailed information
please refer to the TAPI User's Manual, Programmer's Guide.

enjoy
TAPI team
