| 1 |
# Handy references: |
| 2 |
# https://www.gnu.org/software/autoconf/manual/autoconf.html#Generic-Structures |
| 3 |
# AC_CHECK_MEMBER (aggregate.member, [action-if-found], [action-if-not-found], [includes = 'AC_INCLUDES_DEFAULT']) |
| 4 |
# https://www.gnu.org/software/autoconf/manual/autoconf.html#Generic-Types |
| 5 |
# AC_CHECK_TYPE (type, [action-if-found], [action-if-not-found], [includes = 'AC_INCLUDES_DEFAULT']) |
| 6 |
|
| 7 |
# Macros to assist on probing kernel features |
| 8 |
# Probes if a type is defined |
| 9 |
AC_DEFUN([LKSCTP_CHECK_TYPE], [ |
| 10 |
AC_CHECK_TYPE([$1], |
| 11 |
AC_DEFINE([$2], 1, |
| 12 |
[Define if $1 is present.]) |
| 13 |
AM_CONDITIONAL([$2], [true]), |
| 14 |
AM_CONDITIONAL([$2], [false]), |
| 15 |
[AC_INCLUDES_DEFAULT |
| 16 |
#ifdef HAVE_STDINT_H |
| 17 |
# include <stdint.h> |
| 18 |
#endif |
| 19 |
#ifdef HAVE_SYS_SOCKET_H |
| 20 |
# include <sys/socket.h> |
| 21 |
#endif |
| 22 |
#ifdef HAVE_LINUX_SCTP_H |
| 23 |
# include <linux/sctp.h> |
| 24 |
#endif |
| 25 |
])]) |
| 26 |
|
| 27 |
# Probes if a struct has a given member |
| 28 |
AC_DEFUN([LKSCTP_CHECK_MEMBER], [ |
| 29 |
AC_CHECK_MEMBER([$1], |
| 30 |
AC_DEFINE([$2], 1, |
| 31 |
[Define if $1 is present.]) |
| 32 |
AM_CONDITIONAL([$2], [true]), |
| 33 |
AM_CONDITIONAL([$2], [false]), |
| 34 |
[AC_INCLUDES_DEFAULT |
| 35 |
#ifdef HAVE_STDINT_H |
| 36 |
# include <stdint.h> |
| 37 |
#endif |
| 38 |
#ifdef HAVE_SYS_SOCKET_H |
| 39 |
# include <sys/socket.h> |
| 40 |
#endif |
| 41 |
#ifdef HAVE_LINUX_SCTP_H |
| 42 |
# include <linux/sctp.h> |
| 43 |
#endif |
| 44 |
])]) |
| 45 |
|
| 46 |
# Probes if a declaration is present |
| 47 |
AC_DEFUN([LKSCTP_CHECK_DECL], [ |
| 48 |
AC_CHECK_DECL([$1], |
| 49 |
AC_DEFINE([$2], 1, |
| 50 |
[Define if $1 is present.]) |
| 51 |
AM_CONDITIONAL([$2], [true]), |
| 52 |
AM_CONDITIONAL([$2], [false]), |
| 53 |
[AC_INCLUDES_DEFAULT |
| 54 |
#ifdef HAVE_STDINT_H |
| 55 |
# include <stdint.h> |
| 56 |
#endif |
| 57 |
#ifdef HAVE_SYS_SOCKET_H |
| 58 |
# include <sys/socket.h> |
| 59 |
#endif |
| 60 |
#ifdef HAVE_LINUX_SCTP_H |
| 61 |
# include <linux/sctp.h> |
| 62 |
#endif |
| 63 |
])]) |