@@ -154,6 +154,9 @@ endif
154154# disable automatic Makefile rules
155155. SUFFIXES :
156156
157+ # dash `echo` is not well-behaved, so force bash
158+ SHELL = /bin /bash --posix
159+
157160# find out if git repository is available
158161ifeq ($(shell [ -e $(JULIAHOME )/. git ] && echo true || echo "Warning: git information unavailable; versioning information limited" >&2 ), true )
159162NO_GIT := 0
@@ -587,6 +590,12 @@ endif #USEMSVC
587590RANLIB := $(CROSS_COMPILE )ranlib
588591OBJCOPY := $(CROSS_COMPILE )objcopy
589592
593+ ifneq ($(USEMSVC ), 1 )
594+ CPP_STDOUT := $(CPP ) -P
595+ else
596+ CPP_STDOUT := $(CPP ) -E
597+ endif
598+
590599# file extensions
591600ifeq ($(OS ), WINNT )
592601 SHLIB_EXT := dll
@@ -1024,22 +1033,19 @@ JCPPFLAGS+=-DSYSTEM_LLVM
10241033endif # SYSTEM_LLVM
10251034
10261035# Windows builds need a little help finding the LLVM libraries for llvm-config
1027- LLVM_CONFIG_PATH_FIX :=
1028- ifeq ($(OS ), WINNT )
1029- LLVM_CONFIG_PATH_FIX := PATH = "$(build_bindir):$(PATH)"
1036+ # use delayed expansion (= not :=) because spawn isn't defined until later
1037+ LLVM_CONFIG_PATH_FIX =
1038+ ifeq ($(BUILD_OS ), WINNT )
1039+ LLVM_CONFIG_PATH_FIX = PATH = "$(build_bindir):$(PATH)"
1040+ else ifeq ($(OS ), WINNT )
1041+ LLVM_CONFIG_PATH_FIX = WINEPATH = "$(call cygpath_w,$(build_bindir));$(WINEPATH)"
10301042endif
10311043
10321044ifeq ($(BUILD_OS ), $(OS ))
10331045LLVM_CONFIG_HOST := $(LLVM_CONFIG )
10341046else
10351047LLVM_CONFIG_HOST := $(basename $(LLVM_CONFIG ))-host $(BUILD_EXE )
1036- ifeq (exists , $(shell [ -f '$(LLVM_CONFIG_HOST)' ] && echo exists ))
1037- ifeq ($(shell $(LLVM_CONFIG_PATH_FIX ) $(LLVM_CONFIG_HOST ) --version ), 3.3 )
1038- # llvm-config-host <= 3.3 is broken, use llvm-config instead (in an emulator)
1039- # use delayed expansion (= not :=) because spawn isn't defined until later
1040- LLVM_CONFIG_HOST = $(LLVM_CONFIG_PATH_FIX ) $(call spawn , $(LLVM_CONFIG ))
1041- endif
1042- else
1048+ ifneq (exists , $(shell [ -f '$(LLVM_CONFIG_HOST)' ] && echo exists ))
10431049# llvm-config-host does not exist (cmake build)
10441050LLVM_CONFIG_HOST = $(LLVM_CONFIG_PATH_FIX ) $(call spawn , $(LLVM_CONFIG ))
10451051endif
@@ -1570,6 +1576,7 @@ PRINT_FLISP = echo '$(subst ','\'',$(1))'; $(1)
15701576PRINT_JULIA = echo '$(subst ' , '\' ' , $(1 ))'; $(1)
15711577
15721578endif
1579+
15731580# Makefile debugging trick:
15741581# call print-VARIABLE to see the runtime value of any variable
15751582# (hardened against any special characters appearing in the output)
0 commit comments