]> git.ipfire.org Git - thirdparty/lldpd.git/blob - m4/ethtool.m4
Make netsnmp headers compatible with C99.
[thirdparty/lldpd.git] / m4 / ethtool.m4
1 #
2 # lldp_CHECK_HEADER_ETHTOOL
3 #
4 AC_DEFUN([lldp_CHECK_HEADER_ETHTOOL], [
5 AC_CACHE_CHECK([for linux/ethtool.h], mac_cv_header_ethtool_h, [
6 AC_COMPILE_IFELSE([
7 AC_LANG_SOURCE([
8 AC_INCLUDES_DEFAULT
9 @%:@include <linux/ethtool.h>
10 ])
11 ], [mac_cv_header_ethtool_h=yes], [mac_cv_header_ethtool_h=no]
12 )
13 if test "$mac_cv_header_ethtool_h" = no; then
14 AC_COMPILE_IFELSE([
15 AC_LANG_SOURCE([
16 AC_INCLUDES_DEFAULT
17 @%:@define u8 uint8_t
18 @%:@define s8 int8_t
19 @%:@define u16 uint16_t
20 @%:@define s16 int16_t
21 @%:@define u32 uint32_t
22 @%:@define s32 int32_t
23 @%:@define u64 uint64_t
24 @%:@define s64 int64_t
25 @%:@include <linux/ethtool.h>
26 ])
27 ],
28 [mac_cv_header_ethtool_h="yes (with type munging)"],
29 [mac_cv_header_ethtool_h=no]
30 )
31 ])
32 fi
33 if test "$mac_cv_header_ethtool_h" = "yes (with type munging)"; then
34 AC_DEFINE(u8, uint8_t, [Define to the type u8 should expand to.])
35 AC_DEFINE(s8, int8_t, [Define to the type u8 should expand to.])
36 AC_DEFINE(u16, uint16_t, [Define to the type u16 should expand to.])
37 AC_DEFINE(s16, int16_t, [Define to the type u16 should expand to.])
38 AC_DEFINE(u32, uint32_t, [Define to the type u32 should expand to.])
39 AC_DEFINE(s32, int32_t, [Define to the type u32 should expand to.])
40 AC_DEFINE(u64, uint64_t, [Define to the type u64 should expand to.])
41 AC_DEFINE(s64, int64_t, [Define to the type u64 should expand to.])
42 fi
43 if test "$mac_cv_header_ethtool_h" = no; then
44 :
45 else
46 AC_DEFINE(HAVE_ETHTOOL_H, 1, [Define to 1 if you have the <linux/ethtool.h> header file.])
47 fi
48 ])