@@ -126,11 +126,19 @@ endif
126126
127127# we include twice to pickup user definitions better
128128# include from JULIAHOME first so that BUILDROOT can override
129- ifeq (exists , $(shell [ -e $(JULIAHOME )/Make . user ] && echo exists ))
130- include $(JULIAHOME )/Make . user
129+ MAYBE_HOST :=
130+ ifneq ($(BUILDING_HOST_TOOLS ), 1 )
131+ MAKE_USER_FNAME = Make . user
132+ else
133+ MAYBE_HOST := /host
134+ MAKE_USER_FNAME = Make . host . user
135+ endif
136+
137+ ifeq (exists , $(shell [ -e $(JULIAHOME )/$(MAKE_USER_FNAME ) ] && echo exists ))
138+ include $(JULIAHOME )/$(MAKE_USER_FNAME )
131139endif
132- ifeq (exists , $(shell [ -e $(BUILDROOT )/Make . user ] && echo exists ))
133- include $(BUILDROOT )/Make . user
140+ ifeq (exists , $(shell [ -e $(BUILDROOT )/$( MAKE_USER_FNAME ) ] && echo exists ))
141+ include $(BUILDROOT )/$( MAKE_USER_FNAME )
134142endif
135143
136144# disable automatic Makefile rules
@@ -236,8 +244,12 @@ sysconfdir := $(prefix)/etc
236244endif
237245
238246# Directories where things get built into
239- build_prefix := $(BUILDROOT )/usr
247+ build_prefix := $(BUILDROOT )/usr $(MAYBE_HOST )
248+ ifeq ($(BUILDING_HOST_TOOLS ), 1 )
249+ build_staging := $(BUILDROOT )/usr -host -staging
250+ else
240251build_staging := $(build_prefix )-staging
252+ endif
241253build_bindir := $(build_prefix )/bin
242254build_depsbindir := $(build_prefix )/tools
243255build_libdir := $(build_prefix )/lib
@@ -571,11 +583,11 @@ else
571583LOCALBASE ?= /usr
572584endif
573585
574- ifeq (exists , $(shell [ -e $(JULIAHOME )/Make . user ] && echo exists ))
575- include $(JULIAHOME )/Make . user
586+ ifeq (exists , $(shell [ -e $(JULIAHOME )/$( MAKE_USER_FNAME ) ] && echo exists ))
587+ include $(JULIAHOME )/$( MAKE_USER_FNAME )
576588endif
577- ifeq (exists , $(shell [ -e $(BUILDROOT )/Make . user ] && echo exists ))
578- include $(BUILDROOT )/Make . user
589+ ifeq (exists , $(shell [ -e $(BUILDROOT )/$( MAKE_USER_FNAME ) ] && echo exists ))
590+ include $(BUILDROOT )/$( MAKE_USER_FNAME )
579591endif
580592
581593# A bit of a kludge to work around libraries linking to FreeBSD's outdated system libgcc_s
@@ -1064,7 +1076,7 @@ else ifneq ($(USEMSVC), 1)
10641076endif
10651077
10661078ifeq ($(OS ), Linux )
1067- OSLIBS += -Wl , --no -as -needed -ldl -lrt -lpthread -Wl , --export -dynamic , --as -needed , --no -whole -archive $( LIBUNWIND )
1079+ OSLIBS += -Wl , --no -as -needed -ldl -lrt -lpthread -Wl , --export -dynamic , --as -needed , --no -whole -archive
10681080# Detect if ifunc is supported
10691081IFUNC_DETECT_SRC := 'void (*f0(void))(void) { return (void(*)(void))0L; }; void f(void) __attribute__((ifunc("f0")));'
10701082ifeq (supported , $(shell echo $(IFUNC_DETECT_SRC ) | $(CC ) -Werror -x c - -S -o /dev /null > /dev /null 2 >&1 && echo supported ))
@@ -1103,8 +1115,6 @@ OSLIBS += -Wl,--export-dynamic -Wl,--version-script=$(JULIAHOME)/src/julia.expma
11031115endif
11041116
11051117ifeq ($(OS ), Darwin )
1106- INSTALL_NAME_CMD := install_name_tool -id $(INSTALL_NAME_ID_DIR )
1107- INSTALL_NAME_CHANGE_CMD := install_name_tool -change
11081118SHLIB_EXT := dylib
11091119OSLIBS += -framework CoreFoundation $(LIBUNWIND )
11101120WHOLE_ARCHIVE := -Xlinker -all_load
0 commit comments