]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - configure
Re-added required parts of connection.h
[user/henk/code/inspircd.git] / configure
1 #!/usr/bin/perl
2 # InspIRCd Configuration Script
3 #
4 # Copyright 2003 The ChatSpike Development Team
5 # <brain@chatspike.net>
6 # <Craig@chatspike.net>
7 #
8 # [14:21] Brain: <matrix impression> i know perl-fu!
9 #
10 # $Id$
11 #
12 ########################################
13
14 chomp($topdir = `pwd`);
15 $this = resolve_directory($topdir);                                             # PWD, Regardless.
16 @modlist = ();                                                                  # Declare for Module List..
17 %config = ();                                                                   # Initiate Configuration Hash..
18 $config{ME}                 = resolve_directory($topdir);                       # Present Working Directory
19 $config{CONFIG_DIR}         = resolve_directory($config{ME}."/conf");           # Configuration Directory
20 $config{MODULE_DIR}         = resolve_directory($config{ME}."/modules");        # Modules Directory
21 $config{BINARY_DIR}         = resolve_directory($config{ME}."/bin");            # Binary Directory
22 $config{LIBRARY_DIR}        = resolve_directory($config{ME}."/lib");            # Library Directory
23 $config{OPTIMITEMP}         = "0";                                              # Default Optimisation Value
24 $config{OPTIMISATI}         = "-g";                                             # Optimisation Flag
25 $config{NICK_LENGT}         = "31";                                             # Default Nick Length
26 $config{CHAN_LENGT}         = "64";                                             # Default Channel Name Length
27 $config{MAX_CHANNE}         = "20";                                             # Default Max. Channels per user..
28 $config{MAXI_MODES}         = "20";                                             # Default Max. Number of Modes set at once.
29 $config{HAS_STRLCPY}        = "false";                                          # strlcpy Check.
30 $config{USE_KQUEUE}         = "y";                                              # kqueue enabled
31 $config{USE_EPOLL}          = "y";                                              # epoll enabled
32 $config{STATIC_LINK}        = "no";                                             # are doing static modules?
33 chomp($config{MAX_CLIENT_T} = `sh -c \"ulimit -n\"`);                           # FD Limit
34 chomp($config{GCCVER}       = `gcc -dumpversion | cut -c 1`);                   # Major GCC Version
35 chomp($config{GCC34}        = `gcc -dumpversion | cut -c 3`);                   # Minor GCC Version
36 chomp($config{OSNAME}       = `/bin/uname`);                                    # Operating System Name
37 $config{CC}                 = "g++";                                            # C++ compiler
38 $config{MAKEORDER}          = "ircd mods config bininst";                       # build order
39 $config{STATICLIBS}         = "";                                               # library archive path
40 $config{MAX_IDENT}          = "12";                                             # max ident size
41 $config{MAX_QUIT}           = "255";                                            # max quit message size
42 $config{MAX_TOPIC}          = "307";                                            # max topic size
43 $config{MAX_KICK}           = "255";                                            # max kick message size
44 $config{MAX_GECOS}          = "128";                                            # max GECOS size
45 $config{MAX_AWAY}           = "200";                                            # max AWAY size
46
47 if ((!$config{OSNAME}) || ($config{OSNAME} eq "")) {
48   chomp($config{OSNAME} = `/usr/bin/uname`);
49   if ((!$config{OSNAME}) || ($config{OSNAME} eq "")){
50         $config{OSNAME} = "Unknown";
51   }
52 }
53
54 if (!$config{MAX_CLIENT_T}) { 
55   $config{MAX_CLIENT_T} = 1024;                                 # Set a reasonable 'Default'
56   $fd_scan_fail = "true";                                       # Used Later
57 }
58
59 # Get and Set some important vars..
60 getmodules();
61
62 my $arg = $ARGV[0];                                             # Do Some Argument Checks..
63 if ($arg eq "-clean") { `rm -rf .config.cache`; }               # Remove the config.cache file.
64
65 if ($arg eq "-update") {
66   # Does the cache file exist?
67   if (!getcache()) {
68     # No, No it doesn't.. *BASH*
69     print "You have not run ./configure before. Please do this before trying to run the update script.\n";
70     exit 0;
71   } else {
72     # We've Loaded the cache file and all our variables..
73     print "Updating Files..\n";
74     getosflags();
75     $has_epoll = $config{HAS_EPOLL};
76     $has_kqueue = $config{HAS_KQUEUE};
77     writefiles();
78     print "Complete.\n";
79     exit;
80   }
81 }
82
83 print "Checking for cache from previous configure...\n";
84 getcache();
85 print "Checking operating system version...\n";
86 getosflags();
87
88 if (!$config{MAX_CLIENT}) { 
89   # If the cache hasn't set the max clients, copy the variable of MAX_CLIENT_T, this
90   # allows us to keep _T for testing purposes. (ie. "Are you sure you want to go
91   # higher than the found value" :))
92   $config{MAX_CLIENT} = $config{MAX_CLIENT_T};
93 }
94
95 printf "Checking if strlcpy exists... ";
96 # Perform the strlcpy() test..
97 $config{HAS_STRLCPY} = "false";
98 my $fail = 0;
99 open(STRLCPY, "</usr/include/string.h") or $fail = 1;
100 if (!$fail)
101 {
102         while (chomp($line = <STRLCPY>))
103         {
104                 # try and find the delcaration of:
105                 # size_t strlcpy(...)
106                 if ($line =~ /size_t(\0x9|\s)+strlcpy/)
107                 {
108                         $config{HAS_STRLCPY} = "true";
109                 }
110         }
111         close(STRLCPY);
112 }
113 print "yes\n" if $config{HAS_STRLCPY} eq "true";
114 print "no\n" if $config{HAS_STRLCPY} eq "false";
115
116 printf "Checking if kqueue exists... ";
117 $has_kqueue = 0;
118 $fail = 0;
119 open(KQUEUE, "</usr/include/sys/event.h") or $fail = 1;
120 if (!$fail)
121 {
122         while (chomp($line = <KQUEUE>))
123         {
124                 # try and find the delcaration of:
125                 # int kqueue(void);
126                 if ($line =~ /int(\0x9|\s)+kqueue/)
127                 {
128                         $has_kqueue = 1;
129                 }
130         }
131         close(KQUEUE);
132 }
133 print "yes\n" if $has_kqueue == 1;
134 print "no\n" if $has_kqueue == 0;
135
136 printf "Checking if epoll exists... ";
137 $has_epoll = 0;
138 $fail = 0;
139 open(EPOLL, "</usr/include/sys/epoll.h") or $fail = 1;
140 if (!$fail)
141 {
142         while (chomp($line = <EPOLL>))
143         {
144                 # try and find the declaration of:
145                 # extern int epoll_create (int __size) __THROW;
146                 if (($line =~ /int(\0x9|\s)+epoll_create(\0x9|\s)+\(/) || ($line =~ /int(\0x9|\s)+epoll_create\(/))
147                 {
148                         $has_epoll = 1;
149                 }
150         }
151         close(EPOLL);
152 }
153 if ($has_epoll) {
154         my $kernel = `uname -r`;
155         chomp($kernel);
156         if (($kernel =~ /2\.0/) || ($kernel =~ /2\.2/) || ($kernel =~ /2\.4/)) {
157                 $has_epoll = 0;
158         }
159 }
160 print "yes\n" if $has_epoll == 1;
161 print "no\n" if $has_epoll == 0;
162
163 if ($config{OSNAME} =~ /CYGWIN/) {
164         $config{HAS_STRLCPY} = "true";
165 }
166
167 $config{HAS_EPOLL} = $has_epoll;
168 $config{HAS_KQUEUE} = $has_kqueue; 
169
170 ################################################################################
171 #                          BEGIN INTERACTIVE PART                              #
172 ################################################################################
173
174 # Clear the Screen..
175 system("clear");
176 # Display Splash Logo..
177 show_splash();
178 chomp($wholeos = `uname -mnr`);
179
180 # Display Introduction Message..
181 print "
182 Welcome to the InspIRCd Configuration program!
183
184 *** If you are unsure of any of these values, leave it blank for    ***
185 *** standard settings that will work, and your server will run      ***
186 *** using them. If you are running this server as part of a         ***
187 *** larger network, you must consult with your network admins       ***
188 *** for the proper values to use, or server links will be unstable! ***
189
190 Press \033[1m<RETURN>\033[0m to accept the default for any option, or enter
191 a new value. Please note: You will \033[1mHAVE\033[0m to read the docs
192 dir, otherwise you won't have a config file!
193
194 Your operating system is: \033[1;32m$config{OSNAME}\033[0m ($wholeos), fdmax: $config{MAX_CLIENT_T}\n\n";
195
196 $config{CHANGE_COMPILER} = "n";
197 print "I have detected the following compiler: \033[1;32m$config{CC}\033[0m (version \033[1;32m$config{GCCVER}.$config{GCC34}\033[0m)\n";
198
199 if ($config{GCCVER} < 3)
200 {
201         print "\033[1;32mIMPORTANT!\033[0m A GCC 2.x compiler has been detected, and
202 should NOT be used. You should probably specify a newer compiler.\n";
203 }
204 yesno(CHANGE_COMPILER,"Do you want to change the compiler?");
205 if ($config{CHANGE_COMPILER} =~ /y/i)
206 {
207     print "What command do you want to use to invoke your compiler?\n";
208     print "[\033[1;32m$config{CC}\033[0m] -> ";
209     chomp($config{CC} = <STDIN>);
210     if ($config{CC} eq "") { $config{CC} = "g++"; }
211     chomp($foo = `$config{CC} -dumpversion | cut -c 1`);
212     if ($foo ne "") {
213             chomp($config{GCCVER}       = `$config{CC} -dumpversion | cut -c 1`); # we must redo these if we change
214             chomp($config{GCC34}        = `$config{CC} -dumpversion | cut -c 3`); # the compiler path
215             print "Queried compiler: \033[1;32m$config{CC}\033[0m (version \033[1;32m$config{GCCVER}.$config{GCC34}\033[0m)\n";
216     }
217     else
218     {
219             print "\033[1;32mWARNING!\033[0m Could not execute the compiler you specified. You may want to try again.\n";
220     }
221 }
222
223 print "\n";
224
225 # Directory Settings..
226 dir_check("are the configuration files", "CONFIG_DIR");
227 dir_check("are the modules to be compiled to", "MODULE_DIR");
228 dir_check("is the IRCd binary to be placed", "BINARY_DIR");
229 dir_check("are the IRCd libraries to be placed", "LIBRARY_DIR");
230
231 if ($has_kqueue) {
232         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?");
233         print "\n";
234 }
235 if ($has_epoll) {
236         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?");
237         print "\n";
238 }
239 $chose_hiperf = (($config{USE_EPOLL} eq "y") || ($config{USE_KQUEUE} eq "y"));
240 if (!$chose_hiperf)
241 {
242         print "No high-performance socket engines are available, or you chose\n";
243         print "not to enable one. Defaulting to select() engine.\n\n";
244 }
245
246 print "\nThe following questions will ask you for various figures relating\n";
247 print "To your IRCd install. Please note that these should usually be left\n";
248 print "as defaults unless you have a real reason to change them. If they\n";
249 print "changed, then the values must be identical on all servers on your\n";
250 print "network, or malfunctions and/or crashes may occur, with the exception\n";
251 print "of the 'maximum number of clients' setting which may be different on\n";
252 print "different servers on the network.\n\n";
253
254 # File Descriptor Settings..
255 my $continue = 0;
256 while (!$continue) {
257   print "Maximum number of clients at any one time ($config{MAX_CLIENT_T})\n";
258   print "[\033[1;32m$config{MAX_CLIENT}\033[0m] -> ";
259   chomp($var = <STDIN>);
260   if ($var eq "") { $var = $config{MAX_CLIENT}; }
261   if ($var =~ /^\d+$/) {
262     if (($var > $config{MAX_CLIENT_T}) && ($fd_scan_failed ne true)) {
263       # Client has entered a larger number than the 'discovered' value
264       # Confirm.
265       print "WARNING: Our scans have indicated that you are attempting
266 to use more sockets than there are avaliable. Are you sure
267 you wish to do this? It may cause the IRCd to malfunction [y/n]
268 [\033[1;32mn\033[0m] -> $c";
269       chomp($tmp = <STDIN>);
270       if ($tmp ne "y") {
271         print "Please enter the correct value.\n\n";
272         next;
273       }
274     }
275   } else {
276     print "You must enter a number in this field. Please try again.\n\n";
277     next;
278   }
279   # If we get here, we should be good to go.
280   $config{MAX_CLIENT} = $var;
281   $continue = 1;
282   print "\n";
283 }
284
285 my $continue = 0;
286 while (!$continue) {
287   print "What is the maximum length of nicknames?\n";
288   print "[\033[1;32m$config{NICK_LENGT}\033[0m] -> ";
289   chomp($var = <STDIN>);
290   if ($var eq "") { $var = $config{NICK_LENGT}; }
291   if ($var =~ /^\d+$/) {
292     # We don't care what the number is, set it and be on our way.
293     $config{NICK_LENGT} = $var;
294     $continue = 1;
295     print "\n";
296   } else {
297     print "You must enter a number in this field. Please try again.\n\n";
298   }
299 }
300
301 $continue = 0;
302 while (!$continue) {
303   print "What is the maximum length of channel names?\n";
304   print "[\033[1;32m$config{CHAN_LENGT}\033[0m] -> ";
305   chomp($var = <STDIN>);
306   if ($var eq "") { $var = $config{CHAN_LENGT}; }
307   if ($var =~ /^\d+$/) {
308     # We don't care what the number is, set it and be on our way.
309     $config{CHAN_LENGT} = $var;
310     $continue = 1;
311     print "\n";
312   } else {
313     print "You must enter a number in this field. Please try again.\n\n";
314   }
315 }
316
317 $continue = 0;
318 while (!$continue) {
319   print "What is the maximum number of channels a user may join at any one time?\n";
320   print "[\033[1;32m$config{MAX_CHANNE}\033[0m] -> ";
321   chomp($var = <STDIN>);
322   if ($var eq "") { $var = $config{MAX_CHANNE}; }
323   if ($var =~ /^\d+$/) {
324     # We don't care what the number is, set it and be on our way.
325     $config{MAX_CHANNE} = $var;
326     $continue = 1;
327     print "\n";
328   } else {
329     print "You must enter a number in this field. Please try again.\n\n";
330   }
331 }
332
333 $continue = 0;
334 while (!$continue) {
335   print "What is the maximum number of mode changes in one line?\n";
336   print "[\033[1;32m$config{MAXI_MODES}\033[0m] -> ";
337   chomp($var = <STDIN>);
338   if ($var eq "") { $var = $config{MAXI_MODES}; }
339   if ($var =~ /^\d+$/) {
340     # We don't care what the number is, set it and be on our way.
341     $config{MAXI_MODES} = $var;
342     $continue = 1;
343     print "\n";
344   } else {
345     print "You must enter a number in this field. Please try again.\n\n";
346   }
347 }
348
349 $continue = 0;
350 while (!$continue) {
351   print "What is the maximum length of an ident (username)?\n";
352   print "[\033[1;32m$config{MAX_IDENT}\033[0m] -> ";
353   chomp($var = <STDIN>);
354   if ($var eq "") { $var = $config{MAX_IDENT}; }
355   if ($var =~ /^\d+$/) {
356     # We don't care what the number is, set it and be on our way.
357     $config{MAX_IDENT} = $var;
358     $continue = 1;
359     print "\n";
360   } else {
361     print "You must enter a number in this field. Please try again.\n\n";
362   }
363 }
364
365 $continue = 0;
366 while (!$continue) {
367   print "What is the maximum length of a quit message?\n";
368   print "[\033[1;32m$config{MAX_QUIT}\033[0m] -> ";
369   chomp($var = <STDIN>);
370   if ($var eq "") { $var = $config{MAX_QUIT}; }
371   if ($var =~ /^\d+$/) {
372     # We don't care what the number is, set it and be on our way.
373     $config{MAX_QUIT} = $var;
374     $continue = 1;
375     print "\n";
376   } else {
377     print "You must enter a number in this field. Please try again.\n\n";
378   }
379 }
380
381 $continue = 0;
382 while (!$continue) {
383   print "What is the maximum length of a channel topic?\n";
384   print "[\033[1;32m$config{MAX_TOPIC}\033[0m] -> ";
385   chomp($var = <STDIN>);
386   if ($var eq "") { $var = $config{MAX_TOPIC}; }
387   if ($var =~ /^\d+$/) {
388     # We don't care what the number is, set it and be on our way.
389     $config{MAX_TOPIC} = $var;
390     $continue = 1;
391     print "\n";
392   } else {
393     print "You must enter a number in this field. Please try again.\n\n";
394   }
395 }
396
397 $continue = 0;
398 while (!$continue) {
399   print "What is the maximum length of a kick message?\n";
400   print "[\033[1;32m$config{MAX_KICK}\033[0m] -> ";
401   chomp($var = <STDIN>);
402   if ($var eq "") { $var = $config{MAX_KICK}; }
403   if ($var =~ /^\d+$/) {
404     # We don't care what the number is, set it and be on our way.
405     $config{MAX_KICK} = $var;
406     $continue = 1;
407     print "\n";
408   } else {
409     print "You must enter a number in this field. Please try again.\n\n";
410   }
411 }
412
413 $continue = 0;
414 while (!$continue) {
415   print "What is the maximum length of a GECOS (real name) field?\n";
416   print "[\033[1;32m$config{MAX_GECOS}\033[0m] -> ";
417   chomp($var = <STDIN>);
418   if ($var eq "") { $var = $config{MAX_GECOS}; }
419   if ($var =~ /^\d+$/) {
420     # We don't care what the number is, set it and be on our way.
421     $config{MAX_GECOS} = $var;
422     $continue = 1;
423     print "\n";
424   } else {
425     print "You must enter a number in this field. Please try again.\n\n";
426   }
427 }
428
429 $continue = 0;
430 while (!$continue) {
431   print "What is the maximum length of an away message?\n";
432   print "[\033[1;32m$config{MAX_AWAY}\033[0m] -> ";
433   chomp($var = <STDIN>);
434   if ($var eq "") { $var = $config{MAX_AWAY}; }
435   if ($var =~ /^\d+$/) {
436     # We don't care what the number is, set it and be on our way.
437     $config{MAX_AWAY} = $var;
438     $continue = 1;
439     print "\n";
440   } else {
441     print "You must enter a number in this field. Please try again.\n\n";
442   }
443 }
444
445 # Code Optimisation
446 print "Enter the Level Of Binary optimisation. This is a number between 0 and 3.
447 The InspIRCd Team will NOT support any bug reports above 0. Also note,
448 the IRCd behaviour will be different depending on this value. Please
449 read the documentation for more information.
450
451 The higher the number, the more optimised your binary will be. This
452 value will default to 0 if you either don't enter a number, or enter
453 a value outside the range.
454
455 As always, if you are unsure, just press enter and accept the default.\n\n";
456 print "[\033[1;32m$config{OPTIMITEMP}\033[0m] -> ";
457 chomp($var = <STDIN>);
458 if ($var eq "") {
459   $var = $config{OPTIMITEMP};
460 }
461
462 if ($var eq "1") {
463   $config{OPTIMITEMP} = 1;
464   $config{OPTIMISATI} = "-O";
465 } elsif ($var eq "2") {
466   $config{OPTIMITEMP} = 2;
467   $config{OPTIMISATI} = "-O2";
468 } elsif ($var eq "3") {
469   $config{OPTIMITEMP} = 3;
470   $config{OPTIMISATI} = "-O3";
471 } else {
472   $config{OPTIMITEMP} = 0;
473   $config{OPTIMISATI} = "-g";
474 }
475
476 print "\n\033[1;32mPre-build configuration is complete!\033[0m\n\n";
477 print "\033[0mConfig path:\033[1;32m\t\t\t$config{CONFIG_DIR}\n";
478 print "\033[0mModule path:\033[1;32m\t\t\t$config{MODULE_DIR}\n";
479 print "\033[0mMax connections:\033[1;32m\t\t$config{MAX_CLIENT}\n";
480 print "\033[0mMax User Channels:\033[1;32m\t\t$config{MAX_CHANNE}\n";
481 print "\033[0mMax nickname length:\033[1;32m\t\t$config{NICK_LENGT}\n";
482 print "\033[0mMax channel length:\033[1;32m\t\t$config{CHAN_LENGT}\n";
483 print "\033[0mMax mode length:\033[1;32m\t\t$config{MAXI_MODES}\n";
484 print "\033[0mMax ident length:\033[1;32m\t\t$config{MAX_IDENT}\n";
485 print "\033[0mMax quit length:\033[1;32m\t\t$config{MAX_QUIT}\n";
486 print "\033[0mMax topic length:\033[1;32m\t\t$config{MAX_TOPIC}\n";
487 print "\033[0mMax kick length:\033[1;32m\t\t$config{MAX_KICK}\n";
488 print "\033[0mMax name length:\033[1;32m\t\t$config{MAX_GECOS}\n";
489 print "\033[0mMax away length:\033[1;32m\t\t$config{MAX_AWAY}\n";
490 print "\033[0mGCC Version Found:\033[1;32m\t\t$config{GCCVER}.$config{GCC34}\n";
491 print "\033[0mOptimatizaton Flag:\033[1;32m\t\t$config{OPTIMISATI}\033[0m\n";
492 print "\033[0mCompiler program:\033[1;32m\t\t$config{CC}\033[0m\n";
493 print "\033[0mStatic modules:\033[1;32m\t\t\t$config{STATIC_LINK}\033[0m\n\n";
494
495 makecache();
496 writefiles();
497
498 print "\n\n";
499 print "To build your server with these settings, please type '\033[1;32m$config{MAKEPROG}\033[0m' now.\n";
500 print "*** \033[1;32mRemember to edit your configuration files!!!\033[0m ***\n\n\n";
501 if (($config{OSNAME} eq "OpenBSD") && ($config{CC} ne "eg++")) {
502         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";
503 }
504 if ($config{OSNAME} =~ /CYGWIN/) {
505         print <<FOO;
506 \033[1;32mWARNING!\033[0m CYGWIN does not properly support shared modules,
507 so modules will be compiled statically into the core of the ircd. The modules
508 will act like they are being loaded from disk and being unloaded from RAM,
509 however they are in fact being enabled and disabled similar to features in
510 other ircds.
511 FOO
512 }
513
514 if ($config{GCCVER} < "3") {
515         print <<FOO2;
516 \033[1;32mWARNING!\033[0m You are attempting to compile InspIRCd on GCC 2.x!
517 GCC 2.x series compilers only had partial (read as broken) C++ support, and
518 your compile will most likely fail horribly! If you have any problems, do NOT
519 report them to the bugtracker or forums without first upgrading your compiler
520 to a newer 3.x or 4.x (or whatever is available currently) version.
521 FOO2
522 }
523
524 ################################################################################
525 #                              HELPER FUNCTIONS                                #
526 ################################################################################
527 sub getcache {
528   # Retrieves the .config.cache file, and loads values into the main config hash.
529   open(CACHE, ".config.cache") or return undef;
530   while (<CACHE>) {
531     chomp;
532
533     # Ignore Blank lines, and comments..
534     next if /^\s*$/;
535     next if /^\s*#/;
536
537     my ($key, $value) = split("=", $_);
538     $value =~ /^\"(.*)\"$/;
539     # Do something with data here!
540     $config{$key} = $1;
541   }
542   close(CONFIG);
543   return "true";
544 }
545
546 sub makecache {
547   # Dump the contents of %config
548   print "Writing \033[1;32mcache file\033[0m for future ./configures ...\n";
549   open(FILEHANDLE, ">.config.cache");
550   foreach $key (keys %config)
551   {
552     print FILEHANDLE "$key=\"$config{$key}\"\n";
553   }
554   close(FILEHANDLE);
555 }
556
557 sub dir_check {
558   my ($desc, $hash_key) = @_;
559   my $complete = 0;
560   while (!$complete) {
561     print "In what directory $desc?\n";
562     print "[\033[1;32m$config{$hash_key}\033[0m] -> ";
563     chomp($var = <STDIN>);
564     if ($var eq "") { $var = $config{$hash_key}; }
565     if ($var =~ /^\~\/(.+)$/) {
566         # Convert it to a full path..
567         $var = resolve_directory($ENV{HOME} . "/" . $1);
568     }
569     if (substr($var,0,1) ne "/")
570     {
571         # Assume relative Path was given.. fill in the rest.
572         $var = $this . "/$var";
573     }
574     $var = resolve_directory($var); 
575     if (! -e $var) {
576       print "$var does not exist. Create it?\n[\033[1;32my\033[0m] ";
577       chomp($tmp = <STDIN>);
578       if (($tmp eq "") || ($tmp =~ /^y/i)) {
579         # Attempt to Create the Dir..
580         $chk = system("mkdir -p \"$var\" >> /dev/null 2>&1") / 256;
581         if ($chk != 0) {
582           print "Unable to create directory. ($var)\n\n";
583           # Restart Loop..
584           next;
585         }
586       } else {
587         # They said they don't want to create, and we can't install there.
588         print "\n\n";
589         next;
590       }
591     } else {
592       if (!is_dir($var)) {
593         # Target exists, but is not a directory.
594         print "File $var exists, but is not a directory.\n\n";
595         next;
596       }
597     }
598     # Either Dir Exists, or was created fine.
599     $config{$hash_key} = $var;
600     $complete = 1;
601     print "\n";
602   }
603 }
604
605 sub getosflags {
606   if ($config{OSNAME} =~ /BSD$/) {
607     $config{LDLIBS} = "-Ldl";
608     $config{FLAGS}  = "-fPIC -frtti $OPTIMISATI -Wall -Woverloaded-virtual $config{OPTIMISATI}";
609     $config{MAKEPROG} = "gmake";
610     if ($config{OSNAME} eq "OpenBSD") {
611         chomp($foo = `eg++ -dumpversion | cut -c 1`);
612         # theyre running the package version of gcc (eg++)... detect it and set up its version numbers.
613         # if theyre not running this, configure lets the build continue but they probably wont manage to
614         # compile as this standard version is 2.95.3!
615         if ($foo ne "") {
616                 $config{CC} = "eg++";
617                 chomp($config{GCCVER}       = `eg++ -dumpversion | cut -c 1`); # we must redo these if we change
618                 chomp($config{GCC34}        = `eg++ -dumpversion | cut -c 3`); # the compiler path
619         }
620     }
621   } else {
622     $config{LDLIBS} = "-ldl";
623     $config{FLAGS}  = "-fPIC -frtti $OPTIMISATI -Wall -Woverloaded-virtual $config{OPTIMISATI}";
624     $config{MAKEPROG} = "make";
625     if ($config{OSNAME} =~ /CYGWIN/) {
626        $config{FLAGS}  = "-frtti $OPTIMISATI -Wall -Woverloaded-virtual $config{OPTIMISATI}";
627        $config{LDLIBS} = "";
628        $config{MAKEPROG} = "/usr/bin/make";
629        $config{MAKEORDER} = "mods ircd config bininst";
630        $config{STATICLIBS} = "modules/mods.a";
631        $config{STATIC_LINK} = "yes";
632     }
633   }
634   if ($config{OSNAME} =~ /SunOS/) {
635     # solaris/sunos needs these
636     # socket = bsd sockets api
637     # nsl = dns stuff
638     # rt = POSIX realtime extensions
639     # resolv = inet_aton only (why isnt this in nsl?!)
640     $config{LDLIBS} = $config{LDLIBS} . " -lsocket -lnsl -lrt -lresolv";
641   }
642 }
643
644 sub is_dir {
645   my ($path) = @_;
646   if (chdir($path)) {
647     chdir($this);
648     return 1;
649   } else {
650     # Just in case..
651     chdir($this);
652     return 0;
653   }
654 }
655
656 sub getmodules {
657   my $i = 0;
658   opendir(DIRHANDLE, "src/modules");
659   foreach $name (sort readdir(DIRHANDLE)) {
660     if ($name =~ /^m_(.+)\.cpp$/)
661     {
662       $mod = $1;
663       if ($mod !~ /_static$/) {
664               $modlist[$i++] = $mod;
665       }
666     }
667   }
668   closedir(DIRHANDLE);
669 }
670
671 sub writefiles {
672
673   print "Writing \033[1;32minspircd_config.h\033[0m\n";
674   # First File.. inspircd_config.h
675   chomp(my $incos = `uname -n -s -r`);
676   chomp(my $version = `sh ./src/version.sh`);
677   open(FILEHANDLE, ">include/inspircd_config.h");
678   my $NL = $config{NICK_LENGT}+1;
679   my $CL = $config{CHAN_LENGT}+1;
680   print FILEHANDLE <<EOF;
681 /* Auto generated by configure, do not modify! */
682 #ifndef __CONFIGURATION_AUTO__
683 #define __CONFIGURATION_AUTO__
684
685 #define CONFIG_FILE "$config{CONFIG_DIR}/inspircd.conf"
686 #define MOD_PATH "$config{MODULE_DIR}"
687 #define VERSION "$version"
688 #define MAXCLIENTS $config{MAX_CLIENT}
689 #define NICKMAX $NL
690 #define CHANMAX $CL
691 #define MAXCHANS $config{MAX_CHANNE}
692 #define MAXMODES $config{MAXI_MODES}
693 #define IDENTMAX $config{MAX_IDENT}
694 #define MAXQUIT $config{MAX_QUIT}
695 #define MAXTOPIC $config{MAX_TOPIC}
696 #define MAXKICK $config{MAX_KICK}
697 #define MAXGECOS $config{MAX_GECOS}
698 #define MAXAWAY $config{MAX_AWAY}
699 #define OPTIMISATION $config{OPTIMITEMP}
700 #define SYSTEM "$incos"
701 #define MAXBUF 514
702 EOF
703
704   if ($config{OSNAME} =~ /SunOS/) {
705     print FILEHANDLE "#define IS_SOLARIS\n";
706   }
707   if ($config{OSNAME} =~ /CYGWIN/) {
708     print FILEHANDLE "#define IS_CYGWIN\n";
709     print FILEHANDLE "#ifndef FD_SETSIZE\n#define FD_SETSIZE    1024\n#endif\n";
710   }
711   if ($config{STATIC_LINK} eq "yes") {
712     print FILEHANDLE "#define STATIC_LINK\n";
713   }
714   if ($config{GCCVER} > 3) {
715     print FILEHANDLE "#define GCC3\n";
716     print FILEHANDLE "#define GCC34\n";
717   }
718   else
719   {
720     if ($config{GCCVER} == 3) {
721       print FILEHANDLE "#define GCC3\n";
722       if ($config{GCC34} > 3) {
723         print FILEHANDLE "#define GCC34\n";
724       }
725     }
726   }
727   if ($config{HAS_STRLCPY} eq "true") {
728     print FILEHANDLE "#define HAS_STRLCPY\n";
729   }
730   my $use_hiperf = 0;
731   if (($has_kqueue) && ($config{USE_KQUEUE} eq "y")) {
732     print FILEHANDLE "#define USE_KQUEUE\n";
733     $use_hiperf = 1;
734   }
735   if (($has_epoll) && ($config{USE_EPOLL} eq "y")) {
736     print FILEHANDLE "#define USE_EPOLL\n";
737     $use_hiperf = 1;
738   }
739   # user didn't choose either epoll or select for their OS.
740   # default them to USE_SELECT (ewwy puke puke)
741   if (!$use_hiperf) {
742     print FILEHANDLE "#define USE_SELECT\n";
743   }
744   print FILEHANDLE "\n#endif\n";
745   close(FILEHANDLE);
746
747   # Create a Modules List..
748   my $modules = "";
749   foreach $i (@modlist)
750   {
751     if ($config{OSNAME} =~ /CYGWIN/) {
752         $modules .= "m_".$i.".o ";
753     }
754     else {
755         $modules .= "m_".$i.".so ";
756     }
757   }
758   chomp($modules);   # Remove Redundant whitespace..
759
760
761   # Write all .in files.
762   my $tmp = "";
763   my $file = "";
764   my $exe = "inspircd";
765
766   if ($config{OSNAME} =~ /CYGWIN/) {
767     $exe = "inspircd.exe";
768   }
769
770   opendir(DIRHANDLE, $this);
771   foreach $name (sort readdir(DIRHANDLE)) {
772     if ($name =~ /^\.(.+)\.inc$/)
773     {
774       $file = $1;
775       # All .name.inc files need parsing!
776       $tmp = "";
777       open(FILEHANDLE, ".$file.inc");
778       while (<FILEHANDLE>) {
779         $tmp .= $_;
780       }
781       close(FILEHANDLE);
782
783       $tmp =~ s/\@CC\@/$config{CC}/;
784       $tmp =~ s/\@MAKEPROG\@/$config{MAKEPROG}/;
785       $tmp =~ s/\@FLAGS\@/$config{FLAGS}/;
786       $tmp =~ s/\@LDLIBS\@/$config{LDLIBS}/;
787       $tmp =~ s/\@CONFIG_DIR\@/$config{CONFIG_DIR}/;
788       $tmp =~ s/\@MODULE_DIR\@/$config{MODULE_DIR}/;
789       $tmp =~ s/\@BINARY_DIR\@/$config{BINARY_DIR}/;
790       $tmp =~ s/\@LIBRARY_DIR\@/$config{LIBRARY_DIR}/;
791       $tmp =~ s/\@MODULES\@/$modules/;
792       $tmp =~ s/\@EXECUTABLE\@/$exe/;
793       $tmp =~ s/\@MAKEORDER\@/$config{MAKEORDER}/;
794       $tmp =~ s/\@STATICLIBS\@/$config{STATICLIBS}/;
795
796       print "Writing \033[1;32m$file\033[0m\n";
797       open(FILEHANDLE, ">$file");
798       print FILEHANDLE $tmp;
799     }
800   }
801   closedir(DIRHANDLE);
802
803   # Make inspircd executable!
804   chmod 0744, 'inspircd';
805
806   if ($config{OSNAME} =~ /CYGWIN/) {
807         print "Writing static-build \033[1;32msrc/Makefile\033[0m\n";
808         write_static_makefile();
809   }
810   else {
811         print "Writing dynamic-build \033[1;32msrc/Makefile\033[0m\n";
812         write_dynamic_makefile();
813   }
814
815
816   # Modules Makefile..
817   print "Writing \033[1;32msrc/modules/Makefile\033[0m\n";
818   open(FILEHANDLE, ">src/modules/Makefile");
819   print FILEHANDLE <<EOF;
820 # (C) ChatSpike development team
821 # Makefile by <Craig\@ChatSpike.net>
822 # Many Thanks to Andrew Church <achurch\@achurch.org>
823 #    for assisting with making this work right.
824 #
825 # Automatically Generated by ./configure to add a modules
826 # please run ./configure --update
827
828 all: \$(MODULES)
829
830 EOF
831
832   # Create a Modules List..
833   my $modules = "";
834   my $flags = "";
835   if ($config{OSNAME} =~ /CYGWIN/) {
836      open(MODLIST,">include/modlist.h");
837      print MODLIST <<HEADER;
838 // Generated automatically by configure. DO NOT EDIT!
839
840 #ifndef __SYMBOLS__H_CONFIGURED__
841 #define __SYMBOLS__H_CONFIGURED__
842
843 HEADER
844      foreach $i (@modlist) {
845         if ($i !~ /_static$/) {
846                 print MODLIST "extern \"C\" void * $i\_init (void);\n";
847         }
848      }
849      print MODLIST "\nstruct {const char *name; initfunc *value; } modsyms[] = {\n";
850   }
851   foreach $i (@modlist)
852   {
853     if ($i !~ /_static$/) {
854      $flags = getcompilerflags("src/modules/m_".$i.".cpp");
855      if ($config{OSNAME} =~ /CYGWIN/) {
856         print FILEHANDLE <<EOCHEESE;
857 m_$i.o: m_$i\_static.cpp ../../include/modules.h ../../include/users.h ../../include/channels.h ../../include/base.h
858         \$(CC) -pipe -I../../include \$(FLAGS) $flags -export-dynamic -c m_$i\_static.cpp
859         mv m_$i\_static.o ../m_$i.o
860
861 EOCHEESE
862         print "Configuring module [\033[1;32mm_$i.so\033[0m] for static linking... ";
863         open(MODULE,"<src/modules/m_".$i.".cpp") or die("Could not open m_".$i.".cpp");
864         open(MUNGED,">src/modules/m_".$i."_static.cpp") or die("Could not create m_".$i."_static.cpp");
865         while (chomp($a = <MODULE>)) { 
866                 $a =~ s/init_module/$i\_init/g;
867                 $a =~ s/Srv/$i\Srv/g;
868                 print MUNGED "$a\n";
869         }
870         close(MODULE);
871         close(MUNGED);
872         print MODLIST <<EOENT;
873 {"m_$i.so",\&$i\_init},
874 EOENT
875         print "done\n";
876      }
877      else {
878          print FILEHANDLE <<EOCHEESE;
879 m_$i.so: m_$i.cpp ../../include/modules.h ../../include/users.h ../../include/channels.h ../../include/base.h
880         \$(CC) -pipe -I../../include \$(FLAGS) $flags -export-dynamic -c m_$i.cpp
881         \$(CC) \$(FLAGS) -shared $flags -o m_$i.so m_$i.o
882         @-rm -f \$(MODPATH)/m_$i.so
883         cp m_$i.so \$(MODPATH)/
884         chmod 0700 \$(MODPATH)/m_$i.so
885
886 EOCHEESE
887       }
888    }
889   }
890   if ($config{OSNAME} =~ /CYGWIN/) {
891      print MODLIST "{0}};\n\n#endif\n";
892      close(MODLIST);
893   }
894 }
895
896 sub getcompilerflags {
897   my ($file) = @_;
898   open(FLAGS, $file);
899   while (<FLAGS>) {
900     if ($_ =~ /^\/\* \$CompileFlags: (.+) \*\/$/) {
901       close(FLAGS);
902       return $1;
903     }
904   }
905   close(FLAGS);
906   return undef;
907 }
908
909 sub show_splash {
910   print "'\033[1;33m####\033[0m:'\033[1;33m##\033[0m::: \033[1;33m##\033[0m::'\033[1;33m######\033[0m::'\033[1;33m########\033[0m::'\033[1;33m####\033[0m:'\033[1;33m########\033[0m:::'\033[1;33m######\033[0m::'\033[1;33m########\033[0m::\n";
911   print ". \033[1;33m##\033[0m:: \033[1;33m###\033[0m:: \033[1;33m##\033[0m:'\033[1;33m##\033[0m... \033[1;33m##\033[0m: \033[1;33m##\033[0m.... \033[1;33m##\033[0m:. \033[1;33m##\033[0m:: \033[1;33m##\033[0m.... \033[1;33m##\033[0m:'\033[1;33m##\033[0m... \033[1;33m##\033[0m: \033[1;33m##\033[0m.... \033[1;33m##\033[0m:\n";
912   print ": \033[1;33m##\033[0m:: \033[1;33m####\033[0m: \033[1;33m##\033[0m: \033[1;33m##\033[0m:::..:: \033[1;33m##\033[0m:::: \033[1;33m##\033[0m:: \033[1;33m##\033[0m:: \033[1;33m##\033[0m:::: \033[1;33m##\033[0m: \033[1;33m##\033[0m:::..:: \033[1;33m##\033[0m:::: \033[1;33m##\033[0m:\n";
913   print ": \033[1;33m##\033[0m:: \033[1;33m##\033[0m \033[1;33m##\033[0m \033[1;33m##\033[0m:. \033[1;33m######\033[0m:: \033[1;33m########\033[0m::: \033[1;33m##\033[0m:: \033[1;33m########\033[0m:: \033[1;33m##\033[0m::::::: \033[1;33m##\033[0m:::: \033[1;33m##\033[0m:\n";
914   print ": \033[1;33m##\033[0m:: \033[1;33m##\033[0m. \033[1;33m####\033[0m::..... \033[1;33m##\033[0m: \033[1;33m##\033[0m.....:::: \033[1;33m##\033[0m:: \033[1;33m##\033[0m.. \033[1;33m##\033[0m::: \033[1;33m##\033[0m::::::: \033[1;33m##\033[0m:::: \033[1;33m##\033[0m:\n";
915   print ": \033[1;33m##\033[0m:: \033[1;33m##\033[0m:. \033[1;33m###\033[0m:'\033[1;33m##\033[0m::: \033[1;33m##\033[0m: \033[1;33m##\033[0m::::::::: \033[1;33m##\033[0m:: \033[1;33m##\033[0m::. \033[1;33m##\033[0m:: \033[1;33m##\033[0m::: \033[1;33m##\033[0m: \033[1;33m##\033[0m:::: \033[1;33m##\033[0m:\n";
916   print "'\033[1;33m####\033[0m: \033[1;33m##\033[0m::. \033[1;33m##\033[0m:. \033[1;33m######\033[0m:: \033[1;33m##\033[0m::::::::'\033[1;33m####\033[0m: \033[1;33m##\033[0m:::. \033[1;33m##\033[0m:. \033[1;33m######\033[0m:: \033[1;33m########\033[0m::\n";
917   print "\033[0m\033[0m....::..::::..:::......:::..:::::::::....::..:::::..:::......:::........:::\n\n";
918 }
919
920 sub resolve_directory {
921         use File::Spec;
922         return File::Spec->rel2abs($_[0]);
923 }
924
925 sub yesno {
926         my ($flag,$prompt) = @_;
927         print "$prompt [\033[1;32m$config{$flag}\033[0m] -> ";
928         chomp($tmp = <STDIN>);
929         if ($tmp eq "") { $tmp = $config{$flag} }
930
931         if (($tmp eq "") || ($tmp =~ /^y/i)) {
932                 $config{$flag} = "y";
933         } else {
934                 $config{$flag} = "n";
935         }
936         return;
937 }
938
939
940 sub write_static_makefile {
941         open(FH,">src/Makefile") or die("Could not write src/Makefile!");
942         print FH <<EOM;
943 # Insp Makefile :p
944 #
945 # (C) ChatSpike development team
946 # Makefile by <Craig\@ChatSpike.net>
947 # Makefile version 2 (dynamically linked core) by <brain\@inspircd.org>
948 #
949
950 CC = im a cheezeball
951
952 CXXFLAGS = -I../include \${FLAGS}
953
954 all: socket.o hashcomp.o channels.o mode.o xline.o inspstring.o dns.o base.o inspircd_util.o inspircd_io.o message.o commands.o dnsqueue.o dynamic.o users.o modules.o wildcard.o helperfuncs.o \$(MODULES) inspircd.exe
955
956 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
957         \$(CC) -I../include \$(FLAGS) inspircd.cpp -o inspircd.exe \$(LDLIBS) channels.o mode.o xline.o inspstring.o dns.o base.o inspircd_util.o inspircd_io.o connection.o message.o commands.o dnsqueue.o dynamic.o users.o modules.o wildcard.o servers.o helperfuncs.o hashcomp.o socket.o \$(MODULES)
958
959 hashcomp.o: hashcomp.cpp ../include/base.h ../include/hashcomp.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
960         \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c hashcomp.cpp
961
962 helperfuncs.o: helperfuncs.cpp ../include/base.h ../include/helperfuncs.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
963         \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c helperfuncs.cpp
964
965 channels.o: channels.cpp ../include/base.h ../include/channels.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
966         \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c channels.cpp
967
968 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
969         \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c mode.cpp
970
971 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
972         \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c xline.cpp
973
974 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
975         \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c inspstring.cpp
976
977 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
978         \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c dns.cpp
979
980 base.o: base.cpp ../include/base.h ../include/globals.h ../include/inspircd_config.h
981         \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c base.cpp
982
983 inspircd_util.o: inspircd_util.cpp ../include/base.h ../include/inspircd_util.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
984         \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c inspircd_util.cpp
985
986 inspircd_io.o: inspircd_io.cpp ../include/base.h ../include/inspircd_io.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
987         \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c inspircd_io.cpp
988
989 message.o: message.cpp ../include/base.h ../include/message.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
990         \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c message.cpp
991
992 commands.o: commands.cpp ../include/base.h ../include/commands.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
993         \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c commands.cpp
994
995 dnsqueue.o: dnsqueue.cpp ../include/base.h ../include/dnsqueue.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
996         \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c dnsqueue.cpp
997
998 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
999         \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c dynamic.cpp
1000
1001 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
1002         \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c users.cpp
1003
1004 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
1005         \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c modules.cpp
1006
1007 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
1008         \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c wildcard.cpp
1009
1010 socket.o: socket.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h
1011         \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c socket.cpp
1012
1013
1014 EOM
1015 close(FH);
1016 }
1017
1018 sub write_dynamic_makefile {
1019         open(FH,">src/Makefile") or die("Could not write src/Makefile");
1020         print FH <<EOM;
1021 # Insp Makefile :p
1022 #
1023 # (C) ChatSpike development team
1024 # Makefile by <Craig\@ChatSpike.net>
1025 # Makefile version 2 (dynamically linked core) by <brain\@inspircd.org>
1026 #
1027
1028 CC = im a cheezeball
1029
1030 CXXFLAGS = -I../include \${FLAGS}
1031
1032 all: libIRCDsocket.so libIRCDhash.so libIRCDchannels.so libIRCDmode.so libIRCDxline.so libIRCDstring.so libIRCDasyncdns.so libIRCDbase.so libIRCDutil.so libIRCDio.so libIRCDmessage.so libIRCDcommands.so libIRCDdnsqueue.so libIRCDdynamic.so libIRCDusers.so libIRCDmodules.so libIRCDwildcard.so libIRCDhelper.so inspircd
1033
1034 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
1035         \$(CC) -I../include \$(FLAGS) -rdynamic -L. inspircd.cpp -o inspircd \$(LDLIBS) libIRCDchannels.so libIRCDmode.so libIRCDxline.so libIRCDstring.so libIRCDasyncdns.so libIRCDbase.so libIRCDutil.so libIRCDio.so libIRCDconnection.so libIRCDmessage.so libIRCDcommands.so libIRCDdnsqueue.so libIRCDdynamic.so libIRCDusers.so libIRCDmodules.so libIRCDwildcard.so libIRCDservers.so libIRCDhelper.so libIRCDhash.so libIRCDsocket.so
1036
1037 libIRCDhash.so: hashcomp.cpp ../include/base.h ../include/hashcomp.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1038         \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c hashcomp.cpp
1039         \$(CC) -shared -o libIRCDhash.so hashcomp.o
1040
1041 libIRCDhelper.so: helperfuncs.cpp ../include/base.h ../include/helperfuncs.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1042         \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c helperfuncs.cpp
1043         \$(CC) -shared -o libIRCDhelper.so helperfuncs.o
1044
1045 libIRCDchannels.so: channels.cpp ../include/base.h ../include/channels.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1046         \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c channels.cpp
1047         \$(CC) -shared -o libIRCDchannels.so channels.o
1048
1049 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
1050         \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c mode.cpp
1051         \$(CC) -shared -o libIRCDmode.so mode.o
1052
1053 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
1054         \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c xline.cpp
1055         \$(CC) -shared -o libIRCDxline.so xline.o
1056
1057 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
1058         \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c inspstring.cpp
1059         \$(CC) -shared -o libIRCDstring.so inspstring.o
1060
1061 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
1062         \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c dns.cpp
1063         \$(CC) -shared -o libIRCDasyncdns.so dns.o
1064
1065 libIRCDbase.so: base.cpp ../include/base.h ../include/globals.h ../include/inspircd_config.h
1066         \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c base.cpp
1067         \$(CC) -shared -o libIRCDbase.so base.o
1068
1069 libIRCDutil.so: inspircd_util.cpp ../include/base.h ../include/inspircd_util.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1070         \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c inspircd_util.cpp
1071         \$(CC) -shared -o libIRCDutil.so inspircd_util.o
1072
1073 libIRCDio.so: inspircd_io.cpp ../include/base.h ../include/inspircd_io.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1074         \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c inspircd_io.cpp
1075         \$(CC) -shared -o libIRCDio.so inspircd_io.o
1076
1077 libIRCDmessage.so: message.cpp ../include/base.h ../include/message.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1078         \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c message.cpp
1079         \$(CC) -shared -o libIRCDmessage.so message.o
1080
1081 libIRCDcommands.so: commands.cpp ../include/base.h ../include/commands.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1082         \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c commands.cpp
1083         \$(CC) -shared -o libIRCDcommands.so commands.o
1084
1085 libIRCDdnsqueue.so: dnsqueue.cpp ../include/base.h ../include/dnsqueue.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
1086         \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c dnsqueue.cpp
1087         \$(CC) -shared -o libIRCDdnsqueue.so dnsqueue.o
1088
1089 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
1090         \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c dynamic.cpp
1091         \$(CC) -shared -o libIRCDdynamic.so dynamic.o
1092
1093 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
1094         \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c users.cpp
1095         \$(CC) -shared -o libIRCDusers.so users.o
1096
1097 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
1098         \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c modules.cpp
1099         \$(CC) -shared -o libIRCDmodules.so modules.o
1100
1101 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
1102         \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c wildcard.cpp
1103         \$(CC) -shared -o libIRCDwildcard.so wildcard.o
1104
1105 libIRCDsocket.so: socket.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h
1106         \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c socket.cpp
1107         \$(CC) -shared -o libIRCDsocket.so socket.o
1108
1109 EOM
1110 close(FH);
1111 }