From b5e2e7003f5d628d1c9baef08e6f6ae8b43e2ee5 Mon Sep 17 00:00:00 2001 From: Dongdong Li Date: Sun, 21 Jul 2013 20:05:44 -0800 Subject: Review 69001: More support for setup environment 1. More general solution to get CC_VERSION, work for Linux(OpenSUSE, Ubuntu, Debian) and OSX 2. Add zsh support, change == to = to make it compatible with bash, zsh and sh 3. Fix a bug in Makefile [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 16640] --- version_detection.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'version_detection.mk') diff --git a/version_detection.mk b/version_detection.mk index 245f46f..7f7925c 100644 --- a/version_detection.mk +++ b/version_detection.mk @@ -38,7 +38,7 @@ CUDA_VERSION_STRING:=$(shell $(CUDA_INSTALL_PATH)/bin/nvcc --version | awk '/rel CUDART_VERSION:=$(shell echo $(CUDA_VERSION_STRING) | sed 's/\./ /' | awk '{printf("%02u%02u", 10*int($$1), 10*$$2);}') # Detect GCC Version -CC_VERSION := $(shell gcc --version | perl -ne '/gcc\s+\(.*\)\s+([0-9.]+)/ and print $$1;') +CC_VERSION := $(shell gcc --version | head -1 | awk '{for(i=1;i<=NF;i++){ if(match($$i,/[0-9]\.[0-9]\.[0-9]/)) {print $$i}}}') # Detect Support for C++11 (C++0x) from GCC Version GNUC_CPP0X := $(shell gcc --version | perl -ne 'if (/gcc\s+\(.*\)\s+([0-9.]+)/){ if($$1 >= 4.3) {$$n=1} else {$$n=0;} } END { print $$n; }') -- cgit v1.3