diff options
author | Peter Foley <pefoley2@verizon.net> | 2013-03-02 15:28:26 -0500 |
---|---|---|
committer | Andras Timar <atimar@suse.com> | 2013-03-04 12:52:00 +0000 |
commit | 6398cf9f874cf0879151d70e9f63f7b8d53b30e0 (patch) | |
tree | aeaccb3826d0bb2fd99dd5ec0886b0179d354329 /solenv | |
parent | 52db503897de94deae3121e1ce194c88b517f300 (diff) |
do not require cygwin gcc
Change-Id: I29de91f2eeb5c9317271aecf861f64a3c8eff73f
Reviewed-on: https://gerrit.libreoffice.org/2521
Reviewed-by: Michael Meeks <michael.meeks@suse.com>
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
Diffstat (limited to 'solenv')
-rw-r--r-- | solenv/CustomTarget_concat-deps.mk | 15 | ||||
-rw-r--r-- | solenv/Package_concat-deps.mk | 2 | ||||
-rw-r--r-- | solenv/bin/concat-deps.c | 24 |
3 files changed, 26 insertions, 15 deletions
diff --git a/solenv/CustomTarget_concat-deps.mk b/solenv/CustomTarget_concat-deps.mk index 1f138c59b8ab..6e8d56a637d8 100644 --- a/solenv/CustomTarget_concat-deps.mk +++ b/solenv/CustomTarget_concat-deps.mk @@ -9,16 +9,15 @@ $(eval $(call gb_CustomTarget_CustomTarget,solenv/concat-deps)) -$(call gb_CustomTarget_get_target,solenv/concat-deps) : \ - $(call gb_CustomTarget_get_workdir,solenv/concat-deps)/concat-deps +$(eval $(call gb_CustomTarget_register_targets,solenv/concat-deps,\ + concat-deps$(gb_Executable_EXT_for_build) \ +)) -$(call gb_CustomTarget_get_workdir,solenv/concat-deps)/concat-deps : \ - $(SRCDIR)/solenv/bin/concat-deps.c \ - | $(call gb_CustomTarget_get_workdir,solenv/concat-deps)/.dir - $(call gb_Output_announce,solenv/concat-deps,$(true),GCC,1) +$(call gb_CustomTarget_get_workdir,solenv/concat-deps)/concat-deps$(gb_Executable_EXT_for_build) : \ + $(SRCDIR)/solenv/bin/concat-deps.c + $(call gb_Output_announce,solenv/concat-deps,$(true),C,1) ifeq ($(COM_FOR_BUILD),MSC) - # on cygwin force the use of gcc - gcc -O2 $< -o $@ + LIB="$(ILIB)" $(CC_FOR_BUILD) -nologo $(SOLARINC) -O2 $< -Fo$(dir $@) -Fe$(dir $@) else $(CC_FOR_BUILD) -O2 $< -o $@ endif diff --git a/solenv/Package_concat-deps.mk b/solenv/Package_concat-deps.mk index 9d6319d18c48..9ede3860aea8 100644 --- a/solenv/Package_concat-deps.mk +++ b/solenv/Package_concat-deps.mk @@ -9,6 +9,6 @@ $(eval $(call gb_Package_Package,solenv_concat-deps,$(call gb_CustomTarget_get_workdir,solenv/concat-deps))) -$(eval $(call gb_Package_add_file,solenv_concat-deps,bin/concat-deps,concat-deps)) +$(eval $(call gb_Package_add_file,solenv_concat-deps,bin/concat-deps$(gb_Executable_EXT_for_build),concat-deps$(gb_Executable_EXT_for_build))) # vim: set noet sw=4 ts=4: diff --git a/solenv/bin/concat-deps.c b/solenv/bin/concat-deps.c index 5b478aa822fa..5782f66e10b2 100644 --- a/solenv/bin/concat-deps.c +++ b/solenv/bin/concat-deps.c @@ -30,12 +30,12 @@ #define USE_MEMORY_ALIGNMENT 4 #endif /* Def _AIX */ -#ifdef __CYGWIN__ +#ifdef _MSC_VER #define __windows #define CORE_BIG_ENDIAN 0 #define CORE_LITTLE_ENDIAN 1 #define USE_MEMORY_ALIGNMENT 64 /* big value -> no alignment */ -#endif /* Def __CYGWIN__ */ +#endif /* Def _MSC_VER */ #if defined(__linux) || defined(__OpenBSD__) || \ defined(__FreeBSD__) || defined(__NetBSD__) || \ @@ -97,7 +97,10 @@ #ifdef __windows #define FILE_O_RDONLY _O_RDONLY #define FILE_O_BINARY _O_BINARY -#define PATHNCMP strncasecmp /* MSVC converts paths to lower-case sometimes? */ +#define PATHNCMP _strnicmp /* MSVC converts paths to lower-case sometimes? */ +#define inline __inline +#define ssize_t long +#define S_ISREG(mode) (((mode) & _S_IFMT) == (_S_IFREG)) /* MSVC does not have this macro */ #else /* not windaube */ #define FILE_O_RDONLY O_RDONLY #define FILE_O_BINARY 0 @@ -775,10 +778,17 @@ static void emit_unpacked_target(char const*const token, char const*const end) { /* is there some obvious way to printf N characters that i'm missing? */ size_t size = end - token + 1; - char tmp[size]; + char* tmp=(char *)malloc(size*sizeof(char)); + #ifdef _MSC_VER + // MSVC _snprintf doesn't null terminate strings + _snprintf(tmp, size, "%s", token); + tmp[size-1]='\0'; + #else snprintf(tmp, size, "%s", token); + #endif fputs(tmp, stdout); fputs(".done ", stdout); + free(tmp); } /* prefix paths to absolute */ @@ -787,6 +797,7 @@ static inline void print_fullpaths(char* line) char* token; char* end; int boost_count = 0; + int token_len; const char * unpacked_end = 0; /* end of UnpackedTarget match (if any) */ /* for UnpackedTarget the target is GenC{,xx}Object, dont mangle! */ int target_seen = 0; @@ -805,7 +816,7 @@ static inline void print_fullpaths(char* line) while (*end && (' ' != *end) && ('\t' != *end) && (':' != *end)) { ++end; } - int token_len = end - token; + token_len = end - token; if (target_seen && elide_dependency(token, token_len, &unpacked_end)) { @@ -855,8 +866,9 @@ static inline void print_fullpaths(char* line) static inline char * eat_space_at_end(char * end) { + char * real_end; assert('\0' == *end); - char * real_end = end - 1; + real_end = end - 1; while (' ' == *real_end || '\t' == *real_end || '\n' == *real_end || ':' == *real_end) { /* eat colon and whitespace at end */ |