2006-04-24 17:11:45 +00:00
|
|
|
# AST_EXT_LIB([NAME], [FUNCTION], [package header], [package symbol name], [package friendly name], [additional LIB data])
|
|
|
|
|
|
|
|
AC_DEFUN([AST_EXT_LIB],
|
|
|
|
[
|
|
|
|
AC_ARG_WITH([$1], AC_HELP_STRING([--with-$1=PATH],[use $5 files in PATH]),[
|
|
|
|
case ${withval} in
|
|
|
|
n|no)
|
2006-05-20 22:30:05 +00:00
|
|
|
USE_$4=no
|
2006-04-24 17:11:45 +00:00
|
|
|
;;
|
|
|
|
y|ye|yes)
|
2006-05-20 22:30:05 +00:00
|
|
|
$4_MANDATORY="yes"
|
2006-04-24 17:11:45 +00:00
|
|
|
;;
|
|
|
|
*)
|
2006-05-20 22:30:05 +00:00
|
|
|
$4_DIR="${withval}"
|
|
|
|
$4_MANDATORY="yes"
|
2006-04-24 17:11:45 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
])
|
|
|
|
|
2006-05-20 22:30:05 +00:00
|
|
|
PBX_LIB$4=0
|
2006-04-24 17:11:45 +00:00
|
|
|
|
2006-05-20 22:30:05 +00:00
|
|
|
if test "${USE_$4}" != "no"; then
|
2006-05-19 18:54:21 +00:00
|
|
|
pbxlibdir=""
|
2006-05-20 22:30:05 +00:00
|
|
|
if test "x${$4_DIR}" != "x"; then
|
2006-05-19 18:54:21 +00:00
|
|
|
pbxlibdir="-L${$1_DIR}/lib"
|
2006-05-01 10:34:20 +00:00
|
|
|
fi
|
2006-05-20 22:30:05 +00:00
|
|
|
AC_CHECK_LIB([$1], [$2], [AST_$4_FOUND=yes], [AST_$4_FOUND=no], ${pbxlibdir} $6)
|
2006-04-24 17:11:45 +00:00
|
|
|
|
2006-05-20 22:30:05 +00:00
|
|
|
if test "${AST_$4_FOUND}" = "yes"; then
|
|
|
|
$4_LIB="-l$1 $6"
|
2006-04-24 17:11:45 +00:00
|
|
|
$4_HEADER_FOUND="1"
|
2006-05-20 22:30:05 +00:00
|
|
|
if test "x${$4_DIR}" != "x"; then
|
|
|
|
$4_LIB="${pbxlibdir} ${$4_LIB}"
|
|
|
|
$4_INCLUDE="-I${$4_DIR}/include"
|
2006-04-24 17:11:45 +00:00
|
|
|
if test "x$3" != "x" ; then
|
2006-05-20 22:30:05 +00:00
|
|
|
AC_CHECK_HEADER([${$4_DIR}/include/$3], [$4_HEADER_FOUND=1], [$4_HEADER_FOUND=0] )
|
2006-04-24 17:11:45 +00:00
|
|
|
fi
|
|
|
|
else
|
|
|
|
if test "x$3" != "x" ; then
|
|
|
|
AC_CHECK_HEADER([$3], [$4_HEADER_FOUND=1], [$4_HEADER_FOUND=0] )
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if test "x${$4_HEADER_FOUND}" = "x0" ; then
|
2006-05-20 22:30:05 +00:00
|
|
|
if test ! -z "${$4_MANDATORY}" ;
|
2006-04-25 17:22:38 +00:00
|
|
|
then
|
|
|
|
echo " ***"
|
|
|
|
echo " *** It appears that you do not have the $1 development package installed."
|
|
|
|
echo " *** Please install it to include $5 support, or re-run configure"
|
|
|
|
echo " *** without explicitly specifying --with-$1"
|
|
|
|
exit 1
|
|
|
|
fi
|
2006-05-20 22:30:05 +00:00
|
|
|
$4_LIB=""
|
|
|
|
$4_INCLUDE=""
|
|
|
|
PBX_LIB$4=0
|
2006-04-25 17:22:38 +00:00
|
|
|
else
|
2006-05-20 22:30:05 +00:00
|
|
|
PBX_LIB$4=1
|
2006-04-27 00:10:56 +00:00
|
|
|
AC_DEFINE_UNQUOTED([HAVE_$4], 1, [Define to indicate the $5 library])
|
2006-04-24 17:11:45 +00:00
|
|
|
fi
|
2006-05-20 22:30:05 +00:00
|
|
|
elif test ! -z "${$4_MANDATORY}";
|
2006-04-24 17:11:45 +00:00
|
|
|
then
|
|
|
|
echo "***"
|
|
|
|
echo "*** The $5 installation on this system appears to be broken."
|
|
|
|
echo "*** Either correct the installation, or run configure"
|
2006-04-25 17:22:38 +00:00
|
|
|
echo "*** without explicity specifying --with-$1"
|
2006-04-24 17:11:45 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
2006-05-20 22:30:05 +00:00
|
|
|
AC_SUBST([$4_LIB])
|
|
|
|
AC_SUBST([$4_INCLUDE])
|
|
|
|
AC_SUBST([PBX_LIB$4])
|
2006-04-24 17:11:45 +00:00
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
AC_DEFUN(
|
2006-04-29 15:31:45 +00:00
|
|
|
[AST_CHECK_GNU_MAKE], [AC_CACHE_CHECK(for GNU make, GNU_MAKE,
|
2006-04-24 17:11:45 +00:00
|
|
|
GNU_MAKE='Not Found' ;
|
|
|
|
for a in make gmake gnumake ; do
|
|
|
|
if test -z "$a" ; then continue ; fi ;
|
|
|
|
if ( sh -c "$a --version" 2> /dev/null | grep GNU 2>&1 > /dev/null ) ; then
|
|
|
|
GNU_MAKE=$a ;
|
|
|
|
break;
|
|
|
|
fi
|
|
|
|
done ;
|
|
|
|
) ;
|
|
|
|
if test "x$GNU_MAKE" = "xNot Found" ; then
|
|
|
|
echo " *** Please install GNU make. It is required to build Asterisk!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
AC_SUBST([GNU_MAKE])
|
2006-04-29 15:31:45 +00:00
|
|
|
])
|