3 # InspIRCd Configuration Script
5 # Copyright 2002-2007 The ChatSpike Development Team
6 # <brain@chatspike.net>
7 # <Craig@chatspike.net>
9 # [14:21] Brain: <matrix impression> i know perl-fu!
13 ########################################
21 # Utility functions for our buildsystem
26 'enable-gnutls' => \$opt_use_gnutls,
27 'enable-openssl' => \$opt_use_openssl,
28 'disable-interactive' => \$opt_nointeractive,
29 'with-nick-length=i' => \$opt_nick_length,
30 'with-channel-length=i' => \$opt_chan_length,
31 'with-max-channels=i' => \$opt_maxchans,
32 'with-max-oper-channels=i' => \$opt_opermaxchans,
33 'with-max-clients=i' => \$opt_maxclients,
34 'enable-epoll' => \$opt_epoll,
35 'enable-kqueue' => \$opt_kqueue,
36 'disable-epoll' => \$opt_noepoll,
37 'disable-kqueue' => \$opt_nokqueue,
38 'enable-ipv6' => \$opt_ipv6,
39 'enable-remote-ipv6' => \$opt_ipv6links,
40 'disable-remote-ipv6' => \$opt_noipv6links,
41 'with-cc=s' => \$opt_cc,
42 'with-ident-length=i' => \$opt_ident,
43 'with-quit-length=i' => \$opt_quit,
44 'with-topic-length=i' => \$opt_topic,
45 'with-kick-length=i' => \$opt_kick,
46 'with-gecos-length=i' => \$opt_gecos,
47 'with-away-length=i' => \$opt_away,
48 'with-max-modes=i' => \$opt_modes,
49 'prefix=s' => \$opt_base_dir,
50 'config-dir=s' => \$opt_config_dir,
51 'module-dir=s' => \$opt_module_dir,
52 'binary-dir=s' => \$opt_binary_dir,
53 'library-dir=s' => \$opt_library_dir,
54 'disable-debuginfo' => sub { $opt_disable_debug = 1 },
55 'help' => sub { showhelp(); },
56 'modupdate' => sub { modupdate(); },
57 'update' => sub { update(); },
58 'svnupdate' => sub { svnupdate(); },
59 'clean' => sub { clean(); },
62 my $non_interactive = (
63 (defined $opt_library_dir) ||
64 (defined $opt_base_dir) ||
65 (defined $opt_config_dir) ||
66 (defined $opt_module_dir) ||
67 (defined $opt_base_dir) ||
68 (defined $opt_binary_dir) ||
69 (defined $opt_nointeractive) ||
70 (defined $opt_away) ||
71 (defined $opt_gecos) ||
72 (defined $opt_kick) ||
73 (defined $opt_maxclients) ||
74 (defined $opt_modes) ||
75 (defined $opt_topic) ||
76 (defined $opt_quit) ||
77 (defined $opt_ident) ||
79 (defined $opt_ipv6) ||
80 (defined $opt_ipv6links) ||
81 (defined $opt_noipv6links) ||
82 (defined $opt_kqueue) ||
83 (defined $opt_epoll) ||
84 (defined $opt_maxchans) ||
85 (defined $opt_opermaxchans) ||
86 (defined $opt_chan_length) ||
87 (defined $opt_nick_length) ||
88 (defined $opt_use_openssl) ||
89 (defined $opt_nokqueue) ||
90 (defined $opt_noepoll) ||
91 (defined $opt_use_gnutls)
93 my $interactive = !$non_interactive;
96 chomp($topdir = getcwd());
97 $this = resolve_directory($topdir); # PWD, Regardless.
98 @modlist = (); # Declare for Module List..
99 %config = (); # Initiate Configuration Hash..
100 $config{ME} = resolve_directory($topdir); # Present Working Directory
102 $config{BASE_DIR} = $config{ME};
104 if (defined $opt_base_dir)
106 $config{BASE_DIR} = $opt_base_dir;
109 $config{CONFIG_DIR} = resolve_directory($config{BASE_DIR}."/conf"); # Configuration Directory
110 $config{MODULE_DIR} = resolve_directory($config{BASE_DIR}."/modules"); # Modules Directory
111 $config{BINARY_DIR} = resolve_directory($config{BASE_DIR}."/bin"); # Binary Directory
112 $config{LIBRARY_DIR} = resolve_directory($config{BASE_DIR}."/lib"); # Library Directory
114 if (defined $opt_config_dir)
116 $config{CONFIG_DIR} = $opt_config_dir;
118 if (defined $opt_module_dir)
120 $config{MODULE_DIR} = $opt_module_dir;
122 if (defined $opt_binary_dir)
124 $config{BINARY_DIR} = $opt_binary_dir;
126 if (defined $opt_library_dir)
128 $config{LIBRARY_DIR} = $opt_library_dir;
130 chomp($config{HAS_GNUTLS} = `libgnutls-config --version 2>/dev/null | cut -c 1,2,3`); # GNUTLS Version.
131 chomp($config{HAS_OPENSSL} = `openssl version 2>/dev/null`); # Openssl version
132 $config{USE_GNUTLS} = "n";
133 if (defined $opt_use_gnutls)
135 $config{USE_GNUTLS} = "y"; # Use gnutls.
137 $config{USE_OPENSSL} = "n"; # Use openssl.
138 if (defined $opt_use_openssl)
140 $config{USE_OPENSSL} = "y";
143 # no, let's not change these.
144 $config{OPTIMITEMP} = "0"; # Default Optimisation Value
145 if (!defined $opt_disable_debug)
147 $config{OPTIMISATI} = "-O2 -g1"; # Optimisation Flag
151 $config{OPTIMISATI} = "-O2"; # DEBUGGING OFF!
154 $config{NICK_LENGT} = "31"; # Default Nick Length
155 if (defined $opt_nick_length)
157 $config{NICK_LENGT} = $opt_nick_length;
159 $config{CHAN_LENGT} = "64"; # Default Channel Name Length
160 if (defined $opt_chan_length)
162 $config{CHAN_LENGT} = $opt_chan_length;
164 $config{MAX_CHANNE} = "20"; # Default Max. Channels per user
165 if (defined $opt_maxchans)
167 $config{MAX_CHANNE} = $opt_maxchans;
169 $config{MAX_OPERCH} = "60"; # Default Max. Channels per oper
170 if (defined $opt_opermaxchans)
172 $config{MAX_OPERCH} = $opt_opermaxchans;
174 $config{MAXI_MODES} = "20"; # Default Max. Number of Modes set at once.
175 if (defined $opt_modes)
177 $config{MAXI_MODES} = $opt_modes;
179 $config{HAS_STRLCPY} = "false"; # strlcpy Check.
180 $config{HAS_STDINT} = "false"; # stdint.h check
181 $config{USE_KQUEUE} = "y"; # kqueue enabled
182 if (defined $opt_kqueue)
184 $config{USE_KQUEUE} = "y";
186 if (defined $opt_nokqueue)
188 $config{USE_KQUEUE} = "n";
190 $config{USE_EPOLL} = "y"; # epoll enabled
191 if (defined $opt_epoll)
193 $config{USE_EPOLL} = "y";
195 if (defined $opt_noepoll)
197 $config{USE_EPOLL} = "n";
199 $config{IPV6} = "n"; # IPv6 support (experimental)
200 if (defined $opt_ipv6)
204 $config{SUPPORT_IP6LINKS} = "y"; # IPv4 supporting IPv6 links (experimental)
205 if (defined $opt_ipv6links)
207 $config{SUPPORT_IP6LINKS} = "y";
209 if (defined $opt_noipv6links)
211 $config{SUPPORT_IP6LINKS} = "n";
213 $config{STATIC_LINK} = "no"; # are doing static modules?
214 chomp($config{MAX_CLIENT_T} = `sh -c \"ulimit -n\"`); # FD Limit
215 chomp($config{MAX_DESCRIPTORS} = `sh -c \"ulimit -n\"`); # Hard FD Limit
216 chomp($config{GCCVER} = `g++ -dumpversion | cut -c 1`); # Major GCC Version
217 $config{_SOMAXCONN} = SOMAXCONN; # Max connections in accept queue
218 $config{OSNAME} = $^O; # Operating System Name
219 $config{IS_DARWIN} = "NO"; # Is OSX?
220 $config{CC} = "g++"; # C++ compiler
223 $config{CC} = $opt_cc;
225 $exec = $config{CC} . " -dumpversion | cut -c 1";
226 chomp($config{GCCVER} = `$exec`); # Major GCC Version
227 $config{MAKEORDER} = "ircd mods"; # build order
228 $config{STATICLIBS} = ""; # library archive path
229 $config{MAX_IDENT} = "12"; # max ident size
230 $config{MAX_QUIT} = "255"; # max quit message size
231 $config{MAX_TOPIC} = "307"; # max topic size
232 $config{MAX_KICK} = "255"; # max kick message size
233 $config{MAX_GECOS} = "128"; # max GECOS size
234 $config{MAX_AWAY} = "200"; # max AWAY size
235 if (defined $opt_ident)
237 $config{MAX_IDENT} = $opt_ident;
239 if (defined $opt_quit)
241 $config{MAX_QUIT} = $opt_quit;
243 if (defined $opt_topic)
245 $config{MAX_TOPIC} = $opt_topic;
247 if (defined $opt_kick)
249 $config{MAX_KICK} = $opt_kick;
251 if (defined $opt_gecos)
253 $config{MAX_GECOS} = $opt_gecos;
255 if (defined $opt_away)
257 $config{MAX_AWAY} = $opt_away;
260 $config{HAS_OPENSSL} =~ /OpenSSL ([-[:digit:].]+)([a-z])?(\-[a-z][0-9])? (\w{3}|[0-9]+) (\w{3}|[0-9]+) [0-9]{4}/;
261 $config{HAS_OPENSSL} = $1;
263 if ($config{GCCVER} eq "") {
264 print $config{CC} . " was not found! You require g++ (the GNU C++ compiler, part of GCC) to build InspIRCd!\n";
268 if ($config{OSNAME} =~ /darwin/)
270 $config{IS_DARWIN} = "YES";
273 # Minihack! Convert Cygwin to 'Cyg-Static' so i can
274 # Keep my dynamic module experiments here for later
277 if ($config{OSNAME} =~ /CYGWIN/i)
279 $config{OSNAME} = "CYG-STATIC";
282 if (!$config{MAX_CLIENT_T}) {
283 $config{MAX_CLIENT_T} = 1024; # Set a reasonable 'Default'
284 $fd_scan_fail = "true"; # Used Later
287 # Get and Set some important vars..
292 system("rm -rf .config.cache");
298 chomp($topdir = getcwd());
299 $this = resolve_directory($topdir); # PWD, Regardless.
301 # Does the cache file exist?
303 # No, No it doesn't.. *BASH*
304 print "You have not run ./configure before. Please do this before trying to run the update script.\n";
307 # We've Loaded the cache file and all our variables..
308 print "Updating Files..\n";
310 if ($opt_disable_debug == 1)
312 print "Disabling debug information (-g).\n";
313 $config{OPTIMISATI} = "";
316 $has_epoll = $config{HAS_EPOLL};
317 $has_kqueue = $config{HAS_KQUEUE};
326 print "Configure update failed: $@\n";
334 chomp($topdir = getcwd());
335 $this = resolve_directory($topdir); # PWD, Regardless.
337 # Does the cache file exist?
339 # No, No it doesn't.. *BASH*
340 print "You have not run ./configure before. Please do this before trying to run the update script.\n";
343 # We've Loaded the cache file and all our variables..
344 print "Updating Files..\n";
346 $has_epoll = $config{HAS_EPOLL};
347 $has_kqueue = $config{HAS_KQUEUE};
356 print "Module update failed: $@\n";
366 open(FH,"<.svn/entries") or $fail = 1;
368 print "This is not an SVN copy of InspIRCd.\n";
371 system("svn update");
372 system("perl configure -update");
373 if ($ARGV[1] eq "rebuild") {
374 system("make install");
379 print "Running non-interactive configure...\n" unless $interactive;
380 print "Checking for cache from previous configure... ";
381 print ((getcache() eq "true") ? "found\n" : "not found\n");
382 print "Checking operating system version... ";
383 print getosflags() . "\n";
385 if (defined $opt_maxclients)
387 $config{MAX_CLIENT} = $opt_maxclients;
390 if (!$config{MAX_CLIENT}) {
391 # If the cache hasn't set the max clients, copy the variable of MAX_CLIENT_T, this
392 # allows us to keep _T for testing purposes. (ie. "Are you sure you want to go
393 # higher than the found value" :))
394 $config{MAX_CLIENT} = $config{MAX_CLIENT_T};
397 printf "Checking if stdint.h exists... ";
398 $config{HAS_STDINT} = "true";
400 open(STDINT, "</usr/include/stdint.h") or $config{HAS_STDINT} = "false";
401 if ($config{HAS_STDINT} eq "true") {
404 print "yes\n" if $config{HAS_STDINT} eq "true";
405 print "no\n" if $config{HAS_STDINT} eq "false";
408 printf "Checking if strlcpy exists... ";
409 # Perform the strlcpy() test..
410 $config{HAS_STRLCPY} = "false";
412 open(STRLCPY, "</usr/include/string.h") or $fail = 1;
414 while (chomp($line = <STRLCPY>)) {
415 # try and find the delcaration of:
416 # size_t strlcpy(...)
417 if ($line =~ /size_t(\0x9|\s)+strlcpy/) {
418 $config{HAS_STRLCPY} = "true";
423 print "yes\n" if $config{HAS_STRLCPY} eq "true";
424 print "no\n" if $config{HAS_STRLCPY} eq "false";
427 printf "Checking if kqueue exists... ";
430 open(KQUEUE, "</usr/include/sys/event.h") or $fail = 1;
432 while (chomp($line = <KQUEUE>)) {
433 # try and find the delcaration of:
435 if ($line =~ /int(\0x9|\s)+kqueue/) {
441 print "yes\n" if $has_kqueue == 1;
442 print "no\n" if $has_kqueue == 0;
444 printf "Checking if epoll exists... ";
447 open(EPOLL, "</usr/include/sys/epoll.h") or $fail = 1;
453 my $kernel = `uname -r`;
455 if (($kernel =~ /^2\.0\./) || ($kernel =~ /^2\.2\./) || ($kernel =~ /^2\.4\./)) {
459 print "yes\n" if $has_epoll == 1;
460 print "no\n" if $has_epoll == 0;
462 if (($config{OSNAME} =~ /CYGWIN/) || ($config{OSNAME} eq "CYG-STATIC")) {
463 $config{HAS_STRLCPY} = "true";
466 $config{HAS_EPOLL} = $has_epoll;
467 $config{HAS_KQUEUE} = $has_kqueue;
469 printf "Checking for libgnutls... ";
470 if (($config{HAS_GNUTLS}) && (($config{HAS_GNUTLS} >= 1.2) || ($config{HAS_GNUTLS} eq "y"))) {
472 $config{HAS_GNUTLS} = "y";
475 $config{HAS_GNUTLS} = "n";
478 printf "Checking for openssl... ";
479 if (($config{HAS_OPENSSL}) && (($config{HAS_OPENSSL} >= 0.8) || ($config{HAS_OPENSSL} eq "y"))) {
481 $config{HAS_OPENSSL} = "y";
484 $config{HAS_OPENSSL} = "n";
487 ################################################################################
488 # BEGIN INTERACTIVE PART #
489 ################################################################################
497 my $rev = getrevision();
498 # Display Introduction Message..
500 Welcome to the \033[1mInspIRCd\033[0m Configuration program! (\033[1minteractive mode\033[0m)
501 \033[1mPackage maintainers: Type ./configure --help for non-interactive help\033[0m
503 *** If you are unsure of any of these values, leave it blank for ***
504 *** standard settings that will work, and your server will run ***
505 *** using them. Please consult your IRC network admin if in doubt. ***
507 Press \033[1m<RETURN>\033[0m to accept the default for any option, or enter
508 a new value. Please note: You will \033[1mHAVE\033[0m to read the docs
509 dir, otherwise you won't have a config file!
511 Your operating system is: \033[1;32m$config{OSNAME}\033[0m ($wholeos)
512 Maximum file descriptors: \033[1;32m$config{MAX_CLIENT_T}\033[0m
513 Your InspIRCd revision ID is \033[1;32mr$rev\033[0m";
515 print " (Non-SVN build)";
519 $config{CHANGE_COMPILER} = "n";
520 print "I have detected the following compiler: \033[1;32m$config{CC}\033[0m (version \033[1;32m$config{GCCVER}.x\033[0m)\n";
522 while (($config{GCCVER} < 3) || ($config{GCCVER} eq "")) {
523 print "\033[1;32mIMPORTANT!\033[0m A GCC 2.x compiler has been detected, and
524 should NOT be used. You should probably specify a newer compiler.\n\n";
525 yesno(CHANGE_COMPILER,"Do you want to change the compiler?");
526 if ($config{CHANGE_COMPILER} =~ /y/i) {
527 print "What command do you want to use to invoke your compiler?\n";
528 print "[\033[1;32m$config{CC}\033[0m] -> ";
529 chomp($config{CC} = <STDIN>);
530 if ($config{CC} eq "") {
533 chomp($foo = `$config{CC} -dumpversion | cut -c 1`);
535 chomp($config{GCCVER} = `$config{CC} -dumpversion | cut -c 1`); # we must redo these if we change compilers
536 print "Queried compiler: \033[1;32m$config{CC}\033[0m (version \033[1;32m$config{GCCVER}.x\033[0m)\n";
537 if ($config{GCCVER} < 3) {
538 print "\033[1;32mGCC 2.x WILL NOT WORK!\033[0m. Let's try that again, shall we?\n";
542 print "\033[1;32mWARNING!\033[0m Could not execute the compiler you specified. You may want to try again.\n";
549 # Directory Settings..
550 my $tmpbase = $config{BASE_DIR};
551 dir_check("do you wish to install the InspIRCd base", "BASE_DIR");
552 if ($tmpbase ne $config{BASE_DIR}) {
553 $config{CONFIG_DIR} = resolve_directory($config{BASE_DIR}."/conf"); # Configuration Dir
554 $config{MODULE_DIR} = resolve_directory($config{BASE_DIR}."/modules"); # Modules Directory
555 $config{BINARY_DIR} = resolve_directory($config{BASE_DIR}."/bin"); # Binary Directory
556 $config{LIBRARY_DIR} = resolve_directory($config{BASE_DIR}."/lib"); # Library Directory
559 dir_check("are the configuration files", "CONFIG_DIR");
560 dir_check("are the modules to be compiled to", "MODULE_DIR");
561 dir_check("is the IRCd binary to be placed", "BINARY_DIR");
562 dir_check("are the IRCd libraries to be placed", "LIBRARY_DIR");
565 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?");
569 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?");
572 $chose_hiperf = (($config{USE_EPOLL} eq "y") || ($config{USE_KQUEUE} eq "y"));
573 if (!$chose_hiperf) {
574 print "No high-performance socket engines are available, or you chose\n";
575 print "not to enable one. Defaulting to select() engine.\n\n";
578 yesno(IPV6,"Would you like to build InspIRCd with IPv6 support?");
581 if ($config{IPV6} eq "y") {
582 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";
583 $config{SUPPORT_IP6LINKS} = "y";
585 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.");
589 if (($config{HAS_GNUTLS} eq "y") && ($config{HAS_OPENSSL} eq "y")) {
590 print "I have detected both GnuTLS and OpenSSL on your system.\n";
591 print "I will default to GnuTLS. If you wish to use OpenSSL\n";
592 print "instead, you should enable the OpenSSL module yourself\n";
593 print "by copying it from src/modules/extra to src/modules.\n\n";
596 if ($config{HAS_GNUTLS} eq "y") {
597 yesno(USE_GNUTLS, "Would you like to enable SSL Support?");
598 if ($config{USE_GNUTLS} eq "y") {
599 print "\nUsing GnuTLS SSL module.\n";
601 } elsif ($config{HAS_OPENSSL} eq "y") {
602 yesno(USE_OPENSSL, "Would you like to enable SSL Support?");
603 if ($config{USE_OPENSSL} eq "y") {
604 print "\nUsing OpenSSL SSL module.\nYou will get better performance if you move to GnuTLS in the future.\n";
608 print "\nThe following questions will ask you for various figures relating\n";
609 print "To your IRCd install. Please note that these should usually be left\n";
610 print "as defaults unless you have a real reason to change them. If they\n";
611 print "changed, then the values must be identical on all servers on your\n";
612 print "network, or malfunctions and/or crashes may occur, with the exception\n";
613 print "of the 'maximum number of clients' setting which may be different on\n";
614 print "different servers on the network.\n\n";
616 # File Descriptor Settings..
617 promptnumeric("number of clients at any one time", "MAX_CLIENT_T");
618 $config{MAX_CLIENT} = $config{MAX_CLIENT_T};
619 $config{MAX_DESCRIPTORS} = $config{MAX_CLIENT_T};
621 promptnumeric("length of nicknames", "NICK_LENGT");
622 promptnumeric("length of channel names", "CHAN_LENGT");
623 promptnumeric("number of channels a normal user may join at any one time", "MAX_CHANNE");
624 promptnumeric("number of channels an oper may join at any one time", "MAX_OPERCH");
625 promptnumeric("number of mode changes in one line", "MAXI_MODES");
626 promptnumeric("length of an ident (username)", "MAX_IDENT");
627 promptnumeric("length of a quit message", "MAX_QUIT");
628 promptnumeric("length of a channel topic", "MAX_TOPIC");
629 promptnumeric("length of a kick message", "MAX_KICK");
630 promptnumeric("length of a GECOS (real name)", "MAX_GECOS");
631 promptnumeric("length of an away message", "MAX_AWAY");
636 if (($config{USE_GNUTLS} eq "y") && ($config{HAS_GNUTLS} ne "y"))
638 print "Sorry, but i couldn't detect gnutls. Make sure gnutls-config is in your path.\n";
641 if (($config{USE_OPENSSL} eq "y") && ($config{HAS_OPENSSL} ne "y"))
643 print "Sorry, but i couldn't detect openssl. Make sure openssl is in your path.\n";
647 if ($config{USE_GNUTLS} eq "y") {
649 open(TMP, "<src/modules/m_ssl_gnutls.cpp") or $failed = 1;
652 print "Symlinking src/modules/m_ssl_gnutls.cpp from extra/\n";
653 chdir("src/modules");
654 system("ln -s extra/m_ssl_gnutls.cpp");
655 system("ln -s extra/ssl_cert.h");
662 open(TMP, "<$config{CONFIG_DIR}/key.pem") or $failed = 1;
664 open(TMP, "<$config{CONFIG_DIR}/cert.pem") or $failed = 1;
667 print "SSL Certificates Not found, Generating.. \n\n
668 *************************************************************
669 * Generating the Private Key may take some time, go grab a *
670 * Coffee. Even better, to generate some more entropy if it *
671 * is taking a while, open another console and type du / a *
672 * few times and get that HD going :) Then answer the *
673 * Questions which follow. If you are unsure, just hit enter *
674 *************************************************************\n\n";
675 system("certtool --generate-privkey --outfile key.pem");
676 system("certtool --generate-self-signed --load-privkey key.pem --outfile cert.pem");
677 print "\nCertificate generation complete, copying to config directory... ";
678 system("mv key.pem $config{CONFIG_DIR}/key.pem");
679 system("mv cert.pem $config{CONFIG_DIR}/cert.pem");
682 print "SSL Certificates found, skipping.\n\n"
687 print "Skipping SSL certificate generation\nin non-interactive mode.\n\n";
689 } elsif ($config{USE_OPENSSL} eq "y") {
691 open(TMP, "<src/modules/m_ssl_openssl.cpp") or $failed = 1;
694 print "Symlinking src/modules/m_ssl_openssl.cpp from extra/\n";
695 chdir("src/modules");
696 system("ln -s extra/m_ssl_openssl.cpp");
697 system("ln -s extra/ssl_cert.h");
704 open(TMP, "<$config{CONFIG_DIR}/key.pem") or $failed = 1;
706 open(TMP, "<$config{CONFIG_DIR}/cert.pem") or $failed = 1;
709 print "SSL Certificates Not found, Generating.. \n\n
710 *************************************************************
711 * Generating the certificates may take some time, go grab a *
712 * coffee, or something. *
713 *************************************************************\n\n";
714 system("openssl req -x509 -nodes -newkey rsa:1024 -keyout key.pem -out cert.pem");
715 system("openssl dhparam -out dhparams.pem 1024");
716 print "\nCertificate generation complete, copying to config directory... ";
717 system("mv key.pem $config{CONFIG_DIR}/key.pem");
718 system("mv cert.pem $config{CONFIG_DIR}/cert.pem");
719 system("mv dhparams.pem $config{CONFIG_DIR}/dhparams.pem");
722 print "SSL Certificates found, skipping.\n\n"
727 print "Skipping SSL certificate generation\nin non-interactive mode.\n\n";
730 if (($config{USE_GNUTLS} eq "n") && ($config{USE_OPENSSL} eq "n")) {
731 print "Skipping SSL Certificate generation, SSL support is not available.\n\n";
739 print "To build your server with these settings, please type '\033[1;32m$config{MAKEPROG}\033[0m' now.\n";
740 if (($config{USE_GNUTLS} eq "y") || ($config{USE_OPENSSL} eq "y")) {
741 print "Please remember that to enable \033[1;32mSSL support\033[0m you must\n";
742 print "load the required modules in your config. This configure process\n";
743 print "has just prepared these modules to be compiled for you, and has not\n";
744 print "configured them to be compiled into the core of the ircd.\n";
746 print "*** \033[1;32mRemember to edit your configuration files!!!\033[0m ***\n\n\n";
747 if (($config{OSNAME} eq "OpenBSD") && ($config{CC} ne "eg++")) {
748 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";
751 if ($config{GCCVER} < "3") {
753 \033[1;32mWARNING!\033[0m You are attempting to compile InspIRCd on GCC 2.x!
754 GCC 2.x series compilers only had partial (read as broken) C++ support, and
755 your compile will most likely fail horribly! If you have any problems, do NOT
756 report them to the bugtracker or forums without first upgrading your compiler
757 to a newer 3.x or 4.x (or whatever is available currently) version.
761 ################################################################################
763 ################################################################################
765 # Retrieves the .config.cache file, and loads values into the main config hash.
766 open(CACHE, ".config.cache") or return undef;
769 # Ignore Blank lines, and comments..
772 my ($key, $value) = split("=", $_, 2);
773 $value =~ /^\"(.*)\"$/;
774 # Do something with data here!
782 # Dump the contents of %config
783 print "Writing \033[1;32mcache file\033[0m for future ./configures ...\n";
784 open(FILEHANDLE, ">.config.cache");
785 foreach $key (keys %config) {
786 print FILEHANDLE "$key=\"$config{$key}\"\n";
792 my ($desc, $hash_key) = @_;
795 print "In what directory $desc?\n";
796 print "[\033[1;32m$config{$hash_key}\033[0m] -> ";
797 chomp($var = <STDIN>);
799 $var = $config{$hash_key};
801 if ($var =~ /^\~\/(.+)$/) {
802 # Convert it to a full path..
803 $var = resolve_directory($ENV{HOME} . "/" . $1);
805 elsif ((($config{OSNAME} =~ /MINGW32/i) and ($var !~ /^[A-Z]{1}:\\.*/)) and (substr($var,0,1) ne "/"))
807 # Assume relative Path was given.. fill in the rest.
808 $var = $this . "/$var";
811 $var = resolve_directory($var);
813 print "$var does not exist. Create it?\n[\033[1;32my\033[0m] ";
814 chomp($tmp = <STDIN>);
815 if (($tmp eq "") || ($tmp =~ /^y/i)) {
816 # Attempt to Create the Dir..
818 system("mkdir -p \"$var\" >> /dev/null 2>&1");
819 $chk = system("mkdir -p \"$var\" >> /dev/null 2>&1") / 256;
821 print "Unable to create directory. ($var)\n\n";
826 # They said they don't want to create, and we can't install there.
832 # Target exists, but is not a directory.
833 print "File $var exists, but is not a directory.\n\n";
837 # Either Dir Exists, or was created fine.
838 $config{$hash_key} = $var;
846 $config{LDLIBS} = "-lstdc++";
847 $config{FLAGS} = "-fno-strict-aliasing -fPIC -Wall -Woverloaded-virtual $config{OPTIMISATI}";
848 $config{MAKEPROG} = "make";
849 $SHARED = "-Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared";
851 if ($config{OSNAME} =~ /OpenBSD/i) {
852 $config{MAKEPROG} = "gmake";
853 chomp($foo = `eg++ -dumpversion | cut -c 1`);
854 # theyre running the package version of gcc (eg++)... detect it and set up its version numbers.
855 # if theyre not running this, configure lets the build continue but they probably wont manage to
856 # compile as this standard version is 2.95.3!
858 $config{CC} = "eg++";
859 chomp($config{GCCVER} = `eg++ -dumpversion | cut -c 1`); # we must redo these if we change the compiler path
864 if ($config{OSNAME} =~ /darwin/i) {
865 $SHARED = "-bundle -undefined dynamic_lookup";
866 $config{LDLIBS} = "-ldl -lstdc++";
868 if ($config{OSNAME} =~ /Linux/i) {
869 $config{LDLIBS} = "-ldl -lstdc++";
870 $config{FLAGS} = "-fno-strict-aliasing -fPIC -Wall -Woverloaded-virtual $config{OPTIMISATI}";
871 $config{FLAGS} .= " " . $ENV{CXXFLAGS} if exists($ENV{CXXFLAGS});
872 $config{MAKEPROG} = "make";
873 if ($config{OSNAME} =~ /CYGWIN/) {
874 $config{FLAGS} = "-fno-strict-aliasing -Wall -Woverloaded-virtual $config{OPTIMISATI}";
875 $config{LDLIBS} = "";
876 $config{MAKEPROG} = "/usr/bin/make";
877 $config{MAKEORDER} = "ircd mods";
879 } elsif ($config{OSNAME} eq "CYG-STATIC") {
880 $config{FLAGS} = "-fno-strict-aliasing -Wall -Woverloaded-virtual $config{OPTIMISATI}";
881 $config{LDLIBS} = "";
882 $config{MAKEPROG} = "/usr/bin/make";
883 $config{MAKEORDER} = "mods ircd";
884 $config{STATICLIBS} = "modules/mods.a";
885 $config{STATIC_LINK} = "yes";
886 return "Cygwin-Static";
888 $config{FLAGS} .= " " . $ENV{CXXFLAGS} if exists($ENV{CXXFLAGS});
891 if ($config{OSNAME} =~ /SunOS/i)
893 # solaris/sunos needs these
894 # socket = bsd sockets api
896 # rt = POSIX realtime extensions
897 # resolv = inet_aton only (why isnt this in nsl?!)
898 $config{MAKEPROG} = "gmake";
899 $config{LDLIBS} = $config{LDLIBS} . " -lsocket -lnsl -lrt -lresolv";
903 if($config{OSNAME} =~ /MINGW32/i)
905 # All code is position-independent on windows
906 $config{FLAGS} =~ s/-fPIC //;
910 return $config{OSNAME};
914 my($writeheader) = @_;
915 # First File.. inspircd_config.h
916 chomp(my $incos = `uname -n -s -r`);
917 chomp(my $version = `sh ./src/version.sh`);
918 chomp(my $revision = getrevision());
919 $version = "$version(r$revision)";
920 chomp(my $revision2 = getrevision());
921 if ($writeheader == 1)
923 print "Writing \033[1;32minspircd_config.h\033[0m\n";
924 open(FILEHANDLE, ">include/inspircd_config.h");
925 my $NL = $config{NICK_LENGT}+1;
926 my $CL = $config{CHAN_LENGT}+1;
927 print FILEHANDLE <<EOF;
928 /* Auto generated by configure, do not modify! */
929 #ifndef __CONFIGURATION_AUTO__
930 #define __CONFIGURATION_AUTO__
932 #define CONFIG_FILE "$config{CONFIG_DIR}/inspircd.conf"
933 #define MOD_PATH "$config{MODULE_DIR}"
934 #define VERSION "$version"
935 #define REVISION "$revision2"
936 #define MAXCLIENTS $config{MAX_CLIENT}
937 #define MAXCLIENTS_S "$config{MAX_CLIENT}"
938 #define SOMAXCONN_S "$config{_SOMAXCONN}"
939 #define MAX_DESCRIPTORS $config{MAX_DESCRIPTORS}
942 #define MAXCHANS $config{MAX_CHANNE}
943 #define OPERMAXCHANS $config{MAX_OPERCH}
944 #define MAXMODES $config{MAXI_MODES}
945 #define IDENTMAX $config{MAX_IDENT}
946 #define MAXQUIT $config{MAX_QUIT}
947 #define MAXTOPIC $config{MAX_TOPIC}
948 #define MAXKICK $config{MAX_KICK}
949 #define MAXGECOS $config{MAX_GECOS}
950 #define MAXAWAY $config{MAX_AWAY}
951 #define OPTIMISATION $config{OPTIMITEMP}
952 #define LIBRARYDIR "$config{LIBRARY_DIR}"
953 #define SYSTEM "$incos"
956 if ($config{OSNAME} =~ /SunOS/i) {
957 print FILEHANDLE "#define IS_SOLARIS\n";
959 if ($config{OSNAME} =~ /CYGWIN/i) {
960 print FILEHANDLE "#define IS_CYGWIN\n";
961 print FILEHANDLE "#ifndef FD_SETSIZE\n#define FD_SETSIZE 1024\n#endif\n";
963 if ($config{OSNAME} =~ /MINGW32/i) {
964 print FILEHANDLE "#define IS_MINGW\n";
966 if ($config{OSNAME} =~ /CYG-STATIC/i) {
967 print FILEHANDLE "#ifndef FD_SETSIZE\n#define FD_SETSIZE 1024\n#endif\n";
969 if ($config{STATIC_LINK} eq "yes") {
970 print FILEHANDLE "#define STATIC_LINK\n";
972 if ($config{GCCVER} >= 3) {
973 print FILEHANDLE "#define GCC3\n";
975 if ($config{HAS_STRLCPY} eq "true") {
976 print FILEHANDLE "#define HAS_STRLCPY\n";
978 if ($config{HAS_STDINT} eq "true") {
979 print FILEHANDLE "#define HAS_STDINT\n";
981 if ($config{IPV6} =~ /y/i) {
982 print FILEHANDLE "#define IPV6\n";
984 if ($config{SUPPORT_IP6LINKS} =~ /y/i) {
985 print FILEHANDLE "#define SUPPORT_IP6LINKS\n";
988 if (($has_kqueue) && ($config{USE_KQUEUE} eq "y")) {
989 print FILEHANDLE "#define USE_KQUEUE\n";
990 $se = "socketengine_kqueue";
993 if (($has_epoll) && ($config{USE_EPOLL} eq "y")) {
994 print FILEHANDLE "#define USE_EPOLL\n";
995 $se = "socketengine_epoll";
998 # user didn't choose either epoll or select for their OS.
999 # default them to USE_SELECT (ewwy puke puke)
1001 print FILEHANDLE "#define USE_SELECT\n";
1002 $se = "socketengine_select";
1004 print FILEHANDLE "\n#endif\n";
1010 open(FILEHANDLE, ">include/inspircd_se_config.h");
1011 print FILEHANDLE <<EOF;
1012 /* Auto generated by configure, do not modify or commit to svn! */
1013 #ifndef __CONFIGURATION_SOCKETENGINE__
1014 #define __CONFIGURATION_SOCKETENGINE__
1024 # Create a Modules List..
1026 foreach $i (@modlist)
1028 if ($config{STATIC_LINK} eq "yes") {
1029 $modules .= "m_".$i.".o ";
1032 $modules .= "m_".$i.".so ";
1035 chomp($modules); # Remove Redundant whitespace..
1037 opendir(DIRHANDLE, "src/modules");
1038 foreach $name (sort readdir(DIRHANDLE)) {
1039 if ($name =~ /^m_(.+?)$/) {
1040 if (opendir(MDIRHANDLE, "src/modules/$name") != 0) {
1041 closedir(MDIRHANDLE);
1042 $modules .= "$name.so ";
1046 closedir(DIRHANDLE);
1049 # Write all .in files.
1052 my $exe = "inspircd";
1054 if ($config{OSNAME} =~ /CYGWIN/i) {
1055 $exe = "inspircd.exe";
1058 opendir(DIRHANDLE, $this);
1060 # Do this once here, and cache it in the .*.inc files,
1061 # rather than attempting to read src/version.sh from
1062 # compiled code -- we might not have the source to hand.
1063 # Fix for bug#177 by Brain.
1065 chomp(my $version = `sh ./src/version.sh`);
1066 chomp(my $revision = getrevision());
1067 $version = "$version(r$revision)";
1070 if ($config{IS_DARWIN} eq "NO")
1075 # We can actually parse any file starting with . and ending with .inc,
1076 # but right now we only parse .inspircd.inc to form './inspircd'
1078 foreach $name (sort readdir(DIRHANDLE)) {
1079 if ($name =~ /^\.(.+)\.inc$/) {
1081 # All .name.inc files need parsing!
1083 open(FILEHANDLE, ".$file.inc");
1084 while (<FILEHANDLE>) {
1089 $tmp =~ s/\@CC\@/$config{CC}/;
1090 $tmp =~ s/\@MAKEPROG\@/$config{MAKEPROG}/;
1091 $tmp =~ s/\@FLAGS\@/$config{FLAGS}/;
1092 $tmp =~ s/\@LDLIBS\@/$config{LDLIBS}/;
1093 $tmp =~ s/\@BASE_DIR\@/$config{BASE_DIR}/;
1094 $tmp =~ s/\@CONFIG_DIR\@/$config{CONFIG_DIR}/;
1095 $tmp =~ s/\@MODULE_DIR\@/$config{MODULE_DIR}/;
1096 $tmp =~ s/\@MODULE_EXT\@/$modext/;
1097 $tmp =~ s/\@BINARY_DIR\@/$config{BINARY_DIR}/;
1098 $tmp =~ s/\@LIBRARY_DIR\@/$config{LIBRARY_DIR}/;
1099 $tmp =~ s/\@MODULES\@/$modules/;
1100 $tmp =~ s/\@EXECUTABLE\@/$exe/;
1101 $tmp =~ s/\@MAKEORDER\@/$config{MAKEORDER}/;
1102 $tmp =~ s/\@STATICLIBS\@/$config{STATICLIBS}/;
1103 $tmp =~ s/\@IS_DARWIN\@/$config{IS_DARWIN}/;
1104 $tmp =~ s/\@VERSION\@/$version/;
1106 print "Writing \033[1;32m$file\033[0m\n";
1107 open(FILEHANDLE, ">$file");
1108 print FILEHANDLE $tmp;
1111 closedir(DIRHANDLE);
1113 # Make inspircd executable!
1114 chmod 0744, 'inspircd';
1116 if ($config{STATIC_LINK} eq "yes") {
1117 print "Writing static-build \033[1;32msrc/Makefile\033[0m\n";
1118 write_static_makefile();
1119 write_static_modules_makefile();
1120 } elsif ($config{OSNAME} =~ /CYGWIN/i) {
1121 print "Writing cygwin-build \033[1;32msrc/Makefile\033[0m\n";
1122 write_static_makefile();
1123 write_dynamic_modules_makefile();
1125 print "Writing dynamic-build \033[1;32msrc/Makefile\033[0m\n";
1126 write_dynamic_makefile();
1127 write_dynamic_modules_makefile();
1131 sub write_static_modules_makefile {
1132 # Modules Makefile..
1133 print "Writing \033[1;32msrc/modules/Makefile\033[0m\n";
1134 open(FILEHANDLE, ">src/modules/Makefile");
1137 # Module Makefile Header
1139 print FILEHANDLE <<EOF;
1140 # (C) ChatSpike development team
1141 # Makefile by <Craig\@ChatSpike.net>
1142 # Many Thanks to Andrew Church <achurch\@achurch.org>
1143 # for assisting with making this work right.
1145 # Automatically Generated by ./configure to add a modules
1146 # please run ./configure --update
1152 # End Module Makefile Header
1155 # Create a Modules List..
1160 open(MODLIST,">include/modlist.h");
1163 # Include File Header
1165 print MODLIST <<HEADER;
1166 // Generated automatically by configure. DO NOT EDIT!
1168 #ifndef __SYMBOLS__H_CONFIGURED__
1169 #define __SYMBOLS__H_CONFIGURED__
1173 # End Include File Header
1176 # Place Module List into Include
1177 foreach $i (@modlist) {
1178 if ($i !~ /_static$/) {
1179 print MODLIST "extern \"C\" void * $i\_init (void);\n";
1182 print MODLIST "\nstruct {const char *name; initfunc *value; } modsyms[] = {\n";
1187 foreach $i (@modlist)
1189 if ($i !~ /_static$/) {
1190 $cmflags = getcompilerflags("src/modules/m_".$i.".cpp");
1191 $liflags = getlinkerflags("src/modules/m_".$i.".cpp");
1192 $deps = getdependencies("src/modules/m_".$i.".cpp");
1194 #print "file: $i: cmflags=$cmflags; liflags=$liflags; deps=$deps\n";
1197 # Write Entry to the Makefile
1199 print FILEHANDLE <<EOCHEESE;
1200 m_$i.o: .m_$i\_static.cpp ../../include/modules.h ../../include/users.h ../../include/channels.h ../../include/base.h $deps
1201 \$(CC) -pipe -I../../include \$(FLAGS) $flags -export-dynamic -c .m_$i\_static.cpp
1202 mv .m_$i\_static.o ../m_$i.o
1206 # End Write Entry to the MakeFile
1208 print "Configuring module [\033[1;32mm_$i.so\033[0m] for static linking... ";
1209 open(MODULE,"<src/modules/m_".$i.".cpp") or die("Could not open m_".$i.".cpp");
1210 open(MUNGED,">src/modules/.m_".$i."_static.cpp") or die("Could not create .m_".$i."_static.cpp");
1211 while (chomp($a = <MODULE>)) {
1212 $a =~ s/init_module/$i\_init/g;
1213 print MUNGED "$a\n";
1217 print MODLIST <<EOENT;
1218 {"m_$i.so",\&$i\_init},
1224 print MODLIST "{0}};\n\n#endif\n";
1228 sub write_dynamic_modules_makefile {
1229 # Modules Makefile..
1230 print "Writing \033[1;32msrc/modules/Makefile\033[0m\n";
1231 open(FILEHANDLE, ">src/modules/Makefile");
1234 if ($config{OSNAME} =~ /CYGWIN/i) {
1235 $extra = "../inspircd.dll.a";
1239 # Module Makefile Header
1241 print FILEHANDLE <<EOF;
1242 # (C) ChatSpike development team
1243 # Makefile by <Craig\@ChatSpike.net>
1244 # Many Thanks to Andrew Church <achurch\@achurch.org>
1245 # for assisting with making this work right.
1247 # Automatically Generated by ./configure to add a modules
1248 # please run ./configure -update or ./configure -modupdate
1254 # End Module Makefile Header
1257 # Create a Modules List..
1263 foreach $i (@modlist) {
1265 # Write Entry to the MakeFile
1267 $cmflags = getcompilerflags("src/modules/m_".$i.".cpp");
1268 $liflags = getlinkerflags("src/modules/m_".$i.".cpp");
1269 $deps = getdependencies("src/modules/m_".$i.".cpp");
1271 #print "file: $i: cmflags=$cmflags; liflags=$liflags; deps=$deps\n";
1273 print FILEHANDLE <<EOCHEESE;
1274 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
1275 \$(CC) -pipe -I../../include \$(FLAGS) $cmflags -export-dynamic -c m_$i.cpp
1278 if ($config{OSNAME} =~ /darwin/) {
1279 print FILEHANDLE <<EOCHEESE;
1280 \$(CC) -pipe -twolevel_namespace -undefined dynamic_lookup \$(FLAGS) -bundle $liflags -o m_$i.so m_$i.o $extra
1284 print FILEHANDLE <<EOCHEESE;
1285 \$(CC) -pipe \$(FLAGS) -shared $liflags -o m_$i.so m_$i.o $extra
1289 $crud = $crud . " install -m \$(INSTMODE) m_$i.so \$(MODPATH)\n";
1291 # End Write Entry to the MakeFile
1295 opendir(DIRHANDLE, "src/modules");
1296 foreach $name (sort readdir(DIRHANDLE)) {
1297 if ($name =~ /^m_(.+?)$/) {
1300 # A module made of multiple files, in a dir, e.g. src/modules/m_spanningtree/
1301 if (opendir(MDIRHANDLE, "src/modules/$name") != 0) {
1302 print "Composing Makefile rules for directory \033[1;32m$name\033[0m... ";
1304 print FILEHANDLE "$name.so: ../../include/modules.h ../../include/users.h ../../include/channels.h ../../include/base.h ../../include/inspircd_config.h ../../include/inspircd.h ../../include/configreader.h";
1305 foreach $fname (sort readdir(MDIRHANDLE)) {
1306 if ($fname =~ /\.cpp$/) {
1307 $cmflags = getcompilerflags("src/modules/$name/$fname");
1308 $liflags = getlinkerflags("src/modules/$name/$fname");
1309 $deps = getdependencies("src/modules/$name/$fname");
1311 $oname =~ s/\.cpp$/.o/g;
1312 print FILEHANDLE " $name/$oname";
1313 $crapola = $crapola . "$name/$oname: $name/$fname ../../include/modules.h ../../include/users.h ../../include/channels.h ../../include/base.h ../../include/inspircd_config.h ../../include/inspircd.h ../../include/configreader.h $deps\n";
1314 $crapola = $crapola . " \$(CC) -pipe -I../../include -I. \$(FLAGS) $cmflags -export-dynamic -o $name/$oname -c $name/$fname\n\n";
1315 $crap3 = $crap3 . " $name/$oname";
1319 print "(\033[1;32m$i files found\033[0m)\n";
1320 if ($config{OSNAME} =~ /darwin/) {
1321 print FILEHANDLE "\n \$(CC) -pipe -twolevel_namespace -undefined dynamic_lookup \$(FLAGS) -bundle -o $name.so $crap3\n";
1323 print FILEHANDLE "\n \$(CC) -pipe \$(FLAGS) -shared $liflags -o $name.so $crap3\n";
1325 print FILEHANDLE "\n$crapola\n";
1326 closedir(MDIRHANDLE);
1327 $crud = $crud . " install -m \$(INSTMODE) $name.so \$(MODPATH)\n";
1331 closedir(DIRHANDLE);
1333 print FILEHANDLE "modinst:\n \@echo \"Installing modules...\"\n" . $crud;
1337 sub write_static_makefile {
1338 open(FH,">src/Makefile") or die("Could not write src/Makefile!");
1341 opendir(DIRHANDLE, "src");
1342 foreach $name (sort readdir(DIRHANDLE)) {
1343 if ($name =~ /^cmd_(.+)\.cpp$/) {
1344 $cmdlist[$i++] = $1;
1347 closedir(DIRHANDLE);
1350 foreach my $cmd (@cmdlist) {
1351 $cmdobjs = $cmdobjs . "cmd_$cmd.o ";
1352 $srcobjs = $srcobjs . "cmd_$cmd.cpp ";
1357 # (C) ChatSpike development team
1358 # Makefile by <Craig\@ChatSpike.net>
1359 # Makefile version 2 (statically linked core) by <brain\@inspircd.org>
1362 CC = im a cheezeball
1364 CXXFLAGS = -I../include \${FLAGS}
1365 CPPFILES = \$(shell /bin/ls -l modes/ | grep '\\.cpp' | sed 's/^.* //' | grep -v svn)
1366 RELCPPFILES = \$(shell /bin/ls -l modes/ | grep '\\.cpp' | sed 's/^.* /modes\\//' | grep -v svn)
1370 $se = "socketengine_select";
1371 if (($has_kqueue) && ($config{USE_KQUEUE} eq "y")) {
1372 $se = "socketengine_kqueue";
1374 elsif (($has_epoll) && ($config{USE_EPOLL} eq "y")) {
1375 $se = "socketengine_epoll";
1379 # This next section is for cygwin dynamic module builds.
1380 # Basically, what we do, is build the inspircd core as a library
1381 # then the main executable uses that. the library is capable of
1382 # loading / unloading the modules dynamically :)
1383 # Massive thanks to the guys on #cygwin @ irc.freenode.net for helping
1387 if ($config{OSNAME} =~ /CYGWIN/i) {
1389 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
1391 inspircd.exe: inspircd.dll.a
1394 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
1395 \$(CC) -shared -Wl,--out-implib=inspircd.dll.a -o inspircd.dll \$^
1399 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
1401 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
1402 \$(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)
1408 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
1409 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c cull_list.cpp
1411 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
1412 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c snomasks.cpp
1414 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
1415 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c command_parse.cpp
1417 userprocess.o: userprocess.cpp ../include/base.h ../include/hashcomp.h ../include/globals.h ../include/inspircd_config.h
1418 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c userprocess.cpp
1420 socketengine.o: $se.cpp socketengine.cpp ../include/base.h ../include/hashcomp.h ../include/globals.h ../include/inspircd_config.h ../include/$se.h
1421 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c socketengine.cpp $se.cpp
1423 hashcomp.o: hashcomp.cpp ../include/base.h ../include/hashcomp.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1424 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c hashcomp.cpp
1426 helperfuncs.o: helperfuncs.cpp ../include/base.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1427 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c helperfuncs.cpp
1429 channels.o: channels.cpp ../include/base.h ../include/channels.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1430 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c channels.cpp
1432 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
1433 \${MAKE} -C "modes" DIRNAME="src/modes" CC="\$(CC)" \$(MAKEARGS)
1434 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c mode.cpp
1436 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
1437 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c xline.cpp
1439 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
1440 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c inspstring.cpp
1442 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 ../include/timer.h
1443 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c dns.cpp
1445 base.o: base.cpp ../include/base.h ../include/globals.h ../include/inspircd_config.h
1446 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c base.cpp
1448 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
1449 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c configreader.cpp
1451 commands.o: commands.cpp ../include/base.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h ../include/timer.h $srcobjs
1452 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c commands.cpp $cmdobjs
1454 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
1455 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c dynamic.cpp
1457 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 ../include/timer.h
1458 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c users.cpp
1460 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 ../include/timer.h
1461 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c modules.cpp
1463 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
1464 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c wildcard.cpp
1466 socket.o: socket.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h
1467 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c socket.cpp
1469 inspsocket.o: inspsocket.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h ../include/timer.h
1470 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c inspsocket.cpp
1472 timer.o: timer.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h ../include/timer.h
1473 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c timer.cpp
1476 foreach my $cmd (@cmdlist) {
1478 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
1479 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c cmd_$cmd.cpp
1485 sub write_dynamic_makefile {
1489 opendir(DIRHANDLE, "src");
1490 foreach $name (sort readdir(DIRHANDLE)) {
1491 if ($name =~ /^cmd_(.+)\.cpp$/) {
1492 $cmdlist[$i++] = $1;
1495 closedir(DIRHANDLE);
1499 foreach my $cmd (@cmdlist) {
1500 $cmdobjs = $cmdobjs . "cmd_$cmd.so ";
1501 $srcobjs = $srcobjs . "cmd_$cmd.cpp ";
1504 $se = "socketengine_select";
1505 if (($has_kqueue) && ($config{USE_KQUEUE} eq "y")) {
1506 $se = "socketengine_kqueue";
1508 elsif (($has_epoll) && ($config{USE_EPOLL} eq "y")) {
1509 $se = "socketengine_epoll";
1512 open(FH,">src/Makefile") or die("Could not write src/Makefile");
1516 # (C) ChatSpike development team
1517 # Makefile by <Craig\@ChatSpike.net>
1518 # Makefile version 2 (dynamically linked core) by <brain\@inspircd.org>
1521 CC = im a cheezeball
1523 CXXFLAGS = -I../include \${FLAGS}
1524 CPPFILES = \$(shell /bin/ls -l modes/ | grep '\\.cpp' | sed 's/^.* //' | grep -v svn)
1525 RELCPPFILES = \$(shell /bin/ls -l modes/ | grep '\\.cpp' | sed 's/^.* /modes\\//' | grep -v svn)
1529 CPPFILES_OBJS = \$(RELCPPFILES:.cpp=.o)
1533 if ($config{OSNAME} =~ /darwin/) {
1535 all: \$(CPPFILES_OBJS) $cmdobjs libIRCDtimer.dylib libIRCDcull_list.dylib libIRCDuserprocess.dylib libIRCDsocketengine.dylib libIRCDsocket.dylib libIRCDhash.dylib libIRCDchannels.dylib libIRCDmode.dylib libIRCDxline.dylib libIRCDstring.dylib libIRCDasyncdns.dylib libIRCDbase.dylib libIRCDconfigreader.dylib libIRCDinspsocket.dylib libIRCDcommands.dylib libIRCDdynamic.dylib libIRCDusers.dylib libIRCDmodules.dylib libIRCDwildcard.dylib libIRCDhelper.dylib libIRCDcommand_parse.dylib libIRCDsnomasks.dylib inspircd
1537 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 \$(CPPFILES_OBJS) \$(CMD_OBJS) \$(CMD_LINK_OBJS) libIRCDtimer.dylib libIRCDcull_list.dylib libIRCDuserprocess.dylib libIRCDsocketengine.dylib libIRCDsocket.dylib libIRCDhash.dylib libIRCDchannels.dylib libIRCDmode.dylib libIRCDxline.dylib libIRCDstring.dylib libIRCDasyncdns.dylib libIRCDbase.dylib libIRCDconfigreader.dylib libIRCDinspsocket.dylib libIRCDsnomasks.dylib libIRCDcommands.dylib libIRCDdynamic.dylib libIRCDusers.dylib libIRCDmodules.dylib libIRCDwildcard.dylib libIRCDhelper.dylib libIRCDcommand_parse.dylib
1538 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c inspircd.cpp
1539 \$(CC) -pipe -dynamic -L. -o inspircd \$(LDLIBS) inspircd.o libIRCDchannels.dylib libIRCDmode.dylib libIRCDxline.dylib libIRCDstring.dylib libIRCDasyncdns.dylib libIRCDbase.dylib libIRCDconfigreader.dylib libIRCDinspsocket.dylib libIRCDcommands.dylib libIRCDdynamic.dylib libIRCDusers.dylib libIRCDmodules.dylib libIRCDwildcard.dylib libIRCDhelper.dylib libIRCDhash.dylib libIRCDsocket.dylib libIRCDsocketengine.dylib libIRCDuserprocess.dylib libIRCDcull_list.dylib libIRCDcommand_parse.dylib libIRCDtimer.dylib libIRCDsnomasks.dylib
1541 libIRCDsocketengine.dylib: $se.cpp socketengine.cpp ../include/base.h ../include/hashcomp.h ../include/globals.h ../include/inspircd_config.h ../include/$se.h
1542 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c socketengine.cpp $se.cpp
1543 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDsocketengine.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDsocketengine.dylib socketengine.o $se.o
1545 libIRCDsnomasks.dylib: snomasks.cpp ../include/base.h ../include/hashcomp.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h ../include/channels.h
1546 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c snomasks.cpp
1547 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDsnomasks.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDsnomasks.dylib snomasks.o
1549 libIRCDcommand_parse.dylib: command_parse.cpp ../include/base.h ../include/hashcomp.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1550 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c command_parse.cpp
1551 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDcommand_parse.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDcommand_parse.dylib command_parse.o
1553 libIRCDcull_list.dylib: cull_list.cpp ../include/base.h ../include/hashcomp.h ../include/globals.h ../include/inspircd_config.h ../include/users.h ../include/channels.h
1554 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c cull_list.cpp
1555 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDcull_list.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDcull_list.dylib cull_list.o
1557 libIRCDuserprocess.dylib: userprocess.cpp ../include/base.h ../include/hashcomp.h ../include/globals.h ../include/inspircd_config.h
1558 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c userprocess.cpp
1559 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDuserprocess.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDuserprocess.dylib userprocess.o
1561 libIRCDhash.dylib: hashcomp.cpp ../include/base.h ../include/hashcomp.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1562 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c hashcomp.cpp
1563 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDhash.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDhash.dylib hashcomp.o
1565 libIRCDhelper.dylib: helperfuncs.cpp ../include/base.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1566 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c helperfuncs.cpp
1567 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDhelper.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDhelper.dylib helperfuncs.o
1569 libIRCDchannels.dylib: channels.cpp ../include/base.h ../include/channels.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1570 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c channels.cpp
1571 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDchannels.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDchannels.dylib channels.o
1573 libIRCDmode.dylib: 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)
1574 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c mode.cpp
1575 \${MAKE} -C "modes" DIRNAME="src/modes" CC="\$(CC)" \$(MAKEARGS) CPPFILES="\$(CPPFILES)"
1576 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDmode.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDmode.dylib mode.o modes/modeclasses.a
1578 libIRCDxline.dylib: xline.cpp ../include/base.h ../include/xline.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h ../include/timer.h
1579 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c xline.cpp
1580 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDxline.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDxline.dylib xline.o
1582 libIRCDstring.dylib: inspstring.cpp ../include/base.h ../include/inspstring.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1583 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c inspstring.cpp
1584 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDstring.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDstring.dylib inspstring.o
1586 libIRCDasyncdns.dylib: dns.cpp ../include/base.h ../include/dns.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h ../include/timer.h
1587 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c dns.cpp
1588 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDasyncdns.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDasyncdns.dylib dns.o
1590 libIRCDbase.dylib: base.cpp ../include/base.h ../include/globals.h ../include/inspircd_config.h
1591 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c base.cpp
1592 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDbase.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDbase.dylib base.o
1594 libIRCDconfigreader.dylib: configreader.cpp ../include/base.h ../include/configreader.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1595 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c configreader.cpp
1596 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDconfigreader.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDconfigreader.dylib configreader.o
1598 libIRCDcommands.dylib: commands.cpp ../include/base.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h ../include/timer.h
1599 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c commands.cpp
1600 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDcommands.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDcommands.dylib commands.o
1602 libIRCDdynamic.dylib: dynamic.cpp ../include/base.h ../include/dynamic.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1603 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c dynamic.cpp
1604 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDdynamic.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDdynamic.dylib dynamic.o
1606 libIRCDusers.dylib: users.cpp ../include/base.h ../include/users.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h ../include/timer.h
1607 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c users.cpp
1608 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDusers.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDusers.dylib users.o
1610 libIRCDmodules.dylib: modules.cpp ../include/base.h ../include/modules.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h ../include/timer.h
1611 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c modules.cpp
1612 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDmodules.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDmodules.dylib modules.o
1614 libIRCDwildcard.dylib: wildcard.cpp ../include/base.h ../include/wildcard.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1615 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c wildcard.cpp
1616 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDwildcard.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDwildcard.dylib wildcard.o
1618 libIRCDsocket.dylib: socket.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h
1619 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c socket.cpp
1620 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDsocket.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDsocket.dylib socket.o
1622 libIRCDinspsocket.dylib: inspsocket.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h ../include/timer.h
1623 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c inspsocket.cpp
1624 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDinspsocket.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDinspsocket.dylib inspsocket.o
1626 libIRCDtimer.dylib: timer.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h ../include/timer.h
1627 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c timer.cpp
1628 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDtimer.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDtimer.dylib timer.o
1635 all: \$(CPPFILES_OBJS) $cmdobjs \$(CMD_LINK_OBJS) 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 libIRCDcommands.so libIRCDdynamic.so libIRCDusers.so libIRCDmodules.so libIRCDwildcard.so libIRCDhelper.so libIRCDcommand_parse.so libIRCDsnomasks.so inspircd
1637 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 \$(CPPFILES_OBJS) \$(CMD_OBJS) \$(CMD_LINK_OBJS) 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 libIRCDsnomasks.so libIRCDcommands.so libIRCDdynamic.so libIRCDusers.so libIRCDmodules.so libIRCDwildcard.so libIRCDhelper.so libIRCDcommand_parse.so
1638 \$(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
1640 libIRCDsocketengine.so: $se.cpp socketengine.cpp ../include/base.h ../include/hashcomp.h ../include/globals.h ../include/inspircd_config.h ../include/$se.h
1641 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c socketengine.cpp $se.cpp
1642 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDsocketengine.so socketengine.o $se.o
1644 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
1645 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c snomasks.cpp
1646 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDsnomasks.so snomasks.o
1648 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
1649 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c command_parse.cpp
1650 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDcommand_parse.so command_parse.o
1652 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
1653 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c cull_list.cpp
1654 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDcull_list.so cull_list.o
1656 libIRCDuserprocess.so: userprocess.cpp ../include/base.h ../include/hashcomp.h ../include/globals.h ../include/inspircd_config.h
1657 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c userprocess.cpp
1658 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDuserprocess.so userprocess.o
1660 libIRCDhash.so: hashcomp.cpp ../include/base.h ../include/hashcomp.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1661 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c hashcomp.cpp
1662 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDhash.so hashcomp.o
1664 libIRCDhelper.so: helperfuncs.cpp ../include/base.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1665 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c helperfuncs.cpp
1666 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDhelper.so helperfuncs.o
1668 libIRCDchannels.so: channels.cpp ../include/base.h ../include/channels.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1669 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c channels.cpp
1670 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDchannels.so channels.o
1672 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)
1673 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c mode.cpp
1674 \${MAKE} -C "modes" DIRNAME="src/modes" CC="\$(CC)" \$(MAKEARGS) CPPFILES="\$(CPPFILES)"
1675 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDmode.so mode.o modes/modeclasses.a
1677 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 ../include/timer.h
1678 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c xline.cpp
1679 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDxline.so xline.o
1681 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
1682 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c inspstring.cpp
1683 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDstring.so inspstring.o
1685 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 ../include/timer.h
1686 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c dns.cpp
1687 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDasyncdns.so dns.o
1689 libIRCDbase.so: base.cpp ../include/base.h ../include/globals.h ../include/inspircd_config.h
1690 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c base.cpp
1691 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDbase.so base.o
1693 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
1694 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c configreader.cpp
1695 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDconfigreader.so configreader.o
1697 libIRCDcommands.so: commands.cpp ../include/base.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h ../include/timer.h
1698 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c commands.cpp
1699 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDcommands.so commands.o
1701 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
1702 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c dynamic.cpp
1703 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDdynamic.so dynamic.o
1705 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 ../include/timer.h
1706 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c users.cpp
1707 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDusers.so users.o
1709 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 ../include/timer.h
1710 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c modules.cpp
1711 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDmodules.so modules.o
1713 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
1714 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c wildcard.cpp
1715 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDwildcard.so wildcard.o
1717 libIRCDsocket.so: socket.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h
1718 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c socket.cpp
1719 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDsocket.so socket.o
1721 libIRCDinspsocket.so: inspsocket.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h ../include/timer.h
1722 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c inspsocket.cpp
1723 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDinspsocket.so inspsocket.o
1725 libIRCDtimer.so: timer.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h ../include/timer.h
1726 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c timer.cpp
1727 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDtimer.so timer.o
1734 foreach my $cmd (@cmdlist) {
1736 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
1737 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c cmd_$cmd.cpp
1738 \$(CC) -pipe $SHARED -o cmd_$cmd.so cmd_$cmd.o