Versioning engines default location: the Unix case
authorRichard Levitte <levitte@openssl.org>
Wed, 6 Jul 2016 16:50:47 +0000 (18:50 +0200)
committerRichard Levitte <levitte@openssl.org>
Thu, 7 Jul 2016 13:07:32 +0000 (15:07 +0200)
OpenSSL engines are tied to the OpenSSL shared library versions,
starting with OpenSSL 1.1.  We therefore need to install them in
directories which have the shared library version in it's name, to
easily allow multiple OpenSSL versions to be installed at the same
time.

For Unix, the default installation directory is changed from
$PREFIX/lib/engines to $PREFIX/lib/engines-${major}_${minor} (mingw)
or $PREFIX/lib/engines-${major}.${minor} (all but mingw)

($PREFIX is the directory given for the configuration option --prefix,
and ${major} and ${minor} are the major and minor shared library
version numbers)

Reviewed-by: Rich Salz <rsalz@openssl.org>
Configurations/unix-Makefile.tmpl

index 989896156156fad231094ac0e17036a95912fe91..af7a5e75a3b3d3276e8cae125b8fb4f5ecdd1eb0 100644 (file)
 
      sub windowsdll { $config{target} =~ /^(?:Cygwin|mingw)/ }
 
+     our $sover = $config{target} =~ /^mingw/
+         ? $config{shlib_major}."_".$config{shlib_minor}
+         : $config{shlib_major}.".".$config{shlib_minor};
+
      # shlib and shlib_simple both take a static library name and figure
      # out what the shlib name should be.
      #
@@ -144,7 +148,7 @@ LIBDIR={- #
           our $libdir = $config{libdir} || "lib$multilib";
           $libdir -}
 ENGINESDIR={- use File::Spec::Functions;
-              catdir($prefix,$libdir,"engines") -}
+              catdir($prefix,$libdir,"engines-$sover") -}
 
 MANDIR=$(INSTALLTOP)/share/man
 DOCDIR=$(INSTALLTOP)/share/doc/$(BASENAME)
@@ -433,7 +437,7 @@ uninstall_dev:
 
 install_engines:
        @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
-       @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/
+       @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(ENGINESDIR)/
        @echo "*** Installing engines"
        @set -e; for e in dummy $(ENGINES); do \
                if [ "$$e" = "dummy" ]; then continue; fi; \
@@ -441,11 +445,11 @@ install_engines:
                if [ "$$fn" = '{- dso("ossltest") -}' ]; then \
                        continue; \
                fi; \
-               echo "install $$e -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn"; \
-               cp $$e $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn.new; \
-               chmod 755 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn.new; \
-               mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn.new \
-                     $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn; \
+               echo "install $$e -> $(DESTDIR)$(ENGINESDIR)/$$fn"; \
+               cp $$e $(DESTDIR)$(ENGINESDIR)/$$fn.new; \
+               chmod 755 $(DESTDIR)$(ENGINESDIR)/$$fn.new; \
+               mv -f $(DESTDIR)$(ENGINESDIR)/$$fn.new \
+                     $(DESTDIR)$(ENGINESDIR)/$$fn; \
        done
 
 uninstall_engines:
@@ -456,10 +460,10 @@ uninstall_engines:
                if [ "$$fn" = '{- dso("ossltest") -}' ]; then \
                        continue; \
                fi; \
-               echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn"; \
-               $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$$fn; \
+               echo "$(RM) $(DESTDIR)$(ENGINESDIR)/$$fn"; \
+               $(RM) $(DESTDIR)$(ENGINESDIR)/$$fn; \
        done
-       -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines
+       -$(RMDIR) $(DESTDIR)$(ENGINESDIR)
 
 install_runtime:
        @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)