]> git.karo-electronics.de Git - karo-tx-linux.git/blob - tools/perf/config/feature-tests.mak
Merge remote-tracking branch 'asoc/topic/core' into asoc-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_ELF_MMAP
47 #include <libelf.h>
48 int main(void)
49 {
50         Elf *elf = elf_begin(0, ELF_C_READ_MMAP, 0);
51         return (long)elf;
52 }
53 endef
54
55 ifndef NO_NEWT
56 define SOURCE_NEWT
57 #include <newt.h>
58
59 int main(void)
60 {
61         newtInit();
62         newtCls();
63         return newtFinished();
64 }
65 endef
66 endif
67
68 ifndef NO_GTK2
69 define SOURCE_GTK2
70 #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
71 #include <gtk/gtk.h>
72 #pragma GCC diagnostic error \"-Wstrict-prototypes\"
73
74 int main(int argc, char *argv[])
75 {
76         gtk_init(&argc, &argv);
77
78         return 0;
79 }
80 endef
81
82 define SOURCE_GTK2_INFOBAR
83 #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
84 #include <gtk/gtk.h>
85 #pragma GCC diagnostic error \"-Wstrict-prototypes\"
86
87 int main(void)
88 {
89         gtk_info_bar_new();
90
91         return 0;
92 }
93 endef
94 endif
95
96 ifndef NO_LIBPERL
97 define SOURCE_PERL_EMBED
98 #include <EXTERN.h>
99 #include <perl.h>
100
101 int main(void)
102 {
103 perl_alloc();
104 return 0;
105 }
106 endef
107 endif
108
109 ifndef NO_LIBPYTHON
110 define SOURCE_PYTHON_VERSION
111 #include <Python.h>
112 #if PY_VERSION_HEX >= 0x03000000
113         #error
114 #endif
115 int main(void){}
116 endef
117 define SOURCE_PYTHON_EMBED
118 #include <Python.h>
119 int main(void)
120 {
121         Py_Initialize();
122         return 0;
123 }
124 endef
125 endif
126
127 define SOURCE_BFD
128 #include <bfd.h>
129
130 int main(void)
131 {
132         bfd_demangle(0, 0, 0);
133         return 0;
134 }
135 endef
136
137 define SOURCE_CPLUS_DEMANGLE
138 extern char *cplus_demangle(const char *, int);
139
140 int main(void)
141 {
142         cplus_demangle(0, 0);
143         return 0;
144 }
145 endef
146
147 define SOURCE_STRLCPY
148 #include <stdlib.h>
149 extern size_t strlcpy(char *dest, const char *src, size_t size);
150
151 int main(void)
152 {
153         strlcpy(NULL, NULL, 0);
154         return 0;
155 }
156 endef
157
158 ifndef NO_LIBUNWIND
159 define SOURCE_LIBUNWIND
160 #include <libunwind.h>
161 #include <stdlib.h>
162
163 extern int UNW_OBJ(dwarf_search_unwind_table) (unw_addr_space_t as,
164                                       unw_word_t ip,
165                                       unw_dyn_info_t *di,
166                                       unw_proc_info_t *pi,
167                                       int need_unwind_info, void *arg);
168
169
170 #define dwarf_search_unwind_table UNW_OBJ(dwarf_search_unwind_table)
171
172 int main(void)
173 {
174         unw_addr_space_t addr_space;
175         addr_space = unw_create_addr_space(NULL, 0);
176         unw_init_remote(NULL, addr_space, NULL);
177         dwarf_search_unwind_table(addr_space, 0, NULL, NULL, 0, NULL);
178         return 0;
179 }
180 endef
181 endif
182
183 ifndef NO_BACKTRACE
184 define SOURCE_BACKTRACE
185 #include <execinfo.h>
186 #include <stdio.h>
187
188 int main(void)
189 {
190         backtrace(NULL, 0);
191         backtrace_symbols(NULL, 0);
192         return 0;
193 }
194 endef
195 endif
196
197 ifndef NO_LIBAUDIT
198 define SOURCE_LIBAUDIT
199 #include <libaudit.h>
200
201 int main(void)
202 {
203         return audit_open();
204 }
205 endef
206 endif