summaryrefslogtreecommitdiff
path: root/v4l
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2006-05-07 18:29:49 -0400
committerMichael Krufky <mkrufky@linuxtv.org>2006-05-07 18:29:49 -0400
commit27e0a2e8659f2e3e37b7781c322647040d3566c3 (patch)
tree65e55b7fafb8f554522129d2bb4d8029ed71912f /v4l
parentb6e187a6550c6685b2e52b2d37053ab3dfe7c2cd (diff)
downloadmediapointer-dvb-s2-27e0a2e8659f2e3e37b7781c322647040d3566c3.tar.gz
mediapointer-dvb-s2-27e0a2e8659f2e3e37b7781c322647040d3566c3.tar.bz2
fix ability to pass compile-time build options when building from the hg repo
From: Michael Krufky <mkrufky@linuxtv.org> When building in-kernel, compile-time build options are passed into the compiler using '#include <linux/config.h>' . This file #include's <linux/autoconf.h> , which is created on the fly by the kbuild system. However, this does not work correctly when building from the mercurial repository, since the kernel is built indepentently of v4l/.myconfig This creates a "config-compat.h", which will be #include'd by compat.h and will emulate <linux/config.h> for the local build. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Diffstat (limited to 'v4l')
-rw-r--r--v4l/Makefile20
-rw-r--r--v4l/compat.h1
-rwxr-xr-xv4l/scripts/makelinks.sh2
3 files changed, 21 insertions, 2 deletions
diff --git a/v4l/Makefile b/v4l/Makefile
index 58b160397..3ba4603f3 100644
--- a/v4l/Makefile
+++ b/v4l/Makefile
@@ -25,7 +25,7 @@ endif
#################################################
# default compilation rule
-default:: Makefile.media links .version
+default:: config-compat.h Makefile.media links .version
echo srcdir $(SRCDIR)
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) $(MYCFLAGS) modules
@@ -188,6 +188,22 @@ links::
@find ../linux/drivers/media -name '*.[ch]' -type f -exec ln -sf '{}' . \;
@find ../linux/sound -name '*.[ch]' -type f -exec ln -sf '{}' . \;
+config-compat.h:: .myconfig
+ @echo \#ifndef __CONFIG_COMPAT_H__ > config-compat.h
+ @echo \#define __CONFIG_COMPAT_H__ >> config-compat.h
+ @echo >> config-compat.h
+ @echo \#include \<linux\/config\.h\> >> config-compat.h
+ @echo >> config-compat.h
+ @grep "CONFIG\_" .myconfig | grep -v "\:\= n" | \
+ sed s/"CONFIG\_"/"\#undef CONFIG\_"/1 | \
+ sed s/"\:\= ."/""/1 >> config-compat.h >> config-compat.h
+ @echo >> config-compat.h
+ @grep "CONFIG\_" .myconfig | grep -v "\:\= n" | \
+ sed s/"CONFIG\_"/"\#define CONFIG\_"/1 | \
+ sed s/"\:\="/""/1 >> config-compat.h >> config-compat.h
+ @echo >> config-compat.h
+ @echo \#endif >> config-compat.h
+
kernel-links makelinks::
cd ..; v4l/scripts/makelinks.sh $(KDIR)
@@ -204,7 +220,7 @@ clean::
@find . -name '*.c' -type l -exec rm '{}' \;
@find . -name '*.h' -type l -exec rm '{}' \;
-rm -f *~ *.o *.ko .*.o.cmd .*.ko.cmd *.mod.c av7110_firm.h fdump \
- ivtv-svnversion.h
+ ivtv-svnversion.h config-compat.h
distclean:: clean
-rm -f .version .*.o.flags .*.o.d Makefile.media \
diff --git a/v4l/compat.h b/v4l/compat.h
index 0bcb238fb..b9138c7be 100644
--- a/v4l/compat.h
+++ b/v4l/compat.h
@@ -10,6 +10,7 @@
#include <linux/version.h>
#include <linux/utsname.h>
#include <linux/sched.h>
+#include "config-compat.h"
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,18)
# define minor(x) MINOR(x)
diff --git a/v4l/scripts/makelinks.sh b/v4l/scripts/makelinks.sh
index a66989771..03fd48849 100755
--- a/v4l/scripts/makelinks.sh
+++ b/v4l/scripts/makelinks.sh
@@ -39,10 +39,12 @@ 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 ..