aboutsummaryrefslogtreecommitdiffstats
path: root/Configurations
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2017-07-21 18:04:51 +0200
committerRichard Levitte <levitte@openssl.org>2017-07-24 11:34:17 +0200
commitd07abe13a7955296da756d3f5032a276ac3d47ee (patch)
treeae2c4def4921e79240d412f7bcafbb02d05751ca /Configurations
parent1a68e5b0d9cf502de0d6c3701bbd5c6cb1aa7b73 (diff)
downloadopenssl-d07abe13a7955296da756d3f5032a276ac3d47ee.tar.gz
Simplify Makefile.shared
Makefile.shared was designed to figure out static library names, shared library names, library version compatibility, import library names and the like on its own. This was a design for pre-1.1.0 OpenSSL because the main Makefile didn't have all that knowledge. With 1.1.0, the situation isn't the same, a lot more knowledge is included in the main Makefile, and while Makefile.shared did things right most of the time (there are some corner cases, such as the choice of .sl or .so as DSO extension on some HPUX versions), there's still an inherent fragility when one has to keep an eye on Makefile.shared to make sure it produces what the main Makefile produces. This change simplifies Makefile.shared by removing all its "intelligence" and have it depend entirely on the input from the main Makefile instead. That way, all the naming is driven from configuration data. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3983)
Diffstat (limited to 'Configurations')
-rw-r--r--Configurations/unix-Makefile.tmpl23
1 files changed, 11 insertions, 12 deletions
diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl
index 16b84a6dbf..809c251e10 100644
--- a/Configurations/unix-Makefile.tmpl
+++ b/Configurations/unix-Makefile.tmpl
@@ -930,6 +930,7 @@ EOF
my $shlib_target = $target{shared_target};
my $ordinalsfile = defined($args{ordinals}) ? $args{ordinals}->[1] : "";
my $target = shlib_simple($lib);
+ my $target_full = shlib($lib);
return <<"EOF"
# With a build on a Windows POSIX layer (Cygwin or Mingw), we know for a fact
# that two files get produced, {shlibname}.dll and {libname}.dll.a.
@@ -945,11 +946,11 @@ $target: $lib$libext $deps $ordinalsfile
PERL="\$(PERL)" SRCDIR='\$(SRCDIR)' DSTDIR="$libd" \\
INSTALLTOP='\$(INSTALLTOP)' LIBDIR='\$(LIBDIR)' \\
LIBDEPS='\$(PLIB_LDFLAGS) '"$linklibs"' \$(EX_LIBS)' \\
- LIBNAME=$libname LIBVERSION=\$(SHLIB_MAJOR).\$(SHLIB_MINOR) \\
- LIBCOMPATVERSIONS=';\$(SHLIB_VERSION_HISTORY)' \\
+ LIBNAME=$libname SHLIBVERSION=\$(SHLIB_MAJOR).\$(SHLIB_MINOR) \\
+ STLIBNAME=$lib$libext \\
+ SHLIBNAME=$target SHLIBNAME_FULL=$target_full \\
CC='\$(CC)' CFLAGS='\$(CFLAGS) \$(LIB_CFLAGS)' \\
- LDFLAGS='\$(LDFLAGS)' \\
- SHARED_LDFLAGS='\$(LIB_LDFLAGS)' SHLIB_EXT=$shlibext \\
+ LDFLAGS='\$(LDFLAGS)' SHARED_LDFLAGS='\$(LIB_LDFLAGS)' \\
RC='\$(RC)' SHARED_RCFLAGS='\$(RCFLAGS)' \\
link_shlib.$shlib_target
EOF
@@ -962,10 +963,9 @@ EOF
}
sub obj2dso {
my %args = @_;
- my $lib = $args{lib};
- my $libd = dirname($lib);
- my $libn = basename($lib);
- (my $libname = $libn) =~ s/^lib//;
+ my $dso = $args{lib};
+ my $dsod = dirname($dso);
+ my $dson = basename($dso);
my $shlibdeps = join("", map { my $d = dirname($_);
my $f = basename($_);
(my $l = $f) =~ s/^lib//;
@@ -973,17 +973,16 @@ EOF
my $deps = join(" ",compute_lib_depends(@{$args{deps}}));
my $shlib_target = $target{shared_target};
my $objs = join(" ", map { $_.$objext } @{$args{objs}});
- my $target = dso($lib);
+ my $target = dso($dso);
return <<"EOF";
$target: $objs $deps
\$(MAKE) -f \$(SRCDIR)/Makefile.shared -e \\
PLATFORM=\$(PLATFORM) \\
- PERL="\$(PERL)" SRCDIR='\$(SRCDIR)' DSTDIR="$libd" \\
+ PERL="\$(PERL)" SRCDIR='\$(SRCDIR)' DSTDIR="$dsod" \\
LIBDEPS='\$(PLIB_LDFLAGS) '"$shlibdeps"' \$(EX_LIBS)' \\
- LIBNAME=$libname LDFLAGS='\$(LDFLAGS)' \\
+ SHLIBNAME_FULL=$target LDFLAGS='\$(LDFLAGS)' \\
CC='\$(CC)' CFLAGS='\$(CFLAGS) \$(DSO_CFLAGS)' \\
SHARED_LDFLAGS='\$(DSO_LDFLAGS)' \\
- SHLIB_EXT=$dsoext \\
LIBEXTRAS="$objs" \\
link_dso.$shlib_target
EOF