Skip to content

Commit

Permalink
[build] define conditionals only once
Browse files Browse the repository at this point in the history
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
  • Loading branch information
fabbione committed Dec 15, 2017
1 parent 0fc12e4 commit 0a92792
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -194,19 +194,14 @@ LIBS="$saved_LIBS"

# OS detection

AM_CONDITIONAL([KNET_LINUX], [false])
AM_CONDITIONAL([KNET_BSD], [false])

AC_MSG_CHECKING([for os in ${host_os}])
case "$host_os" in
*linux*)
AC_DEFINE_UNQUOTED([KNET_LINUX], [1], [Compiling for Linux platform])
AM_CONDITIONAL([KNET_LINUX], [true])
AC_MSG_RESULT([Linux])
;;
*bsd*)
AC_DEFINE_UNQUOTED([KNET_BSD], [1], [Compiling for BSD platform])
AM_CONDITIONAL([KNET_BSD], [true])
AC_MSG_RESULT([BSD])
if test "x$enable_libtap" = xyes; then
AC_MSG_ERROR([libtap is not currently supported on BSD platforms])
Expand All @@ -217,6 +212,9 @@ case "$host_os" in
;;
esac

AM_CONDITIONAL([KNET_LINUX], [echo $host_os | grep -q linux])
AM_CONDITIONAL([KNET_BSD], [echo $host_os | grep -q bsd])

# Checks for header files.
AC_CHECK_HEADERS([fcntl.h])
AC_CHECK_HEADERS([stdlib.h])
Expand Down

0 comments on commit 0a92792

Please sign in to comment.