File: build

package info (click to toggle)
json-glib 1.10.6%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,476 kB
  • sloc: ansic: 13,543; sh: 39; python: 28; makefile: 16; javascript: 5
file content (31 lines) | stat: -rwxr-xr-x 535 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
#!/bin/sh

set -e
set -u
exec 2>&1
set -x

cd "${AUTOPKGTEST_TMP}"

if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then
    CROSS_COMPILE="$DEB_HOST_GNU_TYPE-"
else
    CROSS_COMPILE=
fi

cat > trivial.c <<EOF
#include <errno.h>
#include <json-glib/json-glib.h>

int main (void)
{
    json_array_get_type ();
    return 0;
}
EOF

# Deliberately word-splitting, that's how pkg-config works:
# shellcheck disable=SC2046
"${CROSS_COMPILE}gcc" -o trivial trivial.c $("${CROSS_COMPILE}pkgconf" --cflags --libs json-glib-1.0)
test -x trivial
./trivial