File tree 1 file changed +16
-7
lines changed 1 file changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -17,15 +17,24 @@ NETLIB_LAPACK_DIR = $(TOPDIR)/lapack-netlib
17
17
# http://stackoverflow.com/questions/4029274/mingw-and-make-variables
18
18
# - Default value is 'cc' which is not always a valid command (e.g. MinGW).
19
19
ifeq ($(origin CC),default)
20
+
21
+ # Check if $(CC) refers to a valid command and set the value to gcc if not
22
+ ifneq ($(findstring cmd.exe,$(SHELL)),)
23
+ ifeq ($(shell where $(CC) 2>NUL),)
20
24
CC = gcc
21
- # Change the default compile to clang on Mac OSX.
22
- # http://stackoverflow.com/questions/714100/os-detecting-makefile
23
- UNAME_S := $(shell uname -s)
24
- ifeq ($(UNAME_S),Darwin)
25
- CC = clang
26
- # EXTRALIB += -Wl,-no_compact_unwind
27
- endif
28
25
endif
26
+ else # POSIX-ish
27
+ ifeq ($(shell command -v $(CC) 2>/dev/null),)
28
+ ifeq ($(shell uname -s),Darwin)
29
+ CC = clang
30
+ # EXTRALIB += -Wl,-no_compact_unwind
31
+ else
32
+ CC = gcc
33
+ endif # Darwin
34
+ endif # CC exists
35
+ endif # Shell is sane
36
+
37
+ endif # CC is set to default
29
38
30
39
# Default Fortran compiler (FC) is selected by f_check.
31
40
You can’t perform that action at this time.
0 commit comments