Skip to content

Commit c1123d9

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)
1 parent 9c5f2ea commit c1123d9

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
@@ -519,12 +519,10 @@ descrip.mms : FORCE
519519

520520
# Install helper targets #############################################
521521

522-
install_sw : all install_shared _install_dev_ns -
523-
install_engines _install_runtime_ns -
522+
install_sw : all install_dev install_engines install_runtime -
524523
install_startup install_ivp
525524

526-
uninstall_sw : uninstall_shared _uninstall_dev_ns -
527-
uninstall_engines _uninstall_runtime_ns -
525+
uninstall_sw : uninstall_dev uninstall_engines uninstall_runtime -
528526
uninstall_startup uninstall_ivp
529527

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

556-
install_shared : check_INSTALLTOP
557-
@ {- output_off() if $disabled{shared}; "" -} !
558-
@ WRITE SYS$OUTPUT "*** Installing shareable images"
559-
@ ! Install shared (runtime) libraries
560-
- CREATE/DIR ossl_installroot:[LIB.'arch']
561-
{- join("\n ",
562-
map { "COPY/PROT=W:R $_.EXE ossl_installroot:[LIB.'arch']" }
563-
@install_shlibs) -}
564-
@ {- output_on() if $disabled{shared}; "" -} !
565-
566-
_install_dev_ns : check_INSTALLTOP
554+
install_dev : check_INSTALLTOP install_runtime_libs
567555
@ WRITE SYS$OUTPUT "*** Installing development files"
568556
@ ! Install header files
569557
- CREATE/DIR ossl_installroot:[include.openssl]
@@ -574,19 +562,6 @@ _install_dev_ns : check_INSTALLTOP
574562
map { "COPY/PROT=W:R $_.OLB ossl_installroot:[LIB.'arch']" }
575563
@install_libs) -}
576564

577-
install_dev : install_shared _install_dev_ns
578-
579-
_install_runtime_ns : check_INSTALLTOP
580-
@ ! Install the main program
581-
- CREATE/DIR ossl_installroot:[EXE.'arch']
582-
COPY/PROT=W:RE [.APPS]openssl.EXE -
583-
ossl_installroot:[EXE.'arch']openssl{- $osslver -}.EXE
584-
@ ! Install scripts
585-
COPY/PROT=W:RE $(BIN_SCRIPTS) ossl_installroot:[EXE]
586-
@ ! {- output_on() if $disabled{apps}; "" -}
587-
588-
install_runtime : install_shared _install_runtime_ns
589-
590565
install_engines : check_INSTALLTOP
591566
@ {- output_off() unless scalar @{$unified_info{engines}}; "" -} !
592567
@ WRITE SYS$OUTPUT "*** Installing engines"
@@ -596,6 +571,28 @@ install_engines : check_INSTALLTOP
596571
@{$unified_info{install}->{engines}}) -}
597572
@ {- output_on() unless scalar @{$unified_info{engines}}; "" -} !
598573

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

Configurations/unix-Makefile.tmpl

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ install_ssldirs:
495495
chmod 644 $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf; \
496496
fi
497497
498-
install_dev:
498+
install_dev: install_runtime_libs
499499
@[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
500500
@$(ECHO) "*** Installing development files"
501501
@$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/include/openssl
@@ -528,11 +528,6 @@ install_dev:
528528
fn1=`basename $$s1`; \
529529
fn2=`basename $$s2`; \
530530
: {- output_off(); output_on() unless windowsdll() or sharedaix(); "" -}; \
531-
$(ECHO) "install $$s1 -> $(DESTDIR)$(libdir)/$$fn1"; \
532-
cp $$s1 $(DESTDIR)$(libdir)/$$fn1.new; \
533-
chmod 755 $(DESTDIR)$(libdir)/$$fn1.new; \
534-
mv -f $(DESTDIR)$(libdir)/$$fn1.new \
535-
$(DESTDIR)$(libdir)/$$fn1; \
536531
if [ "$$fn1" != "$$fn2" ]; then \
537532
$(ECHO) "link $(DESTDIR)$(libdir)/$$fn2 -> $(DESTDIR)$(libdir)/$$fn1"; \
538533
ln -sf $$fn1 $(DESTDIR)$(libdir)/$$fn2; \
@@ -572,7 +567,7 @@ install_dev:
572567
@cp openssl.pc $(DESTDIR)$(libdir)/pkgconfig
573568
@chmod 644 $(DESTDIR)$(libdir)/pkgconfig/openssl.pc
574569
575-
uninstall_dev:
570+
uninstall_dev: uninstall_runtime_libs
576571
@$(ECHO) "*** Uninstalling development files"
577572
@ : {- output_off() unless grep { $_ eq "OPENSSL_USE_APPLINK" } (@{$target{defines}}, @{$config{defines}}); "" -}
578573
@$(ECHO) "$(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c"
@@ -643,13 +638,14 @@ uninstall_engines:
643638
done
644639
-$(RMDIR) $(DESTDIR)$(ENGINESDIR)
645640
646-
install_runtime:
641+
install_runtime: install_programs
642+
643+
install_runtime_libs:
647644
@[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
648-
@$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/bin
649645
@ : {- output_off() if windowsdll(); "" -}
650646
@$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(libdir)
651647
@ : {- output_on() if windowsdll(); "" -}
652-
@$(ECHO) "*** Installing runtime files"
648+
@$(ECHO) "*** Installing runtime libraries"
653649
@set -e; for s in dummy $(INSTALL_SHLIBS); do \
654650
if [ "$$s" = "dummy" ]; then continue; fi; \
655651
fn=`basename $$s`; \
@@ -667,6 +663,11 @@ install_runtime:
667663
$(DESTDIR)$(libdir)/$$fn; \
668664
: {- output_on() if windowsdll(); "" -}; \
669665
done
666+
667+
install_programs: install_runtime_libs
668+
@[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
669+
@$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/bin
670+
@$(ECHO) "*** Installing runtime programs"
670671
@set -e; for x in dummy $(INSTALL_PROGRAMS); do \
671672
if [ "$$x" = "dummy" ]; then continue; fi; \
672673
fn=`basename $$x`; \
@@ -686,8 +687,10 @@ install_runtime:
686687
$(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
687688
done
688689
689-
uninstall_runtime:
690-
@$(ECHO) "*** Uninstalling runtime files"
690+
uninstall_runtime: uninstall_programs uninstall_runtime_libs
691+
692+
uninstall_programs:
693+
@$(ECHO) "*** Uninstalling runtime programs"
691694
@set -e; for x in dummy $(INSTALL_PROGRAMS); \
692695
do \
693696
if [ "$$x" = "dummy" ]; then continue; fi; \
@@ -702,6 +705,10 @@ uninstall_runtime:
702705
$(ECHO) "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
703706
$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
704707
done
708+
-$(RMDIR) $(DESTDIR)$(INSTALLTOP)/bin
709+
710+
uninstall_runtime_libs:
711+
@$(ECHO) "*** Uninstalling runtime libraries"
705712
@ : {- output_off() unless windowsdll(); "" -}
706713
@set -e; for s in dummy $(INSTALL_SHLIBS); do \
707714
if [ "$$s" = "dummy" ]; then continue; fi; \
@@ -710,7 +717,6 @@ uninstall_runtime:
710717
$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
711718
done
712719
@ : {- output_on() unless windowsdll(); "" -}
713-
-$(RMDIR) $(DESTDIR)$(INSTALLTOP)/bin
714720
715721
716722
install_man_docs:

Configurations/windows-makefile.tmpl

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

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

444444
uninstall_engines:
445445

446-
install_runtime:
446+
install_runtime: install_programs
447+
448+
install_runtime_libs:
447449
@if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 )
448-
@$(ECHO) "*** Installing runtime files"
450+
@$(ECHO) "*** Installing runtime libraries"
449451
@"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\bin"
450452
@if not "$(SHLIBS)"=="" \
451453
"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_SHLIBS) "$(INSTALLTOP)\bin"
452454
@if not "$(SHLIBS)"=="" \
453455
"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_SHLIBPDBS) \
454456
"$(INSTALLTOP)\bin"
457+
458+
install_programs: install_runtime_libs
459+
@if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 )
460+
@$(ECHO) "*** Installing runtime programs"
461+
@"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\bin"
455462
@"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_PROGRAMS) \
456463
"$(INSTALLTOP)\bin"
457464
@"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_PROGRAMPDBS) \

0 commit comments

Comments
 (0)