How to compile an external module in C++ for Yate

From Yate Documentation
(Difference between revisions)
Jump to: navigation, search
(Write configure.in)

Revision as of 19:06, 3 December 2012


Contents

Install Yate

To use an external module you need to have Yate already installed. This can be done in two ways:

  • Yate is installed from SVN source, the needed headers files are obtained in this way
  • Development packages for Yate including headers and shared libraries (typically this is called yate-devel but depends on distribution).

Compile an external module

When compiling an external module, it is recommended to have autogen.sh. This way, the build system will detect if the Yate headers are correctly installed, and their paths. When running autogen.sh an executable file is produced, configure from configure.in. Then configure is run and Makefile is produced using Makefile.in.

So, to start using the Yate's build system with your software package it is recommended to write the files bellow.

Write configure.in

This file is process with autoconf to produce a configure script.
It contains tests that check for conditions that are likely to differ on different platforms. The tests are made by actually invoke autoconf macros.

Typical layout:

  • AC_INIT(package, version) - perform initialization and verification - sets the name of the package (name of the external module) and its version.
  • package information
  • program checks
  • library checks
  • header file checks
  • type checks
  • structure checks
  • compiler characteristics checks
  • library functions check
  • system service checks
  • AC_CONFIG_FILES([... Makefile])
  • AC_OUTPUT

For Yate's detection the following parameters are required:

  • YATE_VER - Yate version
  • YATE_INC - Yate includes path
  • YATE_LIB - Yate libraries path
  • YATE_STR
  • YATE_MOD - Yate modules path
  • YATE_SCR - Yate scripts path
  • YATE_SKN - Yate skin path
  • YATE_CFG - Yate configuration files path

If Yate version couldn't be found an error must be given to the user so that he will Know that something is wrong with installation of Yate.

Your external module uses Yate, that was already installed, so you have to give to the user the possibility to give configure command line options to specify to use Yate (like ./configure --with-yate).

Write Makefile.in

This file holds the make rules for a Yate module

Personal tools
Namespaces

Variants
Actions
Preface
Configuration
Administrators
Developers