summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xconfigure15
-rw-r--r--include/configreader.h9
-rw-r--r--make/template/main.mk9
-rw-r--r--src/configreader.cpp38
4 files changed, 40 insertions, 31 deletions
diff --git a/configure b/configure
index c4f0dffc7..d7cf0d732 100755
--- a/configure
+++ b/configure
@@ -300,7 +300,7 @@ if (<src/modules/m_ssl_*.cpp> && prompt_bool $interactive, 'Would you like to ge
system './tools/genssl', 'auto';
}
-write_configure_cache %config if $interactive;
+write_configure_cache %config;
parse_templates \%config, \%compiler, \%version;
print_format <<"EOM";
@@ -312,10 +312,15 @@ Configuration is complete! You have chosen to build with the following settings:
<|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}
diff --git a/include/configreader.h b/include/configreader.h
index da81d5055..57d7ab069 100644
--- a/include/configreader.h
+++ b/include/configreader.h
@@ -117,13 +117,10 @@ class ServerLimits
/** Maximum hostname length */
size_t MaxHost;
- /** Creating the class initialises it to the defaults
- * as in 1.1's ./configure script. Reading other values
- * from the config will change these values.
+ /** Read all limits from a config tag. Limits which aren't specified in the tag are set to a default value.
+ * @param tag Configuration tag to read the limits from
*/
- ServerLimits() : NickMax(31), ChanMax(64), MaxModes(20), IdentMax(12),
- MaxQuit(255), MaxTopic(307), MaxKick(255), MaxGecos(128), MaxAway(200),
- MaxLine(512), MaxHost(64) { }
+ ServerLimits(ConfigTag* tag);
};
struct CommandLineConf
diff --git a/make/template/main.mk b/make/template/main.mk
index b4d77e4e6..521888bea 100644
--- a/make/template/main.mk
+++ b/make/template/main.mk
@@ -247,7 +247,7 @@ install: target
-$(INSTALL) -m $(INSTMODE_LIB) inspircd-genssl.1 $(MANPATH) 2>/dev/null
-$(INSTALL) -m $(INSTMODE_BIN) tools/genssl $(BINPATH)/inspircd-genssl 2>/dev/null
-$(INSTALL) -m $(INSTMODE_LIB) docs/conf/*.example $(CONPATH)/examples
- -$(INSTALL) -m $(INSTMODE_LIB) *.pem $(CONPATH)
+ -$(INSTALL) -m $(INSTMODE_LIB) *.pem $(CONPATH) 2>/dev/null
-$(INSTALL) -m $(INSTMODE_LIB) docs/conf/aliases/*.example $(CONPATH)/examples/aliases
-$(INSTALL) -m $(INSTMODE_LIB) docs/conf/modules/*.example $(CONPATH)/examples/modules
@echo ""
@@ -264,11 +264,8 @@ install: target
@echo 'Remember to create your config file:' $(CONPATH)/inspircd.conf
@echo 'Examples are available at:' $(CONPATH)/examples/
-@TARGET BSD_MAKE CONFIGURE_CACHE_FILE = @CONFIGURE_CACHE_FILE@
-@TARGET GNU_MAKE CONFIGURE_CACHE_FILE = $(wildcard @CONFIGURE_CACHE_FILE@)
-
-GNUmakefile BSDmakefile: make/template/main.mk src/version.sh configure $(CONFIGURE_CACHE_FILE)
- ./configure -update
+GNUmakefile BSDmakefile: make/template/main.mk src/version.sh configure @CONFIGURE_CACHE_FILE@
+ ./configure --update
@TARGET BSD_MAKE .MAKEFILEDEPS: BSDmakefile
clean:
diff --git a/src/configreader.cpp b/src/configreader.cpp
index 54c32d846..d52f3de13 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -29,7 +29,30 @@
#include "configparser.h"
#include <iostream>
+ServerLimits::ServerLimits(ConfigTag* tag)
+ : NickMax(tag->getInt("maxnick", 32))
+ , ChanMax(tag->getInt("maxchan", 64))
+ , MaxModes(tag->getInt("maxmodes", 20))
+ , IdentMax(tag->getInt("maxident", 11))
+ , MaxQuit(tag->getInt("maxquit", 255))
+ , MaxTopic(tag->getInt("maxtopic", 307))
+ , MaxKick(tag->getInt("maxkick", 255))
+ , MaxGecos(tag->getInt("maxgecos", 128))
+ , MaxAway(tag->getInt("maxaway", 200))
+ , MaxLine(tag->getInt("maxline", 512))
+ , MaxHost(tag->getInt("maxhost", 64))
+{
+}
+
+static ConfigTag* CreateEmptyTag()
+{
+ std::vector<KeyVal>* items;
+ return ConfigTag::create("empty", "<auto>", 0, items);
+}
+
ServerConfig::ServerConfig()
+ : EmptyTag(CreateEmptyTag())
+ , Limits(EmptyTag)
{
RawLog = HideBans = HideSplits = UndernetMsgPrefix = false;
WildcardIPv6 = InvBypassModes = true;
@@ -41,9 +64,6 @@ ServerConfig::ServerConfig()
OperMaxChans = 30;
c_ipv4_range = 32;
c_ipv6_range = 128;
-
- std::vector<KeyVal>* items;
- EmptyTag = ConfigTag::create("empty", "<auto>", 0, items);
}
ServerConfig::~ServerConfig()
@@ -401,17 +421,7 @@ void ServerConfig::Fill()
OperMaxChans = ConfValue("channels")->getInt("opers");
c_ipv4_range = ConfValue("cidr")->getInt("ipv4clone", 32);
c_ipv6_range = ConfValue("cidr")->getInt("ipv6clone", 128);
- Limits.NickMax = ConfValue("limits")->getInt("maxnick", 32);
- Limits.ChanMax = ConfValue("limits")->getInt("maxchan", 64);
- Limits.MaxModes = ConfValue("limits")->getInt("maxmodes", 20);
- Limits.IdentMax = ConfValue("limits")->getInt("maxident", 11);
- Limits.MaxHost = ConfValue("limits")->getInt("maxhost", 64);
- Limits.MaxQuit = ConfValue("limits")->getInt("maxquit", 255);
- Limits.MaxTopic = ConfValue("limits")->getInt("maxtopic", 307);
- Limits.MaxKick = ConfValue("limits")->getInt("maxkick", 255);
- Limits.MaxGecos = ConfValue("limits")->getInt("maxgecos", 128);
- Limits.MaxAway = ConfValue("limits")->getInt("maxaway", 200);
- Limits.MaxLine = ConfValue("limits")->getInt("maxline", 512);
+ Limits = ServerLimits(ConfValue("limits"));
Paths.Config = ConfValue("path")->getString("configdir", INSPIRCD_CONFIG_PATH);
Paths.Data = ConfValue("path")->getString("datadir", INSPIRCD_DATA_PATH);
Paths.Log = ConfValue("path")->getString("logdir", INSPIRCD_LOG_PATH);