- print "no\n";
- $config{HAS_OPENSSL} = "n";
-}
-
-if ($interactive)
-{
- # Clear the screen.
- system 'tput', 'clear';
-
- my $revision = getrevision();
- chomp(my $version = `sh src/version.sh`);
-
- # Display Introduction Message..
- print <<"STOP" ;
-Welcome to the \e[1mInspIRCd\e[0m Configuration program! (\e[1minteractive mode\e[0m)
-\e[1mPackage maintainers: Type ./configure --help for non-interactive help\e[0m
-
-*** If you are unsure of any of these values, leave it blank for ***
-*** standard settings that will work, and your server will run ***
-*** using them. Please consult your IRC network admin if in doubt. ***
-
-Press \e[1m<RETURN>\e[0m to accept the default for any option, or enter
-a new value. Please note: You will \e[1mHAVE\e[0m to read the docs
-dir, otherwise you won't have a config file!
-
-Your operating system is: \e[1;32m$^O\e[0m
-STOP
- print "Your InspIRCd version is: \e[1;32m";
- print $revision eq 'release' ? substr($version, 9) : substr($revision, 1);
- print "\e[0m\n\n";
- print "The following compiler has been detected: \e[1;32m$cxx{NAME} $cxx{VERSION}\e[0m ($config{CXX})\n\n";
-
- # Directory Settings..
- my $tmpbase = $config{BASE_DIR};
- dir_check("do you wish to install the InspIRCd base", "BASE_DIR");
- if ($tmpbase ne $config{BASE_DIR}) {
- $config{CONFIG_DIR} = rel2abs($config{BASE_DIR}."/conf");
- $config{MODULE_DIR} = rel2abs($config{BASE_DIR}."/modules");
- $config{DATA_DIR} = rel2abs($config{BASE_DIR}."/data");
- $config{LOG_DIR} = rel2abs($config{BASE_DIR}."/logs");
- $config{BINARY_DIR} = rel2abs($config{BASE_DIR}."/bin");
- }
-
- dir_check("are the configuration files", "CONFIG_DIR");
- dir_check("are the modules to be compiled to", "MODULE_DIR");
- dir_check("is the IRCd binary to be placed", "BINARY_DIR");
- dir_check("are variable data files to be located in", "DATA_DIR");
- dir_check("are the logs to be stored in", "LOG_DIR");
- dir_check("do you want the build to take place", "BUILD_DIR");
-
- my $chose_hiperf = 0;
- if ($config{HAS_KQUEUE}) {
- $config{USE_KQUEUE} = "y";
- yesno('USE_KQUEUE',"You are running a BSD operating system, and kqueue\nwas detected. Would you like to enable kqueue support?\nThis is likely to increase performance.\nIf you are unsure, answer yes.\n\nEnable kqueue?");
- print "\n";
- if ($config{USE_KQUEUE} eq "y") {
- $config{SOCKETENGINE} = "kqueue";
- $chose_hiperf = 1;
- }
- }
- if ($config{HAS_EPOLL}) {
- $config{USE_EPOLL} = "y";
- yesno('USE_EPOLL',"You are running a Linux 2.6+ operating system, and epoll\nwas detected. Would you like to enable epoll support?\nThis is likely to increase performance.\nIf you are unsure, answer yes.\n\nEnable epoll?");
- print "\n";
- if ($config{USE_EPOLL} eq "y") {
- $config{SOCKETENGINE} = "epoll";
- $chose_hiperf = 1;
- }
- }
- if ($config{HAS_PORTS}) {
- $config{USE_PORTS} = "y";
- yesno('USE_PORTS',"You are running Solaris 10.\nWould you like to enable I/O completion ports support?\nThis is likely to increase performance.\nIf you are unsure, answer yes.\n\nEnable support for I/O completion ports?");
- print "\n";
- if ($config{USE_PORTS} eq "y") {
- $config{SOCKETENGINE} = "ports";
- $chose_hiperf = 1;
- }
- }
-
- if (!$chose_hiperf && $config{HAS_POLL}) {
- $config{USE_POLL} = "y";
- yesno('USE_POLL', "Would you like to use poll?\nThis is likely to increase performance.\nIf you are unsure, answer yes.\n\nEnable poll?");
- if ($config{USE_POLL} eq "y") {
- $config{SOCKETENGINE} = "poll";
- }
- }
- if (!$chose_hiperf && $config{USE_POLL} ne "y")
- {
- print "No high-performance socket engines are available, or you chose\n";
- print "not to enable one. Defaulting to select() engine.\n\n";
- $config{SOCKETENGINE} = "select";
- }
-
- $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");
- }
-
- $config{USE_SSL} = "n";
-
- if ($config{HAS_GNUTLS} eq "y" || $config{HAS_OPENSSL} eq "y")
- {
- print "Detected GnuTLS version: \e[1;32m" . $gnutls_ver . "\e[0m\n";
- print "Detected OpenSSL version: \e[1;32m" . $openssl_ver . "\e[0m\n\n";
-
- yesno('USE_SSL', "One or more SSL libraries detected. Would you like to enable SSL support?");
- if ($config{USE_SSL} eq "y")
- {
- if ($config{HAS_GNUTLS} eq "y")
- {
- yesno('USE_GNUTLS',"Would you like to enable SSL with m_ssl_gnutls? (recommended)");
- if ($config{USE_GNUTLS} eq "y")
- {
- print "\nUsing GnuTLS SSL module.\n";
- }
- }
-
- if ($config{HAS_OPENSSL} eq "y")
- {
- yesno('USE_OPENSSL', "Would you like to enable SSL with m_ssl_openssl?");
- if ($config{USE_OPENSSL} eq "y")
- {
- print "\nUsing OpenSSL SSL module.\n";
- }
- }
- }
- }
- else
- {
- print "\nCould not detect OpenSSL or GnuTLS. Make sure pkg-config is installed and\n";
- print "is in your path.\n\n";
- }
-}
-
-# We are on a POSIX system, we can enable POSIX extras without asking
-symlink "extra/m_regex_posix.cpp", "src/modules/m_regex_posix.cpp";
-
-if (($config{USE_GNUTLS} eq "y") && ($config{HAS_GNUTLS} ne "y"))
-{
- print "Sorry, but i couldn't detect gnutls. Make sure gnutls-config is in your path.\n";
- exit 1;
-}
-if (($config{USE_OPENSSL} eq "y") && ($config{HAS_OPENSSL} ne "y"))
-{
- print "Sorry, but i couldn't detect openssl. Make sure openssl is in your path.\n";
- exit 1;