summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2009-08-16 14:53:02 +0200
committerGuillem Jover <guillem@debian.org>2009-08-16 15:09:41 +0200
commit31843aafa7912c9fc591ddcd8e0fd2e79331e28a (patch)
treeaf75d449c0314d8ee0535ffd56b9e2958538d01a /m4
parent0a8ed560cc38f47c08503857977ea5cb9753ca00 (diff)
downloaddpkg-31843aafa7912c9fc591ddcd8e0fd2e79331e28a.tar.gz
Use AC_*_IFELSE instead of obsolete AC_TRY_* macros
Diffstat (limited to 'm4')
-rw-r--r--m4/compiler.m415
-rw-r--r--m4/funcs.m417
-rw-r--r--m4/types.m47
3 files changed, 19 insertions, 20 deletions
diff --git a/m4/compiler.m4 b/m4/compiler.m4
index 54f6a5c2a..b85e162a0 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 658a41c46..1b9f0e8fc 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 6931f2ad2..dde3f837d 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"],