From: Richard Levitte Date: Sat, 19 May 2018 05:09:19 +0000 (+0200) Subject: Windows: don't install __DECC_*.H X-Git-Tag: OpenSSL_1_1_1-pre7~31 X-Git-Url: https://git.openssl.org/?p=openssl.git;a=commitdiff_plain;h=246bd8fd0507f4555432c148eed5a9322c113bf5;hp=6439e343fa64f06941197d085acd11bd13856596 Windows: don't install __DECC_*.H This adds the possibility to exclude files by regexp in util/copy.pl Partial fix for #3254 Reviewed-by: Tim Hudson Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/6303) --- diff --git a/Configurations/windows-makefile.tmpl b/Configurations/windows-makefile.tmpl index 49af571435..11acdf00f6 100644 --- a/Configurations/windows-makefile.tmpl +++ b/Configurations/windows-makefile.tmpl @@ -412,7 +412,8 @@ install_dev: @"$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\ms\applink.c" \ "$(INSTALLTOP)\include\openssl" @rem {- output_on() unless grep { $_ eq "OPENSSL_USE_APPLINK" } @{$config{defines}}; "" -} - @"$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\include\openssl\*.h" \ + @"$(PERL)" "$(SRCDIR)\util\copy.pl" "-exclude_re=/__DECC_" \ + "$(SRCDIR)\include\openssl\*.h" \ "$(INSTALLTOP)\include\openssl" @"$(PERL)" "$(SRCDIR)\util\copy.pl" $(BLDDIR)\include\openssl\*.h \ "$(INSTALLTOP)\include\openssl" diff --git a/util/copy.pl b/util/copy.pl index f93fb251db..ca4697a230 100644 --- a/util/copy.pl +++ b/util/copy.pl @@ -18,6 +18,7 @@ use Fcntl; my $stripcr = 0; my $arg; +my @excludes = (); foreach $arg (@ARGV) { if ($arg eq "-stripcr") @@ -25,11 +26,16 @@ foreach $arg (@ARGV) { $stripcr = 1; next; } + if ($arg =~ /^-exclude_re=(.*)$/) + { + push @excludes, $1; + next; + } $arg =~ s|\\|/|g; # compensate for bug/feature in cygwin glob... $arg = qq("$arg") if ($arg =~ /\s/); # compensate for bug in 5.10... - foreach (glob $arg) + foreach my $f (glob $arg) { - push @filelist, $_; + push @filelist, $f unless grep { $f =~ /$_/ } @excludes; } }