From owner-freebsd-hackers Thu Apr 10 07:51:33 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id HAA09957 for hackers-outgoing; Thu, 10 Apr 1997 07:51:33 -0700 (PDT) Received: from pdx1.world.net (pdx1.world.net [192.243.32.18]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id HAA09952 for ; Thu, 10 Apr 1997 07:51:30 -0700 (PDT) From: proff@suburbia.net Received: from suburbia.net (suburbia.net [203.4.184.1]) by pdx1.world.net (8.7.5/8.7.3) with SMTP id HAA01637 for ; Thu, 10 Apr 1997 07:53:52 -0700 (PDT) Received: (qmail 7206 invoked by uid 110); 10 Apr 1997 14:50:51 -0000 Message-ID: <19970410145051.7205.qmail@suburbia.net> Subject: detecting kernel version at compile time To: hackers@freebsd.org Date: Fri, 11 Apr 1997 00:50:50 +1000 (EST) X-Mailer: ELM [version 2.4ME+ PL28 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk The kernel attempts to build without reference to /usr/include/*. This means that under normal circumstances can not be included, and one must rely on the #define BSD version_num in sys/param.h. However #define BSD version_num only has meaning insofar as Berkeley release versions are concerned (and under -current is set to 199506). What is needed, is file, which #defines __FreeBSD_sysversion=kernel_version_num and is included from sys/param.h. The reason it must be included from sys/param.h is that there is otherwise no way to conditionally test for the presence of this file at compile-time using CPP conditionals without error. Another benefit is that __FreeBSD_sysversion isn't necessarily __FreeBSD_version i.e users may update their sys tree more frequently than the rest (presuming they even have the rest of the source distribution). Ability to detect the kernel version at compile time is essential to adequately support third party modules. -- Prof. Julian Assange |If you want to build a ship, don't drum up people |together to collect wood and don't assign them tasks proff@suburbia.net |and work, but rather teach them to long for the endless proff@gnu.ai.mit.edu |immensity of the sea. -- Antoine de Saint Exupery