Repository navigation
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·101 lines (90 loc) · 2.24 KB
/
Copy pathbuild.sh
File metadata and controls
executable file
·101 lines (90 loc) · 2.24 KB
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
#!/bin/bash
CC=gcc
PROTO_PREFIX=/usr/share/wayland-protocols
WLR_PROTO_PREFIX=/home/user/dev/labwc/subprojects/wlr-protocols
sources=(
src/client.c
src/allocators/common.c
src/allocators/gbm.c
src/allocators/shm.c
src/allocators/pool.c
src/backends/drm.c
src/interfaces/ext_capture.c
src/interfaces/ext_foreign_toplevel_list.c
src/interfaces/drm_lease.c
src/interfaces/wl_buffer.c
src/interfaces/wl_seat.c
src/interfaces/wl_surface.c
src/interfaces/wlr_layershell.c
src/interfaces/xdg_shell.c
src/renderers/simple.c
)
protocols=(
$PROTO_PREFIX/stable/linux-dmabuf/linux-dmabuf-v1.xml
$PROTO_PREFIX/stable/xdg-shell/xdg-shell.xml
$PROTO_PREFIX/staging/cursor-shape/cursor-shape-v1.xml
$PROTO_PREFIX/unstable/tablet/tablet-unstable-v2.xml # required by cursor-shape
$PROTO_PREFIX/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml
$PROTO_PREFIX/staging/ext-foreign-toplevel-list/ext-foreign-toplevel-list-v1.xml
$PROTO_PREFIX/staging/ext-image-copy-capture/ext-image-copy-capture-v1.xml
$PROTO_PREFIX/staging/ext-image-capture-source/ext-image-capture-source-v1.xml
$PROTO_PREFIX/staging/drm-lease/drm-lease-v1.xml
$WLR_PROTO_PREFIX/unstable/wlr-layer-shell-unstable-v1.xml
)
binaries=(
window
window_custom
window_animate
window_pointer
toplevel_list
toplevel_capture
panel
panel_animate
drm
drm_lease
)
includes=(
-I include/
-I /usr/include/drm/
-I build/protocols/
)
libs=(
-l wayland-client
-l drm
-l gbm
)
opts=(
#-std=c11
#-fsanitize=address,undefined
#-O2
)
if ! test -e "$WLR_PROTO_PREFIX"; then
echo "wlr-protocols not found, please adjust build.sh"
exit 1;
fi
mkdir -p build/protocols
# FIXME: replace the .xml part
for proto in "${protocols[@]}"; do
name=$(basename "$proto")
test -e build/protocols/"$name".h && continue;
wayland-scanner client-header "$proto" build/protocols/"$name".h
wayland-scanner private-code "$proto" build/protocols/"$name".c
done
for binary in "${binaries[@]}"; do
printf "build/%s.. " "$binary"
if $CC -Wall -g \
"${sources[@]}" \
src/examples/$binary.c \
build/protocols/*.c \
"${includes[@]}" \
"${libs[@]}" \
"${opts[@]}" \
-o build/$binary \
"$@"
then
echo "done";
else
echo "failed";
exit 1;
fi
done