[asterisk-dev] New module with ext. dependency
Sean Kelly
keenskelly at gmail.com
Tue Jul 24 14:01:50 CDT 2012
Greetings,
I'm neck deep in a custom module for Asterisk that has an external
dependency for libfftw3; I have been struggling through getting the
proper adjustments made to configure/autoconf/Makefile to figure out
how to get this working. The module compiles without errors, but at
this time will not execute because the required library is not being
linked in when the module builds.
I am working on Asterisk 1.8.12.2 and with the most recent version of
the FFTW library. I started with this document's section on building
"Modules with dependencies":
https://wiki.asterisk.org/wiki/display/AST/Build+System+Architecture
So far I have added the following:
Added to configure.ac:
-------------------------------------------
AST_EXT_LIB_SETUP([FFTW], [FFTW], [fftw])
.
.
.
AST_EXT_LIB_CHECK([FFTW], [libfftw3], [execute],
[/usr/local/include/fftw3.h], [-lm -lfftw3])
-------------------------------------------
Added to build_tools/menuselect-deps.in:
------------------------------------------
FFTW=@PBX_FFTW@
------------------------------------------
Added to makeopts.in:
------------------------------------------
FFTW_INCLUDE=@FFTW_INCLUDE@
FFTW_LIB=@FFTW_LIB@
------------------------------------------
Added to apps/app_mymodule.c
------------------------------------------
/*** MODULEINFO
<depend>fftw</depend>
***/
------------------------------------------
Some code comments in (an older copy of?) menuselect/acinclude.m4 :
http://pd-l2ork.googlecode.com/svn/trunk/pd-l2ork/pd/src/acinclude.m4
read:
------------------------------------------
# Helper function to setup variables for a package.
# $1 -> the package name. Used in configure.ac and also as a prefix
# for the variables ($1_DIR, $1_INCLUDE, $1_LIB) in makeopts
# $3 -> option name, used in --with-$3 or --without-$3 when calling configure.
# $2 and $4 are just text describing the package (short and long form)
# AST_EXT_LIB_SETUP([package], [short description], [configure option
name], [long description])
------------------------------------------
Which suggests that maybe I can enable this as so:
./configure --with-fftw
However after running through a pile of checks, it ends up with:
------------------------------------------
configure: WARNING: unrecognized options: --with-fftw
------------------------------------------
I'm not sure where to go from here. Does anyone here have first hand
experience getting an external library dependency integrated into the
normal build chain?
Thanks,
- Sean
More information about the asterisk-dev
mailing list