]> git.karo-electronics.de Git - karo-tx-linux.git/blob - tools/perf/config/feature-tests.mak
Merge remote-tracking branch 'arm/for-next'
[karo-tx-linux.git] / tools / perf / config / feature-tests.mak
1 define SOURCE_HELLO
2 #include <stdio.h>
3 int main(void)
4 {
5         return puts(\"hi\");
6 }
7 endef
8
9 ifndef NO_DWARF
10 define SOURCE_DWARF
11 #include <dwarf.h>
12 #include <elfutils/libdw.h>
13 #include <elfutils/version.h>
14 #ifndef _ELFUTILS_PREREQ
15 #error
16 #endif
17
18 int main(void)
19 {
20         Dwarf *dbg = dwarf_begin(0, DWARF_C_READ);
21         return (long)dbg;
22 }
23 endef
24 endif
25
26 define SOURCE_LIBELF
27 #include <libelf.h>
28
29 int main(void)
30 {
31         Elf *elf = elf_begin(0, ELF_C_READ, 0);
32         return (long)elf;
33 }
34 endef
35
36 define SOURCE_GLIBC
37 #include <gnu/libc-version.h>
38
39 int main(void)
40 {
41         const char *version = gnu_get_libc_version();
42         return (long)version;
43 }
44 endef
45
46 define SOURCE_BIONIC
47 #include <android/api-level.h>
48
49 int main(void)
50 {
51         return __ANDROID_API__;
52 }
53 endef
54
55 define SOURCE_ELF_MMAP
56 #include <libelf.h>
57 int main(void)
58 {
59         Elf *elf = elf_begin(0, ELF_C_READ_MMAP, 0);
60         return (long)elf;
61 }
62 endef
63
64 define SOURCE_ELF_GETPHDRNUM
65 #include <libelf.h>
66 int main(void)
67 {
68         size_t dst;
69         return elf_getphdrnum(0, &dst);
70 }
71 endef
72
73 ifndef NO_SLANG
74 define SOURCE_SLANG
75 #include <slang.h>
76
77 int main(void)
78 {
79         return SLsmg_init_smg();
80 }
81 endef
82 endif
83
84 ifndef NO_GTK2
85 define SOURCE_GTK2
86 #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
87 #include <gtk/gtk.h>
88 #pragma GCC diagnostic error \"-Wstrict-prototypes\"
89
90 int main(int argc, char *argv[])
91 {
92         gtk_init(&argc, &argv);
93
94         return 0;
95 }
96 endef
97
98 define SOURCE_GTK2_INFOBAR
99 #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
100 #include <gtk/gtk.h>
101 #pragma GCC diagnostic error \"-Wstrict-prototypes\"
102
103 int main(void)
104 {
105         gtk_info_bar_new();
106
107         return 0;
108 }
109 endef
110 endif
111
112 ifndef NO_LIBPERL
113 define SOURCE_PERL_EMBED
114 #include <EXTERN.h>
115 #include <perl.h>
116
117 int main(void)
118 {
119 perl_alloc();
120 return 0;
121 }
122 endef
123 endif
124
125 ifndef NO_LIBPYTHON
126 define SOURCE_PYTHON_VERSION
127 #include <Python.h>
128 #if PY_VERSION_HEX >= 0x03000000
129         #error
130 #endif
131 int main(void)
132 {
133         return 0;
134 }
135 endef
136 define SOURCE_PYTHON_EMBED
137 #include <Python.h>
138 int main(void)
139 {
140         Py_Initialize();
141         return 0;
142 }
143 endef
144 endif
145
146 define SOURCE_BFD
147 #include <bfd.h>
148
149 int main(void)
150 {
151         bfd_demangle(0, 0, 0);
152         return 0;
153 }
154 endef
155
156 define SOURCE_CPLUS_DEMANGLE
157 extern char *cplus_demangle(const char *, int);
158
159 int main(void)
160 {
161         cplus_demangle(0, 0);
162         return 0;
163 }
164 endef
165
166 define SOURCE_STRLCPY
167 #include <stdlib.h>
168 extern size_t strlcpy(char *dest, const char *src, size_t size);
169
170 int main(void)
171 {
172         strlcpy(NULL, NULL, 0);
173         return 0;
174 }
175 endef
176
177 ifndef NO_LIBUNWIND
178 define SOURCE_LIBUNWIND
179 #include <libunwind.h>
180 #include <stdlib.h>
181
182 extern int UNW_OBJ(dwarf_search_unwind_table) (unw_addr_space_t as,
183                                       unw_word_t ip,
184                                       unw_dyn_info_t *di,
185                                       unw_proc_info_t *pi,
186                                       int need_unwind_info, void *arg);
187
188 #define dwarf_search_unwind_table UNW_OBJ(dwarf_search_unwind_table)
189
190 int main(void)
191 {
192         unw_addr_space_t addr_space;
193         addr_space = unw_create_addr_space(NULL, 0);
194         unw_init_remote(NULL, addr_space, NULL);
195         dwarf_search_unwind_table(addr_space, 0, NULL, NULL, 0, NULL);
196         return 0;
197 }
198 endef
199
200 define SOURCE_LIBUNWIND_DEBUG_FRAME
201 #include <libunwind.h>
202 #include <stdlib.h>
203
204 extern int
205 UNW_OBJ(dwarf_find_debug_frame) (int found, unw_dyn_info_t *di_debug,
206                                  unw_word_t ip, unw_word_t segbase,
207                                  const char *obj_name, unw_word_t start,
208                                  unw_word_t end);
209
210 #define dwarf_find_debug_frame UNW_OBJ(dwarf_find_debug_frame)
211
212 int main(void)
213 {
214         dwarf_find_debug_frame(0, NULL, 0, 0, NULL, 0, 0);
215         return 0;
216 }
217 endef
218
219 endif
220
221 ifndef NO_BACKTRACE
222 define SOURCE_BACKTRACE
223 #include <execinfo.h>
224 #include <stdio.h>
225
226 int main(void)
227 {
228         backtrace(NULL, 0);
229         backtrace_symbols(NULL, 0);
230         return 0;
231 }
232 endef
233 endif
234
235 ifndef NO_LIBAUDIT
236 define SOURCE_LIBAUDIT
237 #include <libaudit.h>
238
239 int main(void)
240 {
241         printf(\"error message: %s\", audit_errno_to_name(0));
242         return audit_open();
243 }
244 endef
245 endif
246
247 define SOURCE_ON_EXIT
248 #include <stdio.h>
249
250 int main(void)
251 {
252         return on_exit(NULL, NULL);
253 }
254 endef
255
256 define SOURCE_LIBNUMA
257 #include <numa.h>
258 #include <numaif.h>
259
260 int main(void)
261 {
262         numa_available();
263         return 0;
264 }
265 endef