From 07b12e72497b3f0e6e53eebab032e92e1f789f0a Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 7 Jul 2020 07:57:32 +0100 Subject: 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. --- configure | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'configure') 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 () { + 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 () { +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 () { +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 -- cgit v1.2.3