Trouble Compiling modules/kernel

Joe Kamphaus joe at joekamphaus.net
Wed Jan 7 15:30:37 EST 2009


What am I doing wrong?

I am trying to compile a kernel and keep getting this error:

CC [M]  drivers/char/speakup/speakup.o
drivers/char/speakup/speakup.c:2677:39: error: macro "DECLARE_WORK" requires 3 arguments, but only 2 given
drivers/char/speakup/speakup.c:2677: warning: type defaults to ‘int’ in declaration of ‘DECLARE_WORK’
drivers/char/speakup/speakup.c: In function ‘speakup_help’:
drivers/char/speakup/speakup.c:2686: error: ‘ld_help’ undeclared (first use in this function)
drivers/char/speakup/speakup.c:2686: error: (Each undeclared identifier is reported only once
drivers/char/speakup/speakup.c:2686: error: for each function it appears in.)
make[3]: *** [drivers/char/speakup/speakup.o] Error 1
make[2]: *** [drivers/char/speakup] Error 2
make[1]: *** [drivers/char] Error 2
make: *** [drivers] Error 2

I have tried to compile as module or included in kernel.  I have tried several kernel versions. I am using cvs with the following script to patch the source.

#!/bin/bash

ROOTDIR=/usr/src/linux
if [ "$1" != "" ]; then
	ROOTDIR="$1"
else
    if [ -d kernel -a -d Documentation ]; then
	ROOTDIR=`pwd`
    fi
fi

VERSION=v`head -2 $ROOTDIR/Makefile | \
	awk '{ printf "%s",$3 }'`

DIR=$ROOTDIR/drivers/char/speakup

echo "Patching version $VERSION"

if [ ! -d ${DIR}/CVS ] && [ "$CVSROOT" == "" ]; then
	echo 'CVSROOT not set.  Enter it below.  Hit enter for anonymous.'
	read -p 'CVSROOT> ' CVSROOT
	[ "$CVSROOT" == "" ] &&
	  CVSROOT=':pserver:anonymous at linux-speakup.org:/usr/src/CVS'
	export CVSROOT
	cvs login || exit
fi

if [ "$1" != "-p" ]; then
	#  get new version
	mkdir -p ${DIR%/speakup}
	cd ${DIR%/speakup}
	if [ -d speakup ] && [ -d ${DIR}/CVS ]; then
		cd speakup
		cvs update -d -P || exit
	else
	rm -fr ${DIR}
		cvs co -P speakup || exit
		cd speakup
	fi
fi

#  make .orig files
echo -n 'Creating .orig files ['
for i in `cat ${DIR}/patchlist-${VERSION}`; do
	patch=`echo $i | cut -f 1 -d ,`
	filebase=`echo $i | cut -f 2 -d ,`

	mkdir -p `dirname $ROOTDIR/$filebase`
	if [ "$patch" == "1" ]; then
		if [ ! -e $ROOTDIR/$filebase.orig ]; then
			echo -n .
			cp $ROOTDIR/$filebase $ROOTDIR/$filebase.orig
		fi
	fi
done
echo '] done.'

#  apply patches
echo -n 'Patching files ['
for i in ${DIR}/diff-${VERSION}/*.patch; do
	# skip dirs
	[ -d $i ] && continue
	echo -n p
	writeloc=${i##$DIR\/diff-${VERSION}\/}
	writeloc=${writeloc%.patch}
	writeloc=${writeloc//^/\/} 
	patch --silent -f -p0 -o $ROOTDIR/$writeloc $ROOTDIR/$writeloc.orig $i
done
echo '] done.'

#  copy files
echo -n 'Copying files ['
for i in ${DIR}/diff-${VERSION}/*.copy; do
	# skip dirs
	[ -d $i ] && continue
	echo -n c
	writeloc=${i##$DIR\/diff-${VERSION}\/}
	writeloc=${writeloc%.copy}
	writeloc=${writeloc//^/\/} 
	cp $i $ROOTDIR/$writeloc
done
echo '] done.'

http://www.joekamphaus.net





More information about the Speakup mailing list