diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2006-05-09 09:41:40 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:05:45 -0500 |
commit | 2895f28c4c03a7527b3d5d5b196c47f28c5a4463 (patch) | |
tree | d70e2347fce0b993cb448b0cd36e27f4f99840a1 /source4 | |
parent | 5196640c2c81fed284d4fee8ce13ebf1da467cdd (diff) | |
download | samba-2895f28c4c03a7527b3d5d5b196c47f28c5a4463.tar.gz samba-2895f28c4c03a7527b3d5d5b196c47f28c5a4463.tar.bz2 samba-2895f28c4c03a7527b3d5d5b196c47f28c5a4463.zip |
r15521: Take an optional subsystem name to generate a dependency graph for
just that subsystem
(This used to be commit 3fae92eef5d2f591dd40c4c07e20baa1c4a33211)
Diffstat (limited to 'source4')
-rwxr-xr-x | source4/build/smb_build/dot.pl | 40 |
1 files changed, 34 insertions, 6 deletions
diff --git a/source4/build/smb_build/dot.pl b/source4/build/smb_build/dot.pl index 898d2cd0ff..c8203d4cdd 100755 --- a/source4/build/smb_build/dot.pl +++ b/source4/build/smb_build/dot.pl @@ -7,12 +7,24 @@ use strict; use lib 'build'; use smb_build::config_mk; -sub generate($) +my $subsys = shift @ARGV; + +sub contains($$) +{ + my ($haystack,$needle) = @_; + foreach (@$haystack) { + return 1 if ($_ eq $needle); + } + return 0; +} + +sub generate($$$) { - my $depend = shift; - my $res = "digraph samba4 {\n"; + my ($depend,$only,$name) = @_; + my $res = "digraph $name {\n"; foreach my $part (values %{$depend}) { + next if (defined($only) and not contains($only,$part->{NAME})); foreach my $elem (@{$part->{PUBLIC_DEPENDENCIES}}, @{$part->{PRIVATE_DEPENDENCIES}}) { $res .= "\t\"$part->{NAME}\" -> \"$elem\";\n"; @@ -25,9 +37,25 @@ sub generate($) my $INPUT = {}; smb_build::config_mk::run_config_mk($INPUT, '.', '.', "main.mk"); -print __FILE__.": creating samba4-deps.dot\n"; -open DOTTY, ">samba4-deps.dot"; -print DOTTY generate($INPUT); +my $name = "samba4"; + +my $only; +if (defined($subsys)) { + my $DEPEND = smb_build::input::check($INPUT, \%config::enabled, + "STATIC_LIBRARY", "SHARED_LIBRARY", "SHARED_LIBRARY"); + + die("No such subsystem $subsys") unless (defined($DEPEND->{$subsys})); + + $only = $DEPEND->{$subsys}->{UNIQUE_DEPENDENCIES_ALL}; + push (@$only, "$subsys"); + + $name = $subsys; +} + +my $fname = "$name-deps.dot"; +print __FILE__.": creating $fname\n"; +open DOTTY, ">$fname"; +print DOTTY generate($INPUT, $only, $name); close DOTTY; 1; |