]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - make/configure.pm
Add a separate stats class for DNSBL errors.
[user/henk/code/inspircd.git] / make / configure.pm
index fd1833d5fe1515cc9fcabc74566081a95b2f735d..001de5fc748f4014576e5426581e223be40ddf54 100644 (file)
@@ -1,6 +1,7 @@
 #
 # InspIRCd -- Internet Relay Chat Daemon
 #
+#   Copyright (C) 2020 Nicole Kleinhoff <ilbelkyr@shalture.org>
 #   Copyright (C) 2013-2020 Sadie Powell <sadie@witchery.services>
 #   Copyright (C) 2012 Robby <robby@chatbelgie.be>
 #   Copyright (C) 2007-2008 Craig Edwards <brain@inspircd.org>
@@ -52,6 +53,8 @@ our @EXPORT = qw(CONFIGURE_CACHE_FILE
                  run_test
                  test_file
                  test_header
+                 module_expand
+                 module_shrink
                  write_configure_cache
                  get_compiler_info
                  find_compiler
@@ -176,7 +179,8 @@ FLAGS
                                 will search for c++, g++, clang++ or icpc.
 
 If you have any problems with configuring InspIRCd then visit our IRC channel
-at irc.inspircd.org #InspIRCd for support.
+at irc.inspircd.org #InspIRCd or create a support discussion at
+https://github.com/inspircd/inspircd/discussions.
 
 Packagers: see https://docs.inspircd.org/packaging/ for packaging advice.
 EOH
@@ -187,6 +191,8 @@ sub cmd_update {
        print_error "You have not run $0 before. Please do this before trying to update the generated files." unless -f CONFIGURE_CACHE_FILE;
        say 'Updating...';
        my %config = read_config_file(CONFIGURE_CACHE_FILE);
+       $config{EXAMPLE_DIR} //= catdir $config{CONFIG_DIR}, 'examples';
+       $config{RUNTIME_DIR} //= $config{DATA_DIR};
        my %compiler = get_compiler_info($config{CXX});
        my %version = get_version $config{DISTRIBUTION};
        parse_templates(\%config, \%compiler, \%version);
@@ -221,6 +227,18 @@ 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) {
                print_format "Creating <|GREEN ${\abs2rel CONFIGURE_DIRECTORY, CONFIGURE_ROOT}|> ...\n";