From 170641f69a86cdd740df4c1ec74194ef84dab6a0 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Thu, 29 Mar 2007 18:23:36 +0000 Subject: Replace obsolete macros (processing done by autoupdate). Some tests were rearranged (AC_TRY_LINK moved out of AC_TRY_RUN cross-compilation case, with arrangements to maintain the semantics) to avoid autoupdate errors. Factored out common (duplicate) code in aa.m4. Tested with autoconf 2.61; needs testing with 2.60. CVS patchset: 8767 CVS date: 2007/03/29 18:23:36 --- m4/_xine.m4 | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) (limited to 'm4/_xine.m4') diff --git a/m4/_xine.m4 b/m4/_xine.m4 index 9acb0f37d..930703bbb 100644 --- a/m4/_xine.m4 +++ b/m4/_xine.m4 @@ -9,7 +9,7 @@ AC_DEFUN([AC_C_ALWAYS_INLINE], AC_MSG_CHECKING([for always_inline]) SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wall -Werror" - AC_TRY_COMPILE([],[inline __attribute__ ((__always_inline__)) void f (void);], + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[inline __attribute__ ((__always_inline__)) void f (void);]])], [ac_cv_always_inline=yes],[ac_cv_always_inline=no]) CFLAGS="$SAVE_CFLAGS" AC_MSG_RESULT([$ac_cv_always_inline]) @@ -148,7 +148,7 @@ AC_DEFUN([AC_TRY_CFLAGS], [AC_MSG_CHECKING([if $CC supports $1 flags]) SAVE_CFLAGS="$CFLAGS" CFLAGS="$1" - AC_TRY_COMPILE([],[],[ac_cv_try_cflags_ok=yes],[ac_cv_try_cflags_ok=no]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[ac_cv_try_cflags_ok=yes],[ac_cv_try_cflags_ok=no]) CFLAGS="$SAVE_CFLAGS" AC_MSG_RESULT([$ac_cv_try_cflags_ok]) if test x"$ac_cv_try_cflags_ok" = x"yes"; then @@ -163,7 +163,7 @@ AC_DEFUN([AC_TRY_LDFLAGS], [AC_MSG_CHECKING([if $CC supports $1 flags]) SAVE_LDFLAGS="$LDFLAGS" LDFLAGS="$1" - AC_TRY_LINK([],[],[ac_cv_try_ldflags_ok=yes],[ac_cv_try_ldflags_ok=no]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[ac_cv_try_ldflags_ok=yes],[ac_cv_try_ldflags_ok=no]) LDFLAGS="$SAVE_LDFLAGS" AC_MSG_RESULT([$ac_cv_try_ldflags_ok]) if test x"$ac_cv_try_ldflags_ok" = x"yes"; then @@ -362,7 +362,7 @@ dnl AC_COMPILE_CHECK_SIZEOF (TYPE SUPPOSED-SIZE) dnl abort if the given type does not have the supposed size AC_DEFUN([AC_COMPILE_CHECK_SIZEOF], [AC_MSG_CHECKING(that size of $1 is $2) - AC_TRY_COMPILE([],[switch (0) case 0: case (sizeof ($1) == $2):;],[], + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[switch (0) case 0: case (sizeof ($1) == $2):;]])],[], [AC_MSG_ERROR([can not build a default inttypes.h])]) AC_MSG_RESULT([yes])]) @@ -545,26 +545,18 @@ AC_DEFUN([AC_CHECK_SOCKLEN_T], [ AC_LANG_PUSH(C++) AC_CACHE_VAL(ac_cv_socklen_t, [ - AC_TRY_COMPILE( -#include + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include #include - , -socklen_t a=0; + ]], [[socklen_t a=0; getsockname(0,(struct sockaddr*)0, &a); - , - ac_cv_socklen_t=socklen_t, - [ - AC_TRY_COMPILE( -#include -#include - , + ]])],[ac_cv_socklen_t=socklen_t],[ac_cv_socklen_t='']) + if test "x$ac_cv_socklen_t" = x; then + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include +#include ]], [[ int a=0; -getsockname(0,(struct sockaddr*)0, &a); - , - ac_cv_socklen_t=int, - ac_cv_socklen_t=size_t - )] - ) +getsockname(0,(struct sockaddr*)0, &a);]])], + [ac_cv_socklen_t=int],[ac_cv_socklen_t=size_t]) + fi ]) AC_LANG_POP([C++]) -- cgit v1.2.3