3 # InspIRCd Configuration Script
5 # Copyright 2002-2007 The ChatSpike Development Team
6 # <brain@chatspike.net>
7 # <Craig@chatspike.net>
9 # Licensed under GPL, please see the COPYING file
10 # for more information
12 # [14:21] Brain: <matrix impression> i know perl-fu!
16 ########################################
23 # Utility functions for our buildsystem
27 use make::opensslcert;
30 'enable-gnutls' => \$opt_use_gnutls,
31 'rebuild' => \$opt_rebuild,
32 'enable-openssl' => \$opt_use_openssl,
33 'disable-interactive' => \$opt_nointeractive,
34 'with-nick-length=i' => \$opt_nick_length,
35 'with-channel-length=i' => \$opt_chan_length,
36 'with-max-clients=i' => \$opt_maxclients,
37 'enable-ports' => \$opt_ports,
38 'enable-epoll' => \$opt_epoll,
39 'enable-kqueue' => \$opt_kqueue,
40 'disable-ports' => \$opt_noports,
41 'disable-epoll' => \$opt_noepoll,
42 'disable-kqueue' => \$opt_nokqueue,
43 'enable-ipv6' => \$opt_ipv6,
44 'enable-remote-ipv6' => \$opt_ipv6links,
45 'disable-remote-ipv6' => \$opt_noipv6links,
46 'with-cc=s' => \$opt_cc,
47 'with-ident-length=i' => \$opt_ident,
48 'with-quit-length=i' => \$opt_quit,
49 'with-topic-length=i' => \$opt_topic,
50 'with-maxbuf=i' => \$opt_maxbuf,
51 'with-kick-length=i' => \$opt_kick,
52 'with-gecos-length=i' => \$opt_gecos,
53 'with-away-length=i' => \$opt_away,
54 'with-max-modes=i' => \$opt_modes,
55 'prefix=s' => \$opt_base_dir,
56 'config-dir=s' => \$opt_config_dir,
57 'module-dir=s' => \$opt_module_dir,
58 'binary-dir=s' => \$opt_binary_dir,
59 'library-dir=s' => \$opt_library_dir,
60 'disable-debuginfo' => sub { $opt_disable_debug = 1 },
61 'help' => sub { showhelp(); },
62 'modupdate' => sub { modupdate(); },
63 'update' => sub { update(); },
64 'svnupdate' => sub { svnupdate(); },
65 'clean' => sub { clean(); },
68 my $non_interactive = (
69 (defined $opt_library_dir) ||
70 (defined $opt_base_dir) ||
71 (defined $opt_config_dir) ||
72 (defined $opt_module_dir) ||
73 (defined $opt_base_dir) ||
74 (defined $opt_binary_dir) ||
75 (defined $opt_nointeractive) ||
76 (defined $opt_away) ||
77 (defined $opt_gecos) ||
78 (defined $opt_kick) ||
79 (defined $opt_maxclients) ||
80 (defined $opt_modes) ||
81 (defined $opt_topic) ||
82 (defined $opt_quit) ||
83 (defined $opt_ident) ||
85 (defined $opt_ipv6) ||
86 (defined $opt_ipv6links) ||
87 (defined $opt_noipv6links) ||
88 (defined $opt_kqueue) ||
89 (defined $opt_epoll) ||
90 (defined $opt_ports) ||
91 (defined $opt_maxchans) ||
92 (defined $opt_opermaxchans) ||
93 (defined $opt_chan_length) ||
94 (defined $opt_nick_length) ||
95 (defined $opt_use_openssl) ||
96 (defined $opt_nokqueue) ||
97 (defined $opt_noepoll) ||
98 (defined $opt_noports) ||
99 (defined $opt_maxbuf) ||
100 (defined $opt_use_gnutls)
102 my $interactive = !$non_interactive;
105 chomp($topdir = getcwd());
106 $this = resolve_directory($topdir); # PWD, Regardless.
107 @modlist = (); # Declare for Module List..
108 %config = (); # Initiate Configuration Hash..
109 $config{ME} = resolve_directory($topdir); # Present Working Directory
111 $config{BASE_DIR} = $config{ME};
113 if (defined $opt_base_dir)
115 $config{BASE_DIR} = $opt_base_dir;
118 $config{CONFIG_DIR} = resolve_directory($config{BASE_DIR}."/conf"); # Configuration Directory
119 $config{MODULE_DIR} = resolve_directory($config{BASE_DIR}."/modules"); # Modules Directory
120 $config{BINARY_DIR} = resolve_directory($config{BASE_DIR}."/bin"); # Binary Directory
121 $config{LIBRARY_DIR} = resolve_directory($config{BASE_DIR}."/lib"); # Library Directory
123 if (defined $opt_config_dir)
125 $config{CONFIG_DIR} = $opt_config_dir;
127 if (defined $opt_module_dir)
129 $config{MODULE_DIR} = $opt_module_dir;
131 if (defined $opt_binary_dir)
133 $config{BINARY_DIR} = $opt_binary_dir;
135 if (defined $opt_library_dir)
137 $config{LIBRARY_DIR} = $opt_library_dir;
139 chomp($config{HAS_GNUTLS} = `libgnutls-config --version 2>/dev/null | cut -c 1,2,3`); # GNUTLS Version.
140 chomp($config{HAS_OPENSSL} = `pkg-config --modversion openssl 2>/dev/null`); # Openssl version
141 chomp($gnutls_ver = $config{HAS_GNUTLS});
142 chomp($openssl_ver = $config{HAS_OPENSSL});
143 $config{USE_GNUTLS} = "n";
144 if (defined $opt_use_gnutls)
146 $config{USE_GNUTLS} = "y"; # Use gnutls.
148 $config{USE_OPENSSL} = "n"; # Use openssl.
149 if (defined $opt_use_openssl)
151 $config{USE_OPENSSL} = "y";
154 # no, let's not change these.
155 $config{OPTIMITEMP} = "0"; # Default Optimisation Value
156 if (!defined $opt_disable_debug)
158 $config{OPTIMISATI} = "-g1"; # Optimisation Flag
162 $config{OPTIMISATI} = "-O2"; # DEBUGGING OFF!
165 $config{NICK_LENGT} = "31"; # Default Nick Length
166 if (defined $opt_nick_length)
168 $config{NICK_LENGT} = $opt_nick_length;
170 $config{CHAN_LENGT} = "64"; # Default Channel Name Length
171 if (defined $opt_chan_length)
173 $config{CHAN_LENGT} = $opt_chan_length;
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{USE_PORTS} = "y"; # epoll enabled
201 if (defined $opt_ports)
203 $config{USE_PORTS} = "y";
205 if (defined $opt_noports)
207 $config{USE_PORTS} = "n";
209 $config{IPV6} = "n"; # IPv6 support (experimental)
210 if (defined $opt_ipv6)
214 $config{SUPPORT_IP6LINKS} = "y"; # IPv4 supporting IPv6 links (experimental)
215 if (defined $opt_ipv6links)
217 $config{SUPPORT_IP6LINKS} = "y";
219 if (defined $opt_noipv6links)
221 $config{SUPPORT_IP6LINKS} = "n";
223 $config{STATIC_LINK} = "no"; # are doing static modules?
224 chomp($config{MAX_CLIENT_T} = `sh -c \"ulimit -n\"`); # FD Limit
225 chomp($config{MAX_DESCRIPTORS} = `sh -c \"ulimit -n\"`); # Hard FD Limit
226 chomp($config{GCCVER} = `g++ -dumpversion | cut -c 1`); # Major GCC Version
227 $config{_SOMAXCONN} = SOMAXCONN; # Max connections in accept queue
228 $config{OSNAME} = $^O; # Operating System Name
229 $config{IS_DARWIN} = "NO"; # Is OSX?
230 if ($config{OSNAME} =~ /darwin/i)
232 $config{IS_DARWIN} = "YES";
234 $config{CC} = "g++"; # C++ compiler
237 $config{CC} = $opt_cc;
239 $exec = $config{CC} . " -dumpversion | cut -c 1";
240 chomp($config{GCCVER} = `$exec`); # Major GCC Version
241 $config{MAKEORDER} = "ircd mods"; # build order
242 $config{STATICLIBS} = ""; # library archive path
243 $config{MAX_IDENT} = "12"; # max ident size
244 $config{MAX_QUIT} = "255"; # max quit message size
245 $config{MAX_TOPIC} = "307"; # max topic size
246 $config{MAX_KICK} = "255"; # max kick message size
247 $config{MAX_GECOS} = "128"; # max GECOS size
248 $config{MAX_AWAY} = "200"; # max AWAY size
249 $config{MAXBUF} = "512"; # Max buffer size
250 if (defined $opt_ident)
252 $config{MAX_IDENT} = $opt_ident;
254 if (defined $opt_quit)
256 $config{MAX_QUIT} = $opt_quit;
258 if (defined $opt_topic)
260 $config{MAX_TOPIC} = $opt_topic;
262 if (defined $opt_kick)
264 $config{MAX_KICK} = $opt_kick;
266 if (defined $opt_gecos)
268 $config{MAX_GECOS} = $opt_gecos;
270 if (defined $opt_away)
272 $config{MAX_AWAY} = $opt_away;
275 $config{HAS_OPENSSL} =~ /^([-[:digit:].]+)([a-z])?(\-[a-z][0-9])?$/;
276 $config{HAS_OPENSSL} = $1;
278 if ($config{GCCVER} eq "") {
279 print $config{CC} . " was not found! You require g++ (the GNU C++ compiler, part of GCC) to build InspIRCd!\n";
283 # Minihack! Convert Cygwin to 'Cyg-Static' so i can
284 # Keep my dynamic module experiments here for later
287 if ($config{OSNAME} =~ /CYGWIN/i)
289 $config{OSNAME} = "CYG-STATIC";
292 if (!$config{MAX_CLIENT_T}) {
293 $config{MAX_CLIENT_T} = 1024; # Set a reasonable 'Default'
294 $fd_scan_fail = "true"; # Used Later
297 # Get and Set some important vars..
302 system("rm -rf .config.cache");
308 chomp($topdir = getcwd());
309 $this = resolve_directory($topdir); # PWD, Regardless.
311 # Does the cache file exist?
313 # No, No it doesn't.. *BASH*
314 print "You have not run ./configure before. Please do this before trying to run the update script.\n";
317 # We've Loaded the cache file and all our variables..
318 print "Updating Files..\n";
320 if ($opt_disable_debug == 1)
322 print "Disabling debug information (-g).\n";
323 $config{OPTIMISATI} = "";
326 $has_epoll = $config{HAS_EPOLL};
327 $has_ports = $config{HAS_PORTS};
328 $has_kqueue = $config{HAS_KQUEUE};
337 print "Configure update failed: $@\n";
345 chomp($topdir = getcwd());
346 $this = resolve_directory($topdir); # PWD, Regardless.
348 # Does the cache file exist?
350 # No, No it doesn't.. *BASH*
351 print "You have not run ./configure before. Please do this before trying to run the update script.\n";
354 # We've Loaded the cache file and all our variables..
355 print "Updating Files..\n";
357 $has_epoll = $config{HAS_EPOLL};
358 $has_ports = $config{HAS_PORTS};
359 $has_kqueue = $config{HAS_KQUEUE};
368 print "Module update failed: $@\n";
378 open(FH,"<.svn/entries") or $fail = 1;
380 print "This is not an SVN copy of InspIRCd.\n";
387 system("svn update");
388 system("perl configure -update");
389 if (defined $opt_rebuild) {
390 system("make install");
395 print "Running non-interactive configure...\n" unless $interactive;
396 print "Checking for cache from previous configure... ";
397 print ((getcache() eq "true") ? "found\n" : "not found\n");
398 print "Checking operating system version... ";
399 print getosflags() . "\n";
401 if (defined $opt_maxclients)
403 $config{MAX_CLIENT} = $opt_maxclients;
406 if (!$config{MAX_CLIENT}) {
407 # If the cache hasn't set the max clients, copy the variable of MAX_CLIENT_T, this
408 # allows us to keep _T for testing purposes. (ie. "Are you sure you want to go
409 # higher than the found value" :))
410 $config{MAX_CLIENT} = $config{MAX_CLIENT_T};
413 printf "Checking if stdint.h exists... ";
414 $config{HAS_STDINT} = "true";
416 open(STDINT, "</usr/include/stdint.h") or $config{HAS_STDINT} = "false";
417 if ($config{HAS_STDINT} eq "true") {
420 print "yes\n" if $config{HAS_STDINT} eq "true";
421 print "no\n" if $config{HAS_STDINT} eq "false";
424 printf "Checking if strlcpy exists... ";
425 # Perform the strlcpy() test..
426 $config{HAS_STRLCPY} = "false";
428 open(STRLCPY, "</usr/include/string.h") or $fail = 1;
430 while (chomp($line = <STRLCPY>)) {
431 # try and find the delcaration of:
432 # size_t strlcpy(...)
433 if ($line =~ /size_t(\0x9|\s)+strlcpy/) {
434 $config{HAS_STRLCPY} = "true";
439 print "yes\n" if $config{HAS_STRLCPY} eq "true";
440 print "no\n" if $config{HAS_STRLCPY} eq "false";
443 printf "Checking if kqueue exists... ";
446 open(KQUEUE, "</usr/include/sys/event.h") or $fail = 1;
448 while (chomp($line = <KQUEUE>)) {
449 # try and find the delcaration of:
451 if ($line =~ /int(\0x9|\s)+kqueue/) {
457 print "yes\n" if $has_kqueue == 1;
458 print "no\n" if $has_kqueue == 0;
460 printf "Checking if epoll exists... ";
463 open(EPOLL, "</usr/include/sys/epoll.h") or $fail = 1;
469 my $kernel = `uname -r`;
471 if (($kernel =~ /^2\.0\./) || ($kernel =~ /^2\.2\./) || ($kernel =~ /^2\.4\./)) {
475 print "yes\n" if $has_epoll == 1;
476 print "no\n" if $has_epoll == 0;
478 printf "Checking if Solaris I/O completion ports are available... ";
480 my $system = `uname -s`;
482 $has_ports = 1 if ($system eq "SunOS");
485 my $kernel = `uname -r`;
487 if (($kernel !~ /^5\.10/)) {
491 print "yes\n" if $has_ports == 1;
492 print "no\n" if $has_ports == 0;
494 if (($config{OSNAME} =~ /CYGWIN/) || ($config{OSNAME} eq "CYG-STATIC")) {
495 $config{HAS_STRLCPY} = "true";
498 $config{HAS_EPOLL} = $has_epoll;
499 $config{HAS_KQUEUE} = $has_kqueue;
501 printf "Checking for libgnutls... ";
502 if (($config{HAS_GNUTLS}) && (($config{HAS_GNUTLS} >= 1.2) || ($config{HAS_GNUTLS} eq "y"))) {
504 $config{HAS_GNUTLS} = "y";
507 $config{HAS_GNUTLS} = "n";
510 printf "Checking for openssl... ";
511 if (($config{HAS_OPENSSL}) && (($config{HAS_OPENSSL} >= 0.8) || ($config{HAS_OPENSSL} eq "y"))) {
513 $config{HAS_OPENSSL} = "y";
516 $config{HAS_OPENSSL} = "n";
519 ################################################################################
520 # BEGIN INTERACTIVE PART #
521 ################################################################################
529 my $rev = getrevision();
530 # Display Introduction Message..
532 Welcome to the \033[1mInspIRCd\033[0m Configuration program! (\033[1minteractive mode\033[0m)
533 \033[1mPackage maintainers: Type ./configure --help for non-interactive help\033[0m
535 *** If you are unsure of any of these values, leave it blank for ***
536 *** standard settings that will work, and your server will run ***
537 *** using them. Please consult your IRC network admin if in doubt. ***
539 Press \033[1m<RETURN>\033[0m to accept the default for any option, or enter
540 a new value. Please note: You will \033[1mHAVE\033[0m to read the docs
541 dir, otherwise you won't have a config file!
543 Your operating system is: \033[1;32m$config{OSNAME}\033[0m ($wholeos)
544 Maximum file descriptors: \033[1;32m$config{MAX_CLIENT_T}\033[0m
545 Your InspIRCd revision ID is \033[1;32mr$rev\033[0m";
547 print " (Non-SVN build)";
551 $config{CHANGE_COMPILER} = "n";
552 print "I have detected the following compiler: \033[1;32m$config{CC}\033[0m (version \033[1;32m$config{GCCVER}.x\033[0m)\n";
554 while (($config{GCCVER} < 3) || ($config{GCCVER} eq "")) {
555 print "\033[1;32mIMPORTANT!\033[0m A GCC 2.x compiler has been detected, and
556 should NOT be used. You should probably specify a newer compiler.\n\n";
557 yesno(CHANGE_COMPILER,"Do you want to change the compiler?");
558 if ($config{CHANGE_COMPILER} =~ /y/i) {
559 print "What command do you want to use to invoke your compiler?\n";
560 print "[\033[1;32m$config{CC}\033[0m] -> ";
561 chomp($config{CC} = <STDIN>);
562 if ($config{CC} eq "") {
565 chomp($foo = `$config{CC} -dumpversion | cut -c 1`);
567 chomp($config{GCCVER} = `$config{CC} -dumpversion | cut -c 1`); # we must redo these if we change compilers
568 print "Queried compiler: \033[1;32m$config{CC}\033[0m (version \033[1;32m$config{GCCVER}.x\033[0m)\n";
569 if ($config{GCCVER} < 3) {
570 print "\033[1;32mGCC 2.x WILL NOT WORK!\033[0m. Let's try that again, shall we?\n";
574 print "\033[1;32mWARNING!\033[0m Could not execute the compiler you specified. You may want to try again.\n";
581 # Directory Settings..
582 my $tmpbase = $config{BASE_DIR};
583 dir_check("do you wish to install the InspIRCd base", "BASE_DIR");
584 if ($tmpbase ne $config{BASE_DIR}) {
585 $config{CONFIG_DIR} = resolve_directory($config{BASE_DIR}."/conf"); # Configuration Dir
586 $config{MODULE_DIR} = resolve_directory($config{BASE_DIR}."/modules"); # Modules Directory
587 $config{BINARY_DIR} = resolve_directory($config{BASE_DIR}."/bin"); # Binary Directory
588 $config{LIBRARY_DIR} = resolve_directory($config{BASE_DIR}."/lib"); # Library Directory
591 dir_check("are the configuration files", "CONFIG_DIR");
592 dir_check("are the modules to be compiled to", "MODULE_DIR");
593 dir_check("is the IRCd binary to be placed", "BINARY_DIR");
594 dir_check("are the IRCd libraries to be placed", "LIBRARY_DIR");
597 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?");
601 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?");
605 yesno(USE_PORTS,"You are running Solaris 10.\nWould you like to enable I/O completion ports support?\nThis is likely to increase performance.\nIf you are unsure, answer yes.\n\nEnable support for I/O completion ports?");
608 $chose_hiperf = (($config{USE_EPOLL} eq "y") || ($config{USE_KQUEUE} eq "y") || ($config{USE_PORTS} eq "y"));
609 if (!$chose_hiperf) {
610 print "No high-performance socket engines are available, or you chose\n";
611 print "not to enable one. Defaulting to select() engine.\n\n";
614 yesno(IPV6,"Would you like to build InspIRCd with IPv6 support?");
617 if ($config{IPV6} eq "y") {
618 print "You have chosen to build an \033[1;32mIPV6-enabled\033[0m server.\nTo accept IPV4 users, you can still use IPV4 addresses\nin your port bindings..\n\n";
619 $config{SUPPORT_IP6LINKS} = "y";
621 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?\nIf you are using a recent operating\nsystem and are unsure, answer yes.\nIf you answer 'no' here, your InspIRCd server will be unable\nto parse IPV6 addresses (e.g. for CIDR bans)");
625 if (($config{HAS_GNUTLS} eq "y") && ($config{HAS_OPENSSL} eq "y")) {
626 print "I have detected both \033[1;32mGnuTLS\033[0m and \033[1;32mOpenSSL\033[0m on your system.\n";
627 print "I will default to GnuTLS. If you wish to use OpenSSL\n";
628 print "instead, you should enable the OpenSSL module yourself\n";
629 print "by copying it from src/modules/extra to src/modules.\n\n";
630 print "Detected GnuTLS version: \033[1;32m" . $gnutls_ver . "\033[0m\n";
631 print "Detected OpenSSL version: \033[1;32m" . $openssl_ver . "\033[0m\n\n";
634 if ($config{HAS_GNUTLS} eq "y") {
635 yesno(USE_GNUTLS, "Would you like to enable SSL Support?");
636 if ($config{USE_GNUTLS} eq "y") {
637 print "\nUsing GnuTLS SSL module.\n";
639 } elsif ($config{HAS_OPENSSL} eq "y") {
640 yesno(USE_OPENSSL, "Would you like to enable SSL Support?");
641 if ($config{USE_OPENSSL} eq "y") {
642 print "\nUsing OpenSSL SSL module.\nYou will get better performance if you move to GnuTLS in the future.\n";
646 print "\nCould not detect OpenSSL or GnuTLS. Make sure pkg-config is installed if\nyou intend to use OpenSSL, or that GnuTLS is in your path if you intend\nto use GnuTLS.\n\n";
649 print "\nThe following questions will ask you for various figures relating\n";
650 print "To your IRCd install. Please note that these should usually be left\n";
651 print "as defaults unless you have a real reason to change them. If they\n";
652 print "changed, then the values must be identical on all servers on your\n";
653 print "network, or malfunctions and/or crashes may occur, with the exception\n";
654 print "of the 'maximum number of clients' setting which may be different on\n";
655 print "different servers on the network.\n\n";
657 # File Descriptor Settings..
658 promptnumeric("number of clients at any one time", "MAX_CLIENT_T");
659 $config{MAX_CLIENT} = $config{MAX_CLIENT_T};
660 $config{MAX_DESCRIPTORS} = $config{MAX_CLIENT_T};
662 promptnumeric("length of nicknames", "NICK_LENGT");
663 promptnumeric("length of channel names", "CHAN_LENGT");
664 promptnumeric("number of mode changes in one line", "MAXI_MODES");
665 promptnumeric("length of an ident (username)", "MAX_IDENT");
666 promptnumeric("length of a quit message", "MAX_QUIT");
667 promptnumeric("length of a channel topic", "MAX_TOPIC");
668 promptnumeric("length of a kick message", "MAX_KICK");
669 promptnumeric("length of a GECOS (real name)", "MAX_GECOS");
670 promptnumeric("length of an away message", "MAX_AWAY");
675 if (($config{USE_GNUTLS} eq "y") && ($config{HAS_GNUTLS} ne "y"))
677 print "Sorry, but i couldn't detect gnutls. Make sure gnutls-config is in your path.\n";
680 if (($config{USE_OPENSSL} eq "y") && ($config{HAS_OPENSSL} ne "y"))
682 print "Sorry, but i couldn't detect openssl. Make sure openssl is in your path.\n";
686 if ($config{USE_GNUTLS} eq "y") {
688 open(TMP, "<src/modules/m_ssl_gnutls.cpp") or $failed = 1;
691 print "Symlinking src/modules/m_ssl_gnutls.cpp from extra/\n";
692 chdir("src/modules");
693 system("ln -s extra/m_ssl_gnutls.cpp");
700 open(TMP, "<$config{CONFIG_DIR}/key.pem") or $failed = 1;
702 open(TMP, "<$config{CONFIG_DIR}/cert.pem") or $failed = 1;
705 print "SSL Certificates Not found, Generating.. \n\n
706 *************************************************************
707 * Generating the Private Key may take some time, go grab a *
708 * Coffee. Even better, to generate some more entropy if it *
709 * is taking a while, open another console and type du / a *
710 * few times and get that HD going :) Then answer the *
711 * Questions which follow. If you are unsure, just hit enter *
712 *************************************************************\n\n";
714 print "\nCertificate generation complete, copying to config directory... ";
715 system("mv key.pem $config{CONFIG_DIR}/key.pem");
716 system("mv cert.pem $config{CONFIG_DIR}/cert.pem");
719 print "SSL Certificates found, skipping.\n\n"
724 print "Skipping SSL certificate generation\nin non-interactive mode.\n\n";
726 } elsif ($config{USE_OPENSSL} eq "y") {
728 open(TMP, "<src/modules/m_ssl_openssl.cpp") or $failed = 1;
731 print "Symlinking src/modules/m_ssl_openssl.cpp from extra/\n";
732 chdir("src/modules");
733 system("ln -s extra/m_ssl_openssl.cpp");
740 open(TMP, "<$config{CONFIG_DIR}/key.pem") or $failed = 1;
742 open(TMP, "<$config{CONFIG_DIR}/cert.pem") or $failed = 1;
745 print "SSL Certificates Not found, Generating.. \n\n
746 *************************************************************
747 * Generating the certificates may take some time, go grab a *
748 * coffee, or something. *
749 *************************************************************\n\n";
751 print "\nCertificate generation complete, copying to config directory... ";
752 system("mv key.pem $config{CONFIG_DIR}/key.pem");
753 system("mv cert.pem $config{CONFIG_DIR}/cert.pem");
754 system("mv dhparams.pem $config{CONFIG_DIR}/dhparams.pem");
757 print "SSL Certificates found, skipping.\n\n"
762 print "Skipping SSL certificate generation\nin non-interactive mode.\n\n";
765 if (($config{USE_GNUTLS} eq "n") && ($config{USE_OPENSSL} eq "n")) {
766 print "Skipping SSL Certificate generation, SSL support is not available.\n\n";
774 print "To build your server with these settings, please type '\033[1;32m$config{MAKEPROG}\033[0m' now.\n";
775 if (($config{USE_GNUTLS} eq "y") || ($config{USE_OPENSSL} eq "y")) {
776 print "Please remember that to enable \033[1;32mSSL support\033[0m you must\n";
777 print "load the required modules in your config. This configure process\n";
778 print "has just prepared these modules to be compiled for you, and has not\n";
779 print "configured them to be compiled into the core of the ircd.\n";
781 print "*** \033[1;32mRemember to edit your configuration files!!!\033[0m ***\n\n\n";
782 if (($config{OSNAME} eq "OpenBSD") && ($config{CC} ne "eg++")) {
783 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";
786 if ($config{GCCVER} < "3") {
788 \033[1;32mWARNING!\033[0m You are attempting to compile InspIRCd on GCC 2.x!
789 GCC 2.x series compilers only had partial (read as broken) C++ support, and
790 your compile will most likely fail horribly! If you have any problems, do NOT
791 report them to the bugtracker or forums without first upgrading your compiler
792 to a newer 3.x or 4.x (or whatever is available currently) version.
796 ################################################################################
798 ################################################################################
800 # Retrieves the .config.cache file, and loads values into the main config hash.
801 open(CACHE, ".config.cache") or return undef;
804 # Ignore Blank lines, and comments..
807 my ($key, $value) = split("=", $_, 2);
808 $value =~ /^\"(.*)\"$/;
809 # Do something with data here!
817 # Dump the contents of %config
818 print "Writing \033[1;32mcache file\033[0m for future ./configures ...\n";
819 open(FILEHANDLE, ">.config.cache");
820 foreach $key (keys %config) {
821 print FILEHANDLE "$key=\"$config{$key}\"\n";
827 my ($desc, $hash_key) = @_;
830 print "In what directory $desc?\n";
831 print "[\033[1;32m$config{$hash_key}\033[0m] -> ";
832 chomp($var = <STDIN>);
834 $var = $config{$hash_key};
836 if ($var =~ /^\~\/(.+)$/) {
837 # Convert it to a full path..
838 $var = resolve_directory($ENV{HOME} . "/" . $1);
840 elsif ((($config{OSNAME} =~ /MINGW32/i) and ($var !~ /^[A-Z]{1}:\\.*/)) and (substr($var,0,1) ne "/"))
842 # Assume relative Path was given.. fill in the rest.
843 $var = $this . "/$var";
846 $var = resolve_directory($var);
848 print "$var does not exist. Create it?\n[\033[1;32my\033[0m] ";
849 chomp($tmp = <STDIN>);
850 if (($tmp eq "") || ($tmp =~ /^y/i)) {
851 # Attempt to Create the Dir..
853 system("mkdir -p \"$var\" >> /dev/null 2>&1");
854 $chk = system("mkdir -p \"$var\" >> /dev/null 2>&1") / 256;
856 print "Unable to create directory. ($var)\n\n";
861 # They said they don't want to create, and we can't install there.
867 # Target exists, but is not a directory.
868 print "File $var exists, but is not a directory.\n\n";
872 # Either Dir Exists, or was created fine.
873 $config{$hash_key} = $var;
881 $config{LDLIBS} = "-lstdc++";
882 $config{FLAGS} = "-fno-strict-aliasing -fPIC -Wall -Woverloaded-virtual $config{OPTIMISATI}";
883 $config{DEVELOPER} = "-fno-strict-aliasing -fPIC -Wall -Woverloaded-virtual -g";
884 $SHARED = "-Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared";
885 $config{MAKEPROG} = "make";
887 if ($config{OSNAME} =~ /darwin/i) {
888 $config{FLAGS} = "-DDARWIN -frtti -fPIC -Wall -Woverloaded-virtual $config{OPTIMISATI}";
889 $SHARED = "-bundle -twolevel_namespace -undefined dynamic_lookup";
890 $config{LDLIBS} = "-ldl -lstdc++";
893 if ($config{OSNAME} =~ /OpenBSD/i) {
894 $config{MAKEPROG} = "gmake";
895 chomp($foo = `eg++ -dumpversion | cut -c 1`);
896 # theyre running the package version of gcc (eg++)... detect it and set up its version numbers.
897 # if theyre not running this, configure lets the build continue but they probably wont manage to
898 # compile as this standard version is 2.95.3!
900 $config{CC} = "eg++";
901 chomp($config{GCCVER} = `eg++ -dumpversion | cut -c 1`); # we must redo these if we change the compiler path
906 if ($config{OSNAME} =~ /Linux/i) {
907 $config{LDLIBS} = "-ldl -lstdc++";
908 $config{FLAGS} = "-fno-strict-aliasing -fPIC -Wall -Woverloaded-virtual $config{OPTIMISATI}";
909 $config{FLAGS} .= " " . $ENV{CXXFLAGS} if exists($ENV{CXXFLAGS});
910 $config{MAKEPROG} = "make";
911 if ($config{OSNAME} =~ /CYGWIN/) {
912 $config{FLAGS} = "-fno-strict-aliasing -Wall -Woverloaded-virtual $config{OPTIMISATI}";
913 $config{LDLIBS} = "";
914 $config{MAKEPROG} = "/usr/bin/make";
915 $config{MAKEORDER} = "ircd mods";
917 } elsif ($config{OSNAME} eq "CYG-STATIC") {
918 $config{FLAGS} = "-fno-strict-aliasing -Wall -Woverloaded-virtual $config{OPTIMISATI}";
919 $config{LDLIBS} = "";
920 $config{MAKEPROG} = "/usr/bin/make";
921 $config{MAKEORDER} = "mods ircd";
922 $config{STATICLIBS} = "modules/mods.a";
923 $config{STATIC_LINK} = "yes";
924 return "Cygwin-Static";
926 $config{FLAGS} .= " " . $ENV{CXXFLAGS} if exists($ENV{CXXFLAGS});
929 if ($config{OSNAME} =~ /SunOS/i)
931 # solaris/sunos needs these
932 # socket = bsd sockets api
934 # rt = POSIX realtime extensions
935 # resolv = inet_aton only (why isnt this in nsl?!)
936 $config{MAKEPROG} = "gmake";
937 $config{LDLIBS} = $config{LDLIBS} . " -lsocket -lnsl -lrt -lresolv";
941 if($config{OSNAME} =~ /MINGW32/i)
943 # All code is position-independent on windows
944 $config{FLAGS} =~ s/-fPIC //;
948 return $config{OSNAME};
952 my($writeheader) = @_;
953 # First File.. inspircd_config.h
954 chomp(my $incos = `uname -n -s -r`);
955 chomp($version = `sh src/version.sh`);
956 chomp(my $revision2 = getrevision());
957 if ($writeheader == 1)
959 print "Writing \033[1;32minspircd_config.h\033[0m\n";
960 open(FILEHANDLE, ">include/inspircd_config.h");
961 my $NL = $config{NICK_LENGT}+1;
962 my $CL = $config{CHAN_LENGT}+1;
963 print FILEHANDLE <<EOF;
964 /* Auto generated by configure, do not modify! */
965 #ifndef __CONFIGURATION_AUTO__
966 #define __CONFIGURATION_AUTO__
968 /* this is for windows support. */
969 #define CoreExport /**/
970 #define DllExport /**/
972 #define CONFIG_FILE "$config{CONFIG_DIR}/inspircd.conf"
973 #define MOD_PATH "$config{MODULE_DIR}"
974 #define VERSION "$version"
975 #define REVISION "$revision2"
976 #define MAXCLIENTS $config{MAX_CLIENT}
977 #define MAXCLIENTS_S "$config{MAX_CLIENT}"
978 #define SOMAXCONN_S "$config{_SOMAXCONN}"
979 #define MAX_DESCRIPTORS $config{MAX_DESCRIPTORS}
982 #define MAXMODES $config{MAXI_MODES}
983 #define IDENTMAX $config{MAX_IDENT}
984 #define MAXQUIT $config{MAX_QUIT}
985 #define MAXTOPIC $config{MAX_TOPIC}
986 #define MAXKICK $config{MAX_KICK}
987 #define MAXGECOS $config{MAX_GECOS}
988 #define MAXAWAY $config{MAX_AWAY}
989 #define OPTIMISATION $config{OPTIMITEMP}
990 #define LIBRARYDIR "$config{LIBRARY_DIR}"
991 #define SYSTEM "$incos"
993 print FILEHANDLE "#define MAXBUF " . ($config{MAXBUF}+2) . "\n";
995 if ($config{OSNAME} =~ /SunOS/i) {
996 print FILEHANDLE "#define IS_SOLARIS\n";
998 if ($config{OSNAME} =~ /CYGWIN/i) {
999 print FILEHANDLE "#define IS_CYGWIN\n";
1000 print FILEHANDLE "#ifndef FD_SETSIZE\n#define FD_SETSIZE 1024\n#endif\n";
1002 if ($config{OSNAME} =~ /MINGW32/i) {
1003 print FILEHANDLE "#define IS_MINGW\n";
1005 if ($config{OSNAME} =~ /CYG-STATIC/i) {
1006 print FILEHANDLE "#ifndef FD_SETSIZE\n#define FD_SETSIZE 1024\n#endif\n";
1008 if ($config{STATIC_LINK} eq "yes") {
1009 print FILEHANDLE "#define STATIC_LINK\n";
1011 if ($config{GCCVER} >= 3) {
1012 print FILEHANDLE "#define GCC3\n";
1014 if ($config{HAS_STRLCPY} eq "true") {
1015 print FILEHANDLE "#define HAS_STRLCPY\n";
1017 if ($config{HAS_STDINT} eq "true") {
1018 print FILEHANDLE "#define HAS_STDINT\n";
1020 if ($config{IPV6} =~ /y/i) {
1021 print FILEHANDLE "#define IPV6\n";
1023 if ($config{SUPPORT_IP6LINKS} =~ /y/i) {
1024 print FILEHANDLE "#define SUPPORT_IP6LINKS\n";
1027 if (($has_kqueue) && ($config{USE_KQUEUE} eq "y")) {
1028 print FILEHANDLE "#define USE_KQUEUE\n";
1029 $se = "socketengine_kqueue";
1032 if (($has_epoll) && ($config{USE_EPOLL} eq "y")) {
1033 print FILEHANDLE "#define USE_EPOLL\n";
1034 $se = "socketengine_epoll";
1037 if (($has_ports) && ($config{USE_PORTS} eq "y")) {
1038 print FILEHANDLE "#define USE_PORTS\n";
1039 $se = "socketengine_ports";
1042 # user didn't choose either epoll or select for their OS.
1043 # default them to USE_SELECT (ewwy puke puke)
1045 print FILEHANDLE "#define USE_SELECT\n";
1046 $se = "socketengine_select";
1048 print FILEHANDLE "\n#endif\n";
1054 open(FILEHANDLE, ">include/inspircd_se_config.h");
1055 print FILEHANDLE <<EOF;
1056 /* Auto generated by configure, do not modify or commit to svn! */
1057 #ifndef __CONFIGURATION_SOCKETENGINE__
1058 #define __CONFIGURATION_SOCKETENGINE__
1068 # Create a Modules List..
1070 foreach $i (@modlist)
1072 if ($config{STATIC_LINK} eq "yes") {
1073 $modules .= "m_".$i.".o ";
1076 $modules .= "m_".$i.".so ";
1079 chomp($modules); # Remove Redundant whitespace..
1081 opendir(DIRHANDLE, "src/modules");
1082 foreach $name (sort readdir(DIRHANDLE)) {
1083 if ($name =~ /^m_(.+?)$/) {
1084 if (opendir(MDIRHANDLE, "src/modules/$name") != 0) {
1085 closedir(MDIRHANDLE);
1086 $modules .= "$name.so ";
1090 closedir(DIRHANDLE);
1093 # Write all .in files.
1096 my $exe = "inspircd";
1098 if ($config{OSNAME} =~ /CYGWIN/i) {
1099 $exe = "inspircd.exe";
1102 opendir(DIRHANDLE, $this);
1104 # Do this once here, and cache it in the .*.inc files,
1105 # rather than attempting to read src/version.sh from
1106 # compiled code -- we might not have the source to hand.
1107 # Fix for bug#177 by Brain.
1109 chomp(my $version = `sh ./src/version.sh`);
1110 chomp(my $revision = getrevision());
1111 $version = "$version(r$revision)";
1114 if ($config{IS_DARWIN} eq "YES")
1118 # We can actually parse any file starting with . and ending with .inc,
1119 # but right now we only parse .inspircd.inc to form './inspircd'
1121 foreach $name (sort readdir(DIRHANDLE)) {
1122 if ($name =~ /^\.(.+)\.inc$/) {
1124 # All .name.inc files need parsing!
1126 open(FILEHANDLE, ".$file.inc");
1127 while (<FILEHANDLE>) {
1132 $tmp =~ s/\@CC\@/$config{CC}/;
1133 $tmp =~ s/\@MAKEPROG\@/$config{MAKEPROG}/;
1134 $tmp =~ s/\@FLAGS\@/$config{FLAGS}/;
1135 $tmp =~ s/\@DEVELOPER\@/$config{DEVELOPER}/;
1136 $tmp =~ s/\@LDLIBS\@/$config{LDLIBS}/;
1137 $tmp =~ s/\@BASE_DIR\@/$config{BASE_DIR}/;
1138 $tmp =~ s/\@CONFIG_DIR\@/$config{CONFIG_DIR}/;
1139 $tmp =~ s/\@MODULE_DIR\@/$config{MODULE_DIR}/;
1140 $tmp =~ s/\@BINARY_DIR\@/$config{BINARY_DIR}/;
1141 $tmp =~ s/\@LIBRARY_DIR\@/$config{LIBRARY_DIR}/;
1142 $tmp =~ s/\@LIBRARY_EXT\@/$LIBEXT/;
1143 $tmp =~ s/\@MODULES\@/$modules/;
1144 $tmp =~ s/\@EXECUTABLE\@/$exe/;
1145 $tmp =~ s/\@MAKEORDER\@/$config{MAKEORDER}/;
1146 $tmp =~ s/\@STATICLIBS\@/$config{STATICLIBS}/;
1147 $tmp =~ s/\@VERSION\@/$version/;
1149 print "Writing \033[1;32m$file\033[0m\n";
1150 open(FILEHANDLE, ">$file");
1151 print FILEHANDLE $tmp;
1154 closedir(DIRHANDLE);
1156 # Make inspircd executable!
1157 chmod 0744, 'inspircd';
1159 if ($config{STATIC_LINK} eq "yes") {
1160 print "Writing static-build \033[1;32msrc/Makefile\033[0m\n";
1161 write_static_makefile();
1162 write_static_modules_makefile();
1163 } elsif ($config{OSNAME} =~ /CYGWIN/i) {
1164 print "Writing cygwin-build \033[1;32msrc/Makefile\033[0m\n";
1165 write_static_makefile();
1166 write_dynamic_modules_makefile();
1168 print "Writing dynamic-build \033[1;32msrc/Makefile\033[0m\n";
1169 write_dynamic_makefile();
1170 write_dynamic_modules_makefile();
1174 sub write_static_modules_makefile {
1175 # Modules Makefile..
1176 print "Writing \033[1;32msrc/modules/Makefile\033[0m\n";
1177 open(FILEHANDLE, ">src/modules/Makefile");
1180 # Module Makefile Header
1182 print FILEHANDLE <<EOF;
1183 # (C) ChatSpike development team
1184 # Makefile by <Craig\@ChatSpike.net>
1185 # Many Thanks to Andrew Church <achurch\@achurch.org>
1186 # for assisting with making this work right.
1188 # Automatically Generated by ./configure to add a modules
1189 # please run ./configure --update
1195 # End Module Makefile Header
1198 # Create a Modules List..
1203 open(MODLIST,">include/modlist.h");
1206 # Include File Header
1208 print MODLIST <<HEADER;
1209 // Generated automatically by configure. DO NOT EDIT!
1211 #ifndef __SYMBOLS__H_CONFIGURED__
1212 #define __SYMBOLS__H_CONFIGURED__
1216 # End Include File Header
1219 # Place Module List into Include
1220 foreach $i (@modlist) {
1221 if ($i !~ /_static$/) {
1222 print MODLIST "extern \"C\" void * $i\_init (void);\n";
1225 print MODLIST "\nstruct {const char *name; initfunc *value; } modsyms[] = {\n";
1230 foreach $i (@modlist)
1232 if ($i !~ /_static$/) {
1233 $cmflags = getcompilerflags("src/modules/m_".$i.".cpp");
1234 $liflags = getlinkerflags("src/modules/m_".$i.".cpp");
1235 $deps = getdependencies("src/modules/m_".$i.".cpp");
1237 #print "file: $i: cmflags=$cmflags; liflags=$liflags; deps=$deps\n";
1240 # Write Entry to the Makefile
1242 print FILEHANDLE <<EOCHEESE;
1243 m_$i.o: .m_$i\_static.cpp ../../include/modules.h ../../include/users.h ../../include/channels.h ../../include/base.h $deps
1244 \$(CC) -pipe -I../../include \$(FLAGS) $flags -export-dynamic -c .m_$i\_static.cpp
1245 mv .m_$i\_static.o ../m_$i.o
1249 # End Write Entry to the MakeFile
1251 print "Configuring module [\033[1;32mm_$i.so\033[0m] for static linking... ";
1252 open(MODULE,"<src/modules/m_".$i.".cpp") or die("Could not open m_".$i.".cpp");
1253 open(MUNGED,">src/modules/.m_".$i."_static.cpp") or die("Could not create .m_".$i."_static.cpp");
1254 while (chomp($a = <MODULE>)) {
1255 $a =~ s/init_module/$i\_init/g;
1256 print MUNGED "$a\n";
1260 print MODLIST <<EOENT;
1261 {"m_$i.so",\&$i\_init},
1267 print MODLIST "{0}};\n\n#endif\n";
1271 sub write_dynamic_modules_makefile {
1272 # Modules Makefile..
1273 print "Writing \033[1;32msrc/modules/Makefile\033[0m\n";
1274 open(FILEHANDLE, ">src/modules/Makefile");
1277 if ($config{OSNAME} =~ /CYGWIN/i) {
1278 $extra = "../inspircd.dll.a";
1282 # Module Makefile Header
1284 print FILEHANDLE <<EOF;
1285 # (C) ChatSpike development team
1286 # Makefile by <Craig\@ChatSpike.net>
1287 # Many Thanks to Andrew Church <achurch\@achurch.org>
1288 # for assisting with making this work right.
1290 # Automatically Generated by ./configure to add a modules
1291 # please run ./configure -update or ./configure -modupdate
1297 # End Module Makefile Header
1300 # Create a Modules List..
1306 foreach $i (@modlist) {
1308 # Write Entry to the MakeFile
1310 $cmflags = getcompilerflags("src/modules/m_".$i.".cpp");
1311 $liflags = getlinkerflags("src/modules/m_".$i.".cpp");
1312 $deps = getdependencies("src/modules/m_".$i.".cpp");
1314 #print "file: $i: cmflags=$cmflags; liflags=$liflags; deps=$deps\n";
1316 print FILEHANDLE <<EOCHEESE;
1317 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
1318 \$(CC) -pipe -I../../include \$(FLAGS) $cmflags -export-dynamic -c m_$i.cpp
1321 if ($config{OSNAME} =~ /darwin/) {
1322 print FILEHANDLE <<EOCHEESE;
1323 \$(CC) -pipe -twolevel_namespace -undefined dynamic_lookup \$(FLAGS) -bundle $liflags -o m_$i.so m_$i.o $extra
1327 print FILEHANDLE <<EOCHEESE;
1328 \$(CC) -pipe \$(FLAGS) -shared $liflags -o m_$i.so m_$i.o $extra
1332 $crud = $crud . " install -m \$(INSTMODE) m_$i.so \$(MODPATH)\n";
1334 # End Write Entry to the MakeFile
1338 opendir(DIRHANDLE, "src/modules");
1339 foreach $name (sort readdir(DIRHANDLE)) {
1340 if ($name =~ /^m_(.+?)$/) {
1343 # A module made of multiple files, in a dir, e.g. src/modules/m_spanningtree/
1344 if (opendir(MDIRHANDLE, "src/modules/$name") != 0) {
1345 print "Composing Makefile rules for directory \033[1;32m$name\033[0m... ";
1347 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";
1348 foreach $fname (sort readdir(MDIRHANDLE)) {
1349 if ($fname =~ /\.cpp$/) {
1350 $cmflags = getcompilerflags("src/modules/$name/$fname");
1351 $liflags = getlinkerflags("src/modules/$name/$fname");
1352 $deps = getdependencies("src/modules/$name/$fname");
1354 $oname =~ s/\.cpp$/.o/g;
1355 print FILEHANDLE " $name/$oname";
1356 $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";
1357 $crapola = $crapola . " \$(CC) -pipe -I../../include -I. \$(FLAGS) $cmflags -export-dynamic -o $name/$oname -c $name/$fname\n\n";
1358 $crap3 = $crap3 . " $name/$oname";
1362 print "(\033[1;32m$i files found\033[0m)\n";
1363 if ($config{IS_DARWIN} eq "YES") {
1364 print FILEHANDLE "\n \$(CC) -pipe -twolevel_namespace -undefined dynamic_lookup \$(FLAGS) -bundle -o $name.so $crap3\n";
1366 print FILEHANDLE "\n \$(CC) -pipe \$(FLAGS) -shared $liflags -o $name.so $crap3\n";
1368 print FILEHANDLE "\n$crapola\n";
1369 closedir(MDIRHANDLE);
1370 $crud = $crud . " install -m \$(INSTMODE) $name.so \$(MODPATH)\n";
1374 closedir(DIRHANDLE);
1376 print FILEHANDLE "modinst:\n \@echo \"Installing modules...\"\n" . $crud;
1380 sub write_static_makefile {
1381 open(FH,">src/Makefile") or die("Could not write src/Makefile!");
1384 opendir(DIRHANDLE, "src");
1385 foreach $name (sort readdir(DIRHANDLE)) {
1386 if ($name =~ /^cmd_(.+)\.cpp$/) {
1387 $cmdlist[$i++] = $1;
1390 closedir(DIRHANDLE);
1393 foreach my $cmd (@cmdlist) {
1394 $cmdobjs = $cmdobjs . "cmd_$cmd.o ";
1395 $srcobjs = $srcobjs . "cmd_$cmd.cpp ";
1400 # (C) ChatSpike development team
1401 # Makefile by <Craig\@ChatSpike.net>
1402 # Makefile version 2 (statically linked core) by <brain\@inspircd.org>
1405 CC = im a cheezeball
1407 CXXFLAGS = -I../include \${FLAGS}
1408 CPPFILES = \$(shell /bin/ls -l modes/ | grep '\\.cpp' | sed 's/^.* //' | grep -v svn)
1409 RELCPPFILES = \$(shell /bin/ls -l modes/ | grep '\\.cpp' | sed 's/^.* /modes\\//' | grep -v svn)
1413 $se = "socketengine_select";
1414 if (($has_kqueue) && ($config{USE_KQUEUE} eq "y")) {
1415 $se = "socketengine_kqueue";
1417 elsif (($has_epoll) && ($config{USE_EPOLL} eq "y")) {
1418 $se = "socketengine_epoll";
1420 elsif (($has_ports) && ($config{USE_PORTS} eq "y")) {
1421 $se = "socketengine_ports";
1425 # This next section is for cygwin dynamic module builds.
1426 # Basically, what we do, is build the inspircd core as a library
1427 # then the main executable uses that. the library is capable of
1428 # loading / unloading the modules dynamically :)
1429 # Massive thanks to the guys on #cygwin @ irc.freenode.net for helping
1433 if ($config{OSNAME} =~ /CYGWIN/i) {
1435 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
1437 inspircd.exe: inspircd.dll.a
1440 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
1441 \$(CC) -shared -Wl,--out-implib=inspircd.dll.a -o inspircd.dll \$^
1445 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
1447 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
1448 \$(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)
1454 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
1455 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c cull_list.cpp
1457 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
1458 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c snomasks.cpp
1460 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
1461 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c command_parse.cpp
1463 userprocess.o: userprocess.cpp ../include/base.h ../include/hashcomp.h ../include/globals.h ../include/inspircd_config.h
1464 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c userprocess.cpp
1466 socketengine.o: $se.cpp socketengine.cpp ../include/base.h ../include/hashcomp.h ../include/globals.h ../include/inspircd_config.h ../include/$se.h
1467 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c socketengine.cpp $se.cpp
1469 hashcomp.o: hashcomp.cpp ../include/base.h ../include/hashcomp.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1470 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c hashcomp.cpp
1472 helperfuncs.o: helperfuncs.cpp ../include/base.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1473 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c helperfuncs.cpp
1475 channels.o: channels.cpp ../include/base.h ../include/channels.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1476 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c channels.cpp
1478 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
1479 \${MAKE} -C "modes" DIRNAME="src/modes" CC="\$(CC)" \$(MAKEARGS)
1480 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c mode.cpp
1482 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
1483 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c xline.cpp
1485 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
1486 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c inspstring.cpp
1488 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
1489 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c dns.cpp
1491 base.o: base.cpp ../include/base.h ../include/globals.h ../include/inspircd_config.h
1492 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c base.cpp
1494 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
1495 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c configreader.cpp
1497 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
1498 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c commands.cpp $cmdobjs
1500 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
1501 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c dynamic.cpp
1503 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
1504 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c users.cpp
1506 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
1507 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c modules.cpp
1509 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
1510 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c wildcard.cpp
1512 socket.o: socket.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h
1513 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c socket.cpp
1515 inspsocket.o: inspsocket.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h ../include/timer.h
1516 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c inspsocket.cpp
1518 timer.o: timer.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h ../include/timer.h
1519 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c timer.cpp
1522 foreach my $cmd (@cmdlist) {
1524 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
1525 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c cmd_$cmd.cpp
1531 sub write_dynamic_makefile {
1535 opendir(DIRHANDLE, "src");
1536 foreach $name (sort readdir(DIRHANDLE)) {
1537 if ($name =~ /^cmd_(.+)\.cpp$/) {
1538 $cmdlist[$i++] = $1;
1541 closedir(DIRHANDLE);
1545 foreach my $cmd (@cmdlist) {
1546 $cmdobjs = $cmdobjs . "cmd_$cmd.so ";
1547 $srcobjs = $srcobjs . "cmd_$cmd.cpp ";
1550 $se = "socketengine_select";
1551 if (($has_kqueue) && ($config{USE_KQUEUE} eq "y")) {
1552 $se = "socketengine_kqueue";
1554 elsif (($has_epoll) && ($config{USE_EPOLL} eq "y")) {
1555 $se = "socketengine_epoll";
1557 elsif (($has_ports) && ($config{USE_PORTS} eq "y")) {
1558 $se = "socketengine_ports";
1561 open(FH,">src/Makefile") or die("Could not write src/Makefile");
1565 # (C) ChatSpike development team
1566 # Makefile by <Craig\@ChatSpike.net>
1567 # Makefile version 2 (dynamically linked core) by <brain\@inspircd.org>
1570 CC = im a cheezeball
1572 CXXFLAGS = -I../include \${FLAGS}
1573 CPPFILES = \$(shell /bin/ls -l modes/ | grep '\\.cpp' | sed 's/^.* //' | grep -v svn)
1574 RELCPPFILES = \$(shell /bin/ls -l modes/ | grep '\\.cpp' | sed 's/^.* /modes\\//' | grep -v svn)
1578 if ($config{IS_DARWIN} eq "YES") {
1580 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
1582 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
1583 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c inspircd.cpp
1584 \$(CC) -pipe -dynamic -bind_at_load -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
1586 libIRCDsocketengine.dylib: $se.cpp socketengine.cpp ../include/base.h ../include/hashcomp.h ../include/globals.h ../include/inspircd_config.h ../include/$se.h
1587 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c socketengine.cpp
1588 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c $se.cpp
1589 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDsocketengine.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDsocketengine.dylib socketengine.o $se.o
1591 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
1592 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c snomasks.cpp
1593 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDsnomasks.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDsnomasks.dylib snomasks.o
1595 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
1596 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c command_parse.cpp
1597 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDcommand_parse.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDcommand_parse.dylib command_parse.o
1599 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
1600 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c cull_list.cpp
1601 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDcull_list.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDcull_list.dylib cull_list.o
1603 libIRCDuserprocess.dylib: userprocess.cpp ../include/base.h ../include/hashcomp.h ../include/globals.h ../include/inspircd_config.h
1604 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c userprocess.cpp
1605 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDuserprocess.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDuserprocess.dylib userprocess.o
1607 libIRCDhash.dylib: hashcomp.cpp ../include/base.h ../include/hashcomp.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1608 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c hashcomp.cpp
1609 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDhash.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDhash.dylib hashcomp.o
1611 libIRCDhelper.dylib: helperfuncs.cpp ../include/base.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1612 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c helperfuncs.cpp
1613 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDhelper.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDhelper.dylib helperfuncs.o
1615 libIRCDchannels.dylib: channels.cpp ../include/base.h ../include/channels.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1616 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c channels.cpp
1617 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDchannels.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDchannels.dylib channels.o
1619 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)
1620 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c mode.cpp
1621 \${MAKE} -C "modes" DIRNAME="src/modes" CC="\$(CC)" \$(MAKEARGS) CPPFILES="\$(CPPFILES)"
1622 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDmode.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDmode.dylib mode.o modes/modeclasses.a
1624 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
1625 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c xline.cpp
1626 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDxline.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDxline.dylib xline.o
1628 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
1629 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c inspstring.cpp
1630 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDstring.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDstring.dylib inspstring.o
1632 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
1633 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c dns.cpp
1634 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDasyncdns.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDasyncdns.dylib dns.o
1636 libIRCDbase.dylib: base.cpp ../include/base.h ../include/globals.h ../include/inspircd_config.h
1637 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c base.cpp
1638 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDbase.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDbase.dylib base.o
1640 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
1641 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c configreader.cpp
1642 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDconfigreader.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDconfigreader.dylib configreader.o
1644 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
1645 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c commands.cpp
1646 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDcommands.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDcommands.dylib commands.o
1648 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
1649 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c dynamic.cpp
1650 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDdynamic.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDdynamic.dylib dynamic.o
1652 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
1653 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c users.cpp
1654 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDusers.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDusers.dylib users.o
1656 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
1657 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c modules.cpp
1658 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDmodules.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDmodules.dylib modules.o
1660 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
1661 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c wildcard.cpp
1662 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDwildcard.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDwildcard.dylib wildcard.o
1664 libIRCDsocket.dylib: socket.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h
1665 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c socket.cpp
1666 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDsocket.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDsocket.dylib socket.o
1668 libIRCDinspsocket.dylib: inspsocket.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h ../include/timer.h
1669 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c inspsocket.cpp
1670 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDinspsocket.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDinspsocket.dylib inspsocket.o
1672 libIRCDtimer.dylib: timer.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h ../include/timer.h
1673 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c timer.cpp
1674 \$(CC) -pipe -install_name $config{LIBRARY_DIR}/libIRCDtimer.dylib -dynamiclib -twolevel_namespace -undefined dynamic_lookup -o libIRCDtimer.dylib timer.o
1681 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
1683 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
1684 \$(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
1686 libIRCDsocketengine.so: $se.cpp socketengine.cpp ../include/base.h ../include/hashcomp.h ../include/globals.h ../include/inspircd_config.h ../include/$se.h
1687 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c socketengine.cpp $se.cpp
1688 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDsocketengine.so socketengine.o $se.o
1690 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
1691 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c snomasks.cpp
1692 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDsnomasks.so snomasks.o
1694 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
1695 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c command_parse.cpp
1696 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDcommand_parse.so command_parse.o
1698 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
1699 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c cull_list.cpp
1700 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDcull_list.so cull_list.o
1702 libIRCDuserprocess.so: userprocess.cpp ../include/base.h ../include/hashcomp.h ../include/globals.h ../include/inspircd_config.h
1703 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c userprocess.cpp
1704 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDuserprocess.so userprocess.o
1706 libIRCDhash.so: hashcomp.cpp ../include/base.h ../include/hashcomp.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1707 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c hashcomp.cpp
1708 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDhash.so hashcomp.o
1710 libIRCDhelper.so: helperfuncs.cpp ../include/base.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1711 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c helperfuncs.cpp
1712 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDhelper.so helperfuncs.o
1714 libIRCDchannels.so: channels.cpp ../include/base.h ../include/channels.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1715 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c channels.cpp
1716 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDchannels.so channels.o
1718 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)
1719 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c mode.cpp
1720 \${MAKE} -C "modes" DIRNAME="src/modes" CC="\$(CC)" \$(MAKEARGS) CPPFILES="\$(CPPFILES)"
1721 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDmode.so mode.o modes/modeclasses.a
1723 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
1724 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c xline.cpp
1725 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDxline.so xline.o
1727 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
1728 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c inspstring.cpp
1729 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDstring.so inspstring.o
1731 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
1732 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c dns.cpp
1733 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDasyncdns.so dns.o
1735 libIRCDbase.so: base.cpp ../include/base.h ../include/globals.h ../include/inspircd_config.h
1736 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c base.cpp
1737 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDbase.so base.o
1739 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
1740 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c configreader.cpp
1741 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDconfigreader.so configreader.o
1743 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
1744 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c commands.cpp
1745 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDcommands.so commands.o
1747 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
1748 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c dynamic.cpp
1749 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDdynamic.so dynamic.o
1751 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
1752 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c users.cpp
1753 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDusers.so users.o
1755 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
1756 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c modules.cpp
1757 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDmodules.so modules.o
1759 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
1760 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c wildcard.cpp
1761 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDwildcard.so wildcard.o
1763 libIRCDsocket.so: socket.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h
1764 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c socket.cpp
1765 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDsocket.so socket.o
1767 libIRCDinspsocket.so: inspsocket.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h ../include/timer.h
1768 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c inspsocket.cpp
1769 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDinspsocket.so inspsocket.o
1771 libIRCDtimer.so: timer.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h ../include/timer.h
1772 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c timer.cpp
1773 \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDtimer.so timer.o
1777 foreach my $cmd (@cmdlist) {
1779 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
1780 \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c cmd_$cmd.cpp
1781 \$(CC) -pipe $SHARED -o cmd_$cmd.so cmd_$cmd.o