diff options
author | Richard Levitte <levitte@openssl.org> | 2016-11-09 20:01:51 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2016-11-10 15:51:42 +0100 |
commit | 186a31e510d1326063cfeca17e58fadec236ad2a (patch) | |
tree | 229bc2215ceeac6eac726c455a52be262e19b82d /Configurations/unix-Makefile.tmpl | |
parent | 42e055e12496a0eab72c64de845aa5bb18a9c4a2 (diff) | |
download | openssl-new-186a31e510d1326063cfeca17e58fadec236ad2a.tar.gz |
Building: make it possible to force linking with static OpenSSL libs
Very simply, support having the .a extension to denote depending on
static libraries. Note that this is not supported on native Windows
when building shared libraries, as there is not static library then,
just an import library with the same name.
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1889)
Diffstat (limited to 'Configurations/unix-Makefile.tmpl')
-rw-r--r-- | Configurations/unix-Makefile.tmpl | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl index 1c85637f49..84ceb76365 100644 --- a/Configurations/unix-Makefile.tmpl +++ b/Configurations/unix-Makefile.tmpl @@ -844,13 +844,13 @@ configdata.pm: $(SRCDIR)/Configure $(SRCDIR)/config {- join(" ", @{$config{build # It takes a list of library names and outputs a list of dependencies sub compute_lib_depends { if ($disabled{shared}) { - return map { $_.$libext } @_; + return map { $_ =~ /\.a$/ ? $`.$libext : $_.$libext } @_; } # Depending on shared libraries: # On Windows POSIX layers, we depend on {libname}.dll.a # On Unix platforms, we depend on {shlibname}.so - return map { shlib_simple($_) } @_; + return map { $_ =~ /\.a$/ ? $`.$libext : shlib_simple($_) } @_; } sub generatesrc { @@ -1073,11 +1073,16 @@ EOF my $binn = basename($bin); my $objs = join(" ", map { $_.$objext } @{$args{objs}}); my $deps = join(" ",compute_lib_depends(@{$args{deps}})); - my $linklibs = join("", map { my $d = dirname($_); - my $f = basename($_); - $d = "." if $d eq $f; - (my $l = $f) =~ s/^lib//; - " -L$d -l$l" } @{$args{deps}}); + my $linklibs = join("", map { if ($_ =~ /\.a$/) { + " $_"; + } else { + my $d = dirname($_); + my $f = basename($_); + $d = "." if $d eq $f; + (my $l = $f) =~ s/^lib//; + " -L$d -l$l" + } + } @{$args{deps}}); my $shlib_target = $disabled{shared} ? "" : $target{shared_target}; my $cc = '$(CC)'; my $cflags = '$(CFLAGS) $(BIN_CFLAGS)'; |