From 6321271094c4a68aa6ce1556ca39a6f72c6fd5e7 Mon Sep 17 00:00:00 2001 From: guy Date: Thu, 21 Apr 2005 03:42:09 +0000 Subject: [PATCH] AC_TRY_COMPILE works only for code that fits inside "main()"; the test for __attribute__ doesn't fit inside "main()" with GCC 4.0, as it defines a function. --- aclocal.m4 | 16 +++++++++++----- configure | 11 +++++------ 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index d500140..eea75fd 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,4 +1,4 @@ -dnl @(#) $Header: /tcpdump/master/libpcap/aclocal.m4,v 1.85 2005-03-27 03:27:09 guy Exp $ (LBL) +dnl @(#) $Header: /tcpdump/master/libpcap/aclocal.m4,v 1.85.2.1 2005-04-21 03:42:09 guy Exp $ (LBL) dnl dnl Copyright (c) 1995, 1996, 1997, 1998 dnl The Regents of the University of California. All rights reserved. @@ -851,10 +851,10 @@ dnl AC_DEFUN(AC_C___ATTRIBUTE__, [ AC_MSG_CHECKING(for __attribute__) AC_CACHE_VAL(ac_cv___attribute__, [ -AC_TRY_COMPILE([ +AC_COMPILE_IFELSE( + AC_LANG_SOURCE([[ #include -], -[ + static void foo(void) __attribute__ ((noreturn)); static void @@ -862,7 +862,13 @@ foo(void) { exit(1); } -], + +int +main(int argc, char **argv) +{ + foo(); +} + ]]), ac_cv___attribute__=yes, ac_cv___attribute__=no)]) if test "$ac_cv___attribute__" = "yes"; then diff --git a/configure b/configure index 3a51734..74d3b9d 100755 --- a/configure +++ b/configure @@ -2633,10 +2633,6 @@ cat >>conftest.$ac_ext <<_ACEOF #include -int -main () -{ - static void foo(void) __attribute__ ((noreturn)); static void @@ -2645,9 +2641,12 @@ foo(void) exit(1); } - ; - return 0; +int +main(int argc, char **argv) +{ + foo(); } + _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5