tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kernel build environment versioning?

Is there any kind of preprocessor-testable version ID when building the
kernel?  If so, how far back does it go?  I had a quick look at the
three versions I care about (using -dM -E) and none of them seemed to
define any sort of version symbol, but perhaps I'd just need to add an
include file my test missed or something.

The reason I care is that I have a kernel facility (diskwatch, the
kernel part of my live-backup code) for which I'd like to share code
across versions to the extent possible.  This would be greatly
facilitated by something that would let me do it as

#if ...on version X...
...setup for version X...
#elif ...on version Y...
...setup for version Y...
#elif ...on version Z...
...setup for version Z...
...error out...
...bulk of the code, using the stuff set up above...

But this works only when the preprocessor can tell whether the file is
being built for a 1.4T kernel versus 3.1 versus 4.0.1 versus 5.0 versus
whatever.  I don't really expect anyone to remember what 1.4T has, but
for 5.x and 4.x and maybe even 3.x I figure if there is anything of the
sort, someone here will know it.

/~\ The ASCII                             Mouse
\ / Ribbon Campaign
 X  Against HTML      
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B

Home | Main Index | Thread Index | Old Index