Added --enable-kernel switch to disable kernel module building. stable-1.5
authorFlorian Pose <fp@igh-essen.com>
Mon, 10 Mar 2014 13:43:48 +0100
branchstable-1.5
changeset 2540 fca12d7035d1
parent 2539 d2d43d2e7f31
child 2541 1ddd186e9d2c
child 2556 674fcdccc0f3
Added --enable-kernel switch to disable kernel module building.
Makefile.am
configure.ac
--- a/Makefile.am	Wed Feb 19 12:28:15 2014 +0100
+++ b/Makefile.am	Mon Mar 10 13:43:48 2014 +0100
@@ -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
--- a/configure.ac	Wed Feb 19 12:28:15 2014 +0100
+++ b/configure.ac	Mon Mar 10 13:43:48 2014 +0100
@@ -57,9 +57,42 @@
 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=<DIR>],
@@ -116,6 +149,8 @@
 AC_SUBST(LINUX_SOURCE_DIR,[$sourcedir])
 AC_MSG_RESULT([$LINUX_SOURCE_DIR (Kernel $linuxversion)])
 
+fi
+
 #------------------------------------------------------------------------------
 # Linux module installation subdirectory
 #------------------------------------------------------------------------------
@@ -150,7 +185,7 @@
                 ;;
         esac
     ],
-    [enablegeneric=1]
+    [enablegeneric=$enablekernel]
 )
 
 AM_CONDITIONAL(ENABLE_GENERIC, test "x$enablegeneric" = "x1")
@@ -173,7 +208,7 @@
                 ;;
         esac
     ],
-    [enable8139too=1]
+    [enable8139too=$enablekernel]
 )
 
 AM_CONDITIONAL(ENABLE_8139TOO, test "x$enable8139too" = "x1")