- if ($config{OSNAME} =~ /SunOS/) {
- print FILEHANDLE "#define IS_SOLARIS\n";
- }
- if ($config{OSNAME} =~ /CYGWIN/) {
- print FILEHANDLE "#define IS_CYGWIN\n";
- print FILEHANDLE "#ifndef FD_SETSIZE\n#define FD_SETSIZE 1024\n#endif\n";
- }
- if ($config{OSNAME} eq "CYG-STATIC") {
- print FILEHANDLE "#ifndef FD_SETSIZE\n#define FD_SETSIZE 1024\n#endif\n";
- }
-
- if ($config{STATIC_LINK} eq "yes") {
- print FILEHANDLE "#define STATIC_LINK\n";
- }
- if ($config{GCCVER} > 3) {
- print FILEHANDLE "#define GCC3\n";
- print FILEHANDLE "#define GCC34\n";
- }
- else
- {
- if ($config{GCCVER} == 3) {
- print FILEHANDLE "#define GCC3\n";
- if ($config{GCC34} > 3) {
- print FILEHANDLE "#define GCC34\n";
- }
- }
- }
- if ($config{HAS_STRLCPY} eq "true") {
- print FILEHANDLE "#define HAS_STRLCPY\n";
- }
- if ($config{THREADED_DNS} =~ /y/i) {
- print FILEHANDLE "#define THREADED_DNS\n";
- }
- my $use_hiperf = 0;
- if (($has_kqueue) && ($config{USE_KQUEUE} eq "y")) {
- print FILEHANDLE "#define USE_KQUEUE\n";
- $use_hiperf = 1;
- }
- if (($has_epoll) && ($config{USE_EPOLL} eq "y")) {
- print FILEHANDLE "#define USE_EPOLL\n";
- $use_hiperf = 1;
- }
- # user didn't choose either epoll or select for their OS.
- # default them to USE_SELECT (ewwy puke puke)
- if (!$use_hiperf) {
- print FILEHANDLE "#define USE_SELECT\n";
- }
- print FILEHANDLE "\n#endif\n";
- close(FILEHANDLE);
-
- # Create a Modules List..
- my $modules = "";
- foreach $i (@modlist)
- {
- if ($config{STATIC_LINK} eq "yes") {
- $modules .= "m_".$i.".o ";
- }
- else {
- $modules .= "m_".$i.".so ";
- }
- }
- chomp($modules); # Remove Redundant whitespace..
-
-
- # Write all .in files.
- my $tmp = "";
- my $file = "";
- my $exe = "inspircd";
-
- if ($config{OSNAME} =~ /CYGWIN/) {
- $exe = "inspircd.exe";
- }
-
- opendir(DIRHANDLE, $this);
- if ($config{THREADED_DNS} =~ /y/i) {
- $config{LDLIBS} = $config{LDLIBS} . " -pthread";
- }
- foreach $name (sort readdir(DIRHANDLE)) {
- if ($name =~ /^\.(.+)\.inc$/)
- {
- $file = $1;
- # All .name.inc files need parsing!
- $tmp = "";
- open(FILEHANDLE, ".$file.inc");
- while (<FILEHANDLE>) {
- $tmp .= $_;
- }
- close(FILEHANDLE);
-
- $tmp =~ s/\@CC\@/$config{CC}/;
- $tmp =~ s/\@MAKEPROG\@/$config{MAKEPROG}/;
- $tmp =~ s/\@FLAGS\@/$config{FLAGS}/;
- $tmp =~ s/\@LDLIBS\@/$config{LDLIBS}/;
- $tmp =~ s/\@BASE_DIR\@/$config{BASE_DIR}/;
- $tmp =~ s/\@CONFIG_DIR\@/$config{CONFIG_DIR}/;
- $tmp =~ s/\@MODULE_DIR\@/$config{MODULE_DIR}/;
- $tmp =~ s/\@BINARY_DIR\@/$config{BINARY_DIR}/;
- $tmp =~ s/\@LIBRARY_DIR\@/$config{LIBRARY_DIR}/;
- $tmp =~ s/\@MODULES\@/$modules/;
- $tmp =~ s/\@EXECUTABLE\@/$exe/;
- $tmp =~ s/\@MAKEORDER\@/$config{MAKEORDER}/;
- $tmp =~ s/\@STATICLIBS\@/$config{STATICLIBS}/;
-
- print "Writing \033[1;32m$file\033[0m\n";
- open(FILEHANDLE, ">$file");
- print FILEHANDLE $tmp;
- }
- }
- closedir(DIRHANDLE);
-
- # Make inspircd executable!
- chmod 0744, 'inspircd';
-
- if ($config{STATIC_LINK} eq "yes") {
- print "Writing static-build \033[1;32msrc/Makefile\033[0m\n";
- write_static_makefile();
- write_static_modules_makefile();
- } elsif ($config{OSNAME} =~ /CYGWIN/) {
- print "Writing cygwin-build \033[1;32msrc/Makefile\033[0m\n";
- write_static_makefile();
- write_dynamic_modules_makefile();
- } else {
- print "Writing dynamic-build \033[1;32msrc/Makefile\033[0m\n";
- write_dynamic_makefile();
- write_dynamic_modules_makefile();
- }
+
+ # Write all .in files.
+ my $tmp = "";
+ my $file = "";
+ my $exe = "inspircd";
+
+ if ($config{OSNAME} =~ /CYGWIN/) {
+ $exe = "inspircd.exe";
+ }
+
+ opendir(DIRHANDLE, $this);
+ if ($config{THREADED_DNS} =~ /y/i) {
+ $config{LDLIBS} = $config{LDLIBS} . " -pthread";
+ }
+ foreach $name (sort readdir(DIRHANDLE)) {
+ if ($name =~ /^\.(.+)\.inc$/) {
+ $file = $1;
+ # All .name.inc files need parsing!
+ $tmp = "";
+ open(FILEHANDLE, ".$file.inc");
+ while (<FILEHANDLE>) {
+ $tmp .= $_;
+ }
+ close(FILEHANDLE);
+
+ $tmp =~ s/\@CC\@/$config{CC}/;
+ $tmp =~ s/\@MAKEPROG\@/$config{MAKEPROG}/;
+ $tmp =~ s/\@FLAGS\@/$config{FLAGS}/;
+ $tmp =~ s/\@LDLIBS\@/$config{LDLIBS}/;
+ $tmp =~ s/\@BASE_DIR\@/$config{BASE_DIR}/;
+ $tmp =~ s/\@CONFIG_DIR\@/$config{CONFIG_DIR}/;
+ $tmp =~ s/\@MODULE_DIR\@/$config{MODULE_DIR}/;
+ $tmp =~ s/\@BINARY_DIR\@/$config{BINARY_DIR}/;
+ $tmp =~ s/\@LIBRARY_DIR\@/$config{LIBRARY_DIR}/;
+ $tmp =~ s/\@MODULES\@/$modules/;
+ $tmp =~ s/\@EXECUTABLE\@/$exe/;
+ $tmp =~ s/\@MAKEORDER\@/$config{MAKEORDER}/;
+ $tmp =~ s/\@STATICLIBS\@/$config{STATICLIBS}/;
+
+ print "Writing \033[1;32m$file\033[0m\n";
+ open(FILEHANDLE, ">$file");
+ print FILEHANDLE $tmp;
+ }
+ }
+ closedir(DIRHANDLE);
+
+ # Make inspircd executable!
+ chmod 0744, 'inspircd';
+
+ if ($config{STATIC_LINK} eq "yes") {
+ print "Writing static-build \033[1;32msrc/Makefile\033[0m\n";
+ write_static_makefile();
+ write_static_modules_makefile();
+ } elsif ($config{OSNAME} =~ /CYGWIN/) {
+ print "Writing cygwin-build \033[1;32msrc/Makefile\033[0m\n";
+ write_static_makefile();
+ write_dynamic_modules_makefile();
+ } else {
+ print "Writing dynamic-build \033[1;32msrc/Makefile\033[0m\n";
+ write_dynamic_makefile();
+ write_dynamic_modules_makefile();
+ }