Until the new ldb changes land, make ldb_wait set the error string.
[samba.git] / source4 / build / smb_build / summary.pm
1 # Samba Build System
2 # - write out summary
3 #
4 #  Copyright (C) Jelmer Vernooij 2006
5 #  Released under the GNU GPL
6
7 package summary;
8 use strict;
9
10 sub enabled($)
11 {
12     my ($val) = @_;
13
14     return (defined($val) && $val =~ m/yes|true/i);
15 }
16
17 sub showitem($$$)
18 {
19         my ($output,$desc,$items) = @_;
20
21         my @need = ();
22
23         foreach (@$items) {
24                 if (!enabled($output->{$_}->{ENABLE})) {
25                         push (@need, $_);
26                 }
27         }
28
29         print "Support for $desc: ";
30         if ($#need >= 0) {
31                 print "no (install " . join(',',@need) . ")\n";
32         } else {
33                 print "yes\n";
34         }
35 }
36
37 sub showisexternal($$$)
38 {
39         my ($output, $desc, $name) = @_;
40         print "Using external $desc: ".
41             (($output->{$name}->{TYPE} eq "EXT_LIB")?"yes":"no")."\n";
42 }
43
44 sub show($$)
45 {
46         my ($output,$config) = @_;
47
48         print "Summary:\n\n";
49         showitem($output, "SSL in SWAT and LDAP", ["GNUTLS"]);
50         showitem($output, "threads in smbd (see --with-pthread)", ["PTHREAD"]);
51         showitem($output, "intelligent command line editing", ["READLINE"]);
52         showitem($output, "changing process titles (see --with-setproctitle)", ["SETPROCTITLE"]);
53         showitem($output, "using extended attributes", ["XATTR"]);
54         showitem($output, "using libblkid", ["BLKID"]);
55         showitem($output, "using iconv", ["ICONV"]);
56         showitem($output, "using pam", ["PAM"]);
57         showitem($output, "python bindings", ["LIBPYTHON"]);
58         showisexternal($output, "popt", "LIBPOPT");
59         showisexternal($output, "talloc", "LIBTALLOC");
60         showisexternal($output, "tdb", "LIBTDB");
61         showisexternal($output, "ldb", "LIBLDB");
62         print "Developer mode: ".(enabled($config->{developer})?"yes":"no")."\n";
63         print "Automatic dependencies: ".
64             (enabled($config->{automatic_dependencies})
65                     ? "yes" : "no (install GNU make >= 3.81 and see --enable-automatic-dependencies)") .
66              "\n";
67         
68         print "Building shared libraries: " .
69             (enabled($config->{BLDSHARED})
70                     ? "yes" : "no (not supported on this system)") .
71             "\n";
72         print "Using shared libraries internally: " .
73             (enabled($config->{USESHARED})
74                     ? "yes" : "no (specify --enable-dso)") .
75             "\n";
76
77         print "\n";
78 }
79
80 1;