diff options
author | Richard Levitte <levitte@openssl.org> | 2017-12-04 14:27:58 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2017-12-12 17:18:07 +0100 |
commit | 81183680797f16bc05d39c1e9c1bf007fdbe4e19 (patch) | |
tree | beb69cd6c0f76ca8e1ac4c5f237608696d5a77ba /Configurations/descrip.mms.tmpl | |
parent | ccce3e1db5132e472d1871c6a02caec5c71db72a (diff) |
Build file templates: Replace the use of Makefile.shared
Because this also includes handling all sorts of non-object files when
linking a program, shared library or DSO, this also includes allowing
general recognition of files such as .res files (compiled from .rc
files), or .def / .map / .opt files (for export and possibly
versioning of public symbols only).
This does mean that there's a tangible change for all build file
templates: they must now recognise and handle the `.o` extension,
which is used internally to recognise object files internally. This
extension was removed by common.tmpl before this change, but would
mean that the platform specific templates wouldn't know if "foo.map"
was originally "foo.map.o" (i.e. an object file in its own right) or
"foo.map" (an export definition file that should be treated as such,
not as an object file).
For the sake of simplifying things, we also modify util/mkdef.pl to
produce .def (Windows) and .opt (VMS) files that don't need additional
hackery.
Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4840)
Diffstat (limited to 'Configurations/descrip.mms.tmpl')
-rw-r--r-- | Configurations/descrip.mms.tmpl | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/Configurations/descrip.mms.tmpl b/Configurations/descrip.mms.tmpl index cfa055b72d..0a1ca6419c 100644 --- a/Configurations/descrip.mms.tmpl +++ b/Configurations/descrip.mms.tmpl @@ -337,7 +337,7 @@ uninstall : uninstall_docs uninstall_sw # use $(LIBS), $(PROGRAMS), $(GENERATED) and $(ENGINES)directly. libclean : {- join("\n\t", map { "- DELETE $_.OLB;*" } @libs) || "@ !" -} - {- join("\n\t", map { "- DELETE $_.EXE;*,$_.MAP;*,$_.OPT;*" } @shlibs) || "@ !" -} + {- join("\n\t", map { "- DELETE $_.EXE;*,$_.MAP;*" } @shlibs) || "@ !" -} clean : libclean {- join("\n\t", map { "- DELETE $_.EXE;*,$_.OPT;*" } @{$unified_info{programs}}) || "@ !" -} @@ -589,7 +589,7 @@ EOF sub src2obj { my %args = @_; - my $obj = $args{obj}; + (my $obj = $args{obj}) =~ s|\.o$||; my $deps = join(", -\n\t\t", @{$args{srcs}}, @{$args{deps}}); # Because VMS C isn't very good at combining a /INCLUDE path with @@ -662,8 +662,10 @@ EOF my $libd = dirname($lib); my $libn = basename($lib); (my $mkdef_key = $libn) =~ s/^${osslprefix_q}lib([^0-9]*)\d*/$1/i; + my @defs = grep { $_ =~ /\.opt$/ } @{$args{objs}}; my @deps = compute_lib_depends(@{$args{deps}}); - my $deps = join(", -\n\t\t", @deps); + die "More than one symbol vector" if scalar @defs > 1; + my $deps = join(", -\n\t\t", @defs, @deps); my $shlib_target = $disabled{shared} ? "" : $target{shared_target}; my $ordinalsfile = defined($args{ordinals}) ? $args{ordinals}->[1] : ""; my $engine_opt = abs2rel(rel2abs(catfile($config{sourcedir}, @@ -672,6 +674,7 @@ EOF my $mkdef_pl = abs2rel(rel2abs(catfile($config{sourcedir}, "util", "mkdef.pl")), rel2abs($config{builddir})); + my $shared_def = join(",", map { "$_/OPT" } @defs); my $translatesyms_pl = abs2rel(rel2abs(catfile($config{sourcedir}, "VMS", "translatesyms.pl")), rel2abs($config{builddir})); @@ -686,19 +689,12 @@ EOF "WRITE OPT_FILE \"$x\"" } @deps) || "\@ !"; return <<"EOF" -$shlib.EXE : $lib.OLB $deps $ordinalsfile - \$(PERL) $mkdef_pl "$mkdef_key" "VMS" > $shlib.SYMVEC-tmp - \$(PERL) $translatesyms_pl \$(BLDDIR)CXX\$DEMANGLER_DB. < $shlib.SYMVEC-tmp > $shlib.SYMVEC - DELETE $shlib.SYMVEC-tmp;* - OPEN/WRITE/SHARE=READ OPT_FILE $shlib.OPT - WRITE OPT_FILE "IDENTIFICATION=""V$config{version}""" - TYPE $shlib.SYMVEC /OUTPUT=OPT_FILE: - WRITE OPT_FILE "$lib.OLB/LIBRARY" - $write_opt - CLOSE OPT_FILE - LINK \$(LDFLAGS)/SHARE=\$\@ $shlib.OPT/OPT \$(EX_LIBS) - DELETE $shlib.SYMVEC;* - PURGE $shlib.EXE,$shlib.OPT,$shlib.MAP +$shlib.EXE : $lib.OLB $deps + \$(PERL) $translatesyms_pl \$(BLDDIR)CXX\$DEMANGLER_DB. < $defs[0] > $defs[0]-translated + LINK \$(LDFLAGS)/SHARE=\$\@ $defs[0]-translated/OPT,$lib.OLB/LIBRARY + \$(EX_LIBS) + DELETE $defs[0]-translated;* + PURGE $shlib.EXE,$shlib.MAP EOF . ($config{target} =~ m|alpha| ? "" : <<"EOF" SET IMAGE/FLAGS=(NOCALL_DEBUG) \$\@ @@ -711,7 +707,7 @@ EOF my $libd = dirname($lib); my $libn = basename($lib); (my $libn_nolib = $libn) =~ s/^lib//; - my @objs = map { "$_.OBJ" } @{$args{objs}}; + my @objs = map { (my $x = $_) =~ s|\.o$|.OBJ|; $x } @{$args{objs}}; my @deps = compute_lib_depends(@{$args{deps}}); my $deps = join(", -\n\t\t", @objs, @deps); my $shlib_target = $disabled{shared} ? "" : $target{shared_target}; @@ -750,9 +746,10 @@ EOF sub obj2lib { my %args = @_; (my $lib = $args{lib}) =~ s/\.a$//; - my $objs = join(", -\n\t\t", map { $_.".OBJ" } (@{$args{objs}})); - my $fill_lib = join("\n\t", (map { "LIBRARY/REPLACE $lib.OLB $_.OBJ" } - @{$args{objs}})); + my @objs = map { (my $x = $_) =~ s|\.o$|.OBJ|; $x } @{$args{objs}}; + my $objs = join(", -\n\t\t", @objs); + my $fill_lib = join("\n\t", (map { "LIBRARY/REPLACE $lib.OLB $_" } + @objs)); return <<"EOF"; $lib.OLB : $objs LIBRARY/CREATE/OBJECT $lib.OLB @@ -765,7 +762,7 @@ EOF my $bin = $args{bin}; my $bind = dirname($bin); my $binn = basename($bin); - my @objs = map { "$_.OBJ" } @{$args{objs}}; + my @objs = map { (my $x = $_) =~ s|\.o$|.OBJ|; $x } @{$args{objs}}; my $objs = join(",", @objs); my @deps = compute_lib_depends(@{$args{deps}}); my $deps = join(", -\n\t\t", @objs, @deps); |