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