From 74e1ed0781b35cfd53baba71c84dfbf6c59c5403 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Wed, 21 Jun 2006 10:04:08 -0300 Subject: Fixes circular dependencies at building system From: Mauro Carvalho Chehab There were a circular dependency at scripts/make_makefile.pl that were affecting mostly building with GNU make 3.81. Also, scripts/make_noconfig.pl is, in fact, building .myconfig file, so, better to name it as make_myconfig.pl. Signed-off-by: Mauro Carvalho Chehab --- v4l/Makefile | 14 ++++++----- v4l/scripts/make_makefile.pl | 2 +- v4l/scripts/make_myconfig.pl | 58 ++++++++++++++++++++++++++++++++++++++++++++ v4l/scripts/make_noconfig.pl | 58 -------------------------------------------- 4 files changed, 67 insertions(+), 65 deletions(-) create mode 100755 v4l/scripts/make_myconfig.pl delete mode 100755 v4l/scripts/make_noconfig.pl diff --git a/v4l/Makefile b/v4l/Makefile index d20e68d4e..27a79a181 100644 --- a/v4l/Makefile +++ b/v4l/Makefile @@ -180,7 +180,9 @@ 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 +config-compat.h:: + scripts/make_myconfig.pl + @echo \#ifndef __CONFIG_COMPAT_H__ > config-compat.h @echo \#define __CONFIG_COMPAT_H__ >> config-compat.h @echo >> config-compat.h @@ -253,26 +255,26 @@ LXDIALOG := $(KDIR)/scripts/$(LXDIALOG_DIR)lxdialog/lxdialog xconfig:: links .version $(QCONF) ./scripts/make_kconfig.pl $(QCONF) Kconfig - ./scripts/make_noconfig.pl + ./scripts/make_myconfig.pl gconfig:: links .version $(GCONF) ./scripts/make_kconfig.pl $(QCONF) Kconfig - ./scripts/make_noconfig.pl + ./scripts/make_myconfig.pl config:: links .version $(CONF) ./scripts/make_kconfig.pl $(CONF) Kconfig - ./scripts/make_noconfig.pl + ./scripts/make_myconfig.pl menuconfig:: links .version $(MCONF) lxdialog ./scripts/make_kconfig.pl $(MCONF) Kconfig - ./scripts/make_noconfig.pl + ./scripts/make_myconfig.pl allyesconfig allmodconfig:: links .version ./scripts/make_kconfig.pl 1 - ./scripts/make_noconfig.pl + ./scripts/make_myconfig.pl # rule to build kernel conf programs KMAKEVARS := config-targets=1 mixed-targets=0 dot-config=0 diff --git a/v4l/scripts/make_makefile.pl b/v4l/scripts/make_makefile.pl index bcfb3764f..f0d9aef7f 100755 --- a/v4l/scripts/make_makefile.pl +++ b/v4l/scripts/make_makefile.pl @@ -181,5 +181,5 @@ if (open IN,"Makefile.media") { if (open IN,".myconfig") { close IN; } else { - system "make allmodconfig"; + system "./scripts/make_kconfig.pl 1"; } diff --git a/v4l/scripts/make_myconfig.pl b/v4l/scripts/make_myconfig.pl new file mode 100755 index 000000000..7323f419c --- /dev/null +++ b/v4l/scripts/make_myconfig.pl @@ -0,0 +1,58 @@ +#!/usr/bin/perl + +# The purpose of this script is to produce a file named '.myconfig', in +# the same style as the '.config' file. Except .myconfig has disabled +# options explicitly set to 'n' rather than just omitted. This is to +# make sure they override any corresponding options that may be turned on +# in the Kernel's config files. +# The .myconfig file is what will be included in the v4l-dvb Makefile +# to control which drivers are built. + +my %config = (); +my %allconfig = (); + +open IN,".config"; +while () { + if (m/\s*(\w+)=\s*(\S*)/) { +#printf "%s=%s\n",$1,$2; + $config { $1 } = $2; + } +} +close IN; + +# Build table of _all_ bool and tristate config variables +my $key = 0; +open IN,"Kconfig"; +while () { + if (/^config\s+(\w+)\s*$/) { + $key == 0 or die "Couldn't find type of config '$key'"; + $key = "CONFIG_$1"; + } elsif (/^\s+bool(ean)?\s/) { + $allconfig{$key} = 'bool'; + $key = 0; + } elsif (/^\s+tristate\s/) { + $allconfig{$key} = 'tristate'; + $key = 0; + } elsif (/^\s+(int|hex|string)\s/) { + $allconfig{$key} = 'data'; + $key = 0; + } +} +close IN; + +exists $allconfig{0} and die "Unable to correctly parse Kconfig file"; + +# Produce output for including in a Makefile +# Explicitly set bool/tri options that didn't appear in .config to n +# 'data' options are only output if they appeared in .config +open OUT,">.myconfig"; +while ( my ($key, $value) = each(%allconfig) ) { + if ($value eq 'data') { + next unless (exists $config{$key}); + $value = $config{$key}; + } else { + $value = exists $config{$key} ? $config{$key} : 'n'; + } + printf OUT "%-44s := %s\n",$key,$value; +} +close OUT; diff --git a/v4l/scripts/make_noconfig.pl b/v4l/scripts/make_noconfig.pl deleted file mode 100755 index 7323f419c..000000000 --- a/v4l/scripts/make_noconfig.pl +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/perl - -# The purpose of this script is to produce a file named '.myconfig', in -# the same style as the '.config' file. Except .myconfig has disabled -# options explicitly set to 'n' rather than just omitted. This is to -# make sure they override any corresponding options that may be turned on -# in the Kernel's config files. -# The .myconfig file is what will be included in the v4l-dvb Makefile -# to control which drivers are built. - -my %config = (); -my %allconfig = (); - -open IN,".config"; -while () { - if (m/\s*(\w+)=\s*(\S*)/) { -#printf "%s=%s\n",$1,$2; - $config { $1 } = $2; - } -} -close IN; - -# Build table of _all_ bool and tristate config variables -my $key = 0; -open IN,"Kconfig"; -while () { - if (/^config\s+(\w+)\s*$/) { - $key == 0 or die "Couldn't find type of config '$key'"; - $key = "CONFIG_$1"; - } elsif (/^\s+bool(ean)?\s/) { - $allconfig{$key} = 'bool'; - $key = 0; - } elsif (/^\s+tristate\s/) { - $allconfig{$key} = 'tristate'; - $key = 0; - } elsif (/^\s+(int|hex|string)\s/) { - $allconfig{$key} = 'data'; - $key = 0; - } -} -close IN; - -exists $allconfig{0} and die "Unable to correctly parse Kconfig file"; - -# Produce output for including in a Makefile -# Explicitly set bool/tri options that didn't appear in .config to n -# 'data' options are only output if they appeared in .config -open OUT,">.myconfig"; -while ( my ($key, $value) = each(%allconfig) ) { - if ($value eq 'data') { - next unless (exists $config{$key}); - $value = $config{$key}; - } else { - $value = exists $config{$key} ? $config{$key} : 'n'; - } - printf OUT "%-44s := %s\n",$key,$value; -} -close OUT; -- cgit v1.2.3