aboutsummaryrefslogtreecommitdiffstats
path: root/tools/build
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2015-03-04 05:35:47 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-03-21 13:53:39 -0400
commit6c6f0f6164fbf7a1667378496ee36ae48c18a9d6 (patch)
treef7cbfd5ceaa05b16fbfd3e0db2392b447e62c579 /tools/build
parent00ae1127a03d20f5ef89f3c1fe7d4720270fc2a5 (diff)
tools build: Add feature check for lzma library
Will be used to decompress 'xz' objects. The check detects the liblzma.so devel library normally delivered by xz package. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Acked-by: Namhyung Kim <namhyung@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com>
Diffstat (limited to 'tools/build')
-rw-r--r--tools/build/Makefile.feature6
-rw-r--r--tools/build/feature/Makefile8
-rw-r--r--tools/build/feature/test-all.c5
-rw-r--r--tools/build/feature/test-lzma.c10
4 files changed, 25 insertions, 4 deletions
diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
index c6f44894d4a1..3a0b0ca2a28c 100644
--- a/tools/build/Makefile.feature
+++ b/tools/build/Makefile.feature
@@ -50,7 +50,8 @@ FEATURE_TESTS = \
50 stackprotector-all \ 50 stackprotector-all \
51 timerfd \ 51 timerfd \
52 libdw-dwarf-unwind \ 52 libdw-dwarf-unwind \
53 zlib 53 zlib \
54 lzma
54 55
55FEATURE_DISPLAY = \ 56FEATURE_DISPLAY = \
56 dwarf \ 57 dwarf \
@@ -65,7 +66,8 @@ FEATURE_DISPLAY = \
65 libslang \ 66 libslang \
66 libunwind \ 67 libunwind \
67 libdw-dwarf-unwind \ 68 libdw-dwarf-unwind \
68 zlib 69 zlib \
70 lzma
69 71
70# Set FEATURE_CHECK_(C|LD)FLAGS-all for all FEATURE_TESTS features. 72# Set FEATURE_CHECK_(C|LD)FLAGS-all for all FEATURE_TESTS features.
71# If in the future we need per-feature checks/flags for features not 73# If in the future we need per-feature checks/flags for features not
diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
index 0d694a94cda2..463ed8f2a267 100644
--- a/tools/build/feature/Makefile
+++ b/tools/build/feature/Makefile
@@ -32,7 +32,8 @@ FILES= \
32 test-libbabeltrace.bin \ 32 test-libbabeltrace.bin \
33 test-compile-32.bin \ 33 test-compile-32.bin \
34 test-compile-x32.bin \ 34 test-compile-x32.bin \
35 test-zlib.bin 35 test-zlib.bin \
36 test-lzma.bin
36 37
37CC := $(CROSS_COMPILE)gcc -MD 38CC := $(CROSS_COMPILE)gcc -MD
38PKG_CONFIG := $(CROSS_COMPILE)pkg-config 39PKG_CONFIG := $(CROSS_COMPILE)pkg-config
@@ -45,7 +46,7 @@ __BUILD = $(CC) $(CFLAGS) -Wall -Werror -o $(OUTPUT)$@ $(patsubst %.bin,%.c,$@)
45############################### 46###############################
46 47
47test-all.bin: 48test-all.bin:
48 $(BUILD) -fstack-protector-all -O2 -D_FORTIFY_SOURCE=2 -ldw -lelf -lnuma -lelf -laudit -I/usr/include/slang -lslang $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null) $(FLAGS_PERL_EMBED) $(FLAGS_PYTHON_EMBED) -DPACKAGE='"perf"' -lbfd -ldl -lz 49 $(BUILD) -fstack-protector-all -O2 -D_FORTIFY_SOURCE=2 -ldw -lelf -lnuma -lelf -laudit -I/usr/include/slang -lslang $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null) $(FLAGS_PERL_EMBED) $(FLAGS_PYTHON_EMBED) -DPACKAGE='"perf"' -lbfd -ldl -lz -llzma
49 50
50test-hello.bin: 51test-hello.bin:
51 $(BUILD) 52 $(BUILD)
@@ -152,6 +153,9 @@ test-compile-x32.bin:
152test-zlib.bin: 153test-zlib.bin:
153 $(BUILD) -lz 154 $(BUILD) -lz
154 155
156test-lzma.bin:
157 $(BUILD) -llzma
158
155-include *.d 159-include *.d
156 160
157############################### 161###############################
diff --git a/tools/build/feature/test-all.c b/tools/build/feature/test-all.c
index a61c20456705..84689a67814a 100644
--- a/tools/build/feature/test-all.c
+++ b/tools/build/feature/test-all.c
@@ -113,6 +113,10 @@
113#undef main 113#undef main
114#endif 114#endif
115 115
116#define main main_test_lzma
117# include "test-lzma.c"
118#undef main
119
116int main(int argc, char *argv[]) 120int main(int argc, char *argv[])
117{ 121{
118 main_test_libpython(); 122 main_test_libpython();
@@ -138,6 +142,7 @@ int main(int argc, char *argv[])
138 main_test_sync_compare_and_swap(argc, argv); 142 main_test_sync_compare_and_swap(argc, argv);
139 main_test_zlib(); 143 main_test_zlib();
140 main_test_pthread_attr_setaffinity_np(); 144 main_test_pthread_attr_setaffinity_np();
145 main_test_lzma();
141 146
142 return 0; 147 return 0;
143} 148}
diff --git a/tools/build/feature/test-lzma.c b/tools/build/feature/test-lzma.c
new file mode 100644
index 000000000000..95adc8ced3dd
--- /dev/null
+++ b/tools/build/feature/test-lzma.c
@@ -0,0 +1,10 @@
1#include <lzma.h>
2
3int main(void)
4{
5 lzma_stream strm = LZMA_STREAM_INIT;
6 int ret;
7
8 ret = lzma_stream_decoder(&strm, UINT64_MAX, LZMA_CONCATENATED);
9 return ret ? -1 : 0;
10}