###################################################
# InspIRCd Configuration Script
#
-# Copyright 2002-2007 The InspIRCd Development Team
+# Copyright 2002-2008 The InspIRCd Development Team
# http://www.inspircd.org/wiki/index.php/Credits
#
# Licensed under GPL, please see the COPYING file
our %extrasources = ();
our ($opt_use_gnutls, $opt_rebuild, $opt_use_openssl, $opt_nointeractive, $opt_nick_length,
- $opt_chan_length, $opt_maxclients, $opt_ports, $opt_epoll, $opt_kqueue, $opt_noports,
+ $opt_chan_length, $opt_ports, $opt_epoll, $opt_kqueue, $opt_noports,
$opt_noepoll, $opt_nokqueue, $opt_disablerpath, $opt_ipv6, $opt_ipv6links,
$opt_noipv6links, $opt_ident, $opt_quit, $opt_topic, $opt_maxbuf, $opt_kick,
$opt_gecos, $opt_away, $opt_modes, $opt_disable_debug, $opt_maxchans,
- $opt_opermaxchans);
+ $opt_opermaxchans, $opt_freebsd_port);
our ($opt_cc, $opt_base_dir, $opt_config_dir, $opt_module_dir, $opt_binary_dir,
$opt_library_dir);
'disable-interactive' => \$opt_nointeractive,
'with-nick-length=i' => \$opt_nick_length,
'with-channel-length=i' => \$opt_chan_length,
- 'with-max-clients=i' => \$opt_maxclients,
'enable-ports' => \$opt_ports,
'enable-epoll' => \$opt_epoll,
'enable-kqueue' => \$opt_kqueue,
'with-gecos-length=i' => \$opt_gecos,
'with-away-length=i' => \$opt_away,
'with-max-modes=i' => \$opt_modes,
+ 'enable-freebsd-ports-openssl' => \$opt_freebsd_port,
'prefix=s' => \$opt_base_dir,
'config-dir=s' => \$opt_config_dir,
'module-dir=s' => \$opt_module_dir,
(defined $opt_away) ||
(defined $opt_gecos) ||
(defined $opt_kick) ||
- (defined $opt_maxclients) ||
(defined $opt_modes) ||
(defined $opt_topic) ||
(defined $opt_quit) ||
(defined $opt_noepoll) ||
(defined $opt_noports) ||
(defined $opt_maxbuf) ||
- (defined $opt_use_gnutls)
+ (defined $opt_use_gnutls) ||
+ (defined $opt_freebsd_port)
);
our $interactive = !$non_interactive;
$config{LIBRARY_DIR} = $opt_library_dir;
}
chomp($config{HAS_GNUTLS} = `libgnutls-config --version 2>/dev/null | cut -c 1,2,3`); # GNUTLS Version.
-chomp($config{HAS_OPENSSL} = `pkg-config --modversion openssl 2>/dev/null`); # Openssl version
+
+if (defined $opt_freebsd_port)
+{
+ chomp($config{HAS_OPENSSL} = `pkg-config --modversion openssl 2>/dev/null`);
+ chomp($config{HAS_OPENSSL_PORT} = `pkg-config --modversion openssl 2>/dev/null`);
+ $config{USE_FREEBSD_BASE_SSL} = "n";
+}
+else
+{
+ if ($^O eq "freebsd")
+ {
+ # default: use base ssl
+ chomp($config{HAS_OPENSSL} = `openssl version | cut -d ' ' -f 2`); # OpenSSL version, freebsd specific
+ chomp($config{HAS_OPENSSL_PORT} = `pkg-config --modversion openssl 2>/dev/null`); # Port version, may be different
+ }
+ else
+ {
+ chomp($config{HAS_OPENSSL} = `pkg-config --modversion openssl 2>/dev/null`); # Openssl version, others
+ $config{HAS_OPENSSL_PORT} = "";
+ }
+}
+
chomp(our $gnutls_ver = $config{HAS_GNUTLS});
chomp(our $openssl_ver = $config{HAS_OPENSSL});
$config{USE_GNUTLS} = "n";
{
$config{SUPPORT_IP6LINKS} = "n";
}
-chomp($config{MAX_CLIENT_T} = `sh -c \"ulimit -n\"`); # FD Limit
-chomp($config{MAX_DESCRIPTORS} = `sh -c \"ulimit -n\"`); # Hard FD Limit
chomp($config{GCCVER} = `g++ -dumpversion | cut -c 1`); # Major GCC Version
$config{_SOMAXCONN} = SOMAXCONN; # Max connections in accept queue
$config{OSNAME} = $^O; # Operating System Name
exit;
}
-our $fd_scan_fail = "";
-if (!$config{MAX_CLIENT_T}) {
- $config{MAX_CLIENT_T} = 1024; # Set a reasonable 'Default'
- $fd_scan_fail = "true"; # Used Later
-}
-
# Get and Set some important vars..
getmodules();
if (scalar(@conflicted) > 0)
{
print STDERR "\e[0;33;1mERROR:\e[0m You have local modifications which conflicted with the updates from SVN\n";
- printf STDERR "Configure is not able to complete the update. Please resolve these conflicts, then run ./configure -%supdate", (($coredirchanged || $configurechanged) ? "" : "mod");
- print "Conflicted files: " . join ", ", @conflicted;
+ printf STDERR "Configure is not able to complete the update. Please resolve these conflicts, then run ./configure -%supdate\n", (($coredirchanged || $configurechanged) ? "" : "mod");
+ print "Conflicted files: " . join ", ", @conflicted . "\n";
exit 1;
}
if ($configurechanged || $coredirchanged)
print "Checking operating system version... ";
print getosflags() . "\n";
-if (defined $opt_maxclients)
-{
- $config{MAX_CLIENT} = $opt_maxclients;
-}
-
-if (!$config{MAX_CLIENT}) {
- # If the cache hasn't set the max clients, copy the variable of MAX_CLIENT_T, this
- # allows us to keep _T for testing purposes. (ie. "Are you sure you want to go
- # higher than the found value" :))
- $config{MAX_CLIENT} = $config{MAX_CLIENT_T};
-}
-
printf "Checking if stdint.h exists... ";
$config{HAS_STDINT} = "true";
our $fail = 0;
dir, otherwise you won't have a config file!
Your operating system is: \e[1;32m$config{OSNAME}\e[0m ($wholeos)
-Maximum file descriptors: \e[1;32m$config{MAX_CLIENT_T}\e[0m
Your InspIRCd revision ID is \e[1;32mr$rev\e[0m
STOP
if ($rev eq "r0") {
print "You have chosen to build an \e[1;32mIPV6-enabled\e[0m server.\nTo accept IPV4 users, you can still use IPV4 addresses\nin your port bindings..\n\n";
$config{SUPPORT_IP6LINKS} = "y";
} else {
- yesno('SUPPORT_IP6LINKS',"You have chosen to build an \e[1;32mIPV4-only\e[0m server.\nWould you like to enable support for linking to IPV6-enabled\nInspIRCd servers?\nIf you are using a recent operating\nsystem and are unsure, answer yes.\nIf you answer 'no' here, your InspIRCd server will be unable\nto parse IPV6 addresses (e.g. for CIDR bans)");
+ yesno('SUPPORT_IP6LINKS',"You have chosen to build an \e[1;32mIPV4-only\e[0m server.\nWould you like to enable support for linking to IPV6-enabled\nInspIRCd servers? If you are using a recent operating system and are\nunsure, answer yes. If you answer 'no' here, your InspIRCd server will\nbe unable to parse IPV6 addresses (e.g. for CIDR bans)\n\nEnable linking to servers which have IPV6 enabled?");
print "\n";
}
+ $config{USE_FREEBSD_BASE_SSL} = "n";
+ $config{USE_FREEBSD_PORTS_SSL} = "n";
+ if ($config{HAS_OPENSSL_PORT} ne "")
+ {
+ $config{USE_FREEBSD_PORTS_SSL} = "y";
+ print "I have detected the OpenSSL FreeBSD port installed on your system,\n";
+ print "version \e[1;32m".$config{HAS_OPENSSL_PORT}."\e[0m. Your base system OpenSSL is version \e[1;32m".$openssl_ver."\e[0m.\n\n";
+ yesno('USE_FREEBSD_PORTS_SSL', "Do you want to use the FreeBSD ports version?");
+ print "\n";
+ $config{USE_FREEBSD_BASE_SSL} = "y" if ($config{USE_FREEBSD_PORTS_SSL} eq "n");
+
+ if ($config{USE_FREEBSD_BASE_SSL} eq "n")
+ {
+ # update to port version
+ $openssl_ver = $config{HAS_OPENSSL_PORT};
+ }
+ }
+ else
+ {
+ $config{USE_FREEBSD_BASE_SSL} = "y" if ($^O eq "freebsd");
+ }
+
if (($config{HAS_GNUTLS} eq "y") && ($config{HAS_OPENSSL} eq "y")) {
print "I have detected both \e[1;32mGnuTLS\e[0m and \e[1;32mOpenSSL\e[0m on your system.\n";
print "I will default to GnuTLS. If you wish to use OpenSSL\n";
print "of the 'maximum number of clients' setting which may be different on\n";
print "different servers on the network.\n\n";
- # File Descriptor Settings..
- promptnumeric("number of clients at any one time", "MAX_CLIENT_T");
- $config{MAX_CLIENT} = $config{MAX_CLIENT_T};
- $config{MAX_DESCRIPTORS} = $config{MAX_CLIENT_T};
-
promptnumeric("length of nicknames", "NICK_LENGT");
promptnumeric("length of channel names", "CHAN_LENGT");
promptnumeric("number of mode changes in one line", "MAXI_MODES");
# Beware: Linux sets it's own cflags below for some retarded reason
$config{LDLIBS} = "-pthread -lstdc++";
- $config{FLAGS} = "-fPIC -Woverloaded-virtual -Wshadow -Wall $config{OPTIMISATI}";
- $config{DEVELOPER} = "-fPIC -Woverloaded-virtual -Wshadow -Wall -g";
+ $config{FLAGS} = "-fPIC -Woverloaded-virtual -Wshadow -Wformat=2 -Wmissing-format-attribute -Wall $config{OPTIMISATI}";
+ $config{DEVELOPER} = "-fPIC -Woverloaded-virtual -Wshadow -Wall -Wformat=2 -Wmissing-format-attribute -g";
$SHARED = "-Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared" unless defined $opt_disablerpath;
$config{MAKEPROG} = "make";
if ($config{OSNAME} =~ /Linux/i) {
$config{LDLIBS} = "-ldl -lstdc++ -pthread";
- $config{FLAGS} = "-fPIC -Woverloaded-virtual -Wshadow -Wall $config{OPTIMISATI}";
+# $config{FLAGS} = "-fPIC -Woverloaded-virtual -Wshadow -Wall $config{OPTIMISATI}";
$config{FLAGS} .= " " . $ENV{CXXFLAGS} if exists($ENV{CXXFLAGS});
$config{LDLIBS} .= " " . $ENV{LDLIBS} if exists($ENV{LDLIBS});
$config{MAKEPROG} = "make";
#define MOD_PATH "$config{MODULE_DIR}"
#define VERSION "$version"
#define REVISION "$revision2"
-#define MAXCLIENTS $config{MAX_CLIENT}
-#define MAXCLIENTS_S "$config{MAX_CLIENT}"
#define SOMAXCONN_S "$config{_SOMAXCONN}"
-#define MAX_DESCRIPTORS $config{MAX_DESCRIPTORS}
#define NICKMAX $NL
#define CHANMAX $CL
#define MAXMODES $config{MAXI_MODES}