From owner-freebsd-current@freebsd.org Sun Jan 15 17:09:13 2017 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30DC1CB1815 for ; Sun, 15 Jan 2017 17:09:13 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 1A0021F1E for ; Sun, 15 Jan 2017 17:09:13 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 16887CB1814; Sun, 15 Jan 2017 17:09:13 +0000 (UTC) Delivered-To: current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 162E8CB1813 for ; Sun, 15 Jan 2017 17:09:13 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay110.isp.belgacom.be (mailrelay110.isp.belgacom.be [195.238.20.137]) (using TLSv1.2 with cipher RC4-SHA (128/128 bits)) (Client CN "relay.skynet.be", Issuer "GlobalSign Organization Validation CA - SHA256 - G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F6B51F1D; Sun, 15 Jan 2017 17:09:11 +0000 (UTC) (envelope-from tijl@freebsd.org) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2D6BABcrHtY//s+sVtdHAEBBAEBCgEBg?= =?us-ascii?q?zkBAQEBAR9QD3gRjVhykUcBgjaSToILKoV4ghlAGAECAQEBAQEBAWMohSocIzw?= =?us-ascii?q?0Kok+CrF7iX0BAQgCASWON4IJhRgFmzqBS4USinV0gWGOJUiSJB84NnEqCIZtP?= =?us-ascii?q?TUBiGEBAQE?= X-IPAS-Result: =?us-ascii?q?A2D6BABcrHtY//s+sVtdHAEBBAEBCgEBgzkBAQEBAR9QD3g?= =?us-ascii?q?RjVhykUcBgjaSToILKoV4ghlAGAECAQEBAQEBAWMohSocIzw0Kok+CrF7iX0BA?= =?us-ascii?q?QgCASWON4IJhRgFmzqBS4USinV0gWGOJUiSJB84NnEqCIZtPTUBiGEBAQE?= Received: from 251.62-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.62.251]) by relay.skynet.be with ESMTP; 15 Jan 2017 18:08:59 +0100 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.15.2/8.15.2) with ESMTP id v0FH8wfT003041; Sun, 15 Jan 2017 18:08:59 +0100 (CET) (envelope-from tijl@FreeBSD.org) Date: Sun, 15 Jan 2017 18:08:58 +0100 From: Tijl Coosemans To: current@FreeBSD.org Cc: danfe@FreeBSD.org Subject: Installing opt_*.h kernel headers Message-ID: <20170115180858.19f828bf@kalimero.tijl.coosemans.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2017 17:09:13 -0000 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.