[asterisk-commits] tilghman: branch 1.4 r101894 - in /branches/1.4: ./ include/asterisk/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Feb 1 13:36:12 CST 2008
Author: tilghman
Date: Fri Feb 1 13:36:12 2008
New Revision: 101894
URL: http://svn.digium.com/view/asterisk?view=rev&rev=101894
Log:
Change detection of getifaddrs to use AST_C_COMPILE_CHECK, backported from trunk (as suggested by kpfleming)
Modified:
branches/1.4/acinclude.m4
branches/1.4/configure
branches/1.4/configure.ac
branches/1.4/include/asterisk/autoconfig.h.in
Modified: branches/1.4/acinclude.m4
URL: http://svn.digium.com/view/asterisk/branches/1.4/acinclude.m4?view=diff&rev=101894&r1=101893&r2=101894
==============================================================================
--- branches/1.4/acinclude.m4 (original)
+++ branches/1.4/acinclude.m4 Fri Feb 1 13:36:12 2008
@@ -97,6 +97,33 @@
fi
])
+# AST_C_COMPILE_CHECK can be used for testing for various items in header files
+
+# AST_C_COMPILE_CHECK([package], [expression], [header file], [version])
+AC_DEFUN([AST_C_COMPILE_CHECK],
+[
+ if test "x${PBX_$1}" != "x1" -a "${USE_$1}" != "no"; then
+ AC_MSG_CHECKING([if "$2" compiles using $3])
+ saved_cppflags="${CPPFLAGS}"
+ if test "x${$1_DIR}" != "x"; then
+ $1_INCLUDE="-I${$1_DIR}/include"
+ fi
+ CPPFLAGS="${CPPFLAGS} ${$1_INCLUDE}"
+
+ AC_COMPILE_IFELSE(
+ [ AC_LANG_PROGRAM( [#include <$3>],
+ [ $2; ]
+ )],
+ [ AC_MSG_RESULT(yes)
+ PBX_$1=1
+ AC_DEFINE([HAVE_$1], 1, [Define if your system has the $1 headers.])
+ AC_DEFINE([HAVE_$1_VERSION], $4, [Define $1 headers version])
+ ],
+ [ AC_MSG_RESULT(no) ]
+ )
+ CPPFLAGS="${saved_cppflags}"
+ fi
+])
AC_DEFUN(
[AST_CHECK_GNU_MAKE], [AC_CACHE_CHECK(for GNU make, GNU_MAKE,
Modified: branches/1.4/configure.ac
URL: http://svn.digium.com/view/asterisk/branches/1.4/configure.ac?view=diff&rev=101894&r1=101893&r2=101894
==============================================================================
--- branches/1.4/configure.ac (original)
+++ branches/1.4/configure.ac Fri Feb 1 13:36:12 2008
@@ -404,7 +404,7 @@
AST_EXT_LIB_CHECK([CAP], [cap], [cap_from_text], [sys/capability.h])
fi
-AST_EXT_LIB_CHECK([GETIFADDRS], [c], [getifaddrs], [ifaddrs.h])
+AST_C_COMPILE_CHECK([GETIFADDRS], [struct ifaddrs *p; getifaddrs(&p)], [ifaddrs.h])
GSM_INTERNAL="yes"
AC_SUBST(GSM_INTERNAL)
Modified: branches/1.4/include/asterisk/autoconfig.h.in
URL: http://svn.digium.com/view/asterisk/branches/1.4/include/asterisk/autoconfig.h.in?view=diff&rev=101894&r1=101893&r2=101894
==============================================================================
--- branches/1.4/include/asterisk/autoconfig.h.in (original)
+++ branches/1.4/include/asterisk/autoconfig.h.in Fri Feb 1 13:36:12 2008
@@ -123,8 +123,11 @@
/* Define to 1 if you have the `gethostname' function. */
#undef HAVE_GETHOSTNAME
-/* Define to indicate the ${GETIFADDRS_DESCRIP} library */
+/* Define if your system has the GETIFADDRS headers. */
#undef HAVE_GETIFADDRS
+
+/* Define GETIFADDRS headers version */
+#undef HAVE_GETIFADDRS_VERSION
/* Define to 1 if you have the `getloadavg' function. */
#undef HAVE_GETLOADAVG
More information about the asterisk-commits
mailing list