summaryrefslogtreecommitdiff
path: root/aclocal.m4
diff options
context:
space:
mode:
authorguy <guy>2005-04-21 02:21:47 +0000
committerguy <guy>2005-04-21 02:21:47 +0000
commitd26090f659cf19a3befbe2e3bdb4534f6d354f19 (patch)
tree599cfb6f116a2540654e7daa88699b7534033a74 /aclocal.m4
parenta4d5ec5902b508547a09c190494a07e9dd729770 (diff)
downloadtcpdump-d26090f659cf19a3befbe2e3bdb4534f6d354f19.tar.gz
Put back AC_LBL_C_INLINE; it turns out that wasn't the cause of the
inline problem, and AC_LBL_C_INLINE checks for a case that some versions of the HP C compiler don't handle, and only uses inline if that case succeeds.
Diffstat (limited to 'aclocal.m4')
-rw-r--r--aclocal.m448
1 files changed, 47 insertions, 1 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index 696f2236..24e483d3 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,4 +1,4 @@
-dnl @(#) $Header: /tcpdump/master/tcpdump/aclocal.m4,v 1.108 2005-04-20 09:49:52 guy Exp $ (LBL)
+dnl @(#) $Header: /tcpdump/master/tcpdump/aclocal.m4,v 1.109 2005-04-21 02:21:47 guy Exp $ (LBL)
dnl
dnl Copyright (c) 1995, 1996, 1997, 1998
dnl The Regents of the University of California. All rights reserved.
@@ -157,6 +157,52 @@ AC_DEFUN(AC_LBL_C_INIT,
fi
])
+
+#
+# Try compiling a sample of the type of code that appears in
+# gencode.c with "inline", "__inline__", and "__inline".
+#
+# Autoconf's AC_C_INLINE, at least in autoconf 2.13, isn't good enough,
+# as it just tests whether a function returning "int" can be inlined;
+# at least some versions of HP's C compiler can inline that, but can't
+# inline a function that returns a struct pointer.
+#
+AC_DEFUN(AC_LBL_C_INLINE,
+ [AC_MSG_CHECKING(for inline)
+ AC_CACHE_VAL(ac_cv_lbl_inline, [
+ ac_cv_lbl_inline=""
+ ac_lbl_cc_inline=no
+ for ac_lbl_inline in inline __inline__ __inline
+ do
+ AC_TRY_COMPILE(
+ [#define inline $ac_lbl_inline
+ static inline struct iltest *foo(void);
+ struct iltest {
+ int iltest1;
+ int iltest2;
+ };
+
+ static inline struct iltest *
+ foo()
+ {
+ static struct iltest xxx;
+
+ return &xxx;
+ }],,ac_lbl_cc_inline=yes,)
+ if test "$ac_lbl_cc_inline" = yes ; then
+ break;
+ fi
+ done
+ if test "$ac_lbl_cc_inline" = yes ; then
+ ac_cv_lbl_inline=$ac_lbl_inline
+ fi])
+ if test ! -z "$ac_cv_lbl_inline" ; then
+ AC_MSG_RESULT($ac_cv_lbl_inline)
+ else
+ AC_MSG_RESULT(no)
+ fi
+ AC_DEFINE_UNQUOTED(inline, $ac_cv_lbl_inline, [Define as token for inline if inlining supported])])
+
dnl
dnl Use pfopen.c if available and pfopen() not in standard libraries
dnl Require libpcap