package/nvidia-driver: build the kernel module

Add option to build the nvidia.ko module. If CUDA is enabled on x86_64,
also build the nvidia-uvm.ko kernel module (for Unified Memory access),
which is required by the CUDA user-land library.

Substancially inspired by the corresponding Gentoo ebuild:
    http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-340.32.ebuild?revision=1.2&view=markup

[Thomas:
  - add quotes when using $(TARGET_CC) and other variables, since they
    can have spaces in their values
  - remove space after opening parenthesis and before closing parenthesis.]

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
diff --git a/package/nvidia-driver/Config.in b/package/nvidia-driver/Config.in
index 18453ab..cd7fc95 100644
--- a/package/nvidia-driver/Config.in
+++ b/package/nvidia-driver/Config.in
@@ -49,4 +49,18 @@
 	  Say 'y' here if you plan on running a program that uses
 	  those private libraries.
 
+comment "nvidia kernel module needs a kernel to be built"
+	depends on !BR2_LINUX_KERNEL
+
+config BR2_PACKAGE_NVIDIA_DRIVER_MODULE
+	bool "nvidia kernel module"
+	depends on BR2_LINUX_KERNEL
+	help
+	  Build the nvidia.ko kernel module.
+
+	  If CUDA support (above) is set, and the target is x86_64, then
+	  this will also build the nvidia-uvm.ko kernel module, which
+	  provides Unified Memory access to the GPU and CPU memories for
+	  CUDA programs.
+
 endif # BR2_PACKAGE_NVIDIA_DRIVER