use make::configure;
use make::utilities;
-our ($opt_use_gnutls, $opt_use_openssl, $opt_nointeractive, $opt_socketengine, $opt_freebsd_port,
+our ($opt_use_gnutls, $opt_use_openssl, $opt_nointeractive, $opt_socketengine,
$opt_system, $opt_uid, $opt_base_dir, $opt_config_dir, $opt_module_dir, $opt_binary_dir,
$opt_data_dir, $opt_log_dir);
'enable-openssl' => \$opt_use_openssl,
'disable-interactive' => \$opt_nointeractive,
'socketengine=s' => \$opt_socketengine,
- 'enable-freebsd-ports-openssl' => \$opt_freebsd_port,
'prefix=s' => \$opt_base_dir,
'config-dir=s' => \$opt_config_dir,
'module-dir=s' => \$opt_module_dir,
(defined $opt_use_openssl) ||
(defined $opt_system) ||
(defined $opt_uid) ||
- (defined $opt_use_gnutls) ||
- (defined $opt_freebsd_port)
+ (defined $opt_use_gnutls)
);
our $topdir = getcwd();
if (defined $opt_log_dir) {
$config{LOG_DIR} = $opt_log_dir;
}
-chomp($config{HAS_GNUTLS} = `pkg-config --modversion gnutls 2>/dev/null`); # GNUTLS Version.
-
-if (defined $opt_freebsd_port)
-{
- chomp($config{HAS_OPENSSL} = `pkg-config --modversion openssl 2>/dev/null`);
- chomp($config{HAS_OPENSSL_PORT} = `pkg-config --modversion openssl 2>/dev/null`);
- $config{USE_FREEBSD_BASE_SSL} = "n";
-}
-else
-{
- if ($^O eq "freebsd")
- {
- # default: use base ssl
- chomp($config{HAS_OPENSSL} = `openssl version | cut -d ' ' -f 2`); # OpenSSL version, freebsd specific
- chomp($config{HAS_OPENSSL_PORT} = `pkg-config --modversion openssl 2>/dev/null`); # Port version, may be different
- }
- else
- {
- chomp($config{HAS_OPENSSL} = `pkg-config --modversion openssl 2>/dev/null`); # Openssl version, others
- $config{HAS_OPENSSL_PORT} = "";
- }
-}
+chomp($config{HAS_GNUTLS} = `pkg-config --modversion gnutls 2>/dev/null`);
+chomp($config{HAS_OPENSSL} = `pkg-config --modversion openssl 2>/dev/null`);
chomp(our $gnutls_ver = $config{HAS_GNUTLS});
chomp(our $openssl_ver = $config{HAS_OPENSSL});
print "Checking for cache from previous configure... ";
print ($cache_loaded ? "found\n" : "not found\n");
-print "Checking whether clock_gettime() is available... ";
-if (test_file($config{CXX}, "clock_gettime.cpp", "-lrt")) {
- $config{HAS_CLOCK_GETTIME} = "true";
- print "yes\n";
-} else {
- $config{HAS_CLOCK_GETTIME} = "false";
- print "no\n";
-}
+$config{HAS_CLOCK_GETTIME} = run_test 'clock_gettime()', test_file($config{CXX}, 'clock_gettime.cpp', '-lrt');
+$config{HAS_EVENTFD} = run_test 'eventfd()', test_file($config{CXX}, 'eventfd.cpp');
-print "Checking whether eventfd() is available... ";
-if (test_file($config{CXX}, "eventfd.cpp")) {
- $config{HAS_EVENTFD} = "true";
- print "yes\n";
-} else {
- $config{HAS_EVENTFD} = "false";
- print "no\n";
+if ($config{HAS_EPOLL} = run_test 'epoll', test_header($config{CXX}, 'sys/epoll.h')) {
+ $config{SOCKETENGINE} ||= 'epoll';
}
-print "Checking whether epoll is available... ";
-$config{HAS_EPOLL} = test_header($config{CXX}, "sys/epoll.h");
-print $config{HAS_EPOLL} ? "yes\n" : "no\n";
-$config{SOCKETENGINE} ||= "epoll" if $config{HAS_EPOLL};
-
-print "Checking whether Kqueue is available... ";
-$config{HAS_KQUEUE} = test_file($config{CXX}, "kqueue.cpp");
-print $config{HAS_KQUEUE} ? "yes\n" : "no\n";
-$config{SOCKETENGINE} ||= "kqueue" if $config{HAS_KQUEUE};
+if ($config{HAS_KQUEUE} = run_test 'kqueue', test_file($config{CXX}, 'kqueue.cpp')) {
+ $config{SOCKETENGINE} ||= 'kqueue';
+}
-print 'Checking whether Solaris IOCP is available... ';
-$config{HAS_PORTS} = test_header($config{CXX}, 'port.h');
-print $config{HAS_PORTS} ? "yes\n" : "no\n";
-$config{SOCKETENGINE} ||= "ports" if $config{HAS_PORTS};
+if ($config{HAS_PORTS} = run_test 'Solaris IOCP', test_header($config{CXX}, 'port.h')) {
+ $config{SOCKETENGINE} ||= 'ports';
+}
-print 'Checking whether poll is available... ';
-$config{HAS_POLL} = test_header($config{CXX}, 'poll.h');
-print $config{HAS_POLL} ? "yes\n" : "no\n";
-$config{SOCKETENGINE} ||= "poll" if $config{HAS_POLL};
+if ($config{HAS_POLL} = run_test 'poll', test_header($config{CXX}, 'poll.h')) {
+ $config{SOCKETENGINE} ||= 'poll';
+}
# Select is available on all platforms
$config{HAS_SELECT} = 1;
$config{SOCKETENGINE} = "select";
}
- $config{USE_FREEBSD_BASE_SSL} = "n";
- $config{USE_FREEBSD_PORTS_SSL} = "n";
- if ($config{HAS_OPENSSL_PORT} ne "")
- {
- $config{USE_FREEBSD_PORTS_SSL} = "y";
- print "I have detected the OpenSSL FreeBSD port installed on your system,\n";
- print "version \e[1;32m".$config{HAS_OPENSSL_PORT}."\e[0m. Your base system OpenSSL is version \e[1;32m".$openssl_ver."\e[0m.\n\n";
- yesno('USE_FREEBSD_PORTS_SSL', "Do you want to use the FreeBSD ports version?");
- print "\n";
- $config{USE_FREEBSD_BASE_SSL} = "y" if ($config{USE_FREEBSD_PORTS_SSL} eq "n");
-
- if ($config{USE_FREEBSD_BASE_SSL} eq "n")
- {
- # update to port version
- $openssl_ver = $config{HAS_OPENSSL_PORT};
- }
- }
- else
- {
- $config{USE_FREEBSD_BASE_SSL} = "y" if ($^O eq "freebsd");
- }
-
$config{USE_SSL} = "n";
if ($config{HAS_GNUTLS} eq "y" || $config{HAS_OPENSSL} eq "y")
if (($config{USE_GNUTLS} eq "y") && ($config{HAS_GNUTLS} ne "y"))
{
- print "Sorry, but i couldn't detect gnutls. Make sure gnutls-config is in your path.\n";
+ print "Sorry, but i couldn't detect gnutls. Make sure pkg-config is in your path.\n";
exit 1;
}
if (($config{USE_OPENSSL} eq "y") && ($config{HAS_OPENSSL} ne "y"))
{
- print "Sorry, but i couldn't detect openssl. Make sure openssl is in your path.\n";
+ print "Sorry, but i couldn't detect openssl. Make sure pkg-config is in your path.\n";
exit 1;
}
print "Skipping SSL Certificate generation, SSL support is not available.\n\n";
}
-depcheck();
+getmodules();
writefiles();
makecache();
dumphash();
EOF
- if ($config{HAS_EVENTFD} eq 'true') {
+ if ($config{HAS_EVENTFD}) {
print FILEHANDLE "#define HAS_EVENTFD\n";
}
- if ($config{HAS_CLOCK_GETTIME} eq 'true') {
+ if ($config{HAS_CLOCK_GETTIME}) {
print FILEHANDLE "#define HAS_CLOCK_GETTIME\n";
}
chmod 0755, 'inspircd';
}
-sub depcheck
-{
- getmodules();
- for my $mod (@modlist) {
- getcompilerflags("src/modules/m_$mod.cpp");
- getlinkerflags("src/modules/m_$mod.cpp");
- }
-}
-
# Routine to list out the extra/ modules that have been enabled.
# Note: when getting any filenames out and comparing, it's important to lc it if the
# file system is not case-sensitive (== Epoc, MacOS, OS/2 (incl DOS/DJGPP), VMS, Win32
for my $extra (keys(%extras)) {
next unless $extras{$extra} =~ m/enabled/; # only process enabled extras.
my $abs_extra = File::Spec->catfile($abs_srcdir, "extra", $extra);
- my @deps = split / +/, getdependencies($abs_extra);
+ my @deps = split /\s+/, get_property($abs_extra, 'ModDep');
for my $dep (@deps) {
if (exists($extras{$dep})) {
my $ref = \$extras{$dep}; # Take reference.
next;
}
# Get dependencies, and add them to be processed.
- my @deps = split / +/, getdependencies($extrapath);
+ my @deps = split /\s+/, get_property($extrapath, 'ModDep');
for my $dep (@deps) {
next if scalar(grep { $_ eq $dep } (@extras)) > 0; # Skip if we're going to be enabling it anyway.
if (!-e "src/modules/$dep" && !-e "include/$dep") {
}
# Check if anything needs this.
for my $file (@files) {
- my @deps = split / +/, getdependencies("src/modules/extra/$file");
+ my @deps = split /\s+/, get_property("src/modules/extra/$file", 'ModDep');
# File depends on this extra...
if (scalar(grep { $_ eq $extra } @deps) > 0) {
# And is both enabled and not about to be disabled.