##
## Makefile for OpenSSL
##
## {- join("\n## ", @autowarntext) -}
{-
our $objext = $target{obj_extension} || ".o";
our $defext = $target{def_extension} || ".ld";
our $depext = $target{dep_extension} || ".d";
our $exeext = $target{exe_extension} || "";
our $libext = $target{lib_extension} || ".a";
our $shlibext = $target{shared_extension} || ".so";
our $shlibvariant = $target{shlib_variant} || "";
our $shlibextsimple = $target{shared_extension_simple} || ".so";
our $shlibextimport = $target{shared_import_extension} || "";
our $dsoext = $target{dso_extension} || ".so";
our $makedepprog = $disabled{makedepend} ? undef : $config{makedepprog};
sub windowsdll { $config{target} =~ /^(?:Cygwin|mingw)/ }
# Shared AIX support is special. We put libcrypto[64].so.ver into
# libcrypto.a and use libcrypto_a.a as static one.
sub sharedaix { !$disabled{shared} && $config{target} =~ /^aix/ }
our $sover_dirname = $config{shlib_version_number};
$sover_dirname =~ s|\.|_|g
if $config{target} =~ /^mingw/;
# shlib and shlib_simple both take a static library name and figure
# out what the shlib name should be.
#
# When OpenSSL is configured "no-shared", these functions will just
# return empty lists, making them suitable to join().
#
# With Windows DLL producers, shlib($libname) will return the shared
# library name (which usually is different from the static library
# name) with the default shared extension appended to it, while
# shlib_simple($libname) will return the static library name with
# the shared extension followed by ".a" appended to it. The former
# result is used as the runtime shared library while the latter is
# used as the DLL import library.
#
# On all Unix systems, shlib($libname) will return the library name
# with the default shared extension, while shlib_simple($libname)
# will return the name from shlib($libname) with any SO version number
# removed. On some systems, they may therefore return the exact same
# string.
sub shlib {
my $lib = shift;
return () if $disabled{shared} || $lib =~ /\.a$/;
return $unified_info{sharednames}->{$lib}. $shlibvariant. '$(SHLIB_EXT)';
}
sub shlib_simple {
my $lib = shift;
return () if $disabled{shared} || $lib =~ /\.a$/;
if (windowsdll()) {
return $lib . '$(SHLIB_EXT_IMPORT)';
}
return $lib . '$(SHLIB_EXT_SIMPLE)';
}
# Easy fixing of static library names
sub lib {
(my $lib = shift) =~ s/\.a$//;
return $lib . $libext;
}
# dso is a complement to shlib / shlib_simple that returns the
# given libname with the simple shared extension (possible SO version
# removed). This differs from shlib_simple() by being unconditional.
sub dso {
my $engine = shift;
return $engine . $dsoext;
}
# This makes sure things get built in the order they need
# to. You're welcome.
sub dependmagic {
my $target = shift;
return "$target: build_generated\n\t\$(MAKE) depend && \$(MAKE) _