Re: linux-kernel-headers foul-up [RESOLVED]
On Thu, Nov 06, 2003 at 09:19:45AM +0800, csj wrote:
> OPTFLAGS = ... -I/usr/local/src/linux/include
/usr/local/src/linux should be the linux kernel source code.
> <rhetorical> Why
> else would the mplayer developers look for their headers by
> default in /usr/include/linux/? </rhetorical>
/usr/include/linux should be libc's linux kernel headers.
Here is an exerpt from the #kernelnewbies FAQ at www.kernelnewbies.org:
Kernel source headers
These are the kernel header files that are part of the kernel source
package. They should never be used for compiling user-space programs.
Old Linux distributions often made /usr/include/linux and
/usr/include/asm symlinks to the right parts of the kernel source tree
installed in /usr/src/linux. This is the wrong thing to do - userspace
programs must use copies of the kernel headers, suitably modified.
There is also a link to Linus explaining the situation -
http://www.ussg.iu.edu/hypermail/linux/kernel/0007.3/0587.html
> I can see a problem if developers wants to put out a source
> package of their latest and greatest program and it wants to link
> to the kernel. Where would they point it to?
I imagine there are some very specific situations where a user space
program would correctly need to include the linux kernel source path
rather than libc's sanitized headers, but in virtually all cases they
would opt for libc's ones - /usr/include/linux
--
Jon Dowland
http://jon.dowland.name/
Reply to: