summaryrefslogtreecommitdiff
path: root/source4/build/smb_build/summary.pm
blob: 09f5ff83ce9c4055e06ab12e82f339871a75b7ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Samba Build System
# - write out summary
#
#  Copyright (C) Jelmer Vernooij 2006
#  Released under the GNU GPL

package summary;
use smb_build::config;
use strict;

sub enabled($)
{
    my ($val) = @_;

    return (defined($val) && $val =~ m/yes|true/i);
}

sub showitem($$$)
{
	my ($output,$desc,$items) = @_;

	my @need = ();

	foreach (@$items) {
		push (@need, $_) if (enabled($config::enable{$_}));
	}

	print "Support for $desc: ";
	if ($#need >= 0) {
		print "no (install " . join(',',@need) . ")\n";
	} else {
		print "yes\n";
	}
}

sub showisexternal($$$)
{
	my ($output, $desc, $name) = @_;
	print "Using external $desc: ";
	if ($output->{$name}->{TYPE} eq "SUBSYSTEM" or
	    $output->{$name}->{TYPE} eq "LIBRARY") {
		print "no"; 
	} else {
		print "yes";
	}
	print "\n";
}

sub show($$)
{
	my ($output,$config) = @_;

	print "Summary:\n\n";
	showitem($output, "SSL in SWAT and LDAP", ["GNUTLS"]);
	showitem($output, "threads in server (see --with-pthread)", ["PTHREAD"]);
	showitem($output, "intelligent command line editing", ["READLINE"]);
	showitem($output, "changing process titles (see --with-setproctitle)", ["SETPROCTITLE"]);
	showitem($output, "using extended attributes", ["XATTR"]);
	showitem($output, "using libblkid", ["BLKID"]);
	showitem($output, "using iconv", ["ICONV"]);
	showitem($output, "using pam", ["PAM"]);
	showitem($output, "python bindings", ["LIBPYTHON"]);
	showisexternal($output, "popt", "LIBPOPT");
	showisexternal($output, "talloc", "LIBTALLOC");
	showisexternal($output, "tdb", "LIBTDB");
	showisexternal($output, "tevent", "LIBTEVENT");
	showisexternal($output, "ldb", "LIBLDB");
	showisexternal($output, "heimdal", "HEIMDAL_KRB5");
	print "Developer mode: ".(enabled($config->{developer})?"yes":"no")."\n";
	print "Automatic dependencies: ".
	    (enabled($config->{automatic_dependencies})
		    ? "yes" : "no (install GNU make >= 3.81 and see --enable-automatic-dependencies)") .
	     "\n";
	
	print "Building shared libraries: " .
	    (enabled($config->{BLDSHARED})
		    ? "yes" : "no (not supported on this system)") .
	    "\n";
	print "Using shared libraries internally: " .
	    (enabled($config->{USESHARED})
		    ? "yes" : "no (specify --enable-dso)") .
	    "\n";

	print "\n";
}

1;