metadata: do not emit feature flag selects for targets which have subtargets - fixes...
[openwrt/svn-archive/archive.git] / scripts / metadata.pl
index 2e90257270b8c3e21a10ffebe6d8fae81a64b55d..3de408798004b6df53d40daf4c77c266475c89b2 100755 (executable)
@@ -163,11 +163,12 @@ sub target_config_features(@) {
                /pcmcia/ and $ret .= "\tselect PCMCIA_SUPPORT\n";
                /squashfs/ and $ret .= "\tselect USES_SQUASHFS\n";
                /jffs2/ and $ret .= "\tselect USES_JFFS2\n";
                /pcmcia/ and $ret .= "\tselect PCMCIA_SUPPORT\n";
                /squashfs/ and $ret .= "\tselect USES_SQUASHFS\n";
                /jffs2/ and $ret .= "\tselect USES_JFFS2\n";
-               /ext2/ and $ret .= "\tselect USES_EXT2\n";
+               /ext4/ and $ret .= "\tselect USES_EXT4\n";
                /targz/ and $ret .= "\tselect USES_TARGZ\n";
                /cpiogz/ and $ret .= "\tselect USES_CPIOGZ\n";
                /ubifs/ and $ret .= "\tselect USES_UBIFS\n";
                /fpu/ and $ret .= "\tselect HAS_FPU\n";
                /targz/ and $ret .= "\tselect USES_TARGZ\n";
                /cpiogz/ and $ret .= "\tselect USES_CPIOGZ\n";
                /ubifs/ and $ret .= "\tselect USES_UBIFS\n";
                /fpu/ and $ret .= "\tselect HAS_FPU\n";
+               /spe_fpu/ and $ret .= "\tselect HAS_SPE_FPU\n";
                /ramdisk/ and $ret .= "\tselect USES_INITRAMFS\n";
                /powerpc64/ and $ret .= "\tselect powerpc64\n";
                /nommu/ and $ret .= "\tselect NOMMU\n";
                /ramdisk/ and $ret .= "\tselect USES_INITRAMFS\n";
                /powerpc64/ and $ret .= "\tselect powerpc64\n";
                /nommu/ and $ret .= "\tselect NOMMU\n";
@@ -196,9 +197,7 @@ sub print_target($) {
        my $target = shift;
        my $features = target_config_features(@{$target->{features}});
        my $help = $target->{desc};
        my $target = shift;
        my $features = target_config_features(@{$target->{features}});
        my $help = $target->{desc};
-       my $kernel = $target->{kernel};
        my $confstr;
        my $confstr;
-       $kernel =~ tr/./_/;
 
        chomp $features;
        $features .= "\n";
 
        chomp $features;
        $features .= "\n";
@@ -214,7 +213,6 @@ sub print_target($) {
        $confstr = <<EOF;
 config TARGET_$target->{conf}
        bool "$target->{name}"
        $confstr = <<EOF;
 config TARGET_$target->{conf}
        bool "$target->{name}"
-       select LINUX_$kernel
        select LINUX_$v
 EOF
        }
        select LINUX_$v
 EOF
        }
@@ -229,6 +227,8 @@ EOF
        }
        if (@{$target->{subtargets}} > 0) {
                $confstr .= "\tselect HAS_SUBTARGETS\n";
        }
        if (@{$target->{subtargets}} > 0) {
                $confstr .= "\tselect HAS_SUBTARGETS\n";
+       } else {
+               $confstr .= $features;
        }
 
        if ($target->{arch} =~ /\w/) {
        }
 
        if ($target->{arch} =~ /\w/) {
@@ -248,7 +248,6 @@ EOF
                $flags =~ /\+/ and $mode = "select";
                $flags =~ /@/ and $confstr .= "\t$mode $name\n";
        }
                $flags =~ /\+/ and $mode = "select";
                $flags =~ /@/ and $confstr .= "\t$mode $name\n";
        }
-       $confstr .= $features;
        $confstr .= "$help\n\n";
        print $confstr;
 }
        $confstr .= "$help\n\n";
        print $confstr;
 }
@@ -532,6 +531,7 @@ sub print_package_config_category($) {
                                print "\t\tdefault $default\n";
                        }
                        print mconf_depends($pkg->{name}, $pkg->{depends}, 0);
                                print "\t\tdefault $default\n";
                        }
                        print mconf_depends($pkg->{name}, $pkg->{depends}, 0);
+                       print mconf_depends($pkg->{name}, $pkg->{mdepends}, 0);
                        print "\t\thelp\n";
                        print $pkg->{description};
                        print "\n";
                        print "\t\thelp\n";
                        print $pkg->{description};
                        print "\n";
@@ -640,6 +640,9 @@ sub gen_package_mk() {
                        $pkg->{buildonly} and $config = "";
                        print "package-$config += $pkg->{subdir}$pkg->{src}\n";
                        if ($pkg->{variant}) {
                        $pkg->{buildonly} and $config = "";
                        print "package-$config += $pkg->{subdir}$pkg->{src}\n";
                        if ($pkg->{variant}) {
+                               if (!defined($done{$pkg->{src}})) {
+                                       print "\$(curdir)/$pkg->{subdir}$pkg->{src}/default-variant := $pkg->{variant}\n";
+                               }
                                print "\$(curdir)/$pkg->{subdir}$pkg->{src}/variants += \$(if $config,$pkg->{variant})\n"
                        }
                        $pkg->{prereq} and print "prereq-$config += $pkg->{subdir}$pkg->{src}\n";
                                print "\$(curdir)/$pkg->{subdir}$pkg->{src}/variants += \$(if $config,$pkg->{variant})\n"
                        }
                        $pkg->{prereq} and print "prereq-$config += $pkg->{subdir}$pkg->{src}\n";
@@ -737,7 +740,7 @@ sub gen_package_mk() {
                                if ($idx) {
                                        my $depline;
                                        next if $pkg->{src} eq $pkg_dep->{src}.$suffix;
                                if ($idx) {
                                        my $depline;
                                        next if $pkg->{src} eq $pkg_dep->{src}.$suffix;
-                                       next if $dep{$pkg->{src}."->".$idx};
+                                       next if $dep{$condition.":".$pkg->{src}."->".$idx};
                                        next if $dep{$pkg->{src}."->($dep)".$idx} and $pkg_dep->{vdepends};
                                        my $depstr;
 
                                        next if $dep{$pkg->{src}."->($dep)".$idx} and $pkg_dep->{vdepends};
                                        my $depstr;