Build files: add module installation targets
authorRichard Levitte <levitte@openssl.org>
Fri, 17 Apr 2020 13:38:45 +0000 (15:38 +0200)
committerRichard Levitte <levitte@openssl.org>
Sun, 19 Apr 2020 21:36:51 +0000 (23:36 +0200)
We only installed engines, now we also install other modules.

Fixes #11559

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/11566)

Configurations/descrip.mms.tmpl
Configurations/unix-Makefile.tmpl
Configurations/windows-makefile.tmpl
INSTALL.md

index 8ce6e78..2eb05d1 100644 (file)
       grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
              && $unified_info{attributes}->{modules}->{$_}->{engine} }
       @{$unified_info{modules}};
       grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
              && $unified_info{attributes}->{modules}->{$_}->{engine} }
       @{$unified_info{modules}};
+  our @install_modules =
+      grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
+             && !$unified_info{attributes}->{modules}->{$_}->{engine} }
+      @{$unified_info{modules}};
   our @install_programs =
       grep { !$unified_info{attributes}->{programs}->{$_}->{noinst} }
       @{$unified_info{programs}};
   our @install_programs =
       grep { !$unified_info{attributes}->{programs}->{$_}->{noinst} }
       @{$unified_info{programs}};
@@ -132,6 +136,7 @@ GENERATED={- # common0.tmpl provides @generated
 INSTALL_LIBS={- join(", ", map { "-\n\t".$_.".OLB" } @install_libs) -}
 INSTALL_SHLIBS={- join(", ", map { "-\n\t".$_.".EXE" } @install_shlibs) -}
 INSTALL_ENGINES={- join(", ", map { "-\n\t".$_.".EXE" } @install_engines) -}
 INSTALL_LIBS={- join(", ", map { "-\n\t".$_.".OLB" } @install_libs) -}
 INSTALL_SHLIBS={- join(", ", map { "-\n\t".$_.".EXE" } @install_shlibs) -}
 INSTALL_ENGINES={- join(", ", map { "-\n\t".$_.".EXE" } @install_engines) -}
+INSTALL_MODULES={- join(", ", map { "-\n\t".$_.".EXE" } @install_modules) -}
 INSTALL_PROGRAMS={- join(", ", map { "-\n\t".$_.".EXE" } @install_programs) -}
 BIN_SCRIPTS={- join(", ", @install_bin_scripts) -}
 MISC_SCRIPTS={- join(", ", @install_misc_scripts) -}
 INSTALL_PROGRAMS={- join(", ", map { "-\n\t".$_.".EXE" } @install_programs) -}
 BIN_SCRIPTS={- join(", ", @install_bin_scripts) -}
 MISC_SCRIPTS={- join(", ", @install_misc_scripts) -}
@@ -521,11 +526,11 @@ descrip.mms : FORCE
 
 # Install helper targets #############################################
 
 
 # Install helper targets #############################################
 
-install_sw : install_dev install_engines install_runtime -
-             install_startup install_ivp
+install_sw : install_dev install_engines install_modules -
+             install_runtime install_startup install_ivp
 
 
-uninstall_sw : uninstall_dev uninstall_engines uninstall_runtime -
-               uninstall_startup uninstall_ivp
+uninstall_sw : uninstall_dev uninstall_modules uninstall_engines -
+               uninstall_runtime uninstall_startup uninstall_ivp
 
 install_docs : install_html_docs
 
 
 install_docs : install_html_docs
 
@@ -566,13 +571,22 @@ install_dev : check_INSTALLTOP install_runtime_libs
 
 install_engines : check_INSTALLTOP install_runtime_libs build_modules
         @ {- output_off() unless scalar @install_engines; "" -} !
 
 install_engines : check_INSTALLTOP install_runtime_libs build_modules
         @ {- output_off() unless scalar @install_engines; "" -} !
-        @ WRITE SYS$OUTPUT "*** Installing ENGINE modules"
+        @ WRITE SYS$OUTPUT "*** Installing engines"
         - CREATE/DIR ossl_installroot:[ENGINES{- $sover_dirname.$target{pointer_size} -}.'arch']
         {- join("\n        ",
                 map { "COPY/PROT=W:RE $_.EXE ossl_installroot:[ENGINES$sover_dirname$target{pointer_size}.'arch']" }
                 @install_engines) -}
         @ {- output_on() unless scalar @install_engines; "" -} !
 
         - CREATE/DIR ossl_installroot:[ENGINES{- $sover_dirname.$target{pointer_size} -}.'arch']
         {- join("\n        ",
                 map { "COPY/PROT=W:RE $_.EXE ossl_installroot:[ENGINES$sover_dirname$target{pointer_size}.'arch']" }
                 @install_engines) -}
         @ {- output_on() unless scalar @install_engines; "" -} !
 
+install_modules : check_INSTALLTOP install_runtime_libs build_modules
+        @ {- output_off() unless scalar @install_modules; "" -} !
+        @ WRITE SYS$OUTPUT "*** Installing modules"
+        - CREATE/DIR ossl_installroot:[MODULES{- $sover_dirname.$target{pointer_size} -}.'arch']
+        {- join("\n        ",
+                map { "COPY/PROT=W:RE $_.EXE ossl_installroot:[MODULES$sover_dirname$target{pointer_size}.'arch']" }
+                @install_modules) -}
+        @ {- output_on() unless scalar @install_modules; "" -} !
+
 install_runtime : install_programs
 
 install_runtime_libs : check_INSTALLTOP build_libs
 install_runtime : install_programs
 
 install_runtime_libs : check_INSTALLTOP build_libs
index 12f0269..b6f8da1 100644 (file)
@@ -138,6 +138,14 @@ INSTALL_ENGINES={-
                                && $unified_info{attributes}->{modules}->{$_}->{engine} }
                         @{$unified_info{modules}}))
 -}
                                && $unified_info{attributes}->{modules}->{$_}->{engine} }
                         @{$unified_info{modules}}))
 -}
+INSTALL_MODDULES={-
+        join(" \\\n" . ' ' x 16,
+             fill_lines(" ", $COLUMNS - 16,
+                        map { platform->dso($_) }
+                        grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
+                               && !$unified_info{attributes}->{modules}->{$_}->{engine} }
+                        @{$unified_info{modules}}))
+-}
 INSTALL_PROGRAMS={-
         join(" \\\n" . ' ' x 16,
              fill_lines(" ", $COLUMNS - 16, map { platform->bin($_) }
 INSTALL_PROGRAMS={-
         join(" \\\n" . ' ' x 16,
              fill_lines(" ", $COLUMNS - 16, map { platform->bin($_) }
@@ -532,9 +540,9 @@ depend:
 
 # Install helper targets #############################################
 
 
 # Install helper targets #############################################
 
-install_sw: install_dev install_engines install_runtime
+install_sw: install_dev install_engines install_modules install_runtime
 
 
-uninstall_sw: uninstall_runtime uninstall_engines uninstall_dev
+uninstall_sw: uninstall_runtime uninstall_modules uninstall_engines uninstall_dev
 
 install_docs: install_man_docs install_html_docs
 
 
 install_docs: install_man_docs install_html_docs
 
@@ -702,10 +710,12 @@ uninstall_dev: uninstall_runtime_libs
        -$(RMDIR) $(DESTDIR)$(libdir)/pkgconfig
        -$(RMDIR) $(DESTDIR)$(libdir)
 
        -$(RMDIR) $(DESTDIR)$(libdir)/pkgconfig
        -$(RMDIR) $(DESTDIR)$(libdir)
 
-install_engines: install_runtime_libs build_modules
+_install_modules_deps: install_runtime_libs build_modules
+
+install_engines: _install_modules_deps
        @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
        @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(ENGINESDIR)/
        @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
        @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(ENGINESDIR)/
-       @$(ECHO) "*** Installing ENGINE modules"
+       @$(ECHO) "*** Installing engines"
        @set -e; for e in dummy $(INSTALL_ENGINES); do \
                if [ "$$e" = "dummy" ]; then continue; fi; \
                fn=`basename $$e`; \
        @set -e; for e in dummy $(INSTALL_ENGINES); do \
                if [ "$$e" = "dummy" ]; then continue; fi; \
                fn=`basename $$e`; \
@@ -717,7 +727,7 @@ install_engines: install_runtime_libs build_modules
        done
 
 uninstall_engines:
        done
 
 uninstall_engines:
-       @$(ECHO) "*** Uninstalling ENGINE modules"
+       @$(ECHO) "*** Uninstalling engines"
        @set -e; for e in dummy $(INSTALL_ENGINES); do \
                if [ "$$e" = "dummy" ]; then continue; fi; \
                fn=`basename $$e`; \
        @set -e; for e in dummy $(INSTALL_ENGINES); do \
                if [ "$$e" = "dummy" ]; then continue; fi; \
                fn=`basename $$e`; \
@@ -729,6 +739,33 @@ uninstall_engines:
        done
        -$(RMDIR) $(DESTDIR)$(ENGINESDIR)
 
        done
        -$(RMDIR) $(DESTDIR)$(ENGINESDIR)
 
+install_modules: _install_modules_deps
+       @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
+       @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(MODULESDIR)/
+       @$(ECHO) "*** Installing modules"
+       @set -e; for e in dummy $(INSTALL_MODULES); do \
+               if [ "$$e" = "dummy" ]; then continue; fi; \
+               fn=`basename $$e`; \
+               $(ECHO) "install $$e -> $(DESTDIR)$(MODULESDIR)/$$fn"; \
+               cp $$e $(DESTDIR)$(MODULESDIR)/$$fn.new; \
+               chmod 755 $(DESTDIR)$(MODULESDIR)/$$fn.new; \
+               mv -f $(DESTDIR)$(MODULESDIR)/$$fn.new \
+                     $(DESTDIR)$(MODULESDIR)/$$fn; \
+       done
+
+uninstall_modules:
+       @$(ECHO) "*** Uninstalling modules"
+       @set -e; for e in dummy $(INSTALL_MODULES); do \
+               if [ "$$e" = "dummy" ]; then continue; fi; \
+               fn=`basename $$e`; \
+               if [ "$$fn" = '{- platform->dso("ossltest") -}' ]; then \
+                       continue; \
+               fi; \
+               $(ECHO) "$(RM) $(DESTDIR)$(MODULESDIR)/$$fn"; \
+               $(RM) $(DESTDIR)$(MODULESDIR)/$$fn; \
+       done
+       -$(RMDIR) $(DESTDIR)$(MODULESDIR)
+
 install_runtime: install_programs
 
 install_runtime_libs: build_libs
 install_runtime: install_programs
 
 install_runtime_libs: build_libs
index 0438399..5709edb 100644 (file)
@@ -94,6 +94,20 @@ INSTALL_ENGINEPDBS={-
                          && $unified_info{attributes}->{modules}->{$_}->{engine} }
                   @{$unified_info{modules}})
 -}
                          && $unified_info{attributes}->{modules}->{$_}->{engine} }
                   @{$unified_info{modules}})
 -}
+INSTALL_MODDULES={-
+        join(" \\\n" . ' ' x 16,
+             fill_lines(" ", $COLUMNS - 16,
+                        map { platform->dso($_) }
+                        grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
+                               && !$unified_info{attributes}->{modules}->{$_}->{engine} }
+                        @{$unified_info{modules}}))
+-}
+INSTALL_MODULEPDBS={-
+        join(" ", map { quotify1(platform->dsopdb($_)) }
+                  grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
+                         && !$unified_info{attributes}->{modules}->{$_}->{engine} }
+                  @{$unified_info{modules}})
+-}
 INSTALL_PROGRAMS={-
         join(" ", map { quotify1(platform->bin($_)) }
                   grep { !$unified_info{attributes}->{programs}->{$_}->{noinst} }
 INSTALL_PROGRAMS={-
         join(" ", map { quotify1(platform->bin($_)) }
                   grep { !$unified_info{attributes}->{programs}->{$_}->{noinst} }
@@ -441,9 +455,9 @@ depend:
 
 # Install helper targets #############################################
 
 
 # Install helper targets #############################################
 
-install_sw: install_dev install_engines install_runtime
+install_sw: install_dev install_engines install_modules install_runtime
 
 
-uninstall_sw: uninstall_runtime uninstall_engines uninstall_dev
+uninstall_sw: uninstall_runtime uninstall_modules uninstall_engines uninstall_dev
 
 install_docs: install_html_docs
 
 
 install_docs: install_html_docs
 
@@ -487,9 +501,11 @@ install_dev: install_runtime_libs
 
 uninstall_dev:
 
 
 uninstall_dev:
 
-install_engines: install_runtime_libs build_modules
+_install_modules_deps: install_runtime_libs build_modules
+
+install_engines: _install_modules_deps
        @if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 )
        @if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 )
-       @$(ECHO) "*** Installing ENGINE modules"
+       @$(ECHO) "*** Installing engines"
        @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(ENGINESDIR)"
        @if not "$(INSTALL_ENGINES)"=="" \
         "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_ENGINES) "$(ENGINESDIR)"
        @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(ENGINESDIR)"
        @if not "$(INSTALL_ENGINES)"=="" \
         "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_ENGINES) "$(ENGINESDIR)"
@@ -498,6 +514,17 @@ install_engines: install_runtime_libs build_modules
 
 uninstall_engines:
 
 
 uninstall_engines:
 
+install_modules: _install_modules_deps
+       @if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 )
+       @$(ECHO) "*** Installing modules"
+       @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(MODULESDIR)"
+       @if not "$(INSTALL_MODULES)"=="" \
+        "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_MODULES) "$(MODULESDIR)"
+       @if not "$(INSTALL_MODULES)"=="" \
+        "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_MODULEPDBS) "$(MODULESDIR)"
+
+uninstall_modules:
+
 install_runtime: install_programs
 
 install_runtime_libs: build_libs
 install_runtime: install_programs
 
 install_runtime_libs: build_libs
index a7fe72c..e19f669 100644 (file)
@@ -207,6 +207,9 @@ To avoid breaking other applications, install your copy of OpenSSL to a
 [different location](#installing-to-a-different-location) which is not in
 the global search path for system libraries.
 
 [different location](#installing-to-a-different-location) which is not in
 the global search path for system libraries.
 
+Finally, if you plan on using the FIPS module, you need to read the
+[Post-installation Notes](#post-installation-notes) further down.
+
 ### Unix / Linux / macOS ###
 
 Depending on your distribution, you need to run the following command as
 ### Unix / Linux / macOS ###
 
 Depending on your distribution, you need to run the following command as
@@ -1344,6 +1347,18 @@ Some APIs have changed as well.  However, older APIs have been preserved when
 possible.
 
 
 possible.
 
 
+Post-installation Notes
+-----------------------
+
+With the default OpenSSL installation comes a FIPS provider module, which
+needs some post-installation attention, without which it will not be usable.
+This involves using the following command:
+
+    openssl fipsinstall
+
+See the openssl-fipsinstall(1) manual for details and examples.
+
+
 Advanced Build Options
 ======================
 
 Advanced Build Options
 ======================