3 # InspIRCd Configuration Script
5 # Copyright 2002-2006 The ChatSpike Development Team
6 # <brain@chatspike.net>
7 # <Craig@chatspike.net>
9 # [14:21] Brain: <matrix impression> i know perl-fu!
13 ########################################
21 'enable-gnutls' => \$opt_use_gnutls,
22 'enable-openssl' => \$opt_use_openssl,
23 'disable-interactive' => \$opt_nointeractive,
24 'with-nick-length=i' => \$opt_nick_length,
25 'with-channel-length=i' => \$opt_chan_length,
26 'with-max-channels=i' => \$opt_maxchans,
27 'with-max-oper-channels=i' => \$opt_opermaxchans,
28 'with-max-clients' => \$opt_maxclients,
29 'enable-epoll' => \$opt_epoll,
30 'enable-kqueue' => \$opt_kqueue,
31 'disable-epoll' => \$opt_noepoll,
32 'disable-kqueue' => \$opt_nokqueue,
33 'enable-ipv6' => \$opt_ipv6,
34 'enable-remote-ipv6' => \$opt_ipv6links,
35 'disable-remote-ipv6' => \$opt_noipv6links,
36 'with-cc=s' => \$opt_cc,
37 'with-ident-length=i' => \$opt_ident,
38 'with-quit-length=i' => \$opt_quit,
39 'with-topic-length=i' => \$opt_topic,
40 'with-kick-length=i' => \$opt_kick,
41 'with-gecos-length=i' => \$opt_gecos,
42 'with-away-length=i' => \$opt_away,
43 'with-max-modes=i' => \$opt_modes,
44 'prefix=s' => \$opt_base_dir,
45 'config-dir=s' => \$opt_config_dir,
46 'module-dir=s' => \$opt_module_dir,
47 'binary-dir=s' => \$opt_binary_dir,
48 'library-dir=s' => \$opt_library_dir,
49 'disable-debuginfo' => sub { $opt_disable_debug = 1 },
50 'help' => sub { showhelp(); },
51 'modupdate' => sub { modupdate(); },
52 'update' => sub { update(); },
53 'svnupdate' => sub { svnupdate(); },
54 'clean' => sub { clean(); },
57 my $non_interactive = (
58 (defined $opt_library_dir) ||
59 (defined $opt_base_dir) ||
60 (defined $opt_config_dir) ||
61 (defined $opt_module_dir) ||
62 (defined $opt_base_dir) ||
63 (defined $opt_binary_dir) ||
64 (defined $opt_nointeractive) ||
65 (defined $opt_away) ||
66 (defined $opt_gecos) ||
67 (defined $opt_kick) ||
68 (defined $opt_maxclients) ||
69 (defined $opt_modes) ||
70 (defined $opt_topic) ||
71 (defined $opt_quit) ||
72 (defined $opt_ident) ||
74 (defined $opt_ipv6) ||
75 (defined $opt_ipv6links) ||
76 (defined $opt_noipv6links) ||
77 (defined $opt_kqueue) ||
78 (defined $opt_epoll) ||
79 (defined $opt_maxchans) ||
80 (defined $opt_opermaxchans) ||
81 (defined $opt_chan_length) ||
82 (defined $opt_nick_length) ||
83 (defined $opt_use_openssl) ||
84 (defined $opt_nokqueue) ||
85 (defined $opt_noepoll) ||
86 (defined $opt_use_gnutls)
88 my $interactive = !$non_interactive;
91 chomp($topdir = getcwd());
92 $this = resolve_directory($topdir); # PWD, Regardless.
93 @modlist = (); # Declare for Module List..
94 %config = (); # Initiate Configuration Hash..
95 $config{ME} = resolve_directory($topdir); # Present Working Directory
97 $config{BASE_DIR} = $config{ME};
99 if (defined $opt_base_dir)
101 $config{BASE_DIR} = $opt_base_dir;
104 $config{CONFIG_DIR} = resolve_directory($config{BASE_DIR}."/conf"); # Configuration Directory
105 $config{MODULE_DIR} = resolve_directory($config{BASE_DIR}."/modules"); # Modules Directory
106 $config{BINARY_DIR} = resolve_directory($config{BASE_DIR}."/bin"); # Binary Directory
107 $config{LIBRARY_DIR} = resolve_directory($config{BASE_DIR}."/lib"); # Library Directory
109 if (defined $opt_config_dir)
111 $config{CONFIG_DIR} = $opt_config_dir;
113 if (defined $opt_module_dir)
115 $config{MODULE_DIR} = $opt_module_dir;
117 if (defined $opt_binary_dir)
119 $config{BINARY_DIR} = $opt_binary_dir;
121 if (defined $opt_library_dir)
123 $config{LIBRARY_DIR} = $opt_library_dir;
125 chomp($config{HAS_GNUTLS} = `libgnutls-config --version 2>/dev/null | cut -c 1,2,3`); # GNUTLS Version.
126 chomp($config{HAS_OPENSSL} = `openssl version 2>/dev/null`); # Openssl version
127 $config{USE_GNUTLS} = "n";
128 if (defined $opt_use_gnutls)
130 $config{USE_GNUTLS} = "y"; # Use gnutls.
132 $config{USE_OPENSSL} = "n"; # Use openssl.
133 if (defined $opt_use_openssl)
135 $config{USE_OPENSSL} = "y";
138 # no, let's not change these.
139 $config{OPTIMITEMP} = "0"; # Default Optimisation Value
140 if (!defined $opt_disable_debug)
142 $config{OPTIMISATI} = "-g"; # Optimisation Flag
146 $config{OPTIMISATI} = ""; # DEBUGGING OFF!
149 $config{NICK_LENGT} = "31"; # Default Nick Length
150 if (defined $opt_nick_length)
152 $config{NICK_LENGT} = $opt_nick_length;
154 $config{CHAN_LENGT} = "64"; # Default Channel Name Length
155 if (defined $opt_chan_length)
157 $config{CHAN_LENGT} = $opt_chan_length;
159 $config{MAX_CHANNE} = "20"; # Default Max. Channels per user
160 if (defined $opt_maxchans)
162 $config{MAX_CHANNE} = $opt_maxchans;
164 $config{MAX_OPERCH} = "60"; # Default Max. Channels per oper
165 if (defined $opt_opermaxchans)
167 $config{MAX_OPERCH} = $opt_opermaxchans;
169 $config{MAXI_MODES} = "20"; # Default Max. Number of Modes set at once.
170 if (defined $opt_modes)
172 $config{MAXI_MODES} = $opt_modes;
174 $config{HAS_STRLCPY} = "false"; # strlcpy Check.
175 $config{HAS_STDINT} = "false"; # stdint.h check
176 $config{USE_KQUEUE} = "y"; # kqueue enabled
177 if (defined $opt_kqueue)
179 $config{USE_KQUEUE} = "y";
181 if (defined $opt_nokqueue)
183 $config{USE_KQUEUE} = "n";
185 $config{USE_EPOLL} = "y"; # epoll enabled
186 if (defined $opt_epoll)
188 $config{USE_EPOLL} = "y";
190 if (defined $opt_noepoll)
192 $config{USE_EPOLL} = "n";
194 $config{IPV6} = "n"; # IPv6 support (experimental)
195 if (defined $opt_ipv6)
199 $config{SUPPORT_IP6LINKS} = "y"; # IPv4 supporting IPv6 links (experimental)
200 if (defined $opt_ipv6links)
202 $config{SUPPORT_IP6LINKS} = "y";
204 if (defined $opt_noipv6links)
206 $config{SUPPORT_IP6LINKS} = "n";
208 $config{STATIC_LINK} = "no"; # are doing static modules?
209 chomp($config{MAX_CLIENT_T} = `sh -c \"ulimit -n\"`); # FD Limit
210 chomp($config{MAX_DESCRIPTORS} = `sh -c \"ulimit -n\"`); # Hard FD Limit
211 chomp($config{GCCVER} = `g++ -dumpversion | cut -c 1`); # Major GCC Version
212 chomp($config{OSNAME} = `uname`); # Operating System Name
213 $config{CC} = "g++"; # C++ compiler
216 $config{CC} = $opt_cc;
218 $exec = $config{CC} . " -dumpversion | cut -c 1";
219 chomp($config{GCCVER} = `$exec`); # Major GCC Version
220 $config{MAKEORDER} = "ircd mods"; # build order
221 $config{STATICLIBS} = ""; # library archive path
222 $config{MAX_IDENT} = "12"; # max ident size
223 $config{MAX_QUIT} = "255"; # max quit message size
224 $config{MAX_TOPIC} = "307"; # max topic size
225 $config{MAX_KICK} = "255"; # max kick message size
226 $config{MAX_GECOS} = "128"; # max GECOS size
227 $config{MAX_AWAY} = "200"; # max AWAY size
228 if (defined $opt_ident)
230 $config{MAX_IDENT} = $opt_ident;
232 if (defined $opt_quit)
234 $config{MAX_QUIT} = $opt_quit;
236 if (defined $opt_topic)
238 $config{MAX_TOPIC} = $opt_topic;
240 if (defined $opt_kick)
242 $config{MAX_KICK} = $opt_kick;
244 if (defined $opt_gecos)
246 $config{MAX_GECOS} = $opt_gecos;
248 if (defined $opt_away)
250 $config{MAX_AWAY} = $opt_away;
255 $config{HAS_OPENSSL} =~ /OpenSSL ([-[:digit:].]+)([a-z])?(\-[a-z][0-9])? (\w{3}|[0-9]+) (\w{3}|[0-9]+) [0-9]{4}/;
256 $config{HAS_OPENSSL} = $1;
258 if ($config{GCCVER} eq "") {
259 print $config{CC} . " was not found! You require g++ (the GNU C++ compiler, part of GCC) to build InspIRCd!\n";
263 # Minihack! Convert Cygwin to 'Cyg-Static' so i can
264 # Keep my dynamic module experiments here for later
267 if ($config{OSNAME} =~ /CYGWIN/)
269 $config{OSNAME} = "CYG-STATIC";
271 elsif($config{OSNAME} =~ /^MINGW32/)
273 $config{OSNAME} = "MINGW32";
275 elsif ((!$config{OSNAME}) || ($config{OSNAME} eq ""))
277 chomp($config{OSNAME} = `/usr/bin/uname`);
279 if((!$config{OSNAME}) || ($config{OSNAME} eq ""))
281 $config{OSNAME} = "Unknown";
285 if (!$config{MAX_CLIENT_T}) {
286 $config{MAX_CLIENT_T} = 1024; # Set a reasonable 'Default'
287 $fd_scan_fail = "true"; # Used Later
290 # Get and Set some important vars..
295 if ($arg eq "-clean") {
296 system("rm -rf .config.cache");
302 chomp($topdir = getcwd());
303 $this = resolve_directory($topdir); # PWD, Regardless.
305 # Does the cache file exist?
307 # No, No it doesn't.. *BASH*
308 print "You have not run ./configure before. Please do this before trying to run the update script.\n";
311 # We've Loaded the cache file and all our variables..
312 print "Updating Files..\n";
314 if ($opt_disable_debug == 1)
316 print "Disabling debug information (-g).\n";
317 $config{OPTIMISATI} = "";
320 $has_epoll = $config{HAS_EPOLL};
321 $has_kqueue = $config{HAS_KQUEUE};
330 chomp($topdir = getcwd());
331 $this = resolve_directory($topdir); # PWD, Regardless.
333 # Does the cache file exist?
335 # No, No it doesn't.. *BASH*
336 print "You have not run ./configure before. Please do this before trying to run the update script.\n";
339 # We've Loaded the cache file and all our variables..
340 print "Updating Files..\n";
342 $has_epoll = $config{HAS_EPOLL};
343 $has_kqueue = $config{HAS_KQUEUE};
355 open(FH,"<.svn/entries") or $fail = 1;
357 print "This is not an SVN copy of InspIRCd.\n";
360 system("svn update");
361 system("perl configure -update");
362 if ($ARGV[1] eq "rebuild") {
363 system("make install");
368 print "Running non-interactive configure...\n" unless $interactive;
369 print "Checking for cache from previous configure... ";
370 print ((getcache() eq "true") ? "found\n" : "not found\n");
371 print "Checking operating system version... ";
372 print getosflags() . "\n";
374 if (defined $opt_maxclients)
376 $config{MAX_CLIENT} = $opt_maxclients;
379 if (!$config{MAX_CLIENT}) {
380 # If the cache hasn't set the max clients, copy the variable of MAX_CLIENT_T, this
381 # allows us to keep _T for testing purposes. (ie. "Are you sure you want to go
382 # higher than the found value" :))
383 $config{MAX_CLIENT} = $config{MAX_CLIENT_T};
386 printf "Checking if stdint.h exists... ";
387 $config{HAS_STDINT} = "true";
389 open(STDINT, "</usr/include/stdint.h") or $config{HAS_STDINT} = "false";
390 if ($config{HAS_STDINT} eq "true") {
393 print "yes\n" if $config{HAS_STDINT} eq "true";
394 print "no\n" if $config{HAS_STDINT} eq "false";
397 printf "Checking if strlcpy exists... ";
398 # Perform the strlcpy() test..
399 $config{HAS_STRLCPY} = "false";
401 open(STRLCPY, "</usr/include/string.h") or $fail = 1;
403 while (chomp($line = <STRLCPY>)) {
404 # try and find the delcaration of:
405 # size_t strlcpy(...)
406 if ($line =~ /size_t(\0x9|\s)+strlcpy/) {
407 $config{HAS_STRLCPY} = "true";
412 print "yes\n" if $config{HAS_STRLCPY} eq "true";
413 print "no\n" if $config{HAS_STRLCPY} eq "false";
416 printf "Checking if kqueue exists... ";
419 open(KQUEUE, "</usr/include/sys/event.h") or $fail = 1;
421 while (chomp($line = <KQUEUE>)) {
422 # try and find the delcaration of:
424 if ($line =~ /int(\0x9|\s)+kqueue/) {
430 print "yes\n" if $has_kqueue == 1;
431 print "no\n" if $has_kqueue == 0;
433 printf "Checking if epoll exists... ";
436 open(EPOLL, "</usr/include/sys/epoll.h") or $fail = 1;
442 my $kernel = `uname -r`;
444 if (($kernel =~ /2\.0/) || ($kernel =~ /2\.2/) || ($kernel =~ /2\.4/)) {
448 print "yes\n" if $has_epoll == 1;
449 print "no\n" if $has_epoll == 0;
451 if (($config{OSNAME} =~ /CYGWIN/) || ($config{OSNAME} eq "CYG-STATIC")) {
452 $config{HAS_STRLCPY} = "true";
455 $config{HAS_EPOLL} = $has_epoll;
456 $config{HAS_KQUEUE} = $has_kqueue;
458 printf "Checking for libgnutls... ";
459 if (($config{HAS_GNUTLS}) && (($config{HAS_GNUTLS} >= 1.2) || ($config{HAS_GNUTLS} eq "y"))) {
461 $config{HAS_GNUTLS} = "y";
464 $config{HAS_GNUTLS} = "n";
467 printf "Checking for openssl... ";
468 if (($config{HAS_OPENSSL}) && (($config{HAS_OPENSSL} >= 0.8) || ($config{HAS_OPENSSL} eq "y"))) {
470 $config{HAS_OPENSSL} = "y";
473 $config{HAS_OPENSSL} = "n";
476 ################################################################################
477 # BEGIN INTERACTIVE PART #
478 ################################################################################
484 chomp($wholeos = `uname -sr`);
486 my $rev = getrevision();
487 # Display Introduction Message..
489 Welcome to the \033[1mInspIRCd\033[0m Configuration program! (\033[1minteractive mode\033[0m)
490 \033[1mPackage maintainers: Type ./configure --help for non-interactive help\033[0m
492 *** If you are unsure of any of these values, leave it blank for ***
493 *** standard settings that will work, and your server will run ***
494 *** using them. Please consult your IRC network admin if in doubt. ***
496 Press \033[1m<RETURN>\033[0m to accept the default for any option, or enter
497 a new value. Please note: You will \033[1mHAVE\033[0m to read the docs
498 dir, otherwise you won't have a config file!
500 Your operating system is: \033[1;32m$config{OSNAME}\033[0m ($wholeos)
501 Maximum file descriptors: \033[1;32m$config{MAX_CLIENT_T}\033[0m
502 Your InspIRCd revision ID is \033[1;32mr$rev\033[0m";
504 print " (Non-SVN build)";
508 $config{CHANGE_COMPILER} = "n";
509 print "I have detected the following compiler: \033[1;32m$config{CC}\033[0m (version \033[1;32m$config{GCCVER}.x\033[0m)\n";
511 while (($config{GCCVER} < 3) || ($config{GCCVER} eq "")) {
512 print "\033[1;32mIMPORTANT!\033[0m A GCC 2.x compiler has been detected, and
513 should NOT be used. You should probably specify a newer compiler.\n\n";
514 yesno(CHANGE_COMPILER,"Do you want to change the compiler?");
515 if ($config{CHANGE_COMPILER} =~ /y/i) {
516 print "What command do you want to use to invoke your compiler?\n";
517 print "[\033[1;32m$config{CC}\033[0m] -> ";
518 chomp($config{CC} = <STDIN>);
519 if ($config{CC} eq "") {
522 chomp($foo = `$config{CC} -dumpversion | cut -c 1`);
524 chomp($config{GCCVER} = `$config{CC} -dumpversion | cut -c 1`); # we must redo these if we change compilers
525 print "Queried compiler: \033[1;32m$config{CC}\033[0m (version \033[1;32m$config{GCCVER}.x\033[0m)\n";
526 if ($config{GCCVER} < 3) {
527 print "\033[1;32mGCC 2.x WILL NOT WORK!\033[0m. Let's try that again, shall we?\n";
531 print "\033[1;32mWARNING!\033[0m Could not execute the compiler you specified. You may want to try again.\n";
538 # Directory Settings..
539 my $tmpbase = $config{BASE_DIR};
540 dir_check("do you wish to install the InspIRCd base", "BASE_DIR");
541 if ($tmpbase ne $config{BASE_DIR}) {
542 $config{CONFIG_DIR} = resolve_directory($config{BASE_DIR}."/conf"); # Configuration Dir
543 $config{MODULE_DIR} = resolve_directory($config{BASE_DIR}."/modules"); # Modules Directory
544 $config{BINARY_DIR} = resolve_directory($config{BASE_DIR}."/bin"); # Binary Directory
545 $config{LIBRARY_DIR} = resolve_directory($config{BASE_DIR}."/lib"); # Library Directory
548 dir_check("are the configuration files", "CONFIG_DIR");
549 dir_check("are the modules to be compiled to", "MODULE_DIR");
550 dir_check("is the IRCd binary to be placed", "BINARY_DIR");
551 dir_check("are the IRCd libraries to be placed", "LIBRARY_DIR");
554 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?");
558 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?");
561 $chose_hiperf = (($config{USE_EPOLL} eq "y") || ($config{USE_KQUEUE} eq "y"));
562 if (!$chose_hiperf) {
563 print "No high-performance socket engines are available, or you chose\n";
564 print "not to enable one. Defaulting to select() engine.\n\n";
567 yesno(IPV6,"Would you like to build InspIRCd with IPv6 support?");
570 if ($config{IPV6} eq "y") {
571 print "You have chosen to build an \033[1;32mIPV6-only\033[0m server.\nTo accept IPV4 users, you must use the '::ffff:' notation of addresses.\n\n";
572 $config{SUPPORT_IP6LINKS} = "y";
574 yesno(SUPPORT_IP6LINKS,"You have chosen to build an \033[1;32mIPV4-only\033[0m server.\nWould you like to enable support for linking to IPV6-enabled\nInspIRCd servers which are using '::ffff:' notation?\nIf you are using a recent operating\nsystem and are unsure, answer yes.");
578 if (($config{HAS_GNUTLS} eq "y") && ($config{HAS_OPENSSL} eq "y")) {
579 print "I have detected both GnuTLS and OpenSSL on your system.\n";
580 print "I will default to GnuTLS. If you wish to use OpenSSL\n";
581 print "instead, you should enable the OpenSSL module yourself\n";
582 print "by copying it from src/modules/extra to src/modules.\n\n";
585 if ($config{HAS_GNUTLS} eq "y") {
586 yesno(USE_GNUTLS, "Would you like to enable SSL Support?");
587 if ($config{USE_GNUTLS} eq "y") {
588 print "\nUsing GnuTLS SSL module.\n";
590 } elsif ($config{HAS_OPENSSL} eq "y") {
591 yesno(USE_OPENSSL, "Would you like to enable SSL Support?");
592 if ($config{USE_OPENSSL} eq "y") {
593 print "\nUsing OpenSSL SSL module.\nYou will get better performance if you move to GnuTLS in the future.\n";
597 print "\nThe following questions will ask you for various figures relating\n";
598 print "To your IRCd install. Please note that these should usually be left\n";
599 print "as defaults unless you have a real reason to change them. If they\n";
600 print "changed, then the values must be identical on all servers on your\n";
601 print "network, or malfunctions and/or crashes may occur, with the exception\n";
602 print "of the 'maximum number of clients' setting which may be different on\n";
603 print "different servers on the network.\n\n";
605 # File Descriptor Settings..
608 print "Maximum number of clients at any one time ($config{MAX_CLIENT_T})\n";
609 print "[\033[1;32m$config{MAX_CLIENT}\033[0m] -> ";
610 chomp($var = <STDIN>);
612 $var = $config{MAX_CLIENT};
614 if ($var =~ /^\d+$/) {
615 if (($var > $config{MAX_CLIENT_T}) && ($fd_scan_fail ne "true")) {
616 # Client has entered a larger number than the 'discovered' value
618 print "WARNING: Our scans have indicated that you are attempting
619 to use more sockets than there are avaliable. Are you sure
620 you wish to do this? It may cause the IRCd to malfunction [y/n]
621 [\033[1;32mn\033[0m] -> $c";
622 chomp($tmp = <STDIN>);
624 print "Please enter the correct value.\n\n";
629 print "You must enter a number in this field. Please try again.\n\n";
632 # If we get here, we should be good to go.
633 $config{MAX_CLIENT} = $var;
634 $config{MAX_DESCRIPTORS} = $var;
641 print "What is the maximum length of nicknames?\n";
642 print "[\033[1;32m$config{NICK_LENGT}\033[0m] -> ";
643 chomp($var = <STDIN>);
645 $var = $config{NICK_LENGT};
647 if ($var =~ /^\d+$/) {
648 # We don't care what the number is, set it and be on our way.
649 $config{NICK_LENGT} = $var;
653 print "You must enter a number in this field. Please try again.\n\n";
659 print "What is the maximum length of channel names?\n";
660 print "[\033[1;32m$config{CHAN_LENGT}\033[0m] -> ";
661 chomp($var = <STDIN>);
663 $var = $config{CHAN_LENGT};
665 if ($var =~ /^\d+$/) {
666 # We don't care what the number is, set it and be on our way.
667 $config{CHAN_LENGT} = $var;
671 print "You must enter a number in this field. Please try again.\n\n";
677 print "What is the maximum number of channels a normal user may join at any one time?\n";
678 print "[\033[1;32m$config{MAX_CHANNE}\033[0m] -> ";
679 chomp($var = <STDIN>);
681 $var = $config{MAX_CHANNE};
683 if ($var =~ /^\d+$/) {
684 # We don't care what the number is, set it and be on our way.
685 $config{MAX_CHANNE} = $var;
689 print "You must enter a number in this field. Please try again.\n\n";
695 print "What is the maximum number of channels an oper may join at any one time?\n";
696 print "[\033[1;32m$config{MAX_OPERCH}\033[0m] -> ";
697 chomp($var = <STDIN>);
699 $var = $config{MAX_OPERCH};
701 if ($var =~ /^\d+$/) {
702 # We don't care what the number is, set it and be on our way.
703 $config{MAX_OPERCH} = $var;
711 print "What is the maximum number of mode changes in one line?\n";
712 print "[\033[1;32m$config{MAXI_MODES}\033[0m] -> ";
713 chomp($var = <STDIN>);
715 $var = $config{MAXI_MODES};
717 if ($var =~ /^\d+$/) {
718 # We don't care what the number is, set it and be on our way.
719 $config{MAXI_MODES} = $var;
723 print "You must enter a number in this field. Please try again.\n\n";
729 print "What is the maximum length of an ident (username)?\n";
730 print "[\033[1;32m$config{MAX_IDENT}\033[0m] -> ";
731 chomp($var = <STDIN>);
733 $var = $config{MAX_IDENT};
735 if ($var =~ /^\d+$/) {
736 # We don't care what the number is, set it and be on our way.
737 $config{MAX_IDENT} = $var;
741 print "You must enter a number in this field. Please try again.\n\n";
747 print "What is the maximum length of a quit message?\n";
748 print "[\033[1;32m$config{MAX_QUIT}\033[0m] -> ";
749 chomp($var = <STDIN>);
751 $var = $config{MAX_QUIT};
753 if ($var =~ /^\d+$/) {
754 # We don't care what the number is, set it and be on our way.
755 $config{MAX_QUIT} = $var;
759 print "You must enter a number in this field. Please try again.\n\n";
765 print "What is the maximum length of a channel topic?\n";
766 print "[\033[1;32m$config{MAX_TOPIC}\033[0m] -> ";
767 chomp($var = <STDIN>);
769 $var = $config{MAX_TOPIC};
771 if ($var =~ /^\d+$/) {
772 # We don't care what the number is, set it and be on our way.
773 $config{MAX_TOPIC} = $var;
777 print "You must enter a number in this field. Please try again.\n\n";
783 print "What is the maximum length of a kick message?\n";
784 print "[\033[1;32m$config{MAX_KICK}\033[0m] -> ";
785 chomp($var = <STDIN>);
787 $var = $config{MAX_KICK};
789 if ($var =~ /^\d+$/) {
790 # We don't care what the number is, set it and be on our way.
791 $config{MAX_KICK} = $var;
795 print "You must enter a number in this field. Please try again.\n\n";
801 print "What is the maximum length of a GECOS (real name) field?\n";
802 print "[\033[1;32m$config{MAX_GECOS}\033[0m] -> ";
803 chomp($var = <STDIN>);
805 $var = $config{MAX_GECOS};
807 if ($var =~ /^\d+$/) {
808 # We don't care what the number is, set it and be on our way.
809 $config{MAX_GECOS} = $var;
813 print "You must enter a number in this field. Please try again.\n\n";
819 print "What is the maximum length of an away message?\n";
820 print "[\033[1;32m$config{MAX_AWAY}\033[0m] -> ";
821 chomp($var = <STDIN>);
823 $var = $config{MAX_AWAY};
825 if ($var =~ /^\d+$/) {
826 # We don't care what the number is, set it and be on our way.
827 $config{MAX_AWAY} = $var;
831 print "You must enter a number in this field. Please try again.\n\n";
836 print "\n\033[1;32mPre-build configuration is complete!\033[0m\n\n";
837 print "\033[0mBase install path:\033[1;32m\t\t$config{BASE_DIR}\033[0m\n";
838 print "\033[0mConfig path:\033[1;32m\t\t\t$config{CONFIG_DIR}\033[0m\n";
839 print "\033[0mModule path:\033[1;32m\t\t\t$config{MODULE_DIR}\033[0m\n";
840 print "\033[0mLibrary path:\033[1;32m\t\t\t$config{LIBRARY_DIR}\033[0m\n";
841 print "\033[0mMax connections:\033[1;32m\t\t$config{MAX_CLIENT}\033[0m\n";
842 print "\033[0mMax User Channels:\033[1;32m\t\t$config{MAX_CHANNE}\033[0m\n";
843 print "\033[0mMax Oper Channels:\033[1;32m\t\t$config{MAX_OPERCH}\033[0m\n";
844 print "\033[0mMax nickname length:\033[1;32m\t\t$config{NICK_LENGT}\033[0m\n";
845 print "\033[0mMax channel length:\033[1;32m\t\t$config{CHAN_LENGT}\033[0m\n";
846 print "\033[0mMax mode length:\033[1;32m\t\t$config{MAXI_MODES}\033[0m\n";
847 print "\033[0mMax ident length:\033[1;32m\t\t$config{MAX_IDENT}\033[0m\n";
848 print "\033[0mMax quit length:\033[1;32m\t\t$config{MAX_QUIT}\033[0m\n";
849 print "\033[0mMax topic length:\033[1;32m\t\t$config{MAX_TOPIC}\033[0m\n";
850 print "\033[0mMax kick length:\033[1;32m\t\t$config{MAX_KICK}\033[0m\n";
851 print "\033[0mMax name length:\033[1;32m\t\t$config{MAX_GECOS}\033[0m\n";
852 print "\033[0mMax away length:\033[1;32m\t\t$config{MAX_AWAY}\033[0m\n";
853 print "\033[0mGCC Version Found:\033[1;32m\t\t$config{GCCVER}.x\033[0m\n";
854 # and not echo it out so we don't get some ricer fuck complaining
855 #print "\033[0mOptimization Flag:\033[1;32m\t\t$config{OPTIMISATI}\033[0m\n";
856 print "\033[0mCompiler program:\033[1;32m\t\t$config{CC}\033[0m\n";
857 print "\033[0mStatic modules:\033[1;32m\t\t\t$config{STATIC_LINK}\033[0m\n";
858 print "\033[0mIPv6 Support:\033[1;32m\t\t\t$config{IPV6}\033[0m\n";
859 print "\033[0mIPv6 to IPv4 Links:\033[1;32m\t\t$config{SUPPORT_IP6LINKS}\033[0m\n";
860 print "\033[0mGnuTLS Support:\033[1;32m\t\t\t$config{USE_GNUTLS}\033[0m\n";
861 print "\033[0mOpenSSL Support:\033[1;32m\t\t$config{USE_OPENSSL}\033[0m\n\n";
863 if (($config{USE_GNUTLS} eq "y") && ($config{HAS_GNUTLS} ne "y"))
865 print "Sorry, but i couldn't detect gnutls. Make sure gnutls-config is in your path.\n";
868 if (($config{USE_OPENSSL} eq "y") && ($config{HAS_OPENSSL} ne "y"))
870 print "Sorry, but i couldn't detect openssl. Make sure openssl is in your path.\n";
874 if ($config{USE_GNUTLS} eq "y") {
876 open(TMP, "<src/modules/m_ssl_gnutls.cpp") or $failed = 1;
879 print "Symlinking src/modules/m_ssl_gnutls.cpp from extra/\n";
880 chdir("src/modules");
881 system("ln -s extra/m_ssl_gnutls.cpp");
882 system("ln -s extra/ssl_cert.h");
889 open(TMP, "<$config{CONFIG_DIR}/key.pem") or $failed = 1;
891 open(TMP, "<$config{CONFIG_DIR}/cert.pem") or $failed = 1;
894 print "SSL Certificates Not found, Generating.. \n\n
895 *************************************************************
896 * Generating the Private Key may take some time, go grab a *
897 * Coffee. Even better, to generate some more entropy if it *
898 * is taking a while, open another console and type du / a *
899 * few times and get that HD going :) Then answer the *
900 * Questions which follow. If you are unsure, just hit enter *
901 *************************************************************\n\n";
902 system("certtool --generate-privkey --outfile key.pem");
903 system("certtool --generate-self-signed --load-privkey key.pem --outfile cert.pem");
904 print "\nCertificate generation complete, copying to config directory... ";
905 system("mv key.pem $config{CONFIG_DIR}/key.pem");
906 system("mv cert.pem $config{CONFIG_DIR}/cert.pem");
909 print "SSL Certificates found, skipping.\n\n"
914 print "Skipping SSL certificate generation\nin non-interactive mode.\n\n";
916 } elsif ($config{USE_OPENSSL} eq "y") {
918 open(TMP, "<src/modules/m_ssl_openssl.cpp") or $failed = 1;
921 print "Symlinking src/modules/m_ssl_openssl.cpp from extra/\n";
922 chdir("src/modules");
923 system("ln -s extra/m_ssl_openssl.cpp");
924 system("ln -s extra/ssl_cert.h");
931 open(TMP, "<$config{CONFIG_DIR}/key.pem") or $failed = 1;
933 open(TMP, "<$config{CONFIG_DIR}/cert.pem") or $failed = 1;
936 print "SSL Certificates Not found, Generating.. \n\n
937 *************************************************************
938 * Generating the certificates may take some time, go grab a *
939 * coffee, or something. *
940 *************************************************************\n\n";
941 system("openssl req -x509 -nodes -newkey rsa:1024 -keyout key.pem -out cert.pem");
942 system("openssl dhparam -out dhparams.pem 1024");
943 print "\nCertificate generation complete, copying to config directory... ";
944 system("mv key.pem $config{CONFIG_DIR}/key.pem");
945 system("mv cert.pem $config{CONFIG_DIR}/cert.pem");
946 system("mv dhparams.pem $config{CONFIG_DIR}/dhparams.pem");
949 print "SSL Certificates found, skipping.\n\n"
954 print "Skipping SSL certificate generation\nin non-interactive mode.\n\n";
957 if (($config{USE_GNUTLS} eq "n") && ($config{USE_OPENSSL} eq "n")) {
958 print "Skipping SSL Certificate generation, SSL support is not available.\n\n";
966 print "To build your server with these settings, please type '\033[1;32m$config{MAKEPROG}\033[0m' now.\n";
967 if (($config{USE_GNUTLS} eq "y") || ($config{USE_OPENSSL} eq "y")) {
968 print "Please remember that to enable \033[1;32mSSL support\033[0m you must\n";
969 print "load the required modules in your config. This configure process\n";
970 print "has just prepared these modules to be compiled for you, and has not\n";
971 print "configured them to be compiled into the core of the ircd.\n";
973 print "*** \033[1;32mRemember to edit your configuration files!!!\033[0m ***\n\n\n";
974 if (($config{OSNAME} eq "OpenBSD") && ($config{CC} ne "eg++")) {
975 print "\033[1;32mWARNING!\033[0m You are running OpenBSD but you are using the base gcc package\nrather than eg++. This compile will most likely fail, but i'm letting you\ngo ahead with it anyway, just in case i'm wrong :-)\n";
978 if ($config{GCCVER} < "3") {
980 \033[1;32mWARNING!\033[0m You are attempting to compile InspIRCd on GCC 2.x!
981 GCC 2.x series compilers only had partial (read as broken) C++ support, and
982 your compile will most likely fail horribly! If you have any problems, do NOT
983 report them to the bugtracker or forums without first upgrading your compiler
984 to a newer 3.x or 4.x (or whatever is available currently) version.
988 ################################################################################
990 ################################################################################
992 # Retrieves the .config.cache file, and loads values into the main config hash.
993 open(CACHE, ".config.cache") or return undef;
996 # Ignore Blank lines, and comments..
999 my ($key, $value) = split("=", $_);
1000 $value =~ /^\"(.*)\"$/;
1001 # Do something with data here!
1009 # Dump the contents of %config
1010 print "Writing \033[1;32mcache file\033[0m for future ./configures ...\n";
1011 open(FILEHANDLE, ">.config.cache");
1012 foreach $key (keys %config) {
1013 print FILEHANDLE "$key=\"$config{$key}\"\n";
1019 my ($desc, $hash_key) = @_;
1021 while (!$complete) {
1022 print "In what directory $desc?\n";
1023 print "[\033[1;32m$config{$hash_key}\033[0m] -> ";
1024 chomp($var = <STDIN>);
1026 $var = $config{$hash_key};
1028 if ($var =~ /^\~\/(.+)$/) {
1029 # Convert it to a full path..
1030 $var = resolve_directory($ENV{HOME} . "/" . $1);
1032 elsif ((($config{OSNAME} == "MINGW32") and ($var !~ /^[A-Z]{1}:\\.*/)) and (substr($var,0,1) ne "/"))
1034 # Assume relative Path was given.. fill in the rest.
1035 $var = $this . "/$var";
1038 $var = resolve_directory($var);
1040 print "$var does not exist. Create it?\n[\033[1;32my\033[0m] ";
1041 chomp($tmp = <STDIN>);
1042 if (($tmp eq "") || ($tmp =~ /^y/i)) {
1043 # Attempt to Create the Dir..
1045 system("mkdir -p \"$var\" >> /dev/null 2>&1");
1046 $chk = system("mkdir -p \"$var\" >> /dev/null 2>&1") / 256;
1048 print "Unable to create directory. ($var)\n\n";
1053 # They said they don't want to create, and we can't install there.
1058 if (!is_dir($var)) {
1059 # Target exists, but is not a directory.
1060 print "File $var exists, but is not a directory.\n\n";
1064 # Either Dir Exists, or was created fine.
1065 $config{$hash_key} = $var;
1073 $config{LDLIBS} = "-lstdc++";
1074 $config{FLAGS} = "-fno-strict-aliasing -fPIC -Wall -Woverloaded-virtual $config{OPTIMISATI}";
1075 $config{MAKEPROG} = "make";
1077 if ($config{OSNAME} eq "OpenBSD") {
1078 $config{MAKEPROG} = "gmake";
1079 chomp($foo = `eg++ -dumpversion | cut -c 1`);
1080 # theyre running the package version of gcc (eg++)... detect it and set up its version numbers.
1081 # if theyre not running this, configure lets the build continue but they probably wont manage to
1082 # compile as this standard version is 2.95.3!
1084 $config{CC} = "eg++";
1085 chomp($config{GCCVER} = `eg++ -dumpversion | cut -c 1`); # we must redo these if we change the compiler path
1090 if ($config{OSNAME} =~ /Linux/) {
1091 $config{LDLIBS} = "-ldl -lstdc++";
1092 $config{FLAGS} = "-fno-strict-aliasing -fPIC -Wall -Woverloaded-virtual $config{OPTIMISATI}";
1093 $config{FLAGS} .= " " . $ENV{CXXFLAGS} if exists($ENV{CXXFLAGS});
1094 $config{MAKEPROG} = "make";
1095 if ($config{OSNAME} =~ /CYGWIN/) {
1096 $config{FLAGS} = "-fno-strict-aliasing -Wall -Woverloaded-virtual $config{OPTIMISATI}";
1097 $config{LDLIBS} = "";
1098 $config{MAKEPROG} = "/usr/bin/make";
1099 $config{MAKEORDER} = "ircd mods";
1101 } elsif ($config{OSNAME} eq "CYG-STATIC") {
1102 $config{FLAGS} = "-fno-strict-aliasing -Wall -Woverloaded-virtual $config{OPTIMISATI}";
1103 $config{LDLIBS} = "";
1104 $config{MAKEPROG} = "/usr/bin/make";
1105 $config{MAKEORDER} = "mods ircd";
1106 $config{STATICLIBS} = "modules/mods.a";
1107 $config{STATIC_LINK} = "yes";
1108 return "Cygwin-Static";
1110 $config{FLAGS} .= " " . $ENV{CXXFLAGS} if exists($ENV{CXXFLAGS});
1113 if ($config{OSNAME} =~ /SunOS/)
1115 # solaris/sunos needs these
1116 # socket = bsd sockets api
1118 # rt = POSIX realtime extensions
1119 # resolv = inet_aton only (why isnt this in nsl?!)
1120 $config{MAKEPROG} = "gmake";
1121 $config{LDLIBS} = $config{LDLIBS} . " -lsocket -lnsl -lrt -lresolv";
1125 if($config{OSNAME} eq "MINGW32")
1127 # All code is position-independent on windows
1128 $config{FLAGS} =~ s/-fPIC //;
1132 return $config{OSNAME};
1149 print "Detecting modules ";
1150 opendir(DIRHANDLE, "src/modules");
1151 foreach $name (sort readdir(DIRHANDLE)) {
1152 if ($name =~ /^m_(.+)\.cpp$/)
1155 if ($mod !~ /_static$/) {
1156 $modlist[$i++] = $mod;
1161 closedir(DIRHANDLE);
1162 print "\nOk, $i modules.\n";
1169 my $data = `svn info`;
1176 $data =~ /Revision: (\d+)/;
1178 if (!defined($rev)) {
1185 my($writeheader) = @_;
1186 # First File.. inspircd_config.h
1187 chomp(my $incos = `uname -n -s -r`);
1188 chomp(my $version = `sh ./src/version.sh`);
1189 chomp(my $revision = getrevision());
1190 $version = "$version(r$revision)";
1191 chomp(my $revision2 = getrevision());
1192 if ($writeheader == 1)
1194 print "Writing \033[1;32minspircd_config.h\033[0m\n";
1195 open(FILEHANDLE, ">include/inspircd_config.h");
1196 my $NL = $config{NICK_LENGT}+1;
1197 my $CL = $config{CHAN_LENGT}+1;
1198 print FILEHANDLE <<EOF;
1199 /* Auto generated by configure, do not modify! */
1200 #ifndef __CONFIGURATION_AUTO__
1201 #define __CONFIGURATION_AUTO__
1203 #define CONFIG_FILE "$config{CONFIG_DIR}/inspircd.conf"
1204 #define MOD_PATH "$config{MODULE_DIR}"
1205 #define VERSION "$version"
1206 #define REVISION "$revision2"
1207 #define MAXCLIENTS $config{MAX_CLIENT}
1208 #define MAX_DESCRIPTORS $config{MAX_DESCRIPTORS}
1211 #define MAXCHANS $config{MAX_CHANNE}
1212 #define OPERMAXCHANS $config{MAX_OPERCH}
1213 #define MAXMODES $config{MAXI_MODES}
1214 #define IDENTMAX $config{MAX_IDENT}
1215 #define MAXQUIT $config{MAX_QUIT}
1216 #define MAXTOPIC $config{MAX_TOPIC}
1217 #define MAXKICK $config{MAX_KICK}
1218 #define MAXGECOS $config{MAX_GECOS}
1219 #define MAXAWAY $config{MAX_AWAY}
1220 #define OPTIMISATION $config{OPTIMITEMP}
1221 #define LIBRARYDIR "$config{LIBRARY_DIR}"
1222 #define SYSTEM "$incos"
1225 if ($config{OSNAME} =~ /SunOS/) {
1226 print FILEHANDLE "#define IS_SOLARIS\n";
1228 if ($config{OSNAME} =~ /CYGWIN/) {
1229 print FILEHANDLE "#define IS_CYGWIN\n";
1230 print FILEHANDLE "#ifndef FD_SETSIZE\n#define FD_SETSIZE 1024\n#endif\n";
1232 if ($config{OSNAME} eq "MINGW32") {
1233 print FILEHANDLE "#define IS_MINGW\n";
1235 if ($config{OSNAME} eq "CYG-STATIC") {
1236 print FILEHANDLE "#ifndef FD_SETSIZE\n#define FD_SETSIZE 1024\n#endif\n";
1238 if ($config{STATIC_LINK} eq "yes") {
1239 print FILEHANDLE "#define STATIC_LINK\n";
1241 if ($config{GCCVER} >= 3) {
1242 print FILEHANDLE "#define GCC3\n";
1244 if ($config{HAS_STRLCPY} eq "true") {
1245 print FILEHANDLE "#define HAS_STRLCPY\n";
1247 if ($config{HAS_STDINT} eq "true") {
1248 print FILEHANDLE "#define HAS_STDINT\n";
1250 if ($config{IPV6} =~ /y/i) {
1251 print FILEHANDLE "#define IPV6\n";
1253 if ($config{SUPPORT_IP6LINKS} =~ /y/i) {
1254 print FILEHANDLE "#define SUPPORT_IP6LINKS\n";
1257 if (($has_kqueue) && ($config{USE_KQUEUE} eq "y")) {
1258 print FILEHANDLE "#define USE_KQUEUE\n";
1259 $se = "socketengine_kqueue";
1262 if (($has_epoll) && ($config{USE_EPOLL} eq "y")) {
1263 print FILEHANDLE "#define USE_EPOLL\n";
1264 $se = "socketengine_epoll";
1267 # user didn't choose either epoll or select for their OS.
1268 # default them to USE_SELECT (ewwy puke puke)
1270 print FILEHANDLE "#define USE_SELECT\n";
1271 $se = "socketengine_select";
1273 print FILEHANDLE "\n#endif\n";
1279 open(FILEHANDLE, ">include/inspircd_se_config.h");
1280 print FILEHANDLE <<EOF;
1281 /* Auto generated by configure, do not modify or commit to svn! */
1282 #ifndef __CONFIGURATION_SOCKETENGINE__
1283 #define __CONFIGURATION_SOCKETENGINE__
1293 # Create a Modules List..
1295 foreach $i (@modlist)
1297 if ($config{STATIC_LINK} eq "yes") {
1298 $modules .= "m_".$i.".o ";
1301 $modules .= "m_".$i.".so ";
1304 chomp($modules); # Remove Redundant whitespace..
1307 # Write all .in files.
1310 my $exe = "inspircd";
1312 if ($config{OSNAME} =~ /CYGWIN/) {
1313 $exe = "inspircd.exe";
1316 opendir(DIRHANDLE, $this);
1318 # Do this once here, and cache it in the .*.inc files,
1319 # rather than attempting to read src/version.sh from
1320 # compiled code -- we might not have the source to hand.
1321 # Fix for bug#177 by Brain.
1323 chomp(my $version = `sh ./src/version.sh`);
1324 chomp(my $revision = getrevision());
1325 $version = "$version(r$revision)";
1327 # We can actually parse any file starting with . and ending with .inc,
1328 # but right now we only parse .inspircd.inc to form './inspircd'
1330 foreach $name (sort readdir(DIRHANDLE)) {
1331 if ($name =~ /^\.(.+)\.inc$/) {
1333 # All .name.inc files need parsing!
1335 open(FILEHANDLE, ".$file.inc");
1336 while (<FILEHANDLE>) {
1341 $tmp =~ s/\@CC\@/$config{CC}/;
1342 $tmp =~ s/\@MAKEPROG\@/$config{MAKEPROG}/;
1343 $tmp =~ s/\@FLAGS\@/$config{FLAGS}/;
1344 $tmp =~ s/\@LDLIBS\@/$config{LDLIBS}/;
1345 $tmp =~ s/\@BASE_DIR\@/$config{BASE_DIR}/;
1346 $tmp =~ s/\@CONFIG_DIR\@/$config{CONFIG_DIR}/;
1347 $tmp =~ s/\@MODULE_DIR\@/$config{MODULE_DIR}/;
1348 $tmp =~ s/\@BINARY_DIR\@/$config{BINARY_DIR}/;
1349 $tmp =~ s/\@LIBRARY_DIR\@/$config{LIBRARY_DIR}/;
1350 $tmp =~ s/\@MODULES\@/$modules/;
1351 $tmp =~ s/\@EXECUTABLE\@/$exe/;
1352 $tmp =~ s/\@MAKEORDER\@/$config{MAKEORDER}/;
1353 $tmp =~ s/\@STATICLIBS\@/$config{STATICLIBS}/;
1354 $tmp =~ s/\@VERSION\@/$version/;
1356 print "Writing \033[1;32m$file\033[0m\n";
1357 open(FILEHANDLE, ">$file");
1358 print FILEHANDLE $tmp;
1361 closedir(DIRHANDLE);
1363 # Make inspircd executable!
1364 chmod 0744, 'inspircd';
1366 if ($config{STATIC_LINK} eq "yes") {
1367 print "Writing static-build \033[1;32msrc/Makefile\033[0m\n";
1368 write_static_makefile();
1369 write_static_modules_makefile();
1370 } elsif ($config{OSNAME} =~ /CYGWIN/) {
1371 print "Writing cygwin-build \033[1;32msrc/Makefile\033[0m\n";
1372 write_static_makefile();
1373 write_dynamic_modules_makefile();
1375 print "Writing dynamic-build \033[1;32msrc/Makefile\033[0m\n";
1376 write_dynamic_makefile();
1377 write_dynamic_modules_makefile();
1381 sub getcompilerflags {
1385 if ($_ =~ /^\/\* \$CompileFlags: (.+) \*\/$/) {
1394 sub getlinkerflags {
1398 if ($_ =~ /^\/\* \$LinkerFlags: (.+) \*\/$/) {
1407 sub getdependencies {
1411 if ($_ =~ /^\/\* \$ModDep: (.+) \*\/$/) {
1420 sub resolve_directory {
1422 return File::Spec->rel2abs($_[0]);
1426 my ($flag,$prompt) = @_;
1427 print "$prompt [\033[1;32m$config{$flag}\033[0m] -> ";
1428 chomp($tmp = <STDIN>);
1429 if ($tmp eq "") { $tmp = $config{$flag} }
1431 if (($tmp eq "") || ($tmp =~ /^y/i)) {
1432 $config{$flag} = "y";
1434 $config{$flag} = "n";
1439 sub write_static_modules_makefile {
1440 # Modules Makefile..
1441 print "Writing \033[1;32msrc/modules/Makefile\033[0m\n";
1442 open(FILEHANDLE, ">src/modules/Makefile");
1445 # Module Makefile Header
1447 print FILEHANDLE <<EOF;
1448 # (C) ChatSpike development team
1449 # Makefile by <Craig\@ChatSpike.net>
1450 # Many Thanks to Andrew Church <achurch\@achurch.org>
1451 # for assisting with making this work right.
1453 # Automatically Generated by ./configure to add a modules
1454 # please run ./configure --update
1460 # End Module Makefile Header
1463 # Create a Modules List..
1468 open(MODLIST,">include/modlist.h");
1471 # Include File Header
1473 print MODLIST <<HEADER;
1474 // Generated automatically by configure. DO NOT EDIT!
1476 #ifndef __SYMBOLS__H_CONFIGURED__
1477 #define __SYMBOLS__H_CONFIGURED__
1481 # End Include File Header
1484 # Place Module List into Include
1485 foreach $i (@modlist) {
1486 if ($i !~ /_static$/) {
1487 print MODLIST "extern \"C\" void * $i\_init (void);\n";
1490 print MODLIST "\nstruct {const char *name; initfunc *value; } modsyms[] = {\n";
1495 foreach $i (@modlist)
1497 if ($i !~ /_static$/) {
1498 $cmflags = getcompilerflags("src/modules/m_".$i.".cpp");
1499 $liflags = getlinkerflags("src/modules/m_".$i.".cpp");
1500 $deps = getdependencies("src/modules/m_".$i.".cpp");
1503 # Write Entry to the Makefile
1505 print FILEHANDLE <<EOCHEESE;
1506 m_$i.o: .m_$i\_static.cpp ../../include/modules.h ../../include/users.h ../../include/channels.h ../../include/base.h $deps
1507 \$(CC) -pipe -I../../include \$(FLAGS) $flags -export-dynamic -c .m_$i\_static.cpp
1508 mv .m_$i\_static.o ../m_$i.o
1512 # End Write Entry to the MakeFile
1514 print "Configuring module [\033[1;32mm_$i.so\033[0m] for static linking... ";
1515 open(MODULE,"<src/modules/m_".$i.".cpp") or die("Could not open m_".$i.".cpp");
1516 open(MUNGED,">src/modules/.m_".$i."_static.cpp") or die("Could not create .m_".$i."_static.cpp");
1517 while (chomp($a = <MODULE>)) {
1518 $a =~ s/init_module/$i\_init/g;
1519 print MUNGED "$a\n";
1523 print MODLIST <<EOENT;
1524 {"m_$i.so",\&$i\_init},
1529 print MODLIST "{0}};\n\n#endif\n";
1533 sub write_dynamic_modules_makefile {
1534 # Modules Makefile..
1535 print "Writing \033[1;32msrc/modules/Makefile\033[0m\n";
1536 open(FILEHANDLE, ">src/modules/Makefile");
1539 if ($config{OSNAME} =~ /CYGWIN/) {
1540 $extra = "../inspircd.dll.a";
1544 # Module Makefile Header
1546 print FILEHANDLE <<EOF;
1547 # (C) ChatSpike development team
1548 # Makefile by <Craig\@ChatSpike.net>
1549 # Many Thanks to Andrew Church <achurch\@achurch.org>
1550 # for assisting with making this work right.
1552 # Automatically Generated by ./configure to add a modules
1553 # please run ./configure -update or ./configure -modupdate
1559 # End Module Makefile Header
1562 # Create a Modules List..
1568 foreach $i (@modlist) {
1570 # Write Entry to the MakeFile
1572 $cmflags = getcompilerflags("src/modules/m_".$i.".cpp");
1573 $liflags = getlinkerflags("src/modules/m_".$i.".cpp");
1574 $deps = getdependencies("src/modules/m_".$i.".cpp");
1575 print FILEHANDLE <<EOCHEESE;
1576 m_$i.so: m_$i.cpp ../../include/modules.h ../../include/users.h ../../include/channels.h ../../include/base.h ../../include/inspircd_config.h ../../include/inspircd.h ../../include/configreader.h $deps
1577 \$(CC) -pipe -I../../include \$(FLAGS) $cmflags -export-dynamic -c m_$i.cpp
1578 \$(CC) -pipe \$(FLAGS) -shared $liflags -o m_$i.so m_$i.o $extra
1581 $crud = $crud . " install -m 0700 m_$i.so \$(MODPATH)\n";
1583 # End Write Entry to the MakeFile
1586 print FILEHANDLE "modinst:\n \@echo \"Installing modules...\"\n" . $crud;
1590 sub write_static_makefile {
1591 open(FH,">src/Makefile") or die("Could not write src/Makefile!");
1594 opendir(DIRHANDLE, "src");
1595 foreach $name (sort readdir(DIRHANDLE)) {
1596 if ($name =~ /^cmd_(.+)\.cpp$/) {
1597 $cmdlist[$i++] = $1;
1600 closedir(DIRHANDLE);
1603 foreach my $cmd (@cmdlist) {
1604 $cmdobjs = $cmdobjs . "cmd_$cmd.o ";
1605 $srcobjs = $srcobjs . "cmd_$cmd.cpp ";
1610 # (C) ChatSpike development team
1611 # Makefile by <Craig\@ChatSpike.net>
1612 # Makefile version 2 (statically linked core) by <brain\@inspircd.org>
1615 CC = im a cheezeball
1617 CXXFLAGS = -I../include \${FLAGS}
1618 CPPFILES = \$(shell /bin/ls -l modes/ | grep '\\.cpp' | sed 's/^.* //' | grep -v svn)
1619 RELCPPFILES = \$(shell /bin/ls -l modes/ | grep '\\.cpp' | sed 's/^.* /modes\\//' | grep -v svn)
1623 $se = "socketengine_select";
1624 if (($has_kqueue) && ($config{USE_KQUEUE} eq "y")) {
1625 $se = "socketengine_kqueue";
1627 elsif (($has_epoll) && ($config{USE_EPOLL} eq "y")) {
1628 $se = "socketengine_epoll";
1632 # This next section is for cygwin dynamic module builds.
1633 # Basically, what we do, is build the inspircd core as a library
1634 # then the main executable uses that. the library is capable of
1635 # loading / unloading the modules dynamically :)
1636 # Massive thanks to the guys on #cygwin @ irc.freenode.net for helping
1640 if ($config{OSNAME} =~ /CYGWIN/) {
1642 all: timer.o command_parse.o cull_list.o userprocess.o socketengine.o socket.o hashcomp.o channels.o mode.o xline.o inspstring.o dns.o base.o configreader.o inspsocket.o $cmdobjs commands.o dynamic.o users.o modules.o wildcard.o helperfuncs.o snomasks.o inspircd.exe
1644 inspircd.exe: inspircd.dll.a
1647 inspircd.dll inspircd.dll.a: inspircd.o channels.o mode.o xline.o inspstring.o dns.o base.o configreader.o inspsocket.o $cmdobjs commands.o dynamic.o users.o modules.o wildcard.o helperfuncs.o hashcomp.o socket.o socketengine.o userprocess.o cull_list.o command_parse.o timer.o snomasks.o
1648 \$(CC) -shared -Wl,--out-implib=inspircd.dll.a -o inspircd.dll \$^
1652 all: timer.o command_parse.o cull_list.o userprocess.o socketengine.o socket.o hashcomp.o channels.o mode.o xline.o inspstring.o dns.o base.o configreader.o inspsocket.o $cmdobjs commands.o dynamic.o users.o modules.o wildcard.o helperfuncs.o snomasks.o \$(MODULES) inspircd.exe
1654 inspircd.exe: inspircd.cpp ../include/base.h ../include/channels.h ../include/inspircd.h ../include/channels.h ../include/globals.h ../include/inspircd_config.h ../include/base.h
1655 \$(CC) -I../include \$(FLAGS) inspircd.cpp -o inspircd.exe \$(LDLIBS) channels.o mode.o xline.o inspstring.o dns.o base.o inspsocket.o configreader.o $cmdobjs commands.o dynamic.o users.o modules.o wildcard.o helperfuncs.o hashcomp.o socket.o socketengine.o userprocess.o cull_list.o command_parse.o timer.o snomasks.o modes/modeclasses.a \$(MODULES)
1661 cull_list.o: cull_list.cpp ../include/base.h ../include/hashcomp.h ../include/globals.h ../include/inspircd_config.h ../include/users.h ../include/channels.h
1662 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c cull_list.cpp
1664 snomasks.o: snomasks.cpp ../include/base.h ../include/hashcomp.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h ../include/channels.h
1665 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c snomasks.cpp
1667 command_parse.o: command_parse.cpp ../include/base.h ../include/hashcomp.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1668 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c command_parse.cpp
1670 userprocess.o: userprocess.cpp ../include/base.h ../include/hashcomp.h ../include/globals.h ../include/inspircd_config.h
1671 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c userprocess.cpp
1673 socketengine.o: $se.cpp socketengine.cpp ../include/base.h ../include/hashcomp.h ../include/globals.h ../include/inspircd_config.h ../include/$se.h
1674 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c socketengine.cpp $se.cpp
1676 hashcomp.o: hashcomp.cpp ../include/base.h ../include/hashcomp.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1677 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c hashcomp.cpp
1679 helperfuncs.o: helperfuncs.cpp ../include/base.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1680 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c helperfuncs.cpp
1682 channels.o: channels.cpp ../include/base.h ../include/channels.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1683 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c channels.cpp
1685 mode.o: mode.cpp ../include/base.h ../include/mode.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h \$(RELCPPFILES) modes/modeclasses.a
1686 \${MAKE} -C "modes" DIRNAME="src/modes" CC="\$(CC)" \$(MAKEARGS)
1687 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c mode.cpp
1689 xline.o: xline.cpp ../include/base.h ../include/xline.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1690 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c xline.cpp
1692 inspstring.o: inspstring.cpp ../include/base.h ../include/inspstring.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1693 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c inspstring.cpp
1695 dns.o: dns.cpp ../include/base.h ../include/dns.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1696 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c dns.cpp
1698 base.o: base.cpp ../include/base.h ../include/globals.h ../include/inspircd_config.h
1699 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c base.cpp
1701 configreader.o: configreader.cpp ../include/base.h ../include/configreader.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1702 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c configreader.cpp
1704 commands.o: commands.cpp ../include/base.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h $srcobjs
1705 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c commands.cpp $cmdobjs
1707 dynamic.o: dynamic.cpp ../include/base.h ../include/dynamic.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1708 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c dynamic.cpp
1710 users.o: users.cpp ../include/base.h ../include/users.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1711 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c users.cpp
1713 modules.o: modules.cpp ../include/base.h ../include/modules.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1714 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c modules.cpp
1716 wildcard.o: wildcard.cpp ../include/base.h ../include/wildcard.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1717 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c wildcard.cpp
1719 socket.o: socket.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h
1720 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c socket.cpp
1722 inspsocket.o: inspsocket.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h
1723 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c inspsocket.cpp
1725 timer.o: timer.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h
1726 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c timer.cpp
1729 foreach my $cmd (@cmdlist) {
1731 cmd_$cmd.o: cmd_$cmd.cpp ../include/base.h ../include/modules.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h ../include/commands/cmd_$cmd.h
1732 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c cmd_$cmd.cpp
1738 sub write_dynamic_makefile {
1742 opendir(DIRHANDLE, "src");
1743 foreach $name (sort readdir(DIRHANDLE)) {
1744 if ($name =~ /^cmd_(.+)\.cpp$/) {
1745 $cmdlist[$i++] = $1;
1748 closedir(DIRHANDLE);
1752 foreach my $cmd (@cmdlist) {
1753 $cmdobjs = $cmdobjs . "cmd_$cmd.so ";
1754 $srcobjs = $srcobjs . "cmd_$cmd.cpp ";
1757 $se = "socketengine_select";
1758 if (($has_kqueue) && ($config{USE_KQUEUE} eq "y")) {
1759 $se = "socketengine_kqueue";
1761 elsif (($has_epoll) && ($config{USE_EPOLL} eq "y")) {
1762 $se = "socketengine_epoll";
1765 open(FH,">src/Makefile") or die("Could not write src/Makefile");
1769 # (C) ChatSpike development team
1770 # Makefile by <Craig\@ChatSpike.net>
1771 # Makefile version 2 (dynamically linked core) by <brain\@inspircd.org>
1774 CC = im a cheezeball
1776 CXXFLAGS = -I../include \${FLAGS}
1777 CPPFILES = \$(shell /bin/ls -l modes/ | grep '\\.cpp' | sed 's/^.* //' | grep -v svn)
1778 RELCPPFILES = \$(shell /bin/ls -l modes/ | grep '\\.cpp' | sed 's/^.* /modes\\//' | grep -v svn)
1780 all: libIRCDtimer.so libIRCDcull_list.so libIRCDuserprocess.so libIRCDsocketengine.so libIRCDsocket.so libIRCDhash.so libIRCDchannels.so libIRCDmode.so libIRCDxline.so libIRCDstring.so libIRCDasyncdns.so libIRCDbase.so libIRCDconfigreader.so libIRCDinspsocket.so $cmdobjs libIRCDcommands.so libIRCDdynamic.so libIRCDusers.so libIRCDmodules.so libIRCDwildcard.so libIRCDhelper.so libIRCDcommand_parse.so libIRCDsnomasks.so inspircd
1782 inspircd: inspircd.cpp ../include/base.h ../include/channels.h ../include/inspircd.h ../include/channels.h ../include/globals.h ../include/inspircd_config.h ../include/socket.h libIRCDtimer.so libIRCDcull_list.so libIRCDuserprocess.so libIRCDsocketengine.so libIRCDsocket.so libIRCDhash.so libIRCDchannels.so libIRCDmode.so libIRCDxline.so libIRCDstring.so libIRCDasyncdns.so libIRCDbase.so libIRCDconfigreader.so libIRCDinspsocket.so $cmdobjs libIRCDsnomasks.so libIRCDcommands.so libIRCDdynamic.so libIRCDusers.so libIRCDmodules.so libIRCDwildcard.so libIRCDhelper.so libIRCDcommand_parse.so
1783 \$(CC) -pipe -I../include $extra -Wl,--rpath -Wl,$config{LIBRARY_DIR} \$(FLAGS) -rdynamic -L. inspircd.cpp -o inspircd \$(LDLIBS) libIRCDchannels.so libIRCDmode.so libIRCDxline.so libIRCDstring.so libIRCDasyncdns.so libIRCDbase.so libIRCDconfigreader.so libIRCDinspsocket.so libIRCDcommands.so libIRCDdynamic.so libIRCDusers.so libIRCDmodules.so libIRCDwildcard.so libIRCDhelper.so libIRCDhash.so libIRCDsocket.so libIRCDsocketengine.so libIRCDuserprocess.so libIRCDcull_list.so libIRCDcommand_parse.so libIRCDtimer.so libIRCDsnomasks.so
1785 libIRCDsocketengine.so: $se.cpp socketengine.cpp ../include/base.h ../include/hashcomp.h ../include/globals.h ../include/inspircd_config.h ../include/$se.h
1786 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c socketengine.cpp $se.cpp
1787 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDsocketengine.so socketengine.o $se.o
1789 libIRCDsnomasks.so: snomasks.cpp ../include/base.h ../include/hashcomp.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h ../include/channels.h
1790 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c snomasks.cpp
1791 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDsnomasks.so snomasks.o
1793 libIRCDcommand_parse.so: command_parse.cpp ../include/base.h ../include/hashcomp.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1794 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c command_parse.cpp
1795 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDcommand_parse.so command_parse.o
1797 libIRCDcull_list.so: cull_list.cpp ../include/base.h ../include/hashcomp.h ../include/globals.h ../include/inspircd_config.h ../include/users.h ../include/channels.h
1798 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c cull_list.cpp
1799 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDcull_list.so cull_list.o
1801 libIRCDuserprocess.so: userprocess.cpp ../include/base.h ../include/hashcomp.h ../include/globals.h ../include/inspircd_config.h
1802 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c userprocess.cpp
1803 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDuserprocess.so userprocess.o
1805 libIRCDhash.so: hashcomp.cpp ../include/base.h ../include/hashcomp.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1806 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c hashcomp.cpp
1807 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDhash.so hashcomp.o
1809 libIRCDhelper.so: helperfuncs.cpp ../include/base.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1810 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c helperfuncs.cpp
1811 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDhelper.so helperfuncs.o
1813 libIRCDchannels.so: channels.cpp ../include/base.h ../include/channels.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1814 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c channels.cpp
1815 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDchannels.so channels.o
1817 libIRCDmode.so: mode.cpp ../include/base.h ../include/mode.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h \$(RELCPPFILES)
1818 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c mode.cpp
1819 \${MAKE} -C "modes" DIRNAME="src/modes" CC="\$(CC)" \$(MAKEARGS) CPPFILES="\$(CPPFILES)"
1820 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDmode.so mode.o modes/modeclasses.a
1822 libIRCDxline.so: xline.cpp ../include/base.h ../include/xline.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1823 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c xline.cpp
1824 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDxline.so xline.o
1826 libIRCDstring.so: inspstring.cpp ../include/base.h ../include/inspstring.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1827 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c inspstring.cpp
1828 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDstring.so inspstring.o
1830 libIRCDasyncdns.so: dns.cpp ../include/base.h ../include/dns.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1831 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c dns.cpp
1832 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDasyncdns.so dns.o
1834 libIRCDbase.so: base.cpp ../include/base.h ../include/globals.h ../include/inspircd_config.h
1835 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c base.cpp
1836 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDbase.so base.o
1838 libIRCDconfigreader.so: configreader.cpp ../include/base.h ../include/configreader.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1839 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c configreader.cpp
1840 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDconfigreader.so configreader.o
1842 libIRCDcommands.so: commands.cpp ../include/base.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1843 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c commands.cpp
1844 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDcommands.so commands.o
1846 libIRCDdynamic.so: dynamic.cpp ../include/base.h ../include/dynamic.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1847 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c dynamic.cpp
1848 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDdynamic.so dynamic.o
1850 libIRCDusers.so: users.cpp ../include/base.h ../include/users.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1851 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c users.cpp
1852 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDusers.so users.o
1854 libIRCDmodules.so: modules.cpp ../include/base.h ../include/modules.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1855 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c modules.cpp
1856 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDmodules.so modules.o
1858 libIRCDwildcard.so: wildcard.cpp ../include/base.h ../include/wildcard.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1859 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c wildcard.cpp
1860 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDwildcard.so wildcard.o
1862 libIRCDsocket.so: socket.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h
1863 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c socket.cpp
1864 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDsocket.so socket.o
1866 libIRCDinspsocket.so: inspsocket.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h
1867 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c inspsocket.cpp
1868 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDinspsocket.so inspsocket.o
1870 libIRCDtimer.so: timer.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h
1871 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c timer.cpp
1872 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDtimer.so timer.o
1875 foreach my $cmd (@cmdlist) {
1877 cmd_$cmd.so: cmd_$cmd.cpp ../include/base.h ../include/modules.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h ../include/commands/cmd_$cmd.h
1878 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c cmd_$cmd.cpp
1879 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o cmd_$cmd.so cmd_$cmd.o
1888 chomp($PWD = `pwd`);
1889 print "Usage: configure [options]
1891 *** NOTE: NON-INTERACTIVE CONFIGURE IS *NOT* SUPPORTED BY THE ***
1892 *** INSPIRCD DEVELOPMENT TEAM. DO NOT ASK FOR HELP REGARDING ***
1893 *** NON-INTERACTIVE CONFIGURE ON THE FORUMS OR ON IRC! ***
1895 Options: [defaults in brackets after descriptions]
1897 When no options are specified, interactive
1898 configuration is started and you must specify
1899 any required values manually. If one or more
1900 options are specified, non-interactive configuration
1901 is started, and any omitted values are defaulted.
1903 Arguments with a single \"-\" symbol, as in
1904 InspIRCd 1.0.x, are also allowed.
1906 --disable-interactive Sets no options intself, but
1907 will disable any interactive prompting.
1908 --update Update makefiles and dependencies
1909 --modupdate Detect new modules and write makefiles
1910 --svnupdate {rebuild} Update working copy via subversion
1911 {and optionally rebuild it}
1912 --clean Remove .config.cache file and go interactive
1913 --enable-gnutls Enable GnuTLS module [no]
1914 --enable-openssl Enable OpenSSL module [no]
1915 --with-nick-length=[n] Specify max. nick length [32]
1916 --with-channel-length=[n] Specify max. channel length [64]
1917 --with-max-channels=[n] Specify max. number of channels
1918 a normal user may join [20]
1919 --with-max-oper-channels=[n] Specify max. number of channels
1920 an irc operator may join [60]
1921 --with-max-clients=[n] Specify maximum number of users
1922 which may connect locally
1923 --enable-optimization=[n] Optimize using -O[n] gcc flag
1924 --enable-epoll Enable epoll() where supported [set]
1925 --enable-kqueue Enable kqueue() where supported [set]
1926 --disable-epoll Do not enable epoll(), fall back
1927 to select() [not set]
1928 --disable-kqueue Do not enable kqueue(), fall back
1929 to select() [not set]
1930 --enable-ipv6 Build ipv6 native InspIRCd [no]
1931 --enable-remote-ipv6 Build with ipv6 support for remote
1932 servers on the network [yes]
1933 --disable-remote-ipv6 Do not allow remote ipv6 servers [not set]
1934 --with-cc=[filename] Use an alternative g++ binary to
1935 build InspIRCd [g++]
1936 --with-ident-length=[n] Specify max length of ident [12]
1937 --with-quit-length=[n] Specify max length of quit [200]
1938 --with-topic-length=[n] Specify max length of topic [350]
1939 --with-kick-length=[n] Specify max length of kick [200]
1940 --with-gecos-length=[n] Specify max length of gecos [150]
1941 --with-away-length=[n] Specify max length of away [150]
1942 --with-max-modes=[n] Specify max modes per line which
1943 have parameters [20]
1944 --prefix=[directory] Base directory to install into (if defined,
1945 can automatically define config, module, bin
1946 and library dirs as subdirectories of prefix)
1948 --config-dir=[directory] Config file directory for config and SSL certs
1950 --module-dir=[directory] Modules directory for loadable modules
1952 --binary-dir=[directory] Binaries directory for core binary
1954 --library-dir=[directory] Library directory for core libraries
1956 --help Show this help text and exit