diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2012-08-01 19:44:04 +0200 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2012-08-01 22:39:50 +0200 |
commit | 79e1b9cb2305bc00665e94afd6a00e9f18b76bf8 (patch) | |
tree | 7723b23ba19fa8f56499feb1323cd6c346f4a2c2 /solenv | |
parent | e9da4879384c15da84e26d137302ae1ccc30f86a (diff) |
always compile from SRCDIR
* this helps getting nonbroken deps if using some ccache/CCACHE_BASEDIR combos
Change-Id: I401e55cc10b16aa5901348909237e97d05ab2761
Diffstat (limited to 'solenv')
-rw-r--r-- | solenv/bin/concat-deps.c | 42 | ||||
-rw-r--r-- | solenv/gbuild/platform/com_GCC_class.mk | 8 |
2 files changed, 7 insertions, 43 deletions
diff --git a/solenv/bin/concat-deps.c b/solenv/bin/concat-deps.c index 8c9354b08406..e68093b3703c 100644 --- a/solenv/bin/concat-deps.c +++ b/solenv/bin/concat-deps.c @@ -111,10 +111,7 @@ static char* base_dir_var = "$(SRCDIR)"; #define kBASE_DIR_VAR_LENGTH 9 -static char* current_dir; -static size_t current_dir_length; static char* base_dir; -static size_t base_dir_length; #ifdef __GNUC__ #define clz __builtin_clz @@ -715,13 +712,10 @@ char* lastnondotdot; fputs(path, stdout); } -static char* print_fullpaths_buffer = NULL; -static size_t print_fullpaths_buffersize = 0; /* prefix paths to absolute */ static inline void print_fullpaths(char* line) { char* token; -size_t token_length;; token = strtok(line," "); while(token != NULL) @@ -732,19 +726,9 @@ size_t token_length;; } else { - token_length=strlen(token); - if(print_fullpaths_buffersize < current_dir_length+token_length+2) - { - /* we really should avoid to get there more than once, so print a message to alert of the condition */ - if(print_fullpaths_buffersize) - fprintf(stderr, "resize fullpaths buffer %d -> %d\n", ((int)print_fullpaths_buffersize), ((int)(current_dir_length+token_length))+1024); - print_fullpaths_buffersize = current_dir_length+token_length+1024; - print_fullpaths_buffer = realloc(print_fullpaths_buffer, print_fullpaths_buffersize); - } - memcpy(print_fullpaths_buffer, current_dir, current_dir_length); - *(print_fullpaths_buffer+current_dir_length) = '/'; - memcpy(print_fullpaths_buffer+current_dir_length+1, token, token_length+1); - print_nodotdot(print_fullpaths_buffer); + fputs(base_dir_var, stdout); + fputc('/', stdout); + print_nodotdot(token); } fputc(' ', stdout); token = strtok(NULL," "); @@ -882,26 +866,6 @@ struct hash* dep_hash; fputs("Error: SRCDIR is missing in the environement\n", stderr); return 1; } - current_dir = getcwd(NULL, 0); - base_dir_length = strlen(base_dir); - current_dir_length = strlen(current_dir); - if(strncmp(base_dir, current_dir, base_dir_length) == 0) - { - if(current_dir_length == base_dir_length) - { - current_dir = base_dir_var; - current_dir_length = kBASE_DIR_VAR_LENGTH; - } - else - { - buffer = malloc(kBASE_DIR_VAR_LENGTH+current_dir_length-base_dir_length+1); - memcpy(buffer, base_dir_var, kBASE_DIR_VAR_LENGTH); - memcpy(buffer+kBASE_DIR_VAR_LENGTH, current_dir+base_dir_length, current_dir_length-base_dir_length+1); - free(current_dir); - current_dir=buffer; - current_dir_length=kBASE_DIR_VAR_LENGTH+current_dir_length-base_dir_length; - } - } in_list = file_load(argv[1], &in_list_size, &rc); if(!rc) diff --git a/solenv/gbuild/platform/com_GCC_class.mk b/solenv/gbuild/platform/com_GCC_class.mk index b098c9945fe6..18a389e4dd23 100644 --- a/solenv/gbuild/platform/com_GCC_class.mk +++ b/solenv/gbuild/platform/com_GCC_class.mk @@ -36,7 +36,7 @@ gb_AsmObject_get_source = $(1)/$(2).s define gb_AsmObject__command $(call gb_Output_announce,$(2),$(true),ASM,3) $(call gb_Helper_abbreviate_dirs,\ - mkdir -p $(dir $(1)) $(dir $(4)) && \ + mkdir -p $(dir $(1)) $(dir $(4)) && cd $(SRCDIR) && \ $(gb_CC) \ $(DEFS) \ $(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \ @@ -54,7 +54,7 @@ endef define gb_CObject__command $(call gb_Output_announce,$(2).c,$(true),C ,3) $(call gb_Helper_abbreviate_dirs,\ - mkdir -p $(dir $(1)) $(dir $(4)) && \ + mkdir -p $(dir $(1)) $(dir $(4)) && cd $(SRCDIR) && \ $(gb_CC) \ $(DEFS) \ $(if $(filter Library,$(TARGETTYPE)),$(gb_Library_LTOFLAGS)) \ @@ -75,7 +75,7 @@ endef define gb_CxxObject__command $(call gb_Output_announce,$(2).cxx,$(true),CXX,3) $(call gb_Helper_abbreviate_dirs,\ - mkdir -p $(dir $(1)) $(dir $(4)) && \ + mkdir -p $(dir $(1)) $(dir $(4)) && cd $(SRCDIR) && \ $(gb_CXX) \ $(DEFS) \ $(if $(filter Library,$(TARGETTYPE)),$(gb_Library_LTOFLAGS)) \ @@ -92,7 +92,7 @@ endef define gb_SrsPartTarget__command_dep $(call gb_Helper_abbreviate_dirs,\ - mkdir -p $(dir $(call gb_SrsPartTarget_get_dep_target,$(1))) && \ + mkdir -p $(dir $(call gb_SrsPartTarget_get_dep_target,$(1))) && cd $(SRCDIR) && \ $(gb_GCCP) \ -MM -MT $(call gb_SrsPartTarget_get_target,$(1)) \ $(INCLUDE) \ |