Kaydet (Commit) 14028189 authored tarafından Michael Meeks's avatar Michael Meeks

elide all dependencies on .hdl files, they're ~all duplicated by .hpp

Also - verified that codemaker touches both .hdl and .hpp regardless
of whether the contents changed in anyway under gbuild.

Change-Id: I391e9cf952c61a6c59087cd7cd0ddc8c54a14df3
üst 20c03393
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#define _FRAMEGRABBER_HXX #define _FRAMEGRABBER_HXX
#include "gstplayer.hxx" #include "gstplayer.hxx"
#include "com/sun/star/media/XFrameGrabber.hdl" #include <com/sun/star/media/XFrameGrabber.hpp>
#include <cppuhelper/implbase2.hxx> #include <cppuhelper/implbase2.hxx>
namespace avmedia { namespace gstreamer { namespace avmedia { namespace gstreamer {
......
...@@ -710,11 +710,34 @@ static inline void eat_space(char ** token) ...@@ -710,11 +710,34 @@ static inline void eat_space(char ** token)
} }
} }
/*
* Prune LibreOffice specific duplicate dependencies to improve
* gnumake startup time, and shrink the disk-space footprint.
*/
static inline int elide_dependency(const char* key, int key_len)
{
#if 0
{
int i;
fprintf (stderr, "elide?!: '");
for (i = 0; i < key_len; i++) {
fprintf (stderr, "%c", key[i]);
}
fprintf (stderr, "'\n");
}
#endif
/* .hdl files are always matched by .hpp */
if (key_len > 4 && !strncmp(key + key_len - 4, ".hdl", 4))
return 1;
return 0;
}
/* prefix paths to absolute */ /* prefix paths to absolute */
static inline void print_fullpaths(char* line) static inline void print_fullpaths(char* line)
{ {
char* token; char* token;
char* end; char* end;
token = line; token = line;
eat_space(&token); eat_space(&token);
...@@ -724,15 +747,16 @@ char* end; ...@@ -724,15 +747,16 @@ char* end;
while (*end && (' ' != *end) && ('\t' != *end)) { while (*end && (' ' != *end) && ('\t' != *end)) {
++end; ++end;
} }
if(*token == ':' || *token == '\\' || *token == '/' || *token == '$' int token_len = end - token;
|| ':' == token[1]) if(elide_dependency(token, token_len))
; /* don't output it */
else if(*token == ':' || *token == '\\' || *token == '/' ||
*token == '$' || ':' == token[1])
{ {
fwrite(token, end - token, 1, stdout); fwrite(token, token_len, 1, stdout);
} }
else else
{ {
fputs(base_dir_var, stdout);
fputc('/', stdout);
fwrite(token, end - token, 1, stdout); fwrite(token, end - token, 1, stdout);
} }
fputc(' ', stdout); fputc(' ', stdout);
...@@ -741,6 +765,7 @@ char* end; ...@@ -741,6 +765,7 @@ char* end;
} }
} }
static int _process(struct hash* dep_hash, char* fn) static int _process(struct hash* dep_hash, char* fn)
{ {
int rc; int rc;
...@@ -795,7 +820,9 @@ off_t size; ...@@ -795,7 +820,9 @@ off_t size;
* these are the one for which we want to filter * these are the one for which we want to filter
* duplicate out * duplicate out
*/ */
if(hash_store(dep_hash, base, (int)(cursor_out - base))) int key_len = cursor_out - base;
if(!elide_dependency(base,key_len - 1) &&
hash_store(dep_hash, base, key_len))
{ {
/* DO NOT modify base after it has been added /* DO NOT modify base after it has been added
as key by hash_store */ as key by hash_store */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment