Date: Sun, 15 Jan 2017 18:08:58 +0100 From: Tijl Coosemans <tijl@FreeBSD.org> To: current@FreeBSD.org Cc: danfe@FreeBSD.org Subject: Installing opt_*.h kernel headers Message-ID: <20170115180858.19f828bf@kalimero.tijl.coosemans.org>
next in thread | raw e-mail | index | archive | help
Hi, The latest version of x11/nvidia-driver contains a call to a syscons function which is only available if the kernel config contains device sc (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216050). The call doesn't seem to be critical so I'd like to patch it like this: +#include "opt_syscons.h" ... +#ifdef DEV_SC syscons stuff here +#endif And add opt_syscons.h to SRCS in the module Makefile. This doesn't work however because sys/conf/kmod.mk creates empty opt_*.h files in the module build directory. Only when KERNBUILDDIR is set does it create opt_*.h files as symlinks to the same file in KERNBUILDDIR. This means that to build this port correctly users would have to have a kernel build directory (even if they just need the nvidia driver and don't otherwise build kernels) and the ports tree would need some way to find it (using KERNCONF etc.). It would be better if these opt_*.h files were installed along with the kernel. Somewhere in /usr/include or /boot/kernel(.old)? Perhaps concatenated into one file? Then kmod.mk could create symlinks to this file if KERNBUILDDIR is undefined. Building a module directly from sys/modules would then also just work without .if !defined(KERNBUILDDIR) magic that several Makefiles contain.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20170115180858.19f828bf>