diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-04-24 17:11:45 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-04-24 17:11:45 +0000 |
commit | 29f496ef12247a2401d02428fa533020b588f5b6 (patch) | |
tree | 170532911902642fdae405ec644509398b0b6ee5 /acinclude.m4 | |
parent | 3cbcc049473cb374710364337d0d415c56133b0e (diff) |
Thanks to the fine work of Russell Bryant and Dancho Lazarov, we now have autoconf and menuselect tools for Asterisk!
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@22267 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'acinclude.m4')
-rw-r--r-- | acinclude.m4 | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4 new file mode 100644 index 000000000..57037b3ff --- /dev/null +++ b/acinclude.m4 @@ -0,0 +1,79 @@ +# 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) + USE_$1=no + ;; + y|ye|yes) + $1_MANDATORY="yes" + ;; + *) + $1_DIR="${withval}" + $1_MANDATORY="yes" + ;; +esac +]) + +PBX_LIB$1=0 + +if test "${USE_$1}" != "no"; then + AC_CHECK_LIB([$1], [$2], AC_DEFINE_UNQUOTED([HAVE_$4], 1, + [Define to indicate the $5 library]), [], -L${$1_DIR}/lib $6) + + if test "${ac_cv_lib_$1_$2}" = "yes"; then + $1_LIB="-l$1 $6" + $4_HEADER_FOUND="1" + if test "x${$1_DIR}" != "x"; then + $1_LIB="-L${$1_DIR}/lib ${$1_LIB}" + $1_INCLUDE="-I${$1_DIR}/include" + if test "x$3" != "x" ; then + AC_CHECK_HEADER([${$1_DIR}/include/$3], [$4_HEADER_FOUND=1], [$4_HEADER_FOUND=0] ) + 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 + echo " ***" + echo " *** It appears that you do not have the $5 development package installed." + echo " *** Please install it to include $5 support, or re-run configure" + echo " *** with the argument --without-$1" + exit 1 + fi + PBX_LIB$1=1 + elif test ! -z "${$1_MANDATORY}"; + then + echo "***" + echo "*** The $5 installation on this system appears to be broken." + echo "*** Either correct the installation, or run configure" + echo "*** including --without-$1" + exit 1 + fi +fi +AC_SUBST([$1_LIB]) +AC_SUBST([$1_INCLUDE]) +AC_SUBST([PBX_LIB$1]) +]) + + +AC_DEFUN( +[AST_CHECK_GNU_MAKE], [ AC_CACHE_CHECK( for GNU make, GNU_MAKE, + 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]) +] ) |