Hello,

I had to re-write a convoluted part of configure.ac to get it to detect what 
kernel I'm running. Forget the exact error, but this is very messy in the state 
it's in right now:

---cut here---if test $RTS '!=' uspace; then 
AC_MSG_CHECKING([for kernel version string]) 

if test -e $KERNELDIR/include/linux/utsrelease.h; then 
VERSION_FILE=$KERNELDIR/include/linux/utsrelease.h 
elif test -e $KERNELDIR/include/generated/utsrelease.h; then 
VERSION_FILE=$KERNELDIR/include/generated/utsrelease.h 
else 
VERSION_FILE=$KERNELDIR/include/linux/version.h 
fi 
KERNEL_VERS=`$CC -E -dM ${VERSION_FILE} | grep UTS | cut -d '"' -f 2` 

if test -z "$KERNEL_VERS"; then 
AC_MSG_ERROR(Kernel version string not found) 
fi 

AC_MSG_RESULT([$KERNEL_VERS]) 

AC_SUBST([KERNEL_VERS]) AC_DEFINE_UNQUOTED([RTAPI_KERNEL_VERSION], 
"$KERNEL_VERS", [Required kernel version])
---cut here---

Maybe with some autotools clean up, it'll help get rid of these LXRT problems? 
For example, what I did on my system, boot into RTAI kernel, then just: 
KERNEL_VERS=`uname -r` without using VERSION_FILE utsrelease etc. This way 
LinuxCNC will only build against the kernel that is booted. Smaller LOC 
footprint and less error prone. I try to avoid having more code in a script 
that is necessary. For example, rtai-load in upstream:

http://svn.savannah.gnu.org/viewvc/rtai/vulcano/base/scripts/rtai-load.in?revision=1&view=markup

My rtai-load:

https://github.com/NTULINUX/RTAI/blob/master/base/scripts/rtai-load.in

Same functionality, but 89 lines of easy-to-read code instead of 265 lines of 
complete utter chaos.

Lines like:

e=`echo $* | sed -e "s,^[$spc]*![$spc]*\\(.*\\)$,\\1,"`

Is not really a good idea.

Hope this helps!


Alec


_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to