]> The Tcpdump Group git mirrors - tcpdump/blobdiff - aclocal.m4
AC_TRY_COMPILE works only for code that fits inside "main()"; the test
[tcpdump] / aclocal.m4
index 5c63556630c3c632bd652885da536d6a26e8d87e..97ac29ae7767c67ff174447a49260bb7b50bdf2c 100644 (file)
@@ -1,4 +1,4 @@
-dnl @(#) $Header: /tcpdump/master/tcpdump/aclocal.m4,v 1.106.2.3 2005-04-21 02:22:38 guy Exp $ (LBL)
+dnl @(#) $Header: /tcpdump/master/tcpdump/aclocal.m4,v 1.106.2.4 2005-04-21 03:51:19 guy Exp $ (LBL)
 dnl
 dnl Copyright (c) 1995, 1996, 1997, 1998
 dnl    The Regents of the University of California.  All rights reserved.
@@ -1211,10 +1211,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 <stdlib.h>
-],
-[
+
 static void foo(void) __attribute__ ((noreturn));
 
 static void
@@ -1222,7 +1222,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