aboutsummaryrefslogtreecommitdiff
path: root/make
diff options
context:
space:
mode:
authorGravatar Sadie Powell2024-06-24 19:15:41 +0100
committerGravatar Sadie Powell2024-06-24 19:15:41 +0100
commite11adbea4f0db1dbf441f16363be459bda5e50a2 (patch)
treef3abb68a314e85e154a910b1b461f174f4cd9ddc /make
parentFix some uses of raw mode characters in messages. (diff)
Move module_{expand,shrink} to make::common.
Diffstat (limited to 'make')
-rw-r--r--make/common.pm15
-rw-r--r--make/configure.pm14
2 files changed, 15 insertions, 14 deletions
diff --git a/make/common.pm b/make/common.pm
index 26129e24b..7082ba635 100644
--- a/make/common.pm
+++ b/make/common.pm
@@ -24,6 +24,7 @@ use strict;
use warnings FATAL => qw(all);
use Exporter qw(import);
+use File::Basename qw(basename);
use File::Path qw(mkpath);
use File::Spec::Functions qw(rel2abs);
@@ -33,6 +34,8 @@ our @EXPORT = qw(create_directory
execute
get_cpu_count
get_version
+ module_expand
+ module_shrink
read_config_file
write_config_file);
@@ -107,6 +110,18 @@ sub get_cpu_count {
return $count;
}
+sub module_expand($) {
+ my $module = shift;
+ $module = "m_$module" unless $module =~ /^(?:m|core)_/;
+ $module = "$module.cpp" unless $module =~ /\.cpp$/;
+ return $module;
+}
+
+sub module_shrink($) {
+ my $module = basename shift;
+ return $module =~ s/(?:^m_|\.cpp$)//gr;
+}
+
sub read_config_file($) {
my $path = shift;
my %config;
diff --git a/make/configure.pm b/make/configure.pm
index c19ca9927..2a950b70c 100644
--- a/make/configure.pm
+++ b/make/configure.pm
@@ -50,8 +50,6 @@ our @EXPORT = qw(CONFIGURE_CACHE_FILE
run_test
test_file
test_header
- module_expand
- module_shrink
write_configure_cache
get_compiler_info
find_compiler
@@ -229,18 +227,6 @@ sub test_header($$;$) {
return !$?;
}
-sub module_expand($) {
- my $module = shift;
- $module = "m_$module" unless $module =~ /^(?:m|core)_/;
- $module = "$module.cpp" unless $module =~ /\.cpp$/;
- return $module;
-}
-
-sub module_shrink($) {
- my $module = basename shift;
- return $module =~ s/(?:^m_|\.cpp$)//gr;
-}
-
sub write_configure_cache(%) {
unless (-e CONFIGURE_DIRECTORY) {
say console_format "Creating <|GREEN ${\abs2rel CONFIGURE_DIRECTORY, CONFIGURE_ROOT}|> ...";