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

From Yate Documentation
(Difference between revisions)
Jump to: navigation, search
(Write configure.in)
Line 37: Line 37:
 
For Yate's detection the following parameters are required:
 
For Yate's detection the following parameters are required:
  
YATE_VER=""
+
* YATE_VER - Yate version
YATE_INC=""
+
* YATE_INC - Yate includes path
YATE_LIB=""
+
* YATE_LIB - Yate libraries path
YATE_STR=""
+
* YATE_STR
YATE_MOD=""
+
* YATE_MOD - Yate modules path
YATE_SCR=""
+
* YATE_SCR
YATE_SKN=""
+
* YATE_SKN - Yate skin path
YATE_CFG=""
+
* YATE_CFG - Yate configuration files path
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
+
  
 +
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.
  
 
===Write Makefile.in===
 
===Write Makefile.in===
  
 
This file holds the make rules for a Yate module
 
This file holds the make rules for a Yate module

Revision as of 18:28, 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 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 version
  • YATE_INC - Yate includes path
  • YATE_LIB - Yate libraries path
  • YATE_STR
  • YATE_MOD - Yate modules path
  • YATE_SCR
  • 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.

Write Makefile.in

This file holds the make rules for a Yate module

Personal tools
Namespaces

Variants
Actions
Preface
Configuration
Administrators
Developers