File: sysroot.sh

package info (click to toggle)
pkgconf 2.5.1-3
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 2,900 kB
  • sloc: ansic: 8,117; sh: 6,689; makefile: 247; python: 157
file content (110 lines) | stat: -rwxr-xr-x 2,341 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/usr/bin/env atf-sh

. $(atf_get_srcdir)/test_env.sh

tests_init \
	cflags \
	variable \
	do_not_eat_slash \
	do_not_duplicate_sysroot_dir \
	uninstalled \
	uninstalled_pkgconf1 \
	uninstalled_fdo \
	uninstalled_fdo_pc_sysrootdir

do_not_eat_slash_body()
{
	export PKG_CONFIG_PATH="${selfdir}/lib1"
	export PKG_CONFIG_SYSROOT_DIR="/"
	atf_check \
		-o inline:"-fPIC -I/test/include/foo\n" \
		pkgconf --cflags baz
}

cflags_body()
{
	export PKG_CONFIG_PATH="${selfdir}/lib1"
	export PKG_CONFIG_SYSROOT_DIR="${SYSROOT_DIR}"
	atf_check \
		-o inline:"-fPIC -I${SYSROOT_DIR}/test/include/foo\n" \
		pkgconf --cflags baz
}

variable_body()
{
	export PKG_CONFIG_PATH="${selfdir}/lib1"
	export PKG_CONFIG_SYSROOT_DIR="${SYSROOT_DIR}"
	atf_check \
		-o inline:"${SYSROOT_DIR}/test\n" \
		pkgconf --variable=prefix foo
	atf_check \
		-o inline:"${SYSROOT_DIR}/test/include\n" \
		pkgconf --variable=includedir foo
}

do_not_duplicate_sysroot_dir_body()
{
	export PKG_CONFIG_PATH="${selfdir}/lib1"
	export PKG_CONFIG_SYSROOT_DIR="/sysroot"

	atf_check \
		-o inline:"-I/sysroot/usr/include\n" \
		pkgconf --cflags sysroot-dir-2

	atf_check \
		-o inline:"-I/sysroot/usr/include\n" \
		pkgconf --cflags sysroot-dir-3

	atf_check \
		-o inline:"-I/sysroot/usr/include\n" \
		pkgconf --cflags sysroot-dir-5

	export PKG_CONFIG_SYSROOT_DIR="${SYSROOT_DIR}"

	atf_check \
		-o inline:"-I${SYSROOT_DIR}/usr/include\n" \
		pkgconf --cflags sysroot-dir-4
}

uninstalled_body()
{
	export PKG_CONFIG_PATH="${selfdir}/lib1"
	export PKG_CONFIG_SYSROOT_DIR="/sysroot"

	atf_check \
		-o inline:"-L/test/lib -lomg\n" \
		pkgconf --libs omg
}

uninstalled_pkgconf1_body()
{
	export PKG_CONFIG_PATH="${selfdir}/lib1"
	export PKG_CONFIG_SYSROOT_DIR="/sysroot"
	export PKG_CONFIG_PKGCONF1_SYSROOT_RULES="1"

	atf_check \
		-o inline:"-L/sysroot/test/lib -lomg\n" \
		pkgconf --libs omg
}

uninstalled_fdo_body()
{
	export PKG_CONFIG_PATH="${selfdir}/lib1"
	export PKG_CONFIG_SYSROOT_DIR="/sysroot"
	export PKG_CONFIG_FDO_SYSROOT_RULES="1"

	atf_check \
		-o inline:"-L/test/lib -lomg\n" \
		pkgconf --libs omg
}

uninstalled_fdo_pc_sysrootdir_body()
{
	export PKG_CONFIG_PATH="${selfdir}/lib1"
	export PKG_CONFIG_SYSROOT_DIR="/sysroot"
	export PKG_CONFIG_FDO_SYSROOT_RULES="1"

	atf_check \
		-o inline:"-L/sysroot/test/lib -lomg\n" \
		pkgconf --libs omg-sysroot
}