Debian Codegraph @

debian/tests/build

raw
1 #!/bin/sh
2
3 set -e
4 set -u
5 exec 2>&1
6 set -x
7
8 cd "${AUTOPKGTEST_TMP}"
9
10 if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then
11 CROSS_COMPILE="$DEB_HOST_GNU_TYPE-"
12 else
13 CROSS_COMPILE=
14 fi
15
16 cat > trivial.c <<EOF
17 #include <errno.h>
18 #include <json-glib/json-glib.h>
19
20 int main (void)
21 {
22 json_array_get_type ();
23 return 0;
24 }
25 EOF
26
27 # Deliberately word-splitting, that's how pkg-config works:
28 # shellcheck disable=SC2046
29 "${CROSS_COMPILE}gcc" -o trivial trivial.c $("${CROSS_COMPILE}pkgconf" --cflags --libs json-glib-1.0)
30 test -x trivial
31 ./trivial