Skip to contentSkip to conversation

Where is the version.h?

DISCUSSION parmenides 3 participants 6 messages Jan 27, 2014 – Jan 28, 2014

lore
Share & tools
lore

parmenides

author
#0 lore raw

Hi,

According to LDD3, the linux/module.h automatically includes the linux/version, which define some macros to help test the kernel version. But I search the source tree, and can not find version.h in include/linux. Where can I find it?

Thanks!

#1 lore raw
Quoted 5 lines · parmenides

According to LDD3, the linux/module.h automatically includes the linux/version, which define some macros to help test the kernel version. But I search the source tree, and can not find version.h in include/linux. Where can I find it?

It lives in include/generated/uapi/linux/version.h

If you've never built a kernel in your tree you won't find it though, because it's created from the Makefile. Look for version_h and filechk_version.h.

Regards,
Kristof

author
#2 lore raw
Quoted 2 lines · Kristof Provost

It lives in include/generated/uapi/linux/version.h

Accroding to LDD3, version.h is included with the path "linux/version.h", therefore I think the
"include/generated/uapi/linux/version.h"
might be symbolic linked to
"include/linux/version.h"
during compilation. Is this the case?

#3 lore raw
Quoted 6 lines · parmenides

Accroding to LDD3, version.h is included with the path "linux/version.h", therefore I think the
"include/generated/uapi/linux/version.h"
might be symbolic linked to
"include/linux/version.h"
during compilation. Is this the case?

No, the build gets done with a -Iinclude/generated/uapi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 848 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140127/e52825c7/attachment.bin

author
#4 lore raw
Quoted 1 line · Valdis.Kletnieks at vt.edu

No, the build gets done with a -Iinclude/generated/uapi

So, I get it. Thanks for your reply!

#5 lore raw
In reply to parmenides
Quoted 4 lines · parmenides

According to LDD3, the linux/module.h automatically includes the linux/version, which define some macros to help test the kernel version. But I search the source tree, and can not find version.h in include/linux. Where can I find it?

It's auto-generated. You need to run at least a 'make prepare' in the
kernel tree (though you'll probably want to go ahead and actually build and
boot a kernel to develop against).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 848 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140127/fe36c92e/attachment-0001.bin