configure.ac: clean up AC_ARG_ENABLE() for linuxkm, and make AC_ARG_WITH for linux-source and linux-arch unconditional.

This commit is contained in:
Daniel Pouzzner
2020-09-09 18:17:28 -05:00
parent 2609fa9aeb
commit 291febb270

View File

@ -3359,27 +3359,36 @@ fi
# Linux Kernel Module # Linux Kernel Module
AC_ARG_ENABLE([linuxkm], AC_ARG_ENABLE([linuxkm],
[ --enable-linuxkm Enable Linux Kernel Module (default: disabled)], [AS_HELP_STRING([--enable-linuxkm],[Enable Linux Kernel Module (default: disabled)])],
[ ENABLED_LINUXKM=$enableval ], [ENABLED_LINUXKM=$enableval],
[ ENABLED_LINUXKM=no ] [ENABLED_LINUXKM=no]
) )
AC_ARG_WITH([linux-source],
[AS_HELP_STRING([--with-linux-source=PATH],[PATH to root of Linux kernel build tree])],
[KERNEL_ROOT=$withval],
[KERNEL_ROOT=""])
AC_ARG_WITH([linux-arch],
[AS_HELP_STRING([--with-linux-arch=arch],[built arch (SRCARCH) of Linux kernel build tree])],
[KERNEL_ARCH=$withval],
[KERNEL_ARCH=""])
if test "x$ENABLED_LINUXKM" = "xyes" if test "x$ENABLED_LINUXKM" = "xyes"
then then
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_LINUXKM" AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_LINUXKM"
ENABLED_NO_LIBRARY=yes
AC_PATH_DEFAULT_KERNEL_SOURCE if test "$KERNEL_ROOT" = ""; then
AC_ARG_WITH([linux-source], AC_PATH_DEFAULT_KERNEL_SOURCE
[AS_HELP_STRING([--with-linux-source=PATH],[PATH to root of Linux kernel build tree])], KERNEL_ROOT="$DEFAULT_KERNEL_ROOT"
[KERNEL_ROOT=$withval], fi
[KERNEL_ROOT=$DEFAULT_KERNEL_ROOT])
AC_SUBST([KERNEL_ROOT]) AC_SUBST([KERNEL_ROOT])
AC_DEFAULT_KERNEL_ARCH if test "$KERNEL_ARCH" = ""; then
AC_ARG_WITH([linux-arch], AC_DEFAULT_KERNEL_ARCH
[AS_HELP_STRING([--with-linux-arch=arch],[built arch (SRCARCH) of Linux kernel build tree])], KERNEL_ARCH="$DEFAULT_KERNEL_ARCH"
[KERNEL_ARCH=$withval], fi
[KERNEL_ARCH=$DEFAULT_KERNEL_ARCH])
AC_SUBST([KERNEL_ARCH]) AC_SUBST([KERNEL_ARCH])
if test "${KERNEL_ROOT}" = ""; then if test "${KERNEL_ROOT}" = ""; then
@ -3388,8 +3397,6 @@ then
if test "${KERNEL_ARCH}" = ""; then if test "${KERNEL_ARCH}" = ""; then
AC_MSG_ERROR([Linux kernel target architecture for build tree ${KERNEL_ROOT} could not be determined. Is target kernel configured?]) AC_MSG_ERROR([Linux kernel target architecture for build tree ${KERNEL_ROOT} could not be determined. Is target kernel configured?])
fi fi
ENABLED_NO_LIBRARY=yes
fi fi