Arnaldo Carvalho de Melo | f9af3a4 | 2010-06-09 16:57:39 -0300 | [diff] [blame] | 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> |
Robert Morell | a711239 | 2010-11-16 14:16:33 -0800 | [diff] [blame] | 12 | #include <elfutils/libdw.h> |
| 13 | #include <elfutils/version.h> |
Arnaldo Carvalho de Melo | f9af3a4 | 2010-06-09 16:57:39 -0300 | [diff] [blame] | 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 | |
Irina Tirdea | d816ec2 | 2012-10-08 09:43:27 +0300 | [diff] [blame] | 46 | define SOURCE_BIONIC |
| 47 | #include <android/api-level.h> |
| 48 | |
| 49 | int main(void) |
| 50 | { |
| 51 | return __ANDROID_API__; |
| 52 | } |
| 53 | endef |
| 54 | |
Arnaldo Carvalho de Melo | f9af3a4 | 2010-06-09 16:57:39 -0300 | [diff] [blame] | 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 | |
Arnaldo Carvalho de Melo | 6692c26 | 2013-03-28 11:34:10 -0300 | [diff] [blame] | 64 | ifndef NO_SLANG |
| 65 | define SOURCE_SLANG |
| 66 | #include <slang.h> |
Arnaldo Carvalho de Melo | f9af3a4 | 2010-06-09 16:57:39 -0300 | [diff] [blame] | 67 | |
| 68 | int main(void) |
| 69 | { |
Arnaldo Carvalho de Melo | 6692c26 | 2013-03-28 11:34:10 -0300 | [diff] [blame] | 70 | return SLsmg_init_smg(); |
Arnaldo Carvalho de Melo | f9af3a4 | 2010-06-09 16:57:39 -0300 | [diff] [blame] | 71 | } |
| 72 | endef |
| 73 | endif |
| 74 | |
Pekka Enberg | c31a945 | 2012-03-19 15:13:29 -0300 | [diff] [blame] | 75 | ifndef NO_GTK2 |
| 76 | define SOURCE_GTK2 |
| 77 | #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" |
| 78 | #include <gtk/gtk.h> |
| 79 | #pragma GCC diagnostic error \"-Wstrict-prototypes\" |
| 80 | |
| 81 | int main(int argc, char *argv[]) |
| 82 | { |
| 83 | gtk_init(&argc, &argv); |
| 84 | |
| 85 | return 0; |
| 86 | } |
| 87 | endef |
Namhyung Kim | a6b702c | 2012-05-29 13:23:01 +0900 | [diff] [blame] | 88 | |
| 89 | define SOURCE_GTK2_INFOBAR |
| 90 | #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" |
| 91 | #include <gtk/gtk.h> |
| 92 | #pragma GCC diagnostic error \"-Wstrict-prototypes\" |
| 93 | |
| 94 | int main(void) |
| 95 | { |
| 96 | gtk_info_bar_new(); |
| 97 | |
| 98 | return 0; |
| 99 | } |
| 100 | endef |
Pekka Enberg | c31a945 | 2012-03-19 15:13:29 -0300 | [diff] [blame] | 101 | endif |
| 102 | |
Arnaldo Carvalho de Melo | f9af3a4 | 2010-06-09 16:57:39 -0300 | [diff] [blame] | 103 | ifndef NO_LIBPERL |
| 104 | define SOURCE_PERL_EMBED |
| 105 | #include <EXTERN.h> |
| 106 | #include <perl.h> |
| 107 | |
| 108 | int main(void) |
| 109 | { |
| 110 | perl_alloc(); |
| 111 | return 0; |
| 112 | } |
| 113 | endef |
| 114 | endif |
| 115 | |
| 116 | ifndef NO_LIBPYTHON |
Michael Witten | ced465c | 2011-04-02 21:46:09 +0000 | [diff] [blame] | 117 | define SOURCE_PYTHON_VERSION |
| 118 | #include <Python.h> |
| 119 | #if PY_VERSION_HEX >= 0x03000000 |
| 120 | #error |
| 121 | #endif |
Arnaldo Carvalho de Melo | feb8ada | 2012-10-09 15:15:25 -0300 | [diff] [blame] | 122 | int main(void) |
| 123 | { |
| 124 | return 0; |
| 125 | } |
Michael Witten | ced465c | 2011-04-02 21:46:09 +0000 | [diff] [blame] | 126 | endef |
Arnaldo Carvalho de Melo | f9af3a4 | 2010-06-09 16:57:39 -0300 | [diff] [blame] | 127 | define SOURCE_PYTHON_EMBED |
| 128 | #include <Python.h> |
Arnaldo Carvalho de Melo | f9af3a4 | 2010-06-09 16:57:39 -0300 | [diff] [blame] | 129 | int main(void) |
| 130 | { |
| 131 | Py_Initialize(); |
| 132 | return 0; |
| 133 | } |
| 134 | endef |
| 135 | endif |
| 136 | |
| 137 | define SOURCE_BFD |
| 138 | #include <bfd.h> |
| 139 | |
| 140 | int main(void) |
| 141 | { |
| 142 | bfd_demangle(0, 0, 0); |
| 143 | return 0; |
| 144 | } |
| 145 | endef |
| 146 | |
| 147 | define SOURCE_CPLUS_DEMANGLE |
| 148 | extern char *cplus_demangle(const char *, int); |
| 149 | |
| 150 | int main(void) |
| 151 | { |
| 152 | cplus_demangle(0, 0); |
| 153 | return 0; |
| 154 | } |
| 155 | endef |
| 156 | |
Kirill A. Shutemov | f4e7ac0 | 2010-08-21 03:38:20 +0300 | [diff] [blame] | 157 | define SOURCE_STRLCPY |
| 158 | #include <stdlib.h> |
| 159 | extern size_t strlcpy(char *dest, const char *src, size_t size); |
| 160 | |
| 161 | int main(void) |
| 162 | { |
| 163 | strlcpy(NULL, NULL, 0); |
| 164 | return 0; |
| 165 | } |
| 166 | endef |
Jiri Olsa | 6a40cd9 | 2012-08-07 15:20:44 +0200 | [diff] [blame] | 167 | |
| 168 | ifndef NO_LIBUNWIND |
| 169 | define SOURCE_LIBUNWIND |
| 170 | #include <libunwind.h> |
| 171 | #include <stdlib.h> |
| 172 | |
| 173 | extern int UNW_OBJ(dwarf_search_unwind_table) (unw_addr_space_t as, |
| 174 | unw_word_t ip, |
| 175 | unw_dyn_info_t *di, |
| 176 | unw_proc_info_t *pi, |
| 177 | int need_unwind_info, void *arg); |
| 178 | |
| 179 | |
| 180 | #define dwarf_search_unwind_table UNW_OBJ(dwarf_search_unwind_table) |
| 181 | |
| 182 | int main(void) |
| 183 | { |
| 184 | unw_addr_space_t addr_space; |
| 185 | addr_space = unw_create_addr_space(NULL, 0); |
| 186 | unw_init_remote(NULL, addr_space, NULL); |
| 187 | dwarf_search_unwind_table(addr_space, 0, NULL, NULL, 0, NULL); |
| 188 | return 0; |
| 189 | } |
| 190 | endef |
| 191 | endif |
Irina Tirdea | c9f08be | 2012-09-08 03:43:23 +0300 | [diff] [blame] | 192 | |
| 193 | ifndef NO_BACKTRACE |
| 194 | define SOURCE_BACKTRACE |
| 195 | #include <execinfo.h> |
| 196 | #include <stdio.h> |
| 197 | |
| 198 | int main(void) |
| 199 | { |
| 200 | backtrace(NULL, 0); |
| 201 | backtrace_symbols(NULL, 0); |
| 202 | return 0; |
| 203 | } |
| 204 | endef |
| 205 | endif |
Namhyung Kim | 4d29089 | 2012-09-27 20:23:38 +0900 | [diff] [blame] | 206 | |
| 207 | ifndef NO_LIBAUDIT |
| 208 | define SOURCE_LIBAUDIT |
| 209 | #include <libaudit.h> |
| 210 | |
| 211 | int main(void) |
| 212 | { |
| 213 | return audit_open(); |
| 214 | } |
| 215 | endef |
Bernhard Rosenkraenzer | 78da39f | 2012-10-08 09:43:26 +0300 | [diff] [blame] | 216 | endif |
| 217 | |
| 218 | define SOURCE_ON_EXIT |
| 219 | #include <stdio.h> |
| 220 | |
| 221 | int main(void) |
| 222 | { |
| 223 | return on_exit(NULL, NULL); |
| 224 | } |
| 225 | endef |
Peter Hurley | 79d824e | 2013-01-27 20:51:22 -0500 | [diff] [blame] | 226 | |
| 227 | define SOURCE_LIBNUMA |
| 228 | #include <numa.h> |
| 229 | #include <numaif.h> |
| 230 | |
| 231 | int main(void) |
| 232 | { |
| 233 | numa_available(); |
| 234 | return 0; |
| 235 | } |
Arnaldo Carvalho de Melo | 6692c26 | 2013-03-28 11:34:10 -0300 | [diff] [blame] | 236 | endef |