Skip to content

Commit d582f15

Browse files
committed
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: Paul Dale <paul.dale@oracle.com> (Merged from #7583) (cherry picked from commit c1123d9)
1 parent 0178459 commit d582f15

3 files changed

Lines changed: 54 additions & 44 deletions

File tree

Configurations/descrip.mms.tmpl

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -513,12 +513,10 @@ descrip.mms : FORCE
513513

514514
# Install helper targets #############################################
515515

516-
install_sw : all install_shared _install_dev_ns -
517-
install_engines _install_runtime_ns -
516+
install_sw : all install_dev install_engines install_runtime -
518517
install_startup install_ivp
519518

520-
uninstall_sw : uninstall_shared _uninstall_dev_ns -
521-
uninstall_engines _uninstall_runtime_ns -
519+
uninstall_sw : uninstall_dev uninstall_engines uninstall_runtime -
522520
uninstall_startup uninstall_ivp
523521

524522
install_docs : install_html_docs
@@ -547,17 +545,7 @@ install_ssldirs : check_INSTALLTOP
547545
COPY/PROT=W:R {- sourcefile("apps", "ct_log_list.cnf") -} -
548546
ossl_dataroot:[000000]ct_log_list.cnf
549547

550-
install_shared : check_INSTALLTOP
551-
@ {- output_off() if $disabled{shared}; "" -} !
552-
@ WRITE SYS$OUTPUT "*** Installing shareable images"
553-
@ ! Install shared (runtime) libraries
554-
- CREATE/DIR ossl_installroot:[LIB.'arch']
555-
{- join("\n ",
556-
map { "COPY/PROT=W:R $_.EXE ossl_installroot:[LIB.'arch']" }
557-
@install_shlibs) -}
558-
@ {- output_on() if $disabled{shared}; "" -} !
559-
560-
_install_dev_ns : check_INSTALLTOP
548+
install_dev : check_INSTALLTOP install_runtime_libs
561549
@ WRITE SYS$OUTPUT "*** Installing development files"
562550
@ ! Install header files
563551
- CREATE/DIR ossl_installroot:[include.openssl]
@@ -568,19 +556,6 @@ _install_dev_ns : check_INSTALLTOP
568556
map { "COPY/PROT=W:R $_.OLB ossl_installroot:[LIB.'arch']" }
569557
@install_libs) -}
570558

571-
install_dev : install_shared _install_dev_ns
572-
573-
_install_runtime_ns : check_INSTALLTOP
574-
@ ! Install the main program
575-
- CREATE/DIR ossl_installroot:[EXE.'arch']
576-
COPY/PROT=W:RE [.APPS]openssl.EXE -
577-
ossl_installroot:[EXE.'arch']openssl{- $osslver -}.EXE
578-
@ ! Install scripts
579-
COPY/PROT=W:RE $(BIN_SCRIPTS) ossl_installroot:[EXE]
580-
@ ! {- output_on() if $disabled{apps}; "" -}
581-
582-
install_runtime : install_shared _install_runtime_ns
583-
584559
install_engines : check_INSTALLTOP
585560
@ {- output_off() unless scalar @{$unified_info{engines}}; "" -} !
586561
@ WRITE SYS$OUTPUT "*** Installing engines"
@@ -590,6 +565,28 @@ install_engines : check_INSTALLTOP
590565
@{$unified_info{install}->{engines}}) -}
591566
@ {- output_on() unless scalar @{$unified_info{engines}}; "" -} !
592567

568+
install_runtime: install_programs
569+
570+
install_runtime_libs : check_INSTALLTOP
571+
@ {- output_off() if $disabled{shared}; "" -} !
572+
@ WRITE SYS$OUTPUT "*** Installing shareable images"
573+
@ ! Install shared (runtime) libraries
574+
- CREATE/DIR ossl_installroot:[LIB.'arch']
575+
{- join("\n ",
576+
map { "COPY/PROT=W:R $_.EXE ossl_installroot:[LIB.'arch']" }
577+
@install_shlibs) -}
578+
@ {- output_on() if $disabled{shared}; "" -} !
579+
580+
install_programs : check_INSTALLTOP install_runtime_libs
581+
@ {- output_off() if $disabled{apps}; "" -} !
582+
@ ! Install the main program
583+
- CREATE/DIR ossl_installroot:[EXE.'arch']
584+
COPY/PROT=W:RE [.APPS]openssl.EXE -
585+
ossl_installroot:[EXE.'arch']openssl{- $osslver -}.EXE
586+
@ ! Install scripts
587+
COPY/PROT=W:RE $(BIN_SCRIPTS) ossl_installroot:[EXE]
588+
@ ! {- output_on() if $disabled{apps}; "" -}
589+
593590
install_startup : [.VMS]openssl_startup.com [.VMS]openssl_shutdown.com -
594591
[.VMS]openssl_utils.com, check_INSTALLTOP
595592
- CREATE/DIR ossl_installroot:[SYS$STARTUP]

Configurations/unix-Makefile.tmpl

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ install_ssldirs:
491491
chmod 644 $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf; \
492492
fi
493493
494-
install_dev:
494+
install_dev: install_runtime_libs
495495
@[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
496496
@$(ECHO) "*** Installing development files"
497497
@$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/include/openssl
@@ -524,11 +524,6 @@ install_dev:
524524
fn1=`basename $$s1`; \
525525
fn2=`basename $$s2`; \
526526
: {- output_off(); output_on() unless windowsdll() or sharedaix(); "" -}; \
527-
$(ECHO) "install $$s1 -> $(DESTDIR)$(libdir)/$$fn1"; \
528-
cp $$s1 $(DESTDIR)$(libdir)/$$fn1.new; \
529-
chmod 755 $(DESTDIR)$(libdir)/$$fn1.new; \
530-
mv -f $(DESTDIR)$(libdir)/$$fn1.new \
531-
$(DESTDIR)$(libdir)/$$fn1; \
532527
if [ "$$fn1" != "$$fn2" ]; then \
533528
$(ECHO) "link $(DESTDIR)$(libdir)/$$fn2 -> $(DESTDIR)$(libdir)/$$fn1"; \
534529
ln -sf $$fn1 $(DESTDIR)$(libdir)/$$fn2; \
@@ -568,7 +563,7 @@ install_dev:
568563
@cp openssl.pc $(DESTDIR)$(libdir)/pkgconfig
569564
@chmod 644 $(DESTDIR)$(libdir)/pkgconfig/openssl.pc
570565
571-
uninstall_dev:
566+
uninstall_dev: uninstall_runtime_libs
572567
@$(ECHO) "*** Uninstalling development files"
573568
@ : {- output_off() unless grep { $_ eq "OPENSSL_USE_APPLINK" } (@{$target{defines}}, @{$config{defines}}); "" -}
574569
@$(ECHO) "$(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c"
@@ -639,13 +634,14 @@ uninstall_engines:
639634
done
640635
-$(RMDIR) $(DESTDIR)$(ENGINESDIR)
641636
642-
install_runtime:
637+
install_runtime: install_programs
638+
639+
install_runtime_libs:
643640
@[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
644-
@$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/bin
645641
@ : {- output_off() if windowsdll(); "" -}
646642
@$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(libdir)
647643
@ : {- output_on() if windowsdll(); "" -}
648-
@$(ECHO) "*** Installing runtime files"
644+
@$(ECHO) "*** Installing runtime libraries"
649645
@set -e; for s in dummy $(INSTALL_SHLIBS); do \
650646
if [ "$$s" = "dummy" ]; then continue; fi; \
651647
fn=`basename $$s`; \
@@ -663,6 +659,11 @@ install_runtime:
663659
$(DESTDIR)$(libdir)/$$fn; \
664660
: {- output_on() if windowsdll(); "" -}; \
665661
done
662+
663+
install_programs: install_runtime_libs
664+
@[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
665+
@$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/bin
666+
@$(ECHO) "*** Installing runtime programs"
666667
@set -e; for x in dummy $(INSTALL_PROGRAMS); do \
667668
if [ "$$x" = "dummy" ]; then continue; fi; \
668669
fn=`basename $$x`; \
@@ -682,8 +683,10 @@ install_runtime:
682683
$(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
683684
done
684685
685-
uninstall_runtime:
686-
@$(ECHO) "*** Uninstalling runtime files"
686+
uninstall_runtime: uninstall_programs uninstall_runtime_libs
687+
688+
uninstall_programs:
689+
@$(ECHO) "*** Uninstalling runtime programs"
687690
@set -e; for x in dummy $(INSTALL_PROGRAMS); \
688691
do \
689692
if [ "$$x" = "dummy" ]; then continue; fi; \
@@ -698,6 +701,10 @@ uninstall_runtime:
698701
$(ECHO) "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
699702
$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
700703
done
704+
-$(RMDIR) $(DESTDIR)$(INSTALLTOP)/bin
705+
706+
uninstall_runtime_libs:
707+
@$(ECHO) "*** Uninstalling runtime libraries"
701708
@ : {- output_off() unless windowsdll(); "" -}
702709
@set -e; for s in dummy $(INSTALL_SHLIBS); do \
703710
if [ "$$s" = "dummy" ]; then continue; fi; \
@@ -706,7 +713,6 @@ uninstall_runtime:
706713
$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
707714
done
708715
@ : {- output_on() unless windowsdll(); "" -}
709-
-$(RMDIR) $(DESTDIR)$(INSTALLTOP)/bin
710716
711717
712718
install_man_docs:

Configurations/windows-makefile.tmpl

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ install_ssldirs:
408408
"$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\apps\ct_log_list.cnf" \
409409
"$(OPENSSLDIR)\ct_log_list.cnf"
410410

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

440440
uninstall_engines:
441441

442-
install_runtime:
442+
install_runtime: install_programs
443+
444+
install_runtime_libs:
443445
@if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 )
444-
@$(ECHO) "*** Installing runtime files"
446+
@$(ECHO) "*** Installing runtime libraries"
445447
@"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\bin"
446448
@if not "$(SHLIBS)"=="" \
447449
"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_SHLIBS) "$(INSTALLTOP)\bin"
448450
@if not "$(SHLIBS)"=="" \
449451
"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_SHLIBPDBS) \
450452
"$(INSTALLTOP)\bin"
453+
454+
install_programs: install_runtime_libs
455+
@if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 )
456+
@$(ECHO) "*** Installing runtime programs"
457+
@"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\bin"
451458
@"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_PROGRAMS) \
452459
"$(INSTALLTOP)\bin"
453460
@"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_PROGRAMPDBS) \

0 commit comments

Comments
 (0)