|
13 | 13 | our $shlibextimport = $target{shared_import_extension} || ""; |
14 | 14 | our $dsoext = $target{dso_extension} || ".so"; |
15 | 15 |
|
| 16 | + # $mingw_installroot and $mingw_commonroot is relevant for mingw only. |
| 17 | + my $mingw_installenv = |
| 18 | + $target{build_scheme}->[2] eq "mingw" |
| 19 | + ? "ProgramFiles(x86)" : "ProgramW6432"; |
| 20 | + my $mingw_commonenv = |
| 21 | + $target{build_scheme}->[2] eq "mingw" |
| 22 | + ? "CommonProgramFiles(x86)" : "CommonProgramW6432"; |
| 23 | + our $mingw_installroot = |
| 24 | + defined($ENV{$mingw_installenv}) |
| 25 | + ? $mingw_installenv : 'ProgramFiles'; |
| 26 | + our $mingw_commonroot = |
| 27 | + defined($ENV{$mingw_commonenv}) |
| 28 | + ? $mingw_commonenv : 'CommonProgramFiles'; |
| 29 | + my $mingw_installdflt = |
| 30 | + defined($ENV{$mingw_installenv}) |
| 31 | + ? "C:/Program Files (x86)" : "C:/Program Files"; |
| 32 | + my $mingw_commondflt = "$mingw_installdflt/Common Files"; |
| 33 | + |
| 34 | + # expand variables early |
| 35 | + $mingw_installroot = $ENV{$mingw_installroot} // $mingw_installdflt; |
| 36 | + $mingw_commonroot = $ENV{$mingw_commonroot} // $mingw_commondflt; |
| 37 | + |
16 | 38 | sub windowsdll { $config{target} =~ /^(?:Cygwin|mingw)/ } |
17 | 39 |
|
18 | 40 | our $sover = $config{target} =~ /^mingw/ |
@@ -121,6 +143,7 @@ APPS_OPENSSL={- use File::Spec::Functions; |
121 | 143 | # Normally it is left empty. |
122 | 144 | DESTDIR= |
123 | 145 |
|
| 146 | +{- output_off() if $config{target} =~ /^mingw/; "" -} |
124 | 147 | # Do not edit these manually. Use Configure with --prefix or --openssldir |
125 | 148 | # to change this! Short explanation in the top comment in Configure |
126 | 149 | INSTALLTOP={- # $prefix is used in the OPENSSLDIR perl snippet |
@@ -159,6 +182,79 @@ ENGINESDIR={- use File::Spec::Functions; |
159 | 182 | # Convenience variable for those who want to set the rpath in shared |
160 | 183 | # libraries and applications |
161 | 184 | LIBRPATH=$(INSTALLTOP)/$(LIBDIR) |
| 185 | +{- output_on() if $config{target} =~ /^mingw/; |
| 186 | + output_off() if $config{target} !~ /^mingw/; |
| 187 | + "" -} |
| 188 | +# Do not edit these manually. Use Configure with --prefix or --openssldir |
| 189 | +# to change this! Short explanation in the top comment in Configure |
| 190 | +INSTALLTOP_dev={- # $prefix is used in the OPENSSLDIR perl snippet |
| 191 | + # |
| 192 | + use File::Spec::Win32; |
| 193 | + my $prefix_default = "$mingw_installroot/OpenSSL"; |
| 194 | + our $prefix = |
| 195 | + File::Spec::Win32->canonpath($config{prefix} |
| 196 | + || $prefix_default); |
| 197 | + our ($prefix_dev, $prefix_dir, $prefix_file) = |
| 198 | + File::Spec::Win32->splitpath($prefix, 1); |
| 199 | + $prefix =~ s|\\|/|g; |
| 200 | + $prefix_dir =~ s|\\|/|g; |
| 201 | + $prefix_dev -} |
| 202 | +INSTALLTOP_dir={- my $x = File::Spec::Win32->canonpath($prefix_dir); |
| 203 | + $x =~ s|\\|/|g; |
| 204 | + $x -} |
| 205 | +OPENSSLDIR_dev={- # |
| 206 | + # The logic here is that if no --openssldir was given, |
| 207 | + # OPENSSLDIR will get the value "$mingw_commonroot/SSL". |
| 208 | + # If --openssldir was given and the value is an absolute |
| 209 | + # path, OPENSSLDIR will get its value without change. |
| 210 | + # If the value from --openssldir is a relative path, |
| 211 | + # OPENSSLDIR will get $prefix with the --openssldir |
| 212 | + # value appended as a subdirectory. |
| 213 | + # |
| 214 | + use File::Spec::Win32; |
| 215 | + our $openssldir = |
| 216 | + $config{openssldir} ? |
| 217 | + (File::Spec::Win32->file_name_is_absolute($config{openssldir}) ? |
| 218 | + File::Spec::Win32->canonpath($config{openssldir}) |
| 219 | + : File::Spec::Win32->catdir($prefix, $config{openssldir})) |
| 220 | + : File::Spec::Win32->canonpath("$mingw_commonroot/SSL"); |
| 221 | + our ($openssldir_dev, $openssldir_dir, $openssldir_file) = |
| 222 | + File::Spec::Win32->splitpath($openssldir, 1); |
| 223 | + $openssldir =~ s|\\|/|g; |
| 224 | + $openssldir_dir =~ s|\\|/|g; |
| 225 | + $openssldir_dev -} |
| 226 | +OPENSSLDIR_dir={- my $x = File::Spec::Win32->canonpath($openssldir_dir); |
| 227 | + $x =~ s|\\|/|g; |
| 228 | + $x -} |
| 229 | +LIBDIR={- our $libdir = $config{libdir} || "lib"; |
| 230 | + $libdir -} |
| 231 | +ENGINESDIR_dev={- use File::Spec::Win32; |
| 232 | + our $enginesdir = |
| 233 | + File::Spec::Win32->catdir($prefix,$libdir, |
| 234 | + "engines-$sover_dirname"); |
| 235 | + our ($enginesdir_dev, $enginesdir_dir, $enginesdir_file) = |
| 236 | + File::Spec::Win32->splitpath($enginesdir, 1); |
| 237 | + $enginesdir =~ s|\\|/|g; |
| 238 | + $enginesdir_dir =~ s|\\|/|g; |
| 239 | + $enginesdir_dev -} |
| 240 | +ENGINESDIR_dir={- my $x = File::Spec::Win32->canonpath($enginesdir_dir); |
| 241 | + $x =~ s|\\|/|g; |
| 242 | + $x -} |
| 243 | +# In a Windows environment, $(DESTDIR) is harder to contatenate with other |
| 244 | +# directory variables, because both may contain devices. What we do here is |
| 245 | +# to adapt INSTALLTOP, OPENSSLDIR and ENGINESDIR depending on if $(DESTDIR) |
| 246 | +# has a value or not, to ensure that concatenation will always work further |
| 247 | +# down. |
| 248 | +ifneq "$(DESTDIR)" "" |
| 249 | +INSTALLTOP=$(INSTALLTOP_dir) |
| 250 | +OPENSSLDIR=$(OPENSSLDIR_dir) |
| 251 | +ENGINESDIR=$(ENGINESDIR_dir) |
| 252 | +else |
| 253 | +INSTALLTOP=$(INSTALLTOP_dev)$(INSTALLTOP_dir) |
| 254 | +OPENSSLDIR=$(OPENSSLDIR_dev)$(OPENSSLDIR_dir) |
| 255 | +ENGINESDIR=$(ENGINESDIR_dev)$(ENGINESDIR_dir) |
| 256 | +endif |
| 257 | +{- output_on() if $config{target} !~ /^mingw/; "" -} |
162 | 258 |
|
163 | 259 | MANDIR=$(INSTALLTOP)/share/man |
164 | 260 | DOCDIR=$(INSTALLTOP)/share/doc/$(BASENAME) |
|
0 commit comments