[PATCH] handle missing dep files in concat-deps
Björn Michaelsen (via_Code_Review)
gerrit at gerrit.libreoffice.org
Sun Jun 16 11:05:58 PDT 2013
Hi,
I have submitted a patch for review:
https://gerrit.libreoffice.org/4302
To pull it, you can do:
git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/02/4302/3
handle missing dep files in concat-deps
Change-Id: I515432bdefe2b055c78b6ba97868adbde65d9165
---
M solenv/bin/concat-deps.c
M solenv/gbuild/AllLangResTarget.mk
M solenv/gbuild/LinkTarget.mk
M solenv/gbuild/UnoApiTarget.mk
4 files changed, 63 insertions(+), 6 deletions(-)
diff --git a/solenv/bin/concat-deps.c b/solenv/bin/concat-deps.c
index 3613946..a8dbbd8 100644
--- a/solenv/bin/concat-deps.c
+++ b/solenv/bin/concat-deps.c
@@ -118,6 +118,7 @@
int internal_boost = 0;
static char* base_dir;
static char* work_dir;
+int work_dir_len;
#ifdef __GNUC__
#define clz __builtin_clz
@@ -864,6 +865,22 @@
return real_end;
}
+static char* phony_content_buffer;
+static inline char* generate_phony_line(char* phony_target)
+{
+ sprintf(phony_content_buffer, "%s/%s : $(gb_Helper_PHONY)\n", work_dir, phony_target);
+ return phony_content_buffer;
+}
+
+static inline void generate_phony_file(char* fn, char* content)
+{
+FILE* depfile;
+ depfile = fopen(fn, "w");
+ fputs(content, depfile);
+ fclose(depfile);
+}
+
+static char* target;
static int _process(struct hash* dep_hash, char* fn)
{
int rc;
@@ -872,6 +889,7 @@
char* cursor;
char* cursor_out;
char* base;
+char* created_line;
int continuation = 0;
char last_ns = 0;
off_t size;
@@ -985,6 +1003,45 @@
}
}
}
+ else
+ {
+ if(strncmp(fn, work_dir, work_dir_len) == 0)
+ {
+ if(strncmp(fn+work_dir_len, "/Dep/CxxObject/", 15) == 0)
+ {
+ strncpy(target, fn+work_dir_len+5, 4000);
+ *(target+strlen(target)-1) = 'o';
+ created_line = generate_phony_line(target);
+ generate_phony_file(fn, created_line);
+ puts(created_line);
+ rc = 0;
+ }
+ else if(strncmp(fn+work_dir_len, "/Dep/UnoApiPartTarget/", 22) == 0)
+ {
+ strncpy(target, fn+work_dir_len+5, 4000);
+ *(target+strlen(target)-2) = 0;
+ strncat(target, ".urd", 5);
+ created_line = generate_phony_line(target);
+ generate_phony_file(fn, created_line);
+ puts(created_line);
+ rc = 0;
+ }
+ else if(strncmp(fn+work_dir_len, "/Dep/SrsPartTarget/", 19) == 0)
+ {
+ strncpy(target, fn+work_dir_len+5, 20);
+ *(target+strlen(target)-2) = 0;
+ strncat(target, ".urd", 4);
+ created_line = generate_phony_line(target);
+ generate_phony_file(fn, created_line);
+ puts(created_line);
+ rc = 0;
+ }
+ else
+ {
+ fprintf(stderr, "no magic for %s in %s", fn, work_dir);
+ }
+ }
+ }
return rc;
}
@@ -1023,6 +1080,9 @@
}
if(get_var(&base_dir, "SRCDIR") || get_var(&work_dir, "WORKDIR"))
return 1;
+ work_dir_len = strlen(work_dir);
+ phony_content_buffer = malloc(work_dir_len+4096);
+ target = malloc(4096);
env_str = getenv("SYSTEM_BOOST");
internal_boost = !env_str || strcmp(env_str,"TRUE");
diff --git a/solenv/gbuild/AllLangResTarget.mk b/solenv/gbuild/AllLangResTarget.mk
index 9b7afbf..0791f01 100644
--- a/solenv/gbuild/AllLangResTarget.mk
+++ b/solenv/gbuild/AllLangResTarget.mk
@@ -102,8 +102,7 @@
ifeq ($(gb_FULLDEPS),$(true))
$(call gb_SrsPartTarget_get_dep_target,%) : $(SRCDIR)/% $(gb_Helper_MISCDUMMY)
$(call gb_Helper_abbreviate_dirs,\
- mkdir -p $(dir $@) && \
- echo "$(call gb_SrsPartTarget_get_target,$*) : $(gb_Helper_PHONY)" > $@)
+ mkdir -p $(dir $@))
endif
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
index 63f0f11..517c5bd 100644
--- a/solenv/gbuild/LinkTarget.mk
+++ b/solenv/gbuild/LinkTarget.mk
@@ -191,8 +191,7 @@
$(call gb_CxxObject_get_dep_target,%) :
$(if $(wildcard $@),touch $@,\
- $(eval $(gb_CxxObject__set_pchflags))\
- $(call gb_Object__command_dep,$@,$(call gb_CxxObject_get_target,$*)))
+ $(eval $(gb_CxxObject__set_pchflags)))
endif
diff --git a/solenv/gbuild/UnoApiTarget.mk b/solenv/gbuild/UnoApiTarget.mk
index 45096b3..59a2fc2 100644
--- a/solenv/gbuild/UnoApiTarget.mk
+++ b/solenv/gbuild/UnoApiTarget.mk
@@ -72,8 +72,7 @@
$(if $(wildcard $(dir $@)),,mkdir -p $(dir $@))
$(call gb_UnoApiPartTarget_get_dep_target,%) :
- $(if $(wildcard $@),touch $@,\
- $(call gb_Object__command_dep,$@,$(call gb_UnoApiPartTarget_get_target,$*.urd)))
+ $(if $(wildcard $@),touch $@)
endif
--
To view, visit https://gerrit.libreoffice.org/4302
To unsubscribe, visit https://gerrit.libreoffice.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I515432bdefe2b055c78b6ba97868adbde65d9165
Gerrit-PatchSet: 3
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Björn Michaelsen <bjoern.michaelsen at canonical.com>
Gerrit-Reviewer: Björn Michaelsen <bjoern.michaelsen at canonical.com>
Gerrit-Reviewer: Jan Holesovsky <kendy at suse.cz>
Gerrit-Reviewer: LibreOffice gerrit bot <gerrit at libreoffice.org>
Gerrit-Reviewer: Norbert Thiebaud <nthiebaud at gmail.com>
More information about the LibreOffice
mailing list