Debian Codegraph @

debian/tests/libxkbcommon-x11-dev

raw
1 #!/bin/sh
2 # Copyright 2020 Collabora Ltd.
3 # Copyright 2020 Simon McVittie
4 # SPDX-License-Identifier: MIT
5
6 set -eux
7
8 if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then
9 CROSS_COMPILE="$DEB_HOST_GNU_TYPE-"
10 CC="${CROSS_COMPILE}gcc"
11 PKG_CONFIG="${CROSS_COMPILE}pkg-config"
12 else
13 CROSS_COMPILE=
14 CC=cc
15 PKG_CONFIG=pkg-config
16 fi
17
18 cd "$AUTOPKGTEST_TMP"
19
20 cat > trivial.c <<EOF
21 #undef NDEBUG
22 #include <assert.h>
23
24 #include <xkbcommon/xkbcommon-x11.h>
25
26 int main (void)
27 {
28 int32_t (*func) (xcb_connection_t *) = xkb_x11_get_core_keyboard_device_id;
29 assert(func);
30 return 0;
31 }
32 EOF
33
34 # Deliberately word-splitting pkg-config's output:
35 # shellcheck disable=SC2046
36 "${CC}" -otrivial trivial.c $("${PKG_CONFIG}" --cflags --libs xkbcommon-x11)
37 ./trivial