linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: modversion.h improvement suggestion
       [not found] <Pine.GSO.4.05.10205051818350.20954-100000@mausmaki.cosy.sbg.ac.at>
@ 2002-05-05 16:36 ` Sebastian Huber
  0 siblings, 0 replies; 6+ messages in thread
From: Sebastian Huber @ 2002-05-05 16:36 UTC (permalink / raw)
  To: linux-kernel

On Sunday 05 May 2002 18:19, you wrote:
> On Sun, 5 May 2002, Sebastian Huber wrote:
> > Hello,
> > I tried to compile a device driver module and got the error that
> > 'modversion.h' cannot be found. My first questions were:
> > 	Are the include paths ok?
> > 	Do the maintainer now what he or she is doing?
> > 	Uses this driver code obsolete kernel stuff?
> > 	Has SuSE forgotten something to install?
> > Then I started a google search for 'modversion.h' and noticed that this
> > was a common problem. And after a while I found the solution ->
> > modversion.h is an automatically generated file.
> >
> > So what about a default modversion.h file:
> > /* This is an automatically generated file. Do not edit it. */
> > #error You have not generated the module versions. You have to ...
> >
> > This hint may save some time for those who are not so fit in kernel
> > issues.
>
> you should include module.h in any case - this also includes modversions.h
> (if you compile your kernel/module with MODVERSIONS enabled)
>
> 	++dent

They include modules.h, but if modversion.h doesn't exist you get of course 
the error that the file cannot be found. And if you don't play every day with 
the kernel this information alone don't help you very much. So an appropriate 
message might help you.

PS:
I'm not a member of this mailing list, so please cc me mails related to that 
subject.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: modversion.h improvement suggestion
  2002-05-06 21:03   ` Olaf Titz
@ 2002-05-07  4:55     ` Keith Owens
  0 siblings, 0 replies; 6+ messages in thread
From: Keith Owens @ 2002-05-07  4:55 UTC (permalink / raw)
  To: linux-kernel

On Mon, 06 May 2002 23:03:34 +0200, 
Olaf Titz <olaf@bigred.inka.de> wrote:
>i.e. copy the main Makefile, add a few rules to just echo the flags,
>and then invoke it in the original place (since it depends on that).
>We should really have a more elegant way to extract this info from the
>main Makefile.
>
>kaos wrote
>> In any case, modversions.h will disappear in kbuild 2.5.
>
>which leaves hope this issue will be addressed...

kbuild 2.5 has full and officially maintained support for compiling
code that is not yet in the main kernel tree.  No more hacks to get
external drivers, filesystems etc. to build.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: modversion.h improvement suggestion
  2002-05-05 23:43 ` Keith Owens
@ 2002-05-06 21:03   ` Olaf Titz
  2002-05-07  4:55     ` Keith Owens
  0 siblings, 1 reply; 6+ messages in thread
From: Olaf Titz @ 2002-05-06 21:03 UTC (permalink / raw)
  To: linux-kernel

> The build instructions for third party modules should say something
> like
>
>   If your kernel was built with CONFIG_MODVERSIONS=y then add these
>   flags to the build for this module
>
>   -DMODVERSIONS -include kernel_source_tree/linux/modversions.h

or even better, pick up the _complete_ compilation rule from the
kernel Makefile, since this is (unfortunately) by now the only way to
get all compiler options right.

I do it this way (in a configure.in for an external module):
KSRC is the kernel source location.

  cp $KSRC/Makefile conftest.make
  echo -e "conftest.CC:" >>conftest.make
  echo -e "\t@echo \$(CC)" >>conftest.make
  echo -e "conftest.CFLAGS:" >>conftest.make
  echo -e "\t@echo \$(CFLAGS) \$(MODFLAGS)" >>conftest.make
  here=`pwd`
  NKCC=`cd $KSRC; $MAKE -s -f $here/conftest.make conftest.CC`
  NKCFLAGS=`cd $KSRC; $MAKE -s -f $here/conftest.make conftest.CFLAGS`

i.e. copy the main Makefile, add a few rules to just echo the flags,
and then invoke it in the original place (since it depends on that).
We should really have a more elegant way to extract this info from the
main Makefile.

> In any case, modversions.h will disappear in kbuild 2.5.

which leaves hope this issue will be addressed...

Olaf




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: modversion.h improvement suggestion
  2002-05-05 16:00 Sebastian Huber
  2002-05-05 23:43 ` Keith Owens
@ 2002-05-06 15:39 ` Alan Cox
  1 sibling, 0 replies; 6+ messages in thread
From: Alan Cox @ 2002-05-06 15:39 UTC (permalink / raw)
  To: Sebastian Huber; +Cc: linux-kernel

> I tried to compile a device driver module and got the error that 
> 'modversion.h' cannot be found. My first questions were:

A device driver should not be directly including modversions.h. Its 
included automatically by the kernel build line only in the case where
CONFIG_MODVERSIONS is set.

If the module is being built seperate to the tree then it should probably
borrow the Make rules the kernel uses

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: modversion.h improvement suggestion
  2002-05-05 16:00 Sebastian Huber
@ 2002-05-05 23:43 ` Keith Owens
  2002-05-06 21:03   ` Olaf Titz
  2002-05-06 15:39 ` Alan Cox
  1 sibling, 1 reply; 6+ messages in thread
From: Keith Owens @ 2002-05-05 23:43 UTC (permalink / raw)
  To: Sebastian Huber; +Cc: linux-kernel

On Sun, 5 May 2002 18:00:51 +0200, 
Sebastian Huber <sebastian-huber@web.de> wrote:
>So what about a default modversion.h file:
>/* This is an automatically generated file. Do not edit it. */
>#error You have not generated the module versions. You have to ...

No.

It is a big mistake to ship a file and overwrite it under the same
name.  It messes up source repositories.

Any code that has an explicit #include <linux/modversions.h> is broken.
The kernel build automatically includes modversions.h when required.

The build instructions for third party modules should say something
like 

  If your kernel was built with CONFIG_MODVERSIONS=y then add these
  flags to the build for this module
  
  -DMODVERSIONS -include kernel_source_tree/linux/modversions.h

In any case, modversions.h will disappear in kbuild 2.5.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* modversion.h improvement suggestion
@ 2002-05-05 16:00 Sebastian Huber
  2002-05-05 23:43 ` Keith Owens
  2002-05-06 15:39 ` Alan Cox
  0 siblings, 2 replies; 6+ messages in thread
From: Sebastian Huber @ 2002-05-05 16:00 UTC (permalink / raw)
  To: linux-kernel

Hello,
I tried to compile a device driver module and got the error that 
'modversion.h' cannot be found. My first questions were:
	Are the include paths ok?
	Do the maintainer now what he or she is doing?
	Uses this driver code obsolete kernel stuff?
	Has SuSE forgotten something to install?
Then I started a google search for 'modversion.h' and noticed that this was a 
common problem. And after a while I found the solution -> modversion.h is an 
automatically generated file.

So what about a default modversion.h file:
/* This is an automatically generated file. Do not edit it. */
#error You have not generated the module versions. You have to ...

This hint may save some time for those who are not so fit in kernel issues.

Ciao
	Sebastian


PS:
I'm not a member of this mailing list, so please cc me mails related to that 
subject.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2002-05-07  4:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <Pine.GSO.4.05.10205051818350.20954-100000@mausmaki.cosy.sbg.ac.at>
2002-05-05 16:36 ` modversion.h improvement suggestion Sebastian Huber
2002-05-05 16:00 Sebastian Huber
2002-05-05 23:43 ` Keith Owens
2002-05-06 21:03   ` Olaf Titz
2002-05-07  4:55     ` Keith Owens
2002-05-06 15:39 ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).