diff options
author | Tanzinul Islam <tanzinul.islam@gmail.com> | 2020-11-15 20:57:49 +0000 |
---|---|---|
committer | Dmitry Belyavskiy <beldmit@gmail.com> | 2021-04-19 11:05:54 +0200 |
commit | 8557bdde4836b4dc63ad305c9f3c648816a05e86 (patch) | |
tree | 3a8caf5d45055433c8bc26341faccf95d636776f /Configurations | |
parent | e15eff3aaabe17be37ec42ae7ca342cbf2a2733c (diff) | |
download | openssl-8557bdde4836b4dc63ad305c9f3c648816a05e86.tar.gz |
Avoid quoting dependency filepaths in build tree
C++Builder's `make.exe` has a bug in finding the rule of a quoted
dependency that doesn't exist in the filesystem. So for example:
A: "src\B" "out\C"
touch $@
out\C:
mkdir out
touch $@
leads to:
Fatal: '"out\C"' does not exist - don't know how to make it
This happens even with the `-N` option, and is different behavior from
Microsoft NMake which documents the feature of [quoted filepaths][1].
Commit cb663908 quoted all dependency filepaths, in case they are used
in a out-of-source build. The quoting is not done for target names,
however, which implies that the build directory is still expected to not
have spaces. It follows that we only need to quote non-generated source
files in dependency lists, since generated source files will be created
in the build directory.
Change the logic accordingly as a workaround, so that it works at least
for in-source builds with C++Builder's `make.exe`.
[1]: https://docs.microsoft.com/cpp/build/reference/long-filenames-in-a-makefile?view=msvc-160
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/13540)
Diffstat (limited to 'Configurations')
-rw-r--r-- | Configurations/windows-makefile.tmpl | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Configurations/windows-makefile.tmpl b/Configurations/windows-makefile.tmpl index 5d1d77b3d2..73ddcc8bd5 100644 --- a/Configurations/windows-makefile.tmpl +++ b/Configurations/windows-makefile.tmpl @@ -621,7 +621,7 @@ reconfigure reconf: {- use File::Basename; - use File::Spec::Functions qw/:DEFAULT abs2rel rel2abs/; + use File::Spec::Functions qw/:DEFAULT abs2rel rel2abs file_name_is_absolute/; # Helper function to figure out dependencies on libraries # It takes a list of library names and outputs a list of dependencies @@ -649,7 +649,10 @@ EOF my $incs = join("", map { " -I\"$_\"" } @{$args{incs}}); my $defs = join("", map { " -D".$_ } @{$args{defs}}); my $deps = @{$args{deps}} ? - '"'.join('" "', @{$args{generator_deps}}, @{$args{deps}}).'"' : ''; + join(' ', + map { file_name_is_absolute($_) || ($_ =~ m|^../|) ? "\"$_\"" : $_ } + (@{$args{generator_deps}}, @{$args{deps}})) + : ''; if ($args{src} =~ /\.html$/) { # @@ -787,7 +790,9 @@ EOF ? platform->asm($x) : $x } ( @{$args{srcs}} ); my $srcs = '"'.join('" "', @srcs).'"'; - my $deps = '"'.join('" "', @srcs, @{$args{deps}}).'"'; + my $deps = join(' ', + map { file_name_is_absolute($_) || ($_ =~ m|^../|) ? "\"$_\"" : $_ } + (@srcs, @{$args{deps}})); my $incs = join("", map { ' -I"'.$_.'"' } @{$args{incs}}); my $defs = join("", map { " -D".$_ } @{$args{defs}}); my $cflags = { shlib => ' $(LIB_CFLAGS)', |