-
Notifications
You must be signed in to change notification settings - Fork 3
/
configure
executable file
·87 lines (74 loc) · 1.85 KB
/
configure
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
#!/usr/bin/env perl
use strict;
use warnings;
use integer;
use constant TEST => 1;
require 5.8.0;
eval {
require Carp;
require POSIX;
require Scalar::Util;
require overload;
Carp->import('cluck');
Scalar::Util->import(qw(weaken tainted));
1;
} or die "A required perl module was not found: $@";
eval { require Digest::SHA; 1 } || eval { require Digest::SHA1; 1 } ||
die "One of Digest::SHA or Digest::SHA1 is required";
print "Required modules found.\n";
if (eval {
require Socket;
require Fcntl;
1;
}) {
print "Uniprocess:\n";
print " SSL: ", eval {
require IO::Socket::SSL;
1;
} ? "OK\n" : "Not available (install IO::Socket::SSL)\n";
print " IPv6: ", eval {
require Socket6;
require IO::Socket::INET6;
1;
} ? "OK\n" : "Not available (install IO::Socket::INET6)\n";
print " DNS: ", eval {
require Net::DNS;
1;
} ? "OK\n" : "Not available (install Net::DNS)\n";
} else {
print "Uniprocess runner not available: $@\n";
}
print "Multiplex process:\n";
my @cflag = qw(-Wall -std=c99 -D_XOPEN_SOURCE=600);
my @cfiles = qw(multiplex.c queue.c);
my $gnutls = `pkg-config gnutls --modversion 2>/dev/null`;
if (@ARGV && $ARGV[0] =~ /nossl/) {
$gnutls = '';
}
if ($gnutls) {
chomp $gnutls;
print " GnuTLS version $gnutls found\n";
push @cflag, '-DSSL_GNUTLS=1';
push @cflag, grep length, split /\s+/, `pkg-config gnutls --cflags --libs`;
push @cfiles, 'ssl-gnutls.c';
} else {
print " GnuTLS not found, multiplex will have no SSL support\n";
}
if (@ARGV && $ARGV[0] =~ /debug/) {
push @cflag, '-g';
} else {
push @cflag, '-O2',
}
print " Compiling...\n";
unless (fork) {
chdir 'c-src';
exec 'cc', '-o', 'multiplex', @cflag, @cfiles;
exit 1;
} else {
wait;
if ($?) {
print " Compilation failed, multiplex support not available\n";
} else {
print " Multiplex process support available.\n";
}
}