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