lkml.org 
[lkml]   [2002]   [May]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: modversion.h improvement suggestion
Date
From
> 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



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:25    [W:0.053 / U:0.312 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site