Merged revisions 135597 via svnmerge from
[asterisk/asterisk.git] / acinclude.m4
index e5f24fc..59566d0 100644 (file)
@@ -10,7 +10,7 @@ AC_MSG_CHECKING(for compiler 'attribute $1' support)
 saved_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS -Werror"
 AC_COMPILE_IFELSE(
-       AC_LANG_PROGRAM([static int __attribute__(($1)) test(void) {}],
+       AC_LANG_PROGRAM([static void __attribute__(($1)) *test(void *muffin, ...) {}],
                        []),
        AC_MSG_RESULT(yes)
        AC_DEFINE_UNQUOTED([HAVE_ATTRIBUTE_$1], 1, [Define to 1 if your GCC C compiler supports the '$1' attribute.]),
@@ -128,11 +128,15 @@ AC_DEFUN([AST_C_DEFINE_CHECK],
 
 # Check if a given expression will compile using a certain header.
 
-# AST_C_COMPILE_CHECK([package], [expression], [header file], [version])
+# AST_C_COMPILE_CHECK([package], [expression], [header file], [version], [description])
 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])
+        if test "x$5" != "x"; then
+            AC_MSG_CHECKING([for $5])
+       else
+            AC_MSG_CHECKING([if "$2" compiles using $3])
+       fi
        saved_cppflags="${CPPFLAGS}"
        if test "x${$1_DIR}" != "x"; then
            $1_INCLUDE="-I${$1_DIR}/include"
@@ -192,7 +196,7 @@ if test "x${PBX_$1}" != "x1" -a "${USE_$1}" != "no"; then
          $1_HEADER_FOUND="1"
       else                             # check for the header
          saved_cppflags="${CPPFLAGS}"
-         CPPFLAGS="${CPPFLAGS} ${$1_INCLUDE} $6"
+         CPPFLAGS="${CPPFLAGS} ${$1_INCLUDE}"
         AC_CHECK_HEADER([$4], [$1_HEADER_FOUND=1], [$1_HEADER_FOUND=0])
          CPPFLAGS="${saved_cppflags}"
       fi