diff --git a/Makefile.am b/Makefile.am index 38c8b699..828a06be 100644 --- a/Makefile.am +++ b/Makefile.am @@ -30,11 +30,14 @@ ACLOCAL_AMFLAGS = -I m4 SUBDIRS = \ - devices \ include \ - master \ script +if ENABLE_KERNEL +SUBDIRS += devices +SUBDIRS += master +endif + if BUILD_TOOL SUBDIRS += tool endif diff --git a/configure.ac b/configure.ac index 8d87cdb5..51d1c722 100644 --- a/configure.ac +++ b/configure.ac @@ -56,10 +56,43 @@ m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) AC_PROG_CXX AC_PROG_LIBTOOL +#------------------------------------------------------------------------------ +# Kernel modules +#------------------------------------------------------------------------------ + +AC_MSG_CHECKING([whether to build kernel modules]) + +AC_ARG_ENABLE([kernel], + AS_HELP_STRING([--enable-kernel], + [Enable building kernel modules]), + [ + case "${enableval}" in + yes) enablekernel=1 + ;; + no) enablekernel=0 + ;; + *) AC_MSG_ERROR([Invalid value for --enable-generic]) + ;; + esac + ], + [enablekernel=1] +) + +if test "x$enablekernel" = "x1"; then + AC_MSG_RESULT([yes]) +else + AC_MSG_RESULT([no]) +fi + +AM_CONDITIONAL(ENABLE_KERNEL, test "x$enablekernel" = "x1") +AC_SUBST(ENABLE_KERNEL,[$enablekernel]) + #------------------------------------------------------------------------------ # Linux sources #------------------------------------------------------------------------------ +if test "x$enablekernel" = "x1"; then + AC_ARG_WITH([linux-dir], AC_HELP_STRING( [--with-linux-dir=