target/sdk: generate a Config.in file with the settings of the build that the SDK...
authorFelix Fietkau <nbd@openwrt.org>
Mon, 10 Mar 2014 18:58:49 +0000 (18:58 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 10 Mar 2014 18:58:49 +0000 (18:58 +0000)
This allows make oldconfig/menuconfig to run

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 39864

target/sdk/Makefile
target/sdk/convert-config.pl [new file with mode: 0755]
target/sdk/files/Config.in

index 2318f4d09b396dc7bbabd759be56e61658061b4e..376aef8eb0f5430e968dfbe763cf04d82e9440ba 100644 (file)
@@ -64,6 +64,7 @@ $(BIN_DIR)/$(SDK_NAME).tar.bz2: clean
        rm -rf \
                $(SDK_BUILD_DIR)/target/linux/*/files* \
                $(SDK_BUILD_DIR)/target/linux/*/patches*
+       ./convert-config.pl $(TOPDIR)/.config > $(SDK_BUILD_DIR)/Config-build.in
        $(CP) -L \
                $(TOPDIR)/LICENSE \
                $(TOPDIR)/rules.mk \
diff --git a/target/sdk/convert-config.pl b/target/sdk/convert-config.pl
new file mode 100755 (executable)
index 0000000..9fd2c36
--- /dev/null
@@ -0,0 +1,31 @@
+#!/usr/bin/env perl
+use strict;
+
+while (<>) {
+       chomp;
+       next unless /^CONFIG_([^=]+)=(.*)$/;
+
+       my $var = $1;
+       my $val = $2;
+       my $type;
+
+       if ($val eq 'y') {
+               $type = "bool";
+       } elsif ($val eq 'm') {
+               $type = "tristate";
+       } elsif ($val =~ /^".*"$/) {
+               $type = "string";
+       } elsif ($val =~ /^\d+$/) {
+               $type = "int";
+       } else {
+               warn "WARNING: no type found for symbol CONFIG_$var=$val\n";
+               next;
+       }
+
+       print <<EOF;
+config $var
+       $type
+       default $val
+
+EOF
+}
index 214466b5b27df881d3699081a9682f2838f70266..4a2f12e74fc4e21c50f33813e326a6a9a6427753 100644 (file)
@@ -1 +1,2 @@
+source "Config-build.in"
 source "tmp/.config-package.in"