add an argument for extra headers to AC_EXT_LIB_CHECK,
and on passing simplify the code. Too bad that every time we need to regenerate configure... git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89452 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
parent
463723296d
commit
52619b6ec5
29
acinclude.m4
29
acinclude.m4
|
@ -117,11 +117,13 @@ AC_DEFUN([AST_C_DEFINE_CHECK],
|
|||
# in a library, or, if no function is supplied, only check for the
|
||||
# existence of the header files.
|
||||
|
||||
# AST_EXT_LIB_CHECK([package], [library], [function], [header], [additional LIB data], [version])
|
||||
# AST_EXT_LIB_CHECK([package], [library], [function], [header],
|
||||
# [extra libs], [extra cflags], [version])
|
||||
AC_DEFUN([AST_EXT_LIB_CHECK],
|
||||
[
|
||||
if test "x${PBX_$1}" != "x1" -a "${USE_$1}" != "no"; then
|
||||
pbxlibdir=""
|
||||
# if --with-$1=DIR has been specified, use it.
|
||||
if test "x${$1_DIR}" != "x"; then
|
||||
if test -d ${$1_DIR}/lib; then
|
||||
pbxlibdir="-L${$1_DIR}/lib"
|
||||
|
@ -136,22 +138,21 @@ if test "x${PBX_$1}" != "x1" -a "${USE_$1}" != "no"; then
|
|||
AC_CHECK_LIB([$2], [${pbxfuncname}], [AST_$1_FOUND=yes], [AST_$1_FOUND=no], ${pbxlibdir} $5)
|
||||
fi
|
||||
|
||||
# now check for the header.
|
||||
if test "${AST_$1_FOUND}" = "yes"; then
|
||||
$1_LIB="-l$2 $5"
|
||||
$1_HEADER_FOUND="1"
|
||||
$1_LIB="${pbxlibdir} -l$2 $5"
|
||||
# if --with-$1=DIR has been specified, use it.
|
||||
if test "x${$1_DIR}" != "x"; then
|
||||
$1_LIB="${pbxlibdir} ${$1_LIB}"
|
||||
$1_INCLUDE="-I${$1_DIR}/include"
|
||||
saved_cppflags="${CPPFLAGS}"
|
||||
CPPFLAGS="${CPPFLAGS} -I${$1_DIR}/include"
|
||||
if test "x$4" != "x" ; then
|
||||
AC_CHECK_HEADER([${$1_DIR}/include/$4], [$1_HEADER_FOUND=1], [$1_HEADER_FOUND=0])
|
||||
fi
|
||||
CPPFLAGS="${saved_cppflags}"
|
||||
else
|
||||
if test "x$4" != "x" ; then
|
||||
AC_CHECK_HEADER([$4], [$1_HEADER_FOUND=1], [$1_HEADER_FOUND=0])
|
||||
fi
|
||||
fi
|
||||
$1_INCLUDE="${$1_INCLUDE} $6"
|
||||
if test "x$4" = "x" ; then # no header, assume found
|
||||
$1_HEADER_FOUND="1"
|
||||
else # check for the header
|
||||
saved_cppflags="${CPPFLAGS}"
|
||||
CPPFLAGS="${CPPFLAGS} ${$1_INCLUDE} $6"
|
||||
AC_CHECK_HEADER([$4], [$1_HEADER_FOUND=1], [$1_HEADER_FOUND=0])
|
||||
CPPFLAGS="${saved_cppflags}"
|
||||
fi
|
||||
if test "x${$1_HEADER_FOUND}" = "x0" ; then
|
||||
$1_LIB=""
|
||||
|
|
10
configure.ac
10
configure.ac
|
@ -1141,12 +1141,12 @@ AST_C_DEFINE_CHECK([ZAPTEL_TRANSCODE], [ZT_TCOP_ALLOCATE], [zaptel/zaptel.h])
|
|||
# On FreeBSD, try old zaptel (0.80 or so) and pretend we have vldtmf
|
||||
case "${host_os}" in
|
||||
freebsd*)
|
||||
AST_EXT_LIB_CHECK([ZAPTEL], [zaptel],, [zaptel.h],, [80])
|
||||
AST_EXT_LIB_CHECK([ZAPTEL_VLDTMF], [zaptel],, [zaptel/zaptel.h],, [90])
|
||||
AST_EXT_LIB_CHECK([ZAPTEL_VLDTMF], [zaptel],, [zaptel.h],, [80])
|
||||
AST_EXT_LIB_CHECK([ZAPTEL], [zaptel],, [zaptel.h],,, [80])
|
||||
AST_EXT_LIB_CHECK([ZAPTEL_VLDTMF], [zaptel],, [zaptel/zaptel.h],,, [90])
|
||||
AST_EXT_LIB_CHECK([ZAPTEL_VLDTMF], [zaptel],, [zaptel.h],,, [80])
|
||||
|
||||
# other case, old tonezone (0.80)
|
||||
AST_EXT_LIB_CHECK([TONEZONE], [tonezone], [tone_zone_find], [zaptel.h], [${tonezone_extra}], [80])
|
||||
AST_EXT_LIB_CHECK([TONEZONE], [tonezone], [tone_zone_find], [zaptel.h], [${tonezone_extra}],, [80])
|
||||
;;
|
||||
esac
|
||||
|
||||
|
@ -1179,7 +1179,7 @@ AC_CHECK_HEADER([linux/ixjuser.h], [PBX_IXJUSER=1], [PBX_IXJUSER=0], [
|
|||
AC_SUBST(PBX_IXJUSER)
|
||||
|
||||
AST_EXT_TOOL_CHECK([SDL], [sdl])
|
||||
AST_EXT_LIB_CHECK([SDL_IMAGE], [SDL_image], [IMG_Load], [SDL/SDL_image.h], [${SDL_LIB}])
|
||||
AST_EXT_LIB_CHECK([SDL_IMAGE], [SDL_image], [IMG_Load], [SDL_image.h], [${SDL_LIB}], [${SDL_INCLUDE}])
|
||||
AST_EXT_LIB_CHECK([FFMPEG], [avcodec], [sws_getContext], [ffmpeg/avcodec.h], [-lpthread -lz -lm])
|
||||
|
||||
PBX_GTK=0
|
||||
|
|
Loading…
Reference in New Issue