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
22 #include "inspircd_win32wrapper.h"
28 void WriteCompileModules();
29 void WriteCompileCommands();
33 /* detects if we are running windows xp or higher (5.1) */
37 vi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
39 if(vi.dwMajorVersion >= 5)
45 int get_int_option(const char * text, int def)
47 static char buffer[500];
49 printf_c("%s\n[\033[1;32m%u\033[0m] -> ", text, def);
50 fgets(buffer, 500, stdin);
51 if(sscanf(buffer, "%u", &ret) != 1)
58 bool get_bool_option(const char * text, bool def)
60 static char buffer[500];
62 printf_c("%s [\033[1;32m%c\033[0m] -> ", text, def ? 'y' : 'n');
63 fgets(buffer, 500, stdin);
64 if(sscanf(buffer, "%s", ret) != 1)
65 strcpy(ret, def ? "y" : "n");
68 return !strncmp(ret, "y", 1);
71 void get_string_option(const char * text, char * def, char * buf)
73 static char buffer[500];
75 printf_c("%s\n[\033[1;32m%s\033[0m] -> ", text, def);
77 printf_c("%s\n[] -> ", text);
78 fgets(buffer, 500, stdin);
79 if(sscanf(buffer, "%s", buf) != 1)
85 // escapes a string for use in a c++ file
86 bool escape_string(char * str, size_t size)
88 size_t len = strlen(str);
89 char * d_str = (char*)malloc(len * 2);
120 /* gets the svn revision */
121 int get_svn_revision(char * buffer, size_t len)
123 /* again.. I am lazy :p cbf to pipe output of svn info to us, so i'll just read the file */
133 FILE * f = fopen("..\\.svn\\entries", "r");
136 for (int q = 0; q < 4; ++q)
140 sprintf(buffer, "%u", rev);
147 int __stdcall WinMain(IN HINSTANCE hInstance, IN HINSTANCE hPrevInstance, IN LPSTR lpCmdLine, IN int nShowCmd )
149 if (!strcmp(lpCmdLine, "/rebase"))
154 FILE * j = fopen("inspircd_config.h", "r");
157 if (MessageBox(0, "inspircd_config.h already exists. Remove it and build from clean?", "Configure program", MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2) != IDYES)
166 // pipe standard handles to this console
167 freopen("CONIN$", "r", stdin);
168 freopen("CONOUT$", "w", stdout);
169 freopen("CONOUT$", "w", stderr);
179 printf_c("\nWelcome to the \033[1mInspIRCd\033[0m Configuration program! (\033[1minteractive mode\033[0m)\n"
180 "\033[1mPackage maintainers: Type ./configure --help for non-interactive help\033[0m\n\n");
181 printf_c("*** If you are unsure of any of these values, leave it blank for ***\n"
182 "*** standard settings that will work, and your server will run ***\n"
183 "*** using them. Please consult your IRC network admin if in doubt. ***\n\n"
184 "Press \033[1m<RETURN>\033[0m to accept the default for any option, or enter\n"
185 "a new value. Please note: You will \033[1mHAVE\033[0m to read the docs\n"
186 "dir, otherwise you won't have a config file!\n\n");
192 bool use_iocp = false;
193 bool use_openssl = false;
195 char mod_path[MAX_PATH];
196 char config_file[MAX_PATH];
197 char library_dir[MAX_PATH];
198 char base_path[MAX_PATH];
199 char bin_dir[MAX_PATH];
200 char revision_text[MAX_PATH];
201 char openssl_inc_path[MAX_PATH];
202 char openssl_lib_path[MAX_PATH];
203 int revision = get_svn_revision(revision_text, MAX_PATH);
207 FILE * fI = fopen("..\\src\\version.sh", "r");
210 fgets(version, 514, fI);
211 fgets(version, 514, fI);
224 strcpy(version, "InspIRCD-Unknown");
226 printf_c("Your operating system is: \033[1;32mwindows_x64 \033[0m\n");
228 printf_c("Your operating system is: \033[1;32mwindows_x32 \033[0m\n");
230 printf_c("InspIRCd revision ID: \033[1;32m%s \033[0m\n\n", revision ? revision_text : "(Non-SVN build)");
235 printf_c("You are running Windows 2000 or above, and IOCP support is most likely available.\n"
236 "Thisis much more efficent but is currently EXPERIMENTAL and UNSUPPORTED.\n"
237 "If you are unsure, answer no.\n\n");
239 use_iocp = get_bool_option("Do you want to use the IOCP implementation?", false);
242 ipv6 = get_bool_option("Do you want to enable IPv6?", false);
244 printf_c("\033[1mAll paths are relative to the binary directory.\033[0m\n");
245 get_string_option("In what directory do you wish to install the InspIRCd base?", "..", base_path);
246 get_string_option("In what directory are the configuration files?", "../conf", config_file);
247 get_string_option("In what directory are the modules to be compiled to?", "../modules", mod_path);
248 get_string_option("In what directory is the IRCd binary to be placed?", ".", bin_dir);
249 get_string_option("In what directory are the IRCd libraries to be placed?", "../lib", library_dir);
251 // NOTE: this may seem hackish (generating a batch build script), but it assures the user knows
252 // what they're doing, and we don't have to mess with copying files and changing around modules.mak
253 // for the extra libraries. --fez
254 // in case it exists, remove old m_ssl_openssl.cpp
255 remove("..\\src\\modules\\m_ssl_openssl.cpp");
256 printf_c("You can compile InspIRCd modules that add OpenSSL or GnuTLS support for SSL functionality.\n"
257 "To do so you will need the appropriate link libraries and header files on your system.\n");
258 use_openssl = get_bool_option("Would you like to compile the IRCd with OpenSSL support?", false);
261 get_string_option("Please enter the full path to your OpenSSL include directory\n"
262 "(e.g., C:\\openssl\\include, but NOT the openssl subdirectory under include\\)\n"
263 "(also, path should not end in '\\')",
264 "C:\\openssl\\include", openssl_inc_path);
266 // NOTE: if inspircd ever changes so that it compiles with /MT instead of the /MTd switch, then
267 // the dependency on libeay32mtd.lib and ssleay32mtd.lib will change to just libeay32.lib and
268 // ssleay32.lib. --fez
270 get_string_option("Please enter the full path to your OpenSSL library directory\n"
271 "(e.g., C:\\openssl\\lib, which should contain libeay32mtd.lib and ssleay32mtd.lib)",
272 "C:\\openssl\\lib", openssl_lib_path);
275 FILE *fp = fopen("compile_openssl.bat", "w");
276 fprintf(fp, "@echo off\n");
277 fprintf(fp, "echo This batch script compiles m_ssl_openssl for InspIRCd.\n");
278 fprintf(fp, "echo NOTE: this batch file should be invoked from the Visual Studio Command Prompt (vsvars32.bat)\n");
279 fprintf(fp, "set OPENSSL_INC_PATH=\"%s\"\n", openssl_inc_path);
280 fprintf(fp, "set OPENSSL_LIB_PATH=\"%s\"\n", openssl_lib_path);
281 fprintf(fp, "set COMPILE=cl /nologo -Dssize_t=long /LD /Od /I \".\" /I \"../../include\" /I \"../../include/modes\" /I \"../../include/modules\" /I \"../../win\" /D \"WIN32\" /D \"_CONSOLE\" /D \"_MBCS\" /D \"DLL_BUILD\" /EHsc /Gm /MD /Fo\"Release/\" /Fd\"Release/vc70.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");
282 fprintf(fp, "cd ..\\src\\modules\n");
283 fprintf(fp, "copy extra\\m_ssl_openssl.cpp .\n");
284 fprintf(fp, "echo \t%%COMPILE%%\n");
285 fprintf(fp, "%%COMPILE%%\n");
286 fprintf(fp, "cd ..\\..\\win\n");
287 fprintf(fp, "echo done... now check for errors.\n");
290 printf_c("\033[1;32m!!!NOTICE!!! The file 'compile_openssl.bat' has been written to your 'win' directory. Launch it\n"
291 "!!! from the Visual Studio Command Prompt !!! to compile the m_ssl_openssl module.\n"
292 "Wait until after compiling inspircd to run it.\n"
293 "Also, ssleay32.dll and libeay32.dll will be required for the IRCd to run.\033[0m\n");
296 printf_c("\n\033[1;32mPre-build configuration is complete!\n\n"); sc(TNORMAL);
300 // dump all the options back out
301 printf_c("\033[0mBase install path:\033[1;32m %s\n", base_path);
302 printf_c("\033[0mConfig path:\033[1;32m %s\n", config_file);
303 printf_c("\033[0mModule path:\033[1;32m %s\n", mod_path);
304 printf_c("\033[0mLibrary path:\033[1;32m %s\n", library_dir);
305 printf_c("\033[0mSocket Engine:\033[1;32m %s\n", use_iocp ? "iocp" : "select");
307 printf("\n"); sc(TNORMAL);
308 if(get_bool_option("Are these settings correct?", true) == false)
316 escape_string(config_file, MAX_PATH);
317 escape_string(mod_path, MAX_PATH);
318 escape_string(library_dir, MAX_PATH);
320 printf("\nWriting inspircd_config.h...");
321 FILE * f = fopen("inspircd_config.h", "w");
322 fprintf(f, "/* Auto generated by configure, do not modify! */\n");
323 fprintf(f, "#ifndef __CONFIGURATION_AUTO__\n");
324 fprintf(f, "#define __CONFIGURATION_AUTO__\n\n");
326 fprintf(f, "#define CONFIG_USE_IOCP 1\n\n");
328 fprintf(f, "#define IPV6 1\n\n");
330 fprintf(f, "#define CONFIG_FILE \"%s/inspircd.conf\"\n", config_file);
331 fprintf(f, "#define MOD_PATH \"%s\"\n", mod_path);
332 fprintf(f, "#define SOMAXCONN_S \"128\"\n");
333 fprintf(f, "#define LIBRARYDIR \"%s\"\n", library_dir);
334 fprintf(f, "#define VERSION \"%s\"\n", version);
335 fprintf(f, "#define REVISION \"%s\"\n", revision_text);
338 vi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
341 fprintf(f, "#define SYSTEM \"Windows_x64 %u.%u.%u %s\"\n", vi.dwMajorVersion, vi.dwMinorVersion, vi.dwBuildNumber, vi.szCSDVersion);
343 fprintf(f, "#define SYSTEM \"Windows_x32 %u.%u.%u %s\"\n", vi.dwMajorVersion, vi.dwMinorVersion, vi.dwBuildNumber, vi.szCSDVersion);
345 fprintf(f, "#define MAXBUF 514\n");
347 fprintf(f, "\n#include \"inspircd_win32wrapper.h\"");
348 fprintf(f, "\n#include \"inspircd_namedpipe.h\"");
349 fprintf(f, "\n#include \"threadengines/threadengine_win32.h\"\n\n");
350 fprintf(f, "#endif\n\n");
353 sc(TGREEN); printf(" done\n"); sc(TNORMAL);
354 printf("Writing inspircd_se_config.h...");
356 f = fopen("inspircd_se_config.h", "w");
357 fprintf(f, "/* Auto generated by configure, do not modify or commit to svn! */\n");
358 fprintf(f, "#ifndef __CONFIGURATION_SOCKETENGINE__\n");
359 fprintf(f, "#define __CONFIGURATION_SOCKETENGINE__\n\n");
360 fprintf(f, "#include \"socketengines/socketengine_%s.h\"\n\n", use_iocp ? "iocp" : "select");
361 fprintf(f, "#endif\n\n");
364 sc(TGREEN); printf(" done\n"); sc(TNORMAL);
365 printf("Writing command and module compilation scripts...");
366 WriteCompileCommands();
367 WriteCompileModules();
368 sc(TGREEN); printf(" done\n"); sc(TNORMAL);
370 printf("\nconfigure is done.. exiting!\n");
373 /* Keeps files from modules/extra up to date if theyre copied into modules/ */
379 printf("\nUpdating extra modules in src/modules...\n");
382 HANDLE fh = FindFirstFile("..\\src\\modules\\extra\\*.*", &fd);
384 if(fh == INVALID_HANDLE_VALUE)
389 strcpy(dest, "..\\src\\modules\\");
390 strcat(dest, fd.cFileName);
391 strcpy(src, "..\\src\\modules\\extra\\");
392 strcat(src, fd.cFileName);
393 FILE* x = fopen(dest, "r");
397 CopyFile(src, dest, false);
398 sc(TGREEN); printf(" %s", fd.cFileName); sc(TNORMAL);
402 while (FindNextFile(fh, &fd));
419 HANDLE fh = FindFirstFile("..\\bin\\debug\\lib\\*.so", &fd);
421 HANDLE fh = FindFirstFile("..\\bin\\release\\lib\\*.so", &fd);
423 if(fh == INVALID_HANDLE_VALUE)
429 strcat(dest, " ..\\bin\\debug\\lib\\");
431 strcat(dest, " ..\\bin\\release\\lib\\");
433 strcat(dest, fd.cFileName);
435 while (FindNextFile(fh, &fd));
439 sprintf(command, "rebase.exe -v -b 10000000 -c baseaddr_commands.txt %s", dest);
440 printf("%s\n", command);
444 fh = FindFirstFile("..\\bin\\debug\\modules\\*.so", &fd);
446 fh = FindFirstFile("..\\bin\\release\\modules\\*.so", &fd);
448 if(fh == INVALID_HANDLE_VALUE)
456 strcat(dest, " ..\\bin\\debug\\modules\\");
458 strcat(dest, " ..\\bin\\release\\modules\\");
460 strcat(dest, fd.cFileName);
462 while (FindNextFile(fh, &fd));
464 sprintf(command, "rebase.exe -v -b 11000000 -c baseaddr_modules.txt %s", dest);
465 printf("%s\n", command);
472 void WriteCompileCommands()
474 char commands[300][100];
475 int command_count = 0;
476 printf("\n Finding Command Sources...\n");
478 HANDLE fh = FindFirstFile("..\\src\\commands\\cmd_*.cpp", &fd);
479 if(fh == INVALID_HANDLE_VALUE)
480 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");
486 strcpy(commands[command_count], fd.cFileName);
487 commands[command_count][strlen(fd.cFileName) - 4] = 0;
488 printf(" %s\n", commands[command_count]);
490 } while(FindNextFile(fh, &fd));
494 // Write our spiffy new makefile :D
495 // I am such a lazy fucker :P
496 FILE * f = fopen("..\\src\\commands\\commands.mak", "w");
498 time_t t = time(NULL);
499 fprintf(f, "# Generated at %s\n", ctime(&t));
500 fprintf(f, "all: makedir ");
502 // dump modules.. first time :)
503 for(int i = 0; i < command_count; ++i)
504 fprintf(f, "%s.so ", commands[i]);
506 fprintf(f, "\n.cpp.obj:\n");
510 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 /Gm /RTC1 /MDd /Fo\"Debug/\" /Fd\"Debug/vc70.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");
511 CreateDirectory("..\\src\\debug", NULL);
512 CreateDirectory("..\\bin\\debug\\bin", NULL);
513 CreateDirectory("..\\bin\\debug\\lib", NULL);
514 CreateDirectory("..\\bin\\debug\\modules", NULL);
516 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\" /EHsc /Gm /GL /MD /Fo\"Release/\" /Fd\"Release/vc70.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");
517 CreateDirectory("..\\src\\release", NULL);
518 CreateDirectory("..\\bin\\release\\bin", NULL);
519 CreateDirectory("..\\bin\\release\\lib", NULL);
520 CreateDirectory("..\\bin\\release\\modules", NULL);
524 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 /Gm /RTC1 /MDd /Fo\"Debug/\" /Fd\"Debug/vc70.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");
525 CreateDirectory("..\\src\\debug", NULL);
526 CreateDirectory("..\\bin\\debug\\bin", NULL);
527 CreateDirectory("..\\bin\\debug\\lib", NULL);
528 CreateDirectory("..\\bin\\debug\\modules", NULL);
530 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\" /EHsc /Gm /GL /MD /Fo\"Release/\" /Fd\"Release/vc70.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");
531 CreateDirectory("..\\src\\release", NULL);
532 CreateDirectory("..\\bin\\release\\bin", NULL);
533 CreateDirectory("..\\bin\\release\\lib", NULL);
534 CreateDirectory("..\\bin\\release\\modules", NULL);
539 fprintf(f, "makedir:\n if not exist debug mkdir debug\n if not exist ..\\..\\bin\\debug\\lib mkdir ..\\..\\bin\\debug\\lib\n\n");
541 fprintf(f, "makedir:\n if not exist release mkdir release\n if not exist ..\\..\\bin\\release\\lib mkdir ..\\..\\bin\\release\\lib\n\n");
544 // dump modules.. again the second and last time :)
545 for(int i = 0; i < command_count; ++i)
546 fprintf(f, "%s.so : %s.obj\n", commands[i], commands[i]);
552 void WriteCompileModules()
554 char modules[300][100];
555 int module_count = 0;
557 printf("Finding Modules...\n");
559 HANDLE fh = FindFirstFile("..\\src\\modules\\m_*.cpp", &fd);
560 if(fh == INVALID_HANDLE_VALUE)
561 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");
567 strcpy(modules[module_count], fd.cFileName);
568 modules[module_count][strlen(fd.cFileName) - 4] = 0;
569 printf(" %s\n", modules[module_count]);
571 } while(FindNextFile(fh, &fd));
575 // Write our spiffy new makefile :D
576 // I am such a lazy fucker :P
577 FILE * f = fopen("..\\src\\modules\\modules.mak", "w");
579 time_t t = time(NULL);
580 fprintf(f, "# Generated at %s\n", ctime(&t));
581 fprintf(f, "all: makedir ");
583 // dump modules.. first time :)
584 for(int i = 0; i < module_count; ++i)
585 fprintf(f, "%s.so ", modules[i]);
587 fprintf(f, "\n.cpp.obj:\n");
591 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 /Gm /RTC1 /MDd /Fo\"Debug/\" /Fd\"Debug/vc70.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");
592 CreateDirectory("..\\src\\modules\\debug_x64", NULL);
594 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\" /EHsc /Gm /GL /MD /Fo\"Release/\" /Fd\"Release/vc70.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");
595 CreateDirectory("..\\src\\modules\\release_x64", NULL);
599 fprintf(f, " cl /nologo -Dssize_t=long /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 /Gm /RTC1 /MDd /Fo\"Debug/\" /Fd\"Debug/vc70.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");
600 CreateDirectory("..\\src\\modules\\debug", NULL);
601 CreateDirectory("..\\src\\modules\\debug\\lib", NULL);
602 CreateDirectory("..\\src\\modules\\debug\\modules", NULL);
603 CreateDirectory("..\\src\\modules\\debug\\bin", NULL);
605 fprintf(f, " cl /nologo -Dssize_t=long /LD /Od /I \".\" /I \"../../include\" /I \"../../include/modes\" /I \"../../include/modules\" /I \"../../win\" /D \"WIN32\" /D \"_CONSOLE\" /D \"_MBCS\" /D \"DLL_BUILD\" /EHsc /Gm /GL /MD /Fo\"Release/\" /Fd\"Release/vc70.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");
606 CreateDirectory("..\\src\\modules\\release", NULL);
607 CreateDirectory("..\\src\\modules\\release\\lib", NULL);
608 CreateDirectory("..\\src\\modules\\release\\modules", NULL);
609 CreateDirectory("..\\src\\modules\\release\\bin", NULL);
614 fprintf(f, "makedir:\n if not exist debug mkdir debug\n if not exist ..\\..\\bin\\debug\\modules mkdir ..\\..\\bin\\debug\\modules\n\n");
616 fprintf(f, "makedir:\n if not exist release mkdir release\n if not exist ..\\..\\bin\\release\\modules mkdir ..\\..\\bin\\release\\modules\n\n");
619 // dump modules.. again the second and last time :)
620 for(int i = 0; i < module_count; ++i)
621 fprintf(f, "%s.so : %s.obj\n", modules[i], modules[i]);