Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Apr 1997 00:50:50 +1000 (EST)
From:      proff@suburbia.net
To:        hackers@freebsd.org
Subject:   detecting kernel version at compile time
Message-ID:  <19970410145051.7205.qmail@suburbia.net>

next in thread | raw e-mail | index | archive | help

The kernel attempts to build without reference to /usr/include/*.
This means that under normal circumstances <osreldate.h> 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 <sys/sysreldate.h> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19970410145051.7205.qmail>