Import OpenSSL 1.1.0h
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
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";
|
||||
@@ -40,7 +41,7 @@
|
||||
sub shlib {
|
||||
return () if $disabled{shared};
|
||||
my $lib = shift;
|
||||
return $unified_info{sharednames}->{$lib} . $shlibext;
|
||||
return $unified_info{sharednames}->{$lib}. $shlibvariant. $shlibext;
|
||||
}
|
||||
sub shlib_simple {
|
||||
return () if $disabled{shared};
|
||||
@@ -97,8 +98,7 @@ DEPS={- join(" ", map { (my $x = $_) =~ s|\.o$|$depext|; $x; }
|
||||
{- output_on() if $disabled{makedepend}; "" -}
|
||||
GENERATED_MANDATORY={- join(" ", @{$unified_info{depends}->{""}} ) -}
|
||||
GENERATED={- join(" ",
|
||||
( map { (my $x = $_) =~ s|\.S$|\.s|; $x }
|
||||
grep { defined $unified_info{generate}->{$_} }
|
||||
( grep { defined $unified_info{generate}->{$_} }
|
||||
map { @{$unified_info{sources}->{$_}} }
|
||||
grep { /\.o$/ } keys %{$unified_info{sources}} ),
|
||||
( grep { /\.h$/ } keys %{$unified_info{generate}} )) -}
|
||||
@@ -113,6 +113,9 @@ BIN_SCRIPTS=$(BLDDIR)/tools/c_rehash
|
||||
MISC_SCRIPTS=$(BLDDIR)/apps/CA.pl $(BLDDIR)/apps/tsget
|
||||
{- output_on() if $disabled{apps}; "" -}
|
||||
|
||||
APPS_OPENSSL={- use File::Spec::Functions;
|
||||
catfile("apps","openssl") -}
|
||||
|
||||
# DESTDIR is for package builders so that they can configure for, say,
|
||||
# /usr/ and yet have everything installed to /tmp/somedir/usr/.
|
||||
# Normally it is left empty.
|
||||
@@ -204,9 +207,8 @@ TARFILE= ../$(NAME).tar
|
||||
# order to be excused from maintaining a separate set of architecture
|
||||
# dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC
|
||||
# gcc, then the driver will automatically translate it to -xarch=v8plus
|
||||
# and pass it down to assembler.
|
||||
AS=$(CC) -c
|
||||
ASFLAG=$(CFLAGS)
|
||||
# and pass it down to assembler. In any case, we do not define AS or
|
||||
# ASFLAGS for this reason.
|
||||
PERLASM_SCHEME= {- $target{perlasm_scheme} -}
|
||||
|
||||
# For x86 assembler: Set PROCESSOR to 386 if you want to support
|
||||
@@ -237,15 +239,21 @@ build_programs_nodep: $(PROGRAMS) $(SCRIPTS)
|
||||
# Kept around for backward compatibility
|
||||
build_apps build_tests: build_programs
|
||||
|
||||
# Convenience target to prebuild all generated files, not just the mandatory
|
||||
# ones
|
||||
build_all_generated: $(GENERATED_MANDATORY) $(GENERATED)
|
||||
|
||||
test: tests
|
||||
{- dependmagic('tests'); -}: build_programs_nodep build_engines_nodep link-utils
|
||||
@ : {- output_off() if $disabled{tests}; "" -}
|
||||
( cd test; \
|
||||
mkdir -p test-runs; \
|
||||
SRCTOP=../$(SRCDIR) \
|
||||
BLDTOP=../$(BLDDIR) \
|
||||
RESULT_D=test-runs \
|
||||
PERL="$(PERL)" \
|
||||
EXE_EXT={- $exeext -} \
|
||||
OPENSSL_ENGINES=../$(BLDDIR)/engines \
|
||||
OPENSSL_ENGINES=`cd ../$(BLDDIR)/engines; pwd` \
|
||||
OPENSSL_DEBUG_MEMORY=on \
|
||||
$(PERL) ../$(SRCDIR)/test/run_tests.pl $(TESTS) )
|
||||
@ : {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
|
||||
@@ -285,7 +293,7 @@ clean: libclean
|
||||
-$(RM) `find . -name '*{- $objext -}' -a \! -path "./.git/*"`
|
||||
$(RM) core
|
||||
$(RM) tags TAGS doc-nits
|
||||
$(RM) test/.rnd
|
||||
$(RM) -r test/test-runs
|
||||
$(RM) openssl.pc libcrypto.pc libssl.pc
|
||||
-$(RM) `find . -type l -a \! -path "./.git/*"`
|
||||
$(RM) $(TARFILE)
|
||||
@@ -592,19 +600,9 @@ doc-nits:
|
||||
lint:
|
||||
lint -DLINT $(INCLUDES) $(SRCS)
|
||||
|
||||
{- # because the program apps/openssl has object files as sources, and
|
||||
# they then have the corresponding C files as source, we need to chain
|
||||
# the lookups in %unified_info
|
||||
my $apps_openssl = catfile("apps","openssl");
|
||||
our @openssl_source = map { @{$unified_info{sources}->{$_}} }
|
||||
@{$unified_info{sources}->{$apps_openssl}};
|
||||
""; -}
|
||||
generate_apps:
|
||||
( cd $(SRCDIR); $(PERL) VMS/VMSify-conf.pl \
|
||||
< apps/openssl.cnf > apps/openssl-vms.cnf )
|
||||
( b=`pwd`; cd $(SRCDIR); $(PERL) -I$$b apps/progs.pl \
|
||||
{- join(" ", @openssl_source) -} \
|
||||
> apps/progs.h )
|
||||
|
||||
generate_crypto_bn:
|
||||
( cd $(SRCDIR); $(PERL) crypto/bn/bn_prime.pl > crypto/bn/bn_prime.h )
|
||||
@@ -656,9 +654,12 @@ tags TAGS: FORCE
|
||||
|
||||
# Release targets (note: only available on Unix) #####################
|
||||
|
||||
# If your tar command doesn't support --owner and --group, make sure to
|
||||
# use one that does, for example GNU tar
|
||||
TAR_COMMAND=$(TAR) $(TARFLAGS) --owner 0 --group 0 -cvf -
|
||||
PREPARE_CMD=:
|
||||
tar:
|
||||
set -e; \
|
||||
TMPDIR=/var/tmp/openssl-copy.$$$$; \
|
||||
DISTDIR=$(NAME); \
|
||||
mkdir -p $$TMPDIR/$$DISTDIR; \
|
||||
@@ -669,12 +670,12 @@ tar:
|
||||
mkdir -p $$TMPDIR/$$DISTDIR/`dirname $$F`; \
|
||||
cp $$F $$TMPDIR/$$DISTDIR/$$F; \
|
||||
done); \
|
||||
(cd $$TMPDIR; \
|
||||
(cd $$TMPDIR/$$DISTDIR; \
|
||||
$(PREPARE_CMD); \
|
||||
find $$TMPDIR/$$DISTDIR -type d -print | xargs chmod 755; \
|
||||
find $$TMPDIR/$$DISTDIR -type f -print | xargs chmod a+r; \
|
||||
find $$TMPDIR/$$DISTDIR -type f -perm -0100 -print | xargs chmod a+x; \
|
||||
$(TAR_COMMAND) $$DISTDIR) \
|
||||
find . -type d -print | xargs chmod 755; \
|
||||
find . -type f -print | xargs chmod a+r; \
|
||||
find . -type f -perm -0100 -print | xargs chmod a+x); \
|
||||
(cd $$TMPDIR; $(TAR_COMMAND) $$DISTDIR) \
|
||||
| (cd $(SRCDIR); gzip --best > $(TARFILE).gz); \
|
||||
rm -rf $$TMPDIR
|
||||
cd $(SRCDIR); ls -l $(TARFILE).gz
|
||||
@@ -722,7 +723,6 @@ libssl.pc:
|
||||
echo 'Version: '$(VERSION); \
|
||||
echo 'Requires.private: libcrypto'; \
|
||||
echo 'Libs: -L$${libdir} -lssl'; \
|
||||
echo 'Libs.private: $(EX_LIBS)'; \
|
||||
echo 'Cflags: -I$${includedir}' ) > libssl.pc
|
||||
|
||||
openssl.pc:
|
||||
@@ -799,20 +799,6 @@ EOF
|
||||
}
|
||||
|
||||
if (defined($generator)) {
|
||||
# If the target is named foo.S in build.info, we want to
|
||||
# end up generating foo.s in two steps.
|
||||
if ($args{src} =~ /\.S$/) {
|
||||
(my $target = $args{src}) =~ s|\.S$|.s|;
|
||||
return <<"EOF";
|
||||
$target: $args{generator}->[0] $deps
|
||||
( trap "rm -f \$@.*" INT 0; \\
|
||||
$generator \$@.S; \\
|
||||
\$(CC) $incs \$(CFLAGS) -E \$@.S | \\
|
||||
\$(PERL) -ne '/^#(line)?\\s*[0-9]+/ or print' > \$@.i && \\
|
||||
mv -f \$@.i \$@ )
|
||||
EOF
|
||||
}
|
||||
# Otherwise....
|
||||
return <<"EOF";
|
||||
$args{src}: $args{generator}->[0] $deps
|
||||
$generator \$@
|
||||
@@ -820,7 +806,7 @@ EOF
|
||||
}
|
||||
return <<"EOF";
|
||||
$args{src}: $args{generator}->[0] $deps
|
||||
\$(CC) $incs \$(CFLAGS) -E \$< | \\
|
||||
\$(CC) $incs \$(CFLAGS) -E $args{generator}->[0] | \\
|
||||
\$(PERL) -ne '/^#(line)?\\s*[0-9]+/ or print' > \$@
|
||||
EOF
|
||||
}
|
||||
@@ -832,12 +818,7 @@ EOF
|
||||
sub src2obj {
|
||||
my %args = @_;
|
||||
my $obj = $args{obj};
|
||||
my @srcs = map { if ($unified_info{generate}->{$_}) {
|
||||
(my $x = $_) =~ s/\.S$/.s/; $x
|
||||
} else {
|
||||
$_
|
||||
}
|
||||
} ( @{$args{srcs}} );
|
||||
my @srcs = @{$args{srcs}};
|
||||
my $srcs = join(" ", @srcs);
|
||||
my $deps = join(" ", @srcs, @{$args{deps}});
|
||||
my $incs = join("", map { " -I".$_ } @{$args{incs}});
|
||||
@@ -850,11 +831,30 @@ EOF
|
||||
dso => '$(DSO_CFLAGS)',
|
||||
bin => '$(BIN_CFLAGS)' } -> {$args{intent}};
|
||||
my $makedepprog = $config{makedepprog};
|
||||
my $recipe = <<"EOF";
|
||||
$obj$objext: $deps
|
||||
EOF
|
||||
if (!$disabled{makedepend} && $makedepprog !~ /\/makedepend/) {
|
||||
my $recipe;
|
||||
# extension-specific rules
|
||||
if (grep /\.s$/, @srcs) {
|
||||
$recipe .= <<"EOF";
|
||||
$obj$objext: $deps
|
||||
\$(CC) \$(CFLAGS) $ecflags -c -o \$\@ $srcs
|
||||
EOF
|
||||
} elsif (grep /\.S$/, @srcs) {
|
||||
# In case one wonders why not just $(CC) -c file.S. While it
|
||||
# does work with contemporary compilers, there are some legacy
|
||||
# ones that get it wrong. Hence the elaborate scheme... We
|
||||
# don't care to maintain dependecy lists, because dependency
|
||||
# is rather weak, at most one header file that lists constants
|
||||
# which are assigned in ascending order.
|
||||
$recipe .= <<"EOF";
|
||||
$obj$objext: $deps
|
||||
( trap "rm -f \$@.*" INT 0; \\
|
||||
\$(CPP) $incs \$(CFLAGS) $ecflags $srcs | \\
|
||||
\$(PERL) -ne '/^#(line)?\\s*[0-9]+/ or print' > \$@.s && \\
|
||||
\$(CC) \$(CFLAGS) $ecflags -c -o \$\@ \$@.s )
|
||||
EOF
|
||||
} elsif (!$disabled{makedepend} && $makedepprog !~ /\/makedepend/) {
|
||||
$recipe .= <<"EOF";
|
||||
$obj$objext: $deps
|
||||
\$(CC) $incs \$(CFLAGS) $ecflags -MMD -MF $obj$depext.tmp -MT \$\@ -c -o \$\@ $srcs
|
||||
\@touch $obj$depext.tmp
|
||||
\@if cmp $obj$depext.tmp $obj$depext > /dev/null 2> /dev/null; then \\
|
||||
@@ -865,6 +865,7 @@ EOF
|
||||
EOF
|
||||
} else {
|
||||
$recipe .= <<"EOF";
|
||||
$obj$objext: $deps
|
||||
\$(CC) $incs \$(CFLAGS) $ecflags -c -o \$\@ $srcs
|
||||
EOF
|
||||
if (!$disabled{makedepend} && $makedepprog =~ /\/makedepend/) {
|
||||
@@ -900,6 +901,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.
|
||||
@@ -914,27 +916,28 @@ $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
|
||||
. (windowsdll() ? <<"EOF" : "");
|
||||
rm -f apps/$shlib$shlibext
|
||||
rm -f test/$shlib$shlibext
|
||||
rm -f fuzz/$shlib$shlibext
|
||||
cp -p $shlib$shlibext apps/
|
||||
cp -p $shlib$shlibext test/
|
||||
cp -p $shlib$shlibext fuzz/
|
||||
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//;
|
||||
@@ -942,17 +945,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
|
||||
|
||||
Reference in New Issue
Block a user