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

From Yate Documentation
Revision as of 18:10, 3 December 2012 by Dana (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Write an external module in C++ following the coding styles (this is recommended not required)

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.

Typical layout:

  • AC_INIT(package, version) - perform initialisation 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([...])
  • AC_OUTPUT

For Yate's detection the following parameters are required:

YATE_VER="" YATE_INC="" YATE_LIB="" YATE_STR="" YATE_MOD="" YATE_SCR="" YATE_SKN="" YATE_CFG="" yc="yate-config"

AC_ARG_WITH(yate,AC_HELP_STRING([--with-yate=DIR],[use Yate from DIR]),[ac_cv_use_yate=$withval],[ac_cv_use_yate=yes])

AC_MSG_CHECKING([for Yate using $yc]) YATE_VER=`"$yc" --version 2>/dev/null` YATE_INC=`"$yc" --c-all 2>/dev/null` YATE_LIB="$YATE_LIB"`"$yc" --ld-nostrip 2>/dev/null` YATE_STR=`"$yc" --ld-strip 2>/dev/null` YATE_MOD=`"$yc" --modules 2>/dev/null` YATE_SCR=`"$yc" --scripts 2>/dev/null` YATE_SKN=`"$yc" --skins 2>/dev/null` YATE_CFG=`"$yc" --config 2>/dev/null` if "x$YATE_VER" = "x" ; then

   YATE_VER="no"

fi AC_MSG_RESULT([$YATE_VER]) if "x$YATE_VER" = "xno" ; then

   AC_ERROR([Could not find Yate])

fi fi


Write Makefile.in

This file holds the make rules for a Yate module

Personal tools
Namespaces

Variants
Actions
Preface
Configuration
Administrators
Developers