use Getopt::Long qw(GetOptions);
use POSIX qw(getgid getuid);
+use make::common;
use make::configure;
use make::console;
-use make::utilities;
my ($opt_binary_dir,
$opt_config_dir,
$opt_data_dir,
$opt_disable_interactive,
+ $opt_distribution_label,
$opt_gid,
$opt_log_dir,
$opt_manual_dir,
'help' => \&cmd_help,
'update' => \&cmd_update,
- 'disable-interactive' => \$opt_disable_interactive,
- 'binary-dir=s' => \$opt_binary_dir,
- 'config-dir=s' => \$opt_config_dir,
- 'data-dir=s' => \$opt_data_dir,
- 'gid=s' => \$opt_gid,
- 'log-dir=s' => \$opt_log_dir,
- 'manual-dir=s' => \$opt_manual_dir,
- 'module-dir=s' => \$opt_module_dir,
- 'prefix=s' => \$opt_prefix,
- 'socketengine=s' => \$opt_socketengine,
- 'system' => \$opt_system,
- 'uid=s' => \$opt_uid,
+ 'disable-interactive' => \$opt_disable_interactive,
+ 'distribution-label=s' => \$opt_distribution_label,
+ 'binary-dir=s' => \$opt_binary_dir,
+ 'config-dir=s' => \$opt_config_dir,
+ 'data-dir=s' => \$opt_data_dir,
+ 'gid=s' => \$opt_gid,
+ 'log-dir=s' => \$opt_log_dir,
+ 'manual-dir=s' => \$opt_manual_dir,
+ 'module-dir=s' => \$opt_module_dir,
+ 'prefix=s' => \$opt_prefix,
+ 'socketengine=s' => \$opt_socketengine,
+ 'system' => \$opt_system,
+ 'uid=s' => \$opt_uid,
# TODO: when the modulemanager rewrite is done these should be removed.
'disable-extras=s@' => \@opt_disableextras,
defined $opt_config_dir ||
defined $opt_data_dir ||
defined $opt_disable_interactive ||
+ defined $opt_distribution_label ||
defined $opt_gid ||
defined $opt_log_dir ||
defined $opt_manual_dir ||
}
}
-$config{CXX} = defined $ENV{CXX} && !system("$ENV{CXX} -v > /dev/null 2>&1") ? $ENV{CXX} : find_compiler();
-if ($config{CXX} eq "") {
- print "A C++ compiler could not be detected on your system!\n";
- print "Set the CXX environment variable to the full path if this is incorrect.\n";
+$config{CXX} = find_compiler($config{CXX} || $ENV{CXX});
+unless ($config{CXX}) {
+ print "A suitable C++ compiler could not be detected on your system!\n";
+ print "Set the CXX environment variable to the compiler binary path if this is incorrect.\n";
exit 1;
}
-
my %compiler = get_compiler_info($config{CXX});
-if ($compiler{UNSUPPORTED}) {
- print "Your C++ compiler is too old to build InspIRCd!\n";
- print "Reason: $compiler{REASON}\n";
- exit 1;
-}
$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');
}
}
+# If the user has specified a distribution label then we use it in
+# place of the label from src/version.sh or Git.
+if (defined $opt_distribution_label) {
+ $version{LABEL} = $opt_distribution_label;
+}
+
if (defined $opt_system) {
$config{BASE_DIR} = $opt_prefix || '/var/lib/inspircd';
$config{BINARY_DIR} = $opt_binary_dir || '/usr/sbin';
system './tools/genssl', 'auto';
}
-write_configure_cache %config if $interactive;
-parse_templates \%config, \%compiler;
+write_configure_cache %config;
+parse_templates \%config, \%compiler, \%version;
print_format <<"EOM";
<|GREEN Name:|> $compiler{NAME}
<|GREEN Version:|> $compiler{VERSION}
-<|GREEN Extra Modules:|> <<TODO>>
- * m_foo
- * m_bar
- * m_baz
+<|GREEN Extra Modules:|>
+EOM
+
+for my $file (<src/modules/m_*>) {
+ my $module = basename $file, '.cpp';
+ print " * $module\n" if -l $file;
+}
+
+print_format <<"EOM";
<|GREEN Paths:|>
<|GREEN Base:|> $config{BASE_DIR}