|
14 | 14 | our $dsoext = $target{dso_extension} || ".so"; |
15 | 15 | our $makedepprog = $disabled{makedepend} ? undef : $config{makedepprog}; |
16 | 16 |
|
| 17 | + # $mingw_installroot and $mingw_commonroot is relevant for mingw only. |
| 18 | + my $build_scheme = $target{build_scheme}; |
| 19 | + my $install_flavour = $build_scheme->[$#$build_scheme]; # last element |
| 20 | + my $mingw_installenv = $install_flavour eq "WOW" ? "ProgramFiles(x86)" |
| 21 | + : "ProgramW6432"; |
| 22 | + my $mingw_commonenv = $install_flavour eq "WOW" ? "CommonProgramFiles(x86)" |
| 23 | + : "CommonProgramW6432"; |
| 24 | + our $mingw_installroot = |
| 25 | + defined($ENV{$mingw_installenv}) ? $mingw_installenv : 'ProgramFiles'; |
| 26 | + our $mingw_commonroot = |
| 27 | + defined($ENV{$mingw_commonenv}) ? $mingw_commonenv : 'CommonProgramFiles'; |
| 28 | + my $mingw_installdflt = |
| 29 | + $install_flavour eq "WOW" ? "C:/Program Files (x86)" |
| 30 | + : "C:/Program Files"; |
| 31 | + my $mingw_commondflt = "$mingw_installdflt/Common Files"; |
| 32 | + |
| 33 | + # expand variables early |
| 34 | + $mingw_installroot = $ENV{$mingw_installroot} // $mingw_installdflt; |
| 35 | + $mingw_commonroot = $ENV{$mingw_commonroot} // $mingw_commondflt; |
| 36 | + |
17 | 37 | sub windowsdll { $config{target} =~ /^(?:Cygwin|mingw)/ } |
18 | 38 |
|
19 | 39 | # Shared AIX support is special. We put libcrypto[64].so.ver into |
@@ -132,6 +152,7 @@ APPS_OPENSSL={- use File::Spec::Functions; |
132 | 152 | # Normally it is left empty. |
133 | 153 | DESTDIR= |
134 | 154 |
|
| 155 | +{- output_off() if $config{target} =~ /^mingw/; "" -} |
135 | 156 | # Do not edit these manually. Use Configure with --prefix or --openssldir |
136 | 157 | # to change this! Short explanation in the top comment in Configure |
137 | 158 | INSTALLTOP={- # $prefix is used in the OPENSSLDIR perl snippet |
@@ -175,6 +196,83 @@ ENGINESDIR=$(libdir)/engines-{- $sover_dirname -} |
175 | 196 | # Convenience variable for those who want to set the rpath in shared |
176 | 197 | # libraries and applications |
177 | 198 | LIBRPATH=$(libdir) |
| 199 | +{- output_on() if $config{target} =~ /^mingw/; |
| 200 | + output_off() if $config{target} !~ /^mingw/; |
| 201 | + "" -} |
| 202 | +# Do not edit these manually. Use Configure with --prefix or --openssldir |
| 203 | +# to change this! Short explanation in the top comment in Configure |
| 204 | +INSTALLTOP_dev={- # $prefix is used in the OPENSSLDIR perl snippet |
| 205 | + # |
| 206 | + use File::Spec::Win32; |
| 207 | + my $prefix_default = "$mingw_installroot/OpenSSL"; |
| 208 | + our $prefix = |
| 209 | + File::Spec::Win32->canonpath($config{prefix} |
| 210 | + || $prefix_default); |
| 211 | + our ($prefix_dev, $prefix_dir, $prefix_file) = |
| 212 | + File::Spec::Win32->splitpath($prefix, 1); |
| 213 | + $prefix =~ s|\\|/|g; |
| 214 | + $prefix_dir =~ s|\\|/|g; |
| 215 | + $prefix_dev -} |
| 216 | +INSTALLTOP_dir={- my $x = File::Spec::Win32->canonpath($prefix_dir); |
| 217 | + $x =~ s|\\|/|g; |
| 218 | + $x -} |
| 219 | +OPENSSLDIR_dev={- # |
| 220 | + # The logic here is that if no --openssldir was given, |
| 221 | + # OPENSSLDIR will get the value "$mingw_commonroot/SSL". |
| 222 | + # If --openssldir was given and the value is an absolute |
| 223 | + # path, OPENSSLDIR will get its value without change. |
| 224 | + # If the value from --openssldir is a relative path, |
| 225 | + # OPENSSLDIR will get $prefix with the --openssldir |
| 226 | + # value appended as a subdirectory. |
| 227 | + # |
| 228 | + use File::Spec::Win32; |
| 229 | + our $openssldir = |
| 230 | + $config{openssldir} ? |
| 231 | + (File::Spec::Win32->file_name_is_absolute($config{openssldir}) ? |
| 232 | + File::Spec::Win32->canonpath($config{openssldir}) |
| 233 | + : File::Spec::Win32->catdir($prefix, $config{openssldir})) |
| 234 | + : File::Spec::Win32->canonpath("$mingw_commonroot/SSL"); |
| 235 | + our ($openssldir_dev, $openssldir_dir, $openssldir_file) = |
| 236 | + File::Spec::Win32->splitpath($openssldir, 1); |
| 237 | + $openssldir =~ s|\\|/|g; |
| 238 | + $openssldir_dir =~ s|\\|/|g; |
| 239 | + $openssldir_dev -} |
| 240 | +OPENSSLDIR_dir={- my $x = File::Spec::Win32->canonpath($openssldir_dir); |
| 241 | + $x =~ s|\\|/|g; |
| 242 | + $x -} |
| 243 | +LIBDIR={- our $libdir = $config{libdir} || "lib"; |
| 244 | + File::Spec::Win32->file_name_is_absolute($libdir) ? "" : $libdir -} |
| 245 | +ENGINESDIR_dev={- use File::Spec::Win32; |
| 246 | + our $enginesdir = |
| 247 | + File::Spec::Win32->catdir($prefix,$libdir, |
| 248 | + "engines-$sover_dirname"); |
| 249 | + our ($enginesdir_dev, $enginesdir_dir, $enginesdir_file) = |
| 250 | + File::Spec::Win32->splitpath($enginesdir, 1); |
| 251 | + $enginesdir =~ s|\\|/|g; |
| 252 | + $enginesdir_dir =~ s|\\|/|g; |
| 253 | + $enginesdir_dev -} |
| 254 | +ENGINESDIR_dir={- my $x = File::Spec::Win32->canonpath($enginesdir_dir); |
| 255 | + $x =~ s|\\|/|g; |
| 256 | + $x -} |
| 257 | +# In a Windows environment, $(DESTDIR) is harder to contatenate with other |
| 258 | +# directory variables, because both may contain devices. What we do here is |
| 259 | +# to adapt INSTALLTOP, OPENSSLDIR and ENGINESDIR depending on if $(DESTDIR) |
| 260 | +# has a value or not, to ensure that concatenation will always work further |
| 261 | +# down. |
| 262 | +ifneq "$(DESTDIR)" "" |
| 263 | +INSTALLTOP=$(INSTALLTOP_dir) |
| 264 | +OPENSSLDIR=$(OPENSSLDIR_dir) |
| 265 | +ENGINESDIR=$(ENGINESDIR_dir) |
| 266 | +else |
| 267 | +INSTALLTOP=$(INSTALLTOP_dev)$(INSTALLTOP_dir) |
| 268 | +OPENSSLDIR=$(OPENSSLDIR_dev)$(OPENSSLDIR_dir) |
| 269 | +ENGINESDIR=$(ENGINESDIR_dev)$(ENGINESDIR_dir) |
| 270 | +endif |
| 271 | + |
| 272 | +# $(libdir) is chosen to be compatible with the GNU coding standards |
| 273 | +libdir={- File::Spec::Win32->file_name_is_absolute($libdir) |
| 274 | + ? $libdir : '$(INSTALLTOP)/$(LIBDIR)' -} |
| 275 | +{- output_on() if $config{target} !~ /^mingw/; "" -} |
178 | 276 |
|
179 | 277 | MANDIR=$(INSTALLTOP)/share/man |
180 | 278 | DOCDIR=$(INSTALLTOP)/share/doc/$(BASENAME) |
|
0 commit comments