lkml.org 
[lkml]   [2000]   [Dec]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
On Mon, Dec 18, 2000 at 10:51:09AM -0500, Dana Lacoste wrote:
>
> Can we get a #3 going? I think it could really help both the cross-compile
> people and those who just want to make sure their modules are compiling in
> the 'correct' environment. It also allows for things like 'kgcc vs. gcc' to
> be 'properly' resolved by the distribution-creator as it should be, instead of
> linux-kernel or the 3rd party module mailing lists.

I use the following script (scripts/dep.linux from Comedi-0.7.53).
It could easily be improved to handle the /lib/modules/*/build/include
link. I've also developed (actually, "gathered") a lot of other stuff
for convenient non-kernel module compiling, including compatiblity
header files, Makefiles, etc. Good places to look for stuff include
comedi, RTAI, RTLinux, PCMCIA, and MTD.

Keep in mind that there is no "correct" environment except that
which the user specifies.



dave...



#!/bin/sh

if [ "$LINUXDIR" = "" ]
then
echo -n "Enter location of Linux source tree [/usr/src/linux]: "
read LINUXDIR
: ${LINUXDIR:=/usr/src/linux}
fi

if [ ! -f "$LINUXDIR/.config" ];then
echo Kernel source tree at $LINUXDIR is not configured
echo Fix before continuing
exit 1
fi

echo using LINUXDIR=$LINUXDIR
echo LINUXDIR=$LINUXDIR >.sourcedirs

. $LINUXDIR/.config

#
# check for a bad situation
#
if [ "$CONFIG_MODULES" = "n" ]
then
cat <<EOF
*****
***** WARNING!!!
*****
***** Your kernel is configured to not allow loadable modules.
***** You are attempting to compile a loadable module for this
***** kernel. This is a problem. Please correct it.
*****
EOF
exit
fi

#
# check running kernel vs. /usr/src/linux and warn if necessary
#
read dummy dummy dummy2 <$LINUXDIR/include/linux/version.h
UTS_VERSION=`echo $dummy2|sed 's/"//g'`

echo UTS_VERSION=$UTS_VERSION >.uts_version

if [ "$(uname -r)" != "$UTS_VERSION" ]
then
cat <<EOF
*****
***** WARNING!!!
*****
***** The kernel that is currently running is a different
***** version than the source in $LINUXDIR. The current
***** compile will create a module that is *incompatible*
***** with the running kernel.
*****
EOF
fi


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

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