The unpac monorepo manager self-hosting as a monorepo using unpac
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #13723 from dra27/flexlink-FLEXDIR

Set `FLEXDIR` when bootstrapping flexlink

authored by

Gabriel Scherer and committed by
GitHub
125160a0 c9ee4f41

+27 -8
+3 -5
Makefile
··· 645 645 OCAMLOPT='$(value BOOT_OCAMLC) $(USE_RUNTIME_PRIMS) $(USE_STDLIB)' \ 646 646 flexlink.exe support 647 647 cp $(FLEXDLL_SOURCE_DIR)/flexlink.exe $@ 648 + cp $(addprefix $(FLEXDLL_SOURCE_DIR)/, $(FLEXDLL_OBJECTS)) $(ROOTDIR) 648 649 649 650 partialclean:: 650 - rm -f flexlink.byte flexlink.byte.exe 651 + rm -f flexlink.byte flexlink.byte.exe flexdll_*.o flexdll_*.obj 651 652 652 653 $(BYTE_BINDIR)/flexlink$(EXE): \ 653 654 boot/ocamlrun$(EXE) flexlink.byte$(EXE) | $(BYTE_BINDIR) ··· 655 656 # Start with a copy to ensure that the result is always executable 656 657 cp boot/ocamlrun$(EXE) $@ 657 658 cat flexlink.byte$(EXE) >> $@ 658 - cp $(addprefix $(FLEXDLL_SOURCE_DIR)/, $(FLEXDLL_OBJECTS)) $(BYTE_BINDIR) 659 659 660 660 partialclean:: 661 661 rm -f $(BYTE_BINDIR)/flexlink $(BYTE_BINDIR)/flexlink.exe ··· 886 886 cp $(FLEXDLL_SOURCE_DIR)/flexlink.exe $@ 887 887 rm -f $(OPT_BINDIR)/flexlink$(EXE) 888 888 cd $(OPT_BINDIR); $(LN) $(call ROOT_FROM, $(OPT_BINDIR))/$@ flexlink$(EXE) 889 - cp $(addprefix $(BYTE_BINDIR)/, $(FLEXDLL_OBJECTS)) $(OPT_BINDIR) 890 889 891 890 else 892 891 ··· 2803 2802 flexlink.byte$(EXE) "$(INSTALL_BINDIR)" 2804 2803 endif # ifeq "$(INSTALL_BYTECODE_PROGRAMS)" "true" 2805 2804 $(MKDIR) "$(INSTALL_FLEXDLLDIR)" 2806 - $(INSTALL_DATA) $(addprefix $(BYTE_BINDIR)/, $(FLEXDLL_OBJECTS)) \ 2807 - "$(INSTALL_FLEXDLLDIR)" 2805 + $(INSTALL_DATA) $(FLEXDLL_OBJECTS) "$(INSTALL_FLEXDLLDIR)" 2808 2806 endif # ifeq "$(BOOTSTRAPPING_FLEXDLL)" "true" 2809 2807 $(INSTALL_DATA) Makefile.config "$(INSTALL_LIBDIR)" 2810 2808 $(INSTALL_DATA) $(DOC_FILES) "$(INSTALL_DOCDIR)"
+2
Makefile.build_config.in
··· 177 177 178 178 OC_NATIVE_LINKFLAGS = -g 179 179 180 + BUILD_TRIPLET = @build@ 181 + 180 182 # Platform-dependent command to create symbolic links 181 183 LN = @ln@ 182 184
+21 -1
Makefile.common
··· 141 141 ifeq "$(filter $(REAL_ROOT_DIR)/$(BYTE_BINDIR), $(subst :, ,$(PATH)))" "" 142 142 export PATH := \ 143 143 $(REAL_ROOT_DIR)/$(OPT_BINDIR):$(REAL_ROOT_DIR)/$(BYTE_BINDIR):$(PATH) 144 + # $(BUILD_COMPANY_SYSTEM) is the last two parts of $(BUILD_TRIPLET) 145 + BUILD_TRIPLET_FIELDS := $(subst -,$(SPACE),$(BUILD_TRIPLET)) 146 + BUILD_COMPANY_SYSTEM := $(subst $(SPACE),-,$\ 147 + $(wordlist 2, $(words $(BUILD_TRIPLET_FIELDS)), $(BUILD_TRIPLET_FIELDS))) 148 + # Use the FLEXDIR environment variable to tell flexlink where the support 149 + # objects are located. Passing this location using -I would defeat the whole 150 + # purpose of the PATH-trick (bootstrapped flexlink is indistinguishable from 151 + # an installed flexlink). flexlink also looks for the objects in the same 152 + # directory as the executable, but this is slightly irritating as it requires 153 + # copying them to both byte/bin/ and opt/bin/ but also doesn't work if 154 + # opt/bin/flexlink.exe is a symlink to flexlink.opt.exe, as flexlink can end 155 + # up looking in the directory for the target of the symlink, rather than the 156 + # symlink itself. 157 + ifeq "" "$(filter pc-msys pc-cygwin%, $(BUILD_COMPANY_SYSTEM))" 158 + export FLEXDIR := $(REAL_ROOT_DIR) 159 + else 160 + export FLEXDIR := $(shell cygpath -w "$(REAL_ROOT_DIR)") 161 + endif 162 + undefine BUILD_TRIPLET_FIELDS 163 + undefine BUILD_COMPANY_SYSTEM 144 164 endif 145 165 undefine REAL_ROOT_DIR 146 - endif 166 + endif # ifeq "$(BOOTSTRAPPING_FLEXDLL)" "true" 147 167 148 168 # List of other libraries 149 169 ALL_OTHERLIBS = dynlink str systhreads unix runtime_events
+1 -2
Makefile.cross
··· 96 96 $(LN) flexlink.opt.exe flexlink.byte.exe 97 97 cp flexlink.byte.exe $(BYTE_BINDIR)/flexlink 98 98 cd $(BYTE_BINDIR) && $(LN) flexlink flexlink.exe 99 - cp $(addprefix $(FLEXDLL_SOURCE_DIR)/, $(FLEXDLL_OBJECTS)) $(BYTE_BINDIR) 99 + cp $(addprefix $(FLEXDLL_SOURCE_DIR)/, $(FLEXDLL_OBJECTS)) $(ROOTDIR) 100 100 cp flexlink.opt.exe $(OPT_BINDIR)/flexlink 101 101 cd $(OPT_BINDIR) && $(LN) flexlink flexlink.exe 102 - cp $(addprefix $(FLEXDLL_SOURCE_DIR)/, $(FLEXDLL_OBJECTS)) $(OPT_BINDIR) 103 102 104 103 INSTALL_OVERRIDES=build_ocamldoc=false WITH_DEBUGGER= OCAMLRUN=ocamlrun 105 104