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