LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-27-2008, 02:07 PM   #1
Lytse Flap
LQ Newbie
 
Registered: Mar 2006
Location: Odense V (DK)
Distribution: SuSE
Posts: 9

Rep: Reputation: 0
third party makefile not correct? Missing version.h with installed kernel-headers.


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?
 
Old 07-29-2008, 03:55 AM   #2
murugesan
Member
 
Registered: May 2003
Location: Bangalore ,Karnataka, India, Asia, Earth, Solar system, milky way galaxy, black hole
Distribution: murugesan openssl
Posts: 181

Rep: Reputation: 29
Shall we get the output of make command with the statements below and above the line containing the error.
 
Old 07-29-2008, 11:06 AM   #3
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
You probably need to install the full kernel sources and make sure there is a link from the kernel sources to /usr/src/linux. Then configure the sources by running 'make oldconfig'. Many sources require this in order to compile.
 
Old 07-31-2008, 05:24 PM   #4
Lytse Flap
LQ Newbie
 
Registered: Mar 2006
Location: Odense V (DK)
Distribution: SuSE
Posts: 9

Original Poster
Rep: Reputation: 0
The solutions was to recompile the kernel.
make oldconfig
make

And wait for a few hours.

Then I had to look for a patch because the sources are using the depricated ioctl32.h headers.

Sorry forgot this thread, but I have a busy week.

Last edited by Lytse Flap; 07-31-2008 at 05:25 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Making sure the correct kernel headers are used djgerbavore Fedora 2 09-06-2007 08:52 AM
Am I missing some stuff in /build/ ? Kernel Headers?!?!? yttrium88 Linux - Newbie 1 10-28-2006 08:40 PM
kernel version and rpms - how do I know I am downloading the correct rpm version justice4all Red Hat 4 08-18-2006 06:01 PM
Missing Kernel Headers utku Debian 16 02-09-2005 02:20 AM
Upgraded to SuSE 9, is this kernel version correct? Thermodynamic Linux - Software 1 01-24-2004 12:04 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration