This is a problem I have no idea how to solve this.
On an openSUSE 10.3 installation, with the kernel-headers installed, I want to install a script that installs the parallel cable for Xilinx FPGAs. I know that the problem must be in a make rule, or better I suspect the makefile to be wrong.
Short summary of the installation script.
The script from Xilinx, called installdravers, checks basic settings. Think of being root, have the proper kernel a.s.o. some basic stuff.
Then it calls a make file that will generate an error on the first compile rule.
The makefile compiles the file linux_wrappers.c, which needs linux_common.h. And the linux_common.h needs version.h. When this header is not present, the linux_common.h can not determine the kernel version and generates an error with the message that the kernel is too old.
Code:
#ifndef _LINUX_COMMON_H_
#define _LINUX_COMMON_H_
#include <linux/version.h>
#ifndef VERSION_CODE
# define VERSION_CODE(vers,rel,seq) ( ((vers)<<16) | ((rel)<<8) | (seq) )
#endif
/* only allow major releases */
#if LINUX_VERSION_CODE < VERSION_CODE(2,0,0) /* not < 2.0 */
# error "This kernel is too old: not supported by this file"
#endif
Okay, install the kernel-headers is the first answet what is given to me.
But I already installed these headers. Secondly, when I try a simple C-code like this one:
Code:
#include <linux/version.h>
#include <stdio.h>
int main(void){
printf("Letters\n");
}
The GCC generates a working binary without any warnings. So version.h is properly installed and working.
So, I came to the conclusion that the makefile give some false parameters.
Code:
cc -c -O2 -Wall -DLINUX -D__KERNEL__ -DMODULE -DWINDRIVER_KERNEL -mpreferred-stack-boundary=2 -mregparm=3 -nostdinc -iwithprefix include -Wstrict-prototypes -Wno-trigraphs -fno-common -pipe -O -I/lib/modules/2.6.22.18-0.2-default/source/include -I/home/joris/download/install_drivers/linux_drivers/windriver32/include -I/home/joris/download/install_drivers/linux_drivers/windriver32 -fno-strict-aliasing -D"KBUILD_STR(s)=#s" -D"KBUILD_MODNAME=KBUILD_STR(windrvr6)" -D"KBUILD_BASENAME=KBUILD_STR(windrvr6)" -include /lib/modules/2.6.22.18-0.2-default/build/include/linux/autoconf.h -c -o LINUX.2.6.22.i386/linux_wrappers.o linux_wrappers.c
And when I look to more errors, all the kernel-headers are not found by GCC. And all by compiling this only linux_wrapper.c, which is actually the only file make is going to compile.
But this make-rule looks fair to me. Any one a solution where I should look?