diff options
author | Wang Nan <wangnan0@huawei.com> | 2016-09-26 07:26:56 +0000 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-10-05 19:59:35 -0300 |
commit | 87095f7ddeff3038a0cf8e6574922f9c11688619 (patch) | |
tree | 73eb2890678d20f32da70d5f373612e03bd6e509 /tools/build/feature/Makefile | |
parent | f61bdc3304281e9ff9eec4f1ed9fb15bcf4d8a5e (diff) | |
download | linux-stable-87095f7ddeff3038a0cf8e6574922f9c11688619.tar.gz linux-stable-87095f7ddeff3038a0cf8e6574922f9c11688619.tar.bz2 linux-stable-87095f7ddeff3038a0cf8e6574922f9c11688619.zip |
tools build: Add feature detection for g++
Check if g++ is available. The result will be used by builtin clang and
LLVM support. Since LLVM requires C++11, this feature detector checks
std::move().
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1474874832-134786-3-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/build/feature/Makefile')
-rw-r--r-- | tools/build/feature/Makefile | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile index a0b29a311816..ac9c477a2a48 100644 --- a/tools/build/feature/Makefile +++ b/tools/build/feature/Makefile @@ -46,11 +46,13 @@ FILES= \ test-lzma.bin \ test-bpf.bin \ test-get_cpuid.bin \ - test-sdt.bin + test-sdt.bin \ + test-cxx.bin FILES := $(addprefix $(OUTPUT),$(FILES)) CC := $(CROSS_COMPILE)gcc -MD +CXX := $(CROSS_COMPILE)g++ -MD PKG_CONFIG := $(CROSS_COMPILE)pkg-config all: $(FILES) @@ -58,6 +60,9 @@ all: $(FILES) __BUILD = $(CC) $(CFLAGS) -Wall -Werror -o $@ $(patsubst %.bin,%.c,$(@F)) $(LDFLAGS) BUILD = $(__BUILD) > $(@:.bin=.make.output) 2>&1 +__BUILDXX = $(CXX) $(CXXFLAGS) -Wall -Werror -o $@ $(patsubst %.bin,%.cpp,$(@F)) $(LDFLAGS) + BUILDXX = $(__BUILDXX) > $(@:.bin=.make.output) 2>&1 + ############################### $(OUTPUT)test-all.bin: @@ -217,6 +222,9 @@ $(OUTPUT)test-bpf.bin: $(OUTPUT)test-sdt.bin: $(BUILD) +$(OUTPUT)test-cxx.bin: + $(BUILDXX) -std=gnu++11 + -include $(OUTPUT)*.d ############################### |