···141141ifeq "$(filter $(REAL_ROOT_DIR)/$(BYTE_BINDIR), $(subst :, ,$(PATH)))" ""
142142 export PATH := \
143143 $(REAL_ROOT_DIR)/$(OPT_BINDIR):$(REAL_ROOT_DIR)/$(BYTE_BINDIR):$(PATH)
144144+ # $(BUILD_COMPANY_SYSTEM) is the last two parts of $(BUILD_TRIPLET)
145145+ BUILD_TRIPLET_FIELDS := $(subst -,$(SPACE),$(BUILD_TRIPLET))
146146+ BUILD_COMPANY_SYSTEM := $(subst $(SPACE),-,$\
147147+ $(wordlist 2, $(words $(BUILD_TRIPLET_FIELDS)), $(BUILD_TRIPLET_FIELDS)))
148148+ # Use the FLEXDIR environment variable to tell flexlink where the support
149149+ # objects are located. Passing this location using -I would defeat the whole
150150+ # purpose of the PATH-trick (bootstrapped flexlink is indistinguishable from
151151+ # an installed flexlink). flexlink also looks for the objects in the same
152152+ # directory as the executable, but this is slightly irritating as it requires
153153+ # copying them to both byte/bin/ and opt/bin/ but also doesn't work if
154154+ # opt/bin/flexlink.exe is a symlink to flexlink.opt.exe, as flexlink can end
155155+ # up looking in the directory for the target of the symlink, rather than the
156156+ # symlink itself.
157157+ifeq "" "$(filter pc-msys pc-cygwin%, $(BUILD_COMPANY_SYSTEM))"
158158+ export FLEXDIR := $(REAL_ROOT_DIR)
159159+else
160160+ export FLEXDIR := $(shell cygpath -w "$(REAL_ROOT_DIR)")
161161+endif
162162+ undefine BUILD_TRIPLET_FIELDS
163163+ undefine BUILD_COMPANY_SYSTEM
144164endif
145165 undefine REAL_ROOT_DIR
146146-endif
166166+endif # ifeq "$(BOOTSTRAPPING_FLEXDLL)" "true"
147167148168# List of other libraries
149169ALL_OTHERLIBS = dynlink str systhreads unix runtime_events