The following commit has been merged in the master branch:
commit 31843aafa7912c9fc591ddcd8e0fd2e79331e28a
Author: Guillem Jover <[email protected]>
Date:   Sun Aug 16 14:53:02 2009 +0200

    Use AC_*_IFELSE instead of obsolete AC_TRY_* macros

diff --git a/m4/compiler.m4 b/m4/compiler.m4
index 54f6a5c..b85e162 100644
--- a/m4/compiler.m4
+++ b/m4/compiler.m4
@@ -35,9 +35,10 @@ fi])dnl
 # Check whether the C compiler supports __attribute__, defines HAVE_C_ATTRIBUTE
 AC_DEFUN([DPKG_C_ATTRIBUTE],
 [AC_CACHE_CHECK([whether compiler supports __attribute__], [dpkg_cv_attribute],
-[AC_TRY_COMPILE([],
-[extern int testfunction(int x) __attribute__((unused))
-],
+       [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+               [[]],
+               [[extern int testfunction(int x) __attribute__((unused))]]
+       )],
        [dpkg_cv_attribute=yes],
        [dpkg_cv_attribute=no])])
 AS_IF([test "x$dpkg_cv_attribute" = "xyes"],
@@ -50,7 +51,7 @@ AS_IF([test "x$dpkg_cv_attribute" = "xyes"],
 # ------------------------------------------------------
 # Try compiling some C99 code to see whether it works
 AC_DEFUN([DPKG_TRY_C99],
-[AC_TRY_COMPILE([
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 #include <stdio.h>
 #include <stdbool.h>
 #include <inttypes.h>
@@ -58,8 +59,8 @@ AC_DEFUN([DPKG_TRY_C99],
 
 /* Variadic macro arguments */
 #define variadic_macro(foo, ...) printf(foo, __VA_ARGS__)
-],
-[
+]],
+[[
        /* Compound initialisers */
        struct { int a, b; } foo = { .a = 1, .b = 2 };
 
@@ -75,7 +76,7 @@ AC_DEFUN([DPKG_TRY_C99],
 
        /* Magic __func__ variable */
        printf("%s", __func__);
-], [$1], [$2])dnl
+]])], [$1], [$2])dnl
 ])# DPKG_TRY_C99
 
 # DPKG_C_C99
diff --git a/m4/funcs.m4 b/m4/funcs.m4
index 658a41c..1b9f0e8 100644
--- a/m4/funcs.m4
+++ b/m4/funcs.m4
@@ -5,26 +5,27 @@
 # Define HAVE_VA_COPY if we have va_copy, fail if they can't be assigned
 AC_DEFUN([DPKG_FUNC_VA_COPY],
 [AC_CACHE_CHECK([for va_copy], [dpkg_cv_va_copy],
-[AC_TRY_RUN(
-[#include <stdarg.h>
+       [AC_RUN_IFELSE([AC_LANG_SOURCE(
+[[#include <stdarg.h>
 main() {
 va_list v1, v2;
 va_copy (v1, v2);
 exit (0);
-}],
+}
+       ]])],
        [dpkg_cv_va_copy=yes],
+       [dpkg_cv_va_copy=no],
        [dpkg_cv_va_copy=no])])
 AS_IF([test "x$dpkg_cv_va_copy" = "xyes"],
        [AC_DEFINE([HAVE_VA_COPY], 1,
                  [Define to 1 if the `va_copy' macro exists])],
        [AC_CACHE_CHECK([for va_list assignment by copy],
                       [dpkg_cv_va_list_copy],
-[AC_TRY_COMPILE(
-[#include <stdarg.h>
-],
-[va_list v1, v2;
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+[[#include <stdarg.h>]],
+[[va_list v1, v2;
 v1 = v2;
-],
+]])],
                       [dpkg_cv_va_list_copy=yes],
                       [dpkg_cv_va_list_copy=no])])])
 ])# DPKG_FUNC_VA_COPY
diff --git a/m4/types.m4 b/m4/types.m4
index 6931f2a..dde3f83 100644
--- a/m4/types.m4
+++ b/m4/types.m4
@@ -26,11 +26,8 @@ AC_CHECK_DECLS([sys_siglist],,,
 # Defines HAVE_DEFINE to 1 if declared in HEADER, 0 otherwise
 AC_DEFUN([DPKG_CHECK_DEFINE],
 [AC_CACHE_CHECK([whether $1 is defined in $2], [dpkg_cv_define_$1],
-[AC_TRY_COMPILE(
-[#include <$2>
-],
-[int i = $1;
-],
+[AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM([[#include <$2>]], [[int i = $1;]])],
        [dpkg_cv_define_$1=yes],
        [dpkg_cv_define_$1=no])])
 AS_IF([test "x$dpkg_cv_define" = "xyes"],

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to