Rebase against 666c5b6e20e3b9e1e34d10b88372406f494699f2.

This commit is contained in:
Alistair Leslie-Hughes
2020-09-15 11:15:32 +10:00
parent c35a3386eb
commit 91a9c0e3db
10 changed files with 375 additions and 380 deletions

View File

@@ -1,19 +1,19 @@
From 7824e15960e00ffb11adae1a1e683aa1487f6317 Mon Sep 17 00:00:00 2001
From 197e9857c0d65098111273e1d3219ac90f4896d2 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Wed, 29 Jan 2020 15:37:39 -0600
Subject: [PATCH 23/52] tools: Add support for multiple parent directories.
Subject: [PATCH] tools: Add support for multiple parent directories.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
---
tools/make_makefiles | 45 +++++++++++++++++++++++++++-----------------
tools/makedep.c | 30 ++++++++++++++++++++---------
2 files changed, 49 insertions(+), 26 deletions(-)
tools/makedep.c | 26 +++++++++++++++++--------
2 files changed, 46 insertions(+), 25 deletions(-)
diff --git a/tools/make_makefiles b/tools/make_makefiles
index c18fa90e2d3..1e34a280a40 100755
index a92987c2ab5..6bc1b47ca5d 100755
--- a/tools/make_makefiles
+++ b/tools/make_makefiles
@@ -231,14 +231,14 @@ sub parse_makefile($)
@@ -230,14 +230,14 @@ sub parse_makefile($)
{
die "Configure substitution is not allowed in $file" unless $file eq "Makefile";
}
@@ -30,7 +30,7 @@ index c18fa90e2d3..1e34a280a40 100755
{
my $var = $1;
my @list = split(/\s+/, $2);
@@ -293,19 +293,27 @@ sub get_makedep_flags($)
@@ -292,19 +292,27 @@ sub get_makedep_flags($)
return %flags;
}
@@ -66,7 +66,7 @@ index c18fa90e2d3..1e34a280a40 100755
}
# preserve shared source files that are listed in the existing makefile
@@ -410,13 +418,16 @@ sub assign_sources_to_makefiles(@)
@@ -409,13 +417,16 @@ sub assign_sources_to_makefiles(@)
foreach my $file (@makefiles)
{
my $make = $makefiles{$file};
@@ -91,28 +91,25 @@ index c18fa90e2d3..1e34a280a40 100755
}
diff --git a/tools/makedep.c b/tools/makedep.c
index 4bd20d469d6..a67add38afa 100644
index 7fe2c4daf54..55a52603820 100644
--- a/tools/makedep.c
+++ b/tools/makedep.c
@@ -184,6 +184,7 @@ struct makefile
@@ -184,11 +184,11 @@ struct makefile
struct strarray install_dev;
struct strarray extra_targets;
struct strarray extra_imports;
+ struct strarray parent_dirs;
struct list sources;
struct list includes;
const char *base_dir;
@@ -191,7 +192,6 @@ struct makefile
const char *src_dir;
const char *obj_dir;
const char *top_src_dir;
const char *top_obj_dir;
- const char *parent_dir;
const char *module;
const char *testdll;
const char *sharedlib;
@@ -1376,15 +1376,24 @@ static struct file *open_local_file( const struct makefile *make, const char *pa
@@ -1382,14 +1382,21 @@ static struct file *open_local_file( const struct makefile *make, const char *pa
{
char *src_path = root_dir_path( base_dir_path( make, path ));
char *src_path = src_dir_path( make, path );
struct file *ret = load_file( src_path );
+ unsigned int i;
@@ -125,23 +122,19 @@ index 4bd20d469d6..a67add38afa 100644
+
free( src_path );
- path = strmake( "%s/%s", make->parent_dir, path );
- src_path = root_dir_path( base_dir_path( make, path ));
- src_path = src_dir_path( make, path );
+ new_path = strmake( "%s/%s", make->parent_dirs.str[i], path );
+ src_path = root_dir_path( base_dir_path( make, new_path ));
+ src_path = src_dir_path( make, new_path );
ret = load_file( src_path );
- if (ret) ret->flags |= FLAG_PARENTDIR;
+ if (ret)
+ {
+ ret->flags |= FLAG_PARENTDIR;
+ path = new_path;
+ }
+ else
+ free(new_path);
}
if (ret) *filename = src_dir_path( make, path );
@@ -4275,13 +4284,13 @@ static void load_sources( struct makefile *make )
strarray_set_value( &make->vars, "top_srcdir", top_src_dir_path( make, "" ));
if (ret) *filename = src_path;
@@ -4129,13 +4136,13 @@ static void load_sources( struct makefile *make )
strarray_set_value( &make->vars, "top_srcdir", root_src_dir_path( "" ));
strarray_set_value( &make->vars, "srcdir", src_dir_path( make, "" ));
- make->parent_dir = get_expanded_make_variable( make, "PARENTSRC" );
@@ -155,7 +148,7 @@ index 4bd20d469d6..a67add38afa 100644
make->programs = get_expanded_make_var_array( make, "PROGRAMS" );
make->scripts = get_expanded_make_var_array( make, "SCRIPTS" );
make->imports = get_expanded_make_var_array( make, "IMPORTS" );
@@ -4326,8 +4335,11 @@ static void load_sources( struct makefile *make )
@@ -4180,8 +4187,11 @@ static void load_sources( struct makefile *make )
strarray_add( &make->include_args, strmake( "-I%s", obj_dir_path( make, "" )));
if (make->src_dir)
strarray_add( &make->include_args, strmake( "-I%s", make->src_dir ));
@@ -166,9 +159,9 @@ index 4bd20d469d6..a67add38afa 100644
+ for (i = 0; i < make->parent_dirs.count; i++)
+ strarray_add( &make->include_args, strmake( "-I%s", src_dir_path( make, make->parent_dirs.str[i] )));
+ }
strarray_add( &make->include_args, strmake( "-I%s", top_obj_dir_path( make, "include" )));
if (make->top_src_dir)
strarray_add( &make->include_args, strmake( "-I%s", top_src_dir_path( make, "include" )));
strarray_add( &make->include_args, "-Iinclude" );
if (root_src_dir) strarray_add( &make->include_args, strmake( "-I%s", root_src_dir_path( "include" )));
--
2.28.0