tools/build-watch.pl
author Norm Jacobs <Norm.Jacobs@Oracle.COM>
Wed, 23 Feb 2011 10:37:11 -0800
changeset 99 c15c9099bb44
parent 32 280a7444e782
child 3770 ca450a806cc1
permissions -rwxr-xr-x
6841644 OpenSolaris Python should support gdbm 6991811 Migrate Mercurial (Hg) to Python 2.6 7009592 PyOpenSSL should be updated from 0.8 to 0.11 7016735 move mercurial from sfw to userland 7018363 Userland LD_OPTIONS should include non-executable data mapfiles as well 7019410 python 2.6 should move to userland 7020772 userland build should provide more macros for common flags 7021204 userland runpath checking should relax slightly.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     1
#!/usr/perl5/bin/perl
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     2
#
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     3
# CDDL HEADER START
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     4
#
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     5
# The contents of this file are subject to the terms of the
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     6
# Common Development and Distribution License (the "License").
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     7
# You may not use this file except in compliance with the License.
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     8
#
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     9
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    10
# or http://www.opensolaris.org/os/licensing.
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    11
# See the License for the specific language governing permissions
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    12
# and limitations under the License.
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    13
#
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    14
# When distributing Covered Code, include this CDDL HEADER in each
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    15
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    16
# If applicable, add the following below this CDDL HEADER, with the
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    17
# fields enclosed by brackets "[]" replaced with your own identifying
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    18
# information: Portions Copyright [yyyy] [name of copyright owner]
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    19
#
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    20
# CDDL HEADER END
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    21
#
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    22
# Copyright (c) 2010, Oracle and/or it's affiliates.  All rights reserved.
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    23
#
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    24
#
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    25
# build-watch.pl - a simple utility to watch a process and it's children under
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    26
# 		   dtrace and process the results for dependency information.
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    27
#
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    28
# Ex:
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    29
#	$ export WS_TOP=/top/of/your/workspace
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    30
#	$ cd $(WS_TOP)/components/{component}
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    31
#	$ $(WS_TOP)/tools/build-watch.pl -c "gmake install"
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    32
#
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    33
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    34
use File::Temp qw/tempfile/;
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    35
use Getopt::Long;
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    36
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    37
my $verbose = 0;
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    38
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    39
my @ignore = (
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    40
	'^[^/\.].*',		# ignore paths that don't begin with / or .	
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    41
	'^/dev/',		# ignore devices
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    42
	'^/etc/',		# ignore config files
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    43
	'^/proc/',		# ignore /proc
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    44
	'^/tmp/',		# ignore temp files
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    45
	'^/var/',		# ignore more temp/volatile files
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    46
	'^/usr/lib/locale/',	# ignore locale support
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    47
	'^/usr/share/lib/make/',	# ignore make bits
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    48
	'^/usr/share/lib/zoneinfo/',	# ignore timezone info
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    49
	'/SUNWspro/',		# ignore compiler bits
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    50
	'/sunstudio12.1/',	# ignore more compiler bits
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    51
	'^/ws/',		# nothing in /ws can be interesting
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    52
	'^\.[/\.]{0,1}$'	# ignore ., .., and ./
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    53
);
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    54
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    55
sub match
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    56
{
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    57
	local($string, @expressions) = @_;
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    58
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    59
	foreach (@expressions) {
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    60
		($string =~ m{$_}) && return (1);
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    61
	}
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    62
	return (0);
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    63
}
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    64
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    65
sub process_dtrace_results
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    66
{
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    67
	local ($filename) = @_;
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    68
	my (%tools, %files, $fh) = ();
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    69
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    70
	open($fh, "<$filename") || die "open($filename): $!\n";
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    71
	while (<$fh>) {
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    72
		if (/^TOOL:\s+(\S+) = (\S+)$/) {
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    73
			$tools{$2} = $1;
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    74
		} elsif ((/^FILE:\s+(\S+)\s*$/) && (match($1, @ignore) == 0) &&
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    75
			 (-e $1)) {
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    76
			$files{$1} = $1;
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    77
		}
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    78
	}
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    79
	close($fh);
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    80
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    81
	return (\%tools, \%files);
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    82
}
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    83
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    84
sub generate_package_requirements
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    85
{
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    86
	local (*tools, *files) = @_;
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    87
	my ($count, %pkgs, @search_strings, $search_string) = (0);
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    88
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    89
	# create a set of search strings to query the package DB
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    90
	foreach (sort (keys %tools, keys %files)) {
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    91
		if ($count++ % 100 == 0) {
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    92
			defined($search_string) && \
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    93
				push(@search_strings, $search_string);
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    94
			$search_string = $_;
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    95
		} else {
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    96
			$search_string .= " OR $_";
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    97
		}
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    98
	}
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    99
	push(@search_strings, $search_string);
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   100
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   101
	# walk through the search strings and query the package DB
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   102
	foreach (@search_strings) {
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   103
		my $IFH;
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   104
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   105
		open($IFH, "pkg search -l -H -o path,pkg.name '$_'|");
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   106
		while (<$IFH>) {
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   107
           		(/^(\S+)\s+(\S+)$/) && ($pkgs{$1} = $2);
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   108
		}
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   109
		close($IFH);
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   110
	}
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   111
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   112
	return (\%pkgs);
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   113
}
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   114
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   115
#
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   116
# Main execution begins here
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   117
#
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   118
GetOptions("c|command=s" => \$cmd, "i|input-file=s" => \@file,
32
280a7444e782 automatically generate intercomponent dependencies for build ordering
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 17
diff changeset
   119
	   "p|pkg" => \$pkg_flag, "v|verbose" => \$verbose);
10
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   120
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   121
if (defined($cmd)) {
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   122
	$file = (tempfile(UNLINK => 1))[1];
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   123
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   124
	if (!defined($ENV{'WS_TOP'})) {
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   125
		print("WS_TOP must be set in the calling environment\n");
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   126
		exit(1);
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   127
	}
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   128
	($verbose == 1) && print("*** Executing '$cmd' under dtrace...\n");
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   129
	system($ENV{'WS_TOP'}."/tools/build-watch.d", "-o", $file, "-c", $cmd);
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   130
}
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   131
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   132
($verbose == 1) && printf("*** Processing results...\n");
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   133
my ($tools, $files) = process_dtrace_results($file);
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   134
32
280a7444e782 automatically generate intercomponent dependencies for build ordering
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 17
diff changeset
   135
if (defined($pkg_flag)) {
280a7444e782 automatically generate intercomponent dependencies for build ordering
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 17
diff changeset
   136
	($verbose == 1) && printf("*** Generating package requirements...\n");
280a7444e782 automatically generate intercomponent dependencies for build ordering
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 17
diff changeset
   137
	my ($pkgs) = generate_package_requirements($tools, $files);
280a7444e782 automatically generate intercomponent dependencies for build ordering
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 17
diff changeset
   138
}
10
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   139
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   140
if (defined($tools)) {
17
56b936d4786f Change dependency output to construct Makefile macros
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 10
diff changeset
   141
	print "\n";
56b936d4786f Change dependency output to construct Makefile macros
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 10
diff changeset
   142
	print "REQUIRED_TOOL +=\t$_\n" for (sort keys %$tools);
10
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   143
}
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   144
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   145
if (defined($files)) {
17
56b936d4786f Change dependency output to construct Makefile macros
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 10
diff changeset
   146
	print "\n";
56b936d4786f Change dependency output to construct Makefile macros
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 10
diff changeset
   147
	print "REQUIRED_FILE +=\t$_\n" for (sort keys %$files);
10
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   148
}
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   149
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   150
if (defined($pkgs)) {
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   151
	@unique{values %$pkgs} = ();
17
56b936d4786f Change dependency output to construct Makefile macros
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 10
diff changeset
   152
	print "\n";
56b936d4786f Change dependency output to construct Makefile macros
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 10
diff changeset
   153
	print "REQUIRED_PKG +=\t$_\n" for (sort keys %unique);
10
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   154
}
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   155
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   156
exit(0);