Skip to content

Commit a641276

Browse files
committed
avoid '[[' bash-ism; strip potential arch from CC / CXX
1 parent 9f0938f commit a641276

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/Makevars

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
2-
PKG_CPPFLAGS += $(CXX1XSTD) -I../inst/include/
1+
# Calls to 'firstword' are used to strip out
2+
# a possible '-m64' attached to the CC variable
3+
# (or other compiler arguments)
4+
PKG_CPPFLAGS += $(CXX1XSTD) -I../inst/include/
35

46
ifeq ($(OS), Windows_NT)
57

68
USE_TBB=Windows
79
TBB_COPY_PATTERN=tbb*.dll
810

9-
MAKE_CMD = CONLY="$(CC)" CPLUS="$(CXX1X)" make
11+
MAKE_CMD = CONLY="$(firstword $(CC))" CPLUS="$(firstword $(CXX1X))" make
1012

1113
else
1214

@@ -70,9 +72,9 @@ all: tbb $(SHLIB)
7072
tbb:
7173
mkdir -p ../inst/lib/$(ARCH_DIR); \
7274
cd tbb/src; \
73-
if [[ "$(CC)" == clang* ]]; then \
75+
if [ -n "$(shell echo $(CC) | grep clang)" ]; then \
7476
$(MAKE_CMD) cpp0x=1 compiler=clang $(MAKE_ARGS); \
75-
elif [[ "$(CC)" == *gcc* ]]; then \
77+
elif [ -n "$(shell echo $(CC) | grep gcc)" ]; then \
7678
$(MAKE_CMD) cpp0x=1 compiler=gcc $(MAKE_ARGS); \
7779
else \
7880
$(MAKE_CMD) cpp0x=1 $(MAKE_ARGS); \

0 commit comments

Comments
 (0)