-dnl @(#) $Header: /tcpdump/master/tcpdump/aclocal.m4,v 1.106.2.2 2005-04-20 09:51:03 guy Exp $ (LBL)
+dnl @(#) $Header: /tcpdump/master/tcpdump/aclocal.m4,v 1.106.2.3 2005-04-21 02:22:38 guy Exp $ (LBL)
dnl
dnl Copyright (c) 1995, 1996, 1997, 1998
dnl The Regents of the University of California. All rights reserved.
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
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
-/* Define as `__inline' if that's what the C compiler calls it, or to nothing
- if it is not supported. */
+/* Define as token for inline if inlining supported */
#undef inline
/* Define to `short' if int16_t not defined. */
#! /bin/sh
-# From configure.in Revision: 1.188.2.3 .
+# From configure.in Revision: 1.188.2.4 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.57.
#
echo "$as_me:$LINENO: checking for inline" >&5
echo $ECHO_N "checking for inline... $ECHO_C" >&6
-if test "${ac_cv_c_inline+set}" = set; then
+ if test "${ac_cv_lbl_inline+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_cv_c_inline=no
-for ac_kw in inline __inline__ __inline; do
- cat >conftest.$ac_ext <<_ACEOF
+
+ ac_cv_lbl_inline=""
+ ac_lbl_cc_inline=no
+ for ac_lbl_inline in inline __inline__ __inline
+ do
+ cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#ifndef __cplusplus
-typedef int foo_t;
-static $ac_kw foo_t static_foo () {return 0; }
-$ac_kw foo_t foo () {return 0; }
-#endif
+#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;
+ }
+int
+main ()
+{
+
+ ;
+ return 0;
+}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_cv_c_inline=$ac_kw; break
+ ac_lbl_cc_inline=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f conftest.$ac_objext conftest.$ac_ext
-done
-
+ 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
fi
-echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5
-echo "${ECHO_T}$ac_cv_c_inline" >&6
-case $ac_cv_c_inline in
- inline | yes) ;;
- no)
-cat >>confdefs.h <<\_ACEOF
-#define inline
-_ACEOF
- ;;
- *) cat >>confdefs.h <<_ACEOF
-#define inline $ac_cv_c_inline
+
+ if test ! -z "$ac_cv_lbl_inline" ; then
+ echo "$as_me:$LINENO: result: $ac_cv_lbl_inline" >&5
+echo "${ECHO_T}$ac_cv_lbl_inline" >&6
+ else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ fi
+
+cat >>confdefs.h <<_ACEOF
+#define inline $ac_cv_lbl_inline
_ACEOF
- ;;
-esac
echo "$as_me:$LINENO: checking for __attribute__" >&5
-dnl @(#) $Header: /tcpdump/master/tcpdump/configure.in,v 1.188.2.3 2005-04-20 11:20:52 guy Exp $ (LBL)
+dnl @(#) $Header: /tcpdump/master/tcpdump/configure.in,v 1.188.2.4 2005-04-21 02:22:38 guy Exp $ (LBL)
dnl
dnl Copyright (c) 1994, 1995, 1996, 1997
dnl The Regents of the University of California. All rights reserved.
dnl Process this file with autoconf to produce a configure script.
dnl
-AC_REVISION($Revision: 1.188.2.3 $)
+AC_REVISION($Revision: 1.188.2.4 $)
AC_PREREQ(2.50)
AC_INIT(tcpdump.c)
AC_CANONICAL_HOST
AC_LBL_C_INIT(V_CCOPT, V_INCLS)
-AC_C_INLINE
+AC_LBL_C_INLINE
AC_C___ATTRIBUTE__
AC_CHECK_HEADERS(fcntl.h rpc/rpcent.h netdnet/dnetdb.h)
AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>