@@ -106,6 +106,9 @@ BUILD_LLDB = 0
106
106
# XC_HOST = i686-w64-mingw32
107
107
# XC_HOST = x86_64-w64-mingw32
108
108
109
+ # Figure out OS and architecture
110
+ BUILD_OS := $(shell uname )
111
+
109
112
ifeq ($(XC_HOST ), )
110
113
CROSS_COMPILE =
111
114
HOSTCC = $(CC )
@@ -115,8 +118,13 @@ override OPENBLAS_DYNAMIC_ARCH = 1
115
118
override CROSS_COMPILE = $(XC_HOST )-
116
119
ifneq (, $(findstring mingw , $(XC_HOST )))
117
120
override OS := WINNT
121
+ ifneq (, $(findstring CYGWIN , $(BUILD_OS )))
122
+ export STD_LIB_PATH := $(shell $(CROSS_COMPILE )gcc -print -search -dirs | grep programs | sed -e "s/^programs: =//" -e "s!/lib/!/bin/!g" )
123
+ export STD_LIB_PATH := $(STD_LIB_PATH ):$(shell $(CROSS_COMPILE )gcc -print -search -dirs | grep libraries | sed -e "s/^libraries: =//" -e "s!/lib/!/bin/!g" )
124
+ else
118
125
export STD_LIB_PATH := $(shell $(CROSS_COMPILE )gcc -print -search -dirs | grep programs | sed "s/^programs: =//" | xargs -d ":" winepath -w | tr '\n' ';' )
119
126
export STD_LIB_PATH := $(STD_LIB_PATH );$(shell $(CROSS_COMPILE )gcc -print -search -dirs | grep libraries | sed "s/^libraries: =//" | xargs -d ":" winepath -w | tr '\n' ';' )
127
+ endif
120
128
else
121
129
$(error "unknown XC_HOST variable set" )
122
130
endif
@@ -125,7 +133,6 @@ endif
125
133
JLDOWNLOAD = $(JULIAHOME )/deps /jldownload
126
134
127
135
# Figure out OS and architecture
128
- BUILD_OS := $(shell uname )
129
136
OS := $(BUILD_OS )
130
137
131
138
ifneq (, $(findstring MINGW , $(OS )))
@@ -367,7 +374,7 @@ LIBBLAS ?= -lblas
367
374
LIBBLASNAME ?= libblas
368
375
endif
369
376
else
370
- LIBBLAS = -L $(build_libdir ) -lopenblas
377
+ LIBBLAS = -L $(build_shlibdir ) -lopenblas
371
378
LIBBLASNAME = libopenblas
372
379
endif
373
380
@@ -381,7 +388,7 @@ ifeq ($(USE_SYSTEM_LAPACK), 1)
381
388
LIBLAPACK = -llapack
382
389
LIBLAPACKNAME = liblapack
383
390
else
384
- LIBLAPACK = -L $(build_libdir ) -llapack $(LIBBLAS )
391
+ LIBLAPACK = -L $(build_shlibdir ) -llapack $(LIBBLAS )
385
392
LIBLAPACKNAME = liblapack
386
393
endif
387
394
endif
@@ -572,6 +579,8 @@ endef
572
579
573
580
ifeq ($(BUILD_OS ), WINNT )
574
581
spawn = $(1 )
582
+ else ifneq (, $(findstring CYGWIN , $(BUILD_OS )))
583
+ spawn = $(1 )
575
584
else
576
585
ifeq ($(OS ), WINNT )
577
586
spawn = wine $(1 )
@@ -580,9 +589,19 @@ spawn = $(1)
580
589
endif
581
590
endif
582
591
592
+ ifneq (, $(findstring CYGWIN , $(BUILD_OS )))
593
+ cygpath_w = `cygpath -w $(1 )`
594
+ else
595
+ cygpath_w = $(1 )
596
+ endif
597
+
583
598
exec = $(shell $(call spawn , $(1 )))
584
599
600
+ ifneq (, $(findstring CYGWIN , $(BUILD_OS )))
601
+ wine_pathsearch = $(firstword $(wildcard $(addsuffix /$(1 ), $(subst :, , $(2 )))))
602
+ else
585
603
wine_pathsearch = $(firstword $(wildcard $(addsuffix /$(1 ), $(shell printf %s \n '$(2)' | xargs -d ";" winepath -u | tr '\n' ' ' ))))
604
+ endif
586
605
pathsearch = $(firstword $(wildcard $(addsuffix /$(1 ), $(subst :, , $(2 )))))
587
606
588
607
JULIA_EXECUTABLE_debug = $(build_bindir )/julia -debug -$(DEFAULT_REPL )$(EXE )
0 commit comments