From 5091e3df704cd635653ea174ebb06a77792ea609 Mon Sep 17 00:00:00 2001 From: Garance A Drosehn Date: Tue, 9 Dec 2003 00:42:44 +0000 Subject: [PATCH] Fix a problem where 'make installworld' will fail and leave the system in a messy state *if* the user is upgrading from a system which has no /libexec to a system which builds a DYNAMICROOT, and if that user has set DISTDIR (as documented for ports, but it turns out that the same variable name is used for a completely unrelated purpose in 'make release'). There are other possible fixes for this issue, and ru@ may later decide to commit one of those fixes. I just wanted some fix in ASAP, and this is the fix that I have tested. Reviewed by: bde, imp, and ru --- Makefile.inc1 | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 3e7903595b7a..786dc6ab1cdd 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -46,19 +46,16 @@ SUBDIR+= share/info .if exists(${.CURDIR}/include) SUBDIR+= include .endif + +# We must do lib and libexec before bin, because if installworld +# installs a new /bin/sh, the 'make' command will *immediately* +# use that new version. And the new (dynamically-linked) /bin/sh +# will expect to find appropriate libraries in /lib and /libexec. .if exists(${.CURDIR}/lib) SUBDIR+= lib .endif - -# When upgrading to a dynamically linked root, install the runtime -# linker early into its new location before make(1) has a chance -# to run the dynamically linked /bin/sh. -.if !defined(NO_DYNAMICROOT) && !defined(NOPIC) && \ - (!defined(TARGET_ARCH) || ${TARGET_ARCH} == ${MACHINE_ARCH}) && \ - !defined(DISTDIR) && \ - (!defined(DESTDIR) || empty(DESTDIR) || ${DESTDIR} == "/") && \ - !exists(/libexec/ld-elf.so.1) -SUBDIR+= libexec/rtld-elf +.if exists(${.CURDIR}/libexec) +SUBDIR+= libexec .endif .if exists(${.CURDIR}/bin) @@ -74,9 +71,6 @@ SUBDIR+= gnu !defined(NOCRYPT) && !defined(NO_OPENSSL) && !defined(NO_KERBEROS) SUBDIR+= kerberos5 .endif -.if exists(${.CURDIR}/libexec) -SUBDIR+= libexec -.endif .if exists(${.CURDIR}/rescue) && !defined(NO_RESCUE) SUBDIR+= rescue .endif