Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
build: Simplify configure netlink/*.h detection code
Signed-off-by: Kang-Che Sung <[email protected]>
  • Loading branch information
Explorer09 committed May 14, 2025
commit 5ef62af666f45650406766f6d8e8f556d264fd5c
33 changes: 18 additions & 15 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1021,32 +1021,35 @@ AC_ARG_ENABLE([delayacct],
[],
[enable_delayacct=check])
case "$enable_delayacct" in
no)
no|yes)
;;
check)
if test "$my_htop_platform" != linux; then
enable_delayacct=no
elif test "$enable_static" = yes; then
enable_delayacct=no
else
old_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -I/usr/include/libnl3"
AC_CHECK_HEADERS([netlink/attr.h netlink/handlers.h netlink/msg.h], [], [enable_delayacct=no])
CFLAGS="$old_CFLAGS"

if test "$enable_delayacct" != no; then
enable_delayacct=yes
fi
fi
;;
yes)
*)
AC_MSG_ERROR([bad value '$enable_delayacct' for --enable-delayacct])
;;
esac

case "$enable_delayacct" in
check|yes)
old_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -I/usr/include/libnl3"
AC_CHECK_HEADERS([netlink/attr.h netlink/handlers.h netlink/msg.h], [], [AC_MSG_ERROR([can not find required header files netlink/attr.h, netlink/handlers.h, netlink/msg.h])])
AC_CHECK_HEADERS([netlink/attr.h netlink/handlers.h netlink/msg.h],
[],
[if test "$enable_delayacct" = yes; then
AC_MSG_ERROR([can not find required header files netlink/attr.h, netlink/handlers.h, netlink/msg.h])
fi
enable_delayacct=no])
CFLAGS="$old_CFLAGS"
;;
*)
AC_MSG_ERROR([bad value '$enable_delayacct' for --enable-delayacct])

if test "$enable_delayacct" != no; then
enable_delayacct=yes
fi
;;
esac
if test "$enable_delayacct" = yes; then
Expand Down