Author: sserapion Date: Mon Feb 15 07:02:48 2010 New Revision: 45595
URL: http://svn.reactos.org/svn/reactos?rev=45595&view=rev Log: Sync tools to 45592
Added: branches/ros-amd64-bringup/reactos/tools/log2lines/cmd.c - copied unchanged from r45594, trunk/reactos/tools/log2lines/cmd.c branches/ros-amd64-bringup/reactos/tools/log2lines/cmd.h - copied unchanged from r45594, trunk/reactos/tools/log2lines/cmd.h branches/ros-amd64-bringup/reactos/tools/rbuild/backend/msvc/s_as_mscpp.rules - copied unchanged from r45594, trunk/reactos/tools/rbuild/backend/msvc/s_as_mscpp.rules branches/ros-amd64-bringup/reactos/tools/rbuild/backend/msvc/spec.rules - copied unchanged from r45594, trunk/reactos/tools/rbuild/backend/msvc/spec.rules branches/ros-amd64-bringup/reactos/tools/rbuild/backend/msvc/vspropsmaker.cpp - copied unchanged from r45594, trunk/reactos/tools/rbuild/backend/msvc/vspropsmaker.cpp Modified: branches/ros-amd64-bringup/reactos/tools/ (props changed) branches/ros-amd64-bringup/reactos/tools/hpp/ (props changed) branches/ros-amd64-bringup/reactos/tools/log2lines/cache.c branches/ros-amd64-bringup/reactos/tools/log2lines/cache.h branches/ros-amd64-bringup/reactos/tools/log2lines/compat.h branches/ros-amd64-bringup/reactos/tools/log2lines/config.h branches/ros-amd64-bringup/reactos/tools/log2lines/help.c branches/ros-amd64-bringup/reactos/tools/log2lines/help.h branches/ros-amd64-bringup/reactos/tools/log2lines/image.c branches/ros-amd64-bringup/reactos/tools/log2lines/image.h branches/ros-amd64-bringup/reactos/tools/log2lines/list.c branches/ros-amd64-bringup/reactos/tools/log2lines/list.h branches/ros-amd64-bringup/reactos/tools/log2lines/log2lines.c branches/ros-amd64-bringup/reactos/tools/log2lines/log2lines.mak branches/ros-amd64-bringup/reactos/tools/log2lines/options.c branches/ros-amd64-bringup/reactos/tools/log2lines/options.h branches/ros-amd64-bringup/reactos/tools/log2lines/revision.c branches/ros-amd64-bringup/reactos/tools/log2lines/revision.h branches/ros-amd64-bringup/reactos/tools/log2lines/stat.c branches/ros-amd64-bringup/reactos/tools/log2lines/stat.h branches/ros-amd64-bringup/reactos/tools/log2lines/util.c branches/ros-amd64-bringup/reactos/tools/log2lines/util.h branches/ros-amd64-bringup/reactos/tools/log2lines/version.h branches/ros-amd64-bringup/reactos/tools/rbuild/backend/mingw/compilers/gcc.mak branches/ros-amd64-bringup/reactos/tools/rbuild/backend/mingw/linkers/ld.mak branches/ros-amd64-bringup/reactos/tools/rbuild/backend/mingw/mingw.cpp branches/ros-amd64-bringup/reactos/tools/rbuild/backend/mingw/modulehandler.cpp branches/ros-amd64-bringup/reactos/tools/rbuild/backend/mingw/modulehandler.h branches/ros-amd64-bringup/reactos/tools/rbuild/backend/msvc/msvc.cpp branches/ros-amd64-bringup/reactos/tools/rbuild/backend/msvc/msvc.h branches/ros-amd64-bringup/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp branches/ros-amd64-bringup/reactos/tools/rbuild/module.cpp branches/ros-amd64-bringup/reactos/tools/rbuild/project.cpp branches/ros-amd64-bringup/reactos/tools/rbuild/rbuild.cpp branches/ros-amd64-bringup/reactos/tools/rbuild/rbuild.h branches/ros-amd64-bringup/reactos/tools/rbuild/rbuild.mak branches/ros-amd64-bringup/reactos/tools/rbuild/rbuild.vcproj branches/ros-amd64-bringup/reactos/tools/rbuild_helper/ (props changed) branches/ros-amd64-bringup/reactos/tools/rsym/rsym.c (props changed) branches/ros-amd64-bringup/reactos/tools/rsym/rsym.h (props changed) branches/ros-amd64-bringup/reactos/tools/rsym/rsym.mak (props changed) branches/ros-amd64-bringup/reactos/tools/rsym/rsym_common.c (props changed)
Propchange: branches/ros-amd64-bringup/reactos/tools/ ------------------------------------------------------------------------------ svn:mergeinfo = /trunk/reactos/tools:39350-44067,44371-45594
Propchange: branches/ros-amd64-bringup/reactos/tools/hpp/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Mon Feb 15 07:02:48 2010 @@ -1,1 +1,1 @@ -/trunk/reactos/tools/hpp:40091-40500,40600-45466 +/trunk/reactos/tools/hpp:40091-40500,40600-45594
Modified: branches/ros-amd64-bringup/reactos/tools/log2lines/cache.c URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools/... ============================================================================== --- branches/ros-amd64-bringup/reactos/tools/log2lines/cache.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/tools/log2lines/cache.c [iso-8859-1] Mon Feb 15 07:02:48 2010 @@ -11,12 +11,10 @@ #include "util.h" #include "version.h" #include "compat.h" -#include "config.h" -#include "list.h" #include "options.h" #include "help.h" #include "image.h" -#include "revision.h" + #include "log2lines.h"
static char *cache_name; @@ -77,11 +75,6 @@ char *check_iso; char *check_dir;
- if (opt_Revision) - { - revinfo.rev = getRevision(NULL, 1); - revinfo.range = DEF_RANGE; - } check_iso = strrchr(opt_dir, '.'); l2l_dbg(1, "Checking directory: %s\n", opt_dir); if (check_iso && PATHCMP(check_iso, ".7z") == 0) @@ -139,11 +132,6 @@ return 1; } } - if (opt_Revision) - { - revinfo.buildrev = getTBRevision(opt_dir); - l2l_dbg(1, "Trunk build revision: %d\n", revinfo.buildrev); - } cache_name = malloc(MAX_PATH); tmp_name = malloc(MAX_PATH); strcpy(cache_name, opt_dir); @@ -238,10 +226,11 @@ l2l_dbg(0, "Scanning %s ...\n", opt_dir); snprintf(Line, LINESIZE, DIR_FMT, opt_dir, tmp_name); l2l_dbg(1, "Executing: %s\n", Line); - if (system(Line) < 0) + if (system(Line) != 0) { l2l_dbg(0, "Cannot list directory %s\n", opt_dir); l2l_dbg(1, "Failed to execute: '%s'\n", Line); + remove(tmp_name); return 2; } l2l_dbg(0, "Creating cache ...");
Modified: branches/ros-amd64-bringup/reactos/tools/log2lines/cache.h URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools/... ============================================================================== --- branches/ros-amd64-bringup/reactos/tools/log2lines/cache.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/tools/log2lines/cache.h [iso-8859-1] Mon Feb 15 07:02:48 2010 @@ -13,3 +13,5 @@ int create_cache(int force, int skipImageBase);
#endif /* __L2L_CACHE_H__ */ + +/* EOF */
Modified: branches/ros-amd64-bringup/reactos/tools/log2lines/compat.h URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools/... ============================================================================== --- branches/ros-amd64-bringup/reactos/tools/log2lines/compat.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/tools/log2lines/compat.h [iso-8859-1] Mon Feb 15 07:02:48 2010 @@ -37,3 +37,5 @@
#endif /* __L2L_COMPAT_H__ */ + +/* EOF */
Modified: branches/ros-amd64-bringup/reactos/tools/log2lines/config.h URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools/... ============================================================================== --- branches/ros-amd64-bringup/reactos/tools/log2lines/config.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/tools/log2lines/config.h [iso-8859-1] Mon Feb 15 07:02:48 2010 @@ -15,7 +15,6 @@ #define CACHEFILE "log2lines.cache" #define TRKBUILDPREFIX "bootcd-" #define SVN_PREFIX "/trunk/reactos/" -#define KDBG_PROMPT "kdbg>" #define PIPEREAD_CMD "piperead -c"
@@ -32,3 +31,5 @@ #define NAMESIZE 80
#endif /* __L2L_CONFIG_H__ */ + +/* EOF */
Modified: branches/ros-amd64-bringup/reactos/tools/log2lines/help.c URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools/... ============================================================================== --- branches/ros-amd64-bringup/reactos/tools/log2lines/help.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/tools/log2lines/help.c [iso-8859-1] Mon Feb 15 07:02:48 2010 @@ -10,6 +10,7 @@ #include "compat.h" #include "config.h" #include "options.h" +#include "cmd.h" #include "help.h"
char *verboseUsage = @@ -76,7 +77,7 @@ " - regscan[,<range>]:\n" " Scan for regression candidates. Essentially it tries to find\n" " matches between the SVN log entries and the sources hit by\n" -" the backtrace.\n" +" a backtrace (bt) command.\n" " <range> is the amount of revisions to look back from the build\n" " revision (default 500)\n" " The output of '-R regscan' is printed after EOF. The 'Changed path'\n" @@ -130,7 +131,25 @@ " <path to 7z>: Specify path to 7z. See also option -d.\n" " Default: '7z'\n" "\n" -"Examples:\n" +"CLI escape commands:\n" +" It is possible to change options and perform actions from the 'kdb:>' prompt\n" +" By prepending the `(backquote) character to the option.\n" +" Example: 'kdb:> `l new.log' changes the current logfile to 'new.log'.\n" +" Flag options like 'b' are given a numeric value of 0 (off) or 1 (on).\n" +" Options accepting a string as argument can be cleared by the value '" KDBG_ESC_OFF "'.\n" +" Some ClI commands are read only or not (entirely) implemented.\n" +" If no value is provided, the current one is printed.\n" +" There are only a few extra ClI commands or with different behaviour:\n" +" - `h : shows this helptext (without exiting)\n" +" - `q : quits log2lines\n" +" - `R regscan : the output is printed immediately (do a 'bt' first)\n" +" - `R regclear : clears previous regscan matches\n" +" - `s : the output is printed immediately\n" +" - `s clear : clears all statistics.\n" +" - `S : only <context> and <add> can be set.\n" +" - `v <level> : sets the current debug loglevel\n" +"\n" +"Option Examples:\n" " Setup: A VMware machine with its serial port set to: '\\.\pipe\kdbg'.\n\n" " Just recreate cache after a svn update or a new module has been added:\n" " log2lines -F\n\n" @@ -179,7 +198,42 @@ " <msi.dll:5262 (dll/win32/msi/action.c:2665 (ACTION_ProcessComponents))>\n" " | R--- Conflict : source(44191) > build(43850)\n" " | 2664 else\n" -" | 2665 rc = MSIREG_OpenUserDataKey(comp->ComponentId,\n" +" | 2665 rc = MSIREG_OpenUserDataKey(comp->ComponentId,\n\n" +"CLI Examples: (some are based on the option examples above)\n" +" Use '`R check' to show that action.c has been changed after the build:\n" +" kdb:> `R check\n" +" | L2L- -R is "check" (changed)\n" +" kdb:> bt\n" +" <msi.dll:35821 (dll/win32/msi/registry.c:781 (MSIREG_OpenUserDataKey))>\n" +" | 0780 if (create)\n" +" | 0781 rc = RegCreateKeyW(HKEY_LOCAL_MACHINE, keypath, key);\n" +" <msi.dll:5262 (dll/win32/msi/action.c:2665 (ACTION_ProcessComponents))>\n" +" | R--- Conflict : source(44191) > build(43850)\n" +" | 2664 else\n" +" | 2665 rc = MSIREG_OpenUserDataKey(comp->ComponentId,\n\n" +" kdb:>\n\n" +" Generate source lines. Show 2 lines of context plus 1 additional line.\n" +" The -Uu options are dependent on -S:\n" +" kdb:> `S 2+1\n" +" | L2L- -u Undo is 1 (changed)\n" +" | L2L- -U Undo and reprocess is 1 (changed)\n" +" | L2L- -S Sources option is 2+1,"C:\ROS\reactos\" \n" +" | L2L- (Setting source tree not implemented)\n" +" kdb:> bt\n" +" <msi.dll:2e35d (dll/win32/msi/msiquery.c:189 (MSI_IterateRecords))>\n" +" | 0188 {\n" +" | 0189 r = MSI_ViewFetch( view, &rec );\n" +" | ----\n" +" | 0190 if( r != ERROR_SUCCESS )\n" +" kdb:>\n\n" +" Change logfile:\n" +" kdb:> `l\n" +" | L2L- -l logfile is "" (unchanged)\n" +" kdb:> `l new.log\n" +" | L2L- -l logfile is "new.log" (changed)\n" +" kdb:> `l off\n" +" | L2L- -l logfile is "" (changed)\n" +" kdb:>\n" "\n";
void
Modified: branches/ros-amd64-bringup/reactos/tools/log2lines/help.h URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools/... ============================================================================== --- branches/ros-amd64-bringup/reactos/tools/log2lines/help.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/tools/log2lines/help.h [iso-8859-1] Mon Feb 15 07:02:48 2010 @@ -13,3 +13,5 @@ void usage(int verbose);
#endif /* __L2L_HELP_H__ */ + +/* EOF */
Modified: branches/ros-amd64-bringup/reactos/tools/log2lines/image.c URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools/... ============================================================================== --- branches/ros-amd64-bringup/reactos/tools/log2lines/image.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/tools/log2lines/image.c [iso-8859-1] Mon Feb 15 07:02:48 2010 @@ -4,6 +4,7 @@ * * - Image functions for symbol info */ +#include <sys/stat.h> #include <errno.h> #include <string.h> #include <rsym.h>
Modified: branches/ros-amd64-bringup/reactos/tools/log2lines/image.h URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools/... ============================================================================== --- branches/ros-amd64-bringup/reactos/tools/log2lines/image.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/tools/log2lines/image.h [iso-8859-1] Mon Feb 15 07:02:48 2010 @@ -20,3 +20,5 @@
#endif /* __L2L_IMAGE_H__ */ + +/* EOF */
Modified: branches/ros-amd64-bringup/reactos/tools/log2lines/list.c URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools/... ============================================================================== --- branches/ros-amd64-bringup/reactos/tools/log2lines/list.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/tools/log2lines/list.c [iso-8859-1] Mon Feb 15 07:02:48 2010 @@ -66,6 +66,19 @@ return pentry; }
+void list_clear(PLIST list) +{ + PLIST_MEMBER pentry = list->phead; + PLIST_MEMBER pnext; + while (pentry) + { + pnext = pentry->pnext; + entry_delete(pentry); + pentry = pnext; + } + list->phead = list->ptail = NULL; +} + #if 0 LIST_MEMBER * entry_remove(LIST *list, LIST_MEMBER *pentry)
Modified: branches/ros-amd64-bringup/reactos/tools/log2lines/list.h URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools/... ============================================================================== --- branches/ros-amd64-bringup/reactos/tools/log2lines/list.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/tools/log2lines/list.h [iso-8859-1] Mon Feb 15 07:02:48 2010 @@ -12,7 +12,6 @@
typedef struct list_struct { - off_t st_size; PLIST_MEMBER phead; PLIST_MEMBER ptail; } LIST,*PLIST; @@ -22,5 +21,8 @@ PLIST_MEMBER entry_insert(PLIST list, PLIST_MEMBER pentry); PLIST_MEMBER cache_entry_create(char *Line); PLIST_MEMBER sources_entry_create(PLIST list, char *path, char *prefix); +void list_clear(PLIST list);
#endif /* __L2L_LIST_H__ */ + +/* EOF */
Modified: branches/ros-amd64-bringup/reactos/tools/log2lines/log2lines.c URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools/... ============================================================================== --- branches/ros-amd64-bringup/reactos/tools/log2lines/log2lines.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/tools/log2lines/log2lines.c [iso-8859-1] Mon Feb 15 07:02:48 2010 @@ -2,7 +2,7 @@ * ReactOS log2lines * Written by Jan Roeloffzen * - * - Initialization and main loop + * - Initialization, translation and main loop */
#include <errno.h> @@ -13,17 +13,18 @@ #include "util.h" #include "version.h" #include "compat.h" -#include "config.h" -#include "list.h" #include "options.h" #include "image.h" #include "cache.h" #include "log2lines.h" #include "help.h" +#include "cmd.h"
static FILE *stdIn = NULL; static FILE *stdOut = NULL; +static const char *kdbg_prompt = KDBG_PROMPT; +static const char *kdbg_cont = KDBG_CONT;
LIST sources; LINEINFO lastLine; @@ -65,6 +66,8 @@ i++; } fclose(src); + if ( i < min ) + log(outFile, "| S--- source has only %d lines! (check source/revision)\n", i); } else l2l_dbg(1, "Can't open: %s (check " SOURCES_ENV ")\n", s); @@ -332,7 +335,7 @@ /* Strip all lines added by this tool: */ char buf[NAMESIZE]; if (sscanf(s, "| %s", buf) == 1) - if (buf[0] == '0' || strcmp(buf, "----") == 0 || strcmp(buf, "R---") == 0 || atoi(buf)) + if (buf[0] == '0' || strcmp(buf, "----") == 0 || strcmp(buf, "L2L-") == 0 || strcmp(buf, "S---") == 0 || strcmp(buf, "R---") == 0 || atoi(buf)) res = 0; }
@@ -410,6 +413,9 @@ int c; unsigned char ch; int i = 0; + const char *pc = kdbg_cont; + const char *p = kdbg_prompt; + const char *p_eos = p + sizeof(KDBG_PROMPT) - 1; //end of string pos
if (Line && path && LineOut) { @@ -418,23 +424,53 @@ { while ((c = fgetc(inFile)) != EOF) { + if (opt_quit)break; + ch = (unsigned char)c; if (!opt_raw) { switch (ch) { case '\n': - translate_line(outFile, Line, path, LineOut); + if ( strncmp(Line, KDBG_DISCARD, sizeof(KDBG_DISCARD)-1) == 0 ) + { + memset(Line, '\0', LINESIZE); // flushed + } + else + { + Line[1] = handle_escape_cmd(outFile, Line, path, LineOut); + if (Line[1] != KDBG_ESC_CHAR) + { + if (p == p_eos) + { + //kdbg prompt, so already echoed char by char + memset(Line, '\0', LINESIZE); + translate_char(c, outFile); + } + else + { + translate_line(outFile, Line, path, LineOut); + translate_char(c, outFile); + report(outFile); + } + } + } i = 0; - translate_char(c, outFile); - report(outFile); + p = kdbg_prompt; + pc = kdbg_cont; break; case '<': i = 0; Line[i++] = ch; break; case '>': - if (i) + if (ch == *p) + { + p = p_eos; + translate_line(outFile, Line, path, LineOut); + } + + if (p != p_eos) { if (i < LINESIZE) { @@ -452,21 +488,27 @@ i = 0; break; default: - if (i) + if (ch == *p)p++; + if (ch == *pc)pc++; + if (i < LINESIZE) { - if (i < LINESIZE) + Line[i++] = ch; + if (p == p_eos) { - Line[i++] = ch; + translate_char(c, outFile); } - else + else if (!*pc) { translate_line(outFile, Line, path, LineOut); - translate_char(c, outFile); i = 0; } } else + { + translate_line(outFile, Line, path, LineOut); translate_char(c, outFile); + i = 0; + } } } else @@ -477,6 +519,8 @@ { // Line by line, slightly faster but less interactive while (fgets(Line, LINESIZE, inFile) != NULL) { + if (opt_quit)break; + if (!opt_raw) { translate_line(outFile, Line, path, LineOut); @@ -552,26 +596,8 @@ read_cache(); l2l_dbg(4, "Cache read complete\n");
- if (*opt_logFile) - { - logFile = fopen(opt_logFile, "a"); - if (logFile) - { - // disable buffering so fflush is not needed - if (!opt_buffered) - { - l2l_dbg(1, "Disabling log buffering on %s\n", opt_logFile); - setbuf(logFile, NULL); - } - else - l2l_dbg(1, "Enabling log buffering on %s\n", opt_logFile); - } - else - { - l2l_dbg(0, "Could not open logfile %s (%s)\n", opt_logFile, strerror(errno)); - return 2; - } - } + if (set_LogFile(logFile)) + return 2; l2l_dbg(4, "opt_logFile processed\n");
if (opt_Pipe) @@ -584,8 +610,6 @@ l2l_dbg(0, "Could not popen '%s' (%s)\n", opt_Pipe, strerror(errno)); free(opt_Pipe); opt_Pipe = NULL; } - - free(opt_Pipe); opt_Pipe = NULL; } l2l_dbg(4, "opt_Pipe processed\n");
Modified: branches/ros-amd64-bringup/reactos/tools/log2lines/log2lines.mak URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools/... ============================================================================== --- branches/ros-amd64-bringup/reactos/tools/log2lines/log2lines.mak [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/tools/log2lines/log2lines.mak [iso-8859-1] Mon Feb 15 07:02:48 2010 @@ -30,6 +30,7 @@ $(LOG2LINES_BASE_)image.c \ $(LOG2LINES_BASE_)stat.c \ $(LOG2LINES_BASE_)revision.c \ + $(LOG2LINES_BASE_)cmd.c \ $(LOG2LINES_BASE_)log2lines.c \ $(RSYM_BASE_)rsym_common.c
@@ -83,6 +84,10 @@ $(ECHO_HOSTCC) ${host_gcc} $(LOG2LINES_HOST_CFLAGS) -c $< -o $@
+$(LOG2LINES_INT_)cmd.o: $(LOG2LINES_BASE_)cmd.c | $(LOG2LINES_INT) + $(ECHO_HOSTCC) + ${host_gcc} $(LOG2LINES_HOST_CFLAGS) -c $< -o $@ + .PHONY: log2lines_clean log2lines_clean: -@$(rm) $(LOG2LINES_TARGET) $(LOG2LINES_OBJECTS) 2>$(NUL)
Modified: branches/ros-amd64-bringup/reactos/tools/log2lines/options.c URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools/... ============================================================================== --- branches/ros-amd64-bringup/reactos/tools/log2lines/options.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/tools/log2lines/options.c [iso-8859-1] Mon Feb 15 07:02:48 2010 @@ -13,6 +13,7 @@ #include "compat.h" #include "config.h" #include "help.h" +#include "log2lines.h" #include "options.h"
char *optchars = "bcd:fFhl:mMP:rR:sS:tTuUvz:"; @@ -25,6 +26,8 @@ int opt_mark = 0; // -m int opt_Mark = 0; // -M char *opt_Pipe = NULL; // -P +int opt_quit = 0; // -q (cli only) +int opt_cli = 0; // (cli internal) int opt_raw = 0; // -r int opt_stats = 0; // -s int opt_Source = 0; // -S <opt_Source>[+<opt_SrcPlus>][,<sources_path>] @@ -46,29 +49,45 @@ char *s;
strcpy(opt_dir, ""); + strcpy(opt_logFile, ""); + strcpy(opt_7z, CMD_7Z); strcpy(opt_SourcesPath, ""); if ((s = getenv(SOURCES_ENV))) strcpy(opt_SourcesPath, s); + revinfo.rev = getRevision(NULL, 1); + revinfo.range = DEF_RANGE; + revinfo.buildrev = getTBRevision(opt_dir); + l2l_dbg(1, "Trunk build revision: %d\n", revinfo.buildrev);
strcpy(opt_scanned, ""); for (i = 1; i < argc; i++) { - if (strcmp(argv[i],"-P")==0) + if ((argv[i][0] == '-') && (i+1 < argc)) { - //Because its argument can contain spaces we cant use getopt(), a known bug: - if (i+1 < argc) + //Because these arguments can contain spaces we cant use getopt(), a known bug: + switch (argv[i][1]) { + case 'd': + strcpy(opt_dir, argv[i+1]); + break; + case 'l': + strcpy(opt_logFile, argv[i+1]); + break; + case 'P': free(opt_Pipe); opt_Pipe = malloc(LINESIZE); strcpy(opt_Pipe, argv[i+1]); + break; + case 'z': + strcpy(opt_7z, argv[i+1]); + break; } } strcat(opt_scanned, argv[i]); strcat(opt_scanned, " "); } + l2l_dbg(4,"opt_scanned=[%s]\n",opt_scanned); - strcpy(opt_logFile, ""); - strcpy(opt_7z, CMD_7Z);
return 0; } @@ -91,7 +110,7 @@ break; case 'd': optCount++; - strcpy(opt_dir, optarg); + //just count, see optionInit() break; case 'f': opt_force++; @@ -107,7 +126,7 @@ break; case 'l': optCount++; - strcpy(opt_logFile, optarg); + //just count, see optionInit() break; case 'm': opt_mark++; @@ -120,7 +139,7 @@ break; case 'P': optCount++; - //just count, see above + //just count, see optionInit() break; case 'R': optCount++; @@ -137,6 +156,12 @@ if (i == 1) sscanf(optarg, "%*d,%s", opt_SourcesPath); l2l_dbg(3, "Sources option parse result: %d+%d,"%s"\n", opt_Source, opt_SrcPlus, opt_SourcesPath); + if (opt_Source) + { + /* need to retranslate for source info: */ + opt_undo++; + opt_redo++; + } break; case 't': opt_twice++; @@ -166,15 +191,14 @@ } optCount++; } + if(opt_console) + { + l2l_dbg(2, "Note: use 's' command in console mode. Statistics option disabled\n"); + opt_stats = 0; + } if (opt_SourcesPath[0]) { strcat(opt_SourcesPath, PATH_STR); - } - if (opt_Source) - { - /* need to retranslate for source info: */ - opt_undo++; - opt_redo++; } if (!opt_dir[0]) {
Modified: branches/ros-amd64-bringup/reactos/tools/log2lines/options.h URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools/... ============================================================================== --- branches/ros-amd64-bringup/reactos/tools/log2lines/options.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/tools/log2lines/options.h [iso-8859-1] Mon Feb 15 07:02:48 2010 @@ -18,6 +18,8 @@ extern int opt_mark; // -m extern int opt_Mark; // -M extern char *opt_Pipe; // -P +extern int opt_quit; // -q (cli only) +extern int opt_cli; // (cli internal) extern int opt_raw; // -r extern int opt_stats; // -s extern int opt_Source; // -S <opt_Source>[+<opt_SrcPlus>][,<sources_path>] @@ -38,3 +40,5 @@ int optionParse(int argc, const char **argv);
#endif /* __L2L_OPTIONS_H__ */ + +/* EOF */
Modified: branches/ros-amd64-bringup/reactos/tools/log2lines/revision.c URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools/... ============================================================================== --- branches/ros-amd64-bringup/reactos/tools/log2lines/revision.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/tools/log2lines/revision.c [iso-8859-1] Mon Feb 15 07:02:48 2010 @@ -13,7 +13,6 @@ #include "compat.h" #include "util.h" #include "options.h" -#include "revision.h" #include "log2lines.h"
static void @@ -195,7 +194,7 @@ char path[MAX_PATH]; char path2[MAX_PATH]; int wflag = 0; - log(outFile, "\nRegression candidates:\n"); + clilog(outFile, "Regression candidates:\n"); while (( pos = findRev(finx, &r) )) { if (r < (revinfo.buildrev - revinfo.range)) @@ -216,11 +215,11 @@ { if (wflag == 1) { - log(outFile, "%sChanged paths:\n", line); + clilog(outFile, "%sChanged paths:\n", line); summ.regfound++; wflag = 2; } - log(outFile, "%s", line2); + clilog(outFile, "%s", line2); } } else @@ -229,11 +228,11 @@ if (wflag == 2) { int i = 0; - log(outFile, "\n"); + clilog(outFile, "\n"); while (fgets(line2, LINESIZE, flog)) { i++; - log(outFile, "%s", line2); + clilog(outFile, "%s", line2); if (strncmp(LOGBOTTOM, line2, sizeof(LOGBOTTOM) - 1) == 0) break; }
Modified: branches/ros-amd64-bringup/reactos/tools/log2lines/revision.h URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools/... ============================================================================== --- branches/ros-amd64-bringup/reactos/tools/log2lines/revision.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/tools/log2lines/revision.h [iso-8859-1] Mon Feb 15 07:02:48 2010 @@ -26,3 +26,5 @@ int updateSvnlog(void);
#endif /* __L2L_REVISION_H__ */ + +/* EOF */
Modified: branches/ros-amd64-bringup/reactos/tools/log2lines/stat.c URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools/... ============================================================================== --- branches/ros-amd64-bringup/reactos/tools/log2lines/stat.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/tools/log2lines/stat.c [iso-8859-1] Mon Feb 15 07:02:48 2010 @@ -10,7 +10,7 @@
#include "version.h" #include "options.h" -#include "stat.h" +#include "util.h" #include "log2lines.h"
void @@ -18,22 +18,22 @@ { if (outFile) { - fprintf(outFile, "\n*** LOG2LINES SUMMARY ***\n"); - fprintf(outFile, "Translated: %d\n", psumm->translated); - fprintf(outFile, "Reverted: %d\n", psumm->undo); - fprintf(outFile, "Retranslated: %d\n", psumm->redo); - fprintf(outFile, "Skipped: %d\n", psumm->skipped); - fprintf(outFile, "Differ: %d\n", psumm->diff); - fprintf(outFile, "Differ (function/source): %d\n", psumm->majordiff); - fprintf(outFile, "Revision conflicts: %d\n", psumm->revconflicts); - fprintf(outFile, "Regression candidates: %d\n", psumm->regfound); - fprintf(outFile, "Offset error: %d\n", psumm->offset_errors); - fprintf(outFile, "Total: %d\n", psumm->total); - fprintf(outFile, "-------------------------------\n"); - fprintf(outFile, "Log2lines version: " LOG2LINES_VERSION "\n"); - fprintf(outFile, "Directory: %s\n", opt_dir); - fprintf(outFile, "Passed options: %s\n", opt_scanned); - fprintf(outFile, "-------------------------------\n"); + clilog(outFile, "*** LOG2LINES SUMMARY ***\n"); + clilog(outFile, "Translated: %d\n", psumm->translated); + clilog(outFile, "Reverted: %d\n", psumm->undo); + clilog(outFile, "Retranslated: %d\n", psumm->redo); + clilog(outFile, "Skipped: %d\n", psumm->skipped); + clilog(outFile, "Differ: %d\n", psumm->diff); + clilog(outFile, "Differ (function/source): %d\n", psumm->majordiff); + clilog(outFile, "Revision conflicts: %d\n", psumm->revconflicts); + clilog(outFile, "Regression candidates: %d\n", psumm->regfound); + clilog(outFile, "Offset error: %d\n", psumm->offset_errors); + clilog(outFile, "Total: %d\n", psumm->total); + clilog(outFile, "-------------------------------\n"); + clilog(outFile, "Log2lines version: " LOG2LINES_VERSION "\n"); + clilog(outFile, "Directory: %s\n", opt_dir); + clilog(outFile, "Passed options: %s\n", opt_scanned); + clilog(outFile, "-------------------------------\n"); } }
Modified: branches/ros-amd64-bringup/reactos/tools/log2lines/stat.h URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools/... ============================================================================== --- branches/ros-amd64-bringup/reactos/tools/log2lines/stat.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/tools/log2lines/stat.h [iso-8859-1] Mon Feb 15 07:02:48 2010 @@ -28,3 +28,5 @@ void stat_clear(PSUMM psumm);
#endif /* __L2L_STAT_H__ */ + +/* EOF */
Modified: branches/ros-amd64-bringup/reactos/tools/log2lines/util.c URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools/... ============================================================================== --- branches/ros-amd64-bringup/reactos/tools/log2lines/util.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/tools/log2lines/util.c [iso-8859-1] Mon Feb 15 07:02:48 2010 @@ -14,6 +14,39 @@ #include "compat.h" #include "util.h" #include "options.h" + +int +set_LogFile(FILE *logFile) +{ + if (*opt_logFile) + { + if (logFile) + fclose(logFile); + logFile = NULL; + + if (strcmp(opt_logFile,"none") == 0) + return 0; //just close + + logFile = fopen(opt_logFile, "a"); + if (logFile) + { + // disable buffering so fflush is not needed + if (!opt_buffered) + { + l2l_dbg(1, "Disabling log buffering on %s\n", opt_logFile); + setbuf(logFile, NULL); + } + else + l2l_dbg(1, "Enabling log buffering on %s\n", opt_logFile); + } + else + { + l2l_dbg(0, "Could not open logfile %s (%s)\n", opt_logFile, strerror(errno)); + return 2; + } + } + return 0; +}
int file_exists(char *name)
Modified: branches/ros-amd64-bringup/reactos/tools/log2lines/util.h URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools/... ============================================================================== --- branches/ros-amd64-bringup/reactos/tools/log2lines/util.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/tools/log2lines/util.h [iso-8859-1] Mon Feb 15 07:02:48 2010 @@ -8,12 +8,28 @@ #ifndef __L2L_UTIL_H__ #define __L2L_UTIL_H__
+#include <stdio.h> + +#include "cmd.h"
#define log(outFile, fmt, ...) \ { \ fprintf(outFile, fmt, ##__VA_ARGS__); \ if (logFile) \ fprintf(logFile, fmt, ##__VA_ARGS__); \ + } + +#define esclog(outFile, fmt, ...) \ + { \ + log(outFile, KDBG_ESC_RESP fmt, ##__VA_ARGS__); \ + } + +#define clilog(outFile, fmt, ...) \ + { \ + if (opt_cli) \ + esclog(outFile, fmt, ##__VA_ARGS__) \ + else \ + log(outFile, fmt, ##__VA_ARGS__); \ }
#define l2l_dbg(level, ...) \ @@ -29,5 +45,8 @@ long my_atoi(const char *a); int isOffset(const char *a); int copy_file(char *src, char *dst); +int set_LogFile(FILE *logFile);
#endif /* __L2L_UTIL_H__ */ + +/* EOF */
Modified: branches/ros-amd64-bringup/reactos/tools/log2lines/version.h URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools/... ============================================================================== --- branches/ros-amd64-bringup/reactos/tools/log2lines/version.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/tools/log2lines/version.h [iso-8859-1] Mon Feb 15 07:02:48 2010 @@ -8,6 +8,8 @@ #ifndef __L2L_VERSION_H__ #define __L2L_VERSION_H__
-#define LOG2LINES_VERSION "1.12b" +#define LOG2LINES_VERSION "2.1"
#endif /* __L2L_VERSION_H__ */ + +/* EOF */
Modified: branches/ros-amd64-bringup/reactos/tools/rbuild/backend/mingw/compilers/gcc.mak URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools/... ============================================================================== --- branches/ros-amd64-bringup/reactos/tools/rbuild/backend/mingw/compilers/gcc.mak [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/tools/rbuild/backend/mingw/compilers/gcc.mak [iso-8859-1] Mon Feb 15 07:02:48 2010 @@ -15,6 +15,12 @@ BUILTIN_CFLAGS+= -fno-optimize-sibling-calls endif BUILTIN_CXXFLAGS+= -fno-optimize-sibling-calls + +# Add -fno-set-stack-executable required for x86/MinGW +ifneq (,$(filter $(ARCH), i386)) + BUILTIN_CFLAGS+= -fno-set-stack-executable + BUILTIN_CXXFLAGS+= -fno-set-stack-executable +endif
#(module, source, dependencies, cflags, output) define RBUILD_DEPENDS @@ -161,4 +167,3 @@ endif
endef -
Modified: branches/ros-amd64-bringup/reactos/tools/rbuild/backend/mingw/linkers/ld.mak URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools/... ============================================================================== --- branches/ros-amd64-bringup/reactos/tools/rbuild/backend/mingw/linkers/ld.mak [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/tools/rbuild/backend/mingw/linkers/ld.mak [iso-8859-1] Mon Feb 15 07:02:48 2010 @@ -1,5 +1,6 @@ -LDFLAG_DLL:=-shared -LDFLAG_DRIVER:=-shared --subsystem=native +# -exclude-all-symbols disables autoexporting all symbols *if none were found* (either in a DEF file or using __declspec(dllexport) +LDFLAG_DLL:=-shared -exclude-all-symbols +LDFLAG_DRIVER:=-shared --subsystem=native -exclude-all-symbols LDFLAG_NOSTDLIB:=-nostartfiles -nostdlib LDFLAG_CONSOLE:=--subsystem=console LDFLAG_WINDOWS:=--subsystem=windows
Modified: branches/ros-amd64-bringup/reactos/tools/rbuild/backend/mingw/mingw.cpp URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools/... ============================================================================== --- branches/ros-amd64-bringup/reactos/tools/rbuild/backend/mingw/mingw.cpp [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/tools/rbuild/backend/mingw/mingw.cpp [iso-8859-1] Mon Feb 15 07:02:48 2010 @@ -487,11 +487,8 @@ fputs ( "BUILTIN_CXXINCLUDES+= $(TARGET_CPPFLAGS)\n", fMakefile );
fprintf ( fMakefile, "PROJECT_CCLIBS := "$(shell ${TARGET_CC} -print-libgcc-file-name)"\n" ); - fprintf ( fMakefile, "PROJECT_CXXLIBS := "$(shell ${TARGET_CPP} -print-file-name=libstdc++.a)" "$(shell ${TARGET_CPP} -print-libgcc-file-name)" "$(shell ${TARGET_CPP} -print-file-name=libmingw32.a)" "$(shell ${TARGET_CPP} -print-file-name=libmingwex.a)" " ); - /* hack to get libgcc_eh.a, should check mingw version or something */ if (Environment::GetArch() == "amd64") - fprintf ( fMakefile, " "$(shell ${TARGET_CPP} -print-file-name=libgcc_eh.a)"" ); /* hack to get _get_output_format, needed by libmingwex */ else if (Environment::GetArch() == "i386") fprintf ( fMakefile, ""$(shell ${TARGET_CPP} -print-file-name=ofmt_stub.a)""); @@ -916,7 +913,7 @@ bool MingwBackend::IsSupportedCompilerVersion ( const string& compilerVersion ) { - if ( strcmp ( compilerVersion.c_str (), "4.4.2") < 0 ) + if ( strcmp ( compilerVersion.c_str (), "4.4.0") < 0 ) return false; else return true; @@ -980,18 +977,18 @@ { int digit = binutilsVersion.find_last_of("."); if(digit == -1) - { + { printf("Unable to detect binutils version!\n"); return false; - } - + } + string date = string(binutilsVersion, digit + 1); if(date.length() == 8) { /* This is a real date in the format YYYYMMDD. - Check whether we have at least Binutils 20091017 (older versions - don't support the -exclude-all-symbols option we use). */ - if(strcmp(date.c_str(), "20091119") < 0) + Check whether we have at least Binutils 20091016 (the oldest one + we were still using after upgrading to RosBE 1.5). */ + if(strcmp(date.c_str(), "20091016") < 0) return false; } else
Modified: branches/ros-amd64-bringup/reactos/tools/rbuild/backend/mingw/modulehandler.cpp URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools/... ============================================================================== --- branches/ros-amd64-bringup/reactos/tools/rbuild/backend/mingw/modulehandler.cpp [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/tools/rbuild/backend/mingw/modulehandler.cpp [iso-8859-1] Mon Feb 15 07:02:48 2010 @@ -1021,7 +1021,7 @@ } CleanupCompilationUnitVector ( sourceCompilationUnits );
- if ( IsSpecDefinitionFile() ) + if ( module.IsSpecDefinitionFile() ) { const FileLocation *stubs_file = new FileLocation( IntermediateDirectory, @@ -1826,7 +1826,7 @@ }
- spec = IsSpecDefinitionFile(); + spec = module.IsSpecDefinitionFile();
if(spec) { @@ -1985,23 +1985,6 @@ fprintf ( fMakefile, "\n" ); }
-SpecFileType -MingwModuleHandler::IsSpecDefinitionFile () const -{ - if(!module.importLibrary) - return None; - - std::string ext = GetExtension ( *module.importLibrary->source ); - - if ( ext == ".spec" ) - return Spec; - - if ( ext == ".pspec" ) - return PSpec; - - return None; -} - /* caller needs to delete the returned object */ const FileLocation* MingwModuleHandler::GetDefinitionFilename () const @@ -2009,7 +1992,7 @@ if ( module.importLibrary == NULL ) return NULL;
- if ( IsSpecDefinitionFile () ) + if ( module.IsSpecDefinitionFile () ) { return new FileLocation ( IntermediateDirectory, module.importLibrary->source->relative_path,
Modified: branches/ros-amd64-bringup/reactos/tools/rbuild/backend/mingw/modulehandler.h URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools/... ============================================================================== --- branches/ros-amd64-bringup/reactos/tools/rbuild/backend/mingw/modulehandler.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/tools/rbuild/backend/mingw/modulehandler.h [iso-8859-1] Mon Feb 15 07:02:48 2010 @@ -31,13 +31,6 @@ PrefixFilename ( const std::string& filename, const std::string& prefix ); - -enum SpecFileType -{ - None, - Spec = 1, - PSpec = 2 -};
class MingwModuleHandler {
Modified: branches/ros-amd64-bringup/reactos/tools/rbuild/backend/msvc/msvc.cpp URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools/... ============================================================================== --- branches/ros-amd64-bringup/reactos/tools/rbuild/backend/msvc/msvc.cpp [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/tools/rbuild/backend/msvc/msvc.cpp [iso-8859-1] Mon Feb 15 07:02:48 2010 @@ -83,7 +83,6 @@
void MSVCBackend::Process() { - // TODO FIXME wine hack? bool only_msvc_headers = false;
while ( m_configurations.size () > 0 ) @@ -95,14 +94,14 @@
m_configurations.push_back ( new MSVCConfiguration( Debug )); m_configurations.push_back ( new MSVCConfiguration( Release )); - m_configurations.push_back ( new MSVCConfiguration( Speed )); +// m_configurations.push_back ( new MSVCConfiguration( Speed )); m_configurations.push_back ( new MSVCConfiguration( RosBuild ));
if (!only_msvc_headers) { m_configurations.push_back ( new MSVCConfiguration( Debug, ReactOSHeaders )); m_configurations.push_back ( new MSVCConfiguration( Release, ReactOSHeaders )); - m_configurations.push_back ( new MSVCConfiguration( Speed, ReactOSHeaders )); +// m_configurations.push_back ( new MSVCConfiguration( Speed, ReactOSHeaders )); }
if ( configuration.CleanAsYouGo ) { @@ -117,6 +116,22 @@
filename_sln += "_auto.sln"; printf ( "Creating MSVC workspace: %s\n", filename_sln.c_str() ); + + //Write a property page for each configuration + for ( size_t icfg = 0; icfg < m_configurations.size(); icfg++ ) + { + MSVCConfiguration* cfg = m_configurations[icfg]; + + //RosBuild doesn't need a property page + if(cfg->optimization == RosBuild) + continue; + + string filename_props( cfg->name ); + filename_props += ".vsprops"; + //Write the propery pages files + PropsMaker propsMaker( configuration, &ProjectNode, filename_props, cfg ); + propsMaker._generate_props( _get_solution_version(), _get_studio_version() ); + }
// Write out the project files ProcessModules(); @@ -376,7 +391,7 @@ void MSVCBackend::_get_def_files ( const Module& module, vector<string>& out) const { - if (module.HasImportLibrary ()) + if (module.HasImportLibrary()) { #if 0 string modulename = module.GetBasePath ();
Modified: branches/ros-amd64-bringup/reactos/tools/rbuild/backend/msvc/msvc.h URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools/... ============================================================================== --- branches/ros-amd64-bringup/reactos/tools/rbuild/backend/msvc/msvc.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/tools/rbuild/backend/msvc/msvc.h [iso-8859-1] Mon Feb 15 07:02:48 2010 @@ -179,6 +179,7 @@ private: void _generate_standard_configuration( const Module& module, const MSVCConfiguration& cfg, BinaryType binaryType ); void _generate_makefile_configuration( const Module& module, const MSVCConfiguration& cfg ); + std::string _get_file_path( FileLocation* file, std::string relative_path); };
class VCXProjMaker : public ProjMaker @@ -222,4 +223,34 @@ void _generate_sln_configurations ( std::string vcproj_guid ); };
+class PropsMaker +{ + public: + PropsMaker ( Configuration& buildConfig, + Project* ProjectNode, + std::string filename_props, + MSVCConfiguration* msvc_configs); + + ~PropsMaker (); + + void _generate_props ( std::string solution_version, std::string studio_version ); + + private: + Configuration m_configuration; + Project* m_ProjectNode; + FILE* OUT; + MSVCConfiguration* m_msvc_config; + bool debug; + bool release; + bool speed; + bool use_ros_headers; + + void _generate_header(); + void _generate_tools_defaults(); + void _generate_macro(std::string Name, std::string Value, bool EvairomentVariable); + void _generate_global_includes(); + void _generate_global_definitions(); + void _generate_footer(); + +}; #endif // __MSVC_H__
Modified: branches/ros-amd64-bringup/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools/... ============================================================================== --- branches/ros-amd64-bringup/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp [iso-8859-1] Mon Feb 15 07:02:48 2010 @@ -80,6 +80,28 @@ fclose ( OUT ); }
+std::string +VCProjMaker::_get_file_path( FileLocation* file, std::string relative_path) +{ + if (file->directory == SourceDirectory) + { + // We want the full path here for directory support later on + return Path::RelativeFromDirectory (file->relative_path, relative_path ); + } + else if(file->directory == IntermediateDirectory) + { + return std::string("$(obj)\") + file->relative_path; + } + else if(file->directory == OutputDirectory) + { + return std::string("$(out)\") + file->relative_path; + } + + return std::string(""); +} + + + void VCProjMaker::_generate_proj_file ( const Module& module ) { @@ -91,7 +113,6 @@ // make sure the containers are empty header_files.clear(); includes.clear(); - includes_ros.clear(); libraries.clear(); common_defines.clear();
@@ -110,21 +131,8 @@ printf ( "Creating MSVC project: '%s'\n", vcproj_file.c_str() );
string path_basedir = module.GetPathToBaseDir (); - string intenv = Environment::GetIntermediatePath (); - string outenv = Environment::GetOutputPath (); - string outdir; - string intdir; string vcdir;
- if ( intenv == "obj-i386" ) - intdir = path_basedir + "obj-i386"; /* append relative dir from project dir */ - else - intdir = intenv; - - if ( outenv == "output-i386" ) - outdir = path_basedir + "output-i386"; - else - outdir = outenv;
if ( configuration.UseVSVersionInPath ) { @@ -135,93 +143,65 @@
vector<string> source_files, resource_files; vector<const IfableData*> ifs_list; - ifs_list.push_back ( &module.project.non_if_data ); - ifs_list.push_back ( &module.non_if_data ); - - while ( ifs_list.size() ) - { - const IfableData& data = *ifs_list.back(); - ifs_list.pop_back(); - const vector<File*>& files = data.files; - for ( i = 0; i < files.size(); i++ ) - { - if (files[i]->file.directory != SourceDirectory) + + const IfableData& data = module.non_if_data/**ifs_list.back()*/; + const vector<File*>& files = data.files; + for ( i = 0; i < files.size(); i++ ) + { + string path = _get_file_path(&files[i]->file, module.output->relative_path); + string file = path + std::string("\") + files[i]->file.name; + + if ( !stricmp ( Right(file,3).c_str(), ".rc" ) ) + resource_files.push_back ( file ); + else if ( !stricmp ( Right(file,2).c_str(), ".h" ) ) + header_files.push_back ( file ); + else + source_files.push_back ( file ); + } + const vector<Include*>& incs = data.includes; + for ( i = 0; i < incs.size(); i++ ) + { + string path = _get_file_path(incs[i]->directory, module.output->relative_path); + + if ( module.type != RpcServer && module.type != RpcClient ) + { + if ( path.find ("/include/reactos/idl") != string::npos) + { + include_idl = true; continue; - - // We want the full path here for directory support later on - string path = Path::RelativeFromDirectory ( - files[i]->file.relative_path, - module.output->relative_path ); - string file = path + std::string("\") + files[i]->file.name; - - if ( !stricmp ( Right(file,3).c_str(), ".rc" ) ) - resource_files.push_back ( file ); - else if ( !stricmp ( Right(file,2).c_str(), ".h" ) ) - header_files.push_back ( file ); - else - source_files.push_back ( file ); - } - const vector<Include*>& incs = data.includes; - for ( i = 0; i < incs.size(); i++ ) - { - string path = Path::RelativeFromDirectory ( - incs[i]->directory->relative_path, - module.output->relative_path ); - if ( module.type != RpcServer && module.type != RpcClient ) - { - if ( path.find ("/include/reactos/idl") != string::npos) - { - include_idl = true; - continue; - } - } - // switch between general headers and ros headers - if ( !strncmp(incs[i]->directory->relative_path.c_str(), "include\crt", 11 ) || - !strncmp(incs[i]->directory->relative_path.c_str(), "include\ddk", 11 ) || - !strncmp(incs[i]->directory->relative_path.c_str(), "include\GL", 10 ) || - !strncmp(incs[i]->directory->relative_path.c_str(), "include\psdk", 12 ) || - !strncmp(incs[i]->directory->relative_path.c_str(), "include\reactos\wine", 20 ) ) - { - if (strncmp(incs[i]->directory->relative_path.c_str(), "include\crt", 11 )) - // not crt include - includes_ros.push_back ( path ); - } - else - { - includes.push_back ( path ); - } - } - const vector<Library*>& libs = data.libraries; - for ( i = 0; i < libs.size(); i++ ) - { - string libpath = outdir + "\" + libs[i]->importedModule->output->relative_path + "\" + _get_vc_dir() + "\---\" + libs[i]->name + ".lib"; - libraries.push_back ( libpath ); - } - const vector<Define*>& defs = data.defines; - for ( i = 0; i < defs.size(); i++ ) - { - if ( defs[i]->backend != "" && defs[i]->backend != "msvc" ) - continue; - - if ( defs[i]->value[0] ) - common_defines.insert( defs[i]->name + "=" + defs[i]->value ); - else - common_defines.insert( defs[i]->name ); - } - for ( std::map<std::string, Property*>::const_iterator p = data.properties.begin(); p != data.properties.end(); ++ p ) - { - Property& prop = *p->second; - if ( strstr ( module.baseaddress.c_str(), prop.name.c_str() ) ) - baseaddr = prop.value; - } - } - /* include intermediate path for reactos.rc */ - string version = intdir + "\include"; - includes.push_back (version); - version += "\reactos"; - includes.push_back (version); - - string include_string; + } + } + includes.push_back ( path ); + } + const vector<Library*>& libs = data.libraries; + for ( i = 0; i < libs.size(); i++ ) + { + string libpath = "$(out)\" + libs[i]->importedModule->output->relative_path + "\" + _get_vc_dir() + "\$(ConfigurationName)\" + libs[i]->name + ".lib"; + libraries.push_back ( libpath ); + } + const vector<Define*>& defs = data.defines; + for ( i = 0; i < defs.size(); i++ ) + { + if ( defs[i]->backend != "" && defs[i]->backend != "msvc" ) + continue; + + if ( defs[i]->value[0] ) + common_defines.insert( defs[i]->name + "=" + defs[i]->value ); + else + common_defines.insert( defs[i]->name ); + } + for ( std::map<std::string, Property*>::const_iterator p = data.properties.begin(); p != data.properties.end(); ++ p ) + { + Property& prop = *p->second; + if ( strstr ( module.baseaddress.c_str(), prop.name.c_str() ) ) + baseaddr = prop.value; + } + + if(module.IsSpecDefinitionFile()) + { + std::string path = _get_file_path(module.importLibrary->source, module.output->relative_path); + source_files.push_back ( path + std::string("\") + module.importLibrary->source->name ); + }
fprintf ( OUT, "<?xml version=\"1.0\" encoding = \"Windows-1252\"?>\r\n" ); fprintf ( OUT, "<VisualStudioProject\r\n" ); @@ -239,6 +219,15 @@ fprintf ( OUT, "\t\t<Platform\r\n" ); fprintf ( OUT, "\t\t\tName="Win32"/>\r\n" ); fprintf ( OUT, "\t</Platforms>\r\n" ); + + fprintf ( OUT, "\t<ToolFiles>\r\n" ); + fprintf ( OUT, "\t\t<ToolFile\r\n" ); + fprintf ( OUT, "\t\t\tRelativePath="%s%s"\r\n", path_basedir.c_str(), "tools\rbuild\backend\msvc\s_as_mscpp.rules" ); + fprintf ( OUT, "\t\t/>\r\n" ); + fprintf ( OUT, "\t\t<ToolFile\r\n" ); + fprintf ( OUT, "\t\t\tRelativePath="%s%s"\r\n", path_basedir.c_str(), "tools\rbuild\backend\msvc\spec.rules" ); + fprintf ( OUT, "\t\t/>\r\n" ); + fprintf ( OUT, "\t</ToolFiles>\r\n" );
// Set the binary type string module_type = GetExtension(*module.output); @@ -335,21 +324,8 @@ { const MSVCConfiguration& config = *m_configurations[iconfig];
- if (( isrcfile == 0 ) && ( module.pch != NULL )) - { - /* little hack to speed up PCH */ - fprintf ( OUT, "%s\t<FileConfiguration\r\n", indent_tab.c_str() ); - fprintf ( OUT, "%s\t\tName="", indent_tab.c_str() ); - fprintf ( OUT, config.name.c_str() ); - fprintf ( OUT, "|Win32">\r\n" ); - fprintf ( OUT, "%s\t\t<Tool\r\n", indent_tab.c_str() ); - fprintf ( OUT, "%s\t\t\tName="VCCLCompilerTool"\r\n", indent_tab.c_str() ); - fprintf ( OUT, "%s\t\t\tUsePrecompiledHeader="1"/>\r\n", indent_tab.c_str() ); - fprintf ( OUT, "%s\t</FileConfiguration>\r\n", indent_tab.c_str() ); - } - //if (configuration.VSProjectVersion < "8.00") { - if ((source_file.find(".idl") != string::npos) || ((source_file.find(".asm") != string::npos || tolower(source_file.at(source_file.size() - 1)) == 's'))) + if ((source_file.find(".idl") != string::npos) || ((source_file.find(".asm") != string::npos))) { fprintf ( OUT, "%s\t<FileConfiguration\r\n", indent_tab.c_str() ); fprintf ( OUT, "%s\t\tName="", indent_tab.c_str() ); @@ -388,12 +364,6 @@ fprintf ( OUT, "%s\t\t\tCommandLine="nasmw $(InputPath) -f coff -o "$(OutDir)\$(InputName).obj""\r\n", indent_tab.c_str() ); fprintf ( OUT, "%s\t\t\tOutputs="$(OutDir)\$(InputName).obj"/>\r\n", indent_tab.c_str() ); } - else if ((tolower(source_file.at(source_file.size() - 1)) == 's')) - { - fprintf ( OUT, "%s\t\t\tName="VCCustomBuildTool"\r\n", indent_tab.c_str() ); - fprintf ( OUT, "%s\t\t\tCommandLine="cl /E "$(InputPath)" %s /D__ASM__ | as -o "$(OutDir)\$(InputName).obj""\r\n", indent_tab.c_str(), include_string.c_str() ); - fprintf ( OUT, "%s\t\t\tOutputs="$(OutDir)\$(InputName).obj"/>\r\n", indent_tab.c_str() ); - } fprintf ( OUT, "%s\t</FileConfiguration>\r\n", indent_tab.c_str() ); } //} @@ -452,24 +422,19 @@ BinaryType binaryType ) { string path_basedir = module.GetPathToBaseDir (); - string intenv = Environment::GetIntermediatePath (); - string outenv = Environment::GetOutputPath (); - string outdir; - string intdir; string vcdir;
- bool debug = ( cfg.optimization == Debug ); - bool release = ( cfg.optimization == Release ); - bool speed = ( cfg.optimization == Speed ); - bool include_idl = false; - string include_string;
size_t i; string intermediatedir = ""; string importLib; - // don't do the work m_configurations.size() times - if (module.importLibrary != NULL) + + if(module.IsSpecDefinitionFile()) + { + importLib = "$(IntDir)\$(ProjectName).def"; + } + else if (module.importLibrary != NULL) { intermediatedir = module.output->relative_path + vcdir; importLib = _strip_gcc_deffile(module.importLibrary->source->name, module.importLibrary->source->relative_path, intermediatedir); @@ -491,17 +456,6 @@ else CfgType = ConfigUnknown;
- - if ( intenv == "obj-i386" ) - intdir = path_basedir + "obj-i386"; /* append relative dir from project dir */ - else - intdir = intenv; - - if ( outenv == "output-i386" ) - outdir = path_basedir + "output-i386"; - else - outdir = outenv; - if ( configuration.UseVSVersionInPath ) { vcdir = DEF_SSEP + _get_vc_dir(); @@ -510,30 +464,68 @@ fprintf ( OUT, "\t\t<Configuration\r\n" ); fprintf ( OUT, "\t\t\tName="%s|Win32"\r\n", cfg.name.c_str() );
- if ( configuration.UseConfigurationInPath ) - { - fprintf ( OUT, "\t\t\tOutputDirectory="%s\%s%s\%s"\r\n", outdir.c_str (), module.output->relative_path.c_str (), vcdir.c_str (), cfg.name.c_str() ); - fprintf ( OUT, "\t\t\tIntermediateDirectory="%s\%s%s\%s"\r\n", intdir.c_str (), module.output->relative_path.c_str (), vcdir.c_str (), cfg.name.c_str() ); - } - else - { - fprintf ( OUT, "\t\t\tOutputDirectory="%s\%s%s"\r\n", outdir.c_str (), module.output->relative_path.c_str (), vcdir.c_str () ); - fprintf ( OUT, "\t\t\tIntermediateDirectory="%s\%s%s"\r\n", intdir.c_str (), module.output->relative_path.c_str (), vcdir.c_str () ); - } + if ( configuration.UseConfigurationInPath ) + { + fprintf ( OUT, "\t\t\tOutputDirectory="$(out)\%s%s\$(ConfigurationName)"\r\n", module.output->relative_path.c_str (), vcdir.c_str () ); + fprintf ( OUT, "\t\t\tIntermediateDirectory="$(obj)\%s%s\$(ConfigurationName)"\r\n", module.output->relative_path.c_str (), vcdir.c_str () ); + } + else + { + fprintf ( OUT, "\t\t\tOutputDirectory="$(out)\%s%s"\r\n", module.output->relative_path.c_str (), vcdir.c_str () ); + fprintf ( OUT, "\t\t\tIntermediateDirectory="$(obj)\%s%s"\r\n", module.output->relative_path.c_str (), vcdir.c_str () ); + }
fprintf ( OUT, "\t\t\tConfigurationType="%d"\r\n", CfgType ); + + fprintf ( OUT, "\t\t\tInheritedPropertySheets="%s%s.vsprops"\r\n", path_basedir.c_str (), cfg.name.c_str ()); fprintf ( OUT, "\t\t\tCharacterSet="2"\r\n" ); fprintf ( OUT, "\t\t\t>\r\n" );
- fprintf ( OUT, "\t\t\t<Tool\r\n" ); - fprintf ( OUT, "\t\t\t\tName="VCCLCompilerTool"\r\n" ); - - fprintf ( OUT, "\t\t\t\tOptimization="%d"\r\n", release ? 2 : 0 ); - - fprintf ( OUT, "\t\t\t\tAdditionalIncludeDirectories="" ); - bool multiple_includes = false; - fprintf ( OUT, "./;" ); - for ( i = 0; i < includes.size(); i++ ) + fprintf ( OUT, "\t\t\t<Tool\r\n" ); + fprintf ( OUT, "\t\t\t\tName="s_as_mscpp"\r\n" ); + fprintf ( OUT, "\t\t\t\tsIncPaths="" ); + fprintf ( OUT, "./;" ); + for ( i = 0; i < includes.size(); i++ ) + { + const std::string& include = includes[i]; + if ( strcmp ( include.c_str(), "." ) ) + { + fprintf ( OUT, "%s", include.c_str() ); + fprintf ( OUT, ";" ); + } + } + fprintf ( OUT, "$(globalIncludes);"\r\n"); + fprintf ( OUT, "\t\t\t\tsPPDefs="__ASM__"\r\n" ); + fprintf ( OUT, "\t\t\t/>\r\n" ); + + fprintf ( OUT, "\t\t\t<Tool\r\n" ); + fprintf ( OUT, "\t\t\t\tName="Pspec"\r\n" ); + fprintf ( OUT, "\t\t\t\tincludes="" ); + fprintf ( OUT, "./;" ); + for ( i = 0; i < includes.size(); i++ ) + { + const std::string& include = includes[i]; + if ( strcmp ( include.c_str(), "." ) ) + { + fprintf ( OUT, "%s", include.c_str() ); + fprintf ( OUT, ";" ); + } + } + fprintf ( OUT, "$(globalIncludes);"\r\n"); + fprintf ( OUT, "\t\t\t\tsPPDefs="__ASM__"\r\n" ); + fprintf ( OUT, "\t\t\t/>\r\n" ); + + + fprintf ( OUT, "\t\t\t<Tool\r\n" ); + fprintf ( OUT, "\t\t\t\tName="VCCLCompilerTool"\r\n" ); + + fprintf ( OUT, "\t\t\t\tAdditionalIncludeDirectories="" ); + bool multiple_includes = false; + fprintf ( OUT, "./;" ); + for ( i = 0; i < includes.size(); i++ ) + { + const std::string& include = includes[i]; + if ( strcmp ( include.c_str(), "." ) ) { const std::string& include = includes[i]; if ( strcmp ( include.c_str(), "." ) ) @@ -549,70 +541,22 @@ { if ( multiple_includes ) fprintf ( OUT, ";" ); - - if ( configuration.UseConfigurationInPath ) - { - fprintf ( OUT, "%s\include\reactos\idl%s\%s\r\n", intdir.c_str (), vcdir.c_str (), cfg.name.c_str() ); - } - else - { - fprintf ( OUT, "%s\include\reactos\idl\r\n", intdir.c_str () ); - } + fprintf ( OUT, "%s", include.c_str() ); + multiple_includes = true; } if ( cfg.headers == ReactOSHeaders ) { - for ( i = 0; i < includes_ros.size(); i++ ) - { - const std::string& include = includes_ros[i]; - if ( multiple_includes ) - fprintf ( OUT, ";" ); - fprintf ( OUT, "%s", include.c_str() ); - //include_string += " /I " + include; - multiple_includes = true; - } + fprintf ( OUT, "$(int)\include\reactos\idl%s\$(ConfigurationName)\r\n", vcdir.c_str ()); } else { - // Add WDK or PSDK paths, if user provides them - if (getenv ( "BASEDIR" ) != NULL && - (module.type == Kernel || - module.type == KernelModeDLL || - module.type == KernelModeDriver || - module.type == KeyboardLayout)) - { - string WdkBase, SdkPath, CrtPath, DdkPath; - WdkBase = getenv ( "BASEDIR" ); - SdkPath = WdkBase + "\inc\api"; - CrtPath = WdkBase + "\inc\crt"; - DdkPath = WdkBase + "\inc\ddk"; - - if ( multiple_includes ) - fprintf ( OUT, ";" ); - - fprintf ( OUT, "%s;", SdkPath.c_str() ); - fprintf ( OUT, "%s;", CrtPath.c_str() ); - fprintf ( OUT, "%s", DdkPath.c_str() ); - multiple_includes = true; - } - } - fprintf ( OUT, ""\r\n" ); + fprintf ( OUT, "$(int)\include\reactos\idl\r\n" ); + } + } + + fprintf ( OUT, ""\r\n" );
StringSet defines = common_defines; - - // Always add _CRT_SECURE_NO_WARNINGS to disable warnings about not - // using the safe functions introduced in MSVC8. - defines.insert ( "_CRT_SECURE_NO_WARNINGS" ); - - if ( debug ) - { - defines.insert ( "_DEBUG" ); - } - - if ( cfg.headers == MSVCHeaders ) - { - // this is a define in MinGW w32api, but not Microsoft's headers - defines.insert ( "STDCALL=__stdcall" ); - }
if ( binaryType == Lib || binaryType == Exe ) { @@ -624,71 +568,50 @@ defines.insert ( "_USRDLL" ); }
- fprintf ( OUT, "\t\t\t\tPreprocessorDefinitions="" ); - for ( StringSet::iterator it1=defines.begin(); it1!=defines.end(); it1++ ) - { - if ( i > 0 ) - fprintf ( OUT, ";" ); - - string unescaped = *it1; - fprintf ( OUT, "%s", _replace_str(unescaped, ""","").c_str() ); - } - fprintf ( OUT, ""\r\n" ); - fprintf ( OUT, "\t\t\t\tForcedIncludeFiles="%s"\r\n", "warning.h"); - fprintf ( OUT, "\t\t\t\tMinimalRebuild="%s"\r\n", speed ? "TRUE" : "FALSE" ); - fprintf ( OUT, "\t\t\t\tBasicRuntimeChecks="0"\r\n" ); - fprintf ( OUT, "\t\t\t\tRuntimeLibrary="%d"\r\n", debug ? 3 : 2 ); // 3=/MDd 2=/MD - fprintf ( OUT, "\t\t\t\tBufferSecurityCheck="FALSE"\r\n" ); - fprintf ( OUT, "\t\t\t\tEnableFunctionLevelLinking="FALSE"\r\n" ); - - if ( module.pch != NULL ) - { - fprintf ( OUT, "\t\t\t\tUsePrecompiledHeader="2"\r\n" ); - string pch_path = Path::RelativeFromDirectory ( - module.pch->file->name, - module.output->relative_path ); - string::size_type pos = pch_path.find_last_of ("/"); - if ( pos != string::npos ) - pch_path.erase(0, pos+1); - fprintf ( OUT, "\t\t\t\tPrecompiledHeaderThrough="%s"\r\n", pch_path.c_str() ); - - // Only include from the same module - pos = pch_path.find("../"); - if (pos == string::npos && std::find(header_files.begin(), header_files.end(), pch_path) == header_files.end()) - header_files.push_back(pch_path); - } - else - { - fprintf ( OUT, "\t\t\t\tUsePrecompiledHeader="0"\r\n" ); - } - - fprintf ( OUT, "\t\t\t\tWholeProgramOptimization="%s"\r\n", release ? "FALSE" : "FALSE"); - if ( release ) - { - fprintf ( OUT, "\t\t\t\tFavorSizeOrSpeed="1"\r\n" ); - fprintf ( OUT, "\t\t\t\tStringPooling="true"\r\n" ); - } - - fprintf ( OUT, "\t\t\t\tWarningLevel="%s"\r\n", speed ? "0" : "3" ); - fprintf ( OUT, "\t\t\t\tDetect64BitPortabilityProblems="%s"\r\n", "FALSE"); - if ( !module.cplusplus ) - fprintf ( OUT, "\t\t\t\tCompileAs="1"\r\n" ); - - if ( module.type == Win32CUI || module.type == Win32GUI ) - { - fprintf ( OUT, "\t\t\t\tCallingConvention="%d"\r\n", 0 ); // 0=__cdecl - } - else - { - fprintf ( OUT, "\t\t\t\tCallingConvention="%d"\r\n", 2 ); // 2=__stdcall - } - - fprintf ( OUT, "\t\t\t\tDebugInformationFormat="%s"/>\r\n", speed ? "0" : release ? "3": "4"); // 3=/Zi 4=ZI + fprintf ( OUT, "\t\t\t\tPreprocessorDefinitions="" ); + for ( StringSet::iterator it1=defines.begin(); it1!=defines.end(); it1++ ) + { + string unescaped = *it1; + fprintf ( OUT, "%s ; ", _replace_str(unescaped, ""","").c_str() ); + } + fprintf ( OUT, ""\r\n" ); + + //disable precompiled headers for now +#if 0 + if ( module.pch != NULL ) + { + fprintf ( OUT, "\t\t\t\tUsePrecompiledHeader="2"\r\n" ); + string pch_path = Path::RelativeFromDirectory ( + module.pch->file->name, + module.output->relative_path ); + string::size_type pos = pch_path.find_last_of ("/"); + if ( pos != string::npos ) + pch_path.erase(0, pos+1); + fprintf ( OUT, "\t\t\t\tPrecompiledHeaderThrough="%s"\r\n", pch_path.c_str() ); + + // Only include from the same module + pos = pch_path.find("../"); + if (pos == string::npos && std::find(header_files.begin(), header_files.end(), pch_path) == header_files.end()) + header_files.push_back(pch_path); + } +#endif + + if ( module.cplusplus ) + fprintf ( OUT, "\t\t\t\tCompileAs="2"\r\n" ); + + fprintf ( OUT, "\t\t\t/>\r\n");
fprintf ( OUT, "\t\t\t<Tool\r\n" ); fprintf ( OUT, "\t\t\t\tName="VCCustomBuildTool"/>\r\n" );
- if ( binaryType == Lib ) + if ( binaryType != Lib ) + { + fprintf ( OUT, "\t\t\t<Tool\r\n" ); + fprintf ( OUT, "\t\t\t\tName="VCLinkerTool"\r\n" ); + if (module.GetEntryPoint() == "0" && binaryType != Sys ) + fprintf ( OUT, "AdditionalOptions="/noentry"" ); + + if (configuration.VSProjectVersion == "9.00") { fprintf ( OUT, "\t\t\t<Tool\r\n" ); fprintf ( OUT, "\t\t\t\tName="VCLibrarianTool"\r\n" ); @@ -728,47 +651,20 @@
fprintf ( OUT, "\t\t\t\tAdditionalLibraryDirectories="" );
- // Add WDK libs paths, if needed - if (getenv ( "BASEDIR" ) != NULL && - (module.type == Kernel || - module.type == KernelModeDLL || - module.type == KernelModeDriver || - module.type == KeyboardLayout)) - { - string WdkBase, CrtPath, DdkPath; - WdkBase = getenv ( "BASEDIR" ); - CrtPath = WdkBase + "\lib\crt\i386"; - DdkPath = WdkBase + "\lib\wnet\i386"; - - fprintf ( OUT, "%s;", CrtPath.c_str() ); - fprintf ( OUT, "%s", DdkPath.c_str() ); - - if (libraries.size () > 0) - fprintf ( OUT, ";" ); - } - // Add conventional libraries dirs for (i = 0; i < libraries.size (); i++) { if ( i > 0 ) fprintf ( OUT, ";" );
- string libpath = libraries[i].c_str(); - libpath.replace (libpath.find("---"), 3, cfg.name); - libpath = libpath.substr (0, libpath.find_last_of ("\") ); - fprintf ( OUT, "%s", libpath.c_str() ); - } + string libpath = libraries[i].c_str(); + libpath = libpath.substr (0, libpath.find_last_of ("\") ); + fprintf ( OUT, "%s", libpath.c_str() ); + }
fprintf ( OUT, ""\r\n" );
- fprintf ( OUT, "\t\t\t\tOutputFile="$(OutDir)/%s%s"\r\n", module.name.c_str(), module_type.c_str() ); - fprintf ( OUT, "\t\t\t\tLinkIncremental="%d"\r\n", debug ? 2 : 1 ); - fprintf ( OUT, "\t\t\t\tGenerateDebugInformation="%s"\r\n", speed ? "FALSE" : "TRUE" ); - fprintf ( OUT, "\t\t\t\tLinkTimeCodeGeneration="%d"\r\n", release? 0 : 0); // whole program optimization - - if ( debug ) - fprintf ( OUT, "\t\t\t\tProgramDatabaseFile="$(OutDir)/%s.pdb"\r\n", module.name.c_str() ); - + fprintf ( OUT, "\t\t\t\tOutputFile="$(OutDir)/%s%s"\r\n", module.name.c_str(), module_type.c_str() ); if ( binaryType == Sys ) { if (module.GetEntryPoint() == "0") @@ -833,6 +729,8 @@ } fprintf ( OUT, "\t\t\t\tTargetMachine="%d"/>\r\n", 1 ); } + fprintf ( OUT, "\t\t\t/>\r\n" ); + }
fprintf ( OUT, "\t\t\t<Tool\r\n" ); fprintf ( OUT, "\t\t\t\tName="VCResourceCompilerTool"\r\n" ); @@ -850,18 +748,9 @@ multiple_includes = true; } } - if ( cfg.headers == ReactOSHeaders ) - { - for ( i = 0; i < includes_ros.size(); i++ ) - { - const std::string& include = includes_ros[i]; - if ( multiple_includes ) - fprintf ( OUT, ";" ); - fprintf ( OUT, "%s", include.c_str() ); - multiple_includes = true; - } - } - fprintf ( OUT, ""/>\r\n " ); + } + + fprintf ( OUT, ""/>\r\n " );
fprintf ( OUT, "\t\t\t<Tool\r\n" ); fprintf ( OUT, "\t\t\t\tName="VCMIDLTool"/>\r\n" ); @@ -883,6 +772,8 @@ fprintf ( OUT, "\t\t\t\tName="VCWebDeploymentTool"/>\r\n" ); fprintf ( OUT, "\t\t</Configuration>\r\n" ); } + fprintf ( OUT, "\t\t</Configuration>\r\n" ); +}
void
Modified: branches/ros-amd64-bringup/reactos/tools/rbuild/module.cpp URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools/... ============================================================================== --- branches/ros-amd64-bringup/reactos/tools/rbuild/module.cpp [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/tools/rbuild/module.cpp [iso-8859-1] Mon Feb 15 07:02:48 2010 @@ -1436,6 +1436,24 @@ throw new InvalidOperationException ( __FILE__, __LINE__, "Module %s has no dllname." ); }
+SpecFileType +Module::IsSpecDefinitionFile () const +{ + if(!importLibrary) + return None; + + std::string ext = GetExtension ( *importLibrary->source ); + + if ( ext == ".spec" ) + return Spec; + + if ( ext == ".pspec" ) + return PSpec; + + return None; +} + + File::File ( DirectoryLocation directory, const string& relative_path, const string& name,
Modified: branches/ros-amd64-bringup/reactos/tools/rbuild/project.cpp URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools/... ============================================================================== --- branches/ros-amd64-bringup/reactos/tools/rbuild/project.cpp [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/tools/rbuild/project.cpp [iso-8859-1] Mon Feb 15 07:02:48 2010 @@ -63,6 +63,14 @@ }
/* static */ string +Environment::GetSourcePath () +{ + char temp[_MAX_PATH]; + getcwd(temp, _MAX_PATH); + return string(temp); +} + +string Environment::GetOutputPath () { string defaultOutput =
Modified: branches/ros-amd64-bringup/reactos/tools/rbuild/rbuild.cpp URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools/... ============================================================================== --- branches/ros-amd64-bringup/reactos/tools/rbuild/rbuild.cpp [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/tools/rbuild/rbuild.cpp [iso-8859-1] Mon Feb 15 07:02:48 2010 @@ -133,6 +133,11 @@
if (configuration.VSProjectVersion.length() == 3) //7.1 configuration.VSProjectVersion.append("0"); + + //We should set this here because in the end we will use + //msc sompiler so we need to parse msc specidic + //definitions and includes + configuration.Compiler = MicrosoftC;
break; case 'c':
Modified: branches/ros-amd64-bringup/reactos/tools/rbuild/rbuild.h URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools/... ============================================================================== --- branches/ros-amd64-bringup/reactos/tools/rbuild/rbuild.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/tools/rbuild/rbuild.h [iso-8859-1] Mon Feb 15 07:02:48 2010 @@ -167,6 +167,13 @@ MicrosoftLink };
+enum SpecFileType +{ + None, + Spec = 1, + PSpec = 2 +}; + class Configuration { public: @@ -197,6 +204,7 @@ static std::string GetArch (); static std::string GetIntermediatePath (); static std::string GetOutputPath (); + static std::string GetSourcePath (); static std::string GetCdOutputPath (); static std::string GetInstallPath (); static std::string GetAutomakeFile ( const std::string& defaultFile ); @@ -427,6 +435,7 @@ void InvokeModule () const; void ProcessXML (); std::string GetDllName() const; + SpecFileType IsSpecDefinitionFile () const; private: void SetImportLibrary ( ImportLibrary* importLibrary ); void SetDelayImportLibrary ( ImportLibrary* importLibrary );
Modified: branches/ros-amd64-bringup/reactos/tools/rbuild/rbuild.mak URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools/... ============================================================================== --- branches/ros-amd64-bringup/reactos/tools/rbuild/rbuild.mak [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/tools/rbuild/rbuild.mak [iso-8859-1] Mon Feb 15 07:02:48 2010 @@ -209,6 +209,7 @@ slnmaker.cpp \ vcprojmaker.cpp \ vcxprojmaker.cpp \ + vspropsmaker.cpp \ )
RBUILD_BACKEND_SOURCES = \ @@ -496,7 +497,11 @@ $(RBUILD_MSVC_INT_)projmaker.o: $(RBUILD_MSVC_BASE_)projmaker.cpp $(RBUILD_HEADERS) | $(RBUILD_MSVC_INT) $(ECHO_HOSTCC) ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ - + +$(RBUILD_MSVC_INT_)vspropsmaker.o: $(RBUILD_MSVC_BASE_)vspropsmaker.cpp $(RBUILD_HEADERS) | $(RBUILD_MSVC_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + $(RBUILD_MSVC_INT_)slnmaker.o: $(RBUILD_MSVC_BASE_)slnmaker.cpp $(RBUILD_HEADERS) | $(RBUILD_MSVC_INT) $(ECHO_HOSTCC) ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@
Modified: branches/ros-amd64-bringup/reactos/tools/rbuild/rbuild.vcproj URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools/... ============================================================================== --- branches/ros-amd64-bringup/reactos/tools/rbuild/rbuild.vcproj [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/tools/rbuild/rbuild.vcproj [iso-8859-1] Mon Feb 15 07:02:48 2010 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" - Version="9.00" + Version="9,00" Name="rbuild" ProjectGUID="{D9305AFB-499E-49F1-A865-99DD7E19E762}" RootNamespace="rbuild" @@ -137,7 +137,6 @@ BasicRuntimeChecks="3" RuntimeLibrary="1" DefaultCharIsUnsigned="true" - OpenMP="true" UsePrecompiledHeader="0" PrecompiledHeaderFile=".\Debug/rbuild.pch" AssemblerListingLocation=".\Debug/" @@ -291,6 +290,10 @@ RelativePath=".\backend\msvc\vcxprojmaker.cpp" > </File> + <File + RelativePath=".\backend\msvc\vspropsmaker.cpp" + > + </File> </Filter> <Filter Name="mingw"
Propchange: branches/ros-amd64-bringup/reactos/tools/rbuild_helper/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Mon Feb 15 07:02:48 2010 @@ -1,1 +1,1 @@ -/trunk/reactos/tools/rbuild_helper:41027-41474,42237-45466 +/trunk/reactos/tools/rbuild_helper:41027-41474,42237-45594
Propchange: branches/ros-amd64-bringup/reactos/tools/rsym/rsym.c ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Mon Feb 15 07:02:48 2010 @@ -1,2 +1,2 @@ /branches/ros-amd64-bringup/reactos/tools/rsym/rsym.c:34780-34782,34908-34909,34965,35683,35762,35777,35805,35827,36172,36445,36502-36503,36505,36899,36936,36992 -/trunk/reactos/tools/rsym/rsym.c:44770-45466 +/trunk/reactos/tools/rsym/rsym.c:44770-45594
Propchange: branches/ros-amd64-bringup/reactos/tools/rsym/rsym.h ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Mon Feb 15 07:02:48 2010 @@ -1,2 +1,2 @@ /branches/ros-amd64-bringup/reactos/tools/rsym/rsym.h:34780-34782,34908-34909,34965,35683,35762,35777,35805,35827,36172,36445,36502-36503,36505,36899,36936,36992 -/trunk/reactos/tools/rsym/rsym.h:44770-45466 +/trunk/reactos/tools/rsym/rsym.h:44770-45594
Propchange: branches/ros-amd64-bringup/reactos/tools/rsym/rsym.mak ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Mon Feb 15 07:02:48 2010 @@ -1,2 +1,2 @@ /branches/ros-amd64-bringup/reactos/tools/rsym/rsym.mak:34780-34782,34908-34909,34965,35683,35762,35777,35805,35827,36172,36445,36502-36503,36505,36899,36936,36992 -/trunk/reactos/tools/rsym/rsym.mak:44770-45466 +/trunk/reactos/tools/rsym/rsym.mak:44770-45594
Propchange: branches/ros-amd64-bringup/reactos/tools/rsym/rsym_common.c ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Mon Feb 15 07:02:48 2010 @@ -1,2 +1,2 @@ /branches/ros-amd64-bringup/reactos/tools/rsym/rsym_common.c:34780-34782,34908-34909,34965,35683,35762,35777,35805,35827,36172,36445,36502-36503,36505,36899,36936,36992 -/trunk/reactos/tools/rsym/rsym_common.c:44770-45466 +/trunk/reactos/tools/rsym/rsym_common.c:44770-45594