#
# 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
if (system "$compiler -v > /dev/null 2>&1") {
say "Skipping $compiler as it is not installed on this system!";
next;
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';
- system './configure', '--enable-extras', $ENV{TEST_BUILD_MODULES} if defined $ENV{TEST_BUILD_MODULES};
- if (system './configure', '--development', '--socketengine', $socketengine) {
- say "Failed to configure using the $compiler compiler and the $socketengine socket engine!";
- exit 1;
+ my @configure_flags;
+ if (defined $ENV{TEST_BUILD_MODULES}) {
+ execute "$root/configure", '--enable-extras', $ENV{TEST_BUILD_MODULES};
+ push @configure_flags, '--disable-auto-extras';
- $ENV{INSPIRCD_STATIC} = 1;
- if (system 'make', '-j'.get_cpu_count, 'install') {
- say "Failed to compile with static modules using the $compiler compiler and the $socketengine socket engine!";
+ if (execute "$root/configure", '--development', '--socketengine', $socketengine, @configure_flags) {
+ say "Failed to configure using the $compiler compiler and the $socketengine socket engine!";
- delete $ENV{INSPIRCD_STATIC};
- if (system 'make', '-j'.get_cpu_count, 'install') {
- say "Failed to compile with dynamic modules using the $compiler compiler and the $socketengine socket engine!";
+ if (execute 'make', '--directory', $root, '--jobs', get_cpu_count() + 1, 'install') {
+ say "Failed to compile using the $compiler compiler and the $socketengine socket engine!";