summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2020-07-07 07:57:32 +0100
committerSadie Powell <sadie@witchery.services>2020-07-07 08:33:07 +0100
commit07b12e72497b3f0e6e53eebab032e92e1f789f0a (patch)
treea33e758cd37b035f7ee24f89c9b248b6377297e4 /configure
parent7823761cf3bbdd58ff9c33bcc1cc72c6a36a4c25 (diff)
Various improvements to the build system.
- Fix running configure where configure is not in the PWD. - Only show relative paths when generating files from templates.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure15
1 files changed, 10 insertions, 5 deletions
diff --git a/configure b/configure
index 9d064c693..5de4c7903 100755
--- a/configure
+++ b/configure
@@ -36,9 +36,10 @@ use feature ':5.10';
use strict;
use warnings FATAL => qw(all);
+use Cwd qw(getcwd);
use File::Basename qw(basename);
use File::Copy ();
-use File::Spec::Functions qw(catfile catdir rel2abs);
+use File::Spec::Functions qw(abs2rel catfile catdir rel2abs);
use FindBin qw($RealDir);
use Getopt::Long qw(GetOptions);
use POSIX qw(getgid getuid);
@@ -351,7 +352,7 @@ Currently, InspIRCd is configured to automatically enable all available extra mo
Would you like to enable extra modules manually?
EOQ
if (prompt_bool $interactive, $question, 0) {
- foreach my $extra (<src/modules/extra/m_*.cpp>) {
+ foreach my $extra (<$RealDir/src/modules/extra/m_*.cpp>) {
my $module_name = basename $extra, '.cpp';
if (prompt_bool $interactive, "Would you like to enable $module_name?", 0) {
enable_extras "$module_name.cpp";
@@ -390,7 +391,7 @@ Note: you can get a <|BOLD free|> CA-signed certificate from Let's Encrypt. See
https://letsencrypt.org/getting-started/ for more details.
EOQ
-if (<src/modules/m_ssl_*.cpp>) {
+if (<$RealDir/src/modules/m_ssl_*.cpp>) {
if (prompt_bool $interactive, $question, $interactive) {
system './tools/genssl', 'auto';
}
@@ -426,11 +427,15 @@ Configuration is complete! You have chosen to build with the following settings:
<|GREEN Extra Modules:|>
EOM
-for my $file (<src/modules/m_*>) {
+for my $file (<$RealDir/src/modules/m_*>) {
my $module = basename $file, '.cpp';
say " * $module" if -l $file;
}
+my @makeargs;
+push @makeargs, "-C${\abs2rel $RealDir}" unless getcwd eq $RealDir;
+push @makeargs, "-j${\(get_cpu_count() + 1)}";
+
print_format <<"EOM";
<|GREEN Paths:|>
@@ -448,7 +453,7 @@ print_format <<"EOM";
<|GREEN Execution User:|> $config{USER} ($config{UID})
<|GREEN Socket Engine:|> $config{SOCKETENGINE}
-To build with these settings run '<|GREEN make -j${\(get_cpu_count() + 1)} install|>' now.
+To build with these settings run '<|GREEN make ${\join ' ', @makeargs} install|>' now.
EOM