tools/build-watch.pl
author Mike Sullivan <Mike.Sullivan@Oracle.COM>
Sat, 24 Sep 2016 09:29:15 -0700
changeset 6971 32152bc508b7
parent 5682 94c0ca64c022
permissions -rwxr-xr-x
Close of build 109.
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
#
5682
94c0ca64c022 15558602 TCL_LD_SEARCH_FLAGS is wrongly defined in tclConfig.sh
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 3770
diff changeset
    22
94c0ca64c022 15558602 TCL_LD_SEARCH_FLAGS is wrongly defined in tclConfig.sh
Shawn Walker-Salas <shawn.walker@oracle.com>
parents: 3770
diff changeset
    23
#
3770
ca450a806cc1 20440888 Userland python tools should migrate to 2.7
John Beck <John.Beck@Oracle.COM>
parents: 32
diff changeset
    24
# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
10
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    25
#
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    26
#
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    27
# 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
    28
# 		   dtrace and process the results for dependency information.
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    29
#
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    30
# Ex:
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    31
#	$ export WS_TOP=/top/of/your/workspace
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    32
#	$ cd $(WS_TOP)/components/{component}
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    33
#	$ $(WS_TOP)/tools/build-watch.pl -c "gmake install"
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    34
#
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    35
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    36
use File::Temp qw/tempfile/;
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    37
use Getopt::Long;
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 $verbose = 0;
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    40
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    41
my @ignore = (
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    42
	'^[^/\.].*',		# ignore paths that don't begin with / or .	
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    43
	'^/dev/',		# ignore devices
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    44
	'^/etc/',		# ignore config files
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    45
	'^/proc/',		# ignore /proc
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    46
	'^/tmp/',		# ignore temp files
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    47
	'^/var/',		# ignore more temp/volatile files
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    48
	'^/usr/lib/locale/',	# ignore locale support
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    49
	'^/usr/share/lib/make/',	# ignore make bits
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    50
	'^/usr/share/lib/zoneinfo/',	# ignore timezone info
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    51
	'/SUNWspro/',		# ignore compiler bits
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    52
	'/sunstudio12.1/',	# ignore more compiler bits
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    53
	'^/ws/',		# nothing in /ws can be interesting
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    54
	'^\.[/\.]{0,1}$'	# ignore ., .., and ./
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    55
);
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
sub match
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
	local($string, @expressions) = @_;
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    60
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    61
	foreach (@expressions) {
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    62
		($string =~ m{$_}) && return (1);
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
	return (0);
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    65
}
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
sub process_dtrace_results
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    68
{
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    69
	local ($filename) = @_;
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    70
	my (%tools, %files, $fh) = ();
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    71
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    72
	open($fh, "<$filename") || die "open($filename): $!\n";
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    73
	while (<$fh>) {
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    74
		if (/^TOOL:\s+(\S+) = (\S+)$/) {
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    75
			$tools{$2} = $1;
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    76
		} elsif ((/^FILE:\s+(\S+)\s*$/) && (match($1, @ignore) == 0) &&
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    77
			 (-e $1)) {
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    78
			$files{$1} = $1;
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    79
		}
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
	close($fh);
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
	return (\%tools, \%files);
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    84
}
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
sub generate_package_requirements
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    87
{
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    88
	local (*tools, *files) = @_;
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    89
	my ($count, %pkgs, @search_strings, $search_string) = (0);
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    90
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    91
	# 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
    92
	foreach (sort (keys %tools, keys %files)) {
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    93
		if ($count++ % 100 == 0) {
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    94
			defined($search_string) && \
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    95
				push(@search_strings, $search_string);
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    96
			$search_string = $_;
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    97
		} else {
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    98
			$search_string .= " OR $_";
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    99
		}
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
	push(@search_strings, $search_string);
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   102
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   103
	# walk through the search strings and query the package DB
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   104
	foreach (@search_strings) {
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   105
		my $IFH;
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   106
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   107
		open($IFH, "pkg search -l -H -o path,pkg.name '$_'|");
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   108
		while (<$IFH>) {
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   109
           		(/^(\S+)\s+(\S+)$/) && ($pkgs{$1} = $2);
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
		close($IFH);
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   112
	}
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
	return (\%pkgs);
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
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
# Main execution begins here
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   119
#
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   120
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
   121
	   "p|pkg" => \$pkg_flag, "v|verbose" => \$verbose);
10
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   122
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   123
if (defined($cmd)) {
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   124
	$file = (tempfile(UNLINK => 1))[1];
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   125
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   126
	if (!defined($ENV{'WS_TOP'})) {
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   127
		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
   128
		exit(1);
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   129
	}
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   130
	($verbose == 1) && print("*** Executing '$cmd' under dtrace...\n");
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   131
	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
   132
}
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   133
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   134
($verbose == 1) && printf("*** Processing results...\n");
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   135
my ($tools, $files) = process_dtrace_results($file);
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   136
32
280a7444e782 automatically generate intercomponent dependencies for build ordering
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 17
diff changeset
   137
if (defined($pkg_flag)) {
280a7444e782 automatically generate intercomponent dependencies for build ordering
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 17
diff changeset
   138
	($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
   139
	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
   140
}
10
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   141
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   142
if (defined($tools)) {
17
56b936d4786f Change dependency output to construct Makefile macros
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 10
diff changeset
   143
	print "\n";
56b936d4786f Change dependency output to construct Makefile macros
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 10
diff changeset
   144
	print "REQUIRED_TOOL +=\t$_\n" for (sort keys %$tools);
10
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   145
}
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   146
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   147
if (defined($files)) {
17
56b936d4786f Change dependency output to construct Makefile macros
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 10
diff changeset
   148
	print "\n";
56b936d4786f Change dependency output to construct Makefile macros
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 10
diff changeset
   149
	print "REQUIRED_FILE +=\t$_\n" for (sort keys %$files);
10
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   150
}
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   151
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   152
if (defined($pkgs)) {
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   153
	@unique{values %$pkgs} = ();
17
56b936d4786f Change dependency output to construct Makefile macros
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 10
diff changeset
   154
	print "\n";
56b936d4786f Change dependency output to construct Makefile macros
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 10
diff changeset
   155
	print "REQUIRED_PKG +=\t$_\n" for (sort keys %unique);
10
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   156
}
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   157
e3fdbd3632b6 dependency gathering tool(s)
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   158
exit(0);