This is a modified version of openssl-1.0.2c patch found in BLFS, to work with openssl 1.0.2d James 2015 Submitted By: Ken Moffat Date: 2015-03-27 Initial Package Version: 1.0.2a Upstream Status: Ignored Origin: Mike Frysinger, Gentoo Description: Fixes build when using more than one make job to build the package. http://rt.openssl.org/Ticket/Display.html?id=2084&user=guest&pass=guest KM: removed test/Makefile changes, since the tests still need -j1 diff -ur openssl-1.0.2d-old/crypto/Makefile openssl-1.0.2d/crypto/Makefile --- openssl-1.0.2d-old/crypto/Makefile 2015-07-09 19:02:54.000000000 +0700 +++ openssl-1.0.2d/crypto/Makefile 2015-07-09 21:14:46.747475387 +0700 @@ -85,11 +85,11 @@ @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi subdirs: - @target=all; $(RECURSIVE_MAKE) + +@target=all; $(RECURSIVE_MAKE) files: $(PERL) $(TOP)/util/files.pl "CPUID_OBJ=$(CPUID_OBJ)" Makefile >> $(TOP)/MINFO - @target=files; $(RECURSIVE_MAKE) + +@target=files; $(RECURSIVE_MAKE) links: @$(PERL) $(TOP)/util/mklink.pl ../include/openssl $(EXHEADER) @@ -100,7 +100,7 @@ # lib: $(LIB): are splitted to avoid end-less loop lib: $(LIB) @touch lib -$(LIB): $(LIBOBJ) +$(LIB): $(LIBOBJ) | subdirs $(AR) $(LIB) $(LIBOBJ) test -z "$(FIPSLIBDIR)" || $(AR) $(LIB) $(FIPSLIBDIR)fipscanister.o $(RANLIB) $(LIB) || echo Never mind. @@ -111,7 +111,7 @@ fi libs: - @target=lib; $(RECURSIVE_MAKE) + +@target=lib; $(RECURSIVE_MAKE) install: @[ -n "$(INSTALLTOP)" ] # should be set by top Makefile... @@ -120,7 +120,7 @@ (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \ chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \ done; - @target=install; $(RECURSIVE_MAKE) + +@target=install; $(RECURSIVE_MAKE) lint: @target=lint; $(RECURSIVE_MAKE) diff -ur openssl-1.0.2d-old/crypto/objects/Makefile openssl-1.0.2d/crypto/objects/Makefile --- openssl-1.0.2d-old/crypto/objects/Makefile 2015-07-09 19:02:56.000000000 +0700 +++ openssl-1.0.2d/crypto/objects/Makefile 2015-07-09 21:14:46.747475387 +0700 @@ -44,11 +44,11 @@ # objects.pl both reads and writes obj_mac.num obj_mac.h: objects.pl objects.txt obj_mac.num $(PERL) objects.pl objects.txt obj_mac.num obj_mac.h - @sleep 1; touch obj_mac.h; sleep 1 -obj_xref.h: objxref.pl obj_xref.txt obj_mac.num +# This doesn't really need obj_mac.h, but since that rule reads & writes +# obj_mac.num, we can't run in parallel with it. +obj_xref.h: objxref.pl obj_xref.txt obj_mac.num obj_mac.h $(PERL) objxref.pl obj_mac.num obj_xref.txt > obj_xref.h - @sleep 1; touch obj_xref.h; sleep 1 files: $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO diff -ur openssl-1.0.2d-old/engines/Makefile openssl-1.0.2d/engines/Makefile --- openssl-1.0.2d-old/engines/Makefile 2015-07-09 19:03:07.000000000 +0700 +++ openssl-1.0.2d/engines/Makefile 2015-07-09 21:14:46.747475387 +0700 @@ -72,7 +72,7 @@ all: lib subdirs -lib: $(LIBOBJ) +lib: $(LIBOBJ) | subdirs @if [ -n "$(SHARED_LIBS)" ]; then \ set -e; \ for l in $(LIBNAMES); do \ @@ -89,7 +89,7 @@ subdirs: echo $(EDIRS) - @target=all; $(RECURSIVE_MAKE) + +@target=all; $(RECURSIVE_MAKE) files: $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO @@ -128,7 +128,7 @@ mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx ); \ done; \ fi - @target=install; $(RECURSIVE_MAKE) + +@target=install; $(RECURSIVE_MAKE) tags: ctags $(SRC) diff -ur openssl-1.0.2d-old/Makefile.org openssl-1.0.2d/Makefile.org --- openssl-1.0.2d-old/Makefile.org 2015-07-09 18:57:15.000000000 +0700 +++ openssl-1.0.2d/Makefile.org 2015-07-09 21:17:53.420806563 +0700 @@ -278,17 +278,17 @@ build_libssl: build_ssl libssl.pc build_crypto: - @dir=crypto; target=all; $(BUILD_ONE_CMD) + +@dir=crypto; target=all; $(BUILD_ONE_CMD) build_ssl: build_crypto - @dir=ssl; target=all; $(BUILD_ONE_CMD) + +@dir=ssl; target=all; $(BUILD_ONE_CMD) build_engines: build_crypto - @dir=engines; target=all; $(BUILD_ONE_CMD) + +@dir=engines; target=all; $(BUILD_ONE_CMD) build_apps: build_libs - @dir=apps; target=all; $(BUILD_ONE_CMD) + +@dir=apps; target=all; $(BUILD_ONE_CMD) build_tests: build_libs - @dir=test; target=all; $(BUILD_ONE_CMD) + +@dir=test; target=all; $(BUILD_ONE_CMD) build_tools: build_libs - @dir=tools; target=all; $(BUILD_ONE_CMD) + +@dir=tools; target=all; $(BUILD_ONE_CMD) all_testapps: build_libs build_testapps build_testapps: @@ -527,9 +527,9 @@ dist_pem_h: (cd crypto/pem; $(MAKE) -e $(BUILDENV) pem.h; $(MAKE) clean) -install: all install_docs install_sw +install: install_docs install_sw -install_sw: +install_dirs: @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \ $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR) \ $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines \ @@ -538,12 +538,19 @@ $(INSTALL_PREFIX)$(OPENSSLDIR)/misc \ $(INSTALL_PREFIX)$(OPENSSLDIR)/certs \ $(INSTALL_PREFIX)$(OPENSSLDIR)/private + @$(PERL) $(TOP)/util/mkdir-p.pl \ + $(INSTALL_PREFIX)$(MANDIR)/man1 \ + $(INSTALL_PREFIX)$(MANDIR)/man3 \ + $(INSTALL_PREFIX)$(MANDIR)/man5 \ + $(INSTALL_PREFIX)$(MANDIR)/man7 + +install_sw: install_dirs @set -e; headerlist="$(EXHEADER)"; for i in $$headerlist;\ do \ (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \ chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \ done; - @set -e; target=install; $(RECURSIVE_BUILD_CMD) + +@set -e; target=install; $(RECURSIVE_BUILD_CMD) @set -e; liblist="$(LIBS)"; for i in $$liblist ;\ do \ if [ -f "$$i" ]; then \ @@ -627,12 +634,7 @@ done; \ done -install_docs: - @$(PERL) $(TOP)/util/mkdir-p.pl \ - $(INSTALL_PREFIX)$(MANDIR)/man1 \ - $(INSTALL_PREFIX)$(MANDIR)/man3 \ - $(INSTALL_PREFIX)$(MANDIR)/man5 \ - $(INSTALL_PREFIX)$(MANDIR)/man7 +install_docs: install_dirs @pod2man="`cd ./util; ./pod2mantest $(PERL)`"; \ here="`pwd`"; \ filecase=; \ diff -ur openssl-1.0.2d-old/Makefile.shared openssl-1.0.2d/Makefile.shared --- openssl-1.0.2d-old/Makefile.shared 2015-07-09 18:53:21.000000000 +0700 +++ openssl-1.0.2d/Makefile.shared 2015-07-09 21:14:46.747475387 +0700 @@ -105,6 +105,7 @@ SHAREDFLAGS="$${SHAREDFLAGS:-$(CFLAGS) $(SHARED_LDFLAGS)}"; \ LIBPATH=`for x in $$LIBDEPS; do echo $$x; done | sed -e 's/^ *-L//;t' -e d | uniq`; \ LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \ + [ -e $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX ] && exit 0; \ LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \ $${SHAREDCMD} $${SHAREDFLAGS} \ -o $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX \ @@ -122,6 +123,7 @@ done; \ fi; \ if [ -n "$$SHLIB_SOVER" ]; then \ + [ -e "$$SHLIB$$SHLIB_SUFFIX" ] || \ ( $(SET_X); rm -f $$SHLIB$$SHLIB_SUFFIX; \ ln -s $$prev $$SHLIB$$SHLIB_SUFFIX ); \ fi; \