Olaf Petzold wrote:
>
> Hello,
>
> I'm switching from rtl.2.2 to v3pre8 now and I found some problems with the
> order of includes. The rtl.mk does include all paths e.g. /usr/rtlinux/include,
> /usr/rtlinux/include/posix. The last ist very important else the cc doesn't
> find the right includes and take the one from the kernel tree (e.g. time.h)
> regardless of the right one from the /usr/rtlinux/include/posix dir. Why the
> way of order of include paths and not do inside the rtl-includes an
> #include <posix/time.h> anstead of #include <time.h>.
> To find this behavior .... hours.
>
> I don't use rtl.mk - I use autoconf && automake !
Hi Olaf,
I agree, unless you prefix the RTL variants of standard headers with
something, it is easy to pull in the wrong header. Although you can use
-nostdinc to make sure that nothing is sucked in from /usr/include, it
is too easy to get tripped up. I think that your method of saying
<posix/time.h> is okay. Personally I'd like to see a common method that
would work for rtai or rtl. A recent suggestion I like from David
Schleef is:
install headers in:
/usr/i386-linux/realtime
e.g:
/usr/i386-linux/realtime/rtlinux/<normal rtl inc structure>
/usr/i386-linux/realtime/rtai/<normal rtai inc structure>
For rt-net:
/usr/i386-linux/realtime/include/sys/socket.h
/usr/i386-linux/realtime/include/net/*
Then to compile a kernel module, use:
cc -c -D__KERNEL__ -I /usr/realtime/include -nostdinc it.c'
In your c files, you then need to include files using:
#include <rtl/posix/time.h>
This mechanism copes with both architecture and variant differences.
This is just a straw man, and if anyone can see problems, or has a
better solution, please feel free to disagree.
Regards, Stuart
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/