1 # AST_EXT_LIB_SETUP([package symbol name], [package friendly name], [package option name], [additional help text])
3 AC_DEFUN([AST_EXT_LIB_SETUP],
7 AC_ARG_WITH([$3], AC_HELP_STRING([--with-$3=PATH],[use $2 files in PATH $4]),[
23 AC_SUBST([$1_INCLUDE])
27 # AST_EXT_LIB_CHECK([package symbol name], [package library name], [function to check], [package header], [additional LIB data])
29 AC_DEFUN([AST_EXT_LIB_CHECK],
31 if test "${USE_$1}" != "no"; then
33 if test "x${$1_DIR}" != "x"; then
34 if test -d ${$1_DIR}/lib; then
35 pbxlibdir="-L${$1_DIR}/lib"
37 pbxlibdir="-L${$1_DIR}"
40 AC_CHECK_LIB([$2], [$3], [AST_$1_FOUND=yes], [AST_$1_FOUND=no], ${pbxlibdir} $5)
42 if test "${AST_$1_FOUND}" = "yes"; then
45 if test "x${$1_DIR}" != "x"; then
46 $1_LIB="${pbxlibdir} ${$1_LIB}"
47 $1_INCLUDE="-I${$1_DIR}/include"
48 if test "x$4" != "x" ; then
49 AC_CHECK_HEADER([${$1_DIR}/include/$4], [$1_HEADER_FOUND=1], [$1_HEADER_FOUND=0] )
52 if test "x$4" != "x" ; then
53 AC_CHECK_HEADER([$4], [$1_HEADER_FOUND=1], [$1_HEADER_FOUND=0] )
56 if test "x${$1_HEADER_FOUND}" = "x0" ; then
57 if test ! -z "${$1_MANDATORY}" ;
60 AC_MSG_NOTICE( *** It appears that you do not have the $2 development package installed.)
61 AC_MSG_NOTICE( *** Please install it to include ${$1_DESCRIP} support, or re-run configure)
62 AC_MSG_NOTICE( *** without explicitly specifying --with-${$1_OPTION})
70 AC_DEFINE_UNQUOTED([HAVE_$1], 1, [Define to indicate the ${$1_DESCRIP} library])
72 elif test ! -z "${$1_MANDATORY}";
75 AC_MSG_NOTICE(*** The ${$1_DESCRIP} installation on this system appears to be broken.)
76 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
77 AC_MSG_NOTICE(*** without explicitly specifying --with-${$1_OPTION})
85 [AST_CHECK_GNU_MAKE], [AC_CACHE_CHECK(for GNU make, GNU_MAKE,
86 GNU_MAKE='Not Found' ;
87 GNU_MAKE_VERSION_MAJOR=0 ;
88 GNU_MAKE_VERSION_MINOR=0 ;
89 for a in make gmake gnumake ; do
90 if test -z "$a" ; then continue ; fi ;
91 if ( sh -c "$a --version" 2> /dev/null | grep GNU 2>&1 > /dev/null ) ; then
93 GNU_MAKE_VERSION_MAJOR=`$GNU_MAKE --version | grep "GNU Make" | cut -f3 -d' ' | cut -f1 -d'.'`
94 GNU_MAKE_VERSION_MINOR=`$GNU_MAKE --version | grep "GNU Make" | cut -f2 -d'.' | cut -c1-2`
99 if test "x$GNU_MAKE" = "xNot Found" ; then
100 AC_MSG_ERROR( *** Please install GNU make. It is required to build Asterisk!)