X-Git-Url: https://git.archive.openwrt.org/?a=blobdiff_plain;f=scripts%2Fmetadata.pl;h=aa66e53094c952617952d74eed2be20178bfe48e;hb=d9d6100edd9b4229398ffc177bd3aff826308377;hp=3d9d68a654b4fb5b8f3c4c2745ca42dd3d3ea2e2;hpb=e83c4ff72150271fc703f362b0b6acee11d51d8c;p=openwrt.git diff --git a/scripts/metadata.pl b/scripts/metadata.pl index 3d9d68a654..aa66e53094 100755 --- a/scripts/metadata.pl +++ b/scripts/metadata.pl @@ -155,6 +155,7 @@ sub target_config_features(@) { /display/ and $ret .= "\tselect DISPLAY_SUPPORT\n"; /gpio/ and $ret .= "\tselect GPIO_SUPPORT\n"; /pci/ and $ret .= "\tselect PCI_SUPPORT\n"; + /pcie/ and $ret .= "\tselect PCIE_SUPPORT\n"; /usb/ and $ret .= "\tselect USB_SUPPORT\n"; /pcmcia/ and $ret .= "\tselect PCMCIA_SUPPORT\n"; /squashfs/ and $ret .= "\tselect USES_SQUASHFS\n"; @@ -162,7 +163,11 @@ sub target_config_features(@) { /ext2/ and $ret .= "\tselect USES_EXT2\n"; /tgz/ and $ret .= "\tselect USES_TGZ\n"; /cpiogz/ and $ret .= "\tselect USES_CPIOGZ\n"; + /ubifs/ and $ret .= "\tselect USES_UBIFS\n"; /fpu/ and $ret .= "\tselect HAS_FPU\n"; + /ramdisk/ and $ret .= "\tselect USES_INITRAMFS\n"; + /powerpc64/ and $ret .= "\tselect powerpc64\n"; + /nommu/ and $ret .= "\tselect NOMMU\n"; } return $ret; } @@ -221,25 +226,26 @@ EOF } if (@{$target->{subtargets}} > 0) { $confstr .= "\tselect HAS_SUBTARGETS\n"; - } else { + } + + if ($target->{arch} =~ /\w/) { $confstr .= "\tselect $target->{arch}\n"; - foreach my $dep (@{$target->{depends}}) { - my $mode = "depends"; - my $flags; - my $name; - - $dep =~ /^([@\+\-]+)(.+)$/; - $flags = $1; - $name = $2; - - next if $name =~ /:/; - $flags =~ /-/ and $mode = "deselect"; - $flags =~ /\+/ and $mode = "select"; - $flags =~ /@/ and $confstr .= "\t$mode $name\n"; - } - $confstr .= $features; } + foreach my $dep (@{$target->{depends}}) { + my $mode = "depends"; + my $flags; + my $name; + + $dep =~ /^([@\+\-]+)(.+)$/; + $flags = $1; + $name = $2; + next if $name =~ /:/; + $flags =~ /-/ and $mode = "deselect"; + $flags =~ /\+/ and $mode = "select"; + $flags =~ /@/ and $confstr .= "\t$mode $name\n"; + } + $confstr .= $features; $confstr .= "$help\n\n"; print $confstr; } @@ -411,15 +417,15 @@ sub mconf_depends { my @depends = @$depends; foreach my $depend (@depends) { my $m = "depends"; - $depend =~ s/^([@\+]+)//; - my $flags = $1; + my $flags = ""; + $depend =~ s/^([@\+]+)// and $flags = $1; my $vdep; - my $condition; + my $condition = $parent_condition; if ($depend =~ /^(.+):(.+)$/) { if ($1 ne "PACKAGE_$pkgname") { - if ($parent_condition) { - $condition = "$parent_condition && $1"; + if ($condition) { + $condition = "$condition && $1"; } else { $condition = $1; } @@ -529,6 +535,31 @@ sub print_package_config_category($) { undef $category{$cat}; } +sub print_package_features() { + keys %features > 0 or return; + print "menu \"Package features\"\n"; + foreach my $n (keys %features) { + my @features = sort { $b->{priority} <=> $a->{priority} or $a->{title} cmp $b->{title} } @{$features{$n}}; + print <{target_title}" + default FEATURE_$features[0]->{name} +EOF + + foreach my $feature (@features) { + print <{name} + bool "$feature->{title}" +EOF + $feature->{description} =~ /\w/ and do { + print "\t\thelp\n".$feature->{description}."\n"; + }; + } + print "endchoice\n" + } + print "endmenu\n\n"; +} + sub gen_package_config() { parse_package_metadata($ARGV[0]) or exit 1; print "menuconfig UCI_PRECONFIG\n\tbool \"Image configuration\"\n" if %preconfig; @@ -545,6 +576,7 @@ sub gen_package_config() { EOF } } + print_package_features(); print_package_config_category 'Base system'; foreach my $cat (keys %category) { print_package_config_category $cat; @@ -590,6 +622,9 @@ sub gen_package_mk() { if ($config) { $pkg->{buildonly} and $config = ""; print "package-$config += $pkg->{subdir}$pkg->{src}\n"; + if ($pkg->{variant}) { + print "\$(curdir)/$pkg->{subdir}$pkg->{src}/variants += \$(if $config,$pkg->{variant})\n" + } $pkg->{prereq} and print "prereq-$config += $pkg->{subdir}$pkg->{src}\n"; } @@ -675,23 +710,24 @@ sub gen_package_mk() { foreach my $dep (@deps) { $pkg_dep = $package{$deps}; if (defined $pkg_dep->{src}) { - ($pkg->{src} ne $pkg_dep->{src}) and $idx = $pkg_dep->{subdir}.$pkg_dep->{src}; + ($pkg->{src} ne $pkg_dep->{src}.$suffix) and $idx = $pkg_dep->{subdir}.$pkg_dep->{src}; } elsif (defined($srcpackage{$dep})) { $idx = $subdir{$dep}.$dep; } + $idx .= $suffix; undef $idx if $idx =~ /^(kernel)|(base-files)$/; if ($idx) { my $depline; - next if $pkg->{src} eq $pkg_dep->{src}; + next if $pkg->{src} eq $pkg_dep->{src}.$suffix; next if $dep{$pkg->{src}."->".$idx}; next if $dep{$pkg->{src}."->($dep)".$idx} and $pkg_dep->{vdepends}; my $depstr; if ($pkg_dep->{vdepends}) { - $depstr = "\$(if \$(CONFIG_PACKAGE_$dep),\$(curdir)/$idx$suffix/compile)"; + $depstr = "\$(if \$(CONFIG_PACKAGE_$dep),\$(curdir)/$idx/compile)"; $dep{$pkg->{src}."->($dep)".$idx} = 1; } else { - $depstr = "\$(curdir)/$idx$suffix/compile"; + $depstr = "\$(curdir)/$idx/compile"; $dep{$pkg->{src}."->".$idx} = 1; } $depline = get_conditional_dep($condition, $depstr);