Skip to content
Snippets Groups Projects
Commit 5cf27a30 authored by Luigi Rizzo's avatar Luigi Rizzo
Browse files

document, and extend a bit the macro AST_EXT_LIB_CHECK so that

it can be used in more places in configure.ac



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@44420 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent e7db78a4
No related branches found
No related tags found
No related merge requests found
......@@ -37,11 +37,17 @@ AC_SUBST([$1_INCLUDE])
AC_SUBST([PBX_$1])
])
# Check for existence of a given package ($1), looking up a function
# in a library, or, if no function is supplied, only check for the
# existence of the header files.
# Only check if PBX_$1 != 1, and set PBX_$1=1 and HAVE_$1 if found.
# Should be called after AST_EXT_LIB_SETUP($1, ...)
# AST_EXT_LIB_CHECK([package symbol name], [package library name], [function to check], [package header], [additional LIB data])
AC_DEFUN([AST_EXT_LIB_CHECK],
[
if test "${USE_$1}" != "no"; then
if test "x${PBX_$1}" != "x1" -a "${USE_$1}" != "no"; then
pbxlibdir=""
if test "x${$1_DIR}" != "x"; then
if test -d ${$1_DIR}/lib; then
......@@ -50,7 +56,12 @@ if test "${USE_$1}" != "no"; then
pbxlibdir="-L${$1_DIR}"
fi
fi
AC_CHECK_LIB([$2], [$3], [AST_$1_FOUND=yes], [AST_$1_FOUND=no], ${pbxlibdir} $5)
pbxfuncname="$3"
if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers
AST_$1_FOUND=yes
else
AC_CHECK_LIB([$2], [${pbxfuncname}], [AST_$1_FOUND=yes], [AST_$1_FOUND=no], ${pbxlibdir} $5)
fi
if test "${AST_$1_FOUND}" = "yes"; then
$1_LIB="-l$2 $5"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment