1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2009 InspIRCd Development Team
6 * See: http://wiki.inspircd.org/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
14 #define _CRT_SECURE_NO_DEPRECATE
16 #define CONFIGURE_BUILD
17 #define WIN32_LEAN_AND_MEAN
23 #include "inspircd_win32wrapper.h"
29 void WriteCompileModules();
30 void WriteCompileCommands();
34 /* detects if we are running windows xp or higher (5.1) */
38 vi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
40 if(vi.dwMajorVersion >= 5)
46 int get_int_option(const char * text, int def)
48 static char buffer[500];
50 printf_c("%s\n[\033[1;32m%u\033[0m] -> ", text, def);
51 fgets(buffer, 500, stdin);
52 if(sscanf(buffer, "%u", &ret) != 1)
59 bool get_bool_option(const char * text, bool def)
61 static char buffer[500];
63 printf_c("%s [\033[1;32m%c\033[0m] -> ", text, def ? 'y' : 'n');
64 fgets(buffer, 500, stdin);
65 if(sscanf(buffer, "%s", ret) != 1)
66 strcpy(ret, def ? "y" : "n");
69 return !strncmp(ret, "y", 1);
72 void get_string_option(const char * text, char * def, char * buf)
74 static char buffer[500];
76 printf_c("%s\n[\033[1;32m%s\033[0m] -> ", text, def);
78 printf_c("%s\n[] -> ", text);
79 fgets(buffer, 500, stdin);
80 if(sscanf(buffer, "%s", buf) != 1)
86 // escapes a string for use in a c++ file
87 bool escape_string(char * str, size_t size)
89 size_t len = strlen(str);
90 char * d_str = (char*)malloc(len * 2);
121 /* gets the svn revision */
122 int get_svn_revision(char * buffer, size_t len)
124 /* again.. I am lazy :p cbf to pipe output of svn info to us, so i'll just read the file */
134 FILE * f = fopen("..\\.svn\\entries", "r");
137 for (int q = 0; q < 4; ++q)
141 sprintf(buffer, "%u", rev);
148 void get_machine_info(char * buffer, size_t len)
153 DWORD dwSize = sizeof(buf);
154 if (!GetComputerNameEx((COMPUTER_NAME_FORMAT)ComputerNameDnsFullyQualified, buf, &dwSize))
155 sprintf(buf, "%s", "unknown");
157 FILE * f = fopen("ver.txt.tmp", "r");
160 while (fgets(buf2, 500, f)) { }
162 unlink("ver.txt.tmp");
165 sprintf(buf2, "%s", "unknown");
167 sprintf(buffer, "%s ", buf);
169 char* b = buffer + strlen(buf)+1;
173 if (*b2 != 10 && *b2 != 13)
183 int __stdcall WinMain(IN HINSTANCE hInstance, IN HINSTANCE hPrevInstance, IN LPSTR lpCmdLine, IN int nShowCmd )
185 if (!strcmp(lpCmdLine, "/rebase"))
191 FILE * j = fopen("inspircd_config.h", "r");
194 if (MessageBox(0, "inspircd_config.h already exists. Remove it and build from clean?", "Configure program", MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2) != IDYES)
201 // call before we hook console handles
202 system("ver > ver.txt.tmp");
206 // pipe standard handles to this console
207 freopen("CONIN$", "r", stdin);
208 freopen("CONOUT$", "w", stdout);
209 freopen("CONOUT$", "w", stderr);
219 printf_c("\nWelcome to the \033[1mInspIRCd\033[0m Configuration program! (\033[1minteractive mode\033[0m)\n"
220 "\033[1mPackage maintainers: Type ./configure --help for non-interactive help\033[0m\n\n");
221 printf_c("*** If you are unsure of any of these values, leave it blank for ***\n"
222 "*** standard settings that will work, and your server will run ***\n"
223 "*** using them. Please consult your IRC network admin if in doubt. ***\n\n"
224 "Press \033[1m<RETURN>\033[0m to accept the default for any option, or enter\n"
225 "a new value. Please note: You will \033[1mHAVE\033[0m to read the docs\n"
226 "dir, otherwise you won't have a config file!\n\n");
232 bool use_openssl = false;
234 char mod_path[MAX_PATH];
235 char config_file[MAX_PATH];
236 char library_dir[MAX_PATH];
237 char base_path[MAX_PATH];
238 char bin_dir[MAX_PATH];
239 char revision_text[MAX_PATH];
240 char openssl_inc_path[MAX_PATH];
241 char openssl_lib_path[MAX_PATH];
242 int revision = get_svn_revision(revision_text, MAX_PATH);
244 char machine_text[MAX_PATH];
245 get_machine_info(machine_text, MAX_PATH);
248 FILE * fI = fopen("..\\src\\version.sh", "r");
251 fgets(version, 514, fI);
252 fgets(version, 514, fI);
265 strcpy(version, "InspIRCD-Unknown");
267 printf_c("Your operating system is: \033[1;32mwindows_x64 \033[0m\n");
269 printf_c("Your operating system is: \033[1;32mwindows_x32 \033[0m\n");
271 printf_c("InspIRCd revision ID: \033[1;32m%s \033[0m\n\n", revision ? revision_text : "(Non-SVN build)");
273 ipv6 = get_bool_option("Do you want to enable IPv6?", false);
275 printf_c("\033[1mAll paths are relative to the binary directory.\033[0m\n");
276 get_string_option("In what directory do you wish to install the InspIRCd base?", "..", base_path);
277 get_string_option("In what directory are the configuration files?", "../conf", config_file);
278 get_string_option("In what directory are the modules to be compiled to?", "../modules", mod_path);
279 get_string_option("In what directory is the IRCd binary to be placed?", ".", bin_dir);
280 get_string_option("In what directory are the IRCd libraries to be placed?", "../lib", library_dir);
282 // NOTE: this may seem hackish (generating a batch build script), but it assures the user knows
283 // what they're doing, and we don't have to mess with copying files and changing around modules.mak
284 // for the extra libraries. --fez
285 // in case it exists, remove old m_ssl_openssl.cpp
286 remove("..\\src\\modules\\m_ssl_openssl.cpp");
287 printf_c("You can compile InspIRCd modules that add OpenSSL or GnuTLS support for SSL functionality.\n"
288 "To do so you will need the appropriate link libraries and header files on your system.\n");
289 use_openssl = get_bool_option("Would you like to compile the IRCd with OpenSSL support?", false);
292 get_string_option("Please enter the full path to your OpenSSL include directory\n"
293 "(e.g., C:\\openssl\\include, but NOT the openssl subdirectory under include\\)\n"
294 "(also, path should not end in '\\')",
295 "C:\\openssl\\include", openssl_inc_path);
297 // NOTE: if inspircd ever changes so that it compiles with /MT instead of the /MTd switch, then
298 // the dependency on libeay32mtd.lib and ssleay32mtd.lib will change to just libeay32.lib and
299 // ssleay32.lib. --fez
301 get_string_option("Please enter the full path to your OpenSSL library directory\n"
302 "(e.g., C:\\openssl\\lib, which should contain libeay32mtd.lib and ssleay32mtd.lib)",
303 "C:\\openssl\\lib", openssl_lib_path);
306 FILE *fp = fopen("compile_openssl.bat", "w");
307 fprintf(fp, "@echo off\n");
308 fprintf(fp, "echo This batch script compiles m_ssl_openssl for InspIRCd.\n");
309 fprintf(fp, "echo NOTE: this batch file should be invoked from the Visual Studio Command Prompt (vsvars32.bat)\n");
310 fprintf(fp, "set OPENSSL_INC_PATH=\"%s\"\n", openssl_inc_path);
311 fprintf(fp, "set OPENSSL_LIB_PATH=\"%s\"\n", openssl_lib_path);
312 fprintf(fp, "set COMPILE=cl /nologo /LD /Od /I \".\" /I \"../../include\" /I \"../../include/modes\" /I \"../../include/modules\" /I \"../../win\" /D \"WIN32\" /D \"_CONSOLE\" /D \"_MBCS\" /D \"DLL_BUILD\" /Gm /EHsc /MD /Fo\"Release/\" /Fd\"Release/vc90.pdb\" /W2 /Wp64 /Zi /TP /I %%OPENSSL_INC_PATH%% m_ssl_openssl.cpp ..\\..\\win\\inspircd_memory_functions.cpp %%OPENSSL_INC_PATH%%\\openssl\\applink.c /link /LIBPATH:%%OPENSSL_LIB_PATH%% ..\\..\\bin\\release\\bin\\inspircd.lib ws2_32.lib /OUT:\"..\\..\\bin\\release\\modules\\m_ssl_openssl.so\" /PDB:\"..\\..\\bin\\release\\modules\\m_ssl_openssl.pdb\" /IMPLIB:\"..\\..\\bin\\release\\modules\\m_ssl_openssl.lib\"\n");
313 fprintf(fp, "cd ..\\src\\modules\n");
314 fprintf(fp, "copy extra\\m_ssl_openssl.cpp .\n");
315 fprintf(fp, "echo \t%%COMPILE%%\n");
316 fprintf(fp, "%%COMPILE%%\n");
317 fprintf(fp, "cd ..\\..\\win\n");
318 fprintf(fp, "echo done... now check for errors.\n");
321 printf_c("\033[1;32m!!!NOTICE!!! The file 'compile_openssl.bat' has been written to your 'win' directory. Launch it\n"
322 "!!! from the Visual Studio Command Prompt !!! to compile the m_ssl_openssl module.\n"
323 "Wait until after compiling inspircd to run it.\n"
324 "Also, ssleay32.dll and libeay32.dll will be required for the IRCd to run.\033[0m\n");
327 printf_c("\n\033[1;32mPre-build configuration is complete!\n\n"); sc(TNORMAL);
331 // dump all the options back out
332 printf_c("\033[0mBase install path:\033[1;32m %s\n", base_path);
333 printf_c("\033[0mConfig path:\033[1;32m %s\n", config_file);
334 printf_c("\033[0mModule path:\033[1;32m %s\n", mod_path);
335 printf_c("\033[0mLibrary path:\033[1;32m %s\n", library_dir);
336 printf_c("\033[0mSocket Engine:\033[1;32m %s\n", "select");
338 printf("\n"); sc(TNORMAL);
339 if(get_bool_option("Are these settings correct?", true) == false)
347 escape_string(config_file, MAX_PATH);
348 escape_string(mod_path, MAX_PATH);
349 escape_string(library_dir, MAX_PATH);
351 printf("\nWriting inspircd_config.h...");
352 FILE * f = fopen("inspircd_config.h", "w");
353 fprintf(f, "/* Auto generated by configure, do not modify! */\n");
354 fprintf(f, "#ifndef __CONFIGURATION_AUTO__\n");
355 fprintf(f, "#define __CONFIGURATION_AUTO__\n\n");
357 fprintf(f, "#define IPV6 1\n\n");
359 fprintf(f, "#define CONFIG_FILE \"%s/inspircd.conf\"\n", config_file);
360 fprintf(f, "#define MOD_PATH \"%s\"\n", mod_path);
361 fprintf(f, "#define SOMAXCONN_S \"128\"\n");
362 fprintf(f, "#define LIBRARYDIR \"%s\"\n", library_dir);
363 fprintf(f, "#define MAXBUF 514\n");
365 fprintf(f, "\n#include \"inspircd_win32wrapper.h\"");
366 fprintf(f, "\n#include \"inspircd_namedpipe.h\"");
367 fprintf(f, "\n#include \"threadengines/threadengine_win32.h\"\n\n");
368 fprintf(f, "#endif\n\n");
371 sc(TGREEN); printf(" done\n"); sc(TNORMAL);
372 printf("Writing inspircd_se_config.h...");
374 f = fopen("inspircd_se_config.h", "w");
375 fprintf(f, "/* Auto generated by configure, do not modify or commit to svn! */\n");
376 fprintf(f, "#ifndef __CONFIGURATION_SOCKETENGINE__\n");
377 fprintf(f, "#define __CONFIGURATION_SOCKETENGINE__\n\n");
378 fprintf(f, "#include \"socketengines/socketengine_%s.h\"\n\n", "select");
379 fprintf(f, "#endif\n\n");
382 sc(TGREEN); printf(" done\n"); sc(TNORMAL);
383 printf("Writing inspircd_version.h...");
384 f = fopen("inspircd_version.h", "w");
385 fprintf(f, "#define VERSION \"%s\"\n", version);
386 fprintf(f, "#define REVISION \"%d\"\n", revision);
387 fprintf(f, "#define SYSTEM \"%s\"\n", machine_text);
390 sc(TGREEN); printf(" done\n"); sc(TNORMAL);
391 printf("Writing command and module compilation scripts...");
392 WriteCompileCommands();
393 WriteCompileModules();
394 sc(TGREEN); printf(" done\n"); sc(TNORMAL);
396 printf("\nconfigure is done.. exiting!\n");
399 /* Keeps files from modules/extra up to date if theyre copied into modules/ */
405 printf("\nUpdating extra modules in src/modules...\n");
408 HANDLE fh = FindFirstFile("..\\src\\modules\\extra\\*.*", &fd);
410 if(fh == INVALID_HANDLE_VALUE)
415 strcpy(dest, "..\\src\\modules\\");
416 strcat(dest, fd.cFileName);
417 strcpy(src, "..\\src\\modules\\extra\\");
418 strcat(src, fd.cFileName);
419 FILE* x = fopen(dest, "r");
423 CopyFile(src, dest, false);
424 sc(TGREEN); printf(" %s", fd.cFileName); sc(TNORMAL);
428 while (FindNextFile(fh, &fd));
445 HANDLE fh = FindFirstFile("..\\bin\\debug\\lib\\*.so", &fd);
447 HANDLE fh = FindFirstFile("..\\bin\\release\\lib\\*.so", &fd);
449 if(fh == INVALID_HANDLE_VALUE)
455 strcat(dest, " ..\\bin\\debug\\lib\\");
457 strcat(dest, " ..\\bin\\release\\lib\\");
459 strcat(dest, fd.cFileName);
461 while (FindNextFile(fh, &fd));
465 sprintf(command, "rebase.exe -v -b 10000000 -c baseaddr_commands.txt %s", dest);
466 printf("%s\n", command);
470 fh = FindFirstFile("..\\bin\\debug\\modules\\*.so", &fd);
472 fh = FindFirstFile("..\\bin\\release\\modules\\*.so", &fd);
474 if(fh == INVALID_HANDLE_VALUE)
482 strcat(dest, " ..\\bin\\debug\\modules\\");
484 strcat(dest, " ..\\bin\\release\\modules\\");
486 strcat(dest, fd.cFileName);
488 while (FindNextFile(fh, &fd));
490 sprintf(command, "rebase.exe -v -b 11000000 -c baseaddr_modules.txt %s", dest);
491 printf("%s\n", command);
498 void WriteCompileCommands()
500 char commands[300][100];
501 int command_count = 0;
502 printf("\n Finding Command Sources...\n");
504 HANDLE fh = FindFirstFile("..\\src\\commands\\cmd_*.cpp", &fd);
505 if(fh == INVALID_HANDLE_VALUE)
506 printf_c("\033[1;32m No command sources could be found! This \033[1m*could*\033[1;32m be a bad thing.. :P\033[0m");
512 strcpy(commands[command_count], fd.cFileName);
513 commands[command_count][strlen(fd.cFileName) - 4] = 0;
514 printf(" %s\n", commands[command_count]);
516 } while(FindNextFile(fh, &fd));
520 // Write our spiffy new makefile :D
521 // I am such a lazy fucker :P
522 FILE * f = fopen("..\\src\\commands\\commands.mak", "w");
524 time_t t = time(NULL);
525 fprintf(f, "# Generated at %s\n", ctime(&t));
526 fprintf(f, "all: makedir ");
528 // dump modules.. first time :)
529 for(int i = 0; i < command_count; ++i)
530 fprintf(f, "%s.so ", commands[i]);
532 fprintf(f, "\n.cpp.obj:\n");
536 fprintf(f, " cl /nologo /LD /Od /I \".\" /I \"../../include\" /I \"../../include/modes\" /I \"../../include/commands\" /I \"../../win\" /D \"WIN32\" /D \"_DEBUG\" /D \"_CONSOLE\" /D \"_MBCS\" /D \"DLL_BUILD\" /Gm /EHsc /RTC1 /MDd /Fo\"Debug/\" /Fd\"Debug/vc90.pdb\" /W2 /Zi /TP $*.cpp ..\\..\\win\\inspircd_memory_functions.cpp /link ..\\..\\bin\\debug_x64\\bin\\inspircd.lib /OUT:\"..\\..\\bin\\debug_x64\\lib\\$*.so\" /PDB:\"..\\..\\bin\\debug_x64\\lib\\$*.pdb\" /MACHINE:X64 /IMPLIB:\"..\\..\\bin\\debug_x64\\lib\\$*.lib\"\n\n");
537 CreateDirectory("..\\src\\debug", NULL);
538 CreateDirectory("..\\bin\\debug\\bin", NULL);
539 CreateDirectory("..\\bin\\debug\\lib", NULL);
540 CreateDirectory("..\\bin\\debug\\modules", NULL);
542 fprintf(f, " cl /nologo /LD /Od /I \".\" /I \"../../include\" /I \"../../include/modes\" /I \"../../include/commands\" /I \"../../win\" /D \"WIN32\" /D \"_CONSOLE\" /D \"_MBCS\" /D \"DLL_BUILD\" /Gm /EHsc /GL /MD /Fo\"Release/\" /Fd\"Release/vc90.pdb\" /W2 /Zi /TP $*.cpp ..\\..\\win\\inspircd_memory_functions.cpp /link ..\\..\\bin\\release_x64\\bin\\inspircd.lib /OUT:\"..\\..\\bin\\release_x64\\lib\\$*.so\" /PDB:\"..\\..\\bin\\release_x64\\lib\\$*.pdb\" /MACHINE:X64 /IMPLIB:\"..\\..\\bin\\release_x64\\lib\\$*.lib\"\n\n");
543 CreateDirectory("..\\src\\release", NULL);
544 CreateDirectory("..\\bin\\release\\bin", NULL);
545 CreateDirectory("..\\bin\\release\\lib", NULL);
546 CreateDirectory("..\\bin\\release\\modules", NULL);
550 fprintf(f, " cl /nologo /LD /Od /I \".\" /I \"../../include\" /I \"../../include/modes\" /I \"../../include/commands\" /I \"../../win\" /D \"WIN32\" /D \"_DEBUG\" /D \"_CONSOLE\" /D \"_MBCS\" /D \"DLL_BUILD\" /Gm /EHsc /RTC1 /MDd /Fo\"Debug/\" /Fd\"Debug/vc90.pdb\" /W2 /Zi /TP $*.cpp ..\\..\\win\\inspircd_memory_functions.cpp /link ..\\..\\bin\\debug\\bin\\inspircd.lib /OUT:\"..\\..\\bin\\debug\\lib\\$*.so\" /PDB:\"..\\..\\bin\\debug\\lib\\$*.pdb\" /IMPLIB:\"..\\..\\bin\\debug\\lib\\$*.lib\"\n\n");
551 CreateDirectory("..\\src\\debug", NULL);
552 CreateDirectory("..\\bin\\debug\\bin", NULL);
553 CreateDirectory("..\\bin\\debug\\lib", NULL);
554 CreateDirectory("..\\bin\\debug\\modules", NULL);
556 fprintf(f, " cl /nologo /LD /Od /I \".\" /I \"../../include\" /I \"../../include/modes\" /I \"../../include/commands\" /I \"../../win\" /D \"WIN32\" /D \"_CONSOLE\" /D \"_MBCS\" /D \"DLL_BUILD\" /Gm /EHsc /GL /MD /Fo\"Release/\" /Fd\"Release/vc90.pdb\" /W2 /Zi /TP $*.cpp ..\\..\\win\\inspircd_memory_functions.cpp /link ..\\..\\bin\\release\\bin\\inspircd.lib /OUT:\"..\\..\\bin\\release\\lib\\$*.so\" /PDB:\"..\\..\\bin\\release\\lib\\$*.pdb\" /IMPLIB:\"..\\..\\bin\\release\\lib\\$*.lib\"\n\n");
557 CreateDirectory("..\\src\\release", NULL);
558 CreateDirectory("..\\bin\\release\\bin", NULL);
559 CreateDirectory("..\\bin\\release\\lib", NULL);
560 CreateDirectory("..\\bin\\release\\modules", NULL);
565 fprintf(f, "makedir:\n if not exist debug mkdir debug\n if not exist ..\\..\\bin\\debug\\lib mkdir ..\\..\\bin\\debug\\lib\n\n");
567 fprintf(f, "makedir:\n if not exist release mkdir release\n if not exist ..\\..\\bin\\release\\lib mkdir ..\\..\\bin\\release\\lib\n\n");
570 // dump modules.. again the second and last time :)
571 for(int i = 0; i < command_count; ++i)
572 fprintf(f, "%s.so : %s.obj\n", commands[i], commands[i]);
578 void WriteCompileModules()
580 char modules[300][100];
581 int module_count = 0;
583 printf("Finding Modules...\n");
585 HANDLE fh = FindFirstFile("..\\src\\modules\\m_*.cpp", &fd);
586 if(fh == INVALID_HANDLE_VALUE)
587 printf_c("\033[1;32m No module sources could be found! This \033[1m*could*\033[1;32m be a bad thing.. :P\033[0m");
593 strcpy(modules[module_count], fd.cFileName);
594 modules[module_count][strlen(fd.cFileName) - 4] = 0;
595 printf(" %s\n", modules[module_count]);
597 } while(FindNextFile(fh, &fd));
601 // Write our spiffy new makefile :D
602 // I am such a lazy fucker :P
603 FILE * f = fopen("..\\src\\modules\\modules.mak", "w");
605 time_t t = time(NULL);
606 fprintf(f, "# Generated at %s\n", ctime(&t));
607 fprintf(f, "all: makedir ");
609 // dump modules.. first time :)
610 for(int i = 0; i < module_count; ++i)
611 fprintf(f, "%s.so ", modules[i]);
613 fprintf(f, "\n.cpp.obj:\n");
617 fprintf(f, " cl /nologo /LD /Od /I \".\" /I \"../../include\" /I \"../../include/modes\" /I \"../../include/modules\" /I \"../../win\" /D \"WIN32\" /D \"_DEBUG\" /D \"_CONSOLE\" /D \"_MBCS\" /D \"DLL_BUILD\" /Gm /EHsc /RTC1 /MDd /Fo\"Debug/\" /Fd\"Debug/vc90.pdb\" /W2 /Zi /TP $*.cpp ..\\..\\win\\inspircd_memory_functions.cpp /link ..\\..\\bin\\debug_x64\\bin\\inspircd.lib ws2_32.lib /OUT:\"..\\..\\bin\\debug_x64\\modules\\$*.so\" /PDB:\"..\\..\\bin\\debug_x64\\modules\\$*.pdb\" /MACHINE:X64 /IMPLIB:\"..\\..\\bin\\debug_x64\\modules\\$*.lib\"\n\n");
618 CreateDirectory("..\\src\\modules\\debug_x64", NULL);
620 fprintf(f, " cl /nologo /LD /Od /I \".\" /I \"../../include\" /I \"../../include/modes\" /I \"../../include/modules\" /I \"../../win\" /D \"WIN32\" /D \"_CONSOLE\" /D \"_MBCS\" /D \"DLL_BUILD\" /Gm /EHsc /GL /MD /Fo\"Release/\" /Fd\"Release/vc90.pdb\" /W2 /Zi /TP $*.cpp ..\\..\\win\\inspircd_memory_functions.cpp /link ..\\..\\bin\\release_x64\\bin\\inspircd.lib ws2_32.lib /OUT:\"..\\..\\bin\\release_x64\\modules\\$*.so\" /PDB:\"..\\..\\bin\\release_x64\\modules\\$*.pdb\" /MACHINE:X64 /IMPLIB:\"..\\..\\bin\\release_x64\\modules\\$*.lib\"\n\n");
621 CreateDirectory("..\\src\\modules\\release_x64", NULL);
625 fprintf(f, " cl /nologo /LD /Od /I \".\" /I \"../../include\" /I \"../../include/modes\" /I \"../../include/modules\" /I \"../../win\" /D \"WIN32\" /D \"_DEBUG\" /D \"_CONSOLE\" /D \"_MBCS\" /D \"DLL_BUILD\" /Gm /EHsc /RTC1 /MDd /Fo\"Debug/\" /Fd\"Debug/vc90.pdb\" /W2 /Zi /TP $*.cpp ..\\..\\win\\inspircd_memory_functions.cpp /link ..\\..\\bin\\debug\\bin\\inspircd.lib ws2_32.lib /OUT:\"..\\..\\bin\\debug\\modules\\$*.so\" /PDB:\"..\\..\\bin\\debug\\modules\\$*.pdb\" /IMPLIB:\"..\\..\\bin\\debug\\modules\\$*.lib\"\n\n");
626 CreateDirectory("..\\src\\modules\\debug", NULL);
627 CreateDirectory("..\\src\\modules\\debug\\lib", NULL);
628 CreateDirectory("..\\src\\modules\\debug\\modules", NULL);
629 CreateDirectory("..\\src\\modules\\debug\\bin", NULL);
631 fprintf(f, " cl /nologo /LD /Od /I \".\" /I \"../../include\" /I \"../../include/modes\" /I \"../../include/modules\" /I \"../../win\" /D \"WIN32\" /D \"_CONSOLE\" /D \"_MBCS\" /D \"DLL_BUILD\" /Gm /EHsc /GL /MD /Fo\"Release/\" /Fd\"Release/vc90.pdb\" /W2 /Zi /TP $*.cpp ..\\..\\win\\inspircd_memory_functions.cpp /link ..\\..\\bin\\release\\bin\\inspircd.lib ws2_32.lib /OUT:\"..\\..\\bin\\release\\modules\\$*.so\" /PDB:\"..\\..\\bin\\release\\modules\\$*.pdb\" /IMPLIB:\"..\\..\\bin\\release\\modules\\$*.lib\"\n\n");
632 CreateDirectory("..\\src\\modules\\release", NULL);
633 CreateDirectory("..\\src\\modules\\release\\lib", NULL);
634 CreateDirectory("..\\src\\modules\\release\\modules", NULL);
635 CreateDirectory("..\\src\\modules\\release\\bin", NULL);
640 fprintf(f, "makedir:\n if not exist debug mkdir debug\n if not exist ..\\..\\bin\\debug\\modules mkdir ..\\..\\bin\\debug\\modules\n\n");
642 fprintf(f, "makedir:\n if not exist release mkdir release\n if not exist ..\\..\\bin\\release\\modules mkdir ..\\..\\bin\\release\\modules\n\n");
645 // dump modules.. again the second and last time :)
646 for(int i = 0; i < module_count; ++i)
647 fprintf(f, "%s.so : %s.obj\n", modules[i], modules[i]);