Commit c1123d9f authored by Richard Levitte's avatar Richard Levitte
Browse files

Allow parallel install



When trying 'make -j{n} install', you may occasionally run into
trouble because to sub-targets (install_dev and install_runtime) try
to install the same shared libraries.  That makes parallel install
difficult.

This is solved by dividing install_runtime into two parts, one for
libraries and one for programs, and have install_dev depend on
install_runtime_libs instead of installing the shared runtime
libraries itself.

Fixes #7466

Reviewed-by: default avatarPaul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/7583)
parent 9c5f2ea6
Loading
Loading
Loading
Loading
+25 −28
Original line number Original line Diff line number Diff line
@@ -519,12 +519,10 @@ descrip.mms : FORCE


# Install helper targets #############################################
# Install helper targets #############################################


install_sw : all install_shared _install_dev_ns -
install_sw : all install_dev install_engines install_runtime -
             install_engines _install_runtime_ns -
             install_startup install_ivp
             install_startup install_ivp


uninstall_sw : uninstall_shared _uninstall_dev_ns -
uninstall_sw : uninstall_dev uninstall_engines uninstall_runtime -
               uninstall_engines _uninstall_runtime_ns -
               uninstall_startup uninstall_ivp
               uninstall_startup uninstall_ivp


install_docs : install_html_docs
install_docs : install_html_docs
@@ -553,17 +551,7 @@ install_ssldirs : check_INSTALLTOP
                COPY/PROT=W:R {- sourcefile("apps", "ct_log_list.cnf") -} -
                COPY/PROT=W:R {- sourcefile("apps", "ct_log_list.cnf") -} -
                        ossl_dataroot:[000000]ct_log_list.cnf
                        ossl_dataroot:[000000]ct_log_list.cnf


install_shared : check_INSTALLTOP
install_dev : check_INSTALLTOP install_runtime_libs
        @ {- output_off() if $disabled{shared}; "" -} !
        @ WRITE SYS$OUTPUT "*** Installing shareable images"
        @ ! Install shared (runtime) libraries
        - CREATE/DIR ossl_installroot:[LIB.'arch']
        {- join("\n        ",
                map { "COPY/PROT=W:R $_.EXE ossl_installroot:[LIB.'arch']" }
                @install_shlibs) -}
        @ {- output_on() if $disabled{shared}; "" -} !

_install_dev_ns : check_INSTALLTOP
        @ WRITE SYS$OUTPUT "*** Installing development files"
        @ WRITE SYS$OUTPUT "*** Installing development files"
        @ ! Install header files
        @ ! Install header files
        - CREATE/DIR ossl_installroot:[include.openssl]
        - CREATE/DIR ossl_installroot:[include.openssl]
@@ -574,19 +562,6 @@ _install_dev_ns : check_INSTALLTOP
                map { "COPY/PROT=W:R $_.OLB ossl_installroot:[LIB.'arch']" }
                map { "COPY/PROT=W:R $_.OLB ossl_installroot:[LIB.'arch']" }
                @install_libs) -}
                @install_libs) -}


install_dev : install_shared _install_dev_ns

_install_runtime_ns : check_INSTALLTOP
        @ ! Install the main program
        - CREATE/DIR ossl_installroot:[EXE.'arch']
        COPY/PROT=W:RE [.APPS]openssl.EXE -
                ossl_installroot:[EXE.'arch']openssl{- $osslver -}.EXE
        @ ! Install scripts
        COPY/PROT=W:RE $(BIN_SCRIPTS) ossl_installroot:[EXE]
        @ ! {- output_on() if $disabled{apps}; "" -}

install_runtime : install_shared _install_runtime_ns

install_engines : check_INSTALLTOP
install_engines : check_INSTALLTOP
        @ {- output_off() unless scalar @{$unified_info{engines}}; "" -} !
        @ {- output_off() unless scalar @{$unified_info{engines}}; "" -} !
        @ WRITE SYS$OUTPUT "*** Installing engines"
        @ WRITE SYS$OUTPUT "*** Installing engines"
@@ -596,6 +571,28 @@ install_engines : check_INSTALLTOP
                @{$unified_info{install}->{engines}}) -}
                @{$unified_info{install}->{engines}}) -}
        @ {- output_on() unless scalar @{$unified_info{engines}}; "" -} !
        @ {- output_on() unless scalar @{$unified_info{engines}}; "" -} !


install_runtime: install_programs

install_runtime_libs : check_INSTALLTOP
        @ {- output_off() if $disabled{shared}; "" -} !
        @ WRITE SYS$OUTPUT "*** Installing shareable images"
        @ ! Install shared (runtime) libraries
        - CREATE/DIR ossl_installroot:[LIB.'arch']
        {- join("\n        ",
                map { "COPY/PROT=W:R $_.EXE ossl_installroot:[LIB.'arch']" }
                @install_shlibs) -}
        @ {- output_on() if $disabled{shared}; "" -} !

install_programs : check_INSTALLTOP install_runtime_libs
        @ {- output_off() if $disabled{apps}; "" -} !
        @ ! Install the main program
        - CREATE/DIR ossl_installroot:[EXE.'arch']
        COPY/PROT=W:RE [.APPS]openssl.EXE -
                ossl_installroot:[EXE.'arch']openssl{- $osslver -}.EXE
        @ ! Install scripts
        COPY/PROT=W:RE $(BIN_SCRIPTS) ossl_installroot:[EXE]
        @ ! {- output_on() if $disabled{apps}; "" -}

install_startup : [.VMS]openssl_startup.com [.VMS]openssl_shutdown.com -
install_startup : [.VMS]openssl_startup.com [.VMS]openssl_shutdown.com -
                 [.VMS]openssl_utils.com, check_INSTALLTOP
                 [.VMS]openssl_utils.com, check_INSTALLTOP
        - CREATE/DIR ossl_installroot:[SYS$STARTUP]
        - CREATE/DIR ossl_installroot:[SYS$STARTUP]
+19 −13
Original line number Original line Diff line number Diff line
@@ -495,7 +495,7 @@ install_ssldirs:
		chmod 644 $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf; \
		chmod 644 $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf; \
	fi
	fi


install_dev:
install_dev: install_runtime_libs
	@[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
	@[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
	@$(ECHO) "*** Installing development files"
	@$(ECHO) "*** Installing development files"
	@$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/include/openssl
	@$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/include/openssl
@@ -528,11 +528,6 @@ install_dev:
		fn1=`basename $$s1`; \
		fn1=`basename $$s1`; \
		fn2=`basename $$s2`; \
		fn2=`basename $$s2`; \
		: {- output_off(); output_on() unless windowsdll() or sharedaix(); "" -}; \
		: {- output_off(); output_on() unless windowsdll() or sharedaix(); "" -}; \
		$(ECHO) "install $$s1 -> $(DESTDIR)$(libdir)/$$fn1"; \
		cp $$s1 $(DESTDIR)$(libdir)/$$fn1.new; \
		chmod 755 $(DESTDIR)$(libdir)/$$fn1.new; \
		mv -f $(DESTDIR)$(libdir)/$$fn1.new \
		      $(DESTDIR)$(libdir)/$$fn1; \
		if [ "$$fn1" != "$$fn2" ]; then \
		if [ "$$fn1" != "$$fn2" ]; then \
			$(ECHO) "link $(DESTDIR)$(libdir)/$$fn2 -> $(DESTDIR)$(libdir)/$$fn1"; \
			$(ECHO) "link $(DESTDIR)$(libdir)/$$fn2 -> $(DESTDIR)$(libdir)/$$fn1"; \
			ln -sf $$fn1 $(DESTDIR)$(libdir)/$$fn2; \
			ln -sf $$fn1 $(DESTDIR)$(libdir)/$$fn2; \
@@ -572,7 +567,7 @@ install_dev:
	@cp openssl.pc $(DESTDIR)$(libdir)/pkgconfig
	@cp openssl.pc $(DESTDIR)$(libdir)/pkgconfig
	@chmod 644 $(DESTDIR)$(libdir)/pkgconfig/openssl.pc
	@chmod 644 $(DESTDIR)$(libdir)/pkgconfig/openssl.pc


uninstall_dev:
uninstall_dev: uninstall_runtime_libs
	@$(ECHO) "*** Uninstalling development files"
	@$(ECHO) "*** Uninstalling development files"
	@ : {- output_off() unless grep { $_ eq "OPENSSL_USE_APPLINK" } (@{$target{defines}}, @{$config{defines}}); "" -}
	@ : {- output_off() unless grep { $_ eq "OPENSSL_USE_APPLINK" } (@{$target{defines}}, @{$config{defines}}); "" -}
	@$(ECHO) "$(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c"
	@$(ECHO) "$(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c"
@@ -643,13 +638,14 @@ uninstall_engines:
	done
	done
	-$(RMDIR) $(DESTDIR)$(ENGINESDIR)
	-$(RMDIR) $(DESTDIR)$(ENGINESDIR)


install_runtime:
install_runtime: install_programs

install_runtime_libs:
	@[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
	@[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
	@$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/bin
	@ : {- output_off() if windowsdll(); "" -}
	@ : {- output_off() if windowsdll(); "" -}
	@$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(libdir)
	@$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(libdir)
	@ : {- output_on() if windowsdll(); "" -}
	@ : {- output_on() if windowsdll(); "" -}
	@$(ECHO) "*** Installing runtime files"
	@$(ECHO) "*** Installing runtime libraries"
	@set -e; for s in dummy $(INSTALL_SHLIBS); do \
	@set -e; for s in dummy $(INSTALL_SHLIBS); do \
		if [ "$$s" = "dummy" ]; then continue; fi; \
		if [ "$$s" = "dummy" ]; then continue; fi; \
		fn=`basename $$s`; \
		fn=`basename $$s`; \
@@ -667,6 +663,11 @@ install_runtime:
		      $(DESTDIR)$(libdir)/$$fn; \
		      $(DESTDIR)$(libdir)/$$fn; \
		: {- output_on() if windowsdll(); "" -}; \
		: {- output_on() if windowsdll(); "" -}; \
	done
	done

install_programs: install_runtime_libs
	@[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
	@$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/bin
	@$(ECHO) "*** Installing runtime programs"
	@set -e; for x in dummy $(INSTALL_PROGRAMS); do \
	@set -e; for x in dummy $(INSTALL_PROGRAMS); do \
		if [ "$$x" = "dummy" ]; then continue; fi; \
		if [ "$$x" = "dummy" ]; then continue; fi; \
		fn=`basename $$x`; \
		fn=`basename $$x`; \
@@ -686,8 +687,10 @@ install_runtime:
		      $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
		      $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
	done
	done


uninstall_runtime:
uninstall_runtime: uninstall_programs uninstall_runtime_libs
	@$(ECHO) "*** Uninstalling runtime files"

uninstall_programs:
	@$(ECHO) "*** Uninstalling runtime programs"
	@set -e; for x in dummy $(INSTALL_PROGRAMS); \
	@set -e; for x in dummy $(INSTALL_PROGRAMS); \
	do  \
	do  \
		if [ "$$x" = "dummy" ]; then continue; fi; \
		if [ "$$x" = "dummy" ]; then continue; fi; \
@@ -702,6 +705,10 @@ uninstall_runtime:
		$(ECHO) "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
		$(ECHO) "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
		$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
		$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
	done
	done
	-$(RMDIR) $(DESTDIR)$(INSTALLTOP)/bin

uninstall_runtime_libs:
	@$(ECHO) "*** Uninstalling runtime libraries"
	@ : {- output_off() unless windowsdll(); "" -}
	@ : {- output_off() unless windowsdll(); "" -}
	@set -e; for s in dummy $(INSTALL_SHLIBS); do \
	@set -e; for s in dummy $(INSTALL_SHLIBS); do \
		if [ "$$s" = "dummy" ]; then continue; fi; \
		if [ "$$s" = "dummy" ]; then continue; fi; \
@@ -710,7 +717,6 @@ uninstall_runtime:
		$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
		$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
	done
	done
	@ : {- output_on() unless windowsdll(); "" -}
	@ : {- output_on() unless windowsdll(); "" -}
	-$(RMDIR) $(DESTDIR)$(INSTALLTOP)/bin




install_man_docs:
install_man_docs:
+10 −3
Original line number Original line Diff line number Diff line
@@ -412,7 +412,7 @@ install_ssldirs:
         "$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\apps\ct_log_list.cnf" \
         "$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\apps\ct_log_list.cnf" \
                                        "$(OPENSSLDIR)\ct_log_list.cnf"
                                        "$(OPENSSLDIR)\ct_log_list.cnf"


install_dev:
install_dev: install_runtime_libs
	@if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 )
	@if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 )
	@$(ECHO) "*** Installing development files"
	@$(ECHO) "*** Installing development files"
	@"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\include\openssl"
	@"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\include\openssl"
@@ -443,15 +443,22 @@ install_engines:


uninstall_engines:
uninstall_engines:


install_runtime:
install_runtime: install_programs

install_runtime_libs:
	@if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 )
	@if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 )
	@$(ECHO) "*** Installing runtime files"
	@$(ECHO) "*** Installing runtime libraries"
	@"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\bin"
	@"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\bin"
	@if not "$(SHLIBS)"=="" \
	@if not "$(SHLIBS)"=="" \
	 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_SHLIBS) "$(INSTALLTOP)\bin"
	 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_SHLIBS) "$(INSTALLTOP)\bin"
	@if not "$(SHLIBS)"=="" \
	@if not "$(SHLIBS)"=="" \
	 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_SHLIBPDBS) \
	 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_SHLIBPDBS) \
                                        "$(INSTALLTOP)\bin"
                                        "$(INSTALLTOP)\bin"

install_programs: install_runtime_libs
	@if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 )
	@$(ECHO) "*** Installing runtime programs"
	@"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\bin"
	@"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_PROGRAMS) \
	@"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_PROGRAMS) \
                                        "$(INSTALLTOP)\bin"
                                        "$(INSTALLTOP)\bin"
	@"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_PROGRAMPDBS) \
	@"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_PROGRAMPDBS) \