Windows: don't install __DECC_*.H
authorRichard Levitte <levitte@openssl.org>
Sat, 19 May 2018 05:09:19 +0000 (07:09 +0200)
committerRichard Levitte <levitte@openssl.org>
Sun, 20 May 2018 08:15:49 +0000 (10:15 +0200)
This adds the possibility to exclude files by regexp in util/copy.pl

Partial fix for #3254

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6303)

(cherry picked from commit 246bd8fd0507f4555432c148eed5a9322c113bf5)

Configurations/windows-makefile.tmpl
util/copy.pl

index e3e213f610a60ad0d9a4183e9a49f6fd3bc1676d..a2fd762c4e5f0a4fae74eb22650b17a77f0cbf59 100644 (file)
@@ -292,7 +292,8 @@ install_dev:
        @"$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\ms\applink.c" \
                                       "$(INSTALLTOP)\include\openssl"
        @rem {- output_on() unless grep { $_ eq "OPENSSL_USE_APPLINK" } @{$target{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"
index 01964f585e87c6adf0ccf926f5be4ce0e53f4c43..1a9cb71e5a2e2c651fee29271385bea75d0cef23 100644 (file)
@@ -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;
                }
 }