xref: /kvmtool/config/feature-tests.mak (revision 8f22adc4230f07980a318ad1662fba5af0c131c1)
1328a03bcSCyrill Gorcunovdefine SOURCE_HELLO
2328a03bcSCyrill Gorcunov#include <stdio.h>
3328a03bcSCyrill Gorcunovint main(void)
4328a03bcSCyrill Gorcunov{
5328a03bcSCyrill Gorcunov	return puts(\"hi\");
6328a03bcSCyrill Gorcunov}
7328a03bcSCyrill Gorcunovendef
8328a03bcSCyrill Gorcunov
9328a03bcSCyrill Gorcunovifndef NO_DWARF
10328a03bcSCyrill Gorcunovdefine SOURCE_DWARF
11328a03bcSCyrill Gorcunov#include <dwarf.h>
12328a03bcSCyrill Gorcunov#include <elfutils/libdw.h>
13328a03bcSCyrill Gorcunov#include <elfutils/version.h>
14328a03bcSCyrill Gorcunov#ifndef _ELFUTILS_PREREQ
15328a03bcSCyrill Gorcunov#error
16328a03bcSCyrill Gorcunov#endif
17328a03bcSCyrill Gorcunov
18328a03bcSCyrill Gorcunovint main(void)
19328a03bcSCyrill Gorcunov{
20328a03bcSCyrill Gorcunov	Dwarf *dbg = dwarf_begin(0, DWARF_C_READ);
21328a03bcSCyrill Gorcunov	return (long)dbg;
22328a03bcSCyrill Gorcunov}
23328a03bcSCyrill Gorcunovendef
24328a03bcSCyrill Gorcunovendif
25328a03bcSCyrill Gorcunov
26328a03bcSCyrill Gorcunovdefine SOURCE_LIBELF
27328a03bcSCyrill Gorcunov#include <libelf.h>
28328a03bcSCyrill Gorcunov
29328a03bcSCyrill Gorcunovint main(void)
30328a03bcSCyrill Gorcunov{
31328a03bcSCyrill Gorcunov	Elf *elf = elf_begin(0, ELF_C_READ, 0);
32328a03bcSCyrill Gorcunov	return (long)elf;
33328a03bcSCyrill Gorcunov}
34328a03bcSCyrill Gorcunovendef
35328a03bcSCyrill Gorcunov
36328a03bcSCyrill Gorcunovdefine SOURCE_GLIBC
37328a03bcSCyrill Gorcunov#include <gnu/libc-version.h>
38328a03bcSCyrill Gorcunov
39328a03bcSCyrill Gorcunovint main(void)
40328a03bcSCyrill Gorcunov{
41328a03bcSCyrill Gorcunov	const char *version = gnu_get_libc_version();
42328a03bcSCyrill Gorcunov	return (long)version;
43328a03bcSCyrill Gorcunov}
44328a03bcSCyrill Gorcunovendef
45328a03bcSCyrill Gorcunov
46328a03bcSCyrill Gorcunovdefine SOURCE_ELF_MMAP
47328a03bcSCyrill Gorcunov#include <libelf.h>
48328a03bcSCyrill Gorcunovint main(void)
49328a03bcSCyrill Gorcunov{
50328a03bcSCyrill Gorcunov	Elf *elf = elf_begin(0, ELF_C_READ_MMAP, 0);
51328a03bcSCyrill Gorcunov	return (long)elf;
52328a03bcSCyrill Gorcunov}
53328a03bcSCyrill Gorcunovendef
54328a03bcSCyrill Gorcunov
55328a03bcSCyrill Gorcunovifndef NO_NEWT
56328a03bcSCyrill Gorcunovdefine SOURCE_NEWT
57328a03bcSCyrill Gorcunov#include <newt.h>
58328a03bcSCyrill Gorcunov
59328a03bcSCyrill Gorcunovint main(void)
60328a03bcSCyrill Gorcunov{
61328a03bcSCyrill Gorcunov	newtInit();
62328a03bcSCyrill Gorcunov	newtCls();
63328a03bcSCyrill Gorcunov	return newtFinished();
64328a03bcSCyrill Gorcunov}
65328a03bcSCyrill Gorcunovendef
66328a03bcSCyrill Gorcunovendif
67328a03bcSCyrill Gorcunov
68328a03bcSCyrill Gorcunovifndef NO_LIBPERL
69328a03bcSCyrill Gorcunovdefine SOURCE_PERL_EMBED
70328a03bcSCyrill Gorcunov#include <EXTERN.h>
71328a03bcSCyrill Gorcunov#include <perl.h>
72328a03bcSCyrill Gorcunov
73328a03bcSCyrill Gorcunovint main(void)
74328a03bcSCyrill Gorcunov{
75328a03bcSCyrill Gorcunovperl_alloc();
76328a03bcSCyrill Gorcunovreturn 0;
77328a03bcSCyrill Gorcunov}
78328a03bcSCyrill Gorcunovendef
79328a03bcSCyrill Gorcunovendif
80328a03bcSCyrill Gorcunov
81328a03bcSCyrill Gorcunovifndef NO_LIBPYTHON
82328a03bcSCyrill Gorcunovdefine SOURCE_PYTHON_VERSION
83328a03bcSCyrill Gorcunov#include <Python.h>
84328a03bcSCyrill Gorcunov#if PY_VERSION_HEX >= 0x03000000
85328a03bcSCyrill Gorcunov	#error
86328a03bcSCyrill Gorcunov#endif
87328a03bcSCyrill Gorcunovint main(void){}
88328a03bcSCyrill Gorcunovendef
89328a03bcSCyrill Gorcunovdefine SOURCE_PYTHON_EMBED
90328a03bcSCyrill Gorcunov#include <Python.h>
91328a03bcSCyrill Gorcunovint main(void)
92328a03bcSCyrill Gorcunov{
93328a03bcSCyrill Gorcunov	Py_Initialize();
94328a03bcSCyrill Gorcunov	return 0;
95328a03bcSCyrill Gorcunov}
96328a03bcSCyrill Gorcunovendef
97328a03bcSCyrill Gorcunovendif
98328a03bcSCyrill Gorcunov
99328a03bcSCyrill Gorcunovdefine SOURCE_BFD
100328a03bcSCyrill Gorcunov#include <bfd.h>
101328a03bcSCyrill Gorcunov
102328a03bcSCyrill Gorcunovint main(void)
103328a03bcSCyrill Gorcunov{
104328a03bcSCyrill Gorcunov	bfd_demangle(0, 0, 0);
105328a03bcSCyrill Gorcunov	return 0;
106328a03bcSCyrill Gorcunov}
107328a03bcSCyrill Gorcunovendef
108328a03bcSCyrill Gorcunov
109328a03bcSCyrill Gorcunovdefine SOURCE_CPLUS_DEMANGLE
110328a03bcSCyrill Gorcunovextern char *cplus_demangle(const char *, int);
111328a03bcSCyrill Gorcunov
112328a03bcSCyrill Gorcunovint main(void)
113328a03bcSCyrill Gorcunov{
114328a03bcSCyrill Gorcunov	cplus_demangle(0, 0);
115328a03bcSCyrill Gorcunov	return 0;
116328a03bcSCyrill Gorcunov}
117328a03bcSCyrill Gorcunovendef
118328a03bcSCyrill Gorcunov
119328a03bcSCyrill Gorcunovdefine SOURCE_STRLCPY
120328a03bcSCyrill Gorcunov#include <stdlib.h>
121328a03bcSCyrill Gorcunovextern size_t strlcpy(char *dest, const char *src, size_t size);
122328a03bcSCyrill Gorcunov
123328a03bcSCyrill Gorcunovint main(void)
124328a03bcSCyrill Gorcunov{
125328a03bcSCyrill Gorcunov	strlcpy(NULL, NULL, 0);
126328a03bcSCyrill Gorcunov	return 0;
127328a03bcSCyrill Gorcunov}
128328a03bcSCyrill Gorcunovendef
1291e4ff24bSJohn Floren
1301e4ff24bSJohn Florendefine SOURCE_VNCSERVER
1311e4ff24bSJohn Floren#include <rfb/rfb.h>
1321e4ff24bSJohn Floren
1331e4ff24bSJohn Florenint main(void)
1341e4ff24bSJohn Floren{
1351e4ff24bSJohn Floren	rfbIsActive((void *)0);
1361e4ff24bSJohn Floren	return 0;
1371e4ff24bSJohn Floren}
1381e4ff24bSJohn Florenendef
1393f838fecSPekka Enberg
1403f838fecSPekka Enbergdefine SOURCE_SDL
1413f838fecSPekka Enberg#include <SDL/SDL.h>
1423f838fecSPekka Enberg
1433f838fecSPekka Enbergint main(void)
1443f838fecSPekka Enberg{
1453f838fecSPekka Enberg	SDL_Init(SDL_INIT_VIDEO);
1463f838fecSPekka Enberg	return 0;
1473f838fecSPekka Enberg}
1483f838fecSPekka Enbergendef
149af68c51aSLan Tianyu
150af68c51aSLan Tianyudefine SOURCE_ZLIB
151af68c51aSLan Tianyu#include <zlib.h>
152af68c51aSLan Tianyu
153af68c51aSLan Tianyuint main(void)
154af68c51aSLan Tianyu{
155af68c51aSLan Tianyu	inflateInit2(NULL, 0);
156af68c51aSLan Tianyu	return 0;
157af68c51aSLan Tianyu}
158af68c51aSLan Tianyuendef
1591664498dSSasha Levin
1601664498dSSasha Levindefine SOURCE_AIO
1611664498dSSasha Levin#include <libaio.h>
1621664498dSSasha Levin
1631664498dSSasha Levinint main(void)
1641664498dSSasha Levin{
1651664498dSSasha Levin	io_setup(0, NULL);
1661664498dSSasha Levin	return 0;
1671664498dSSasha Levin}
1681664498dSSasha Levinendef
1692c82d39aSCyrill Gorcunov
1702c82d39aSCyrill Gorcunovdefine SOURCE_STATIC
1712c82d39aSCyrill Gorcunov#include <stdlib.h>
1722c82d39aSCyrill Gorcunov
1732c82d39aSCyrill Gorcunovint main(void)
1742c82d39aSCyrill Gorcunov{
1752c82d39aSCyrill Gorcunov	return 0;
1762c82d39aSCyrill Gorcunov}
1772c82d39aSCyrill Gorcunovendef
1787bcceb95SPekka Enberg
1797bcceb95SPekka Enbergdefine SOURCE_GTK3
1807bcceb95SPekka Enberg#include <gtk/gtk.h>
1817bcceb95SPekka Enberg
1827bcceb95SPekka Enbergint main(void)
1837bcceb95SPekka Enberg{
1847bcceb95SPekka Enberg	gtk_main();
1857bcceb95SPekka Enberg
1867bcceb95SPekka Enberg	return 0;
1877bcceb95SPekka Enberg}
1887bcceb95SPekka Enbergendef
18920ecab30SAndre Przywara
19020ecab30SAndre Przywaradefine SOURCE_LIBFDT
19120ecab30SAndre Przywara#include <libfdt.h>
19220ecab30SAndre Przywara
19320ecab30SAndre Przywaraint main(void)
19420ecab30SAndre Przywara{
19520ecab30SAndre Przywara	fdt_check_header(NULL);
19620ecab30SAndre Przywara	return 0;
19720ecab30SAndre Przywara}
19820ecab30SAndre Przywaraendef
199*8f22adc4SAndre Przywara
200*8f22adc4SAndre Przywaradefine SOURCE_STRLCPY
201*8f22adc4SAndre Przywara#include <string.h>
202*8f22adc4SAndre Przywara
203*8f22adc4SAndre Przywaraint main(void)
204*8f22adc4SAndre Przywara{
205*8f22adc4SAndre Przywara	strlcpy(NULL, NULL, 0);
206*8f22adc4SAndre Przywara	return 0;
207*8f22adc4SAndre Przywara}
208*8f22adc4SAndre Przywaraendef
209