Skip to content

Commit

Permalink
On Linux, check for sys/eventfd.h with autoconf as well.
Browse files Browse the repository at this point in the history
  • Loading branch information
guyharris committed Sep 14, 2018
1 parent e3e421a commit dfce68d
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,10 @@ main(void)
# linux/if_bonding.h requires sys/socket.h.
#
check_include_files("sys/socket.h;linux/if_bonding.h" HAVE_LINUX_IF_BONDING_H)

#
# Check for the eventfd header.
#
check_include_files("sys/eventfd.h" HAVE_SYS_EVENTFD_H)
endif()
endif(NOT WIN32)
Expand Down
3 changes: 3 additions & 0 deletions config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@
/* Define to 1 if you have the <sys/dlpi.h> header file. */
#undef HAVE_SYS_DLPI_H

/* Define to 1 if you have the <sys/eventfd.h> header file. */
#undef HAVE_SYS_EVENTFD_H

/* Define to 1 if you have the <sys/ioccom.h> header file. */
#undef HAVE_SYS_IOCCOM_H

Expand Down
19 changes: 19 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -4931,6 +4931,9 @@ fi

case "$host_os" in
linux*|uclinux*)
#
# linux/if_bonding.h requires sys/socket.h.
#
for ac_header in linux/sockios.h linux/if_bonding.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
Expand All @@ -4946,6 +4949,22 @@ _ACEOF

fi

done


#
# Check for the eventfd header.
#
for ac_header in sys/eventfd.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "sys/eventfd.h" "ac_cv_header_sys_eventfd_h" "$ac_includes_default"
if test "x$ac_cv_header_sys_eventfd_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_SYS_EVENTFD_H 1
_ACEOF

fi

done

;;
Expand Down
8 changes: 8 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,19 @@ fi

case "$host_os" in
linux*|uclinux*)
#
# linux/if_bonding.h requires sys/socket.h.
#
AC_CHECK_HEADERS(linux/sockios.h linux/if_bonding.h,,,
[
#include <sys/socket.h>
#include <linux/if.h>
])

#
# Check for the eventfd header.
#
AC_CHECK_HEADERS(sys/eventfd.h)
;;
esac

Expand Down

0 comments on commit dfce68d

Please sign in to comment.