sub windowsdll { $config{target} =~ /^(?:Cygwin|mingw)/ }
- our $sover = $config{target} =~ /^mingw/
- ? $config{shlib_major}."_".$config{shlib_minor}
- : $config{shlib_major}.".".$config{shlib_minor};
+ 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.
sub shlib {
my $lib = shift;
return () if $disabled{shared} || $lib =~ /\.a$/;
- return $unified_info{sharednames}->{$lib} . $shlibext;
+ return $unified_info{sharednames}->{$lib} . '$(SHLIB_EXT)';
}
sub shlib_simple {
my $lib = shift;
return () if $disabled{shared} || $lib =~ /\.a$/;
if (windowsdll()) {
- return $lib . $shlibextimport;
+ return $lib . '$(SHLIB_EXT_IMPORT)';
}
- return $lib . $shlibextsimple;
+ return $lib . '$(SHLIB_EXT_SIMPLE)';
}
# Easy fixing of static library names
SHLIB_MAJOR={- $config{shlib_major} -}
SHLIB_MINOR={- $config{shlib_minor} -}
SHLIB_TARGET={- $target{shared_target} -}
+SHLIB_EXT={- $shlibext -}
+SHLIB_EXT_SIMPLE={- $shlibextsimple -}
+SHLIB_EXT_IMPORT={- $shlibextimport -}
LIBS={- join(" ", map { lib($_) } @{$unified_info{libraries}}) -}
SHLIBS={- join(" ", map { shlib($_) } @{$unified_info{libraries}}) -}
our $libdir = $config{libdir} || "lib$multilib";
$libdir -}
ENGINESDIR={- use File::Spec::Functions;
- catdir($prefix,$libdir,"engines-$sover") -}
+ catdir($prefix,$libdir,"engines-$sover_dirname") -}
# Convenience variable for those who want to set the rpath in shared
# libraries and applications
# 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; \
(cd $(SRCDIR); \
+ excl_re=`git submodule status | sed -e 's/^.//' | cut -d' ' -f2`; \
+ excl_re="^(fuzz/corpora|`echo $$excl_re | sed -e 's/ /$$|/g'`\$$)"; \
+ echo "$$excl_re"; \
git ls-tree -r --name-only --full-tree HEAD \
- | grep -v '^fuzz/corpora' \
+ | egrep -v "$$excl_re" \
| while read F; do \
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
dist:
- @$(MAKE) PREPARE_CMD='$(PERL) ./Configure dist' tar
+ @$(MAKE) PREPARE_CMD='$(PERL) ./Configure dist' TARFILE="$(TARFILE)" NAME="$(NAME)" tar
# Helper targets #####################################################
echo 'exec_prefix=$${prefix}'; \
echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
echo 'includedir=$${prefix}/include'; \
- echo 'enginesdir=$${libdir}/engines-{- $sover -}'; \
+ echo 'enginesdir=$${libdir}/engines-{- $sover_dirname -}'; \
echo ''; \
echo 'Name: OpenSSL-libcrypto'; \
echo 'Description: OpenSSL cryptography library'; \
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.
# With all other Unix platforms, we often build a shared library with the
# SO version built into the file name and a symlink without the SO version
# It's not necessary to have both as targets. The choice falls on the
-# simplest, {libname}$shlibextimport for Windows POSIX layers and
-# {libname}$shlibextsimple for the Unix platforms.
+# simplest, {libname}\$(SHLIB_EXT_IMPORT) for Windows POSIX layers and
+# {libname}\$(SHLIB_EXT_SIMPLE) for the Unix platforms.
$target: $lib$libext $deps $ordinalsfile
\$(MAKE) -f \$(SRCDIR)/Makefile.shared -e \\
ECHO=\$(ECHO) \\
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_VERSION_NUMBER) \\
+ 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
- cp -p $shlib$shlibext apps/
- cp -p $shlib$shlibext test/
+ rm -f apps/$shlib'\$(SHLIB_EXT)'
+ rm -f test/$shlib'\$(SHLIB_EXT)'
+ cp -p $shlib'\$(SHLIB_EXT)' apps/
+ cp -p $shlib'\$(SHLIB_EXT)' test/
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//;
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