File: build

package info (click to toggle)
waffle 1.8.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,140 kB
  • sloc: ansic: 18,784; xml: 2,909; objc: 465; cpp: 267; sh: 125; makefile: 18
file content (44 lines) | stat: -rwxr-xr-x 797 bytes parent folder | download
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
#!/bin/sh
# Copyright © 2019-2023 Collabora Ltd.
# SPDX-License-Identifier: BSD-2-Clause
# (see debian/copyright)

# Check that the library can be linked by using pkgconf in the most
# obvious way.

set -e
set -u
set -x

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

CC="${CROSS_COMPILE}gcc"
PKG_CONFIG="${CROSS_COMPILE}pkgconf"

tempdir="$(mktemp -d)"
cd "$tempdir"

cat > trivial.c <<'EOF'
#undef NDEBUG
#include <assert.h>

#include <waffle.h>

int main (void)
{
  assert (waffle_enum_to_string (WAFFLE_DONT_CARE) != NULL);
  return 0;
}
EOF

# Deliberately word-splitting pkgconf output
# shellcheck disable=SC2046
"$CC" -o trivial trivial.c $("$PKG_CONFIG" --cflags --libs waffle-1)
test -x trivial
./trivial

rm -fr "$tempdir"