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 'rebuild' => \$opt_rebuild,
28 'enable-openssl' => \$opt_use_openssl,
29 'disable-interactive' => \$opt_nointeractive,
30 'with-nick-length=i' => \$opt_nick_length,
31 'with-channel-length=i' => \$opt_chan_length,
32 'with-max-channels=i' => \$opt_maxchans,
33 'with-max-oper-channels=i' => \$opt_opermaxchans,
34 'with-max-clients=i' => \$opt_maxclients,
35 'enable-epoll' => \$opt_epoll,
36 'enable-kqueue' => \$opt_kqueue,
37 'disable-epoll' => \$opt_noepoll,
38 'disable-kqueue' => \$opt_nokqueue,
39 'enable-ipv6' => \$opt_ipv6,
40 'enable-remote-ipv6' => \$opt_ipv6links,
41 'disable-remote-ipv6' => \$opt_noipv6links,
42 'with-cc=s' => \$opt_cc,
43 'with-ident-length=i' => \$opt_ident,
44 'with-quit-length=i' => \$opt_quit,
45 'with-topic-length=i' => \$opt_topic,
46 'with-kick-length=i' => \$opt_kick,
47 'with-gecos-length=i' => \$opt_gecos,
48 'with-away-length=i' => \$opt_away,
49 'with-max-modes=i' => \$opt_modes,
50 'prefix=s' => \$opt_base_dir,
51 'config-dir=s' => \$opt_config_dir,
52 'module-dir=s' => \$opt_module_dir,
53 'binary-dir=s' => \$opt_binary_dir,
54 'library-dir=s' => \$opt_library_dir,
55 'disable-debuginfo' => sub { $opt_disable_debug = 1 },
56 'help' => sub { showhelp(); },
57 'modupdate' => sub { modupdate(); },
58 'update' => sub { update(); },
59 'svnupdate' => sub { svnupdate(); },
60 'clean' => sub { clean(); },
63 my $non_interactive = (
64 (defined $opt_library_dir) ||
65 (defined $opt_base_dir) ||
66 (defined $opt_config_dir) ||
67 (defined $opt_module_dir) ||
68 (defined $opt_base_dir) ||
69 (defined $opt_binary_dir) ||
70 (defined $opt_nointeractive) ||
71 (defined $opt_away) ||
72 (defined $opt_gecos) ||
73 (defined $opt_kick) ||
74 (defined $opt_maxclients) ||
75 (defined $opt_modes) ||
76 (defined $opt_topic) ||
77 (defined $opt_quit) ||
78 (defined $opt_ident) ||
80 (defined $opt_ipv6) ||
81 (defined $opt_ipv6links) ||
82 (defined $opt_noipv6links) ||
83 (defined $opt_kqueue) ||
84 (defined $opt_epoll) ||
85 (defined $opt_maxchans) ||
86 (defined $opt_opermaxchans) ||
87 (defined $opt_chan_length) ||
88 (defined $opt_nick_length) ||
89 (defined $opt_use_openssl) ||
90 (defined $opt_nokqueue) ||
91 (defined $opt_noepoll) ||
92 (defined $opt_use_gnutls)
94 my $interactive = !$non_interactive;
97 chomp($topdir = getcwd());
98 $this = resolve_directory($topdir); # PWD, Regardless.
99 @modlist = (); # Declare for Module List..
100 %config = (); # Initiate Configuration Hash..
101 $config{ME} = resolve_directory($topdir); # Present Working Directory
103 $config{BASE_DIR} = $config{ME};
105 if (defined $opt_base_dir)
107 $config{BASE_DIR} = $opt_base_dir;
110 $config{CONFIG_DIR} = resolve_directory($config{BASE_DIR}."/conf"); # Configuration Directory
111 $config{MODULE_DIR} = resolve_directory($config{BASE_DIR}."/modules"); # Modules Directory
112 $config{BINARY_DIR} = resolve_directory($config{BASE_DIR}."/bin"); # Binary Directory
113 $config{LIBRARY_DIR} = resolve_directory($config{BASE_DIR}."/lib"); # Library Directory
115 if (defined $opt_config_dir)
117 $config{CONFIG_DIR} = $opt_config_dir;
119 if (defined $opt_module_dir)
121 $config{MODULE_DIR} = $opt_module_dir;
123 if (defined $opt_binary_dir)
125 $config{BINARY_DIR} = $opt_binary_dir;
127 if (defined $opt_library_dir)
129 $config{LIBRARY_DIR} = $opt_library_dir;
131 chomp($config{HAS_GNUTLS} = `libgnutls-config --version 2>/dev/null | cut -c 1,2,3`); # GNUTLS Version.
132 chomp($config{HAS_OPENSSL} = `openssl version 2>/dev/null`); # Openssl version
133 $config{USE_GNUTLS} = "n";
134 if (defined $opt_use_gnutls)
136 $config{USE_GNUTLS} = "y"; # Use gnutls.
138 $config{USE_OPENSSL} = "n"; # Use openssl.
139 if (defined $opt_use_openssl)
141 $config{USE_OPENSSL} = "y";
144 # no, let's not change these.
145 $config{OPTIMITEMP} = "0"; # Default Optimisation Value
146 if (!defined $opt_disable_debug)
148 $config{OPTIMISATI} = "-g1"; # Optimisation Flag
152 $config{OPTIMISATI} = "-O2"; # DEBUGGING OFF!
155 $config{NICK_LENGT} = "31"; # Default Nick Length
156 if (defined $opt_nick_length)
158 $config{NICK_LENGT} = $opt_nick_length;
160 $config{CHAN_LENGT} = "64"; # Default Channel Name Length
161 if (defined $opt_chan_length)
163 $config{CHAN_LENGT} = $opt_chan_length;
165 $config{MAX_CHANNE} = "20"; # Default Max. Channels per user
166 if (defined $opt_maxchans)
168 $config{MAX_CHANNE} = $opt_maxchans;
170 $config{MAX_OPERCH} = "60"; # Default Max. Channels per oper
171 if (defined $opt_opermaxchans)
173 $config{MAX_OPERCH} = $opt_opermaxchans;
175 $config{MAXI_MODES} = "20"; # Default Max. Number of Modes set at once.
176 if (defined $opt_modes)
178 $config{MAXI_MODES} = $opt_modes;
180 $config{HAS_STRLCPY} = "false"; # strlcpy Check.
181 $config{HAS_STDINT} = "false"; # stdint.h check
182 $config{USE_KQUEUE} = "y"; # kqueue enabled
183 if (defined $opt_kqueue)
185 $config{USE_KQUEUE} = "y";
187 if (defined $opt_nokqueue)
189 $config{USE_KQUEUE} = "n";
191 $config{USE_EPOLL} = "y"; # epoll enabled
192 if (defined $opt_epoll)
194 $config{USE_EPOLL} = "y";
196 if (defined $opt_noepoll)
198 $config{USE_EPOLL} = "n";
200 $config{IPV6} = "n"; # IPv6 support (experimental)
201 if (defined $opt_ipv6)
205 $config{SUPPORT_IP6LINKS} = "y"; # IPv4 supporting IPv6 links (experimental)
206 if (defined $opt_ipv6links)
208 $config{SUPPORT_IP6LINKS} = "y";
210 if (defined $opt_noipv6links)
212 $config{SUPPORT_IP6LINKS} = "n";
214 $config{STATIC_LINK} = "no"; # are doing static modules?
215 chomp($config{MAX_CLIENT_T} = `sh -c \"ulimit -n\"`); # FD Limit
216 chomp($config{MAX_DESCRIPTORS} = `sh -c \"ulimit -n\"`); # Hard FD Limit
217 chomp($config{GCCVER} = `g++ -dumpversion | cut -c 1`); # Major GCC Version
218 $config{_SOMAXCONN} = SOMAXCONN; # Max connections in accept queue
219 $config{OSNAME} = $^O; # Operating System Name
220 $config{IS_DARWIN} = "NO"; # Is OSX?
221 if ($config{OSNAME} =~ /darwin/i)
223 $config{IS_DARWIN} = "YES";
225 $config{CC} = "g++"; # C++ compiler
228 $config{CC} = $opt_cc;
230 $exec = $config{CC} . " -dumpversion | cut -c 1";
231 chomp($config{GCCVER} = `$exec`); # Major GCC Version
232 $config{MAKEORDER} = "ircd mods"; # build order
233 $config{STATICLIBS} = ""; # library archive path
234 $config{MAX_IDENT} = "12"; # max ident size
235 $config{MAX_QUIT} = "255"; # max quit message size
236 $config{MAX_TOPIC} = "307"; # max topic size
237 $config{MAX_KICK} = "255"; # max kick message size
238 $config{MAX_GECOS} = "128"; # max GECOS size
239 $config{MAX_AWAY} = "200"; # max AWAY size
240 if (defined $opt_ident)
242 $config{MAX_IDENT} = $opt_ident;
244 if (defined $opt_quit)
246 $config{MAX_QUIT} = $opt_quit;
248 if (defined $opt_topic)
250 $config{MAX_TOPIC} = $opt_topic;
252 if (defined $opt_kick)
254 $config{MAX_KICK} = $opt_kick;
256 if (defined $opt_gecos)
258 $config{MAX_GECOS} = $opt_gecos;
260 if (defined $opt_away)
262 $config{MAX_AWAY} = $opt_away;
265 $config{HAS_OPENSSL} =~ /OpenSSL ([-[:digit:].]+)([a-z])?(\-[a-z][0-9])? (\w{3}|[0-9]+) (\w{3}|[0-9]+) [0-9]{4}/;
266 $config{HAS_OPENSSL} = $1;
268 if ($config{GCCVER} eq "") {
269 print $config{CC} . " was not found! You require g++ (the GNU C++ compiler, part of GCC) to build InspIRCd!\n";
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";
375 system("svn update");
376 system("perl configure -update");
377 if (defined $opt_rebuild) {
378 system("make install");
383 print "Running non-interactive configure...\n" unless $interactive;
384 print "Checking for cache from previous configure... ";
385 print ((getcache() eq "true") ? "found\n" : "not found\n");
386 print "Checking operating system version... ";
387 print getosflags() . "\n";
389 if (defined $opt_maxclients)
391 $config{MAX_CLIENT} = $opt_maxclients;
394 if (!$config{MAX_CLIENT}) {
395 # If the cache hasn't set the max clients, copy the variable of MAX_CLIENT_T, this
396 # allows us to keep _T for testing purposes. (ie. "Are you sure you want to go
397 # higher than the found value" :))
398 $config{MAX_CLIENT} = $config{MAX_CLIENT_T};
401 printf "Checking if stdint.h exists... ";
402 $config{HAS_STDINT} = "true";
404 open(STDINT, "</usr/include/stdint.h") or $config{HAS_STDINT} = "false";
405 if ($config{HAS_STDINT} eq "true") {
408 print "yes\n" if $config{HAS_STDINT} eq "true";
409 print "no\n" if $config{HAS_STDINT} eq "false";
412 printf "Checking if strlcpy exists... ";
413 # Perform the strlcpy() test..
414 $config{HAS_STRLCPY} = "false";
416 open(STRLCPY, "</usr/include/string.h") or $fail = 1;
418 while (chomp($line = <STRLCPY>)) {
419 # try and find the delcaration of:
420 # size_t strlcpy(...)
421 if ($line =~ /size_t(\0x9|\s)+strlcpy/) {
422 $config{HAS_STRLCPY} = "true";
427 print "yes\n" if $config{HAS_STRLCPY} eq "true";
428 print "no\n" if $config{HAS_STRLCPY} eq "false";
431 printf "Checking if kqueue exists... ";
434 open(KQUEUE, "</usr/include/sys/event.h") or $fail = 1;
436 while (chomp($line = <KQUEUE>)) {
437 # try and find the delcaration of:
439 if ($line =~ /int(\0x9|\s)+kqueue/) {
445 print "yes\n" if $has_kqueue == 1;
446 print "no\n" if $has_kqueue == 0;
448 printf "Checking if epoll exists... ";
451 open(EPOLL, "</usr/include/sys/epoll.h") or $fail = 1;
457 my $kernel = `uname -r`;
459 if (($kernel =~ /^2\.0\./) || ($kernel =~ /^2\.2\./) || ($kernel =~ /^2\.4\./)) {
463 print "yes\n" if $has_epoll == 1;
464 print "no\n" if $has_epoll == 0;
466 if (($config{OSNAME} =~ /CYGWIN/) || ($config{OSNAME} eq "CYG-STATIC")) {
467 $config{HAS_STRLCPY} = "true";
470 $config{HAS_EPOLL} = $has_epoll;
471 $config{HAS_KQUEUE} = $has_kqueue;
473 printf "Checking for libgnutls... ";
474 if (($config{HAS_GNUTLS}) && (($config{HAS_GNUTLS} >= 1.2) || ($config{HAS_GNUTLS} eq "y"))) {
476 $config{HAS_GNUTLS} = "y";
479 $config{HAS_GNUTLS} = "n";
482 printf "Checking for openssl... ";
483 if (($config{HAS_OPENSSL}) && (($config{HAS_OPENSSL} >= 0.8) || ($config{HAS_OPENSSL} eq "y"))) {
485 $config{HAS_OPENSSL} = "y";
488 $config{HAS_OPENSSL} = "n";
491 ################################################################################
492 # BEGIN INTERACTIVE PART #
493 ################################################################################
501 my $rev = getrevision();
502 # Display Introduction Message..
504 Welcome to the \033[1mInspIRCd\033[0m Configuration program! (\033[1minteractive mode\033[0m)
505 \033[1mPackage maintainers: Type ./configure --help for non-interactive help\033[0m
507 *** If you are unsure of any of these values, leave it blank for ***
508 *** standard settings that will work, and your server will run ***
509 *** using them. Please consult your IRC network admin if in doubt. ***
511 Press \033[1m<RETURN>\033[0m to accept the default for any option, or enter
512 a new value. Please note: You will \033[1mHAVE\033[0m to read the docs
513 dir, otherwise you won't have a config file!
515 Your operating system is: \033[1;32m$config{OSNAME}\033[0m ($wholeos)
516 Maximum file descriptors: \033[1;32m$config{MAX_CLIENT_T}\033[0m
517 Your InspIRCd revision ID is \033[1;32mr$rev\033[0m";
519 print " (Non-SVN build)";
523 $config{CHANGE_COMPILER} = "n";
524 print "I have detected the following compiler: \033[1;32m$config{CC}\033[0m (version \033[1;32m$config{GCCVER}.x\033[0m)\n";
526 while (($config{GCCVER} < 3) || ($config{GCCVER} eq "")) {
527 print "\033[1;32mIMPORTANT!\033[0m A GCC 2.x compiler has been detected, and
528 should NOT be used. You should probably specify a newer compiler.\n\n";
529 yesno(CHANGE_COMPILER,"Do you want to change the compiler?");
530 if ($config{CHANGE_COMPILER} =~ /y/i) {
531 print "What command do you want to use to invoke your compiler?\n";
532 print "[\033[1;32m$config{CC}\033[0m] -> ";
533 chomp($config{CC} = <STDIN>);
534 if ($config{CC} eq "") {
537 chomp($foo = `$config{CC} -dumpversion | cut -c 1`);
539 chomp($config{GCCVER} = `$config{CC} -dumpversion | cut -c 1`); # we must redo these if we change compilers
540 print "Queried compiler: \033[1;32m$config{CC}\033[0m (version \033[1;32m$config{GCCVER}.x\033[0m)\n";
541 if ($config{GCCVER} < 3) {
542 print "\033[1;32mGCC 2.x WILL NOT WORK!\033[0m. Let's try that again, shall we?\n";
546 print "\033[1;32mWARNING!\033[0m Could not execute the compiler you specified. You may want to try again.\n";
553 # Directory Settings..
554 my $tmpbase = $config{BASE_DIR};
555 dir_check("do you wish to install the InspIRCd base", "BASE_DIR");
556 if ($tmpbase ne $config{BASE_DIR}) {
557 $config{CONFIG_DIR} = resolve_directory($config{BASE_DIR}."/conf"); # Configuration Dir
558 $config{MODULE_DIR} = resolve_directory($config{BASE_DIR}."/modules"); # Modules Directory
559 $config{BINARY_DIR} = resolve_directory($config{BASE_DIR}."/bin"); # Binary Directory
560 $config{LIBRARY_DIR} = resolve_directory($config{BASE_DIR}."/lib"); # Library Directory
563 dir_check("are the configuration files", "CONFIG_DIR");
564 dir_check("are the modules to be compiled to", "MODULE_DIR");
565 dir_check("is the IRCd binary to be placed", "BINARY_DIR");
566 dir_check("are the IRCd libraries to be placed", "LIBRARY_DIR");
569 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?");
573 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?");
576 $chose_hiperf = (($config{USE_EPOLL} eq "y") || ($config{USE_KQUEUE} eq "y"));
577 if (!$chose_hiperf) {
578 print "No high-performance socket engines are available, or you chose\n";
579 print "not to enable one. Defaulting to select() engine.\n\n";
582 yesno(IPV6,"Would you like to build InspIRCd with IPv6 support?");
585 if ($config{IPV6} eq "y") {
586 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";
587 $config{SUPPORT_IP6LINKS} = "y";
589 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.");
593 if (($config{HAS_GNUTLS} eq "y") && ($config{HAS_OPENSSL} eq "y")) {
594 print "I have detected both GnuTLS and OpenSSL on your system.\n";
595 print "I will default to GnuTLS. If you wish to use OpenSSL\n";
596 print "instead, you should enable the OpenSSL module yourself\n";
597 print "by copying it from src/modules/extra to src/modules.\n\n";
600 if ($config{HAS_GNUTLS} eq "y") {
601 yesno(USE_GNUTLS, "Would you like to enable SSL Support?");
602 if ($config{USE_GNUTLS} eq "y") {
603 print "\nUsing GnuTLS SSL module.\n";
605 } elsif ($config{HAS_OPENSSL} eq "y") {
606 yesno(USE_OPENSSL, "Would you like to enable SSL Support?");
607 if ($config{USE_OPENSSL} eq "y") {
608 print "\nUsing OpenSSL SSL module.\nYou will get better performance if you move to GnuTLS in the future.\n";
612 print "\nThe following questions will ask you for various figures relating\n";
613 print "To your IRCd install. Please note that these should usually be left\n";
614 print "as defaults unless you have a real reason to change them. If they\n";
615 print "changed, then the values must be identical on all servers on your\n";
616 print "network, or malfunctions and/or crashes may occur, with the exception\n";
617 print "of the 'maximum number of clients' setting which may be different on\n";
618 print "different servers on the network.\n\n";
620 # File Descriptor Settings..
621 promptnumeric("number of clients at any one time", "MAX_CLIENT_T");
622 $config{MAX_CLIENT} = $config{MAX_CLIENT_T};
623 $config{MAX_DESCRIPTORS} = $config{MAX_CLIENT_T};
625 promptnumeric("length of nicknames", "NICK_LENGT");
626 promptnumeric("length of channel names", "CHAN_LENGT");
627 promptnumeric("number of channels a normal user may join at any one time", "MAX_CHANNE");
628 promptnumeric("number of channels an oper may join at any one time", "MAX_OPERCH");
629 promptnumeric("number of mode changes in one line", "MAXI_MODES");
630 promptnumeric("length of an ident (username)", "MAX_IDENT");
631 promptnumeric("length of a quit message", "MAX_QUIT");
632 promptnumeric("length of a channel topic", "MAX_TOPIC");
633 promptnumeric("length of a kick message", "MAX_KICK");
634 promptnumeric("length of a GECOS (real name)", "MAX_GECOS");
635 promptnumeric("length of an away message", "MAX_AWAY");
640 if (($config{USE_GNUTLS} eq "y") && ($config{HAS_GNUTLS} ne "y"))
642 print "Sorry, but i couldn't detect gnutls. Make sure gnutls-config is in your path.\n";
645 if (($config{USE_OPENSSL} eq "y") && ($config{HAS_OPENSSL} ne "y"))
647 print "Sorry, but i couldn't detect openssl. Make sure openssl is in your path.\n";
651 if ($config{USE_GNUTLS} eq "y") {
653 open(TMP, "<src/modules/m_ssl_gnutls.cpp") or $failed = 1;
656 print "Symlinking src/modules/m_ssl_gnutls.cpp from extra/\n";
657 chdir("src/modules");
658 system("ln -s extra/m_ssl_gnutls.cpp");
659 system("ln -s extra/ssl_cert.h");
666 open(TMP, "<$config{CONFIG_DIR}/key.pem") or $failed = 1;
668 open(TMP, "<$config{CONFIG_DIR}/cert.pem") or $failed = 1;
671 print "SSL Certificates Not found, Generating.. \n\n
672 *************************************************************
673 * Generating the Private Key may take some time, go grab a *
674 * Coffee. Even better, to generate some more entropy if it *
675 * is taking a while, open another console and type du / a *
676 * few times and get that HD going :) Then answer the *
677 * Questions which follow. If you are unsure, just hit enter *
678 *************************************************************\n\n";
679 system("certtool --generate-privkey --outfile key.pem");
680 system("certtool --generate-self-signed --load-privkey key.pem --outfile cert.pem");
681 print "\nCertificate generation complete, copying to config directory... ";
682 system("mv key.pem $config{CONFIG_DIR}/key.pem");
683 system("mv cert.pem $config{CONFIG_DIR}/cert.pem");
686 print "SSL Certificates found, skipping.\n\n"
691 print "Skipping SSL certificate generation\nin non-interactive mode.\n\n";
693 } elsif ($config{USE_OPENSSL} eq "y") {
695 open(TMP, "<src/modules/m_ssl_openssl.cpp") or $failed = 1;
698 print "Symlinking src/modules/m_ssl_openssl.cpp from extra/\n";
699 chdir("src/modules");
700 system("ln -s extra/m_ssl_openssl.cpp");
701 system("ln -s extra/ssl_cert.h");
708 open(TMP, "<$config{CONFIG_DIR}/key.pem") or $failed = 1;
710 open(TMP, "<$config{CONFIG_DIR}/cert.pem") or $failed = 1;
713 print "SSL Certificates Not found, Generating.. \n\n
714 *************************************************************
715 * Generating the certificates may take some time, go grab a *
716 * coffee, or something. *
717 *************************************************************\n\n";
718 system("openssl req -x509 -nodes -newkey rsa:1024 -keyout key.pem -out cert.pem");
719 system("openssl dhparam -out dhparams.pem 1024");
720 print "\nCertificate generation complete, copying to config directory... ";
721 system("mv key.pem $config{CONFIG_DIR}/key.pem");
722 system("mv cert.pem $config{CONFIG_DIR}/cert.pem");
723 system("mv dhparams.pem $config{CONFIG_DIR}/dhparams.pem");
726 print "SSL Certificates found, skipping.\n\n"
731 print "Skipping SSL certificate generation\nin non-interactive mode.\n\n";
734 if (($config{USE_GNUTLS} eq "n") && ($config{USE_OPENSSL} eq "n")) {
735 print "Skipping SSL Certificate generation, SSL support is not available.\n\n";
743 print "To build your server with these settings, please type '\033[1;32m$config{MAKEPROG}\033[0m' now.\n";
744 if (($config{USE_GNUTLS} eq "y") || ($config{USE_OPENSSL} eq "y")) {
745 print "Please remember that to enable \033[1;32mSSL support\033[0m you must\n";
746 print "load the required modules in your config. This configure process\n";
747 print "has just prepared these modules to be compiled for you, and has not\n";
748 print "configured them to be compiled into the core of the ircd.\n";
750 print "*** \033[1;32mRemember to edit your configuration files!!!\033[0m ***\n\n\n";
751 if (($config{OSNAME} eq "OpenBSD") && ($config{CC} ne "eg++")) {
752 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";
755 if ($config{GCCVER} < "3") {
757 \033[1;32mWARNING!\033[0m You are attempting to compile InspIRCd on GCC 2.x!
758 GCC 2.x series compilers only had partial (read as broken) C++ support, and
759 your compile will most likely fail horribly! If you have any problems, do NOT
760 report them to the bugtracker or forums without first upgrading your compiler
761 to a newer 3.x or 4.x (or whatever is available currently) version.
765 ################################################################################
767 ################################################################################
769 # Retrieves the .config.cache file, and loads values into the main config hash.
770 open(CACHE, ".config.cache") or return undef;
773 # Ignore Blank lines, and comments..
776 my ($key, $value) = split("=", $_, 2);
777 $value =~ /^\"(.*)\"$/;
778 # Do something with data here!
786 # Dump the contents of %config
787 print "Writing \033[1;32mcache file\033[0m for future ./configures ...\n";
788 open(FILEHANDLE, ">.config.cache");
789 foreach $key (keys %config) {
790 print FILEHANDLE "$key=\"$config{$key}\"\n";
796 my ($desc, $hash_key) = @_;
799 print "In what directory $desc?\n";
800 print "[\033[1;32m$config{$hash_key}\033[0m] -> ";
801 chomp($var = <STDIN>);
803 $var = $config{$hash_key};
805 if ($var =~ /^\~\/(.+)$/) {
806 # Convert it to a full path..
807 $var = resolve_directory($ENV{HOME} . "/" . $1);
809 elsif ((($config{OSNAME} =~ /MINGW32/i) and ($var !~ /^[A-Z]{1}:\\.*/)) and (substr($var,0,1) ne "/"))
811 # Assume relative Path was given.. fill in the rest.
812 $var = $this . "/$var";
815 $var = resolve_directory($var);
817 print "$var does not exist. Create it?\n[\033[1;32my\033[0m] ";
818 chomp($tmp = <STDIN>);
819 if (($tmp eq "") || ($tmp =~ /^y/i)) {
820 # Attempt to Create the Dir..
822 system("mkdir -p \"$var\" >> /dev/null 2>&1");
823 $chk = system("mkdir -p \"$var\" >> /dev/null 2>&1") / 256;
825 print "Unable to create directory. ($var)\n\n";
830 # They said they don't want to create, and we can't install there.
836 # Target exists, but is not a directory.
837 print "File $var exists, but is not a directory.\n\n";
841 # Either Dir Exists, or was created fine.
842 $config{$hash_key} = $var;
850 $config{LDLIBS} = "-lstdc++";
851 $config{FLAGS} = "-fno-strict-aliasing -fPIC -Wall -Woverloaded-virtual $config{OPTIMISATI}";
852 $config{DEVELOPER} = "-fno-strict-aliasing -fPIC -Wall -Woverloaded-virtual -g";
853 $SHARED = "-Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared";
854 $config{MAKEPROG} = "make";
856 if ($config{OSNAME} =~ /darwin/i) {
857 $config{FLAGS} = "-DDARWIN -frtti -fPIC -Wall -Woverloaded-virtual $config{OPTIMISATI}";
858 $SHARED = "-bundle -twolevel_namespace -undefined dynamic_lookup";
859 $config{LDLIBS} = "-ldl -lstdc++";
862 if ($config{OSNAME} =~ /OpenBSD/i) {
863 $config{MAKEPROG} = "gmake";
864 chomp($foo = `eg++ -dumpversion | cut -c 1`);
865 # theyre running the package version of gcc (eg++)... detect it and set up its version numbers.
866 # if theyre not running this, configure lets the build continue but they probably wont manage to
867 # compile as this standard version is 2.95.3!
869 $config{CC} = "eg++";
870 chomp($config{GCCVER} = `eg++ -dumpversion | cut -c 1`); # we must redo these if we change the compiler path
875 if ($config{OSNAME} =~ /Linux/i) {
876 $config{LDLIBS} = "-ldl -lstdc++";
877 $config{FLAGS} = "-fno-strict-aliasing -fPIC -Wall -Woverloaded-virtual $config{OPTIMISATI}";
878 $config{FLAGS} .= " " . $ENV{CXXFLAGS} if exists($ENV{CXXFLAGS});
879 $config{MAKEPROG} = "make";
880 if ($config{OSNAME} =~ /CYGWIN/) {
881 $config{FLAGS} = "-fno-strict-aliasing -Wall -Woverloaded-virtual $config{OPTIMISATI}";
882 $config{LDLIBS} = "";
883 $config{MAKEPROG} = "/usr/bin/make";
884 $config{MAKEORDER} = "ircd mods";
886 } elsif ($config{OSNAME} eq "CYG-STATIC") {
887 $config{FLAGS} = "-fno-strict-aliasing -Wall -Woverloaded-virtual $config{OPTIMISATI}";
888 $config{LDLIBS} = "";
889 $config{MAKEPROG} = "/usr/bin/make";
890 $config{MAKEORDER} = "mods ircd";
891 $config{STATICLIBS} = "modules/mods.a";
892 $config{STATIC_LINK} = "yes";
893 return "Cygwin-Static";
895 $config{FLAGS} .= " " . $ENV{CXXFLAGS} if exists($ENV{CXXFLAGS});
898 if ($config{OSNAME} =~ /SunOS/i)
900 # solaris/sunos needs these
901 # socket = bsd sockets api
903 # rt = POSIX realtime extensions
904 # resolv = inet_aton only (why isnt this in nsl?!)
905 $config{MAKEPROG} = "gmake";
906 $config{LDLIBS} = $config{LDLIBS} . " -lsocket -lnsl -lrt -lresolv";
910 if($config{OSNAME} =~ /MINGW32/i)
912 # All code is position-independent on windows
913 $config{FLAGS} =~ s/-fPIC //;
917 return $config{OSNAME};
921 my($writeheader) = @_;
922 # First File.. inspircd_config.h
923 chomp(my $incos = `uname -n -s -r`);
924 chomp($version = `sh src/version.sh`);
925 chomp(my $revision2 = getrevision());
926 if ($writeheader == 1)
928 print "Writing \033[1;32minspircd_config.h\033[0m\n";
929 open(FILEHANDLE, ">include/inspircd_config.h");
930 my $NL = $config{NICK_LENGT}+1;
931 my $CL = $config{CHAN_LENGT}+1;
932 print FILEHANDLE <<EOF;
933 /* Auto generated by configure, do not modify! */
934 #ifndef __CONFIGURATION_AUTO__
935 #define __CONFIGURATION_AUTO__
937 #define CONFIG_FILE "$config{CONFIG_DIR}/inspircd.conf"
938 #define MOD_PATH "$config{MODULE_DIR}"
939 #define VERSION "$version"
940 #define REVISION "$revision2"
941 #define MAXCLIENTS $config{MAX_CLIENT}
942 #define MAXCLIENTS_S "$config{MAX_CLIENT}"
943 #define SOMAXCONN_S "$config{_SOMAXCONN}"
944 #define MAX_DESCRIPTORS $config{MAX_DESCRIPTORS}
947 #define MAXCHANS $config{MAX_CHANNE}
948 #define OPERMAXCHANS $config{MAX_OPERCH}
949 #define MAXMODES $config{MAXI_MODES}
950 #define IDENTMAX $config{MAX_IDENT}
951 #define MAXQUIT $config{MAX_QUIT}
952 #define MAXTOPIC $config{MAX_TOPIC}
953 #define MAXKICK $config{MAX_KICK}
954 #define MAXGECOS $config{MAX_GECOS}
955 #define MAXAWAY $config{MAX_AWAY}
956 #define OPTIMISATION $config{OPTIMITEMP}
957 #define LIBRARYDIR "$config{LIBRARY_DIR}"
958 #define SYSTEM "$incos"
961 if ($config{OSNAME} =~ /SunOS/i) {
962 print FILEHANDLE "#define IS_SOLARIS\n";
964 if ($config{OSNAME} =~ /CYGWIN/i) {
965 print FILEHANDLE "#define IS_CYGWIN\n";
966 print FILEHANDLE "#ifndef FD_SETSIZE\n#define FD_SETSIZE 1024\n#endif\n";
968 if ($config{OSNAME} =~ /MINGW32/i) {
969 print FILEHANDLE "#define IS_MINGW\n";
971 if ($config{OSNAME} =~ /CYG-STATIC/i) {
972 print FILEHANDLE "#ifndef FD_SETSIZE\n#define FD_SETSIZE 1024\n#endif\n";
974 if ($config{STATIC_LINK} eq "yes") {
975 print FILEHANDLE "#define STATIC_LINK\n";
977 if ($config{GCCVER} >= 3) {
978 print FILEHANDLE "#define GCC3\n";
980 if ($config{HAS_STRLCPY} eq "true") {
981 print FILEHANDLE "#define HAS_STRLCPY\n";
983 if ($config{HAS_STDINT} eq "true") {
984 print FILEHANDLE "#define HAS_STDINT\n";
986 if ($config{IPV6} =~ /y/i) {
987 print FILEHANDLE "#define IPV6\n";
989 if ($config{SUPPORT_IP6LINKS} =~ /y/i) {
990 print FILEHANDLE "#define SUPPORT_IP6LINKS\n";
993 if (($has_kqueue) && ($config{USE_KQUEUE} eq "y")) {
994 print FILEHANDLE "#define USE_KQUEUE\n";
995 $se = "socketengine_kqueue";
998 if (($has_epoll) && ($config{USE_EPOLL} eq "y")) {
999 print FILEHANDLE "#define USE_EPOLL\n";
1000 $se = "socketengine_epoll";
1003 # user didn't choose either epoll or select for their OS.
1004 # default them to USE_SELECT (ewwy puke puke)
1006 print FILEHANDLE "#define USE_SELECT\n";
1007 $se = "socketengine_select";
1009 print FILEHANDLE "\n#endif\n";
1015 open(FILEHANDLE, ">include/inspircd_se_config.h");
1016 print FILEHANDLE <<EOF;
1017 /* Auto generated by configure, do not modify or commit to svn! */
1018 #ifndef __CONFIGURATION_SOCKETENGINE__
1019 #define __CONFIGURATION_SOCKETENGINE__
1029 # Create a Modules List..
1031 foreach $i (@modlist)
1033 if ($config{STATIC_LINK} eq "yes") {
1034 $modules .= "m_".$i.".o ";
1037 $modules .= "m_".$i.".so ";
1040 chomp($modules); # Remove Redundant whitespace..
1042 opendir(DIRHANDLE, "src/modules");
1043 foreach $name (sort readdir(DIRHANDLE)) {
1044 if ($name =~ /^m_(.+?)$/) {
1045 if (opendir(MDIRHANDLE, "src/modules/$name") != 0) {
1046 closedir(MDIRHANDLE);
1047 $modules .= "$name.so ";
1051 closedir(DIRHANDLE);
1054 # Write all .in files.
1057 my $exe = "inspircd";
1059 if ($config{OSNAME} =~ /CYGWIN/i) {
1060 $exe = "inspircd.exe";
1063 opendir(DIRHANDLE, $this);
1065 # Do this once here, and cache it in the .*.inc files,
1066 # rather than attempting to read src/version.sh from
1067 # compiled code -- we might not have the source to hand.
1068 # Fix for bug#177 by Brain.
1070 chomp(my $version = `sh ./src/version.sh`);
1071 chomp(my $revision = getrevision());
1072 $version = "$version(r$revision)";
1075 if ($config{IS_DARWIN} eq "YES")
1079 # We can actually parse any file starting with . and ending with .inc,
1080 # but right now we only parse .inspircd.inc to form './inspircd'
1082 foreach $name (sort readdir(DIRHANDLE)) {
1083 if ($name =~ /^\.(.+)\.inc$/) {
1085 # All .name.inc files need parsing!
1087 open(FILEHANDLE, ".$file.inc");
1088 while (<FILEHANDLE>) {
1093 $tmp =~ s/\@CC\@/$config{CC}/;
1094 $tmp =~ s/\@MAKEPROG\@/$config{MAKEPROG}/;
1095 $tmp =~ s/\@FLAGS\@/$config{FLAGS}/;
1096 $tmp =~ s/\@DEVELOPER\@/$config{DEVELOPER}/;
1097 $tmp =~ s/\@LDLIBS\@/$config{LDLIBS}/;
1098 $tmp =~ s/\@BASE_DIR\@/$config{BASE_DIR}/;
1099 $tmp =~ s/\@CONFIG_DIR\@/$config{CONFIG_DIR}/;
1100 $tmp =~ s/\@MODULE_DIR\@/$config{MODULE_DIR}/;
1101 $tmp =~ s/\@BINARY_DIR\@/$config{BINARY_DIR}/;
1102 $tmp =~ s/\@LIBRARY_DIR\@/$config{LIBRARY_DIR}/;
1103 $tmp =~ s/\@LIBRARY_EXT\@/$LIBEXT/;
1104 $tmp =~ s/\@MODULES\@/$modules/;
1105 $tmp =~ s/\@EXECUTABLE\@/$exe/;
1106 $tmp =~ s/\@MAKEORDER\@/$config{MAKEORDER}/;
1107 $tmp =~ s/\@STATICLIBS\@/$config{STATICLIBS}/;
1108 $tmp =~ s/\@VERSION\@/$version/;
1110 print "Writing \033[1;32m$file\033[0m\n";
1111 open(FILEHANDLE, ">$file");
1112 print FILEHANDLE $tmp;
1115 closedir(DIRHANDLE);
1117 # Make inspircd executable!
1118 chmod 0744, 'inspircd';
1120 if ($config{STATIC_LINK} eq "yes") {
1121 print "Writing static-build \033[1;32msrc/Makefile\033[0m\n";
1122 write_static_makefile();
1123 write_static_modules_makefile();
1124 } elsif ($config{OSNAME} =~ /CYGWIN/i) {
1125 print "Writing cygwin-build \033[1;32msrc/Makefile\033[0m\n";
1126 write_static_makefile();
1127 write_dynamic_modules_makefile();
1129 print "Writing dynamic-build \033[1;32msrc/Makefile\033[0m\n";
1130 write_dynamic_makefile();
1131 write_dynamic_modules_makefile();
1135 sub write_static_modules_makefile {
1136 # Modules Makefile..
1137 print "Writing \033[1;32msrc/modules/Makefile\033[0m\n";
1138 open(FILEHANDLE, ">src/modules/Makefile");
1141 # Module Makefile Header
1143 print FILEHANDLE <<EOF;
1144 # (C) ChatSpike development team
1145 # Makefile by <Craig\@ChatSpike.net>
1146 # Many Thanks to Andrew Church <achurch\@achurch.org>
1147 # for assisting with making this work right.
1149 # Automatically Generated by ./configure to add a modules
1150 # please run ./configure --update
1156 # End Module Makefile Header
1159 # Create a Modules List..
1164 open(MODLIST,">include/modlist.h");
1167 # Include File Header
1169 print MODLIST <<HEADER;
1170 // Generated automatically by configure. DO NOT EDIT!
1172 #ifndef __SYMBOLS__H_CONFIGURED__
1173 #define __SYMBOLS__H_CONFIGURED__
1177 # End Include File Header
1180 # Place Module List into Include
1181 foreach $i (@modlist) {
1182 if ($i !~ /_static$/) {
1183 print MODLIST "extern \"C\" void * $i\_init (void);\n";
1186 print MODLIST "\nstruct {const char *name; initfunc *value; } modsyms[] = {\n";
1191 foreach $i (@modlist)
1193 if ($i !~ /_static$/) {
1194 $cmflags = getcompilerflags("src/modules/m_".$i.".cpp");
1195 $liflags = getlinkerflags("src/modules/m_".$i.".cpp");
1196 $deps = getdependencies("src/modules/m_".$i.".cpp");
1198 #print "file: $i: cmflags=$cmflags; liflags=$liflags; deps=$deps\n";
1201 # Write Entry to the Makefile
1203 print FILEHANDLE <<EOCHEESE;
1204 m_$i.o: .m_$i\_static.cpp ../../include/modules.h ../../include/users.h ../../include/channels.h ../../include/base.h $deps
1205 \$(CC) -pipe -I../../include \$(FLAGS) $flags -export-dynamic -c .m_$i\_static.cpp
1206 mv .m_$i\_static.o ../m_$i.o
1210 # End Write Entry to the MakeFile
1212 print "Configuring module [\033[1;32mm_$i.so\033[0m] for static linking... ";
1213 open(MODULE,"<src/modules/m_".$i.".cpp") or die("Could not open m_".$i.".cpp");
1214 open(MUNGED,">src/modules/.m_".$i."_static.cpp") or die("Could not create .m_".$i."_static.cpp");
1215 while (chomp($a = <MODULE>)) {
1216 $a =~ s/init_module/$i\_init/g;
1217 print MUNGED "$a\n";
1221 print MODLIST <<EOENT;
1222 {"m_$i.so",\&$i\_init},
1228 print MODLIST "{0}};\n\n#endif\n";
1232 sub write_dynamic_modules_makefile {
1233 # Modules Makefile..
1234 print "Writing \033[1;32msrc/modules/Makefile\033[0m\n";
1235 open(FILEHANDLE, ">src/modules/Makefile");
1238 if ($config{OSNAME} =~ /CYGWIN/i) {
1239 $extra = "../inspircd.dll.a";
1243 # Module Makefile Header
1245 print FILEHANDLE <<EOF;
1246 # (C) ChatSpike development team
1247 # Makefile by <Craig\@ChatSpike.net>
1248 # Many Thanks to Andrew Church <achurch\@achurch.org>
1249 # for assisting with making this work right.
1251 # Automatically Generated by ./configure to add a modules
1252 # please run ./configure -update or ./configure -modupdate
1258 # End Module Makefile Header
1261 # Create a Modules List..
1267 foreach $i (@modlist) {
1269 # Write Entry to the MakeFile
1271 $cmflags = getcompilerflags("src/modules/m_".$i.".cpp");
1272 $liflags = getlinkerflags("src/modules/m_".$i.".cpp");
1273 $deps = getdependencies("src/modules/m_".$i.".cpp");
1275 #print "file: $i: cmflags=$cmflags; liflags=$liflags; deps=$deps\n";
1277 print FILEHANDLE <<EOCHEESE;
1278 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
1279 \$(CC) -pipe -I../../include \$(FLAGS) $cmflags -export-dynamic -c m_$i.cpp
1282 if ($config{OSNAME} =~ /darwin/) {
1283 print FILEHANDLE <<EOCHEESE;
1284 \$(CC) -pipe -twolevel_namespace -undefined dynamic_lookup \$(FLAGS) -bundle $liflags -o m_$i.so m_$i.o $extra
1288 print FILEHANDLE <<EOCHEESE;
1289 \$(CC) -pipe \$(FLAGS) -shared $liflags -o m_$i.so m_$i.o $extra
1293 $crud = $crud . " install -m \$(INSTMODE) m_$i.so \$(MODPATH)\n";
1295 # End Write Entry to the MakeFile
1299 opendir(DIRHANDLE, "src/modules");
1300 foreach $name (sort readdir(DIRHANDLE)) {
1301 if ($name =~ /^m_(.+?)$/) {
1304 # A module made of multiple files, in a dir, e.g. src/modules/m_spanningtree/
1305 if (opendir(MDIRHANDLE, "src/modules/$name") != 0) {
1306 print "Composing Makefile rules for directory \033[1;32m$name\033[0m... ";
1308 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";
1309 foreach $fname (sort readdir(MDIRHANDLE)) {
1310 if ($fname =~ /\.cpp$/) {
1311 $cmflags = getcompilerflags("src/modules/$name/$fname");
1312 $liflags = getlinkerflags("src/modules/$name/$fname");
1313 $deps = getdependencies("src/modules/$name/$fname");
1315 $oname =~ s/\.cpp$/.o/g;
1316 print FILEHANDLE " $name/$oname";
1317 $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";
1318 $crapola = $crapola . " \$(CC) -pipe -I../../include -I. \$(FLAGS) $cmflags -export-dynamic -o $name/$oname -c $name/$fname\n\n";
1319 $crap3 = $crap3 . " $name/$oname";
1323 print "(\033[1;32m$i files found\033[0m)\n";
1324 if ($config{IS_DARWIN} eq "YES") {
1325 print FILEHANDLE "\n \$(CC) -pipe -twolevel_namespace -undefined dynamic_lookup \$(FLAGS) -bundle -o $name.so $crap3\n";
1327 print FILEHANDLE "\n \$(CC) -pipe \$(FLAGS) -shared $liflags -o $name.so $crap3\n";
1329 print FILEHANDLE "\n$crapola\n";
1330 closedir(MDIRHANDLE);
1331 $crud = $crud . " install -m \$(INSTMODE) $name.so \$(MODPATH)\n";
1335 closedir(DIRHANDLE);
1337 print FILEHANDLE "modinst:\n \@echo \"Installing modules...\"\n" . $crud;
1341 sub write_static_makefile {
1342 open(FH,">src/Makefile") or die("Could not write src/Makefile!");
1345 opendir(DIRHANDLE, "src");
1346 foreach $name (sort readdir(DIRHANDLE)) {
1347 if ($name =~ /^cmd_(.+)\.cpp$/) {
1348 $cmdlist[$i++] = $1;
1351 closedir(DIRHANDLE);
1354 foreach my $cmd (@cmdlist) {
1355 $cmdobjs = $cmdobjs . "cmd_$cmd.o ";
1356 $srcobjs = $srcobjs . "cmd_$cmd.cpp ";
1361 # (C) ChatSpike development team
1362 # Makefile by <Craig\@ChatSpike.net>
1363 # Makefile version 2 (statically linked core) by <brain\@inspircd.org>
1366 CC = im a cheezeball
1368 CXXFLAGS = -I../include \${FLAGS}
1369 CPPFILES = \$(shell /bin/ls -l modes/ | grep '\\.cpp' | sed 's/^.* //' | grep -v svn)
1370 RELCPPFILES = \$(shell /bin/ls -l modes/ | grep '\\.cpp' | sed 's/^.* /modes\\//' | grep -v svn)
1374 $se = "socketengine_select";
1375 if (($has_kqueue) && ($config{USE_KQUEUE} eq "y")) {
1376 $se = "socketengine_kqueue";
1378 elsif (($has_epoll) && ($config{USE_EPOLL} eq "y")) {
1379 $se = "socketengine_epoll";
1383 # This next section is for cygwin dynamic module builds.
1384 # Basically, what we do, is build the inspircd core as a library
1385 # then the main executable uses that. the library is capable of
1386 # loading / unloading the modules dynamically :)
1387 # Massive thanks to the guys on #cygwin @ irc.freenode.net for helping
1391 if ($config{OSNAME} =~ /CYGWIN/i) {
1393 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
1395 inspircd.exe: inspircd.dll.a
1398 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
1399 \$(CC) -shared -Wl,--out-implib=inspircd.dll.a -o inspircd.dll \$^
1403 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
1405 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
1406 \$(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)
1412 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
1413 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c cull_list.cpp
1415 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
1416 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c snomasks.cpp
1418 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
1419 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c command_parse.cpp
1421 userprocess.o: userprocess.cpp ../include/base.h ../include/hashcomp.h ../include/globals.h ../include/inspircd_config.h
1422 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c userprocess.cpp
1424 socketengine.o: $se.cpp socketengine.cpp ../include/base.h ../include/hashcomp.h ../include/globals.h ../include/inspircd_config.h ../include/$se.h
1425 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c socketengine.cpp $se.cpp
1427 hashcomp.o: hashcomp.cpp ../include/base.h ../include/hashcomp.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1428 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c hashcomp.cpp
1430 helperfuncs.o: helperfuncs.cpp ../include/base.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1431 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c helperfuncs.cpp
1433 channels.o: channels.cpp ../include/base.h ../include/channels.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1434 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c channels.cpp
1436 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
1437 \${MAKE} -C "modes" DIRNAME="src/modes" CC="\$(CC)" \$(MAKEARGS)
1438 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c mode.cpp
1440 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
1441 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c xline.cpp
1443 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
1444 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c inspstring.cpp
1446 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
1447 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c dns.cpp
1449 base.o: base.cpp ../include/base.h ../include/globals.h ../include/inspircd_config.h
1450 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c base.cpp
1452 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
1453 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c configreader.cpp
1455 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
1456 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c commands.cpp $cmdobjs
1458 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
1459 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c dynamic.cpp
1461 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
1462 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c users.cpp
1464 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
1465 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c modules.cpp
1467 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
1468 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c wildcard.cpp
1470 socket.o: socket.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h
1471 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c socket.cpp
1473 inspsocket.o: inspsocket.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h ../include/timer.h
1474 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c inspsocket.cpp
1476 timer.o: timer.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h ../include/timer.h
1477 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c timer.cpp
1480 foreach my $cmd (@cmdlist) {
1482 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
1483 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c cmd_$cmd.cpp
1489 sub write_dynamic_makefile {
1493 opendir(DIRHANDLE, "src");
1494 foreach $name (sort readdir(DIRHANDLE)) {
1495 if ($name =~ /^cmd_(.+)\.cpp$/) {
1496 $cmdlist[$i++] = $1;
1499 closedir(DIRHANDLE);
1503 foreach my $cmd (@cmdlist) {
1504 $cmdobjs = $cmdobjs . "cmd_$cmd.so ";
1505 $srcobjs = $srcobjs . "cmd_$cmd.cpp ";
1508 $se = "socketengine_select";
1509 if (($has_kqueue) && ($config{USE_KQUEUE} eq "y")) {
1510 $se = "socketengine_kqueue";
1512 elsif (($has_epoll) && ($config{USE_EPOLL} eq "y")) {
1513 $se = "socketengine_epoll";
1516 open(FH,">src/Makefile") or die("Could not write src/Makefile");
1520 # (C) ChatSpike development team
1521 # Makefile by <Craig\@ChatSpike.net>
1522 # Makefile version 2 (dynamically linked core) by <brain\@inspircd.org>
1525 CC = im a cheezeball
1527 CXXFLAGS = -I../include \${FLAGS}
1528 CPPFILES = \$(shell /bin/ls -l modes/ | grep '\\.cpp' | sed 's/^.* //' | grep -v svn)
1529 RELCPPFILES = \$(shell /bin/ls -l modes/ | grep '\\.cpp' | sed 's/^.* /modes\\//' | grep -v svn)
1533 if ($config{IS_DARWIN} eq "YES") {
1535 all: 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 $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 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
1543 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c $se.cpp
1544 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDsocketengine.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDsocketengine.dylib socketengine.o $se.o
1546 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
1547 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c snomasks.cpp
1548 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDsnomasks.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDsnomasks.dylib snomasks.o
1550 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
1551 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c command_parse.cpp
1552 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDcommand_parse.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDcommand_parse.dylib command_parse.o
1554 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
1555 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c cull_list.cpp
1556 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDcull_list.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDcull_list.dylib cull_list.o
1558 libIRCDuserprocess.dylib: userprocess.cpp ../include/base.h ../include/hashcomp.h ../include/globals.h ../include/inspircd_config.h
1559 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c userprocess.cpp
1560 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDuserprocess.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDuserprocess.dylib userprocess.o
1562 libIRCDhash.dylib: hashcomp.cpp ../include/base.h ../include/hashcomp.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1563 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c hashcomp.cpp
1564 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDhash.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDhash.dylib hashcomp.o
1566 libIRCDhelper.dylib: helperfuncs.cpp ../include/base.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1567 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c helperfuncs.cpp
1568 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDhelper.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDhelper.dylib helperfuncs.o
1570 libIRCDchannels.dylib: channels.cpp ../include/base.h ../include/channels.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1571 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c channels.cpp
1572 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDchannels.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDchannels.dylib channels.o
1574 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)
1575 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c mode.cpp
1576 \${MAKE} -C "modes" DIRNAME="src/modes" CC="\$(CC)" \$(MAKEARGS) CPPFILES="\$(CPPFILES)"
1577 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDmode.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDmode.dylib mode.o modes/modeclasses.a
1579 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
1580 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c xline.cpp
1581 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDxline.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDxline.dylib xline.o
1583 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
1584 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c inspstring.cpp
1585 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDstring.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDstring.dylib inspstring.o
1587 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
1588 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c dns.cpp
1589 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDasyncdns.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDasyncdns.dylib dns.o
1591 libIRCDbase.dylib: base.cpp ../include/base.h ../include/globals.h ../include/inspircd_config.h
1592 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c base.cpp
1593 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDbase.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDbase.dylib base.o
1595 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
1596 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c configreader.cpp
1597 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDconfigreader.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDconfigreader.dylib configreader.o
1599 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
1600 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c commands.cpp
1601 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDcommands.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDcommands.dylib commands.o
1603 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
1604 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c dynamic.cpp
1605 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDdynamic.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDdynamic.dylib dynamic.o
1607 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
1608 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c users.cpp
1609 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDusers.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDusers.dylib users.o
1611 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
1612 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c modules.cpp
1613 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDmodules.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDmodules.dylib modules.o
1615 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
1616 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c wildcard.cpp
1617 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDwildcard.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDwildcard.dylib wildcard.o
1619 libIRCDsocket.dylib: socket.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h
1620 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c socket.cpp
1621 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDsocket.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDsocket.dylib socket.o
1623 libIRCDinspsocket.dylib: inspsocket.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h ../include/timer.h
1624 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c inspsocket.cpp
1625 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDinspsocket.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDinspsocket.dylib inspsocket.o
1627 libIRCDtimer.dylib: timer.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h ../include/timer.h
1628 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c timer.cpp
1629 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDtimer.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDtimer.dylib timer.o
1636 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
1638 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
1639 \$(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
1641 libIRCDsocketengine.so: $se.cpp socketengine.cpp ../include/base.h ../include/hashcomp.h ../include/globals.h ../include/inspircd_config.h ../include/$se.h
1642 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c socketengine.cpp $se.cpp
1643 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDsocketengine.so socketengine.o $se.o
1645 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
1646 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c snomasks.cpp
1647 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDsnomasks.so snomasks.o
1649 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
1650 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c command_parse.cpp
1651 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDcommand_parse.so command_parse.o
1653 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
1654 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c cull_list.cpp
1655 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDcull_list.so cull_list.o
1657 libIRCDuserprocess.so: userprocess.cpp ../include/base.h ../include/hashcomp.h ../include/globals.h ../include/inspircd_config.h
1658 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c userprocess.cpp
1659 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDuserprocess.so userprocess.o
1661 libIRCDhash.so: hashcomp.cpp ../include/base.h ../include/hashcomp.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1662 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c hashcomp.cpp
1663 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDhash.so hashcomp.o
1665 libIRCDhelper.so: helperfuncs.cpp ../include/base.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1666 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c helperfuncs.cpp
1667 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDhelper.so helperfuncs.o
1669 libIRCDchannels.so: channels.cpp ../include/base.h ../include/channels.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1670 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c channels.cpp
1671 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDchannels.so channels.o
1673 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)
1674 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c mode.cpp
1675 \${MAKE} -C "modes" DIRNAME="src/modes" CC="\$(CC)" \$(MAKEARGS) CPPFILES="\$(CPPFILES)"
1676 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDmode.so mode.o modes/modeclasses.a
1678 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
1679 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c xline.cpp
1680 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDxline.so xline.o
1682 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
1683 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c inspstring.cpp
1684 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDstring.so inspstring.o
1686 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
1687 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c dns.cpp
1688 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDasyncdns.so dns.o
1690 libIRCDbase.so: base.cpp ../include/base.h ../include/globals.h ../include/inspircd_config.h
1691 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c base.cpp
1692 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDbase.so base.o
1694 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
1695 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c configreader.cpp
1696 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDconfigreader.so configreader.o
1698 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
1699 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c commands.cpp
1700 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDcommands.so commands.o
1702 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
1703 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c dynamic.cpp
1704 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDdynamic.so dynamic.o
1706 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
1707 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c users.cpp
1708 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDusers.so users.o
1710 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
1711 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c modules.cpp
1712 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDmodules.so modules.o
1714 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
1715 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c wildcard.cpp
1716 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDwildcard.so wildcard.o
1718 libIRCDsocket.so: socket.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h
1719 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c socket.cpp
1720 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDsocket.so socket.o
1722 libIRCDinspsocket.so: inspsocket.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h ../include/timer.h
1723 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c inspsocket.cpp
1724 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDinspsocket.so inspsocket.o
1726 libIRCDtimer.so: timer.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h ../include/timer.h
1727 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c timer.cpp
1728 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDtimer.so timer.o
1732 foreach my $cmd (@cmdlist) {
1734 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
1735 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c cmd_$cmd.cpp
1736 \$(CC) -pipe $SHARED -o cmd_$cmd.so cmd_$cmd.o