File: build

package info (click to toggle)
libxcb 1.17.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,472 kB
  • sloc: sh: 4,592; ansic: 3,262; python: 2,520; makefile: 429; perl: 85
file content (40 lines) | stat: -rw-r--r-- 879 bytes parent folder | download | duplicates (3)
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
#!/bin/sh
# autopkgtest check: Build and run a program against libxcb,to verify that the
# headers and pkg-config file are installed correctly
# (C) 2013 Canonical Ltd.
# Author: Vibhav Pant <vibhavp@ubuntu.com>

set -e

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

WORKDIR=$(mktemp -d)
trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
cd $WORKDIR
cat <<EOF > libxcb_test.c
#include <xcb/xcb.h>
#include <stdio.h>
#include <assert.h>

int main(void)
{
	xcb_connection_t *c;

	c = xcb_connect(NULL, NULL);
	assert(xcb_connection_has_error(c) == 0);
	xcb_disconnect(c);

	printf("Test completed successfully\n");
	return 0;
}
EOF

${CROSS_COMPILE}gcc -o libxcb_test libxcb_test.c `${CROSS_COMPILE}pkg-config --cflags --libs xcb` -Wall -Werror
echo "build: OK"
[ -x libxcb_test ]
xvfb-run ./libxcb_test
echo "run: OK"