Skip to content

Commit 57627b1

Browse files
committed
auto merge of #10232 : brson/rust/destdir, r=thestinger
2 parents 2456272 + 758af60 commit 57627b1

File tree

2 files changed

+9
-15
lines changed

2 files changed

+9
-15
lines changed

Makefile.in

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -677,12 +677,6 @@ ifneq ($(findstring clean,$(MAKECMDGOALS)),)
677677
endif
678678

679679
ifneq ($(findstring install,$(MAKECMDGOALS)),)
680-
ifdef DESTDIR
681-
CFG_INFO := $(info cfg: setting CFG_PREFIX via DESTDIR, $(DESTDIR)/$(CFG_PREFIX))
682-
CFG_PREFIX:=$(DESTDIR)/$(CFG_PREFIX)
683-
export CFG_PREFIX
684-
endif
685-
686680
CFG_INFO := $(info cfg: including install rules)
687681
include $(CFG_SRC_DIR)mk/install.mk
688682
endif

mk/install.mk

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,24 @@
1818
# $(2) is the destination directory
1919
# $(3) is the filename/libname-glob
2020
ifdef VERBOSE
21-
INSTALL = install -m755 $(1)/$(3) $(2)/$(3)
21+
INSTALL = install -m755 $(1)/$(3) $(DESTDIR)$(2)/$(3)
2222
else
23-
INSTALL = $(Q)$(call E, install: $(2)/$(3)) && install -m755 $(1)/$(3) $(2)/$(3)
23+
INSTALL = $(Q)$(call E, install: $(DESTDIR)$(2)/$(3)) && install -m755 $(1)/$(3) $(DESTDIR)$(2)/$(3)
2424
endif
2525

2626
# For MK_INSTALL_DIR
2727
# $(1) is the directory to create
28-
MK_INSTALL_DIR = (umask 022 && mkdir -p $(1))
28+
MK_INSTALL_DIR = (umask 022 && mkdir -p $(DESTDIR)$(1))
2929

3030
# For INSTALL_LIB,
3131
# Target-specific $(LIB_SOURCE_DIR) is the source directory
3232
# Target-specific $(LIB_DESTIN_DIR) is the destination directory
3333
# $(1) is the filename/libname-glob
3434
ifdef VERBOSE
35-
DO_INSTALL_LIB = install -m644 `ls -drt1 $(LIB_SOURCE_DIR)/$(1) | tail -1` $(LIB_DESTIN_DIR)/
35+
DO_INSTALL_LIB = install -m644 `ls -drt1 $(LIB_SOURCE_DIR)/$(1) | tail -1` $(DESTDIR)$(LIB_DESTIN_DIR)/
3636
else
37-
DO_INSTALL_LIB = $(Q)$(call E, install_lib: $(LIB_DESTIN_DIR)/$(1)) && \
38-
install -m644 `ls -drt1 $(LIB_SOURCE_DIR)/$(1) | tail -1` $(LIB_DESTIN_DIR)/
37+
DO_INSTALL_LIB = $(Q)$(call E, install_lib: $(DESTDIR)$(LIB_DESTIN_DIR)/$(1)) && \
38+
install -m644 `ls -drt1 $(LIB_SOURCE_DIR)/$(1) | tail -1` $(DESTDIR)$(LIB_DESTIN_DIR)/
3939
endif
4040

4141
# Target-specific $(LIB_SOURCE_DIR) is the source directory
@@ -152,9 +152,9 @@ install-host: $(CSREQ$(ISTAGE)_T_$(CFG_BUILD_)_H_$(CFG_BUILD_))
152152
$(Q)$(call INSTALL_LIB,$(LIBRUSTDOC_GLOB_$(CFG_BUILD)))
153153
$(Q)$(call INSTALL,$(HL),$(PHL),$(CFG_RUNTIME_$(CFG_BUILD)))
154154
$(Q)$(call INSTALL,$(HL),$(PHL),$(CFG_RUSTLLVM_$(CFG_BUILD)))
155-
$(Q)$(call INSTALL,$(S)/man, $(CFG_MANDIR)/man1,rustc.1)
156-
$(Q)$(call INSTALL,$(S)/man, $(CFG_MANDIR)/man1,rustdoc.1)
157-
$(Q)$(call INSTALL,$(S)/man, $(CFG_MANDIR)/man1,rustpkg.1)
155+
$(Q)$(call INSTALL,$(S)/man,$(CFG_MANDIR)/man1,rustc.1)
156+
$(Q)$(call INSTALL,$(S)/man,$(CFG_MANDIR)/man1,rustdoc.1)
157+
$(Q)$(call INSTALL,$(S)/man,$(CFG_MANDIR)/man1,rustpkg.1)
158158

159159
install-targets: $(INSTALL_TARGET_RULES)
160160

0 commit comments

Comments
 (0)