#
# This file is part of InspIRCd. InspIRCd is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
#
# This file is part of InspIRCd. InspIRCd is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
-foreach my $compiler ('g++', 'clang++', 'icpc') {
- next if system "$compiler -v > /dev/null 2>&1";
+my @compilers = $#ARGV >= 0 ? @ARGV : qw(g++ clang++ icpc);
+foreach my $compiler (@compilers) {
+ if (system "$compiler -v > /dev/null 2>&1") {
+ say "Skipping $compiler as it is not installed on this system!";
+ next;
+ }
push @socketengines, 'epoll' if test_header $compiler, 'sys/epoll.h';
push @socketengines, 'kqueue' if test_file $compiler, 'kqueue.cpp';
push @socketengines, 'poll' if test_header $compiler, 'poll.h';
push @socketengines, 'epoll' if test_header $compiler, 'sys/epoll.h';
push @socketengines, 'kqueue' if test_file $compiler, 'kqueue.cpp';
push @socketengines, 'poll' if test_header $compiler, 'poll.h';
- print "Attempting to build using the $compiler compiler and the $socketengine socket engine...\n";
- if (system './configure', '--disable-interactive', "--socketengine=$socketengine") {
- print "Failed to configure using the $compiler compiler and the $socketengine socket engine!\n";
- exit 1;
+ say "Attempting to build using the $compiler compiler and the $socketengine socket engine...";
+ my @configure_flags;
+ if (defined $ENV{TEST_BUILD_MODULES}) {
+ execute './configure', '--enable-extras', $ENV{TEST_BUILD_MODULES};
+ push @configure_flags, '--disable-auto-extras';
- $ENV{PURE_STATIC} = 1;
- if (system 'make', '-j'.get_cpu_count, 'install') {
- print "Failed to compile with static modules using the $compiler compiler and the $socketengine socket engine!\n";
+ if (execute './configure', '--development', '--socketengine', $socketengine, @configure_flags) {
+ say "Failed to configure using the $compiler compiler and the $socketengine socket engine!";
- delete $ENV{PURE_STATIC};
- if (system 'make', '-j'.get_cpu_count, 'install') {
- print "Failed to compile with dynamic modules using the $compiler compiler and the $socketengine socket engine!\n";
+ if (execute 'make', '--jobs', get_cpu_count() + 1, 'install') {
+ say "Failed to compile using the $compiler compiler and the $socketengine socket engine!";