From 4f574fa6fb96098e56b0eac1649eebd186dfd7a4 Mon Sep 17 00:00:00 2001 From: Trent Piepho Date: Mon, 4 Jun 2007 16:18:51 -0700 Subject: build: fix make kernel-links From: Trent Piepho The out of tree v4l-dvb build system uses slightly different compiler flags than the kernel does. This caused problems when trying to compile the out of tree version of the source symlinked into the kernel tree. The workaround is to have the script that creates the symlinks also create a new file called drivers/media/Kbuild, which the kernel build system will use in preference to divers/media/Makefile. The new Kbuild file exports the necessary EXTRA_CFLAGS to make building work and then includes the real drivers/media/Makefile. The dvb Makefiles were changed in a previous patch from 'EXTRA_CFLAGS=' to 'EXTRA_CFLAGS+=' so they wouldn't replace the new EXTRA_CFLAGS. The symlink creating script is also re-written to make the symlinks faster with less duplication of commands and avoid some unnecessary links. Signed-off-by: Trent Piepho --- v4l/scripts/makelinks.sh | 45 ++++++++++++++------------------------------- 1 file changed, 14 insertions(+), 31 deletions(-) (limited to 'v4l/scripts') diff --git a/v4l/scripts/makelinks.sh b/v4l/scripts/makelinks.sh index 9ee780aba..ee83e33ec 100755 --- a/v4l/scripts/makelinks.sh +++ b/v4l/scripts/makelinks.sh @@ -12,39 +12,22 @@ echo "patching $1..." cd linux PWD=`pwd` +FINDDIR="-name CVS -prune -o -type d" +FINDFILE="-name CVS -prune -o -type f -not -name .cvsignore\ + -not -name '*.rej' -not -name '*.orig'" -for x in `find drivers -type d | grep -v CVS` ; do - mkdir -p -v $1/$x +for dir in drivers include Documentation; do + find $dir $FINDDIR -exec mkdir -p -v $1/{} \; + find $dir $FINDFILE -exec ln -f -s $PWD/{} $1/{} \; done -for x in `find Documentation -type d | grep -v CVS` ; do - mkdir -p -v $1/$x +for dir in drivers/media include; do + find $dir $FINDDIR -exec ln -f -s $PWD/../v4l/compat.h $1/{} \; \ + -exec touch $1/{}/config-compat.h \; done -for x in `find include -type d | grep -v CVS` ; do - mkdir -p -v $1/$x -done - -for x in `find Documentation -type f | grep -v CVS | grep -v .cvsignore` ; do - ln -f -s $PWD/$x $1/$x -done - -for x in `find drivers -type f | grep -v CVS | grep -v .cvsignore` ; do - ln -f -s $PWD/$x $1/$x -done - -for x in `find include -type f | grep -v CVS | grep -v .cvsignore` ; do - ln -f -s $PWD/$x $1/$x -done - -for x in `find include -type d | grep -v CVS` ; do - ln -f -s $PWD/../v4l/compat.h $1/$x/compat.h - touch $1/$x/config-compat.h -done - -for x in `find drivers/media -type d | grep -v CVS` ; do - ln -f -s $PWD/../v4l/compat.h $1/$x/compat.h - touch $1/$x/config-compat.h -done - -cd .. +cat > $1/drivers/media/Kbuild <